@wordpress/block-library 8.21.0 → 8.21.1-next.f8d8eceb.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 (192) hide show
  1. package/build/avatar/index.js +5 -1
  2. package/build/avatar/index.js.map +1 -1
  3. package/build/block/edit-title.native.js +11 -3
  4. package/build/block/edit-title.native.js.map +1 -1
  5. package/build/column/edit.js +2 -1
  6. package/build/column/edit.js.map +1 -1
  7. package/build/column/edit.native.js +2 -1
  8. package/build/column/edit.native.js.map +1 -1
  9. package/build/columns/edit.native.js +2 -1
  10. package/build/columns/edit.native.js.map +1 -1
  11. package/build/cover/controls.native.js +2 -1
  12. package/build/cover/controls.native.js.map +1 -1
  13. package/build/cover/edit/index.js +2 -1
  14. package/build/cover/edit/index.js.map +1 -1
  15. package/build/cover/edit/inspector-controls.js +2 -1
  16. package/build/cover/edit/inspector-controls.js.map +1 -1
  17. package/build/file/view.js +1 -1
  18. package/build/file/view.js.map +1 -1
  19. package/build/form/edit.js +1 -1
  20. package/build/form/edit.js.map +1 -1
  21. package/build/form/variations.js +1 -1
  22. package/build/form/variations.js.map +1 -1
  23. package/build/form-input/index.js +1 -1
  24. package/build/form-input/variations.js +7 -7
  25. package/build/form-input/variations.js.map +1 -1
  26. package/build/form-submission-notification/variations.js +4 -4
  27. package/build/form-submission-notification/variations.js.map +1 -1
  28. package/build/form-submit-button/index.js +1 -1
  29. package/build/group/edit.js +2 -11
  30. package/build/group/edit.js.map +1 -1
  31. package/build/html/preview.js +2 -4
  32. package/build/html/preview.js.map +1 -1
  33. package/build/image/image.js +11 -5
  34. package/build/image/image.js.map +1 -1
  35. package/build/image/view.js +10 -20
  36. package/build/image/view.js.map +1 -1
  37. package/build/missing/edit.native.js +46 -8
  38. package/build/missing/edit.native.js.map +1 -1
  39. package/build/paragraph/edit.js +1 -1
  40. package/build/paragraph/edit.js.map +1 -1
  41. package/build/post-featured-image/dimension-controls.js +2 -2
  42. package/build/post-featured-image/dimension-controls.js.map +1 -1
  43. package/build/query/edit/enhanced-pagination-modal.js +27 -13
  44. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  45. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +15 -12
  46. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  47. package/build/query/utils.js +29 -8
  48. package/build/query/utils.js.map +1 -1
  49. package/build/query/view.js +4 -2
  50. package/build/query/view.js.map +1 -1
  51. package/build/search/edit.js +1 -2
  52. package/build/search/edit.js.map +1 -1
  53. package/build/social-link/edit.native.js +7 -19
  54. package/build/social-link/edit.native.js.map +1 -1
  55. package/build/spacer/controls.js +3 -3
  56. package/build/spacer/controls.js.map +1 -1
  57. package/build/spacer/controls.native.js +2 -1
  58. package/build/spacer/controls.native.js.map +1 -1
  59. package/build/spacer/edit.js +1 -1
  60. package/build/spacer/edit.js.map +1 -1
  61. package/build/spacer/edit.native.js +5 -1
  62. package/build/spacer/edit.native.js.map +1 -1
  63. package/build/tag-cloud/edit.js +2 -1
  64. package/build/tag-cloud/edit.js.map +1 -1
  65. package/build/template-part/edit/inner-blocks.js +2 -2
  66. package/build/template-part/edit/inner-blocks.js.map +1 -1
  67. package/build/term-description/index.js +0 -1
  68. package/build/term-description/index.js.map +1 -1
  69. package/build-module/avatar/index.js +5 -1
  70. package/build-module/avatar/index.js.map +1 -1
  71. package/build-module/block/edit-title.native.js +12 -4
  72. package/build-module/block/edit-title.native.js.map +1 -1
  73. package/build-module/column/edit.js +3 -2
  74. package/build-module/column/edit.js.map +1 -1
  75. package/build-module/column/edit.native.js +3 -2
  76. package/build-module/column/edit.native.js.map +1 -1
  77. package/build-module/columns/edit.native.js +3 -2
  78. package/build-module/columns/edit.native.js.map +1 -1
  79. package/build-module/cover/controls.native.js +3 -2
  80. package/build-module/cover/controls.native.js.map +1 -1
  81. package/build-module/cover/edit/index.js +3 -2
  82. package/build-module/cover/edit/index.js.map +1 -1
  83. package/build-module/cover/edit/inspector-controls.js +3 -2
  84. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  85. package/build-module/file/view.js +2 -2
  86. package/build-module/file/view.js.map +1 -1
  87. package/build-module/form/edit.js +1 -1
  88. package/build-module/form/edit.js.map +1 -1
  89. package/build-module/form/variations.js +1 -1
  90. package/build-module/form/variations.js.map +1 -1
  91. package/build-module/form-input/index.js +1 -1
  92. package/build-module/form-input/variations.js +7 -7
  93. package/build-module/form-input/variations.js.map +1 -1
  94. package/build-module/form-submission-notification/variations.js +4 -4
  95. package/build-module/form-submission-notification/variations.js.map +1 -1
  96. package/build-module/form-submit-button/index.js +1 -1
  97. package/build-module/group/edit.js +3 -12
  98. package/build-module/group/edit.js.map +1 -1
  99. package/build-module/html/preview.js +2 -4
  100. package/build-module/html/preview.js.map +1 -1
  101. package/build-module/image/image.js +12 -6
  102. package/build-module/image/image.js.map +1 -1
  103. package/build-module/image/view.js +10 -20
  104. package/build-module/image/view.js.map +1 -1
  105. package/build-module/missing/edit.native.js +47 -9
  106. package/build-module/missing/edit.native.js.map +1 -1
  107. package/build-module/paragraph/edit.js +2 -2
  108. package/build-module/paragraph/edit.js.map +1 -1
  109. package/build-module/post-featured-image/dimension-controls.js +3 -3
  110. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  111. package/build-module/query/edit/enhanced-pagination-modal.js +28 -14
  112. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  113. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +17 -14
  114. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  115. package/build-module/query/utils.js +27 -5
  116. package/build-module/query/utils.js.map +1 -1
  117. package/build-module/query/view.js +4 -2
  118. package/build-module/query/view.js.map +1 -1
  119. package/build-module/search/edit.js +2 -3
  120. package/build-module/search/edit.js.map +1 -1
  121. package/build-module/social-link/edit.native.js +8 -20
  122. package/build-module/social-link/edit.native.js.map +1 -1
  123. package/build-module/spacer/controls.js +4 -4
  124. package/build-module/spacer/controls.js.map +1 -1
  125. package/build-module/spacer/controls.native.js +3 -2
  126. package/build-module/spacer/controls.native.js.map +1 -1
  127. package/build-module/spacer/edit.js +2 -2
  128. package/build-module/spacer/edit.js.map +1 -1
  129. package/build-module/spacer/edit.native.js +6 -2
  130. package/build-module/spacer/edit.native.js.map +1 -1
  131. package/build-module/tag-cloud/edit.js +3 -2
  132. package/build-module/tag-cloud/edit.js.map +1 -1
  133. package/build-module/template-part/edit/inner-blocks.js +3 -3
  134. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  135. package/build-module/term-description/index.js +0 -1
  136. package/build-module/term-description/index.js.map +1 -1
  137. package/build-style/file/style-rtl.css +0 -5
  138. package/build-style/file/style.css +0 -5
  139. package/build-style/navigation/style-rtl.css +5 -0
  140. package/build-style/navigation/style.css +5 -0
  141. package/build-style/style-rtl.css +5 -5
  142. package/build-style/style.css +5 -5
  143. package/package.json +32 -32
  144. package/src/avatar/block.json +5 -1
  145. package/src/block/edit-title.native.js +16 -13
  146. package/src/calendar/index.php +2 -6
  147. package/src/column/edit.js +3 -8
  148. package/src/column/edit.native.js +3 -8
  149. package/src/columns/edit.native.js +3 -8
  150. package/src/comment-author-avatar/index.php +1 -1
  151. package/src/cover/controls.native.js +3 -8
  152. package/src/cover/edit/index.js +3 -2
  153. package/src/cover/edit/inspector-controls.js +3 -8
  154. package/src/file/index.php +2 -1
  155. package/src/file/style.scss +0 -6
  156. package/src/file/view.js +2 -2
  157. package/src/form/edit.js +1 -1
  158. package/src/form/variations.js +1 -1
  159. package/src/form-input/block.json +1 -1
  160. package/src/form-input/variations.js +7 -7
  161. package/src/form-submission-notification/variations.js +4 -4
  162. package/src/form-submit-button/block.json +1 -1
  163. package/src/freeform/test/__snapshots__/index.native.js.snap +7 -0
  164. package/src/freeform/test/index.native.js +57 -0
  165. package/src/group/edit.js +2 -7
  166. package/src/html/preview.js +9 -4
  167. package/src/image/image.js +17 -6
  168. package/src/image/index.php +5 -6
  169. package/src/image/view.js +13 -19
  170. package/src/missing/edit.native.js +43 -6
  171. package/src/navigation/index.php +1 -1
  172. package/src/navigation/style.scss +6 -1
  173. package/src/paragraph/edit.js +2 -2
  174. package/src/post-featured-image/dimension-controls.js +3 -3
  175. package/src/query/edit/enhanced-pagination-modal.js +37 -21
  176. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +18 -22
  177. package/src/query/index.php +97 -8
  178. package/src/query/utils.js +29 -8
  179. package/src/query/view.js +11 -2
  180. package/src/query-pagination-next/index.php +1 -1
  181. package/src/query-pagination-previous/index.php +1 -1
  182. package/src/search/edit.js +5 -3
  183. package/src/social-link/edit.native.js +12 -26
  184. package/src/social-link/editor.native.scss +0 -9
  185. package/src/social-link/index.php +2 -2
  186. package/src/spacer/controls.js +9 -12
  187. package/src/spacer/controls.native.js +3 -8
  188. package/src/spacer/edit.js +2 -2
  189. package/src/spacer/edit.native.js +6 -5
  190. package/src/tag-cloud/edit.js +3 -7
  191. package/src/template-part/edit/inner-blocks.js +3 -3
  192. package/src/term-description/block.json +0 -1
