@wordpress/edit-site 5.32.0 → 5.34.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 (872) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +3 -0
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +8 -7
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +282 -13
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/utils.js +22 -11
  13. package/build/components/add-new-template/utils.js.map +1 -1
  14. package/build/components/app/index.js.map +1 -1
  15. package/build/components/async/index.js +51 -0
  16. package/build/components/async/index.js.map +1 -0
  17. package/build/components/block-editor/block-inspector-button.js +10 -9
  18. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  19. package/build/components/block-editor/editor-canvas.js +15 -6
  20. package/build/components/block-editor/editor-canvas.js.map +1 -1
  21. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  22. package/build/components/block-editor/resizable-editor.js.map +1 -1
  23. package/build/components/block-editor/resize-handle.js +20 -5
  24. package/build/components/block-editor/resize-handle.js.map +1 -1
  25. package/build/components/block-editor/site-editor-canvas.js +5 -1
  26. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  27. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  28. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  29. package/build/components/canvas-loader/index.js.map +1 -1
  30. package/build/components/code-editor/index.js.map +1 -1
  31. package/build/components/create-template-part-modal/index.js +3 -0
  32. package/build/components/create-template-part-modal/index.js.map +1 -1
  33. package/build/components/editor/index.js +61 -11
  34. package/build/components/editor/index.js.map +1 -1
  35. package/build/components/editor-canvas-container/index.js.map +1 -1
  36. package/build/components/error-boundary/index.js.map +1 -1
  37. package/build/components/error-boundary/warning.js.map +1 -1
  38. package/build/components/global-styles/background-panel.js +13 -1
  39. package/build/components/global-styles/background-panel.js.map +1 -1
  40. package/build/components/global-styles/block-preview-panel.js +6 -1
  41. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  42. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  43. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  44. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  45. package/build/components/global-styles/font-families.js +1 -1
  46. package/build/components/global-styles/font-families.js.map +1 -1
  47. package/build/components/global-styles/font-family-item.js.map +1 -1
  48. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/context.js +69 -35
  50. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  51. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  52. package/build/components/global-styles/font-library-modal/font-collection.js +18 -6
  53. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  54. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  55. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/index.js +1 -1
  57. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/installed-fonts.js +31 -28
  59. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  61. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  63. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  65. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  67. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  68. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  69. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  70. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  71. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  72. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  73. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  74. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  75. package/build/components/global-styles/header.js.map +1 -1
  76. package/build/components/global-styles/highlighted-colors.js +1 -1
  77. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  78. package/build/components/global-styles/hooks.js +11 -3
  79. package/build/components/global-styles/hooks.js.map +1 -1
  80. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  81. package/build/components/global-styles/index.js.map +1 -1
  82. package/build/components/global-styles/navigation-button.js.map +1 -1
  83. package/build/components/global-styles/palette.js.map +1 -1
  84. package/build/components/global-styles/preview-colors.js.map +1 -1
  85. package/build/components/global-styles/preview-iframe.js.map +1 -1
  86. package/build/components/global-styles/preview-styles.js.map +1 -1
  87. package/build/components/global-styles/root-menu.js +2 -2
  88. package/build/components/global-styles/root-menu.js.map +1 -1
  89. package/build/components/global-styles/screen-background.js +1 -1
  90. package/build/components/global-styles/screen-background.js.map +1 -1
  91. package/build/components/global-styles/screen-block-list.js.map +1 -1
  92. package/build/components/global-styles/screen-block.js.map +1 -1
  93. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  94. package/build/components/global-styles/screen-colors.js.map +1 -1
  95. package/build/components/global-styles/screen-css.js.map +1 -1
  96. package/build/components/global-styles/screen-layout.js.map +1 -1
  97. package/build/components/global-styles/screen-revisions/index.js +1 -1
  98. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  99. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  101. package/build/components/global-styles/screen-root.js.map +1 -1
  102. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  103. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js.map +1 -1
  105. package/build/components/global-styles/style-variations-container.js +8 -2
  106. package/build/components/global-styles/style-variations-container.js.map +1 -1
  107. package/build/components/global-styles/subtitle.js.map +1 -1
  108. package/build/components/global-styles/typography-elements.js.map +1 -1
  109. package/build/components/global-styles/typography-example.js.map +1 -1
  110. package/build/components/global-styles/typography-panel.js.map +1 -1
  111. package/build/components/global-styles/typography-preview.js.map +1 -1
  112. package/build/components/global-styles/ui.js +1 -1
  113. package/build/components/global-styles/ui.js.map +1 -1
  114. package/build/components/global-styles/utils.js.map +1 -1
  115. package/build/components/global-styles/variations/variation.js.map +1 -1
  116. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  117. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  118. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  119. package/build/components/global-styles-renderer/index.js.map +1 -1
  120. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  121. package/build/components/header-edit-mode/index.js +36 -52
  122. package/build/components/header-edit-mode/index.js.map +1 -1
  123. package/build/components/header-edit-mode/more-menu/index.js +4 -100
  124. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  125. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  126. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  127. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  128. package/build/components/keyboard-shortcuts/register.js +0 -67
  129. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  130. package/build/components/layout/animation.js +3 -2
  131. package/build/components/layout/animation.js.map +1 -1
  132. package/build/components/layout/hooks.js.map +1 -1
  133. package/build/components/layout/index.js +20 -52
  134. package/build/components/layout/index.js.map +1 -1
  135. package/build/components/layout/router.js +70 -33
  136. package/build/components/layout/router.js.map +1 -1
  137. package/build/components/media/index.js.map +1 -1
  138. package/build/components/page/header.js.map +1 -1
  139. package/build/components/page/index.js +5 -2
  140. package/build/components/page/index.js.map +1 -1
  141. package/build/components/page-pages/index.js +18 -19
  142. package/build/components/page-pages/index.js.map +1 -1
  143. package/build/components/page-patterns/dataviews-pattern-actions.js +16 -11
  144. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  145. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  146. package/build/components/page-patterns/header.js +5 -3
  147. package/build/components/page-patterns/header.js.map +1 -1
  148. package/build/components/page-patterns/index.js +140 -62
  149. package/build/components/page-patterns/index.js.map +1 -1
  150. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  151. package/build/components/page-patterns/search-items.js +2 -1
  152. package/build/components/page-patterns/search-items.js.map +1 -1
  153. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  154. package/build/components/page-patterns/use-patterns.js +6 -10
  155. package/build/components/page-patterns/use-patterns.js.map +1 -1
  156. package/build/components/page-patterns/utils.js.map +1 -1
  157. package/build/components/page-templates/hooks.js.map +1 -0
  158. package/build/components/{page-templates-template-parts → page-templates}/index.js +78 -103
  159. package/build/components/page-templates/index.js.map +1 -0
  160. package/build/components/pagination/index.js.map +1 -1
  161. package/build/components/pattern-modal/duplicate.js +13 -8
  162. package/build/components/pattern-modal/duplicate.js.map +1 -1
  163. package/build/components/pattern-modal/index.js.map +1 -1
  164. package/build/components/pattern-modal/rename.js +6 -3
  165. package/build/components/pattern-modal/rename.js.map +1 -1
  166. package/build/components/plugin-template-setting-panel/index.js +9 -0
  167. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  168. package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
  169. package/build/components/rename-post-menu-item/index.js.map +1 -0
  170. package/build/components/resizable-frame/index.js +10 -11
  171. package/build/components/resizable-frame/index.js.map +1 -1
  172. package/build/components/revisions/index.js.map +1 -1
  173. package/build/components/routes/link.js.map +1 -1
  174. package/build/components/routes/use-title.js.map +1 -1
  175. package/build/components/save-button/index.js.map +1 -1
  176. package/build/components/save-hub/index.js.map +1 -1
  177. package/build/components/save-panel/index.js +3 -3
  178. package/build/components/save-panel/index.js.map +1 -1
  179. package/build/components/sidebar/index.js +41 -75
  180. package/build/components/sidebar/index.js.map +1 -1
  181. package/build/components/sidebar-button/index.js.map +1 -1
  182. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  183. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  184. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  185. package/build/components/sidebar-dataviews/default-views.js +1 -1
  186. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  187. package/build/components/sidebar-dataviews/index.js +1 -1
  188. package/build/components/sidebar-dataviews/index.js.map +1 -1
  189. package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
  190. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  191. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  192. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  193. package/build/components/sidebar-edit-mode/index.js +31 -55
  194. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  195. package/build/components/sidebar-edit-mode/page-panels/index.js +55 -3
  196. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  197. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  198. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +23 -16
  199. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
  201. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  202. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  203. package/build/components/sidebar-edit-mode/template-panel/index.js +3 -6
  204. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  205. package/build/components/sidebar-navigation-item/index.js +31 -0
  206. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  207. package/build/components/sidebar-navigation-screen/index.js +36 -9
  208. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  209. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  210. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  212. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  213. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -2
  215. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  216. package/build/components/sidebar-navigation-screen-main/index.js +6 -15
  217. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  219. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  220. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
  221. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  222. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  223. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  224. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  225. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  226. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  227. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  228. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  229. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  231. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  233. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  234. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  235. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-page/index.js +53 -12
  237. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  238. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  239. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-pattern/index.js +17 -15
  241. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  242. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  243. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  244. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  245. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  246. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  247. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  248. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  249. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  250. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  251. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  252. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  253. package/build/components/sidebar-navigation-screen-patterns/index.js +64 -52
  254. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  255. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  257. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  259. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-template/index.js +11 -8
  261. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  263. package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  264. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  265. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
  266. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  267. package/build/components/site-hub/index.js +22 -21
  268. package/build/components/site-hub/index.js.map +1 -1
  269. package/build/components/site-icon/index.js.map +1 -1
  270. package/build/components/start-template-options/index.js.map +1 -1
  271. package/build/components/style-book/index.js.map +1 -1
  272. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
  273. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  274. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  275. package/build/components/table/index.js.map +1 -1
  276. package/build/components/template-actions/index.js +7 -8
  277. package/build/components/template-actions/index.js.map +1 -1
  278. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  279. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  280. package/build/components/template-part-converter/index.js.map +1 -1
  281. package/build/components/use-edited-entity-record/index.js.map +1 -1
  282. package/build/components/welcome-guide/editor.js.map +1 -1
  283. package/build/components/welcome-guide/image.js.map +1 -1
  284. package/build/components/welcome-guide/index.js.map +1 -1
  285. package/build/components/welcome-guide/page.js.map +1 -1
  286. package/build/components/welcome-guide/styles.js +6 -3
  287. package/build/components/welcome-guide/styles.js.map +1 -1
  288. package/build/components/welcome-guide/template.js.map +1 -1
  289. package/build/deprecated.js +55 -0
  290. package/build/deprecated.js.map +1 -0
  291. package/build/hooks/commands/use-common-commands.js.map +1 -1
  292. package/build/hooks/commands/use-edit-mode-commands.js +10 -28
  293. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  294. package/build/hooks/components.js.map +1 -1
  295. package/build/hooks/index.js.map +1 -1
  296. package/build/hooks/push-changes-to-global-styles/index.js +3 -40
  297. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  298. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +36 -5
  299. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  300. package/build/index.js +18 -23
  301. package/build/index.js.map +1 -1
  302. package/build/lock-unlock.js.map +1 -1
  303. package/build/store/actions.js +21 -96
  304. package/build/store/actions.js.map +1 -1
  305. package/build/store/constants.js.map +1 -1
  306. package/build/store/index.js +1 -1
  307. package/build/store/index.js.map +1 -1
  308. package/build/store/private-actions.js +1 -85
  309. package/build/store/private-actions.js.map +1 -1
  310. package/build/store/private-selectors.js.map +1 -1
  311. package/build/store/reducer.js.map +1 -1
  312. package/build/store/selectors.js.map +1 -1
  313. package/build/utils/clone-deep.js.map +1 -1
  314. package/build/utils/constants.js +2 -2
  315. package/build/utils/constants.js.map +1 -1
  316. package/build/utils/get-is-list-page.js.map +1 -1
  317. package/build/utils/is-previewing-theme.js.map +1 -1
  318. package/build/utils/is-template-removable.js.map +1 -1
  319. package/build/utils/is-template-revertable.js.map +1 -1
  320. package/build/utils/math.js.map +1 -1
  321. package/build/utils/set-nested-value.js +44 -0
  322. package/build/utils/set-nested-value.js.map +1 -0
  323. package/build/utils/template-part-create.js.map +1 -1
  324. package/build/utils/use-activate-theme.js.map +1 -1
  325. package/build/utils/use-actual-current-theme.js.map +1 -1
  326. package/build-module/components/add-new-page/index.js +3 -0
  327. package/build-module/components/add-new-page/index.js.map +1 -1
  328. package/build-module/components/add-new-pattern/index.js +8 -7
  329. package/build-module/components/add-new-pattern/index.js.map +1 -1
  330. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  331. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  332. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
  333. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  334. package/build-module/components/add-new-template/index.js +283 -14
  335. package/build-module/components/add-new-template/index.js.map +1 -1
  336. package/build-module/components/add-new-template/utils.js +21 -11
  337. package/build-module/components/add-new-template/utils.js.map +1 -1
  338. package/build-module/components/app/index.js.map +1 -1
  339. package/build-module/components/async/index.js +44 -0
  340. package/build-module/components/async/index.js.map +1 -0
  341. package/build-module/components/block-editor/block-inspector-button.js +9 -8
  342. package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
  343. package/build-module/components/block-editor/editor-canvas.js +16 -7
  344. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  345. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  346. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  347. package/build-module/components/block-editor/resize-handle.js +21 -6
  348. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  349. package/build-module/components/block-editor/site-editor-canvas.js +5 -1
  350. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  351. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  352. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  353. package/build-module/components/canvas-loader/index.js.map +1 -1
  354. package/build-module/components/code-editor/index.js.map +1 -1
  355. package/build-module/components/create-template-part-modal/index.js +3 -0
  356. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  357. package/build-module/components/editor/index.js +61 -11
  358. package/build-module/components/editor/index.js.map +1 -1
  359. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  360. package/build-module/components/error-boundary/index.js.map +1 -1
  361. package/build-module/components/error-boundary/warning.js.map +1 -1
  362. package/build-module/components/global-styles/background-panel.js +14 -1
  363. package/build-module/components/global-styles/background-panel.js.map +1 -1
  364. package/build-module/components/global-styles/block-preview-panel.js +6 -1
  365. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  366. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  367. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  368. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  369. package/build-module/components/global-styles/font-families.js.map +1 -1
  370. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  371. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  372. package/build-module/components/global-styles/font-library-modal/context.js +68 -35
  373. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  374. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  375. package/build-module/components/global-styles/font-library-modal/font-collection.js +19 -7
  376. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  377. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  378. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  379. package/build-module/components/global-styles/font-library-modal/index.js +2 -2
  380. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  381. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +32 -29
  382. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  383. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  384. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  385. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  386. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  387. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  388. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  389. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  390. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  391. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  392. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  393. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  394. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  395. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  396. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  397. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  398. package/build-module/components/global-styles/header.js.map +1 -1
  399. package/build-module/components/global-styles/highlighted-colors.js +1 -1
  400. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  401. package/build-module/components/global-styles/hooks.js +11 -3
  402. package/build-module/components/global-styles/hooks.js.map +1 -1
  403. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  404. package/build-module/components/global-styles/index.js.map +1 -1
  405. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  406. package/build-module/components/global-styles/palette.js.map +1 -1
  407. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  408. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  409. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  410. package/build-module/components/global-styles/root-menu.js +2 -2
  411. package/build-module/components/global-styles/root-menu.js.map +1 -1
  412. package/build-module/components/global-styles/screen-background.js +1 -1
  413. package/build-module/components/global-styles/screen-background.js.map +1 -1
  414. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  415. package/build-module/components/global-styles/screen-block.js.map +1 -1
  416. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  417. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  418. package/build-module/components/global-styles/screen-css.js.map +1 -1
  419. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  420. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  421. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  422. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  423. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  424. package/build-module/components/global-styles/screen-root.js.map +1 -1
  425. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  426. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  427. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  428. package/build-module/components/global-styles/style-variations-container.js +8 -2
  429. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  430. package/build-module/components/global-styles/subtitle.js.map +1 -1
  431. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  432. package/build-module/components/global-styles/typography-example.js.map +1 -1
  433. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  434. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  435. package/build-module/components/global-styles/ui.js.map +1 -1
  436. package/build-module/components/global-styles/utils.js.map +1 -1
  437. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  438. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  439. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  440. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  441. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  442. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  443. package/build-module/components/header-edit-mode/index.js +41 -57
  444. package/build-module/components/header-edit-mode/index.js.map +1 -1
  445. package/build-module/components/header-edit-mode/more-menu/index.js +6 -100
  446. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  447. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  448. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  449. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  450. package/build-module/components/keyboard-shortcuts/register.js +0 -67
  451. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  452. package/build-module/components/layout/animation.js +4 -3
  453. package/build-module/components/layout/animation.js.map +1 -1
  454. package/build-module/components/layout/hooks.js.map +1 -1
  455. package/build-module/components/layout/index.js +20 -52
  456. package/build-module/components/layout/index.js.map +1 -1
  457. package/build-module/components/layout/router.js +70 -33
  458. package/build-module/components/layout/router.js.map +1 -1
  459. package/build-module/components/media/index.js.map +1 -1
  460. package/build-module/components/page/header.js.map +1 -1
  461. package/build-module/components/page/index.js +5 -2
  462. package/build-module/components/page/index.js.map +1 -1
  463. package/build-module/components/page-pages/index.js +18 -19
  464. package/build-module/components/page-pages/index.js.map +1 -1
  465. package/build-module/components/page-patterns/dataviews-pattern-actions.js +16 -11
  466. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  467. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  468. package/build-module/components/page-patterns/header.js +5 -3
  469. package/build-module/components/page-patterns/header.js.map +1 -1
  470. package/build-module/components/page-patterns/index.js +143 -65
  471. package/build-module/components/page-patterns/index.js.map +1 -1
  472. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  473. package/build-module/components/page-patterns/search-items.js +3 -2
  474. package/build-module/components/page-patterns/search-items.js.map +1 -1
  475. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  476. package/build-module/components/page-patterns/use-patterns.js +3 -6
  477. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  478. package/build-module/components/page-patterns/utils.js.map +1 -1
  479. package/build-module/components/page-templates/hooks.js.map +1 -0
  480. package/build-module/components/{page-templates-template-parts → page-templates}/index.js +77 -102
  481. package/build-module/components/page-templates/index.js.map +1 -0
  482. package/build-module/components/pagination/index.js.map +1 -1
  483. package/build-module/components/pattern-modal/duplicate.js +11 -6
  484. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  485. package/build-module/components/pattern-modal/index.js.map +1 -1
  486. package/build-module/components/pattern-modal/rename.js +4 -1
  487. package/build-module/components/pattern-modal/rename.js.map +1 -1
  488. package/build-module/components/plugin-template-setting-panel/index.js +8 -0
  489. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  490. package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
  491. package/build-module/components/rename-post-menu-item/index.js.map +1 -0
  492. package/build-module/components/resizable-frame/index.js +10 -11
  493. package/build-module/components/resizable-frame/index.js.map +1 -1
  494. package/build-module/components/revisions/index.js.map +1 -1
  495. package/build-module/components/routes/link.js.map +1 -1
  496. package/build-module/components/routes/use-title.js.map +1 -1
  497. package/build-module/components/save-button/index.js.map +1 -1
  498. package/build-module/components/save-hub/index.js.map +1 -1
  499. package/build-module/components/save-panel/index.js +2 -2
  500. package/build-module/components/save-panel/index.js.map +1 -1
  501. package/build-module/components/sidebar/index.js +42 -75
  502. package/build-module/components/sidebar/index.js.map +1 -1
  503. package/build-module/components/sidebar-button/index.js.map +1 -1
  504. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  505. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  506. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  507. package/build-module/components/sidebar-dataviews/default-views.js +1 -1
  508. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  509. package/build-module/components/sidebar-dataviews/index.js +1 -1
  510. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  511. package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
  512. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  513. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
  514. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  515. package/build-module/components/sidebar-edit-mode/index.js +30 -54
  516. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  517. package/build-module/components/sidebar-edit-mode/page-panels/index.js +58 -6
  518. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  519. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  520. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
  521. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  522. package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
  523. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  524. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  525. package/build-module/components/sidebar-edit-mode/template-panel/index.js +4 -7
  526. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  527. package/build-module/components/sidebar-navigation-item/index.js +31 -0
  528. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  529. package/build-module/components/sidebar-navigation-screen/index.js +37 -10
  530. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  531. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  532. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  533. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  534. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  535. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -3
  537. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  538. package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
  539. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  540. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  541. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  542. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
  543. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  544. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  545. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  546. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  547. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  548. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  549. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
  550. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  551. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  553. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  554. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  555. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
  556. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  557. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  558. package/build-module/components/sidebar-navigation-screen-page/index.js +56 -15
  559. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  560. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  561. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  562. package/build-module/components/sidebar-navigation-screen-pattern/index.js +17 -15
  563. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  564. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  565. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  567. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  568. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  569. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  570. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
  571. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  572. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  573. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  574. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  575. package/build-module/components/sidebar-navigation-screen-patterns/index.js +66 -54
  576. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  577. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  579. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  581. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-template/index.js +13 -9
  583. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
  585. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  586. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  587. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
  588. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  589. package/build-module/components/site-hub/index.js +22 -21
  590. package/build-module/components/site-hub/index.js.map +1 -1
  591. package/build-module/components/site-icon/index.js.map +1 -1
  592. package/build-module/components/start-template-options/index.js.map +1 -1
  593. package/build-module/components/style-book/index.js.map +1 -1
  594. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
  595. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  596. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  597. package/build-module/components/table/index.js.map +1 -1
  598. package/build-module/components/template-actions/index.js +7 -8
  599. package/build-module/components/template-actions/index.js.map +1 -1
  600. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  601. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  602. package/build-module/components/template-part-converter/index.js.map +1 -1
  603. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  604. package/build-module/components/welcome-guide/editor.js.map +1 -1
  605. package/build-module/components/welcome-guide/image.js.map +1 -1
  606. package/build-module/components/welcome-guide/index.js.map +1 -1
  607. package/build-module/components/welcome-guide/page.js.map +1 -1
  608. package/build-module/components/welcome-guide/styles.js +6 -3
  609. package/build-module/components/welcome-guide/styles.js.map +1 -1
  610. package/build-module/components/welcome-guide/template.js.map +1 -1
  611. package/build-module/deprecated.js +45 -0
  612. package/build-module/deprecated.js.map +1 -0
  613. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  614. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
  615. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  616. package/build-module/hooks/components.js.map +1 -1
  617. package/build-module/hooks/index.js.map +1 -1
  618. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
  619. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  620. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -5
  621. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  622. package/build-module/index.js +1 -5
  623. package/build-module/index.js.map +1 -1
  624. package/build-module/lock-unlock.js.map +1 -1
  625. package/build-module/store/actions.js +16 -92
  626. package/build-module/store/actions.js.map +1 -1
  627. package/build-module/store/constants.js.map +1 -1
  628. package/build-module/store/index.js.map +1 -1
  629. package/build-module/store/private-actions.js +0 -83
  630. package/build-module/store/private-actions.js.map +1 -1
  631. package/build-module/store/private-selectors.js.map +1 -1
  632. package/build-module/store/reducer.js.map +1 -1
  633. package/build-module/store/selectors.js.map +1 -1
  634. package/build-module/utils/clone-deep.js.map +1 -1
  635. package/build-module/utils/constants.js +1 -1
  636. package/build-module/utils/constants.js.map +1 -1
  637. package/build-module/utils/get-is-list-page.js.map +1 -1
  638. package/build-module/utils/is-previewing-theme.js.map +1 -1
  639. package/build-module/utils/is-template-removable.js.map +1 -1
  640. package/build-module/utils/is-template-revertable.js.map +1 -1
  641. package/build-module/utils/math.js.map +1 -1
  642. package/build-module/utils/set-nested-value.js +38 -0
  643. package/build-module/utils/set-nested-value.js.map +1 -0
  644. package/build-module/utils/template-part-create.js.map +1 -1
  645. package/build-module/utils/use-activate-theme.js.map +1 -1
  646. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  647. package/build-style/style-rtl.css +261 -720
  648. package/build-style/style.css +261 -720
  649. package/package.json +43 -44
  650. package/src/components/add-new-page/index.js +7 -1
  651. package/src/components/add-new-pattern/index.js +15 -12
  652. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  653. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
  654. package/src/components/add-new-template/index.js +412 -12
  655. package/src/components/add-new-template/style.scss +0 -22
  656. package/src/components/add-new-template/utils.js +44 -24
  657. package/src/components/async/index.js +43 -0
  658. package/src/components/block-editor/block-inspector-button.js +9 -11
  659. package/src/components/block-editor/editor-canvas.js +45 -21
  660. package/src/components/block-editor/resize-handle.js +30 -11
  661. package/src/components/block-editor/site-editor-canvas.js +6 -1
  662. package/src/components/block-editor/style.scss +10 -15
  663. package/src/components/create-template-part-modal/index.js +3 -0
  664. package/src/components/editor/index.js +91 -15
  665. package/src/components/editor/style.scss +6 -1
  666. package/src/components/global-styles/background-panel.js +16 -0
  667. package/src/components/global-styles/block-preview-panel.js +6 -1
  668. package/src/components/global-styles/font-library-modal/context.js +85 -54
  669. package/src/components/global-styles/font-library-modal/font-collection.js +265 -222
  670. package/src/components/global-styles/font-library-modal/index.js +2 -2
  671. package/src/components/global-styles/font-library-modal/installed-fonts.js +184 -147
  672. package/src/components/global-styles/font-library-modal/style.scss +48 -13
  673. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  674. package/src/components/global-styles/highlighted-colors.js +1 -1
  675. package/src/components/global-styles/hooks.js +20 -3
  676. package/src/components/global-styles/root-menu.js +2 -2
  677. package/src/components/global-styles/screen-background.js +1 -1
  678. package/src/components/global-styles/screen-revisions/index.js +1 -1
  679. package/src/components/global-styles/style-variations-container.js +11 -2
  680. package/src/components/header-edit-mode/index.js +56 -78
  681. package/src/components/header-edit-mode/more-menu/index.js +9 -157
  682. package/src/components/header-edit-mode/style.scss +14 -86
  683. package/src/components/keyboard-shortcuts/register.js +0 -78
  684. package/src/components/layout/animation.js +6 -3
  685. package/src/components/layout/index.js +23 -52
  686. package/src/components/layout/router.js +73 -50
  687. package/src/components/layout/style.scss +15 -37
  688. package/src/components/page/index.js +7 -2
  689. package/src/components/page-pages/index.js +46 -26
  690. package/src/components/page-pages/style.scss +40 -22
  691. package/src/components/page-patterns/dataviews-pattern-actions.js +13 -15
  692. package/src/components/page-patterns/header.js +7 -3
  693. package/src/components/page-patterns/index.js +162 -109
  694. package/src/components/page-patterns/search-items.js +3 -0
  695. package/src/components/page-patterns/style.scss +21 -7
  696. package/src/components/page-patterns/use-patterns.js +3 -6
  697. package/src/components/{page-templates-template-parts → page-templates}/index.js +46 -84
  698. package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
  699. package/src/components/pattern-modal/duplicate.js +6 -4
  700. package/src/components/pattern-modal/rename.js +2 -1
  701. package/src/components/plugin-template-setting-panel/index.js +8 -0
  702. package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
  703. package/src/components/resizable-frame/index.js +6 -9
  704. package/src/components/save-panel/index.js +2 -2
  705. package/src/components/sidebar/index.js +52 -100
  706. package/src/components/sidebar/style.scss +41 -6
  707. package/src/components/sidebar-dataviews/default-views.js +1 -1
  708. package/src/components/sidebar-dataviews/index.js +1 -1
  709. package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
  710. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
  711. package/src/components/sidebar-edit-mode/index.js +50 -75
  712. package/src/components/sidebar-edit-mode/page-panels/index.js +65 -14
  713. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +40 -20
  714. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
  715. package/src/components/sidebar-edit-mode/style.scss +1 -1
  716. package/src/components/sidebar-edit-mode/template-panel/index.js +3 -13
  717. package/src/components/sidebar-navigation-item/index.js +29 -0
  718. package/src/components/sidebar-navigation-screen/index.js +29 -12
  719. package/src/components/sidebar-navigation-screen/style.scss +1 -21
  720. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -11
  721. package/src/components/sidebar-navigation-screen-main/index.js +11 -23
  722. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
  723. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
  724. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  725. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
  726. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  727. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
  728. package/src/components/sidebar-navigation-screen-page/index.js +63 -14
  729. package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
  730. package/src/components/sidebar-navigation-screen-pattern/index.js +13 -15
  731. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  732. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  733. package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  734. package/src/components/sidebar-navigation-screen-patterns/index.js +97 -95
  735. package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
  736. package/src/components/sidebar-navigation-screen-template/index.js +9 -13
  737. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  738. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -43
  739. package/src/components/site-hub/index.js +80 -90
  740. package/src/components/site-hub/style.scss +14 -34
  741. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +50 -39
  742. package/src/components/template-actions/index.js +8 -11
  743. package/src/components/welcome-guide/style.scss +1 -1
  744. package/src/components/welcome-guide/styles.js +6 -5
  745. package/src/deprecated.js +42 -0
  746. package/src/hooks/commands/use-edit-mode-commands.js +12 -33
  747. package/src/hooks/push-changes-to-global-styles/index.js +1 -40
  748. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
  749. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +74 -17
  750. package/src/index.js +1 -9
  751. package/src/store/actions.js +25 -141
  752. package/src/store/private-actions.js +0 -133
  753. package/src/store/test/actions.js +7 -2
  754. package/src/style.scss +1 -7
  755. package/src/utils/constants.js +2 -1
  756. package/src/utils/set-nested-value.js +39 -0
  757. package/build/components/add-new-template/new-template.js +0 -298
  758. package/build/components/add-new-template/new-template.js.map +0 -1
  759. package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
  760. package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  761. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
  762. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  763. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
  764. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  765. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
  766. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  767. package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
  768. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  769. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  770. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  771. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
  772. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  773. package/build/components/keyboard-shortcut-help-modal/index.js +0 -119
  774. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  775. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
  776. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  777. package/build/components/keyboard-shortcuts/edit-mode.js +0 -79
  778. package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  779. package/build/components/page-actions/index.js +0 -35
  780. package/build/components/page-actions/index.js.map +0 -1
  781. package/build/components/page-actions/trash-page-menu-item.js +0 -54
  782. package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
  783. package/build/components/page-templates-template-parts/actions.js +0 -207
  784. package/build/components/page-templates-template-parts/actions.js.map +0 -1
  785. package/build/components/page-templates-template-parts/add-new-template-part.js +0 -64
  786. package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  787. package/build/components/page-templates-template-parts/hooks.js.map +0 -1
  788. package/build/components/page-templates-template-parts/index.js.map +0 -1
  789. package/build/components/preferences-modal/index.js +0 -38
  790. package/build/components/preferences-modal/index.js.map +0 -1
  791. package/build/components/sidebar-edit-mode/constants.js +0 -9
  792. package/build/components/sidebar-edit-mode/constants.js.map +0 -1
  793. package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
  794. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  795. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
  796. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  797. package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
  798. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  799. package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
  800. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  801. package/build/components/template-actions/rename-menu-item.js.map +0 -1
  802. package/build-module/components/add-new-template/new-template.js +0 -290
  803. package/build-module/components/add-new-template/new-template.js.map +0 -1
  804. package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
  805. package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
  806. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
  807. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  808. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  809. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
  810. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
  811. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
  812. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  813. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  814. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  815. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  816. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
  817. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  818. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -110
  819. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  820. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
  821. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  822. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -72
  823. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  824. package/build-module/components/page-actions/index.js +0 -27
  825. package/build-module/components/page-actions/index.js.map +0 -1
  826. package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
  827. package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
  828. package/build-module/components/page-templates-template-parts/actions.js +0 -199
  829. package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
  830. package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -56
  831. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  832. package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
  833. package/build-module/components/page-templates-template-parts/index.js.map +0 -1
  834. package/build-module/components/preferences-modal/index.js +0 -30
  835. package/build-module/components/preferences-modal/index.js.map +0 -1
  836. package/build-module/components/sidebar-edit-mode/constants.js +0 -3
  837. package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
  838. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
  839. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  840. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
  841. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
  842. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
  843. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
  844. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
  845. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
  846. package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
  847. package/src/components/add-new-template/new-template.js +0 -429
  848. package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
  849. package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
  850. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
  851. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
  852. package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  853. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  854. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  855. package/src/components/keyboard-shortcut-help-modal/index.js +0 -151
  856. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
  857. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  858. package/src/components/keyboard-shortcuts/edit-mode.js +0 -88
  859. package/src/components/page-actions/index.js +0 -30
  860. package/src/components/page-actions/trash-page-menu-item.js +0 -63
  861. package/src/components/page-templates-template-parts/actions.js +0 -277
  862. package/src/components/page-templates-template-parts/add-new-template-part.js +0 -60
  863. package/src/components/preferences-modal/index.js +0 -29
  864. package/src/components/sidebar-edit-mode/constants.js +0 -2
  865. package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
  866. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -40
  867. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
  868. package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
  869. package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
  870. /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  871. /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  872. /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
