@wordpress/edit-site 5.33.0 → 5.35.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 (543) hide show
  1. package/CHANGELOG.md +11 -3
  2. package/build/components/add-new-page/index.js +3 -0
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +8 -7
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +2 -2
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/app/index.js +4 -2
  13. package/build/components/app/index.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +4 -18
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/resize-handle.js +20 -5
  17. package/build/components/block-editor/resize-handle.js.map +1 -1
  18. package/build/components/block-editor/site-editor-canvas.js +2 -2
  19. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  20. package/build/components/create-template-part-modal/index.js +3 -0
  21. package/build/components/create-template-part-modal/index.js.map +1 -1
  22. package/build/components/dataviews-actions/index.js +46 -0
  23. package/build/components/dataviews-actions/index.js.map +1 -0
  24. package/build/components/editor/index.js +95 -16
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/global-styles/background-panel.js +13 -1
  27. package/build/components/global-styles/background-panel.js.map +1 -1
  28. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  29. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  30. package/build/components/global-styles/color-palette-panel.js +5 -2
  31. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/context.js +9 -3
  33. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/font-collection.js +7 -2
  35. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  37. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  38. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  39. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  40. package/build/components/global-styles/gradients-palette-panel.js +1 -2
  41. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  42. package/build/components/global-styles/hooks.js +5 -2
  43. package/build/components/global-styles/hooks.js.map +1 -1
  44. package/build/components/global-styles/icon-with-current-color.js +2 -2
  45. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  46. package/build/components/global-styles/preset-colors.js +29 -0
  47. package/build/components/global-styles/preset-colors.js.map +1 -0
  48. package/build/components/global-styles/preview-colors.js +3 -7
  49. package/build/components/global-styles/preview-colors.js.map +1 -1
  50. package/build/components/global-styles/screen-color-palette.js +5 -5
  51. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  52. package/build/components/global-styles/screen-colors.js +1 -4
  53. package/build/components/global-styles/screen-colors.js.map +1 -1
  54. package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  55. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  56. package/build/components/global-styles/style-variations-container.js +8 -2
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typography-example.js +5 -2
  59. package/build/components/global-styles/typography-example.js.map +1 -1
  60. package/build/components/global-styles/ui.js +4 -1
  61. package/build/components/global-styles/ui.js.map +1 -1
  62. package/build/components/global-styles/variations/variation.js +12 -6
  63. package/build/components/global-styles/variations/variation.js.map +1 -1
  64. package/build/components/global-styles/variations/variations-color.js +5 -5
  65. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  66. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  67. package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  68. package/build/components/global-styles-sidebar/index.js.map +1 -0
  69. package/build/components/header-edit-mode/index.js +21 -137
  70. package/build/components/header-edit-mode/index.js.map +1 -1
  71. package/build/components/header-edit-mode/more-menu/index.js +3 -97
  72. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  73. package/build/components/keyboard-shortcuts/register.js +0 -49
  74. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  75. package/build/components/layout/index.js +9 -9
  76. package/build/components/layout/index.js.map +1 -1
  77. package/build/components/layout/router.js +70 -44
  78. package/build/components/layout/router.js.map +1 -1
  79. package/build/components/page/index.js +2 -2
  80. package/build/components/page/index.js.map +1 -1
  81. package/build/components/page-pages/index.js +4 -14
  82. package/build/components/page-pages/index.js.map +1 -1
  83. package/build/components/page-patterns/dataviews-pattern-actions.js +15 -87
  84. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  85. package/build/components/page-patterns/header.js +3 -1
  86. package/build/components/page-patterns/header.js.map +1 -1
  87. package/build/components/page-patterns/index.js +28 -68
  88. package/build/components/page-patterns/index.js.map +1 -1
  89. package/build/components/page-patterns/use-patterns.js +1 -0
  90. package/build/components/page-patterns/use-patterns.js.map +1 -1
  91. package/build/components/page-templates/hooks.js.map +1 -0
  92. package/build/components/{page-templates-template-parts → page-templates}/index.js +73 -94
  93. package/build/components/page-templates/index.js.map +1 -0
  94. package/build/components/pagination/index.js +2 -2
  95. package/build/components/pagination/index.js.map +1 -1
  96. package/build/components/pattern-modal/duplicate.js +7 -5
  97. package/build/components/pattern-modal/duplicate.js.map +1 -1
  98. package/build/components/plugin-template-setting-panel/index.js +9 -0
  99. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  100. package/build/components/resizable-frame/index.js +20 -9
  101. package/build/components/resizable-frame/index.js.map +1 -1
  102. package/build/components/revisions/index.js +5 -2
  103. package/build/components/revisions/index.js.map +1 -1
  104. package/build/components/save-panel/index.js +4 -4
  105. package/build/components/save-panel/index.js.map +1 -1
  106. package/build/components/sidebar/index.js +61 -31
  107. package/build/components/sidebar/index.js.map +1 -1
  108. package/build/components/sidebar-button/index.js +2 -2
  109. package/build/components/sidebar-button/index.js.map +1 -1
  110. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  111. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  112. package/build/components/sidebar-navigation-item/index.js +5 -3
  113. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  114. package/build/components/sidebar-navigation-screen/index.js +6 -32
  115. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  116. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  117. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  119. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  121. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  123. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  124. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  125. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  126. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  127. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  128. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  129. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-page/index.js +39 -8
  131. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
  133. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen-pattern/index.js +3 -15
  135. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  137. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  139. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  141. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-patterns/index.js +25 -29
  143. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  144. package/build/components/sidebar-navigation-screen-template/index.js +5 -2
  145. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  146. package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  147. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  148. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -33
  149. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  150. package/build/components/site-hub/index.js +3 -3
  151. package/build/components/site-hub/index.js.map +1 -1
  152. package/build/components/site-icon/index.js +2 -2
  153. package/build/components/site-icon/index.js.map +1 -1
  154. package/build/components/style-book/index.js +10 -7
  155. package/build/components/style-book/index.js.map +1 -1
  156. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  157. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  158. package/build/components/template-actions/index.js +1 -1
  159. package/build/components/template-actions/index.js.map +1 -1
  160. package/build/components/template-part-converter/index.js +18 -1
  161. package/build/components/template-part-converter/index.js.map +1 -1
  162. package/build/deprecated.js +55 -0
  163. package/build/deprecated.js.map +1 -0
  164. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +40 -6
  165. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  166. package/build/index.js +18 -18
  167. package/build/index.js.map +1 -1
  168. package/build/utils/constants.js +1 -2
  169. package/build/utils/constants.js.map +1 -1
  170. package/build/utils/get-is-list-page.js +1 -1
  171. package/build/utils/get-is-list-page.js.map +1 -1
  172. package/build/utils/use-activate-theme.js +9 -6
  173. package/build/utils/use-activate-theme.js.map +1 -1
  174. package/build-module/components/add-new-page/index.js +3 -0
  175. package/build-module/components/add-new-page/index.js.map +1 -1
  176. package/build-module/components/add-new-pattern/index.js +8 -7
  177. package/build-module/components/add-new-pattern/index.js.map +1 -1
  178. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  179. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  180. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
  181. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  182. package/build-module/components/add-new-template/index.js +2 -2
  183. package/build-module/components/add-new-template/index.js.map +1 -1
  184. package/build-module/components/app/index.js +4 -2
  185. package/build-module/components/app/index.js.map +1 -1
  186. package/build-module/components/block-editor/editor-canvas.js +4 -18
  187. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  188. package/build-module/components/block-editor/resize-handle.js +21 -6
  189. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  190. package/build-module/components/block-editor/site-editor-canvas.js +2 -2
  191. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  192. package/build-module/components/create-template-part-modal/index.js +3 -0
  193. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  194. package/build-module/components/dataviews-actions/index.js +38 -0
  195. package/build-module/components/dataviews-actions/index.js.map +1 -0
  196. package/build-module/components/editor/index.js +96 -17
  197. package/build-module/components/editor/index.js.map +1 -1
  198. package/build-module/components/global-styles/background-panel.js +12 -1
  199. package/build-module/components/global-styles/background-panel.js.map +1 -1
  200. package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
  201. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  202. package/build-module/components/global-styles/color-palette-panel.js +4 -2
  203. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  204. package/build-module/components/global-styles/font-library-modal/context.js +9 -3
  205. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  206. package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -2
  207. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  208. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  209. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  210. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  211. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  212. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  213. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  214. package/build-module/components/global-styles/hooks.js +4 -1
  215. package/build-module/components/global-styles/hooks.js.map +1 -1
  216. package/build-module/components/global-styles/icon-with-current-color.js +2 -2
  217. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  218. package/build-module/components/global-styles/preset-colors.js +22 -0
  219. package/build-module/components/global-styles/preset-colors.js.map +1 -0
  220. package/build-module/components/global-styles/preview-colors.js +3 -7
  221. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  222. package/build-module/components/global-styles/screen-color-palette.js +5 -5
  223. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  224. package/build-module/components/global-styles/screen-colors.js +1 -4
  225. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  226. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  227. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  228. package/build-module/components/global-styles/style-variations-container.js +8 -2
  229. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  230. package/build-module/components/global-styles/typography-example.js +4 -1
  231. package/build-module/components/global-styles/typography-example.js.map +1 -1
  232. package/build-module/components/global-styles/ui.js +4 -1
  233. package/build-module/components/global-styles/ui.js.map +1 -1
  234. package/build-module/components/global-styles/variations/variation.js +11 -5
  235. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  236. package/build-module/components/global-styles/variations/variations-color.js +6 -6
  237. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  238. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  239. package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  240. package/build-module/components/global-styles-sidebar/index.js.map +1 -0
  241. package/build-module/components/header-edit-mode/index.js +22 -138
  242. package/build-module/components/header-edit-mode/index.js.map +1 -1
  243. package/build-module/components/header-edit-mode/more-menu/index.js +5 -99
  244. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  245. package/build-module/components/keyboard-shortcuts/register.js +0 -49
  246. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  247. package/build-module/components/layout/index.js +9 -9
  248. package/build-module/components/layout/index.js.map +1 -1
  249. package/build-module/components/layout/router.js +70 -45
  250. package/build-module/components/layout/router.js.map +1 -1
  251. package/build-module/components/page/index.js +2 -2
  252. package/build-module/components/page/index.js.map +1 -1
  253. package/build-module/components/page-pages/index.js +5 -15
  254. package/build-module/components/page-pages/index.js.map +1 -1
  255. package/build-module/components/page-patterns/dataviews-pattern-actions.js +15 -87
  256. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  257. package/build-module/components/page-patterns/header.js +3 -1
  258. package/build-module/components/page-patterns/header.js.map +1 -1
  259. package/build-module/components/page-patterns/index.js +31 -71
  260. package/build-module/components/page-patterns/index.js.map +1 -1
  261. package/build-module/components/page-patterns/use-patterns.js +1 -0
  262. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  263. package/build-module/components/page-templates/hooks.js.map +1 -0
  264. package/build-module/components/{page-templates-template-parts → page-templates}/index.js +73 -94
  265. package/build-module/components/page-templates/index.js.map +1 -0
  266. package/build-module/components/pagination/index.js +2 -2
  267. package/build-module/components/pagination/index.js.map +1 -1
  268. package/build-module/components/pattern-modal/duplicate.js +7 -5
  269. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  270. package/build-module/components/plugin-template-setting-panel/index.js +8 -0
  271. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  272. package/build-module/components/resizable-frame/index.js +21 -10
  273. package/build-module/components/resizable-frame/index.js.map +1 -1
  274. package/build-module/components/revisions/index.js +4 -1
  275. package/build-module/components/revisions/index.js.map +1 -1
  276. package/build-module/components/save-panel/index.js +4 -4
  277. package/build-module/components/save-panel/index.js.map +1 -1
  278. package/build-module/components/sidebar/index.js +62 -32
  279. package/build-module/components/sidebar/index.js.map +1 -1
  280. package/build-module/components/sidebar-button/index.js +2 -2
  281. package/build-module/components/sidebar-button/index.js.map +1 -1
  282. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  283. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  284. package/build-module/components/sidebar-navigation-item/index.js +5 -3
  285. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  286. package/build-module/components/sidebar-navigation-screen/index.js +6 -32
  287. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  288. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  289. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  290. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  291. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  293. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  295. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  297. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  298. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  299. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  300. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  301. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  302. package/build-module/components/sidebar-navigation-screen-page/index.js +40 -9
  303. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  304. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
  305. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  306. package/build-module/components/sidebar-navigation-screen-pattern/index.js +3 -15
  307. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  308. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  309. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  310. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  311. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  312. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  313. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  314. package/build-module/components/sidebar-navigation-screen-patterns/index.js +26 -30
  315. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  316. package/build-module/components/sidebar-navigation-screen-template/index.js +5 -2
  317. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  318. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  319. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  320. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -33
  321. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  322. package/build-module/components/site-hub/index.js +3 -3
  323. package/build-module/components/site-hub/index.js.map +1 -1
  324. package/build-module/components/site-icon/index.js +2 -2
  325. package/build-module/components/site-icon/index.js.map +1 -1
  326. package/build-module/components/style-book/index.js +9 -6
  327. package/build-module/components/style-book/index.js.map +1 -1
  328. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  329. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  330. package/build-module/components/template-actions/index.js +1 -1
  331. package/build-module/components/template-actions/index.js.map +1 -1
  332. package/build-module/components/template-part-converter/index.js +18 -1
  333. package/build-module/components/template-part-converter/index.js.map +1 -1
  334. package/build-module/deprecated.js +45 -0
  335. package/build-module/deprecated.js.map +1 -0
  336. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +38 -5
  337. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  338. package/build-module/index.js +2 -4
  339. package/build-module/index.js.map +1 -1
  340. package/build-module/utils/constants.js +0 -1
  341. package/build-module/utils/constants.js.map +1 -1
  342. package/build-module/utils/get-is-list-page.js +1 -1
  343. package/build-module/utils/get-is-list-page.js.map +1 -1
  344. package/build-module/utils/use-activate-theme.js +9 -6
  345. package/build-module/utils/use-activate-theme.js.map +1 -1
  346. package/build-style/style-rtl.css +208 -484
  347. package/build-style/style.css +208 -484
  348. package/package.json +43 -45
  349. package/src/components/add-new-page/index.js +7 -1
  350. package/src/components/add-new-pattern/index.js +15 -12
  351. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  352. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
  353. package/src/components/add-new-template/index.js +2 -2
  354. package/src/components/app/index.js +5 -2
  355. package/src/components/block-editor/editor-canvas.js +6 -26
  356. package/src/components/block-editor/resize-handle.js +30 -11
  357. package/src/components/block-editor/site-editor-canvas.js +2 -2
  358. package/src/components/block-editor/style.scss +12 -17
  359. package/src/components/create-template-part-modal/index.js +3 -0
  360. package/src/components/dataviews-actions/index.js +38 -0
  361. package/src/components/editor/index.js +117 -18
  362. package/src/components/editor/style.scss +6 -5
  363. package/src/components/global-styles/background-panel.js +17 -2
  364. package/src/components/global-styles/color-indicator-wrapper.js +2 -2
  365. package/src/components/global-styles/color-palette-panel.js +3 -4
  366. package/src/components/global-styles/font-library-modal/context.js +9 -3
  367. package/src/components/global-styles/font-library-modal/font-collection.js +31 -12
  368. package/src/components/global-styles/font-library-modal/installed-fonts.js +82 -54
  369. package/src/components/global-styles/font-library-modal/style.scss +17 -0
  370. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  371. package/src/components/global-styles/gradients-palette-panel.js +1 -4
  372. package/src/components/global-styles/hooks.js +2 -1
  373. package/src/components/global-styles/icon-with-current-color.js +2 -2
  374. package/src/components/global-styles/preset-colors.js +18 -0
  375. package/src/components/global-styles/preview-colors.js +4 -7
  376. package/src/components/global-styles/screen-color-palette.js +4 -4
  377. package/src/components/global-styles/screen-colors.js +0 -2
  378. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  379. package/src/components/global-styles/stories/index.story.js +2 -1
  380. package/src/components/global-styles/style-variations-container.js +11 -2
  381. package/src/components/global-styles/typography-example.js +2 -1
  382. package/src/components/global-styles/ui.js +5 -1
  383. package/src/components/global-styles/variations/style.scss +15 -31
  384. package/src/components/global-styles/variations/variation.js +13 -10
  385. package/src/components/global-styles/variations/variations-color.js +5 -8
  386. package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
  387. package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
  388. package/src/components/header-edit-mode/index.js +25 -184
  389. package/src/components/header-edit-mode/more-menu/index.js +8 -145
  390. package/src/components/header-edit-mode/style.scss +1 -271
  391. package/src/components/keyboard-shortcuts/register.js +0 -58
  392. package/src/components/layout/index.js +14 -10
  393. package/src/components/layout/router.js +66 -56
  394. package/src/components/layout/style.scss +2 -1
  395. package/src/components/page/index.js +2 -2
  396. package/src/components/page-pages/index.js +8 -28
  397. package/src/components/page-patterns/dataviews-pattern-actions.js +11 -101
  398. package/src/components/page-patterns/header.js +3 -1
  399. package/src/components/page-patterns/index.js +32 -110
  400. package/src/components/page-patterns/style.scss +14 -1
  401. package/src/components/page-patterns/use-patterns.js +1 -0
  402. package/src/components/{page-templates-template-parts → page-templates}/index.js +33 -75
  403. package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
  404. package/src/components/pagination/index.js +2 -2
  405. package/src/components/pattern-modal/duplicate.js +4 -3
  406. package/src/components/plugin-template-setting-panel/index.js +8 -0
  407. package/src/components/resizable-frame/index.js +20 -7
  408. package/src/components/revisions/index.js +2 -1
  409. package/src/components/save-panel/index.js +4 -4
  410. package/src/components/sidebar/index.js +61 -37
  411. package/src/components/sidebar-button/index.js +2 -5
  412. package/src/components/sidebar-dataviews/dataview-item.js +4 -7
  413. package/src/components/sidebar-navigation-item/index.js +3 -3
  414. package/src/components/sidebar-navigation-screen/index.js +7 -31
  415. package/src/components/sidebar-navigation-screen/style.scss +11 -9
  416. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  417. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
  418. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  419. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
  420. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  421. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
  422. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
  423. package/src/components/sidebar-navigation-screen-page/index.js +48 -9
  424. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
  425. package/src/components/sidebar-navigation-screen-pattern/index.js +1 -12
  426. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  427. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  428. package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  429. package/src/components/sidebar-navigation-screen-patterns/index.js +20 -39
  430. package/src/components/sidebar-navigation-screen-template/index.js +3 -2
  431. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  432. package/src/components/sidebar-navigation-screen-templates-browse/index.js +8 -39
  433. package/src/components/site-hub/index.js +3 -3
  434. package/src/components/site-icon/index.js +2 -2
  435. package/src/components/style-book/index.js +7 -6
  436. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -4
  437. package/src/components/template-actions/index.js +1 -1
  438. package/src/components/template-part-converter/index.js +16 -3
  439. package/src/deprecated.js +42 -0
  440. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +71 -17
  441. package/src/index.js +2 -9
  442. package/src/style.scss +2 -16
  443. package/src/utils/constants.js +1 -1
  444. package/src/utils/get-is-list-page.js +1 -3
  445. package/src/utils/use-activate-theme.js +4 -4
  446. package/build/components/global-styles/global-styles-provider.js +0 -129
  447. package/build/components/global-styles/global-styles-provider.js.map +0 -1
  448. package/build/components/header-edit-mode/document-tools/index.js +0 -68
  449. package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
  450. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
  451. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  452. package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
  453. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  454. package/build/components/keyboard-shortcuts/edit-mode.js +0 -56
  455. package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  456. package/build/components/page-templates-template-parts/add-new-template-part.js +0 -65
  457. package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  458. package/build/components/page-templates-template-parts/hooks.js.map +0 -1
  459. package/build/components/page-templates-template-parts/index.js.map +0 -1
  460. package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  461. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  462. package/build/components/sidebar-edit-mode/index.js +0 -146
  463. package/build/components/sidebar-edit-mode/index.js.map +0 -1
  464. package/build/components/sidebar-edit-mode/page-panels/index.js +0 -98
  465. package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  466. package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
  467. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  468. package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
  469. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  470. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
  471. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  472. package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
  473. package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  474. package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
  475. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  476. package/build/components/sidebar-edit-mode/template-panel/index.js +0 -130
  477. package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  478. package/build/components/start-template-options/index.js +0 -191
  479. package/build/components/start-template-options/index.js.map +0 -1
  480. package/build/utils/math.js +0 -98
  481. package/build/utils/math.js.map +0 -1
  482. package/build-module/components/global-styles/global-styles-provider.js +0 -120
  483. package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
  484. package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
  485. package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
  486. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
  487. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  488. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  489. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  490. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -49
  491. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  492. package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -57
  493. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  494. package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
  495. package/build-module/components/page-templates-template-parts/index.js.map +0 -1
  496. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  497. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  498. package/build-module/components/sidebar-edit-mode/index.js +0 -137
  499. package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
  500. package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -90
  501. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  502. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
  503. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  504. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
  505. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  506. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -31
  507. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  508. package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
  509. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  510. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
  511. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  512. package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -122
  513. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  514. package/build-module/components/start-template-options/index.js +0 -184
  515. package/build-module/components/start-template-options/index.js.map +0 -1
  516. package/build-module/utils/math.js +0 -92
  517. package/build-module/utils/math.js.map +0 -1
  518. package/src/components/global-styles/global-styles-provider.js +0 -162
  519. package/src/components/header-edit-mode/document-tools/index.js +0 -68
  520. package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
  521. package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  522. package/src/components/keyboard-shortcuts/edit-mode.js +0 -59
  523. package/src/components/page-templates-template-parts/add-new-template-part.js +0 -62
  524. package/src/components/sidebar-edit-mode/index.js +0 -162
  525. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -105
  526. package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
  527. package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
  528. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -49
  529. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -34
  530. package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
  531. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
  532. package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
  533. package/src/components/sidebar-edit-mode/template-panel/index.js +0 -144
  534. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
  535. package/src/components/start-template-options/index.js +0 -231
  536. package/src/components/start-template-options/style.scss +0 -55
  537. package/src/utils/math.js +0 -93
  538. /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  539. /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  540. /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  541. /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  542. /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  543. /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","__experimentalVStack","VStack","useViewportMatch","BlockEditorProvider","useCallback","editorStore","preferencesStore","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","ColorVariations","TypographyVariations","useColorVariations","useTypographyVariations","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","createElement","path","onClick","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","colorVariations","typographyVariations","gap","settings","onChange","onInput","spacing","className","title","SidebarNavigationScreenGlobalStyles","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","Fragment","description","content","footer","record","actions","icon","label","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\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 StyleVariationsContainer from '../global-styles/style-variations-container';\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 ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\nimport {\n\tuseColorVariations,\n\tuseTypographyVariations,\n} from '../global-styles/hooks';\n\nconst noop = () => {};\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 <SidebarNavigationItem { ...props } path=\"/wp_global_styles\" />;\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\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst colorVariations = useColorVariations();\n\tconst typographyVariations = useTypographyVariations();\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t{ colorVariations?.length && (\n\t\t\t\t\t<ColorVariations title={ __( 'Colors' ) } gap={ gap } />\n\t\t\t\t) }\n\t\t\t\t{ typographyVariations?.length && (\n\t\t\t\t\t<TypographyVariations\n\t\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\t\tgap={ gap }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\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\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,Q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AAG;IAC1D8C,MAAM,EACLJ,4BAA4B,IAC3B7C,aAAA,CAACd,oCAAoC;MACpCgE,MAAM,EAAGlC,SAAS,GAAI,CAAC,CAAI;MAC3Bd,OAAO,EAAGuC;IAAe,CACzB,CAEF;IACDU,OAAO,EACNnD,aAAA,CAAA8C,QAAA,QACG,CAAE1B,gBAAgB,IACnBpB,aAAA,CAAClB,aAAa;MACbsE,IAAI,EAAGtF,IAAM;MACbuF,KAAK,EAAGzF,EAAE,CAAE,YAAa,CAAG;MAC5BsC,OAAO,EAAGA,CAAA,KACTmB,4BAA4B,CAC3B,CAAEE,iBAAiB,GAChB,YAAY,GACZS,SACJ,CACA;MACDsB,SAAS,EAAG/B;IAAmB,CAC/B,CACD,EACDvB,aAAA,CAAClB,aAAa;MACbsE,IAAI,EAAGvF,IAAM;MACbwF,KAAK,EAAGzF,EAAE,CAAE,aAAc,CAAG;MAC7BsC,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAMmC,gBAAgB,CAAC;IAAG,CAChD,CACA;EACF,CACD,CAAC,EACAd,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,IACtDtB,aAAA,CAAChB,SAAS;IACTuE,cAAc,EAAG,KAAO;IACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;IAC1BtD,OAAO,EAAGsC,aAAe;IACzBiB,QAAQ,EAAGjB,aAAe;IAC1BkB,eAAe,EAAG,KAAO;IACzBC,QAAQ,EAAG;EAAO,CAClB,CAED,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","__experimentalVStack","VStack","useViewportMatch","BlockEditorProvider","useCallback","editorStore","preferencesStore","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","ColorVariations","TypographyVariations","useColorVariations","useTypographyVariations","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","createElement","path","onClick","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","colorVariations","typographyVariations","gap","settings","onChange","onInput","spacing","className","title","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","Fragment","description","content","footer","record","actions","icon","label","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\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 StyleVariationsContainer from '../global-styles/style-variations-container';\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 ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\nimport {\n\tuseColorVariations,\n\tuseTypographyVariations,\n} from '../global-styles/hooks';\n\nconst noop = () => {};\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 <SidebarNavigationItem { ...props } path=\"/wp_global_styles\" />;\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\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst colorVariations = useColorVariations();\n\tconst typographyVariations = useTypographyVariations();\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t{ colorVariations?.length && (\n\t\t\t\t\t<ColorVariations title={ __( 'Colors' ) } gap={ gap } />\n\t\t\t\t) }\n\t\t\t\t{ typographyVariations?.length && (\n\t\t\t\t\t<TypographyVariations\n\t\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\t\tgap={ gap }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,oB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4BAA4B,IAC3B9C,aAAA,CAACd,oCAAoC;MACpCiE,MAAM,EAAGlC,SAAS,GAAI,CAAC,CAAI;MAC3Bf,OAAO,EAAGwC;IAAe,CACzB,CAEF;IACDU,OAAO,EACNpD,aAAA,CAAA+C,QAAA,QACG,CAAE1B,gBAAgB,IACnBrB,aAAA,CAAClB,aAAa;MACbuE,IAAI,EAAGvF,IAAM;MACbwF,KAAK,EAAG1F,EAAE,CAAE,YAAa,CAAG;MAC5BsC,OAAO,EAAGA,CAAA,KACToB,4BAA4B,CAC3B,CAAEE,iBAAiB,GAChB,YAAY,GACZS,SACJ,CACA;MACDsB,SAAS,EAAG/B;IAAmB,CAC/B,CACD,EACDxB,aAAA,CAAClB,aAAa;MACbuE,IAAI,EAAGxF,IAAM;MACbyF,KAAK,EAAG1F,EAAE,CAAE,aAAc,CAAG;MAC7BsC,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAMoC,gBAAgB,CAAC;IAAG,CAChD,CACA;EACF,CACD,CAAC,EACAd,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,IACtDvB,aAAA,CAAChB,SAAS;IACTwE,cAAc,EAAG,KAAO;IACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;IAC1BvD,OAAO,EAAGuC,aAAe;IACzBiB,QAAQ,EAAGjB,aAAe;IAC1BkB,eAAe,EAAG,KAAO;IACzBC,QAAQ,EAAG;EAAO,CAClB,CAED,CAAC;AAEL","ignoreList":[]}
