@wordpress/edit-site 5.4.0 → 5.5.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 (244) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/add-custom-template-modal.js +12 -3
  3. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/new-template-part.js +8 -7
  5. package/build/components/add-new-template/new-template-part.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +3 -6
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/editor/index.js +3 -3
  9. package/build/components/editor/index.js.map +1 -1
  10. package/build/components/global-styles/border-panel.js +1 -1
  11. package/build/components/global-styles/border-panel.js.map +1 -1
  12. package/build/components/global-styles/context-menu.js +11 -8
  13. package/build/components/global-styles/context-menu.js.map +1 -1
  14. package/build/components/global-styles/dimensions-panel.js +41 -487
  15. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  16. package/build/components/global-styles/duotone-panel.js +78 -0
  17. package/build/components/global-styles/duotone-panel.js.map +1 -0
  18. package/build/components/global-styles/filter-utils.js +17 -0
  19. package/build/components/global-styles/filter-utils.js.map +1 -0
  20. package/build/components/global-styles/preview.js +9 -5
  21. package/build/components/global-styles/preview.js.map +1 -1
  22. package/build/components/global-styles/screen-block-list.js +4 -8
  23. package/build/components/global-styles/screen-block-list.js.map +1 -1
  24. package/build/components/global-styles/screen-border.js +1 -1
  25. package/build/components/global-styles/screen-border.js.map +1 -1
  26. package/build/components/global-styles/screen-filters.js +46 -0
  27. package/build/components/global-styles/screen-filters.js.map +1 -0
  28. package/build/components/global-styles/screen-layout.js +13 -5
  29. package/build/components/global-styles/screen-layout.js.map +1 -1
  30. package/build/components/global-styles/screen-variations.js +1 -1
  31. package/build/components/global-styles/screen-variations.js.map +1 -1
  32. package/build/components/global-styles/shadow-panel.js +6 -4
  33. package/build/components/global-styles/shadow-panel.js.map +1 -1
  34. package/build/components/global-styles/typography-panel.js +2 -5
  35. package/build/components/global-styles/typography-panel.js.map +1 -1
  36. package/build/components/global-styles/ui.js +7 -1
  37. package/build/components/global-styles/ui.js.map +1 -1
  38. package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
  39. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  40. package/build/components/keyboard-shortcuts/edit-mode.js +124 -0
  41. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -0
  42. package/build/components/keyboard-shortcuts/global.js +48 -0
  43. package/build/components/keyboard-shortcuts/global.js.map +1 -0
  44. package/build/components/keyboard-shortcuts/index.js +67 -0
  45. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  46. package/build/components/keyboard-shortcuts/register.js +153 -0
  47. package/build/components/keyboard-shortcuts/register.js.map +1 -0
  48. package/build/components/layout/index.js +5 -1
  49. package/build/components/layout/index.js.map +1 -1
  50. package/build/components/list/added-by.js +41 -42
  51. package/build/components/list/added-by.js.map +1 -1
  52. package/build/components/list/table.js +3 -2
  53. package/build/components/list/table.js.map +1 -1
  54. package/build/components/navigation-inspector/navigation-menu.js +22 -5
  55. package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
  56. package/build/components/save-button/index.js +5 -2
  57. package/build/components/save-button/index.js.map +1 -1
  58. package/build/components/save-panel/index.js +11 -1
  59. package/build/components/save-panel/index.js.map +1 -1
  60. package/build/components/sidebar/index.js +28 -16
  61. package/build/components/sidebar/index.js.map +1 -1
  62. package/build/components/sidebar-button/index.js +30 -0
  63. package/build/components/sidebar-button/index.js.map +1 -0
  64. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
  65. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  66. package/build/components/sidebar-navigation-screen/index.js +10 -10
  67. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  68. package/build/components/sidebar-navigation-screen-main/index.js +3 -3
  69. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  70. package/build/components/sidebar-navigation-screen-navigation-item/index.js +17 -16
  71. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  72. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +10 -4
  73. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  74. package/build/components/sidebar-navigation-screen-template/index.js +9 -19
  75. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  76. package/build/components/sidebar-navigation-screen-templates/index.js +25 -15
  77. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  78. package/build/components/sidebar-navigation-screen-templates-browse/index.js +8 -7
  79. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  80. package/build/components/style-book/index.js +17 -2
  81. package/build/components/style-book/index.js.map +1 -1
  82. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
  83. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  84. package/build/components/sync-state-with-url/use-sync-path-with-url.js +65 -18
  85. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  86. package/build/components/template-details/index.js +7 -9
  87. package/build/components/template-details/index.js.map +1 -1
  88. package/build/index.js +10 -22
  89. package/build/index.js.map +1 -1
  90. package/build/store/actions.js +2 -2
  91. package/build/store/actions.js.map +1 -1
  92. package/build/utils/get-is-list-page.js +1 -1
  93. package/build/utils/get-is-list-page.js.map +1 -1
  94. package/build-module/components/add-new-template/add-custom-template-modal.js +13 -4
  95. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  96. package/build-module/components/add-new-template/new-template-part.js +8 -7
  97. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  98. package/build-module/components/add-new-template/new-template.js +3 -6
  99. package/build-module/components/add-new-template/new-template.js.map +1 -1
  100. package/build-module/components/editor/index.js +3 -3
  101. package/build-module/components/editor/index.js.map +1 -1
  102. package/build-module/components/global-styles/border-panel.js +1 -1
  103. package/build-module/components/global-styles/border-panel.js.map +1 -1
  104. package/build-module/components/global-styles/context-menu.js +12 -9
  105. package/build-module/components/global-styles/context-menu.js.map +1 -1
  106. package/build-module/components/global-styles/dimensions-panel.js +43 -480
  107. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  108. package/build-module/components/global-styles/duotone-panel.js +67 -0
  109. package/build-module/components/global-styles/duotone-panel.js.map +1 -0
  110. package/build-module/components/global-styles/filter-utils.js +9 -0
  111. package/build-module/components/global-styles/filter-utils.js.map +1 -0
  112. package/build-module/components/global-styles/preview.js +10 -6
  113. package/build-module/components/global-styles/preview.js.map +1 -1
  114. package/build-module/components/global-styles/screen-block-list.js +4 -6
  115. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  116. package/build-module/components/global-styles/screen-border.js +1 -1
  117. package/build-module/components/global-styles/screen-border.js.map +1 -1
  118. package/build-module/components/global-styles/screen-filters.js +33 -0
  119. package/build-module/components/global-styles/screen-filters.js.map +1 -0
  120. package/build-module/components/global-styles/screen-layout.js +11 -2
  121. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  122. package/build-module/components/global-styles/screen-variations.js +1 -1
  123. package/build-module/components/global-styles/screen-variations.js.map +1 -1
  124. package/build-module/components/global-styles/shadow-panel.js +6 -4
  125. package/build-module/components/global-styles/shadow-panel.js.map +1 -1
  126. package/build-module/components/global-styles/typography-panel.js +2 -5
  127. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  128. package/build-module/components/global-styles/ui.js +6 -1
  129. package/build-module/components/global-styles/ui.js.map +1 -1
  130. package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
  131. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  132. package/build-module/components/keyboard-shortcuts/edit-mode.js +108 -0
  133. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -0
  134. package/build-module/components/keyboard-shortcuts/global.js +37 -0
  135. package/build-module/components/keyboard-shortcuts/global.js.map +1 -0
  136. package/build-module/components/keyboard-shortcuts/index.js +65 -0
  137. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  138. package/build-module/components/keyboard-shortcuts/register.js +141 -0
  139. package/build-module/components/keyboard-shortcuts/register.js.map +1 -0
  140. package/build-module/components/layout/index.js +3 -1
  141. package/build-module/components/layout/index.js.map +1 -1
  142. package/build-module/components/list/added-by.js +43 -44
  143. package/build-module/components/list/added-by.js.map +1 -1
  144. package/build-module/components/list/table.js +3 -2
  145. package/build-module/components/list/table.js.map +1 -1
  146. package/build-module/components/navigation-inspector/navigation-menu.js +25 -8
  147. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
  148. package/build-module/components/save-button/index.js +5 -2
  149. package/build-module/components/save-button/index.js.map +1 -1
  150. package/build-module/components/save-panel/index.js +8 -1
  151. package/build-module/components/save-panel/index.js.map +1 -1
  152. package/build-module/components/sidebar/index.js +25 -18
  153. package/build-module/components/sidebar/index.js.map +1 -1
  154. package/build-module/components/sidebar-button/index.js +18 -0
  155. package/build-module/components/sidebar-button/index.js.map +1 -0
  156. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
  157. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  158. package/build-module/components/sidebar-navigation-screen/index.js +8 -11
  159. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  160. package/build-module/components/sidebar-navigation-screen-main/index.js +3 -3
  161. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  162. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +16 -17
  163. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  164. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +10 -4
  165. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  166. package/build-module/components/sidebar-navigation-screen-template/index.js +8 -18
  167. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  168. package/build-module/components/sidebar-navigation-screen-templates/index.js +23 -16
  169. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  170. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -7
  171. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  172. package/build-module/components/style-book/index.js +17 -3
  173. package/build-module/components/style-book/index.js.map +1 -1
  174. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
  175. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  176. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +63 -18
  177. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  178. package/build-module/components/template-details/index.js +7 -8
  179. package/build-module/components/template-details/index.js.map +1 -1
  180. package/build-module/index.js +12 -22
  181. package/build-module/index.js.map +1 -1
  182. package/build-module/store/actions.js +2 -2
  183. package/build-module/store/actions.js.map +1 -1
  184. package/build-module/utils/get-is-list-page.js +1 -1
  185. package/build-module/utils/get-is-list-page.js.map +1 -1
  186. package/build-style/style-rtl.css +41 -38
  187. package/build-style/style.css +41 -38
  188. package/package.json +31 -31
  189. package/src/components/add-new-template/add-custom-template-modal.js +14 -10
  190. package/src/components/add-new-template/new-template-part.js +7 -9
  191. package/src/components/add-new-template/new-template.js +3 -6
  192. package/src/components/add-new-template/style.scss +0 -5
  193. package/src/components/block-editor/style.scss +1 -1
  194. package/src/components/editor/index.js +4 -3
  195. package/src/components/editor/style.scss +0 -6
  196. package/src/components/global-styles/border-panel.js +1 -1
  197. package/src/components/global-styles/context-menu.js +16 -10
  198. package/src/components/global-styles/dimensions-panel.js +43 -577
  199. package/src/components/global-styles/duotone-panel.js +82 -0
  200. package/src/components/global-styles/filter-utils.js +9 -0
  201. package/src/components/global-styles/preview.js +155 -140
  202. package/src/components/global-styles/screen-block-list.js +4 -9
  203. package/src/components/global-styles/screen-border.js +1 -1
  204. package/src/components/global-styles/screen-filters.js +27 -0
  205. package/src/components/global-styles/screen-layout.js +9 -2
  206. package/src/components/global-styles/screen-variations.js +0 -1
  207. package/src/components/global-styles/shadow-panel.js +4 -3
  208. package/src/components/global-styles/typography-panel.js +5 -7
  209. package/src/components/global-styles/ui.js +6 -1
  210. package/src/components/keyboard-shortcut-help-modal/config.js +10 -0
  211. package/src/components/keyboard-shortcuts/edit-mode.js +116 -0
  212. package/src/components/keyboard-shortcuts/global.js +35 -0
  213. package/src/components/keyboard-shortcuts/index.js +70 -0
  214. package/src/components/keyboard-shortcuts/register.js +157 -0
  215. package/src/components/layout/index.js +4 -0
  216. package/src/components/layout/style.scss +8 -1
  217. package/src/components/list/added-by.js +48 -55
  218. package/src/components/list/style.scss +5 -13
  219. package/src/components/list/table.js +4 -5
  220. package/src/components/navigation-inspector/navigation-menu.js +24 -6
  221. package/src/components/save-button/index.js +2 -2
  222. package/src/components/save-panel/index.js +8 -1
  223. package/src/components/sidebar/index.js +32 -14
  224. package/src/components/sidebar-button/index.js +21 -0
  225. package/src/components/sidebar-button/style.scss +23 -0
  226. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +3 -7
  227. package/src/components/sidebar-edit-mode/style.scss +16 -0
  228. package/src/components/sidebar-navigation-screen/index.js +31 -38
  229. package/src/components/sidebar-navigation-screen/style.scss +1 -9
  230. package/src/components/sidebar-navigation-screen-main/index.js +3 -3
  231. package/src/components/sidebar-navigation-screen-navigation-item/index.js +24 -20
  232. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +7 -3
  233. package/src/components/sidebar-navigation-screen-template/index.js +7 -19
  234. package/src/components/sidebar-navigation-screen-templates/index.js +22 -14
  235. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -5
  236. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -11
  237. package/src/components/style-book/index.js +25 -1
  238. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +28 -23
  239. package/src/components/sync-state-with-url/use-sync-path-with-url.js +72 -17
  240. package/src/components/template-details/index.js +5 -6
  241. package/src/index.js +6 -21
  242. package/src/store/actions.js +2 -2
  243. package/src/style.scss +1 -0
  244. package/src/utils/get-is-list-page.js +1 -1
