@wordpress/edit-site 5.34.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 (371) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/build/components/add-new-template/index.js +2 -2
  3. package/build/components/add-new-template/index.js.map +1 -1
  4. package/build/components/app/index.js +4 -2
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/block-editor/editor-canvas.js +4 -18
  7. package/build/components/block-editor/editor-canvas.js.map +1 -1
  8. package/build/components/block-editor/site-editor-canvas.js +2 -2
  9. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  10. package/build/components/dataviews-actions/index.js +46 -0
  11. package/build/components/dataviews-actions/index.js.map +1 -0
  12. package/build/components/editor/index.js +68 -12
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/global-styles/background-panel.js +13 -1
  15. package/build/components/global-styles/background-panel.js.map +1 -1
  16. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  17. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  18. package/build/components/global-styles/color-palette-panel.js +5 -2
  19. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  20. package/build/components/global-styles/gradients-palette-panel.js +1 -2
  21. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  22. package/build/components/global-styles/hooks.js +5 -2
  23. package/build/components/global-styles/hooks.js.map +1 -1
  24. package/build/components/global-styles/icon-with-current-color.js +2 -2
  25. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  26. package/build/components/global-styles/preset-colors.js +29 -0
  27. package/build/components/global-styles/preset-colors.js.map +1 -0
  28. package/build/components/global-styles/preview-colors.js +3 -7
  29. package/build/components/global-styles/preview-colors.js.map +1 -1
  30. package/build/components/global-styles/screen-color-palette.js +5 -5
  31. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  32. package/build/components/global-styles/screen-colors.js +1 -4
  33. package/build/components/global-styles/screen-colors.js.map +1 -1
  34. package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  35. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  36. package/build/components/global-styles/typography-example.js +5 -2
  37. package/build/components/global-styles/typography-example.js.map +1 -1
  38. package/build/components/global-styles/ui.js +4 -1
  39. package/build/components/global-styles/ui.js.map +1 -1
  40. package/build/components/global-styles/variations/variation.js +12 -6
  41. package/build/components/global-styles/variations/variation.js.map +1 -1
  42. package/build/components/global-styles/variations/variations-color.js +5 -5
  43. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  44. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  45. package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  46. package/build/components/global-styles-sidebar/index.js.map +1 -0
  47. package/build/components/header-edit-mode/index.js +20 -120
  48. package/build/components/header-edit-mode/index.js.map +1 -1
  49. package/build/components/layout/index.js +3 -6
  50. package/build/components/layout/index.js.map +1 -1
  51. package/build/components/layout/router.js +69 -14
  52. package/build/components/layout/router.js.map +1 -1
  53. package/build/components/page/index.js +2 -2
  54. package/build/components/page/index.js.map +1 -1
  55. package/build/components/page-pages/index.js +4 -15
  56. package/build/components/page-pages/index.js.map +1 -1
  57. package/build/components/page-patterns/dataviews-pattern-actions.js +4 -80
  58. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  59. package/build/components/page-patterns/index.js +9 -20
  60. package/build/components/page-patterns/index.js.map +1 -1
  61. package/build/components/page-templates/index.js +6 -14
  62. package/build/components/page-templates/index.js.map +1 -1
  63. package/build/components/pagination/index.js +2 -2
  64. package/build/components/pagination/index.js.map +1 -1
  65. package/build/components/resizable-frame/index.js +11 -3
  66. package/build/components/resizable-frame/index.js.map +1 -1
  67. package/build/components/revisions/index.js +5 -2
  68. package/build/components/revisions/index.js.map +1 -1
  69. package/build/components/save-panel/index.js +4 -4
  70. package/build/components/save-panel/index.js.map +1 -1
  71. package/build/components/sidebar/index.js +61 -31
  72. package/build/components/sidebar/index.js.map +1 -1
  73. package/build/components/sidebar-button/index.js +2 -2
  74. package/build/components/sidebar-button/index.js.map +1 -1
  75. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  76. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  77. package/build/components/sidebar-navigation-item/index.js +5 -3
  78. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen/index.js +6 -32
  80. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  81. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  82. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  83. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  84. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  85. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  86. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  87. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  88. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  90. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  91. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  92. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  94. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  95. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
  96. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  97. package/build/components/sidebar-navigation-screen-pattern/index.js +4 -9
  98. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  99. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -14
  100. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-template/index.js +4 -1
  102. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
  104. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  105. package/build/components/site-hub/index.js +3 -3
  106. package/build/components/site-hub/index.js.map +1 -1
  107. package/build/components/site-icon/index.js +2 -2
  108. package/build/components/site-icon/index.js.map +1 -1
  109. package/build/components/style-book/index.js +10 -7
  110. package/build/components/style-book/index.js.map +1 -1
  111. package/build/components/template-part-converter/index.js +18 -1
  112. package/build/components/template-part-converter/index.js.map +1 -1
  113. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -2
  114. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  115. package/build/utils/get-is-list-page.js +1 -1
  116. package/build/utils/get-is-list-page.js.map +1 -1
  117. package/build/utils/use-activate-theme.js +9 -6
  118. package/build/utils/use-activate-theme.js.map +1 -1
  119. package/build-module/components/add-new-template/index.js +2 -2
  120. package/build-module/components/add-new-template/index.js.map +1 -1
  121. package/build-module/components/app/index.js +4 -2
  122. package/build-module/components/app/index.js.map +1 -1
  123. package/build-module/components/block-editor/editor-canvas.js +4 -18
  124. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  125. package/build-module/components/block-editor/site-editor-canvas.js +2 -2
  126. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  127. package/build-module/components/dataviews-actions/index.js +38 -0
  128. package/build-module/components/dataviews-actions/index.js.map +1 -0
  129. package/build-module/components/editor/index.js +69 -13
  130. package/build-module/components/editor/index.js.map +1 -1
  131. package/build-module/components/global-styles/background-panel.js +12 -1
  132. package/build-module/components/global-styles/background-panel.js.map +1 -1
  133. package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
  134. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  135. package/build-module/components/global-styles/color-palette-panel.js +4 -2
  136. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  137. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  138. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  139. package/build-module/components/global-styles/hooks.js +4 -1
  140. package/build-module/components/global-styles/hooks.js.map +1 -1
  141. package/build-module/components/global-styles/icon-with-current-color.js +2 -2
  142. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  143. package/build-module/components/global-styles/preset-colors.js +22 -0
  144. package/build-module/components/global-styles/preset-colors.js.map +1 -0
  145. package/build-module/components/global-styles/preview-colors.js +3 -7
  146. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  147. package/build-module/components/global-styles/screen-color-palette.js +5 -5
  148. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  149. package/build-module/components/global-styles/screen-colors.js +1 -4
  150. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  151. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  152. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  153. package/build-module/components/global-styles/typography-example.js +4 -1
  154. package/build-module/components/global-styles/typography-example.js.map +1 -1
  155. package/build-module/components/global-styles/ui.js +4 -1
  156. package/build-module/components/global-styles/ui.js.map +1 -1
  157. package/build-module/components/global-styles/variations/variation.js +11 -5
  158. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  159. package/build-module/components/global-styles/variations/variations-color.js +6 -6
  160. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  161. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  162. package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  163. package/build-module/components/global-styles-sidebar/index.js.map +1 -0
  164. package/build-module/components/header-edit-mode/index.js +20 -120
  165. package/build-module/components/header-edit-mode/index.js.map +1 -1
  166. package/build-module/components/layout/index.js +3 -6
  167. package/build-module/components/layout/index.js.map +1 -1
  168. package/build-module/components/layout/router.js +69 -15
  169. package/build-module/components/layout/router.js.map +1 -1
  170. package/build-module/components/page/index.js +2 -2
  171. package/build-module/components/page/index.js.map +1 -1
  172. package/build-module/components/page-pages/index.js +4 -15
  173. package/build-module/components/page-pages/index.js.map +1 -1
  174. package/build-module/components/page-patterns/dataviews-pattern-actions.js +4 -80
  175. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  176. package/build-module/components/page-patterns/index.js +10 -21
  177. package/build-module/components/page-patterns/index.js.map +1 -1
  178. package/build-module/components/page-templates/index.js +6 -14
  179. package/build-module/components/page-templates/index.js.map +1 -1
  180. package/build-module/components/pagination/index.js +2 -2
  181. package/build-module/components/pagination/index.js.map +1 -1
  182. package/build-module/components/resizable-frame/index.js +12 -4
  183. package/build-module/components/resizable-frame/index.js.map +1 -1
  184. package/build-module/components/revisions/index.js +4 -1
  185. package/build-module/components/revisions/index.js.map +1 -1
  186. package/build-module/components/save-panel/index.js +4 -4
  187. package/build-module/components/save-panel/index.js.map +1 -1
  188. package/build-module/components/sidebar/index.js +62 -32
  189. package/build-module/components/sidebar/index.js.map +1 -1
  190. package/build-module/components/sidebar-button/index.js +2 -2
  191. package/build-module/components/sidebar-button/index.js.map +1 -1
  192. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  193. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  194. package/build-module/components/sidebar-navigation-item/index.js +5 -3
  195. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  196. package/build-module/components/sidebar-navigation-screen/index.js +6 -32
  197. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  198. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  199. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  200. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  201. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  202. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  203. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  204. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  205. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  206. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  207. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  208. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  209. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  210. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  211. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  212. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
  213. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  214. package/build-module/components/sidebar-navigation-screen-pattern/index.js +4 -9
  215. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  216. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -14
  217. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  218. package/build-module/components/sidebar-navigation-screen-template/index.js +4 -1
  219. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  220. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
  221. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  222. package/build-module/components/site-hub/index.js +3 -3
  223. package/build-module/components/site-hub/index.js.map +1 -1
  224. package/build-module/components/site-icon/index.js +2 -2
  225. package/build-module/components/site-icon/index.js.map +1 -1
  226. package/build-module/components/style-book/index.js +9 -6
  227. package/build-module/components/style-book/index.js.map +1 -1
  228. package/build-module/components/template-part-converter/index.js +18 -1
  229. package/build-module/components/template-part-converter/index.js.map +1 -1
  230. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +4 -1
  231. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  232. package/build-module/utils/get-is-list-page.js +1 -1
  233. package/build-module/utils/get-is-list-page.js.map +1 -1
  234. package/build-module/utils/use-activate-theme.js +9 -6
  235. package/build-module/utils/use-activate-theme.js.map +1 -1
  236. package/build-style/style-rtl.css +144 -374
  237. package/build-style/style.css +144 -374
  238. package/package.json +43 -45
  239. package/src/components/add-new-template/index.js +2 -2
  240. package/src/components/app/index.js +5 -2
  241. package/src/components/block-editor/editor-canvas.js +6 -26
  242. package/src/components/block-editor/site-editor-canvas.js +2 -2
  243. package/src/components/block-editor/style.scss +2 -2
  244. package/src/components/dataviews-actions/index.js +38 -0
  245. package/src/components/editor/index.js +76 -16
  246. package/src/components/editor/style.scss +0 -4
  247. package/src/components/global-styles/background-panel.js +17 -2
  248. package/src/components/global-styles/color-indicator-wrapper.js +2 -2
  249. package/src/components/global-styles/color-palette-panel.js +3 -4
  250. package/src/components/global-styles/gradients-palette-panel.js +1 -4
  251. package/src/components/global-styles/hooks.js +2 -1
  252. package/src/components/global-styles/icon-with-current-color.js +2 -2
  253. package/src/components/global-styles/preset-colors.js +18 -0
  254. package/src/components/global-styles/preview-colors.js +4 -7
  255. package/src/components/global-styles/screen-color-palette.js +4 -4
  256. package/src/components/global-styles/screen-colors.js +0 -2
  257. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  258. package/src/components/global-styles/stories/index.story.js +2 -1
  259. package/src/components/global-styles/typography-example.js +2 -1
  260. package/src/components/global-styles/ui.js +5 -1
  261. package/src/components/global-styles/variations/style.scss +15 -31
  262. package/src/components/global-styles/variations/variation.js +13 -10
  263. package/src/components/global-styles/variations/variations-color.js +5 -8
  264. package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
  265. package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
  266. package/src/components/header-edit-mode/index.js +25 -164
  267. package/src/components/header-edit-mode/style.scss +1 -199
  268. package/src/components/layout/index.js +3 -8
  269. package/src/components/layout/router.js +65 -15
  270. package/src/components/layout/style.scss +2 -1
  271. package/src/components/page/index.js +2 -2
  272. package/src/components/page-pages/index.js +8 -38
  273. package/src/components/page-pages/style.scss +0 -11
  274. package/src/components/page-patterns/dataviews-pattern-actions.js +3 -92
  275. package/src/components/page-patterns/index.js +16 -35
  276. package/src/components/page-templates/index.js +10 -29
  277. package/src/components/pagination/index.js +2 -2
  278. package/src/components/resizable-frame/index.js +16 -4
  279. package/src/components/revisions/index.js +2 -1
  280. package/src/components/save-panel/index.js +4 -4
  281. package/src/components/sidebar/index.js +61 -37
  282. package/src/components/sidebar-button/index.js +2 -5
  283. package/src/components/sidebar-dataviews/dataview-item.js +4 -7
  284. package/src/components/sidebar-navigation-item/index.js +3 -3
  285. package/src/components/sidebar-navigation-screen/index.js +7 -31
  286. package/src/components/sidebar-navigation-screen/style.scss +11 -9
  287. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  288. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
  289. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  290. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
  291. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  292. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
  293. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
  294. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
  295. package/src/components/sidebar-navigation-screen-pattern/index.js +2 -8
  296. package/src/components/sidebar-navigation-screen-patterns/index.js +2 -13
  297. package/src/components/sidebar-navigation-screen-template/index.js +2 -1
  298. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
  299. package/src/components/site-hub/index.js +3 -3
  300. package/src/components/site-icon/index.js +2 -2
  301. package/src/components/style-book/index.js +7 -6
  302. package/src/components/template-part-converter/index.js +16 -3
  303. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  304. package/src/style.scss +1 -11
  305. package/src/utils/get-is-list-page.js +1 -3
  306. package/src/utils/use-activate-theme.js +4 -4
  307. package/build/components/global-styles/global-styles-provider.js +0 -129
  308. package/build/components/global-styles/global-styles-provider.js.map +0 -1
  309. package/build/components/header-edit-mode/document-tools/index.js +0 -68
  310. package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
  311. package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  312. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  313. package/build/components/sidebar-edit-mode/index.js +0 -147
  314. package/build/components/sidebar-edit-mode/index.js.map +0 -1
  315. package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
  316. package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  317. package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
  318. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  319. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
  320. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  321. package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
  322. package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  323. package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
  324. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  325. package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
  326. package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  327. package/build/components/start-template-options/index.js +0 -191
  328. package/build/components/start-template-options/index.js.map +0 -1
  329. package/build/utils/math.js +0 -98
  330. package/build/utils/math.js.map +0 -1
  331. package/build-module/components/global-styles/global-styles-provider.js +0 -120
  332. package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
  333. package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
  334. package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
  335. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  336. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  337. package/build-module/components/sidebar-edit-mode/index.js +0 -138
  338. package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
  339. package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
  340. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  341. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
  342. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  343. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
  344. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  345. package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
  346. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  347. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
  348. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  349. package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
  350. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  351. package/build-module/components/start-template-options/index.js +0 -184
  352. package/build-module/components/start-template-options/index.js.map +0 -1
  353. package/build-module/utils/math.js +0 -92
  354. package/build-module/utils/math.js.map +0 -1
  355. package/src/components/global-styles/global-styles-provider.js +0 -162
  356. package/src/components/header-edit-mode/document-tools/index.js +0 -68
  357. package/src/components/sidebar-edit-mode/index.js +0 -173
  358. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
  359. package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
  360. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
  361. package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
  362. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
  363. package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
  364. package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
  365. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
  366. package/src/components/start-template-options/index.js +0 -231
  367. package/src/components/start-template-options/style.scss +0 -55
  368. package/src/utils/math.js +0 -93
  369. /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  370. /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  371. /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
