@wordpress/edit-site 5.6.0 → 5.7.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 (122) hide show
  1. package/CHANGELOG.md +2 -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/global-styles/context-menu.js +2 -3
  11. package/build/components/global-styles/context-menu.js.map +1 -1
  12. package/build/components/global-styles/hooks.js +1 -58
  13. package/build/components/global-styles/hooks.js.map +1 -1
  14. package/build/components/global-styles/preview.js +3 -4
  15. package/build/components/global-styles/preview.js.map +1 -1
  16. package/build/components/global-styles/screen-block-list.js +3 -4
  17. package/build/components/global-styles/screen-block-list.js.map +1 -1
  18. package/build/components/global-styles/screen-colors.js +22 -211
  19. package/build/components/global-styles/screen-colors.js.map +1 -1
  20. package/build/components/global-styles/screen-typography-element.js +4 -0
  21. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  22. package/build/components/global-styles/screen-typography.js +5 -0
  23. package/build/components/global-styles/screen-typography.js.map +1 -1
  24. package/build/components/global-styles/ui.js +5 -35
  25. package/build/components/global-styles/ui.js.map +1 -1
  26. package/build/components/global-styles-renderer/index.js +1 -2
  27. package/build/components/global-styles-renderer/index.js.map +1 -1
  28. package/build/components/secondary-sidebar/list-view-sidebar.js +6 -1
  29. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  30. package/build/components/start-template-options/index.js +44 -9
  31. package/build/components/start-template-options/index.js.map +1 -1
  32. package/build/components/style-book/index.js +6 -7
  33. package/build/components/style-book/index.js.map +1 -1
  34. package/build/hooks/push-changes-to-global-styles/index.js +1 -0
  35. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  36. package/build-module/components/add-new-template/new-template-part.js +3 -9
  37. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  38. package/build-module/components/add-new-template/new-template.js +7 -7
  39. package/build-module/components/add-new-template/new-template.js.map +1 -1
  40. package/build-module/components/add-new-template/utils.js +1 -1
  41. package/build-module/components/add-new-template/utils.js.map +1 -1
  42. package/build-module/components/block-editor/editor-canvas.js +8 -11
  43. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  44. package/build-module/components/global-styles/context-menu.js +2 -2
  45. package/build-module/components/global-styles/context-menu.js.map +1 -1
  46. package/build-module/components/global-styles/hooks.js +1 -52
  47. package/build-module/components/global-styles/hooks.js.map +1 -1
  48. package/build-module/components/global-styles/preview.js +3 -4
  49. package/build-module/components/global-styles/preview.js.map +1 -1
  50. package/build-module/components/global-styles/screen-block-list.js +3 -3
  51. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  52. package/build-module/components/global-styles/screen-colors.js +23 -208
  53. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  54. package/build-module/components/global-styles/screen-typography-element.js +4 -0
  55. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  56. package/build-module/components/global-styles/screen-typography.js +5 -0
  57. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  58. package/build-module/components/global-styles/ui.js +5 -30
  59. package/build-module/components/global-styles/ui.js.map +1 -1
  60. package/build-module/components/global-styles-renderer/index.js +1 -2
  61. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  62. package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -2
  63. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  64. package/build-module/components/start-template-options/index.js +45 -10
  65. package/build-module/components/start-template-options/index.js.map +1 -1
  66. package/build-module/components/style-book/index.js +7 -8
  67. package/build-module/components/style-book/index.js.map +1 -1
  68. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -0
  69. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  70. package/build-style/style-rtl.css +4 -17
  71. package/build-style/style.css +4 -17
  72. package/package.json +31 -31
  73. package/src/components/add-new-template/new-template-part.js +1 -6
  74. package/src/components/add-new-template/new-template.js +3 -6
  75. package/src/components/add-new-template/utils.js +1 -1
  76. package/src/components/block-editor/editor-canvas.js +13 -23
  77. package/src/components/global-styles/context-menu.js +2 -2
  78. package/src/components/global-styles/hooks.js +1 -78
  79. package/src/components/global-styles/preview.js +1 -1
  80. package/src/components/global-styles/screen-block-list.js +2 -2
  81. package/src/components/global-styles/screen-colors.js +25 -229
  82. package/src/components/global-styles/screen-typography-element.js +4 -0
  83. package/src/components/global-styles/screen-typography.js +6 -0
  84. package/src/components/global-styles/stories/index.js +425 -0
  85. package/src/components/global-styles/style.scss +4 -18
  86. package/src/components/global-styles/ui.js +6 -31
  87. package/src/components/global-styles-renderer/index.js +1 -2
  88. package/src/components/secondary-sidebar/list-view-sidebar.js +4 -3
  89. package/src/components/start-template-options/index.js +40 -8
  90. package/src/components/style-book/index.js +10 -16
  91. package/src/components/style-book/style.scss +1 -1
  92. package/src/hooks/push-changes-to-global-styles/index.js +1 -0
  93. package/build/components/global-styles/color-utils.js +0 -17
  94. package/build/components/global-styles/color-utils.js.map +0 -1
  95. package/build/components/global-styles/screen-background-color.js +0 -114
  96. package/build/components/global-styles/screen-background-color.js.map +0 -1
  97. package/build/components/global-styles/screen-button-color.js +0 -88
  98. package/build/components/global-styles/screen-button-color.js.map +0 -1
  99. package/build/components/global-styles/screen-heading-color.js +0 -165
  100. package/build/components/global-styles/screen-heading-color.js.map +0 -1
  101. package/build/components/global-styles/screen-link-color.js +0 -105
  102. package/build/components/global-styles/screen-link-color.js.map +0 -1
  103. package/build/components/global-styles/screen-text-color.js +0 -71
  104. package/build/components/global-styles/screen-text-color.js.map +0 -1
  105. package/build-module/components/global-styles/color-utils.js +0 -9
  106. package/build-module/components/global-styles/color-utils.js.map +0 -1
  107. package/build-module/components/global-styles/screen-background-color.js +0 -97
  108. package/build-module/components/global-styles/screen-background-color.js.map +0 -1
  109. package/build-module/components/global-styles/screen-button-color.js +0 -73
  110. package/build-module/components/global-styles/screen-button-color.js.map +0 -1
  111. package/build-module/components/global-styles/screen-heading-color.js +0 -149
  112. package/build-module/components/global-styles/screen-heading-color.js.map +0 -1
  113. package/build-module/components/global-styles/screen-link-color.js +0 -89
  114. package/build-module/components/global-styles/screen-link-color.js.map +0 -1
  115. package/build-module/components/global-styles/screen-text-color.js +0 -56
  116. package/build-module/components/global-styles/screen-text-color.js.map +0 -1
  117. package/src/components/global-styles/color-utils.js +0 -14
  118. package/src/components/global-styles/screen-background-color.js +0 -132
  119. package/src/components/global-styles/screen-button-color.js +0 -104
  120. package/src/components/global-styles/screen-heading-color.js +0 -206
  121. package/src/components/global-styles/screen-link-color.js +0 -124
  122. package/src/components/global-styles/screen-text-color.js +0 -62
