@wordpress/edit-site 6.10.0 → 6.11.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 (439) hide show
  1. package/CHANGELOG.md +2 -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 -0
  9. package/build/components/app/index.js.map +1 -1
  10. package/build/components/block-editor/use-editor-iframe-props.js +29 -20
  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 +23 -10
  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 +2 -2
  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 +2 -2
  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 +9 -10
  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 +7 -0
  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-sidebar/default-sidebar.js +0 -1
  53. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  54. package/build/components/global-styles-sidebar/index.js +43 -30
  55. package/build/components/global-styles-sidebar/index.js.map +1 -1
  56. package/build/components/layout/animation.js +1 -3
  57. package/build/components/layout/animation.js.map +1 -1
  58. package/build/components/layout/index.js +22 -35
  59. package/build/components/layout/index.js.map +1 -1
  60. package/build/components/layout/router.js +17 -140
  61. package/build/components/layout/router.js.map +1 -1
  62. package/build/components/page-patterns/delete-category-menu-item.js +3 -3
  63. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  64. package/build/components/page-patterns/use-pattern-settings.js +1 -1
  65. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  66. package/build/components/page-templates/index.js +1 -2
  67. package/build/components/page-templates/index.js.map +1 -1
  68. package/build/components/pagination/index.js +1 -1
  69. package/build/components/pagination/index.js.map +1 -1
  70. package/build/components/post-edit/index.js +8 -4
  71. package/build/components/post-edit/index.js.map +1 -1
  72. package/build/components/post-fields/index.js +6 -52
  73. package/build/components/post-fields/index.js.map +1 -1
  74. package/build/components/post-list/index.js +1 -1
  75. package/build/components/post-list/index.js.map +1 -1
  76. package/build/components/posts-app/index.js.map +1 -1
  77. package/build/components/posts-app/router.js +4 -4
  78. package/build/components/posts-app/router.js.map +1 -1
  79. package/build/components/resizable-frame/index.js +21 -9
  80. package/build/components/resizable-frame/index.js.map +1 -1
  81. package/build/components/revisions/index.js +1 -1
  82. package/build/components/revisions/index.js.map +1 -1
  83. package/build/components/save-keyboard-shortcut/index.js +78 -0
  84. package/build/components/save-keyboard-shortcut/index.js.map +1 -0
  85. package/build/components/save-panel/index.js +17 -6
  86. package/build/components/save-panel/index.js.map +1 -1
  87. package/build/components/sidebar-dataviews/default-views.js +2 -5
  88. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen/index.js +2 -1
  90. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  91. package/build/components/sidebar-navigation-screen-global-styles/index.js +30 -10
  92. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  94. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  95. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -3
  96. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  97. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
  98. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  99. package/build/components/site-editor-routes/home-edit.js +26 -0
  100. package/build/components/site-editor-routes/home-edit.js.map +1 -0
  101. package/build/components/site-editor-routes/home-view.js +25 -0
  102. package/build/components/site-editor-routes/home-view.js.map +1 -0
  103. package/build/components/site-editor-routes/index.js +49 -0
  104. package/build/components/site-editor-routes/index.js.map +1 -0
  105. package/build/components/site-editor-routes/navigation-edit.js +29 -0
  106. package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
  107. package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
  108. package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  109. package/build/components/site-editor-routes/navigation-item-view.js +30 -0
  110. package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
  111. package/build/components/site-editor-routes/navigation-view.js +28 -0
  112. package/build/components/site-editor-routes/navigation-view.js.map +1 -0
  113. package/build/components/site-editor-routes/pages-edit.js +43 -0
  114. package/build/components/site-editor-routes/pages-edit.js.map +1 -0
  115. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
  116. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  117. package/build/components/site-editor-routes/pages-list-view.js +47 -0
  118. package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
  119. package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
  120. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  121. package/build/components/site-editor-routes/pages-view.js +42 -0
  122. package/build/components/site-editor-routes/pages-view.js.map +1 -0
  123. package/build/components/site-editor-routes/patterns-edit.js +31 -0
  124. package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
  125. package/build/components/site-editor-routes/patterns-view.js +29 -0
  126. package/build/components/site-editor-routes/patterns-view.js.map +1 -0
  127. package/build/components/site-editor-routes/styles-edit.js +28 -0
  128. package/build/components/site-editor-routes/styles-edit.js.map +1 -0
  129. package/build/components/site-editor-routes/styles-view.js +27 -0
  130. package/build/components/site-editor-routes/styles-view.js.map +1 -0
  131. package/build/components/site-editor-routes/templates-edit.js +31 -0
  132. package/build/components/site-editor-routes/templates-edit.js.map +1 -0
  133. package/build/components/site-editor-routes/templates-list-view.js +34 -0
  134. package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
  135. package/build/components/site-editor-routes/templates-view.js +29 -0
  136. package/build/components/site-editor-routes/templates-view.js.map +1 -0
  137. package/build/components/site-hub/index.js +3 -2
  138. package/build/components/site-hub/index.js.map +1 -1
  139. package/build/components/style-book/color-examples.js +46 -0
  140. package/build/components/style-book/color-examples.js.map +1 -0
  141. package/build/components/style-book/constants.js +75 -10
  142. package/build/components/style-book/constants.js.map +1 -1
  143. package/build/components/style-book/duotone-examples.js +55 -0
  144. package/build/components/style-book/duotone-examples.js.map +1 -0
  145. package/build/components/style-book/examples.js +46 -3
  146. package/build/components/style-book/examples.js.map +1 -1
  147. package/build/components/style-book/index.js +92 -36
  148. package/build/components/style-book/index.js.map +1 -1
  149. package/build/components/style-book/types.js.map +1 -1
  150. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
  151. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  152. package/build/hooks/commands/use-common-commands.js +46 -30
  153. package/build/hooks/commands/use-common-commands.js.map +1 -1
  154. package/build/hooks/commands/use-edit-mode-commands.js +10 -6
  155. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  156. package/build/hooks/commands/use-set-command-context.js +12 -15
  157. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  158. package/build/store/private-actions.js +8 -60
  159. package/build/store/private-actions.js.map +1 -1
  160. package/build/store/private-selectors.js +4 -12
  161. package/build/store/private-selectors.js.map +1 -1
  162. package/build/store/reducer.js +9 -18
  163. package/build/store/reducer.js.map +1 -1
  164. package/build-module/components/add-new-post/index.js +1 -1
  165. package/build-module/components/add-new-post/index.js.map +1 -1
  166. package/build-module/components/add-new-template/index.js +1 -1
  167. package/build-module/components/add-new-template/index.js.map +1 -1
  168. package/build-module/components/add-new-template/utils.js +9 -9
  169. package/build-module/components/add-new-template/utils.js.map +1 -1
  170. package/build-module/components/app/index.js +4 -2
  171. package/build-module/components/app/index.js.map +1 -1
  172. package/build-module/components/block-editor/use-editor-iframe-props.js +30 -21
  173. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  174. package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
  175. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  176. package/build-module/components/editor/index.js +23 -10
  177. package/build-module/components/editor/index.js.map +1 -1
  178. package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
  179. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  180. package/build-module/components/editor/use-editor-title.js +3 -3
  181. package/build-module/components/editor/use-editor-title.js.map +1 -1
  182. package/build-module/components/global-styles/font-sizes/font-size.js +6 -6
  183. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  184. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -1
  185. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  186. package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -4
  187. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  188. package/build-module/components/global-styles/palette.js +17 -14
  189. package/build-module/components/global-styles/palette.js.map +1 -1
  190. package/build-module/components/global-styles/root-menu.js +0 -4
  191. package/build-module/components/global-styles/root-menu.js.map +1 -1
  192. package/build-module/components/global-styles/screen-block-list.js +0 -4
  193. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  194. package/build-module/components/global-styles/screen-css.js +1 -1
  195. package/build-module/components/global-styles/screen-css.js.map +1 -1
  196. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  197. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  198. package/build-module/components/global-styles/screen-root.js +0 -3
  199. package/build-module/components/global-styles/screen-root.js.map +1 -1
  200. package/build-module/components/global-styles/screen-style-variations.js +5 -1
  201. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  202. package/build-module/components/global-styles/shadows-edit-panel.js +9 -10
  203. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  204. package/build-module/components/global-styles/shadows-panel.js +0 -3
  205. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  206. package/build-module/components/global-styles/typography-elements.js +2 -5
  207. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  208. package/build-module/components/global-styles/ui.js +7 -0
  209. package/build-module/components/global-styles/ui.js.map +1 -1
  210. package/build-module/components/global-styles/variations/variation.js +3 -3
  211. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  212. package/build-module/components/global-styles/variations/variations-panel.js +0 -1
  213. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  214. package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -1
  215. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  216. package/build-module/components/global-styles-sidebar/index.js +44 -31
  217. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  218. package/build-module/components/layout/animation.js +1 -3
  219. package/build-module/components/layout/animation.js.map +1 -1
  220. package/build-module/components/layout/index.js +22 -35
  221. package/build-module/components/layout/index.js.map +1 -1
  222. package/build-module/components/layout/router.js +17 -139
  223. package/build-module/components/layout/router.js.map +1 -1
  224. package/build-module/components/page-patterns/delete-category-menu-item.js +4 -4
  225. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  226. package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
  227. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  228. package/build-module/components/page-templates/index.js +1 -2
  229. package/build-module/components/page-templates/index.js.map +1 -1
  230. package/build-module/components/pagination/index.js +1 -1
  231. package/build-module/components/pagination/index.js.map +1 -1
  232. package/build-module/components/post-edit/index.js +8 -4
  233. package/build-module/components/post-edit/index.js.map +1 -1
  234. package/build-module/components/post-fields/index.js +7 -51
  235. package/build-module/components/post-fields/index.js.map +1 -1
  236. package/build-module/components/post-list/index.js +1 -1
  237. package/build-module/components/post-list/index.js.map +1 -1
  238. package/build-module/components/posts-app/index.js +2 -2
  239. package/build-module/components/posts-app/index.js.map +1 -1
  240. package/build-module/components/posts-app/router.js +3 -3
  241. package/build-module/components/posts-app/router.js.map +1 -1
  242. package/build-module/components/resizable-frame/index.js +21 -10
  243. package/build-module/components/resizable-frame/index.js.map +1 -1
  244. package/build-module/components/revisions/index.js +1 -1
  245. package/build-module/components/revisions/index.js.map +1 -1
  246. package/build-module/components/save-keyboard-shortcut/index.js +71 -0
  247. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
  248. package/build-module/components/save-panel/index.js +17 -6
  249. package/build-module/components/save-panel/index.js.map +1 -1
  250. package/build-module/components/sidebar-dataviews/default-views.js +2 -5
  251. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  252. package/build-module/components/sidebar-navigation-screen/index.js +2 -1
  253. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  254. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +30 -10
  255. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  256. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  257. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  258. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  259. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
  261. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  262. package/build-module/components/site-editor-routes/home-edit.js +18 -0
  263. package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
  264. package/build-module/components/site-editor-routes/home-view.js +17 -0
  265. package/build-module/components/site-editor-routes/home-view.js.map +1 -0
  266. package/build-module/components/site-editor-routes/index.js +42 -0
  267. package/build-module/components/site-editor-routes/index.js.map +1 -0
  268. package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
  269. package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
  270. package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
  271. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  272. package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
  273. package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
  274. package/build-module/components/site-editor-routes/navigation-view.js +20 -0
  275. package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
  276. package/build-module/components/site-editor-routes/pages-edit.js +35 -0
  277. package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
  278. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  279. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  280. package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
  281. package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
  282. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  283. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  284. package/build-module/components/site-editor-routes/pages-view.js +34 -0
  285. package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
  286. package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
  287. package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
  288. package/build-module/components/site-editor-routes/patterns-view.js +21 -0
  289. package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
  290. package/build-module/components/site-editor-routes/styles-edit.js +20 -0
  291. package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
  292. package/build-module/components/site-editor-routes/styles-view.js +19 -0
  293. package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
  294. package/build-module/components/site-editor-routes/templates-edit.js +23 -0
  295. package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
  296. package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
  297. package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
  298. package/build-module/components/site-editor-routes/templates-view.js +21 -0
  299. package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
  300. package/build-module/components/site-hub/index.js +3 -2
  301. package/build-module/components/site-hub/index.js.map +1 -1
  302. package/build-module/components/style-book/color-examples.js +38 -0
  303. package/build-module/components/style-book/color-examples.js.map +1 -0
  304. package/build-module/components/style-book/constants.js +74 -9
  305. package/build-module/components/style-book/constants.js.map +1 -1
  306. package/build-module/components/style-book/duotone-examples.js +48 -0
  307. package/build-module/components/style-book/duotone-examples.js.map +1 -0
  308. package/build-module/components/style-book/examples.js +47 -3
  309. package/build-module/components/style-book/examples.js.map +1 -1
  310. package/build-module/components/style-book/index.js +94 -38
  311. package/build-module/components/style-book/index.js.map +1 -1
  312. package/build-module/components/style-book/types.js.map +1 -1
  313. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
  314. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  315. package/build-module/hooks/commands/use-common-commands.js +46 -30
  316. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  317. package/build-module/hooks/commands/use-edit-mode-commands.js +10 -6
  318. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  319. package/build-module/hooks/commands/use-set-command-context.js +12 -15
  320. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  321. package/build-module/store/private-actions.js +6 -58
  322. package/build-module/store/private-actions.js.map +1 -1
  323. package/build-module/store/private-selectors.js +3 -11
  324. package/build-module/store/private-selectors.js.map +1 -1
  325. package/build-module/store/reducer.js +9 -18
  326. package/build-module/store/reducer.js.map +1 -1
  327. package/build-style/posts-rtl.css +10 -13
  328. package/build-style/posts.css +10 -13
  329. package/build-style/style-rtl.css +127 -26
  330. package/build-style/style.css +127 -26
  331. package/package.json +43 -41
  332. package/src/components/add-new-post/index.js +1 -1
  333. package/src/components/add-new-template/index.js +1 -1
  334. package/src/components/add-new-template/utils.js +12 -9
  335. package/src/components/app/index.js +4 -2
  336. package/src/components/block-editor/use-editor-iframe-props.js +22 -18
  337. package/src/components/block-editor/use-site-editor-settings.js +12 -10
  338. package/src/components/editor/index.js +34 -13
  339. package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
  340. package/src/components/editor/use-editor-title.js +3 -3
  341. package/src/components/global-styles/font-sizes/font-size.js +11 -15
  342. package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
  343. package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
  344. package/src/components/global-styles/palette.js +21 -18
  345. package/src/components/global-styles/root-menu.js +3 -16
  346. package/src/components/global-styles/screen-block-list.js +0 -7
  347. package/src/components/global-styles/screen-css.js +1 -0
  348. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  349. package/src/components/global-styles/screen-root.js +3 -12
  350. package/src/components/global-styles/screen-style-variations.js +4 -1
  351. package/src/components/global-styles/shadows-edit-panel.js +12 -13
  352. package/src/components/global-styles/shadows-panel.js +0 -4
  353. package/src/components/global-styles/typography-elements.js +3 -11
  354. package/src/components/global-styles/ui.js +11 -0
  355. package/src/components/global-styles/variations/variation.js +3 -3
  356. package/src/components/global-styles/variations/variations-panel.js +0 -1
  357. package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
  358. package/src/components/global-styles-sidebar/index.js +86 -65
  359. package/src/components/global-styles-sidebar/style.scss +6 -0
  360. package/src/components/layout/animation.js +0 -1
  361. package/src/components/layout/index.js +16 -34
  362. package/src/components/layout/router.js +18 -133
  363. package/src/components/layout/style.scss +2 -2
  364. package/src/components/page-patterns/delete-category-menu-item.js +4 -4
  365. package/src/components/page-patterns/use-pattern-settings.js +1 -1
  366. package/src/components/page-templates/index.js +0 -1
  367. package/src/components/pagination/index.js +1 -1
  368. package/src/components/post-edit/index.js +35 -4
  369. package/src/components/post-fields/index.js +7 -54
  370. package/src/components/post-fields/style.scss +3 -0
  371. package/src/components/post-list/index.js +1 -1
  372. package/src/components/post-list/style.scss +1 -1
  373. package/src/components/posts-app/index.js +2 -2
  374. package/src/components/posts-app/router.js +3 -3
  375. package/src/components/resizable-frame/index.js +19 -10
  376. package/src/components/revisions/index.js +4 -1
  377. package/src/components/save-keyboard-shortcut/index.js +69 -0
  378. package/src/components/save-panel/index.js +30 -32
  379. package/src/components/sidebar-dataviews/default-views.js +2 -5
  380. package/src/components/sidebar-navigation-screen/index.js +2 -1
  381. package/src/components/sidebar-navigation-screen-global-styles/index.js +47 -29
  382. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  383. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  384. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
  385. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
  386. package/src/components/site-editor-routes/README.md +20 -0
  387. package/src/components/site-editor-routes/home-edit.js +17 -0
  388. package/src/components/site-editor-routes/home-view.js +16 -0
  389. package/src/components/site-editor-routes/index.js +60 -0
  390. package/src/components/site-editor-routes/navigation-edit.js +22 -0
  391. package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
  392. package/src/components/site-editor-routes/navigation-item-view.js +25 -0
  393. package/src/components/site-editor-routes/navigation-view.js +21 -0
  394. package/src/components/site-editor-routes/pages-edit.js +35 -0
  395. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  396. package/src/components/site-editor-routes/pages-list-view.js +44 -0
  397. package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  398. package/src/components/site-editor-routes/pages-view.js +39 -0
  399. package/src/components/site-editor-routes/patterns-edit.js +24 -0
  400. package/src/components/site-editor-routes/patterns-view.js +22 -0
  401. package/src/components/site-editor-routes/styles-edit.js +17 -0
  402. package/src/components/site-editor-routes/styles-view.js +16 -0
  403. package/src/components/site-editor-routes/templates-edit.js +22 -0
  404. package/src/components/site-editor-routes/templates-list-view.js +28 -0
  405. package/src/components/site-editor-routes/templates-view.js +22 -0
  406. package/src/components/site-hub/index.js +2 -2
  407. package/src/components/site-hub/style.scss +4 -0
  408. package/src/components/style-book/color-examples.tsx +44 -0
  409. package/src/components/style-book/constants.ts +83 -10
  410. package/src/components/style-book/duotone-examples.tsx +53 -0
  411. package/src/components/style-book/examples.tsx +113 -0
  412. package/src/components/style-book/index.js +149 -52
  413. package/src/components/style-book/style.scss +12 -14
  414. package/src/components/style-book/test/categories.js +0 -5
  415. package/src/components/style-book/types.ts +34 -1
  416. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +11 -1
  417. package/src/hooks/commands/use-common-commands.js +60 -40
  418. package/src/hooks/commands/use-edit-mode-commands.js +14 -18
  419. package/src/hooks/commands/use-set-command-context.js +7 -9
  420. package/src/store/private-actions.js +7 -79
  421. package/src/store/private-selectors.js +4 -11
  422. package/src/store/reducer.js +10 -18
  423. package/src/style.scss +3 -0
  424. package/build/components/keyboard-shortcuts/global.js +0 -53
  425. package/build/components/keyboard-shortcuts/global.js.map +0 -1
  426. package/build/components/keyboard-shortcuts/register.js +0 -34
  427. package/build/components/keyboard-shortcuts/register.js.map +0 -1
  428. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
  429. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  430. package/build-module/components/keyboard-shortcuts/global.js +0 -46
  431. package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
  432. package/build-module/components/keyboard-shortcuts/register.js +0 -27
  433. package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
  434. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
  435. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  436. package/src/components/keyboard-shortcuts/global.js +0 -47
  437. package/src/components/keyboard-shortcuts/register.js +0 -27
  438. package/src/components/style-book/examples.ts +0 -63
  439. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
