@wordpress/edit-site 5.30.0 → 5.31.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 (305) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/actions/index.js +2 -4
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/block-editor/editor-canvas.js +16 -3
  5. package/build/components/block-editor/editor-canvas.js.map +1 -1
  6. package/build/components/block-editor/use-site-editor-settings.js +1 -1
  7. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  8. package/build/components/global-styles/color-palette-panel.js +0 -9
  9. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  10. package/build/components/global-styles/font-library-modal/context.js +15 -8
  11. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  12. package/build/components/global-styles/font-library-modal/font-collection.js +4 -3
  13. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +3 -2
  15. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  17. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/upload-fonts.js +44 -10
  19. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/utils/index.js +2 -2
  21. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
  23. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  24. package/build/components/global-styles/header.js +1 -1
  25. package/build/components/global-styles/header.js.map +1 -1
  26. package/build/components/global-styles/hooks.js +50 -1
  27. package/build/components/global-styles/hooks.js.map +1 -1
  28. package/build/components/global-styles/preview-iframe.js +0 -1
  29. package/build/components/global-styles/preview-iframe.js.map +1 -1
  30. package/build/components/global-styles/preview-styles.js +2 -2
  31. package/build/components/global-styles/preview-styles.js.map +1 -1
  32. package/build/components/global-styles/screen-colors.js +2 -9
  33. package/build/components/global-styles/screen-colors.js.map +1 -1
  34. package/build/components/global-styles/screen-typography.js +1 -6
  35. package/build/components/global-styles/screen-typography.js.map +1 -1
  36. package/build/components/global-styles/typography-elements.js +3 -1
  37. package/build/components/global-styles/typography-elements.js.map +1 -1
  38. package/build/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
  39. package/build/components/global-styles/typography-example.js.map +1 -0
  40. package/build/components/global-styles/typography-preview.js +3 -1
  41. package/build/components/global-styles/typography-preview.js.map +1 -1
  42. package/build/components/global-styles/utils.js +1 -1
  43. package/build/components/global-styles/utils.js.map +1 -1
  44. package/build/components/global-styles/variations/variations-color.js +8 -9
  45. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  46. package/build/components/global-styles/variations/variations-typography.js +27 -37
  47. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  48. package/build/components/header-edit-mode/index.js +2 -1
  49. package/build/components/header-edit-mode/index.js.map +1 -1
  50. package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
  51. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  52. package/build/components/keyboard-shortcuts/global.js +17 -3
  53. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  54. package/build/components/layout/router.js +2 -5
  55. package/build/components/layout/router.js.map +1 -1
  56. package/build/components/page-pages/index.js +6 -11
  57. package/build/components/page-pages/index.js.map +1 -1
  58. package/build/components/page-patterns/delete-category-menu-item.js +6 -1
  59. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  60. package/build/components/page-patterns/index.js +1 -4
  61. package/build/components/page-patterns/index.js.map +1 -1
  62. package/build/components/page-patterns/use-patterns.js +9 -9
  63. package/build/components/page-patterns/use-patterns.js.map +1 -1
  64. package/build/components/page-templates-template-parts/index.js +11 -16
  65. package/build/components/page-templates-template-parts/index.js.map +1 -1
  66. package/build/components/save-panel/index.js +14 -9
  67. package/build/components/save-panel/index.js.map +1 -1
  68. package/build/components/sidebar/index.js +2 -3
  69. package/build/components/sidebar/index.js.map +1 -1
  70. package/build/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  71. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  72. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  73. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  74. package/build/components/sidebar-dataviews/default-views.js +2 -2
  75. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  76. package/build/components/sidebar-dataviews/index.js +4 -3
  77. package/build/components/sidebar-dataviews/index.js.map +1 -1
  78. package/build/components/sidebar-edit-mode/page-panels/index.js +2 -2
  79. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  80. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
  81. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  82. package/build/components/sidebar-edit-mode/sidebar-card/index.js +12 -6
  83. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
  84. package/build/components/sidebar-edit-mode/template-panel/index.js +23 -3
  85. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  86. package/build/components/sidebar-navigation-screen-global-styles/index.js +13 -1
  87. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  88. package/build/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +4 -5
  89. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
  90. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
  91. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  92. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  94. package/build/components/sidebar-navigation-screen-template/index.js +5 -1
  95. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  96. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  97. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  98. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  99. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  100. package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
  101. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  102. package/build/components/template-actions/index.js +44 -27
  103. package/build/components/template-actions/index.js.map +1 -1
  104. package/build/components/welcome-guide/editor.js +11 -2
  105. package/build/components/welcome-guide/editor.js.map +1 -1
  106. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
  107. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  108. package/build/utils/constants.js +5 -3
  109. package/build/utils/constants.js.map +1 -1
  110. package/build/utils/get-is-list-page.js +1 -1
  111. package/build/utils/get-is-list-page.js.map +1 -1
  112. package/build/utils/math.js +98 -0
  113. package/build/utils/math.js.map +1 -0
  114. package/build-module/components/actions/index.js +3 -5
  115. package/build-module/components/actions/index.js.map +1 -1
  116. package/build-module/components/block-editor/editor-canvas.js +16 -3
  117. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  118. package/build-module/components/block-editor/use-site-editor-settings.js +1 -1
  119. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  120. package/build-module/components/global-styles/color-palette-panel.js +0 -8
  121. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  122. package/build-module/components/global-styles/font-library-modal/context.js +16 -9
  123. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  124. package/build-module/components/global-styles/font-library-modal/font-collection.js +4 -3
  125. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  126. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +4 -3
  127. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  128. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  129. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  130. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +44 -10
  131. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  132. package/build-module/components/global-styles/font-library-modal/utils/index.js +2 -2
  133. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  134. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
  135. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  136. package/build-module/components/global-styles/header.js +1 -1
  137. package/build-module/components/global-styles/header.js.map +1 -1
  138. package/build-module/components/global-styles/hooks.js +48 -1
  139. package/build-module/components/global-styles/hooks.js.map +1 -1
  140. package/build-module/components/global-styles/preview-iframe.js +0 -1
  141. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  142. package/build-module/components/global-styles/preview-styles.js +2 -2
  143. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  144. package/build-module/components/global-styles/screen-colors.js +2 -9
  145. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  146. package/build-module/components/global-styles/screen-typography.js +1 -6
  147. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  148. package/build-module/components/global-styles/typography-elements.js +3 -1
  149. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  150. package/build-module/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
  151. package/build-module/components/global-styles/typography-example.js.map +1 -0
  152. package/build-module/components/global-styles/typography-preview.js +3 -1
  153. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  154. package/build-module/components/global-styles/utils.js +1 -1
  155. package/build-module/components/global-styles/utils.js.map +1 -1
  156. package/build-module/components/global-styles/variations/variations-color.js +8 -9
  157. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  158. package/build-module/components/global-styles/variations/variations-typography.js +28 -38
  159. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  160. package/build-module/components/header-edit-mode/index.js +2 -1
  161. package/build-module/components/header-edit-mode/index.js.map +1 -1
  162. package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
  163. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  164. package/build-module/components/keyboard-shortcuts/global.js +17 -3
  165. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  166. package/build-module/components/layout/router.js +2 -5
  167. package/build-module/components/layout/router.js.map +1 -1
  168. package/build-module/components/page-pages/index.js +7 -12
  169. package/build-module/components/page-pages/index.js.map +1 -1
  170. package/build-module/components/page-patterns/delete-category-menu-item.js +6 -1
  171. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  172. package/build-module/components/page-patterns/index.js +2 -5
  173. package/build-module/components/page-patterns/index.js.map +1 -1
  174. package/build-module/components/page-patterns/use-patterns.js +9 -9
  175. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  176. package/build-module/components/page-templates-template-parts/index.js +12 -17
  177. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  178. package/build-module/components/save-panel/index.js +14 -9
  179. package/build-module/components/save-panel/index.js.map +1 -1
  180. package/build-module/components/sidebar/index.js +2 -3
  181. package/build-module/components/sidebar/index.js.map +1 -1
  182. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  183. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  184. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  185. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  186. package/build-module/components/sidebar-dataviews/default-views.js +3 -3
  187. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  188. package/build-module/components/sidebar-dataviews/index.js +4 -3
  189. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  190. package/build-module/components/sidebar-edit-mode/page-panels/index.js +3 -3
  191. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  192. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
  193. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  194. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +13 -7
  195. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
  196. package/build-module/components/sidebar-edit-mode/template-panel/index.js +24 -4
  197. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +14 -2
  199. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  200. package/build-module/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
  201. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
  202. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
  203. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  204. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  205. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  206. package/build-module/components/sidebar-navigation-screen-template/index.js +5 -1
  207. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  208. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  209. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  210. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  211. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  212. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
  213. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  214. package/build-module/components/template-actions/index.js +44 -27
  215. package/build-module/components/template-actions/index.js.map +1 -1
  216. package/build-module/components/welcome-guide/editor.js +11 -2
  217. package/build-module/components/welcome-guide/editor.js.map +1 -1
  218. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
  219. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  220. package/build-module/utils/constants.js +4 -2
  221. package/build-module/utils/constants.js.map +1 -1
  222. package/build-module/utils/get-is-list-page.js +1 -1
  223. package/build-module/utils/get-is-list-page.js.map +1 -1
  224. package/build-module/utils/math.js +92 -0
  225. package/build-module/utils/math.js.map +1 -0
  226. package/build-style/style-rtl.css +41 -37
  227. package/build-style/style.css +41 -37
  228. package/package.json +42 -42
  229. package/src/components/actions/index.js +3 -5
  230. package/src/components/block-editor/editor-canvas.js +20 -7
  231. package/src/components/block-editor/use-site-editor-settings.js +0 -2
  232. package/src/components/global-styles/color-palette-panel.js +0 -11
  233. package/src/components/global-styles/font-library-modal/context.js +34 -17
  234. package/src/components/global-styles/font-library-modal/font-collection.js +4 -3
  235. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
  236. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  237. package/src/components/global-styles/font-library-modal/style.scss +14 -5
  238. package/src/components/global-styles/font-library-modal/upload-fonts.js +53 -8
  239. package/src/components/global-styles/font-library-modal/utils/index.js +4 -4
  240. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +4 -0
  241. package/src/components/global-styles/header.js +1 -1
  242. package/src/components/global-styles/hooks.js +68 -1
  243. package/src/components/global-styles/preview-iframe.js +0 -1
  244. package/src/components/global-styles/preview-styles.js +2 -2
  245. package/src/components/global-styles/screen-colors.js +2 -13
  246. package/src/components/global-styles/screen-typography.js +1 -12
  247. package/src/components/global-styles/style.scss +4 -1
  248. package/src/components/global-styles/typography-elements.js +5 -1
  249. package/src/components/global-styles/{preview-typography.js → typography-example.js} +3 -1
  250. package/src/components/global-styles/typography-preview.js +3 -1
  251. package/src/components/global-styles/utils.js +1 -1
  252. package/src/components/global-styles/variations/style.scss +0 -6
  253. package/src/components/global-styles/variations/variations-color.js +9 -5
  254. package/src/components/global-styles/variations/variations-typography.js +37 -59
  255. package/src/components/header-edit-mode/index.js +1 -0
  256. package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
  257. package/src/components/keyboard-shortcuts/global.js +16 -4
  258. package/src/components/layout/router.js +2 -7
  259. package/src/components/page-pages/index.js +8 -13
  260. package/src/components/page-patterns/delete-category-menu-item.js +7 -0
  261. package/src/components/page-patterns/index.js +2 -3
  262. package/src/components/page-patterns/use-patterns.js +17 -10
  263. package/src/components/page-templates-template-parts/index.js +14 -22
  264. package/src/components/save-panel/index.js +24 -17
  265. package/src/components/sidebar/index.js +2 -3
  266. package/src/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  267. package/src/components/sidebar-dataviews/dataview-item.js +2 -2
  268. package/src/components/sidebar-dataviews/default-views.js +11 -3
  269. package/src/components/sidebar-dataviews/index.js +4 -3
  270. package/src/components/sidebar-edit-mode/page-panels/index.js +2 -2
  271. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  272. package/src/components/sidebar-edit-mode/sidebar-card/index.js +30 -11
  273. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +10 -11
  274. package/src/components/sidebar-edit-mode/template-panel/index.js +24 -5
  275. package/src/components/sidebar-navigation-screen/style.scss +10 -1
  276. package/src/components/sidebar-navigation-screen-global-styles/index.js +35 -2
  277. package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +2 -3
  278. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
  279. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
  280. package/src/components/sidebar-navigation-screen-template/index.js +6 -1
  281. package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  282. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  283. package/src/components/sync-state-with-url/use-sync-path-with-url.js +3 -19
  284. package/src/components/template-actions/index.js +63 -46
  285. package/src/components/welcome-guide/editor.js +9 -6
  286. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +21 -4
  287. package/src/style.scss +0 -1
  288. package/src/utils/constants.js +4 -2
  289. package/src/utils/get-is-list-page.js +1 -1
  290. package/src/utils/math.js +93 -0
  291. package/build/components/global-styles/preview-typography.js.map +0 -1
  292. package/build/components/sidebar-edit-mode/template-panel/template-actions.js +0 -50
  293. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
  294. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
  295. package/build/components/sidebar-navigation-screen-templates/index.js +0 -132
  296. package/build/components/sidebar-navigation-screen-templates/index.js.map +0 -1
  297. package/build-module/components/global-styles/preview-typography.js.map +0 -1
  298. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +0 -42
  299. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
  300. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
  301. package/build-module/components/sidebar-navigation-screen-templates/index.js +0 -124
  302. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +0 -1
  303. package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
  304. package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
  305. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
