@wordpress/block-library 6.0.13 → 6.0.14
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 +30 -6
- package/build/image/image.js.map +1 -1
- package/build/navigation/edit/index.js +11 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +7 -1
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +4 -1
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/view.js +2 -2
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/post-comments/index.js +1 -1
- package/build-module/image/image.js +31 -7
- package/build-module/image/image.js.map +1 -1
- package/build-module/navigation/edit/index.js +10 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +6 -1
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +3 -1
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/view.js +2 -2
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/post-comments/index.js +1 -1
- package/build-style/editor-rtl.css +25 -0
- package/build-style/editor.css +25 -0
- package/build-style/image/editor-rtl.css +16 -0
- package/build-style/image/editor.css +16 -0
- package/build-style/navigation/editor-rtl.css +9 -0
- package/build-style/navigation/editor.css +9 -0
- package/build-style/post-comments/style-rtl.css +3 -1
- package/build-style/post-comments/style.css +3 -1
- package/build-style/post-comments-form/style-rtl.css +2 -2
- package/build-style/post-comments-form/style.css +2 -2
- package/build-style/style-rtl.css +5 -3
- package/build-style/style.css +5 -3
- package/package.json +7 -7
- package/src/gallery/index.php +7 -8
- package/src/image/editor.scss +18 -0
- package/src/image/image.js +32 -8
- package/src/image/index.php +1 -1
- package/src/navigation/edit/index.js +14 -6
- package/src/navigation/edit/navigation-menu-selector.js +8 -0
- package/src/navigation/editor.scss +12 -0
- package/src/navigation/menu-items-to-blocks.js +7 -1
- package/src/navigation/view.js +2 -2
- package/src/navigation-submenu/edit.js +1 -1
- package/src/post-comments/block.json +5 -1
- package/src/post-comments/index.php +15 -0
- package/src/post-comments/style.scss +7 -3
- package/src/post-comments-form/style.scss +7 -5
|
@@ -1005,6 +1005,22 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1005
1005
|
caption-side: bottom;
|
|
1006
1006
|
}
|
|
1007
1007
|
|
|
1008
|
+
*:not([data-align]) > .wp-block-image {
|
|
1009
|
+
display: grid;
|
|
1010
|
+
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
|
1011
|
+
}
|
|
1012
|
+
*:not([data-align]) > .wp-block-image .components-placeholder {
|
|
1013
|
+
grid-column: placeholder;
|
|
1014
|
+
}
|
|
1015
|
+
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
|
1016
|
+
grid-column: image;
|
|
1017
|
+
}
|
|
1018
|
+
*:not([data-align]) > .wp-block-image > figcaption {
|
|
1019
|
+
grid-column: image;
|
|
1020
|
+
display: table-caption;
|
|
1021
|
+
caption-side: bottom;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1008
1024
|
.wp-block[data-align=left] > .wp-block-image {
|
|
1009
1025
|
margin-left: 1em;
|
|
1010
1026
|
margin-right: 0;
|
|
@@ -1219,6 +1235,15 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1219
1235
|
visibility: visible;
|
|
1220
1236
|
}
|
|
1221
1237
|
|
|
1238
|
+
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
|
1239
|
+
display: block;
|
|
1240
|
+
position: static;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
.wp-block-navigation__submenu-container .block-list-appender {
|
|
1244
|
+
display: none;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1222
1247
|
/**
|
|
1223
1248
|
* Colors Selector component
|
|
1224
1249
|
*/
|
package/build-style/editor.css
CHANGED
|
@@ -1010,6 +1010,22 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1010
1010
|
caption-side: bottom;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
+
*:not([data-align]) > .wp-block-image {
|
|
1014
|
+
display: grid;
|
|
1015
|
+
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
|
1016
|
+
}
|
|
1017
|
+
*:not([data-align]) > .wp-block-image .components-placeholder {
|
|
1018
|
+
grid-column: placeholder;
|
|
1019
|
+
}
|
|
1020
|
+
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
|
1021
|
+
grid-column: image;
|
|
1022
|
+
}
|
|
1023
|
+
*:not([data-align]) > .wp-block-image > figcaption {
|
|
1024
|
+
grid-column: image;
|
|
1025
|
+
display: table-caption;
|
|
1026
|
+
caption-side: bottom;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1013
1029
|
.wp-block[data-align=left] > .wp-block-image {
|
|
1014
1030
|
margin-right: 1em;
|
|
1015
1031
|
margin-left: 0;
|
|
@@ -1224,6 +1240,15 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1224
1240
|
visibility: visible;
|
|
1225
1241
|
}
|
|
1226
1242
|
|
|
1243
|
+
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
|
1244
|
+
display: block;
|
|
1245
|
+
position: static;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
.wp-block-navigation__submenu-container .block-list-appender {
|
|
1249
|
+
display: none;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1227
1252
|
/**
|
|
1228
1253
|
* Colors Selector component
|
|
1229
1254
|
*/
|
|
@@ -137,6 +137,22 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
137
137
|
caption-side: bottom;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
*:not([data-align]) > .wp-block-image {
|
|
141
|
+
display: grid;
|
|
142
|
+
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
|
143
|
+
}
|
|
144
|
+
*:not([data-align]) > .wp-block-image .components-placeholder {
|
|
145
|
+
grid-column: placeholder;
|
|
146
|
+
}
|
|
147
|
+
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
|
148
|
+
grid-column: image;
|
|
149
|
+
}
|
|
150
|
+
*:not([data-align]) > .wp-block-image > figcaption {
|
|
151
|
+
grid-column: image;
|
|
152
|
+
display: table-caption;
|
|
153
|
+
caption-side: bottom;
|
|
154
|
+
}
|
|
155
|
+
|
|
140
156
|
.wp-block[data-align=left] > .wp-block-image {
|
|
141
157
|
margin-left: 1em;
|
|
142
158
|
margin-right: 0;
|
|
@@ -137,6 +137,22 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
137
137
|
caption-side: bottom;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
*:not([data-align]) > .wp-block-image {
|
|
141
|
+
display: grid;
|
|
142
|
+
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
|
143
|
+
}
|
|
144
|
+
*:not([data-align]) > .wp-block-image .components-placeholder {
|
|
145
|
+
grid-column: placeholder;
|
|
146
|
+
}
|
|
147
|
+
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
|
148
|
+
grid-column: image;
|
|
149
|
+
}
|
|
150
|
+
*:not([data-align]) > .wp-block-image > figcaption {
|
|
151
|
+
grid-column: image;
|
|
152
|
+
display: table-caption;
|
|
153
|
+
caption-side: bottom;
|
|
154
|
+
}
|
|
155
|
+
|
|
140
156
|
.wp-block[data-align=left] > .wp-block-image {
|
|
141
157
|
margin-right: 1em;
|
|
142
158
|
margin-left: 0;
|
|
@@ -137,6 +137,15 @@
|
|
|
137
137
|
visibility: visible;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
|
141
|
+
display: block;
|
|
142
|
+
position: static;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.wp-block-navigation__submenu-container .block-list-appender {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
140
149
|
/**
|
|
141
150
|
* Colors Selector component
|
|
142
151
|
*/
|
|
@@ -137,6 +137,15 @@
|
|
|
137
137
|
visibility: visible;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
|
141
|
+
display: block;
|
|
142
|
+
position: static;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.wp-block-navigation__submenu-container .block-list-appender {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
140
149
|
/**
|
|
141
150
|
* Colors Selector component
|
|
142
151
|
*/
|
|
@@ -125,7 +125,9 @@
|
|
|
125
125
|
display: block;
|
|
126
126
|
margin-bottom: 0.25em;
|
|
127
127
|
}
|
|
128
|
-
.wp-block-post-comments .comment-form
|
|
128
|
+
.wp-block-post-comments .comment-form textarea,
|
|
129
|
+
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
130
|
+
display: block;
|
|
129
131
|
box-sizing: border-box;
|
|
130
132
|
width: 100%;
|
|
131
133
|
}
|
|
@@ -125,7 +125,9 @@
|
|
|
125
125
|
display: block;
|
|
126
126
|
margin-bottom: 0.25em;
|
|
127
127
|
}
|
|
128
|
-
.wp-block-post-comments .comment-form
|
|
128
|
+
.wp-block-post-comments .comment-form textarea,
|
|
129
|
+
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
130
|
+
display: block;
|
|
129
131
|
box-sizing: border-box;
|
|
130
132
|
width: 100%;
|
|
131
133
|
}
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
|
|
111
111
|
padding: calc(0.667em + 2px);
|
|
112
112
|
}
|
|
113
|
-
.wp-block-post-comments-form .comment-form
|
|
113
|
+
.wp-block-post-comments-form .comment-form textarea,
|
|
114
|
+
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
114
115
|
display: block;
|
|
115
116
|
box-sizing: border-box;
|
|
116
117
|
width: 100%;
|
|
117
118
|
}
|
|
118
|
-
.wp-block-post-comments-form .comment-form-comment label,
|
|
119
119
|
.wp-block-post-comments-form .comment-form-author label,
|
|
120
120
|
.wp-block-post-comments-form .comment-form-email label,
|
|
121
121
|
.wp-block-post-comments-form .comment-form-url label {
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
|
|
111
111
|
padding: calc(0.667em + 2px);
|
|
112
112
|
}
|
|
113
|
-
.wp-block-post-comments-form .comment-form
|
|
113
|
+
.wp-block-post-comments-form .comment-form textarea,
|
|
114
|
+
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
114
115
|
display: block;
|
|
115
116
|
box-sizing: border-box;
|
|
116
117
|
width: 100%;
|
|
117
118
|
}
|
|
118
|
-
.wp-block-post-comments-form .comment-form-comment label,
|
|
119
119
|
.wp-block-post-comments-form .comment-form-author label,
|
|
120
120
|
.wp-block-post-comments-form .comment-form-email label,
|
|
121
121
|
.wp-block-post-comments-form .comment-form-url label {
|
|
@@ -2055,7 +2055,9 @@ p.has-background {
|
|
|
2055
2055
|
display: block;
|
|
2056
2056
|
margin-bottom: 0.25em;
|
|
2057
2057
|
}
|
|
2058
|
-
.wp-block-post-comments .comment-form
|
|
2058
|
+
.wp-block-post-comments .comment-form textarea,
|
|
2059
|
+
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
2060
|
+
display: block;
|
|
2059
2061
|
box-sizing: border-box;
|
|
2060
2062
|
width: 100%;
|
|
2061
2063
|
}
|
|
@@ -2120,12 +2122,12 @@ p.has-background {
|
|
|
2120
2122
|
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
|
|
2121
2123
|
padding: calc(0.667em + 2px);
|
|
2122
2124
|
}
|
|
2123
|
-
.wp-block-post-comments-form .comment-form
|
|
2125
|
+
.wp-block-post-comments-form .comment-form textarea,
|
|
2126
|
+
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
2124
2127
|
display: block;
|
|
2125
2128
|
box-sizing: border-box;
|
|
2126
2129
|
width: 100%;
|
|
2127
2130
|
}
|
|
2128
|
-
.wp-block-post-comments-form .comment-form-comment label,
|
|
2129
2131
|
.wp-block-post-comments-form .comment-form-author label,
|
|
2130
2132
|
.wp-block-post-comments-form .comment-form-email label,
|
|
2131
2133
|
.wp-block-post-comments-form .comment-form-url label {
|
package/build-style/style.css
CHANGED
|
@@ -2077,7 +2077,9 @@ p.has-background {
|
|
|
2077
2077
|
display: block;
|
|
2078
2078
|
margin-bottom: 0.25em;
|
|
2079
2079
|
}
|
|
2080
|
-
.wp-block-post-comments .comment-form
|
|
2080
|
+
.wp-block-post-comments .comment-form textarea,
|
|
2081
|
+
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
2082
|
+
display: block;
|
|
2081
2083
|
box-sizing: border-box;
|
|
2082
2084
|
width: 100%;
|
|
2083
2085
|
}
|
|
@@ -2142,12 +2144,12 @@ p.has-background {
|
|
|
2142
2144
|
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
|
|
2143
2145
|
padding: calc(0.667em + 2px);
|
|
2144
2146
|
}
|
|
2145
|
-
.wp-block-post-comments-form .comment-form
|
|
2147
|
+
.wp-block-post-comments-form .comment-form textarea,
|
|
2148
|
+
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) {
|
|
2146
2149
|
display: block;
|
|
2147
2150
|
box-sizing: border-box;
|
|
2148
2151
|
width: 100%;
|
|
2149
2152
|
}
|
|
2150
|
-
.wp-block-post-comments-form .comment-form-comment label,
|
|
2151
2153
|
.wp-block-post-comments-form .comment-form-author label,
|
|
2152
2154
|
.wp-block-post-comments-form .comment-form-email label,
|
|
2153
2155
|
.wp-block-post-comments-form .comment-form-url label {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.14",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@wordpress/api-fetch": "^5.2.6",
|
|
38
38
|
"@wordpress/autop": "^3.2.3",
|
|
39
39
|
"@wordpress/blob": "^3.2.2",
|
|
40
|
-
"@wordpress/block-editor": "^8.0.
|
|
40
|
+
"@wordpress/block-editor": "^8.0.10",
|
|
41
41
|
"@wordpress/blocks": "^11.1.4",
|
|
42
|
-
"@wordpress/components": "^19.1.
|
|
42
|
+
"@wordpress/components": "^19.1.4",
|
|
43
43
|
"@wordpress/compose": "^5.0.6",
|
|
44
44
|
"@wordpress/core-data": "^4.0.8",
|
|
45
45
|
"@wordpress/data": "^6.1.4",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"@wordpress/html-entities": "^3.2.3",
|
|
53
53
|
"@wordpress/i18n": "^4.2.4",
|
|
54
54
|
"@wordpress/icons": "^6.1.1",
|
|
55
|
-
"@wordpress/interface": "^4.1.
|
|
55
|
+
"@wordpress/interface": "^4.1.12",
|
|
56
56
|
"@wordpress/is-shallow-equal": "^4.2.1",
|
|
57
57
|
"@wordpress/keycodes": "^3.2.4",
|
|
58
58
|
"@wordpress/notices": "^3.2.7",
|
|
59
59
|
"@wordpress/primitives": "^3.0.4",
|
|
60
|
-
"@wordpress/reusable-blocks": "^3.0.
|
|
60
|
+
"@wordpress/reusable-blocks": "^3.0.16",
|
|
61
61
|
"@wordpress/rich-text": "^5.0.6",
|
|
62
|
-
"@wordpress/server-side-render": "^3.0.
|
|
62
|
+
"@wordpress/server-side-render": "^3.0.14",
|
|
63
63
|
"@wordpress/url": "^3.3.1",
|
|
64
64
|
"@wordpress/viewport": "^4.0.6",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "3826b68f8c5b5026b318463af647f6fb19b534d2"
|
|
77
77
|
}
|
package/src/gallery/index.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
/**
|
|
3
|
-
* Server-side rendering of the `core/
|
|
3
|
+
* Server-side rendering of the `core/gallery` block.
|
|
4
4
|
*
|
|
5
5
|
* @package WordPress
|
|
6
6
|
*/
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
* we add a custom `data-id` attribute before rendering the gallery
|
|
14
14
|
* so that the Image Block can pick it up in its render_callback.
|
|
15
15
|
*
|
|
16
|
-
* @param
|
|
17
|
-
*
|
|
18
|
-
* @return array The migrated block object.
|
|
16
|
+
* @param array $parsed_block The block being rendered.
|
|
17
|
+
* @return array The migrated block object.
|
|
19
18
|
*/
|
|
20
|
-
function
|
|
19
|
+
function block_core_gallery_data_id_backcompatibility( $parsed_block ) {
|
|
21
20
|
if ( 'core/gallery' === $parsed_block['blockName'] ) {
|
|
22
21
|
foreach ( $parsed_block['innerBlocks'] as $key => $inner_block ) {
|
|
23
22
|
if ( 'core/image' === $inner_block['blockName'] ) {
|
|
@@ -31,14 +30,14 @@ function render_block_core_gallery_data( $parsed_block ) {
|
|
|
31
30
|
return $parsed_block;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
add_filter( 'render_block_data', '
|
|
33
|
+
add_filter( 'render_block_data', 'block_core_gallery_data_id_backcompatibility' );
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* Registers the `core/gallery` block on server.
|
|
38
37
|
* This render callback needs to be here
|
|
39
38
|
* so that the gallery styles are loaded in block-based themes.
|
|
40
39
|
*/
|
|
41
|
-
function
|
|
40
|
+
function register_block_core_gallery() {
|
|
42
41
|
register_block_type_from_metadata(
|
|
43
42
|
__DIR__ . '/gallery',
|
|
44
43
|
array(
|
|
@@ -49,4 +48,4 @@ function gutenberg_register_block_core_gallery() {
|
|
|
49
48
|
);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
add_action( 'init', '
|
|
51
|
+
add_action( 'init', 'register_block_core_gallery', 20 );
|
package/src/image/editor.scss
CHANGED
|
@@ -70,6 +70,24 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
*:not([data-align]) {
|
|
74
|
+
> .wp-block-image {
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
|
77
|
+
.components-placeholder {
|
|
78
|
+
grid-column: placeholder;
|
|
79
|
+
}
|
|
80
|
+
> div:not(.components-placeholder) {
|
|
81
|
+
grid-column: image;
|
|
82
|
+
}
|
|
83
|
+
> figcaption {
|
|
84
|
+
grid-column: image;
|
|
85
|
+
display: table-caption;
|
|
86
|
+
caption-side: bottom;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
73
91
|
.wp-block[data-align="left"] > .wp-block-image {
|
|
74
92
|
margin-right: 1em;
|
|
75
93
|
margin-left: 0;
|
package/src/image/image.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
__experimentalImageEditor as ImageEditor,
|
|
31
31
|
__experimentalImageEditingProvider as ImageEditingProvider,
|
|
32
32
|
} from '@wordpress/block-editor';
|
|
33
|
-
import { useEffect, useState, useRef } from '@wordpress/element';
|
|
33
|
+
import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
|
|
34
34
|
import { __, sprintf, isRTL } from '@wordpress/i18n';
|
|
35
35
|
import { getFilename } from '@wordpress/url';
|
|
36
36
|
import { createBlock, switchToBlockType } from '@wordpress/blocks';
|
|
@@ -79,6 +79,7 @@ export default function Image( {
|
|
|
79
79
|
context,
|
|
80
80
|
clientId,
|
|
81
81
|
} ) {
|
|
82
|
+
const imageRef = useRef();
|
|
82
83
|
const captionRef = useRef();
|
|
83
84
|
const prevUrl = usePrevious( url );
|
|
84
85
|
const { allowResize = true } = context;
|
|
@@ -141,7 +142,10 @@ export default function Image( {
|
|
|
141
142
|
);
|
|
142
143
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
143
144
|
const isWideAligned = includes( [ 'wide', 'full' ], align );
|
|
144
|
-
const [
|
|
145
|
+
const [
|
|
146
|
+
{ loadedNaturalWidth, loadedNaturalHeight },
|
|
147
|
+
setLoadedNaturalSize,
|
|
148
|
+
] = useState( {} );
|
|
145
149
|
const [ isEditingImage, setIsEditingImage ] = useState( false );
|
|
146
150
|
const [ externalBlob, setExternalBlob ] = useState();
|
|
147
151
|
const clientWidth = useClientWidth( containerRef, [ align ] );
|
|
@@ -179,6 +183,27 @@ export default function Image( {
|
|
|
179
183
|
}
|
|
180
184
|
}, [ url, prevUrl ] );
|
|
181
185
|
|
|
186
|
+
// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
|
|
187
|
+
// width and height. This resolves an issue in Safari where the loaded natural
|
|
188
|
+
// witdth and height is otherwise lost when switching between alignments.
|
|
189
|
+
// See: https://github.com/WordPress/gutenberg/pull/37210.
|
|
190
|
+
const { naturalWidth, naturalHeight } = useMemo( () => {
|
|
191
|
+
return {
|
|
192
|
+
naturalWidth:
|
|
193
|
+
imageRef.current?.naturalWidth ||
|
|
194
|
+
loadedNaturalWidth ||
|
|
195
|
+
undefined,
|
|
196
|
+
naturalHeight:
|
|
197
|
+
imageRef.current?.naturalHeight ||
|
|
198
|
+
loadedNaturalHeight ||
|
|
199
|
+
undefined,
|
|
200
|
+
};
|
|
201
|
+
}, [
|
|
202
|
+
loadedNaturalWidth,
|
|
203
|
+
loadedNaturalHeight,
|
|
204
|
+
imageRef.current?.complete,
|
|
205
|
+
] );
|
|
206
|
+
|
|
182
207
|
function onResizeStart() {
|
|
183
208
|
toggleSelection( false );
|
|
184
209
|
}
|
|
@@ -411,13 +436,12 @@ export default function Image( {
|
|
|
411
436
|
alt={ defaultedAlt }
|
|
412
437
|
onError={ () => onImageError() }
|
|
413
438
|
onLoad={ ( event ) => {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
] )
|
|
419
|
-
);
|
|
439
|
+
setLoadedNaturalSize( {
|
|
440
|
+
loadedNaturalWidth: event.target?.naturalWidth,
|
|
441
|
+
loadedNaturalHeight: event.target?.naturalHeight,
|
|
442
|
+
} );
|
|
420
443
|
} }
|
|
444
|
+
ref={ imageRef }
|
|
421
445
|
/>
|
|
422
446
|
{ temporaryURL && <Spinner /> }
|
|
423
447
|
</>
|
package/src/image/index.php
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @param array $attributes The block attributes.
|
|
13
13
|
* @param array $content The block content.
|
|
14
|
-
* @return string
|
|
14
|
+
* @return string Returns the block content with the data-id attribute added.
|
|
15
15
|
*/
|
|
16
16
|
function render_block_core_image( $attributes, $content ) {
|
|
17
17
|
if ( isset( $attributes['data-id'] ) ) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
+
import noop from 'lodash';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -109,12 +110,19 @@ function Navigation( {
|
|
|
109
110
|
layout: { justifyContent, orientation = 'horizontal' } = {},
|
|
110
111
|
} = attributes;
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
let areaMenu,
|
|
114
|
+
setAreaMenu = noop;
|
|
115
|
+
// Navigation areas are deprecated and on their way out. Let's not perform
|
|
116
|
+
// the request unless we're in an environment where the endpoint exists.
|
|
117
|
+
if ( process.env.GUTENBERG_PHASE === 2 ) {
|
|
118
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
119
|
+
[ areaMenu, setAreaMenu ] = useEntityProp(
|
|
120
|
+
'root',
|
|
121
|
+
'navigationArea',
|
|
122
|
+
'navigation',
|
|
123
|
+
navigationArea
|
|
124
|
+
);
|
|
125
|
+
}
|
|
118
126
|
|
|
119
127
|
const navigationAreaMenu = areaMenu === 0 ? undefined : areaMenu;
|
|
120
128
|
|
|
@@ -5,6 +5,7 @@ import { MenuGroup, MenuItem, MenuItemsChoice } from '@wordpress/components';
|
|
|
5
5
|
import { useEntityId } from '@wordpress/core-data';
|
|
6
6
|
import { __, sprintf } from '@wordpress/i18n';
|
|
7
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
@@ -45,6 +46,13 @@ export default function NavigationMenuSelector( { onSelect, onCreateNew } ) {
|
|
|
45
46
|
<MenuItem onClick={ onCreateNew }>
|
|
46
47
|
{ __( 'Create new menu' ) }
|
|
47
48
|
</MenuItem>
|
|
49
|
+
<MenuItem
|
|
50
|
+
href={ addQueryArgs( 'edit.php', {
|
|
51
|
+
post_type: 'wp_navigation',
|
|
52
|
+
} ) }
|
|
53
|
+
>
|
|
54
|
+
{ __( 'Manage menus' ) }
|
|
55
|
+
</MenuItem>
|
|
48
56
|
</MenuGroup>
|
|
49
57
|
</>
|
|
50
58
|
);
|
|
@@ -96,6 +96,18 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
// Show even when a child is selected. This is an edgecase just for navigation submenus.
|
|
100
|
+
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
|
101
|
+
display: block;
|
|
102
|
+
position: static;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Hide when hovering.
|
|
106
|
+
.wp-block-navigation__submenu-container .block-list-appender {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
99
111
|
/**
|
|
100
112
|
* Colors Selector component
|
|
101
113
|
*/
|
|
@@ -7,6 +7,7 @@ import { sortBy } from 'lodash';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { createBlock, parse } from '@wordpress/blocks';
|
|
10
|
+
import { applyFilters } from '@wordpress/hooks';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Convert a flat menu item structure to a nested blocks structure.
|
|
@@ -21,7 +22,12 @@ export default function menuItemsToBlocks( menuItems ) {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const menuTree = createDataTree( menuItems );
|
|
24
|
-
|
|
25
|
+
const blocks = mapMenuItemsToBlocks( menuTree );
|
|
26
|
+
return applyFilters(
|
|
27
|
+
'blocks.navigation.__unstableMenuItemsToBlocks',
|
|
28
|
+
blocks,
|
|
29
|
+
menuItems
|
|
30
|
+
);
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
/**
|
package/src/navigation/view.js
CHANGED
|
@@ -58,7 +58,7 @@ function toggleSubmenuOnClick( event ) {
|
|
|
58
58
|
|
|
59
59
|
// Necessary for some themes such as TT1 Blocks, where
|
|
60
60
|
// scripts could be loaded before the body.
|
|
61
|
-
window.
|
|
61
|
+
window.addEventListener( 'load', () => {
|
|
62
62
|
MicroModal.init( {
|
|
63
63
|
onShow: navigationToggleModal,
|
|
64
64
|
onClose: navigationToggleModal,
|
|
@@ -95,4 +95,4 @@ window.onload = () => {
|
|
|
95
95
|
}
|
|
96
96
|
} );
|
|
97
97
|
} );
|
|
98
|
-
};
|
|
98
|
+
} );
|
|
@@ -520,7 +520,7 @@ export default function NavigationSubmenuEdit( {
|
|
|
520
520
|
! selectedBlockHasDescendants ) ||
|
|
521
521
|
// Show the appender while dragging to allow inserting element between item and the appender.
|
|
522
522
|
hasDescendants
|
|
523
|
-
? InnerBlocks.
|
|
523
|
+
? InnerBlocks.ButtonBlockAppender
|
|
524
524
|
: false,
|
|
525
525
|
}
|
|
526
526
|
);
|
|
@@ -66,3 +66,18 @@ function register_block_core_post_comments() {
|
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
add_action( 'init', 'register_block_core_post_comments' );
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Use the button block classes for the form-submit button.
|
|
72
|
+
*
|
|
73
|
+
* @param array $fields The default comment form arguments.
|
|
74
|
+
*
|
|
75
|
+
* @return array Returns the modified fields.
|
|
76
|
+
*/
|
|
77
|
+
function gutenberg_post_comments_block_form_defaults( $fields ) {
|
|
78
|
+
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
|
|
79
|
+
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
|
|
80
|
+
|
|
81
|
+
return $fields;
|
|
82
|
+
}
|
|
83
|
+
add_filter( 'comment_form_defaults', 'gutenberg_post_comments_block_form_defaults' );
|
|
@@ -64,9 +64,13 @@
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.comment-form
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
.comment-form {
|
|
68
|
+
textarea,
|
|
69
|
+
input:not([type="submit"]):not([type="checkbox"]) {
|
|
70
|
+
display: block;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
.comment-form-cookies-consent {
|
|
@@ -41,13 +41,15 @@
|
|
|
41
41
|
padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.comment-form
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
.comment-form {
|
|
45
|
+
textarea,
|
|
46
|
+
input:not([type="submit"]):not([type="checkbox"]) {
|
|
47
|
+
display: block;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
.comment-form-comment,
|
|
51
53
|
.comment-form-author,
|
|
52
54
|
.comment-form-email,
|
|
53
55
|
.comment-form-url {
|