@wordpress/block-library 9.44.0 → 9.44.1-next.v.202604201441.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 (119) hide show
  1. package/build/button/constants.cjs +1 -1
  2. package/build/button/constants.cjs.map +1 -1
  3. package/build/group/block.json +2 -1
  4. package/build/image/constants.cjs +1 -1
  5. package/build/image/constants.cjs.map +2 -2
  6. package/build/image/edit.cjs +1 -3
  7. package/build/image/edit.cjs.map +2 -2
  8. package/build/image/image.cjs +20 -9
  9. package/build/image/image.cjs.map +2 -2
  10. package/build/latest-posts/edit.cjs +1 -1
  11. package/build/latest-posts/edit.cjs.map +1 -1
  12. package/build/paragraph/use-enter.cjs +12 -23
  13. package/build/paragraph/use-enter.cjs.map +2 -2
  14. package/build/post-featured-image/edit.cjs +2 -5
  15. package/build/post-featured-image/edit.cjs.map +2 -2
  16. package/build/post-template/edit.cjs +8 -2
  17. package/build/post-template/edit.cjs.map +2 -2
  18. package/build/pullquote/block.json +1 -4
  19. package/build/site-logo/edit.cjs +2 -2
  20. package/build/site-logo/edit.cjs.map +1 -1
  21. package/build/tab/block.json +2 -2
  22. package/build/tab/edit.cjs +3 -21
  23. package/build/tab/edit.cjs.map +3 -3
  24. package/build/tab-panel/block.json +1 -1
  25. package/build/tab-panel/edit.cjs +1 -4
  26. package/build/tab-panel/edit.cjs.map +2 -2
  27. package/build/tabs/block.json +0 -1
  28. package/build/tabs/edit.cjs +10 -86
  29. package/build/tabs/edit.cjs.map +3 -3
  30. package/build/tabs/use-tab-menu-sync.cjs +192 -0
  31. package/build/tabs/use-tab-menu-sync.cjs.map +7 -0
  32. package/build/tabs-menu/block.json +1 -1
  33. package/build/tabs-menu/edit.cjs +5 -10
  34. package/build/tabs-menu/edit.cjs.map +3 -3
  35. package/build/tabs-menu-item/block.json +1 -4
  36. package/build/tabs-menu-item/edit.cjs +3 -12
  37. package/build/tabs-menu-item/edit.cjs.map +2 -2
  38. package/build-module/button/constants.mjs +1 -1
  39. package/build-module/button/constants.mjs.map +1 -1
  40. package/build-module/group/block.json +2 -1
  41. package/build-module/image/constants.mjs +1 -1
  42. package/build-module/image/constants.mjs.map +2 -2
  43. package/build-module/image/edit.mjs +1 -3
  44. package/build-module/image/edit.mjs.map +2 -2
  45. package/build-module/image/image.mjs +20 -9
  46. package/build-module/image/image.mjs.map +2 -2
  47. package/build-module/latest-posts/edit.mjs +1 -1
  48. package/build-module/latest-posts/edit.mjs.map +1 -1
  49. package/build-module/paragraph/use-enter.mjs +13 -23
  50. package/build-module/paragraph/use-enter.mjs.map +2 -2
  51. package/build-module/post-featured-image/edit.mjs +2 -5
  52. package/build-module/post-featured-image/edit.mjs.map +2 -2
  53. package/build-module/post-template/edit.mjs +8 -2
  54. package/build-module/post-template/edit.mjs.map +2 -2
  55. package/build-module/pullquote/block.json +1 -4
  56. package/build-module/site-logo/edit.mjs +2 -2
  57. package/build-module/site-logo/edit.mjs.map +1 -1
  58. package/build-module/tab/block.json +2 -2
  59. package/build-module/tab/edit.mjs +3 -21
  60. package/build-module/tab/edit.mjs.map +2 -2
  61. package/build-module/tab-panel/block.json +1 -1
  62. package/build-module/tab-panel/edit.mjs +1 -4
  63. package/build-module/tab-panel/edit.mjs.map +2 -2
  64. package/build-module/tabs/block.json +0 -1
  65. package/build-module/tabs/edit.mjs +12 -88
  66. package/build-module/tabs/edit.mjs.map +2 -2
  67. package/build-module/tabs/use-tab-menu-sync.mjs +171 -0
  68. package/build-module/tabs/use-tab-menu-sync.mjs.map +7 -0
  69. package/build-module/tabs-menu/block.json +1 -1
  70. package/build-module/tabs-menu/edit.mjs +5 -10
  71. package/build-module/tabs-menu/edit.mjs.map +2 -2
  72. package/build-module/tabs-menu-item/block.json +1 -4
  73. package/build-module/tabs-menu-item/edit.mjs +3 -12
  74. package/build-module/tabs-menu-item/edit.mjs.map +2 -2
  75. package/build-style/latest-comments/style-rtl.css +4 -4
  76. package/build-style/latest-comments/style.css +4 -4
  77. package/build-style/post-template/style-rtl.css +1 -1
  78. package/build-style/post-template/style.css +1 -1
  79. package/build-style/style-rtl.css +5 -8
  80. package/build-style/style.css +5 -8
  81. package/build-style/tabs/style-rtl.css +0 -3
  82. package/build-style/tabs/style.css +0 -3
  83. package/package.json +38 -38
  84. package/src/block/test/edit.native.js +1 -1
  85. package/src/button/constants.js +1 -1
  86. package/src/button/test/get-updated-link-attributes.js +6 -10
  87. package/src/group/block.json +2 -1
  88. package/src/image/constants.js +1 -1
  89. package/src/image/edit.js +0 -2
  90. package/src/image/image.js +33 -22
  91. package/src/image/test/edit.native.js +2 -2
  92. package/src/latest-comments/style.scss +7 -7
  93. package/src/latest-posts/edit.js +1 -1
  94. package/src/latest-posts/index.php +1 -1
  95. package/src/navigation/edit/test/overlay-template-part-selector.js +1 -0
  96. package/src/paragraph/use-enter.js +18 -24
  97. package/src/post-featured-image/edit.js +2 -9
  98. package/src/post-template/edit.js +7 -1
  99. package/src/post-template/index.php +3 -0
  100. package/src/post-template/style.scss +2 -2
  101. package/src/pullquote/block.json +1 -4
  102. package/src/site-logo/edit.js +2 -2
  103. package/src/tab/block.json +2 -2
  104. package/src/tab/edit.js +2 -27
  105. package/src/tab-panel/block.json +1 -1
  106. package/src/tab-panel/edit.js +2 -4
  107. package/src/tabs/block.json +0 -1
  108. package/src/tabs/edit.js +11 -134
  109. package/src/tabs/style.scss +0 -3
  110. package/src/tabs/use-tab-menu-sync.js +239 -0
  111. package/src/tabs-menu/block.json +1 -1
  112. package/src/tabs-menu/edit.js +6 -15
  113. package/src/tabs-menu-item/block.json +1 -4
  114. package/src/tabs-menu-item/edit.js +3 -12
  115. package/build/tab/slug-from-label.cjs +0 -37
  116. package/build/tab/slug-from-label.cjs.map +0 -7
  117. package/build-module/tab/slug-from-label.mjs +0 -16
  118. package/build-module/tab/slug-from-label.mjs.map +0 -7
  119. package/src/tab/slug-from-label.js +0 -26