@@ -22,7 +22,9 @@ const {
22
22
  useLocation
23
23
  } = unlock(routerPrivateApis);
24
24
  export const postType = `wp_navigation`;
25
- export default function SidebarNavigationScreenNavigationMenu() {
25
+ export default function SidebarNavigationScreenNavigationMenu({
26
+ backPath
27
+ }) {
26
28
  const {
27
29
  params: {
28
30
  postId
@@ -57,30 +59,35 @@ export default function SidebarNavigationScreenNavigationMenu() {
57
59
  const _handleDuplicate = () => handleDuplicate(navigationMenu);
58
60
  if (isLoading) {
59
61
  return createElement(SidebarNavigationScreenWrapper, {
60
- description: __('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.')
62
+ description: __('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'),
63
+ backPath: backPath
61
64
  }, createElement(Spinner, {
62
65
  className: "edit-site-sidebar-navigation-screen-navigation-menus__loading"
63
66
  }));
64
67
  }
65
68
  if (!isLoading && !navigationMenu) {
66
69
  return createElement(SidebarNavigationScreenWrapper, {
67
- description: __('Navigation Menu missing.')
70
+ description: __('Navigation Menu missing.'),
71
+ backPath: backPath
68
72
  });
69
73
  }
70
74
  if (!navigationMenu?.content?.raw) {
71
75
  return createElement(SidebarNavigationScreenWrapper, {
72
76
  actions: createElement(ScreenNavigationMoreMenu, {
77
+ menuId: navigationMenu?.id,
73
78
  menuTitle: decodeEntities(menuTitle),
74
79
  onDelete: _handleDelete,
75
80
  onSave: _handleSave,
76
81
  onDuplicate: _handleDuplicate
77
82
  }),
83
+ backPath: backPath,
78
84
  title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
79
85
  description: __('This Navigation Menu is empty.')
80
86
  });
81
87
  }
82
88
  return createElement(SingleNavigationMenu, {
83
89
  navigationMenu: navigationMenu,
90
+ backPath: backPath,
84
91
  handleDelete: _handleDelete,
85
92
  handleSave: _handleSave,
86
93
  handleDuplicate: _handleDuplicate
@@ -1 +1 @@
1
- {"version":3,"names":["useEntityRecord","store","coreStore","Spinner","__","useSelect","decodeEntities","privateApis","routerPrivateApis","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","SingleNavigationMenu","useNavigationMenuHandlers","buildNavigationLabel","unlock","useLocation","postType","SidebarNavigationScreenNavigationMenu","params","postId","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","createElement","description","className","content","raw","actions","onDelete","onSave","onDuplicate","id","status"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport { Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu() {\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t>\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 && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC1E,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,EAAE,QAA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C1BF,eAAe,EAAGI;EAAkB,CACpC,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["useEntityRecord","store","coreStore","Spinner","__","useSelect","decodeEntities","privateApis","routerPrivateApis","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","SingleNavigationMenu","useNavigationMenuHandlers","buildNavigationLabel","unlock","useLocation","postType","SidebarNavigationScreenNavigationMenu","backPath","params","postId","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","createElement","description","className","content","raw","actions","menuId","id","onDelete","onSave","onDuplicate","status"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport { Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu( { backPath } ) {\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t>\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 && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuId={ navigationMenu?.id }\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tbackPath={ backPath }\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\tbackPath={ backPath }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC1E,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,+CAA+C;AAC9F,OAAOC,wBAAwB,MAAM,aAAa;AAClD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,yBAAyB,MAAM,gCAAgC;AACtE,OAAOC,oBAAoB,MAAM,sEAAsE;AACvG,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAY,CAAC,GAAGD,MAAM,CAAEN,iBAAkB,CAAC;AAEnD,OAAO,MAAMQ,QAAQ,GAAI,eAAc;AAEvC,eAAe,SAASC,qCAAqCA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC7E,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAO;EAClB,CAAC,GAAGL,WAAW,CAAC,CAAC;EAEjB,MAAM;IAAEM,MAAM,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EAAE,CAAE,0BAA2B,CAAG;MAChDc,QAAQ,EAAGA;IAAU,CACrB,CAAC;EAEJ;EAEA,IAAK,CAAEI,cAAc,EAAEsB,OAAO,EAAEC,GAAG,EAAG;IACrC,OACCJ,aAAA,CAAChC,8BAA8B;MAC9BqC,OAAO,EACNL,aAAA,CAAC/B,wBAAwB;QACxBqC,MAAM,EAAGzB,cAAc,EAAE0B,EAAI;QAC7BlB,SAAS,EAAGxB,cAAc,CAAEwB,SAAU,CAAG;QACzCmB,QAAQ,EAAGZ,aAAe;QAC1Ba,MAAM,EAAGZ,WAAa;QACtBa,WAAW,EAAGX;MAAkB,CAChC,CACD;MACDtB,QAAQ,EAAGA,QAAU;MACrBa,KAAK,EAAGlB,oBAAoB,CAC3BS,cAAc,EAAES,KAAK,EACrBT,cAAc,EAAE0B,EAAE,EAClB1B,cAAc,EAAE8B,MACjB,CAAG;MACHV,WAAW,EAAGtC,EAAE,CAAE,gCAAiC;IAAG,CACtD,CAAC;EAEJ;EAEA,OACCqC,aAAA,CAAC9B,oBAAoB;IACpBW,cAAc,EAAGA,cAAgB;IACjCJ,QAAQ,EAAGA,QAAU;IACrBiB,YAAY,EAAGE,aAAe;IAC9BH,UAAU,EAAGI,WAAa;IAC1BF,eAAe,EAAGI;EAAkB,CACpC,CAAC;AAEJ","ignoreList":[]}
@@ -6,12 +6,17 @@ import { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';
6
6
  import { moreVertical } from '@wordpress/icons';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  import { useState } from '@wordpress/element';
9
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
12
13
  */
13
14
  import RenameModal from './rename-modal';
14
15
  import DeleteConfirmDialog from './delete-confirm-dialog';
16
+ import { unlock } from '../../lock-unlock';
17
+ const {
18
+ useHistory
19
+ } = unlock(routerPrivateApis);
15
20
  const POPOVER_PROPS = {
16
21
  position: 'bottom right'
17
22
  };
@@ -20,10 +25,12 @@ export default function ScreenNavigationMoreMenu(props) {
20
25
  onDelete,
21
26
  onSave,
22
27
  onDuplicate,
23
- menuTitle
28
+ menuTitle,
29
+ menuId
24
30
  } = props;
25
31
  const [renameModalOpen, setRenameModalOpen] = useState(false);
26
32
  const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = useState(false);
33
+ const history = useHistory();
27
34
  const closeModals = () => {
28
35
  setRenameModalOpen(false);
29
36
  setDeleteConfirmDialogOpen(false);
@@ -44,6 +51,14 @@ export default function ScreenNavigationMoreMenu(props) {
44
51
  onClose();
45
52
  }
46
53
  }, __('Rename')), createElement(MenuItem, {
54
+ onClick: () => {
55
+ history.push({
56
+ postId: menuId,
57
+ postType: 'wp_navigation',
58
+ canvas: 'edit'
59
+ });
60
+ }
61
+ }, __('Edit')), createElement(MenuItem, {
47
62
  onClick: () => {
48
63
  onDuplicate();
49
64
  onClose();
@@ -1 +1 @@
1
- {"version":3,"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","RenameModal","DeleteConfirmDialog","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","renameModalOpen","setRenameModalOpen","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","closeModals","openRenameModal","openDeleteConfirmDialog","createElement","Fragment","className","label","icon","popoverProps","onClose","onClick","isDestructive","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,mBAAmB,MAAM,yBAAyB;AAEzD,MAAMC,aAAa,GAAG;EACrBC,QAAQ,EAAE;AACX,CAAC;AAED,eAAe,SAASC,wBAAwBA,CAAEC,KAAK,EAAG;EACzD,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,WAAW;IAAEC;EAAU,CAAC,GAAGJ,KAAK;EAE1D,MAAM,CAAEK,eAAe,EAAEC,kBAAkB,CAAE,GAAGZ,QAAQ,CAAE,KAAM,CAAC;EACjE,MAAM,CAAEa,uBAAuB,EAAEC,0BAA0B,CAAE,GAC5Dd,QAAQ,CAAE,KAAM,CAAC;EAElB,MAAMe,WAAW,GAAGA,CAAA,KAAM;IACzBH,kBAAkB,CAAE,KAAM,CAAC;IAC3BE,0BAA0B,CAAE,KAAM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","moreVertical","__","useState","privateApis","routerPrivateApis","RenameModal","DeleteConfirmDialog","unlock","useHistory","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","createElement","Fragment","className","label","icon","popoverProps","onClose","onClick","push","postId","postType","canvas","isDestructive","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst history = useHistory();\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\tpostId: menuId,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_navigation',\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\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>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAW,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAElD,MAAMK,aAAa,GAAG;EACrBC,QAAQ,EAAE;AACX,CAAC;AAED,eAAe,SAASC,wBAAwBA,CAAEC,KAAK,EAAG;EACzD,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGL,KAAK;EAElE,MAAM,CAAEM,eAAe,EAAEC,kBAAkB,CAAE,GAAGjB,QAAQ,CAAE,KAAM,CAAC;EACjE,MAAM,CAAEkB,uBAAuB,EAAEC,0BAA0B,CAAE,GAC5DnB,QAAQ,CAAE,KAAM,CAAC;EAElB,MAAMoB,OAAO,GAAGd,UAAU,CAAC,CAAC;EAE5B,M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N,CACA,CACP,CAEO,CAAC,EACbmB,uBAAuB,IACxBM,aAAA,CAACpB,mBAAmB;IACnB0B,OAAO,EAAGT,WAAa;IACvBgB,SAAS,EAAG1B;EAAU,CACtB,CACD,EACCK,eAAe,IAChBQ,aAAA,CAACrB,WAAW;IACX2B,OAAO,EAAGT,WAAa;IACvBP,SAAS,EAAGA,SAAW;IACvBF,MAAM,EAAGA;EAAQ,CACjB,CAED,CAAC;AAEL","ignoreList":[]}
@@ -13,6 +13,7 @@ import NavigationMenuEditor from './navigation-menu-editor';
13
13
  import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';
14
14
  export default function SingleNavigationMenu({
15
15
  navigationMenu,
16
+ backPath,
16
17
  handleDelete,
17
18
  handleDuplicate,
18
19
  handleSave
@@ -20,11 +21,13 @@ export default function SingleNavigationMenu({
20
21
  const menuTitle = navigationMenu?.title?.rendered;
21
22
  return createElement(SidebarNavigationScreenWrapper, {
22
23
  actions: createElement(Fragment, null, createElement(ScreenNavigationMoreMenu, {
24
+ menuId: navigationMenu?.id,
23
25
  menuTitle: decodeEntities(menuTitle),
24
26
  onDelete: handleDelete,
25
27
  onSave: handleSave,
26
28
  onDuplicate: handleDuplicate
27
29
  })),
30
+ backPath: backPath,
28
31
  title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
29
32
  description: __('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.')
30
33
  }, createElement(NavigationMenuEditor, {
@@ -1 +1 @@
1
- {"version":3,"names":["__","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","NavigationMenuEditor","buildNavigationLabel","SingleNavigationMenu","navigationMenu","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","createElement","actions","Fragment","onDelete","onSave","onDuplicate","id","status","description","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport NavigationMenuEditor from './navigation-menu-editor';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport default function SingleNavigationMenu( {\n\tnavigationMenu,\n\thandleDelete,\n\thandleDuplicate,\n\thandleSave,\n} ) {\n\tconst menuTitle = navigationMenu?.title?.rendered;\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ handleDelete }\n\t\t\t\t\t\tonSave={ handleSave }\n\t\t\t\t\t\tonDuplicate={ handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\tnavigationMenu?.title,\n\t\t\t\tnavigationMenu?.id,\n\t\t\t\tnavigationMenu?.status\n\t\t\t) }\n\t\t\tdescription={ __(\n\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<NavigationMenuEditor navigationMenuId={ navigationMenu?.id } />\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;AACzD;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,+CAA+C;AAC9F,OAAOC,wBAAwB,MAAM,aAAa;AAClD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,oBAAoB,MAAM,sEAAsE;AAEvG,eAAe,SAASC,oBAAoBA,CAAE;EAC7CC,cAAc;EACdC,YAAY;EACZC,eAAe;EACfC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAGJ,cAAc,EAAEK,KAAK,EAAEC,QAAQ;EAEjD,OACCC,aAAA,CAACZ,8BAA8B;IAC9Ba,OAAO,EACND,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACX,wBAAwB;MACxBQ,SAAS,EAAGV,cAAc,CAAEU,SAAU,CAAG;MACzCM,QAAQ,EAAGT,YAAc;MACzBU,MAAM,EAAGR,UAAY;MACrBS,WAAW,EAAGV;IAAiB,CAC/B,CACA,CACF;IACDG,KAAK,EAAGP,oBAAoB,CAC3BE,cAAc,EAAEK,KAAK,EACrBL,cAAc,EAAEa,EAAE,EAClBb,cAAc,EAAEc,MACjB,CAAG;IACHC,WAAW,EAAGtB,EAAE,CACf,kGACD;EAAG,GAEHc,aAAA,CAACV,oBAAoB;IAACmB,gBAAgB,EAAGhB,cAAc,EAAEa;EAAI,CAAE,CAChC,CAAC;AAEnC","ignoreList":[]}
1
+ {"version":3,"names":["__","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","NavigationMenuEditor","buildNavigationLabel","SingleNavigationMenu","navigationMenu","backPath","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","createElement","actions","Fragment","menuId","id","onDelete","onSave","onDuplicate","status","description","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport NavigationMenuEditor from './navigation-menu-editor';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport default function SingleNavigationMenu( {\n\tnavigationMenu,\n\tbackPath,\n\thandleDelete,\n\thandleDuplicate,\n\thandleSave,\n} ) {\n\tconst menuTitle = navigationMenu?.title?.rendered;\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuId={ navigationMenu?.id }\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ handleDelete }\n\t\t\t\t\t\tonSave={ handleSave }\n\t\t\t\t\t\tonDuplicate={ handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tbackPath={ backPath }\n\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\tnavigationMenu?.title,\n\t\t\t\tnavigationMenu?.id,\n\t\t\t\tnavigationMenu?.status\n\t\t\t) }\n\t\t\tdescription={ __(\n\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<NavigationMenuEditor navigationMenuId={ navigationMenu?.id } />\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;AACzD;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,+CAA+C;AAC9F,OAAOC,wBAAwB,MAAM,aAAa;AAClD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,oBAAoB,MAAM,sEAAsE;AAEvG,eAAe,SAASC,oBAAoBA,CAAE;EAC7CC,cAAc;EACdC,QAAQ;EACRC,YAAY;EACZC,eAAe;EACfC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAGL,cAAc,EAAEM,KAAK,EAAEC,QAAQ;EAEjD,OACCC,aAAA,CAACb,8BAA8B;IAC9Bc,OAAO,EACND,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACZ,wBAAwB;MACxBe,MAAM,EAAGX,cAAc,EAAEY,EAAI;MAC7BP,SAAS,EAAGX,cAAc,CAAEW,SAAU,CAAG;MACzCQ,QAAQ,EAAGX,YAAc;MACzBY,MAAM,EAAGV,UAAY;MACrBW,WAAW,EAAGZ;IAAiB,CAC/B,CACA,CACF;IACDF,QAAQ,EAAGA,QAAU;IACrBK,KAAK,EAAGR,oBAAoB,CAC3BE,cAAc,EAAEM,KAAK,EACrBN,cAAc,EAAEY,EAAE,EAClBZ,cAAc,EAAEgB,MACjB,CAAG;IACHC,WAAW,EAAGxB,EAAE,CACf,kGACD;EAAG,GAEHe,aAAA,CAACX,oBAAoB;IAACqB,gBAAgB,EAAGlB,cAAc,EAAEY;EAAI,CAAE,CAChC,CAAC;AAEnC","ignoreList":[]}
@@ -37,7 +37,9 @@ function buildMenuLabel(title, id, status) {
37
37
 
38
38
  // Save a boolean to prevent us creating a fallback more than once per session.
39
39
  let hasCreatedFallback = false;
40
- export default function SidebarNavigationScreenNavigationMenus() {
40
+ export default function SidebarNavigationScreenNavigationMenus({
41
+ backPath
42
+ }) {
41
43
  const {
42
44
  records: navigationMenus,
43
45
  isResolving: isResolvingNavigationMenus,
@@ -66,13 +68,16 @@ export default function SidebarNavigationScreenNavigationMenus() {
66
68
  } = useNavigationMenuHandlers();
67
69
  const hasNavigationMenus = !!navigationMenus?.length;
68
70
  if (isLoading) {
69
- return createElement(SidebarNavigationScreenWrapper, null, createElement(Spinner, {
71
+ return createElement(SidebarNavigationScreenWrapper, {
72
+ backPath: backPath
73
+ }, createElement(Spinner, {
70
74
  className: "edit-site-sidebar-navigation-screen-navigation-menus__loading"
71
75
  }));
72
76
  }
73
77
  if (!isLoading && !hasNavigationMenus) {
74
78
  return createElement(SidebarNavigationScreenWrapper, {
75
- description: __('No Navigation Menus found.')
79
+ description: __('No Navigation Menus found.'),
80
+ backPath: backPath
76
81
  });
77
82
  }
78
83
 
@@ -80,12 +85,15 @@ export default function SidebarNavigationScreenNavigationMenus() {
80
85
  if (navigationMenus?.length === 1) {
81
86
  return createElement(SingleNavigationMenu, {
82
87
  navigationMenu: firstNavigationMenu,
88
+ backPath: backPath,
83
89
  handleDelete: () => handleDelete(firstNavigationMenu),
84
90
  handleDuplicate: () => handleDuplicate(firstNavigationMenu),
85
91
  handleSave: edits => handleSave(firstNavigationMenu, edits)
86
92
  });
87
93
  }
88
- return createElement(SidebarNavigationScreenWrapper, null, createElement(ItemGroup, null, navigationMenus?.map(({
94
+ return createElement(SidebarNavigationScreenWrapper, {
95
+ backPath: backPath
96
+ }, createElement(ItemGroup, null, navigationMenus?.map(({
89
97
  id,
90
98
  title,
91
99
  status
@@ -100,12 +108,14 @@ export function SidebarNavigationScreenWrapper({
100
108
  children,
101
109
  actions,
102
110
  title,
103
- description
111
+ description,
112
+ backPath
104
113
  }) {
105
114
  return createElement(SidebarNavigationScreen, {
106
115
  title: title || __('Navigation'),
107
116
  actions: actions,
108
117
  description: description || __('Manage your Navigation Menus.'),
118
+ backPath: backPath,
109
119
  content: children
110
120
  });
111
121
  }
@@ -115,7 +125,7 @@ const NavMenuItem = ({
115
125
  }) => {
116
126
  const linkInfo = useLink({
117
127
  postId,
118
- postType: NAVIGATION_POST_TYPE
128
+ path: '/navigation'
119
129
  });
120
130
  return createElement(SidebarNavigationItem, {
121
131
  ...linkInfo,
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SingleNavigationMenu","useNavigationMenuHandlers","unlock","NAVIGATION_POST_TYPE","buildMenuLabel","title","id","status","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","createElement","SidebarNavigationScreenWrapper","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","key","withChevron","icon","rendered","children","actions","content","props","linkInfo","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\n// Save a boolean to prevent us creating a fallback more than once per session.\nlet hasCreatedFallback = false;\n\nexport default function SidebarNavigationScreenNavigationMenus() {\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>\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/>\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\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>\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} ) {\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\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,OAAO,QACD,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,gCAAgC,QAAQ,aAAa;AAC9D,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,oBAAoB,MAAM,qEAAqE;AACtG,OAAOC,yBAAyB,MAAM,2EAA2E;AACjH,SAASC,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IACrCsD,OAAO,EAAGA,OAAS;IACnBZ,WAAW,EAAGA,WAAW,IAAI1C,EAAE,CAAE,+BAAgC,CAAG;IACpEuD,OAAO,EAAGF;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMN,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGQ;AAAM,CAAC,KAAM;EAC/C,MAAMC,QAAQ,GAAG3C,OAAO,CAAE;IACzBkC,MAAM;IACNU,QAAQ,EAAExC;EACX,CAAE,CAAC;EACH,OAAOqB,aAAA,CAAC3B,qBAAqB;IAAA,GAAM6C,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SingleNavigationMenu","useNavigationMenuHandlers","unlock","NAVIGATION_POST_TYPE","buildMenuLabel","title","id","status","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","createElement","SidebarNavigationScreenWrapper","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","key","withChevron","icon","rendered","children","actions","content","props","linkInfo","path"],"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\tpath: '/navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,OAAO,QACD,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,gCAAgC,QAAQ,aAAa;AAC9D,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,oBAAoB,MAAM,qEAAqE;AACtG,OAAOC,yBAAyB,MAAM,2EAA2E;AACjH,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,oBAAoB,QAAQ,uBAAuB;;AAE5D;AACA,SAASC,cAAcA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EAC5C,IAAK,CAAEF,KAAK,EAAG;IACd;IACA,OAAOnB,OAAO,CAAED,EAAE,CAAE,eAAgB,CAAC,EAAEqB,EAAG,CAAC;EAC5C;EAEA,IAAKC,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U;IACrB+B,OAAO,EAAGF;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMN,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGQ;AAAM,CAAC,KAAM;EAC/C,MAAMC,QAAQ,GAAG5C,OAAO,CAAE;IACzBmC,MAAM;IACNU,IAAI,EAAE;EACP,CAAE,CAAC;EACH,OAAOnB,aAAA,CAAC5B,qBAAqB;IAAA,GAAM8C,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
@@ -18,7 +18,6 @@ const POPOVER_PROPS = {
18
18
  /**
19
19
  * Internal dependencies
20
20
  */
21
- import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
22
21
  import { unlock } from '../../lock-unlock';
23
22
  const {
24
23
  useLocation,
@@ -64,10 +63,7 @@ export default function LeafMoreMenu(props) {
64
63
  if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
65
64
  history.push({
66
65
  postType: attributes.type,
67
- postId: attributes.id,
68
- ...(isPreviewingTheme() && {
69
- wp_theme_preview: currentlyPreviewingTheme()
70
- })
66
+ postId: attributes.id
71
67
  }, {
72
68
  backPath: params
73
69
  });
@@ -75,10 +71,7 @@ export default function LeafMoreMenu(props) {
75
71
  if (name === 'core/page-list-item' && attributes.id && history) {
76
72
  history.push({
77
73
  postType: 'page',
78
- postId: attributes.id,
79
- ...(isPreviewingTheme() && {
80
- wp_theme_preview: currentlyPreviewingTheme()
81
- })
74
+ postId: attributes.id
82
75
  }, {
83
76
  backPath: params
84
77
  });
@@ -1 +1 @@
1
- {"version":3,"names":["chevronUp","chevronDown","moreVertical","DropdownMenu","MenuItem","MenuGroup","useDispatch","useSelect","useCallback","__","sprintf","BlockTitle","store","blockEditorStore","privateApis","routerPrivateApis","POPOVER_PROPS","className","placement","isPreviewingTheme","currentlyPreviewingTheme","unlock","useLocation","useHistory","LeafMoreMenu","props","params","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","removeLabel","maximumLength","goToLabel","rootClientId","select","getBlockRootClientId","onGoToPage","selectedBlock","attributes","name","kind","id","type","push","postType","postId","wp_theme_preview","backPath","createElement","icon","label","popoverProps","noIcons","onClose","Fragment","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { chevronUp, chevronDown, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockTitle, store as blockEditorStore } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\n/**\n * Internal dependencies\n */\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { block } = props;\n\tconst { clientId } = block;\n\tconst { moveBlocksDown, moveBlocksUp, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst removeLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst goToLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Go to %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst onGoToPage = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes, name } = selectedBlock;\n\t\t\tif (\n\t\t\t\tattributes.kind === 'post-type' &&\n\t\t\t\tattributes.id &&\n\t\t\t\tattributes.type &&\n\t\t\t\thistory\n\t\t\t) {\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t\t...( isPreviewingTheme() && {\n\t\t\t\t\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( name === 'core/page-list-item' && attributes.id && history ) {\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: 'page',\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t\t...( isPreviewingTheme() && {\n\t\t\t\t\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, params ]\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move up' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move down' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t{ block.attributes?.type === 'page' &&\n\t\t\t\t\t\t\tblock.attributes?.id && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonGoToPage( block );\n\t\t\t\t\t\t\t\t\t\tonClose();\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\t\t{ goToLabel }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ removeLabel }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,WAAW,EAAEC,YAAY,QAAQ,kBAAkB;AACvE,SAASC,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,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Q;IACRgD,IAAI,EAAGpD,SAAW;IAClB0D,OAAO,EAAGA,CAAA,KAAM;MACf3B,YAAY,CAAE,CAAEF,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC1CoB,OAAO,CAAC,CAAC;IACV;EAAG,GAED/C,EAAE,CAAE,SAAU,CACP,CAAC,EACX0C,aAAA,CAAC/C,QAAQ;IACRgD,IAAI,EAAGnD,WAAa;IACpByD,OAAO,EAAGA,CAAA,KAAM;MACf5B,cAAc,CAAE,CAAED,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC5CoB,OAAO,CAAC,CAAC;IACV;EAAG,GAED/C,EAAE,CAAE,WAAY,CACT,CAAC,EACTmB,KAAK,CAACa,UAAU,EAAEI,IAAI,KAAK,MAAM,IAClCjB,KAAK,CAACa,UAAU,EAAEG,EAAE,IACnBO,aAAA,CAAC/C,QAAQ;IACRsD,OAAO,EAAGA,CAAA,KAAM;MACfnB,UAAU,CAAEX,KAAM,CAAC;MACnB4B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDrB,SACO,CAEF,CAAC,EACZgB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC/C,QAAQ;IACRsD,OAAO,EAAGA,CAAA,KAAM;MACf1B,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;MACnC2B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDvB,WACO,CACA,CACV,CAEU,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["chevronUp","chevronDown","moreVertical","DropdownMenu","MenuItem","MenuGroup","useDispatch","useSelect","useCallback","__","sprintf","BlockTitle","store","blockEditorStore","privateApis","routerPrivateApis","POPOVER_PROPS","className","placement","unlock","useLocation","useHistory","LeafMoreMenu","props","params","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","removeLabel","maximumLength","goToLabel","rootClientId","select","getBlockRootClientId","onGoToPage","selectedBlock","attributes","name","kind","id","type","push","postType","postId","backPath","createElement","icon","label","popoverProps","noIcons","onClose","Fragment","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { chevronUp, chevronDown, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockTitle, store as blockEditorStore } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { block } = props;\n\tconst { clientId } = block;\n\tconst { moveBlocksDown, moveBlocksUp, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst removeLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst goToLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Go to %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst onGoToPage = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes, name } = selectedBlock;\n\t\t\tif (\n\t\t\t\tattributes.kind === 'post-type' &&\n\t\t\t\tattributes.id &&\n\t\t\t\tattributes.type &&\n\t\t\t\thistory\n\t\t\t) {\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( name === 'core/page-list-item' && attributes.id && history ) {\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tpostType: 'page',\n\t\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tbackPath: params,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, params ]\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move up' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move down' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t{ block.attributes?.type === 'page' &&\n\t\t\t\t\t\t\tblock.attributes?.id && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonGoToPage( block );\n\t\t\t\t\t\t\t\t\t\tonClose();\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\t\t{ goToLabel }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ removeLabel }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,WAAW,EAAEC,YAAY,QAAQ,kBAAkB;AACvE,SAASC,YAAY,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,uBAAuB;AACzE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,EAAEC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAC/E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AAEpE,MAAMC,aAAa,GAAG;EACrBC,SAAS,EAAE,2CAA2C;EACtDC,SAAS,EAAE;AACZ,CAAC;;AAED;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGF,MAAM,CAAEJ,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EAAG,GAEDpB,SACO,CAEF,CAAC,EACZe,aAAA,CAAC3C,SAAS,QACT2C,aAAA,CAAC5C,QAAQ;IACRmD,OAAO,EAAGA,CAAA,KAAM;MACfzB,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;MACnC0B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDtB,WACO,CACA,CACV,CAEU,CAAC;AAEjB","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { __ } from '@wordpress/i18n';
5
+ import { __, sprintf } from '@wordpress/i18n';
6
6
  import { useDispatch, useSelect } from '@wordpress/data';
7
7
  import { __experimentalVStack as VStack, ExternalLink, __experimentalTruncate as Truncate } from '@wordpress/components';
8
8
  import { store as coreStore, useEntityRecord } from '@wordpress/core-data';
@@ -14,6 +14,7 @@ import { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';
14
14
  import { useEffect, useCallback } from '@wordpress/element';
15
15
  import { privateApis as routerPrivateApis } from '@wordpress/router';
16
16
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
17
+ import { store as noticesStore } from '@wordpress/notices';
17
18
 
18
19
  /**
19
20
  * Internal dependencies
@@ -38,6 +39,9 @@ export default function SidebarNavigationScreenPage({
38
39
  setCanvasMode
39
40
  } = unlock(useDispatch(editSiteStore));
40
41
  const history = useHistory();
42
+ const {
43
+ createSuccessNotice
44
+ } = useDispatch(noticesStore);
41
45
  const {
42
46
  params: {
43
47
  postId
@@ -74,15 +78,42 @@ export default function SidebarNavigationScreenPage({
74
78
  }
75
79
  }, [hasResolved, record, history]);
76
80
  const onActionPerformed = useCallback((actionId, items) => {
77
- if (actionId === 'move-to-trash') {
78
- history.push({
79
- path: '/' + items[0].type,
80
- postId: undefined,
81
- postType: undefined,
82
- canvas: 'view'
83
- });
81
+ switch (actionId) {
82
+ case 'move-to-trash':
83
+ {
84
+ history.push({
85
+ path: '/' + items[0].type,
86
+ postId: undefined,
87
+ postType: undefined,
88
+ canvas: 'view'
89
+ });
90
+ }
91
+ break;
92
+ case 'duplicate-post':
93
+ {
94
+ const newItem = items[0];
95
+ const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
96
+ createSuccessNotice(sprintf(
97
+ // translators: %s: Title of the created post e.g: "Post 1".
98
+ __('"%s" successfully created.'), title), {
99
+ type: 'snackbar',
100
+ id: 'duplicate-post-action',
101
+ actions: [{
102
+ label: __('Edit'),
103
+ onClick: () => {
104
+ history.push({
105
+ path: undefined,
106
+ postId: newItem.id,
107
+ postType: newItem.type,
108
+ canvas: 'edit'
109
+ });
110
+ }
111
+ }]
112
+ });
113
+ }
114
+ break;
84
115
  }
85
- }, [history]);
116
+ }, [history, createSuccessNotice]);
86
117
  const featureImageAltText = featuredMediaAltText ? decodeEntities(featuredMediaAltText) : decodeEntities(record?.title?.rendered || __('Featured image'));
87
118
  return record ? createElement(SidebarNavigationScreen, {
88
119
  backPath: backPath,