@@ -25,6 +25,7 @@ export default function DataViewsSidebarContent() {
25
25
  if ( ! path || ! PATH_TO_TYPE[ path ] ) {
26
26
  return null;
27
27
  }
28
+ const isCustomBoolean = isCustom === 'true';
28
29
  const type = PATH_TO_TYPE[ path ];
29
30
 
30
31
  return (
@@ -39,10 +40,10 @@ export default function DataViewsSidebarContent() {
39
40
  icon={ dataview.icon }
40
41
  type={ dataview.view.type }
41
42
  isActive={
42
- isCustom === 'false' &&
43
+ ! isCustomBoolean &&
43
44
  dataview.slug === activeView
44
45
  }
45
- isCustom="false"
46
+ isCustom={ false }
46
47
  />
47
48
  );
48
49
  } ) }
@@ -51,7 +52,7 @@ export default function DataViewsSidebarContent() {
51
52
  <CustomDataViewsList
52
53
  activeView={ activeView }
53
54
  type={ type }
54
- isCustom="true"
55
+ isCustom
55
56
  />
56
57
  ) }
57
58
  </>
@@ -14,9 +14,9 @@ import { store as coreStore } from '@wordpress/core-data';
14
14
  import { decodeEntities } from '@wordpress/html-entities';
15
15
  import {
16
16
  PageAttributesPanel,
17
+ PluginDocumentSettingPanel,
17
18
  PostDiscussionPanel,
18
19
  PostExcerptPanel,
19
- PostFeaturedImagePanel,
20
20
  PostLastRevisionPanel,
21
21
  PostTaxonomiesPanel,
22
22
  store as editorStore,
@@ -97,6 +97,7 @@ export default function PagePanels() {
97
97
  postType={ type }
98
98
  />
99
99
  </PanelBody>
100
+ <PluginDocumentSettingPanel.Slot />
100
101
  { renderingMode !== 'post-only' && (
101
102
  <PanelBody title={ __( 'Content' ) }>
102
103
  <PageContent />
@@ -104,7 +105,6 @@ export default function PagePanels() {
104
105
  ) }
105
106
  <PostLastRevisionPanel />
106
107
  <PostTaxonomiesPanel />
107
- <PostFeaturedImagePanel />
108
108
  <PostExcerptPanel />
109
109
  <PostDiscussionPanel />
110
110
  <PageAttributesPanel />
@@ -7,6 +7,7 @@ import {
7
7
  PostURLPanel,
8
8
  PostSchedulePanel,
9
9
  PostTemplatePanel,
10
+ PostFeaturedImagePanel,
10
11
  } from '@wordpress/editor';
11
12
 
12
13
  /**
@@ -23,6 +24,7 @@ export default function PageSummary( {
23
24
  } ) {
24
25
  return (
25
26
  <VStack spacing={ 0 }>
27
+ <PostFeaturedImagePanel withPanelBody={ false } />
26
28
  <PageStatus
27
29
  status={ status }
28
30
  date={ date }
@@ -6,7 +6,12 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { Icon } from '@wordpress/components';
9
+ import {
10
+ Icon,
11
+ __experimentalText as Text,
12
+ __experimentalHStack as HStack,
13
+ __experimentalVStack as VStack,
14
+ } from '@wordpress/components';
10
15
 
11
16
  export default function SidebarCard( {
12
17
  className,
@@ -18,17 +23,31 @@ export default function SidebarCard( {
18
23
  } ) {
19
24
  return (
20
25
  <div className={ classnames( 'edit-site-sidebar-card', className ) }>
21
- <Icon className="edit-site-sidebar-card__icon" icon={ icon } />
22
- <div className="edit-site-sidebar-card__content">
23
- <div className="edit-site-sidebar-card__header">
24
- <h2 className="edit-site-sidebar-card__title">{ title }</h2>
25
- { actions }
26
- </div>
27
- <div className="edit-site-sidebar-card__description">
28
- { description }
29
- </div>
26
+ <HStack
27
+ spacing={ 2 }
28
+ className="edit-site-sidebar-card__header"
29
+ align="flex-start"
30
+ >
31
+ <Icon className="edit-site-sidebar-card__icon" icon={ icon } />
32
+ <Text
33
+ numberOfLines={ 2 }
34
+ truncate
35
+ className="edit-site-sidebar-card__title"
36
+ weight={ 500 }
37
+ as="h2"
38
+ >
39
+ { title }
40
+ </Text>
41
+ { actions }
42
+ </HStack>
43
+ <VStack className="edit-site-sidebar-card__content">
44
+ { description && (
45
+ <div className="edit-site-sidebar-card__description">
46
+ { description }
47
+ </div>
48
+ ) }
30
49
  { children }
31
- </div>
50
+ </VStack>
32
51
  </div>
33
52
  );
34
53
  }
@@ -1,30 +1,25 @@
1
1
  .edit-site-sidebar-card {
2
- display: flex;
3
- align-items: flex-start;
4
-
5
2
  &__content {
6
3
  flex-grow: 1;
7
- margin-bottom: $grid-unit-05;
8
4
  }
9
5
 
10
6
  &__title {
11
- font-weight: 500;
12
- line-height: $icon-size;
7
+ width: 100%;
8
+
13
9
  &.edit-site-sidebar-card__title {
14
- font-size: $default-font-size;
15
- line-height: $default-line-height;
10
+ font-size: 16px;
11
+ line-height: $icon-size;
16
12
  margin: 0;
17
- padding: 3px 0; // This makes the title as high as the icon.
18
13
  }
19
14
  }
20
15
 
21
16
  &__description {
22
17
  font-size: $default-font-size;
18
+ color: $gray-700;
23
19
  }
24
20
 
25
21
  &__icon {
26
22
  flex: 0 0 $icon-size;
27
- margin-right: $grid-unit-15;
28
23
  width: $icon-size;
29
24
  height: $icon-size;
30
25
  }
@@ -32,6 +27,10 @@
32
27
  &__header {
33
28
  display: flex;
34
29
  justify-content: space-between;
35
- margin: 0 0 $grid-unit-05;
30
+ margin: 0 0 $grid-unit-15;
31
+ }
32
+
33
+ .edit-site-template-card__actions {
34
+ flex-shrink: 0;
36
35
  }
37
36
  }
@@ -7,7 +7,6 @@ import {
7
7
  PageAttributesPanel,
8
8
  PostDiscussionPanel,
9
9
  PostExcerptPanel,
10
- PostFeaturedImagePanel,
11
10
  PostLastRevisionPanel,
12
11
  PostTaxonomiesPanel,
13
12
  store as editorStore,
@@ -19,16 +18,20 @@ import { __ } from '@wordpress/i18n';
19
18
  import { useAsyncList } from '@wordpress/compose';
20
19
  import { serialize } from '@wordpress/blocks';
21
20
  import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
21
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
22
22
 
23
23
  /**
24
24
  * Internal dependencies
25
25
  */
26
26
  import { store as editSiteStore } from '../../../store';
27
- import TemplateActions from './template-actions';
27
+ import TemplateActions from '../../template-actions';
28
28
  import TemplateAreas from './template-areas';
29
29
  import SidebarCard from '../sidebar-card';
30
30
  import { useAvailablePatterns } from './hooks';
31
31
  import { TEMPLATE_PART_POST_TYPE } from '../../../utils/constants';
32
+ import { unlock } from '../../../lock-unlock';
33
+
34
+ const { useHistory } = unlock( routerPrivateApis );
32
35
 
33
36
  const CARD_ICONS = {
34
37
  wp_block: symbol,
@@ -52,6 +55,11 @@ function TemplatesList( { availableTemplates, onSelect } ) {
52
55
  );
53
56
  }
54
57
 
58
+ const POST_TYPE_PATH = {
59
+ wp_template: '/wp_template',
60
+ wp_template_part: '/wp_template_part/all',
61
+ };
62
+
55
63
  export default function TemplatePanel() {
56
64
  const { title, description, icon, record, postType, postId } = useSelect(
57
65
  ( select ) => {
@@ -77,7 +85,7 @@ export default function TemplatePanel() {
77
85
  },
78
86
  []
79
87
  );
80
-
88
+ const history = useHistory();
81
89
  const availablePatterns = useAvailablePatterns( record );
82
90
  const { editEntityRecord } = useDispatch( coreStore );
83
91
 
@@ -100,7 +108,19 @@ export default function TemplatePanel() {
100
108
  title={ decodeEntities( title ) }
101
109
  icon={ CARD_ICONS[ record?.type ] ?? icon }
102
110
  description={ decodeEntities( description ) }
103
- actions={ <TemplateActions template={ record } /> }
111
+ actions={
112
+ <TemplateActions
113
+ postType={ postType }
114
+ postId={ postId }
115
+ className="edit-site-template-card__actions"
116
+ toggleProps={ { size: 'small' } }
117
+ onRemove={ () => {
118
+ history.push( {
119
+ path: POST_TYPE_PATH[ postType ],
120
+ } );
121
+ } }
122
+ />
123
+ }
104
124
  >
105
125
  <TemplateAreas />
106
126
  </SidebarCard>
@@ -126,7 +146,6 @@ export default function TemplatePanel() {
126
146
  ) }
127
147
  <PostLastRevisionPanel />
128
148
  <PostTaxonomiesPanel />
129
- <PostFeaturedImagePanel />
130
149
  <PostExcerptPanel />
131
150
  <PostDiscussionPanel />
132
151
  <PageAttributesPanel />
@@ -77,7 +77,7 @@
77
77
  flex-shrink: 0;
78
78
  }
79
79
 
80
- .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
80
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-variation-container {
81
81
  @include break-medium() {
82
82
  // Safari does not currently support `scrollbar-gutter: stable`, so at
83
83
  // particular viewport sizes it's possible for previews to render prior to a
@@ -90,7 +90,16 @@
90
90
  // See: https://github.com/WordPress/gutenberg/issues/55112
91
91
  max-width: 292px;
92
92
  }
93
+ }
94
+
95
+ .edit-site-global-styles-variation-title {
96
+ color: $gray-300;
97
+ font-size: 11px;
98
+ text-transform: uppercase;
99
+ font-weight: 500;
100
+ }
93
101
 
102
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
94
103
  .edit-site-global-styles-variations_item-preview {
95
104
  box-shadow: 0 0 0 $border-width $gray-900;
96
105
  }
@@ -5,7 +5,10 @@ import { __ } from '@wordpress/i18n';
5
5
  import { edit, seen } from '@wordpress/icons';
6
6
  import { useSelect, useDispatch } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
- import { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';
8
+ import {
9
+ __experimentalNavigatorButton as NavigatorButton,
10
+ __experimentalVStack as VStack,
11
+ } from '@wordpress/components';
9
12
  import { useViewportMatch } from '@wordpress/compose';
10
13
  import { BlockEditorProvider } from '@wordpress/block-editor';
11
14
  import { useCallback } from '@wordpress/element';
@@ -24,6 +27,12 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
24
27
  import StyleBook from '../style-book';
25
28
  import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
26
29
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
30
+ import ColorVariations from '../global-styles/variations/variations-color';
31
+ import TypographyVariations from '../global-styles/variations/variations-typography';
32
+ import {
33
+ useColorVariations,
34
+ useTypographyVariations,
35
+ } from '../global-styles/hooks';
27
36
 
28
37
  const noop = () => {};
29
38
 
@@ -69,6 +78,9 @@ function SidebarNavigationScreenGlobalStylesContent() {
69
78
  };
70
79
  }, [] );
71
80
 
81
+ const colorVariations = useColorVariations();
82
+ const typographyVariations = useTypographyVariations();
83
+
72
84
  // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
73
85
  // loaded. This is necessary because the Iframe component waits until
74
86
  // the block editor store's `__internalIsInitialized` is true before
@@ -80,7 +92,28 @@ function SidebarNavigationScreenGlobalStylesContent() {
80
92
  onChange={ noop }
81
93
  onInput={ noop }
82
94
  >
83
- <StyleVariationsContainer />
95
+ <VStack
96
+ spacing={ 10 }
97
+ className="edit-site-global-styles-variation-container"
98
+ >
99
+ <StyleVariationsContainer />
100
+ { colorVariations?.length && (
101
+ <div>
102
+ <h3 className="edit-site-global-styles-variation-title">
103
+ { __( 'Colors' ) }
104
+ </h3>
105
+ <ColorVariations />
106
+ </div>
107
+ ) }
108
+ { typographyVariations?.length && (
109
+ <div>
110
+ <h3 className="edit-site-global-styles-variation-title">
111
+ { __( 'Typography' ) }
112
+ </h3>
113
+ <TypographyVariations />
114
+ </div>
115
+ ) }
116
+ </VStack>
84
117
  </BlockEditorProvider>
85
118
  );
86
119
  }
@@ -4,12 +4,11 @@
4
4
  import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
- export default function RenameModal( { onClose, onConfirm } ) {
7
+ export default function DeleteConfirmDialog( { onClose, onConfirm } ) {
8
8
  return (
9
9
  <ConfirmDialog
10
10
  isOpen
11
- onConfirm={ ( e ) => {
12
- e.preventDefault();
11
+ onConfirm={ () => {
13
12
  onConfirm();
14
13
 
15
14
  // Immediate close avoids ability to hit delete multiple times.
@@ -10,7 +10,7 @@ import { useState } from '@wordpress/element';
10
10
  * Internal dependencies
11
11
  */
12
12
  import RenameModal from './rename-modal';
13
- import DeleteModal from './delete-modal';
13
+ import DeleteConfirmDialog from './delete-confirm-dialog';
14
14
 
15
15
  const POPOVER_PROPS = {
16
16
  position: 'bottom right',
@@ -20,14 +20,15 @@ export default function ScreenNavigationMoreMenu( props ) {
20
20
  const { onDelete, onSave, onDuplicate, menuTitle } = props;
21
21
 
22
22
  const [ renameModalOpen, setRenameModalOpen ] = useState( false );
23
- const [ deleteModalOpen, setDeleteModalOpen ] = useState( false );
23
+ const [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =
24
+ useState( false );
24
25
 
25
26
  const closeModals = () => {
26
27
  setRenameModalOpen( false );
27
- setDeleteModalOpen( false );
28
+ setDeleteConfirmDialogOpen( false );
28
29
  };
29
30
  const openRenameModal = () => setRenameModalOpen( true );
30
- const openDeleteModal = () => setDeleteModalOpen( true );
31
+ const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );
31
32
 
32
33
  return (
33
34
  <>
@@ -60,7 +61,7 @@ export default function ScreenNavigationMoreMenu( props ) {
60
61
  <MenuItem
61
62
  isDestructive
62
63
  onClick={ () => {
63
- openDeleteModal();
64
+ openDeleteConfirmDialog();
64
65
 
65
66
  // Close the dropdown after opening the modal.
66
67
  onClose();
@@ -72,11 +73,12 @@ export default function ScreenNavigationMoreMenu( props ) {
72
73
  </div>
73
74
  ) }
74
75
  </DropdownMenu>
75
-
76
- { deleteModalOpen && (
77
- <DeleteModal onClose={ closeModals } onConfirm={ onDelete } />
76
+ { deleteConfirmDialogOpen && (
77
+ <DeleteConfirmDialog
78
+ onClose={ closeModals }
79
+ onConfirm={ onDelete }
80
+ />
78
81
  ) }
79
-
80
82
  { renameModalOpen && (
81
83
  <RenameModal
82
84
  onClose={ closeModals }
@@ -35,9 +35,12 @@ function useDeleteNavigationMenu() {
35
35
  throwOnError: true,
36
36
  }
37
37
  );
38
- createSuccessNotice( __( 'Deleted Navigation menu' ), {
39
- type: 'snackbar',
40
- } );
38
+ createSuccessNotice(
39
+ __( 'Navigation menu successfully deleted.' ),
40
+ {
41
+ type: 'snackbar',
42
+ }
43
+ );
41
44
  goTo( '/navigation' );
42
45
  } catch ( error ) {
43
46
  createErrorNotice(
@@ -93,6 +93,11 @@ function useTemplateDetails( postType, postId ) {
93
93
  return { title, description, content, footer };
94
94
  }
95
95
 
96
+ const POST_TYPE_PATH = {
97
+ wp_template: '/wp_template',
98
+ wp_template_part: '/wp_template_part/all',
99
+ };
100
+
96
101
  export default function SidebarNavigationScreenTemplate() {
97
102
  const navigator = useNavigator();
98
103
  const {
@@ -114,7 +119,7 @@ export default function SidebarNavigationScreenTemplate() {
114
119
  postId={ postId }
115
120
  toggleProps={ { as: SidebarButton } }
116
121
  onRemove={ () => {
117
- navigator.goTo( `/${ postType }/all` );
122
+ navigator.goTo( POST_TYPE_PATH[ postType ] );
118
123
  } }
119
124
  />
120
125
  <SidebarButton
@@ -23,7 +23,7 @@ function TemplateDataviewItem( { template, isActive } ) {
23
23
  title={ text }
24
24
  icon={ icon }
25
25
  isActive={ isActive }
26
- isCustom="false"
26
+ isCustom={ false }
27
27
  />
28
28
  );
29
29
  }
@@ -57,7 +57,7 @@ export default function DataviewsTemplatesSidebarContent( {
57
57
  title={ title }
58
58
  icon={ layout }
59
59
  isActive={ activeView === 'all' }
60
- isCustom="false"
60
+ isCustom={ false }
61
61
  />
62
62
  { firstItemPerAuthorText.map( ( template ) => {
63
63
  return (
@@ -207,7 +207,7 @@ function useResolveEditedEntityAndContext( { path, postId, postType } ) {
207
207
  return {};
208
208
  }, [ homepageId, postType, postId, path ] );
209
209
 
210
- if ( path === '/wp_template/all' && postId ) {
210
+ if ( path === '/wp_template' && postId ) {
211
211
  return { isReady: true, postType: 'wp_template', postId, context };
212
212
  }
213
213
 
@@ -101,28 +101,12 @@ export default function useSyncPathWithURL() {
101
101
  canvas: undefined,
102
102
  path: navigatorLocation.path,
103
103
  } );
104
- } else if (
105
- navigatorLocation.path === '/wp_template/all' &&
106
- ! window?.__experimentalAdminViews
107
- ) {
108
- // When the experiment is disabled, we only support table layout.
109
- // Clear it out from the URL, so layouts other than table cannot be accessed.
110
- updateUrlParams( {
111
- postType: undefined,
112
- categoryType: undefined,
113
- categoryId: undefined,
114
- path: navigatorLocation.path,
115
- layout: undefined,
116
- } );
117
104
  } else if (
118
105
  // These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has.
119
106
  // The "type" property should be kept as well.
120
- ( navigatorLocation.path === '/pages' &&
121
- window?.__experimentalAdminViews ) ||
122
- ( navigatorLocation.path === '/wp_template/all' &&
123
- window?.__experimentalAdminViews ) ||
124
- ( navigatorLocation.path === '/wp_template_part/all' &&
125
- window?.__experimentalAdminViews )
107
+ navigatorLocation.path === '/pages' ||
108
+ navigatorLocation.path === '/wp_template' ||
109
+ navigatorLocation.path === '/wp_template_part/all'
126
110
  ) {
127
111
  updateUrlParams( {
128
112
  postType: undefined,
@@ -36,10 +36,7 @@ export default function TemplateActions( {
36
36
  select( coreStore ).getEntityRecord( 'postType', postType, postId ),
37
37
  [ postType, postId ]
38
38
  );
39
- const { removeTemplate, revertTemplate } = useDispatch( editSiteStore );
40
- const { saveEditedEntityRecord } = useDispatch( coreStore );
41
- const { createSuccessNotice, createErrorNotice } =
42
- useDispatch( noticesStore );
39
+ const { removeTemplate } = useDispatch( editSiteStore );
43
40
  const isRemovable = isTemplateRemovable( template );
44
41
  const isRevertable = isTemplateRevertable( template );
45
42
 
@@ -47,6 +44,49 @@ export default function TemplateActions( {
47
44
  return null;
48
45
  }
49
46
 
47
+ return (
48
+ <DropdownMenu
49
+ icon={ moreVertical }
50
+ label={ __( 'Actions' ) }
51
+ className={ className }
52
+ toggleProps={ toggleProps }
53
+ >
54
+ { ( { onClose } ) => (
55
+ <MenuGroup>
56
+ { isRemovable && (
57
+ <>
58
+ <RenameMenuItem
59
+ template={ template }
60
+ onClose={ onClose }
61
+ />
62
+ <DeleteMenuItem
63
+ onRemove={ () => {
64
+ removeTemplate( template );
65
+ onRemove?.();
66
+ onClose();
67
+ } }
68
+ title={ template.title.rendered }
69
+ />
70
+ </>
71
+ ) }
72
+ { isRevertable && (
73
+ <ResetMenuItem
74
+ template={ template }
75
+ onClose={ onClose }
76
+ />
77
+ ) }
78
+ </MenuGroup>
79
+ ) }
80
+ </DropdownMenu>
81
+ );
82
+ }
83
+
84
+ function ResetMenuItem( { template, onClose } ) {
85
+ const [ isModalOpen, setIsModalOpen ] = useState( false );
86
+ const { revertTemplate } = useDispatch( editSiteStore );
87
+ const { saveEditedEntityRecord } = useDispatch( coreStore );
88
+ const { createSuccessNotice, createErrorNotice } =
89
+ useDispatch( noticesStore );
50
90
  async function revertAndSaveTemplate() {
51
91
  try {
52
92
  await revertTemplate( template, { allowUndo: false } );
@@ -55,7 +95,6 @@ export default function TemplateActions( {
55
95
  template.type,
56
96
  template.id
57
97
  );
58
-
59
98
  createSuccessNotice(
60
99
  sprintf(
61
100
  /* translators: The template/part's name. */
@@ -82,48 +121,26 @@ export default function TemplateActions( {
82
121
  createErrorNotice( errorMessage, { type: 'snackbar' } );
83
122
  }
84
123
  }
85
-
86
124
  return (
87
- <DropdownMenu
88
- icon={ moreVertical }
89
- label={ __( 'Actions' ) }
90
- className={ className }
91
- toggleProps={ toggleProps }
92
- >
93
- { ( { onClose } ) => (
94
- <MenuGroup>
95
- { isRemovable && (
96
- <>
97
- <RenameMenuItem
98
- template={ template }
99
- onClose={ onClose }
100
- />
101
- <DeleteMenuItem
102
- onRemove={ () => {
103
- removeTemplate( template );
104
- onRemove?.();
105
- onClose();
106
- } }
107
- title={ template.title.rendered }
108
- />
109
- </>
110
- ) }
111
- { isRevertable && (
112
- <MenuItem
113
- info={ __(
114
- 'Use the template as supplied by the theme.'
115
- ) }
116
- onClick={ () => {
117
- revertAndSaveTemplate();
118
- onClose();
119
- } }
120
- >
121
- { __( 'Clear customizations' ) }
122
- </MenuItem>
123
- ) }
124
- </MenuGroup>
125
- ) }
126
- </DropdownMenu>
125
+ <>
126
+ <MenuItem
127
+ info={ __( 'Use the template as supplied by the theme.' ) }
128
+ onClick={ () => setIsModalOpen( true ) }
129
+ >
130
+ { __( 'Clear customizations' ) }
131
+ </MenuItem>
132
+ <ConfirmDialog
133
+ isOpen={ isModalOpen }
134
+ onConfirm={ () => {
135
+ revertAndSaveTemplate();
136
+ onClose();
137
+ } }
138
+ onCancel={ () => setIsModalOpen( false ) }
139
+ confirmButtonText={ __( 'Clear' ) }
140
+ >
141
+ { __( 'Are you sure you want to clear these customizations?' ) }
142
+ </ConfirmDialog>
143
+ </>
127
144
  );
128
145
  }
129
146