@wordpress/block-library 9.16.0 → 9.17.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 (215) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/archives/edit.js +2 -2
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/categories/edit.js +115 -37
  5. package/build/categories/edit.js.map +1 -1
  6. package/build/comments/edit/comments-inspector-controls.js +6 -5
  7. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  8. package/build/comments-pagination/index.js +5 -0
  9. package/build/comments-pagination/index.js.map +1 -1
  10. package/build/cover/edit/inspector-controls.js +2 -9
  11. package/build/cover/edit/inspector-controls.js.map +1 -1
  12. package/build/details/edit.js +16 -2
  13. package/build/details/edit.js.map +1 -1
  14. package/build/details/index.js +9 -0
  15. package/build/details/index.js.map +1 -1
  16. package/build/details/save.js +2 -0
  17. package/build/details/save.js.map +1 -1
  18. package/build/embed/transforms.js +5 -2
  19. package/build/embed/transforms.js.map +1 -1
  20. package/build/form/variations.js +1 -1
  21. package/build/form/variations.js.map +1 -1
  22. package/build/group/edit.js +2 -9
  23. package/build/group/edit.js.map +1 -1
  24. package/build/home-link/edit.js +1 -2
  25. package/build/home-link/edit.js.map +1 -1
  26. package/build/latest-comments/edit.js +73 -26
  27. package/build/latest-comments/edit.js.map +1 -1
  28. package/build/latest-posts/constants.js +2 -1
  29. package/build/latest-posts/constants.js.map +1 -1
  30. package/build/latest-posts/edit.js +91 -38
  31. package/build/latest-posts/edit.js.map +1 -1
  32. package/build/list-item/index.js +1 -1
  33. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
  34. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  35. package/build/navigation/edit/use-generate-default-navigation-title.js +4 -4
  36. package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
  37. package/build/navigation-link/edit.js +14 -19
  38. package/build/navigation-link/edit.js.map +1 -1
  39. package/build/navigation-submenu/index.js +7 -0
  40. package/build/navigation-submenu/index.js.map +1 -1
  41. package/build/page-list/edit.js +1 -1
  42. package/build/page-list/edit.js.map +1 -1
  43. package/build/paragraph/edit.js +4 -14
  44. package/build/paragraph/edit.js.map +1 -1
  45. package/build/pattern/index.js +1 -1
  46. package/build/post-content/index.js +1 -0
  47. package/build/post-content/index.js.map +1 -1
  48. package/build/post-date/edit.js +1 -1
  49. package/build/post-date/edit.js.map +1 -1
  50. package/build/post-featured-image/edit.js +0 -6
  51. package/build/post-featured-image/edit.js.map +1 -1
  52. package/build/post-navigation-link/variations.js +2 -2
  53. package/build/post-navigation-link/variations.js.map +1 -1
  54. package/build/post-terms/edit.js +1 -0
  55. package/build/post-terms/edit.js.map +1 -1
  56. package/build/post-time-to-read/index.js +1 -1
  57. package/build/query/edit/query-content.js +2 -6
  58. package/build/query/edit/query-content.js.map +1 -1
  59. package/build/query-no-results/index.js +1 -1
  60. package/build/query-pagination-numbers/edit.js +1 -1
  61. package/build/query-pagination-numbers/edit.js.map +1 -1
  62. package/build/query-title/edit.js +1 -0
  63. package/build/query-title/edit.js.map +1 -1
  64. package/build/read-more/edit.js +25 -7
  65. package/build/read-more/edit.js.map +1 -1
  66. package/build/search/edit.js +67 -49
  67. package/build/search/edit.js.map +1 -1
  68. package/build/separator/edit.js +2 -4
  69. package/build/separator/edit.js.map +1 -1
  70. package/build/spacer/controls.js +13 -9
  71. package/build/spacer/controls.js.map +1 -1
  72. package/build/spacer/edit.js +23 -21
  73. package/build/spacer/edit.js.map +1 -1
  74. package/build/template-part/edit/advanced-controls.js +2 -9
  75. package/build/template-part/edit/advanced-controls.js.map +1 -1
  76. package/build/utils/messages.js +22 -0
  77. package/build/utils/messages.js.map +1 -0
  78. package/build/video/edit-common-settings.js +1 -1
  79. package/build/video/edit-common-settings.js.map +1 -1
  80. package/build-module/archives/edit.js +2 -2
  81. package/build-module/archives/edit.js.map +1 -1
  82. package/build-module/categories/edit.js +116 -38
  83. package/build-module/categories/edit.js.map +1 -1
  84. package/build-module/comments/edit/comments-inspector-controls.js +5 -4
  85. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  86. package/build-module/comments-pagination/index.js +5 -0
  87. package/build-module/comments-pagination/index.js.map +1 -1
  88. package/build-module/cover/edit/inspector-controls.js +1 -8
  89. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  90. package/build-module/details/edit.js +17 -3
  91. package/build-module/details/edit.js.map +1 -1
  92. package/build-module/details/index.js +9 -0
  93. package/build-module/details/index.js.map +1 -1
  94. package/build-module/details/save.js +2 -0
  95. package/build-module/details/save.js.map +1 -1
  96. package/build-module/embed/transforms.js +5 -2
  97. package/build-module/embed/transforms.js.map +1 -1
  98. package/build-module/form/variations.js +1 -1
  99. package/build-module/form/variations.js.map +1 -1
  100. package/build-module/group/edit.js +1 -8
  101. package/build-module/group/edit.js.map +1 -1
  102. package/build-module/home-link/edit.js +1 -2
  103. package/build-module/home-link/edit.js.map +1 -1
  104. package/build-module/latest-comments/edit.js +74 -27
  105. package/build-module/latest-comments/edit.js.map +1 -1
  106. package/build-module/latest-posts/constants.js +1 -0
  107. package/build-module/latest-posts/constants.js.map +1 -1
  108. package/build-module/latest-posts/edit.js +93 -40
  109. package/build-module/latest-posts/edit.js.map +1 -1
  110. package/build-module/list-item/index.js +1 -1
  111. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
  112. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  113. package/build-module/navigation/edit/use-generate-default-navigation-title.js +4 -4
  114. package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
  115. package/build-module/navigation-link/edit.js +15 -20
  116. package/build-module/navigation-link/edit.js.map +1 -1
  117. package/build-module/navigation-submenu/index.js +7 -0
  118. package/build-module/navigation-submenu/index.js.map +1 -1
  119. package/build-module/page-list/edit.js +1 -1
  120. package/build-module/page-list/edit.js.map +1 -1
  121. package/build-module/paragraph/edit.js +5 -15
  122. package/build-module/paragraph/edit.js.map +1 -1
  123. package/build-module/pattern/index.js +1 -1
  124. package/build-module/post-content/index.js +1 -0
  125. package/build-module/post-content/index.js.map +1 -1
  126. package/build-module/post-date/edit.js +1 -1
  127. package/build-module/post-date/edit.js.map +1 -1
  128. package/build-module/post-featured-image/edit.js +0 -6
  129. package/build-module/post-featured-image/edit.js.map +1 -1
  130. package/build-module/post-navigation-link/variations.js +2 -2
  131. package/build-module/post-navigation-link/variations.js.map +1 -1
  132. package/build-module/post-terms/edit.js +1 -0
  133. package/build-module/post-terms/edit.js.map +1 -1
  134. package/build-module/post-time-to-read/index.js +1 -1
  135. package/build-module/query/edit/query-content.js +1 -5
  136. package/build-module/query/edit/query-content.js.map +1 -1
  137. package/build-module/query-no-results/index.js +1 -1
  138. package/build-module/query-pagination-numbers/edit.js +1 -1
  139. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  140. package/build-module/query-title/edit.js +1 -0
  141. package/build-module/query-title/edit.js.map +1 -1
  142. package/build-module/read-more/edit.js +26 -8
  143. package/build-module/read-more/edit.js.map +1 -1
  144. package/build-module/search/edit.js +68 -50
  145. package/build-module/search/edit.js.map +1 -1
  146. package/build-module/separator/edit.js +1 -3
  147. package/build-module/separator/edit.js.map +1 -1
  148. package/build-module/spacer/controls.js +13 -9
  149. package/build-module/spacer/controls.js.map +1 -1
  150. package/build-module/spacer/edit.js +24 -22
  151. package/build-module/spacer/edit.js.map +1 -1
  152. package/build-module/template-part/edit/advanced-controls.js +1 -8
  153. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  154. package/build-module/utils/messages.js +15 -0
  155. package/build-module/utils/messages.js.map +1 -0
  156. package/build-module/video/edit-common-settings.js +1 -1
  157. package/build-module/video/edit-common-settings.js.map +1 -1
  158. package/build-style/editor-rtl.css +8 -45
  159. package/build-style/editor.css +8 -45
  160. package/build-style/gallery/editor-rtl.css +0 -44
  161. package/build-style/gallery/editor.css +0 -44
  162. package/build-style/navigation-link/editor-rtl.css +3 -0
  163. package/build-style/navigation-link/editor.css +3 -0
  164. package/build-style/paragraph/editor-rtl.css +4 -0
  165. package/build-style/paragraph/editor.css +4 -0
  166. package/build-style/post-featured-image/editor-rtl.css +1 -1
  167. package/build-style/post-featured-image/editor.css +1 -1
  168. package/package.json +35 -35
  169. package/src/archives/edit.js +2 -2
  170. package/src/categories/edit.js +133 -45
  171. package/src/comments/edit/comments-inspector-controls.js +5 -8
  172. package/src/comments-pagination/block.json +5 -0
  173. package/src/cover/edit/inspector-controls.js +1 -21
  174. package/src/details/block.json +9 -0
  175. package/src/details/edit.js +18 -2
  176. package/src/details/save.js +6 -2
  177. package/src/embed/transforms.js +3 -1
  178. package/src/form/variations.js +1 -1
  179. package/src/gallery/editor.scss +0 -56
  180. package/src/group/edit.js +1 -20
  181. package/src/home-link/edit.js +0 -6
  182. package/src/latest-comments/edit.js +93 -33
  183. package/src/latest-posts/constants.js +1 -0
  184. package/src/latest-posts/edit.js +119 -44
  185. package/src/list/test/edit.native.js +9 -9
  186. package/src/list-item/block.json +1 -1
  187. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
  188. package/src/navigation/edit/use-generate-default-navigation-title.js +4 -4
  189. package/src/navigation-link/edit.js +25 -29
  190. package/src/navigation-link/editor.scss +27 -18
  191. package/src/navigation-submenu/index.js +7 -0
  192. package/src/navigation-submenu/index.php +21 -4
  193. package/src/page-list/edit.js +52 -50
  194. package/src/paragraph/edit.js +3 -18
  195. package/src/paragraph/editor.scss +7 -0
  196. package/src/pattern/block.json +1 -1
  197. package/src/post-content/block.json +1 -0
  198. package/src/post-date/edit.js +1 -3
  199. package/src/post-featured-image/edit.js +2 -15
  200. package/src/post-featured-image/editor.scss +2 -2
  201. package/src/post-navigation-link/variations.js +2 -2
  202. package/src/post-terms/edit.js +1 -0
  203. package/src/post-time-to-read/block.json +1 -1
  204. package/src/query/edit/query-content.js +1 -11
  205. package/src/query-no-results/block.json +1 -1
  206. package/src/query-pagination-numbers/edit.js +1 -1
  207. package/src/query-title/edit.js +1 -0
  208. package/src/read-more/edit.js +35 -11
  209. package/src/search/edit.js +99 -74
  210. package/src/separator/edit.js +1 -6
  211. package/src/spacer/controls.js +10 -9
  212. package/src/spacer/edit.js +25 -23
  213. package/src/template-part/edit/advanced-controls.js +1 -21
  214. package/src/utils/messages.js +31 -0
  215. package/src/video/edit-common-settings.js +1 -1
