@wordpress/edit-site 5.14.0 → 5.16.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 (461) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +1 -6
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +22 -7
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/utils.js +10 -8
  7. package/build/components/add-new-template/utils.js.map +1 -1
  8. package/build/components/block-editor/constants.js +1 -1
  9. package/build/components/block-editor/constants.js.map +1 -1
  10. package/build/components/block-editor/editor-canvas.js +1 -1
  11. package/build/components/block-editor/editor-canvas.js.map +1 -1
  12. package/build/components/block-editor/index.js +0 -4
  13. package/build/components/block-editor/index.js.map +1 -1
  14. package/build/components/block-editor/use-site-editor-settings.js +114 -13
  15. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  16. package/build/components/code-editor/index.js +60 -28
  17. package/build/components/code-editor/index.js.map +1 -1
  18. package/build/components/create-pattern-modal/index.js +7 -3
  19. package/build/components/create-pattern-modal/index.js.map +1 -1
  20. package/build/components/editor/index.js +5 -5
  21. package/build/components/editor/index.js.map +1 -1
  22. package/build/components/global-styles/global-styles-provider.js +12 -7
  23. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  24. package/build/components/global-styles/screen-block.js +16 -0
  25. package/build/components/global-styles/screen-block.js.map +1 -1
  26. package/build/components/global-styles/screen-revisions/index.js +12 -5
  27. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  28. package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
  29. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  30. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +32 -25
  31. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  32. package/build/components/global-styles/style-variations-container.js +5 -3
  33. package/build/components/global-styles/style-variations-container.js.map +1 -1
  34. package/build/components/header-edit-mode/document-actions/index.js +4 -2
  35. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  36. package/build/components/header-edit-mode/index.js +13 -9
  37. package/build/components/header-edit-mode/index.js.map +1 -1
  38. package/build/components/keyboard-shortcuts/edit-mode.js +7 -5
  39. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  40. package/build/components/layout/index.js +17 -5
  41. package/build/components/layout/index.js.map +1 -1
  42. package/build/components/page/index.js +3 -3
  43. package/build/components/page/index.js.map +1 -1
  44. package/build/components/page-actions/index.js +2 -2
  45. package/build/components/page-actions/index.js.map +1 -1
  46. package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -16
  47. package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
  48. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
  49. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  50. package/build/components/page-patterns/duplicate-menu-item.js +163 -0
  51. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -0
  52. package/build/components/page-patterns/grid-item.js +83 -58
  53. package/build/components/page-patterns/grid-item.js.map +1 -1
  54. package/build/components/page-patterns/grid.js +5 -18
  55. package/build/components/page-patterns/grid.js.map +1 -1
  56. package/build/components/page-patterns/header.js +69 -0
  57. package/build/components/page-patterns/header.js.map +1 -0
  58. package/build/components/page-patterns/index.js +3 -1
  59. package/build/components/page-patterns/index.js.map +1 -1
  60. package/build/components/page-patterns/pagination.js +63 -0
  61. package/build/components/page-patterns/pagination.js.map +1 -0
  62. package/build/components/page-patterns/patterns-list.js +110 -31
  63. package/build/components/page-patterns/patterns-list.js.map +1 -1
  64. package/build/components/page-patterns/rename-menu-item.js +109 -0
  65. package/build/components/page-patterns/rename-menu-item.js.map +1 -0
  66. package/build/components/page-patterns/use-patterns.js +116 -118
  67. package/build/components/page-patterns/use-patterns.js.map +1 -1
  68. package/build/components/page-template-parts/add-new-template-part.js +74 -0
  69. package/build/components/page-template-parts/add-new-template-part.js.map +1 -0
  70. package/build/components/page-template-parts/index.js +3 -25
  71. package/build/components/page-template-parts/index.js.map +1 -1
  72. package/build/components/page-templates/index.js +1 -16
  73. package/build/components/page-templates/index.js.map +1 -1
  74. package/build/components/resizable-frame/index.js +85 -51
  75. package/build/components/resizable-frame/index.js.map +1 -1
  76. package/build/components/save-button/index.js +4 -2
  77. package/build/components/save-button/index.js.map +1 -1
  78. package/build/components/save-hub/index.js +10 -4
  79. package/build/components/save-hub/index.js.map +1 -1
  80. package/build/components/save-panel/index.js +5 -5
  81. package/build/components/save-panel/index.js.map +1 -1
  82. package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
  83. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  84. package/build/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  85. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  86. package/build/components/sidebar-edit-mode/template-panel/index.js +15 -8
  87. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  88. package/build/components/sidebar-navigation-screen/index.js +31 -15
  89. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  90. package/build/components/sidebar-navigation-screen-global-styles/index.js +34 -40
  91. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  92. package/build/components/sidebar-navigation-screen-main/index.js +4 -2
  93. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  94. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
  95. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  96. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +4 -4
  97. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  98. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  99. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  100. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -3
  101. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  102. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -4
  103. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  104. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  105. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  106. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
  107. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +8 -0
  109. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  110. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -1
  111. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  112. package/build/components/sidebar-navigation-screen-page/index.js +2 -3
  113. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  114. package/build/components/sidebar-navigation-screen-page/status-label.js +1 -34
  115. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  116. package/build/components/sidebar-navigation-screen-pages/index.js +35 -25
  117. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen-pattern/index.js +9 -7
  119. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  121. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  123. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  124. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +19 -4
  125. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  126. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +55 -28
  127. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  128. package/build/components/sidebar-navigation-screen-patterns/category-item.js +0 -5
  129. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-patterns/index.js +72 -60
  131. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +9 -5
  133. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +11 -1
  135. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +20 -9
  137. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  139. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-templates/index.js +1 -10
  141. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -0
  143. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  144. package/build/components/site-hub/index.js +29 -13
  145. package/build/components/site-hub/index.js.map +1 -1
  146. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -5
  147. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  148. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  149. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  150. package/build/components/sync-state-with-url/use-sync-path-with-url.js +15 -12
  151. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  152. package/build/components/template-actions/index.js +3 -1
  153. package/build/components/template-actions/index.js.map +1 -1
  154. package/build/components/template-actions/rename-menu-item.js +12 -8
  155. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  156. package/build/components/use-edited-entity-record/index.js +6 -1
  157. package/build/components/use-edited-entity-record/index.js.map +1 -1
  158. package/build/hooks/commands/use-common-commands.js +120 -32
  159. package/build/hooks/commands/use-common-commands.js.map +1 -1
  160. package/build/hooks/commands/use-edit-mode-commands.js +65 -7
  161. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  162. package/build/hooks/push-changes-to-global-styles/index.js +138 -57
  163. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  164. package/build/store/private-actions.js +9 -2
  165. package/build/store/private-actions.js.map +1 -1
  166. package/build/utils/normalize-record-key.js +19 -0
  167. package/build/utils/normalize-record-key.js.map +1 -0
  168. package/build/utils/use-activate-theme.js +1 -1
  169. package/build/utils/use-activate-theme.js.map +1 -1
  170. package/build/utils/use-debounced-input.js +5 -7
  171. package/build/utils/use-debounced-input.js.map +1 -1
  172. package/build-module/components/add-new-page/index.js +1 -6
  173. package/build-module/components/add-new-page/index.js.map +1 -1
  174. package/build-module/components/add-new-pattern/index.js +20 -7
  175. package/build-module/components/add-new-pattern/index.js.map +1 -1
  176. package/build-module/components/add-new-template/utils.js +9 -6
  177. package/build-module/components/add-new-template/utils.js.map +1 -1
  178. package/build-module/components/block-editor/constants.js +1 -1
  179. package/build-module/components/block-editor/constants.js.map +1 -1
  180. package/build-module/components/block-editor/editor-canvas.js +1 -1
  181. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  182. package/build-module/components/block-editor/index.js +0 -4
  183. package/build-module/components/block-editor/index.js.map +1 -1
  184. package/build-module/components/block-editor/use-site-editor-settings.js +116 -14
  185. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  186. package/build-module/components/code-editor/index.js +62 -30
  187. package/build-module/components/code-editor/index.js.map +1 -1
  188. package/build-module/components/create-pattern-modal/index.js +6 -3
  189. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  190. package/build-module/components/editor/index.js +5 -5
  191. package/build-module/components/editor/index.js.map +1 -1
  192. package/build-module/components/global-styles/global-styles-provider.js +12 -7
  193. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  194. package/build-module/components/global-styles/screen-block.js +16 -0
  195. package/build-module/components/global-styles/screen-block.js.map +1 -1
  196. package/build-module/components/global-styles/screen-revisions/index.js +13 -6
  197. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  198. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
  199. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  200. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +28 -21
  201. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  202. package/build-module/components/global-styles/style-variations-container.js +5 -3
  203. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  204. package/build-module/components/header-edit-mode/document-actions/index.js +6 -4
  205. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  206. package/build-module/components/header-edit-mode/index.js +13 -9
  207. package/build-module/components/header-edit-mode/index.js.map +1 -1
  208. package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -5
  209. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  210. package/build-module/components/layout/index.js +17 -5
  211. package/build-module/components/layout/index.js.map +1 -1
  212. package/build-module/components/page/index.js +3 -3
  213. package/build-module/components/page/index.js.map +1 -1
  214. package/build-module/components/page-actions/index.js +2 -2
  215. package/build-module/components/page-actions/index.js.map +1 -1
  216. package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -17
  217. package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
  218. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
  219. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  220. package/build-module/components/page-patterns/duplicate-menu-item.js +147 -0
  221. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -0
  222. package/build-module/components/page-patterns/grid-item.js +84 -64
  223. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  224. package/build-module/components/page-patterns/grid.js +5 -17
  225. package/build-module/components/page-patterns/grid.js.map +1 -1
  226. package/build-module/components/page-patterns/header.js +54 -0
  227. package/build-module/components/page-patterns/header.js.map +1 -0
  228. package/build-module/components/page-patterns/index.js +3 -1
  229. package/build-module/components/page-patterns/index.js.map +1 -1
  230. package/build-module/components/page-patterns/pagination.js +54 -0
  231. package/build-module/components/page-patterns/pagination.js.map +1 -0
  232. package/build-module/components/page-patterns/patterns-list.js +111 -34
  233. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  234. package/build-module/components/page-patterns/rename-menu-item.js +97 -0
  235. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -0
  236. package/build-module/components/page-patterns/use-patterns.js +116 -119
  237. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  238. package/build-module/components/page-template-parts/add-new-template-part.js +58 -0
  239. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -0
  240. package/build-module/components/page-template-parts/index.js +4 -24
  241. package/build-module/components/page-template-parts/index.js.map +1 -1
  242. package/build-module/components/page-templates/index.js +2 -15
  243. package/build-module/components/page-templates/index.js.map +1 -1
  244. package/build-module/components/resizable-frame/index.js +87 -55
  245. package/build-module/components/resizable-frame/index.js.map +1 -1
  246. package/build-module/components/save-button/index.js +4 -2
  247. package/build-module/components/save-button/index.js.map +1 -1
  248. package/build-module/components/save-hub/index.js +10 -4
  249. package/build-module/components/save-hub/index.js.map +1 -1
  250. package/build-module/components/save-panel/index.js +5 -5
  251. package/build-module/components/save-panel/index.js.map +1 -1
  252. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
  253. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  254. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  255. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  256. package/build-module/components/sidebar-edit-mode/template-panel/index.js +15 -9
  257. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  258. package/build-module/components/sidebar-navigation-screen/index.js +29 -16
  259. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +34 -40
  261. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  262. package/build-module/components/sidebar-navigation-screen-main/index.js +4 -3
  263. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  264. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
  265. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  266. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +4 -4
  267. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  268. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  269. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  270. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -3
  271. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  272. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -4
  273. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  274. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  275. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  276. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
  277. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  278. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +7 -0
  279. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  280. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +2 -2
  281. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  282. package/build-module/components/sidebar-navigation-screen-page/index.js +2 -3
  283. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  284. package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -32
  285. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  286. package/build-module/components/sidebar-navigation-screen-pages/index.js +35 -25
  287. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  288. package/build-module/components/sidebar-navigation-screen-pattern/index.js +8 -7
  289. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  290. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  291. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  293. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +18 -4
  295. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +53 -28
  297. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  298. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +0 -5
  299. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  300. package/build-module/components/sidebar-navigation-screen-patterns/index.js +76 -60
  301. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  302. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +9 -5
  303. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
  304. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -1
  305. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  306. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +18 -9
  307. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  308. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  309. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  310. package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -8
  311. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  312. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -0
  313. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  314. package/build-module/components/site-hub/index.js +28 -13
  315. package/build-module/components/site-hub/index.js.map +1 -1
  316. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -5
  317. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  318. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  319. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  320. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +16 -12
  321. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  322. package/build-module/components/template-actions/index.js +2 -1
  323. package/build-module/components/template-actions/index.js.map +1 -1
  324. package/build-module/components/template-actions/rename-menu-item.js +11 -8
  325. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  326. package/build-module/components/use-edited-entity-record/index.js +3 -1
  327. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  328. package/build-module/hooks/commands/use-common-commands.js +116 -32
  329. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  330. package/build-module/hooks/commands/use-edit-mode-commands.js +65 -9
  331. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  332. package/build-module/hooks/push-changes-to-global-styles/index.js +139 -57
  333. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  334. package/build-module/store/private-actions.js +9 -2
  335. package/build-module/store/private-actions.js.map +1 -1
  336. package/build-module/utils/normalize-record-key.js +12 -0
  337. package/build-module/utils/normalize-record-key.js.map +1 -0
  338. package/build-module/utils/use-activate-theme.js +1 -1
  339. package/build-module/utils/use-activate-theme.js.map +1 -1
  340. package/build-module/utils/use-debounced-input.js +5 -7
  341. package/build-module/utils/use-debounced-input.js.map +1 -1
  342. package/build-style/style-rtl.css +281 -103
  343. package/build-style/style.css +281 -103
  344. package/package.json +39 -40
  345. package/src/components/add-new-page/index.js +0 -3
  346. package/src/components/add-new-pattern/index.js +25 -12
  347. package/src/components/add-new-template/utils.js +9 -6
  348. package/src/components/block-editor/constants.js +5 -1
  349. package/src/components/block-editor/editor-canvas.js +1 -1
  350. package/src/components/block-editor/index.js +0 -4
  351. package/src/components/block-editor/use-site-editor-settings.js +119 -20
  352. package/src/components/canvas-spinner/style.scss +14 -0
  353. package/src/components/code-editor/index.js +51 -33
  354. package/src/components/create-pattern-modal/index.js +5 -2
  355. package/src/components/editor/index.js +5 -5
  356. package/src/components/global-styles/global-styles-provider.js +7 -2
  357. package/src/components/global-styles/screen-block.js +15 -0
  358. package/src/components/global-styles/screen-revisions/index.js +64 -58
  359. package/src/components/global-styles/screen-revisions/revisions-buttons.js +17 -31
  360. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +14 -1
  361. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +64 -48
  362. package/src/components/global-styles/style-variations-container.js +2 -0
  363. package/src/components/header-edit-mode/document-actions/index.js +8 -4
  364. package/src/components/header-edit-mode/document-actions/style.scss +45 -28
  365. package/src/components/header-edit-mode/index.js +29 -22
  366. package/src/components/keyboard-shortcuts/edit-mode.js +4 -5
  367. package/src/components/layout/index.js +49 -22
  368. package/src/components/layout/style.scss +4 -3
  369. package/src/components/page/index.js +8 -8
  370. package/src/components/page/style.scss +8 -5
  371. package/src/components/page-actions/index.js +2 -2
  372. package/src/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +9 -22
  373. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
  374. package/src/components/page-patterns/duplicate-menu-item.js +196 -0
  375. package/src/components/page-patterns/grid-item.js +189 -133
  376. package/src/components/page-patterns/grid.js +3 -20
  377. package/src/components/page-patterns/header.js +69 -0
  378. package/src/components/page-patterns/index.js +6 -1
  379. package/src/components/page-patterns/pagination.js +80 -0
  380. package/src/components/page-patterns/patterns-list.js +172 -71
  381. package/src/components/page-patterns/rename-menu-item.js +115 -0
  382. package/src/components/page-patterns/style.scss +141 -30
  383. package/src/components/page-patterns/use-patterns.js +115 -169
  384. package/src/components/page-template-parts/add-new-template-part.js +57 -0
  385. package/src/components/page-template-parts/index.js +3 -23
  386. package/src/components/page-templates/index.js +6 -19
  387. package/src/components/resizable-frame/index.js +104 -51
  388. package/src/components/resizable-frame/style.scss +9 -9
  389. package/src/components/save-button/index.js +2 -0
  390. package/src/components/save-hub/index.js +6 -1
  391. package/src/components/save-hub/style.scss +1 -1
  392. package/src/components/save-panel/index.js +10 -4
  393. package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  394. package/src/components/sidebar-edit-mode/page-panels/page-status.js +2 -5
  395. package/src/components/sidebar-edit-mode/template-panel/index.js +15 -11
  396. package/src/components/sidebar-navigation-item/style.scss +5 -12
  397. package/src/components/sidebar-navigation-screen/index.js +30 -15
  398. package/src/components/sidebar-navigation-screen/style.scss +18 -0
  399. package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -0
  400. package/src/components/sidebar-navigation-screen-global-styles/index.js +48 -44
  401. package/src/components/sidebar-navigation-screen-main/index.js +44 -40
  402. package/src/components/sidebar-navigation-screen-main/template-part-hint.js +34 -0
  403. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +4 -3
  404. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  405. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  406. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +16 -7
  407. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  408. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
  409. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +27 -15
  410. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -4
  411. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  412. package/src/components/sidebar-navigation-screen-page/status-label.js +1 -35
  413. package/src/components/sidebar-navigation-screen-pages/index.js +48 -33
  414. package/src/components/sidebar-navigation-screen-pattern/index.js +5 -2
  415. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
  416. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
  417. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +23 -3
  418. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +74 -43
  419. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -13
  420. package/src/components/sidebar-navigation-screen-patterns/index.js +103 -106
  421. package/src/components/sidebar-navigation-screen-patterns/style.scss +20 -0
  422. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +7 -6
  423. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +9 -0
  424. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +31 -9
  425. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  426. package/src/components/sidebar-navigation-screen-templates/index.js +1 -9
  427. package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -0
  428. package/src/components/site-hub/index.js +48 -29
  429. package/src/components/site-hub/style.scss +14 -2
  430. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
  431. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -4
  432. package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
  433. package/src/components/table/style.scss +1 -0
  434. package/src/components/template-actions/index.js +2 -1
  435. package/src/components/template-actions/rename-menu-item.js +17 -10
  436. package/src/components/use-edited-entity-record/index.js +6 -1
  437. package/src/hooks/commands/use-common-commands.js +105 -32
  438. package/src/hooks/commands/use-edit-mode-commands.js +94 -23
  439. package/src/hooks/push-changes-to-global-styles/index.js +141 -50
  440. package/src/store/private-actions.js +10 -2
  441. package/src/style.scss +10 -12
  442. package/src/utils/normalize-record-key.js +11 -0
  443. package/src/utils/use-activate-theme.js +1 -1
  444. package/src/utils/use-debounced-input.js +8 -7
  445. package/build/components/code-editor/code-editor-text-area.js +0 -96
  446. package/build/components/code-editor/code-editor-text-area.js.map +0 -1
  447. package/build/components/keyboard-shortcuts/index.js +0 -148
  448. package/build/components/keyboard-shortcuts/index.js.map +0 -1
  449. package/build/components/page-actions/delete-page-menu-item.js.map +0 -1
  450. package/build/components/page-content-focus-manager/constants.js +0 -9
  451. package/build/components/page-content-focus-manager/constants.js.map +0 -1
  452. package/build-module/components/code-editor/code-editor-text-area.js +0 -84
  453. package/build-module/components/code-editor/code-editor-text-area.js.map +0 -1
  454. package/build-module/components/keyboard-shortcuts/index.js +0 -132
  455. package/build-module/components/keyboard-shortcuts/index.js.map +0 -1
  456. package/build-module/components/page-actions/delete-page-menu-item.js.map +0 -1
  457. package/build-module/components/page-content-focus-manager/constants.js +0 -2
  458. package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
  459. package/src/components/code-editor/code-editor-text-area.js +0 -84
  460. package/src/components/keyboard-shortcuts/index.js +0 -137
  461. package/src/components/page-content-focus-manager/constants.js +0 -5