@@ -0,0 +1,425 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
+ import { useMemo, useState } from '@wordpress/element';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { mergeBaseAndUserConfigs } from '../global-styles-provider';
11
+ import { default as GlobalStylesUIComponent } from '../ui';
12
+ import { unlock } from '../../../private-apis';
13
+
14
+ const { GlobalStylesContext, ExperimentalBlockEditorProvider } = unlock(
15
+ blockEditorPrivateApis
16
+ );
17
+
18
+ export default { title: 'EditSite/GlobalStylesUI' };
19
+
20
+ const BASE_SETTINGS = {
21
+ settings: {
22
+ appearanceTools: false,
23
+ useRootPaddingAwareAlignments: true,
24
+ border: {
25
+ color: true,
26
+ radius: true,
27
+ style: true,
28
+ width: true,
29
+ },
30
+ color: {
31
+ background: true,
32
+ custom: true,
33
+ customDuotone: true,
34
+ customGradient: true,
35
+ defaultDuotone: true,
36
+ defaultGradients: true,
37
+ defaultPalette: true,
38
+ duotone: {
39
+ default: [
40
+ {
41
+ name: 'Dark grayscale',
42
+ colors: [ '#000000', '#7f7f7f' ],
43
+ slug: 'dark-grayscale',
44
+ },
45
+ {
46
+ name: 'Grayscale',
47
+ colors: [ '#000000', '#ffffff' ],
48
+ slug: 'grayscale',
49
+ },
50
+ {
51
+ name: 'Purple and yellow',
52
+ colors: [ '#8c00b7', '#fcff41' ],
53
+ slug: 'purple-yellow',
54
+ },
55
+ {
56
+ name: 'Blue and red',
57
+ colors: [ '#000097', '#ff4747' ],
58
+ slug: 'blue-red',
59
+ },
60
+ {
61
+ name: 'Midnight',
62
+ colors: [ '#000000', '#00a5ff' ],
63
+ slug: 'midnight',
64
+ },
65
+ {
66
+ name: 'Magenta and yellow',
67
+ colors: [ '#c7005a', '#fff278' ],
68
+ slug: 'magenta-yellow',
69
+ },
70
+ {
71
+ name: 'Purple and green',
72
+ colors: [ '#a60072', '#67ff66' ],
73
+ slug: 'purple-green',
74
+ },
75
+ {
76
+ name: 'Blue and orange',
77
+ colors: [ '#1900d8', '#ffa96b' ],
78
+ slug: 'blue-orange',
79
+ },
80
+ ],
81
+ },
82
+ gradients: {
83
+ default: [
84
+ {
85
+ name: 'Vivid cyan blue to vivid purple',
86
+ gradient:
87
+ 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)',
88
+ slug: 'vivid-cyan-blue-to-vivid-purple',
89
+ },
90
+ {
91
+ name: 'Light green cyan to vivid green cyan',
92
+ gradient:
93
+ 'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)',
94
+ slug: 'light-green-cyan-to-vivid-green-cyan',
95
+ },
96
+ {
97
+ name: 'Luminous vivid amber to luminous vivid orange',
98
+ gradient:
99
+ 'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)',
100
+ slug: 'luminous-vivid-amber-to-luminous-vivid-orange',
101
+ },
102
+ {
103
+ name: 'Luminous vivid orange to vivid red',
104
+ gradient:
105
+ 'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)',
106
+ slug: 'luminous-vivid-orange-to-vivid-red',
107
+ },
108
+ {
109
+ name: 'Very light gray to cyan bluish gray',
110
+ gradient:
111
+ 'linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)',
112
+ slug: 'very-light-gray-to-cyan-bluish-gray',
113
+ },
114
+ {
115
+ name: 'Cool to warm spectrum',
116
+ gradient:
117
+ 'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)',
118
+ slug: 'cool-to-warm-spectrum',
119
+ },
120
+ {
121
+ name: 'Blush light purple',
122
+ gradient:
123
+ 'linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)',
124
+ slug: 'blush-light-purple',
125
+ },
126
+ {
127
+ name: 'Blush bordeaux',
128
+ gradient:
129
+ 'linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)',
130
+ slug: 'blush-bordeaux',
131
+ },
132
+ {
133
+ name: 'Luminous dusk',
134
+ gradient:
135
+ 'linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)',
136
+ slug: 'luminous-dusk',
137
+ },
138
+ {
139
+ name: 'Pale ocean',
140
+ gradient:
141
+ 'linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)',
142
+ slug: 'pale-ocean',
143
+ },
144
+ {
145
+ name: 'Electric grass',
146
+ gradient:
147
+ 'linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)',
148
+ slug: 'electric-grass',
149
+ },
150
+ {
151
+ name: 'Midnight',
152
+ gradient:
153
+ 'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)',
154
+ slug: 'midnight',
155
+ },
156
+ ],
157
+ },
158
+ link: true,
159
+ palette: {
160
+ default: [
161
+ {
162
+ name: 'Black',
163
+ slug: 'black',
164
+ color: '#000000',
165
+ },
166
+ {
167
+ name: 'Cyan bluish gray',
168
+ slug: 'cyan-bluish-gray',
169
+ color: '#abb8c3',
170
+ },
171
+ {
172
+ name: 'White',
173
+ slug: 'white',
174
+ color: '#ffffff',
175
+ },
176
+ {
177
+ name: 'Pale pink',
178
+ slug: 'pale-pink',
179
+ color: '#f78da7',
180
+ },
181
+ {
182
+ name: 'Vivid red',
183
+ slug: 'vivid-red',
184
+ color: '#cf2e2e',
185
+ },
186
+ {
187
+ name: 'Luminous vivid orange',
188
+ slug: 'luminous-vivid-orange',
189
+ color: '#ff6900',
190
+ },
191
+ {
192
+ name: 'Luminous vivid amber',
193
+ slug: 'luminous-vivid-amber',
194
+ color: '#fcb900',
195
+ },
196
+ {
197
+ name: 'Light green cyan',
198
+ slug: 'light-green-cyan',
199
+ color: '#7bdcb5',
200
+ },
201
+ {
202
+ name: 'Vivid green cyan',
203
+ slug: 'vivid-green-cyan',
204
+ color: '#00d084',
205
+ },
206
+ {
207
+ name: 'Pale cyan blue',
208
+ slug: 'pale-cyan-blue',
209
+ color: '#8ed1fc',
210
+ },
211
+ {
212
+ name: 'Vivid cyan blue',
213
+ slug: 'vivid-cyan-blue',
214
+ color: '#0693e3',
215
+ },
216
+ {
217
+ name: 'Vivid purple',
218
+ slug: 'vivid-purple',
219
+ color: '#9b51e0',
220
+ },
221
+ ],
222
+ theme: [
223
+ {
224
+ color: '#ffffff',
225
+ name: 'Base',
226
+ slug: 'base',
227
+ },
228
+ {
229
+ color: '#000000',
230
+ name: 'Contrast',
231
+ slug: 'contrast',
232
+ },
233
+ {
234
+ color: '#9DFF20',
235
+ name: 'Primary',
236
+ slug: 'primary',
237
+ },
238
+ {
239
+ color: '#345C00',
240
+ name: 'Secondary',
241
+ slug: 'secondary',
242
+ },
243
+ {
244
+ color: '#F6F6F6',
245
+ name: 'Tertiary',
246
+ slug: 'tertiary',
247
+ },
248
+ ],
249
+ },
250
+ text: true,
251
+ },
252
+ shadow: {
253
+ defaultPresets: true,
254
+ presets: {
255
+ default: [
256
+ {
257
+ name: 'Natural',
258
+ slug: 'natural',
259
+ shadow: '6px 6px 9px rgba(0, 0, 0, 0.2)',
260
+ },
261
+ {
262
+ name: 'Deep',
263
+ slug: 'deep',
264
+ shadow: '12px 12px 50px rgba(0, 0, 0, 0.4)',
265
+ },
266
+ {
267
+ name: 'Sharp',
268
+ slug: 'sharp',
269
+ shadow: '6px 6px 0px rgba(0, 0, 0, 0.2)',
270
+ },
271
+ {
272
+ name: 'Outlined',
273
+ slug: 'outlined',
274
+ shadow: '6px 6px 0px -3px rgba(255, 255, 255, 1), 6px 6px rgba(0, 0, 0, 1)',
275
+ },
276
+ {
277
+ name: 'Crisp',
278
+ slug: 'crisp',
279
+ shadow: '6px 6px 0px rgba(0, 0, 0, 1)',
280
+ },
281
+ ],
282
+ },
283
+ },
284
+ layout: {
285
+ contentSize: '650px',
286
+ wideSize: '1200px',
287
+ },
288
+ spacing: {
289
+ blockGap: true,
290
+ margin: true,
291
+ padding: true,
292
+ customSpacingSize: true,
293
+ units: [ '%', 'px', 'em', 'rem', 'vh', 'vw' ],
294
+ spacingScale: {
295
+ operator: '*',
296
+ increment: 1.5,
297
+ steps: 0,
298
+ mediumStep: 1.5,
299
+ unit: 'rem',
300
+ },
301
+ spacingSizes: {
302
+ theme: [
303
+ {
304
+ size: 'clamp(1.5rem, 5vw, 2rem)',
305
+ slug: '30',
306
+ name: '1',
307
+ },
308
+ {
309
+ size: 'clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)',
310
+ slug: '40',
311
+ name: '2',
312
+ },
313
+ {
314
+ size: 'clamp(2.5rem, 8vw, 4.5rem)',
315
+ slug: '50',
316
+ name: '3',
317
+ },
318
+ {
319
+ size: 'clamp(3.75rem, 10vw, 7rem)',
320
+ slug: '60',
321
+ name: '4',
322
+ },
323
+ {
324
+ size: 'clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)',
325
+ slug: '70',
326
+ name: '5',
327
+ },
328
+ {
329
+ size: 'clamp(7rem, 14vw, 11rem)',
330
+ slug: '80',
331
+ name: '6',
332
+ },
333
+ ],
334
+ },
335
+ },
336
+ typography: {
337
+ customFontSize: true,
338
+ dropCap: false,
339
+ fontSizes: {
340
+ default: [
341
+ {
342
+ name: 'Small',
343
+ slug: 'small',
344
+ size: '13px',
345
+ },
346
+ {
347
+ name: 'Medium',
348
+ slug: 'medium',
349
+ size: '20px',
350
+ },
351
+ {
352
+ name: 'Large',
353
+ slug: 'large',
354
+ size: '36px',
355
+ },
356
+ {
357
+ name: 'Extra Large',
358
+ slug: 'x-large',
359
+ size: '42px',
360
+ },
361
+ ],
362
+ },
363
+ fontStyle: true,
364
+ fontWeight: true,
365
+ letterSpacing: true,
366
+ lineHeight: true,
367
+ textColumns: false,
368
+ textDecoration: true,
369
+ textTransform: true,
370
+ fluid: true,
371
+ fontFamilies: {
372
+ theme: [
373
+ {
374
+ fontFamily:
375
+ '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif',
376
+ name: 'System Font',
377
+ slug: 'system-font',
378
+ },
379
+ ],
380
+ },
381
+ },
382
+ dimensions: {
383
+ minHeight: true,
384
+ },
385
+ position: {
386
+ fixed: true,
387
+ sticky: true,
388
+ },
389
+ },
390
+ styles: {
391
+ blocks: {},
392
+ elements: {},
393
+ },
394
+ };
395
+
396
+ export const GlobalStylesUI = () => {
397
+ const [ userGlobalStyles, setUserStyles ] = useState( {
398
+ settings: {},
399
+ styles: {},
400
+ } );
401
+ const context = useMemo( () => {
402
+ return {
403
+ isReady: true,
404
+ user: userGlobalStyles,
405
+ base: BASE_SETTINGS,
406
+ merged: mergeBaseAndUserConfigs( BASE_SETTINGS, userGlobalStyles ),
407
+ setUserConfig: setUserStyles,
408
+ };
409
+ }, [ userGlobalStyles, setUserStyles ] );
410
+ const wrapperStyle = {
411
+ width: 280,
412
+ };
413
+ return (
414
+ <ExperimentalBlockEditorProvider>
415
+ <GlobalStylesContext.Provider value={ context }>
416
+ <div style={ wrapperStyle }>
417
+ <GlobalStylesUIComponent
418
+ isStyleBookOpened={ false }
419
+ onCloseStyleBook={ () => {} }
420
+ />
421
+ </div>
422
+ </GlobalStylesContext.Provider>
423
+ </ExperimentalBlockEditorProvider>
424
+ );
425
+ };
@@ -27,7 +27,6 @@
27
27
  max-width: 100%;
