@wordpress/edit-site 5.6.0 → 5.8.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 (279) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/new-template-part.js +3 -11
  3. package/build/components/add-new-template/new-template-part.js.map +1 -1
  4. package/build/components/add-new-template/new-template.js +7 -7
  5. package/build/components/add-new-template/new-template.js.map +1 -1
  6. package/build/components/add-new-template/utils.js +1 -1
  7. package/build/components/add-new-template/utils.js.map +1 -1
  8. package/build/components/block-editor/editor-canvas.js +7 -10
  9. package/build/components/block-editor/editor-canvas.js.map +1 -1
  10. package/build/components/editor/index.js +6 -4
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/global-styles/border-panel.js +35 -1
  13. package/build/components/global-styles/border-panel.js.map +1 -1
  14. package/build/components/global-styles/context-menu.js +8 -11
  15. package/build/components/global-styles/context-menu.js.map +1 -1
  16. package/build/components/global-styles/dimensions-panel.js +11 -1
  17. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  18. package/build/components/global-styles/effects-panel.js +53 -0
  19. package/build/components/global-styles/effects-panel.js.map +1 -0
  20. package/build/components/global-styles/filters-panel.js +45 -0
  21. package/build/components/global-styles/filters-panel.js.map +1 -0
  22. package/build/components/global-styles/global-styles-provider.js +7 -4
  23. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  24. package/build/components/global-styles/hooks.js +1 -58
  25. package/build/components/global-styles/hooks.js.map +1 -1
  26. package/build/components/global-styles/preview.js +4 -5
  27. package/build/components/global-styles/preview.js.map +1 -1
  28. package/build/components/global-styles/screen-block-list.js +17 -12
  29. package/build/components/global-styles/screen-block-list.js.map +1 -1
  30. package/build/components/global-styles/screen-colors.js +22 -211
  31. package/build/components/global-styles/screen-colors.js.map +1 -1
  32. package/build/components/global-styles/screen-css.js +1 -1
  33. package/build/components/global-styles/screen-css.js.map +1 -1
  34. package/build/components/global-styles/screen-effects.js +15 -7
  35. package/build/components/global-styles/screen-effects.js.map +1 -1
  36. package/build/components/global-styles/screen-filters.js +2 -2
  37. package/build/components/global-styles/screen-filters.js.map +1 -1
  38. package/build/components/global-styles/screen-style-variations.js +8 -118
  39. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  40. package/build/components/global-styles/screen-typography-element.js +4 -0
  41. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  42. package/build/components/global-styles/screen-typography.js +5 -0
  43. package/build/components/global-styles/screen-typography.js.map +1 -1
  44. package/build/components/global-styles/style-variations-container.js +149 -0
  45. package/build/components/global-styles/style-variations-container.js.map +1 -0
  46. package/build/components/global-styles/ui.js +51 -37
  47. package/build/components/global-styles/ui.js.map +1 -1
  48. package/build/components/global-styles-renderer/index.js +1 -2
  49. package/build/components/global-styles-renderer/index.js.map +1 -1
  50. package/build/components/header-edit-mode/more-menu/index.js +1 -1
  51. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  52. package/build/components/keyboard-shortcuts/index.js +0 -137
  53. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  54. package/build/components/layout/index.js +8 -1
  55. package/build/components/layout/index.js.map +1 -1
  56. package/build/components/preferences-modal/index.js +4 -0
  57. package/build/components/preferences-modal/index.js.map +1 -1
  58. package/build/components/secondary-sidebar/list-view-sidebar.js +6 -1
  59. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  60. package/build/components/sidebar/index.js +4 -0
  61. package/build/components/sidebar/index.js.map +1 -1
  62. package/build/components/sidebar-navigation-screen/index.js +8 -6
  63. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  64. package/build/components/sidebar-navigation-screen-global-styles/index.js +58 -0
  65. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  66. package/build/components/sidebar-navigation-screen-main/index.js +5 -0
  67. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  68. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +114 -9
  69. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  70. package/build/components/site-hub/index.js +4 -3
  71. package/build/components/site-hub/index.js.map +1 -1
  72. package/build/components/start-template-options/index.js +44 -9
  73. package/build/components/start-template-options/index.js.map +1 -1
  74. package/build/components/style-book/index.js +6 -7
  75. package/build/components/style-book/index.js.map +1 -1
  76. package/build/components/welcome-guide/styles.js +1 -1
  77. package/build/components/welcome-guide/styles.js.map +1 -1
  78. package/build/hooks/commands/index.js +19 -0
  79. package/build/hooks/commands/index.js.map +1 -0
  80. package/build/hooks/commands/use-navigation-commands.js +117 -0
  81. package/build/hooks/commands/use-navigation-commands.js.map +1 -0
  82. package/build/hooks/commands/use-wp-admin-commands.js +94 -0
  83. package/build/hooks/commands/use-wp-admin-commands.js.map +1 -0
  84. package/build/hooks/push-changes-to-global-styles/index.js +1 -0
  85. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  86. package/build/hooks/template-part-edit.js +2 -1
  87. package/build/hooks/template-part-edit.js.map +1 -1
  88. package/build/index.js +2 -1
  89. package/build/index.js.map +1 -1
  90. package/build/store/selectors.js +2 -1
  91. package/build/store/selectors.js.map +1 -1
  92. package/build-module/components/add-new-template/new-template-part.js +3 -9
  93. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  94. package/build-module/components/add-new-template/new-template.js +7 -7
  95. package/build-module/components/add-new-template/new-template.js.map +1 -1
  96. package/build-module/components/add-new-template/utils.js +1 -1
  97. package/build-module/components/add-new-template/utils.js.map +1 -1
  98. package/build-module/components/block-editor/editor-canvas.js +8 -11
  99. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  100. package/build-module/components/editor/index.js +6 -4
  101. package/build-module/components/editor/index.js.map +1 -1
  102. package/build-module/components/global-styles/border-panel.js +34 -1
  103. package/build-module/components/global-styles/border-panel.js.map +1 -1
  104. package/build-module/components/global-styles/context-menu.js +8 -8
  105. package/build-module/components/global-styles/context-menu.js.map +1 -1
  106. package/build-module/components/global-styles/dimensions-panel.js +11 -1
  107. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  108. package/build-module/components/global-styles/effects-panel.js +43 -0
  109. package/build-module/components/global-styles/effects-panel.js.map +1 -0
  110. package/build-module/components/global-styles/filters-panel.js +35 -0
  111. package/build-module/components/global-styles/filters-panel.js.map +1 -0
  112. package/build-module/components/global-styles/global-styles-provider.js +8 -5
  113. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  114. package/build-module/components/global-styles/hooks.js +1 -52
  115. package/build-module/components/global-styles/hooks.js.map +1 -1
  116. package/build-module/components/global-styles/preview.js +4 -5
  117. package/build-module/components/global-styles/preview.js.map +1 -1
  118. package/build-module/components/global-styles/screen-block-list.js +16 -11
  119. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  120. package/build-module/components/global-styles/screen-colors.js +23 -208
  121. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  122. package/build-module/components/global-styles/screen-css.js +1 -1
  123. package/build-module/components/global-styles/screen-css.js.map +1 -1
  124. package/build-module/components/global-styles/screen-effects.js +13 -4
  125. package/build-module/components/global-styles/screen-effects.js.map +1 -1
  126. package/build-module/components/global-styles/screen-filters.js +2 -2
  127. package/build-module/components/global-styles/screen-filters.js.map +1 -1
  128. package/build-module/components/global-styles/screen-style-variations.js +11 -114
  129. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  130. package/build-module/components/global-styles/screen-typography-element.js +4 -0
  131. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  132. package/build-module/components/global-styles/screen-typography.js +5 -0
  133. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  134. package/build-module/components/global-styles/style-variations-container.js +130 -0
  135. package/build-module/components/global-styles/style-variations-container.js.map +1 -0
  136. package/build-module/components/global-styles/ui.js +49 -33
  137. package/build-module/components/global-styles/ui.js.map +1 -1
  138. package/build-module/components/global-styles-renderer/index.js +1 -2
  139. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  140. package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
  141. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  142. package/build-module/components/keyboard-shortcuts/index.js +1 -135
  143. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  144. package/build-module/components/layout/index.js +6 -1
  145. package/build-module/components/layout/index.js.map +1 -1
  146. package/build-module/components/preferences-modal/index.js +4 -0
  147. package/build-module/components/preferences-modal/index.js.map +1 -1
  148. package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -2
  149. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  150. package/build-module/components/sidebar/index.js +3 -0
  151. package/build-module/components/sidebar/index.js.map +1 -1
  152. package/build-module/components/sidebar-navigation-screen/index.js +9 -7
  153. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  154. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  155. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  156. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -1
  157. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  158. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +113 -11
  159. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  160. package/build-module/components/site-hub/index.js +3 -3
  161. package/build-module/components/site-hub/index.js.map +1 -1
  162. package/build-module/components/start-template-options/index.js +45 -10
  163. package/build-module/components/start-template-options/index.js.map +1 -1
  164. package/build-module/components/style-book/index.js +7 -8
  165. package/build-module/components/style-book/index.js.map +1 -1
  166. package/build-module/components/welcome-guide/styles.js +1 -1
  167. package/build-module/components/welcome-guide/styles.js.map +1 -1
  168. package/build-module/hooks/commands/index.js +10 -0
  169. package/build-module/hooks/commands/index.js.map +1 -0
  170. package/build-module/hooks/commands/use-navigation-commands.js +101 -0
  171. package/build-module/hooks/commands/use-navigation-commands.js.map +1 -0
  172. package/build-module/hooks/commands/use-wp-admin-commands.js +79 -0
  173. package/build-module/hooks/commands/use-wp-admin-commands.js.map +1 -0
  174. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -0
  175. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  176. package/build-module/hooks/template-part-edit.js +2 -1
  177. package/build-module/hooks/template-part-edit.js.map +1 -1
  178. package/build-module/index.js +2 -1
  179. package/build-module/index.js.map +1 -1
  180. package/build-module/store/selectors.js +2 -1
  181. package/build-module/store/selectors.js.map +1 -1
  182. package/build-style/style-rtl.css +24 -63
  183. package/build-style/style.css +24 -63
  184. package/package.json +33 -31
  185. package/src/components/add-new-template/new-template-part.js +1 -6
  186. package/src/components/add-new-template/new-template.js +3 -6
  187. package/src/components/add-new-template/utils.js +1 -1
  188. package/src/components/block-editor/editor-canvas.js +13 -23
  189. package/src/components/editor/index.js +11 -3
  190. package/src/components/global-styles/border-panel.js +32 -1
  191. package/src/components/global-styles/context-menu.js +8 -8
  192. package/src/components/global-styles/dimensions-panel.js +11 -0
  193. package/src/components/global-styles/effects-panel.js +40 -0
  194. package/src/components/global-styles/filters-panel.js +33 -0
  195. package/src/components/global-styles/global-styles-provider.js +4 -4
  196. package/src/components/global-styles/hooks.js +1 -78
  197. package/src/components/global-styles/preview.js +2 -2
  198. package/src/components/global-styles/screen-block-list.js +11 -7
  199. package/src/components/global-styles/screen-colors.js +25 -229
  200. package/src/components/global-styles/screen-css.js +1 -1
  201. package/src/components/global-styles/screen-effects.js +12 -5
  202. package/src/components/global-styles/screen-filters.js +2 -2
  203. package/src/components/global-styles/screen-style-variations.js +10 -129
  204. package/src/components/global-styles/screen-typography-element.js +4 -0
  205. package/src/components/global-styles/screen-typography.js +6 -0
  206. package/src/components/global-styles/stories/index.js +425 -0
  207. package/src/components/global-styles/style-variations-container.js +136 -0
  208. package/src/components/global-styles/style.scss +4 -57
  209. package/src/components/global-styles/ui.js +50 -33
  210. package/src/components/global-styles-renderer/index.js +1 -2
  211. package/src/components/header-edit-mode/more-menu/index.js +1 -1
  212. package/src/components/keyboard-shortcuts/index.js +1 -155
  213. package/src/components/layout/index.js +4 -0
  214. package/src/components/preferences-modal/index.js +7 -0
  215. package/src/components/secondary-sidebar/list-view-sidebar.js +4 -3
  216. package/src/components/sidebar/index.js +4 -0
  217. package/src/components/sidebar-navigation-screen/index.js +10 -5
  218. package/src/components/sidebar-navigation-screen/style.scss +20 -5
  219. package/src/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  220. package/src/components/sidebar-navigation-screen-main/index.js +9 -1
  221. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +134 -9
  222. package/src/components/site-hub/index.js +3 -3
  223. package/src/components/start-template-options/index.js +40 -8
  224. package/src/components/start-template-options/style.scss +7 -14
  225. package/src/components/style-book/index.js +10 -16
  226. package/src/components/style-book/style.scss +1 -1
  227. package/src/components/welcome-guide/styles.js +1 -1
  228. package/src/hooks/commands/index.js +10 -0
  229. package/src/hooks/commands/use-navigation-commands.js +103 -0
  230. package/src/hooks/commands/use-wp-admin-commands.js +77 -0
  231. package/src/hooks/push-changes-to-global-styles/index.js +1 -0
  232. package/src/hooks/template-part-edit.js +1 -0
  233. package/src/index.js +1 -0
  234. package/src/store/selectors.js +2 -1
  235. package/build/components/global-styles/color-utils.js +0 -17
  236. package/build/components/global-styles/color-utils.js.map +0 -1
  237. package/build/components/global-styles/duotone-panel.js +0 -78
  238. package/build/components/global-styles/duotone-panel.js.map +0 -1
  239. package/build/components/global-styles/filter-utils.js +0 -17
  240. package/build/components/global-styles/filter-utils.js.map +0 -1
  241. package/build/components/global-styles/screen-background-color.js +0 -114
  242. package/build/components/global-styles/screen-background-color.js.map +0 -1
  243. package/build/components/global-styles/screen-button-color.js +0 -88
  244. package/build/components/global-styles/screen-button-color.js.map +0 -1
  245. package/build/components/global-styles/screen-heading-color.js +0 -165
  246. package/build/components/global-styles/screen-heading-color.js.map +0 -1
  247. package/build/components/global-styles/screen-link-color.js +0 -105
  248. package/build/components/global-styles/screen-link-color.js.map +0 -1
  249. package/build/components/global-styles/screen-text-color.js +0 -71
  250. package/build/components/global-styles/screen-text-color.js.map +0 -1
  251. package/build/components/global-styles/shadow-panel.js +0 -197
  252. package/build/components/global-styles/shadow-panel.js.map +0 -1
  253. package/build-module/components/global-styles/color-utils.js +0 -9
  254. package/build-module/components/global-styles/color-utils.js.map +0 -1
  255. package/build-module/components/global-styles/duotone-panel.js +0 -67
  256. package/build-module/components/global-styles/duotone-panel.js.map +0 -1
  257. package/build-module/components/global-styles/filter-utils.js +0 -9
  258. package/build-module/components/global-styles/filter-utils.js.map +0 -1
  259. package/build-module/components/global-styles/screen-background-color.js +0 -97
  260. package/build-module/components/global-styles/screen-background-color.js.map +0 -1
  261. package/build-module/components/global-styles/screen-button-color.js +0 -73
  262. package/build-module/components/global-styles/screen-button-color.js.map +0 -1
  263. package/build-module/components/global-styles/screen-heading-color.js +0 -149
  264. package/build-module/components/global-styles/screen-heading-color.js.map +0 -1
  265. package/build-module/components/global-styles/screen-link-color.js +0 -89
  266. package/build-module/components/global-styles/screen-link-color.js.map +0 -1
  267. package/build-module/components/global-styles/screen-text-color.js +0 -56
  268. package/build-module/components/global-styles/screen-text-color.js.map +0 -1
  269. package/build-module/components/global-styles/shadow-panel.js +0 -178
  270. package/build-module/components/global-styles/shadow-panel.js.map +0 -1
  271. package/src/components/global-styles/color-utils.js +0 -14
  272. package/src/components/global-styles/duotone-panel.js +0 -82
  273. package/src/components/global-styles/filter-utils.js +0 -9
  274. package/src/components/global-styles/screen-background-color.js +0 -132
  275. package/src/components/global-styles/screen-button-color.js +0 -104
  276. package/src/components/global-styles/screen-heading-color.js +0 -206
  277. package/src/components/global-styles/screen-link-color.js +0 -124
  278. package/src/components/global-styles/screen-text-color.js +0 -62
  279. package/src/components/global-styles/shadow-panel.js +0 -178
