@wordpress/block-library 6.0.7 → 6.0.8

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 (70) hide show
  1. package/build/cover/transforms.js +2 -0
  2. package/build/cover/transforms.js.map +1 -1
  3. package/build/navigation/edit/index.js +14 -2
  4. package/build/navigation/edit/index.js.map +1 -1
  5. package/build/navigation/edit/inner-blocks.js +1 -1
  6. package/build/navigation/edit/inner-blocks.js.map +1 -1
  7. package/build/navigation/edit/responsive-wrapper.js +5 -2
  8. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  9. package/build/page-list/edit.js +40 -42
  10. package/build/page-list/edit.js.map +1 -1
  11. package/build/post-featured-image/edit.js +54 -23
  12. package/build/post-featured-image/edit.js.map +1 -1
  13. package/build-module/cover/transforms.js +2 -0
  14. package/build-module/cover/transforms.js.map +1 -1
  15. package/build-module/navigation/edit/index.js +14 -2
  16. package/build-module/navigation/edit/index.js.map +1 -1
  17. package/build-module/navigation/edit/inner-blocks.js +1 -1
  18. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  19. package/build-module/navigation/edit/responsive-wrapper.js +5 -2
  20. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  21. package/build-module/page-list/edit.js +41 -43
  22. package/build-module/page-list/edit.js.map +1 -1
  23. package/build-module/post-featured-image/edit.js +56 -26
  24. package/build-module/post-featured-image/edit.js.map +1 -1
  25. package/build-style/code/theme-rtl.css +1 -1
  26. package/build-style/code/theme.css +1 -1
  27. package/build-style/cover/style-rtl.css +8 -2
  28. package/build-style/cover/style.css +8 -2
  29. package/build-style/editor-rtl.css +101 -51
  30. package/build-style/editor.css +101 -51
  31. package/build-style/navigation/style-rtl.css +33 -1
  32. package/build-style/navigation/style.css +33 -1
  33. package/build-style/post-comments-form/style-rtl.css +18 -0
  34. package/build-style/post-comments-form/style.css +18 -0
  35. package/build-style/post-featured-image/editor-rtl.css +100 -16
  36. package/build-style/post-featured-image/editor.css +100 -16
  37. package/build-style/social-links/editor-rtl.css +1 -35
  38. package/build-style/social-links/editor.css +1 -35
  39. package/build-style/style-rtl.css +59 -25
  40. package/build-style/style.css +59 -25
  41. package/build-style/theme-rtl.css +1 -1
  42. package/build-style/theme.css +1 -1
  43. package/package.json +7 -7
  44. package/src/calendar/index.php +1 -1
  45. package/src/code/theme.scss +1 -1
  46. package/src/cover/style.scss +9 -2
  47. package/src/cover/transforms.js +2 -0
  48. package/src/gallery/index.php +1 -1
  49. package/src/home-link/index.php +1 -1
  50. package/src/image/index.php +1 -1
  51. package/src/navigation/edit/index.js +25 -0
  52. package/src/navigation/edit/inner-blocks.js +2 -1
  53. package/src/navigation/edit/responsive-wrapper.js +8 -1
  54. package/src/navigation/index.php +45 -5
  55. package/src/navigation/style.scss +46 -2
  56. package/src/navigation-area/index.php +1 -1
  57. package/src/navigation-link/index.php +1 -1
  58. package/src/navigation-submenu/index.php +2 -8
  59. package/src/page-list/edit.js +35 -44
  60. package/src/page-list/index.php +1 -1
  61. package/src/post-comments-form/style.scss +20 -1
  62. package/src/post-featured-image/edit.js +61 -26
  63. package/src/post-featured-image/editor.scss +124 -20
  64. package/src/site-logo/editor.scss +1 -0
  65. package/src/social-links/editor.scss +1 -47
  66. package/src/style.scss +0 -1
  67. package/src/table-of-contents/index.php +1 -1
  68. package/build-style/navigation-submenu/style-rtl.css +0 -97
  69. package/build-style/navigation-submenu/style.css +0 -97
  70. package/src/navigation-submenu/style.scss +0 -25
