@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
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","_data","_coreData","_compose","_element","_editor","_preferences","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_sidebarNavigationItem","_styleBook","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_content","_jsxRuntime","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","useDispatch","editSiteStore","setCanvasMode","unlock","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","params","path","uid","onClick","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","setIsListViewOpened","editorStore","isMobileViewport","useViewportMatch","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","jsxs","Fragment","children","title","__","description","content","footer","record","actions","icon","seen","label","isPressed","edit","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\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AAK,EAAG,IAAAR,QAAE,EAAE,aAAc,CAAG;UAC7B1C,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAM4B,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAf,iBAAiB,IAAI,CAAEJ,gBAAgB,IAAIG,UAAU,iBACtD,IAAA/B,WAAA,CAAAc,GAAA,EAAClB,UAAA,CAAAmB,OAAS;MACTyD,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BtD,OAAO,EAAGgC,aAAe;MACzBuB,QAAQ,EAAGvB,aAAe;MAC1BwB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","_data","_coreData","_compose","_element","_editor","_preferences","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_sidebarNavigationItem","_styleBook","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_content","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","useDispatch","editSiteStore","history","params","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","path","uid","onClick","push","canvas","undefined","transition","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","setIsListViewOpened","editorStore","isMobileViewport","useViewportMatch","setEditorCanvasContainerView","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","jsxs","Fragment","children","title","__","description","content","footer","record","actions","icon","seen","label","isPressed","edit","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAA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YAAY,GACZb,SACJ,CACA;UACDiD,SAAS,EAAGpC;QAAmB,CAC/B,CACD,eACD,IAAAtC,WAAA,CAAAkB,GAAA,EAACxB,cAAA,CAAAyB,OAAa;UACboD,IAAI,EAAGI,WAAM;UACbF,KAAK,EAAG,IAAAR,QAAE,EAAE,aAAc,CAAG;UAC7B3C,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAM6B,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAb,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIX,MAAM,KAAK,MAAM,iBAC7D,IAAAxB,WAAA,CAAAkB,GAAA,EAACtB,UAAA,CAAAuB,OAAS;MACTyD,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BvD,OAAO,EAAGiC,aAAe;MACzBuB,QAAQ,EAAGvB,aAAe;MAC1BwB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -119,7 +119,7 @@ function useDuplicateNavigationMenu() {
119
119
  try {
120
120
  const savedRecord = await saveEntityRecord('postType', _.postType, {
121
121
  title: (0, _i18n.sprintf)(/* translators: %s: Navigation menu title */
122
- (0, _i18n.__)('%s (Copy)'), menuTitle),
122
+ (0, _i18n._x)('%s (Copy)', 'navigation menu'), menuTitle),
123
123
  content: navigationMenu?.content?.raw,
124
124
  status: 'publish'
125
125
  }, {
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_i18n","_data","_notices","_router","_","_constants","_lockUnlock","useHistory","unlock","routerPrivateApis","useDeleteNavigationMenu","deleteEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","history","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","__","type","push","error","sprintf","message","useSaveNavigationMenu","getEditedEntityRecord","useSelect","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","NAVIGATION_POST_TYPE","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","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":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,CAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAM;EAAEQ;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,SAASC,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EACvD,MAAM;IAAEC,mBAAmB;IAAEC;EAAkB,CAAC,GAC/C,IAAAH,iBAAW,EAAEI,cAAa,CAAC;EAC5B,MAAMC,OAAO,GAAGV,UAAU,CAAC,CAAC;EAE5B,MAAMW,YAAY,GAAG,MAAQC,cAAc,IAAM;IAChD,MAAMC,MAAM,GAAGD,cAAc,EAAEE,EAAE;IACjC,IAAI;MACH,MAAMV,kBAAkB,CACvB,UAAU,EACVW,UAAQ,EACRF,MAAM,EACN;QACCG,KAAK,EAAE;MACR,CAAC,EACD;QACCC,YAAY,EAAE;MACf,CACD,CAAC;MACDV,mBAAmB,CAClB,IAAAW,QAAE,EAAE,uCAAwC,CAAC,EAC7C;QACCC,IAAI,EAAE;MACP,CACD,CAAC;MACDT,OAAO,CAACU,IAAI,CAAE;QAAEL,QAAQ,EAAE;MAAgB,CAAE,CAAC;IAC9C,CAAC,CAAC,OAAQM,KAAK,EAAG;MACjBb,iBAAiB,CAChB,IAAAc,aAAO,EACN;MACA,I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rD;IACD,CAAC,CAAC,OAAQO,KAAK,EAAG;MACjBb,iBAAiB,CAChB,IAAAc,aAAO,EACN;MACA,IAAAJ,QAAE,EAAE,2CAA4C,CAAC,EACjDG,KAAK,EAAEE,OACR,CAAC,EAED;QACCJ,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOsB,eAAe;AACvB;AAEe,SAASS,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNvC,YAAY,EAAER,uBAAuB,CAAC,CAAC;IACvC6B,UAAU,EAAER,qBAAqB,CAAC,CAAC;IACnCiB,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_coreData","require","_i18n","_data","_notices","_router","_","_constants","_lockUnlock","useHistory","unlock","routerPrivateApis","useDeleteNavigationMenu","deleteEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","history","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","__","type","push","error","sprintf","message","useSaveNavigationMenu","getEditedEntityRecord","useSelect","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","NAVIGATION_POST_TYPE","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","_x","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.push( { postType: 'wp_navigation' } );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t_x( '%s (Copy)', 'navigation menu' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.push( { postType, postId: savedRecord.id } );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,CAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAM;EAAEQ;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAA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;EAAkB,CAAC,GAC/C,IAAAH,iBAAW,EAAEI,cAAa,CAAC;EAE5B,MAAMgC,eAAe,GAAG,MAAQ7B,cAAc,IAAM;IACnD,MAAM8B,SAAS,GACd9B,cAAc,EAAE+B,KAAK,EAAEC,QAAQ,IAAIhC,cAAc,EAAEiC,IAAI;IAExD,IAAI;MACH,MAAMC,WAAW,GAAG,MAAMN,gBAAgB,CACzC,UAAU,EACVzB,UAAQ,EACR;QACC4B,KAAK,EAAE,IAAArB,aAAO,EACb;QACA,IAAAyB,QAAE,EAAE,WAAW,EAAE,iBAAkB,CAAC,EACpCL,SACD,CAAC;QACDM,OAAO,EAAEpC,cAAc,EAAEoC,OAAO,EAAEC,GAAG;QACrCC,MAAM,EAAE;MACT,CAAC,EACD;QACCjC,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAK6B,WAAW,EAAG;QAClBvC,mBAAmB,CAAE,IAAAW,QAAE,EAAE,4BAA6B,CAAC,EAAE;UACxDC,IAAI,EAAE;QACP,CAAE,CAAC;QACHT,OAAO,CAACU,IAAI,CAAE;UAAEL,QAAQ,EAARA,UAAQ;UAAEF,MAAM,EAAEiC,WAAW,CAAChC;QAAG,CAAE,CAAC;MACrD;IACD,CAAC,CAAC,OAAQO,KAAK,EAAG;MACjBb,iBAAiB,CAChB,IAAAc,aAAO,EACN;MACA,IAAAJ,QAAE,EAAE,2CAA4C,CAAC,EACjDG,KAAK,EAAEE,OACR,CAAC,EAED;QACCJ,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOsB,eAAe;AACvB;AAEe,SAASU,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNxC,YAAY,EAAER,uBAAuB,CAAC,CAAC;IACvC6B,UAAU,EAAER,qBAAqB,CAAC,CAAC;IACnCiB,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
@@ -13,14 +13,14 @@ var _htmlEntities = require("@wordpress/html-entities");
13
13
  // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
14
14
  function buildNavigationLabel(title, id, status) {
15
15
  if (!title?.rendered) {
16
- /* translators: %s is the index of the menu in the list of menus. */
16
+ /* translators: %s: the index of the menu in the list of menus. */
17
17
  return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
18
18
  }
19
19
  if (status === 'publish') {
20
20
  return (0, _htmlEntities.decodeEntities)(title?.rendered);
21
21
  }
22
22
  return (0, _i18n.sprintf)(
23
- // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
24
- (0, _i18n.__)('%1$s (%2$s)'), (0, _htmlEntities.decodeEntities)(title?.rendered), status);
23
+ // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
24
+ (0, _i18n._x)('%1$s (%2$s)', 'menu label'), (0, _htmlEntities.decodeEntities)(title?.rendered), status);
25
25
  }
26
26
  //# sourceMappingURL=build-navigation-label.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_htmlEntities","buildNavigationLabel","title","id","status","rendered","sprintf","__","decodeEntities"],"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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACe,SAASE,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAO,IAAAC,aAAO,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC,EAAEJ,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAO,IAAAI,4BAAc,EAAEN,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAO,IAAAC,aAAO;EACb;EACA,IAAAC,QAAE,EAAE,aAAc,CAAC,EACnB,IAAAC,4BAAc,EAAEN,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_htmlEntities","buildNavigationLabel","title","id","status","rendered","sprintf","__","decodeEntities","_x"],"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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACe,SAASE,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAO,IAAAC,aAAO,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC,EAAEJ,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAO,IAAAI,4BAAc,EAAEN,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAO,IAAAC,aAAO;EACb;EACA,IAAAG,QAAE,EAAE,aAAa,EAAE,YAAa,CAAC,EACjC,IAAAD,4BAAc,EAAEN,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF","ignoreList":[]}
@@ -32,19 +32,16 @@ var _jsxRuntime = require("react/jsx-runtime");
32
32
  // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
33
33
  function buildMenuLabel(title, id, status) {
34
34
  if (!title) {
35
- /* translators: %s is the index of the menu in the list of menus. */
35
+ /* translators: %s: the index of the menu in the list of menus. */
36
36
  return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
37
37
  }
38
38
  if (status === 'publish') {
39
39
  return (0, _htmlEntities.decodeEntities)(title);
40
40
  }
41
41
  return (0, _i18n.sprintf)(
42
- // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
43
- (0, _i18n.__)('%1$s (%2$s)'), (0, _htmlEntities.decodeEntities)(title), status);
42
+ // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
43
+ (0, _i18n._x)('%1$s (%2$s)', 'menu label'), (0, _htmlEntities.decodeEntities)(title), status);
44
44
  }
45
-
46
- // Save a boolean to prevent us creating a fallback more than once per session.
47
- let hasCreatedFallback = false;
48
45
  function SidebarNavigationScreenNavigationMenus({
49
46
  backPath
50
47
  }) {
@@ -57,16 +54,14 @@ function SidebarNavigationScreenNavigationMenus({
57
54
  const {
58
55
  getNavigationFallbackId
59
56
  } = (0, _lockUnlock.unlock)((0, _data.useSelect)(_coreData.store));
57
+ const isCreatingNavigationFallback = (0, _data.useSelect)(select => select(_coreData.store).isResolving('getNavigationFallbackId'), []);
60
58
  const firstNavigationMenu = navigationMenus?.[0];
61
59
 
62
- // Save a boolean to prevent us creating a fallback more than once per session.
63
- if (firstNavigationMenu) {
64
- hasCreatedFallback = true;
65
- }
66
-
67
60
  // If there is no navigation menu found
68
61
  // then trigger fallback algorithm to create one.
69
- if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && !hasCreatedFallback) {
62
+ if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus &&
63
+ // Ensure a fallback navigation is created only once
64
+ !isCreatingNavigationFallback) {
70
65
  getNavigationFallbackId();
71
66
  }
72
67
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_link","_singleNavigationMenu","_useNavigationMenuHandlers","_lockUnlock","_constants2","_jsxRuntime","buildMenuLabel","title","id","status","sprintf","__","decodeEntities","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","useEntityRecords","NAVIGATION_POST_TYPE","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","unlock","useSelect","coreStore","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","hasNavigationMenus","length","jsx","SidebarNavigationScreenWrapper","children","Spinner","className","description","default","navigationMenu","edits","__experimentalItemGroup","map","index","NavMenuItem","postId","withChevron","icon","navigation","rendered","actions","content","props","linkInfo","useLink","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\n// Save a boolean to prevent us creating a fallback more than once per session.\nlet hasCreatedFallback = false;\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// Save a boolean to prevent us creating a fallback more than once per session.\n\tif ( firstNavigationMenu ) {\n\t\thasCreatedFallback = true;\n\t}\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t! hasCreatedFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,sBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,qBAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,0BAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA6D,IAAAe,WAAA,GAAAf,OAAA;AAxB7D;AACA;AACA;;AAYA;AACA;AACA;;AAUA;AACA,SAASgB,cAAcA,CAA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;QAAAd,QAAA,EAEjBjC,cAAc,CAAEC,KAAK,EAAE+C,QAAQ,EAAEN,KAAK,GAAG,CAAC,EAAEvC,MAAO;MAAC,GAJhDD,EAKM,CACZ;IAAC,CACO;EAAC,CACmB,CAAC;AAEnC;AAEO,SAAS8B,8BAA8BA,CAAE;EAC/CC,QAAQ;EACRgB,OAAO;EACPhD,KAAK;EACLmC,WAAW;EACX3B;AACD,CAAC,EAAG;EACH,oBACC,IAAAV,WAAA,CAAAgC,GAAA,EAACzC,wBAAA,CAAA+C,OAAuB;IACvBpC,KAAK,EAAGA,KAAK,IAAI,IAAAI,QAAE,EAAE,YAAa,CAAG;IACrC4C,OAAO,EAAGA,OAAS;IACnBb,WAAW,EAAGA,WAAW,IAAI,IAAA/B,QAAE,EAAE,+BAAgC,CAAG;IACpEI,QAAQ,EAAGA,QAAU;IACrByC,OAAO,EAAGjB;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMU,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGO;AAAM,CAAC,KAAM;EAC/C,MAAMC,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBT,MAAM;IACNU,QAAQ,EAAE;EACX,CAAE,CAAC;EACH,oBAAO,IAAAvD,WAAA,CAAAgC,GAAA,EAACvC,sBAAA,CAAA6C,OAAqB;IAAA,GAAMe,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_link","_singleNavigationMenu","_useNavigationMenuHandlers","_lockUnlock","_constants2","_jsxRuntime","buildMenuLabel","title","id","status","sprintf","__","decodeEntities","_x","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","useEntityRecords","NAVIGATION_POST_TYPE","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","unlock","useSelect","coreStore","isCreatingNavigationFallback","select","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","hasNavigationMenus","length","jsx","SidebarNavigationScreenWrapper","children","Spinner","className","description","default","navigationMenu","edits","__experimentalItemGroup","map","index","NavMenuItem","postId","withChevron","icon","navigation","rendered","actions","content","props","linkInfo","useLink","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\tconst isCreatingNavigationFallback = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).isResolving( 'getNavigationFallbackId' ),\n\t\t[]\n\t);\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t// Ensure a fallback navigation is created only once\n\t\t! isCreatingNavigationFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IA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GAAA,EAACzC,sBAAA,CAAA+C,OAAqB;IAAA,GAAMe,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.homeEditRoute = void 0;
8
+ var _editor = _interopRequireDefault(require("../editor"));
9
+ var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+
15
+ const homeEditRoute = exports.homeEditRoute = {
16
+ name: 'home-edit',
17
+ match: params => {
18
+ return params.canvas === 'edit';
19
+ },
20
+ areas: {
21
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
22
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
23
+ mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
24
+ }
25
+ };
26
+ //# sourceMappingURL=home-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenMain","_jsxRuntime","homeEditRoute","exports","name","match","params","canvas","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAJ5E;AACA;AACA;;AAIO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC5BE,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OAAOA,MAAM,CAACC,MAAM,KAAK,MAAM;EAChC,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAR,WAAA,CAAAS,GAAA,EAACV,4BAAA,CAAAW,OAA2B,IAAE,CAAC;IACxCC,OAAO,eAAE,IAAAX,WAAA,CAAAS,GAAA,EAACb,OAAA,CAAAc,OAAM,IAAE,CAAC;IACnBE,MAAM,eAAE,IAAAZ,WAAA,CAAAS,GAAA,EAACb,OAAA,CAAAc,OAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.homeViewRoute = void 0;
8
+ var _editor = _interopRequireDefault(require("../editor"));
9
+ var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+
15
+ const homeViewRoute = exports.homeViewRoute = {
16
+ name: 'home-view',
17
+ match: params => {
18
+ return params.canvas !== 'edit';
19
+ },
20
+ areas: {
21
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
22
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
23
+ }
24
+ };
25
+ //# sourceMappingURL=home-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenMain","_jsxRuntime","homeViewRoute","exports","name","match","params","canvas","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAJ5E;AACA;AACA;;AAIO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC5BE,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OAAOA,MAAM,CAACC,MAAM,KAAK,MAAM;EAChC,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAR,WAAA,CAAAS,GAAA,EAACV,4BAAA,CAAAW,OAA2B,IAAE,CAAC;IACxCC,OAAO,eAAE,IAAAX,WAAA,CAAAS,GAAA,EAACb,OAAA,CAAAc,OAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useRegisterSiteEditorRoutes = useRegisterSiteEditorRoutes;
7
+ var _data = require("@wordpress/data");
8
+ var _element = require("@wordpress/element");
9
+ var _lockUnlock = require("../../lock-unlock");
10
+ var _store = require("../../store");
11
+ var _homeView = require("./home-view");
12
+ var _homeEdit = require("./home-edit");
13
+ var _navigationView = require("./navigation-view");
14
+ var _navigationEdit = require("./navigation-edit");
15
+ var _navigationItemEdit = require("./navigation-item-edit");
16
+ var _navigationItemView = require("./navigation-item-view");
17
+ var _stylesEdit = require("./styles-edit");
18
+ var _stylesView = require("./styles-view");
19
+ var _patternsEdit = require("./patterns-edit");
20
+ var _patternsView = require("./patterns-view");
21
+ var _templatesEdit = require("./templates-edit");
22
+ var _templatesListView = require("./templates-list-view");
23
+ var _templatesView = require("./templates-view");
24
+ var _pagesView = require("./pages-view");
25
+ var _pagesEdit = require("./pages-edit");
26
+ var _pagesListView = require("./pages-list-view");
27
+ var _pagesListViewQuickEdit = require("./pages-list-view-quick-edit");
28
+ var _pagesViewQuickEdit = require("./pages-view-quick-edit");
29
+ /**
30
+ * WordPress dependencies
31
+ */
32
+
33
+ /**
34
+ * Internal dependencies
35
+ */
36
+
37
+ const routes = [_pagesListViewQuickEdit.pagesListViewQuickEditRoute, _pagesListView.pagesListViewRoute, _pagesViewQuickEdit.pagesViewQuickEditRoute, _pagesView.pagesViewRoute, _pagesEdit.pagesEditRoute, _templatesEdit.templatesEditRoute, _templatesListView.templatesListViewRoute, _templatesView.templatesViewRoute, _patternsView.patternsViewRoute, _patternsEdit.patternsEditRoute, _stylesView.stylesViewRoute, _stylesEdit.stylesEditRoute, _navigationItemView.navigationItemViewRoute, _navigationItemEdit.navigationItemEditRoute, _navigationView.navigationViewRoute, _navigationEdit.navigationEditRoute, _homeView.homeViewRoute, _homeEdit.homeEditRoute];
38
+ function useRegisterSiteEditorRoutes() {
39
+ const registry = (0, _data.useRegistry)();
40
+ const {
41
+ registerRoute
42
+ } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
43
+ (0, _element.useEffect)(() => {
44
+ registry.batch(() => {
45
+ routes.forEach(registerRoute);
46
+ });
47
+ }, [registry, registerRoute]);
48
+ }
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_element","_lockUnlock","_store","_homeView","_homeEdit","_navigationView","_navigationEdit","_navigationItemEdit","_navigationItemView","_stylesEdit","_stylesView","_patternsEdit","_patternsView","_templatesEdit","_templatesListView","_templatesView","_pagesView","_pagesEdit","_pagesListView","_pagesListViewQuickEdit","_pagesViewQuickEdit","routes","pagesListViewQuickEditRoute","pagesListViewRoute","pagesViewQuickEditRoute","pagesViewRoute","pagesEditRoute","templatesEditRoute","templatesListViewRoute","templatesViewRoute","patternsViewRoute","patternsEditRoute","stylesViewRoute","stylesEditRoute","navigationItemViewRoute","navigationItemEditRoute","navigationViewRoute","navigationEditRoute","homeViewRoute","homeEditRoute","useRegisterSiteEditorRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,cAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,cAAA,GAAAhB,OAAA;AACA,IAAAiB,UAAA,GAAAjB,OAAA;AACA,IAAAkB,UAAA,GAAAlB,OAAA;AACA,IAAAmB,cAAA,GAAAnB,OAAA;AACA,IAAAoB,uBAAA,GAAApB,OAAA;AACA,IAAAqB,mBAAA,GAAArB,OAAA;AA5BA;AACA;AACA;;AAIA;AACA;AACA;;AAsBA,MAAMsB,MAAM,GAAG,CACdC,mDAA2B,EAC3BC,iCAAkB,EAClBC,2CAAuB,EACvBC,yBAAc,EACdC,yBAAc,EACdC,iCAAkB,EAClBC,yCAAsB,EACtBC,iCAAkB,EAClBC,+BAAiB,EACjBC,+BAAiB,EACjBC,2BAAe,EACfC,2BAAe,EACfC,2CAAuB,EACvBC,2CAAuB,EACvBC,mCAAmB,EACnBC,mCAAmB,EACnBC,uBAAa,EACbC,uBAAa,CACb;AAEM,SAASC,2BAA2BA,CAAA,EAAG;EAC7C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrB3B,MAAM,CAAC4B,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.navigationEditRoute = void 0;
8
+ var _constants = require("../../utils/constants");
9
+ var _editor = _interopRequireDefault(require("../editor"));
10
+ var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+
16
+ const navigationEditRoute = exports.navigationEditRoute = {
17
+ name: 'navigation-edit',
18
+ match: params => {
19
+ return params.postType === _constants.NAVIGATION_POST_TYPE && !params.postId && params.canvas === 'edit';
20
+ },
21
+ areas: {
22
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
23
+ backPath: {}
24
+ }),
25
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
26
+ mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
27
+ }
28
+ };
29
+ //# sourceMappingURL=navigation-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_constants","require","_editor","_interopRequireDefault","_sidebarNavigationScreenNavigationMenus","_jsxRuntime","navigationEditRoute","exports","name","match","params","postType","NAVIGATION_POST_TYPE","postId","canvas","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uCAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAmG,IAAAI,WAAA,GAAAJ,OAAA;AALnG;AACA;AACA;;AAKO,MAAMK,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAClCE,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKC,+BAAoB,IACxC,CAAEF,MAAM,CAACG,MAAM,IACfH,MAAM,CAACI,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAX,WAAA,CAAAY,GAAA,EAACb,uCAAA,CAAAc,OAAsC;MAACC,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IACnEC,OAAO,eAAE,IAAAf,WAAA,CAAAY,GAAA,EAACf,OAAA,CAAAgB,OAAM,IAAE,CAAC;IACnBG,MAAM,eAAE,IAAAhB,WAAA,CAAAY,GAAA,EAACf,OAAA,CAAAgB,OAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.navigationItemEditRoute = void 0;
8
+ var _constants = require("../../utils/constants");
9
+ var _editor = _interopRequireDefault(require("../editor"));
10
+ var _sidebarNavigationScreenNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+
16
+ const navigationItemEditRoute = exports.navigationItemEditRoute = {
17
+ name: 'navigation-item-edit',
18
+ match: params => {
19
+ return params.postType === _constants.NAVIGATION_POST_TYPE && !!params.postId && params.canvas === 'edit';
20
+ },
21
+ areas: {
22
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenu.default, {
23
+ backPath: {
24
+ postType: _constants.NAVIGATION_POST_TYPE
25
+ }
26
+ }),
27
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
28
+ mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
29
+ }
30
+ };
31
+ //# sourceMappingURL=navigation-item-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_constants","require","_editor","_interopRequireDefault","_sidebarNavigationScreenNavigationMenu","_jsxRuntime","navigationItemEditRoute","exports","name","match","params","postType","NAVIGATION_POST_TYPE","postId","canvas","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,sCAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAiG,IAAAI,WAAA,GAAAJ,OAAA;AALjG;AACA;AACA;;AAKO,MAAMK,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACtCE,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKC,+BAAoB,IACxC,CAAC,CAAEF,MAAM,CAACG,MAAM,IAChBH,MAAM,CAACI,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eACN,IAAAX,WAAA,CAAAY,GAAA,EAACb,sCAAA,CAAAc,OAAqC;MACrCC,QAAQ,EAAG;QAAER,QAAQ,EAAEC;MAAqB;IAAG,CAC/C,CACD;IACDQ,OAAO,eAAE,IAAAf,WAAA,CAAAY,GAAA,EAACf,OAAA,CAAAgB,OAAM,IAAE,CAAC;IACnBG,MAAM,eAAE,IAAAhB,WAAA,CAAAY,GAAA,EAACf,OAAA,CAAAgB,OAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.navigationItemViewRoute = void 0;
8
+ var _constants = require("../../utils/constants");
9
+ var _editor = _interopRequireDefault(require("../editor"));
10
+ var _sidebarNavigationScreenNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+
16
+ const navigationItemViewRoute = exports.navigationItemViewRoute = {
17
+ name: 'navigation-item-view',
18
+ match: params => {
19
+ return params.postType === _constants.NAVIGATION_POST_TYPE && !!params.postId && params.canvas !== 'edit';
20
+ },
21
+ areas: {
22
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenu.default, {
23
+ backPath: {
24
+ postType: _constants.NAVIGATION_POST_TYPE
25
+ }
26
+ }),
27
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
28
+ }
29
+ };
30
+ //# sourceMappingURL=navigation-item-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_constants","require","_editor","_interopRequireDefault","_sidebarNavigationScreenNavigationMenu","_jsxRuntime","navigationItemViewRoute","exports","name","match","params","postType","NAVIGATION_POST_TYPE","postId","canvas","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,sCAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAiG,IAAAI,WAAA,GAAAJ,OAAA;AALjG;AACA;AACA;;AAKO,MAAMK,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACtCE,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKC,+BAAoB,IACxC,CAAC,CAAEF,MAAM,CAACG,MAAM,IAChBH,MAAM,CAACI,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eACN,IAAAX,WAAA,CAAAY,GAAA,EAACb,sCAAA,CAAAc,OAAqC;MACrCC,QAAQ,EAAG;QAAER,QAAQ,EAAEC;MAAqB;IAAG,CAC/C,CACD;IACDQ,OAAO,eAAE,IAAAf,WAAA,CAAAY,GAAA,EAACf,OAAA,CAAAgB,OAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.navigationViewRoute = void 0;
8
+ var _constants = require("../../utils/constants");
9
+ var _editor = _interopRequireDefault(require("../editor"));
10
+ var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+
16
+ const navigationViewRoute = exports.navigationViewRoute = {
17
+ name: 'navigation-view',
18
+ match: params => {
19
+ return params.postType === _constants.NAVIGATION_POST_TYPE && !params.postId && params.canvas !== 'edit';
20
+ },
21
+ areas: {
22
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
23
+ backPath: {}
24
+ }),
25
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
26
+ }
27
+ };
28
+ //# sourceMappingURL=navigation-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_constants","require","_editor","_interopRequireDefault","_sidebarNavigationScreenNavigationMenus","_jsxRuntime","navigationViewRoute","exports","name","match","params","postType","NAVIGATION_POST_TYPE","postId","canvas","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uCAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAmG,IAAAI,WAAA,GAAAJ,OAAA;AALnG;AACA;AACA;;AAKO,MAAMK,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAClCE,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKC,+BAAoB,IACxC,CAAEF,MAAM,CAACG,MAAM,IACfH,MAAM,CAACI,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAX,WAAA,CAAAY,GAAA,EAACb,uCAAA,CAAAc,OAAsC;MAACC,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IACnEC,OAAO,eAAE,IAAAf,WAAA,CAAAY,GAAA,EAACf,OAAA,CAAAgB,OAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.pagesEditRoute = void 0;
8
+ var _i18n = require("@wordpress/i18n");
9
+ var _postList = _interopRequireDefault(require("../post-list"));
10
+ var _sidebarDataviews = _interopRequireDefault(require("../sidebar-dataviews"));
11
+ var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
12
+ var _editor = _interopRequireDefault(require("../editor"));
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ function PageList() {
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_postList.default, {
24
+ postType: "page"
25
+ });
26
+ }
27
+ const pagesEditRoute = exports.pagesEditRoute = {
28
+ name: 'pages-edit',
29
+ match: params => {
30
+ return params.postType === 'page' && params.canvas === 'edit';
31
+ },
32
+ areas: {
33
+ sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreen.default, {
34
+ title: (0, _i18n.__)('Pages'),
35
+ backPath: {},
36
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarDataviews.default, {})
37
+ }),
38
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageList, {}),
39
+ mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
40
+ preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
41
+ }
42
+ };
43
+ //# sourceMappingURL=pages-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_i18n","require","_postList","_interopRequireDefault","_sidebarDataviews","_sidebarNavigationScreen","_editor","_jsxRuntime","PageList","jsx","default","postType","pagesEditRoute","exports","name","match","params","canvas","areas","sidebar","title","__","backPath","content","mobile","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/pages-edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PostList from '../post-list';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport Editor from '../editor';\n\nfunction PageList() {\n\treturn <PostList postType=\"page\" />;\n}\n\nexport const pagesEditRoute = {\n\tname: 'pages-edit',\n\tmatch: ( params ) => {\n\t\treturn params.postType === 'page' && params.canvas === 'edit';\n\t},\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tbackPath={ {} }\n\t\t\t\tcontent={ <DataViewsSidebarContent /> }\n\t\t\t/>\n\t\t),\n\t\tcontent: <PageList />,\n\t\tmobile: <Editor />,\n\t\tpreview: <Editor />,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,wBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAH,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