@@ -346,22 +346,43 @@ export const usePatterns = ( clientId, name ) => {
346
346
  };
347
347
 
348
348
  /**
349
- * Hook that returns whether the Query Loop with the given `clientId` contains
350
- * any third-party block.
349
+ * The object returned by useUnsupportedBlocks with info about the type of
350
+ * unsupported blocks present inside the Query block.
351
+ *
352
+ * @typedef {Object} UnsupportedBlocksInfo
353
+ * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present.
354
+ * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present.
355
+ * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks.
356
+ */
357
+
358
+ /**
359
+ * Hook that returns an object with information about the unsupported blocks
360
+ * present inside a Query Loop with the given `clientId`. The returned object
361
+ * contains props that are true when a certain type of unsupported block is
362
+ * present.
351
363
  *
352
364
  * @param {string} clientId The block's client ID.
353
- * @return {boolean} True if it contains third-party blocks.
365
+ * @return {UnsupportedBlocksInfo} The object containing the information.
354
366
  */
355
- export const useContainsThirdPartyBlocks = ( clientId ) => {
367
+ export const useUnsupportedBlocks = ( clientId ) => {
356
368
  return useSelect(
357
369
  ( select ) => {
358
370
  const { getClientIdsOfDescendants, getBlockName } =
359
371
  select( blockEditorStore );
360
-
361
- return getClientIdsOfDescendants( clientId ).some(
362
- ( descendantClientId ) =>
363
- ! getBlockName( descendantClientId ).startsWith( 'core/' )
372
+ const blocks = {};
373
+ getClientIdsOfDescendants( clientId ).forEach(
374
+ ( descendantClientId ) => {
375
+ const blockName = getBlockName( descendantClientId );
376
+ if ( ! blockName.startsWith( 'core/' ) ) {
377
+ blocks.hasBlocksFromPlugins = true;
378
+ } else if ( blockName === 'core/post-content' ) {
379
+ blocks.hasPostContentBlock = true;
380
+ }
381
+ }
364
382
  );
383
+ blocks.hasUnsupportedBlocks =
384
+ blocks.hasBlocksFromPlugins || blocks.hasPostContentBlock;
385
+ return blocks;
365
386
  },
366
387
  [ clientId ]
367
388
  );
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",