@@ -2153,6 +2153,10 @@ h6.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]) {
2153
2153
  transform: translate(calc(-1*((-100vw + var(--wp--lightbox-scrollbar-width)) / 2 + var(--wp--lightbox-initial-left-position))), calc(-50vh + var(--wp--lightbox-initial-top-position))) scale(var(--wp--lightbox-scale));
2154
2154
  }
2155
2155
  }
2156
+ :where(.wp-block-latest-comments) {
2157
+ padding-right: 0;
2158
+ }
2159
+
2156
2160
  ol.wp-block-latest-comments {
2157
2161
  margin-right: 0;
2158
2162
  box-sizing: border-box;
@@ -2171,10 +2175,6 @@ ol.wp-block-latest-comments {
2171
2175
  line-height: 1.5;
2172
2176
  }
2173
2177
 
2174
- .wp-block-latest-comments .wp-block-latest-comments {
2175
- padding-right: 0;
2176
- }
2177
-
2178
2178
  .wp-block-latest-comments__comment {
2179
2179
  list-style: none;
2180
2180
  margin-bottom: 1em;
@@ -3967,7 +3967,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3967
3967
  }
3968
3968
 
3969
3969
  @media (max-width: 600px) {
3970
- .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
3970
+ .wp-block-post-template-is-layout-grid[class*=columns-]:not(.has-native-responsive-grid) {
3971
3971
  grid-template-columns: 1fr;
3972
3972
  }
3973
3973
  }
@@ -4915,9 +4915,6 @@ ul.wp-block-rss.is-grid li {
4915
4915
  .wp-block-tabs {
4916
4916
  box-sizing: border-box;
4917
4917
  }
4918
- .wp-block-tabs .wp-block-tabs__title {
4919
- display: none;
4920
- }
4921
4918
 
4922
4919
  .wp-block-tabs-menu-item {
4923
4920
  box-sizing: border-box;
@@ -2167,6 +2167,10 @@ h6.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]) {
2167
2167
  transform: translate(calc((-100vw + var(--wp--lightbox-scrollbar-width)) / 2 + var(--wp--lightbox-initial-left-position)), calc(-50vh + var(--wp--lightbox-initial-top-position))) scale(var(--wp--lightbox-scale));
2168
2168
  }
2169
2169
  }