@@ -10,28 +10,30 @@ import {
10
10
  } from '@wordpress/components';
11
11
  import { getBlockTypes, store as blocksStore } from '@wordpress/blocks';
12
12
  import { useSelect, useDispatch } from '@wordpress/data';
13
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
13
+ import {
14
+ privateApis as blockEditorPrivateApis,
15
+ store as blockEditorStore,
16
+ } from '@wordpress/block-editor';
14
17
  import { __ } from '@wordpress/i18n';
15
18
  import { store as preferencesStore } from '@wordpress/preferences';
16
19
  import { moreVertical } from '@wordpress/icons';
17
20
  import { store as coreStore } from '@wordpress/core-data';
21
+ import { useEffect, useRef } from '@wordpress/element';
18
22
 
19
23
  /**
20
24
  * Internal dependencies
21
25
  */
22
26
  import ScreenRoot from './screen-root';
23
- import ScreenBlockList from './screen-block-list';
27
+ import {
28
+ useBlockHasGlobalStyles,
29
+ default as ScreenBlockList,
30
+ } from './screen-block-list';
24
31
  import ScreenBlock from './screen-block';
25
32
  import ScreenTypography from './screen-typography';
26
33
  import ScreenTypographyElement from './screen-typography-element';
27
34
  import ScreenFilters from './screen-filters';