28
28
  }
29
29
 
30
- .edit-site-global-styles-screen-heading-color,
31
30
  .edit-site-global-styles-screen-typography,
32
31
  .edit-site-global-styles-screen-css {
33
32
  margin: $grid-unit-20;
@@ -46,10 +45,10 @@
46
45
  .edit-site-global-styles-screen-colors {
47
46
  margin: $grid-unit-20;
48
47
 
49
- .component-color-indicator {
50
- // Show a diagonal line (crossed out) for empty swatches.
51
- background: $white linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
52
- flex-shrink: 0;
48
+ .color-block-support-panel {
49
+ padding-left: 0;
50
+ padding-right: 0;
51
+ border-top: none;
53
52
  }
54
53
  }
55
54
 
@@ -84,13 +83,6 @@
84
83
  margin: 0;
85
84
  }
86
85
 
87
- .edit-site-screen-text-color__control,
88
- .edit-site-screen-link-color__control,
89
- .edit-site-screen-button-color__control,
90
- .edit-site-screen-background-color__control.has-no-tabs {
91
- padding: $grid-unit-20;
92
- }
93
-
94
86
  .edit-site-global-styles-variations_item {
95
87
  box-sizing: border-box;
96
88
 
@@ -123,12 +115,6 @@
123
115
  flex-shrink: 0;
124
116
  }
125
117
 
126
- .edit-site-global-styles__color-label {
127
- white-space: nowrap;
128
- overflow: hidden;
129
- text-overflow: ellipsis;
130
- }
131
-
132
118
  .edit-site-global-styles__block-preview-panel {
133
119
  position: relative;
134
120
  width: 100%;
@@ -27,11 +27,6 @@ import ScreenTypographyElement from './screen-typography-element';
27
27
  import ScreenFilters from './screen-filters';
28
28
  import ScreenColors from './screen-colors';
29
29
  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
30
  import ScreenLayout from './screen-layout';
36
31
  import ScreenStyleVariations from './screen-style-variations';
37
32
  import { ScreenVariation } from './screen-variations';
@@ -184,6 +179,12 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
184
179
  <ScreenTypographyElement name={ name } element="heading" />
185
180
  </GlobalStylesNavigationScreen>
186
181
 
182
+ <GlobalStylesNavigationScreen
183
+ path={ parentMenu + '/typography/caption' }
184
+ >
185
+ <ScreenTypographyElement name={ name } element="caption" />
186
+ </GlobalStylesNavigationScreen>
187
+
187
188
  <GlobalStylesNavigationScreen
188
189
  path={ parentMenu + '/typography/button' }
189
190
  >
@@ -200,36 +201,10 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
200
201
  <ScreenColorPalette name={ name } />
201
202
  </GlobalStylesNavigationScreen>
202
203
 
203
- <GlobalStylesNavigationScreen
204
- path={ parentMenu + '/colors/background' }
205
- >
206
- <ScreenBackgroundColor name={ name } variation={ variation } />
207
- </GlobalStylesNavigationScreen>
208
-
209
204
  <GlobalStylesNavigationScreen path={ parentMenu + '/filters' }>
210
205
  <ScreenFilters name={ name } />
211
206
  </GlobalStylesNavigationScreen>
212
207
 
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
208
  <GlobalStylesNavigationScreen path={ parentMenu + '/border' }>
234
209
  <ScreenBorder name={ name } variation={ variation } />
235
210
  </GlobalStylesNavigationScreen>
@@ -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 ] );
@@ -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
  );