@@ -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,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,CAAA,EAAG;EAC/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,CAAEP,cAAc,EAAG;IACtC,OACCmB,aAAA,CAAC/B,8BAA8B;MAC9BgC,WAAW,EAAGrC,EAAE,CAAE,0BAA2B;IAAG,CAChD,CAAC;EAEJ;EAEA,IAAK,CAAEiB,cAAc,EAAEsB,OAAO,EAAEC,GAAG,EAAG;IACrC,OACCJ,aAAA,CAAC/B,8BAA8B;MAC9BoC,OAAO,EACNL,aAAA,CAAC9B,wBAAwB;QACxBmB,SAAS,EAAGvB,cAAc,CAAEuB,SAAU,CAAG;QACzCiB,QAAQ,EAAGV,aAAe;QAC1BW,MAAM,EAAGV,WAAa;QACtBW,WAAW,EAAGT;MAAkB,CAChC,CACD;MACDT,KAAK,EAAGjB,oBAAoB,CAC3BQ,cAAc,EAAES,KAAK,EACrBT,cAAc,EAAE4B,EAAE,EAClB5B,cAAc,EAAE6B,MACjB,CAAG;MACHT,WAAW,EAAGrC,EAAE,CAAE,gCAAiC;IAAG,CACtD,CAAC;EAEJ;EAEA,OACCoC,aAAA,CAAC7B,oBAAoB;IACpBU,cAAc,EAAGA,cAAgB;IACjCa,YAAY,EAAGE,aAAe;IAC9BH,UAAU,EAAGI,WAAa;IAC1BF,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,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,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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CAAC,CAAC;IACV;EAAG,GAEDzB,EAAE,CAAE,QAAS,CACN,CAAC,EACXmB,aAAA,CAACtB,QAAQ;IACR6B,OAAO,EAAGA,CAAA,KAAM;MACfhB,WAAW,CAAC,CAAC;MACbe,OAAO,CAAC,CAAC;IACV;EAAG,GAEDzB,EAAE,CAAE,WAAY,CACT,CAAC,EACXmB,aAAA,CAACtB,QAAQ;IACR8B,aAAa;IACbD,OAAO,EAAGA,CAAA,KAAM;MACfR,uBAAuB,CAAC,CAAC;;MAEzB;MACAO,OAAO,CAAC,CAAC;IACV;EAAG,GAEDzB,EAAE,CAAE,QAAS,CACN,CACA,CACP,CAEO,CAAC,EACbc,uBAAuB,IACxBK,aAAA,CAAChB,mBAAmB;IACnBsB,OAAO,EAAGT,WAAa;IACvBY,SAAS,EAAGpB;EAAU,CACtB,CACD,EACCI,eAAe,IAChBO,aAAA,CAACjB,WAAW;IACXuB,OAAO,EAAGT,WAAa;IACvBL,SAAS,EAAGA,SAAW;IACvBF,MAAM,EAAGA;EAAQ,CACjB,CAED,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["DropdownMenu","MenuItem","MenuGroup","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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B,aAAA,CAAC5B,QAAQ;IACRmC,OAAO,EAAGA,CAAA,KAAM;MACfT,eAAe,CAAC,CAAC;MACjB;MACAQ,OAAO,CAAC,CAAC;IACV;EAAG,GAED/B,EAAE,CAAE,QAAS,CACN,CAAC,EACXyB,aAAA,CAAC5B,QAAQ;IACRmC,OAAO,EAAGA,CAAA,KAAM;MACfX,OAAO,CAACY,IAAI,CAAE;QACbC,MAAM,EAAElB,MAAM;QACdmB,QAAQ,EAAE,eAAe;QACzBC,MAAM,EAAE;MACT,CAAE,CAAC;IACJ;EAAG,GAEDpC,EAAE,CAAE,MAAO,CACJ,CAAC,EACXyB,aAAA,CAAC5B,QAAQ;IACRmC,OAAO,EAAGA,CAAA,KAAM;MACflB,WAAW,CAAC,CAAC;MACbiB,OAAO,CAAC,CAAC;IACV;EAAG,GAED/B,EAAE,CAAE,WAAY,CACT,CAAC,EACXyB,aAAA,CAAC5B,QAAQ;IACRwC,aAAa;IACbL,OAAO,EAAGA,CAAA,KAAM;MACfR,uBAAuB,CAAC,CAAC;;MAEzB;MACAO,OAAO,CAAC,CAAC;IACV;EAAG,GAED/B,EAAE,CAAE,QAAS,CACN,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,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,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAOhB,cAAc,CAAEc,KAAM,CAAC;EAC/B;EAEA,OAAOnB,OAAO;EACb;EACAD,EAAE,CAAE,aAAc,CAAC,EACnBM,cAAc,CAAEc,KAAM,CAAC,EACvBE,MACD,CAAC;AACF;;AAEA;AACA,IAAIC,kBAAkB,GAAG,KAAK;AAE9B,eAAe,SAASC,sCAAsCA,CAA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AMA,eAAe,CAAEH,mBAAoB,CAAG;MAChEC,UAAU,EAAKU,KAAK,IACnBV,UAAU,CAAED,mBAAmB,EAAEW,KAAM;IACvC,CACD,CAAC;EAEJ;EAEA,OACCL,aAAA,CAACC,8BAA8B,QAC9BD,aAAA,CAAC/B,SAAS,QACPkB,eAAe,EAAEmB,GAAG,CAAE,CAAE;IAAExB,EAAE;IAAED,KAAK;IAAEE;EAAO,CAAC,EAAEwB,KAAK,KACrDP,aAAA,CAACQ,WAAW;IACXC,MAAM,EAAG3B,EAAI;IACb4B,GAAG,EAAG5B,EAAI;IACV6B,WAAW;IACXC,IAAI,EAAGzC;EAAY,GAEjBS,cAAc,CAAEC,KAAK,EAAEgC,QAAQ,EAAEN,KAAK,GAAG,CAAC,EAAExB,MAAO,CACzC,CACZ,CACQ,CACoB,CAAC;AAEnC;AAEA,OAAO,SAASkB,8BAA8BA,CAAE;EAC/Ca,QAAQ;EACRC,OAAO;EACPlC,KAAK;EACLsB;AACD,CAAC,EAAG;EACH,OACCH,aAAA,CAAC5B,uBAAuB;IACvBS,KAAK,EAAGA,KAAK,IAAIpB,EAAE,CAAE,YAAa,CAAG;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,g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AAChB,QAAQ,EAAGA;EAAU,GACpDe,aAAA,CAAChC,SAAS,QACPmB,eAAe,EAAEmB,GAAG,CAAE,CAAE;IAAEzB,EAAE;IAAED,KAAK;IAAEE;EAAO,CAAC,EAAEyB,KAAK,KACrDP,aAAA,CAACQ,WAAW;IACXC,MAAM,EAAG5B,EAAI;IACb6B,GAAG,EAAG7B,EAAI;IACV8B,WAAW;IACXC,IAAI,EAAG1C;EAAY,GAEjBS,cAAc,CAAEC,KAAK,EAAEiC,QAAQ,EAAEN,KAAK,GAAG,CAAC,EAAEzB,MAAO,CACzC,CACZ,CACQ,CACoB,CAAC;AAEnC;AAEA,OAAO,SAASmB,8BAA8BA,CAAE;EAC/Ca,QAAQ;EACRC,OAAO;EACPnC,KAAK;EACLuB,WAAW;EACXlB;AACD,CAAC,EAAG;EACH,OACCe,aAAA,CAAC7B,uBAAuB;IACvBS,KAAK,EAAGA,KAAK,IAAIpB,EAAE,CAAE,YAAa,CAAG;IACrCuD,OAAO,EAAGA,OAAS;IACnBZ,WAAW,EAAGA,WAAW,IAAI3C,EAAE,CAAE,+BAAgC,CAAG;IACpEyB,QAAQ,EAAGA,QAAU;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,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,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AACxC,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGF,MAAM,CAAEN,iBAAkB,CAAC;AAE/D,eAAe,SAASS,YAAYA,CAAEC,KAAK,EAAG;EAC7C,MAAM;IA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O,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\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AAC,KACdL,aAAA,CAAAM,QAAA,QACCN,aAAA,CAAC3C,SAAS,QACT2C,aAAA,CAAC5C,QAAQ;IACR6C,IAAI,EAAGjD,SAAW;IAClBuD,OAAO,EAAGA,CAAA,KAAM;MACf1B,YAAY,CAAE,CAAEF,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC1CmB,OAAO,CAAC,CAAC;IACV;EAAG,GAED5C,EAAE,CAAE,SAAU,CACP,CAAC,EACXuC,aAAA,CAAC5C,QAAQ;IACR6C,IAAI,EAAGhD,WAAa;IACpBsD,OAAO,EAAGA,CAAA,KAAM;MACf3B,cAAc,CAAE,CAAED,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC5CmB,OAAO,CAAC,CAAC;IACV;EAAG,GAED5C,EAAE,CAAE,WAAY,CACT,CAAC,EACTiB,KAAK,CAACa,UAAU,EAAEI,IAAI,KAAK,MAAM,IAClCjB,KAAK,CAACa,UAAU,EAAEG,EAAE,IACnBM,aAAA,CAAC5C,QAAQ;IACRmD,OAAO,EAAGA,CAAA,KAAM;MACflB,UAAU,CAAEX,KAAM,CAAC;MACnB2B,OAAO,CAAC,CAAC;IACV;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 } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -49,7 +49,7 @@ export default function StatusLabel({
49
49
  break;
50
50
  }