28
35
  import ScreenColors from './screen-colors';
29
36
  import ScreenColorPalette from './screen-color-palette';
30
- import ScreenBackgroundColor from './screen-background-color';
31
- import ScreenTextColor from './screen-text-color';
32
- import ScreenLinkColor from './screen-link-color';
33
- import ScreenHeadingColor from './screen-heading-color';
34
- import ScreenButtonColor from './screen-button-color';
35
37
  import ScreenLayout from './screen-layout';
36
38
  import ScreenStyleVariations from './screen-style-variations';
37
39
  import { ScreenVariation } from './screen-variations';
@@ -184,6 +186,12 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
184
186
  <ScreenTypographyElement name={ name } element="heading" />
185
187
  </GlobalStylesNavigationScreen>
186
188
 
189
+ <GlobalStylesNavigationScreen
190
+ path={ parentMenu + '/typography/caption' }
191
+ >
192
+ <ScreenTypographyElement name={ name } element="caption" />
193
+ </GlobalStylesNavigationScreen>
194
+
187
195
  <GlobalStylesNavigationScreen
188
196
  path={ parentMenu + '/typography/button' }
189
197
  >
@@ -200,36 +208,10 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
200
208
  <ScreenColorPalette name={ name } />
201
209
  </GlobalStylesNavigationScreen>
