@wordpress/edit-site 5.3.2 → 5.4.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 (339) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/build/components/add-new-template/new-template-part.js +8 -5
  3. package/build/components/add-new-template/new-template-part.js.map +1 -1
  4. package/build/components/add-new-template/new-template.js +9 -25
  5. package/build/components/add-new-template/new-template.js.map +1 -1
  6. package/build/components/app/index.js.map +1 -1
  7. package/build/components/block-editor/editor-canvas.js +4 -3
  8. package/build/components/block-editor/editor-canvas.js.map +1 -1
  9. package/build/components/block-editor/index.js +3 -3
  10. package/build/components/block-editor/index.js.map +1 -1
  11. package/build/components/editor/index.js +28 -24
  12. package/build/components/editor/index.js.map +1 -1
  13. package/build/components/global-styles/border-panel.js +6 -6
  14. package/build/components/global-styles/border-panel.js.map +1 -1
  15. package/build/components/global-styles/color-palette-panel.js +7 -4
  16. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  17. package/build/components/global-styles/color-utils.js +1 -1
  18. package/build/components/global-styles/color-utils.js.map +1 -1
  19. package/build/components/global-styles/context-menu.js +16 -3
  20. package/build/components/global-styles/context-menu.js.map +1 -1
  21. package/build/components/global-styles/custom-css.js +3 -3
  22. package/build/components/global-styles/custom-css.js.map +1 -1
  23. package/build/components/global-styles/dimensions-panel.js +10 -9
  24. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  25. package/build/components/global-styles/global-styles-provider.js +2 -2
  26. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  27. package/build/components/global-styles/gradients-palette-panel.js +10 -5
  28. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  29. package/build/components/global-styles/header.js +4 -2
  30. package/build/components/global-styles/header.js.map +1 -1
  31. package/build/components/global-styles/hooks.js +16 -53
  32. package/build/components/global-styles/hooks.js.map +1 -1
  33. package/build/components/global-styles/navigation-button.js +1 -1
  34. package/build/components/global-styles/navigation-button.js.map +1 -1
  35. package/build/components/global-styles/palette.js +5 -3
  36. package/build/components/global-styles/palette.js.map +1 -1
  37. package/build/components/global-styles/preview.js +2 -2
  38. package/build/components/global-styles/preview.js.map +1 -1
  39. package/build/components/global-styles/screen-background-color.js +5 -4
  40. package/build/components/global-styles/screen-background-color.js.map +1 -1
  41. package/build/components/global-styles/screen-block-list.js +14 -3
  42. package/build/components/global-styles/screen-block-list.js.map +1 -1
  43. package/build/components/global-styles/screen-button-color.js +9 -7
  44. package/build/components/global-styles/screen-button-color.js.map +1 -1
  45. package/build/components/global-styles/screen-colors.js +10 -8
  46. package/build/components/global-styles/screen-colors.js.map +1 -1
  47. package/build/components/global-styles/screen-css.js +5 -5
  48. package/build/components/global-styles/screen-css.js.map +1 -1
  49. package/build/components/global-styles/screen-heading-color.js +10 -8
  50. package/build/components/global-styles/screen-heading-color.js.map +1 -1
  51. package/build/components/global-styles/screen-link-color.js +5 -4
  52. package/build/components/global-styles/screen-link-color.js.map +1 -1
  53. package/build/components/global-styles/screen-root.js +2 -2
  54. package/build/components/global-styles/screen-root.js.map +1 -1
  55. package/build/components/global-styles/screen-style-variations.js +2 -2
  56. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  57. package/build/components/global-styles/screen-text-color.js +5 -4
  58. package/build/components/global-styles/screen-text-color.js.map +1 -1
  59. package/build/components/global-styles/screen-typography.js +5 -3
  60. package/build/components/global-styles/screen-typography.js.map +1 -1
  61. package/build/components/global-styles/shadow-panel.js +4 -5
  62. package/build/components/global-styles/shadow-panel.js.map +1 -1
  63. package/build/components/global-styles/subtitle.js +3 -2
  64. package/build/components/global-styles/subtitle.js.map +1 -1
  65. package/build/components/global-styles/typography-panel.js +24 -301
  66. package/build/components/global-styles/typography-panel.js.map +1 -1
  67. package/build/components/global-styles/typography-preview.js +2 -2
  68. package/build/components/global-styles/typography-preview.js.map +1 -1
  69. package/build/components/global-styles/ui.js +3 -10
  70. package/build/components/global-styles/ui.js.map +1 -1
  71. package/build/components/global-styles-renderer/index.js +2 -2
  72. package/build/components/global-styles-renderer/index.js.map +1 -1
  73. package/build/components/header-edit-mode/index.js +6 -3
  74. package/build/components/header-edit-mode/index.js.map +1 -1
  75. package/build/components/keyboard-shortcut-help-modal/config.js +1 -1
  76. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  77. package/build/components/layout/index.js +10 -23
  78. package/build/components/layout/index.js.map +1 -1
  79. package/build/components/list/actions/rename-menu-item.js +1 -1
  80. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  81. package/build/components/list/table.js +1 -0
  82. package/build/components/list/table.js.map +1 -1
  83. package/build/components/navigation-inspector/index.js +0 -29
  84. package/build/components/navigation-inspector/index.js.map +1 -1
  85. package/build/components/navigation-inspector/navigation-menu.js +6 -4
  86. package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
  87. package/build/components/save-panel/index.js +4 -3
  88. package/build/components/save-panel/index.js.map +1 -1
  89. package/build/components/sidebar/index.js +18 -23
  90. package/build/components/sidebar/index.js.map +1 -1
  91. package/build/components/sidebar-edit-mode/index.js +1 -1
  92. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  93. package/build/components/sidebar-edit-mode/template-card/index.js +9 -2
  94. package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  95. package/build/components/sidebar-edit-mode/template-card/last-revision.js +84 -0
  96. package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
  97. package/build/components/sidebar-navigation-screen/index.js +28 -7
  98. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  99. package/build/components/sidebar-navigation-screen-navigation-item/index.js +72 -0
  100. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
  101. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
  102. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-template/index.js +70 -0
  104. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -0
  105. package/build/components/sidebar-navigation-screen-templates/index.js +32 -82
  106. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  107. package/build/components/sidebar-navigation-screen-templates-browse/index.js +43 -0
  108. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
  109. package/build/components/site-hub/index.js +14 -49
  110. package/build/components/site-hub/index.js.map +1 -1
  111. package/build/components/start-template-options/index.js +175 -0
  112. package/build/components/start-template-options/index.js.map +1 -0
  113. package/build/components/style-book/index.js +10 -3
  114. package/build/components/style-book/index.js.map +1 -1
  115. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -20
  116. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  117. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -3
  118. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  119. package/build/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +12 -12
  120. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
  121. package/build/components/use-edited-entity-record/index.js +6 -2
  122. package/build/components/use-edited-entity-record/index.js.map +1 -1
  123. package/build/hooks/push-changes-to-global-styles/index.js +7 -6
  124. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  125. package/build/{experiments.js → private-apis.js} +3 -3
  126. package/build/private-apis.js.map +1 -0
  127. package/build/store/index.js +3 -3
  128. package/build/store/index.js.map +1 -1
  129. package/build/utils/get-is-list-page.js +5 -6
  130. package/build/utils/get-is-list-page.js.map +1 -1
  131. package/build-module/components/add-new-template/new-template-part.js +7 -4
  132. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  133. package/build-module/components/add-new-template/new-template.js +8 -22
  134. package/build-module/components/add-new-template/new-template.js.map +1 -1
  135. package/build-module/components/app/index.js.map +1 -1
  136. package/build-module/components/block-editor/editor-canvas.js +2 -1
  137. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  138. package/build-module/components/block-editor/index.js +3 -3
  139. package/build-module/components/block-editor/index.js.map +1 -1
  140. package/build-module/components/editor/index.js +27 -25
  141. package/build-module/components/editor/index.js.map +1 -1
  142. package/build-module/components/global-styles/border-panel.js +8 -8
  143. package/build-module/components/global-styles/border-panel.js.map +1 -1
  144. package/build-module/components/global-styles/color-palette-panel.js +8 -5
  145. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  146. package/build-module/components/global-styles/color-utils.js +2 -2
  147. package/build-module/components/global-styles/color-utils.js.map +1 -1
  148. package/build-module/components/global-styles/context-menu.js +13 -2
  149. package/build-module/components/global-styles/context-menu.js.map +1 -1
  150. package/build-module/components/global-styles/custom-css.js +4 -4
  151. package/build-module/components/global-styles/custom-css.js.map +1 -1
  152. package/build-module/components/global-styles/dimensions-panel.js +12 -11
  153. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  154. package/build-module/components/global-styles/global-styles-provider.js +3 -3
  155. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  156. package/build-module/components/global-styles/gradients-palette-panel.js +11 -6
  157. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  158. package/build-module/components/global-styles/header.js +5 -3
  159. package/build-module/components/global-styles/header.js.map +1 -1
  160. package/build-module/components/global-styles/hooks.js +15 -52
  161. package/build-module/components/global-styles/hooks.js.map +1 -1
  162. package/build-module/components/global-styles/navigation-button.js +2 -2
  163. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  164. package/build-module/components/global-styles/palette.js +6 -4
  165. package/build-module/components/global-styles/palette.js.map +1 -1
  166. package/build-module/components/global-styles/preview.js +3 -3
  167. package/build-module/components/global-styles/preview.js.map +1 -1
  168. package/build-module/components/global-styles/screen-background-color.js +7 -6
  169. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  170. package/build-module/components/global-styles/screen-block-list.js +12 -3
  171. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  172. package/build-module/components/global-styles/screen-button-color.js +11 -9
  173. package/build-module/components/global-styles/screen-button-color.js.map +1 -1
  174. package/build-module/components/global-styles/screen-colors.js +12 -10
  175. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  176. package/build-module/components/global-styles/screen-css.js +5 -5
  177. package/build-module/components/global-styles/screen-css.js.map +1 -1
  178. package/build-module/components/global-styles/screen-heading-color.js +12 -10
  179. package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
  180. package/build-module/components/global-styles/screen-link-color.js +7 -6
  181. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  182. package/build-module/components/global-styles/screen-root.js +3 -3
  183. package/build-module/components/global-styles/screen-root.js.map +1 -1
  184. package/build-module/components/global-styles/screen-style-variations.js +3 -3
  185. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  186. package/build-module/components/global-styles/screen-text-color.js +7 -6
  187. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  188. package/build-module/components/global-styles/screen-typography.js +6 -4
  189. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  190. package/build-module/components/global-styles/shadow-panel.js +6 -7
  191. package/build-module/components/global-styles/shadow-panel.js.map +1 -1
  192. package/build-module/components/global-styles/subtitle.js +3 -2
  193. package/build-module/components/global-styles/subtitle.js.map +1 -1
  194. package/build-module/components/global-styles/typography-panel.js +29 -302
  195. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  196. package/build-module/components/global-styles/typography-preview.js +3 -3
  197. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  198. package/build-module/components/global-styles/ui.js +4 -11
  199. package/build-module/components/global-styles/ui.js.map +1 -1
  200. package/build-module/components/global-styles-renderer/index.js +3 -3
  201. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  202. package/build-module/components/header-edit-mode/index.js +6 -3
  203. package/build-module/components/header-edit-mode/index.js.map +1 -1
  204. package/build-module/components/keyboard-shortcut-help-modal/config.js +1 -1
  205. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  206. package/build-module/components/layout/index.js +10 -23
  207. package/build-module/components/layout/index.js.map +1 -1
  208. package/build-module/components/list/actions/rename-menu-item.js +1 -1
  209. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  210. package/build-module/components/list/table.js +1 -0
  211. package/build-module/components/list/table.js.map +1 -1
  212. package/build-module/components/navigation-inspector/index.js +0 -27
  213. package/build-module/components/navigation-inspector/index.js.map +1 -1
  214. package/build-module/components/navigation-inspector/navigation-menu.js +7 -5
  215. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
  216. package/build-module/components/save-panel/index.js +3 -2
  217. package/build-module/components/save-panel/index.js.map +1 -1
  218. package/build-module/components/sidebar/index.js +15 -21
  219. package/build-module/components/sidebar/index.js.map +1 -1
  220. package/build-module/components/sidebar-edit-mode/index.js +1 -1
  221. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  222. package/build-module/components/sidebar-edit-mode/template-card/index.js +9 -4
  223. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  224. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js +70 -0
  225. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
  226. package/build-module/components/sidebar-navigation-screen/index.js +27 -9
  227. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  228. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +55 -0
  229. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
  230. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
  231. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  232. package/build-module/components/sidebar-navigation-screen-template/index.js +53 -0
  233. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -0
  234. package/build-module/components/sidebar-navigation-screen-templates/index.js +34 -81
  235. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  236. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
  237. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
  238. package/build-module/components/site-hub/index.js +14 -46
  239. package/build-module/components/site-hub/index.js.map +1 -1
  240. package/build-module/components/start-template-options/index.js +156 -0
  241. package/build-module/components/start-template-options/index.js.map +1 -0
  242. package/build-module/components/style-book/index.js +11 -4
  243. package/build-module/components/style-book/index.js.map +1 -1
  244. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -21
  245. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  246. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  247. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  248. package/build-module/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +11 -11
  249. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
  250. package/build-module/components/use-edited-entity-record/index.js +6 -2
  251. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  252. package/build-module/hooks/push-changes-to-global-styles/index.js +9 -8
  253. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  254. package/build-module/{experiments.js → private-apis.js} +2 -2
  255. package/build-module/private-apis.js.map +1 -0
  256. package/build-module/store/index.js +1 -1
  257. package/build-module/store/index.js.map +1 -1
  258. package/build-module/utils/get-is-list-page.js +5 -6
  259. package/build-module/utils/get-is-list-page.js.map +1 -1
  260. package/build-style/style-rtl.css +91 -41
  261. package/build-style/style.css +91 -41
  262. package/package.json +31 -31
  263. package/src/components/add-new-template/new-template-part.js +7 -4
  264. package/src/components/add-new-template/new-template.js +9 -22
  265. package/src/components/app/index.js +0 -1
  266. package/src/components/block-editor/editor-canvas.js +2 -1
  267. package/src/components/block-editor/index.js +3 -3
  268. package/src/components/editor/index.js +31 -28
  269. package/src/components/global-styles/border-panel.js +8 -8
  270. package/src/components/global-styles/color-palette-panel.js +6 -3
  271. package/src/components/global-styles/color-utils.js +2 -3
  272. package/src/components/global-styles/context-menu.js +17 -2
  273. package/src/components/global-styles/custom-css.js +4 -4
  274. package/src/components/global-styles/dimensions-panel.js +15 -11
  275. package/src/components/global-styles/global-styles-provider.js +3 -3
  276. package/src/components/global-styles/gradients-palette-panel.js +7 -4
  277. package/src/components/global-styles/header.js +9 -3
  278. package/src/components/global-styles/hooks.js +20 -93
  279. package/src/components/global-styles/navigation-button.js +4 -2
  280. package/src/components/global-styles/palette.js +4 -4
  281. package/src/components/global-styles/preview.js +3 -3
  282. package/src/components/global-styles/screen-background-color.js +6 -5
  283. package/src/components/global-styles/screen-block-list.js +19 -3
  284. package/src/components/global-styles/screen-button-color.js +11 -9
  285. package/src/components/global-styles/screen-colors.js +10 -10
  286. package/src/components/global-styles/screen-css.js +14 -7
  287. package/src/components/global-styles/screen-heading-color.js +12 -10
  288. package/src/components/global-styles/screen-link-color.js +6 -5
  289. package/src/components/global-styles/screen-root.js +3 -3
  290. package/src/components/global-styles/screen-style-variations.js +3 -3
  291. package/src/components/global-styles/screen-text-color.js +6 -5
  292. package/src/components/global-styles/screen-typography.js +4 -4
  293. package/src/components/global-styles/shadow-panel.js +9 -6
  294. package/src/components/global-styles/style.scss +7 -1
  295. package/src/components/global-styles/subtitle.js +5 -2
  296. package/src/components/global-styles/typography-panel.js +31 -395
  297. package/src/components/global-styles/typography-preview.js +3 -3
  298. package/src/components/global-styles/ui.js +3 -8
  299. package/src/components/global-styles-renderer/index.js +3 -3
  300. package/src/components/header-edit-mode/index.js +6 -3
  301. package/src/components/keyboard-shortcut-help-modal/config.js +1 -1
  302. package/src/components/layout/index.js +35 -48
  303. package/src/components/layout/style.scss +11 -23
  304. package/src/components/list/actions/rename-menu-item.js +1 -1
  305. package/src/components/list/table.js +4 -0
  306. package/src/components/navigation-inspector/index.js +0 -32
  307. package/src/components/navigation-inspector/navigation-menu.js +10 -4
  308. package/src/components/save-panel/index.js +4 -1
  309. package/src/components/sidebar/index.js +14 -19
  310. package/src/components/sidebar-edit-mode/index.js +1 -1
  311. package/src/components/sidebar-edit-mode/template-card/index.js +24 -14
  312. package/src/components/sidebar-edit-mode/template-card/last-revision.js +75 -0
  313. package/src/components/sidebar-edit-mode/template-card/style.scss +4 -0
  314. package/src/components/sidebar-navigation-screen/index.js +27 -11
  315. package/src/components/sidebar-navigation-screen/style.scss +4 -6
  316. package/src/components/sidebar-navigation-screen-navigation-item/index.js +52 -0
  317. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  318. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  319. package/src/components/sidebar-navigation-screen-template/index.js +52 -0
  320. package/src/components/sidebar-navigation-screen-templates/index.js +49 -83
  321. package/src/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
  322. package/src/components/site-hub/index.js +67 -122
  323. package/src/components/site-hub/style.scss +1 -11
  324. package/src/components/start-template-options/index.js +171 -0
  325. package/src/components/start-template-options/style.scss +76 -0
  326. package/src/components/style-book/index.js +11 -7
  327. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +48 -14
  328. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  329. package/src/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +10 -10
  330. package/src/components/use-edited-entity-record/index.js +6 -2
  331. package/src/hooks/push-changes-to-global-styles/index.js +29 -24
  332. package/src/{experiments.js → private-apis.js} +1 -1
  333. package/src/store/index.js +1 -1
  334. package/src/style.scss +1 -0
  335. package/src/utils/get-is-list-page.js +5 -5
  336. package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
  337. package/build/experiments.js.map +0 -1
  338. package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
  339. package/build-module/experiments.js.map +0 -1
