@wordpress/block-library 9.26.1-next.719a03cbe.0 → 9.27.1-next.46f643fa0.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 (170) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/categories/edit.js +15 -3
  3. package/build/categories/edit.js.map +1 -1
  4. package/build/cover/edit/block-controls.js +4 -2
  5. package/build/cover/edit/block-controls.js.map +1 -1
  6. package/build/cover/edit/index.js +6 -3
  7. package/build/cover/edit/index.js.map +1 -1
  8. package/build/cover/edit/inspector-controls.js +13 -4
  9. package/build/cover/edit/inspector-controls.js.map +1 -1
  10. package/build/cover/index.js +6 -0
  11. package/build/cover/index.js.map +1 -1
  12. package/build/cover/save.js +3 -1
  13. package/build/cover/save.js.map +1 -1
  14. package/build/file/edit.js +2 -1
  15. package/build/file/edit.js.map +1 -1
  16. package/build/latest-posts/edit.js +0 -2
  17. package/build/latest-posts/edit.js.map +1 -1
  18. package/build/media-text/edit.js +2 -2
  19. package/build/media-text/edit.js.map +1 -1
  20. package/build/navigation-link/edit.js +32 -15
  21. package/build/navigation-link/edit.js.map +1 -1
  22. package/build/navigation-link/update-attributes.js +112 -14
  23. package/build/navigation-link/update-attributes.js.map +1 -1
  24. package/build/navigation-submenu/edit.js +19 -2
  25. package/build/navigation-submenu/edit.js.map +1 -1
  26. package/build/paragraph/edit.js +2 -2
  27. package/build/paragraph/edit.js.map +1 -1
  28. package/build/post-content/edit.js +78 -16
  29. package/build/post-content/edit.js.map +1 -1
  30. package/build/post-content/index.js +6 -0
  31. package/build/post-content/index.js.map +1 -1
  32. package/build/post-date/deprecated.js +104 -1
  33. package/build/post-date/deprecated.js.map +1 -1
  34. package/build/post-date/edit.js +32 -32
  35. package/build/post-date/edit.js.map +1 -1
  36. package/build/post-date/index.js +4 -4
  37. package/build/post-date/index.js.map +1 -1
  38. package/build/post-date/variations.js +32 -3
  39. package/build/post-date/variations.js.map +1 -1
  40. package/build/separator/edit.js +5 -30
  41. package/build/separator/edit.js.map +1 -1
  42. package/build/site-tagline/index.js +1 -1
  43. package/build/social-link/variations.js +51 -49
  44. package/build/social-link/variations.js.map +1 -1
  45. package/build/utils/poster-image.js +93 -0
  46. package/build/utils/poster-image.js.map +1 -0
  47. package/build/video/edit.js +7 -6
  48. package/build/video/edit.js.map +1 -1
  49. package/build/video/tracks-editor.js +95 -104
  50. package/build/video/tracks-editor.js.map +1 -1
  51. package/build/video/tracks.js +6 -2
  52. package/build/video/tracks.js.map +1 -1
  53. package/build-module/categories/edit.js +15 -3
  54. package/build-module/categories/edit.js.map +1 -1
  55. package/build-module/cover/edit/block-controls.js +4 -2
  56. package/build-module/cover/edit/block-controls.js.map +1 -1
  57. package/build-module/cover/edit/index.js +6 -3
  58. package/build-module/cover/edit/index.js.map +1 -1
  59. package/build-module/cover/edit/inspector-controls.js +12 -4
  60. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  61. package/build-module/cover/index.js +6 -0
  62. package/build-module/cover/index.js.map +1 -1
  63. package/build-module/cover/save.js +3 -1
  64. package/build-module/cover/save.js.map +1 -1
  65. package/build-module/file/edit.js +2 -1
  66. package/build-module/file/edit.js.map +1 -1
  67. package/build-module/latest-posts/edit.js +0 -2
  68. package/build-module/latest-posts/edit.js.map +1 -1
  69. package/build-module/media-text/edit.js +2 -2
  70. package/build-module/media-text/edit.js.map +1 -1
  71. package/build-module/navigation-link/edit.js +32 -15
  72. package/build-module/navigation-link/edit.js.map +1 -1
  73. package/build-module/navigation-link/update-attributes.js +113 -15
  74. package/build-module/navigation-link/update-attributes.js.map +1 -1
  75. package/build-module/navigation-submenu/edit.js +20 -3
  76. package/build-module/navigation-submenu/edit.js.map +1 -1
  77. package/build-module/paragraph/edit.js +2 -2
  78. package/build-module/paragraph/edit.js.map +1 -1
  79. package/build-module/post-content/edit.js +80 -18
  80. package/build-module/post-content/edit.js.map +1 -1
  81. package/build-module/post-content/index.js +6 -0
  82. package/build-module/post-content/index.js.map +1 -1
  83. package/build-module/post-date/deprecated.js +104 -1
  84. package/build-module/post-date/deprecated.js.map +1 -1
  85. package/build-module/post-date/edit.js +35 -35
  86. package/build-module/post-date/edit.js.map +1 -1
  87. package/build-module/post-date/index.js +4 -4
  88. package/build-module/post-date/index.js.map +1 -1
  89. package/build-module/post-date/variations.js +32 -3
  90. package/build-module/post-date/variations.js.map +1 -1
  91. package/build-module/separator/edit.js +6 -31
  92. package/build-module/separator/edit.js.map +1 -1
  93. package/build-module/site-tagline/index.js +1 -1
  94. package/build-module/social-link/variations.js +52 -50
  95. package/build-module/social-link/variations.js.map +1 -1
  96. package/build-module/utils/poster-image.js +85 -0
  97. package/build-module/utils/poster-image.js.map +1 -0
  98. package/build-module/video/edit.js +7 -6
  99. package/build-module/video/edit.js.map +1 -1
  100. package/build-module/video/tracks-editor.js +96 -105
  101. package/build-module/video/tracks-editor.js.map +1 -1
  102. package/build-module/video/tracks.js +6 -2
  103. package/build-module/video/tracks.js.map +1 -1
  104. package/build-style/archives/editor-rtl.css +0 -4
  105. package/build-style/archives/editor.css +0 -4
  106. package/build-style/editor-rtl.css +67 -18
  107. package/build-style/editor.css +67 -18
  108. package/build-style/file/style-rtl.css +1 -1
  109. package/build-style/file/style.css +1 -1
  110. package/build-style/navigation/editor-rtl.css +6 -6
  111. package/build-style/navigation/editor.css +6 -6
  112. package/build-style/navigation/style-rtl.css +1 -0
  113. package/build-style/navigation/style.css +1 -0
  114. package/build-style/page-list/editor-rtl.css +0 -4
  115. package/build-style/page-list/editor.css +0 -4
  116. package/build-style/style-rtl.css +3 -1
  117. package/build-style/style.css +3 -1
  118. package/build-style/video/editor-rtl.css +0 -4
  119. package/build-style/video/editor.css +0 -4
  120. package/build-style/video/style-rtl.css +1 -0
  121. package/build-style/video/style.css +1 -0
  122. package/package.json +35 -35
  123. package/src/archives/editor.scss +0 -4
  124. package/src/categories/edit.js +13 -1
  125. package/src/comments-pagination/index.php +7 -2
  126. package/src/cover/block.json +6 -0
  127. package/src/cover/edit/block-controls.js +22 -17
  128. package/src/cover/edit/index.js +4 -1
  129. package/src/cover/edit/inspector-controls.js +15 -2
  130. package/src/cover/save.js +2 -0
  131. package/src/editor.scss +1 -0
  132. package/src/file/edit.js +4 -1
  133. package/src/file/style.scss +1 -1
  134. package/src/latest-posts/edit.js +0 -2
  135. package/src/media-text/edit.js +1 -1
  136. package/src/navigation/style.scss +1 -0
  137. package/src/navigation-link/edit.js +28 -16
  138. package/src/navigation-link/test/edit.js +738 -6
  139. package/src/navigation-link/update-attributes.js +125 -12
  140. package/src/navigation-submenu/edit.js +21 -1
  141. package/src/page-list/editor.scss +0 -6
  142. package/src/paragraph/edit.js +2 -2
  143. package/src/post-content/block.json +6 -0
  144. package/src/post-content/edit.js +71 -19
  145. package/src/post-content/index.php +11 -4
  146. package/src/post-date/block.json +4 -4
  147. package/src/post-date/deprecated.js +104 -1
  148. package/src/post-date/edit.js +74 -86
  149. package/src/post-date/index.php +55 -28
  150. package/src/post-date/variations.js +37 -3
  151. package/src/post-featured-image/index.php +3 -2
  152. package/src/separator/edit.js +8 -43
  153. package/src/site-tagline/block.json +1 -1
  154. package/src/social-link/README.md +21 -0
  155. package/src/social-link/index.php +49 -49
  156. package/src/social-link/variations.js +51 -49
  157. package/src/utils/poster-image.js +131 -0
  158. package/src/utils/poster-image.scss +75 -0
  159. package/src/video/edit.js +8 -6
  160. package/src/video/editor.scss +0 -6
  161. package/src/video/index.php +91 -0
  162. package/src/video/style.native.scss +1 -0
  163. package/src/video/style.scss +1 -0
  164. package/src/video/tracks-editor.js +93 -103
  165. package/src/video/tracks.js +2 -1
  166. package/build/video/poster-image.js +0 -81
  167. package/build/video/poster-image.js.map +0 -1
  168. package/build-module/video/poster-image.js +0 -74
  169. package/build-module/video/poster-image.js.map +0 -1
  170. package/src/video/poster-image.js +0 -86