@@ -9,6 +9,7 @@ import { useViewportMatch } from '@wordpress/compose';
9
9
  import { useCallback } from '@wordpress/element';
10
10
  import { store as editorStore } from '@wordpress/editor';
11
11
  import { store as preferencesStore } from '@wordpress/preferences';
12
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
12
13
 
13
14
  /**
14
15
  * Internal dependencies
@@ -23,13 +24,18 @@ import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-glob
23
24
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
24
25
  import SidebarNavigationScreenGlobalStylesContent from './content';
25
26
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
27
+ const {
28
+ useLocation,
29
+ useHistory
30
+ } = unlock(routerPrivateApis);
26
31
  export function SidebarNavigationItemGlobalStyles(props) {
27
32
  const {
28
33
  openGeneralSidebar
29
34
  } = useDispatch(editSiteStore);
35
+ const history = useHistory();
30
36
  const {
31
- setCanvasMode
32
- } = unlock(useDispatch(editSiteStore));
37
+ params
38
+ } = useLocation();
33
39
  const hasGlobalStyleVariations = useSelect(select => !!select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
34
40
  if (hasGlobalStyleVariations) {
35
41
  return /*#__PURE__*/_jsx(SidebarNavigationItem, {
@@ -44,7 +50,12 @@ export function SidebarNavigationItemGlobalStyles(props) {
44
50
  ...props,
45
51
  onClick: () => {
46
52
  // Switch to edit mode.
47
- setCanvasMode('edit');
53
+ history.push({
54
+ ...params,
55
+ canvas: 'edit'
56
+ }, undefined, {
57
+ transition: 'canvas-mode-edit-transition'
58
+ });
48
59
  // Open global styles sidebar.
49
60
  openGeneralSidebar('edit-site/global-styles');
50
61
  }
@@ -53,6 +64,13 @@ export function SidebarNavigationItemGlobalStyles(props) {
53
64
  export default function SidebarNavigationScreenGlobalStyles({
54
65
  backPath
55
66
  }) {
67
+ const history = useHistory();
68
+ const {
69
+ params
70
+ } = useLocation();
71
+ const {
72
+ canvas = 'view'
73
+ } = params;
56
74
  const {
57
75
  revisions,
58
76
  isLoading: isLoadingRevisions
@@ -65,17 +83,14 @@ export default function SidebarNavigationScreenGlobalStyles({
65
83
  } = useDispatch(editorStore);
66
84
  const isMobileViewport = useViewportMatch('medium', '<');
67
85
  const {
68
- setCanvasMode,
69
86
  setEditorCanvasContainerView
70
87
  } = unlock(useDispatch(editSiteStore));
71
88
  const {
72
- isViewMode,
73
89
  isStyleBookOpened,
74
90
  revisionsCount
75
91
  } = useSelect(select => {
76
92
  var _globalStyles$_links$;
77
93
  const {
78
- getCanvasMode,
79
94
  getEditorCanvasContainerView
80
95
  } = unlock(select(editSiteStore));
81
96
  const {
@@ -85,7 +100,6 @@ export default function SidebarNavigationScreenGlobalStyles({
85
100
  const globalStylesId = __experimentalGetCurrentGlobalStylesId();
86
101
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
87
102
  return {
88
- isViewMode: 'view' === getCanvasMode(),
89
103
  isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
90
104
  revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
91
105
  };
@@ -94,8 +108,14 @@ export default function SidebarNavigationScreenGlobalStyles({
94
108
  set: setPreference
95
109
  } = useDispatch(preferencesStore);
96
110
  const openGlobalStyles = useCallback(async () => {
97
- return Promise.all([setPreference('core', 'distractionFree', false), setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]);
98
- }, [setCanvasMode, openGeneralSidebar, setPreference]);
111
+ history.push({
112
+ ...params,
113
+ canvas: 'edit'
114
+ }, undefined, {
115
+ transition: 'canvas-mode-edit-transition'
116
+ });
117
+ return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
118
+ }, [history, params, openGeneralSidebar, setPreference]);
99
119
  const openStyleBook = useCallback(async () => {
100
120
  await openGlobalStyles();
101
121
  // Open the Style Book once the canvas mode is set to edit,
@@ -139,7 +159,7 @@ export default function SidebarNavigationScreenGlobalStyles({
139
159
  onClick: async () => await openGlobalStyles()
140
160
  })]
141
161
  })
142
- }), isStyleBookOpened && !isMobileViewport && isViewMode && /*#__PURE__*/_jsx(StyleBook, {
162
+ }), isStyleBookOpened && !isMobileViewport && canvas === 'view' && /*#__PURE__*/_jsx(StyleBook, {
143
163
  enableResizing: false,
144
164
  isSelected: () => false,
145
165
  onClick: openStyleBook,
@@ -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;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASP,KAAK,IAAIQ,aAAa,QAAQ,aAAa;AACpD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,wBAAwB,MAAM,+DAA+D;AACpG,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,OAAOC,0CAA0C,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnE,OAAO,SAASC,iCAAiCA,CAAEC,KAAK,EAAG;EAC1D,MAAM;IAAEC;EAAmB,CAAC,GAAGxB,WAAW,CAAES,aAAc,CAAC;EAC3D,MAAM;IAAEg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AG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAd,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,iBACtDzB,IAAA,CAACL,SAAS;MACTgE,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1B5C,OAAO,EAAG2B,aAAe;MACzBkB,QAAQ,EAAGlB,aAAe;MAC1BmB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","useViewportMatch","useCallback","editorStore","preferencesStore","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenGlobalStylesContent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","history","params","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","path","uid","onClick","push","canvas","undefined","transition","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_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';\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 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\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst history = useHistory();\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/>\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\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\t...params,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t\t{\n\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t}\n\t\t\t\t);\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 history = useHistory();\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\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 { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isStyleBookOpened, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEditorCanvasContainerView } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\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\tisStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),\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 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 && canvas === 'view' && (\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;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB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,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","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,mBAAm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"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,sBAAsB;AACzD,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASN,KAAK,IAAIO,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,CAAEL,SAAU,CAAC;EACvD,MAAM;IAAEe,mBAAmB;IAAEC;EAAkB,CAAC,GAC/CX,WAAW,CAAEC,YAAa,CAAC;EAC5B,MAAMW,OAAO,GAAGL,UAAU,CAAC,CAAC;EAE5B,MAAMM,YAAY,GAAG,MAAQC,cAAc,IAAM;IAChD,MAAMC,MAAM,GAAGD,cAAc,EAAEE,EAAE;IACjC,IAAI;MACH,MAAMP,kBAAkB,CACvB,UAAU,EACVL,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D;QACC5B,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAKyB,WAAW,EAAG;QAClBjC,mBAAmB,CAAEd,EAAE,CAAE,4BAA6B,CAAC,EAAE;UACxDuB,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;MACAF,EAAE,CAAE,2CAA4C,CAAC,EACjDyB,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,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\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AAA,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 } ) => {\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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,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,eAAe,QAAQ,aAAa;AACtD,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,sBAAsB,QAAQ,uBAAuB;AAC9D,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,2BAA2B,QAAQ,8BAA8B;AAC1E,SAASC,uBAAuB,QAAQ,yBAAyB;AAEjE,MAAMC,MAAM,GAAG,CACdF,2BAA2B,EAC3BD,kBAAkB,EAClBE,uBAAuB,EACvBJ,cAAc,EACdC,cAAc,EACdJ,kBAAkB,EAClBC,sBAAsB,EACtBC,kBAAkB,EAClBH,iBAAiB,EACjBD,iBAAiB,EACjBD,eAAe,EACfD,eAAe,EACfD,uBAAuB,EACvBD,uBAAuB,EACvBF,mBAAmB,EACnBC,mBAAmB,EACnBH,aAAa,EACbC,aAAa,CACb;AAED,OAAO,SAASkB,2BAA2BA,CAAA,EAAG;EAC7C,MAAMC,QAAQ,GAAG1B,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAE2B;EAAc,CAAC,GAAGxB,MAAM,CAAEF,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":[]}
@@ -0,0 +1,20 @@
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 navigationViewRoute = {
9
+ name: 'navigation-view',
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
+ }
19
+ };
20
+ //# sourceMappingURL=navigation-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAVIGATION_POST_TYPE","Editor","SidebarNavigationScreenNavigationMenus","jsx","_jsx","navigationViewRoute","name","match","params","postType","postId","canvas","areas","sidebar","backPath","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation-view.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 navigationViewRoute = {\n\tname: 'navigation-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: <SidebarNavigationScreenNavigationMenus backPath={ {} } />,\n\t\tpreview: <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;EACnB;AACD,CAAC","ignoreList":[]}