@@ -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;AAClF,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASP,KAAK,IAAIQ,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,GAAG;AAC5B,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,SAASC,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAK,CAAC,GAAGT,YAAY,CAAC,CAAC;EAE/B,MAAM;IAAEU;EAAmB,CAAC,GAAGN,WAAW,CAAEN,SAAU,CAAC;EAEvD,MAAM;IAAEa,mBAAmB;IAAEC;EAAkB,CAAC,GAC/CR,WAAW,CAAEC,YAAa,CAAC;EAE5B,MAAMQ,YAAY,GAAG,MAAQC,cAAc,IAAM;IAChD,MAAMC,MAAM,GAAGD,cAAc,EAAEE,EAAE;IACjC,IAAI;MACH,MAAMN,kBAAkB,CACvB,UAAU,EACVJ,QAAQ,EACRS,MAAM,EACN;QACCE,KAAK,EAAE;MACR,CAAC,EACD;QACCC,YAAY,EAAE;MACf,CACD,CAAC;MACDP,mBAAmB,CAClBV,EAAE,CAAE,uCAAwC,CAAC,EAC7C;QACCkB,IAAI,EAAE;MACP,CACD,CAAC;MACDV,IAAI,CAAE,aAAc,CAAC;IACtB,CAAC,CAAC,OAAQW,KAAK,EAAG;MACjBR,iBAAiB,CAChBV,OAAO,EACN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C,EACjDmB,KAAK,EAAEC,OACR,CAAC,EAED;QACCF,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOkB,eAAe;AACvB;AAEA,eAAe,SAASS,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNjC,YAAY,EAAEL,uBAAuB,CAAC,CAAC;IACvCqB,UAAU,EAAEP,qBAAqB,CAAC,CAAC;IACnCe,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF"}
1
+ {"version":3,"names":["store","coreStore","__","sprintf","useSelect","useDispatch","noticesStore","privateApis","routerPrivateApis","postType","NAVIGATION_POST_TYPE","unlock","useHistory","useDeleteNavigationMenu","deleteEntityRecord","createSuccessNotice","createErrorNotice","history","handleDelete","navigationMenu","postId","id","force","throwOnError","type","push","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,SA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E6B,IAAI;IAExD,IAAI;MACH,MAAMC,WAAW,GAAG,MAAMN,gBAAgB,CACzC,UAAU,EACVlC,QAAQ,EACR;QACCqC,KAAK,EAAE3C,OAAO,EACb;QACAD,EAAE,CAAE,WAAY,CAAC,EACjB2C,SACD,CAAC;QACDK,OAAO,EAAE/B,cAAc,EAAE+B,OAAO,EAAEC,GAAG;QACrCC,MAAM,EAAE;MACT,CAAC,EACD;QACC7B,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAK0B,WAAW,EAAG;QAClBlC,mBAAmB,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,4BA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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"}
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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AM;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,Q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xC,aAAe;IAC9ByC,OAAO;IAAA,GACF/B;EAAK,GAER,CAAE;IAAEgC;EAAQ,CAAC,KACdL,aAAA,CAAAM,QAAA,QACCN,aAAA,CAAChD,SAAS,QACTgD,aAAA,CAACjD,QAAQ;IACRkD,IAAI,EAAGtD,SAAW;IAClB4D,OAAO,EAAGA,CAAA,KAAM;MACf5B,YAAY,CAAE,CAAEF,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC1CqB,OAAO,CAAC,CAAC;IACV;EAAG,GAEDjD,EAAE,CAAE,SAAU,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,uBA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QAAA,QACCN,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC/C,QAAQ;IACRgD,IAAI,EAAGpD,SAAW;IAClB0D,OAAO,EAAGA,CAAA,KAAM;MACf3B,YAAY,CAAE,CAAEF,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC1CoB,OAAO,CAAC,CAAC;IACV;EAAG,GAED/C,EAAE,CAAE,SAAU,CACP,CAAC,EACX0C,aAAA,CAAC/C,QAAQ;IACRgD,IAAI,EAAGnD,WAAa;IACpByD,OAAO,EAAGA,CAAA,KAAM;MACf5B,cAAc,CAAE,CAAED,QAAQ,CAAE,EAAEO,YAAa,CAAC;MAC5CoB,OAAO,CAAC,CAAC;IACV;EAAG,GAED/C,EAAE,CAAE,WAAY,CACT,CAAC,EACTmB,KAAK,CAACa,UAAU,EAAEI,IAAI,KAAK,MAAM,IAClCjB,KAAK,CAACa,UAAU,EAAEG,EAAE,IACnBO,aAAA,CAAC/C,QAAQ;IACRsD,OAAO,EAAGA,CAAA,KAAM;MACfnB,UAAU,CAAEX,KAAM,CAAC;MACnB4B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDrB,SACO,CAEF,CAAC,EACZgB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC/C,QAAQ;IACRsD,OAAO,EAAGA,CAAA,KAAM;MACf1B,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;MACnC2B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDvB,WACO,CACA,CACV,CAEU,CAAC;AAEjB","ignoreList":[]}
@@ -1 +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-nav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CAAEI,cAAc,CAAE,CAAC,CAAG,CAAC,KAAK,gBAAgB;IACzD,MAAMG,iBAAiB,GACtBF,oBAAoB,IACpBJ,aAAa,CAAEG,cAAc,CAAE,CAAC,CAAG,CAAC,GAAG,CAAC;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"}
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,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,MAAM;EAAEC;AAAgB,CAAC,GAAGF,MAAM,CAAET,sBAAuB,CAAC;;AAE5D;AACA,MAAMY,cAAc,GAAG,GAAG;AAC1B,MAAMC,WAAW,GAAG,CACnB,UAAU,EACV,MAAM,EACN;EACCC,QAAQ,EAAEF,cAAc;EACxBG,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAE;EAClE;EACA;EACA;EACAC,OAAO,EAAE,YAAY;EACrBC,KAAK,EAAE;AACR,CAAC,CACD;AAED,eAAe,SAASC,qBAAqBA,CAAE;EAAEC;AAAa,CAAC,EAAG;EACjE,MAAM;IAAEC,oBAAoB;IAAEC;EAAU,CAAC,GAAGhB,SAAS,CAClDiB,MAAM,IAAM;IACb,MAAM;MACLC,wBAAwB;MACxBC,YAAY;MACZC,aAAa;MACbC;IACD,CAAC,GAAGJ,MAAM,CAAEpB,gBAAiB,CAAC;IAC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YAAY,EAAG;EAAO,CACtB,CACD,EACDJ,aAAA;IAAKK,SAAS,EAAC;EAA2E,GACzFL,aAAA,CAACtC,SAAS,MAAE,CACR,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -2,17 +2,19 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { __ } from '@wordpress/i18n';
5
+ import { __, sprintf } from '@wordpress/i18n';
6
6
  import { useDispatch, useSelect } from '@wordpress/data';
7
- 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';
17
+ import { store as noticesStore } from '@wordpress/notices';
16
18
 
17
19
  /**
18
20
  * Internal dependencies
@@ -22,11 +24,14 @@ import { unlock } from '../../lock-unlock';
22
24
  import { store as editSiteStore } from '../../store';
23
25
  import SidebarButton from '../sidebar-button';
24
26
  import PageDetails from './page-details';
25
- import PageActions from '../page-actions';
26
27
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
27
28
  const {
29
+ useLocation,
28
30
  useHistory
29
31
  } = unlock(routerPrivateApis);
32
+ const {
33
+ PostActions
34
+ } = unlock(editorPrivateApis);
30
35
  export default function SidebarNavigationScreenPage({
31
36
  backPath
32
37
  }) {
@@ -34,12 +39,14 @@ export default function SidebarNavigationScreenPage({
34
39
  setCanvasMode
35
40
  } = unlock(useDispatch(editSiteStore));
36
41
  const history = useHistory();
42
+ const {
43
+ createSuccessNotice
44
+ } = useDispatch(noticesStore);
37
45
  const {
38
46
  params: {
39
47
  postId
40
- },
41
- goTo
42
- } = useNavigator();
48
+ }
49
+ } = useLocation();
43
50
  const {
44
51
  record,
45
52
  hasResolved
@@ -69,18 +76,52 @@ export default function SidebarNavigationScreenPage({
69
76
  canvas: 'view'
70
77
  });
71
78
  }
72
- }, [hasResolved, history]);
79
+ }, [hasResolved, record, history]);
80
+ const onActionPerformed = useCallback((actionId, items) => {
81
+ switch (actionId) {
82
+ case 'move-to-trash':
83
+ {
84
+ history.push({
85
+ path: '/' + items[0].type,
86
+ postId: undefined,
87
+ postType: undefined,
88
+ canvas: 'view'
89
+ });
90
+ }
91
+ break;
92
+ case 'duplicate-post':
93
+ {
94
+ const newItem = items[0];
95
+ const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
96
+ createSuccessNotice(sprintf(
97
+ // translators: %s: Title of the created post e.g: "Post 1".
98
+ __('"%s" successfully created.'), title), {
99
+ type: 'snackbar',
100
+ id: 'duplicate-post-action',
101
+ actions: [{
102
+ label: __('Edit'),
103
+ onClick: () => {
104
+ history.push({
105
+ path: undefined,
106
+ postId: newItem.id,
107
+ postType: newItem.type,
108
+ canvas: 'edit'
109
+ });
110
+ }
111
+ }]
112
+ });
113
+ }
114
+ break;
115
+ }
116
+ }, [history, createSuccessNotice]);
73
117
  const featureImageAltText = featuredMediaAltText ? decodeEntities(featuredMediaAltText) : decodeEntities(record?.title?.rendered || __('Featured image'));
74
118
  return record ? createElement(SidebarNavigationScreen, {
75
119
  backPath: backPath,
76
120
  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');
121
+ actions: createElement(Fragment, null, createElement(PostActions, {
122
+ onActionPerformed: onActionPerformed,
123
+ buttonProps: {
124
+ size: 'default'
84
125
  }
85
126
  }), createElement(SidebarButton, {
86
127
  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,QAAQ,wBAAwB;AACxD,SAASC,sBAAsB,EAAEC,mBAAmB,QAAQ,gBAAgB;AAC5E,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASd,KAAK,IAAIe,aAAa,QAAQ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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":["__","sprintf","useDispatch","useSelect","__experimentalVStack","VStack","ExternalLink","__experimentalTruncate","Truncate","store","coreStore","useEntityRecord","decodeEntities","pencil","__unstableStripHTML","stripHTML","escapeAttribute","safeDecodeURIComponent","filterURLForDisplay","useEffect","useCallback","privateApis","routerPrivateApis","editorPrivateApis","noticesStore","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","PageDetails","SidebarNavigationScreenDetailsFooter","useLocation","useHistory","PostActions","SidebarNavigationScreenPage","backPath","setCanvasMode","history","createSuccessNotice","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","newItem","title","rendered","id","actions","label","onClick","featureImageAltText","createElement","Fragment","buttonProps","size","icon","meta","className","href","link","content","alignment","spacing","alt","src","excerpt","numberOfLines","footer","modified"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } 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';\nimport { store as noticesStore } from '@wordpress/notices';\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 { createSuccessNotice } = useDispatch( noticesStore );\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\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/' + items[ 0 ].type,\n\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\tpostType: undefined,\n\t\t\t\t\t\t\tcanvas: 'view',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpath: undefined,\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\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)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EAAEiD,QAAQ,GACfjB,aAAA,CAAC3C,oCAAoC;MAACW,MAAM,EAAGA;IAAQ,CAAE,CAAC,GACvD;EACJ,CACD,CAAC,GACC,IAAI;AACT","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","sprintf","__experimentalTruncate","Truncate","count","wordCount","useSelect","decodeEntities","store","coreStore","useEntityRecord","safeDecodeURIComponent","StatusLabel","unlock","editSiteStore","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","TEMPLATE_POST_TYPE","AVERAGE_READING_RATE","getPageDetails","page","details","label","value","createElement","status","password","date","short","numberOfLines","slug","generated_slug","templateTitle","push","parentTitle","wordCountType","wordsCounted","content","rendered","readingTime","Math","round","isPostsPage","toLocaleString","PageDetails","id","record","select","getEditedPostId","template","getEntityRecord","_templateTitle","title","_parentTitle","parent","_fields","siteSettings","page_for_posts","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/page-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from './status-label';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\nfunction getPageDetails( page ) {\n\tif ( ! page ) {\n\t\treturn [];\n\t}\n\n\tconst details = [\n\t\t{\n\t\t\tlabel: __( 'Status' ),\n\t\t\tvalue: (\n\t\t\t\t<StatusLabel\n\t\t\t\t\tstatus={ page?.password ? 'protected' : page.status }\n\t\t\t\t\tdate={ page?.date }\n\t\t\t\t\tshort\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: (\n\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t{ safeDecodeURIComponent(\n\t\t\t\t\t\tpage.slug || page.generated_slug\n\t\t\t\t\t) }\n\t\t\t\t</Truncate>\n\t\t\t),\n\t\t},\n\t];\n\n\tif ( page?.templateTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Template' ),\n\t\t\tvalue: decodeEntities( page.templateTitle ),\n\t\t} );\n\t}\n\n\tif ( page?.parentTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Parent' ),\n\t\t\tvalue: decodeEntities( page.parentTitle || __( '(no title)' ) ),\n\t\t} );\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = page?.content?.rendered\n\t\t? wordCount( page.content.rendered, wordCountType )\n\t\t: 0;\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\n\tif ( wordsCounted && ! page?.isPostsPage ) {\n\t\tdetails.push(\n\t\t\t{\n\t\t\t\tlabel: __( 'Words' ),\n\t\t\t\tvalue: wordsCounted.toLocaleString() || __( 'Unknown' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Time to read' ),\n\t\t\t\tvalue:\n\t\t\t\t\treadingTime > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the number of minutes. */\n\t\t\t\t\t\t\t\t__( '%s mins' ),\n\t\t\t\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( '< 1 min' ),\n\t\t\t}\n\t\t);\n\t}\n\treturn details;\n}\n\nexport default function PageDetails( { id } ) {\n\tconst { record } = useEntityRecord( 'postType', 'page', id );\n\tconst { parentTitle, templateTitle, isPostsPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostId } = unlock( select( editSiteStore ) );\n\t\t\tconst template = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tgetEditedPostId()\n\t\t\t);\n\t\t\tconst _templateTitle = template?.title?.rendered;\n\n\t\t\t// Parent page title.\n\t\t\tconst _parentTitle = record?.parent\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\trecord.parent,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fields: [ 'title' ],\n\t\t\t\t\t\t}\n\t\t\t\t )?.title?.rendered\n\t\t\t\t: null;\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\t\treturn {\n\t\t\t\tparentTitle: _parentTitle,\n\t\t\t\ttemplateTitle: _templateTitle,\n\t\t\t\tisPostsPage: record?.id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t},\n\t\t[ record?.parent, record?.id ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\tspacing={ 5 }\n\t\t\ttitle={ __( 'Details' ) }\n\t\t>\n\t\t\t{ getPageDetails( {\n\t\t\t\tparentTitle,\n\t\t\t\ttemplateTitle,\n\t\t\t\tisPostsPage,\n\t\t\t\t...record,\n\t\t\t} ).map( ( { label, value } ) => (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ value }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) ) }\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,sBAAsB,IAAIC,QAAQ,QAAQ,uBAAuB;AAC1E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,sBAAsB,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SACCC,mCAAmC,EACnCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,SAASC,kBAAkB,QAAQ,uBAAuB;;AAE1D;AACA,MAAMC,oBAAoB,GAAG,GAAG;AAEhC,SAASC,cAAcA,CAAEC,IAAI,EAAG;EAC/B,IAAK,CAAEA,IAAI,EAAG;IACb,OAAO,EAAE;EACV;EAEA,MAAMC,OAAO,GAAG,CACf;IACCC,KAAK,EAAEzB,EAAE,CAAE,QAAS,CAAC;IACrB0B,KAAK,EACJC,aAAA,CAACd,WAAW;MACXe,MAAM,E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AAC;IAEtD,OAAO;MACNhB,WAAW,EAAEmB,YAAY;MACzBrB,aAAa,EAAEmB,cAAc;MAC7BT,WAAW,EAAEI,MAAM,EAAED,EAAE,KAAKW,YAAY,EAAEC;IAC3C,CAAC;EACF,CAAC,EACD,CAAEX,MAAM,EAAEQ,MAAM,EAAER,MAAM,EAAED,EAAE,CAC7B,CAAC;EACD,OACCrB,aAAA,CAACX,mCAAmC;IACnC6C,OAAO,EAAG,CAAG;IACbN,KAAK,EAAGvD,EAAE,CAAE,SAAU;EAAG,GAEvBsB,cAAc,CAAE;IACjBe,WAAW;IACXF,aAAa;IACbU,WAAW;IACX,GAAGI;EACJ,CAAE,CAAC,CAACa,GAAG,CAAE,CAAE;IAAErC,KAAK;IAAEC;EAAM,CAAC,KAC1BC,aAAA,CAACV,sCAAsC;IAAC8C,GAAG,EAAGtC;EAAO,GACpDE,aAAA,CAACT,wCAAwC,QACtCO,KACuC,CAAC,EAC3CE,aAAA,CAACR,wCAAwC,QACtCO,KACuC,CACH,CACvC,CACkC,CAAC;AAExC"}
