@wordpress/edit-site 5.7.0 → 5.9.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 (259) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/new-template.js +2 -1
  3. package/build/components/add-new-template/new-template.js.map +1 -1
  4. package/build/components/block-editor/index.js +7 -7
  5. package/build/components/block-editor/index.js.map +1 -1
  6. package/build/components/editor/index.js +6 -4
  7. package/build/components/editor/index.js.map +1 -1
  8. package/build/components/editor-canvas-container/index.js +117 -0
  9. package/build/components/editor-canvas-container/index.js.map +1 -0
  10. package/build/components/global-styles/border-panel.js +81 -1
  11. package/build/components/global-styles/border-panel.js.map +1 -1
  12. package/build/components/global-styles/context-menu.js +6 -8
  13. package/build/components/global-styles/context-menu.js.map +1 -1
  14. package/build/components/global-styles/dimensions-panel.js +11 -1
  15. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  16. package/build/components/global-styles/effects-panel.js +53 -0
  17. package/build/components/global-styles/effects-panel.js.map +1 -0
  18. package/build/components/global-styles/filters-panel.js +50 -0
  19. package/build/components/global-styles/filters-panel.js.map +1 -0
  20. package/build/components/global-styles/global-styles-provider.js +4 -15
  21. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  22. package/build/components/global-styles/preview.js +1 -1
  23. package/build/components/global-styles/preview.js.map +1 -1
  24. package/build/components/global-styles/screen-block-list.js +14 -8
  25. package/build/components/global-styles/screen-block-list.js.map +1 -1
  26. package/build/components/global-styles/screen-css.js +1 -1
  27. package/build/components/global-styles/screen-css.js.map +1 -1
  28. package/build/components/global-styles/screen-effects.js +15 -7
  29. package/build/components/global-styles/screen-effects.js.map +1 -1
  30. package/build/components/global-styles/screen-filters.js +2 -2
  31. package/build/components/global-styles/screen-filters.js.map +1 -1
  32. package/build/components/global-styles/screen-style-variations.js +8 -118
  33. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  34. package/build/components/global-styles/style-variations-container.js +149 -0
  35. package/build/components/global-styles/style-variations-container.js.map +1 -0
  36. package/build/components/global-styles/ui.js +52 -15
  37. package/build/components/global-styles/ui.js.map +1 -1
  38. package/build/components/header-edit-mode/index.js +11 -7
  39. package/build/components/header-edit-mode/index.js.map +1 -1
  40. package/build/components/header-edit-mode/more-menu/index.js +1 -1
  41. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  42. package/build/components/keyboard-shortcuts/index.js +0 -137
  43. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  44. package/build/components/layout/index.js +17 -8
  45. package/build/components/layout/index.js.map +1 -1
  46. package/build/components/list/table.js +3 -3
  47. package/build/components/list/table.js.map +1 -1
  48. package/build/components/preferences-modal/index.js +4 -0
  49. package/build/components/preferences-modal/index.js.map +1 -1
  50. package/build/components/sidebar/index.js +4 -0
  51. package/build/components/sidebar/index.js.map +1 -1
  52. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +28 -13
  53. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  54. package/build/components/sidebar-navigation-screen/index.js +8 -6
  55. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  56. package/build/components/sidebar-navigation-screen-global-styles/index.js +58 -0
  57. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  58. package/build/components/sidebar-navigation-screen-main/index.js +5 -0
  59. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  60. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +114 -9
  61. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  62. package/build/components/site-hub/index.js +40 -17
  63. package/build/components/site-hub/index.js.map +1 -1
  64. package/build/components/site-icon/index.js +8 -7
  65. package/build/components/site-icon/index.js.map +1 -1
  66. package/build/components/start-template-options/index.js +9 -8
  67. package/build/components/start-template-options/index.js.map +1 -1
  68. package/build/components/style-book/index.js +9 -41
  69. package/build/components/style-book/index.js.map +1 -1
  70. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -3
  71. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  72. package/build/components/template-details/index.js +3 -1
  73. package/build/components/template-details/index.js.map +1 -1
  74. package/build/components/welcome-guide/styles.js +1 -1
  75. package/build/components/welcome-guide/styles.js.map +1 -1
  76. package/build/hooks/commands/index.js +19 -0
  77. package/build/hooks/commands/index.js.map +1 -0
  78. package/build/hooks/commands/use-navigation-commands.js +126 -0
  79. package/build/hooks/commands/use-navigation-commands.js.map +1 -0
  80. package/build/hooks/commands/use-wp-admin-commands.js +97 -0
  81. package/build/hooks/commands/use-wp-admin-commands.js.map +1 -0
  82. package/build/hooks/template-part-edit.js +2 -1
  83. package/build/hooks/template-part-edit.js.map +1 -1
  84. package/build/index.js +2 -1
  85. package/build/index.js.map +1 -1
  86. package/build/store/private-actions.js +19 -1
  87. package/build/store/private-actions.js.map +1 -1
  88. package/build/store/private-selectors.js +13 -0
  89. package/build/store/private-selectors.js.map +1 -1
  90. package/build/store/reducer.js +23 -1
  91. package/build/store/reducer.js.map +1 -1
  92. package/build/store/selectors.js +2 -1
  93. package/build/store/selectors.js.map +1 -1
  94. package/build-module/components/add-new-template/new-template.js +3 -2
  95. package/build-module/components/add-new-template/new-template.js.map +1 -1
  96. package/build-module/components/block-editor/index.js +6 -6
  97. package/build-module/components/block-editor/index.js.map +1 -1
  98. package/build-module/components/editor/index.js +6 -4
  99. package/build-module/components/editor/index.js.map +1 -1
  100. package/build-module/components/editor-canvas-container/index.js +100 -0
  101. package/build-module/components/editor-canvas-container/index.js.map +1 -0
  102. package/build-module/components/global-styles/border-panel.js +81 -1
  103. package/build-module/components/global-styles/border-panel.js.map +1 -1
  104. package/build-module/components/global-styles/context-menu.js +6 -6
  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 +40 -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 +5 -16
  113. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  114. package/build-module/components/global-styles/preview.js +1 -1
  115. package/build-module/components/global-styles/preview.js.map +1 -1
  116. package/build-module/components/global-styles/screen-block-list.js +13 -8
  117. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  118. package/build-module/components/global-styles/screen-css.js +1 -1
  119. package/build-module/components/global-styles/screen-css.js.map +1 -1
  120. package/build-module/components/global-styles/screen-effects.js +13 -4
  121. package/build-module/components/global-styles/screen-effects.js.map +1 -1
  122. package/build-module/components/global-styles/screen-filters.js +2 -2
  123. package/build-module/components/global-styles/screen-filters.js.map +1 -1
  124. package/build-module/components/global-styles/screen-style-variations.js +11 -114
  125. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  126. package/build-module/components/global-styles/style-variations-container.js +130 -0
  127. package/build-module/components/global-styles/style-variations-container.js.map +1 -0
  128. package/build-module/components/global-styles/ui.js +49 -16
  129. package/build-module/components/global-styles/ui.js.map +1 -1
  130. package/build-module/components/header-edit-mode/index.js +10 -7
  131. package/build-module/components/header-edit-mode/index.js.map +1 -1
  132. package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
  133. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  134. package/build-module/components/keyboard-shortcuts/index.js +1 -135
  135. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  136. package/build-module/components/layout/index.js +14 -8
  137. package/build-module/components/layout/index.js.map +1 -1
  138. package/build-module/components/list/table.js +3 -3
  139. package/build-module/components/list/table.js.map +1 -1
  140. package/build-module/components/preferences-modal/index.js +4 -0
  141. package/build-module/components/preferences-modal/index.js.map +1 -1
  142. package/build-module/components/sidebar/index.js +3 -0
  143. package/build-module/components/sidebar/index.js.map +1 -1
  144. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +28 -15
  145. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  146. package/build-module/components/sidebar-navigation-screen/index.js +9 -7
  147. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  148. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  149. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  150. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -1
  151. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  152. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +113 -11
  153. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  154. package/build-module/components/site-hub/index.js +40 -18
  155. package/build-module/components/site-hub/index.js.map +1 -1
  156. package/build-module/components/site-icon/index.js +8 -7
  157. package/build-module/components/site-icon/index.js.map +1 -1
  158. package/build-module/components/start-template-options/index.js +9 -8
  159. package/build-module/components/start-template-options/index.js.map +1 -1
  160. package/build-module/components/style-book/index.js +10 -41
  161. package/build-module/components/style-book/index.js.map +1 -1
  162. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -3
  163. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  164. package/build-module/components/template-details/index.js +3 -1
  165. package/build-module/components/template-details/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 +109 -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 +81 -0
  173. package/build-module/hooks/commands/use-wp-admin-commands.js.map +1 -0
  174. package/build-module/hooks/template-part-edit.js +2 -1
  175. package/build-module/hooks/template-part-edit.js.map +1 -1
  176. package/build-module/index.js +2 -1
  177. package/build-module/index.js.map +1 -1
  178. package/build-module/store/private-actions.js +15 -0
  179. package/build-module/store/private-actions.js.map +1 -1
  180. package/build-module/store/private-selectors.js +11 -0
  181. package/build-module/store/private-selectors.js.map +1 -1
  182. package/build-module/store/reducer.js +23 -1
  183. package/build-module/store/reducer.js.map +1 -1
  184. package/build-module/store/selectors.js +2 -1
  185. package/build-module/store/selectors.js.map +1 -1
  186. package/build-style/style-rtl.css +133 -107
  187. package/build-style/style.css +133 -107
  188. package/package.json +34 -32
  189. package/src/components/add-new-template/new-template.js +3 -0
  190. package/src/components/block-editor/index.js +8 -8
  191. package/src/components/editor/index.js +11 -3
  192. package/src/components/editor-canvas-container/index.js +115 -0
  193. package/src/components/editor-canvas-container/style.scss +19 -0
  194. package/src/components/global-styles/border-panel.js +73 -1
  195. package/src/components/global-styles/context-menu.js +6 -6
  196. package/src/components/global-styles/dimensions-panel.js +11 -0
  197. package/src/components/global-styles/effects-panel.js +40 -0
  198. package/src/components/global-styles/filters-panel.js +39 -0
  199. package/src/components/global-styles/global-styles-provider.js +4 -18
  200. package/src/components/global-styles/preview.js +1 -1
  201. package/src/components/global-styles/screen-block-list.js +9 -5
  202. package/src/components/global-styles/screen-css.js +1 -1
  203. package/src/components/global-styles/screen-effects.js +12 -5
  204. package/src/components/global-styles/screen-filters.js +2 -2
  205. package/src/components/global-styles/screen-style-variations.js +10 -129
  206. package/src/components/global-styles/style-variations-container.js +136 -0
  207. package/src/components/global-styles/style.scss +0 -39
  208. package/src/components/global-styles/ui.js +54 -8
  209. package/src/components/header-edit-mode/index.js +14 -5
  210. package/src/components/header-edit-mode/more-menu/index.js +1 -1
  211. package/src/components/keyboard-shortcuts/index.js +1 -155
  212. package/src/components/layout/index.js +13 -16
  213. package/src/components/layout/style.scss +31 -4
  214. package/src/components/list/table.js +16 -2
  215. package/src/components/preferences-modal/index.js +7 -0
  216. package/src/components/secondary-sidebar/style.scss +23 -5
  217. package/src/components/sidebar/index.js +4 -0
  218. package/src/components/sidebar/style.scss +2 -1
  219. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +36 -17
  220. package/src/components/sidebar-navigation-screen/index.js +10 -5
  221. package/src/components/sidebar-navigation-screen/style.scss +20 -5
  222. package/src/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  223. package/src/components/sidebar-navigation-screen-main/index.js +9 -1
  224. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +134 -9
  225. package/src/components/site-hub/index.js +51 -23
  226. package/src/components/site-icon/index.js +6 -11
  227. package/src/components/site-icon/style.scss +8 -3
  228. package/src/components/start-template-options/index.js +13 -12
  229. package/src/components/start-template-options/style.scss +18 -43
  230. package/src/components/style-book/index.js +7 -51
  231. package/src/components/style-book/style.scss +0 -18
  232. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -3
  233. package/src/components/template-details/index.js +1 -0
  234. package/src/components/welcome-guide/styles.js +1 -1
  235. package/src/hooks/commands/index.js +10 -0
  236. package/src/hooks/commands/use-navigation-commands.js +112 -0
  237. package/src/hooks/commands/use-wp-admin-commands.js +79 -0
  238. package/src/hooks/template-part-edit.js +1 -0
  239. package/src/index.js +1 -0
  240. package/src/store/private-actions.js +14 -0
  241. package/src/store/private-selectors.js +11 -0
  242. package/src/store/reducer.js +18 -0
  243. package/src/store/selectors.js +2 -1
  244. package/src/style.scss +1 -0
  245. package/build/components/global-styles/duotone-panel.js +0 -78
  246. package/build/components/global-styles/duotone-panel.js.map +0 -1
  247. package/build/components/global-styles/filter-utils.js +0 -17
  248. package/build/components/global-styles/filter-utils.js.map +0 -1
  249. package/build/components/global-styles/shadow-panel.js +0 -197
  250. package/build/components/global-styles/shadow-panel.js.map +0 -1
  251. package/build-module/components/global-styles/duotone-panel.js +0 -67
  252. package/build-module/components/global-styles/duotone-panel.js.map +0 -1
  253. package/build-module/components/global-styles/filter-utils.js +0 -9
  254. package/build-module/components/global-styles/filter-utils.js.map +0 -1
  255. package/build-module/components/global-styles/shadow-panel.js +0 -178
  256. package/build-module/components/global-styles/shadow-panel.js.map +0 -1
  257. package/src/components/global-styles/duotone-panel.js +0 -82
  258. package/src/components/global-styles/filter-utils.js +0 -9
  259. package/src/components/global-styles/shadow-panel.js +0 -178