@@ -152,10 +152,6 @@
152
152
  margin-left: -9px;
153
153
  }
154
154
 
155
- .editor-video-poster-control .components-button {
156
- margin-right: 8px;
157
- }
158
-
159
155
  .block-library-video-tracks-editor {
160
156
  z-index: 159990;
161
157
  }
@@ -139,6 +139,7 @@
139
139
  }
140
140
  .wp-block-video video {
141
141
  width: 100%;
142
+ height: auto;
142
143
  vertical-align: middle;
143
144
  }
144
145
  @supports (position: sticky) {
@@ -139,6 +139,7 @@
139
139
  }
140
140
  .wp-block-video video {
141
141
  width: 100%;
142
+ height: auto;
142
143
  vertical-align: middle;
143
144
  }
144
145
  @supports (position: sticky) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.26.1-next.719a03cbe.0",
3
+ "version": "9.27.1-next.46f643fa0.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,39 +41,39 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@babel/runtime": "7.25.7",
44
- "@wordpress/a11y": "^4.26.1-next.719a03cbe.0",
45
- "@wordpress/api-fetch": "^7.26.1-next.719a03cbe.0",
46
- "@wordpress/autop": "^4.26.1-next.719a03cbe.0",
47
- "@wordpress/blob": "^4.26.1-next.719a03cbe.0",
48
- "@wordpress/block-editor": "^14.21.1-next.719a03cbe.0",
49
- "@wordpress/blocks": "^14.15.1-next.719a03cbe.0",
50
- "@wordpress/components": "^29.13.1-next.719a03cbe.0",
51
- "@wordpress/compose": "^7.26.1-next.719a03cbe.0",
52
- "@wordpress/core-data": "^7.26.1-next.719a03cbe.0",
53
- "@wordpress/data": "^10.26.1-next.719a03cbe.0",
54
- "@wordpress/date": "^5.26.1-next.719a03cbe.0",
55
- "@wordpress/deprecated": "^4.26.1-next.719a03cbe.0",
56
- "@wordpress/dom": "^4.26.1-next.719a03cbe.0",
57
- "@wordpress/element": "^6.26.1-next.719a03cbe.0",
58
- "@wordpress/escape-html": "^3.26.1-next.719a03cbe.0",
59
- "@wordpress/hooks": "^4.26.1-next.719a03cbe.0",
60
- "@wordpress/html-entities": "^4.26.1-next.719a03cbe.0",
61
- "@wordpress/i18n": "^6.0.1-next.719a03cbe.0",
62
- "@wordpress/icons": "^10.26.2-next.719a03cbe.0",
63
- "@wordpress/interactivity": "^6.26.1-next.719a03cbe.0",
64
- "@wordpress/interactivity-router": "^2.26.1-next.719a03cbe.0",
65
- "@wordpress/keyboard-shortcuts": "^5.26.1-next.719a03cbe.0",
66
- "@wordpress/keycodes": "^4.26.1-next.719a03cbe.0",
67
- "@wordpress/notices": "^5.26.1-next.719a03cbe.0",
68
- "@wordpress/patterns": "^2.26.1-next.719a03cbe.0",
69
- "@wordpress/primitives": "^4.26.1-next.719a03cbe.0",
70
- "@wordpress/private-apis": "^1.26.1-next.719a03cbe.0",
71
- "@wordpress/reusable-blocks": "^5.26.1-next.719a03cbe.0",
72
- "@wordpress/rich-text": "^7.26.1-next.719a03cbe.0",
73
- "@wordpress/server-side-render": "^6.2.1-next.719a03cbe.0",
74
- "@wordpress/url": "^4.26.1-next.719a03cbe.0",
75
- "@wordpress/viewport": "^6.26.1-next.719a03cbe.0",
76
- "@wordpress/wordcount": "^4.26.1-next.719a03cbe.0",
44
+ "@wordpress/a11y": "^4.27.1-next.46f643fa0.0",
45
+ "@wordpress/api-fetch": "^7.27.1-next.46f643fa0.0",
46
+ "@wordpress/autop": "^4.27.1-next.46f643fa0.0",
47
+ "@wordpress/blob": "^4.27.1-next.46f643fa0.0",
48
+ "@wordpress/block-editor": "^15.0.1-next.46f643fa0.0",
49
+ "@wordpress/blocks": "^15.0.1-next.46f643fa0.0",
50
+ "@wordpress/components": "^30.1.1-next.46f643fa0.0",
51
+ "@wordpress/compose": "^7.27.1-next.46f643fa0.0",
52
+ "@wordpress/core-data": "^7.27.1-next.46f643fa0.0",
53
+ "@wordpress/data": "^10.27.1-next.46f643fa0.0",
54
+ "@wordpress/date": "^5.27.1-next.46f643fa0.0",
55
+ "@wordpress/deprecated": "^4.27.1-next.46f643fa0.0",
56
+ "@wordpress/dom": "^4.27.1-next.46f643fa0.0",
57
+ "@wordpress/element": "^6.27.1-next.46f643fa0.0",
58
+ "@wordpress/escape-html": "^3.27.1-next.46f643fa0.0",
59
+ "@wordpress/hooks": "^4.27.1-next.46f643fa0.0",
60
+ "@wordpress/html-entities": "^4.27.1-next.46f643fa0.0",
61
+ "@wordpress/i18n": "^6.0.1-next.46f643fa0.0",
62
+ "@wordpress/icons": "^10.27.2-next.46f643fa0.0",
63
+ "@wordpress/interactivity": "^6.28.1-next.46f643fa0.0",
64
+ "@wordpress/interactivity-router": "^2.27.1-next.46f643fa0.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.27.1-next.46f643fa0.0",
66
+ "@wordpress/keycodes": "^4.27.1-next.46f643fa0.0",
67
+ "@wordpress/notices": "^5.27.1-next.46f643fa0.0",
68
+ "@wordpress/patterns": "^2.27.1-next.46f643fa0.0",
69
+ "@wordpress/primitives": "^4.27.1-next.46f643fa0.0",
70
+ "@wordpress/private-apis": "^1.27.1-next.46f643fa0.0",
71
+ "@wordpress/reusable-blocks": "^5.27.1-next.46f643fa0.0",
72
+ "@wordpress/rich-text": "^7.27.1-next.46f643fa0.0",
73
+ "@wordpress/server-side-render": "^6.4.1-next.46f643fa0.0",
74
+ "@wordpress/url": "^4.27.1-next.46f643fa0.0",
75
+ "@wordpress/viewport": "^6.27.1-next.46f643fa0.0",
76
+ "@wordpress/wordcount": "^4.27.1-next.46f643fa0.0",
77
77
  "change-case": "^4.1.2",