1
+ {"version":3,"names":["__","_x","sprintf","__experimentalTruncate","Truncate","count","wordCount","useSelect","decodeEntities","store","coreStore","useEntityRecord","safeDecodeURIComponent","StatusLabel","unlock","editSiteStore","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","TEMPLATE_POST_TYPE","AVERAGE_READING_RATE","getPageDetails","page","details","label","value","createElement","status","password","date","short","numberOfLines","slug","generated_slug","templateTitle","push","parentTitle","wordCountType","wordsCounted","content","rendered","readingTime","Math","round","isPostsPage","toLocaleString","PageDetails","id","record","select","getEditedPostId","template","getEntityRecord","_templateTitle","title","_parentTitle","parent","_fields","siteSettings","page_for_posts","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/page-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from './status-label';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\nfunction getPageDetails( page ) {\n\tif ( ! page ) {\n\t\treturn [];\n\t}\n\n\tconst details = [\n\t\t{\n\t\t\tlabel: __( 'Status' ),\n\t\t\tvalue: (\n\t\t\t\t<StatusLabel\n\t\t\t\t\tstatus={ page?.password ? 'protected' : page.status }\n\t\t\t\t\tdate={ page?.date }\n\t\t\t\t\tshort\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: (\n\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t{ safeDecodeURIComponent(\n\t\t\t\t\t\tpage.slug || page.generated_slug\n\t\t\t\t\t) }\n\t\t\t\t</Truncate>\n\t\t\t),\n\t\t},\n\t];\n\n\tif ( page?.templateTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Template' ),\n\t\t\tvalue: decodeEntities( page.templateTitle ),\n\t\t} );\n\t}\n\n\tif ( page?.parentTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Parent' ),\n\t\t\tvalue: decodeEntities( page.parentTitle || __( '(no title)' ) ),\n\t\t} );\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = page?.content?.rendered\n\t\t? wordCount( page.content.rendered, wordCountType )\n\t\t: 0;\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\n\tif ( wordsCounted && ! page?.isPostsPage ) {\n\t\tdetails.push(\n\t\t\t{\n\t\t\t\tlabel: __( 'Words' ),\n\t\t\t\tvalue: wordsCounted.toLocaleString() || __( 'Unknown' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Time to read' ),\n\t\t\t\tvalue:\n\t\t\t\t\treadingTime > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the number of minutes. */\n\t\t\t\t\t\t\t\t__( '%s mins' ),\n\t\t\t\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( '< 1 min' ),\n\t\t\t}\n\t\t);\n\t}\n\treturn details;\n}\n\nexport default function PageDetails( { id } ) {\n\tconst { record } = useEntityRecord( 'postType', 'page', id );\n\tconst { parentTitle, templateTitle, isPostsPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostId } = unlock( select( editSiteStore ) );\n\t\t\tconst template = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tgetEditedPostId()\n\t\t\t);\n\t\t\tconst _templateTitle = template?.title?.rendered;\n\n\t\t\t// Parent page title.\n\t\t\tconst _parentTitle = record?.parent\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\trecord.parent,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fields: [ 'title' ],\n\t\t\t\t\t\t}\n\t\t\t\t )?.title?.rendered\n\t\t\t\t: null;\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\t\treturn {\n\t\t\t\tparentTitle: _parentTitle,\n\t\t\t\ttemplateTitle: _templateTitle,\n\t\t\t\tisPostsPage: record?.id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t},\n\t\t[ record?.parent, record?.id ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\tspacing={ 5 }\n\t\t\ttitle={ __( 'Details' ) }\n\t\t>\n\t\t\t{ getPageDetails( {\n\t\t\t\tparentTitle,\n\t\t\t\ttemplateTitle,\n\t\t\t\tisPostsPage,\n\t\t\t\t...record,\n\t\t\t} ).map( ( { label, value } ) => (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ value }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) ) }\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,sBAAsB,IAAIC,QAAQ,QAAQ,uBAAuB;AAC1E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,sBAAsB,QAAQ,gBAAgB;;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