@@ -25,12 +25,13 @@ import {
25
25
  ToolbarGroup,
26
26
  ToolbarButton,
27
27
  ResizableBox,
28
- PanelBody,
29
- __experimentalVStack as VStack,
30
28
  __experimentalUseCustomUnits as useCustomUnits,
31
29
  __experimentalUnitControl as UnitControl,
32
30
  __experimentalToggleGroupControl as ToggleGroupControl,
33
31
  __experimentalToggleGroupControlOption as ToggleGroupControlOption,
32
+ __experimentalToolsPanel as ToolsPanel,
33
+ __experimentalToolsPanelItem as ToolsPanelItem,
34
+ __experimentalVStack as VStack,
34
35
  } from '@wordpress/components';
35
36
  import { useInstanceId } from '@wordpress/compose';
36
37
  import { Icon, search } from '@wordpress/icons';
@@ -54,6 +55,7 @@ import {
54
55
  MIN_WIDTH,
55
56
  isPercentageUnit,
56
57
  } from './utils.js';
58
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
57
59
 
58
60
  // Used to calculate border radius adjustment to avoid "fat" corners when
59
61
  // button is placed inside wrapper.
@@ -370,6 +372,7 @@ export default function SearchEdit( {
370
372
  </>
371
373
  );
372
374
  };