@@ -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,8 @@ 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';
26
+ import { store as preferencesStore } from '@wordpress/preferences';
25
27
 
26
28
  /**
27
29
  * Internal dependencies
@@ -42,6 +44,7 @@ import { unlock } from '../../private-apis';
42
44
  import SavePanel from '../save-panel';
43
45
  import KeyboardShortcutsRegister from '../keyboard-shortcuts/register';
44
46
  import KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';
47
+ import { useCommands } from '../../hooks/commands';
45
48
 
46
49
  const ANIMATION_DURATION = 0.5;
47
50
  const emptyResizeHandleStyles = {
@@ -60,13 +63,14 @@ export default function Layout() {
60
63
  // This ensures the edited entity id and type are initialized properly.
61
64
  useInitEditedEntityFromURL();
62
65
  useSyncCanvasModeWithURL();
66
+ useCommands();
63
67
 
64
68
  const hubRef = useRef();
65
69
  const { params } = useLocation();
66
70
  const isListPage = getIsListPage( params );
67
71
  const isEditorPage = ! isListPage;
68
- const { canvasMode, previousShortcut, nextShortcut } = useSelect(
69
- ( select ) => {
72
+ const { hasFixedToolbar, canvasMode, previousShortcut, nextShortcut } =
73
+ useSelect( ( select ) => {
70
74
  const { getAllShortcutKeyCombinations } = select(
71
75
  keyboardShortcutsStore
72
76
  );
@@ -79,10 +83,10 @@ export default function Layout() {
79
83
  nextShortcut: getAllShortcutKeyCombinations(
80
84
  'core/edit-site/next-region'
81
85
  ),
86
+ hasFixedToolbar:
87
+ select( preferencesStore ).get( 'fixedToolbar' ),
82
88
  };
83
- },
84
- []
85
- );
89
+ }, [] );
86
90
  const navigateRegionsProps = useNavigateRegions( {
87
91
  previous: previousShortcut,
88
92
  next: nextShortcut,
@@ -123,6 +127,7 @@ export default function Layout() {
123
127
 
124
128
  return (
125
129
  <>
130
+ { window?.__experimentalEnableCommandCenter && <CommandMenu /> }
126
131
  <KeyboardShortcutsRegister />
127
132
  <KeyboardShortcutsGlobal />
128
133
  { fullResizer }
@@ -135,19 +140,11 @@ export default function Layout() {
135
140
  {
136
141
  'is-full-canvas': isFullCanvas,
137
142
  'is-edit-mode': canvasMode === 'edit',
143
+ 'has-fixed-toolbar': hasFixedToolbar,
138
144
  }
139
145
  ) }
140
146
  >
141
- <SiteHub
142
- ref={ hubRef }
143
- className="edit-site-layout__hub"
144
- style={ {
145
- width:
146
- isResizingEnabled && forcedWidth
147
- ? forcedWidth - 48
148
- : undefined,
149
- } }
150
- />
147
+ <SiteHub ref={ hubRef } className="edit-site-layout__hub" />
151
148
 
152
149
  <AnimatePresence initial={ false }>
153
150
  { isEditorPage && canvasMode === 'edit' && (
@@ -172,7 +169,7 @@ export default function Layout() {
172
169
  ease: 'easeOut',
173
170
  } }
174
171
  >
175
- { canvasMode === 'edit' && <Header /> }
172
+ <Header />
176
173
  </NavigableRegion>
177
174
  ) }
178
175
  </AnimatePresence>
@@ -15,7 +15,7 @@
15
15
  z-index: z-index(".edit-site-layout__hub");
16
16
 
17
17
  .edit-site-layout.is-full-canvas.is-edit-mode & {
18
- width: auto;
18
+ width: $header-height;
19
19
  padding-right: 0;
20
20
  }
21
21
 
@@ -135,6 +135,7 @@
135
135
 
136
136
  & > div {
137
137
  border-radius: 0;
138
+ box-shadow: none;
138
139
  }
139
140
  }
140
141
  }
@@ -148,13 +149,20 @@
148
149
  .edit-site-layout__view-mode-toggle.components-button {
149
150
  position: relative;
150
151
  color: $white;
151
- height: 100%;
152
- width: 100%;
153
- border-radius: $radius-block-ui;
152
+ border-radius: 0;
153
+ height: $header-height;
154
+ width: $header-height;
155
+ overflow: hidden;
154
156
  padding: 0;
155
157
  display: flex;
156
158
  align-items: center;
157
159
  justify-content: center;
160
+ border-bottom: 1px solid transparent;
161
+
162
+ .edit-site-layout.is-full-canvas.is-edit-mode & {
163
+ border-bottom-color: $gray-200;
164
+ transition: border-bottom-color 0.15s 0.4s ease-out;
165
+ }
158
166
 
159
167
  &:hover,
160
168
  &:active {
@@ -189,6 +197,10 @@
189
197
  .edit-site-layout__view-mode-toggle-icon {
190
198
  display: flex;
191
199
  border-radius: $radius-block-ui;
200
+ height: $grid-unit-80;
201
+ width: $grid-unit-80;
202
+ justify-content: center;
203
+ align-items: center;
192
204
  }
193
205
  }
194
206
 
@@ -220,3 +232,18 @@
220
232
  border-left: $border-width solid $gray-300;
221
233
  }
222
234
  }
235
+
236
+ .edit-site-layout.has-fixed-toolbar {
237
+ // making the header be lower than the content
238
+ // so the fixed toolbar can be positioned on top of it
239
+ // but only on desktop
240
+ @include break-medium() {
241
+ .edit-site-site-hub {
242
+ z-index: 4;
243
+ }
244
+ .edit-site-layout__header:focus-within {
245
+ z-index: 3;
246
+ }
247
+ }
248
+
249
+ }
@@ -18,19 +18,33 @@ import Actions from './actions';
18
18
  import AddedBy from './added-by';
19
19
 
20
20
  export default function Table( { templateType } ) {
21
- const { records: templates, isResolving: isLoading } = useEntityRecords(
21
+ const { records: allTemplates } = useEntityRecords(
22
22
  'postType',
23
23
  templateType,
24
24
  {
25
25
  per_page: -1,
26
26
  }
27
27
  );
28
+
29
+ const templates = useSelect(
30
+ ( select ) =>
31
+ allTemplates?.filter(
32
+ ( template ) =>
33
+ ! select( coreStore ).isDeletingEntityRecord(
34
+ 'postType',
35
+ templateType,
36
+ template.id
37
+ )
38
+ ),
39
+ [ allTemplates ]
40
+ );
41
+
28
42
  const postType = useSelect(
29
43
  ( select ) => select( coreStore ).getPostType( templateType ),
30
44
  [ templateType ]
31
45
  );
32
46
 
33
- if ( ! templates || isLoading ) {
47
+ if ( ! templates ) {
34
48
  return null;
35
49
  }
36
50
 
@@ -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,3 +1,8 @@
1
+ /**
2
+ * Note that this CSS file should be in sync with its counterpart in the other editor:
3
+ * packages/edit-post/src/components/secondary-sidebar/style.scss
4
+ */
5
+
1
6
  .edit-site-editor__inserter-panel,