2170
+ :where(.wp-block-latest-comments) {
2171
+ padding-left: 0;
2172
+ }
2173
+
2170
2174
  ol.wp-block-latest-comments {
2171
2175
  margin-left: 0;
2172
2176
  box-sizing: border-box;
@@ -2185,10 +2189,6 @@ ol.wp-block-latest-comments {
2185
2189
  line-height: 1.5;
2186
2190
  }
2187
2191
 
2188
- .wp-block-latest-comments .wp-block-latest-comments {
2189
- padding-left: 0;
2190
- }
2191
-
2192
2192
  .wp-block-latest-comments__comment {
2193
2193
  list-style: none;
2194
2194
  margin-bottom: 1em;
@@ -3997,7 +3997,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3997
3997
  }
3998
3998
 
3999
3999
  @media (max-width: 600px) {
4000
- .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
4000
+ .wp-block-post-template-is-layout-grid[class*=columns-]:not(.has-native-responsive-grid) {
4001
4001
  grid-template-columns: 1fr;
4002
4002
  }
4003
4003
  }
@@ -4948,9 +4948,6 @@ ul.wp-block-rss.is-grid li {
4948
4948
  .wp-block-tabs {
4949
4949
  box-sizing: border-box;
4950
4950
  }
4951
- .wp-block-tabs .wp-block-tabs__title {
4952
- display: none;
4953
- }
4954
4951
 
4955
4952
  .wp-block-tabs-menu-item {
4956
4953
  box-sizing: border-box;
@@ -1,6 +1,3 @@
1
1
  .wp-block-tabs {
2
2
  box-sizing: border-box;
3
- }
4
- .wp-block-tabs .wp-block-tabs__title {
5
- display: none;
6
3
  }
@@ -1,6 +1,3 @@
1
1
  .wp-block-tabs {
2
2
  box-sizing: border-box;
3
- }
4
- .wp-block-tabs .wp-block-tabs__title {
5
- display: none;
6
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.44.0",
3
+ "version": "9.44.1-next.v.202604201441.0+dab6d8c07",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -95,42 +95,42 @@
95
95
  ],
96
96
  "dependencies": {
97
97
  "@arraypress/waveform-player": "1.2.1",
98
- "@wordpress/a11y": "^4.44.0",
99
- "@wordpress/api-fetch": "^7.44.0",
100
- "@wordpress/autop": "^4.44.0",
101
- "@wordpress/base-styles": "^6.20.0",
102
- "@wordpress/blob": "^4.44.0",
103
- "@wordpress/block-editor": "^15.17.0",
104
- "@wordpress/blocks": "^15.17.0",
105
- "@wordpress/components": "^32.6.0",
106
- "@wordpress/compose": "^7.44.0",
107
- "@wordpress/core-data": "^7.44.0",
108
- "@wordpress/data": "^10.44.0",
109
- "@wordpress/date": "^5.44.0",
110
- "@wordpress/deprecated": "^4.44.0",
111
- "@wordpress/dom": "^4.44.0",
112
- "@wordpress/element": "^6.44.0",
113
- "@wordpress/escape-html": "^3.44.0",
114
- "@wordpress/hooks": "^4.44.0",
115
- "@wordpress/html-entities": "^4.44.0",
116
- "@wordpress/i18n": "^6.17.0",
117
- "@wordpress/icons": "^12.2.0",
118
- "@wordpress/interactivity": "^6.44.0",
119
- "@wordpress/interactivity-router": "^2.44.0",
120
- "@wordpress/keyboard-shortcuts": "^5.44.0",
121
- "@wordpress/keycodes": "^4.44.0",
122
- "@wordpress/latex-to-mathml": "^1.12.0",
123
- "@wordpress/notices": "^5.44.0",
124
- "@wordpress/patterns": "^2.44.0",
125
- "@wordpress/primitives": "^4.44.0",
126
- "@wordpress/private-apis": "^1.44.0",
127
- "@wordpress/reusable-blocks": "^5.44.0",
128
- "@wordpress/rich-text": "^7.44.0",
129
- "@wordpress/server-side-render": "^6.20.0",
130
- "@wordpress/upload-media": "^0.29.0",
131
- "@wordpress/url": "^4.44.0",
132
- "@wordpress/viewport": "^6.44.0",
133
- "@wordpress/wordcount": "^4.44.0",
98
+ "@wordpress/a11y": "^4.44.1-next.v.202604201441.0+dab6d8c07",
99
+ "@wordpress/api-fetch": "^7.44.1-next.v.202604201441.0+dab6d8c07",
100
+ "@wordpress/autop": "^4.44.1-next.v.202604201441.0+dab6d8c07",
101
+ "@wordpress/base-styles": "^6.20.1-next.v.202604201441.0+dab6d8c07",
102
+ "@wordpress/blob": "^4.44.1-next.v.202604201441.0+dab6d8c07",
103
+ "@wordpress/block-editor": "^15.18.1-next.v.202604201441.0+dab6d8c07",
104
+ "@wordpress/blocks": "^15.17.2-next.v.202604201441.0+dab6d8c07",
105
+ "@wordpress/components": "^33.0.1-next.v.202604201441.0+dab6d8c07",
106
+ "@wordpress/compose": "^7.44.1-next.v.202604201441.0+dab6d8c07",
107
+ "@wordpress/core-data": "^7.44.1-next.v.202604201441.0+dab6d8c07",
108
+ "@wordpress/data": "^10.45.1-next.v.202604201441.0+dab6d8c07",
109
+ "@wordpress/date": "^5.44.1-next.v.202604201441.0+dab6d8c07",
110
+ "@wordpress/deprecated": "^4.44.1-next.v.202604201441.0+dab6d8c07",
111
+ "@wordpress/dom": "^4.44.1-next.v.202604201441.0+dab6d8c07",
112
+ "@wordpress/element": "^6.44.1-next.v.202604201441.0+dab6d8c07",
113
+ "@wordpress/escape-html": "^3.44.1-next.v.202604201441.0+dab6d8c07",
114
+ "@wordpress/hooks": "^4.44.1-next.v.202604201441.0+dab6d8c07",
115
+ "@wordpress/html-entities": "^4.44.1-next.v.202604201441.0+dab6d8c07",
116
+ "@wordpress/i18n": "^6.17.1-next.v.202604201441.0+dab6d8c07",
117
+ "@wordpress/icons": "^12.2.1-next.v.202604201441.0+dab6d8c07",
118
+ "@wordpress/interactivity": "^6.44.1-next.v.202604201441.0+dab6d8c07",
119
+ "@wordpress/interactivity-router": "^2.44.1-next.v.202604201441.0+dab6d8c07",
120
+ "@wordpress/keyboard-shortcuts": "^5.44.1-next.v.202604201441.0+dab6d8c07",
121
+ "@wordpress/keycodes": "^4.44.1-next.v.202604201441.0+dab6d8c07",
122
+ "@wordpress/latex-to-mathml": "^1.12.1-next.v.202604201441.0+dab6d8c07",
123
+ "@wordpress/notices": "^5.44.1-next.v.202604201441.0+dab6d8c07",
124
+ "@wordpress/patterns": "^2.44.1-next.v.202604201441.0+dab6d8c07",
125
+ "@wordpress/primitives": "^4.44.1-next.v.202604201441.0+dab6d8c07",
126
+ "@wordpress/private-apis": "^1.44.1-next.v.202604201441.0+dab6d8c07",
127
+ "@wordpress/reusable-blocks": "^5.44.1-next.v.202604201441.0+dab6d8c07",
128
+ "@wordpress/rich-text": "^7.44.1-next.v.202604201441.0+dab6d8c07",
129
+ "@wordpress/server-side-render": "^6.20.1-next.v.202604201441.0+dab6d8c07",
130
+ "@wordpress/upload-media": "^0.29.1-next.v.202604201441.0+dab6d8c07",
131
+ "@wordpress/url": "^4.44.1-next.v.202604201441.0+dab6d8c07",
132
+ "@wordpress/viewport": "^6.44.1-next.v.202604201441.0+dab6d8c07",
133
+ "@wordpress/wordcount": "^4.44.1-next.v.202604201441.0+dab6d8c07",
134
134
  "change-case": "^4.1.2",
135
135
  "clsx": "^2.1.1",
136
136
  "colord": "^2.7.0",
@@ -151,5 +151,5 @@
151
151
  "publishConfig": {
152
152
  "access": "public"
153
153
  },
154
- "gitHead": "b862d8c84121a47bbeff882f6c87e61681ce2e0d"
154
+ "gitHead": "c788005ba4ee2a34851c1217c51602656aa7c3a6"
155
155
  }
@@ -29,7 +29,7 @@ const getMockedReusableBlock = ( id ) => ( {
29
29
  <!-- /wp:heading -->
30
30
 
31
31
  <!-- wp:paragraph -->
32
- <p><strong>Bold</strong> <em>Italic</em> <s>Striked</s> Superscript<sup>(1)</sup> Subscript<sub>(2)</sub> <a href="http://www.wordpress.org" target="_blank" rel="noreferrer noopener">Link</a></p>
32
+ <p><strong>Bold</strong> <em>Italic</em> <s>Striked</s> Superscript<sup>(1)</sup> Subscript<sub>(2)</sub> <a href="http://www.wordpress.org" target="_blank" rel="noopener">Link</a></p>
33
33
  <!-- /wp:paragraph -->
34
34
 
35
35
  !-- wp:heading {"level":4} -->
@@ -1,3 +1,3 @@
1
- export const NEW_TAB_REL = 'noreferrer noopener';
1
+ export const NEW_TAB_REL = 'noopener';
2
2
  export const NEW_TAB_TARGET = '_blank';
3
3
  export const NOFOLLOW_REL = 'nofollow';
@@ -15,7 +15,7 @@ describe( 'getUpdatedLinkAttributes method', () => {
15
15
 
16
16
  expect( result.url ).toEqual( 'https://example.com' );
17
17
  expect( result.linkTarget ).toEqual( '_blank' );
18
- expect( result.rel ).toEqual( 'noreferrer noopener' );
18
+ expect( result.rel ).toEqual( 'noopener' );
19
19
  } );
20
20
 
21
21
  it( 'should return empty rel value as undefined', () => {
@@ -44,9 +44,7 @@ describe( 'getUpdatedLinkAttributes method', () => {
44
44
 
45
45
  expect( result.url ).toEqual( 'https://example.com' );
46
46
  expect( result.linkTarget ).toEqual( '_blank' );
47
- expect( result.rel ).toEqual(
48
- 'rel_value noreferrer noopener nofollow'
49
- );
47
+ expect( result.rel ).toEqual( 'rel_value noopener nofollow' );
50
48
  } );
51
49
 
52
50
  it( 'should correctly update link attributes with opensInNewTab', () => {
@@ -61,7 +59,7 @@ describe( 'getUpdatedLinkAttributes method', () => {
61
59
 
62
60
  expect( result.url ).toEqual( 'https://example.com' );
63
61
  expect( result.linkTarget ).toEqual( '_blank' );
64
- expect( result.rel ).toEqual( 'rel_value noreferrer noopener' );
62
+ expect( result.rel ).toEqual( 'rel_value noopener' );
65
63
  } );
66
64
 
67
65
  it( 'should correctly update link attributes with nofollow', () => {
@@ -106,9 +104,7 @@ describe( 'getUpdatedLinkAttributes method', () => {
106
104
 
107
105
  expect( result.url ).toEqual( 'https://example.com' );
108
106
  expect( result.linkTarget ).toEqual( '_blank' );
109
- expect( result.rel ).toEqual(
110
- 'rel_value nofollow noreferrer noopener'
111
- );
107
+ expect( result.rel ).toEqual( 'rel_value nofollow noopener' );
112
108
  } );
113
109
 
114
110
  it( 'should correctly handle rel with existing new tab values and remove duplicates', () => {
@@ -116,13 +112,13 @@ describe( 'getUpdatedLinkAttributes method', () => {
116
112
  url: 'example.com',
117
113
  opensInNewTab: true,
118
114
  nofollow: false,
119
- rel: 'rel_value noreferrer noopener',
115
+ rel: 'rel_value noopener',
120
116
  };
121
117
 
122
118
  const result = getUpdatedLinkAttributes( options );
123
119
 
124
120
  expect( result.url ).toEqual( 'https://example.com' );
125
121
  expect( result.linkTarget ).toEqual( '_blank' );
126
- expect( result.rel ).toEqual( 'rel_value noreferrer noopener' );
122
+ expect( result.rel ).toEqual( 'rel_value noopener' );
127
123
  } );
128
124
  } );
@@ -55,7 +55,8 @@
55
55
  }
56
56
  },
57
57
  "dimensions": {
58
- "minHeight": true
58
+ "minHeight": true,
59
+ "minWidth": true
59
60
  },
60
61
  "__experimentalBorder": {
61
62
  "color": true,
@@ -3,7 +3,7 @@ export const LINK_DESTINATION_NONE = 'none';
3
3
  export const LINK_DESTINATION_MEDIA = 'media';
4
4
  export const LINK_DESTINATION_ATTACHMENT = 'attachment';
5
5
  export const LINK_DESTINATION_CUSTOM = 'custom';
6
- export const NEW_TAB_REL = [ 'noreferrer', 'noopener' ];
6
+ export const NEW_TAB_REL = [ 'noopener' ];
7
7
  export const ALLOWED_MEDIA_TYPES = [ 'image' ];
8
8
  export const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0;
9
9
  export const SIZED_LAYOUTS = [ 'flex', 'grid' ];
package/src/image/edit.js CHANGED
@@ -142,8 +142,6 @@ export function ImageEdit( {
142
142
  setAttributes( {
143
143
  width: undefined,
144
144
  height: undefined,
145
- aspectRatio: undefined,
146
- scale: undefined,
147
145
  } );
148
146
  }
149
147
  }, [ __unstableMarkNextChangeAsNotPersistent, align, setAttributes ] );
@@ -362,27 +362,6 @@ export default function Image( {
362
362
  [ id, isSingleSelected ]
363
363
  );
364
364
 
365
- // If the image has an id but the attachment doesn't exist on this site,
366
- // clear the id so Gutenberg treats the image as external.
367
- // This handles content copied between WordPress sites.
368
- //
369
- // Known limitation: if a different attachment with the same id happens to
370
- // exist on the destination site, the lookup will succeed and the wrong
371
- // local image will be used. URL matching could address this in a follow-up.
372
- // See: https://github.com/WordPress/gutenberg/issues/74156
373
- useEffect( () => {
374
- if ( ! id || ! isSingleSelected ) {
375
- return;
376
- }
377
- // Only clear for confirmed 404s. apiFetch throws the Response object
378
- // for HTTP errors, so checking .status === 404 avoids incorrectly
379
- // clearing the id on 403, 500, or network failures, which would
380
- // cause data loss for valid local attachments.
381
- if ( attachmentResolutionError?.status === 404 ) {
382
- setAttributes( { id: undefined } );
383
- }
384
- }, [ id, isSingleSelected, attachmentResolutionError, setAttributes ] );
385
-
386
365
  const {
387
366
  canInsertCover,
388
367
  imageEditing,
@@ -413,7 +392,11 @@ export default function Image( {
413
392
  const { getBlock, getSettings } = useSelect( blockEditorStore );
414
393
  const onNavigateToEntityRecord = getSettings().onNavigateToEntityRecord;
415
394
 
416
- const { replaceBlocks, toggleSelection } = useDispatch( blockEditorStore );
395
+ const {
396
+ replaceBlocks,
397
+ toggleSelection,
398
+ __unstableMarkNextChangeAsNotPersistent,
399
+ } = useDispatch( blockEditorStore );
417
400
  const { createErrorNotice, createSuccessNotice } =
418
401
  useDispatch( noticesStore );
419
402
  const { editEntityRecord } = useDispatch( coreStore );
@@ -444,6 +427,34 @@ export default function Image( {
444
427
  )
445
428
  .map( ( { name, slug } ) => ( { value: slug, label: name } ) );
446
429
 
430
+ // If the image has an id but the attachment doesn't exist on this site,
431
+ // clear the id so Gutenberg treats the image as external.
432
+ // This handles content copied between WordPress sites.
433
+ //
434
+ // Known limitation: if a different attachment with the same id happens to
435
+ // exist on the destination site, the lookup will succeed and the wrong
436
+ // local image will be used. URL matching could address this in a follow-up.
437
+ // See: https://github.com/WordPress/gutenberg/issues/74156
438
+ useEffect( () => {
439
+ if ( ! id || ! isSingleSelected ) {
440
+ return;
441
+ }
442
+ // Only clear for confirmed 404s. apiFetch throws the Response object
443
+ // for HTTP errors, so checking .status === 404 avoids incorrectly
444
+ // clearing the id on 403, 500, or network failures, which would
445
+ // cause data loss for valid local attachments.
446
+ if ( attachmentResolutionError?.status === 404 ) {
447
+ __unstableMarkNextChangeAsNotPersistent();
448
+ setAttributes( { id: undefined } );
449
+ }
450
+ }, [
451
+ id,
452
+ isSingleSelected,
453
+ attachmentResolutionError,
454
+ setAttributes,
455
+ __unstableMarkNextChangeAsNotPersistent,
456
+ ] );
457
+
447
458
  // If an image is externally hosted, try to fetch the image data. This may
448
459
  // fail if the image host doesn't allow CORS with the domain. If it works,
449
460
  // we can enable a button in the toolbar to upload the image.
@@ -269,7 +269,7 @@ describe( 'Image Block', () => {
269
269
  fireEvent.press( linkTargetButton );
270
270
 
271
271
  const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
272
- <figure class="wp-block-image size-large is-style-default"><a href="https://wordpress.org" target="_blank" rel="noreferrer noopener"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption class="wp-element-caption">Mountain</figcaption></figure>
272
+ <figure class="wp-block-image size-large is-style-default"><a href="https://wordpress.org" target="_blank" rel="noopener"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption class="wp-element-caption">Mountain</figcaption></figure>
273
273
  <!-- /wp:image -->`;
274
274
  expect( getEditorHtml() ).toBe( expectedHtml );
275
275
  } );
@@ -278,7 +278,7 @@ describe( 'Image Block', () => {
278
278
  const initialHtml = `
279
279
  <!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
280
280
  <figure class="wp-block-image size-large is-style-default">
281
- <a href="https://wordpress.org" target="_blank" rel="noreferrer noopener">
281
+ <a href="https://wordpress.org" target="_blank" rel="noopener">
282
282
  <img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
283
283
  </a>
284
284
  <figcaption class="wp-element-caption">Mountain</figcaption>
@@ -1,3 +1,10 @@
1
+ // Reset the browser's default `padding-inline-start: 40px` on `<ol>`.
2
+ // Using `:where` keeps specificity at 0 so global styles, theme.json,
3
+ // and inspector controls can override it without difficulty.
4
+ :where(.wp-block-latest-comments) {
5
+ padding-left: 0;
6
+ }
7
+
1
8
  // Lower specificity - target list element.
2
9
  ol.wp-block-latest-comments {
3
10
  // Removes left spacing in Customizer Widgets screen.
@@ -26,13 +33,6 @@ ol.wp-block-latest-comments {
26
33
  }
27
34
  }
28
35
 
29
- // Higher specificity - target list via wrapper.
30
- .wp-block-latest-comments .wp-block-latest-comments {
31
- // Remove left spacing. Higher specificity required to
32
- // override default wp-block layout styles in the Post/Site editor.
33
- padding-left: 0;
34
- }
35
-
36
36
  .wp-block-latest-comments__comment {
37
37
  list-style: none;
38
38
  margin-bottom: 1em;
@@ -743,7 +743,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
743
743
  <a
744
744
  className="wp-block-latest-posts__read-more"
745
745
  href={ post.link }
746
- rel="noopener noreferrer"
746
+ rel="noopener"
747
747
  onClick={
748
748
  showRedirectionPreventedNotice
749
749
  }
@@ -163,7 +163,7 @@ function render_block_core_latest_posts( $attributes ) {
163
163
  $trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
164
164
  $trimmed_excerpt .= sprintf(
165
165
  /* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */
166
- __( '… <a class="wp-block-latest-posts__read-more" href="%1$s" rel="noopener noreferrer">Read more<span class="screen-reader-text">: %2$s</span></a>' ),
166
+ __( '… <a class="wp-block-latest-posts__read-more" href="%1$s" rel="noopener">Read more<span class="screen-reader-text">: %2$s</span></a>' ),
167
167
  esc_url( $post_link ),
168
168
  esc_html( $title )
169
169
  );
@@ -43,6 +43,7 @@ jest.mock( '@wordpress/data', () => ( {
43
43
  return newState;
44
44
  } ),
45
45
  register: jest.fn(),
46
+ keyedReducer: jest.fn( () => ( reducer ) => reducer ),
46
47
  } ) );
47
48
 
48
49
  const mockSetAttributes = jest.fn();
@@ -9,24 +9,20 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
9
9
  import {
10
10
  hasBlockSupport,
11
11
  createBlock,
12
+ cloneBlock,
12
13
  getDefaultBlockName,
13
14
  } from '@wordpress/blocks';
14
15
 
15
16
  export function useOnEnter( props ) {
16
17
  const { batch } = useRegistry();
17
- const {
18
- moveBlocksToPosition,
19
- replaceInnerBlocks,
20
- duplicateBlocks,
21
- insertBlock,
22
- } = useDispatch( blockEditorStore );
18
+ const { moveBlocksToPosition, replaceBlocks, selectionChange } =
19
+ useDispatch( blockEditorStore );
23
20
  const {
24
21
  getBlockRootClientId,
25
22
  getBlockIndex,
26
23
  getBlockOrder,
27
24
  getBlockName,
28
25
  getBlock,
29
- getNextBlockClientId,
30
26
  canInsertBlockType,
31
27
  } = useSelect( blockEditorStore );
32
28
  const propsRef = useRef( props );
@@ -104,24 +100,22 @@ export function useOnEnter( props ) {
104
100
 
105
101
  // If it is in the middle, split the block in two.
106
102
  const wrapperBlock = getBlock( wrapperClientId );
103
+ const head = cloneBlock( {
104
+ ...wrapperBlock,
105
+ innerBlocks: wrapperBlock.innerBlocks.slice( 0, position ),
106
+ } );
107
+ const middle = createBlock( defaultBlockName );
108
+ const tail = cloneBlock( {
109
+ ...wrapperBlock,
110
+ innerBlocks: wrapperBlock.innerBlocks.slice( position + 1 ),
111
+ } );
112
+
107
113
  batch( () => {
108
- duplicateBlocks( [ wrapperClientId ] );
109
- const blockIndex = getBlockIndex( wrapperClientId );
110
-
111
- replaceInnerBlocks(
112
- wrapperClientId,
113
- wrapperBlock.innerBlocks.slice( 0, position )
114
- );
115
- replaceInnerBlocks(
116
- getNextBlockClientId( wrapperClientId ),
117
- wrapperBlock.innerBlocks.slice( position + 1 )
118
- );
119
- insertBlock(
120
- createBlock( defaultBlockName ),
121
- blockIndex + 1,
122
- grandparentClientId,
123
- true
124
- );
114
+ replaceBlocks( wrapperClientId, [ head, middle, tail ] );
115
+ // The selected paragraph is a descendant of the replaced
116
+ // wrapper, so `replaceBlocks` leaves the selection stale.
117
+ // Move it to the new default block explicitly.
118
+ selectionChange( middle.clientId );
125
119
  } );
126
120
  }
127
121
 
@@ -278,15 +278,8 @@ export default function PostFeaturedImageEdit( {
278
278
  }
279
279
  >
280
280
  <ToggleControl
281
- label={
282
- postType?.labels.singular_name
283
- ? sprintf(
284
- // translators: %s: Name of the post type e.g: "post".
285
- __( 'Link to %s' ),
286
- postType.labels.singular_name
287
- )
288
- : __( 'Link to post' )
289
- }
281
+ __nextHasNoMarginBottom
282
+ label={ __( 'Make image a link' ) }
290
283
  onChange={ () =>
291
284
  setAttributes( { isLink: ! isLink } )
292
285
  }
@@ -116,7 +116,11 @@ export default function PostTemplateEdit( {
116
116
  attributes: { layout },
117
117
  __unstableLayoutClassNames,
118
118
  } ) {
119
- const { type: layoutType, columnCount = 3 } = layout || {};
119
+ const {
120
+ type: layoutType,
121
+ columnCount = 3,
122
+ minimumColumnWidth,
123
+ } = layout || {};
120
124
  const [ activeBlockContextId, setActiveBlockContextId ] = useState();
121
125
  const { posts, blocks } = useSelect(
122
126
  ( select ) => {
@@ -281,6 +285,8 @@ export default function PostTemplateEdit( {
281
285
  className: clsx( __unstableLayoutClassNames, {
282
286
  [ `columns-${ columnCount }` ]:
283
287
  layoutType === 'grid' && columnCount, // Ensure column count is flagged via classname for backwards compatibility.
288
+ 'has-native-responsive-grid':
289
+ layoutType === 'grid' && columnCount && minimumColumnWidth, // Flag native responsive grid when minimum column width is provided.
284
290
  } ),
285
291
  } );
286
292
 
@@ -94,6 +94,9 @@ function render_block_core_post_template( $attributes, $content, $block ) {
94
94
  if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) ) {
95
95
  $classnames .= ' ' . sanitize_title( 'columns-' . $attributes['layout']['columnCount'] );
96
96
  }
97
+ if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) && ! empty( $attributes['layout']['minimumColumnWidth'] ) ) {
98
+ $classnames .= ' has-native-responsive-grid';
99
+ }
97
100
 
98
101
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) );
99
102
 
@@ -32,9 +32,9 @@
32
32
  }
33
33
  }
34
34
 
35
- @media ( max-width: $break-small ) {
35
+ @media (max-width: $break-small) {
36
36
  // Temporary specificity bump until "wp-container" layout specificity is revisited.
37
- .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
37
+ .wp-block-post-template-is-layout-grid[class*="columns-"]:not(.has-native-responsive-grid) {
38
38
  grid-template-columns: 1fr;
39
39
  }
40
40
  }
@@ -43,10 +43,7 @@
43
43
  }
44
44
  },
45
45
  "dimensions": {
46
- "minHeight": true,
47
- "__experimentalDefaultControls": {
48
- "minHeight": false
49
- }
46
+ "minHeight": true
50
47
  },
51
48
  "spacing": {
52
49
  "margin": true,
@@ -282,11 +282,11 @@ const SiteLogo = ( {
282
282
  ),
283
283
  {
284
284
  a: (
285
- // eslint-disable-next-line jsx-a11y/anchor-has-content
285
+ // eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-no-target-blank
286
286
  <a
287
287
  href={ siteIconSettingsUrl }
288
288
  target="_blank"
289
- rel="noopener noreferrer"
289
+ rel="noopener"
290
290
  />
291
291
  ),
292
292
  }
@@ -5,7 +5,6 @@
5
5
  "name": "core/tab",
6
6
  "title": "Tab",
7
7
  "description": "Content for a tab in a tabbed interface.",
8
- "version": "1.0.0",
9
8
  "category": "design",
10
9
  "textdomain": "default",
11
10
  "attributes": {
@@ -46,7 +45,8 @@
46
45
  "__experimentalFontFamily": true
47
46
  }
48
47
  },
49
- "renaming": true
48
+ "renaming": true,
49
+ "visibility": false
50
50
  },
51
51
  "providesContext": {
52
52
  "core/tab-label": "label"