@wordpress/edit-site 5.32.0 → 5.33.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 (809) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js.map +1 -1
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +282 -13
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +22 -11
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/async/index.js +51 -0
  12. package/build/components/async/index.js.map +1 -0
  13. package/build/components/block-editor/block-inspector-button.js +10 -9
  14. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  15. package/build/components/block-editor/editor-canvas.js +15 -6
  16. package/build/components/block-editor/editor-canvas.js.map +1 -1
  17. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  18. package/build/components/block-editor/resizable-editor.js.map +1 -1
  19. package/build/components/block-editor/resize-handle.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +5 -1
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-loader/index.js.map +1 -1
  25. package/build/components/code-editor/index.js.map +1 -1
  26. package/build/components/create-template-part-modal/index.js.map +1 -1
  27. package/build/components/editor/index.js +35 -8
  28. package/build/components/editor/index.js.map +1 -1
  29. package/build/components/editor-canvas-container/index.js.map +1 -1
  30. package/build/components/error-boundary/index.js.map +1 -1
  31. package/build/components/error-boundary/warning.js.map +1 -1
  32. package/build/components/global-styles/background-panel.js +13 -1
  33. package/build/components/global-styles/background-panel.js.map +1 -1
  34. package/build/components/global-styles/block-preview-panel.js +6 -1
  35. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  36. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  37. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  38. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  39. package/build/components/global-styles/font-families.js +1 -1
  40. package/build/components/global-styles/font-families.js.map +1 -1
  41. package/build/components/global-styles/font-family-item.js.map +1 -1
  42. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  43. package/build/components/global-styles/font-library-modal/context.js +60 -32
  44. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  45. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  46. package/build/components/global-styles/font-library-modal/font-collection.js +11 -4
  47. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  48. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/index.js +1 -1
  51. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  52. package/build/components/global-styles/font-library-modal/installed-fonts.js +10 -9
  53. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  54. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  55. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  57. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  59. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  61. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  63. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  65. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  66. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  67. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  68. package/build/components/global-styles/header.js.map +1 -1
  69. package/build/components/global-styles/highlighted-colors.js +1 -1
  70. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  71. package/build/components/global-styles/hooks.js +11 -3
  72. package/build/components/global-styles/hooks.js.map +1 -1
  73. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  74. package/build/components/global-styles/index.js.map +1 -1
  75. package/build/components/global-styles/navigation-button.js.map +1 -1
  76. package/build/components/global-styles/palette.js.map +1 -1
  77. package/build/components/global-styles/preview-colors.js.map +1 -1
  78. package/build/components/global-styles/preview-iframe.js.map +1 -1
  79. package/build/components/global-styles/preview-styles.js.map +1 -1
  80. package/build/components/global-styles/root-menu.js +2 -2
  81. package/build/components/global-styles/root-menu.js.map +1 -1
  82. package/build/components/global-styles/screen-background.js +1 -1
  83. package/build/components/global-styles/screen-background.js.map +1 -1
  84. package/build/components/global-styles/screen-block-list.js.map +1 -1
  85. package/build/components/global-styles/screen-block.js.map +1 -1
  86. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  87. package/build/components/global-styles/screen-colors.js.map +1 -1
  88. package/build/components/global-styles/screen-css.js.map +1 -1
  89. package/build/components/global-styles/screen-layout.js.map +1 -1
  90. package/build/components/global-styles/screen-revisions/index.js +1 -1
  91. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  92. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  93. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  94. package/build/components/global-styles/screen-root.js.map +1 -1
  95. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  96. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  97. package/build/components/global-styles/screen-typography.js.map +1 -1
  98. package/build/components/global-styles/style-variations-container.js.map +1 -1
  99. package/build/components/global-styles/subtitle.js.map +1 -1
  100. package/build/components/global-styles/typography-elements.js.map +1 -1
  101. package/build/components/global-styles/typography-example.js.map +1 -1
  102. package/build/components/global-styles/typography-panel.js.map +1 -1
  103. package/build/components/global-styles/typography-preview.js.map +1 -1
  104. package/build/components/global-styles/ui.js +1 -1
  105. package/build/components/global-styles/ui.js.map +1 -1
  106. package/build/components/global-styles/utils.js.map +1 -1
  107. package/build/components/global-styles/variations/variation.js.map +1 -1
  108. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  109. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  110. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  111. package/build/components/global-styles-renderer/index.js.map +1 -1
  112. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  113. package/build/components/header-edit-mode/index.js +4 -4
  114. package/build/components/header-edit-mode/index.js.map +1 -1
  115. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  116. package/build/components/header-edit-mode/more-menu/index.js +10 -12
  117. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  118. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  119. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  120. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  121. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  122. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  123. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  124. package/build/components/keyboard-shortcuts/register.js +0 -18
  125. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  126. package/build/components/layout/animation.js +3 -2
  127. package/build/components/layout/animation.js.map +1 -1
  128. package/build/components/layout/hooks.js.map +1 -1
  129. package/build/components/layout/index.js +13 -48
  130. package/build/components/layout/index.js.map +1 -1
  131. package/build/components/layout/router.js +73 -7
  132. package/build/components/layout/router.js.map +1 -1
  133. package/build/components/media/index.js.map +1 -1
  134. package/build/components/page/header.js.map +1 -1
  135. package/build/components/page/index.js +5 -2
  136. package/build/components/page/index.js.map +1 -1
  137. package/build/components/page-pages/index.js +15 -17
  138. package/build/components/page-pages/index.js.map +1 -1
  139. package/build/components/page-patterns/dataviews-pattern-actions.js +5 -4
  140. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  141. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  142. package/build/components/page-patterns/header.js +2 -2
  143. package/build/components/page-patterns/header.js.map +1 -1
  144. package/build/components/page-patterns/index.js +124 -17
  145. package/build/components/page-patterns/index.js.map +1 -1
  146. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  147. package/build/components/page-patterns/search-items.js +2 -1
  148. package/build/components/page-patterns/search-items.js.map +1 -1
  149. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  150. package/build/components/page-patterns/use-patterns.js +5 -10
  151. package/build/components/page-patterns/use-patterns.js.map +1 -1
  152. package/build/components/page-patterns/utils.js.map +1 -1
  153. package/build/components/page-templates-template-parts/add-new-template-part.js +2 -1
  154. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  155. package/build/components/page-templates-template-parts/hooks.js.map +1 -1
  156. package/build/components/page-templates-template-parts/index.js +13 -25
  157. package/build/components/page-templates-template-parts/index.js.map +1 -1
  158. package/build/components/pagination/index.js.map +1 -1
  159. package/build/components/pattern-modal/duplicate.js +6 -3
  160. package/build/components/pattern-modal/duplicate.js.map +1 -1
  161. package/build/components/pattern-modal/index.js.map +1 -1
  162. package/build/components/pattern-modal/rename.js +6 -3
  163. package/build/components/pattern-modal/rename.js.map +1 -1
  164. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  165. package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
  166. package/build/components/rename-post-menu-item/index.js.map +1 -0
  167. package/build/components/resizable-frame/index.js +1 -5
  168. package/build/components/resizable-frame/index.js.map +1 -1
  169. package/build/components/revisions/index.js.map +1 -1
  170. package/build/components/routes/link.js.map +1 -1
  171. package/build/components/routes/use-title.js.map +1 -1
  172. package/build/components/save-button/index.js.map +1 -1
  173. package/build/components/save-hub/index.js.map +1 -1
  174. package/build/components/save-panel/index.js +3 -3
  175. package/build/components/save-panel/index.js.map +1 -1
  176. package/build/components/sidebar/index.js +41 -75
  177. package/build/components/sidebar/index.js.map +1 -1
  178. package/build/components/sidebar-button/index.js.map +1 -1
  179. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  180. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  181. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  182. package/build/components/sidebar-dataviews/default-views.js +1 -1
  183. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  184. package/build/components/sidebar-dataviews/index.js +1 -1
  185. package/build/components/sidebar-dataviews/index.js.map +1 -1
  186. package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
  187. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  188. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  189. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  190. package/build/components/sidebar-edit-mode/index.js +29 -54
  191. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  192. package/build/components/sidebar-edit-mode/page-panels/index.js +23 -2
  193. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  194. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  195. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  196. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
  197. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  198. package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
  199. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  201. package/build/components/sidebar-edit-mode/template-panel/index.js +1 -1
  202. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  203. package/build/components/sidebar-navigation-item/index.js +31 -0
  204. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  205. package/build/components/sidebar-navigation-screen/index.js +36 -9
  206. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  207. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  208. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  209. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  210. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  212. package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -2
  213. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-main/index.js +6 -15
  215. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  216. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  217. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  218. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
  219. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  220. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  221. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  223. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  224. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  225. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  226. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  227. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  229. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  230. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  231. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  232. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  233. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-page/index.js +22 -12
  235. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  237. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-pattern/index.js +14 -5
  239. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  241. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  242. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  243. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  245. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  246. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  247. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  248. package/build/components/sidebar-navigation-screen-patterns/index.js +33 -27
  249. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  251. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  253. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  255. package/build/components/sidebar-navigation-screen-template/index.js +10 -7
  256. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  257. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  259. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  260. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  261. package/build/components/site-hub/index.js +22 -21
  262. package/build/components/site-hub/index.js.map +1 -1
  263. package/build/components/site-icon/index.js.map +1 -1
  264. package/build/components/start-template-options/index.js.map +1 -1
  265. package/build/components/style-book/index.js.map +1 -1
  266. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -5
  267. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  268. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  269. package/build/components/table/index.js.map +1 -1
  270. package/build/components/template-actions/index.js +7 -8
  271. package/build/components/template-actions/index.js.map +1 -1
  272. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  273. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  274. package/build/components/template-part-converter/index.js.map +1 -1
  275. package/build/components/use-edited-entity-record/index.js.map +1 -1
  276. package/build/components/welcome-guide/editor.js.map +1 -1
  277. package/build/components/welcome-guide/image.js.map +1 -1
  278. package/build/components/welcome-guide/index.js.map +1 -1
  279. package/build/components/welcome-guide/page.js.map +1 -1
  280. package/build/components/welcome-guide/styles.js +6 -3
  281. package/build/components/welcome-guide/styles.js.map +1 -1
  282. package/build/components/welcome-guide/template.js.map +1 -1
  283. package/build/hooks/commands/use-common-commands.js.map +1 -1
  284. package/build/hooks/commands/use-edit-mode-commands.js +10 -28
  285. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  286. package/build/hooks/components.js.map +1 -1
  287. package/build/hooks/index.js.map +1 -1
  288. package/build/hooks/push-changes-to-global-styles/index.js +3 -40
  289. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  290. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  291. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  292. package/build/index.js +3 -8
  293. package/build/index.js.map +1 -1
  294. package/build/lock-unlock.js.map +1 -1
  295. package/build/store/actions.js +21 -96
  296. package/build/store/actions.js.map +1 -1
  297. package/build/store/constants.js.map +1 -1
  298. package/build/store/index.js +1 -1
  299. package/build/store/index.js.map +1 -1
  300. package/build/store/private-actions.js +1 -85
  301. package/build/store/private-actions.js.map +1 -1
  302. package/build/store/private-selectors.js.map +1 -1
  303. package/build/store/reducer.js.map +1 -1
  304. package/build/store/selectors.js.map +1 -1
  305. package/build/utils/clone-deep.js.map +1 -1
  306. package/build/utils/constants.js +2 -1
  307. package/build/utils/constants.js.map +1 -1
  308. package/build/utils/get-is-list-page.js.map +1 -1
  309. package/build/utils/is-previewing-theme.js.map +1 -1
  310. package/build/utils/is-template-removable.js.map +1 -1
  311. package/build/utils/is-template-revertable.js.map +1 -1
  312. package/build/utils/math.js.map +1 -1
  313. package/build/utils/set-nested-value.js +44 -0
  314. package/build/utils/set-nested-value.js.map +1 -0
  315. package/build/utils/template-part-create.js.map +1 -1
  316. package/build/utils/use-activate-theme.js.map +1 -1
  317. package/build/utils/use-actual-current-theme.js.map +1 -1
  318. package/build-module/components/add-new-page/index.js.map +1 -1
  319. package/build-module/components/add-new-pattern/index.js.map +1 -1
  320. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  321. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  322. package/build-module/components/add-new-template/index.js +283 -14
  323. package/build-module/components/add-new-template/index.js.map +1 -1
  324. package/build-module/components/add-new-template/utils.js +21 -11
  325. package/build-module/components/add-new-template/utils.js.map +1 -1
  326. package/build-module/components/app/index.js.map +1 -1
  327. package/build-module/components/async/index.js +44 -0
  328. package/build-module/components/async/index.js.map +1 -0
  329. package/build-module/components/block-editor/block-inspector-button.js +9 -8
  330. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  331. package/build-module/components/block-editor/editor-canvas.js +16 -7
  332. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  333. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  334. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  335. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  336. package/build-module/components/block-editor/site-editor-canvas.js +5 -1
  337. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  338. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  339. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  340. package/build-module/components/canvas-loader/index.js.map +1 -1
  341. package/build-module/components/code-editor/index.js.map +1 -1
  342. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  343. package/build-module/components/editor/index.js +35 -8
  344. package/build-module/components/editor/index.js.map +1 -1
  345. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  346. package/build-module/components/error-boundary/index.js.map +1 -1
  347. package/build-module/components/error-boundary/warning.js.map +1 -1
  348. package/build-module/components/global-styles/background-panel.js +14 -1
  349. package/build-module/components/global-styles/background-panel.js.map +1 -1
  350. package/build-module/components/global-styles/block-preview-panel.js +6 -1
  351. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  352. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  353. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  354. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  355. package/build-module/components/global-styles/font-families.js.map +1 -1
  356. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  357. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  358. package/build-module/components/global-styles/font-library-modal/context.js +59 -32
  359. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  360. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  361. package/build-module/components/global-styles/font-library-modal/font-collection.js +12 -5
  362. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  363. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  364. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  365. package/build-module/components/global-styles/font-library-modal/index.js +2 -2
  366. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  367. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +11 -10
  368. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  369. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  370. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  371. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  372. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  373. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  374. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  375. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  376. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  377. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  379. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  380. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  381. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  382. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  383. package/build-module/components/global-styles/header.js.map +1 -1
  384. package/build-module/components/global-styles/highlighted-colors.js +1 -1
  385. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  386. package/build-module/components/global-styles/hooks.js +11 -3
  387. package/build-module/components/global-styles/hooks.js.map +1 -1
  388. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  389. package/build-module/components/global-styles/index.js.map +1 -1
  390. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  391. package/build-module/components/global-styles/palette.js.map +1 -1
  392. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  393. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  394. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  395. package/build-module/components/global-styles/root-menu.js +2 -2
  396. package/build-module/components/global-styles/root-menu.js.map +1 -1
  397. package/build-module/components/global-styles/screen-background.js +1 -1
  398. package/build-module/components/global-styles/screen-background.js.map +1 -1
  399. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  400. package/build-module/components/global-styles/screen-block.js.map +1 -1
  401. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  402. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  403. package/build-module/components/global-styles/screen-css.js.map +1 -1
  404. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  405. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  406. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  407. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  408. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  409. package/build-module/components/global-styles/screen-root.js.map +1 -1
  410. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  411. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  412. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  413. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  414. package/build-module/components/global-styles/subtitle.js.map +1 -1
  415. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  416. package/build-module/components/global-styles/typography-example.js.map +1 -1
  417. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  418. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  419. package/build-module/components/global-styles/ui.js.map +1 -1
  420. package/build-module/components/global-styles/utils.js.map +1 -1
  421. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  422. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  423. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  424. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  425. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  426. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  427. package/build-module/components/header-edit-mode/index.js +3 -3
  428. package/build-module/components/header-edit-mode/index.js.map +1 -1
  429. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  430. package/build-module/components/header-edit-mode/more-menu/index.js +8 -8
  431. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  432. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  433. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  434. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  435. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  436. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  437. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  438. package/build-module/components/keyboard-shortcuts/register.js +0 -18
  439. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  440. package/build-module/components/layout/animation.js +4 -3
  441. package/build-module/components/layout/animation.js.map +1 -1
  442. package/build-module/components/layout/hooks.js.map +1 -1
  443. package/build-module/components/layout/index.js +13 -48
  444. package/build-module/components/layout/index.js.map +1 -1
  445. package/build-module/components/layout/router.js +73 -7
  446. package/build-module/components/layout/router.js.map +1 -1
  447. package/build-module/components/media/index.js.map +1 -1
  448. package/build-module/components/page/header.js.map +1 -1
  449. package/build-module/components/page/index.js +5 -2
  450. package/build-module/components/page/index.js.map +1 -1
  451. package/build-module/components/page-pages/index.js +14 -16
  452. package/build-module/components/page-pages/index.js.map +1 -1
  453. package/build-module/components/page-patterns/dataviews-pattern-actions.js +5 -4
  454. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  455. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  456. package/build-module/components/page-patterns/header.js +2 -2
  457. package/build-module/components/page-patterns/header.js.map +1 -1
  458. package/build-module/components/page-patterns/index.js +126 -19
  459. package/build-module/components/page-patterns/index.js.map +1 -1
  460. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  461. package/build-module/components/page-patterns/search-items.js +3 -2
  462. package/build-module/components/page-patterns/search-items.js.map +1 -1
  463. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  464. package/build-module/components/page-patterns/use-patterns.js +2 -6
  465. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  466. package/build-module/components/page-patterns/utils.js.map +1 -1
  467. package/build-module/components/page-templates-template-parts/add-new-template-part.js +3 -2
  468. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
  469. package/build-module/components/page-templates-template-parts/hooks.js.map +1 -1
  470. package/build-module/components/page-templates-template-parts/index.js +13 -25
  471. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  472. package/build-module/components/pagination/index.js.map +1 -1
  473. package/build-module/components/pattern-modal/duplicate.js +4 -1
  474. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  475. package/build-module/components/pattern-modal/index.js.map +1 -1
  476. package/build-module/components/pattern-modal/rename.js +4 -1
  477. package/build-module/components/pattern-modal/rename.js.map +1 -1
  478. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  479. package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
  480. package/build-module/components/rename-post-menu-item/index.js.map +1 -0
  481. package/build-module/components/resizable-frame/index.js +1 -5
  482. package/build-module/components/resizable-frame/index.js.map +1 -1
  483. package/build-module/components/revisions/index.js.map +1 -1
  484. package/build-module/components/routes/link.js.map +1 -1
  485. package/build-module/components/routes/use-title.js.map +1 -1
  486. package/build-module/components/save-button/index.js.map +1 -1
  487. package/build-module/components/save-hub/index.js.map +1 -1
  488. package/build-module/components/save-panel/index.js +2 -2
  489. package/build-module/components/save-panel/index.js.map +1 -1
  490. package/build-module/components/sidebar/index.js +42 -75
  491. package/build-module/components/sidebar/index.js.map +1 -1
  492. package/build-module/components/sidebar-button/index.js.map +1 -1
  493. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  494. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  495. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  496. package/build-module/components/sidebar-dataviews/default-views.js +1 -1
  497. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  498. package/build-module/components/sidebar-dataviews/index.js +1 -1
  499. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  500. package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
  501. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  502. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  503. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  504. package/build-module/components/sidebar-edit-mode/index.js +28 -53
  505. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  506. package/build-module/components/sidebar-edit-mode/page-panels/index.js +23 -2
  507. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  508. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  509. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  510. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
  511. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  512. package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
  513. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  514. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  515. package/build-module/components/sidebar-edit-mode/template-panel/index.js +1 -1
  516. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  517. package/build-module/components/sidebar-navigation-item/index.js +31 -0
  518. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  519. package/build-module/components/sidebar-navigation-screen/index.js +37 -10
  520. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  521. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  522. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  523. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  524. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  525. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  526. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -3
  527. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  528. package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
  529. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  530. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  531. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  532. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
  533. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  534. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  535. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  537. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  538. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  539. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  540. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  541. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  542. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  543. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  544. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  545. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  546. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  547. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  548. package/build-module/components/sidebar-navigation-screen-page/index.js +24 -14
  549. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  550. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  551. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-pattern/index.js +14 -5
  553. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  554. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  555. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  556. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  557. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  558. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  559. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  561. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-patterns/index.js +34 -28
  563. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  564. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  565. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  567. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  568. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  569. package/build-module/components/sidebar-navigation-screen-template/index.js +12 -8
  570. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  571. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  572. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  573. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
  574. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  575. package/build-module/components/site-hub/index.js +22 -21
  576. package/build-module/components/site-hub/index.js.map +1 -1
  577. package/build-module/components/site-icon/index.js.map +1 -1
  578. package/build-module/components/start-template-options/index.js.map +1 -1
  579. package/build-module/components/style-book/index.js.map +1 -1
  580. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -5
  581. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  582. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  583. package/build-module/components/table/index.js.map +1 -1
  584. package/build-module/components/template-actions/index.js +7 -8
  585. package/build-module/components/template-actions/index.js.map +1 -1
  586. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  587. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  588. package/build-module/components/template-part-converter/index.js.map +1 -1
  589. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  590. package/build-module/components/welcome-guide/editor.js.map +1 -1
  591. package/build-module/components/welcome-guide/image.js.map +1 -1
  592. package/build-module/components/welcome-guide/index.js.map +1 -1
  593. package/build-module/components/welcome-guide/page.js.map +1 -1
  594. package/build-module/components/welcome-guide/styles.js +6 -3
  595. package/build-module/components/welcome-guide/styles.js.map +1 -1
  596. package/build-module/components/welcome-guide/template.js.map +1 -1
  597. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  598. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
  599. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  600. package/build-module/hooks/components.js.map +1 -1
  601. package/build-module/hooks/index.js.map +1 -1
  602. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
  603. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  604. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
  605. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  606. package/build-module/index.js +4 -6
  607. package/build-module/index.js.map +1 -1
  608. package/build-module/lock-unlock.js.map +1 -1
  609. package/build-module/store/actions.js +16 -92
  610. package/build-module/store/actions.js.map +1 -1
  611. package/build-module/store/constants.js.map +1 -1
  612. package/build-module/store/index.js.map +1 -1
  613. package/build-module/store/private-actions.js +0 -83
  614. package/build-module/store/private-actions.js.map +1 -1
  615. package/build-module/store/private-selectors.js.map +1 -1
  616. package/build-module/store/reducer.js.map +1 -1
  617. package/build-module/store/selectors.js.map +1 -1
  618. package/build-module/utils/clone-deep.js.map +1 -1
  619. package/build-module/utils/constants.js +1 -0
  620. package/build-module/utils/constants.js.map +1 -1
  621. package/build-module/utils/get-is-list-page.js.map +1 -1
  622. package/build-module/utils/is-previewing-theme.js.map +1 -1
  623. package/build-module/utils/is-template-removable.js.map +1 -1
  624. package/build-module/utils/is-template-revertable.js.map +1 -1
  625. package/build-module/utils/math.js.map +1 -1
  626. package/build-module/utils/set-nested-value.js +38 -0
  627. package/build-module/utils/set-nested-value.js.map +1 -0
  628. package/build-module/utils/template-part-create.js.map +1 -1
  629. package/build-module/utils/use-activate-theme.js.map +1 -1
  630. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  631. package/build-style/style-rtl.css +172 -585
  632. package/build-style/style.css +172 -585
  633. package/package.json +43 -44
  634. package/src/components/add-new-template/index.js +412 -12
  635. package/src/components/add-new-template/style.scss +0 -22
  636. package/src/components/add-new-template/utils.js +44 -24
  637. package/src/components/async/index.js +43 -0
  638. package/src/components/block-editor/block-inspector-button.js +9 -11
  639. package/src/components/block-editor/editor-canvas.js +45 -21
  640. package/src/components/block-editor/site-editor-canvas.js +6 -1
  641. package/src/components/editor/index.js +50 -13
  642. package/src/components/global-styles/background-panel.js +16 -0
  643. package/src/components/global-styles/block-preview-panel.js +6 -1
  644. package/src/components/global-styles/font-library-modal/context.js +76 -51
  645. package/src/components/global-styles/font-library-modal/font-collection.js +247 -223
  646. package/src/components/global-styles/font-library-modal/index.js +2 -2
  647. package/src/components/global-styles/font-library-modal/installed-fonts.js +156 -147
  648. package/src/components/global-styles/font-library-modal/style.scss +31 -13
  649. package/src/components/global-styles/highlighted-colors.js +1 -1
  650. package/src/components/global-styles/hooks.js +20 -3
  651. package/src/components/global-styles/root-menu.js +2 -2
  652. package/src/components/global-styles/screen-background.js +1 -1
  653. package/src/components/global-styles/screen-revisions/index.js +1 -1
  654. package/src/components/header-edit-mode/index.js +3 -5
  655. package/src/components/header-edit-mode/more-menu/index.js +6 -17
  656. package/src/components/header-edit-mode/style.scss +1 -1
  657. package/src/components/keyboard-shortcuts/edit-mode.js +0 -29
  658. package/src/components/keyboard-shortcuts/register.js +0 -20
  659. package/src/components/layout/animation.js +6 -3
  660. package/src/components/layout/index.js +12 -50
  661. package/src/components/layout/router.js +75 -12
  662. package/src/components/layout/style.scss +15 -37
  663. package/src/components/page/index.js +7 -2
  664. package/src/components/page-pages/index.js +33 -23
  665. package/src/components/page-pages/style.scss +29 -22
  666. package/src/components/page-patterns/dataviews-pattern-actions.js +5 -6
  667. package/src/components/page-patterns/header.js +4 -2
  668. package/src/components/page-patterns/index.js +168 -56
  669. package/src/components/page-patterns/search-items.js +3 -0
  670. package/src/components/page-patterns/style.scss +7 -6
  671. package/src/components/page-patterns/use-patterns.js +2 -6
  672. package/src/components/page-templates-template-parts/add-new-template-part.js +4 -2
  673. package/src/components/page-templates-template-parts/index.js +24 -39
  674. package/src/components/pattern-modal/duplicate.js +2 -1
  675. package/src/components/pattern-modal/rename.js +2 -1
  676. package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
  677. package/src/components/resizable-frame/index.js +2 -6
  678. package/src/components/save-panel/index.js +2 -2
  679. package/src/components/sidebar/index.js +52 -100
  680. package/src/components/sidebar/style.scss +41 -6
  681. package/src/components/sidebar-dataviews/default-views.js +1 -1
  682. package/src/components/sidebar-dataviews/index.js +1 -1
  683. package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
  684. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
  685. package/src/components/sidebar-edit-mode/index.js +39 -75
  686. package/src/components/sidebar-edit-mode/page-panels/index.js +25 -2
  687. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +20 -12
  688. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -6
  689. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
  690. package/src/components/sidebar-edit-mode/style.scss +1 -1
  691. package/src/components/sidebar-edit-mode/template-panel/index.js +1 -1
  692. package/src/components/sidebar-navigation-item/index.js +29 -0
  693. package/src/components/sidebar-navigation-screen/index.js +29 -12
  694. package/src/components/sidebar-navigation-screen/style.scss +1 -21
  695. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -11
  696. package/src/components/sidebar-navigation-screen-main/index.js +11 -23
  697. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  698. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
  699. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  700. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
  701. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  702. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
  703. package/src/components/sidebar-navigation-screen-page/index.js +23 -13
  704. package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
  705. package/src/components/sidebar-navigation-screen-pattern/index.js +9 -6
  706. package/src/components/sidebar-navigation-screen-patterns/index.js +70 -60
  707. package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
  708. package/src/components/sidebar-navigation-screen-template/index.js +8 -12
  709. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -7
  710. package/src/components/site-hub/index.js +80 -90
  711. package/src/components/site-hub/style.scss +14 -34
  712. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +50 -35
  713. package/src/components/template-actions/index.js +8 -11
  714. package/src/components/welcome-guide/style.scss +1 -1
  715. package/src/components/welcome-guide/styles.js +6 -5
  716. package/src/hooks/commands/use-edit-mode-commands.js +12 -33
  717. package/src/hooks/push-changes-to-global-styles/index.js +1 -40
  718. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
  719. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
  720. package/src/index.js +9 -10
  721. package/src/store/actions.js +25 -141
  722. package/src/store/private-actions.js +0 -133
  723. package/src/store/test/actions.js +7 -2
  724. package/src/style.scss +0 -2
  725. package/src/utils/constants.js +1 -0
  726. package/src/utils/set-nested-value.js +39 -0
  727. package/build/components/add-new-template/new-template.js +0 -298
  728. package/build/components/add-new-template/new-template.js.map +0 -1
  729. package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
  730. package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  731. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
  732. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  733. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
  734. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  735. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  736. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  737. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
  738. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  739. package/build/components/keyboard-shortcut-help-modal/index.js +0 -119
  740. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  741. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
  742. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  743. package/build/components/page-actions/index.js +0 -35
  744. package/build/components/page-actions/index.js.map +0 -1
  745. package/build/components/page-actions/trash-page-menu-item.js +0 -54
  746. package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
  747. package/build/components/page-templates-template-parts/actions.js +0 -207
  748. package/build/components/page-templates-template-parts/actions.js.map +0 -1
  749. package/build/components/preferences-modal/index.js +0 -38
  750. package/build/components/preferences-modal/index.js.map +0 -1
  751. package/build/components/sidebar-edit-mode/constants.js +0 -9
  752. package/build/components/sidebar-edit-mode/constants.js.map +0 -1
  753. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
  754. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  755. package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
  756. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  757. package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
  758. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  759. package/build/components/template-actions/rename-menu-item.js.map +0 -1
  760. package/build-module/components/add-new-template/new-template.js +0 -290
  761. package/build-module/components/add-new-template/new-template.js.map +0 -1
  762. package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
  763. package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  764. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  765. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  766. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
  767. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  768. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  769. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  770. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
  771. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  772. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -110
  773. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  774. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
  775. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  776. package/build-module/components/page-actions/index.js +0 -27
  777. package/build-module/components/page-actions/index.js.map +0 -1
  778. package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
  779. package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
  780. package/build-module/components/page-templates-template-parts/actions.js +0 -199
  781. package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
  782. package/build-module/components/preferences-modal/index.js +0 -30
  783. package/build-module/components/preferences-modal/index.js.map +0 -1
  784. package/build-module/components/sidebar-edit-mode/constants.js +0 -3
  785. package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
  786. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
  787. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  788. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
  789. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  790. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
  791. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  792. package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
  793. package/src/components/add-new-template/new-template.js +0 -429
  794. package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
  795. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  796. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
  797. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  798. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  799. package/src/components/keyboard-shortcut-help-modal/index.js +0 -151
  800. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
  801. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  802. package/src/components/page-actions/index.js +0 -30
  803. package/src/components/page-actions/trash-page-menu-item.js +0 -63
  804. package/src/components/page-templates-template-parts/actions.js +0 -277
  805. package/src/components/preferences-modal/index.js +0 -29
  806. package/src/components/sidebar-edit-mode/constants.js +0 -2
  807. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
  808. package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
  809. package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useSelect","BlockEditorProvider","createBlock","unlock","store","editSiteStore","NavigationMenuContent","noop","NavigationMenuEditor","navigationMenuId","storedSettings","select","getSettings","blocks","ref","length","createElement","settings","value","onChange","onInput","className","rootClientId","clientId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport NavigationMenuContent from '../sidebar-navigation-screen-navigation-menus/navigation-menu-content';\n\nconst noop = () => {};\n\nexport default function NavigationMenuEditor( { navigationMenuId } ) {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst blocks = useMemo( () => {\n\t\tif ( ! navigationMenuId ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [ createBlock( 'core/navigation', { ref: navigationMenuId } ) ];\n\t}, [ navigationMenuId ] );\n\n\tif ( ! navigationMenuId || ! blocks?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tvalue={ blocks }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus__content\">\n\t\t\t\t<NavigationMenuContent rootClientId={ blocks[ 0 ].clientId } />\n\t\t\t</div>\n\t\t</BlockEditorProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,uEAAuE;AAEzG,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAiB,CAAC,EAAG;EACpE,MAAM;IAAEC;EAAe,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IACnD,MAAM;MAAEC;IAAY,CAAC,GAAGT,MAAM,CAAEQ,MAAM,CAAEN,aAAc,CAAE,CAAC;IAEzD,OAAO;MACNK,cAAc,EAAEE,WAAW,CAAC;IAC7B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,MAAM,GAAGd,OAAO,CAAE,MAAM;IAC7B,IAAK,CAAEU,gBAAgB,EAAG;MACzB,OAAO,EAAE;IACV;IAEA,OAAO,CAAEP,WAAW,CAAE,iBAAiB,EAAE;MAAEY,GAAG,EAAEL;IAAiB,CAAE,CAAC,CAAE;EACvE,CAAC,EAAE,CAAEA,gBAAgB,CAAG,CAAC;EAEzB,IAAK,CAAEA,gBAAgB,IAAI,CAAEI,MAAM,EAAEE,MAAM,EAAG;IAC7C,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACf,mBAAmB;IACnBgB,QAAQ,EAAGP,cAAgB;IAC3BQ,KAAK,EAAGL,MAAQ;IAChBM,QAAQ,EAAGZ,IAAM;IACjBa,OAAO,EAAGb;EAAM,GAEhBS,aAAA;IAAKK,SAAS,EAAC;EAA+D,GAC7EL,aAAA,CAACV,qBAAqB;IAACgB,YAAY,EAAGT,MAAM,CAAE,CAAC,CAAE,CAACU;EAAU,CAAE,CAC1D,CACe,CAAC;AAExB"}
1
+ {"version":3,"names":["useMemo","useSelect","BlockEditorProvider","createBlock","unlock","store","editSiteStore","NavigationMenuContent","noop","NavigationMenuEditor","navigationMenuId","storedSettings","select","getSettings","blocks","ref","length","createElement","settings","value","onChange","onInput","className","rootClientId","clientId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport NavigationMenuContent from '../sidebar-navigation-screen-navigation-menus/navigation-menu-content';\n\nconst noop = () => {};\n\nexport default function NavigationMenuEditor( { navigationMenuId } ) {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst blocks = useMemo( () => {\n\t\tif ( ! navigationMenuId ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [ createBlock( 'core/navigation', { ref: navigationMenuId } ) ];\n\t}, [ navigationMenuId ] );\n\n\tif ( ! navigationMenuId || ! blocks?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tvalue={ blocks }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus__content\">\n\t\t\t\t<NavigationMenuContent rootClientId={ blocks[ 0 ].clientId } />\n\t\t\t</div>\n\t\t</BlockEditorProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,uEAAuE;AAEzG,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAiB,CAAC,EAAG;EACpE,MAAM;IAAEC;EAAe,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IACnD,MAAM;MAAEC;IAAY,CAAC,GAAGT,MAAM,CAAEQ,MAAM,CAAEN,aAAc,CAAE,CAAC;IAEzD,OAAO;MACNK,cAAc,EAAEE,WAAW,CAAC;IAC7B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,MAAM,GAAGd,OAAO,CAAE,MAAM;IAC7B,IAAK,CAAEU,gBAAgB,EAAG;MACzB,OAAO,EAAE;IACV;IAEA,OAAO,CAAEP,WAAW,CAAE,iBAAiB,EAAE;MAAEY,GAAG,EAAEL;IAAiB,CAAE,CAAC,CAAE;EACvE,CAAC,EAAE,CAAEA,gBAAgB,CAAG,CAAC;EAEzB,IAAK,CAAEA,gBAAgB,IAAI,CAAEI,MAAM,EAAEE,MAAM,EAAG;IAC7C,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACf,mBAAmB;IACnBgB,QAAQ,EAAGP,cAAgB;IAC3BQ,KAAK,EAAGL,MAAQ;IAChBM,QAAQ,EAAGZ,IAAM;IACjBa,OAAO,EAAGb;EAAM,GAEhBS,aAAA;IAAKK,SAAS,EAAC;EAA+D,GAC7EL,aAAA,CAACV,qBAAqB;IAACgB,YAAY,EAAGT,MAAM,CAAE,CAAC,CAAE,CAACU;EAAU,CAAE,CAC1D,CACe,CAAC;AAExB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","createElement","title","onRequestClose","className","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","placeholder","onChange","justify","variant","onClick","disabled","type","e","preventDefault"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal title={ __( 'Rename' ) } onRequestClose={ onClose }>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\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{ __( 'Save' ) }\n\t\t\t\t\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ETc,aAAA,CAACjB,MAAM;IACNuB,qBAAqB;IACrBO,QAAQ,EAAG,CAAEd,sBAAwB;IACrCY,OAAO,EAAC,SAAS;IACjBG,IAAI,EAAC,QAAQ;IACbF,OAAO,EAAKG,CAAC,IAAM;MAClBA,CAAC,CAACC,cAAc,CAAC,CAAC;MAElB,IAAK,CAAEjB,sBAAsB,EAAG;QAC/B;MACD;MACAJ,MAAM,CAAE;QAAEM,KAAK,EAAEL;MAAgB,CAAE,CAAC;;MAEpC;MACAF,OAAO,CAAC,CAAC;IACV;EAAG,GAEDR,EAAE,CAAE,MAAO,CACN,CACD,CACD,CACH,CACA,CAAC;AAEV"}
1
+ {"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","createElement","title","onRequestClose","className","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","placeholder","onChange","justify","variant","onClick","disabled","type","e","preventDefault"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal title={ __( 'Rename' ) } onRequestClose={ onClose }>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\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{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,WAAW,EACXC,KAAK,QACC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,S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,KAAK,EAAEL;MAAgB,CAAE,CAAC;;MAEpC;MACAF,OAAO,CAAC,CAAC;IACV;EAAG,GAEDR,EAAE,CAAE,MAAO,CACN,CACD,CACD,CACH,CACA,CAAC;AAEV","ignoreList":[]}
@@ -26,7 +26,7 @@ export default function SingleNavigationMenu({
26
26
  onDuplicate: handleDuplicate
27
27
  })),
28
28
  title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
29
- description: __('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
29
+ description: __('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.')
30
30
  }, createElement(NavigationMenuEditor, {
31
31
  navigationMenuId: navigationMenu?.id
32
32
  }));
@@ -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"}
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":[]}
@@ -2,20 +2,21 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { store as coreStore } from '@wordpress/core-data';
5
- import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
6
5
  import { __, sprintf } from '@wordpress/i18n';
7
6
  import { useSelect, useDispatch } from '@wordpress/data';
8
7
  import { store as noticesStore } from '@wordpress/notices';
8
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
9
9
 
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
13
  import { postType } from '.';
14
14
  import { NAVIGATION_POST_TYPE } from '../../utils/constants';
15
+ import { unlock } from '../../lock-unlock';
16
+ const {
17
+ useHistory
18
+ } = unlock(routerPrivateApis);
15
19
  function useDeleteNavigationMenu() {
16
- const {
17
- goTo
18
- } = useNavigator();
19
20
  const {
20
21
  deleteEntityRecord
21
22
  } = useDispatch(coreStore);
@@ -23,6 +24,7 @@ function useDeleteNavigationMenu() {
23
24
  createSuccessNotice,
24
25
  createErrorNotice
25
26
  } = useDispatch(noticesStore);
27
+ const history = useHistory();
26
28
  const handleDelete = async navigationMenu => {
27
29
  const postId = navigationMenu?.id;
28
30
  try {
@@ -31,13 +33,15 @@ function useDeleteNavigationMenu() {
31
33
  }, {
32
34
  throwOnError: true
33
35
  });
34
- createSuccessNotice(__('Navigation menu successfully deleted.'), {
36
+ createSuccessNotice(__('Navigation Menu successfully deleted.'), {
35
37
  type: 'snackbar'
36
38
  });
37
- goTo('/navigation');
39
+ history.push({
40
+ path: '/navigation'
41
+ });
38
42
  } catch (error) {
39
43
  createErrorNotice(sprintf( /* translators: %s: error message describing why the navigation menu could not be deleted. */
40
- __(`Unable to delete Navigation menu (%s).`), error?.message), {
44
+ __(`Unable to delete Navigation Menu (%s).`), error?.message), {
41
45
  type: 'snackbar'
42
46
  });
43
47
  }
@@ -80,14 +84,14 @@ function useSaveNavigationMenu() {
80
84
  await saveSpecifiedEntityEdits('postType', postType, postId, recordPropertiesToSave, {
81
85
  throwOnError: true
82
86
  });
83
- createSuccessNotice(__('Renamed Navigation menu'), {
87
+ createSuccessNotice(__('Renamed Navigation Menu'), {
84
88
  type: 'snackbar'
85
89
  });
86
90
  } catch (error) {
87
91
  // Revert to original in case of error.
88
92
  editEntityRecord('postType', postType, postId, originalRecord);
89
93
  createErrorNotice(sprintf( /* translators: %s: error message describing why the navigation menu could not be renamed. */
90
- __(`Unable to rename Navigation menu (%s).`), error?.message), {
94
+ __(`Unable to rename Navigation Menu (%s).`), error?.message), {
91
95
  type: 'snackbar'
92
96
  });
93
97
  }
@@ -95,9 +99,7 @@ function useSaveNavigationMenu() {
95
99
  return handleSave;
96
100
  }
97
101
  function useDuplicateNavigationMenu() {
98
- const {
99
- goTo
100
- } = useNavigator();
102
+ const history = useHistory();
101
103
  const {
102
104
  saveEntityRecord
103
105
  } = useDispatch(coreStore);
@@ -117,14 +119,17 @@ function useDuplicateNavigationMenu() {
117
119
  throwOnError: true
118
120
  });
119
121
  if (savedRecord) {
120
- createSuccessNotice(__('Duplicated Navigation menu'), {
122
+ createSuccessNotice(__('Duplicated Navigation Menu'), {
121
123
  type: 'snackbar'
122
124
  });
123
- goTo(`/navigation/${postType}/${savedRecord.id}`);
125
+ history.push({
126
+ postType,
127
+ postId: savedRecord.id
128
+ });
124
129
  }
125
130
  } catch (error) {
126
131
  createErrorNotice(sprintf( /* translators: %s: error message describing why the navigation menu could not be deleted. */
127
- __(`Unable to duplicate Navigation menu (%s).`), error?.message), {
132
+ __(`Unable to duplicate Navigation Menu (%s).`), error?.message), {
128
133
  type: 'snackbar'
129
134
  });
130
135
  }
@@ -1 +1 @@
1
- {"version":3,"names":["store","coreStore","__experimentalUseNavigator","useNavigator","__","sprintf","useSelect","useDispatch","noticesStore","postType","NAVIGATION_POST_TYPE","useDeleteNavigationMenu","goTo","deleteEntityRecord","createSuccessNotice","createErrorNotice","handleDelete","navigationMenu","postId","id","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nfunction useDeleteNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tgoTo( '/navigation' );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t__( '%s (Copy)' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\tgoTo( `/navigation/${ postType }/${ savedRecord.id }` );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AACl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Select","useDispatch","noticesStore","privateApis","routerPrivateApis","postType","NAVIGATION_POST_TYPE","unlock","useHistory","useDeleteNavigationMenu","deleteEntityRecord","createSuccessNotice","createErrorNotice","history","handleDelete","navigationMenu","postId","id","force","throwOnError","type","push","path","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.push( { path: '/navigation' } );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t__( '%s (Copy)' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.push( { postType, postId: savedRecord.id } );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,GAAG;AAC5B,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAW,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAElD,SAASK,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAmB,CAAC,GAAGT,WAAW,CAAEJ,SAAU,CAAC;EACvD,MAAM;IAAEc,mBAAmB;IAAEC;EAAkB,CAAC,GAC/CX,WAAW,CAAEC,YAAa,CAAC;EAC5B,MAAMW,OAAO,GAAGL,UAAU,CAAC,CAAC;EAE5B,MAAMM,YAAY,GAAG,MAAQC,cAAc,IAAM;IAChD,MAAMC,MAAM,GAAGD,cAAc,EAAEE,EAAE;IACjC,IAAI;MACH,MAAMP,kBAAkB,CACvB,UAAU,EACVL,QAAQ,EACRW,MAAM,EACN;QACCE,KAAK,EAAE;MACR,CAAC,EACD;QAC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B,CAAEb,EAAE,CAAE,4BAA6B,CAAC,EAAE;UACxDsB,IAAI,EAAE;QACP,CAAE,CAAC;QACHP,OAAO,CAACQ,IAAI,CAAE;UAAEhB,QAAQ;UAAEW,MAAM,EAAE6B,WAAW,CAAC5B;QAAG,CAAE,CAAC;MACrD;IACD,CAAC,CAAC,OAAQM,KAAK,EAAG;MACjBX,iBAAiB,CAChBb,OAAO,EACN;MACAD,EAAE,CAAG,2CAA2C,CAAC,EACjDyB,KAAK,EAAEC,OACR,CAAC,EAED;QACCJ,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOoB,eAAe;AACvB;AAEA,eAAe,SAASS,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNnC,YAAY,EAAEL,uBAAuB,CAAC,CAAC;IACvCuB,UAAU,EAAEP,qBAAqB,CAAC,CAAC;IACnCe,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","decodeEntities","buildNavigationLabel","title","id","status","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title?.rendered );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title?.rendered ),\n\t\tstatus\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA,eAAe,SAASC,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAON,OAAO,CAAED,EAAE,CAAE,eAAgB,CAAC,EAAEK,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAOJ,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAON,OAAO;EACb;EACAD,EAAE,CAAE,aAAc,CAAC,EACnBE,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF"}
1
+ {"version":3,"names":["__","sprintf","decodeEntities","buildNavigationLabel","title","id","status","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title?.rendered );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title?.rendered ),\n\t\tstatus\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA,eAAe,SAASC,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAON,OAAO,CAAED,EAAE,CAAE,eAAgB,CAAC,EAAEK,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAOJ,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAON,OAAO;EACb;EACAD,EAAE,CAAE,aAAc,CAAC,EACnBE,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"sourcesContent":["// This requested is preloaded in `gutenberg_preload_navigation_posts`.\n// As unbounded queries are limited to 100 by `fetchAllMiddleware`\n// on apiFetch this query is limited to 100.\n// These parameters must be kept aligned with those in\n// lib/compat/wordpress-6.3/navigation-block-preloading.php\n// and\n// block-library/src/navigation/constants.js\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gCAAgC,GAAG;EAC/CC,QAAQ,EAAE,GAAG;EACbC,MAAM,EAAE,CAAE,SAAS,EAAE,OAAO,CAAE;EAC9BC,KAAK,EAAE,MAAM;EACbC,OAAO,EAAE;AACV,CAAC"}
1
+ {"version":3,"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"sourcesContent":["// This requested is preloaded in `gutenberg_preload_navigation_posts`.\n// As unbounded queries are limited to 100 by `fetchAllMiddleware`\n// on apiFetch this query is limited to 100.\n// These parameters must be kept aligned with those in\n// lib/compat/wordpress-6.3/navigation-block-preloading.php\n// and\n// block-library/src/navigation/constants.js\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gCAAgC,GAAG;EAC/CC,QAAQ,EAAE,GAAG;EACbC,MAAM,EAAE,CAAE,SAAS,EAAE,OAAO,CAAE;EAC9BC,KAAK,EAAE,MAAM;EACbC,OAAO,EAAE;AACV,CAAC","ignoreList":[]}
@@ -105,7 +105,7 @@ export function SidebarNavigationScreenWrapper({
105
105
  return createElement(SidebarNavigationScreen, {
106
106
  title: title || __('Navigation'),
107
107
  actions: actions,
108
- description: description || __('Manage your Navigation menus.'),
108
+ description: description || __('Manage your Navigation Menus.'),
109
109
  content: children
110
110
  });
111
111
  }
@@ -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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M;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"}
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,CAAA,EAAG;EAChE,MAAM;IACLC,OAAO,EAA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EC,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":[]}
@@ -20,13 +20,14 @@ const POPOVER_PROPS = {
20
20
  */
21
21
  import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
22
22
  import { unlock } from '../../lock-unlock';
23
- import { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
24
23
  const {
25
24
  useLocation,
26
25
  useHistory
27
26
  } = unlock(routerPrivateApis);
28
27
  export default function LeafMoreMenu(props) {
29
- const location = useLocation();
28
+ const {
29
+ params
30
+ } = useLocation();
30
31
  const history = useHistory();
31
32
  const {
32
33
  block
@@ -68,7 +69,7 @@ export default function LeafMoreMenu(props) {
68
69
  wp_theme_preview: currentlyPreviewingTheme()
69
70
  })
70
71
  }, {
71
- backPath: getPathFromURL(location.params)
72
+ backPath: params
72
73
  });
73
74
  }
74
75
  if (name === 'core/page-list-item' && attributes.id && history) {
@@ -79,10 +80,10 @@ export default function LeafMoreMenu(props) {
79
80
  wp_theme_preview: currentlyPreviewingTheme()
80
81
  })
81
82
  }, {
82
- backPath: getPathFromURL(location.params)
83
+ backPath: params
83
84
  });
84
85
  }
85
- }, [history]);
86
+ }, [history, params]);
86
87
  return createElement(DropdownMenu, {
87
88
  icon: moreVertical,
88
89
  label: __('Options'),
@@ -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","getPathFromURL","useLocation","useHistory","LeafMoreMenu","props","location","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","params","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';\nimport { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst location = 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: getPathFromURL( location.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: getPathFromURL( location.params ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history ]\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,CAA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,CACP,CAAC,EACX4C,aAAA,CAACjD,QAAQ;IACRkD,IAAI,EAAGrD,WAAa;IACpB2D,OAAO,EAAGA,CAAA,KAAM;MACf7B,cAAc,CAAE,CAAED,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC5CqB,OAAO,CAAC,CAAC;IACV;EAAG,GAEDjD,EAAE,CAAE,WAAY,CACT,CAAC,EACToB,KAAK,CAACa,UAAU,EAAEI,IAAI,KAAK,MAAM,IAClCjB,KAAK,CAACa,UAAU,EAAEG,EAAE,IACnBQ,aAAA,CAACjD,QAAQ;IACRwD,OAAO,EAAGA,CAAA,KAAM;MACfpB,UAAU,CAAEX,KAAM,CAAC;MACnB6B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDtB,SACO,CAEF,CAAC,EACZiB,aAAA,CAAChD,SAAS,QACTgD,aAAA,CAACjD,QAAQ;IACRwD,OAAO,EAAGA,CAAA,KAAM;MACf3B,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;MACnC4B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDxB,WACO,CACA,CACV,CAEU,CAAC;AAEjB"}
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;A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KAAM;MACf5B,cAAc,CAAE,CAAED,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC5CoB,OAAO,CAAC,CAAC;IACV;EAAG,GAED/C,EAAE,CAAE,WAAY,CACT,CAAC,EACTmB,KAAK,CAACa,UAAU,EAAEI,IAAI,KAAK,MAAM,IAClCjB,KAAK,CAACa,UAAU,EAAEG,EAAE,IACnBO,aAAA,CAAC/C,QAAQ;IACRsD,OAAO,EAAGA,CAAA,KAAM;MACfnB,UAAU,CAAEX,KAAM,CAAC;MACnB4B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDrB,SACO,CAEF,CAAC,EACZgB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC/C,QAAQ;IACRsD,OAAO,EAAGA,CAAA,KAAM;MACf1B,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;MACnC2B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDvB,WACO,CACA,CACV,CAEU,CAAC;AAEjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","BlockList","useDispatch","useSelect","createBlock","useCallback","coreStore","unlock","LeafMoreMenu","PrivateListView","MAX_PAGE_COUNT","PAGES_QUERY","per_page","_fields","orderby","order","NavigationMenuContent","rootClientId","listViewRootClientId","isLoading","select","areInnerBlocksControlled","getBlockName","getBlockCount","getBlockOrder","isResolving","blockClientIds","hasOnlyPageListBlock","length","pageListHasBlocks","isLoadingPages","replaceBlock","__unstableMarkNextChangeAsNotPersistent","offCanvasOnselect","block","name","attributes","url","clientId","createElement","Fragment","onSelect","blockSettingsMenu","showAppender","className"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport LeafMoreMenu from './leaf-more-menu';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\n// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.\nconst MAX_PAGE_COUNT = 100;\nconst PAGES_QUERY = [\n\t'postType',\n\t'page',\n\t{\n\t\tper_page: MAX_PAGE_COUNT,\n\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t// sort.\n\t\torderby: 'menu_order',\n\t\torder: 'asc',\n\t},\n];\n\nexport default function NavigationMenuContent( { rootClientId } ) {\n\tconst { listViewRootClientId, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tareInnerBlocksControlled,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { isResolving } = select( coreStore );\n\n\t\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\n\t\t\tconst hasOnlyPageListBlock =\n\t\t\t\tblockClientIds.length === 1 &&\n\t\t\t\tgetBlockName( blockClientIds[ 0 ] ) === 'core/page-list';\n\t\t\tconst pageListHasBlocks =\n\t\t\t\thasOnlyPageListBlock &&\n\t\t\t\tgetBlockCount( blockClientIds[ 0 ] ) > 0;\n\n\t\t\tconst isLoadingPages = isResolving(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tPAGES_QUERY\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlistViewRootClientId: pageListHasBlocks\n\t\t\t\t\t? blockClientIds[ 0 ]\n\t\t\t\t\t: rootClientId,\n\t\t\t\t// This is a small hack to wait for the navigation block\n\t\t\t\t// to actually load its inner blocks.\n\t\t\t\tisLoading:\n\t\t\t\t\t! areInnerBlocksControlled( rootClientId ) ||\n\t\t\t\t\tisLoadingPages,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst offCanvasOnselect = useCallback(\n\t\t( block ) => {\n\t\t\tif (\n\t\t\t\tblock.name === 'core/navigation-link' &&\n\t\t\t\t! block.attributes.url\n\t\t\t) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlock(\n\t\t\t\t\tblock.clientId,\n\t\t\t\t\tcreateBlock( 'core/navigation-link', block.attributes )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ __unstableMarkNextChangeAsNotPersistent, replaceBlock ]\n\t);\n\n\t// The hidden block is needed because it makes block edit side effects trigger.\n\t// For example a navigation page list load its items has an effect on edit to load its items.\n\treturn (\n\t\t<>\n\t\t\t{ ! isLoading && (\n\t\t\t\t<PrivateListView\n\t\t\t\t\trootClientId={ listViewRootClientId }\n\t\t\t\t\tonSelect={ offCanvasOnselect }\n\t\t\t\t\tblockSettingsMenu={ LeafMoreMenu }\n\t\t\t\t\tshowAppender={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor\">\n\t\t\t\t<BlockList />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,SAAS,QACH,yBAAyB;AAChC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASN,KAAK,IAAIO,SAAS,QAAQ,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BAAwB,CAAEJ,YAAa,CAAC,IAC1Ca;IACF,CAAC;EACF,CAAC,EACD,CAAEb,YAAY,CACf,CAAC;EACD,MAAM;IAAEc,YAAY;IAAEC;EAAwC,CAAC,GAC9D9B,WAAW,CAAEF,gBAAiB,CAAC;EAEhC,MAAMiC,iBAAiB,GAAG5B,WAAW,CAClC6B,KAAK,IAAM;IACZ,IACCA,KAAK,CAACC,IAAI,KAAK,sBAAsB,IACrC,CAAED,KAAK,CAACE,UAAU,CAACC,GAAG,EACrB;MACDL,uCAAuC,CAAC,CAAC;MACzCD,YAAY,CACXG,KAAK,CAACI,QAAQ,EACdlC,WAAW,CAAE,sBAAsB,EAAE8B,KAAK,CAACE,UAAW,CACvD,CAAC;IACF;EACD,CAAC,EACD,CAAEJ,uCAAuC,EAAED,YAAY,CACxD,CAAC;;EAED;EACA;EACA,OACCQ,aAAA,CAAAC,QAAA,QACG,CAAErB,SAAS,IACZoB,aAAA,CAAC9B,eAAe;IACfQ,YAAY,EAAGC,oBAAsB;IACrCuB,QAAQ,EAAGR,iBAAmB;IAC9BS,iBAAiB,EAAGlC,YAAc;IAClCmC,YAAY,EAAG;EAAO,CACtB,CACD,EACDJ,aAAA;IAAKK,SAAS,EAAC;EAA2E,GACzFL,aAAA,CAACtC,SAAS,MAAE,CACR,CACJ,CAAC;AAEL"}
1
+ {"version":3,"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","BlockList","useDispatch","useSelect","createBlock","useCallback","coreStore","unlock","LeafMoreMenu","PrivateListView","MAX_PAGE_COUNT","PAGES_QUERY","per_page","_fields","orderby","order","NavigationMenuContent","rootClientId","listViewRootClientId","isLoading","select","areInnerBlocksControlled","getBlockName","getBlockCount","getBlockOrder","isResolving","blockClientIds","hasOnlyPageListBlock","length","pageListHasBlocks","isLoadingPages","replaceBlock","__unstableMarkNextChangeAsNotPersistent","offCanvasOnselect","block","name","attributes","url","clientId","createElement","Fragment","onSelect","blockSettingsMenu","showAppender","className"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport LeafMoreMenu from './leaf-more-menu';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\n// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.\nconst MAX_PAGE_COUNT = 100;\nconst PAGES_QUERY = [\n\t'postType',\n\t'page',\n\t{\n\t\tper_page: MAX_PAGE_COUNT,\n\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t// sort.\n\t\torderby: 'menu_order',\n\t\torder: 'asc',\n\t},\n];\n\nexport default function NavigationMenuContent( { rootClientId } ) {\n\tconst { listViewRootClientId, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tareInnerBlocksControlled,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { isResolving } = select( coreStore );\n\n\t\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\n\t\t\tconst hasOnlyPageListBlock =\n\t\t\t\tblockClientIds.length === 1 &&\n\t\t\t\tgetBlockName( blockClientIds[ 0 ] ) === 'core/page-list';\n\t\t\tconst pageListHasBlocks =\n\t\t\t\thasOnlyPageListBlock &&\n\t\t\t\tgetBlockCount( blockClientIds[ 0 ] ) > 0;\n\n\t\t\tconst isLoadingPages = isResolving(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tPAGES_QUERY\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlistViewRootClientId: pageListHasBlocks\n\t\t\t\t\t? blockClientIds[ 0 ]\n\t\t\t\t\t: rootClientId,\n\t\t\t\t// This is a small hack to wait for the navigation block\n\t\t\t\t// to actually load its inner blocks.\n\t\t\t\tisLoading:\n\t\t\t\t\t! areInnerBlocksControlled( rootClientId ) ||\n\t\t\t\t\tisLoadingPages,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst offCanvasOnselect = useCallback(\n\t\t( block ) => {\n\t\t\tif (\n\t\t\t\tblock.name === 'core/navigation-link' &&\n\t\t\t\t! block.attributes.url\n\t\t\t) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlock(\n\t\t\t\t\tblock.clientId,\n\t\t\t\t\tcreateBlock( 'core/navigation-link', block.attributes )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ __unstableMarkNextChangeAsNotPersistent, replaceBlock ]\n\t);\n\n\t// The hidden block is needed because it makes block edit side effects trigger.\n\t// For example a navigation page list load its items has an effect on edit to load its items.\n\treturn (\n\t\t<>\n\t\t\t{ ! isLoading && (\n\t\t\t\t<PrivateListView\n\t\t\t\t\trootClientId={ listViewRootClientId }\n\t\t\t\t\tonSelect={ offCanvasOnselect }\n\t\t\t\t\tblockSettingsMenu={ LeafMoreMenu }\n\t\t\t\t\tshowAppender={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor\">\n\t\t\t\t<BlockList />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAI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AAC;IAEzC,MAAMI,cAAc,GAAGL,WAAW,CACjC,kBAAkB,EAClBd,WACD,CAAC;IAED,OAAO;MACNO,oBAAoB,EAAEW,iBAAiB,GACpCH,cAAc,CAAE,CAAC,CAAE,GACnBT,YAAY;MACf;MACA;MACAE,SAAS,EACR,CAAEE,wBAAwB,CAAEJ,YAAa,CAAC,IAC1Ca;IACF,CAAC;EACF,CAAC,EACD,CAAEb,YAAY,CACf,CAAC;EACD,MAAM;IAAEc,YAAY;IAAEC;EAAwC,CAAC,GAC9D9B,WAAW,CAAEF,gBAAiB,CAAC;EAEhC,MAAMiC,iBAAiB,GAAG5B,WAAW,CAClC6B,KAAK,IAAM;IACZ,IACCA,KAAK,CAACC,IAAI,KAAK,sBAAsB,IACrC,CAAED,KAAK,CAACE,UAAU,CAACC,GAAG,EACrB;MACDL,uCAAuC,CAAC,CAAC;MACzCD,YAAY,CACXG,KAAK,CAACI,QAAQ,EACdlC,WAAW,CAAE,sBAAsB,EAAE8B,KAAK,CAACE,UAAW,CACvD,CAAC;IACF;EACD,CAAC,EACD,CAAEJ,uCAAuC,EAAED,YAAY,CACxD,CAAC;;EAED;EACA;EACA,OACCQ,aAAA,CAAAC,QAAA,QACG,CAAErB,SAAS,IACZoB,aAAA,CAAC9B,eAAe;IACfQ,YAAY,EAAGC,oBAAsB;IACrCuB,QAAQ,EAAGR,iBAAmB;IAC9BS,iBAAiB,EAAGlC,YAAc;IAClCmC,YAAY,EAAG;EAAO,CACtB,CACD,EACDJ,aAAA;IAAKK,SAAS,EAAC;EAA2E,GACzFL,aAAA,CAACtC,SAAS,MAAE,CACR,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -4,15 +4,16 @@ import { createElement, Fragment } from "react";
4
4
  */
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useDispatch, useSelect } from '@wordpress/data';
7
- import { __experimentalUseNavigator as useNavigator, __experimentalVStack as VStack, ExternalLink, __experimentalTruncate as Truncate } from '@wordpress/components';
7
+ import { __experimentalVStack as VStack, ExternalLink, __experimentalTruncate as Truncate } from '@wordpress/components';
8
8
  import { store as coreStore, useEntityRecord } from '@wordpress/core-data';
9
9
  import { decodeEntities } from '@wordpress/html-entities';
10
10
  import { pencil } from '@wordpress/icons';
11
11
  import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
12
12
  import { escapeAttribute } from '@wordpress/escape-html';
13
13
  import { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';
14
- import { useEffect } from '@wordpress/element';
14
+ import { useEffect, useCallback } from '@wordpress/element';
15
15
  import { privateApis as routerPrivateApis } from '@wordpress/router';
16
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
16
17
 
17
18
  /**
18
19
  * Internal dependencies
@@ -22,11 +23,14 @@ import { unlock } from '../../lock-unlock';
22
23
  import { store as editSiteStore } from '../../store';
23
24
  import SidebarButton from '../sidebar-button';
24
25
  import PageDetails from './page-details';
25
- import PageActions from '../page-actions';
26
26
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
27
27
  const {
28
+ useLocation,
28
29
  useHistory
29
30
  } = unlock(routerPrivateApis);
31
+ const {
32
+ PostActions
33
+ } = unlock(editorPrivateApis);
30
34
  export default function SidebarNavigationScreenPage({
31
35
  backPath
32
36
  }) {
@@ -37,9 +41,8 @@ export default function SidebarNavigationScreenPage({
37
41
  const {
38
42
  params: {
39
43
  postId
40
- },
41
- goTo
42
- } = useNavigator();
44
+ }
45
+ } = useLocation();
43
46
  const {
44
47
  record,
45
48
  hasResolved
@@ -69,18 +72,25 @@ export default function SidebarNavigationScreenPage({
69
72
  canvas: 'view'
70
73
  });
71
74
  }
72
- }, [hasResolved, history]);
75
+ }, [hasResolved, record, history]);
76
+ const onActionPerformed = useCallback((actionId, items) => {
77
+ if (actionId === 'move-to-trash') {
78
+ history.push({
79
+ path: '/' + items[0].type,
80
+ postId: undefined,
81
+ postType: undefined,
82
+ canvas: 'view'
83
+ });
84
+ }
85
+ }, [history]);
73
86
  const featureImageAltText = featuredMediaAltText ? decodeEntities(featuredMediaAltText) : decodeEntities(record?.title?.rendered || __('Featured image'));
74
87
  return record ? createElement(SidebarNavigationScreen, {
75
88
  backPath: backPath,
76
89
  title: decodeEntities(record?.title?.rendered || __('(no title)')),
77
- actions: createElement(Fragment, null, createElement(PageActions, {
78
- postId: postId,
79
- toggleProps: {
80
- as: SidebarButton
81
- },
82
- onRemove: () => {
83
- goTo('/page');
90
+ actions: createElement(Fragment, null, createElement(PostActions, {
91
+ onActionPerformed: onActionPerformed,
92
+ buttonProps: {
93
+ size: 'default'
84
94
  }
85
95
  }), createElement(SidebarButton, {
86
96
  onClick: () => setCanvasMode('edit'),
@@ -1 +1 @@
1
- {"version":3,"names":["__","useDispatch","useSelect","__experimentalUseNavigator","useNavigator","__experimentalVStack","VStack","ExternalLink","__experimentalTruncate","Truncate","store","coreStore","useEntityRecord","decodeEntities","pencil","__unstableStripHTML","stripHTML","escapeAttribute","safeDecodeURIComponent","filterURLForDisplay","useEffect","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","PageDetails","PageActions","SidebarNavigationScreenDetailsFooter","useHistory","SidebarNavigationScreenPage","backPath","setCanvasMode","history","params","postId","goTo","record","hasResolved","featuredMediaAltText","featuredMediaSourceUrl","select","getEntityRecord","attachedMedia","featured_media","media_details","sizes","medium","source_url","alt_text","description","raw","push","path","undefined","postType","canvas","featureImageAltText","title","rendered","createElement","actions","Fragment","toggleProps","as","onRemove","onClick","label","icon","meta","className","href","link","content","alignment","spacing","alt","src","excerpt","numberOfLines","id","footer","modified"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalVStack as VStack,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';\nimport { useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport PageDetails from './page-details';\nimport PageActions from '../page-actions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenPage( { backPath } ) {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst history = useHistory();\n\tconst {\n\t\tparams: { postId },\n\t\tgoTo,\n\t} = useNavigator();\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'page',\n\t\tpostId\n\t);\n\n\tconst { featuredMediaAltText, featuredMediaSourceUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\t// Featured image.\n\t\t\tconst attachedMedia = record?.featured_media\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\trecord?.featured_media\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tfeaturedMediaSourceUrl:\n\t\t\t\t\tattachedMedia?.media_details.sizes?.medium?.source_url ||\n\t\t\t\t\tattachedMedia?.source_url,\n\t\t\t\tfeaturedMediaAltText: escapeAttribute(\n\t\t\t\t\tattachedMedia?.alt_text ||\n\t\t\t\t\t\tattachedMedia?.description?.raw ||\n\t\t\t\t\t\t''\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ record ]\n\t);\n\n\t// Redirect to the main pages navigation screen if the page is not found or has been deleted.\n\tuseEffect( () => {\n\t\tif ( hasResolved && ! record ) {\n\t\t\thistory.push( {\n\t\t\t\tpath: '/page',\n\t\t\t\tpostId: undefined,\n\t\t\t\tpostType: undefined,\n\t\t\t\tcanvas: 'view',\n\t\t\t} );\n\t\t}\n\t}, [ hasResolved, history ] );\n\n\tconst featureImageAltText = featuredMediaAltText\n\t\t? decodeEntities( featuredMediaAltText )\n\t\t: decodeEntities( record?.title?.rendered || __( 'Featured image' ) );\n\n\treturn record ? (\n\t\t<SidebarNavigationScreen\n\t\t\tbackPath={ backPath }\n\t\t\ttitle={ decodeEntities(\n\t\t\t\trecord?.title?.rendered || __( '(no title)' )\n\t\t\t) }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<PageActions\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\tgoTo( '/page' );\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\tmeta={\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\thref={ record.link }\n\t\t\t\t>\n\t\t\t\t\t{ filterURLForDisplay(\n\t\t\t\t\t\tsafeDecodeURIComponent( record.link )\n\t\t\t\t\t) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ !! featuredMediaSourceUrl && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__featured-image-wrapper\"\n\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-page__featured-image has-image\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ featureImageAltText }\n\t\t\t\t\t\t\t\t\tsrc={ featuredMediaSourceUrl }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! record?.excerpt?.rendered && (\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__excerpt\"\n\t\t\t\t\t\t\tnumberOfLines={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( record.excerpt.rendered ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t) }\n\t\t\t\t\t<PageDetails id={ postId } />\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\trecord?.modified ? (\n\t\t\t\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t\t\t\t) : null\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,0BAA0B,IAAIC,YAAY,EAC1CC,oBAAoB,IAAIC,MAAM,EAC9BC,YAAY,EACZC,sBAAsB,IAAIC,QAAQ,QAC5B,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,eAAe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E,IAAI,EAAGvD;IAAQ,CACf,CACA,CACF;IACDwD,IAAI,EACHT,aAAA,CAACtD,YAAY;MACZgE,SAAS,EAAC,gDAAgD;MAC1DC,IAAI,EAAGlC,MAAM,CAACmC;IAAM,GAElBtD,mBAAmB,CACpBD,sBAAsB,CAAEoB,MAAM,CAACmC,IAAK,CACrC,CACa,CACd;IACDC,OAAO,EACNb,aAAA,CAAAE,QAAA,QACG,CAAC,CAAEtB,sBAAsB,IAC1BoB,aAAA,CAACvD,MAAM;MACNiE,SAAS,EAAC,kEAAkE;MAC5EI,SAAS,EAAC,MAAM;MAChBC,OAAO,EAAG;IAAG,GAEbf,aAAA;MAAKU,SAAS,EAAC;IAAoE,GAClFV,aAAA;MACCgB,GAAG,EAAGnB,mBAAqB;MAC3BoB,GAAG,EAAGrC;IAAwB,CAC9B,CACG,CACE,CACR,EACC,CAAC,CAAEH,MAAM,EAAEyC,OAAO,EAAEnB,QAAQ,IAC7BC,aAAA,CAACpD,QAAQ;MACR8D,SAAS,EAAC,mDAAmD;MAC7DS,aAAa,EAAG;IAAG,GAEjBhE,SAAS,CAAEsB,MAAM,CAACyC,OAAO,CAACnB,QAAS,CAC5B,CACV,EACDC,aAAA,CAAClC,WAAW;MAACsD,EAAE,EAAG7C;IAAQ,CAAE,CAC3B,CACF;IACD8C,MAAM,EACL5C,MAAM,EAAE6C,QAAQ,GACftB,aAAA,CAAChC,oCAAoC;MAACS,MAAM,EAAGA;IAAQ,CAAE,CAAC,GACvD;EACJ,CACD,CAAC,GACC,IAAI;AACT"}
1
+ {"version":3,"names":["__","useDispatch","useSelect","__experimentalVStack","VStack","ExternalLink","__experimentalTruncate","Truncate","store","coreStore","useEntityRecord","decodeEntities","pencil","__unstableStripHTML","stripHTML","escapeAttribute","safeDecodeURIComponent","filterURLForDisplay","useEffect","useCallback","privateApis","routerPrivateApis","editorPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","PageDetails","SidebarNavigationScreenDetailsFooter","useLocation","useHistory","PostActions","SidebarNavigationScreenPage","backPath","setCanvasMode","history","params","postId","record","hasResolved","featuredMediaAltText","featuredMediaSourceUrl","select","getEntityRecord","attachedMedia","featured_media","media_details","sizes","medium","source_url","alt_text","description","raw","push","path","undefined","postType","canvas","onActionPerformed","actionId","items","type","featureImageAltText","title","rendered","createElement","actions","Fragment","buttonProps","size","onClick","label","icon","meta","className","href","link","content","alignment","spacing","alt","src","excerpt","numberOfLines","id","footer","modified"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\t__experimentalVStack as VStack,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport PageDetails from './page-details';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { PostActions } = unlock( editorPrivateApis );\n\nexport default function SidebarNavigationScreenPage( { backPath } ) {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst history = useHistory();\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'page',\n\t\tpostId\n\t);\n\n\tconst { featuredMediaAltText, featuredMediaSourceUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\t// Featured image.\n\t\t\tconst attachedMedia = record?.featured_media\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\trecord?.featured_media\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tfeaturedMediaSourceUrl:\n\t\t\t\t\tattachedMedia?.media_details.sizes?.medium?.source_url ||\n\t\t\t\t\tattachedMedia?.source_url,\n\t\t\t\tfeaturedMediaAltText: escapeAttribute(\n\t\t\t\t\tattachedMedia?.alt_text ||\n\t\t\t\t\t\tattachedMedia?.description?.raw ||\n\t\t\t\t\t\t''\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ record ]\n\t);\n\n\t// Redirect to the main pages navigation screen if the page is not found or has been deleted.\n\tuseEffect( () => {\n\t\tif ( hasResolved && ! record ) {\n\t\t\thistory.push( {\n\t\t\t\tpath: '/page',\n\t\t\t\tpostId: undefined,\n\t\t\t\tpostType: undefined,\n\t\t\t\tcanvas: 'view',\n\t\t\t} );\n\t\t}\n\t}, [ hasResolved, record, history ] );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tif ( actionId === 'move-to-trash' ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath: '/' + items[ 0 ].type,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tcanvas: 'view',\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\n\tconst featureImageAltText = featuredMediaAltText\n\t\t? decodeEntities( featuredMediaAltText )\n\t\t: decodeEntities( record?.title?.rendered || __( 'Featured image' ) );\n\n\treturn record ? (\n\t\t<SidebarNavigationScreen\n\t\t\tbackPath={ backPath }\n\t\t\ttitle={ decodeEntities(\n\t\t\t\trecord?.title?.rendered || __( '(no title)' )\n\t\t\t) }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<PostActions\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\tbuttonProps={ { size: 'default' } }\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\tmeta={\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\thref={ record.link }\n\t\t\t\t>\n\t\t\t\t\t{ filterURLForDisplay(\n\t\t\t\t\t\tsafeDecodeURIComponent( record.link )\n\t\t\t\t\t) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ !! featuredMediaSourceUrl && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__featured-image-wrapper\"\n\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-page__featured-image has-image\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ featureImageAltText }\n\t\t\t\t\t\t\t\t\tsrc={ featuredMediaSourceUrl }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! record?.excerpt?.rendered && (\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__excerpt\"\n\t\t\t\t\t\t\tnumberOfLines={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( record.excerpt.rendered ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t) }\n\t\t\t\t\t<PageDetails id={ postId } />\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\trecord?.modified ? (\n\t\t\t\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t\t\t\t) : null\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,YAAY,EACZC,sBAAsB,IAAIC,QAAQ,QAC5B,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,sBAAsB,EAAEC,mBAAmB,QAAQ,gBAAgB;AAC5E,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAC3D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAAShB,KAAK,IAAIiB,aAAa,QAAQ,aAAa;AACpD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,oCAAoC,MAAM,6CAA6C;AAE9F,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGN,MAAM,CAAEH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