@wordpress/block-library 9.18.0 → 9.19.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 (82) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/cover/edit/index.js +3 -1
  3. package/build/cover/edit/index.js.map +1 -1
  4. package/build/form/edit.js +4 -2
  5. package/build/form/edit.js.map +1 -1
  6. package/build/image/view.js +4 -4
  7. package/build/image/view.js.map +1 -1
  8. package/build/navigation/view.js +2 -2
  9. package/build/navigation/view.js.map +1 -1
  10. package/build/navigation-link/edit.js +2 -1
  11. package/build/navigation-link/edit.js.map +1 -1
  12. package/build/navigation-submenu/edit.js +2 -1
  13. package/build/navigation-submenu/edit.js.map +1 -1
  14. package/build/post-comments-count/index.js +8 -1
  15. package/build/post-comments-count/index.js.map +1 -1
  16. package/build/post-navigation-link/edit.js +1 -1
  17. package/build/post-navigation-link/edit.js.map +1 -1
  18. package/build/query/view.js +2 -2
  19. package/build/query/view.js.map +1 -1
  20. package/build/search/view.js +2 -2
  21. package/build/search/view.js.map +1 -1
  22. package/build/site-logo/edit.js +2 -5
  23. package/build/site-logo/edit.js.map +1 -1
  24. package/build/video/edit-common-settings.js +10 -3
  25. package/build/video/edit-common-settings.js.map +1 -1
  26. package/build-module/cover/edit/index.js +3 -1
  27. package/build-module/cover/edit/index.js.map +1 -1
  28. package/build-module/form/edit.js +4 -2
  29. package/build-module/form/edit.js.map +1 -1
  30. package/build-module/image/view.js +5 -5
  31. package/build-module/image/view.js.map +1 -1
  32. package/build-module/navigation/view.js +3 -3
  33. package/build-module/navigation/view.js.map +1 -1
  34. package/build-module/navigation-link/edit.js +2 -1
  35. package/build-module/navigation-link/edit.js.map +1 -1
  36. package/build-module/navigation-submenu/edit.js +2 -1
  37. package/build-module/navigation-submenu/edit.js.map +1 -1
  38. package/build-module/post-comments-count/index.js +8 -1
  39. package/build-module/post-comments-count/index.js.map +1 -1
  40. package/build-module/post-navigation-link/edit.js +1 -1
  41. package/build-module/post-navigation-link/edit.js.map +1 -1
  42. package/build-module/query/view.js +3 -3
  43. package/build-module/query/view.js.map +1 -1
  44. package/build-module/search/view.js +3 -3
  45. package/build-module/search/view.js.map +1 -1
  46. package/build-module/site-logo/edit.js +2 -5
  47. package/build-module/site-logo/edit.js.map +1 -1
  48. package/build-module/video/edit-common-settings.js +10 -3
  49. package/build-module/video/edit-common-settings.js.map +1 -1
  50. package/build-style/editor-rtl.css +6 -9
  51. package/build-style/editor.css +6 -9
  52. package/build-style/navigation-link/editor-rtl.css +5 -9
  53. package/build-style/navigation-link/editor.css +5 -9
  54. package/build-style/post-comments-count/style-rtl.css +103 -0
  55. package/build-style/post-comments-count/style.css +103 -0
  56. package/build-style/pullquote/style-rtl.css +4 -0
  57. package/build-style/pullquote/style.css +4 -0
  58. package/build-style/social-link/editor-rtl.css +1 -0
  59. package/build-style/social-link/editor.css +1 -0
  60. package/build-style/style-rtl.css +8 -0
  61. package/build-style/style.css +8 -0
  62. package/package.json +35 -35
  63. package/src/cover/edit/index.js +2 -0
  64. package/src/cover/test/edit.js +6 -6
  65. package/src/form/edit.js +2 -0
  66. package/src/image/view.js +10 -5
  67. package/src/navigation/view.js +8 -3
  68. package/src/navigation-link/edit.js +1 -0
  69. package/src/navigation-link/editor.scss +3 -24
  70. package/src/navigation-submenu/edit.js +1 -0
  71. package/src/post-comments-count/block.json +8 -1
  72. package/src/post-comments-count/style.scss +4 -0
  73. package/src/post-navigation-link/edit.js +1 -1
  74. package/src/pullquote/style.scss +4 -0
  75. package/src/query/view.js +8 -3
  76. package/src/query-total/index.php +2 -0
  77. package/src/search/view.js +8 -3
  78. package/src/site-logo/edit.js +1 -5
  79. package/src/social-link/editor.scss +1 -0
  80. package/src/style.scss +1 -0
  81. package/src/template-part/index.php +3 -1
  82. package/src/video/edit-common-settings.js +11 -2