202
210
 
203
- <GlobalStylesNavigationScreen
204
- path={ parentMenu + '/colors/background' }
205
- >
206
- <ScreenBackgroundColor name={ name } variation={ variation } />
207
- </GlobalStylesNavigationScreen>
208
-
209
211
  <GlobalStylesNavigationScreen path={ parentMenu + '/filters' }>
210
212
  <ScreenFilters name={ name } />
211
213
  </GlobalStylesNavigationScreen>
212
214
 
213
- <GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>
214
- <ScreenTextColor name={ name } variation={ variation } />
215
- </GlobalStylesNavigationScreen>
216
-
217
- <GlobalStylesNavigationScreen path={ parentMenu + '/colors/link' }>
218
- <ScreenLinkColor name={ name } variation={ variation } />
219
- </GlobalStylesNavigationScreen>
220
-
221
- <GlobalStylesNavigationScreen
222
- path={ parentMenu + '/colors/heading' }
223
- >
224
- <ScreenHeadingColor name={ name } variation={ variation } />
225
- </GlobalStylesNavigationScreen>
226
-
227
- <GlobalStylesNavigationScreen
228
- path={ parentMenu + '/colors/button' }
229
- >
230
- <ScreenButtonColor name={ name } variation={ variation } />
231
- </GlobalStylesNavigationScreen>
232
-
233
215
  <GlobalStylesNavigationScreen path={ parentMenu + '/border' }>