78
78
  "clsx": "^2.1.1",
79
79
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "5e146e949c2765411a8310bcc2641a88d036a6d9"
94
+ "gitHead": "17e600e091675c5e3d809adfea23ac456bbeae19"
95
95
  }
@@ -1,7 +1,3 @@
1
- ul.wp-block-archives {
2
- padding-left: 2.5em;
3
- }
4
-
5
1
  // The following styles are to prevent duplicate spacing and borders for the archives
6
2
  // block in the editor given it uses server side rendering.
7
3
  // See https://github.com/WordPress/gutenberg/pull/63400
@@ -25,6 +25,8 @@ import { decodeEntities } from '@wordpress/html-entities';
25
25
  import { __, sprintf } from '@wordpress/i18n';
26
26
  import { pin } from '@wordpress/icons';
27
27
  import { useEntityRecords } from '@wordpress/core-data';
28
+ import { useDispatch } from '@wordpress/data';
29
+ import { store as noticeStore } from '@wordpress/notices';
28
30
 
29
31
  /**
30
32
  * Internal dependencies
@@ -44,6 +46,7 @@ export default function CategoriesEdit( {
44
46
  },
45
47
  setAttributes,
46
48
  className,
49
+ clientId,
47
50
  } ) {
48
51
  const selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' );
49
52
 
@@ -70,6 +73,15 @@ export default function CategoriesEdit( {
70
73
  query
71
74
  );
72
75
 
76
+ const { createWarningNotice } = useDispatch( noticeStore );
77
+ const showRedirectionPreventedNotice = ( event ) => {
78
+ event.preventDefault();
79
+ createWarningNotice( __( 'Links are disabled in the editor.' ), {
80
+ id: `block-library/core/categories/redirection-prevented/${ clientId }`,
81
+ type: 'snackbar',
82
+ } );
83
+ };
84
+
73
85
  const getCategoriesList = ( parentId ) => {
74
86
  if ( ! categories?.length ) {
75
87
  return [];
@@ -99,7 +111,7 @@ export default function CategoriesEdit( {
99
111
  const { id, link, count, name } = category;
100
112
  return (
101
113
  <li key={ id } className={ `cat-item cat-item-${ id }` }>
102
- <a href={ link } target="_blank" rel="noreferrer noopener">
114
+ <a href={ link } onClick={ showRedirectionPreventedNotice }>
103
115
  { renderCategoryName( name ) }
104
116
  </a>
105
117
  { showPostCounts && ` (${ count })` }
@@ -25,10 +25,15 @@ function render_block_core_comments_pagination( $attributes, $content ) {
25
25
  }
26
26
 
27
27
  $classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : '';
28
- $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
28
+ $wrapper_attributes = get_block_wrapper_attributes(
29
+ array(
30
+ 'aria-label' => __( 'Comments pagination' ),
31
+ 'class' => $classes,
32
+ )
33
+ );
29
34
 
30
35
  return sprintf(
31
- '<div %1$s>%2$s</div>',
36
+ '<nav %1$s>%2$s</nav>',
32
37
  $wrapper_attributes,
33
38
  $content
34
39
  );
@@ -81,6 +81,12 @@
81
81
  },
82
82
  "sizeSlug": {
83
83
  "type": "string"
84
+ },
85
+ "poster": {
86
+ "type": "string",
87
+ "source": "attribute",
88
+ "selector": "video",
89
+ "attribute": "poster"
84
90
  }
85
91
  },
86
92
  "usesContext": [ "postId", "postType" ],
@@ -27,6 +27,7 @@ export default function CoverBlockControls( {
27
27
  currentSettings,
28
28
  toggleUseFeaturedImage,
29
29
  onClearMedia,
30
+ blockEditingMode,
30
31
  } ) {
31
32
  const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } =
32
33
  attributes;
@@ -39,6 +40,8 @@ export default function CoverBlockControls( {
39
40
  minHeightUnit === 'vh' &&
40
41
  minHeight === 100 &&
41
42
  ! attributes?.style?.dimensions?.aspectRatio;
43
+ const isContentOnlyMode = blockEditingMode === 'contentOnly';
44
+
42
45
  const toggleMinFullHeight = () => {
43
46
  if ( isMinFullHeight ) {
44
47
  // If there aren't previous values, take the default ones.
@@ -75,23 +78,25 @@ export default function CoverBlockControls( {
75
78
 
76
79
  return (
77
80
  <>
78
- <BlockControls group="block">
79
- <BlockAlignmentMatrixControl
80
- label={ __( 'Change content position' ) }
81
- value={ contentPosition }
82
- onChange={ ( nextPosition ) =>
83
- setAttributes( {
84
- contentPosition: nextPosition,
85
- } )
86
- }
87
- isDisabled={ ! hasInnerBlocks }
88
- />
89
- <FullHeightAlignmentControl
90
- isActive={ isMinFullHeight }
91
- onToggle={ toggleMinFullHeight }
92
- isDisabled={ ! hasInnerBlocks }
93
- />
94
- </BlockControls>
81
+ { ! isContentOnlyMode && (
82
+ <BlockControls group="block">
83
+ <BlockAlignmentMatrixControl
84
+ label={ __( 'Change content position' ) }
85
+ value={ contentPosition }
86
+ onChange={ ( nextPosition ) =>
87
+ setAttributes( {
88
+ contentPosition: nextPosition,
89
+ } )
90
+ }
91
+ isDisabled={ ! hasInnerBlocks }
92
+ />
93
+ <FullHeightAlignmentControl
94
+ isActive={ isMinFullHeight }
95
+ onToggle={ toggleMinFullHeight }
96
+ isDisabled={ ! hasInnerBlocks }
97
+ />
98
+ </BlockControls>
99
+ ) }
95
100
  <BlockControls group="other">
96
101
  <MediaReplaceFlow
97
102
  mediaId={ id }
@@ -102,6 +102,7 @@ function CoverEdit( {
102
102
  tagName: TagName = 'div',
103
103
  isUserOverlayColor,
104
104
  sizeSlug,
105
+ poster,
105
106
  } = attributes;
106
107
 
107
108
  const [ featuredImage ] = useEntityProp(
@@ -324,7 +325,7 @@ function CoverEdit( {
324
325
  const [ resizeListener, { height, width } ] = useResizeObserver();
325
326
  const resizableBoxDimensions = useMemo( () => {
326
327
  return {
327
- height: minHeightUnit === 'px' ? minHeight : 'auto',
328
+ height: minHeightUnit === 'px' && minHeight ? minHeight : 'auto',
328
329
  width: 'auto',
329
330
  };
330
331
  }, [ minHeight, minHeightUnit ] );
@@ -446,6 +447,7 @@ function CoverEdit( {
446
447
  currentSettings={ currentSettings }
447
448
  toggleUseFeaturedImage={ toggleUseFeaturedImage }
448
449
  onClearMedia={ onClearMedia }
450
+ blockEditingMode={ blockEditingMode }
449
451
  />
450
452
  );
451
453
 
@@ -589,6 +591,7 @@ function CoverEdit( {
589
591
  muted
590
592
  loop
591
593
  src={ url }
594
+ poster={ poster }
592
595
  style={ mediaStyle }
593
596
  />
594
597
  ) }
@@ -35,6 +35,7 @@ import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
35
35
  import { unlock } from '../../lock-unlock';
36
36
  import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
37
37
  import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
38
+ import PosterImage from '../../utils/poster-image';
38
39
 
39
40
  const { cleanEmptyObject, ResolutionTool, HTMLElementControl } = unlock(
40
41
  blockEditorPrivateApis
@@ -110,6 +111,7 @@ export default function CoverInspectorControls( {
110
111
  minHeightUnit,
111
112
  alt,
112
113
  tagName,
114
+ poster,
113
115
  } = attributes;
114
116
  const {
115
117
  isVideoBackground,
@@ -198,6 +200,7 @@ export default function CoverInspectorControls( {
198
200
  focalPoint: undefined,
199
201
  isRepeated: false,
200
202
  alt: '',
203
+ poster: undefined,
201
204
  } );
202
205
  updateImage( DEFAULT_MEDIA_SIZE_SLUG );
203
206
  } }
@@ -208,7 +211,7 @@ export default function CoverInspectorControls( {
208
211
  <ToolsPanelItem
209
212
  label={ __( 'Fixed background' ) }
210
213
  isShownByDefault
211
- hasValue={ () => hasParallax }
214
+ hasValue={ () => !! hasParallax }
212
215
  onDeselect={ () =>
213
216
  setAttributes( {
214
217
  hasParallax: false,
@@ -219,7 +222,7 @@ export default function CoverInspectorControls( {
219
222
  <ToggleControl
220
223
  __nextHasNoMarginBottom
221
224
  label={ __( 'Fixed background' ) }
222
- checked={ hasParallax }
225
+ checked={ !! hasParallax }
223
226
  onChange={ toggleParallax }
224
227
  />
225
228
  </ToolsPanelItem>
@@ -269,6 +272,16 @@ export default function CoverInspectorControls( {
269
272
  />
270
273
  </ToolsPanelItem>
271
274
  ) }
275
+ { isVideoBackground && (
276
+ <PosterImage
277
+ poster={ poster }
278
+ onChange={ ( posterImage ) =>
279
+ setAttributes( {
280
+ poster: posterImage?.url,
281
+ } )
282
+ }
283
+ />
284
+ ) }
272
285
  { ! useFeaturedImage && url && ! isVideoBackground && (
273
286
  <ToolsPanelItem
274
287
  label={ __( 'Alternative text' ) }
package/src/cover/save.js CHANGED
@@ -46,6 +46,7 @@ export default function save( { attributes } ) {
46
46
  minHeightUnit,
47
47
  tagName: Tag,
48
48
  sizeSlug,
49
+ poster,
49
50
  } = attributes;
50
51
  const overlayColorClass = getColorClassName(
51
52
  'background-color',
@@ -137,6 +138,7 @@ export default function save( { attributes } ) {
137
138
  loop
138
139
  playsInline
139
140
  src={ url }
141
+ poster={ poster }
140
142
  style={ { objectPosition } }
141
143
  data-object-fit="cover"
142
144
  data-object-position={ objectPosition }
package/src/editor.scss CHANGED
@@ -54,6 +54,7 @@
54
54
  @import "./post-featured-image/editor.scss";
55
55
  @import "./post-comments-form/editor.scss";
56
56
  @import "./editor-elements.scss";
57
+ @import "./utils/poster-image.scss";
57
58
 
58
59
  :root .editor-styles-wrapper {
59
60
  @include background-colors-deprecated();
package/src/file/edit.js CHANGED
@@ -29,6 +29,7 @@ import { __, _x } from '@wordpress/i18n';
29
29
  import { file as icon } from '@wordpress/icons';
30
30
  import { store as coreStore } from '@wordpress/core-data';
31
31
  import { store as noticesStore } from '@wordpress/notices';
32
+ import { getFilename } from '@wordpress/url';
32
33
 
33
34
  /**
34
35
  * Internal dependencies
@@ -127,7 +128,9 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
127
128
  return;
128
129
  }
129
130
 
130
- const isPdf = newMedia.url.endsWith( '.pdf' );
131
+ const isPdf = getFilename( newMedia.url )
132
+ .toLowerCase()
133
+ .endsWith( '.pdf' );
131
134
  const pdfAttributes = {
132
135
  displayPreview: isPdf
133
136
  ? attributes.displayPreview ?? true
@@ -35,7 +35,7 @@
35
35
  padding: 0.5em 1em;
36
36
  display: inline-block;
37
37
 
38
- &:is(a) {
38
+ &:where(a) {
39
39
  &:hover,
40
40
  &:visited,
41
41
  &:focus,
@@ -774,7 +774,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
774
774
  { addLinkToFeaturedImage ? (
775
775
  <a
776
776
  href={ post.link }
777
- rel="noreferrer noopener"
778
777
  onClick={
779
778
  showRedirectionPreventedNotice
780
779
  }
@@ -789,7 +788,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
789
788
  <a
790
789
  className="wp-block-latest-posts__post-title"
791
790
  href={ post.link }
792
- rel="noreferrer noopener"
793
791
  dangerouslySetInnerHTML={
794
792
  !! titleTrimmed
795
793
  ? {
@@ -317,8 +317,8 @@ function MediaTextEdit( {
317
317
  mediaAlt: '',
318
318
  focalPoint: undefined,
319
319
  mediaWidth: 50,
320
- mediaSizeSlug: undefined,
321
320
  } );
321
+ updateImage( DEFAULT_MEDIA_SIZE_SLUG );
322
322
  } }
323
323
  dropdownMenuProps={ dropdownMenuProps }
324
324
  >
@@ -182,6 +182,7 @@ $navigation-icon-size: 24px;
182
182
  > .wp-block-navigation-item__content {
183
183
  display: flex;
184
184
  flex-grow: 1;
185
+ padding: 0.5em 1em;
185
186
 
186
187
  // Right-align the chevron in submenus.
187
188
  .wp-block-navigation__submenu-icon {
@@ -175,8 +175,9 @@ function getMissingText( type ) {
175
175
  * packages/block-library/src/navigation-submenu/edit.js
176
176
  * Consider reusing this components for both blocks.
177
177
  */