@@ -2931,6 +2931,10 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2931
2931
  margin-right: 0.5em;
2932
2932
  }
2933
2933
 
2934
+ .wp-block-post-comments-count {
2935
+ box-sizing: border-box;
2936
+ }
2937
+
2934
2938
  .wp-block-post-content {
2935
2939
  display: flow-root;
2936
2940
  }
@@ -3127,6 +3131,10 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3127
3131
  text-align: left;
3128
3132
  }
3129
3133
 
3134
+ .wp-block-pullquote.has-text-align-center blockquote {
3135
+ text-align: center;
3136
+ }
3137
+
3130
3138
  .wp-block-pullquote.is-style-solid-color {
3131
3139
  border: none;
3132
3140
  }
@@ -2963,6 +2963,10 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2963
2963
  margin-left: 0.5em;
2964
2964
  }
2965
2965
 
2966
+ .wp-block-post-comments-count {
2967
+ box-sizing: border-box;
2968
+ }
2969
+
2966
2970
  .wp-block-post-content {
2967
2971
  display: flow-root;
2968
2972
  }
@@ -3159,6 +3163,10 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3159
3163
  text-align: right;
3160
3164
  }
3161
3165
 
3166
+ .wp-block-pullquote.has-text-align-center blockquote {
3167
+ text-align: center;
3168
+ }
3169
+
3162
3170
  .wp-block-pullquote.is-style-solid-color {
3163
3171
  border: none;
3164
3172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.18.0",
3
+ "version": "9.19.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,39 +41,39 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@babel/runtime": "7.25.7",
44
- "@wordpress/a11y": "^4.18.0",
45
- "@wordpress/api-fetch": "^7.18.0",
46
- "@wordpress/autop": "^4.18.0",
47
- "@wordpress/blob": "^4.18.0",
48
- "@wordpress/block-editor": "^14.13.0",
49
- "@wordpress/blocks": "^14.7.0",
50
- "@wordpress/components": "^29.4.0",
51
- "@wordpress/compose": "^7.18.0",
52
- "@wordpress/core-data": "^7.18.0",
53
- "@wordpress/data": "^10.18.0",
54
- "@wordpress/date": "^5.18.0",
55
- "@wordpress/deprecated": "^4.18.0",
56
- "@wordpress/dom": "^4.18.0",
57
- "@wordpress/element": "^6.18.0",
58
- "@wordpress/escape-html": "^3.18.0",
59
- "@wordpress/hooks": "^4.18.0",
60
- "@wordpress/html-entities": "^4.18.0",
61
- "@wordpress/i18n": "^5.18.0",
62
- "@wordpress/icons": "^10.18.0",
63
- "@wordpress/interactivity": "^6.18.0",
64
- "@wordpress/interactivity-router": "^2.18.0",
65
- "@wordpress/keyboard-shortcuts": "^5.18.0",
66
- "@wordpress/keycodes": "^4.18.0",
67
- "@wordpress/notices": "^5.18.0",
68
- "@wordpress/patterns": "^2.18.0",
69
- "@wordpress/primitives": "^4.18.0",
70
- "@wordpress/private-apis": "^1.18.0",
71
- "@wordpress/reusable-blocks": "^5.18.0",
72
- "@wordpress/rich-text": "^7.18.0",
73
- "@wordpress/server-side-render": "^5.18.0",
74
- "@wordpress/url": "^4.18.0",
75
- "@wordpress/viewport": "^6.18.0",
76
- "@wordpress/wordcount": "^4.18.0",
44
+ "@wordpress/a11y": "^4.19.0",
45
+ "@wordpress/api-fetch": "^7.19.0",
46
+ "@wordpress/autop": "^4.19.0",
47
+ "@wordpress/blob": "^4.19.0",
48
+ "@wordpress/block-editor": "^14.14.0",
49
+ "@wordpress/blocks": "^14.8.0",
50
+ "@wordpress/components": "^29.5.0",
51
+ "@wordpress/compose": "^7.19.0",
52
+ "@wordpress/core-data": "^7.19.0",
53
+ "@wordpress/data": "^10.19.0",
54
+ "@wordpress/date": "^5.19.0",
55
+ "@wordpress/deprecated": "^4.19.0",
56
+ "@wordpress/dom": "^4.19.0",
57
+ "@wordpress/element": "^6.19.0",
58
+ "@wordpress/escape-html": "^3.19.0",
59
+ "@wordpress/hooks": "^4.19.0",
60
+ "@wordpress/html-entities": "^4.19.0",
61
+ "@wordpress/i18n": "^5.19.0",
62
+ "@wordpress/icons": "^10.19.0",
63
+ "@wordpress/interactivity": "^6.19.0",
64
+ "@wordpress/interactivity-router": "^2.19.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.19.0",
66
+ "@wordpress/keycodes": "^4.19.0",
67
+ "@wordpress/notices": "^5.19.0",
68
+ "@wordpress/patterns": "^2.19.0",
69
+ "@wordpress/primitives": "^4.19.0",
70
+ "@wordpress/private-apis": "^1.19.0",
71
+ "@wordpress/reusable-blocks": "^5.19.0",
72
+ "@wordpress/rich-text": "^7.19.0",
73
+ "@wordpress/server-side-render": "^5.19.0",
74
+ "@wordpress/url": "^4.19.0",
75
+ "@wordpress/viewport": "^6.19.0",
76
+ "@wordpress/wordcount": "^4.19.0",
77
77
  "change-case": "^4.1.2",
78
78
  "clsx": "^2.1.1",
79
79
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "afe4fb333177642180ac020f1030c5685eab7183"
94
+ "gitHead": "d6b0b20fa927b110140dc7fdd906a7e0bf662004"
95
95
  }