51
51
  return createElement("div", {
52
- className: classnames('edit-site-sidebar-navigation-screen-page__status', {
52
+ className: clsx('edit-site-sidebar-navigation-screen-page__status', {
53
53
  [`has-status has-${status}-status`]: !!status
54
54
  })
55
55
  }, statusLabel);
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","sprintf","dateI18n","getDate","humanTimeDiff","createInterpolateElement","StatusLabel","status","date","short","relateToNow","statusLabel","time","createElement","dateTime","formattedDate","className"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusLabel }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,aAAa,QAAQ,iBAAiB;AAClE,SAASC,wBAAwB,QAAQ,oBAAoB;AAE7D,eAAe,SAASC,WAAWA,CAAE;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAM,CAAC,EAAG;EAC9D,MAAMC,WAAW,GAAGN,aAAa,CAAEI,IAAK,CAAC;EACzC,IAAIG,WAAW,GAAGJ,MAAM;EACxB,QAASA,MAAM;IACd,KAAK,SAAS;MACbI,WAAW,GAAGH,IAAI,GACfH,wBAAwB,CACxBJ,OAAO,EACN;MACAD,EAAE,CAAE,2BAA4B,CAAC,EACjCU,WACD,CAAC,EACD;QAAEE,IAAI,EAAEC,aAAA;UAAMC,QAAQ,EAAGN;QAAM,CAAE;MAAE,CACnC,CAAC,GACDR,EAAE,CAAE,WAAY,CAAC;MACpB;IACD,KAAK,QAAQ;MACZ,MAAMe,aAAa,GAAGb,QAAQ,CAC7BO,KAAK,GAAG,KAAK,GAAG,KAAK,EACrBN,OAAO,CAAEK,IAAK,CACf,CAAC;MACDG,WAAW,GAAGH,IAAI,GACfH,wBAAwB,CACxBJ,OAAO,EACN;MACAD,EAAE,CAAE,4BAA6B,CAAC,EAClCe,aACD,CAAC,EACD;QAAEH,IAAI,EAAEC,aAAA;UAAMC,QAAQ,EAAGN;QAAM,CAAE;MAAE,CACnC,CAAC,GACDR,EAAE,CAAE,WAAY,CAAC;MACpB;IACD,KAAK,OAAO;MACXW,WAAW,GAAGX,EAAE,CAAE,OAAQ,CAAC;MAC3B;IACD,KAAK,SAAS;MACbW,WAAW,GAAGX,EAAE,CAAE,SAAU,CAAC;MAC7B;IACD,KAAK,SAAS;MACbW,WAAW,GAAGX,EAAE,CAAE,SAAU,CAAC;MAC7B;IACD,KAAK,WAAW;MACfW,WAAW,GAAGX,EAAE,CAAE,oBAAqB,CAAC;MACxC;EACF;EAEA,OACCa,aAAA;IACCG,SAAS,EAAGjB,UAAU,CACrB,kDAAkD,EAClD;MACC,CAAG,kBAAkBQ,MAAQ,SAAQ,GAAI,CAAC,CAAEA;IAC7C,CACD;EAAG,GAEDI,WACE,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","sprintf","dateI18n","getDate","humanTimeDiff","createInterpolateElement","StatusLabel","status","date","short","relateToNow","statusLabel","time","createElement","dateTime","formattedDate","className"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusLabel }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,aAAa,QAAQ,iBAAiB;AAClE,SAASC,wBAAwB,QAAQ,oBAAoB;AAE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]}
@@ -21,15 +21,15 @@ const {
21
21
  useLocation,
22
22
  useHistory
23
23
  } = unlock(routerPrivateApis);