@@ -219,6 +219,36 @@
219
219
  }
220
220
  }
221
221
 
222
+ // General submenu colors.
223
+ // These styles are stored here as opposed to in the separate submenu block,
224
+ // so that they can affect both submenus and page lists with submenu items both.
225
+ .wp-block-navigation-submenu {
226
+ position: relative;
227
+ display: flex;
228
+
229
+ .wp-block-navigation__submenu-icon svg {
230
+ stroke: currentColor;
231
+ }
232
+ }
233
+
234
+ button.wp-block-navigation-item__content {
235
+ background-color: transparent;
236
+ border: none;
237
+ color: currentColor;
238
+ font-size: inherit;
239
+ font-family: inherit;
240
+ line-height: inherit;
241
+
242
+ // Buttons default to center alignment. This becomes visible
243
+ // when a menu item label is long enough to wrap.
244
+ text-align: left;
245
+ }
246
+
247
+ .wp-block-navigation-submenu__toggle {
248
+ cursor: pointer;
249
+ }
250
+
251
+
222
252
  /**
223
253
  * Margins
224
254
  */
@@ -325,6 +355,13 @@
325
355
  }
326
356
  }
327
357
 
358
+ // Allow menu items to be spaced out by space-between when only navigation links are present.
359
+ .wp-block-navigation__container:only-child,
360
+ .wp-block-page-list:only-child {
361
+ flex-grow: 1;
362
+ }
363
+
364
+
328
365
  /**
329
366
  * Mobile menu.
330
367
  */
@@ -345,6 +382,13 @@
345
382
  align-items: var(--layout-align, initial);
346
383
  }
347
384
 
385
+ // If the responsive wrapper is present but overlay is not open,
386
+ // overlay styles shouldn't apply.
387
+ &:not(.is-menu-open.is-menu-open) {
388
+ color: inherit !important;
389
+ background-color: inherit !important;
390
+ }
391
+
348
392
  // Overlay menu.
349
393
  // Provide an opinionated default style for menu items inside.
350
394
  // Inherit as much as we can regarding colors, fonts, sizes,
@@ -432,9 +476,9 @@
432
476
 
433
477
  // Remove background colors for items inside the overlay menu.
434
478
  // Has to be !important to override global styles.
435
- // @todo: We should revisit this so that the overlay colors can be applied, instead of the background.
436
479
  .wp-block-navigation-item .wp-block-navigation__submenu-container,