234
216
  <ScreenBorder name={ name } variation={ variation } />
235
217
  </GlobalStylesNavigationScreen>
@@ -280,6 +262,40 @@ function GlobalStylesStyleBook( { onClose } ) {
280
262
  );
281
263
  }
282
264
 
265
+ function GlobalStylesBlockLink() {
266
+ const navigator = useNavigator();
267
+ const isMounted = useRef();
268
+ const { selectedBlockName, selectedBlockClientId } = useSelect(
269
+ ( select ) => {
270
+ const { getSelectedBlockClientId, getBlockName } =
271
+ select( blockEditorStore );
272
+ const clientId = getSelectedBlockClientId();
273
+ return {
274
+ selectedBlockName: getBlockName( clientId ),
275
+ selectedBlockClientId: clientId,
276
+ };
277
+ },
278
+ []
279
+ );
280
+ const blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );
281
+ useEffect( () => {
282
+ // Avoid navigating to the block screen on mount.
283
+ if ( ! isMounted.current ) {
284
+ isMounted.current = true;
285
+ return;
286
+ }
287
+ if ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {
288
+ return;
289
+ }
290
+ const path = '/blocks/' + encodeURIComponent( selectedBlockName );
291
+ // Avoid navigating to the same path. This can happen when selecting
292
+ // a new block of the same type.
293
+ if ( path !== navigator.location.path ) {
294
+ navigator.goTo( path, { skipFocus: true } );
295
+ }
296
+ }, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );
297
+ }
298
+
283
299
  function GlobalStylesUI( { isStyleBookOpened, onCloseStyleBook } ) {
284
300
  const blocks = getBlockTypes();
285
301
 
@@ -332,6 +348,7 @@ function GlobalStylesUI( { isStyleBookOpened, onCloseStyleBook } ) {
332
348
  ) }
333
349
 
334
350
  <GlobalStylesActionMenu />
351
+ <GlobalStylesBlockLink />
335
352
  </NavigatorProvider>
336
353
  );
337
354
  }
@@ -14,7 +14,7 @@ import { unlock } from '../../private-apis';
14
14
  const { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );
15
15
 
16
16
  function useGlobalStylesRenderer() {
17
- const [ styles, settings, svgFilters ] = useGlobalStylesOutput();
17
+ const [ styles, settings ] = useGlobalStylesOutput();
18
18
  const { getSettings } = useSelect( editSiteStore );
19
19
  const { updateSettings } = useDispatch( editSiteStore );
20
20
 
@@ -30,7 +30,6 @@ function useGlobalStylesRenderer() {
30
30
  updateSettings( {
31
31
  ...currentStoreSettings,
32
32
  styles: [ ...nonGlobalStyles, ...styles ],
33
- svgFilters,
34
33
  __experimentalFeatures: settings,
35
34
  } );
36
35
  }, [ styles, settings ] );
@@ -93,7 +93,7 @@ export default function MoreMenu( { showIconLabels } ) {
93
93
  icon={ external }
94
94
  role="menuitem"
95
95
  href={ __(
96
- 'https://wordpress.org/support/article/site-editor/'
96
+ 'https://wordpress.org/documentation/article/site-editor/'
97
97
  ) }
98
98
  target="_blank"
99
99
  rel="noopener noreferrer"
@@ -1,14 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useEffect } from '@wordpress/element';
5
- import {
6
- useShortcut,
7
- store as keyboardShortcutsStore,
8
- } from '@wordpress/keyboard-shortcuts';
9
- import { isAppleOS } from '@wordpress/keycodes';
4
+ import { useShortcut } from '@wordpress/keyboard-shortcuts';
10
5
  import { useDispatch, useSelect } from '@wordpress/data';
