@wordpress/block-library 9.29.1-next.f34ab90e9.0 → 9.30.1-next.6870dfe5b.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 (168) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/accordion/edit.js +18 -1
  3. package/build/accordion/edit.js.map +1 -1
  4. package/build/accordion/index.js +0 -3
  5. package/build/accordion/index.js.map +1 -1
  6. package/build/accordion-content/edit.js +8 -8
  7. package/build/accordion-content/edit.js.map +1 -1
  8. package/build/accordion-content/index.js +2 -5
  9. package/build/accordion-content/index.js.map +1 -1
  10. package/build/accordion-header/index.js +0 -4
  11. package/build/accordion-header/index.js.map +1 -1
  12. package/build/accordion-panel/edit.js +5 -30
  13. package/build/accordion-panel/edit.js.map +1 -1
  14. package/build/accordion-panel/index.js +2 -5
  15. package/build/accordion-panel/index.js.map +1 -1
  16. package/build/accordion-panel/save.js +3 -29
  17. package/build/accordion-panel/save.js.map +1 -1
  18. package/build/audio/edit.js +3 -1
  19. package/build/audio/edit.js.map +1 -1
  20. package/build/gallery/index.js +2 -1
  21. package/build/gallery/index.js.map +1 -1
  22. package/build/group/variations.js +0 -12
  23. package/build/group/variations.js.map +1 -1
  24. package/build/image/image.js +1 -1
  25. package/build/image/image.js.map +1 -1
  26. package/build/navigation/constants.js +5 -1
  27. package/build/navigation/constants.js.map +1 -1
  28. package/build/navigation/edit/index.js +45 -1
  29. package/build/navigation/edit/index.js.map +1 -1
  30. package/build/navigation/edit/leaf-more-menu.js +0 -1
  31. package/build/navigation/edit/leaf-more-menu.js.map +1 -1
  32. package/build/navigation/edit/menu-inspector-controls.js +40 -5
  33. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  34. package/build/navigation-link/block-inserter.js +69 -0
  35. package/build/navigation-link/block-inserter.js.map +1 -0
  36. package/build/navigation-link/dialog-wrapper.js +80 -0
  37. package/build/navigation-link/dialog-wrapper.js.map +1 -0
  38. package/build/navigation-link/link-ui.js +80 -116
  39. package/build/navigation-link/link-ui.js.map +1 -1
  40. package/build/navigation-link/page-creator.js +137 -0
  41. package/build/navigation-link/page-creator.js.map +1 -0
  42. package/build/query/edit/index.js.map +1 -1
  43. package/build/query/edit/query-content.js +7 -6
  44. package/build/query/edit/query-content.js.map +1 -1
  45. package/build/query/edit/query-placeholder.js +30 -9
  46. package/build/query/edit/query-placeholder.js.map +1 -1
  47. package/build/query/edit/query-toolbar.js +4 -2
  48. package/build/query/edit/query-toolbar.js.map +1 -1
  49. package/build/search/edit.js +22 -14
  50. package/build/search/edit.js.map +1 -1
  51. package/build/template-part/edit/placeholder.js +2 -1
  52. package/build/template-part/edit/placeholder.js.map +1 -1
  53. package/build/video/edit.js +3 -1
  54. package/build/video/edit.js.map +1 -1
  55. package/build-module/accordion/edit.js +20 -3
  56. package/build-module/accordion/edit.js.map +1 -1
  57. package/build-module/accordion/index.js +0 -3
  58. package/build-module/accordion/index.js.map +1 -1
  59. package/build-module/accordion-content/edit.js +8 -8
  60. package/build-module/accordion-content/edit.js.map +1 -1
  61. package/build-module/accordion-content/index.js +2 -5
  62. package/build-module/accordion-content/index.js.map +1 -1
  63. package/build-module/accordion-header/index.js +0 -4
  64. package/build-module/accordion-header/index.js.map +1 -1
  65. package/build-module/accordion-panel/edit.js +6 -29
  66. package/build-module/accordion-panel/edit.js.map +1 -1
  67. package/build-module/accordion-panel/index.js +2 -5
  68. package/build-module/accordion-panel/index.js.map +1 -1
  69. package/build-module/accordion-panel/save.js +4 -28
  70. package/build-module/accordion-panel/save.js.map +1 -1
  71. package/build-module/audio/edit.js +4 -2
  72. package/build-module/audio/edit.js.map +1 -1
  73. package/build-module/gallery/index.js +2 -1
  74. package/build-module/gallery/index.js.map +1 -1
  75. package/build-module/group/variations.js +0 -12
  76. package/build-module/group/variations.js.map +1 -1
  77. package/build-module/image/image.js +1 -1
  78. package/build-module/image/image.js.map +1 -1
  79. package/build-module/navigation/constants.js +5 -1
  80. package/build-module/navigation/constants.js.map +1 -1
  81. package/build-module/navigation/edit/index.js +50 -4
  82. package/build-module/navigation/edit/index.js.map +1 -1
  83. package/build-module/navigation/edit/leaf-more-menu.js +0 -1
  84. package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
  85. package/build-module/navigation/edit/menu-inspector-controls.js +40 -5
  86. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  87. package/build-module/navigation-link/block-inserter.js +61 -0
  88. package/build-module/navigation-link/block-inserter.js.map +1 -0
  89. package/build-module/navigation-link/dialog-wrapper.js +75 -0
  90. package/build-module/navigation-link/dialog-wrapper.js.map +1 -0
  91. package/build-module/navigation-link/link-ui.js +85 -121
  92. package/build-module/navigation-link/link-ui.js.map +1 -1
  93. package/build-module/navigation-link/page-creator.js +130 -0
  94. package/build-module/navigation-link/page-creator.js.map +1 -0
  95. package/build-module/query/edit/index.js.map +1 -1
  96. package/build-module/query/edit/query-content.js +8 -7
  97. package/build-module/query/edit/query-content.js.map +1 -1
  98. package/build-module/query/edit/query-placeholder.js +30 -10
  99. package/build-module/query/edit/query-placeholder.js.map +1 -1
  100. package/build-module/query/edit/query-toolbar.js +4 -2
  101. package/build-module/query/edit/query-toolbar.js.map +1 -1
  102. package/build-module/search/edit.js +22 -14
  103. package/build-module/search/edit.js.map +1 -1
  104. package/build-module/template-part/edit/placeholder.js +2 -1
  105. package/build-module/template-part/edit/placeholder.js.map +1 -1
  106. package/build-module/video/edit.js +4 -2
  107. package/build-module/video/edit.js.map +1 -1
  108. package/build-style/accordion/style-rtl.css +8 -18
  109. package/build-style/accordion/style.css +8 -18
  110. package/build-style/editor-rtl.css +18 -0
  111. package/build-style/editor.css +18 -0
  112. package/build-style/form-input/style-rtl.css +4 -3
  113. package/build-style/form-input/style.css +4 -3
  114. package/build-style/navigation-link/editor-rtl.css +14 -0
  115. package/build-style/navigation-link/editor.css +14 -0
  116. package/build-style/navigation-link/style-rtl.css +1 -1
  117. package/build-style/navigation-link/style.css +1 -1
  118. package/build-style/post-comments-form/style-rtl.css +8 -5
  119. package/build-style/post-comments-form/style.css +8 -5
  120. package/build-style/query/editor-rtl.css +4 -0
  121. package/build-style/query/editor.css +4 -0
  122. package/build-style/search/style-rtl.css +11 -12
  123. package/build-style/search/style.css +11 -12
  124. package/build-style/style-rtl.css +32 -40
  125. package/build-style/style.css +32 -40
  126. package/package.json +35 -35
  127. package/src/accordion/block.json +0 -3
  128. package/src/accordion/edit.js +20 -0
  129. package/src/accordion/style.scss +12 -21
  130. package/src/accordion-content/block.json +2 -4
  131. package/src/accordion-content/edit.js +21 -27
  132. package/src/accordion-content/index.js +0 -1
  133. package/src/accordion-header/block.json +0 -3
  134. package/src/accordion-header/index.js +0 -1
  135. package/src/accordion-panel/block.json +2 -4
  136. package/src/accordion-panel/edit.js +11 -51
  137. package/src/accordion-panel/index.js +0 -1
  138. package/src/accordion-panel/save.js +4 -45
  139. package/src/audio/edit.js +6 -1
  140. package/src/cover/test/edit.js +1 -5
  141. package/src/form-input/style.scss +3 -2
  142. package/src/gallery/block.json +2 -1
  143. package/src/gallery/index.php +1 -1
  144. package/src/gallery/test/helpers.native.js +3 -3
  145. package/src/group/variations.js +0 -12
  146. package/src/image/image.js +2 -1
  147. package/src/navigation/constants.js +4 -0
  148. package/src/navigation/edit/index.js +50 -1
  149. package/src/navigation/edit/leaf-more-menu.js +0 -1
  150. package/src/navigation/edit/menu-inspector-controls.js +40 -5
  151. package/src/navigation-link/block-inserter.js +65 -0
  152. package/src/navigation-link/dialog-wrapper.js +74 -0
  153. package/src/navigation-link/editor.scss +17 -0
  154. package/src/navigation-link/link-ui.js +108 -158
  155. package/src/navigation-link/page-creator.js +157 -0
  156. package/src/navigation-link/style.scss +1 -1
  157. package/src/post-comments-form/style.scss +11 -11
  158. package/src/post-date/index.php +2 -1
  159. package/src/query/edit/index.js +1 -0
  160. package/src/query/edit/query-content.js +8 -4
  161. package/src/query/edit/query-placeholder.js +47 -17
  162. package/src/query/edit/query-toolbar.js +10 -2
  163. package/src/query/editor.scss +6 -1
  164. package/src/search/edit.js +44 -13
  165. package/src/search/index.php +16 -2
  166. package/src/search/style.scss +15 -16
  167. package/src/template-part/edit/placeholder.js +2 -1
  168. package/src/video/edit.js +6 -1