@@ -514,6 +514,8 @@ function CoverEdit( {
514
514
  value={ overlayColor.color }
515
515
  onChange={ onSetOverlayColor }
516
516
  clearable={ false }
517
+ asButtons
518
+ aria-label={ __( 'Overlay color' ) }
517
519
  />
518
520
  </div>
519
521
  </CoverPlaceholder>
@@ -47,7 +47,7 @@ async function setup( attributes, useCoreBlocks, customSettings ) {
47
47
 
48
48
  async function createAndSelectBlock() {
49
49
  await userEvent.click(
50
- screen.getByRole( 'option', {
50
+ screen.getByRole( 'button', {
51
51
  name: 'Black',
52
52
  } )
53
53
  );
@@ -72,7 +72,7 @@ describe( 'Cover block', () => {
72
72
 
73
73
  test( 'can set overlay color using color picker on block placeholder', async () => {
74
74
  const { container } = await setup();
75
- const colorPicker = screen.getByRole( 'option', {
75
+ const colorPicker = screen.getByRole( 'button', {
76
76
  name: 'Black',
77
77
  } );
78
78
  await userEvent.click( colorPicker );
@@ -96,7 +96,7 @@ describe( 'Cover block', () => {
96
96
  await setup();
97
97
 
98
98
  await userEvent.click(
99
- screen.getByRole( 'option', {
99
+ screen.getByRole( 'button', {
100
100
  name: 'Black',
101
101
  } )
102
102
  );
@@ -389,7 +389,7 @@ describe( 'Cover block', () => {
389
389
  describe( 'isDark settings', () => {
390
390
  test( 'should toggle is-light class if background changed from light to dark', async () => {
391
391
  await setup();
392
- const colorPicker = screen.getByRole( 'option', {
392
+ const colorPicker = screen.getByRole( 'button', {
393
393
  name: 'White',
394
394
  } );
395
395
  await userEvent.click( colorPicker );
@@ -413,7 +413,7 @@ describe( 'Cover block', () => {
413
413
  } );
414
414
  test( 'should remove is-light class if overlay color is removed', async () => {
415
415
  await setup();
416
- const colorPicker = screen.getByRole( 'option', {
416
+ const colorPicker = screen.getByRole( 'button', {
417
417
  name: 'White',
418
418
  } );
419
419
  await userEvent.click( colorPicker );
@@ -426,7 +426,7 @@ describe( 'Cover block', () => {
426
426
  } )
427
427
  );
428
428
  await userEvent.click( screen.getByText( 'Overlay' ) );
429
- // The default color is black, so clicking the black color option will remove the background color,
429
+ // The default color is black, so clicking the black color button will remove the background color,
430
430
  // which should remove the isDark setting and assign the is-light class.
431
431
  const popupColorPicker = screen.getByRole( 'option', {
432
432
  name: 'White',
package/src/form/edit.js CHANGED
@@ -123,6 +123,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
123
123
  help={ __(
124
124
  'The email address where form submissions will be sent. Separate multiple email addresses with a comma.'
125
125
  ) }
126
+ type="email"
126
127
  />
127
128
  ) }
128
129
  </PanelBody>
@@ -159,6 +160,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
159
160
  help={ __(
160
161
  'The URL where the form should be submitted.'
161
162
  ) }
163
+ type="url"
162
164
  />
163
165
  </InspectorControls>
164
166
  ) }
package/src/image/view.js CHANGED
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { store, getContext, getElement } from '@wordpress/interactivity';
4
+ import {
5
+ store,
6
+ getContext,
7
+ getElement,
8
+ withSyncEvent,
9
+ } from '@wordpress/interactivity';
5
10
 
6
11
  /**
7
12
  * Tracks whether user is touching screen; used to differentiate behavior for
@@ -128,7 +133,7 @@ const { state, actions, callbacks } = store(
128
133
  }, 450 );
129
134
  }
130
135
  },
131
- handleKeydown( event ) {
136
+ handleKeydown: withSyncEvent( ( event ) => {
132
137
  if ( state.overlayEnabled ) {
133
138
  // Focuses the close button when the user presses the tab key.
134
139
  if ( event.key === 'Tab' ) {
@@ -141,8 +146,8 @@ const { state, actions, callbacks } = store(
141
146
  actions.hideLightbox();
142
147
  }
143
148
  }
144
- },
145
- handleTouchMove( event ) {
149
+ } ),
150
+ handleTouchMove: withSyncEvent( ( event ) => {
146
151
  // On mobile devices, prevents triggering the scroll event because
147
152
  // otherwise the page jumps around when it resets the scroll position.
148
153
  // This also means that closing the lightbox requires that a user
@@ -152,7 +157,7 @@ const { state, actions, callbacks } = store(
152
157
  if ( state.overlayEnabled ) {
153
158
  event.preventDefault();
154
159
  }
155
- },
160
+ } ),
156
161
  handleTouchStart() {
157
162
  isTouching = true;
158
163
  },
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { store, getContext, getElement } from '@wordpress/interactivity';
4
+ import {
5
+ store,
6
+ getContext,
7
+ getElement,
8
+ withSyncEvent,
9
+ } from '@wordpress/interactivity';
5
10
 
6
11
  const focusableSelectors = [
7
12
  'a[href]',
@@ -106,7 +111,7 @@ const { state, actions } = store(
106
111
  actions.openMenu( 'click' );
107
112
  }
108
113
  },
109
- handleMenuKeydown( event ) {
114
+ handleMenuKeydown: withSyncEvent( ( event ) => {
110
115
  const { type, firstFocusableElement, lastFocusableElement } =
111
116
  getContext();
112
117
  if ( state.menuOpenedBy.click ) {
@@ -137,7 +142,7 @@ const { state, actions } = store(
137
142
  }
138
143
  }
139
144
  }
140
- },
145
+ } ),
141
146
  handleMenuFocusout( event ) {
142
147
  const { modal, type } = getContext();
143
148
  // If focus is outside modal, and in the document, close menu
@@ -201,6 +201,7 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
201
201
  );
202
202
  } }
203
203
  autoComplete="off"
204
+ type="url"
204
205
  />
205
206
  </ToolsPanelItem>
206
207
 
@@ -82,30 +82,9 @@
82
82
  // Draw a wavy underline.
83
83
  .wp-block-navigation-link__placeholder-text {
84
84
  span {
85
- $blur: 10%;
86
- $width: 6%;
87
- $stop1: 30%;
88
- $stop2: 64%;
89
-
90
- --wp-underline-color: var(--wp-admin-theme-color);
91
-
92
- background-image:
93
- linear-gradient(45deg, transparent ($stop1 - $blur), var(--wp-underline-color) $stop1, var(--wp-underline-color) ($stop1 + $width), transparent ($stop1 + $width + $blur)),
94
- linear-gradient(135deg, transparent ($stop2 - $blur), var(--wp-underline-color) $stop2, var(--wp-underline-color) ($stop2 + $width), transparent ($stop2 + $width + $blur));
95
- background-position: 0 100%;
96
- background-size: 6px 3px;
97
- background-repeat: repeat-x;
98
-
99
- // Since applied to a span, it doesn't change the footprint of the item,
100
- // but it does vertically shift the underline to better align.
101
- padding-bottom: 0.1em;
102
- }
103
-
104
- &.is-invalid,
105
- &.is-draft {
106
- span {
107
- --wp-underline-color: #{$alert-red};
108
- }
85
+ text-decoration: wavy underline;
86
+ text-decoration-skip-ink: none;
87
+ text-underline-offset: 0.25rem;
109
88
  }
110
89
  }
111
90
 
@@ -431,6 +431,7 @@ export default function NavigationSubmenuEdit( {
431
431
  } }
432
432
  label={ __( 'Link' ) }
433
433
  autoComplete="off"
434
+ type="url"
434
435
  />
435
436
  </ToolsPanelItem>
436
437
 
@@ -39,8 +39,15 @@
39
39
  "fontSize": true
40
40
  }
41
41
  },
42
+ "__experimentalBorder": {
43
+ "radius": true,
44
+ "color": true,
45
+ "width": true,
46
+ "style": true
47
+ },
42
48
  "interactivity": {
43
49
  "clientNavigation": true
44
50
  }
45
- }
51
+ },
52
+ "style": "wp-block-post-comments-count"
46
53
  }
@@ -0,0 +1,4 @@
1
+ .wp-block-post-comments-count {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+ }
@@ -198,7 +198,7 @@ export default function PostNavigationLinkEdit( {
198
198
  aria-label={ ariaLabel }
199
199
  placeholder={ placeholder }
200
200
  value={ label }
201
- allowedFormats={ [ 'core/bold', 'core/italic' ] }
201
+ withoutInteractiveFormatting
202
202
  onChange={ ( newLabel ) =>
203
203
  setAttributes( { label: newLabel } )
204
204
  }
@@ -46,6 +46,10 @@
46
46
  .wp-block-pullquote.has-text-align-right blockquote {
47
47
  text-align: right;
48
48
  }
49
+ // Ensure that we are reasonably specific to override theme defaults.
50
+ .wp-block-pullquote.has-text-align-center blockquote {
51
+ text-align: center;
52
+ }
49
53
 
50
54
  // .is-style-solid-color is deprecated.
51
55
  // This selector has not been scoped with `:root :where`, as global styles
package/src/query/view.js CHANGED
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { store, getContext, getElement } from '@wordpress/interactivity';
4
+ import {
5
+ store,
6
+ getContext,
7
+ getElement,
8
+ withSyncEvent,
9
+ } from '@wordpress/interactivity';
5
10
 
6
11
  const isValidLink = ( ref ) =>
7
12
  ref &&
@@ -22,7 +27,7 @@ store(
22
27
  'core/query',
23
28
  {
24
29
  actions: {
25
- *navigate( event ) {
30
+ navigate: withSyncEvent( function* ( event ) {
26
31
  const ctx = getContext();
27
32
  const { ref } = getElement();
28
33
  const queryRef = ref.closest(
@@ -42,7 +47,7 @@ store(
42
47
  const firstAnchor = `.wp-block-post-template a[href]`;
43
48
  queryRef.querySelector( firstAnchor )?.focus();
44
49
  }
45
- },
50
+ } ),
46
51
  *prefetch() {
47
52
  const { ref } = getElement();
48
53
  if ( isValidLink( ref ) ) {
@@ -10,6 +10,8 @@
10
10
  *
11
11
  * @since 6.8.0
12
12
  *
13
+ * @global WP_Query $wp_query WordPress Query object.
14
+ *
13
15
  * @param array $attributes Block attributes.
14
16
  * @param string $content Block default content.
15
17
  * @param WP_Block $block Block instance.
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { store, getContext, getElement } from '@wordpress/interactivity';
4
+ import {
5
+ store,
6
+ getContext,
7
+ getElement,
8
+ withSyncEvent,
9
+ } from '@wordpress/interactivity';
5
10
 
6
11
  const { actions } = store(
7
12
  'core/search',
@@ -31,7 +36,7 @@ const { actions } = store(
31
36
  },
32
37
  },
33
38
  actions: {
34
- openSearchInput( event ) {
39
+ openSearchInput: withSyncEvent( ( event ) => {
35
40
  const ctx = getContext();
36
41
  const { ref } = getElement();
37
42
  if ( ! ctx.isSearchInputVisible ) {
@@ -39,7 +44,7 @@ const { actions } = store(
39
44
  ctx.isSearchInputVisible = true;
40
45
  ref.parentElement.querySelector( 'input' ).focus();
41
46
  }
42
- },
47
+ } ),
43
48
  closeSearchInput() {
44
49
  const ctx = getContext();
45
50
  ctx.isSearchInputVisible = false;
@@ -499,11 +499,6 @@ export default function LogoEdit( {
499
499
  };
500
500
 
501
501
  const onFilesDrop = ( filesList ) => {
502
- if ( filesList?.length > 1 ) {
503
- onUploadError( __( 'Only one image can be used as a site logo.' ) );
504
- return;
505
- }
506
-
507
502
  getSettings().mediaUpload( {
508
503
  allowedTypes: ALLOWED_MEDIA_TYPES,
509
504
  filesList,
@@ -515,6 +510,7 @@ export default function LogoEdit( {
515
510
  onInitialSelectLogo( image );
516
511
  },
517
512
  onError: onUploadError,
513
+ multiple: false,
518
514
  } );
519
515
  };
520
516
 
@@ -16,6 +16,7 @@
16
16
  height: auto;
17
17
  font-weight: inherit;
18
18
  font-family: inherit;
19
+ margin: 0;
19
20
 
20
21
  // This rule ensures social link buttons display correctly in template parts.
21
22
  opacity: 1;
package/src/style.scss CHANGED
@@ -36,6 +36,7 @@
36
36
  @import "./post-author/style.scss";
37
37
  @import "./post-author-biography/style.scss";
38
38
  @import "./post-comments-form/style.scss";
39
+ @import "./post-comments-count/style.scss";
39
40
  @import "./post-content/style.scss";
40
41
  @import "./post-comments-link/style.scss";
41
42
  @import "./post-date/style.scss";
@@ -70,7 +70,9 @@ function render_block_core_template_part( $attributes ) {
70
70
  if ( 0 === validate_file( $attributes['slug'] ) ) {
71
71
  $block_template = get_block_file_template( $template_part_id, 'wp_template_part' );
72
72
 
73
- $content = $block_template->content;
73
+ if ( isset( $block_template->content ) ) {
74
+ $content = $block_template->content;
75
+ }
74
76
  if ( isset( $block_template->area ) ) {
75
77
  $area = $block_template->area;
76
78
  }
@@ -22,6 +22,7 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
22
22
  const autoPlayHelpText = __(
23
23
  'Autoplay may cause usability issues for some users.'
24
24
  );
25
+
25
26
  const getAutoplayHelp = Platform.select( {
26
27
  web: useCallback( ( checked ) => {
27
28
  return checked ? autoPlayHelpText : null;
@@ -32,7 +33,11 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
32
33
  const toggleFactory = useMemo( () => {
33
34
  const toggleAttribute = ( attribute ) => {
34
35
  return ( newValue ) => {
35
- setAttributes( { [ attribute ]: newValue } );
36
+ setAttributes( {
37
+ [ attribute ]: newValue,
38
+ // Set muted when autoplay changes
39
+ ...( attribute === 'autoplay' && { muted: newValue } ),
40
+ } );
36
41
  };
37
42
  };
38
43
 
@@ -56,7 +61,7 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
56
61
  isShownByDefault
57
62
  hasValue={ () => !! autoplay }
58
63
  onDeselect={ () => {
59
- setAttributes( { autoplay: false } );
64
+ setAttributes( { autoplay: false, muted: false } );
60
65
  } }
61
66
  >
62
67
  <ToggleControl
@@ -95,6 +100,10 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
95
100
  label={ __( 'Muted' ) }
96
101
  onChange={ toggleFactory.muted }
97
102
  checked={ !! muted }
103
+ disabled={ autoplay }
104
+ help={
105
+ autoplay ? __( 'Muted because of Autoplay.' ) : null
106
+ }
98
107
  />
99
108
  </ToolsPanelItem>
100
109
  <ToolsPanelItem