@@ -0,0 +1,82 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import {
6
+ __experimentalToolsPanel as ToolsPanel,
7
+ DuotonePicker,
8
+ } from '@wordpress/components';
9
+ import {
10
+ privateApis as blockEditorPrivateApis,
11
+ useSetting,
12
+ } from '@wordpress/block-editor';
13
+ import { useMemo } from '@wordpress/element';
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import { unlock } from '../../private-apis';
19
+ const { useGlobalStyle } = unlock( blockEditorPrivateApis );
20
+
21
+ const EMPTY_ARRAY = [];
22
+
23
+ function useMultiOriginPresets( { presetSetting, defaultSetting } ) {
24
+ const disableDefault = ! useSetting( defaultSetting );
25
+ const userPresets =
26
+ useSetting( `${ presetSetting }.custom` ) || EMPTY_ARRAY;
27
+ const themePresets =
28
+ useSetting( `${ presetSetting }.theme` ) || EMPTY_ARRAY;
29
+ const defaultPresets =
30
+ useSetting( `${ presetSetting }.default` ) || EMPTY_ARRAY;
31
+ return useMemo(
32
+ () => [
33
+ ...userPresets,
34
+ ...themePresets,
35
+ ...( disableDefault ? EMPTY_ARRAY : defaultPresets ),
36
+ ],
37
+ [ disableDefault, userPresets, themePresets, defaultPresets ]
38
+ );
39
+ }
40
+
41
+ function DuotonePanel( { name } ) {
42
+ const [ themeDuotone, setThemeDuotone ] = useGlobalStyle(
43
+ 'filter.duotone',
44
+ name
45
+ );
46
+
47
+ const duotonePalette = useMultiOriginPresets( {
48
+ presetSetting: 'color.duotone',
49
+ defaultSetting: 'color.defaultDuotone',
50
+ } );
51
+ const colorPalette = useMultiOriginPresets( {
52
+ presetSetting: 'color.palette',
53
+ defaultSetting: 'color.defaultPalette',
54
+ } );
55
+
56
+ if ( duotonePalette?.length === 0 ) {
57
+ return null;
58
+ }
59
+ return (
60
+ <>
61
+ <ToolsPanel label={ __( 'Duotone' ) }>
62
+ <span className="span-columns">
63
+ { __(
64
+ 'Create a two-tone color effect without losing your original image.'
65
+ ) }
66
+ </span>
67
+ <div className="span-columns">
68
+ <DuotonePicker
69
+ colorPalette={ colorPalette }
70
+ duotonePalette={ duotonePalette }
71
+ disableCustomColors={ true }
72
+ disableCustomDuotone={ true }
73
+ value={ themeDuotone }
74
+ onChange={ setThemeDuotone }
75
+ />
76
+ </div>
77
+ </ToolsPanel>
78
+ </>
79
+ );
80
+ }
81
+
82
+ export default DuotonePanel;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { useSupportedStyles } from './hooks';
5
+
6
+ export function useHasFilterPanel( name ) {
7
+ const supports = useSupportedStyles( name );
8
+ return supports.includes( 'filter' );
9
+ }
@@ -107,163 +107,178 @@ const StylesPreview = ( { label, isFocused, withHoverView } ) => {
107
107
 
108
108
  return styles;
109
109
  }, [ styles ] );