@@ -1,16 +1,16 @@
1
1
  // Allow these default styles to be overridden by global styles.
2
- :where(.wp-block-post-comments-form) {
3
- textarea,
4
- input:not([type="submit"]) {
5
- border: 1px solid $gray-600;
6
- font-size: 1em;
7
- font-family: inherit;
8
- }
2
+ :where(.wp-block-post-comments-form textarea),
3
+ :where(.wp-block-post-comments-form input:not([type="submit"])) {
4
+ border-width: 1px;
5
+ border-style: solid;
6
+ border-color: $gray-600;
7
+ font-size: 1em;
8
+ font-family: inherit;
9
+ }
9
10
 
10
- textarea,
11
- input:where(:not([type="submit"]):not([type="checkbox"])) {
12
- padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
13
- }
11
+ :where(.wp-block-post-comments-form textarea),
12
+ :where(.wp-block-post-comments-form input:where(:not([type="submit"]):not([type="checkbox"]))) {
13
+ padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
14
14
  }
15
15
 
16
16
  .wp-block-post-comments-form {
@@ -76,7 +76,8 @@ function render_block_core_post_date( $attributes, $content, $block ) {
76
76
  $formatted_date = sprintf( __( '%s ago' ), human_time_diff( $post_timestamp ) );
77
77
  }
78
78
  } else {
79
- $formatted_date = gmdate( empty( $attributes['format'] ) ? get_option( 'date_format' ) : $attributes['format'], $post_timestamp );
79
+ $format = empty( $attributes['format'] ) ? get_option( 'date_format' ) : $attributes['format'];
80
+ $formatted_date = wp_date( $format, $post_timestamp );
80
81
  }
81
82
 
82
83
  if ( isset( $attributes['textAlign'] ) ) {
@@ -22,6 +22,7 @@ const QueryEdit = ( props ) => {
22
22
  [ clientId ]
23
23
  );
24
24
  const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder;
25
+
25
26
  return (
26
27
  <>
27
28
  <Component
@@ -5,12 +5,12 @@ import { useSelect, useDispatch } from '@wordpress/data';
5
5
  import { useInstanceId } from '@wordpress/compose';
6
6
  import { useEffect, useCallback } from '@wordpress/element';
7
7
  import {
8
- BlockControls,
9
8
  InspectorControls,
10
9
  useBlockProps,
11
10
  store as blockEditorStore,
12
11
  useInnerBlocksProps,
13
12
  privateApis as blockEditorPrivateApis,
13
+ BlockControls,
14
14
  } from '@wordpress/block-editor';
15
15
  import { __ } from '@wordpress/i18n';
16
16
  import { store as coreStore } from '@wordpress/core-data';
@@ -130,6 +130,13 @@ export default function QueryContent( {
130
130
 
131
131
  return (
132
132
  <>
133
+ <BlockControls>
134
+ <QueryToolbar
135
+ clientId={ clientId }
136
+ attributes={ attributes }
137
+ hasInnerBlocks
138
+ />
139
+ </BlockControls>
133
140
  <EnhancedPaginationModal
134
141
  attributes={ attributes }
135
142
  setAttributes={ setAttributes }
@@ -145,9 +152,6 @@ export default function QueryContent( {
145
152
  isSingular={ isSingular }
146
153
  />
147
154
  </InspectorControls>
148
- <BlockControls>
149
- <QueryToolbar attributes={ attributes } clientId={ clientId } />
150
- </BlockControls>
151
155
  <InspectorControls group="advanced">
152
156
  <HTMLElementControl
153
157
  tagName={ TagName }
@@ -8,18 +8,21 @@ import {
8
8
  } from '@wordpress/blocks';
9
9
  import { useState } from '@wordpress/element';
10
10
  import {
11
- useBlockProps,
12
11
  store as blockEditorStore,
13
12
  __experimentalBlockVariationPicker,
13
+ BlockControls,
14
+ useBlockProps,
14
15
  } from '@wordpress/block-editor';
15
16
  import { Button, Placeholder } from '@wordpress/components';
16
17
  import { __ } from '@wordpress/i18n';
18
+ import { useResizeObserver } from '@wordpress/compose';
17
19
 
18
20
  /**
19
21
  * Internal dependencies
20
22
  */
21
23
  import { useScopedBlockVariations } from '../utils';
22
24
  import { useBlockPatterns } from './pattern-selection';
25
+ import QueryToolbar from './query-toolbar';
23
26
 
24
27
  export default function QueryPlaceholder( {
25
28
  attributes,
@@ -28,7 +31,18 @@ export default function QueryPlaceholder( {
28
31
  openPatternSelectionModal,
29
32
  } ) {
30
33
  const [ isStartingBlank, setIsStartingBlank ] = useState( false );
31
- const blockProps = useBlockProps();
34
+ const [ containerWidth, setContainerWidth ] = useState( 0 );
35
+
36
+ // Use ResizeObserver to monitor container width.
37
+ const resizeObserverRef = useResizeObserver( ( [ entry ] ) => {
38
+ setContainerWidth( entry.contentRect.width );
39
+ } );
40
+
41
+ const SMALL_CONTAINER_BREAKPOINT = 160;
42
+
43
+ const isSmallContainer =
44
+ containerWidth > 0 && containerWidth < SMALL_CONTAINER_BREAKPOINT;
45
+
32
46
  const { blockType, activeBlockVariation } = useSelect(
33
47
  ( select ) => {
34
48
  const { getActiveBlockVariation, getBlockType } =
@@ -49,6 +63,10 @@ export default function QueryPlaceholder( {
49
63
  activeBlockVariation?.icon ||
50
64
  blockType?.icon?.src;
51
65
  const label = activeBlockVariation?.title || blockType?.title;
66
+ const blockProps = useBlockProps( {
67
+ ref: resizeObserverRef,
68
+ } );
69
+
52
70
  if ( isStartingBlank ) {
53
71
  return (
54
72
  <QueryVariationPicker
@@ -61,14 +79,24 @@ export default function QueryPlaceholder( {
61
79
  }
62
80
  return (
63
81
  <div { ...blockProps }>
82
+ <BlockControls>
83
+ <QueryToolbar
84
+ clientId={ clientId }
85
+ attributes={ attributes }
86
+ hasInnerBlocks={ false }
87
+ />
88
+ </BlockControls>
64
89
  <Placeholder
65
- icon={ icon }
66
- label={ label }
67
- instructions={ __(
68
- 'Choose a pattern for the query loop or start blank.'
69
- ) }
90
+ className="block-editor-media-placeholder"
91
+ icon={ ! isSmallContainer && icon }
92
+ label={ ! isSmallContainer && label }
93
+ instructions={
94
+ ! isSmallContainer &&
95
+ __( 'Choose a pattern for the query loop or start blank.' )
96
+ }
97
+ withIllustration={ isSmallContainer }
70
98
  >
71
- { !! hasPatterns && (
99
+ { !! hasPatterns && ! isSmallContainer && (
72
100
  <Button
73
101
  __next40pxDefaultSize
74
102
  variant="primary"
@@ -78,15 +106,17 @@ export default function QueryPlaceholder( {
78
106
  </Button>
79
107
  ) }
80
108
 
81
- <Button
82
- __next40pxDefaultSize
83
- variant="secondary"
84
- onClick={ () => {
85
- setIsStartingBlank( true );
86
- } }
87
- >
88
- { __( 'Start blank' ) }
89
- </Button>
109
+ { ! isSmallContainer && (
110
+ <Button
111
+ __next40pxDefaultSize
112
+ variant="secondary"
113
+ onClick={ () => {
114
+ setIsStartingBlank( true );
115
+ } }
116
+ >
117
+ { __( 'Start blank' ) }
118
+ </Button>
119
+ ) }
90
120
  </Placeholder>
91
121
  </div>
92
122
  );
@@ -14,12 +14,20 @@ import { __ } from '@wordpress/i18n';
14
14
  */
15
15
  import PatternSelection, { useBlockPatterns } from './pattern-selection';
16
16
 
17
- export default function QueryToolbar( { clientId, attributes } ) {
17
+ export default function QueryToolbar( {
18
+ clientId,
19
+ attributes,
20
+ hasInnerBlocks,
21
+ } ) {
18
22
  const hasPatterns = useBlockPatterns( clientId, attributes ).length;
19
23
  if ( ! hasPatterns ) {
20
24
  return null;
21
25
  }
22
26
 
27
+ const buttonLabel = hasInnerBlocks
28
+ ? __( 'Change design' )
29
+ : __( 'Choose pattern' );
30
+
23
31
  return (
24
32
  <ToolbarGroup className="wp-block-template-part__block-control-group">
25
33
  <DropdownContentWrapper>
@@ -33,7 +41,7 @@ export default function QueryToolbar( { clientId, attributes } ) {
33
41
  aria-expanded={ isOpen }
34
42
  onClick={ onToggle }
35
43
  >
36
- { __( 'Change design' ) }
44
+ { buttonLabel }
37
45
  </ToolbarButton>
38
46
  ) }
39
47
  renderContent={ () => (
@@ -1,5 +1,4 @@
1
1
  .block-library-query-pattern__selection-modal {
2
-
3
2
  .block-editor-block-patterns-list {
4
3
  column-count: 2;
5
4
  column-gap: $grid-unit-30;
@@ -53,3 +52,9 @@
53
52
  margin-bottom: 0;
54
53
  }
55
54
  }
55
+
56
+ // Provide special styling for the placeholder.
57
+ // @todo this particular minimal style of placeholder could be componentized further.
58
+ .wp-block-query > .block-editor-media-placeholder.is-small {
59
+ min-height: 60px;
60
+ }
@@ -228,7 +228,17 @@ export default function SearchEdit( {
228
228
  );
229
229
  const textFieldStyles = {
230
230
  ...( isButtonPositionInside
231
- ? { borderRadius }
231
+ ? {
232
+ borderRadius: borderProps.style?.borderRadius,
233
+ borderTopLeftRadius:
234
+ borderProps.style?.borderTopLeftRadius,
235
+ borderTopRightRadius:
236
+ borderProps.style?.borderTopRightRadius,
237
+ borderBottomLeftRadius:
238
+ borderProps.style?.borderBottomLeftRadius,
239
+ borderBottomRightRadius:
240
+ borderProps.style?.borderBottomRightRadius,
241
+ }
232
242
  : borderProps.style ),
233
243
  ...typographyProps.style,
234
244
  textDecoration: undefined,
@@ -269,7 +279,17 @@ export default function SearchEdit( {
269
279
  ...colorProps.style,
270
280
  ...typographyProps.style,
271
281
  ...( isButtonPositionInside
272
- ? { borderRadius }
282
+ ? {
283
+ borderRadius: borderProps.style?.borderRadius,
284
+ borderTopLeftRadius:
285
+ borderProps.style?.borderTopLeftRadius,
286
+ borderTopRightRadius:
287
+ borderProps.style?.borderTopRightRadius,
288
+ borderBottomLeftRadius:
289
+ borderProps.style?.borderBottomLeftRadius,
290
+ borderBottomRightRadius:
291
+ borderProps.style?.borderBottomRightRadius,
292
+ }
273
293
  : borderProps.style ),
274
294
  };
275
295
  const handleButtonClick = () => {
@@ -495,8 +515,13 @@ export default function SearchEdit( {
495
515
  </>
496
516
  );
497
517
 
518
+ const isNonZeroBorderRadius = ( radius ) =>
519
+ radius !== undefined && parseInt( radius, 10 ) !== 0;
520
+
498
521
  const padBorderRadius = ( radius ) =>
499
- radius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;
522
+ isNonZeroBorderRadius( radius )
523
+ ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`
524
+ : undefined;
500
525
 
501
526
  const getWrapperStyles = () => {
502
527
  const styles = isButtonPositionInside
@@ -512,10 +537,7 @@ export default function SearchEdit( {
512
537
  borderProps.style?.borderBottomRightRadius,
513
538
  };
514
539
 
515
- const isNonZeroBorderRadius =
516
- borderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;
517
-
518
- if ( isButtonPositionInside && isNonZeroBorderRadius ) {
540
+ if ( isButtonPositionInside ) {
519
541
  // We have button inside wrapper and a border radius value to apply.
520
542
  // Add default padding so we don't get "fat" corners.
521
543
  //
@@ -524,15 +546,24 @@ export default function SearchEdit( {
524
546
 
525
547
  if ( typeof borderRadius === 'object' ) {
526
548
  // Individual corner border radii present.
527
- const { topLeft, topRight, bottomLeft, bottomRight } =
528
- borderRadius;
549
+ const {
550
+ borderTopLeftRadius,
551
+ borderTopRightRadius,
552
+ borderBottomLeftRadius,
553
+ borderBottomRightRadius,
554
+ } = borderProps.style;
529
555
 
530
556
  return {
531
557
  ...styles,
532
- borderTopLeftRadius: padBorderRadius( topLeft ),
533
- borderTopRightRadius: padBorderRadius( topRight ),
534
- borderBottomLeftRadius: padBorderRadius( bottomLeft ),
535
- borderBottomRightRadius: padBorderRadius( bottomRight ),
558
+ borderTopLeftRadius: padBorderRadius( borderTopLeftRadius ),
559
+ borderTopRightRadius:
560
+ padBorderRadius( borderTopRightRadius ),
561
+ borderBottomLeftRadius: padBorderRadius(
562
+ borderBottomLeftRadius
563
+ ),
564
+ borderBottomRightRadius: padBorderRadius(
565
+ borderBottomRightRadius
566
+ ),
536
567
  };
537
568
  }
538
569
 
@@ -372,6 +372,13 @@ function styles_for_block_core_search( $attributes ) {
372
372
  if ( is_array( $border_radius ) ) {
373
373
  // Apply styles for individual corner border radii.
374
374
  foreach ( $border_radius as $key => $value ) {
375
+ // Get border-radius CSS variable from preset value if provided.
376
+ if ( is_string( $value ) && str_contains( $value, 'var:preset|border-radius|' ) ) {
377
+ $index_to_splice = strrpos( $value, '|' ) + 1;
378
+ $slug = _wp_to_kebab_case( substr( $value, $index_to_splice ) );
379
+ $value = "var(--wp--preset--border-radius--$slug)";
380
+ }
381
+
375
382
  if ( null !== $value ) {
376
383
  // Convert camelCase key to kebab-case.
377
384
  $name = strtolower( preg_replace( '/(?<!^)[A-Z]/', '-$0', $key ) );
@@ -387,7 +394,7 @@ function styles_for_block_core_search( $attributes ) {
387
394
 
388
395
  // Add adjusted border radius styles for the wrapper element
389
396
  // if button is positioned inside.
390
- if ( $is_button_inside && intval( $value ) !== 0 ) {
397
+ if ( $is_button_inside && ( intval( $value ) !== 0 || str_contains( $value, 'var(--wp--preset--border-radius--' ) ) ) {
391
398
  $wrapper_styles[] = sprintf(
392
399
  'border-%s-radius: calc(%s + %s);',
393
400
  esc_attr( $name ),
@@ -399,7 +406,14 @@ function styles_for_block_core_search( $attributes ) {
399
406
  }
400
407
  } else {
401
408
  // Numeric check is for backwards compatibility purposes.
402
- $border_radius = is_numeric( $border_radius ) ? $border_radius . 'px' : $border_radius;
409
+ $border_radius = is_numeric( $border_radius ) ? $border_radius . 'px' : $border_radius;
410
+ // Get border-radius CSS variable from preset value if provided.
411
+ if ( is_string( $border_radius ) && str_contains( $border_radius, 'var:preset|border-radius|' ) ) {
412
+ $index_to_splice = strrpos( $border_radius, '|' ) + 1;
413
+ $slug = _wp_to_kebab_case( substr( $border_radius, $index_to_splice ) );
414
+ $border_radius = "var(--wp--preset--border-radius--$slug)";
415
+ }
416
+
403
417
  $border_style = sprintf( 'border-radius: %s;', esc_attr( $border_radius ) );
404
418
  $input_styles[] = $border_style;
405
419
  $button_styles[] = $border_style;
@@ -37,21 +37,6 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
37
37
  width: 100%;
38
38
  }
39
39
 
40
- .wp-block-search__input {
41
- padding: $grid-unit-10;
42
- flex-grow: 1;
43
- margin-left: 0;
44
- margin-right: 0;
45
- min-width: 3rem;
46
- border: 1px solid $gray-600;
47
- // !important used to forcibly prevent undesired application of
48
- // text-decoration styles on the input field.
49
- text-decoration: unset !important;
50
-
51
- // Hides a redundant extra search icon on Mobile Safari.
52
- appearance: initial;
53
- }
54
-
55
40
  .wp-block-search.wp-block-search__button-only {
56
41
  .wp-block-search__button {
57
42
  margin-left: 0;
@@ -104,12 +89,26 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
104
89
  letter-spacing: inherit;
105
90
  text-transform: inherit;
106
91
  font-style: inherit;
92
+ padding: $grid-unit-10;
93
+ flex-grow: 1;
94
+ margin-left: 0;
95
+ margin-right: 0;
96
+ min-width: 3rem;
97
+ border: 1px solid $gray-600;
98
+ // !important used to forcibly prevent undesired application of
99
+ // text-decoration styles on the input field.
100
+ text-decoration: unset !important;
101
+
102
+ // Hides a redundant extra search icon on Mobile Safari.
103
+ appearance: initial;
107
104
  }
108
105
 
109
106
  // We are lowering the specificity so that the button element can override the rule for the button inside the search block.
110
107
  :where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) {
111
108
  padding: $grid-unit-05;
112
- border: 1px solid $gray-600;
109
+ border-width: 1px;
110
+ border-style: solid;
111
+ border-color: $gray-600;
113
112
  background-color: $white;
114
113
  box-sizing: border-box;
115
114
 
@@ -17,6 +17,7 @@ import {
17
17
  useTemplatePartArea,
18
18
  } from './utils/hooks';
19
19
  import TitleModal from './title-modal';
20
+ import { getTemplatePartIcon } from './utils/get-template-part-icon';
20
21
 
21
22
  export default function TemplatePartPlaceholder( {
22
23
  area,
@@ -54,7 +55,7 @@ export default function TemplatePartPlaceholder( {
54
55
 
55
56
  return (
56
57
  <Placeholder
57
- icon={ areaObject.icon }
58
+ icon={ getTemplatePartIcon( areaObject.icon ) }
58
59
  label={ areaObject.label }
59
60
  instructions={
60
61
  isBlockBasedTheme
package/src/video/edit.js CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  MediaPlaceholder,
21
21
  MediaReplaceFlow,
22
22
  useBlockProps,
23
+ useBlockEditingMode,
23
24
  } from '@wordpress/block-editor';
24
25
  import { useRef, useEffect, useState } from '@wordpress/element';
25
26
  import { __ } from '@wordpress/i18n';
@@ -55,6 +56,8 @@ function VideoEdit( {
55
56
  const { id, controls, poster, src, tracks } = attributes;
56
57
  const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
57
58
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
59
+ const blockEditingMode = useBlockEditingMode();
60
+ const hasNonContentControls = blockEditingMode === 'default';
58
61
 
59
62
  useUploadMediaFromBlobURL( {
60
63
  url: temporaryURL,
@@ -251,7 +254,9 @@ function VideoEdit( {
251
254
  isSelected={ isSingleSelected }
252
255
  insertBlocksAfter={ insertBlocksAfter }
253
256
  label={ __( 'Video caption text' ) }
254
- showToolbarButton={ isSingleSelected }
257
+ showToolbarButton={
258
+ isSingleSelected && hasNonContentControls
259
+ }
255
260
  />
256
261
  </figure>
257
262
  </>