@@ -42,10 +42,10 @@ exports.postType = postType;
42
42
 
43
43
  function SidebarNavigationScreenNavigationMenu() {
44
44
  const {
45
- params: {
46
- postId
47
- }
48
- } = (0, _components.__experimentalUseNavigator)();
45
+ params
46
+ } = (0, _components.__experimentalUseNavigator)(); // See https://github.com/WordPress/gutenberg/pull/52120.
47
+
48
+ const postId = Number(params?.postId);
49
49
  const {
50
50
  record: navigationMenu,
51
51
  isResolving
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"names":["postType","SidebarNavigationScreenNavigationMenu","params","postId","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","coreStore","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","content","raw","id","status"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAOO,MAAMA,QAAQ,GAAI,eAAlB;;;AAEQ,SAASC,qCAAT,GAAiD;AAC/D,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA;AAAF;AADH,MAEF,6CAFJ;AAIA,QAAM;AAAEC,IAAAA,MAAM,EAAEC,cAAV;AAA0BC,IAAAA;AAA1B,MAA0C,+BAC/C,UAD+C,EAE/CN,QAF+C,EAG/CG,MAH+C,CAAhD;AAMA,QAAM;AAAEI,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA2B,qBAC9BC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEG,eAAF,CADP;AAGA,WAAO;AACNL,MAAAA,QAAQ,EAAEG,oBAAoB,CAAE,UAAF,EAAcV,QAAd,EAAwBG,MAAxB,CADxB;AAENK,MAAAA,UAAU,EAAEG,sBAAsB,CACjC,UADiC,EAEjCX,QAFiC,EAGjCG,MAHiC;AAF5B,KAAP;AAQA,GAb+B,EAchC,CAAEA,MAAF,CAdgC,CAAjC;AAiBA,QAAMU,SAAS,GAAGP,WAAW,IAAIC,QAAf,IAA2BC,UAA7C;AAEA,QAAMM,SAAS,GAAGT,cAAc,EAAEU,KAAhB,EAAuBC,QAAvB,IAAmCX,cAAc,EA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{ useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tSpinner,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu() {\n\tconst {\n\t\tparams: { postId },\n\t} = useNavigator();\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"names":["postType","SidebarNavigationScreenNavigationMenu","params","postId","Number","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","coreStore","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","content","raw","id","status"],"mappings":";;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BAAgB,GAAG,MAAMJ,eAAe,CAAEf,cAAF,CAA9C;;AAEA,MAAKQ,SAAL,EAAiB;AAChB,WACC,4BAAC,sEAAD;AACC,MAAA,WAAW,EAAG,cACb,kGADa;AADf,OAKC,4BAAC,mBAAD;AAAS,MAAA,SAAS,EAAC;AAAnB,MALD,CADD;AASA;;AAED,MAAK,CAAEA,SAAF,IAAe,CAAER,cAAtB,EAAuC;AACtC,WACC,4BAAC,sEAAD;AACC,MAAA,WAAW,EAAG,cAAI,0BAAJ;AADf,MADD;AAKA;;AAED,MAAK,CAAEA,cAAc,EAAEoB,OAAhB,EAAyBC,GAAhC,EAAsC;AACrC,WACC,4BAAC,sEAAD;AACC,MAAA,OAAO,EACN,4BAAC,iBAAD;AACC,QAAA,SAAS,EAAG,kCAAgBZ,SAAhB,CADb;AAEC,QAAA,QAAQ,EAAGO,aAFZ;AAGC,QAAA,MAAM,EAAGC,WAHV;AAIC,QAAA,WAAW,EAAGE;AAJf,QAFF;AASC,MAAA,KAAK,EAAG,mCACPnB,cAAc,EAAEU,KADT,EAEPV,cAAc,EAAEsB,EAFT,EAGPtB,cAAc,EAAEuB,MAHT,CATT;AAcC,MAAA,WAAW,EAAG,cAAI,gCAAJ;AAdf,MADD;AAkBA;;AAED,SACC,4BAAC,6BAAD;AACC,IAAA,cAAc,EAAGvB,cADlB;AAEC,IAAA,YAAY,EAAGgB,aAFhB;AAGC,IAAA,UAAU,EAAGC,WAHd;AAIC,IAAA,eAAe,EAAGE;AAJnB,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tSpinner,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu() {\n\tconst { params } = useNavigator();\n\n\t// See https://github.com/WordPress/gutenberg/pull/52120.\n\tconst postId = Number( params?.postId );\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"]}
@@ -51,6 +51,7 @@ function ScreenNavigationMoreMenu(props) {
51
51
 
52
52
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.DropdownMenu, {
53
53
  className: "sidebar-navigation__more-menu",
54
+ label: (0, _i18n.__)('Actions'),
54
55
  icon: _icons.moreVertical,
55
56
  popoverProps: POPOVER_PROPS
56
57
  }, ({
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"names":["POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","renameModalOpen","setRenameModalOpen","deleteModalOpen","setDeleteModalOpen","closeModals","openRenameModal","openDeleteModal","moreVertical","onClose"],"mappings":";;;;;;;;;AAMA;;A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Gf;;AACAE,MAAAA,OAAO;AACP;AANF,KAQG,cAAI,QAAJ,CARH,CADD,CApBD,CANF,CADD,EA2CGN,eAAe,IAChB,4BAAC,oBAAD;AAAa,IAAA,OAAO,EAAGE,WAAvB;AAAqC,IAAA,SAAS,EAAGR;AAAjD,IA5CF,EA+CGI,eAAe,IAChB,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGI,WADX;AAEC,IAAA,SAAS,EAAGL,SAFb;AAGC,IAAA,MAAM,EAAGF;AAHV,IAhDF,CADD;AAyDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteModal from './delete-modal';\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteModalOpen, setDeleteModalOpen ] = useState( false );\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteModalOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteModal = () => setDeleteModalOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteModal();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\n\t\t\t{ deleteModalOpen && (\n\t\t\t\t<DeleteModal onClose={ closeModals } onConfirm={ onDelete } />\n\t\t\t) }\n\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"names":["POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","renameModalOpen","setRenameModalOpen","deleteModalOpen","setDeleteModalOpen","closeModals","openRen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EAoBC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfF,MAAAA,eAAe,GADA,CAGf;;AACAE,MAAAA,OAAO;AACP;AANF,KAQG,cAAI,QAAJ,CARH,CADD,CApBD,CAPF,CADD,EA4CGN,eAAe,IAChB,4BAAC,oBAAD;AAAa,IAAA,OAAO,EAAGE,WAAvB;AAAqC,IAAA,SAAS,EAAGR;AAAjD,IA7CF,EAgDGI,eAAe,IAChB,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGI,WADX;AAEC,IAAA,SAAS,EAAGL,SAFb;AAGC,IAAA,MAAM,EAAGF;AAHV,IAjDF,CADD;AA0DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteModal from './delete-modal';\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteModalOpen, setDeleteModalOpen ] = useState( false );\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteModalOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteModal = () => setDeleteModalOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteModal();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\n\t\t\t{ deleteModalOpen && (\n\t\t\t\t<DeleteModal onClose={ closeModals } onConfirm={ onDelete } />\n\t\t\t) }\n\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -38,13 +38,13 @@ function SingleNavigationMenu({
38
38
  }) {
39
39
  const menuTitle = navigationMenu?.title?.rendered;
40
40
  return (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.SidebarNavigationScreenWrapper, {
41
- actions: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_editButton.default, {
42
- postId: navigationMenu?.id
43
- }), (0, _element.createElement)(_moreMenu.default, {
41
+ actions: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_moreMenu.default, {
44
42
  menuTitle: (0, _htmlEntities.decodeEntities)(menuTitle),
45
43
  onDelete: handleDelete,
46
44
  onSave: handleSave,
47
45
  onDuplicate: handleDuplicate
46
+ }), (0, _element.createElement)(_editButton.default, {
47
+ postId: navigationMenu?.id
48
48
  })),
49
49
  title: (0, _buildNavigationLabel.default)(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
50
50
  description: (0, _i18n.__)('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"names":["SingleNavigationMenu","navigationMenu","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","id","status"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;AAOe,SAASA,oBAAT,CAA+B;AAC7CC,EAAAA,cAD6C;AAE7CC,EAAAA,YAF6C;AAG7CC,EAAAA,eAH6C;AAI7CC,EAAAA;AAJ6C,CAA/B,EAKX;AACH,QAAMC,SAAS,GAAGJ,cAAc,EAAEK,KAAhB,EAAuBC,QAAzC;AAEA,SACC,4BAAC,sEAAD;AACC,IAAA,OAAO,EACN,qDACC,4BAAC,mBAAD;AAAY,MAAA,MAAM,EAAGN,cAAc,EAAEO;AAArC,MADD,EAEC,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAG,kCAAgBH,SAAhB,CADb;AAEC,MAAA,QAAQ,EAAGH,YAFZ;AAGC,MAAA,MAAM,EAAGE,UAHV;AAIC,MAAA,WAAW,EAAGD;AAJf,MAFD,CAFF;AAYC,IAAA,KAAK,EAAG,mCACPF,cAAc,EAAEK,KADT,EAEPL,cAAc,EAAEO,EAFT,EAGPP,cAAc,EAAEQ,MAHT,CAZT;AAiBC,IAAA,WAAW,EAAG,cACb,kGADa;AAjBf,KAqBC,4BAAC,6BAAD;AAAsB,IAAA,gBAAgB,EAAGR,cAAc,EAAEO;AAAzD,IArBD,CADD;AAyBA","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';\nimport EditButton from './edit-button';\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<EditButton postId={ navigationMenu?.id } />\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"names":["SingleNavigationMenu","navigationMenu","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","id","status"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;AAOe,SAASA,oBAAT,CAA+B;AAC7CC,EAAAA,cAD6C;AAE7CC,EAAAA,YAF6C;AAG7CC,EAAAA,eAH6C;AAI7CC,EAAAA;AAJ6C,CAA/B,EAKX;AACH,QAAMC,SAAS,GAAGJ,cAAc,EAAEK,KAAhB,EAAuBC,QAAzC;AAEA,SACC,4BAAC,sEAAD;AACC,IAAA,OAAO,EACN,qDACC,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAG,kCAAgBF,SAAhB,CADb;AAEC,MAAA,QAAQ,EAAGH,YAFZ;AAGC,MAAA,MAAM,EAAGE,UAHV;AAIC,MAAA,WAAW,EAAGD;AAJf,MADD,EAOC,4BAAC,mBAAD;AAAY,MAAA,MAAM,EAAGF,cAAc,EAAEO;AAArC,MAPD,CAFF;AAYC,IAAA,KAAK,EAAG,mCACPP,cAAc,EAAEK,KADT,EAEPL,cAAc,EAAEO,EAFT,EAGPP,cAAc,EAAEQ,MAHT,CAZT;AAiBC,IAAA,WAAW,EAAG,cACb,kGADa;AAjBf,KAqBC,4BAAC,6BAAD;AAAsB,IAAA,gBAAgB,EAAGR,cAAc,EAAEO;AAAzD,IArBD,CADD;AAyBA","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';\nimport EditButton from './edit-button';\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\t<EditButton postId={ navigationMenu?.id } />\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"]}
@@ -74,7 +74,7 @@ function useSaveNavigationMenu() {
74
74
  }, []);
75
75
  const {
76
76
  editEntityRecord,
77
- saveEditedEntityRecord
77
+ __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
78
78
  } = (0, _data.useDispatch)(_coreData.store);
79
79
  const {
80
80
  createSuccessNotice,
@@ -90,10 +90,11 @@ function useSaveNavigationMenu() {
90
90
 
91
91
  const originalRecord = getEditedEntityRecord('postType', 'wp_navigation', postId); // Apply the edits.
92
92
 
93
- editEntityRecord('postType', _.postType, postId, edits); // Attempt to persist.
93
+ editEntityRecord('postType', _.postType, postId, edits);
94
+ const recordPropertiesToSave = Object.keys(edits); // Attempt to persist.
94
95
 
95
96
  try {
96
- await saveEditedEntityRecord('postType', _.postType, postId, {
97
+ await saveSpecifiedEntityEdits('postType', _.postType, postId, recordPropertiesToSave, {
97
98
  throwOnError: true
98
99
  });
99
100
  createSuccessNotice((0, _i18n.__)('Renamed Navigation menu'), {
@@ -126,7 +127,7 @@ function useDuplicateNavigationMenu() {
126
127
  } = (0, _data.useDispatch)(_notices.store);
127
128
 
128
129
  const handleDuplicate = async navigationMenu => {
129
- const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;
130
+ const menuTitle = navigationMenu?.title || navigationMenu?.slug;
130
131
 
131
132
  try {
132
133
  const savedRecord = await saveEntityRecord('postType', _.postType, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"names":["useDeleteNavigationMenu","goTo","deleteEntityRecord","coreStore","createSuccessNotice","createErrorNotice","noticesStore","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","saveEditedEntityRecord","handleSave","edits","originalRecord","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,uBAAT,GAAmC;AAClC,QAAM;AAAEC,IAAAA;AAAF,MAAW,6CAAjB;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,eAAb,CAA/B;AAEA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MACL,uBAAaC,cAAb,CADD;;AAGA,QAAMC,YAAY,GAAG,MAAQC,cAAR,IAA4B;AAChD,UAAMC,MAAM,GAAGD,cAAc,EAAEE,EAA/B;;AACA,QAAI;AACH,YA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MAAM,EAAE;AAPT,OAHyC,EAYzC;AACCvB,QAAAA,YAAY,EAAE;AADf,OAZyC,CAA1C;;AAiBA,UAAKoB,WAAL,EAAmB;AAClB7B,QAAAA,mBAAmB,CAAE,cAAI,4BAAJ,CAAF,EAAsC;AACxDU,UAAAA,IAAI,EAAE;AADkD,SAAtC,CAAnB;AAGAb,QAAAA,IAAI,CAAG,eAAeU,UAAU,IAAIsB,WAAW,CAACvB,EAAI,EAAhD,CAAJ;AACA;AACD,KAxBD,CAwBE,OAAQK,KAAR,EAAgB;AACjBV,MAAAA,iBAAiB,CAChB;AACC;AACA,oBAAK,2CAAL,CAFD,EAGCU,KAAK,EAAEC,OAHR,CADgB,EAOhB;AACCF,QAAAA,IAAI,EAAE;AADP,OAPgB,CAAjB;AAWA;AACD,GAzCD;;AA2CA,SAAOc,eAAP;AACA;;AAEc,SAASS,yBAAT,GAAqC;AACnD,SAAO;AACN9B,IAAAA,YAAY,EAAEP,uBAAuB,EAD/B;AAENuB,IAAAA,UAAU,EAAEN,qBAAqB,EAF3B;AAGNW,IAAAA,eAAe,EAAEF,0BAA0B;AAHrC,GAAP;AAKA","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 * Internal dependencies\n */\nimport { postType } from '.';\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( __( 'Deleted Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\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 { editEntityRecord, saveEditedEntityRecord } =\n\t\tuseDispatch( 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\t'wp_navigation',\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveEditedEntityRecord( 'postType', postType, postId, {\n\t\t\t\tthrowOnError: true,\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"names":["useDeleteNavigationMenu","goTo","deleteEntityRecord","coreStore","createSuccessNotice","createErrorNotice","noticesStore","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,uBAAT,GAAmC;AAClC,QAAM;AAAEC,IAAAA;AAAF,MAAW,6CAAjB;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,eAAb,CAA/B;AAEA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MACL,uBAAaC,cAAb,CADD;;AAGA,QAAMC,YAAY,GAAG,MAAQC,cAAR,IAA4B;AAChD,UAAMC,MAAM,GAAGD,cAAc,EAAEE,EAA/B;;AACA,QAAI;AACH,YAAMR,kBAAkB,CACvB,UADuB,EAEvBS,UAFuB,EAGvBF,MAHuB,EAIvB;AACCG,QAAAA,KAAK,EAAE;AADR,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,MAAM,EAAE;AAPT,OAHyC,EAYzC;AACC1B,QAAAA,YAAY,EAAE;AADf,OAZyC,CAA1C;;AAiBA,UAAKuB,WAAL,EAAmB;AAClBhC,QAAAA,mBAAmB,CAAE,cAAI,4BAAJ,CAAF,EAAsC;AACxDU,UAAAA,IAAI,EAAE;AADkD,SAAtC,CAAnB;AAGAb,QAAAA,IAAI,CAAG,eAAeU,UAAU,IAAIyB,WAAW,CAAC1B,EAAI,EAAhD,CAAJ;AACA;AACD,KAxBD,CAwBE,OAAQK,KAAR,EAAgB;AACjBV,MAAAA,iBAAiB,CAChB;AACC;AACA,oBAAK,2CAAL,CAFD,EAGCU,KAAK,EAAEC,OAHR,CADgB,EAOhB;AACCF,QAAAA,IAAI,EAAE;AADP,OAPgB,CAAjB;AAWA;AACD,GAxCD;;AA0CA,SAAOkB,eAAP;AACA;;AAEc,SAASQ,yBAAT,GAAqC;AACnD,SAAO;AACNjC,IAAAA,YAAY,EAAEP,uBAAuB,EAD/B;AAENwB,IAAAA,UAAU,EAAEP,qBAAqB,EAF3B;AAGNe,IAAAA,eAAe,EAAEF,0BAA0B;AAHrC,GAAP;AAKA","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 * Internal dependencies\n */\nimport { postType } from '.';\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( __( 'Deleted Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\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\t'wp_navigation',\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 = navigationMenu?.title || 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"]}
@@ -9,6 +9,8 @@ exports.PRELOADED_NAVIGATION_MENUS_QUERY = void 0;
9
9
  // on apiFetch this query is limited to 100.
10
10
  // These parameters must be kept aligned with those in
11
11
  // lib/compat/wordpress-6.3/navigation-block-preloading.php
12
+ // and
13
+ // block-library/src/navigation/constants.js
12
14
  const PRELOADED_NAVIGATION_MENUS_QUERY = {
13
15
  per_page: 100,
14
16
  status: ['publish', 'draft'],
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,gCAAgC,GAAG;AAC/CC,EAAAA,QAAQ,EAAE,GADqC;AAE/CC,EAAAA,MAAM,EAAE,CAAE,SAAF,EAAa,OAAb,CAFuC;AAG/CC,EAAAA,KAAK,EAAE,MAHwC;AAI/CC,EAAAA,OAAO,EAAE;AAJsC,CAAzC","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\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gCAAgC,GAAG;AAC/CC,EAAAA,QAAQ,EAAE,GADqC;AAE/CC,EAAAA,MAAM,EAAE,CAAE,SAAF,EAAa,OAAb,CAFuC;AAG/CC,EAAAA,KAAK,EAAE,MAHwC;AAI/CC,EAAAA,OAAO,EAAE;AAJsC,CAAzC","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"]}
@@ -45,17 +45,17 @@ var _lockUnlock = require("../../lock-unlock");
45
45
  */
46
46
  // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
47
47
  function buildMenuLabel(title, id, status) {
48
- if (!title?.rendered) {
48
+ if (!title) {
49
49
  /* translators: %s is the index of the menu in the list of menus. */
50
50
  return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
51
51
  }
52
52
 
53
53
  if (status === 'publish') {
54
- return (0, _htmlEntities.decodeEntities)(title?.rendered);
54
+ return (0, _htmlEntities.decodeEntities)(title);
55
55
  }
56
56
 
57
57
  return (0, _i18n.sprintf)( // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
58
- (0, _i18n.__)('%1$s (%2$s)'), (0, _htmlEntities.decodeEntities)(title?.rendered), status);
58
+ (0, _i18n.__)('%1$s (%2$s)'), (0, _htmlEntities.decodeEntities)(title), status);
59
59
  } // Save a boolean to prevent us creating a fallback more than once per session.
60
60
 
61
61
 
@@ -121,7 +121,7 @@ function SidebarNavigationScreenNavigationMenus() {
121
121
  key: id,
122
122
  withChevron: true,
123
123
  icon: _icons.navigation
124
- }, buildMenuLabel(title, index + 1, status)))));
124
+ }, buildMenuLabel(title?.rendered, index + 1, status)))));
125
125
  }
126
126
 
127
127
  function SidebarNavigationScreenWrapper({
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["buildMenuLabel","title","id","status","rendered","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","coreStore","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","edits","map","index","navigation","SidebarNavigationScreenWrapper","children","actions","description","NavMenuItem","postId","props","linkInfo","postType"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AACA;;AAEA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAYA;AACA;AACA;AASA;AACA,SAASA,cAAT,CAAyBC,KAAzB,EAAgCC,EAAhC,EAAoCC,MAApC,EAA6C;AAC5C,MAAK,CAAEF,KAAK,EAAEG,QAAd,EAAyB;AACxB;AACA,WAAO,mBAAS,cAAI,eAAJ,CAAT,EAAgCF,EAAhC,CAAP;AACA;;AAED,MAAKC,MAAM,KAAK,SAAhB,EAA4B;AAC3B,WAAO,kCAAgBF,KAAK,EAAEG,QAAvB,CAAP;AACA;;AAED,SAAO,oBACN;AACA,gBAAI,aAAJ,CAFM,EAGN,kCAAgBH,KAAK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* 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';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( 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\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\t`wp_navigation`,\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, 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: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["buildMenuLabel","title","id","status","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","coreStore","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","edits","map","index","navigation","rendered","SidebarNavigationScreenWrapper","children","actions","description","NavMenuItem","postId","props","linkInfo","postType"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AACA;;AAEA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAYA;AACA;AACA;AASA;AACA,SAASA,cAAT,CAAyBC,KAAzB,EAAgCC,EAAhC,EAAoCC,MAApC,EAA6C;AAC5C,MAAK,CAAEF,KAAP,EAAe;AACd;AACA,WAAO,mBAAS,cAAI,eAAJ,CAAT,EAAgCC,EAAhC,CAAP;AACA;;AAED,MAAKC,M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AAAA,QAAQ,EAAE;AAFe,GAAT,CAAjB;AAIA,SAAO,4BAAC,8BAAD,OAA4BD,QAA5B;AAAA,OAA4CD;AAA5C,IAAP;AACA,CAND","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';\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\t`wp_navigation`,\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: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"]}
@@ -23,6 +23,8 @@ var _isPreviewingTheme = require("../../utils/is-previewing-theme");
23
23
 
24
24
  var _lockUnlock = require("../../lock-unlock");
25
25
 
26
+ var _useSyncPathWithUrl = require("../sync-state-with-url/use-sync-path-with-url");
27
+
26
28
  /**
27
29
  * WordPress dependencies
28
30
  */
@@ -35,10 +37,12 @@ const POPOVER_PROPS = {
35
37
  */
36
38
 
37
39
  const {
40
+ useLocation,
38
41
  useHistory
39
42
  } = (0, _lockUnlock.unlock)(_router.privateApis);
40
43
 
41
44
  function LeafMoreMenu(props) {
45
+ const location = useLocation();
42
46
  const history = useHistory();
43
47
  const {
44
48
  block
@@ -82,6 +86,8 @@ function LeafMoreMenu(props) {
82
86
  ...((0, _isPreviewingTheme.isPreviewingTheme)() && {
83
87
  wp_theme_preview: (0, _isPreviewingTheme.currentlyPreviewingTheme)()
84
88
  })
89
+ }, {
90
+ backPath: (0, _useSyncPathWithUrl.getPathFromURL)(location.params)
85
91
  });
86
92
  }
87
93
 
@@ -92,6 +98,8 @@ function LeafMoreMenu(props) {
92
98
  ...((0, _isPreviewingTheme.isPreviewingTheme)() && {
93
99
  wp_theme_preview: (0, _isPreviewingTheme.currentlyPreviewingTheme)()
94
100
  })
101
+ }, {
102
+ backPath: (0, _useSyncPathWithUrl.getPathFromURL)(location.params)
95
103
  });
96
104
  }
97
105
  }, [history]);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"names":["POPOVER_PROPS","className","placement","useHistory","routerPrivateApis","LeafMoreMenu","props","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","blockEditorStore","removeLabel","maximumLength","goToLabel","rootClientId","select","getBlockRootClientId","onGoToPage","selectedBlock","attributes","name","kind","id","type","push","postType","postId","wp_theme_preview","moreVertical","onClose","chevronUp","chevronDown"],"mappings":";;;;;;;AAOA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAUA;;AAIA;;AAxBA;AACA;AACA;AAUA,MAAMA,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,2CADU;AAErBC,EAAAA,SAAS,EAAE;AAFU,CAAtB;AAKA;AACA;AACA;;AAOA,MAAM;AAAEC,EAAAA;AAAF,IAAiB,wBAAQC,mBAAR,CAAvB;;AAEe,SAASC,YAAT,CAAuBC,KAAvB,EAA+B;AAC7C,QAAMC,OAAO,GAAGJ,UAAU,EAA1B;AACA,QAAM;AAAEK,IAAAA;AAAF,MAAYF,KAAlB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAeD,KAArB;AACA,QAAM;AAAEE,IAAAA,cAAF;AAAkBC,IAAAA,YAAlB;AAAgCC,IAAAA;AAAhC,MACL,uBAAaC,kBAAb,CADD;AAGA,QAAMC,WAAW,GAAG;AACnB;AACA,gBAAI,WAAJ,CAFmB,EAGnB,6BAAY;AAAEL,IAAAA,QAAF;A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AAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,SAAS,EAAC,kCAHX;AAIC,IAAA,YAAY,EAAG/B,aAJhB;AAKC,IAAA,OAAO,MALR;AAAA,OAMMM;AANN,KAQG,CAAE;AAAE0B,IAAAA;AAAF,GAAF,KACD,qDACC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGC,gBADR;AAEC,IAAA,OAAO,EAAG,MAAM;AACftB,MAAAA,YAAY,CAAE,CAAEF,QAAF,CAAF,EAAgBQ,YAAhB,CAAZ;AACAe,MAAAA,OAAO;AACP;AALF,KAOG,cAAI,SAAJ,CAPH,CADD,EAUC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGE,kBADR;AAEC,IAAA,OAAO,EAAG,MAAM;AACfxB,MAAAA,cAAc,CAAE,CAAED,QAAF,CAAF,EAAgBQ,YAAhB,CAAd;AACAe,MAAAA,OAAO;AACP;AALF,KAOG,cAAI,WAAJ,CAPH,CAVD,EAmBGxB,KAAK,CAACc,UAAN,EAAkBG,EAAlB,IACD,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfL,MAAAA,UAAU,CAAEZ,KAAF,CAAV;AACAwB,MAAAA,OAAO;AACP;AAJF,KAMGhB,SANH,CApBF,CADD,EA+BC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfJ,MAAAA,YAAY,CAAE,CAAEH,QAAF,CAAF,EAAgB,KAAhB,CAAZ;AACAuB,MAAAA,OAAO;AACP;AAJF,KAMGlB,WANH,CADD,CA/BD,CATF,CADD;AAuDA","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 { useHistory } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\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\tpostType: attributes.type,\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t...( isPreviewingTheme() && {\n\t\t\t\t\t\twp_theme_preview: currentlyPreviewingTheme(),\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\tpostType: 'page',\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t...( isPreviewingTheme() && {\n\t\t\t\t\t\twp_theme_preview: currentlyPreviewingTheme(),\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?.id && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonGoToPage( block );\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ goToLabel }\n\t\t\t\t\t\t\t</MenuItem>\n\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"names":["POPOVER_PROPS","className","placement","useLocation","useHistory","routerPrivateApis","LeafMoreMenu","props","location","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","blockEditorStore","removeLabel","maximumLength","goToLabel","rootClientId","select","getBlockRootClientId","onGoToPage","selectedBlock","attributes","name","kind","id","type","push","postType","postId","wp_theme_preview","backPath","params","moreVertical","onClose","chevronUp","chevronDown"],"mappings":";;;;;;;AAOA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAUA;;AAIA;;AACA;;AAzBA;AACA;AACA;AAUA,MAAMA,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,2CADU;AAErBC,EAAAA,SAAS,EAAE;AAFU,CAAtB;AAKA;AACA;AACA;;AAQA,MAAM;AAAEC,EAAAA,WAAF;AAAeC,EAAAA;AAAf,IAA8B,wBAAQC,mBAAR,CAApC;;AAEe,SAASC,YAAT,CAAuBC,KAAvB,EAA+B;AAC7C,QAAMC,QAAQ,GAAGL,WAAW,EAA5B;AACA,QAAMM,OAAO,GAAGL,UAAU,EAA1B;AACA,QAAM;AAAEM,IAAAA;AAAF,MAAYH,KAAlB;AACA,QAAM;AAAEI,IAAAA;AAAF,MAAeD,KAArB;AACA,QAAM;AAAEE,IAAAA,cAAF;AAAkBC,IAAAA,YAAlB;AAAgCC,IAAAA;AAAhC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O;AACP;AAJF,KAMGpB,WANH,CADD,CA/BD,CATF,CADD;AAuDA","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?.id && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonGoToPage( block );\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ goToLabel }\n\t\t\t\t\t\t\t</MenuItem>\n\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"]}
@@ -90,6 +90,6 @@ function NavigationMenuContent({
90
90
  showAppender: false
91
91
  }), (0, _element.createElement)("div", {
92
92
  className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor"
93
- }, (0, _element.createElement)(_blockEditor.BlockTools, null, (0, _element.createElement)(_blockEditor.BlockList, null))));
93
+ }, (0, _element.createElement)(_blockEditor.BlockList, null)));
94
94
  }
95
95
  //# sourceMappingURL=navigation-menu-content.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js"],"names":["PrivateListView","blockEditorPrivateApis","MAX_PAGE_COUNT","PAGES_QUERY","per_page","_fields","orderby","order","NavigationMenuContent","rootClientId","listViewRootClientId","isLoading","select","areInnerBlocksControlled","getBlockName","getBlockCount","getBlockOrder","blockEditorStore","isResolving","coreStore","blockClientIds","hasOnlyPageListBlock","length","pageListHasBlocks","isLoadingPages","replaceBlock","__unstableMarkNextChangeAsNotPersistent","offCanvasOnselect","block","name","attributes","url","clientId","LeafMoreMenu"],"mappings":";;;;;;;;;AAWA;;AARA;;AAMA;;AACA;;AAEA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAsB,wBAAQC,wBAAR,CAA5B,C,CAEA;;AACA,MAAMC,cAAc,GAAG,GAAvB;AACA,MAAMC,WAAW,GAAG,CACnB,UADmB,EAEnB,MAFmB,EAGnB;AACCC,EAAAA,QAAQ,EAAEF,cADX;AAECG,EAAAA,OAAO,EAAE,CAAE,IAAF,EAAQ,MAAR,EAAgB,YAAhB,EAA8B,QAA9B,EAAwC,OAAxC,EAAiD,MAAjD,CAFV;AAGC;AACA;AACA;AACAC,EAAAA,OAAO,EAAE,YANV;AAOCC,EAAAA,KAAK,EAAE;AAPR,CAHmB,CAApB;;AAce,SAASC,qBAAT,CAAgC;AAAEC,EAAAA;AAAF,CAAhC,EAAmD;AACjE,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAsC,qBACzCC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,wBADK;AAELC,MAAAA,YAFK;AAGLC,MAAAA,aAHK;AAILC,MAAAA;AAJK,QAKFJ,MAAM,CAAEK,kBAAF,CALV;AAMA,UAAM;AAAEC,MAAAA;AAAF,QAAkBN,MAAM,CAAEO,eAAF,CAA9B;AAEA,UAAMC,cAAc,GAAGJ,aAAa,CAAEP,YAAF,CAApC;AAEA,UAAMY,oBAAoB,GACzBD,cA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AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n\tBlockTools,\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<BlockTools>\n\t\t\t\t\t<BlockList />\n\t\t\t\t</BlockTools>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js"],"names":["PrivateListView","blockEditorPrivateApis","MAX_PAGE_COUNT","PAGES_QUERY","per_page","_fields","orderby","order","NavigationMenuContent","rootClientId","listViewRootClientId","isLoading","select","areInnerBlocksControlled","getBlockName","getBlockCount","getBlockOrder","blockEditorStore","isResolving","coreStore","blockClientIds","hasOnlyPageListBlock","length","pageListHasBlocks","isLoadingPages","replaceBlock","__unstableMarkNextChangeAsNotPersistent","offCanvasOnselect","block","name","attributes","url","clientId","LeafMoreMenu"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAWA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAsB,wBAAQC,wBAAR,CAA5B,C,CAEA;;AACA,MAAMC,cAAc,GAAG,GAAvB;AACA,MAAMC,WAAW,GAAG,CACnB,UADmB,EAEnB,MAFmB,EAGnB;AACCC,EAAAA,QAAQ,EAAEF,cADX;AAECG,EAAAA,OAAO,EAAE,CAAE,IAAF,EAAQ,MAAR,EAAgB,YAAhB,EAA8B,QAA9B,EAAwC,OAAxC,EAAiD,MAAjD,CAFV;AAGC;AACA;AACA;AACAC,EAAAA,OAAO,EAAE,YANV;AAOCC,EAAAA,KAAK,EAAE;AAPR,CAHmB,CAApB;;AAce,SAASC,qBAAT,CAAgC;AAAEC,EAAAA;AAAF,CAAhC,EAAmD;AACjE,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAsC,qBACzCC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,wBADK;AAELC,MAAAA,YAFK;AAGLC,MAAAA,aAHK;AAILC,MAAAA;AAJK,QAKFJ,MAAM,CAAEK,kBAAF,CALV;AAMA,UAAM;AAAEC,MAAAA;AAAF,QAAkBN,MAAM,CAAEO,eAAF,CAA9B;AAEA,UAAMC,cAAc,GAAGJ,aAAa,CAAEP,YAAF,CAApC;AAEA,UAAMY,oBAAoB,GACzBD,cAA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ress 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"]}
@@ -54,10 +54,9 @@ function SidebarNavigationScreenPage() {
54
54
  setCanvasMode
55
55
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
56
56
  const {
57
- params: {
58
- postId
59
- }
57
+ params
60
58
  } = (0, _components.__experimentalUseNavigator)();
59
+ const postId = Number(params?.postId);
61
60
  const {
62
61
  record
63
62
  } = (0, _coreData.useEntityRecord)('postType', 'page', postId);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"names":["SidebarNavigationScreenPage","navigator","setCanvasMode","editSiteStore","params","postId","record","featuredMediaAltText","featuredMediaSourceUrl","select","getEntityRecord","coreStore","attachedMedia","featured_media","media_details","sizes","medium","source_url","alt_text","description","raw","featureImageAltText","title","rendered","as","SidebarButton","goTo","pencil","link","excerpt","modified"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAgBA;AACA;AACA;AASe,SAASA,2BAAT,GAAuC;AACrD,QAAMC,SAAS,GAAG,6CAAlB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,wBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA;AAAF;AADH,MAEF,6CAFJ;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAAa,+BAAiB,UAAjB,EAA6B,MAA7B,EAAqCD,MAArC,CAAnB;AAEA,QAAM;AAAEE,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAmD,qBACtDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAsBD,MAAM,CAAEE,eAAF,CAAlC,CADa,CAEb;;AACA,UAAMC,aAAa,GAAGN,MAAM,EAAEO,cAAR,GACnBH,eAAe,CACf,UADe,EAEf,YAFe,EAGfJ,MAAM,EAAEO,cAHO,CADI,GAMnB,IANH;AAQA,WAAO;AACNL,MAAAA,sBAAsB,EACrBI,aAAa,EAAEE,aAAf,CAA6BC,KAA7B,EAAoCC,MAApC,EAA4CC,UAA5C,IAC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AAA,SAAS,EAAC;AAAf,OACC;AACC,MAAA,GAAG,EAAGa,mBADP;AAEC,MAAA,GAAG,EAAGb;AAFP,MADD,CALD,CAFF,EAeG,CAAC,CAAEF,MAAM,EAAEuB,OAAR,EAAiBN,QAApB,IACD,4BAAC,kCAAD;AACC,MAAA,SAAS,EAAC,mDADX;AAEC,MAAA,aAAa,EAAG;AAFjB,OAIG,8BAAWjB,MAAM,CAACuB,OAAP,CAAeN,QAA1B,CAJH,CAhBF,EAuBC,4BAAC,oBAAD;AAAa,MAAA,EAAE,EAAGlB;AAAlB,MAvBD,CA/BF;AAyDC,IAAA,MAAM,EACL,4BAAC,6CAAD;AACC,MAAA,oBAAoB,EAAGC,MAAM,EAAEwB;AADhC;AA1DF,IADY,GAgET,IAhEJ;AAiEA","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';\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\nexport default function SidebarNavigationScreenPage() {\n\tconst navigator = useNavigator();\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', 'page', postId );\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\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\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\tnavigator.goTo( '/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\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\tlastModifiedDateTime={ record?.modified }\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"names":["SidebarNavigationScreenPage","navigator","setCanvasMode","editSiteStore","params","postId","Number","record","featuredMediaAltText","featuredMediaSourceUrl","select","getEntityRecord","coreStore","attachedMedia","featured_media","media_details","sizes","medium","source_url","alt_text","description","raw","featureImageAltText","title","rendered","as","SidebarButton","goTo","pencil","link","excerpt","modified"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAgBA;AACA;AACA;AASe,SAASA,2BAAT,GAAuC;AACrD,QAAMC,SAAS,GAAG,6CAAlB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,wBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAa,6CAAnB;AAEA,QAAMC,MAAM,GAAGC,MAAM,CAAEF,MAAM,EAAEC,MAAV,CAArB;AACA,QAAM;AAAEE,IAAAA;AAAF,MAAa,+BAAiB,UAAjB,EAA6B,MAA7B,EAAqCF,MAArC,CAAnB;AAEA,QAAM;AAAEG,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAmD,qBACtDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAsBD,MAAM,CAAEE,eAAF,CAAlC,CADa,CAEb;;AACA,UAAMC,aAAa,GAAGN,MAAM,EAAEO,cAAR,GACnBH,eAAe,CACf,UADe,EAEf,YAFe,EAGfJ,MAAM,EAAEO,cAHO,CADI,GAMnB,IANH;AAQA,WAAO;AACNL,MAAAA,sBAAsB,EACrBI,aAAa,EAAEE,aAAf,CAA6BC,KAA7B,EAAoCC,MAApC,EAA4CC,UAA5C,IACAL,aAAa,EAAEK,UAHV;AAINV,MAAAA,oBAAoB,EAAE,iCACrBK,aAAa,EAAEM,QAAf,IACCN,aAAa,EAAEO,WAAf,EAA4BC,GAD7B,IAEC,EAHoB;AAJhB,KAAP;AAUA,GAtBuD,EAuBxD,CAAEd,MAAF,CAvBwD,CAAzD;AA0BA,QAA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AAEC,MAAA,aAAa,EAAG;AAFjB,OAIG,8BAAWjB,MAAM,CAACuB,OAAP,CAAeN,QAA1B,CAJH,CAhBF,EAuBC,4BAAC,oBAAD;AAAa,MAAA,EAAE,EAAGnB;AAAlB,MAvBD,CA/BF;AAyDC,IAAA,MAAM,EACL,4BAAC,6CAAD;AACC,MAAA,oBAAoB,EAAGE,MAAM,EAAEwB;AADhC;AA1DF,IADY,GAgET,IAhEJ;AAiEA","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';\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\nexport default function SidebarNavigationScreenPage() {\n\tconst navigator = useNavigator();\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { params } = useNavigator();\n\n\tconst postId = Number( params?.postId );\n\tconst { record } = useEntityRecord( 'postType', 'page', postId );\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\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\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\tnavigator.goTo( '/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\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\tlastModifiedDateTime={ record?.modified }\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"]}
@@ -15,8 +15,6 @@ var _i18n = require("@wordpress/i18n");
15
15
 
16
16
  var _date = require("@wordpress/date");
17
17
 
18
- var _primitives = require("@wordpress/primitives");
19
-
20
18
  /**
21
19
  * External dependencies
22
20
  */
@@ -24,34 +22,6 @@ var _primitives = require("@wordpress/primitives");
24
22
  /**
25
23
  * WordPress dependencies
26
24
  */
27
- const publishedIcon = (0, _element.createElement)(_primitives.SVG, {
28
- fill: "none",
29
- xmlns: "http://www.w3.org/2000/svg",
30
- viewBox: "0 0 16 16"
31
- }, (0, _element.createElement)(_primitives.Path, {
32
- fillRule: "evenodd",
33
- clipRule: "evenodd",
34
- d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16Zm-1.067-5.6 4.2-5.667.8.6-4.8 6.467-3-2.267.6-.8 2.2 1.667Z"
35
- }));
36
- const draftIcon = (0, _element.createElement)(_primitives.SVG, {
37
- fill: "none",
38
- xmlns: "http://www.w3.org/2000/svg",
39
- viewBox: "0 0 16 16"
40
- }, (0, _element.createElement)(_primitives.Path, {
41
- fillRule: "evenodd",
42
- clipRule: "evenodd",
43
- d: "M14.5 8a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-8 4a4 4 0 0 0 0-8v8Z"
44
- }));
45
- const pendingIcon = (0, _element.createElement)(_primitives.SVG, {
46
- fill: "none",
47
- xmlns: "http://www.w3.org/2000/svg",
48
- viewBox: "0 0 16 16"
49
- }, (0, _element.createElement)(_primitives.Path, {
50
- fillRule: "evenodd",
51
- clipRule: "evenodd",
52
- d: "M14.5 8a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM8 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z"
53
- }));
54
-
55
25
  function StatusLabel({
56
26
  status,
57
27
  date,
@@ -59,7 +29,6 @@ function StatusLabel({
59
29
  }) {
60
30
  const relateToNow = (0, _date.humanTimeDiff)(date);
61
31
  let statusLabel = status;
62
- let statusIcon = pendingIcon;
63
32
 
64
33
  switch (status) {
65
34
  case 'publish':
@@ -70,7 +39,6 @@ function StatusLabel({
70
39
  dateTime: date
71
40
  })
72
41
  }) : (0, _i18n.__)('Published');
73
- statusIcon = publishedIcon;
74
42
  break;
75
43
 
76
44
  case 'future':
@@ -86,7 +54,6 @@ function StatusLabel({
86
54
 
87
55
  case 'draft':
88
56
  statusLabel = (0, _i18n.__)('Draft');
89
- statusIcon = draftIcon;
90
57
  break;
91
58
 
92
59
  case 'pending':
@@ -106,6 +73,6 @@ function StatusLabel({
106
73
  className: (0, _classnames.default)('edit-site-sidebar-navigation-screen-page__status', {
107
74
  [`has-status has-${status}-status`]: !!status
108
75
  })
109
- }, statusIcon, " ", statusLabel);
76
+ }, statusLabel);
110
77
  }
111
78
  //# sourceMappingURL=status-label.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"names":["publishedIcon","draftIcon","pendingIcon","StatusLabel","status","date","short","relateToNow","statusLabel","statusIcon","time","formattedDate"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,MAAMA,aAAa,GAClB,4BAAC,eAAD;AAAK,EAAA,IAAI,EAAC,MAAV;AAAiB,EAAA,KAAK,EAAC,4BAAvB;AAAoD,EAAA,OAAO,EAAC;AAA5D,GACC,4BAAC,gBAAD;AACC,EAAA,QAAQ,EAAC,SADV;AAEC,EAAA,QAAQ,EAAC,SAFV;AAGC,EAAA,CAAC,EAAC;AAHH,EADD,CADD;AAUA,MAAMC,SAAS,GACd,4BAAC,eAAD;AAAK,EAAA,IAAI,EAAC,MAAV;AAAiB,EAAA,KAAK,EAAC,4BAAvB;AAAoD,EAAA,OAAO,EAAC;AAA5D,GACC,4BAAC,gBAAD;AACC,EAAA,QAAQ,EAAC,SADV;AAEC,EAAA,QAAQ,EAAC,SAFV;AAGC,EAAA,CAAC,EAAC;AAHH,EADD,CADD;AAUA,MAAMC,WAAW,GAChB,4BAAC,eAAD;AAAK,EAAA,IAAI,EAAC,MAAV;AAAiB,EAAA,KAAK,EAAC,4BAAvB;AAAoD,EAAA,OAAO,EAAC;AAA5D,GACC,4BAAC,gBAAD;AACC,EAAA,QAAQ,EAAC,SADV;AAEC,EAAA,QAAQ,EAAC,SAFV;AAGC,EAAA,CAAC,EAAC;AA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CAAEA;AAD7C,KAFW;AADb,KAQGK,UARH,OAQkBD,WARlB,CADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { Path, SVG } from '@wordpress/primitives';\n\nconst publishedIcon = (\n\t<SVG fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16Zm-1.067-5.6 4.2-5.667.8.6-4.8 6.467-3-2.267.6-.8 2.2 1.667Z\"\n\t\t/>\n\t</SVG>\n);\n\nconst draftIcon = (\n\t<SVG fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M14.5 8a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-8 4a4 4 0 0 0 0-8v8Z\"\n\t\t/>\n\t</SVG>\n);\n\nconst pendingIcon = (\n\t<SVG fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M14.5 8a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM8 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z\"\n\t\t/>\n\t</SVG>\n);\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tlet statusIcon = pendingIcon;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tstatusIcon = publishedIcon;\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tstatusIcon = draftIcon;\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusIcon } { statusLabel }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"names":["StatusLabel","status","date","short","relateToNow","statusLabel","time","formattedDate"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,WAAT,CAAsB;AAAEC,EAAAA,MAAF;AAAUC,EAAAA,IAAV;AAAgBC,EAAAA;AAAhB,CAAtB,EAAgD;AAC9D,QAAMC,WAAW,GAAG,yBAAeF,IAAf,CAApB;AACA,MAAIG,WAAW,GAAGJ,MAAlB;;AACA,UAASA,MAAT;AACC,SAAK,SAAL;AACCI,MAAAA,WAAW,GAAGH,IAAI,GACf,uCACA;AACC;AACA,oBAAI,2BAAJ,CAFD,EAGCE,WAHD,CADA,EAMA;AAAEE,QAAAA,IAAI,EAAE;AAAM,UAAA,QAAQ,EAAGJ;AAAjB;AAAR,OANA,CADe,GASf,cAAI,WAAJ,CATH;AAUA;;AACD,SAAK,QAAL;AACC,YAAMK,aAAa,GAAG,oBACrBJ,KAAK,GAAG,KAAH,GAAW,KADK,EAErB,mBAASD,IAAT,CAFqB,CAAtB;AAIAG,MAAAA,WAAW,GAAGH,IAAI,GACf,uCACA;AACC;AACA,oBAAI,4BAAJ,CAFD,EAGCK,aAHD,CADA,EAMA;AAAED,QAAAA,IAAI,EAAE;AAAM,UAAA,QAAQ,EAAGJ;AAAjB;AAAR,OANA,CADe,GASf,cAAI,WAAJ,CATH;AAUA;;AACD,SAAK,OAAL;AACCG,MAAAA,WAAW,GAAG,cAAI,OAAJ,CAAd;AACA;;AACD,SAAK,SAAL;AACCA,MAAAA,WAAW,GAAG,cAAI,SAAJ,CAAd;AACA;;AACD,SAAK,SAAL;AACCA,MAAAA,WAAW,GAAG,cAAI,SAAJ,CAAd;AACA;;AACD,SAAK,WAAL;AACCA,MAAAA,WAAW,GAAG,cAAI,oBAAJ,CAAd;AACA;AAxCF;;AA2CA,SACC;AACC,IAAA,SAAS,EAAG,yBACX,kDADW,EAEX;AACC,OAAG,kBAAkBJ,MAAQ,SAA7B,GAAyC,CAAC,CAAEA;AAD7C,KAFW;AADb,KAQGI,WARH,CADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusLabel }\n\t\t</div>\n\t);\n}\n"]}