@wordpress/block-library 9.0.3 → 9.0.4
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/image/image.js +3 -2
- package/build/image/image.js.map +1 -1
- package/build-module/image/image.js +3 -2
- package/build-module/image/image.js.map +1 -1
- package/build-style/audio/style-rtl.css +1 -1
- package/build-style/audio/style.css +1 -1
- package/build-style/audio/theme-rtl.css +2 -2
- package/build-style/audio/theme.css +2 -2
- package/build-style/editor-rtl.css +0 -12
- package/build-style/editor.css +0 -12
- package/build-style/embed/style-rtl.css +1 -1
- package/build-style/embed/style.css +1 -1
- package/build-style/embed/theme-rtl.css +2 -2
- package/build-style/embed/theme.css +2 -2
- package/build-style/image/editor-rtl.css +0 -12
- package/build-style/image/editor.css +0 -12
- package/build-style/image/style-rtl.css +1 -1
- package/build-style/image/style.css +1 -1
- package/build-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/reset-rtl.css +1 -5
- package/build-style/reset.css +1 -5
- package/build-style/style-rtl.css +5 -4
- package/build-style/style.css +5 -4
- package/build-style/table/theme-rtl.css +2 -2
- package/build-style/table/theme.css +2 -2
- package/build-style/theme-rtl.css +8 -8
- package/build-style/theme.css +8 -8
- package/build-style/video/style-rtl.css +1 -1
- package/build-style/video/style.css +1 -1
- package/build-style/video/theme-rtl.css +2 -2
- package/build-style/video/theme.css +2 -2
- package/package.json +12 -12
- package/src/audio/style.scss +1 -1
- package/src/audio/theme.scss +1 -1
- package/src/embed/style.scss +1 -1
- package/src/embed/theme.scss +1 -1
- package/src/image/editor.scss +0 -13
- package/src/image/image.js +9 -2
- package/src/image/style.scss +1 -1
- package/src/media-text/index.php +68 -18
- package/src/navigation/index.php +5 -3
- package/src/navigation/style.scss +1 -0
- package/src/reset.scss +11 -12
- package/src/table/theme.scss +1 -1
- package/src/video/style.scss +1 -1
- package/src/video/theme.scss +1 -1
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
.wp-block-table th {
|
|
94
94
|
word-break: normal;
|
|
95
95
|
}
|
|
96
|
-
.wp-block-table figcaption {
|
|
96
|
+
.wp-block-table :where(figcaption) {
|
|
97
97
|
color: #555;
|
|
98
98
|
font-size: 13px;
|
|
99
99
|
text-align: center;
|
|
100
100
|
}
|
|
101
|
-
.is-dark-theme .wp-block-table figcaption {
|
|
101
|
+
.is-dark-theme .wp-block-table :where(figcaption) {
|
|
102
102
|
color: rgba(255, 255, 255, 0.65);
|
|
103
103
|
}
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
.wp-block-table th {
|
|
94
94
|
word-break: normal;
|
|
95
95
|
}
|
|
96
|
-
.wp-block-table figcaption {
|
|
96
|
+
.wp-block-table :where(figcaption) {
|
|
97
97
|
color: #555;
|
|
98
98
|
font-size: 13px;
|
|
99
99
|
text-align: center;
|
|
100
100
|
}
|
|
101
|
-
.is-dark-theme .wp-block-table figcaption {
|
|
101
|
+
.is-dark-theme .wp-block-table :where(figcaption) {
|
|
102
102
|
color: rgba(255, 255, 255, 0.65);
|
|
103
103
|
}
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
/**
|
|
87
87
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
88
88
|
*/
|
|
89
|
-
.wp-block-audio figcaption {
|
|
89
|
+
.wp-block-audio :where(figcaption) {
|
|
90
90
|
color: #555;
|
|
91
91
|
font-size: 13px;
|
|
92
92
|
text-align: center;
|
|
93
93
|
}
|
|
94
|
-
.is-dark-theme .wp-block-audio figcaption {
|
|
94
|
+
.is-dark-theme .wp-block-audio :where(figcaption) {
|
|
95
95
|
color: rgba(255, 255, 255, 0.65);
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
padding: 0.8em 1em;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
.wp-block-embed figcaption {
|
|
109
|
+
.wp-block-embed :where(figcaption) {
|
|
110
110
|
color: #555;
|
|
111
111
|
font-size: 13px;
|
|
112
112
|
text-align: center;
|
|
113
113
|
}
|
|
114
|
-
.is-dark-theme .wp-block-embed figcaption {
|
|
114
|
+
.is-dark-theme .wp-block-embed :where(figcaption) {
|
|
115
115
|
color: rgba(255, 255, 255, 0.65);
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -225,21 +225,21 @@
|
|
|
225
225
|
.wp-block-table th {
|
|
226
226
|
word-break: normal;
|
|
227
227
|
}
|
|
228
|
-
.wp-block-table figcaption {
|
|
228
|
+
.wp-block-table :where(figcaption) {
|
|
229
229
|
color: #555;
|
|
230
230
|
font-size: 13px;
|
|
231
231
|
text-align: center;
|
|
232
232
|
}
|
|
233
|
-
.is-dark-theme .wp-block-table figcaption {
|
|
233
|
+
.is-dark-theme .wp-block-table :where(figcaption) {
|
|
234
234
|
color: rgba(255, 255, 255, 0.65);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
.wp-block-video figcaption {
|
|
237
|
+
.wp-block-video :where(figcaption) {
|
|
238
238
|
color: #555;
|
|
239
239
|
font-size: 13px;
|
|
240
240
|
text-align: center;
|
|
241
241
|
}
|
|
242
|
-
.is-dark-theme .wp-block-video figcaption {
|
|
242
|
+
.is-dark-theme .wp-block-video :where(figcaption) {
|
|
243
243
|
color: rgba(255, 255, 255, 0.65);
|
|
244
244
|
}
|
|
245
245
|
|
package/build-style/theme.css
CHANGED
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
/**
|
|
87
87
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
88
88
|
*/
|
|
89
|
-
.wp-block-audio figcaption {
|
|
89
|
+
.wp-block-audio :where(figcaption) {
|
|
90
90
|
color: #555;
|
|
91
91
|
font-size: 13px;
|
|
92
92
|
text-align: center;
|
|
93
93
|
}
|
|
94
|
-
.is-dark-theme .wp-block-audio figcaption {
|
|
94
|
+
.is-dark-theme .wp-block-audio :where(figcaption) {
|
|
95
95
|
color: rgba(255, 255, 255, 0.65);
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
padding: 0.8em 1em;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
.wp-block-embed figcaption {
|
|
109
|
+
.wp-block-embed :where(figcaption) {
|
|
110
110
|
color: #555;
|
|
111
111
|
font-size: 13px;
|
|
112
112
|
text-align: center;
|
|
113
113
|
}
|
|
114
|
-
.is-dark-theme .wp-block-embed figcaption {
|
|
114
|
+
.is-dark-theme .wp-block-embed :where(figcaption) {
|
|
115
115
|
color: rgba(255, 255, 255, 0.65);
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -225,21 +225,21 @@
|
|
|
225
225
|
.wp-block-table th {
|
|
226
226
|
word-break: normal;
|
|
227
227
|
}
|
|
228
|
-
.wp-block-table figcaption {
|
|
228
|
+
.wp-block-table :where(figcaption) {
|
|
229
229
|
color: #555;
|
|
230
230
|
font-size: 13px;
|
|
231
231
|
text-align: center;
|
|
232
232
|
}
|
|
233
|
-
.is-dark-theme .wp-block-table figcaption {
|
|
233
|
+
.is-dark-theme .wp-block-table :where(figcaption) {
|
|
234
234
|
color: rgba(255, 255, 255, 0.65);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
.wp-block-video figcaption {
|
|
237
|
+
.wp-block-video :where(figcaption) {
|
|
238
238
|
color: #555;
|
|
239
239
|
font-size: 13px;
|
|
240
240
|
text-align: center;
|
|
241
241
|
}
|
|
242
|
-
.is-dark-theme .wp-block-video figcaption {
|
|
242
|
+
.is-dark-theme .wp-block-video :where(figcaption) {
|
|
243
243
|
color: rgba(255, 255, 255, 0.65);
|
|
244
244
|
}
|
|
245
245
|
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
/**
|
|
87
87
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
88
88
|
*/
|
|
89
|
-
.wp-block-video figcaption {
|
|
89
|
+
.wp-block-video :where(figcaption) {
|
|
90
90
|
color: #555;
|
|
91
91
|
font-size: 13px;
|
|
92
92
|
text-align: center;
|
|
93
93
|
}
|
|
94
|
-
.is-dark-theme .wp-block-video figcaption {
|
|
94
|
+
.is-dark-theme .wp-block-video :where(figcaption) {
|
|
95
95
|
color: rgba(255, 255, 255, 0.65);
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
/**
|
|
87
87
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
88
88
|
*/
|
|
89
|
-
.wp-block-video figcaption {
|
|
89
|
+
.wp-block-video :where(figcaption) {
|
|
90
90
|
color: #555;
|
|
91
91
|
font-size: 13px;
|
|
92
92
|
text-align: center;
|
|
93
93
|
}
|
|
94
|
-
.is-dark-theme .wp-block-video figcaption {
|
|
94
|
+
.is-dark-theme .wp-block-video :where(figcaption) {
|
|
95
95
|
color: rgba(255, 255, 255, 0.65);
|
|
96
96
|
}
|
|
97
97
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"@wordpress/api-fetch": "^7.0.1",
|
|
37
37
|
"@wordpress/autop": "^4.0.1",
|
|
38
38
|
"@wordpress/blob": "^4.0.1",
|
|
39
|
-
"@wordpress/block-editor": "^13.0.
|
|
40
|
-
"@wordpress/blocks": "^13.0.
|
|
41
|
-
"@wordpress/components": "^28.0.
|
|
39
|
+
"@wordpress/block-editor": "^13.0.3",
|
|
40
|
+
"@wordpress/blocks": "^13.0.3",
|
|
41
|
+
"@wordpress/components": "^28.0.3",
|
|
42
42
|
"@wordpress/compose": "^7.0.1",
|
|
43
|
-
"@wordpress/core-data": "^7.0.
|
|
43
|
+
"@wordpress/core-data": "^7.0.3",
|
|
44
44
|
"@wordpress/data": "^10.0.2",
|
|
45
45
|
"@wordpress/date": "^5.0.1",
|
|
46
46
|
"@wordpress/deprecated": "^4.0.1",
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
"@wordpress/hooks": "^4.0.1",
|
|
51
51
|
"@wordpress/html-entities": "^4.0.1",
|
|
52
52
|
"@wordpress/i18n": "^5.0.1",
|
|
53
|
-
"@wordpress/icons": "^10.0.
|
|
54
|
-
"@wordpress/interactivity": "^6.0.
|
|
55
|
-
"@wordpress/interactivity-router": "^2.0.
|
|
53
|
+
"@wordpress/icons": "^10.0.2",
|
|
54
|
+
"@wordpress/interactivity": "^6.0.2",
|
|
55
|
+
"@wordpress/interactivity-router": "^2.0.2",
|
|
56
56
|
"@wordpress/keyboard-shortcuts": "^5.0.2",
|
|
57
57
|
"@wordpress/keycodes": "^4.0.1",
|
|
58
58
|
"@wordpress/notices": "^5.0.2",
|
|
59
|
-
"@wordpress/patterns": "^2.0.
|
|
59
|
+
"@wordpress/patterns": "^2.0.3",
|
|
60
60
|
"@wordpress/primitives": "^4.0.1",
|
|
61
61
|
"@wordpress/private-apis": "^1.0.2",
|
|
62
|
-
"@wordpress/reusable-blocks": "^5.0.
|
|
62
|
+
"@wordpress/reusable-blocks": "^5.0.3",
|
|
63
63
|
"@wordpress/rich-text": "^7.0.2",
|
|
64
|
-
"@wordpress/server-side-render": "^5.0.
|
|
64
|
+
"@wordpress/server-side-render": "^5.0.3",
|
|
65
65
|
"@wordpress/url": "^4.0.1",
|
|
66
66
|
"@wordpress/viewport": "^6.0.2",
|
|
67
67
|
"@wordpress/wordcount": "^4.0.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "9dd5f8dcfa4fc7242e5d48be20ee789ad087b432"
|
|
86
86
|
}
|
package/src/audio/style.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Supply caption styles to audio blocks, even if the theme hasn't opted in.
|
|
5
5
|
// Reason being: the new markup, <figcaptions>, are not likely to be styled in the majority of existing themes,
|
|
6
6
|
// so we supply the styles so as to not appear broken or unstyled in those themes.
|
|
7
|
-
figcaption {
|
|
7
|
+
:where(figcaption) {
|
|
8
8
|
@include caption-style();
|
|
9
9
|
}
|
|
10
10
|
|
package/src/audio/theme.scss
CHANGED
package/src/embed/style.scss
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// Supply caption styles to embeds, even if the theme hasn't opted in.
|
|
26
26
|
// Reason being: the new markup, figcaptions, are not likely to be styled in the majority of existing themes,
|
|
27
27
|
// so we supply the styles so as to not appear broken or unstyled in those.
|
|
28
|
-
figcaption {
|
|
28
|
+
:where(figcaption) {
|
|
29
29
|
@include caption-style();
|
|
30
30
|
}
|
|
31
31
|
|
package/src/embed/theme.scss
CHANGED
package/src/image/editor.scss
CHANGED
|
@@ -176,19 +176,6 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
.wp-block-image__aspect-ratio {
|
|
180
|
-
height: $grid-unit-60 - $border-width - $border-width;
|
|
181
|
-
margin-bottom: -$grid-unit-10;
|
|
182
|
-
display: flex;
|
|
183
|
-
align-items: center;
|
|
184
|
-
|
|
185
|
-
.components-button {
|
|
186
|
-
width: $button-size;
|
|
187
|
-
padding-left: 0;
|
|
188
|
-
padding-right: 0;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
179
|
.wp-block-image__toolbar_content_textarea {
|
|
193
180
|
// Corresponds to the size of the textarea in the block inspector.
|
|
194
181
|
width: 250px;
|
package/src/image/image.js
CHANGED
|
@@ -426,6 +426,9 @@ export default function Image( {
|
|
|
426
426
|
</InspectorControls>
|
|
427
427
|
);
|
|
428
428
|
|
|
429
|
+
const arePatternOverridesEnabled =
|
|
430
|
+
metadata?.bindings?.__default?.source === 'core/pattern-overrides';
|
|
431
|
+
|
|
429
432
|
const {
|
|
430
433
|
lockUrlControls = false,
|
|
431
434
|
lockHrefControls = false,
|
|
@@ -470,7 +473,7 @@ export default function Image( {
|
|
|
470
473
|
lockHrefControls:
|
|
471
474
|
// Disable editing the link of the URL if the image is inside a pattern instance.
|
|
472
475
|
// This is a temporary solution until we support overriding the link on the frontend.
|
|
473
|
-
hasParentPattern,
|
|
476
|
+
hasParentPattern || arePatternOverridesEnabled,
|
|
474
477
|
lockCaption:
|
|
475
478
|
// Disable editing the caption if the image is inside a pattern instance.
|
|
476
479
|
// This is a temporary solution until we support overriding the caption on the frontend.
|
|
@@ -971,7 +974,11 @@ export default function Image( {
|
|
|
971
974
|
isSelected={ isSingleSelected }
|
|
972
975
|
insertBlocksAfter={ insertBlocksAfter }
|
|
973
976
|
label={ __( 'Image caption text' ) }
|
|
974
|
-
showToolbarButton={
|
|
977
|
+
showToolbarButton={
|
|
978
|
+
isSingleSelected &&
|
|
979
|
+
hasNonContentControls &&
|
|
980
|
+
! arePatternOverridesEnabled
|
|
981
|
+
}
|
|
975
982
|
readOnly={ lockCaption }
|
|
976
983
|
/>
|
|
977
984
|
</>
|
package/src/image/style.scss
CHANGED
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
// Supply caption styles to images, even if the theme hasn't opted in.
|
|
79
79
|
// Reason being: the new markup, <figcaptions>, are not likely to be styled in the majority of existing themes,
|
|
80
80
|
// so we supply the styles so as to not appear broken or unstyled in those themes.
|
|
81
|
-
figcaption {
|
|
81
|
+
:where(figcaption) {
|
|
82
82
|
@include caption-style();
|
|
83
83
|
}
|
|
84
84
|
|
package/src/media-text/index.php
CHANGED
|
@@ -29,28 +29,78 @@ function render_block_core_media_text( $attributes, $content ) {
|
|
|
29
29
|
return $content;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
$
|
|
33
|
-
$
|
|
32
|
+
$media_tag_processor = new WP_HTML_Tag_Processor( $content );
|
|
33
|
+
$wrapping_figure_query = array(
|
|
34
|
+
'tag_name' => 'figure',
|
|
35
|
+
'class_name' => 'wp-block-media-text__media',
|
|
36
|
+
);
|
|
37
|
+
$has_media_on_right = isset( $attributes['mediaPosition'] ) && 'right' === $attributes['mediaPosition'];
|
|
38
|
+
$image_fill = isset( $attributes['imageFill'] ) && $attributes['imageFill'];
|
|
39
|
+
$focal_point = isset( $attributes['focalPoint'] ) ? round( $attributes['focalPoint']['x'] * 100 ) . '% ' . round( $attributes['focalPoint']['y'] * 100 ) . '%' : '50% 50%';
|
|
40
|
+
$unique_id = 'wp-block-media-text__media-' . wp_unique_id();
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
$
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
if ( $has_media_on_right ) {
|
|
43
|
+
// Loop through all the figure tags and set a bookmark on the last figure tag.
|
|
44
|
+
while ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) {
|
|
45
|
+
$media_tag_processor->set_bookmark( 'last_figure' );
|
|
46
|
+
}
|
|
47
|
+
if ( $media_tag_processor->has_bookmark( 'last_figure' ) ) {
|
|
48
|
+
$media_tag_processor->seek( 'last_figure' );
|
|
49
|
+
if ( $image_fill ) {
|
|
50
|
+
$media_tag_processor->set_attribute( 'style', 'background-image:url(' . esc_url( $current_featured_image ) . ');background-position:' . $focal_point . ';' );
|
|
51
|
+
} else {
|
|
52
|
+
// Insert a unique ID to identify the figure tag.
|
|
53
|
+
$media_tag_processor->set_attribute( 'id', $unique_id );
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
if ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) {
|
|
58
|
+
if ( $image_fill ) {
|
|
59
|
+
$media_tag_processor->set_attribute( 'style', 'background-image:url(' . esc_url( $current_featured_image ) . ');background-position:' . $focal_point . ';' );
|
|
60
|
+
} else {
|
|
61
|
+
// Insert a unique ID to identify the figure tag.
|
|
62
|
+
$media_tag_processor->set_attribute( 'id', $unique_id );
|
|
63
|
+
}
|
|
40
64
|
}
|
|
41
|
-
$processor->next_tag( 'figure' );
|
|
42
|
-
$processor->set_attribute( 'style', 'background-image:url(' . esc_url( $current_featured_image ) . ');background-position:' . $position . ';' );
|
|
43
|
-
}
|
|
44
|
-
$processor->next_tag( 'img' );
|
|
45
|
-
$media_size_slug = 'full';
|
|
46
|
-
if ( isset( $attributes['mediaSizeSlug'] ) ) {
|
|
47
|
-
$media_size_slug = $attributes['mediaSizeSlug'];
|
|
48
65
|
}
|
|
49
|
-
$processor->set_attribute( 'src', esc_url( $current_featured_image ) );
|
|
50
|
-
$processor->set_attribute( 'class', 'wp-image-' . get_post_thumbnail_id() . ' size-' . $media_size_slug );
|
|
51
|
-
$processor->set_attribute( 'alt', trim( strip_tags( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) ) );
|
|
52
66
|
|
|
53
|
-
$content = $
|
|
67
|
+
$content = $media_tag_processor->get_updated_html();
|
|
68
|
+
|
|
69
|
+
// If the image is not set to fill, add the image tag inside the figure tag,
|
|
70
|
+
// and update the image attributes in order to display the featured image.
|
|
71
|
+
if ( ! $image_fill ) {
|
|
72
|
+
$media_size_slug = isset( $attributes['mediaSizeSlug'] ) ? $attributes['mediaSizeSlug'] : 'full';
|
|
73
|
+
$image_tag = '<img class="wp-block-media-text__featured_image">';
|
|
74
|
+
$content = preg_replace(
|
|
75
|
+
'/(<figure\s+id="' . preg_quote( $unique_id, '/' ) . '"\s+class="wp-block-media-text__media"\s*>)/',
|
|
76
|
+
'$1' . $image_tag,
|
|
77
|
+
$content
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
$image_tag_processor = new WP_HTML_Tag_Processor( $content );
|
|
81
|
+
if ( $image_tag_processor->next_tag(
|
|
82
|
+
array(
|
|
83
|
+
'tag_name' => 'figure',
|
|
84
|
+
'id' => $unique_id,
|
|
85
|
+
)
|
|
86
|
+
) ) {
|
|
87
|
+
// The ID is only used to ensure that the correct figure tag is selected,
|
|
88
|
+
// and can now be removed.
|
|
89
|
+
$image_tag_processor->remove_attribute( 'id' );
|
|
90
|
+
if ( $image_tag_processor->next_tag(
|
|
91
|
+
array(
|
|
92
|
+
'tag_name' => 'img',
|
|
93
|
+
'class_name' => 'wp-block-media-text__featured_image',
|
|
94
|
+
)
|
|
95
|
+
) ) {
|
|
96
|
+
$image_tag_processor->set_attribute( 'src', esc_url( $current_featured_image ) );
|
|
97
|
+
$image_tag_processor->set_attribute( 'class', 'wp-image-' . get_post_thumbnail_id() . ' size-' . $media_size_slug );
|
|
98
|
+
$image_tag_processor->set_attribute( 'alt', trim( strip_tags( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) ) );
|
|
99
|
+
|
|
100
|
+
$content = $image_tag_processor->get_updated_html();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
54
104
|
|
|
55
105
|
return $content;
|
|
56
106
|
}
|
package/src/navigation/index.php
CHANGED
|
@@ -519,9 +519,11 @@ class WP_Navigation_Block_Renderer {
|
|
|
519
519
|
';
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
+
$overlay_inline_styles = esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) );
|
|
523
|
+
|
|
522
524
|
return sprintf(
|
|
523
525
|
'<button aria-haspopup="dialog" %3$s class="%6$s" %10$s>%8$s</button>
|
|
524
|
-
<div class="%5$s"
|
|
526
|
+
<div class="%5$s" %7$s id="%1$s" %11$s>
|
|
525
527
|
<div class="wp-block-navigation__responsive-close" tabindex="-1">
|
|
526
528
|
<div class="wp-block-navigation__responsive-dialog" %12$s>
|
|
527
529
|
<button %4$s class="wp-block-navigation__responsive-container-close" %13$s>%9$s</button>
|
|
@@ -537,7 +539,7 @@ class WP_Navigation_Block_Renderer {
|
|
|
537
539
|
$toggle_aria_label_close,
|
|
538
540
|
esc_attr( implode( ' ', $responsive_container_classes ) ),
|
|
539
541
|
esc_attr( implode( ' ', $open_button_classes ) ),
|
|
540
|
-
|
|
542
|
+
( ! empty( $overlay_inline_styles ) ) ? "style=\"$overlay_inline_styles\"" : '',
|
|
541
543
|
$toggle_button_content,
|
|
542
544
|
$toggle_close_button_content,
|
|
543
545
|
$open_button_directives,
|
|
@@ -826,7 +828,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
|
|
|
826
828
|
$tags->set_attribute( 'data-wp-interactive', 'core/navigation' );
|
|
827
829
|
$tags->set_attribute( 'data-wp-context', '{ "submenuOpenedBy": { "click": false, "hover": false, "focus": false }, "type": "submenu" }' );
|
|
828
830
|
$tags->set_attribute( 'data-wp-watch', 'callbacks.initMenu' );
|
|
829
|
-
$tags->set_attribute( 'data-wp-on
|
|
831
|
+
$tags->set_attribute( 'data-wp-on--focusout', 'actions.handleMenuFocusout' );
|
|
830
832
|
$tags->set_attribute( 'data-wp-on--keydown', 'actions.handleMenuKeydown' );
|
|
831
833
|
|
|
832
834
|
// This is a fix for Safari. Without it, Safari doesn't change the active
|
package/src/reset.scss
CHANGED
|
@@ -8,19 +8,18 @@
|
|
|
8
8
|
// We use :where to keep specificity minimal.
|
|
9
9
|
// https://css-tricks.com/almanac/selectors/w/where/
|
|
10
10
|
:where(.editor-styles-wrapper) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
line-height: initial;
|
|
18
|
-
color: initial;
|
|
11
|
+
// The following styles revert to the browser defaults overriding the WPAdmin styles.
|
|
12
|
+
html & {
|
|
13
|
+
font-family: serif; // unfortunately initial doesn't work for font-family.
|
|
14
|
+
font-size: initial;
|
|
15
|
+
line-height: initial;
|
|
16
|
+
color: initial;
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
// Many themes with white backgrounds load editor styles but fail to also provide
|
|
19
|
+
// an explicit white background color, assuming a white editing canvas.
|
|
20
|
+
// So to match browser defaults, we provide a white default here as well.
|
|
21
|
+
background: #fff;
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
.wp-align-wrapper {
|
|
26
25
|
max-width: $content-width;
|
package/src/table/theme.scss
CHANGED
package/src/video/style.scss
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// Supply caption styles to videos, even if the theme hasn't opted in.
|
|
20
20
|
// Reason being: the new markup, <figcaptions>, are not likely to be styled in the majority of existing themes,
|
|
21
21
|
// so we supply the styles so as to not appear broken or unstyled in those themes.
|
|
22
|
-
figcaption {
|
|
22
|
+
:where(figcaption) {
|
|
23
23
|
@include caption-style();
|
|
24
24
|
}
|
|
25
25
|
}
|
package/src/video/theme.scss
CHANGED