375
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
373
376
 
374
377
  const controls = (
375
378
  <>
@@ -408,79 +411,101 @@ export default function SearchEdit( {
408
411
  </BlockControls>
409
412
 
410
413
  <InspectorControls>
411
- <PanelBody title={ __( 'Settings' ) }>
412
- <VStack
413
- className="wp-block-search__inspector-controls"
414
- spacing={ 4 }
414
+ <ToolsPanel
415
+ label={ __( 'Settings' ) }
416
+ resetAll={ () => {
417
+ setAttributes( {
418
+ width: undefined,
419
+ widthUnit: undefined,
420
+ } );
421
+ } }
422
+ dropdownMenuProps={ dropdownMenuProps }
423
+ >
424
+ <ToolsPanelItem
425
+ hasValue={ () => !! width }
426
+ label={ __( 'Width' ) }
427
+ onDeselect={ () => {
428
+ setAttributes( {
429
+ width: undefined,
430
+ widthUnit: undefined,
431
+ } );
432
+ } }
433
+ isShownByDefault
415
434
  >
416
- <UnitControl
417
- __next40pxDefaultSize
418
- label={ __( 'Width' ) }
419
- id={ unitControlInputId } // unused, kept for backwards compatibility
420
- min={
421
- isPercentageUnit( widthUnit ) ? 0 : MIN_WIDTH
422
- }
423
- max={
424
- isPercentageUnit( widthUnit ) ? 100 : undefined
425
- }
426
- step={ 1 }
427
- onChange={ ( newWidth ) => {
428
- const parsedNewWidth =
429
- newWidth === ''
430
- ? undefined
431
- : parseInt( newWidth, 10 );
432
- setAttributes( {
433
- width: parsedNewWidth,
434
- } );
435
- } }
436
- onUnitChange={ ( newUnit ) => {
437
- setAttributes( {
438
- width:
439
- '%' === newUnit
440
- ? PC_WIDTH_DEFAULT
441
- : PX_WIDTH_DEFAULT,
442
- widthUnit: newUnit,
443
- } );
444
- } }
445
- __unstableInputWidth="80px"
446
- value={ `${ width }${ widthUnit }` }
447
- units={ units }
448
- />
449
- <ToggleGroupControl
450
- label={ __( 'Percentage Width' ) }
451
- value={
452
- PERCENTAGE_WIDTHS.includes( width ) &&
453
- widthUnit === '%'
454
- ? width
455
- : undefined
456
- }
457
- hideLabelFromVision
458
- onChange={ ( newWidth ) => {
459
- setAttributes( {
460
- width: newWidth,
461
- widthUnit: '%',
462
- } );
463
- } }
464
- isBlock
465
- __next40pxDefaultSize
466
- __nextHasNoMarginBottom
467
- >
468
- { PERCENTAGE_WIDTHS.map( ( widthValue ) => {
469
- return (
470
- <ToggleGroupControlOption
471
- key={ widthValue }
472
- value={ widthValue }
473
- label={ sprintf(
474
- /* translators: Percentage value. */
475
- __( '%d%%' ),
476
- widthValue
477
- ) }
478
- />
479
- );
480
- } ) }
481
- </ToggleGroupControl>
482
- </VStack>
483
- </PanelBody>
435
+ <VStack>
436
+ <UnitControl
437
+ __next40pxDefaultSize
438
+ label={ __( 'Width' ) }
439
+ id={ unitControlInputId } // Unused, kept for backwards compatibility
440
+ min={
441
+ isPercentageUnit( widthUnit )
442
+ ? 0
443
+ : MIN_WIDTH
444
+ }
445
+ max={
446
+ isPercentageUnit( widthUnit )
447
+ ? 100
448
+ : undefined
449
+ }
450
+ step={ 1 }
451
+ onChange={ ( newWidth ) => {
452
+ const parsedNewWidth =
453
+ newWidth === ''
454
+ ? undefined
455
+ : parseInt( newWidth, 10 );
456
+ setAttributes( {
457
+ width: parsedNewWidth,
458
+ } );
459
+ } }
460
+ onUnitChange={ ( newUnit ) => {
461
+ setAttributes( {
462
+ width:
463
+ '%' === newUnit
464
+ ? PC_WIDTH_DEFAULT
465
+ : PX_WIDTH_DEFAULT,
466
+ widthUnit: newUnit,
467
+ } );
468
+ } }
469
+ __unstableInputWidth="80px"
470
+ value={ `${ width }${ widthUnit }` }
471
+ units={ units }
472
+ />
473
+ <ToggleGroupControl
474
+ label={ __( 'Percentage Width' ) }
475
+ value={
476
+ PERCENTAGE_WIDTHS.includes( width ) &&
477
+ widthUnit === '%'
478
+ ? width
479
+ : undefined
480
+ }
481
+ hideLabelFromVision
482
+ onChange={ ( newWidth ) => {
483
+ setAttributes( {
484
+ width: newWidth,
485
+ widthUnit: '%',
486
+ } );
487
+ } }
488
+ isBlock
489
+ __next40pxDefaultSize
490
+ __nextHasNoMarginBottom
491
+ >
492
+ { PERCENTAGE_WIDTHS.map( ( widthValue ) => {
493
+ return (
494
+ <ToggleGroupControlOption
495
+ key={ widthValue }
496
+ value={ widthValue }
497
+ label={ sprintf(
498
+ /* translators: Percentage value. */
499
+ __( '%d%%' ),
500
+ widthValue
501
+ ) }
502
+ />
503
+ );
504
+ } ) }
505
+ </ToggleGroupControl>
506
+ </VStack>
507
+ </ToolsPanelItem>
508
+ </ToolsPanel>
484
509
  </InspectorControls>
485
510
  </>
486
511
  );
@@ -19,12 +19,7 @@ import { __ } from '@wordpress/i18n';
19
19
  * Internal dependencies
20
20
  */
21
21
  import useDeprecatedOpacity from './use-deprecated-opacity';
22
-
23
- const htmlElementMessages = {
24
- div: __(
25
- 'The <div> element should only be used if the separator is a design element that should not be announced.'
26
- ),
27
- };
22
+ import { htmlElementMessages } from '../utils/messages';
28
23
 
29
24
  export default function SeparatorEdit( { attributes, setAttributes } ) {
30
25
  const { backgroundColor, opacity, style, tagName } = attributes;
@@ -24,6 +24,7 @@ import { View } from '@wordpress/primitives';
24
24
  */
25
25
  import { unlock } from '../lock-unlock';
26
26
  import { MIN_SPACER_SIZE } from './constants';
27
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
27
28
 
28
29
  const { useSpacingSizes } = unlock( blockEditorPrivateApis );
29
30
 
@@ -43,10 +44,6 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
43
44
  defaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 },
44
45
  } );