2
7
  .edit-site-editor__list-view-panel {
3
8
  height: 100%;
@@ -6,9 +11,11 @@
6
11
  }
7
12
 
8
13
  .edit-site-editor__list-view-panel {
9
- // Same width as the Inserter.
10
- // @see packages/block-editor/src/components/inserter/style.scss
11
- min-width: 350px;
14
+ @include break-medium() {
15
+ // Same width as the Inserter.
16
+ // @see packages/block-editor/src/components/inserter/style.scss
17
+ width: 350px;
18
+ }
12
19
  }
13
20
 
14
21
  .edit-site-editor__inserter-panel-header {
@@ -42,6 +49,17 @@
42
49
  }
43
50
 
44
51
  .edit-site-editor__list-view-panel-content {
45
- overflow-y: auto;
46
- padding: $grid-unit-10;
52
+ height: 100%;
53
+
54
+ // Include custom scrollbars, invisible until hovered.
55
+ @include custom-scrollbars-on-hover(transparent, $gray-600);
56
+ overflow: auto;
57
+
58
+ // Only reserve space for scrollbars when there is content to scroll.
59
+ // This allows items in the list view to have equidistant padding left and right
60
+ // right up until a scrollbar is present.
61
+ scrollbar-gutter: auto;
62
+
63
+ // The table cells use an extra pixels of space left and right. We compensate for that here.
64
+ padding: $grid-unit-10 ($grid-unit-10 - $border-width - $border-width);
47
65
  }