24
- export default function SidebarNavigationScreenPattern() {
24
+ export default function SidebarNavigationScreenPattern({
25
+ backPath
26
+ }) {
25
27
  const history = useHistory();
26
28
  const location = useLocation();
27
29
  const {
28
30
  params: {
29
31
  postType,
30
- postId,
31
- categoryId,
32
- categoryType
32
+ postId
33
33
  }
34
34
  } = location;
35
35
  const {
@@ -37,11 +37,6 @@ export default function SidebarNavigationScreenPattern() {
37
37
  } = unlock(useDispatch(editSiteStore));
38
38
  useInitEditedEntityFromURL();
39
39
  const patternDetails = usePatternDetails(postType, postId);
40
- const backPath = {
41
- categoryId,
42
- categoryType,
43
- path: '/patterns'
44
- };
45
40
  return createElement(SidebarNavigationScreen, {
46
41
  actions: createElement(Fragment, null, createElement(TemplateActions, {
47
42
  postType: postType,
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","__","pencil","privateApis","routerPrivateApis","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","TemplateActions","useLocation","useHistory","SidebarNavigationScreenPattern","history","location","params","postType","postId","categoryId","categoryType","setCanvasMode","patternDetails","backPath","path","createElement","actions","Fragment","toggleProps","as","onRemove","push","onClick","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport usePatternDetails from './use-pattern-details';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport TemplateActions from '../template-actions';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenPattern() {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tparams: { postType, postId, categoryId, categoryType },\n\t} = location;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\tconst backPath = {\n\t\tcategoryId,\n\t\tcategoryType,\n\t\tpath: '/patterns',\n\t};\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<TemplateActions\n\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\ttoggleProps={ { as: SidebarButton } }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tbackPath={ backPath }\n\t\t\t{ ...patternDetails }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,0BAA0B,MAAM,wDAAwD;AAC/F,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB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Apis","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","TemplateActions","useLocation","useHistory","SidebarNavigationScreenPattern","backPath","history","location","params","postType","postId","setCanvasMode","patternDetails","createElement","actions","Fragment","toggleProps","as","onRemove","push","onClick","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport usePatternDetails from './use-pattern-details';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport TemplateActions from '../template-actions';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenPattern( { backPath } ) {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = location;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<TemplateActions\n\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\ttoggleProps={ { as: SidebarButton } }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t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jBM,WAAW,EAAG;QAAEC,EAAE,EAAEvB;MAAc,CAAG;MACrCwB,QAAQ,EAAGA,CAAA,KAAM;QAChBZ,OAAO,CAACa,IAAI,CAAEd,QAAS,CAAC;MACzB;IAAG,CACH,CAAC,EACFQ,aAAA,CAACnB,aAAa;MACb0B,OAAO,EAAGA,CAAA,KAAMT,aAAa,CAAE,MAAO,CAAG;MACzCU,KAAK,EAAG/B,EAAE,CAAE,MAAO,CAAG;MACtBgC,IAAI,EAAG/B;IAAQ,CACf,CACA,CACF;IACDc,QAAQ,EAAGA,QAAU;IAAA,GAChBO;EAAc,CACnB,CAAC;AAEJ","ignoreList":[]}
@@ -78,7 +78,9 @@ function CategoriesGroup({
78
78
  isActive: currentCategory === `${category.name}` && (currentType === PATTERN_TYPES.theme || currentType === PATTERN_TYPES.user)
79
79
  })));
80
80
  }
81
- export default function SidebarNavigationScreenPatterns() {
81
+ export default function SidebarNavigationScreenPatterns({
82
+ backPath
83
+ }) {
82
84
  const {
83
85
  params: {
84
86
  categoryType,
@@ -98,23 +100,11 @@ export default function SidebarNavigationScreenPatterns() {
98
100
  hasPatterns
99
101
  } = usePatternCategories();
100
102
  const isBlockBasedTheme = useSelect(select => select(coreStore).getCurrentTheme()?.is_block_theme, []);
101
-
102
- /**
103
- * This sidebar needs to temporarily accomodate two different "URLs":
104
- *
105
- * 1. path = /patterns
106
- * Block based themes. Also classic themes can access this URL, though it's not linked anywhere.
107
- *
108
- * 2. path = /wp_template_part/all
109
- * Classic themes with support for block-template-parts. We need to list only Template Parts in this case.
110
- * The URL is accessible from the Appearance > Template Parts menu.
111
- *
112
- * This is temporary. We aim to consolidate to /patterns.
113
- */
114
103
  return createElement(SidebarNavigationScreen, {
115
104
  isRoot: !isBlockBasedTheme,
116
105
  title: __('Patterns'),
117
106
  description: __('Manage what patterns are available when editing the site.'),
107
+ backPath: backPath,
118
108
  actions: createElement(AddNewPattern, null),
119
109
  content: createElement(Fragment, null, isLoading && __('Loading items…'), !isLoading && createElement(Fragment, null, !hasTemplateParts && !hasPatterns && createElement(ItemGroup, {
120
110
  className: "edit-site-sidebar-navigation-screen-patterns__group"
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","getTemplatePartIcon","__","store","coreStore","useSelect","file","privateApis","routerPrivateApis","AddNewPattern","SidebarNavigationScreen","CategoryItem","PATTERN_DEFAULT_CATEGORY","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","TEMPLATE_PART_ALL_AREAS_CATEGORY","usePatternCategories","useTemplatePartAreas","unlock","useLocation","CategoriesGroup","path","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","createElement","className","key","count","Object","values","map","templateParts","length","reduce","acc","val","icon","label","id","type","isActive","entries","area","name","theme","user","category","SidebarNavigationScreenPatterns","params","categoryType","categoryId","hasTemplateParts","isLoading","hasPatterns","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","isRoot","title","description","actions","content","Fragment"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport AddNewPattern from '../add-new-pattern';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\tpath,\n\ttemplatePartAreas,\n\tpatternCategories,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\tconst [ allPatterns, ...otherPatterns ] = patternCategories;\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t<CategoryItem\n\t\t\t\tkey=\"all\"\n\t\t\t\tpath={ path }\n\t\t\t\tcount={ Object.values( templatePartAreas )\n\t\t\t\t\t.map( ( { templateParts } ) => templateParts?.length || 0 )\n\t\t\t\t\t.reduce( ( acc, val ) => acc + val, 0 ) }\n\t\t\t\ticon={ getTemplatePartIcon() } /* no name, so it provides the fallback icon */\n\t\t\t\tlabel={ __( 'All template parts' ) }\n\t\t\t\tid={ TEMPLATE_PART_ALL_AREAS_CATEGORY }\n\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\tisActive={\n\t\t\t\t\tcurrentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY &&\n\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t( [ area, { label, templateParts } ] ) => (\n\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\tpath={ path }\n\t\t\t\t\t\tcount={ templateParts?.length }\n\t\t\t\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\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<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ allPatterns && (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ allPatterns.name }\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tcount={ allPatterns.count }\n\t\t\t\t\tlabel={ allPatterns.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ allPatterns.name }\n\t\t\t\t\ttype=\"pattern\"\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ allPatterns.name }` &&\n\t\t\t\t\t\t( currentType === PATTERN_TYPES.theme ||\n\t\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ otherPatterns.map( ( category ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tcount={ category.count }\n\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ category.name }\n\t\t\t\t\ttype=\"pattern\"\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ category.name }` &&\n\t\t\t\t\t\t( currentType === PATTERN_TYPES.theme ||\n\t\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns() {\n\tconst {\n\t\tparams: { categoryType, categoryId, path },\n\t} = useLocation();\n\tconst currentCategory = categoryId || PATTERN_DEFAULT_CATEGORY;\n\tconst currentType = categoryType || PATTERN_TYPES.theme;\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\t/**\n\t * This sidebar needs to temporarily accomodate two different \"URLs\":\n\t *\n\t * 1. path = /patterns\n\t * Block based themes. Also classic themes can access this URL, though it's not linked anywhere.\n\t *\n\t * 2. path = /wp_template_part/all\n\t * Classic themes with support for block-template-parts. We need to list only Template Parts in this case.\n\t * The URL is accessible from the Appearance > Template Parts menu.\n\t *\n\t * This is temporary. We aim to consolidate to /patterns.\n\t */\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ ! isBlockBasedTheme }\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tactions={ <AddNewPattern /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\tpath={ path }\n\t\t\t\t\t\t\t\ttemplatePartAreas={ templatePartAreas }\n\t\t\t\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ currentType }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IA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E,CAAE,gBAAiB,CAAC,EACnC,CAAEsD,SAAS,IACZ5B,aAAA,CAAAuC,QAAA,QACG,CAAEZ,gBAAgB,IAAI,CAAEE,WAAW,IACpC7B,aAAA,CAAC9B,SAAS;MAAC+B,SAAS,EAAC;IAAqD,GACzED,aAAA,CAAC5B,IAAI,QAAGE,EAAE,CAAE,gBAAiB,CAAS,CAC5B,CACX,EACD0B,aAAA,CAACR,eAAe;MACfC,IAAI,EAAGA,IAAM;MACbC,iBAAiB,EAAGA,iBAAmB;MACvCC,iBAAiB,EAAGA,iBAAmB;MACvCC,eAAe,EAAGA,eAAiB;MACnCC,WAAW,EAAGA;IAAa,CAC3B,CACA,CAEF;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","getTemplatePartIcon","__","store","coreStore","useSelect","file","privateApis","routerPrivateApis","AddNewPattern","SidebarNavigationScreen","CategoryItem","PATTERN_DEFAULT_CATEGORY","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","TEMPLATE_PART_ALL_AREAS_CATEGORY","usePatternCategories","useTemplatePartAreas","unlock","useLocation","CategoriesGroup","path","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","createElement","className","key","count","Object","values","map","templateParts","length","reduce","acc","val","icon","label","id","type","isActive","entries","area","name","theme","user","category","SidebarNavigationScreenPatterns","backPath","params","categoryType","categoryId","hasTemplateParts","isLoading","hasPatterns","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","isRoot","title","description","actions","content","Fragment"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport AddNewPattern from '../add-new-pattern';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\tpath,\n\ttemplatePartAreas,\n\tpatternCategories,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\tconst [ allPatterns, ...otherPatterns ] = patternCategories;\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t<CategoryItem\n\t\t\t\tkey=\"all\"\n\t\t\t\tpath={ path }\n\t\t\t\tcount={ Object.values( templatePartAreas )\n\t\t\t\t\t.map( ( { templateParts } ) => templateParts?.length || 0 )\n\t\t\t\t\t.reduce( ( acc, val ) => acc + val, 0 ) }\n\t\t\t\ticon={ getTemplatePartIcon() } /* no name, so it provides the fallback icon */\n\t\t\t\tlabel={ __( 'All template parts' ) }\n\t\t\t\tid={ TEMPLATE_PART_ALL_AREAS_CATEGORY }\n\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\tisActive={\n\t\t\t\t\tcurrentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY &&\n\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t( [ area, { label, templateParts } ] ) => (\n\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\tpath={ path }\n\t\t\t\t\t\tcount={ templateParts?.length }\n\t\t\t\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\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<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ allPatterns && (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ allPatterns.name }\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tcount={ allPatterns.count }\n\t\t\t\t\tlabel={ allPatterns.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ allPatterns.name }\n\t\t\t\t\ttype=\"pattern\"\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ allPatterns.name }` &&\n\t\t\t\t\t\t( currentType === PATTERN_TYPES.theme ||\n\t\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ otherPatterns.map( ( category ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tcount={ category.count }\n\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ category.name }\n\t\t\t\t\ttype=\"pattern\"\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ category.name }` &&\n\t\t\t\t\t\t( currentType === PATTERN_TYPES.theme ||\n\t\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tparams: { categoryType, categoryId, path },\n\t} = useLocation();\n\tconst currentCategory = categoryId || PATTERN_DEFAULT_CATEGORY;\n\tconst currentType = categoryType || PATTERN_TYPES.theme;\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ ! isBlockBasedTheme }\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tbackPath={ backPath }\n\t\t\tactions={ <AddNewPattern /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\tpath={ path }\n\t\t\t\t\t\t\t\ttemplatePartAreas={ templatePartAreas }\n\t\t\t\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ currentType }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAI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