@@ -4,7 +4,10 @@
4
4
  import { Modal } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useState, useEffect, useMemo } from '@wordpress/element';
7
- import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
7
+ import {
8
+ __experimentalBlockPatternsList as BlockPatternsList,
9
+ store as blockEditorStore,
10
+ } from '@wordpress/block-editor';
8
11
  import { useSelect } from '@wordpress/data';
9
12
  import { useAsyncList } from '@wordpress/compose';
10
13
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -35,15 +38,40 @@ function useFallbackTemplateContent( slug, isCustom = false ) {
35
38
 
36
39
  const START_BLANK_TITLE = __( 'Start blank' );
37
40
 
38
- function PatternSelection( { fallbackContent, onChoosePattern, postType } ) {
39
- const [ , , onChange ] = useEntityBlockEditor( 'postType', postType );
40
- const blockPatterns = useMemo(
41
- () => [
41
+ function useStartPatterns( fallbackContent ) {
42
+ const { slug, patterns } = useSelect( ( select ) => {
43
+ const { getEditedPostType, getEditedPostId } = select( editSiteStore );
44
+ const { getEntityRecord } = select( coreStore );
45
+ const postId = getEditedPostId();
46
+ const postType = getEditedPostType();
47
+ const record = getEntityRecord( 'postType', postType, postId );
48
+ const { getSettings } = select( blockEditorStore );
49
+ return {
50
+ slug: record.slug,
51
+ patterns: getSettings().__experimentalBlockPatterns,
52
+ };
53
+ }, [] );
54
+
55
+ return useMemo( () => {
56
+ // filter patterns that are supposed to be used in the current template being edited.
57
+ return [
42
58
  {
43
59
  name: 'fallback',
44
60
  blocks: parse( fallbackContent ),
45
61
  title: __( 'Fallback content' ),
46
62
  },
63
+ ...patterns
64
+ .filter( ( pattern ) => {
65
+ return (
66
+ Array.isArray( pattern.templateTypes ) &&
67
+ pattern.templateTypes.some( ( templateType ) =>
68
+ slug.startsWith( templateType )
69
+ )
70
+ );
71
+ } )
72
+ .map( ( pattern ) => {
73
+ return { ...pattern, blocks: parse( pattern.content ) };
74
+ } ),
47
75
  {
48
76
  name: 'start-blank',
49
77
  blocks: parse(
@@ -51,9 +79,13 @@ function PatternSelection( { fallbackContent, onChoosePattern, postType } ) {
51
79
  ),
52
80
  title: START_BLANK_TITLE,
53
81
  },
54
- ],
55
- [ fallbackContent ]
56
- );
82
+ ];
83
+ }, [ fallbackContent, slug, patterns ] );
84
+ }
85
+
86
+ function PatternSelection( { fallbackContent, onChoosePattern, postType } ) {
87
+ const [ , , onChange ] = useEntityBlockEditor( 'postType', postType );
88
+ const blockPatterns = useStartPatterns( fallbackContent );
57
89
  const shownBlockPatterns = useAsyncList( blockPatterns );
58
90
 
59
91
  return (
@@ -247,25 +247,19 @@ function StyleBook( { isSelected, onSelect, onClose } ) {
247
247
  { ( tab ) => (
248
248
  <Iframe
249
249
  className="edit-site-style-book__iframe"
250
- head={
251
- <>
252
- <EditorStyles styles={ settings.styles } />
253
- <style>
254
- {
255
- // Forming a "block formatting context" to prevent margin collapsing.
256
- // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
257
- `.is-root-container { display: flow-root; }
258
- body { position: relative; padding: 32px !important; }` +
259
- STYLE_BOOK_IFRAME_STYLES
260
- }
261
- </style>
262
- </>
263
- }
264
250
  name="style-book-canvas"
265
251
  tabIndex={ 0 }
266
252
  >
267
- { /* Filters need to be rendered before children to avoid Safari rendering issues. */ }
268
- { settings.svgFilters }
253
+ <EditorStyles styles={ settings.styles } />
254
+ <style>
255
+ {
256
+ // Forming a "block formatting context" to prevent margin collapsing.
257
+ // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
258
+ `.is-root-container { display: flow-root; }
259
+ body { position: relative; padding: 32px !important; }` +
260
+ STYLE_BOOK_IFRAME_STYLES
261
+ }
262
+ </style>
269
263
  <Examples
270
264
  className={ classnames(
271
265
  'edit-site-style-book__examples',
@@ -1,5 +1,5 @@
1
1
  .edit-site-style-book {
2
- background: $white; // Fallback color, overriden by JavaScript.
2
+ background: $white; // Fallback color, overridden by JavaScript.
3
3
  border-radius: $radius-block-ui;
4
4
  bottom: 0;
5
5
  left: 0;