@@ -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>
@@ -3,7 +3,8 @@
3
3
  overflow-y: auto;
4
4
 
5
5
  .components-navigator-screen {
6
- @include custom-scrollbars-on-hover;
6
+ @include custom-scrollbars-on-hover(transparent, $gray-700);
7
+ scrollbar-gutter: stable;
7
8
  }
8
9
  }
9
10
 
@@ -4,9 +4,9 @@
4
4
  import { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { styles, seen } from '@wordpress/icons';
7
- import { useSelect } from '@wordpress/data';
8
-
9
- import { useState, useEffect } from '@wordpress/element';
7
+ import { useSelect, useDispatch } from '@wordpress/data';
8
+ import { useEffect } from '@wordpress/element';
9
+ import { store as interfaceStore } from '@wordpress/interface';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
@@ -15,19 +15,39 @@ import DefaultSidebar from './default-sidebar';
15
15
  import { GlobalStylesUI } from '../global-styles';
16
16
  import { store as editSiteStore } from '../../store';
17
17
  import { GlobalStylesMenuSlot } from '../global-styles/ui';
18
+ import { unlock } from '../../private-apis';
18
19
 
19
20
  export default function GlobalStylesSidebar() {
20
- const [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );
21
- const editorMode = useSelect(
22
- ( select ) => select( editSiteStore ).getEditorMode(),
21
+ const { shouldClearCanvasContainerView, isStyleBookOpened } = useSelect(
22
+ ( select ) => {
23
+ const { getActiveComplementaryArea } = select( interfaceStore );
24
+ const _isVisualEditorMode =
25
+ 'visual' === select( editSiteStore ).getEditorMode();
26
+
27
+ return {
28
+ isStyleBookOpened:
29
+ 'style-book' ===
30
+ unlock(
31
+ select( editSiteStore )
32
+ ).getEditorCanvasContainerView(),
33
+ shouldClearCanvasContainerView:
34
+ 'edit-site/global-styles' !==
35
+ getActiveComplementaryArea( 'core/edit-site' ) ||
36
+ ! _isVisualEditorMode,
37
+ };
38
+ },
23
39
  []
24
40
  );
25
41
 
42
+ const { setEditorCanvasContainerView } = unlock(
43
+ useDispatch( editSiteStore )
44
+ );
26
45
  useEffect( () => {
27
- if ( editorMode !== 'visual' ) {
28
- setIsStyleBookOpened( false );
46
+ if ( shouldClearCanvasContainerView ) {
47
+ setEditorCanvasContainerView( undefined );
29
48
  }
30
- }, [ editorMode ] );
49
+ }, [ shouldClearCanvasContainerView ] );
50
+
31
51
  return (
32
52
  <DefaultSidebar
33
53
  className="edit-site-global-styles-sidebar"
@@ -46,10 +66,12 @@ export default function GlobalStylesSidebar() {
46
66
  icon={ seen }
47
67
  label={ __( 'Style Book' ) }
48
68
  isPressed={ isStyleBookOpened }
49
- disabled={ editorMode !== 'visual' }
50
- onClick={ () => {
51
- setIsStyleBookOpened( ! isStyleBookOpened );
52
- } }
69
+ disabled={ shouldClearCanvasContainerView }
70
+ onClick={ () =>
71
+ setEditorCanvasContainerView(
72
+ isStyleBookOpened ? undefined : 'style-book'
73
+ )
74
+ }
53
75
  />
54
76
  </FlexItem>
55
77
  <FlexItem>
@@ -58,10 +80,7 @@ export default function GlobalStylesSidebar() {
58
80
  </Flex>
59
81
  }
60
82
  >
61
- <GlobalStylesUI
62
- isStyleBookOpened={ isStyleBookOpened }
63
- onCloseStyleBook={ () => setIsStyleBookOpened( false ) }
64
- />
83
+ <GlobalStylesUI />
65
84
  </DefaultSidebar>
66
85
  );
67
86
  }
@@ -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"