11
- import { __ } from '@wordpress/i18n';
12
6
  import { store as coreStore } from '@wordpress/core-data';
13
7
  import { store as blockEditorStore } from '@wordpress/block-editor';
14
8
  import { store as interfaceStore } from '@wordpress/interface';
@@ -136,152 +130,4 @@ function KeyboardShortcuts() {
136
130
  return null;
137
131
  }
138
132
 
139
- function KeyboardShortcutsRegister() {
140
- // Registering the shortcuts.
141
- const { registerShortcut } = useDispatch( keyboardShortcutsStore );
142
- useEffect( () => {
143
- registerShortcut( {
144
- name: 'core/edit-site/save',
145
- category: 'global',
146
- description: __( 'Save your changes.' ),
147
- keyCombination: {
148
- modifier: 'primary',
149
- character: 's',
150
- },
151
- } );
152
-
153
- registerShortcut( {
154
- name: 'core/edit-site/undo',
155
- category: 'global',
156
- description: __( 'Undo your last changes.' ),
157
- keyCombination: {
158
- modifier: 'primary',
159
- character: 'z',
160
- },
161
- } );
162
-
163
- registerShortcut( {
164
- name: 'core/edit-site/redo',
165
- category: 'global',
166
- description: __( 'Redo your last undo.' ),
167
- keyCombination: {
168
- modifier: 'primaryShift',
169
- character: 'z',
170
- },
171
- // Disable on Apple OS because it conflicts with the browser's
172
- // history shortcut. It's a fine alias for both Windows and Linux.
173
- // Since there's no conflict for Ctrl+Shift+Z on both Windows and
174
- // Linux, we keep it as the default for consistency.
175
- aliases: isAppleOS()
176
- ? []
177
- : [
178
- {
179
- modifier: 'primary',
180
- character: 'y',
181
- },
182
- ],
183
- } );
184
-
185
- registerShortcut( {
186
- name: 'core/edit-site/toggle-list-view',
187
- category: 'global',
188
- description: __( 'Open the block list view.' ),
189
- keyCombination: {
190
- modifier: 'access',
191
- character: 'o',
192
- },
193
- } );
194
-
195
- registerShortcut( {
196
- name: 'core/edit-site/toggle-block-settings-sidebar',
197
- category: 'global',
198
- description: __( 'Show or hide the block settings sidebar.' ),
199
- keyCombination: {
200
- modifier: 'primaryShift',
201
- character: ',',
202
- },
203
- } );
204
-
205
- registerShortcut( {
206
- name: 'core/edit-site/keyboard-shortcuts',
207
- category: 'main',
208
- description: __( 'Display these keyboard shortcuts.' ),
209
- keyCombination: {
210
- modifier: 'access',
211
- character: 'h',
212
- },
213
- } );
214
-
215
- registerShortcut( {
216
- name: 'core/edit-site/next-region',
217
- category: 'global',
218
- description: __( 'Navigate to the next part of the editor.' ),
219
- keyCombination: {
220
- modifier: 'ctrl',
221
- character: '`',
222
- },
223
- aliases: [
224
- {
225
- modifier: 'access',
226
- character: 'n',
227
- },
228
- ],
229
- } );
230
-
231
- registerShortcut( {
232
- name: 'core/edit-site/previous-region',
233
- category: 'global',
234
- description: __( 'Navigate to the previous part of the editor.' ),
235
- keyCombination: {
236
- modifier: 'ctrlShift',
237
- character: '`',
238
- },
239
- aliases: [
240
- {
241
- modifier: 'access',
242
- character: 'p',
243
- },
244
- {
245
- modifier: 'ctrlShift',
246
- character: '~',
247
- },
248
- ],
249
- } );
250
- registerShortcut( {
251
- name: 'core/edit-site/toggle-mode',
252
- category: 'global',
253
- description: __( 'Switch between visual editor and code editor.' ),
254
- keyCombination: {
255
- modifier: 'secondary',
256
- character: 'm',
257
- },
258
- } );
259
-
260
- registerShortcut( {
261
- name: `core/edit-site/transform-heading-to-paragraph`,
262
- category: 'block-library',
263
- description: __( 'Transform heading to paragraph.' ),
264
- keyCombination: {
265
- modifier: 'access',
266
- character: `0`,
267
- },
268
- } );
269
-
270
- [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
271
- registerShortcut( {
272
- name: `core/edit-site/transform-paragraph-to-heading-${ level }`,
273
- category: 'block-library',
274
- description: __( 'Transform paragraph to heading.' ),
275
- keyCombination: {
276
- modifier: 'access',
277
- character: `${ level }`,
278
- },
279
- } );
280
- } );
281
- }, [ registerShortcut ] );
282
-
283
- return null;
284
- }
285
-
286
- KeyboardShortcuts.Register = KeyboardShortcutsRegister;
287
133
  export default KeyboardShortcuts;
