@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
@@ -37,10 +37,10 @@ export function SidebarNavigationItemGlobalStyles( props ) {
37
37
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
38
38
  const { createNotice } = useDispatch( noticesStore );
39
39
  const { set: setPreference } = useDispatch( preferencesStore );
40
- const { get: getPrefference } = useSelect( preferencesStore );
40
+ const { get: getPreference } = useSelect( preferencesStore );
41
41
 
42
42
  const turnOffDistractionFreeMode = useCallback( () => {
43
- const isDistractionFree = getPrefference(
43
+ const isDistractionFree = getPreference(
44
44
  editSiteStore.name,
45
45
  'distractionFree'
46
46
  );
@@ -52,7 +52,7 @@ export function SidebarNavigationItemGlobalStyles( props ) {
52
52
  isDismissible: true,
53
53
  type: 'snackbar',
54
54
  } );
55
- }, [ createNotice, setPreference, getPrefference ] );
55
+ }, [ createNotice, setPreference, getPreference ] );
56
56
  const hasGlobalStyleVariations = useSelect(
57
57
  ( select ) =>
58
58
  !! select(
@@ -108,30 +108,10 @@ function SidebarNavigationScreenGlobalStylesContent() {
108
108
  );
109
109
  }
110
110
 
111
- function SidebarNavigationScreenGlobalStylesFooter( { onClickRevisions } ) {
112
- const { revisions, isLoading } = useGlobalStylesRevisions();
113
- const { revisionsCount } = useSelect( ( select ) => {
114
- const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =
115
- select( coreStore );
116
-
117
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
118
- const globalStyles = globalStylesId
119
- ? getEntityRecord( 'root', 'globalStyles', globalStylesId )
120
- : undefined;
121
-
122
- return {
123
- revisionsCount:
124
- globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,
125
- };
126
- }, [] );
127
-
128
- const hasRevisions = revisionsCount >= 2;
129
- const modified = revisions?.[ 0 ]?.modified;
130
-
131
- if ( ! hasRevisions || isLoading || ! modified ) {
132
- return null;
133
- }
134
-
111
+ function SidebarNavigationScreenGlobalStylesFooter( {
112
+ modifiedDateTime,
113
+ onClickRevisions,
114
+ } ) {
135
115
  return (
136
116
  <VStack className="edit-site-sidebar-navigation-screen-global-styles__footer">
137
117
  <SidebarNavigationItem
@@ -150,8 +130,8 @@ function SidebarNavigationScreenGlobalStylesFooter( { onClickRevisions } ) {
150
130
  { __( 'Last modified' ) }
151
131
  </span>
152
132
  <span>
153
- <time dateTime={ modified }>
154
- { humanTimeDiff( modified ) }
133
+ <time dateTime={ modifiedDateTime }>
134
+ { humanTimeDiff( modifiedDateTime ) }
155
135
  </time>
156
136
  </span>
157
137
  <Icon icon={ backup } style={ { fill: 'currentcolor' } } />
@@ -162,6 +142,8 @@ function SidebarNavigationScreenGlobalStylesFooter( { onClickRevisions } ) {
162
142
  }
163
143
 
164
144
  export default function SidebarNavigationScreenGlobalStyles() {
145
+ const { revisions, isLoading: isLoadingRevisions } =
146
+ useGlobalStylesRevisions();
165
147
  const { openGeneralSidebar, setIsListViewOpened } =
166
148
  useDispatch( editSiteStore );
167
149
  const isMobileViewport = useViewportMatch( 'medium', '<' );
@@ -170,19 +152,32 @@ export default function SidebarNavigationScreenGlobalStyles() {
170
152
  );
171
153
  const { createNotice } = useDispatch( noticesStore );
172
154
  const { set: setPreference } = useDispatch( preferencesStore );
173
- const { get: getPrefference } = useSelect( preferencesStore );
174
- const { isViewMode, isStyleBookOpened } = useSelect( ( select ) => {
175
- const { getCanvasMode, getEditorCanvasContainerView } = unlock(
176
- select( editSiteStore )
177
- );
178
- return {
179
- isViewMode: 'view' === getCanvasMode(),
180
- isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
181
- };
182
- }, [] );
155
+ const { get: getPreference } = useSelect( preferencesStore );
156
+ const { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(
157
+ ( select ) => {
158
+ const { getCanvasMode, getEditorCanvasContainerView } = unlock(
159
+ select( editSiteStore )
160
+ );
161
+ const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =
162
+ select( coreStore );
163
+ const globalStylesId = __experimentalGetCurrentGlobalStylesId();
164
+ const globalStyles = globalStylesId
165
+ ? getEntityRecord( 'root', 'globalStyles', globalStylesId )
166
+ : undefined;
167
+ return {
168
+ isViewMode: 'view' === getCanvasMode(),
169
+ isStyleBookOpened:
170
+ 'style-book' === getEditorCanvasContainerView(),
171
+ revisionsCount:
172
+ globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??
173
+ 0,
174
+ };
175
+ },
176
+ []
177
+ );
183
178
 
184
179
  const turnOffDistractionFreeMode = useCallback( () => {
185
- const isDistractionFree = getPrefference(
180
+ const isDistractionFree = getPreference(
186
181
  editSiteStore.name,
187
182
  'distractionFree'
188
183
  );
@@ -194,7 +189,7 @@ export default function SidebarNavigationScreenGlobalStyles() {
194
189
  isDismissible: true,
195
190
  type: 'snackbar',
196
191
  } );
197
- }, [ createNotice, setPreference, getPrefference ] );
192
+ }, [ createNotice, setPreference, getPreference ] );
198
193
 
199
194
  const openGlobalStyles = useCallback( async () => {
200
195
  turnOffDistractionFreeMode();
@@ -226,6 +221,12 @@ export default function SidebarNavigationScreenGlobalStyles() {
226
221
  setEditorCanvasContainerView( 'global-styles-revisions' );
227
222
  }, [ openGlobalStyles, setEditorCanvasContainerView ] );
228
223
 
224
+ // If there are no revisions, do not render a footer.
225
+ const hasRevisions = revisionsCount >= 2;
226
+ const modifiedDateTime = revisions?.[ 0 ]?.modified;
227
+ const shouldShowGlobalStylesFooter =
228
+ hasRevisions && ! isLoadingRevisions && modifiedDateTime;
229
+
229
230
  return (
230
231
  <>
231
232
  <SidebarNavigationScreen
@@ -235,9 +236,12 @@ export default function SidebarNavigationScreenGlobalStyles() {
235
236
  ) }
236
237
  content={ <SidebarNavigationScreenGlobalStylesContent /> }
237
238
  footer={
238
- <SidebarNavigationScreenGlobalStylesFooter
239
- onClickRevisions={ openRevisions }
240
- />
239
+ shouldShowGlobalStylesFooter && (
240
+ <SidebarNavigationScreenGlobalStylesFooter
241
+ modifiedDateTime={ modifiedDateTime }
242
+ onClickRevisions={ openRevisions }
243
+ />
244
+ )
241
245
  }
242
246
  actions={
243
247
  <>
@@ -20,6 +20,7 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
20
20
  import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
21
21
  import { unlock } from '../../lock-unlock';
22
22
  import { store as editSiteStore } from '../../store';
23
+ import TemplatePartHint from './template-part-hint';
23
24
 
24
25
  export default function SidebarNavigationScreenMain() {
25
26
  const { location } = useNavigator();
@@ -42,46 +43,49 @@ export default function SidebarNavigationScreenMain() {
42
43
  'Customize the appearance of your website using the block editor.'
43
44
  ) }
44
45
  content={
45
- <ItemGroup>
46
- <NavigatorButton
47
- as={ SidebarNavigationItem }
48
- path="/navigation"
49
- withChevron
50
- icon={ navigation }
51
- >
52
- { __( 'Navigation' ) }
53
- </NavigatorButton>
54
- <SidebarNavigationItemGlobalStyles
55
- withChevron
56
- icon={ styles }
57
- >
58
- { __( 'Styles' ) }
59
- </SidebarNavigationItemGlobalStyles>
60
- <NavigatorButton
61
- as={ SidebarNavigationItem }
62
- path="/page"
63
- withChevron
64
- icon={ page }
65
- >
66
- { __( 'Pages' ) }
67
- </NavigatorButton>
68
- <NavigatorButton
69
- as={ SidebarNavigationItem }
70
- path="/wp_template"
71
- withChevron
72
- icon={ layout }
73
- >
74
- { __( 'Templates' ) }
75
- </NavigatorButton>
76
- <NavigatorButton
77
- as={ SidebarNavigationItem }
78
- path="/patterns"
79
- withChevron
80
- icon={ symbol }
81
- >
82
- { __( 'Patterns' ) }
83
- </NavigatorButton>
84
- </ItemGroup>
46
+ <>
47
+ <ItemGroup>
48
+ <NavigatorButton
49
+ as={ SidebarNavigationItem }
50
+ path="/navigation"
51
+ withChevron
52
+ icon={ navigation }
53
+ >
54
+ { __( 'Navigation' ) }
55
+ </NavigatorButton>
56
+ <SidebarNavigationItemGlobalStyles
57
+ withChevron
58
+ icon={ styles }
59
+ >
60
+ { __( 'Styles' ) }
61
+ </SidebarNavigationItemGlobalStyles>
62
+ <NavigatorButton
63
+ as={ SidebarNavigationItem }
64
+ path="/page"
65
+ withChevron
66
+ icon={ page }
67
+ >
68
+ { __( 'Pages' ) }
69
+ </NavigatorButton>
70
+ <NavigatorButton
71
+ as={ SidebarNavigationItem }
72
+ path="/wp_template"
73
+ withChevron
74
+ icon={ layout }
75
+ >
76
+ { __( 'Templates' ) }
77
+ </NavigatorButton>
78
+ <NavigatorButton
79
+ as={ SidebarNavigationItem }
80
+ path="/patterns"
81
+ withChevron
82
+ icon={ symbol }
83
+ >
84
+ { __( 'Patterns' ) }
85
+ </NavigatorButton>
86
+ </ItemGroup>
87
+ <TemplatePartHint />
88
+ </>
85
89
  }
86
90
  />
87
91
  );
@@ -0,0 +1,34 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Notice } from '@wordpress/components';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { __ } from '@wordpress/i18n';
7
+ import { store as preferencesStore } from '@wordpress/preferences';
8
+
9
+ const PREFERENCE_NAME = 'isTemplatePartMoveHintVisible';
10
+
11
+ export default function TemplatePartHint() {
12
+ const showTemplatePartHint = useSelect(
13
+ ( select ) =>
14
+ select( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true,
15
+ []
16
+ );
17
+
18
+ const { set: setPreference } = useDispatch( preferencesStore );
19
+ if ( ! showTemplatePartHint ) {
20
+ return null;
21
+ }
22
+
23
+ return (
24
+ <Notice
25
+ politeness="polite"
26
+ className="edit-site-sidebar__notice"
27
+ onRemove={ () => {
28
+ setPreference( 'core', PREFERENCE_NAME, false );
29
+ } }
30
+ >
31
+ { __( 'Looking for template parts? Find them in "Patterns".' ) }
32
+ </Notice>
33
+ );
34
+ }
@@ -22,9 +22,10 @@ import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/
22
22
  export const postType = `wp_navigation`;
23
23
 
24
24
  export default function SidebarNavigationScreenNavigationMenu() {
25
- const {
26
- params: { postId },
27
- } = useNavigator();
25
+ const { params } = useNavigator();
26
+
27
+ // See https://github.com/WordPress/gutenberg/pull/52120.
28
+ const postId = Number( params?.postId );
28
29
 
29
30
  const { record: navigationMenu, isResolving } = useEntityRecord(
30
31
  'postType',
@@ -33,6 +33,7 @@ export default function ScreenNavigationMoreMenu( props ) {
33
33
  <>
34
34
  <DropdownMenu
35
35
  className="sidebar-navigation__more-menu"
36
+ label={ __( 'Actions' ) }
36
37
  icon={ moreVertical }
37
38
  popoverProps={ POPOVER_PROPS }
38
39
  >
@@ -24,13 +24,13 @@ export default function SingleNavigationMenu( {
24
24
  <SidebarNavigationScreenWrapper
25
25
  actions={
26
26
  <>
27
- <EditButton postId={ navigationMenu?.id } />
28
27
  <ScreenNavigationMoreMenu
29
28
  menuTitle={ decodeEntities( menuTitle ) }
30
29
  onDelete={ handleDelete }
31
30
  onSave={ handleSave }
32
31
  onDuplicate={ handleDuplicate }
33
32
  />
33
+ <EditButton postId={ navigationMenu?.id } />
34
34
  </>
35
35
  }
36
36
  title={ buildNavigationLabel(
@@ -65,8 +65,10 @@ function useSaveNavigationMenu() {
65
65
  };
66
66
  }, [] );
67
67
 
68
- const { editEntityRecord, saveEditedEntityRecord } =
69
- useDispatch( coreStore );
68
+ const {
69
+ editEntityRecord,
70
+ __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,
71
+ } = useDispatch( coreStore );
70
72
 
71
73
  const { createSuccessNotice, createErrorNotice } =
72
74
  useDispatch( noticesStore );
@@ -87,11 +89,19 @@ function useSaveNavigationMenu() {
87
89
  // Apply the edits.
88
90
  editEntityRecord( 'postType', postType, postId, edits );
89
91
 
92
+ const recordPropertiesToSave = Object.keys( edits );
93
+
90
94
  // Attempt to persist.
91
95
  try {
92
- await saveEditedEntityRecord( 'postType', postType, postId, {
93
- throwOnError: true,
94
- } );
96
+ await saveSpecifiedEntityEdits(
97
+ 'postType',
98
+ postType,
99
+ postId,
100
+ recordPropertiesToSave,
101
+ {
102
+ throwOnError: true,
103
+ }
104
+ );
95
105
  createSuccessNotice( __( 'Renamed Navigation menu' ), {
96
106
  type: 'snackbar',
97
107
  } );
@@ -125,8 +135,7 @@ function useDuplicateNavigationMenu() {
125
135
  useDispatch( noticesStore );
126
136
 
127
137
  const handleDuplicate = async ( navigationMenu ) => {
128
- const menuTitle =
129
- navigationMenu?.title?.rendered || navigationMenu?.slug;
138
+ const menuTitle = navigationMenu?.title || navigationMenu?.slug;
130
139
 
131
140
  try {
132
141
  const savedRecord = await saveEntityRecord(
@@ -3,6 +3,8 @@
3
3
  // on apiFetch this query is limited to 100.
4
4
  // These parameters must be kept aligned with those in
5
5
  // lib/compat/wordpress-6.3/navigation-block-preloading.php
6
+ // and
7
+ // block-library/src/navigation/constants.js
6
8
  export const PRELOADED_NAVIGATION_MENUS_QUERY = {
7
9
  per_page: 100,
8
10
  status: [ 'publish', 'draft' ],
@@ -25,19 +25,19 @@ import { unlock } from '../../lock-unlock';
25
25
 
26
26
  // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
27
27
  function buildMenuLabel( title, id, status ) {
28
- if ( ! title?.rendered ) {
28
+ if ( ! title ) {
29
29
  /* translators: %s is the index of the menu in the list of menus. */
30
30
  return sprintf( __( '(no title %s)' ), id );
31
31
  }
32
32
 
33
33
  if ( status === 'publish' ) {
34
- return decodeEntities( title?.rendered );
34
+ return decodeEntities( title );
35
35
  }
36
36
 
37
37
  return sprintf(
38
38
  // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
39
39
  __( '%1$s (%2$s)' ),
40
- decodeEntities( title?.rendered ),
40
+ decodeEntities( title ),
41
41
  status
42
42
  );
43
43
  }
@@ -124,7 +124,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
124
124
  withChevron
125
125
  icon={ navigation }
126
126
  >
127
- { buildMenuLabel( title, index + 1, status ) }
127
+ { buildMenuLabel( title?.rendered, index + 1, status ) }
128
128
  </NavMenuItem>
129
129
  ) ) }
130
130
  </ItemGroup>
@@ -23,10 +23,12 @@ import {
23
23
  currentlyPreviewingTheme,
24
24
  } from '../../utils/is-previewing-theme';
25
25
  import { unlock } from '../../lock-unlock';
26
+ import { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
26
27
 
27
- const { useHistory } = unlock( routerPrivateApis );
28
+ const { useLocation, useHistory } = unlock( routerPrivateApis );
28
29
 
29
30
  export default function LeafMoreMenu( props ) {
31
+ const location = useLocation();
30
32
  const history = useHistory();
31
33
  const { block } = props;
32
34
  const { clientId } = block;
@@ -63,22 +65,32 @@ export default function LeafMoreMenu( props ) {
63
65
  attributes.type &&
64
66
  history
65
67
  ) {
66
- history.push( {
67
- postType: attributes.type,
68
- postId: attributes.id,
69
- ...( isPreviewingTheme() && {
70
- wp_theme_preview: currentlyPreviewingTheme(),
71
- } ),
72
- } );
68
+ history.push(
69
+ {
70
+ postType: attributes.type,
71
+ postId: attributes.id,
72
+ ...( isPreviewingTheme() && {
73
+ wp_theme_preview: currentlyPreviewingTheme(),
74
+ } ),
75
+ },
76
+ {
77
+ backPath: getPathFromURL( location.params ),
78
+ }
79
+ );
73
80
  }
74
81
  if ( name === 'core/page-list-item' && attributes.id && history ) {
75
- history.push( {
76
- postType: 'page',
77
- postId: attributes.id,
78
- ...( isPreviewingTheme() && {
79
- wp_theme_preview: currentlyPreviewingTheme(),
80
- } ),
81
- } );
82
+ history.push(
83
+ {
84
+ postType: 'page',
85
+ postId: attributes.id,
86
+ ...( isPreviewingTheme() && {
87
+ wp_theme_preview: currentlyPreviewingTheme(),
88
+ } ),
89
+ },
90
+ {
91
+ backPath: getPathFromURL( location.params ),
92
+ }
93
+ );
82
94
  }
83
95
  },
84
96
  [ history ]
@@ -5,7 +5,6 @@ import {
5
5
  privateApis as blockEditorPrivateApis,
6
6
  store as blockEditorStore,
7
7
  BlockList,
8
- BlockTools,
9
8
  } from '@wordpress/block-editor';
10
9
  import { useDispatch, useSelect } from '@wordpress/data';
11
10
  import { createBlock } from '@wordpress/blocks';
@@ -106,9 +105,7 @@ export default function NavigationMenuContent( { rootClientId } ) {
106
105
  />
107
106
  ) }
108
107
  <div className="edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor">
109
- <BlockTools>
110
- <BlockList />
111
- </BlockTools>
108
+ <BlockList />
112
109
  </div>
113
110
  </>
114
111
  );
@@ -30,9 +30,9 @@ import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-d
30
30
  export default function SidebarNavigationScreenPage() {
31
31
  const navigator = useNavigator();
32
32
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
33
- const {
34
- params: { postId },
35
- } = useNavigator();
33
+ const { params } = useNavigator();
34
+
35
+ const postId = Number( params?.postId );
36
36
  const { record } = useEntityRecord( 'postType', 'page', postId );
37
37
 
38
38
  const { featuredMediaAltText, featuredMediaSourceUrl } = useSelect(
@@ -9,42 +9,10 @@ import classnames from 'classnames';
9
9
  import { __, sprintf } from '@wordpress/i18n';
10
10
  import { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';
11
11
  import { createInterpolateElement } from '@wordpress/element';
12
- import { Path, SVG } from '@wordpress/primitives';
13
-
14
- const publishedIcon = (
15
- <SVG fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
16
- <Path
17
- fillRule="evenodd"
18
- clipRule="evenodd"
19
- 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"
20
- />
21
- </SVG>
22
- );
23
-
24
- const draftIcon = (
25
- <SVG fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
26
- <Path
27
- fillRule="evenodd"
28
- clipRule="evenodd"
29
- 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"
30
- />
31
- </SVG>
32
- );
33
-
34
- const pendingIcon = (
35
- <SVG fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
36
- <Path
37
- fillRule="evenodd"
38
- clipRule="evenodd"
39
- 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"
40
- />
41
- </SVG>
42
- );
43
12
 
44
13
  export default function StatusLabel( { status, date, short } ) {
45
14
  const relateToNow = humanTimeDiff( date );
46
15
  let statusLabel = status;
47
- let statusIcon = pendingIcon;
48
16
  switch ( status ) {
49
17
  case 'publish':
50
18
  statusLabel = date
@@ -57,7 +25,6 @@ export default function StatusLabel( { status, date, short } ) {
57
25
  { time: <time dateTime={ date } /> }
58
26
  )
59
27
  : __( 'Published' );
60
- statusIcon = publishedIcon;
61
28
  break;
62
29
  case 'future':
63
30
  const formattedDate = dateI18n(
@@ -77,7 +44,6 @@ export default function StatusLabel( { status, date, short } ) {
77
44
  break;
78
45
  case 'draft':
79
46
  statusLabel = __( 'Draft' );
80
- statusIcon = draftIcon;
81
47
  break;
82
48
  case 'pending':
83
49
  statusLabel = __( 'Pending' );
@@ -99,7 +65,7 @@ export default function StatusLabel( { status, date, short } ) {
99
65
  }
100
66
  ) }
101
67
  >
102
- { statusIcon } { statusLabel }
68
+ { statusLabel }
103
69
  </div>
104
70
  );
105
71
  }