@wordpress/block-library 8.21.0 → 8.22.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 (217) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/avatar/index.js +5 -1
  3. package/build/avatar/index.js.map +1 -1
  4. package/build/block/edit-title.native.js +11 -3
  5. package/build/block/edit-title.native.js.map +1 -1
  6. package/build/block/edit.js +3 -3
  7. package/build/block/edit.js.map +1 -1
  8. package/build/column/edit.js +2 -1
  9. package/build/column/edit.js.map +1 -1
  10. package/build/column/edit.native.js +2 -1
  11. package/build/column/edit.native.js.map +1 -1
  12. package/build/columns/edit.native.js +2 -1
  13. package/build/columns/edit.native.js.map +1 -1
  14. package/build/cover/controls.native.js +2 -1
  15. package/build/cover/controls.native.js.map +1 -1
  16. package/build/cover/edit/index.js +2 -1
  17. package/build/cover/edit/index.js.map +1 -1
  18. package/build/cover/edit/inspector-controls.js +2 -1
  19. package/build/cover/edit/inspector-controls.js.map +1 -1
  20. package/build/file/view.js +1 -1
  21. package/build/file/view.js.map +1 -1
  22. package/build/form/edit.js +2 -2
  23. package/build/form/edit.js.map +1 -1
  24. package/build/form/index.js +25 -5
  25. package/build/form/index.js.map +1 -1
  26. package/build/form/variations.js +1 -1
  27. package/build/form/variations.js.map +1 -1
  28. package/build/form-input/index.js +2 -2
  29. package/build/form-input/index.js.map +1 -1
  30. package/build/form-input/variations.js +7 -7
  31. package/build/form-input/variations.js.map +1 -1
  32. package/build/form-submission-notification/index.js +1 -1
  33. package/build/form-submission-notification/index.js.map +1 -1
  34. package/build/form-submission-notification/variations.js +4 -4
  35. package/build/form-submission-notification/variations.js.map +1 -1
  36. package/build/form-submit-button/index.js +2 -2
  37. package/build/form-submit-button/index.js.map +1 -1
  38. package/build/group/edit.js +2 -11
  39. package/build/group/edit.js.map +1 -1
  40. package/build/html/preview.js +2 -4
  41. package/build/html/preview.js.map +1 -1
  42. package/build/image/image.js +11 -5
  43. package/build/image/image.js.map +1 -1
  44. package/build/image/view.js +10 -20
  45. package/build/image/view.js.map +1 -1
  46. package/build/missing/edit.native.js +46 -8
  47. package/build/missing/edit.native.js.map +1 -1
  48. package/build/paragraph/edit.js +1 -1
  49. package/build/paragraph/edit.js.map +1 -1
  50. package/build/post-featured-image/dimension-controls.js +2 -2
  51. package/build/post-featured-image/dimension-controls.js.map +1 -1
  52. package/build/post-terms/edit.js +2 -2
  53. package/build/post-terms/edit.js.map +1 -1
  54. package/build/query/edit/enhanced-pagination-modal.js +27 -13
  55. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  56. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +15 -12
  57. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  58. package/build/query/utils.js +29 -8
  59. package/build/query/utils.js.map +1 -1
  60. package/build/query/view.js +4 -2
  61. package/build/query/view.js.map +1 -1
  62. package/build/search/edit.js +1 -2
  63. package/build/search/edit.js.map +1 -1
  64. package/build/social-link/edit.native.js +7 -19
  65. package/build/social-link/edit.native.js.map +1 -1
  66. package/build/spacer/controls.js +3 -3
  67. package/build/spacer/controls.js.map +1 -1
  68. package/build/spacer/controls.native.js +2 -1
  69. package/build/spacer/controls.native.js.map +1 -1
  70. package/build/spacer/edit.js +1 -1
  71. package/build/spacer/edit.js.map +1 -1
  72. package/build/spacer/edit.native.js +5 -1
  73. package/build/spacer/edit.native.js.map +1 -1
  74. package/build/tag-cloud/edit.js +2 -1
  75. package/build/tag-cloud/edit.js.map +1 -1
  76. package/build/template-part/edit/inner-blocks.js +2 -2
  77. package/build/template-part/edit/inner-blocks.js.map +1 -1
  78. package/build/term-description/index.js +0 -1
  79. package/build/term-description/index.js.map +1 -1
  80. package/build-module/avatar/index.js +5 -1
  81. package/build-module/avatar/index.js.map +1 -1
  82. package/build-module/block/edit-title.native.js +12 -4
  83. package/build-module/block/edit-title.native.js.map +1 -1
  84. package/build-module/block/edit.js +3 -3
  85. package/build-module/block/edit.js.map +1 -1
  86. package/build-module/column/edit.js +3 -2
  87. package/build-module/column/edit.js.map +1 -1
  88. package/build-module/column/edit.native.js +3 -2
  89. package/build-module/column/edit.native.js.map +1 -1
  90. package/build-module/columns/edit.native.js +3 -2
  91. package/build-module/columns/edit.native.js.map +1 -1
  92. package/build-module/cover/controls.native.js +3 -2
  93. package/build-module/cover/controls.native.js.map +1 -1
  94. package/build-module/cover/edit/index.js +3 -2
  95. package/build-module/cover/edit/index.js.map +1 -1
  96. package/build-module/cover/edit/inspector-controls.js +3 -2
  97. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  98. package/build-module/file/view.js +2 -2
  99. package/build-module/file/view.js.map +1 -1
  100. package/build-module/form/edit.js +2 -2
  101. package/build-module/form/edit.js.map +1 -1
  102. package/build-module/form/index.js +29 -5
  103. package/build-module/form/index.js.map +1 -1
  104. package/build-module/form/variations.js +1 -1
  105. package/build-module/form/variations.js.map +1 -1
  106. package/build-module/form-input/index.js +2 -2
  107. package/build-module/form-input/index.js.map +1 -1
  108. package/build-module/form-input/variations.js +7 -7
  109. package/build-module/form-input/variations.js.map +1 -1
  110. package/build-module/form-submission-notification/index.js +1 -1
  111. package/build-module/form-submission-notification/index.js.map +1 -1
  112. package/build-module/form-submission-notification/variations.js +4 -4
  113. package/build-module/form-submission-notification/variations.js.map +1 -1
  114. package/build-module/form-submit-button/index.js +2 -2
  115. package/build-module/form-submit-button/index.js.map +1 -1
  116. package/build-module/group/edit.js +3 -12
  117. package/build-module/group/edit.js.map +1 -1
  118. package/build-module/html/preview.js +2 -4
  119. package/build-module/html/preview.js.map +1 -1
  120. package/build-module/image/image.js +12 -6
  121. package/build-module/image/image.js.map +1 -1
  122. package/build-module/image/view.js +10 -20
  123. package/build-module/image/view.js.map +1 -1
  124. package/build-module/missing/edit.native.js +47 -9
  125. package/build-module/missing/edit.native.js.map +1 -1
  126. package/build-module/paragraph/edit.js +2 -2
  127. package/build-module/paragraph/edit.js.map +1 -1
  128. package/build-module/post-featured-image/dimension-controls.js +3 -3
  129. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  130. package/build-module/post-terms/edit.js +2 -2
  131. package/build-module/post-terms/edit.js.map +1 -1
  132. package/build-module/query/edit/enhanced-pagination-modal.js +28 -14
  133. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  134. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +17 -14
  135. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  136. package/build-module/query/utils.js +27 -5
  137. package/build-module/query/utils.js.map +1 -1
  138. package/build-module/query/view.js +4 -2
  139. package/build-module/query/view.js.map +1 -1
  140. package/build-module/search/edit.js +2 -3
  141. package/build-module/search/edit.js.map +1 -1
  142. package/build-module/social-link/edit.native.js +8 -20
  143. package/build-module/social-link/edit.native.js.map +1 -1
  144. package/build-module/spacer/controls.js +4 -4
  145. package/build-module/spacer/controls.js.map +1 -1
  146. package/build-module/spacer/controls.native.js +3 -2
  147. package/build-module/spacer/controls.native.js.map +1 -1
  148. package/build-module/spacer/edit.js +2 -2
  149. package/build-module/spacer/edit.js.map +1 -1
  150. package/build-module/spacer/edit.native.js +6 -2
  151. package/build-module/spacer/edit.native.js.map +1 -1
  152. package/build-module/tag-cloud/edit.js +3 -2
  153. package/build-module/tag-cloud/edit.js.map +1 -1
  154. package/build-module/template-part/edit/inner-blocks.js +3 -3
  155. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  156. package/build-module/term-description/index.js +0 -1
  157. package/build-module/term-description/index.js.map +1 -1
  158. package/build-style/file/style-rtl.css +0 -5
  159. package/build-style/file/style.css +0 -5
  160. package/build-style/navigation/style-rtl.css +5 -0
  161. package/build-style/navigation/style.css +5 -0
  162. package/build-style/style-rtl.css +5 -5
  163. package/build-style/style.css +5 -5
  164. package/package.json +32 -32
  165. package/src/avatar/block.json +5 -1
  166. package/src/block/edit-title.native.js +16 -13
  167. package/src/block/edit.js +1 -1
  168. package/src/calendar/index.php +2 -6
  169. package/src/column/edit.js +3 -8
  170. package/src/column/edit.native.js +3 -8
  171. package/src/columns/edit.native.js +3 -8
  172. package/src/comment-author-avatar/index.php +1 -1
  173. package/src/cover/controls.native.js +3 -8
  174. package/src/cover/edit/index.js +3 -2
  175. package/src/cover/edit/inspector-controls.js +3 -8
  176. package/src/file/index.php +2 -1
  177. package/src/file/style.scss +0 -6
  178. package/src/file/view.js +2 -2
  179. package/src/form/edit.js +3 -1
  180. package/src/form/index.js +38 -1
  181. package/src/form/variations.js +1 -1
  182. package/src/form-input/block.json +2 -2
  183. package/src/form-input/variations.js +7 -7
  184. package/src/form-submission-notification/block.json +1 -1
  185. package/src/form-submission-notification/variations.js +4 -4
  186. package/src/form-submit-button/block.json +2 -2
  187. package/src/freeform/test/__snapshots__/index.native.js.snap +7 -0
  188. package/src/freeform/test/index.native.js +57 -0
  189. package/src/group/edit.js +2 -7
  190. package/src/html/preview.js +9 -4
  191. package/src/image/image.js +17 -6
  192. package/src/image/index.php +5 -6
  193. package/src/image/view.js +13 -19
  194. package/src/missing/edit.native.js +43 -6
  195. package/src/navigation/index.php +1 -1
  196. package/src/navigation/style.scss +6 -1
  197. package/src/paragraph/edit.js +2 -2
  198. package/src/post-featured-image/dimension-controls.js +3 -3
  199. package/src/post-terms/edit.js +2 -2
  200. package/src/query/edit/enhanced-pagination-modal.js +37 -21
  201. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +18 -22
  202. package/src/query/index.php +97 -8
  203. package/src/query/utils.js +29 -8
  204. package/src/query/view.js +11 -2
  205. package/src/query-pagination-next/index.php +1 -1
  206. package/src/query-pagination-previous/index.php +1 -1
  207. package/src/search/edit.js +5 -3
  208. package/src/social-link/edit.native.js +12 -26
  209. package/src/social-link/editor.native.scss +0 -9
  210. package/src/social-link/index.php +2 -2
  211. package/src/spacer/controls.js +9 -12
  212. package/src/spacer/controls.native.js +3 -8
  213. package/src/spacer/edit.js +2 -2
  214. package/src/spacer/edit.native.js +6 -5
  215. package/src/tag-cloud/edit.js +3 -7
  216. package/src/template-part/edit/inner-blocks.js +3 -3
  217. package/src/term-description/block.json +0 -1