45
46
 
46
- const handleOnChange = ( unprocessedValue ) => {
47
- onChange( unprocessedValue.all );
48
- };
49
-
50
47
  // Force the unit to update to `px` when the Spacer is being resized.
51
48
  const [ parsedQuantity, parsedUnit ] =
52
49
  parseQuantityAndUnitFromRawValue( value );
@@ -56,23 +53,24 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
56
53
 
57
54
  return (
58
55
  <>
59
- { ( ! spacingSizes || spacingSizes?.length === 0 ) && (
56
+ { spacingSizes?.length < 2 ? (
60
57
  <UnitControl
61
58
  id={ inputId }
62
59
  isResetValueOnUnitChange
63
60
  min={ MIN_SPACER_SIZE }
64
- onChange={ handleOnChange }
61
+ onChange={ onChange }
65
62
  value={ computedValue }
66
63
  units={ units }
67
64
  label={ label }
68
65
  __next40pxDefaultSize
69
66
  />
70
- ) }
71
- { spacingSizes?.length > 0 && (
67
+ ) : (
72
68
  <View className="tools-panel-item-spacing">
73
69
  <SpacingSizesControl
74
70
  values={ { all: computedValue } }
75
- onChange={ handleOnChange }
71
+ onChange={ ( { all } ) => {
72
+ onChange( all );
73
+ } }
76
74
  label={ label }
77
75
  sides={ [ 'all' ] }
78
76
  units={ units }
@@ -93,6 +91,8 @@ export default function SpacerControls( {
93
91
  width,
94
92
  isResizing,
95
93
  } ) {
94
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
95
+
96
96
  return (
97
97
  <InspectorControls>
98
98
  <ToolsPanel
@@ -103,6 +103,7 @@ export default function SpacerControls( {
103
103
  height: '100px',
104
104
  } );
105
105
  } }
106
+ dropdownMenuProps={ dropdownMenuProps }
106
107
  >
107
108
  { orientation === 'horizontal' && (
108
109
  <ToolsPanelItem
@@ -16,7 +16,7 @@ import {
16
16
  import { ResizableBox } from '@wordpress/components';
17
17
  import { useState, useEffect } from '@wordpress/element';
18
18
  import { View } from '@wordpress/primitives';
19
- import { useSelect } from '@wordpress/data';
19
+ import { useSelect, useDispatch } from '@wordpress/data';
20
20
 
21
21
  /**
22
22
  * Internal dependencies
@@ -124,6 +124,9 @@ const SpacerEdit = ( {
124
124
  const onResizeStart = () => toggleSelection( false );
125
125
  const onResizeStop = () => toggleSelection( true );
126
126
 
127
+ const { __unstableMarkNextChangeAsNotPersistent } =
128
+ useDispatch( blockEditorStore );
129
+
127
130
  const handleOnVerticalResizeStop = ( newHeight ) => {
128
131
  onResizeStop();
129
132
 
@@ -256,11 +259,19 @@ const SpacerEdit = ( {
256
259
  };
257
260
 
258
261
  useEffect( () => {
262
+ // To avoid interfering with undo/redo operations any changes in this
263
+ // effect must not make history and should be preceded by
264
+ // `__unstableMarkNextChangeAsNotPersistent()`.
265
+ const setAttributesCovertly = ( nextAttributes ) => {
266
+ __unstableMarkNextChangeAsNotPersistent();
267
+ setAttributes( nextAttributes );
268
+ };
269
+
259
270
  if (
260
271
  isFlexLayout &&
261
272
  selfStretch !== 'fill' &&
262
273
  selfStretch !== 'fit' &&
263
- ! flexSize
274
+ flexSize === undefined
264
275
  ) {
265
276
  if ( inheritedOrientation === 'horizontal' ) {
266
277
  // If spacer is moving from a vertical container to a horizontal container,
@@ -269,7 +280,7 @@ const SpacerEdit = ( {
269
280
  getCustomValueFromPreset( width, spacingSizes ) ||
270
281
  getCustomValueFromPreset( height, spacingSizes ) ||
271
282
  '100px';
272
- setAttributes( {
283
+ setAttributesCovertly( {
273
284
  width: '0px',
274
285
  style: {
275
286
  ...blockStyle,
@@ -285,7 +296,7 @@ const SpacerEdit = ( {
285
296
  getCustomValueFromPreset( height, spacingSizes ) ||
286
297
  getCustomValueFromPreset( width, spacingSizes ) ||
287
298
  '100px';
288
- setAttributes( {
299
+ setAttributesCovertly( {
289
300
  height: '0px',
290
301
  style: {
291
302
  ...blockStyle,
@@ -301,26 +312,16 @@ const SpacerEdit = ( {
301
312
  isFlexLayout &&
302
313
  ( selfStretch === 'fill' || selfStretch === 'fit' )
303
314
  ) {
304
- if ( inheritedOrientation === 'horizontal' ) {
305
- setAttributes( {
306
- width: undefined,
307
- } );
308
- } else {
309
- setAttributes( {
310
- height: undefined,
311
- } );
312
- }
315
+ setAttributesCovertly(
316
+ inheritedOrientation === 'horizontal'
317
+ ? { width: undefined }
318
+ : { height: undefined }
319
+ );
313
320
  } else if ( ! isFlexLayout && ( selfStretch || flexSize ) ) {
314
- if ( inheritedOrientation === 'horizontal' ) {
315
- setAttributes( {
316
- width: flexSize,
317
- } );
318
- } else {
319
- setAttributes( {
320
- height: flexSize,
321
- } );
322
- }
323
- setAttributes( {
321
+ setAttributesCovertly( {
322
+ ...( inheritedOrientation === 'horizontal'
323
+ ? { width: flexSize }
324
+ : { height: flexSize } ),
324
325
  style: {
325
326
  ...blockStyle,
326
327
  layout: {
@@ -342,6 +343,7 @@ const SpacerEdit = ( {
342
343
  setAttributes,
343
344
  spacingSizes,
344
345
  width,
346
+ __unstableMarkNextChangeAsNotPersistent,
345
347
  ] );
346
348
 
347
349
  return (
@@ -10,27 +10,7 @@ import { useSelect } from '@wordpress/data';
10
10
  * Internal dependencies
11
11
  */
12
12
  import { TemplatePartImportControls } from './import-controls';
13
-
14
- const htmlElementMessages = {
15
- header: __(
16
- 'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
17
- ),
18
- main: __(
19
- 'The <main> element should be used for the primary content of your document only.'
20
- ),
21
- section: __(
22
- "The <section> element should represent a standalone portion of the document that can't be better represented by another element."
23
- ),
24
- article: __(
25
- 'The <article> element should represent a self-contained, syndicatable portion of the document.'
26
- ),
27
- aside: __(
28
- "The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
29
- ),
30
- footer: __(
31
- 'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
32
- ),
33
- };
13
+ import { htmlElementMessages } from '../../utils/messages';
34
14
 
35
15
  export function TemplatePartAdvancedControls( {
36
16
  tagName,
@@ -0,0 +1,31 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ export const htmlElementMessages = {
7
+ article: __(
8
+ 'The <article> element should represent a self-contained, syndicatable portion of the document.'
9
+ ),
10
+ aside: __(
11
+ "The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
12
+ ),
13
+ div: __(
14
+ 'The <div> element should only be used if the block is a design element with no semantic meaning.'
15
+ ),
16
+ footer: __(
17
+ 'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
18
+ ),
19
+ header: __(
20
+ 'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
21
+ ),
22
+ main: __(
23
+ 'The <main> element should be used for the primary content of your document only.'
24
+ ),
25
+ nav: __(
26
+ 'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'
27
+ ),
28
+ section: __(
29
+ "The <section> element should represent a standalone portion of the document that can't be better represented by another element."
30
+ ),
31
+ };
@@ -125,7 +125,7 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
125
125
  /* translators: Setting to play videos within the webpage on mobile browsers rather than opening in a fullscreen player. */
126
126
  label={ __( 'Play inline' ) }
127
127
  onChange={ toggleFactory.playsInline }
128
- checked={ playsInline }
128
+ checked={ !! playsInline }
129
129
  help={ __(
130
130
  'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'
131
131
  ) }