110
+ const isReady = !! width;
110
111
 
111
112
  return (
112
- <Iframe
113
- className="edit-site-global-styles-preview__iframe"
114
- head={ <EditorStyles styles={ editorStyles } /> }
115
- style={ {
116
- height: normalizedHeight * ratio,
117
- visibility: ! width ? 'hidden' : 'visible',
118
- } }
119
- onMouseEnter={ () => setIsHovered( true ) }
120
- onMouseLeave={ () => setIsHovered( false ) }
121
- tabIndex={ -1 }
122
- >
123
- { containerResizeListener }
124
- <motion.div
125
- style={ {
126
- height: normalizedHeight * ratio,
127
- width: '100%',
128
- background: gradientValue ?? backgroundColor,
129
- cursor: 'pointer',
130
- } }
131
- initial="start"
132
- animate={
133
- ( isHovered || isFocused ) && ! disableMotion && label
134
- ? 'hover'
135
- : 'start'
136
- }
137
- >
138
- <motion.div
139
- variants={ firstFrame }
113
+ <>
114
+ <div style={ { position: 'relative' } }>
115
+ { containerResizeListener }
116
+ </div>
117
+ { isReady && (
118
+ <Iframe
119
+ className="edit-site-global-styles-preview__iframe"
120
+ head={ <EditorStyles styles={ editorStyles } /> }
140
121
  style={ {
141
- height: '100%',
142
- overflow: 'hidden',
122
+ height: normalizedHeight * ratio,
143
123
  } }
124
+ onMouseEnter={ () => setIsHovered( true ) }
125
+ onMouseLeave={ () => setIsHovered( false ) }
126
+ tabIndex={ -1 }
144
127
  >
145
- <HStack
146
- spacing={ 10 * ratio }
147
- justify="center"
128
+ <motion.div
148
129
  style={ {
149
- height: '100%',
150
- overflow: 'hidden',
130
+ height: normalizedHeight * ratio,
131
+ width: '100%',
132
+ background: gradientValue ?? backgroundColor,
133
+ cursor: 'pointer',
151
134
  } }
135
+ initial="start"
136
+ animate={
137
+ ( isHovered || isFocused ) &&
138
+ ! disableMotion &&
139
+ label
140
+ ? 'hover'
141
+ : 'start'
142
+ }
152
143
  >
153
144
  <motion.div
145
+ variants={ firstFrame }
154
146
  style={ {
155
- fontFamily: headingFontFamily,
156
- fontSize: 65 * ratio,
157
- color: headingColor,
158
- fontWeight: headingFontWeight,
147
+ height: '100%',
148
+ overflow: 'hidden',
159
149
  } }
160
- animate={ { scale: 1, opacity: 1 } }
161
- initial={ { scale: 0.1, opacity: 0 } }
162
- transition={ { delay: 0.3, type: 'tween' } }
163
150
  >
164
- Aa
165
- </motion.div>
166
- <VStack spacing={ 4 * ratio }>
167
- { highlightedColors.map(
168
- ( { slug, color }, index ) => (
169
- <motion.div
170
- key={ slug }
171
- style={ {
172
- height:
173
- normalizedColorSwatchSize *
174
- ratio,
175
- width:
176
- normalizedColorSwatchSize *
177
- ratio,
178
- background: color,
179
- borderRadius:
180
- ( normalizedColorSwatchSize *
181
- ratio ) /
182
- 2,
183
- } }
184
- animate={ { scale: 1, opacity: 1 } }
185
- initial={ { scale: 0.1, opacity: 0 } }
186
- transition={ {
187
- delay: index === 1 ? 0.2 : 0.1,
188
- } }
189
- />
190
- )
191
- ) }
192
- </VStack>
193
- </HStack>
194
- </motion.div>
195
- <motion.div
196
- variants={ withHoverView && midFrame }
197
- style={ {
198
- height: '100%',
199
- width: '100%',
200
- position: 'absolute',
201
- top: 0,
202
- overflow: 'hidden',
203
- filter: 'blur(60px)',
204
- opacity: 0.1,
205
- } }
206
- >
207
- <HStack
208
- spacing={ 0 }
209
- justify="flex-start"
210
- style={ {
211
- height: '100%',
212
- overflow: 'hidden',
213
- } }
214
- >
215
- { paletteColors
216
- .slice( 0, 4 )
217
- .map( ( { color }, index ) => (
218
- <div
219
- key={ index }
151
+ <HStack
152
+ spacing={ 10 * ratio }
153
+ justify="center"
154
+ style={ {
155
+ height: '100%',
156
+ overflow: 'hidden',
157
+ } }
158
+ >
159
+ <motion.div
220
160
  style={ {
221
- height: '100%',
222
- background: color,
223
- flexGrow: 1,
161
+ fontFamily: headingFontFamily,
162
+ fontSize: 65 * ratio,
163
+ color: headingColor,
164
+ fontWeight: headingFontWeight,
224
165
  } }
225
- />
226
- ) ) }
227
- </HStack>
228
- </motion.div>
229
- <motion.div
230
- variants={ secondFrame }
231
- style={ {
232
- height: '100%',
233
- width: '100%',
234
- overflow: 'hidden',
235
- position: 'absolute',
236
- top: 0,
237
- } }
238
- >
239
- <VStack
240
- spacing={ 3 * ratio }
241
- justify="center"
242
- style={ {
243
- height: '100%',
244
- overflow: 'hidden',
245
- padding: 10 * ratio,
246
- boxSizing: 'border-box',
247
- } }
248
- >
249
- { label && (
250
- <div
166
+ animate={ { scale: 1, opacity: 1 } }
167
+ initial={ { scale: 0.1, opacity: 0 } }
168
+ transition={ { delay: 0.3, type: 'tween' } }
169
+ >
170
+ Aa
171
+ </motion.div>
172
+ <VStack spacing={ 4 * ratio }>
173
+ { highlightedColors.map(
174
+ ( { slug, color }, index ) => (
175
+ <motion.div
176
+ key={ slug }
177
+ style={ {
178
+ height:
179
+ normalizedColorSwatchSize *
180
+ ratio,
181
+ width:
182
+ normalizedColorSwatchSize *
183
+ ratio,
184
+ background: color,
185
+ borderRadius:
186
+ ( normalizedColorSwatchSize *
187
+ ratio ) /
188
+ 2,
189
+ } }
190
+ animate={ {
191
+ scale: 1,
192
+ opacity: 1,
193
+ } }
194
+ initial={ {
195
+ scale: 0.1,
196
+ opacity: 0,
197
+ } }
198
+ transition={ {
199
+ delay:
200
+ index === 1 ? 0.2 : 0.1,
201
+ } }
202
+ />
203
+ )
204
+ ) }
205
+ </VStack>
206
+ </HStack>
207
+ </motion.div>
208
+ <motion.div
209
+ variants={ withHoverView && midFrame }
210
+ style={ {
211
+ height: '100%',
212
+ width: '100%',
213
+ position: 'absolute',
214
+ top: 0,
215
+ overflow: 'hidden',
216
+ filter: 'blur(60px)',
217
+ opacity: 0.1,
218
+ } }
219
+ >
220
+ <HStack
221
+ spacing={ 0 }
222
+ justify="flex-start"
251
223
  style={ {
252
- fontSize: 40 * ratio,
253
- fontFamily: headingFontFamily,
254
- color: headingColor,
255
- fontWeight: headingFontWeight,
256
- lineHeight: '1em',
257
- textAlign: 'center',
224
+ height: '100%',
225
+ overflow: 'hidden',
258
226
  } }
259
227
  >
260
- { label }
261
- </div>
262
- ) }
263
- </VStack>
264
- </motion.div>
265
- </motion.div>
266
- </Iframe>
228
+ { paletteColors
229
+ .slice( 0, 4 )
230
+ .map( ( { color }, index ) => (
231
+ <div
232
+ key={ index }
233
+ style={ {
234
+ height: '100%',
235
+ background: color,
236
+ flexGrow: 1,
237
+ } }
238
+ />
239
+ ) ) }
240
+ </HStack>
241
+ </motion.div>
242
+ <motion.div
243
+ variants={ secondFrame }
244
+ style={ {
245
+ height: '100%',
246
+ width: '100%',
247
+ overflow: 'hidden',
248
+ position: 'absolute',
249
+ top: 0,
250
+ } }
251
+ >
252
+ <VStack
253
+ spacing={ 3 * ratio }
254
+ justify="center"
255
+ style={ {
256
+ height: '100%',
257
+ overflow: 'hidden',
258
+ padding: 10 * ratio,
259
+ boxSizing: 'border-box',
260
+ } }
261
+ >
262
+ { label && (
263
+ <div
264
+ style={ {
265
+ fontSize: 40 * ratio,
266
+ fontFamily: headingFontFamily,
267
+ color: headingColor,
268
+ fontWeight: headingFontWeight,
269
+ lineHeight: '1em',
270
+ textAlign: 'center',
271
+ } }
272
+ >
273
+ { label }
274
+ </div>
275
+ ) }
276
+ </VStack>
277
+ </motion.div>
278
+ </motion.div>
279
+ </Iframe>
280
+ ) }
281
+ </>
267
282
  );
