@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.
- package/build/button/constants.cjs +1 -1
- package/build/button/constants.cjs.map +1 -1
- package/build/group/block.json +2 -1
- package/build/image/constants.cjs +1 -1
- package/build/image/constants.cjs.map +2 -2
- package/build/image/edit.cjs +1 -3
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +20 -9
- package/build/image/image.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +1 -1
- package/build/latest-posts/edit.cjs.map +1 -1
- package/build/paragraph/use-enter.cjs +12 -23
- package/build/paragraph/use-enter.cjs.map +2 -2
- package/build/post-featured-image/edit.cjs +2 -5
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-template/edit.cjs +8 -2
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +1 -4
- package/build/site-logo/edit.cjs +2 -2
- package/build/site-logo/edit.cjs.map +1 -1
- package/build/tab/block.json +2 -2
- package/build/tab/edit.cjs +3 -21
- package/build/tab/edit.cjs.map +3 -3
- package/build/tab-panel/block.json +1 -1
- package/build/tab-panel/edit.cjs +1 -4
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -1
- package/build/tabs/edit.cjs +10 -86
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/use-tab-menu-sync.cjs +192 -0
- package/build/tabs/use-tab-menu-sync.cjs.map +7 -0
- package/build/tabs-menu/block.json +1 -1
- package/build/tabs-menu/edit.cjs +5 -10
- package/build/tabs-menu/edit.cjs.map +3 -3
- package/build/tabs-menu-item/block.json +1 -4
- package/build/tabs-menu-item/edit.cjs +3 -12
- package/build/tabs-menu-item/edit.cjs.map +2 -2
- package/build-module/button/constants.mjs +1 -1
- package/build-module/button/constants.mjs.map +1 -1
- package/build-module/group/block.json +2 -1
- package/build-module/image/constants.mjs +1 -1
- package/build-module/image/constants.mjs.map +2 -2
- package/build-module/image/edit.mjs +1 -3
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +20 -9
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +1 -1
- package/build-module/latest-posts/edit.mjs.map +1 -1
- package/build-module/paragraph/use-enter.mjs +13 -23
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs +2 -5
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-template/edit.mjs +8 -2
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +1 -4
- package/build-module/site-logo/edit.mjs +2 -2
- package/build-module/site-logo/edit.mjs.map +1 -1
- package/build-module/tab/block.json +2 -2
- package/build-module/tab/edit.mjs +3 -21
- package/build-module/tab/edit.mjs.map +2 -2
- package/build-module/tab-panel/block.json +1 -1
- package/build-module/tab-panel/edit.mjs +1 -4
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -1
- package/build-module/tabs/edit.mjs +12 -88
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/use-tab-menu-sync.mjs +171 -0
- package/build-module/tabs/use-tab-menu-sync.mjs.map +7 -0
- package/build-module/tabs-menu/block.json +1 -1
- package/build-module/tabs-menu/edit.mjs +5 -10
- package/build-module/tabs-menu/edit.mjs.map +2 -2
- package/build-module/tabs-menu-item/block.json +1 -4
- package/build-module/tabs-menu-item/edit.mjs +3 -12
- package/build-module/tabs-menu-item/edit.mjs.map +2 -2
- package/build-style/latest-comments/style-rtl.css +4 -4
- package/build-style/latest-comments/style.css +4 -4
- package/build-style/post-template/style-rtl.css +1 -1
- package/build-style/post-template/style.css +1 -1
- package/build-style/style-rtl.css +5 -8
- package/build-style/style.css +5 -8
- package/build-style/tabs/style-rtl.css +0 -3
- package/build-style/tabs/style.css +0 -3
- package/package.json +38 -38
- package/src/block/test/edit.native.js +1 -1
- package/src/button/constants.js +1 -1
- package/src/button/test/get-updated-link-attributes.js +6 -10
- package/src/group/block.json +2 -1
- package/src/image/constants.js +1 -1
- package/src/image/edit.js +0 -2
- package/src/image/image.js +33 -22
- package/src/image/test/edit.native.js +2 -2
- package/src/latest-comments/style.scss +7 -7
- package/src/latest-posts/edit.js +1 -1
- package/src/latest-posts/index.php +1 -1
- package/src/navigation/edit/test/overlay-template-part-selector.js +1 -0
- package/src/paragraph/use-enter.js +18 -24
- package/src/post-featured-image/edit.js +2 -9
- package/src/post-template/edit.js +7 -1
- package/src/post-template/index.php +3 -0
- package/src/post-template/style.scss +2 -2
- package/src/pullquote/block.json +1 -4
- package/src/site-logo/edit.js +2 -2
- package/src/tab/block.json +2 -2
- package/src/tab/edit.js +2 -27
- package/src/tab-panel/block.json +1 -1
- package/src/tab-panel/edit.js +2 -4
- package/src/tabs/block.json +0 -1
- package/src/tabs/edit.js +11 -134
- package/src/tabs/style.scss +0 -3
- package/src/tabs/use-tab-menu-sync.js +239 -0
- package/src/tabs-menu/block.json +1 -1
- package/src/tabs-menu/edit.js +6 -15
- package/src/tabs-menu-item/block.json +1 -4
- package/src/tabs-menu-item/edit.js +3 -12
- package/build/tab/slug-from-label.cjs +0 -37
- package/build/tab/slug-from-label.cjs.map +0 -7
- package/build-module/tab/slug-from-label.mjs +0 -16
- package/build-module/tab/slug-from-label.mjs.map +0 -7
- 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
|
|
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;
|
package/build-style/style.css
CHANGED
|
@@ -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
|
|
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;
|
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.
|
|
104
|
-
"@wordpress/blocks": "^15.17.0",
|
|
105
|
-
"@wordpress/components": "^
|
|
106
|
-
"@wordpress/compose": "^7.44.0",
|
|
107
|
-
"@wordpress/core-data": "^7.44.0",
|
|
108
|
-
"@wordpress/data": "^10.
|
|
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": "
|
|
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="
|
|
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} -->
|
package/src/button/constants.js
CHANGED
|
@@ -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( '
|
|
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
|
|
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
|
|
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
|
|
122
|
+
expect( result.rel ).toEqual( 'rel_value noopener' );
|
|
127
123
|
} );
|
|
128
124
|
} );
|
package/src/group/block.json
CHANGED
package/src/image/constants.js
CHANGED
|
@@ -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 = [ '
|
|
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
package/src/image/image.js
CHANGED
|
@@ -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 {
|
|
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="
|
|
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="
|
|
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;
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
);
|
|
@@ -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
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
282
|
-
|
|
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 {
|
|
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 (
|
|
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
|
|
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
|
}
|
package/src/pullquote/block.json
CHANGED
package/src/site-logo/edit.js
CHANGED
|
@@ -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
|
|
289
|
+
rel="noopener"
|
|
290
290
|
/>
|
|
291
291
|
),
|
|
292
292
|
}
|
package/src/tab/block.json
CHANGED
|
@@ -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"
|