@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
@@ -4,7 +4,7 @@
4
4
  import { useMemo } from '@wordpress/element';
5
5
  import { useSelect, useDispatch } from '@wordpress/data';
6
6
  import { Notice } from '@wordpress/components';
7
- import { EntityProvider, store as coreStore } from '@wordpress/core-data';
7
+ import { EntityProvider } from '@wordpress/core-data';
8
8
  import { store as preferencesStore } from '@wordpress/preferences';
9
9
  import {
10
10
  BlockContextProvider,
@@ -17,7 +17,7 @@ import {
17
17
  store as interfaceStore,
18
18
  } from '@wordpress/interface';
19
19
  import { EditorNotices, EditorSnackbars } from '@wordpress/editor';
20
- import { __ } from '@wordpress/i18n';
20
+ import { __, sprintf } from '@wordpress/i18n';
21
21
 
22
22
  /**
23
23
  * Internal dependencies
@@ -29,12 +29,14 @@ import KeyboardShortcuts from '../keyboard-shortcuts';
29
29
  import InserterSidebar from '../secondary-sidebar/inserter-sidebar';
30
30
  import ListViewSidebar from '../secondary-sidebar/list-view-sidebar';
31
31
  import WelcomeGuide from '../welcome-guide';
32
+ import StartTemplateOptions from '../start-template-options';
32
33
  import { store as editSiteStore } from '../../store';
33
34
  import { GlobalStylesRenderer } from '../global-styles-renderer';
34
35
  import { GlobalStylesProvider } from '../global-styles/global-styles-provider';
35
36
  import useTitle from '../routes/use-title';
36
37
  import CanvasSpinner from '../canvas-spinner';
37
- import { unlock } from '../../experiments';
38
+ import { unlock } from '../../private-apis';
39
+ import useEditedEntityRecord from '../use-edited-entity-record';
38
40
 
39
41
  const interfaceLabels = {
40
42
  /* translators: accessibility text for the editor content landmark region. */
@@ -49,11 +51,15 @@ const interfaceLabels = {
49
51
 
50
52
  export default function Editor() {
51
53
  const {
52
- editedPostId,
53
- editedPostType,
54
- editedPost,
54
+ record: editedPost,
55
+ getTitle,
56
+ isLoaded: hasLoadedPost,
57
+ } = useEditedEntityRecord();
58
+
59
+ const { id: editedPostId, type: editedPostType } = editedPost;
60
+
61
+ const {
55
62
  context,
56
- hasLoadedPost,
57
63
  editorMode,
58
64
  canvasMode,
59
65
  blockEditorMode,
@@ -63,36 +69,19 @@ export default function Editor() {
63
69
  showIconLabels,
64
70
  } = useSelect( ( select ) => {
65
71
  const {
66
- getEditedPostType,
67
- getEditedPostId,
68
72
  getEditedPostContext,
69
73
  getEditorMode,
70
74
  getCanvasMode,
71
75
  isInserterOpened,
72
76
  isListViewOpened,
73
77
  } = unlock( select( editSiteStore ) );
74
- const { hasFinishedResolution, getEntityRecord } = select( coreStore );
75
78
  const { __unstableGetEditorMode } = select( blockEditorStore );
76
79
  const { getActiveComplementaryArea } = select( interfaceStore );
77
- const postType = getEditedPostType();
78
- const postId = getEditedPostId();
79
80
 
80
81
  // The currently selected entity to display.
81
82
  // Typically template or template part in the site editor.
82
83
  return {
83
- editedPostId: postId,
84
- editedPostType: postType,
85
- editedPost: postId
86
- ? getEntityRecord( 'postType', postType, postId )
87
- : null,
88
84
  context: getEditedPostContext(),
89
- hasLoadedPost: postId
90
- ? hasFinishedResolution( 'getEntityRecord', [
91
- 'postType',
92
- postType,
93
- postId,
94
- ] )
95
- : false,
96
85
  editorMode: getEditorMode(),
97
86
  canvasMode: getCanvasMode(),
98
87
  blockEditorMode: __unstableGetEditorMode(),
@@ -134,15 +123,28 @@ export default function Editor() {
134
123
  } ),
135
124
  ],
136
125
  } ),
137
- [ context ]
126
+ [ context, setEditedPostContext ]
138
127
  );
139
- const isReady = editedPostType !== undefined && editedPostId !== undefined;
128
+
129
+ let title;
130
+ if ( hasLoadedPost ) {
131
+ const type =
132
+ editedPostType === 'wp_template'
133
+ ? __( 'Template' )
134
+ : __( 'Template Part' );
135
+ title = sprintf(
136
+ // translators: A breadcrumb trail in browser tab. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).
137
+ __( '%1$s ‹ %2$s ‹ Editor' ),
138
+ getTitle(),
139
+ type
140
+ );
141
+ }
140
142
 
141
143
  // Only announce the title once the editor is ready to prevent "Replace"
142
144
  // action in <URlQueryController> from double-announcing.
143
- useTitle( isReady && __( 'Editor (beta)' ) );
145
+ useTitle( hasLoadedPost && title );
144
146
 
145
- if ( ! isReady ) {
147
+ if ( ! hasLoadedPost ) {
146
148
  return <CanvasSpinner />;
147
149
  }
148
150
 
@@ -159,6 +161,7 @@ export default function Editor() {
159
161
  <GlobalStylesProvider>
160
162
  <BlockContextProvider value={ blockContext }>
161
163
  <SidebarComplementaryAreaFills />
164
+ { isEditMode && <StartTemplateOptions /> }
162
165
  <InterfaceSkeleton
163
166
  enableRegionNavigation={ false }
164
167
  className={
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  __experimentalBorderRadiusControl as BorderRadiusControl,
6
- experiments as blockEditorExperiments,
6
+ privateApis as blockEditorPrivateApis,
7
7
  } from '@wordpress/block-editor';
8
8
  import {
9
9
  __experimentalBorderBoxControl as BorderBoxControl,
@@ -18,10 +18,10 @@ import { __ } from '@wordpress/i18n';
18
18
  /**
19
19
  * Internal dependencies
20
20
  */
21
- import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
22
- import { unlock } from '../../experiments';
21
+ import { useSupportedStyles, useColorsPerOrigin } from './hooks';
22
+ import { unlock } from '../../private-apis';
23
23
 
24
- const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
24
+ const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
25
25
 
26
26
  export function useHasBorderPanel( name ) {
27
27
  const controls = [
@@ -35,7 +35,7 @@ export function useHasBorderPanel( name ) {
35
35
  }
36
36
 
37
37
  function useHasBorderColorControl( name ) {
38
- const supports = getSupportedGlobalStylesPanels( name );
38
+ const supports = useSupportedStyles( name );
39
39
  return (
40
40
  useGlobalSetting( 'border.color', name )[ 0 ] &&
41
41
  supports.includes( 'borderColor' )
@@ -43,7 +43,7 @@ function useHasBorderColorControl( name ) {
43
43
  }
44
44
 
45
45
  function useHasBorderRadiusControl( name ) {
46
- const supports = getSupportedGlobalStylesPanels( name );
46
+ const supports = useSupportedStyles( name );
47
47
  return (
48
48
  useGlobalSetting( 'border.radius', name )[ 0 ] &&
49
49
  supports.includes( 'borderRadius' )
@@ -51,7 +51,7 @@ function useHasBorderRadiusControl( name ) {
51
51
  }
52
52
 
53
53
  function useHasBorderStyleControl( name ) {
54
- const supports = getSupportedGlobalStylesPanels( name );
54
+ const supports = useSupportedStyles( name );
55
55
  return (
56
56
  useGlobalSetting( 'border.style', name )[ 0 ] &&
57
57
  supports.includes( 'borderStyle' )
@@ -59,7 +59,7 @@ function useHasBorderStyleControl( name ) {
59
59
  }
60
60
 
61
61
  function useHasBorderWidthControl( name ) {
62
- const supports = getSupportedGlobalStylesPanels( name );
62
+ const supports = useSupportedStyles( name );
63
63
  return (
64
64
  useGlobalSetting( 'border.width', name )[ 0 ] &&
65
65
  supports.includes( 'borderWidth' )
@@ -6,14 +6,14 @@ import {
6
6
  __experimentalVStack as VStack,
7
7
  } from '@wordpress/components';
8
8
  import { __ } from '@wordpress/i18n';
9
- import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
9
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import { unlock } from '../../experiments';
14
+ import { unlock } from '../../private-apis';
15
15
 
16
- const { useGlobalSetting } = unlock( blockEditorExperiments );
16
+ const { useGlobalSetting } = unlock( blockEditorPrivateApis );
17
17
 
18
18
  export default function ColorPalettePanel( { name } ) {
19
19
  const [ themeColors, setThemeColors ] = useGlobalSetting(
@@ -55,6 +55,7 @@ export default function ColorPalettePanel( { name } ) {
55
55
  colors={ themeColors }
56
56
  onChange={ setThemeColors }
57
57
  paletteLabel={ __( 'Theme' ) }
58
+ paletteLabelHeadingLevel={ 3 }
58
59
  />
59
60
  ) }
60
61
  { !! defaultColors &&
@@ -66,12 +67,14 @@ export default function ColorPalettePanel( { name } ) {
66
67
  colors={ defaultColors }
67
68
  onChange={ setDefaultColors }
68
69
  paletteLabel={ __( 'Default' ) }
70
+ paletteLabelHeadingLevel={ 3 }
69
71
  />
70
72
  ) }
71
73
  <PaletteEdit
72
74
  colors={ customColors }
73
75
  onChange={ setCustomColors }
74
76
  paletteLabel={ __( 'Custom' ) }
77
+ paletteLabelHeadingLevel={ 3 }
75
78
  emptyMessage={ __(
76
79
  'Custom colors are empty! Add some colors to create your own color palette.'
77
80
  ) }
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
-
5
- import { getSupportedGlobalStylesPanels } from './hooks';
4
+ import { useSupportedStyles } from './hooks';
6
5
 
7
6
  export function useHasColorPanel( name ) {
8
- const supports = getSupportedGlobalStylesPanels( name );
7
+ const supports = useSupportedStyles( name );
9
8
  return (
10
9
  supports.includes( 'color' ) ||
11
10
  supports.includes( 'backgroundColor' ) ||
@@ -21,6 +21,8 @@ import {
21
21
  import { isRTL, __ } from '@wordpress/i18n';
22
22
  import { useSelect } from '@wordpress/data';
23
23
  import { store as coreStore } from '@wordpress/core-data';
24
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
25
+ import { useMemo } from '@wordpress/element';
24
26
 
25
27
  /**
26
28
  * Internal dependencies
@@ -28,15 +30,28 @@ import { store as coreStore } from '@wordpress/core-data';
28
30
  import { useHasBorderPanel } from './border-panel';
29
31
  import { useHasColorPanel } from './color-utils';
30
32
  import { useHasDimensionsPanel } from './dimensions-panel';
31
- import { useHasTypographyPanel } from './typography-panel';
32
33
  import { useHasVariationsPanel } from './variations-panel';
33
34
  import { NavigationButtonAsItem } from './navigation-button';
34
35
  import { IconWithCurrentColor } from './icon-with-current-color';
35
36
  import { ScreenVariations } from './screen-variations';
36
37
  import { useHasShadowControl } from './shadow-panel';
38
+ import { unlock } from '../../private-apis';
39
+ import { useSupportedStyles } from './hooks';
40
+
41
+ const {
42
+ useHasTypographyPanel,
43
+ useGlobalSetting,
44
+ overrideSettingsWithSupports,
45
+ } = unlock( blockEditorPrivateApis );
37
46
 
38
47
  function ContextMenu( { name, parentMenu = '' } ) {
39
- const hasTypographyPanel = useHasTypographyPanel( name );
48
+ const [ rawSettings ] = useGlobalSetting( '', name );
49
+ const supports = useSupportedStyles( name );
50
+ const settings = useMemo(
51
+ () => overrideSettingsWithSupports( rawSettings, supports ),
52
+ [ rawSettings, supports ]
53
+ );
54
+ const hasTypographyPanel = useHasTypographyPanel( settings );
40
55
  const hasColorPanel = useHasColorPanel( name );
41
56
  const hasBorderPanel = useHasBorderPanel( name );
42
57
  const hasEffectsPanel = useHasShadowControl( name );
@@ -12,7 +12,7 @@ import {
12
12
  } from '@wordpress/components';
13
13
  import { __ } from '@wordpress/i18n';
14
14
  import {
15
- experiments as blockEditorExperiments,
15
+ privateApis as blockEditorPrivateApis,
16
16
  transformStyles,
17
17
  } from '@wordpress/block-editor';
18
18
  import { info } from '@wordpress/icons';
@@ -20,10 +20,10 @@ import { info } from '@wordpress/icons';
20
20
  /**
21
21
  * Internal dependencies
22
22
  */
23
- import { unlock } from '../../experiments';
23
+ import { unlock } from '../../private-apis';
24
24
  import Subtitle from './subtitle';
25
25
 
26
- const { useGlobalStyle } = unlock( blockEditorExperiments );
26
+ const { useGlobalStyle } = unlock( blockEditorPrivateApis );
27
27
  function CustomCSSControl( { blockName } ) {
28
28
  // If blockName is defined, we are customizing CSS at the block level:
29
29
  // styles.blocks.blockName.css
@@ -101,7 +101,7 @@ function CustomCSSControl( { blockName } ) {
101
101
  </Panel>
102
102
  ) }
103
103
  <VStack spacing={ 3 }>
104
- <Subtitle>{ __( 'ADDITIONAL CSS' ) }</Subtitle>
104
+ <Subtitle>{ __( 'Additional CSS' ) }</Subtitle>
105
105
  <TextareaControl
106
106
  __nextHasNoMarginBottom
107
107
  value={
@@ -20,17 +20,17 @@ import {
20
20
  __experimentalUseCustomSides as useCustomSides,
21
21
  HeightControl,
22
22
  __experimentalSpacingSizesControl as SpacingSizesControl,
23
- experiments as blockEditorExperiments,
23
+ privateApis as blockEditorPrivateApis,
24
24
  } from '@wordpress/block-editor';
25
25
  import { Icon, positionCenter, stretchWide } from '@wordpress/icons';
26
26
 
27
27
  /**
28
28
  * Internal dependencies
29
29
  */
30
- import { getSupportedGlobalStylesPanels } from './hooks';
31
- import { unlock } from '../../experiments';
30
+ import { useSupportedStyles } from './hooks';
31
+ import { unlock } from '../../private-apis';
32
32
 
33
- const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
33
+ const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
34
34
 
35
35
  const AXIAL_SIDES = [ 'horizontal', 'vertical' ];
36
36
 
@@ -53,42 +53,42 @@ export function useHasDimensionsPanel( name ) {
53
53
  }
54
54
 
55
55
  function useHasContentSize( name ) {
56
- const supports = getSupportedGlobalStylesPanels( name );
56
+ const supports = useSupportedStyles( name );
57
57
  const [ settings ] = useGlobalSetting( 'layout.contentSize', name );
58
58
 
59
59
  return settings && supports.includes( 'contentSize' );
60
60
  }
61
61
 
62
62
  function useHasWideSize( name ) {
63
- const supports = getSupportedGlobalStylesPanels( name );
63
+ const supports = useSupportedStyles( name );
64
64
  const [ settings ] = useGlobalSetting( 'layout.wideSize', name );
65
65
 
66
66
  return settings && supports.includes( 'wideSize' );
67
67
  }
68
68
 
69
69
  function useHasPadding( name ) {
70
- const supports = getSupportedGlobalStylesPanels( name );
70
+ const supports = useSupportedStyles( name );
71
71
  const [ settings ] = useGlobalSetting( 'spacing.padding', name );
72
72
 
73
73
  return settings && supports.includes( 'padding' );
74
74
  }
75
75
 
76
76
  function useHasMargin( name ) {
77
- const supports = getSupportedGlobalStylesPanels( name );
77
+ const supports = useSupportedStyles( name );
78
78
  const [ settings ] = useGlobalSetting( 'spacing.margin', name );
79
79
 
80
80
  return settings && supports.includes( 'margin' );
81
81
  }
82
82
 
83
83
  function useHasGap( name ) {
84
- const supports = getSupportedGlobalStylesPanels( name );
84
+ const supports = useSupportedStyles( name );
85
85
  const [ settings ] = useGlobalSetting( 'spacing.blockGap', name );
86
86
 
87
87
  return settings && supports.includes( 'blockGap' );
88
88
  }
89
89
 
90
90
  function useHasMinHeight( name ) {
91
- const supports = getSupportedGlobalStylesPanels( name );
91
+ const supports = useSupportedStyles( name );
92
92
  const [ settings ] = useGlobalSetting( 'dimensions.minHeight', name );
93
93
 
94
94
  return settings && supports.includes( 'minHeight' );
@@ -413,7 +413,11 @@ export default function DimensionsPanel( { name, variation = '' } ) {
413
413
  };
414
414
 
415
415
  return (
416
- <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>
416
+ <ToolsPanel
417
+ label={ __( 'Dimensions' ) }
418
+ resetAll={ resetAll }
419
+ headingLevel={ 3 }
420
+ >
417
421
  { ( showContentSizeControl || showWideSizeControl ) && (
418
422
  <span className="span-columns">
419
423
  { __( 'Set the width of the main content area.' ) }
@@ -9,15 +9,15 @@ import { mergeWith, isEmpty, mapValues } from 'lodash';
9
9
  import { useMemo, useCallback } from '@wordpress/element';
10
10
  import { useSelect, useDispatch } from '@wordpress/data';
11
11
  import { store as coreStore } from '@wordpress/core-data';
12
- import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
12
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
13
13
 
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
17
  import CanvasSpinner from '../canvas-spinner';
18
- import { unlock } from '../../experiments';
18
+ import { unlock } from '../../private-apis';
19
19
 
20
- const { GlobalStylesContext } = unlock( blockEditorExperiments );
20
+ const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
21
21
 
22
22
  function mergeTreesCustomizer( _, srcValue ) {
23
23
  // We only pass as arrays the presets,
@@ -8,15 +8,15 @@ import {
8
8
  DuotonePicker,
9
9
  } from '@wordpress/components';
10
10
  import { __ } from '@wordpress/i18n';
11
- import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
11
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
12
12
 
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
16
  import Subtitle from './subtitle';
17
- import { unlock } from '../../experiments';
17
+ import { unlock } from '../../private-apis';
18
18
 
19
- const { useGlobalSetting } = unlock( blockEditorExperiments );
19
+ const { useGlobalSetting } = unlock( blockEditorPrivateApis );
20
20
 
21
21
  const noop = () => {};
22
22
 
@@ -75,6 +75,7 @@ export default function GradientPalettePanel( { name } ) {
75
75
  gradients={ themeGradients }
76
76
  onChange={ setThemeGradients }
77
77
  paletteLabel={ __( 'Theme' ) }
78
+ paletteLabelHeadingLevel={ 3 }
78
79
  />
79
80
  ) }
80
81
  { !! defaultGradients &&
@@ -86,12 +87,14 @@ export default function GradientPalettePanel( { name } ) {
86
87
  gradients={ defaultGradients }
87
88
  onChange={ setDefaultGradients }
88
89
  paletteLabel={ __( 'Default' ) }
90
+ paletteLabelLevel={ 3 }
89
91
  />
90
92
  ) }
91
93
  <PaletteEdit
92
94
  gradients={ customGradients }
93
95
  onChange={ setCustomGradients }
94
96
  paletteLabel={ __( 'Custom' ) }
97
+ paletteLabelLevel={ 3 }
95
98
  emptyMessage={ __(
96
99
  'Custom gradients are empty! Add some gradients to create your own palette.'
97
100
  ) }
@@ -99,7 +102,7 @@ export default function GradientPalettePanel( { name } ) {
99
102
  />
100
103
  { !! duotonePalette && !! duotonePalette.length && (
101
104
  <div>
102
- <Subtitle>{ __( 'Duotone' ) }</Subtitle>
105
+ <Subtitle level={ 3 }>{ __( 'Duotone' ) }</Subtitle>
103
106
  <Spacer margin={ 3 } />
104
107
  <DuotonePicker
105
108
  duotonePalette={ duotonePalette }
@@ -7,7 +7,7 @@ import {
7
7
  __experimentalSpacer as Spacer,
8
8
  __experimentalHeading as Heading,
9
9
  __experimentalView as View,
10
- __experimentalNavigatorBackButton as NavigatorBackButton,
10
+ __experimentalNavigatorToParentButton as NavigatorToParentButton,
11
11
  } from '@wordpress/components';
12
12
  import { isRTL, __ } from '@wordpress/i18n';
13
13
  import { chevronRight, chevronLeft } from '@wordpress/icons';
@@ -18,7 +18,7 @@ function ScreenHeader( { title, description } ) {
18
18
  <View>
19
19
  <Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>
20
20
  <HStack spacing={ 2 }>
21
- <NavigatorBackButton
21
+ <NavigatorToParentButton
22
22
  style={
23
23
  // TODO: This style override is also used in ToolsPanelHeader.
24
24
  // It should be supported out-of-the-box by Button.
@@ -29,7 +29,13 @@ function ScreenHeader( { title, description } ) {
29
29
  aria-label={ __( 'Navigate to the previous view' ) }
30
30
  />
31
31
  <Spacer>
32
- <Heading level={ 5 }>{ title }</Heading>
32
+ <Heading
33
+ className="edit-site-global-styles-header"
34
+ level={ 2 }
35
+ size={ 13 }
36
+ >
37
+ { title }
38
+ </Heading>
33
39
  </Spacer>
34
40
  </HStack>
35
41
  </Spacer>
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get } from 'lodash';
5
4
  import { colord, extend } from 'colord';
6
5
  import a11yPlugin from 'colord/plugins/a11y';
7
6
 
@@ -10,107 +9,20 @@ import a11yPlugin from 'colord/plugins/a11y';
10
9
  */
11
10
  import { _x } from '@wordpress/i18n';
12
11
  import { useMemo } from '@wordpress/element';
13
- import {
14
- getBlockType,
15
- __EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,
16
- } from '@wordpress/blocks';
17
- import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
12
+ import { store as blocksStore } from '@wordpress/blocks';
13
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
18
14
 
19
15
  /**
20
16
  * Internal dependencies
21
17
  */
22
- import { unlock } from '../../experiments';
18
+ import { unlock } from '../../private-apis';
19
+ import { useSelect } from '@wordpress/data';
23
20
 
24
- const { useGlobalSetting } = unlock( blockEditorExperiments );
21
+ const { useGlobalSetting } = unlock( blockEditorPrivateApis );
25
22
 
26
23
  // Enable colord's a11y plugin.
27
24
  extend( [ a11yPlugin ] );
28
25
 
29
- const ROOT_BLOCK_SUPPORTS = [
30
- 'background',
31
- 'backgroundColor',
32
- 'color',
33
- 'linkColor',
34
- 'buttonColor',
35
- 'fontFamily',
36
- 'fontSize',
37
- 'fontStyle',
38
- 'fontWeight',
39
- 'lineHeight',
40
- 'textDecoration',
41
- 'padding',
42
- 'contentSize',
43
- 'wideSize',
44
- 'blockGap',
45
- ];
46
-
47
- export function getSupportedGlobalStylesPanels( name ) {
48
- if ( ! name ) {
49
- return ROOT_BLOCK_SUPPORTS;
50
- }
51
-
52
- const blockType = getBlockType( name );
53
-
54
- if ( ! blockType ) {
55
- return [];
56
- }
57
-
58
- const supportKeys = [];
59
-
60
- // Check for blockGap support.
61
- // Block spacing support doesn't map directly to a single style property, so needs to be handled separately.
62
- // Also, only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.
63
- if (
64
- blockType?.supports?.spacing?.blockGap &&
65
- blockType?.supports?.spacing?.__experimentalSkipSerialization !==
66
- true &&
67
- ! blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(
68
- ( spacingType ) => spacingType === 'blockGap'
69
- )
70
- ) {
71
- supportKeys.push( 'blockGap' );
72
- }
73
-
74
- // check for shadow support
75
- if ( blockType?.supports?.shadow ) {
76
- supportKeys.push( 'shadow' );
77
- }
78
-
79
- Object.keys( STYLE_PROPERTY ).forEach( ( styleName ) => {
80
- if ( ! STYLE_PROPERTY[ styleName ].support ) {
81
- return;
82
- }
83
-
84
- // Opting out means that, for certain support keys like background color,
85
- // blocks have to explicitly set the support value false. If the key is
86
- // unset, we still enable it.
87
- if ( STYLE_PROPERTY[ styleName ].requiresOptOut ) {
88
- if (
89
- STYLE_PROPERTY[ styleName ].support[ 0 ] in
90
- blockType.supports &&
91
- get(
92
- blockType.supports,
93
- STYLE_PROPERTY[ styleName ].support
94
- ) !== false
95
- ) {
96
- return supportKeys.push( styleName );
97
- }
98
- }
99
-
100
- if (
101
- get(
102
- blockType.supports,
103
- STYLE_PROPERTY[ styleName ].support,
104
- false
105
- )
106
- ) {
107
- return supportKeys.push( styleName );
108
- }
109
- } );
110
-
111
- return supportKeys;
112
- }
113
-
114
26
  export function useColorsPerOrigin( name ) {
115
27
  const [ customColors ] = useGlobalSetting( 'color.palette.custom', name );
116
28
  const [ themeColors ] = useGlobalSetting( 'color.palette.theme', name );
@@ -240,3 +152,18 @@ export function useColorRandomizer( name ) {
240
152
  ? [ randomizeColors ]
241
153
  : [];
242
154
  }
155
+
156
+ export function useSupportedStyles( name, element ) {
157
+ const { supportedPanels } = useSelect(
158
+ ( select ) => {
159
+ return {
160
+ supportedPanels: unlock(
161
+ select( blocksStore )
162
+ ).getSupportedStyles( name, element ),
163
+ };
164
+ },
165
+ [ name, element ]
166
+ );
167
+
168
+ return supportedPanels;
169
+ }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  __experimentalNavigatorButton as NavigatorButton,
6
- __experimentalNavigatorBackButton as NavigatorBackButton,
6
+ __experimentalNavigatorToParentButton as NavigatorToParentButton,
7
7
  __experimentalItem as Item,
8
8
  FlexItem,
9
9
  __experimentalHStack as HStack,
@@ -33,7 +33,9 @@ function NavigationButtonAsItem( props ) {
33
33
  }
34
34
 
35
35
  function NavigationBackButtonAsItem( props ) {
36
- return <NavigatorBackButton as={ GenericNavigationButton } { ...props } />;
36
+ return (
37
+ <NavigatorToParentButton as={ GenericNavigationButton } { ...props } />
38
+ );
37
39
  }
38
40
 
39
41
  export { NavigationButtonAsItem, NavigationBackButtonAsItem };