178
- function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
178
+ function Controls( { attributes, setAttributes, setIsEditingControl } ) {
179
179
  const { label, url, description, rel, opensInNewTab } = attributes;
180
+ const lastURLRef = useRef( url );
180
181
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
181
182
  return (
182
183
  <ToolsPanel
@@ -187,6 +188,7 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
187
188
  url: '',
188
189
  description: '',
189
190
  rel: '',
191
+ opensInNewTab: false,
190
192
  } );
191
193
  } }
192
194
  dropdownMenuProps={ dropdownMenuProps }
@@ -206,8 +208,8 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
206
208
  setAttributes( { label: labelValue } );
207
209
  } }
208
210
  autoComplete="off"
209
- onFocus={ () => setIsLabelFieldFocused( true ) }
210
- onBlur={ () => setIsLabelFieldFocused( false ) }
211
+ onFocus={ () => setIsEditingControl( true ) }
212
+ onBlur={ () => setIsEditingControl( false ) }
211
213
  />
212
214
  </ToolsPanelItem>
213
215
 
@@ -223,14 +225,25 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
223
225
  label={ __( 'Link' ) }
224
226
  value={ url ? safeDecodeURI( url ) : '' }
225
227
  onChange={ ( urlValue ) => {
228
+ setAttributes( {
229
+ url: encodeURI( safeDecodeURI( urlValue ) ),
230
+ } );
231
+ } }
232
+ autoComplete="off"
233
+ type="url"
234
+ onFocus={ () => {
235
+ lastURLRef.current = url;
236
+ setIsEditingControl( true );
237
+ } }
238
+ onBlur={ () => {
239
+ // Defer the updateAttributes call to ensure entity connection isn't severed by accident.
226
240
  updateAttributes(
227
- { url: urlValue },
241
+ { url: ! url ? lastURLRef.current : url },
228
242
  setAttributes,
229
- attributes
243
+ { ...attributes, url: lastURLRef.current }
230
244
  );
245
+ setIsEditingControl( false );
231
246
  } }