@@ -1,5 +1,3 @@
1
- $hub-height: $grid-unit-20 * 2 + $button-size;
2
-
3
1
  .edit-site-layout {
4
2
  height: 100%;
5
3
  background: $gray-900;
@@ -10,24 +8,23 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
10
8
 
11
9
  .edit-site-layout__hub {
12
10
  position: fixed;
13
- top: $canvas-padding;
14
- left: $canvas-padding;
11
+ top: 0;
12
+ left: 0;
15
13
  width: calc(100vw - #{$canvas-padding * 2});
16
- height: $hub-height;
14
+ height: $header-height;
17
15
  z-index: z-index(".edit-site-layout__hub");
18
16
 
19
- background: $black;
20
- padding: $grid-unit-20;
21
- padding-left: 0;
22
- border-radius: $radius-block-ui * 4;
23
- box-shadow: $shadow-modal;
17
+ .edit-site-layout.is-full-canvas.is-edit-mode & {
18
+ width: auto;
19
+ padding-right: 0;
20
+ }
21
+
22
+ @include break-medium {
23
+ width: calc(#{$nav-sidebar-width} - #{$canvas-padding * 2});
24
+ }
24
25
 
25
26
  .edit-site-layout.is-full-canvas & {
26
- top: 0;
27
- left: 0;
28
- padding: 0;
29
27
  padding-right: $grid-unit-20;
30
- height: $header-height;
31
28
  border-radius: 0;
32
29
  width: 100vw;
33
30
  box-shadow: none;
@@ -37,15 +34,6 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
37
34
  padding-right: 0;
38
35
  }
39
36
  }
40
-
41
- .edit-site-layout.is-full-canvas.is-edit-mode & {
42
- width: auto;
43
- padding-right: 0;
44
- }
45
-
46
- @include break-medium {
47
- width: calc(#{$nav-sidebar-width} - #{$canvas-padding * 2});
48
- }
49
37
  }
50
38
 
51
39
  .edit-site-layout__header {
@@ -24,7 +24,7 @@ export default function RenameMenuItem( { template, onClose } ) {
24
24
  const { createSuccessNotice, createErrorNotice } =
25
25
  useDispatch( noticesStore );
26
26
 
27
- if ( ! template.is_custom ) {
27
+ if ( template.type === 'wp_template' && ! template.is_custom ) {
28
28
  return null;
29
29
  }
30
30
 
@@ -84,6 +84,10 @@ export default function Table( { templateType } ) {
84
84
  <Heading level={ 4 }>
85
85
  <Link
86
86
  params={ {
87
+ path:
88
+ template.type === 'wp_template'
89
+ ? '/templates/single'
90
+ : '/template-parts/single',
87
91
  postId: template.id,
88
92
  postType: template.type,
89
93
  } }
@@ -3,14 +3,12 @@
3
3
  */
4
4
  import { useSelect } from '@wordpress/data';
5
5
  import { useState, useEffect } from '@wordpress/element';
6
- import { SelectControl } from '@wordpress/components';
7
6
  import { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';
8
7
  import {
9
8
  store as blockEditorStore,
10
9
  BlockEditorProvider,
11
10
  } from '@wordpress/block-editor';
12
11
  import { speak } from '@wordpress/a11y';
13
- import { useInstanceId } from '@wordpress/compose';
14
12
  import { __ } from '@wordpress/i18n';
15
13
 
16
14
  /**
@@ -71,11 +69,6 @@ export default function NavigationInspector( { onSelect } ) {
71
69
  };
72
70
  }, [] );
73
71
 
74
- const navMenuListId = useInstanceId(
75
- NavigationMenu,
76
- 'edit-site-navigation-inspector-menu'
77
- );
78
-
79
72
  const firstNavRefInTemplate = clientIdToRef[ firstNavigationBlockId ];
80
73
  const firstNavigationMenuRef = navigationMenus?.[ 0 ]?.id;
81
74
 
@@ -99,14 +92,6 @@ export default function NavigationInspector( { onSelect } ) {
99
92
  }
100
93
  }, [ selectedNavigationBlockId ] );
101
94
 
102
- let options = [];
103
- if ( navigationMenus ) {
104
- options = navigationMenus.map( ( { id, title } ) => ( {
105
- value: id,
106
- label: title.rendered,
107
- } ) );
108
- }
109
-
110
95
  const [ innerBlocks, onInput, onChange ] = useEntityBlockEditor(
111
96
  'postType',
112
97
  'wp_navigation',
@@ -137,8 +122,6 @@ export default function NavigationInspector( { onSelect } ) {
137
122
 
138
123
  const isLoading = ! ( hasResolvedNavigationMenus && hasLoadedInnerBlocks );
139
124
 
140
- const hasMoreThanOneNavigationMenu = navigationMenus?.length > 1;
141
-
142
125
  const hasNavigationMenus = !! navigationMenus?.length;
143
126
 
144
127
  // Entity block editor will return entities that are not currently published.
@@ -178,21 +161,6 @@ export default function NavigationInspector( { onSelect } ) {
178
161
  { ! hasResolvedNavigationMenus && (
179
162
  <div className="edit-site-navigation-inspector__placeholder" />
180
163
  ) }
181
- { hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && (
182
- <SelectControl
183
- __nextHasNoMarginBottom
184
- className="edit-site-navigation-inspector__select-menu"
185
- aria-controls={
186
- // aria-controls should only apply when referenced element is in DOM
187
- hasLoadedInnerBlocks ? navMenuListId : undefined
188
- }
189
- value={ currentMenuId || defaultNavigationMenuId }
190
- options={ options }
191
- onChange={ ( newMenuId ) =>
192
- setCurrentMenuId( Number( newMenuId ) )
193
- }
194
- />
195
- ) }
196
164
  { isLoading && (
197
165
  <>
198
166
  <div className="edit-site-navigation-inspector__placeholder is-child" />
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import {
5
- experiments as blockEditorExperiments,
5
+ privateApis as blockEditorPrivateApis,
6
6
  store as blockEditorStore,
7
7
  } from '@wordpress/block-editor';
8
8
  import { useEffect } from '@wordpress/element';
@@ -11,7 +11,7 @@ import { useDispatch } from '@wordpress/data';
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import { unlock } from '../../experiments';
14
+ import { unlock } from '../../private-apis';
15
15
 
16
16
  const ALLOWED_BLOCKS = {
17
17
  'core/navigation': [
@@ -39,7 +39,7 @@ const ALLOWED_BLOCKS = {
39
39
  export default function NavigationMenu( { innerBlocks, onSelect } ) {
40
40
  const { updateBlockListSettings } = useDispatch( blockEditorStore );
41
41
 
42
- const { OffCanvasEditor } = unlock( blockEditorExperiments );
42
+ const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );
43
43
 
44
44
  //TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
45
45
  //Think through a better way of doing this, possible with adding allowed blocks to block library metadata
@@ -56,5 +56,11 @@ export default function NavigationMenu( { innerBlocks, onSelect } ) {
56
56
  } );
57
57
  }, [ updateBlockListSettings, innerBlocks ] );
58
58
 
59
- return <OffCanvasEditor blocks={ innerBlocks } onSelect={ onSelect } />;
59
+ return (
60
+ <OffCanvasEditor
61
+ blocks={ innerBlocks }
62
+ onSelect={ onSelect }
63
+ LeafMoreMenu={ LeafMoreMenu }
64
+ />
65
+ );
60
66
  }
@@ -11,7 +11,7 @@ import { NavigableRegion } from '@wordpress/interface';
11
11
  * Internal dependencies
12
12
  */
13
13
  import { store as editSiteStore } from '../../store';
14
- import { unlock } from '../../experiments';
14
+ import { unlock } from '../../private-apis';
15
15
 
16
16
  export default function SavePanel() {
17
17
  const { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {
@@ -35,6 +35,9 @@ export default function SavePanel() {
35
35
  className="edit-site-save-panel__modal"
36
36
  onRequestClose={ onClose }
37
37
  __experimentalHideHeader
38
+ contentLabel={ __(
39
+ 'Save site, content, and template changes'
40
+ ) }
38
41
  >
39
42
  <EntitiesSavedStates close={ onClose } />
40
43
  </Modal>
@@ -2,43 +2,39 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { memo } from '@wordpress/element';
5
- import { useSelect } from '@wordpress/data';
6
5
  import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';
7
- import { store as coreStore } from '@wordpress/core-data';
8
6
 
9
7
  /**
10
8
  * Internal dependencies
11
9
  */
12
10
  import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
13
11
  import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
14
- import useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';
12
+ import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
13
+ import useSyncPathWithURL from '../sync-state-with-url/use-sync-path-with-url';
15
14
  import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
15
+ import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
16
16
  import SaveButton from '../save-button';
17
+ import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
17
18
 
18
19
  function SidebarScreens() {
19
- useSyncSidebarPathWithURL();
20
+ useSyncPathWithURL();
20
21
 
21
22
  return (
22
23
  <>
23
24
  <SidebarNavigationScreenMain />
24
25
  <SidebarNavigationScreenNavigationMenus />
26
+ <SidebarNavigationScreenNavigationItem />
25
27
  <SidebarNavigationScreenTemplates postType="wp_template" />
26
28
  <SidebarNavigationScreenTemplates postType="wp_template_part" />
29
+ <SidebarNavigationScreenTemplate postType="wp_template" />
30
+ <SidebarNavigationScreenTemplate postType="wp_template_part" />
31
+ <SidebarNavigationScreenTemplatesBrowse postType="wp_template" />
32
+ <SidebarNavigationScreenTemplatesBrowse postType="wp_template_part" />
27
33
  </>
28
34
  );
29
35
  }
30
36
 
31
37
  function Sidebar() {
32
- const { isDirty } = useSelect( ( select ) => {
33
- const { __experimentalGetDirtyEntityRecords } = select( coreStore );
34
- const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
35
- // The currently selected entity to display.
36
- // Typically template or template part in the site editor.
37
- return {
38
- isDirty: dirtyEntityRecords.length > 0,
39
- };
40
- }, [] );
41
-
42
38
  return (
43
39
  <>
44
40
  <NavigatorProvider
@@ -47,11 +43,10 @@ function Sidebar() {
47
43
  >
48
44
  <SidebarScreens />
49
45
  </NavigatorProvider>
50
- { isDirty && (
51
- <div className="edit-site-sidebar__footer">
52
- <SaveButton />
53
- </div>
54
- ) }
46
+
47
+ <div className="edit-site-sidebar__footer">
48
+ <SaveButton />
49
+ </div>
55
50
  </>
56
51
  );
57
52
  }
@@ -69,7 +69,7 @@ export function SidebarComplementaryAreaFills() {
69
69
  identifier={ sidebarName }
70
70
  title={ __( 'Settings' ) }
71
71
  icon={ isRTL() ? drawerLeft : drawerRight }
72
- closeLabel={ __( 'Close settings sidebar' ) }
72
+ closeLabel={ __( 'Close settings' ) }
73
73
  header={ <SettingsHeader sidebarName={ sidebarName } /> }
74
74
  headerClassName="edit-site-sidebar-edit-mode__panel-tabs"
75
75
  >
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { __ } from '@wordpress/i18n';
4
5
  import { useSelect } from '@wordpress/data';
5
- import { Icon } from '@wordpress/components';
6
+ import { PanelRow, Icon } from '@wordpress/components';
6
7
  import { store as editorStore } from '@wordpress/editor';
7
8
  import { store as coreStore } from '@wordpress/core-data';
8
9
  import { decodeEntities } from '@wordpress/html-entities';
@@ -13,6 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
13
14
  import { store as editSiteStore } from '../../../store';
14
15
  import TemplateActions from './template-actions';
15
16
  import TemplateAreas from './template-areas';
17
+ import LastRevision from './last-revision';
16
18
 
17
19
  export default function TemplateCard() {
18
20
  const {
@@ -38,20 +40,28 @@ export default function TemplateCard() {
38
40
  }
39
41
 
40
42
  return (
41
- <div className="edit-site-template-card">
42
- <Icon className="edit-site-template-card__icon" icon={ icon } />
43
- <div className="edit-site-template-card__content">
44
- <div className="edit-site-template-card__header">
45
- <h2 className="edit-site-template-card__title">
46
- { decodeEntities( title ) }
47
- </h2>
48
- <TemplateActions template={ template } />
43
+ <>
44
+ <div className="edit-site-template-card">
45
+ <Icon className="edit-site-template-card__icon" icon={ icon } />
46
+ <div className="edit-site-template-card__content">
47
+ <div className="edit-site-template-card__header">
48
+ <h2 className="edit-site-template-card__title">
49
+ { decodeEntities( title ) }
50
+ </h2>
51
+ <TemplateActions template={ template } />
52
+ </div>
53
+ <div className="edit-site-template-card__description">
54
+ { decodeEntities( description ) }
55
+ </div>
56
+ <TemplateAreas />
49
57
  </div>
50
- <div className="edit-site-template-card__description">
51
- { decodeEntities( description ) }
52
- </div>
53
- <TemplateAreas />
54
58
  </div>
55
- </div>
59
+ <PanelRow
60
+ header={ __( 'Editing history' ) }
61
+ className="edit-site-template-revisions"
62
+ >
63
+ <LastRevision />
64
+ </PanelRow>
65
+ </>
56
66
  );
57
67
  }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Button } from '@wordpress/components';
5
+ import { sprintf, _n } from '@wordpress/i18n';
6
+ import { backup } from '@wordpress/icons';
7
+ import { addQueryArgs } from '@wordpress/url';
8
+ import { PostTypeSupportCheck } from '@wordpress/editor';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import useEditedEntityRecord from '../../use-edited-entity-record';
14
+
15
+ const useRevisionData = () => {
16
+ const { record: currentTemplate } = useEditedEntityRecord();
17
+
18
+ const lastRevisionId =
19
+ currentTemplate?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;
20
+
21
+ const revisionsCount =
22
+ ( currentTemplate?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0 ) +
23
+ 1;
24
+
25
+ return {
26
+ currentTemplate,
27
+ lastRevisionId,
28
+ revisionsCount,
29
+ };
30
+ };
31
+
32
+ function PostLastRevisionCheck( { children } ) {
33
+ const { lastRevisionId, revisionsCount } = useRevisionData();
34
+
35
+ if ( ! lastRevisionId || revisionsCount < 2 ) {
36
+ return null;
37
+ }
38
+
39
+ return (
40
+ <PostTypeSupportCheck supportKeys="revisions">
41
+ { children }
42
+ </PostTypeSupportCheck>
43
+ );
44
+ }
45
+
46
+ const PostLastRevision = () => {
47
+ const { lastRevisionId, revisionsCount } = useRevisionData();
48
+
49
+ return (
50
+ <PostLastRevisionCheck>
51
+ <Button
52
+ href={ addQueryArgs( 'revision.php', {
53
+ revision: lastRevisionId,
54
+ gutenberg: true,
55
+ } ) }
56
+ className="edit-site-template-last-revision__title"
57
+ icon={ backup }
58
+ >
59
+ { sprintf(
60
+ /* translators: %d: number of revisions */
61
+ _n( '%d Revision', '%d Revisions', revisionsCount ),
62
+ revisionsCount
63
+ ) }
64
+ </Button>
65
+ </PostLastRevisionCheck>
66
+ );
67
+ };
68
+
69
+ export default function LastRevision() {
70
+ return (
71
+ <PostLastRevisionCheck>
72
+ <PostLastRevision />
73
+ </PostLastRevisionCheck>
74
+ );
75
+ }
@@ -59,6 +59,10 @@
59
59
  }
60
60
  }
61
61
 
62
+ .edit-site-template-revisions {
63
+ margin-left: math.div(-$grid-unit-10, 2);
64
+ }
65
+
62
66
  h3.edit-site-template-card__template-areas-title {
63
67
  font-weight: 500;
64
68
  margin: 0 0 $grid-unit-10;
@@ -4,19 +4,33 @@
4
4
  import {
5
5
  __experimentalHStack as HStack,
6
6
  __experimentalVStack as VStack,
7
- __experimentalNavigatorBackButton as NavigatorBackButton,
7
+ __experimentalNavigatorToParentButton as NavigatorToParentButton,
8
+ Button,
8
9
  __experimentalNavigatorScreen as NavigatorScreen,
9
10
  } from '@wordpress/components';
10
- import { isRTL, __, sprintf } from '@wordpress/i18n';
11
+ import { isRTL, __ } from '@wordpress/i18n';
11
12
  import { chevronRight, chevronLeft } from '@wordpress/icons';
13
+ import { useSelect } from '@wordpress/data';
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import { store as editSiteStore } from '../../store';
19
+ import { unlock } from '../../private-apis';
12
20
 
13
21
  export default function SidebarNavigationScreen( {
14
22
  path,
15
- parentTitle,
16
23
  title,
17
24
  actions,
18
25
  content,
19
26
  } ) {
27
+ const { dashboardLink } = useSelect( ( select ) => {
28
+ const { getSettings } = unlock( select( editSiteStore ) );
29
+ return {
30
+ dashboardLink: getSettings().__experimentalDashboardLink,
31
+ };
32
+ }, [] );
33
+
20
34
  return (
21
35
  <NavigatorScreen
22
36
  className="edit-site-sidebar-navigation-screen"
@@ -28,18 +42,20 @@ export default function SidebarNavigationScreen( {
28
42
  justify="flex-start"
29
43
  className="edit-site-sidebar-navigation-screen__title-icon"
30
44
  >
31
- { parentTitle ? (
32
- <NavigatorBackButton
45
+ { path !== '/' ? (
46
+ <NavigatorToParentButton
33
47
  className="edit-site-sidebar-navigation-screen__back"
34
48
  icon={ isRTL() ? chevronRight : chevronLeft }
35
- aria-label={ sprintf(
36
- /* translators: %s: previous page. */
37
- __( 'Navigate to the previous view: %s' ),
38
- parentTitle
39
- ) }
49
+ aria-label={ __( 'Back' ) }
40
50
  />
41
51
  ) : (
42
- <div className="edit-site-sidebar-navigation-screen__icon-placeholder" />
52
+ <Button
53
+ className="edit-site-sidebar-navigation-screen__back"
54
+ icon={ isRTL() ? chevronRight : chevronLeft }
55
+ aria-label={ __( 'Navigate to the Dashboard' ) }
56
+ href={ dashboardLink || 'index.php' }
57
+ label={ __( 'Dashboard' ) }
58
+ />
43
59
  ) }
44
60
  <h2 className="edit-site-sidebar-navigation-screen__title">
45
61
  { title }
@@ -7,13 +7,14 @@
7
7
 
8
8
  .edit-site-sidebar-navigation-screen__content {
9
9
  margin: 0 $grid-unit-20 $grid-unit-20 $button-size;
10
+ color: $gray-600;
10
11
  }
11
12
 
12
13
  .edit-site-sidebar-navigation-screen__title-icon {
13
14
  position: sticky;
14
15
  top: 0;
15
16
  background: $gray-900;
16
- padding-top: $grid-unit-60 + $hub-height + $canvas-padding * 2;
17
+ padding-top: $grid-unit-60 + $header-height;
17
18
  box-shadow: 0 $grid-unit-10 $grid-unit-20 $gray-900;
18
19
  margin-bottom: $grid-unit-10;
19
20
  padding-bottom: $grid-unit-10;
@@ -31,11 +32,8 @@
31
32
  .edit-site-sidebar-navigation-screen__back {
32
33
  color: $gray-200;
33
34
 
34
- &:hover {
35
+ &:hover,
36
+ &:not([aria-disabled="true"]):active {
35
37
  color: $white;
36
38
  }
37
39
  }
38
-
39
- .edit-site-sidebar-navigation-screen__icon-placeholder {
40
- width: $button-size;
41
- }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { Button } from '@wordpress/components';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+ import { decodeEntities } from '@wordpress/html-entities';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
14
+ import { unlock } from '../../private-apis';
15
+ import { store as editSiteStore } from '../../store';
16
+
17
+ export default function SidebarNavigationScreenNavigationItem() {
18
+ const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
19
+
20
+ const { post } = useSelect( ( select ) => {
21
+ const { getEditedPostContext } = select( editSiteStore );
22
+ const { getEntityRecord } = select( coreStore );
23
+ const { postType, postId } = getEditedPostContext() ?? {};
24
+
25
+ // The currently selected entity to display.
26
+ // Typically template or template part in the site editor.
27
+ return {
28
+ post:
29
+ postId && postType
30
+ ? getEntityRecord( 'postType', postType, postId )
31
+ : null,
32
+ };
33
+ }, [] );
34
+
35
+ return (
36
+ <SidebarNavigationScreen
37
+ path="/navigation/single"
38
+ title={ post ? decodeEntities( post?.title?.rendered ) : null }
39
+ actions={
40
+ <Button
41
+ variant="primary"
42
+ onClick={ () => setCanvasMode( 'edit' ) }
43
+ >
44
+ { __( 'Edit' ) }
45
+ </Button>
46
+ }
47
+ content={
48
+ post ? decodeEntities( post?.description?.rendered ) : null
49
+ }
50
+ />
51
+ );
52
+ }
@@ -25,6 +25,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
25
25
  history.push( {
26
26
  postType: attributes.type,
27
27
  postId: attributes.id,
28
+ path: '/navigation/single',
28
29
  } );
29
30
  }
30
31
  },
@@ -33,7 +34,6 @@ export default function SidebarNavigationScreenNavigationMenus() {
33
34
  return (
34
35
  <SidebarNavigationScreen
35
36
  path="/navigation"
36
- parentTitle={ __( 'Design' ) }
37
37
  title={ __( 'Navigation' ) }
38
38
  content={
39
39
  <div className="edit-site-sidebar-navigation-screen-navigation-menus">
@@ -1,8 +1,4 @@
1
1
  .edit-site-sidebar-navigation-screen-navigation-menus {
2
- .block-editor-list-view-block__menu-edit,
3
- .edit-site-navigation-inspector__select-menu {
4
- display: none;
5
- }
6
2
  .offcanvas-editor-list-view-leaf {
7
3
  max-width: calc(100% - #{ $grid-unit-05 });
8
4
  }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useDispatch } from '@wordpress/data';
6
+ import { Button } from '@wordpress/components';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
+ import useEditedEntityRecord from '../use-edited-entity-record';
13
+ import { unlock } from '../../private-apis';
14
+ import { store as editSiteStore } from '../../store';
15
+
16
+ const config = {
17
+ wp_template: {
18
+ path: '/templates/single',
19
+ },
20
+ wp_template_part: {
21
+ path: '/template-parts/single',
22
+ },
23
+ };
24
+
25
+ export default function SidebarNavigationScreenTemplate( {
26
+ postType = 'wp_template',
27
+ } ) {
28
+ const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
29
+ const { getDescription, getTitle, record } = useEditedEntityRecord();
30
+ let description = getDescription();
31
+ if ( ! description && record.is_custom ) {
32
+ description = __(
33
+ 'This is a custom template that can be applied manually to any Post or Page.'
34
+ );
35
+ }
36
+
37
+ return (
38
+ <SidebarNavigationScreen
39
+ path={ config[ postType ].path }
40
+ title={ getTitle() }
41
+ actions={
42
+ <Button
43
+ variant="primary"
44
+ onClick={ () => setCanvasMode( 'edit' ) }
45
+ >
46
+ { __( 'Edit' ) }
47
+ </Button>
48
+ }
49
+ content={ description ? <p>{ description }</p> : undefined }
50
+ />
51
+ );
52
+ }