package/src/query/view.js CHANGED
@@ -33,7 +33,14 @@ store( {
33
33
  core: {
34
34
  query: {
35
35
  navigate: async ( { event, ref, context } ) => {
36
- if ( isValidLink( ref ) && isValidEvent( event ) ) {
36
+ const isDisabled = ref.closest( '[data-wp-navigation-id]' )
37
+ ?.dataset.wpNavigationDisabled;
38
+
39
+ if (
40
+ isValidLink( ref ) &&
41
+ isValidEvent( event ) &&
42
+ ! isDisabled
43
+ ) {
37
44
  event.preventDefault();
38
45
 
39
46
  const id = ref.closest( '[data-wp-navigation-id]' )
@@ -70,7 +77,9 @@ store( {
70
77
  }
71
78
  },
72
79
  prefetch: async ( { ref } ) => {
73
- if ( isValidLink( ref ) ) {
80
+ const isDisabled = ref.closest( '[data-wp-navigation-id]' )
81
+ ?.dataset.wpNavigationDisabled;
82
+ if ( isValidLink( ref ) && ! isDisabled ) {
74
83
  await prefetch( ref.href );
75
84
  }
76
85
  },
@@ -63,7 +63,7 @@ function render_block_core_query_pagination_next( $attributes, $content, $block
63
63
  wp_reset_postdata(); // Restore original Post Data.
64
64
  }
65
65
 
66
- if ( $enhanced_pagination ) {
66
+ if ( $enhanced_pagination && isset( $content ) ) {
67
67
  $p = new WP_HTML_Tag_Processor( $content );
68
68
  if ( $p->next_tag(
69
69
  array(
@@ -51,7 +51,7 @@ function render_block_core_query_pagination_previous( $attributes, $content, $bl
51
51
  );
52
52
  }
53
53
 
54
- if ( $enhanced_pagination ) {
54
+ if ( $enhanced_pagination && isset( $content ) ) {
55
55
  $p = new WP_HTML_Tag_Processor( $content );
56
56
  if ( $p->next_tag(
57
57
  array(
@@ -16,7 +16,7 @@ import {
16
16
  getTypographyClassesAndStyles as useTypographyProps,
17
17
  store as blockEditorStore,
18
18
  __experimentalGetElementClassName,
19
- useSetting,
19
+ useSettings,
20
20
  } from '@wordpress/block-editor';
21
21
  import { useDispatch, useSelect } from '@wordpress/data';
22
22
  import { useEffect, useRef } from '@wordpress/element';
@@ -125,8 +125,10 @@ export default function SearchEdit( {
125
125
  }
126
126
 
127
127
  const colorProps = useColorProps( attributes );
128
- const fluidTypographySettings = useSetting( 'typography.fluid' );
129
- const layout = useSetting( 'layout' );
128
+ const [ fluidTypographySettings, layout ] = useSettings(
129
+ 'typography.fluid',
130
+ 'layout'
131
+ );
130
132
  const typographyProps = useTypographyProps( attributes, {
131
133
  typography: {
132
134
  fluid: fluidTypographySettings,
@@ -16,7 +16,7 @@ import {
16
16
  ToolbarButton,
17
17
  LinkSettingsNavigation,
18
18
  } from '@wordpress/components';
19
- import { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';
19
+ import { compose } from '@wordpress/compose';
20
20
  import { __, sprintf } from '@wordpress/i18n';
21
21
  import { link, Icon } from '@wordpress/icons';
22
22
  import { withSelect } from '@wordpress/data';
@@ -30,10 +30,6 @@ const DEFAULT_ACTIVE_ICON_STYLES = {
30
30
  backgroundColor: '#f0f0f0',
31
31
  color: '#444',
32
32
  };
33
- const DEFAULT_INACTIVE_ICON_STYLES = {
34
- backgroundColor: '#0000003f',
35
- color: '#fff',
36
- };
37
33
  const ANIMATION_DELAY = 300;
38
34
  const ANIMATION_DURATION = 400;
39
35
 
@@ -66,12 +62,6 @@ const SocialLinkEdit = ( {
66
62
  styles[ `wp-social-link-${ service }` ] ||
67
63
  styles[ `wp-social-link` ] ||
68
64
  DEFAULT_ACTIVE_ICON_STYLES;
69
- const inactiveIcon =
70
- usePreferredColorSchemeStyle(
71
- styles.inactiveIcon,
72
- styles.inactiveIconDark
73
- ) || DEFAULT_INACTIVE_ICON_STYLES;
74
-
75
65
  const animatedValue = useRef( new Animated.Value( 0 ) ).current;
76
66
 
77
67
  const IconComponent = getIconBySite( service )();
@@ -94,23 +84,13 @@ const SocialLinkEdit = ( {
94
84
  }, [ url ] );
95
85
 
96
86
  const interpolationColors = {
97
- backgroundColor: animatedValue.interpolate( {
98
- inputRange: [ 0, 1 ],
99
- outputRange: [
100
- inactiveIcon.backgroundColor,
101
- activeIcon.backgroundColor,
102
- ],
103
- } ),
104
- color: animatedValue.interpolate( {
87
+ opacity: animatedValue.interpolate( {
105
88
  inputRange: [ 0, 1 ],
106
- outputRange: [ inactiveIcon.color, activeIcon.color ],
89
+ outputRange: [ 0.3, 1 ],
107
90
  } ),
108
- stroke: '',
109
91
  };
110
92
 
111
- const { backgroundColor, color, stroke } = hasUrl
112
- ? activeIcon
113
- : interpolationColors;
93
+ const { opacity } = hasUrl ? activeIcon : interpolationColors;
114
94
 
115
95
  function animateColors() {
116
96
  Animated.sequence( [
@@ -200,12 +180,18 @@ const SocialLinkEdit = ( {
200
180
  accessibilityHint={ accessibilityHint }
201
181
  >
202
182
  <Animated.View
203
- style={ [ styles.iconContainer, { backgroundColor } ] }
183
+ style={ [
184
+ styles.iconContainer,
185
+ {
186
+ backgroundColor: activeIcon.backgroundColor,
187
+ opacity,
188
+ },
189
+ ] }
204
190
  >
205
191
  <Icon
206
192
  animated
207
193
  icon={ IconComponent }
208
- style={ { stroke, color } }
194
+ style={ { color: activeIcon.color } }
209
195
  />
210
196
  </Animated.View>
211
197
  </TouchableWithoutFeedback>
@@ -13,15 +13,6 @@
13
13
  justify-content: center;
14
14
  }
15
15
 
16
- .inactiveIcon {
17
- background-color: $light-quaternary;
18
- color: $white;
19
- }
20
-
21
- .inactiveIconDark {
22
- background-color: $dark-quaternary;
23
- }
24
-
25
16
  .container {
26
17
  margin: $block-selected-margin;
27
18
  }
@@ -62,10 +62,10 @@ function render_block_core_social_link( $attributes, $content, $block ) {
62
62
  $processor = new WP_HTML_Tag_Processor( $link );
63
63
  $processor->next_tag( 'a' );
64
64
  if ( $open_in_new_tab ) {
65
- $processor->set_attribute( 'rel', esc_attr( $rel ) . ' noopener nofollow' );
65
+ $processor->set_attribute( 'rel', trim( $rel . ' noopener nofollow' ) );
66
66
  $processor->set_attribute( 'target', '_blank' );
67
67
  } elseif ( '' !== $rel ) {
68
- $processor->set_attribute( 'rel', esc_attr( $rel ) );
68
+ $processor->set_attribute( 'rel', trim( $rel ) );
69
69
  }
70
70
  return $processor->get_updated_html();
71
71
  }
@@ -4,7 +4,7 @@
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import {
6
6
  InspectorControls,
7
- useSetting,
7
+ useSettings,
8
8
  __experimentalSpacingSizesControl as SpacingSizesControl,
9
9
  isValueSpacingPreset,
10
10
  } from '@wordpress/block-editor';
@@ -25,22 +25,19 @@ import { MIN_SPACER_SIZE } from './constants';
25
25
 
26
26
  function DimensionInput( { label, onChange, isResizing, value = '' } ) {
27
27
  const inputId = useInstanceId( UnitControl, 'block-spacer-height-input' );
28
- const spacingSizes = useSetting( 'spacing.spacingSizes' );
28
+ const [ spacingSizes, spacingUnits ] = useSettings(
29
+ 'spacing.spacingSizes',
30
+ 'spacing.units'
31
+ );
29
32
  // In most contexts the spacer size cannot meaningfully be set to a
30
33
  // percentage, since this is relative to the parent container. This
31
34
  // unit is disabled from the UI.
32
- const availableUnitSettings = (
33
- useSetting( 'spacing.units' ) || undefined
34
- )?.filter( ( availableUnit ) => availableUnit !== '%' );
35
+ const availableUnits = spacingUnits
36
+ ? spacingUnits.filter( ( unit ) => unit !== '%' )
37
+ : [ 'px', 'em', 'rem', 'vw', 'vh' ];
35
38
 
36
39
  const units = useCustomUnits( {
37
- availableUnits: availableUnitSettings || [
38
- 'px',
39
- 'em',
40
- 'rem',
41
- 'vw',
42
- 'vh',
43
- ],
40
+ availableUnits,
44
41
  defaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 },
45
42
  } );
46
43
 
@@ -8,7 +8,7 @@ import {
8
8
  __experimentalUseCustomUnits as useCustomUnits,
9
9
  } from '@wordpress/components';
10
10
  import { useCallback } from '@wordpress/element';
11
- import { useSetting } from '@wordpress/block-editor';
11
+ import { useSettings } from '@wordpress/block-editor';
12
12
  import { __ } from '@wordpress/i18n';
13
13
 
14
14
  /**
@@ -59,14 +59,9 @@ function Controls( {
59
59
  [ height, width ]
60
60
  );
61
61
 
62
+ const [ availableUnits ] = useSettings( 'spacing.units' );
62
63
  const units = useCustomUnits( {
63
- availableUnits: useSetting( 'spacing.units' ) || [
64
- 'px',
65
- 'em',
66
- 'rem',
67
- 'vw',
68
- 'vh',
69
- ],
64
+ availableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],
70
65
  defaultValues: DEFAULT_VALUES,
71
66
  } );
72
67
 
@@ -8,7 +8,7 @@ import classnames from 'classnames';
8
8
  */
9
9
  import {
10
10
  useBlockProps,
11
- useSetting,
11
+ useSettings,
12
12
  getCustomValueFromPreset,
13
13
  getSpacingPresetCssVar,
14
14
  store as blockEditorStore,
@@ -107,7 +107,7 @@ const SpacerEdit = ( {
107
107
  const { layout = {} } = blockStyle;
108
108
  const { selfStretch, flexSize } = layout;
109
109
 
110
- const spacingSizes = useSetting( 'spacing.spacingSizes' );
110
+ const [ spacingSizes ] = useSettings( 'spacing.spacingSizes' );
111
111
 
112
112
  const [ isResizing, setIsResizing ] = useState( false );
113
113
  const [ temporaryHeight, setTemporaryHeight ] = useState( null );
@@ -11,7 +11,7 @@ import { withPreferredColorScheme } from '@wordpress/compose';
11
11
  import {
12
12
  InspectorControls,
13
13
  isValueSpacingPreset,
14
- useSetting,
14
+ useSettings,
15
15
  getCustomValueFromPreset,
16
16
  getPxFromCssUnit,
17
17
  } from '@wordpress/block-editor';
@@ -39,10 +39,11 @@ const Spacer = ( {
39
39
  fontSize: DEFAULT_FONT_SIZE,
40
40
  };
41
41
  const { height, width } = attributes;
42
- const spacingSizes = [
43
- { name: 0, slug: '0', size: 0 },
44
- ...( useSetting( 'spacing.spacingSizes' ) || [] ),
45
- ];
42
+ const spacingSizes = [ { name: 0, slug: '0', size: 0 } ];
43
+ const [ settingsSizes ] = useSettings( 'spacing.spacingSizes' );
44
+ if ( settingsSizes ) {
45
+ spacingSizes.push( ...settingsSizes );
46
+ }
46
47
  const { orientation } = context;
47
48
  const defaultStyle = getStylesFromColorScheme(
48
49
  styles.staticSpacer,
@@ -18,7 +18,7 @@ import { __ } from '@wordpress/i18n';
18
18
  import {
19
19
  InspectorControls,
20
20
  useBlockProps,
21
- useSetting,
21
+ useSettings,
22
22
  } from '@wordpress/block-editor';
23
23
  import ServerSideRender from '@wordpress/server-side-render';
24
24
  import { store as coreStore } from '@wordpress/core-data';
@@ -49,13 +49,9 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
49
49
  largestFontSize,
50
50
  } = attributes;
51
51
 
52
+ const [ availableUnits ] = useSettings( 'spacing.units' );
52
53
  const units = useCustomUnits( {
53
- availableUnits: useSetting( 'spacing.units' ) || [
54
- '%',
55
- 'px',
56
- 'em',
57
- 'rem',
58
- ],
54
+ availableUnits: availableUnits || [ '%', 'px', 'em', 'rem' ],
59
55
  } );
60
56
 
61
57
  const getTaxonomyOptions = () => {
@@ -5,7 +5,7 @@ import { useEntityBlockEditor } from '@wordpress/core-data';
5
5
  import {
6
6
  InnerBlocks,
7
7
  useInnerBlocksProps,
8
- useSetting,
8
+ useSettings,
9
9
  store as blockEditorStore,
10
10
  } from '@wordpress/block-editor';
11
11
  import { useSelect } from '@wordpress/data';
@@ -21,8 +21,8 @@ export default function TemplatePartInnerBlocks( {
21
21
  const { getSettings } = select( blockEditorStore );
22
22
  return getSettings()?.supportsLayout;
23
23
  }, [] );
24
- const defaultLayout = useSetting( 'layout' ) || {};
25
- const usedLayout = !! layout && layout.inherit ? defaultLayout : layout;
24
+ const [ defaultLayout ] = useSettings( 'layout' );
25
+ const usedLayout = layout?.inherit ? defaultLayout || {} : layout;
26
26
 
27
27
  const [ blocks, onInput, onChange ] = useEntityBlockEditor(
28
28
  'postType',
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 3,
4
- "__experimental": "fse",
5
4
  "name": "core/term-description",
6
5
  "title": "Term Description",
7
6
  "category": "theme",