232
- autoComplete="off"
233
- type="url"
234
247
  />
235
248
  </ToolsPanelItem>
236
249
 
@@ -326,9 +339,10 @@ export default function NavigationLinkEdit( {
326
339
  const linkUIref = useRef();
327
340
  const prevUrl = usePrevious( url );
328
341
 
329
- // Change the label using inspector causes rich text to change focus on firefox.
330
- // This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.
331
- const [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );
342
+ // Change the `label` and `url` using inspector causes RichText to change focus.
343
+ // This is a workaround to keep the focus on the field when it's focused we don't render the RichText.
344
+ // See: https://github.com/WordPress/gutenberg/pull/61374.
345
+ const [ isEditingControl, setIsEditingControl ] = useState( false );
332
346
 
333
347
  const {
334
348
  isAtMaxNesting,
@@ -563,14 +577,14 @@ export default function NavigationLinkEdit( {
563
577
  <Controls
564
578
  attributes={ attributes }
565
579
  setAttributes={ setAttributes }
566
- setIsLabelFieldFocused={ setIsLabelFieldFocused }
580
+ setIsEditingControl={ setIsEditingControl }
567
581
  />
568
582
  </InspectorControls>
569
583
  <div { ...blockProps }>
570
584
  { /* eslint-disable jsx-a11y/anchor-is-valid */ }
571
585
  <a className={ classes }>
572
586
  { /* eslint-enable */ }
573
- { ! url ? (
587
+ { ! url && ! isEditingControl ? (
574
588
  <div className="wp-block-navigation-link__placeholder-text">
575
589
  <span>{ missingText }</span>
576
590
  </div>
@@ -578,7 +592,7 @@ export default function NavigationLinkEdit( {
578
592
  <>
579
593
  { ! isInvalid &&
580
594
  ! isDraft &&
581
- ! isLabelFieldFocused && (
595
+ ! isEditingControl && (
582
596
  <>
583
597
  <RichText
584
598
  ref={ ref }
@@ -612,9 +626,7 @@ export default function NavigationLinkEdit( {
612
626
  ) }
613
627
  </>
614
628
  ) }
615
- { ( isInvalid ||
616
- isDraft ||
617
- isLabelFieldFocused ) && (
629
+ { ( isInvalid || isDraft || isEditingControl ) && (
618
630
  <div
619
631
  className={ clsx(
620
632
  'wp-block-navigation-link__placeholder-text',