437
- .wp-block-navigation-item {
480
+ .wp-block-navigation-item,
481
+ .wp-block-page-list {
438
482
  color: inherit !important;
439
483
  background: transparent !important;
440
484
  }
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Server-side rendering of the `core/navigation-area` block.
4
4
  *
5
- * @package gutenberg
5
+ * @package WordPress
6
6
  */
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Server-side rendering of the `core/navigation-link` block.
4
4
  *
5
- * @package gutenberg
5
+ * @package WordPress
6
6
  */
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Server-side rendering of the `core/navigation-submenu` block.
4
4
  *
5
- * @package gutenberg
5
+ * @package WordPress
6
6
  */
7
7
 
8
8
  /**
@@ -19,7 +19,7 @@ function block_core_navigation_submenu_build_css_colors( $context, $attributes )
19
19
  'inline_styles' => '',
20
20
  );
21
21
 
22
- $is_sub_menu = isset( $attributes['isTopLevelLink'] ) ? ( ! $attributes['isTopLevelLink'] ) : false;
22
+ $is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false;
23
23
 
24
24
  // Text color.
25
25
  $named_text_color = null;
@@ -150,12 +150,6 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
150
150
  $has_submenu = count( $block->inner_blocks ) > 0;
151
151
  $is_active = ! empty( $attributes['id'] ) && ( get_the_ID() === $attributes['id'] );
152
152
 
153
- $class_name = ! empty( $attributes['className'] ) ? implode( ' ', (array) $attributes['className'] ) : false;
154
-
155
- if ( false !== $class_name ) {
156
- $css_classes .= ' ' . $class_name;
157
- }
158
-
159
153
  $show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'];
160
154
  $open_on_click = isset( $block->context['openSubmenusOnClick'] ) && $block->context['openSubmenusOnClick'];
161
155
  $open_on_hover_and_click = isset( $block->context['openSubmenusOnClick'] ) && ! $block->context['openSubmenusOnClick'] &&
@@ -14,9 +14,9 @@ import {
14
14
  } from '@wordpress/block-editor';
15
15
  import { ToolbarButton, Placeholder, Spinner } from '@wordpress/components';
16
16
  import { __ } from '@wordpress/i18n';
17
- import { useEffect, useState, memo } from '@wordpress/element';
18
- import apiFetch from '@wordpress/api-fetch';
19
- import { addQueryArgs } from '@wordpress/url';
17
+ import { useMemo, useState, memo } from '@wordpress/element';
18
+ import { useSelect } from '@wordpress/data';
19
+ import { store as coreStore } from '@wordpress/core-data';
20
20
 
21
21
  /**
22
22
  * Internal dependencies
@@ -70,7 +70,7 @@ export default function PageListEdit( { context, clientId } ) {
70
70
  clientId={ clientId }
71
71
  />
72
72
  ) }
73
- { totalPages === null && (
73
+ { totalPages === undefined && (
74
74
  <div { ...blockProps }>
75
75
  <Placeholder>
76
76
  <Spinner />
@@ -95,48 +95,39 @@ export default function PageListEdit( { context, clientId } ) {
95
95
  }
96
96
 
97
97
  function usePagesByParentId() {
98
- const [ pagesByParentId, setPagesByParentId ] = useState( null );
99
- const [ totalPages, setTotalPages ] = useState( null );
100
-
101
- useEffect( () => {
102
- async function performFetch() {
103
- setPagesByParentId( null );
104
- setTotalPages( null );
105
-
106
- let pages = await apiFetch( {
107
- path: addQueryArgs( '/wp/v2/pages', {
108
- orderby: 'menu_order',
109
- order: 'asc',
110
- _fields: [ 'id', 'link', 'parent', 'title', 'menu_order' ],
111
- per_page: -1,
112
- } ),
113
- } );
114
-
115
- // TODO: Once the REST API supports passing multiple values to
116
- // 'orderby', this can be removed.
117
- // https://core.trac.wordpress.org/ticket/39037
118
- pages = sortBy( pages, [ 'menu_order', 'title.rendered' ] );
119
-
120
- setPagesByParentId(
121
- pages.reduce( ( accumulator, page ) => {
122
- const { parent } = page;
123
- if ( accumulator.has( parent ) ) {
124
- accumulator.get( parent ).push( page );
125
- } else {
126
- accumulator.set( parent, [ page ] );
127
- }
128
- return accumulator;
129
- }, new Map() )
130
- );
131
- setTotalPages( pages.length );
132
- }
133
- performFetch();
98
+ const { pages } = useSelect( ( select ) => {
99
+ const { getEntityRecords } = select( coreStore );
100
+
101
+ return {
102
+ pages: getEntityRecords( 'postType', 'page', {
103
+ orderby: 'menu_order',
104
+ order: 'asc',
105
+ _fields: [ 'id', 'link', 'parent', 'title', 'menu_order' ],
106
+ per_page: -1,
107
+ } ),
108
+ };
134
109
  }, [] );
135
110
 
136
- return {
137
- pagesByParentId,
138
- totalPages,
139
- };
111
+ return useMemo( () => {
112
+ // TODO: Once the REST API supports passing multiple values to
113
+ // 'orderby', this can be removed.
114
+ // https://core.trac.wordpress.org/ticket/39037
115
+ const sortedPages = sortBy( pages, [ 'menu_order', 'title.rendered' ] );
116
+ const pagesByParentId = sortedPages.reduce( ( accumulator, page ) => {
117
+ const { parent } = page;
118
+ if ( accumulator.has( parent ) ) {
119
+ accumulator.get( parent ).push( page );
120
+ } else {
121
+ accumulator.set( parent, [ page ] );
122
+ }
123
+ return accumulator;
124
+ }, new Map() );
125
+
126
+ return {
127
+ pagesByParentId,
128
+ totalPages: pages?.length,
129
+ };
130
+ }, [ pages ] );
140
131
  }
141
132
 
142
133
  const PageItems = memo( function PageItems( {
@@ -182,7 +182,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
182
182
  ) . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>' .
183
183
  '</button>';
184
184
  } else {
185
- $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . ' "href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . wp_kses(
185
+ $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . wp_kses(
186
186
  $page['title'],
187
187
  wp_kses_allowed_html( 'post' )
188
188
  ) . '</a>';
@@ -1,6 +1,25 @@
1
- // Styles copied from button block styles.
2
1
  .wp-block-post-comments-form {
2
+ &[style*="font-weight"] :where(.comment-reply-title) {
3
+ font-weight: inherit;
4
+ }
5
+ &[style*="font-family"] :where(.comment-reply-title) {
6
+ font-family: inherit;
7
+ }
8
+ &[class*="-font-size"] :where(.comment-reply-title),
9
+ &[style*="font-size"] :where(.comment-reply-title) {
10
+ font-size: inherit;
11
+ }
12
+ &[style*="line-height"] :where(.comment-reply-title) {
13
+ line-height: inherit;
14
+ }
15
+ &[style*="font-style"] :where(.comment-reply-title) {
16
+ font-style: inherit;
17
+ }
18
+ &[style*="letter-spacing"] :where(.comment-reply-title) {
19
+ letter-spacing: inherit;
20
+ }
3
21
 
22
+ // Styles copied from button block styles.
4
23
  input[type="submit"] {
5
24
  border: none;
6
25
  box-shadow: none;
@@ -2,34 +2,49 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useEntityProp, store as coreStore } from '@wordpress/core-data';
5
- import { useSelect } from '@wordpress/data';
5
+ import { useSelect, useDispatch } from '@wordpress/data';
6
6
  import {
7
- Icon,
8
7
  ToggleControl,
9
8
  PanelBody,
10
- withNotices,
9
+ Placeholder,
10
+ Button,
11
11
  } from '@wordpress/components';
12
12
  import {
13
13
  InspectorControls,
14
14
  BlockControls,
15
15
  MediaPlaceholder,
16
16
  MediaReplaceFlow,
17
- BlockIcon,
18
17
  useBlockProps,
19
18
  } from '@wordpress/block-editor';
20
19
  import { __, sprintf } from '@wordpress/i18n';
21
- import { postFeaturedImage } from '@wordpress/icons';
20
+ import { upload } from '@wordpress/icons';
21
+ import { SVG, Path } from '@wordpress/primitives';
22
+ import { store as noticesStore } from '@wordpress/notices';
22
23
 
23
24
  /**
24
25
  * Internal dependencies
25
26
  */
26
27
  import DimensionControls from './dimension-controls';
27
28
 
29
+ const placeholderIllustration = (
30
+ <SVG
31
+ className="components-placeholder__illustration"
32
+ fill="none"
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ viewBox="0 0 60 60"
35
+ preserveAspectRatio="xMidYMid slice" // @todo: "slice" matches the "cover" behavior, "meet" could be used for "container" and "fill" values.
36
+ >
37
+ <Path
38
+ vectorEffect="non-scaling-stroke"
39
+ d="m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"
40
+ />
41
+ </SVG>
42
+ );
43
+
28
44
  const ALLOWED_MEDIA_TYPES = [ 'image' ];
29
45
  const placeholderChip = (
30
- <div className="post-featured-image_placeholder">
31
- <Icon icon={ postFeaturedImage } />
32
- <p> { __( 'Featured Image' ) }</p>
46
+ <div className="wp-block-post-featured-image__placeholder">
47
+ { placeholderIllustration }
33
48
  </div>
34
49
  );
35
50
 
@@ -37,8 +52,6 @@ function PostFeaturedImageDisplay( {
37
52
  attributes,
38
53
  setAttributes,
39
54
  context: { postId, postType, queryId },
40
- noticeUI,
41
- noticeOperations,
42
55
  } ) {
43
56
  const isDescendentOfQueryLoop = !! queryId;
44
57
  const { isLink, height, width, scale } = attributes;
@@ -48,42 +61,66 @@ function PostFeaturedImageDisplay( {
48
61
  'featured_media',
49
62
  postId
50
63
  );
64
+
51
65
  const media = useSelect(
52
66
  ( select ) =>
53
67
  featuredImage &&
54
68
  select( coreStore ).getMedia( featuredImage, { context: 'view' } ),
55
69
  [ featuredImage ]
56
70
  );
71
+
57
72
  const blockProps = useBlockProps( {
58
- style: { width },
73
+ style: { width, height },
59
74
  } );
75
+
76
+ const placeholder = ( content ) => {
77
+ return (
78
+ <Placeholder className="block-editor-media-placeholder">
79
+ { placeholderIllustration }
80
+ { content }
81
+ </Placeholder>
82
+ );
83
+ };
84
+
60
85
  const onSelectImage = ( value ) => {
61
86
  if ( value?.id ) {
62
87
  setFeaturedImage( value.id );
63
88
  }
64
89
  };
65
- function onUploadError( message ) {
66
- noticeOperations.removeAllNotices();
67
- noticeOperations.createErrorNotice( message );
68
- }
90
+
91
+ const { createErrorNotice } = useDispatch( noticesStore );
92
+ const onUploadError = ( message ) => {
93
+ createErrorNotice( message[ 2 ], { type: 'snackbar' } );
94
+ };
95
+
69
96
  let image;
70
97
  if ( ! featuredImage && isDescendentOfQueryLoop ) {
71
98
  return <div { ...blockProps }>{ placeholderChip }</div>;
72
99
  }
100
+
101
+ const label = __( 'Add a featured image' );
102
+
73
103
  if ( ! featuredImage ) {
74
104
  image = (
75
105
  <MediaPlaceholder
76
- icon={ <BlockIcon icon={ postFeaturedImage } /> }
77
106
  onSelect={ onSelectImage }
78
- notices={ noticeUI }
79
- onError={ onUploadError }
80
107
  accept="image/*"
81
108
  allowedTypes={ ALLOWED_MEDIA_TYPES }
82
- labels={ {
83
- title: __( 'Featured image' ),
84
- instructions: __(
85
- 'Upload a media file or pick one from your media library.'
86
- ),
109
+ onError={ onUploadError }
110
+ placeholder={ placeholder }
111
+ mediaLibraryButton={ ( { open } ) => {
112
+ return (
113
+ <Button
114
+ icon={ upload }
115
+ variant="primary"
116
+ label={ label }
117
+ showTooltip
118
+ tooltipPosition="top center"
119
+ onClick={ () => {
120
+ open();
121
+ } }
122
+ />
123
+ );
87
124
  } }
88
125
  />
89
126
  );
@@ -136,12 +173,10 @@ function PostFeaturedImageDisplay( {
136
173
  );
137
174
  }
138
175
 
139
- const PostFeaturedImageWithNotices = withNotices( PostFeaturedImageDisplay );
140
-
141
176
  export default function PostFeaturedImageEdit( props ) {
142
177
  const blockProps = useBlockProps();
143
178
  if ( ! props.context?.postId ) {
144
179
  return <div { ...blockProps }>{ placeholderChip }</div>;
145
180
  }
146
- return <PostFeaturedImageWithNotices { ...props } />;
181
+ return <PostFeaturedImageDisplay { ...props } />;
147
182
  }
@@ -1,33 +1,137 @@
1
- div[data-type="core/post-featured-image"] {
2
- img {
3
- max-width: 100%;
4
- height: auto;
5
- display: block;
1
+ // Give the featured image placeholder the appearance of a literal image placeholder.
2
+ // @todo: this CSS is similar to that of the Site Logo. That makes it an opportunity
3
+ // to create a new component for placeholders meant to inherit some theme styles.
4
+ .wp-block-post-featured-image.wp-block-post-featured-image {
5
+ // Inherit border radius from style variations.
6
+ .components-placeholder,
7
+ .components-resizable-box__container {
8
+ border-radius: inherit;
6
9
  }
7
- }
8
10
 
9
- .editor-styles-wrapper {
10
- .post-featured-image_placeholder {
11
- display: flex;
12
- flex-direction: row;
11
+ // Style the placeholder.
12
+ .wp-block-post-featured-image__placeholder,
13
+ .components-placeholder {
14
+ justify-content: center;
13
15
  align-items: center;
14
- border-radius: $radius-block-ui;
15
- background-color: $white;
16
- box-shadow: inset 0 0 0 $border-width $gray-900;
17
- padding: $grid-unit-15;
18
- svg {
19
- margin-right: $grid-unit-15;
16
+ box-shadow: none;
17
+ padding: 0;
18
+
19
+ // Hide the upload button, as it's also available in the media library.
20
+ .components-form-file-upload {
21
+ display: none;
22
+ }
23
+
24
+ // Position the spinner.
25
+ .components-placeholder__preview {
26
+ position: absolute;
27
+ top: $grid-unit-05;
28
+ right: $grid-unit-05;
29
+ bottom: $grid-unit-05;
30
+ left: $grid-unit-05;
31
+ background: rgba($white, 0.8);
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ }
36
+
37
+ // Draw the dashed outline.
38
+ // By setting the dashed border to currentColor, we ensure it's visible
39
+ // against any background color.
40
+ color: currentColor;
41
+ background: transparent;
42
+ &::before {
43
+ content: "";
44
+ display: block;
45
+ position: absolute;
46
+ top: 0;
47
+ right: 0;
48
+ bottom: 0;
49
+ left: 0;
50
+ border: $border-width dashed currentColor;
51
+ opacity: 0.3;
52
+ pointer-events: none;
53
+
54
+ // Inherit border radius from style variations.
55
+ border-radius: inherit;
56
+ }
57
+
58
+ // Style the upload button.
59
+ .components-placeholder__fieldset {
60
+ width: auto;
61
+ }
62
+
63
+ .components-button.components-button {
64
+ color: inherit;
65
+ padding: 0;
66
+ display: flex;
67
+ justify-content: center;
68
+ align-items: center;
69
+ width: $grid-unit-60;
70
+ height: $grid-unit-60;
71
+ border-radius: 50%;
72
+ position: relative;
73
+ visibility: hidden;
74
+
75
+ // Animation.
76
+ background: transparent;
77
+ transition: all 0.1s linear;
78
+ @include reduce-motion("transition");
20
79
  }
21
- p {
22
- font-family: $default-font;
23
- font-size: $default-font-size;
24
- margin: 0;
80
+
81
+ .components-button.components-button > svg {
82
+ color: $white;
83
+ }
84
+
85
+ // Style the placeholder illustration.
86
+ .components-placeholder__illustration {
87
+ position: absolute;
88
+ top: 0;
89
+ right: 0;
90
+ bottom: 0;
91
+ left: 0;
92
+ width: 100%;
93
+ height: 100%;
94
+ stroke: currentColor;
95
+ stroke-dasharray: 3;
96
+ opacity: 0.3;
25
97
  }
98
+
99
+ // Show default placeholder height when not resized.
100
+ min-height: 200px;
101
+ }
102
+
103
+ // Provide a minimum size for the placeholder when resized.
104
+ // Note, this should be as small as we can afford it, and exists only
105
+ // to ensure there's room for the upload button.
106
+ &[style*="height"] .components-placeholder {
107
+ min-height: $grid-unit-60;
108
+ min-width: $grid-unit-60;
109
+ height: 100%;
110
+ width: 100%;
111
+ }
112
+
113
+ // Show upload button on block selection.
114
+ &.is-selected .components-button.components-button {
115
+ background: var(--wp-admin-theme-color);
116
+ border-color: var(--wp-admin-theme-color);
117
+ border-style: solid;
118
+ color: $white;
119
+ opacity: 1;
120
+ visibility: visible;
121
+ }
122
+ }
123
+
124
+ div[data-type="core/post-featured-image"] {
125
+ img {
126
+ max-width: 100%;
127
+ height: auto;
128
+ display: block;
26
129
  }
27
130
  }
28
131
 
29
132
  .block-library-post-featured-image-dimension-controls {
30
133
  margin-bottom: $grid-unit-10;
134
+
31
135
  &.scale-control-is-visible {
32
136
  margin-bottom: $grid-unit-20;
33
137
  }
@@ -57,6 +57,7 @@
57
57
  width: 120px;
58
58
  }
59
59
 
60
+ // Style the placeholder.
60
61
  .components-placeholder {
61
62
  justify-content: center;
62
63
  align-items: center;
@@ -37,7 +37,6 @@
37
37
  display: flex;
38
38
  }
39
39
 
40
- & + .block-list-appender,
41
40
  .wp-social-link {
42
41
  padding: 0.25em;
43
42
 
@@ -66,6 +65,7 @@
66
65
 
67
66
  // Selected placeholder state.
68
67
  .wp-block-social-links .wp-block-social-links__social-prompt {
68
+ min-height: $button-size-small;
69
69
  list-style: none;
70
70
  order: 2; // Move after the appender button. Because this element is non-interactive, it does not affect tab order.
71
71
 
@@ -77,52 +77,6 @@
77
77
  margin-bottom: auto;
78
78
  cursor: default;
79
79
  padding-right: $grid-unit-10;
80
-
81
- & + .block-list-appender {
82
- margin-right: $grid-unit-10;
83
- padding: 0.25em;
84
- }
85
- }
86
-
87
- // Polish the Appender.
88
- .wp-block-social-links .block-list-appender {
89
- // Match the overall silhouette of social links.
90
- margin: 4px auto 4px 0;
91
- border-radius: 9999px; // This works as both circular and pill shapes.
92
-
93
- // Treat just like a social icon.
94
- .block-editor-inserter {
95
- display: flex;
96
- align-items: center;
97
- justify-content: center;
98
- font-size: inherit;
99
- width: 1em;
100
- height: 1em;
101
- }
102
-
103
- // Duplicate the font sizes from style.scss to size the appender.
104
- .has-small-icon-size & {
105
- font-size: 16px; // 16 makes for a quarter-padding that keeps the icon centered.
106
- }
107
-
108
- // Normal/default.
109
- .has-normal-icon-size & {
110
- font-size: 24px;
111
- }
112
-
113
- // Large.
114
- .has-large-icon-size & {
115
- font-size: 36px;
116
- }
117
-
118
- // Huge.
119
- .has-huge-icon-size & {
120
- font-size: 48px;
121
- }
122
-
123
- &::before {
124
- content: none;
125
- }
126
80
  }
127
81
 
128
82
  // Center flex items. This has an equivalent in style.scss.
package/src/style.scss CHANGED
@@ -19,7 +19,6 @@
19
19
  @import "./media-text/style.scss";
20
20
  @import "./navigation/style.scss";
21
21
  @import "./navigation-link/style.scss";
22
- @import "./navigation-submenu/style.scss";
23
22
  @import "./home-link/style.scss";
24
23
  @import "./page-list/style.scss";
25
24
  @import "./paragraph/style.scss";
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Server-side rendering of the `core/table-of-contents` block.
4
4
  *
5
- * @package gutenberg
5
+ * @package WordPress
6
6
  */
7
7
 
8
8
  /**