@@ -22,6 +22,7 @@ import { __ } from '@wordpress/i18n';
22
22
  import { useState, useRef } from '@wordpress/element';
23
23
  import { NavigableRegion } from '@wordpress/interface';
24
24
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
25
+ import { CommandMenu } from '@wordpress/commands';
25
26
 
26
27
  /**
27
28
  * Internal dependencies
@@ -42,6 +43,7 @@ import { unlock } from '../../private-apis';
42
43
  import SavePanel from '../save-panel';
43
44
  import KeyboardShortcutsRegister from '../keyboard-shortcuts/register';
44
45
  import KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';
46
+ import { useCommands } from '../../hooks/commands';
45
47
 
46
48
  const ANIMATION_DURATION = 0.5;
47
49
  const emptyResizeHandleStyles = {
@@ -60,6 +62,7 @@ export default function Layout() {
60
62
  // This ensures the edited entity id and type are initialized properly.
61
63
  useInitEditedEntityFromURL();
62
64
  useSyncCanvasModeWithURL();
65
+ useCommands();
63
66
 
64
67
  const hubRef = useRef();
65
68
  const { params } = useLocation();
@@ -123,6 +126,7 @@ export default function Layout() {
123
126
 
124
127
  return (
125
128
  <>
129
+ { window?.__experimentalEnableCommandCenter && <CommandMenu /> }
126
130
  <KeyboardShortcutsRegister />
127
131
  <KeyboardShortcutsGlobal />
128
132
  { fullResizer }
@@ -48,6 +48,13 @@ export default function EditSitePreferencesModal( {
48
48
  ) }
49
49
  label={ __( 'Always open list view' ) }
50
50
  />
51
+ <EnableFeature
52
+ featureName="showBlockBreadcrumbs"
53
+ help={ __(
54
+ 'Shows block breadcrumbs at the bottom of the editor.'
55
+ ) }
56
+ label={ __( 'Display block breadcrumbs' ) }
57
+ />
51
58
  </PreferencesModalSection>
52
59
  ),
53
60
  },
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __experimentalListView as ListView } from '@wordpress/block-editor';
4
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
5
  import { Button } from '@wordpress/components';
6
6
  import {
7
7
  useFocusOnMount,
@@ -18,6 +18,7 @@ import { ESCAPE } from '@wordpress/keycodes';
18
18
  * Internal dependencies
19
19
  */
20
20
  import { store as editSiteStore } from '../../store';
21
+ import { unlock } from '../../private-apis';
21
22
 
22
23
  export default function ListViewSidebar() {
23
24
  const { setIsListViewOpened } = useDispatch( editSiteStore );
@@ -33,7 +34,7 @@ export default function ListViewSidebar() {
33
34
 
34
35
  const instanceId = useInstanceId( ListViewSidebar );
35
36
  const labelId = `edit-site-editor__list-view-panel-label-${ instanceId }`;
36
-
37
+ const { PrivateListView } = unlock( blockEditorPrivateApis );
37
38
  return (
38
39
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
39
40
  <div
@@ -59,7 +60,7 @@ export default function ListViewSidebar() {
59
60
  focusOnMountRef,
60
61
  ] ) }
61
62
  >
62
- <ListView />
63
+ <PrivateListView />
63
64
  </div>
64
65
  </div>
65
66
  );
@@ -17,6 +17,7 @@ import useSyncPathWithURL, {
17
17
  getPathFromURL,
18
18
  } from '../sync-state-with-url/use-sync-path-with-url';
19
19
  import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
20
+ import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
20
21
  import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
21
22
  import SaveHub from '../save-hub';
22
23
  import SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';