268
283
  };
269
284
 
@@ -22,17 +22,16 @@ import { speak } from '@wordpress/a11y';
22
22
  */
23
23
  import { useHasBorderPanel } from './border-panel';
24
24
  import { useHasColorPanel } from './color-utils';
25
- import { useHasDimensionsPanel } from './dimensions-panel';
26
25
  import { useHasVariationsPanel } from './variations-panel';
27
26
  import ScreenHeader from './header';
28
27
  import { NavigationButtonAsItem } from './navigation-button';
29
28
  import { unlock } from '../../private-apis';
30
- import { useSupportedStyles } from './hooks';
31
29
 
32
30
  const {
31
+ useHasDimensionsPanel,
33
32
  useHasTypographyPanel,
34
33
  useGlobalSetting,
35
- overrideSettingsWithSupports,
34
+ useSettingsForBlockElement,
36
35
  } = unlock( blockEditorPrivateApis );
37
36
 
38
37
  function useSortedBlockTypes() {
@@ -60,15 +59,11 @@ function useSortedBlockTypes() {
60
59
 
61
60
  function BlockMenuItem( { block } ) {
62
61
  const [ rawSettings ] = useGlobalSetting( '', block.name );
63
- const supports = useSupportedStyles( block.name );
64
- const settings = useMemo(
65
- () => overrideSettingsWithSupports( rawSettings, supports ),
66
- [ rawSettings, supports ]
67
- );
62
+ const settings = useSettingsForBlockElement( rawSettings, block.name );
68
63
  const hasTypographyPanel = useHasTypographyPanel( settings );
69
64
  const hasColorPanel = useHasColorPanel( block.name );
70
65
  const hasBorderPanel = useHasBorderPanel( block.name );
71
- const hasDimensionsPanel = useHasDimensionsPanel( block.name );
66
+ const hasDimensionsPanel = useHasDimensionsPanel( settings );
72
67
  const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
73
68
  const hasVariationsPanel = useHasVariationsPanel( block.name );
74
69
  const hasBlockMenuItem =
@@ -16,7 +16,7 @@ function ScreenBorder( { name, variation = '' } ) {
16
16
  const variationClassName = getVariationClassName( variation );
17
17
  return (
18
18
  <>
19
- <ScreenHeader title={ __( 'Border & Shadow' ) } />
19
+ <ScreenHeader title={ __( 'Border' ) } />
20
20
  <BlockPreviewPanel name={ name } variation={ variationClassName } />
21
21
  { hasBorderPanel && (
22
22
  <BorderPanel name={ name } variation={ variation } />
@@ -0,0 +1,27 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import DuotonePanel from './duotone-panel';
10
+ import BlockPreviewPanel from './block-preview-panel';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import ScreenHeader from './header';
16
+
17
+ function ScreenFilters( { name } ) {
18
+ return (
19
+ <>
20
+ <ScreenHeader title={ __( 'Filters' ) } />
21
+ <BlockPreviewPanel name={ name } />
22
+ <DuotonePanel name={ name } />
23
+ </>
24
+ );
25
+ }
26
+
27
+ export default ScreenFilters;
@@ -2,17 +2,24 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
- import DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';
10
+ import DimensionsPanel from './dimensions-panel';
10
11
  import ScreenHeader from './header';
11
12
  import BlockPreviewPanel from './block-preview-panel';
12
13
  import { getVariationClassName } from './utils';
14
+ import { unlock } from '../../private-apis';
15
+
16
+ const { useHasDimensionsPanel, useGlobalSetting, useSettingsForBlockElement } =
17
+ unlock( blockEditorPrivateApis );
13
18
 
14
19
  function ScreenLayout( { name, variation = '' } ) {
15
- const hasDimensionsPanel = useHasDimensionsPanel( name );
20
+ const [ rawSettings ] = useGlobalSetting( '', name );
21
+ const settings = useSettingsForBlockElement( rawSettings, name );
22
+ const hasDimensionsPanel = useHasDimensionsPanel( settings );
16
23
  const variationClassName = getVariationClassName( variation );
17
24
  return (
18
25
  <>
@@ -24,7 +24,6 @@ export function ScreenVariations( { name, path = '' } ) {
24
24
  return (
25
25
  <div className="edit-site-global-styles-screen-variations">
26
26
  <VStack spacing={ 3 }>
27
- <p>Manage style variations, saved block appearence presets.</p>
28
27
  <Subtitle>{ __( 'Style Variations' ) }</Subtitle>
29
28
  <VariationsPanel name={ name } />
30
29
  </VStack>
@@ -146,9 +146,9 @@ function ShadowPopoverContainer( { shadow, onShadowChange } ) {
146
146
  function ShadowPresets( { presets, activeShadow, onSelect } ) {
147
147
  return ! presets ? null : (
148
148
  <Grid columns={ 6 } gap={ 0 } align="center" justify="center">
149
- { presets.map( ( { name, shadow }, i ) => (
149
+ { presets.map( ( { name, slug, shadow } ) => (
150
150
  <ShadowIndicator
151
- key={ i }
151
+ key={ slug }
152
152
  label={ name }
153
153
  isActive={ shadow === activeShadow }
154
154
  onSelect={ () =>
@@ -167,8 +167,9 @@ function ShadowIndicator( { label, isActive, onSelect, shadow } ) {
167
167
  <Button
168
168
  className="edit-site-global-styles__shadow-indicator"
169
169
  onClick={ onSelect }
170
- aria-label={ label }
170
+ label={ label }
171
171
  style={ { boxShadow: shadow } }
172
+ showTooltip
172
173
  >
173
174
  { isActive && <Icon icon={ check } /> }
174
175
  </Button>
@@ -2,18 +2,16 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
- import { useMemo } from '@wordpress/element';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import { unlock } from '../../private-apis';
11
- import { useSupportedStyles } from './hooks';
12
10
 
13
11
  const {
14
12
  useGlobalStyle,
15
13
  useGlobalSetting,
16
- overrideSettingsWithSupports,
14
+ useSettingsForBlockElement,
17
15
  TypographyPanel: StylesTypographyPanel,
18
16
  } = unlock( blockEditorPrivateApis );
19
17
 
@@ -40,10 +38,10 @@ export default function TypographyPanel( {
40
38
  } );
41
39
  const [ rawSettings ] = useGlobalSetting( '', name );
42
40
  const usedElement = element === 'heading' ? headingLevel : element;
43
- const supports = useSupportedStyles( name, usedElement );
44
- const settings = useMemo(
45
- () => overrideSettingsWithSupports( rawSettings, supports ),
46
- [ rawSettings, supports ]
41
+ const settings = useSettingsForBlockElement(
42
+ rawSettings,
43
+ name,
44
+ usedElement
47
45
  );
48
46
 
49
47
  return (
@@ -24,6 +24,7 @@ import ScreenBlockList from './screen-block-list';
24
24
  import ScreenBlock from './screen-block';
25
25
  import ScreenTypography from './screen-typography';
26
26
  import ScreenTypographyElement from './screen-typography-element';
27
+ import ScreenFilters from './screen-filters';
27
28
  import ScreenColors from './screen-colors';
28
29
  import ScreenColorPalette from './screen-color-palette';
29
30
  import ScreenBackgroundColor from './screen-background-color';
@@ -68,7 +69,7 @@ function GlobalStylesActionMenu() {
68
69
  <GlobalStylesMenuFill>
69
70
  <DropdownMenu
70
71
  icon={ moreVertical }
71
- label={ __( 'More Styles actions' ) }
72
+ label={ __( 'Styles actions' ) }
72
73
  controls={ [
73
74
  {
74
75
  title: __( 'Reset to defaults' ),
@@ -205,6 +206,10 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
205
206
  <ScreenBackgroundColor name={ name } variation={ variation } />
206
207
  </GlobalStylesNavigationScreen>
207
208
 
209
+ <GlobalStylesNavigationScreen path={ parentMenu + '/filters' }>
210
+ <ScreenFilters name={ name } />
211
+ </GlobalStylesNavigationScreen>
212
+
208
213
  <GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>
209
214
  <ScreenTextColor name={ name } variation={ variation } />
210
215
  </GlobalStylesNavigationScreen>
@@ -36,4 +36,14 @@ export const textFormattingShortcuts = [
36
36
  keyCombination: { modifier: 'access', character: 'x' },
37
37
  description: __( 'Make the selected text inline code.' ),
38
38
  },
39
+ {
40
+ keyCombination: { modifier: 'access', character: '0' },
41
+ description: __( 'Convert the current heading to a paragraph.' ),
42
+ },
43
+ {
44
+ keyCombination: { modifier: 'access', character: '1-6' },
45
+ description: __(
46
+ 'Convert the current paragraph or heading to a heading of level 1 to 6.'
47
+ ),
48
+ },
39
49
  ];