@@ -33,6 +34,9 @@ function SidebarScreens() {
33
34
  <NavigatorScreen path="/navigation">
34
35
  <SidebarNavigationScreenNavigationMenus />
35
36
  </NavigatorScreen>
37
+ <NavigatorScreen path="/wp_global_styles">
38
+ <SidebarNavigationScreenGlobalStyles />
39
+ </NavigatorScreen>
36
40
  <NavigatorScreen path="/navigation/:postType/:postId">
37
41
  <SidebarNavigationScreenNavigationItem />
38
42
  </NavigatorScreen>
@@ -5,6 +5,7 @@ import {
5
5
  __experimentalHStack as HStack,
6
6
  __experimentalVStack as VStack,
7
7
  __experimentalNavigatorToParentButton as NavigatorToParentButton,
8
+ __experimentalHeading as Heading,
8
9
  } from '@wordpress/components';
9
10
  import { isRTL, __ } from '@wordpress/i18n';
10
11
  import { chevronRight, chevronLeft } from '@wordpress/icons';
@@ -35,7 +36,7 @@ export default function SidebarNavigationScreen( {
35
36
  <VStack spacing={ 2 }>
36
37
  <HStack
37
38
  spacing={ 4 }
38
- justify="flex-start"
39
+ alignment="flex-start"
39
40
  className="edit-site-sidebar-navigation-screen__title-icon"
40
41
  >
41
42
  { ! isRoot ? (
@@ -47,14 +48,18 @@ export default function SidebarNavigationScreen( {
47
48
  ) : (
48
49
  <SidebarButton
49
50
  icon={ isRTL() ? chevronRight : chevronLeft }
50
- aria-label={ __( 'Navigate to the Dashboard' ) }
51
+ label={ __( 'Go back to the Dashboard' ) }
51
52
  href={ dashboardLink || 'index.php' }
52
- label={ __( 'Dashboard' ) }
53
53
  />
54
54
  ) }
55
- <h2 className="edit-site-sidebar-navigation-screen__title">
55
+ <Heading
56
+ className="edit-site-sidebar-navigation-screen__title"
57
+ color={ 'white' }
58
+ level={ 2 }
59
+ size={ 20 }
60
+ >
56
61
  { title }
57
- </h2>
62
+ </Heading>
58
63
  { actions }
59
64
  </HStack>
60
65
 
@@ -8,6 +8,7 @@
8
8
  .edit-site-sidebar-navigation-screen__content {
9
9
  margin: 0 $grid-unit-20 $grid-unit-20 $button-size;
10
10
  color: $gray-600;
11
+ //z-index: z-index(".edit-site-sidebar-navigation-screen__content");
11
12
  }
12
13
 
13
14
  .edit-site-sidebar-navigation-screen__page-link {
@@ -34,13 +35,27 @@
34
35
  margin-bottom: $grid-unit-10;
35
36
  padding-bottom: $grid-unit-10;
36
37
  padding-right: $grid-unit-20;
38
+ z-index: z-index(".edit-site-sidebar-navigation-screen__title-icon");
37
39
  }
38
40
 
39
41
  .edit-site-sidebar-navigation-screen__title {
40
- font-size: calc(1.56 * 13px);
41
- line-height: normal;
42
- font-weight: 500;
43
42
  flex-grow: 1;
44
- color: $white;
45
- margin: 0;
43
+ padding: $grid-unit-15 * 0.5 0 0 0;
44
+ }
45
+
46
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
47
+ margin-left: $grid-unit-20;
48
+ .edit-site-global-styles-variations_item-preview {
49
+ border: $gray-900 $border-width solid;
50
+ }
51
+ .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview {
52
+ border: $gray-100 $border-width solid;
53
+ }
54
+ .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview {
55
+ border: var(--wp-admin-theme-color) $border-width solid;
56
+ }
57
+
58
+ .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview {
59
+ border: var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
60
+ }
46
61
  }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { edit } from '@wordpress/icons';
6
+ import { useDispatch } from '@wordpress/data';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
+ import StyleVariationsContainer from '../global-styles/style-variations-container';
13
+ import { unlock } from '../../private-apis';
14
+ import { store as editSiteStore } from '../../store';
15
+ import SidebarButton from '../sidebar-button';
16
+
17
+ export default function SidebarNavigationScreenGlobalStyles() {
18
+ const { openGeneralSidebar } = useDispatch( editSiteStore );
19
+ const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
20
+ return (
21
+ <SidebarNavigationScreen
22
+ title={ __( 'Styles' ) }
23
+ description={ __(
24
+ 'Choose a different style combination for the theme styles.'
25
+ ) }
26
+ content={ <StyleVariationsContainer /> }
27
+ actions={
28
+ <SidebarButton
29
+ icon={ edit }
30
+ label={ __( 'Edit styles' ) }
31
+ onClick={ () => {
32
+ // switch to edit mode.
33
+ setCanvasMode( 'edit' );
34
+ // open global styles sidebar.
35
+ openGeneralSidebar( 'edit-site/global-styles' );
36
+ } }
37
+ />
38
+ }
39
+ />
40
+ );
41
+ }
@@ -6,7 +6,7 @@ import {
6
6
  __experimentalNavigatorButton as NavigatorButton,
7
7
  } from '@wordpress/components';
8
8
  import { __ } from '@wordpress/i18n';
9
- import { layout, symbolFilled, navigation } from '@wordpress/icons';
9
+ import { layout, symbolFilled, navigation, styles } from '@wordpress/icons';
10
10
  import { useSelect } from '@wordpress/data';
11
11
  import { store as coreStore } from '@wordpress/core-data';
12
12
 
@@ -56,6 +56,14 @@ export default function SidebarNavigationScreenMain() {
56
56
  { __( 'Navigation' ) }
57
57
  </NavigatorButton>
58
58
  ) }
59
+ <NavigatorButton
60
+ as={ SidebarNavigationItem }
61
+ path="/wp_global_styles"
62
+ withChevron
63
+ icon={ styles }
64
+ >
65
+ { __( 'Styles' ) }
66
+ </NavigatorButton>
59
67
  <NavigatorButton
60
68
  as={ SidebarNavigationItem }
61
69
  path="/wp_template"