@wordpress/block-library 8.19.2 → 8.19.3
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 +1 -1
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +128 -27
- package/build/image/view.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/search/edit.js +12 -10
- package/build/search/edit.js.map +1 -1
- package/build-module/image/image.js +1 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +128 -27
- package/build-module/image/view.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -1
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/search/edit.js +12 -10
- package/build-module/search/edit.js.map +1 -1
- package/build-style/image/style-rtl.css +2 -6
- package/build-style/image/style.css +2 -6
- package/build-style/navigation-link/style-rtl.css +0 -1
- package/build-style/navigation-link/style.css +0 -1
- package/build-style/style-rtl.css +2 -7
- package/build-style/style.css +2 -7
- package/package.json +32 -32
- package/src/footnotes/index.php +13 -179
- package/src/image/image.js +1 -1
- package/src/image/index.php +9 -2
- package/src/image/style.scss +2 -6
- package/src/image/view.js +137 -44
- package/src/navigation-link/style.scss +0 -1
- package/src/paragraph/edit.js +1 -1
- package/src/search/edit.js +16 -10
|
@@ -231,8 +231,8 @@
|
|
|
231
231
|
}
|
|
232
232
|
.wp-lightbox-overlay .close-button {
|
|
233
233
|
position: absolute;
|
|
234
|
-
top: calc(env(safe-area-inset-top) +
|
|
235
|
-
left: calc(env(safe-area-inset-left) +
|
|
234
|
+
top: calc(env(safe-area-inset-top) + 20px);
|
|
235
|
+
left: calc(env(safe-area-inset-left) + 20px);
|
|
236
236
|
padding: 0;
|
|
237
237
|
cursor: pointer;
|
|
238
238
|
z-index: 5000000;
|
|
@@ -323,10 +323,6 @@
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
html.wp-has-lightbox-open {
|
|
327
|
-
overflow: hidden;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
326
|
@keyframes turn-on-visibility {
|
|
331
327
|
0% {
|
|
332
328
|
opacity: 0;
|
|
@@ -237,8 +237,8 @@
|
|
|
237
237
|
}
|
|
238
238
|
.wp-lightbox-overlay .close-button {
|
|
239
239
|
position: absolute;
|
|
240
|
-
top: calc(env(safe-area-inset-top) +
|
|
241
|
-
right: calc(env(safe-area-inset-right) +
|
|
240
|
+
top: calc(env(safe-area-inset-top) + 20px);
|
|
241
|
+
right: calc(env(safe-area-inset-right) + 20px);
|
|
242
242
|
padding: 0;
|
|
243
243
|
cursor: pointer;
|
|
244
244
|
z-index: 5000000;
|
|
@@ -329,10 +329,6 @@
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
html.wp-has-lightbox-open {
|
|
333
|
-
overflow: hidden;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
332
|
@keyframes turn-on-visibility {
|
|
337
333
|
0% {
|
|
338
334
|
opacity: 0;
|
|
@@ -1644,8 +1644,8 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
.wp-lightbox-overlay .close-button {
|
|
1646
1646
|
position: absolute;
|
|
1647
|
-
top: calc(env(safe-area-inset-top) +
|
|
1648
|
-
left: calc(env(safe-area-inset-left) +
|
|
1647
|
+
top: calc(env(safe-area-inset-top) + 20px);
|
|
1648
|
+
left: calc(env(safe-area-inset-left) + 20px);
|
|
1649
1649
|
padding: 0;
|
|
1650
1650
|
cursor: pointer;
|
|
1651
1651
|
z-index: 5000000;
|
|
@@ -1736,10 +1736,6 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
1738
|
|
|
1739
|
-
html.wp-has-lightbox-open {
|
|
1740
|
-
overflow: hidden;
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
1739
|
@keyframes turn-on-visibility {
|
|
1744
1740
|
0% {
|
|
1745
1741
|
opacity: 0;
|
|
@@ -2568,7 +2564,6 @@ html.has-modal-open {
|
|
|
2568
2564
|
}
|
|
2569
2565
|
|
|
2570
2566
|
.wp-block-navigation .wp-block-navigation-item__label {
|
|
2571
|
-
word-break: normal;
|
|
2572
2567
|
overflow-wrap: break-word;
|
|
2573
2568
|
}
|
|
2574
2569
|
.wp-block-navigation .wp-block-navigation-item__description {
|
package/build-style/style.css
CHANGED
|
@@ -1658,8 +1658,8 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1658
1658
|
}
|
|
1659
1659
|
.wp-lightbox-overlay .close-button {
|
|
1660
1660
|
position: absolute;
|
|
1661
|
-
top: calc(env(safe-area-inset-top) +
|
|
1662
|
-
right: calc(env(safe-area-inset-right) +
|
|
1661
|
+
top: calc(env(safe-area-inset-top) + 20px);
|
|
1662
|
+
right: calc(env(safe-area-inset-right) + 20px);
|
|
1663
1663
|
padding: 0;
|
|
1664
1664
|
cursor: pointer;
|
|
1665
1665
|
z-index: 5000000;
|
|
@@ -1750,10 +1750,6 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
|
|
1753
|
-
html.wp-has-lightbox-open {
|
|
1754
|
-
overflow: hidden;
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
1753
|
@keyframes turn-on-visibility {
|
|
1758
1754
|
0% {
|
|
1759
1755
|
opacity: 0;
|
|
@@ -2598,7 +2594,6 @@ html.has-modal-open {
|
|
|
2598
2594
|
}
|
|
2599
2595
|
|
|
2600
2596
|
.wp-block-navigation .wp-block-navigation-item__label {
|
|
2601
|
-
word-break: normal;
|
|
2602
2597
|
overflow-wrap: break-word;
|
|
2603
2598
|
}
|
|
2604
2599
|
.wp-block-navigation .wp-block-navigation-item__description {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.19.
|
|
3
|
+
"version": "8.19.3",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,36 +31,36 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.42.
|
|
35
|
-
"@wordpress/api-fetch": "^6.39.
|
|
36
|
-
"@wordpress/autop": "^3.42.
|
|
37
|
-
"@wordpress/blob": "^3.42.
|
|
38
|
-
"@wordpress/block-editor": "^12.10.
|
|
39
|
-
"@wordpress/blocks": "^12.19.
|
|
40
|
-
"@wordpress/components": "^25.8.
|
|
41
|
-
"@wordpress/compose": "^6.19.
|
|
42
|
-
"@wordpress/core-data": "^6.19.
|
|
43
|
-
"@wordpress/data": "^9.12.
|
|
44
|
-
"@wordpress/date": "^4.42.
|
|
45
|
-
"@wordpress/deprecated": "^3.42.
|
|
46
|
-
"@wordpress/dom": "^3.42.
|
|
47
|
-
"@wordpress/element": "^5.19.
|
|
48
|
-
"@wordpress/escape-html": "^2.42.
|
|
49
|
-
"@wordpress/hooks": "^3.42.
|
|
50
|
-
"@wordpress/html-entities": "^3.42.
|
|
51
|
-
"@wordpress/i18n": "^4.42.
|
|
52
|
-
"@wordpress/icons": "^9.33.
|
|
53
|
-
"@wordpress/interactivity": "^2.3.
|
|
54
|
-
"@wordpress/keycodes": "^3.42.
|
|
55
|
-
"@wordpress/notices": "^4.10.
|
|
56
|
-
"@wordpress/primitives": "^3.40.
|
|
57
|
-
"@wordpress/private-apis": "^0.24.
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.19.
|
|
59
|
-
"@wordpress/rich-text": "^6.19.
|
|
60
|
-
"@wordpress/server-side-render": "^4.19.
|
|
61
|
-
"@wordpress/url": "^3.43.
|
|
62
|
-
"@wordpress/viewport": "^5.19.
|
|
63
|
-
"@wordpress/wordcount": "^3.42.
|
|
34
|
+
"@wordpress/a11y": "^3.42.3",
|
|
35
|
+
"@wordpress/api-fetch": "^6.39.3",
|
|
36
|
+
"@wordpress/autop": "^3.42.3",
|
|
37
|
+
"@wordpress/blob": "^3.42.3",
|
|
38
|
+
"@wordpress/block-editor": "^12.10.3",
|
|
39
|
+
"@wordpress/blocks": "^12.19.3",
|
|
40
|
+
"@wordpress/components": "^25.8.3",
|
|
41
|
+
"@wordpress/compose": "^6.19.3",
|
|
42
|
+
"@wordpress/core-data": "^6.19.3",
|
|
43
|
+
"@wordpress/data": "^9.12.3",
|
|
44
|
+
"@wordpress/date": "^4.42.3",
|
|
45
|
+
"@wordpress/deprecated": "^3.42.3",
|
|
46
|
+
"@wordpress/dom": "^3.42.3",
|
|
47
|
+
"@wordpress/element": "^5.19.3",
|
|
48
|
+
"@wordpress/escape-html": "^2.42.3",
|
|
49
|
+
"@wordpress/hooks": "^3.42.3",
|
|
50
|
+
"@wordpress/html-entities": "^3.42.3",
|
|
51
|
+
"@wordpress/i18n": "^4.42.3",
|
|
52
|
+
"@wordpress/icons": "^9.33.3",
|
|
53
|
+
"@wordpress/interactivity": "^2.3.3",
|
|
54
|
+
"@wordpress/keycodes": "^3.42.3",
|
|
55
|
+
"@wordpress/notices": "^4.10.3",
|
|
56
|
+
"@wordpress/primitives": "^3.40.3",
|
|
57
|
+
"@wordpress/private-apis": "^0.24.3",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.19.3",
|
|
59
|
+
"@wordpress/rich-text": "^6.19.3",
|
|
60
|
+
"@wordpress/server-side-render": "^4.19.3",
|
|
61
|
+
"@wordpress/url": "^3.43.3",
|
|
62
|
+
"@wordpress/viewport": "^5.19.3",
|
|
63
|
+
"@wordpress/wordcount": "^3.42.3",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "6256f93c37705d142f75a99f1fc808540ca7dca8"
|
|
82
82
|
}
|
package/src/footnotes/index.php
CHANGED
|
@@ -39,15 +39,20 @@ function render_block_core_footnotes( $attributes, $content, $block ) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
42
|
+
$footnote_index = 1;
|
|
42
43
|
|
|
43
44
|
$block_content = '';
|
|
44
45
|
|
|
45
46
|
foreach ( $footnotes as $footnote ) {
|
|
47
|
+
// Translators: %d: Integer representing the number of return links on the page.
|
|
48
|
+
$aria_label = sprintf( __( 'Jump to footnote reference %1$d' ), $footnote_index );
|
|
46
49
|
$block_content .= sprintf(
|
|
47
|
-
'<li id="%1$s">%2$s <a href="#%1$s-link">↩︎</a></li>',
|
|
50
|
+
'<li id="%1$s">%2$s <a href="#%1$s-link" aria-label="%3$s">↩︎</a></li>',
|
|
48
51
|
$footnote['id'],
|
|
49
|
-
$footnote['content']
|
|
52
|
+
$footnote['content'],
|
|
53
|
+
$aria_label
|
|
50
54
|
);
|
|
55
|
+
++$footnote_index;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
return sprintf(
|
|
@@ -68,9 +73,10 @@ function register_block_core_footnotes() {
|
|
|
68
73
|
$post_type,
|
|
69
74
|
'footnotes',
|
|
70
75
|
array(
|
|
71
|
-
'show_in_rest'
|
|
72
|
-
'single'
|
|
73
|
-
'type'
|
|
76
|
+
'show_in_rest' => true,
|
|
77
|
+
'single' => true,
|
|
78
|
+
'type' => 'string',
|
|
79
|
+
'revisions_enabled' => true,
|
|
74
80
|
)
|
|
75
81
|
);
|
|
76
82
|
}
|
|
@@ -84,106 +90,7 @@ function register_block_core_footnotes() {
|
|
|
84
90
|
add_action( 'init', 'register_block_core_footnotes' );
|
|
85
91
|
|
|
86
92
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* @since 6.3.0
|
|
90
|
-
*
|
|
91
|
-
* @param int $revision_id The revision ID.
|
|
92
|
-
*/
|
|
93
|
-
function wp_save_footnotes_meta( $revision_id ) {
|
|
94
|
-
$post_id = wp_is_post_revision( $revision_id );
|
|
95
|
-
|
|
96
|
-
if ( $post_id ) {
|
|
97
|
-
$footnotes = get_post_meta( $post_id, 'footnotes', true );
|
|
98
|
-
|
|
99
|
-
if ( $footnotes ) {
|
|
100
|
-
// Can't use update_post_meta() because it doesn't allow revisions.
|
|
101
|
-
update_metadata( 'post', $revision_id, 'footnotes', wp_slash( $footnotes ) );
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
add_action( 'wp_after_insert_post', 'wp_save_footnotes_meta' );
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Keeps track of the revision ID for "rest_after_insert_{$post_type}".
|
|
109
|
-
*
|
|
110
|
-
* @since 6.3.0
|
|
111
|
-
*
|
|
112
|
-
* @global int $wp_temporary_footnote_revision_id The footnote revision ID.
|
|
113
|
-
*
|
|
114
|
-
* @param int $revision_id The revision ID.
|
|
115
|
-
*/
|
|
116
|
-
function wp_keep_footnotes_revision_id( $revision_id ) {
|
|
117
|
-
global $wp_temporary_footnote_revision_id;
|
|
118
|
-
$wp_temporary_footnote_revision_id = $revision_id;
|
|
119
|
-
}
|
|
120
|
-
add_action( '_wp_put_post_revision', 'wp_keep_footnotes_revision_id' );
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* This is a specific fix for the REST API. The REST API doesn't update
|
|
124
|
-
* the post and post meta in one go (through `meta_input`). While it
|
|
125
|
-
* does fix the `wp_after_insert_post` hook to be called correctly after
|
|
126
|
-
* updating meta, it does NOT fix hooks such as post_updated and
|
|
127
|
-
* save_post, which are normally also fired after post meta is updated
|
|
128
|
-
* in `wp_insert_post()`. Unfortunately, `wp_save_post_revision` is
|
|
129
|
-
* added to the `post_updated` action, which means the meta is not
|
|
130
|
-
* available at the time, so we have to add it afterwards through the
|
|
131
|
-
* `"rest_after_insert_{$post_type}"` action.
|
|
132
|
-
*
|
|
133
|
-
* @since 6.3.0
|
|
134
|
-
*
|
|
135
|
-
* @global int $wp_temporary_footnote_revision_id The footnote revision ID.
|
|
136
|
-
*
|
|
137
|
-
* @param WP_Post $post The post object.
|
|
138
|
-
*/
|
|
139
|
-
function wp_add_footnotes_revisions_to_post_meta( $post ) {
|
|
140
|
-
global $wp_temporary_footnote_revision_id;
|
|
141
|
-
|
|
142
|
-
if ( $wp_temporary_footnote_revision_id ) {
|
|
143
|
-
$revision = get_post( $wp_temporary_footnote_revision_id );
|
|
144
|
-
|
|
145
|
-
if ( ! $revision ) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
$post_id = $revision->post_parent;
|
|
150
|
-
|
|
151
|
-
// Just making sure we're updating the right revision.
|
|
152
|
-
if ( $post->ID === $post_id ) {
|
|
153
|
-
$footnotes = get_post_meta( $post_id, 'footnotes', true );
|
|
154
|
-
|
|
155
|
-
if ( $footnotes ) {
|
|
156
|
-
// Can't use update_post_meta() because it doesn't allow revisions.
|
|
157
|
-
update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', wp_slash( $footnotes ) );
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' );
|
|
164
|
-
add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' );
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Restores the footnotes meta value from the revision.
|
|
168
|
-
*
|
|
169
|
-
* @since 6.3.0
|
|
170
|
-
*
|
|
171
|
-
* @param int $post_id The post ID.
|
|
172
|
-
* @param int $revision_id The revision ID.
|
|
173
|
-
*/
|
|
174
|
-
function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
|
|
175
|
-
$footnotes = get_post_meta( $revision_id, 'footnotes', true );
|
|
176
|
-
|
|
177
|
-
if ( $footnotes ) {
|
|
178
|
-
update_post_meta( $post_id, 'footnotes', wp_slash( $footnotes ) );
|
|
179
|
-
} else {
|
|
180
|
-
delete_post_meta( $post_id, 'footnotes' );
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
add_action( 'wp_restore_post_revision', 'wp_restore_footnotes_from_revision', 10, 2 );
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Adds the footnotes field to the revision.
|
|
93
|
+
* Adds the footnotes field to the revisions display.
|
|
187
94
|
*
|
|
188
95
|
* @since 6.3.0
|
|
189
96
|
*
|
|
@@ -197,7 +104,7 @@ function wp_add_footnotes_to_revision( $fields ) {
|
|
|
197
104
|
add_filter( '_wp_post_revision_fields', 'wp_add_footnotes_to_revision' );
|
|
198
105
|
|
|
199
106
|
/**
|
|
200
|
-
* Gets the footnotes field from the revision.
|
|
107
|
+
* Gets the footnotes field from the revision for the revisions screen.
|
|
201
108
|
*
|
|
202
109
|
* @since 6.3.0
|
|
203
110
|
*
|
|
@@ -211,76 +118,3 @@ function wp_get_footnotes_from_revision( $revision_field, $field, $revision ) {
|
|
|
211
118
|
return get_metadata( 'post', $revision->ID, $field, true );
|
|
212
119
|
}
|
|
213
120
|
add_filter( '_wp_post_revision_field_footnotes', 'wp_get_footnotes_from_revision', 10, 3 );
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* The REST API autosave endpoint doesn't save meta, so we can use the
|
|
217
|
-
* `wp_creating_autosave` when it updates an exiting autosave, and
|
|
218
|
-
* `_wp_put_post_revision` when it creates a new autosave.
|
|
219
|
-
*
|
|
220
|
-
* @since 6.3.0
|
|
221
|
-
*
|
|
222
|
-
* @param int|array $autosave The autosave ID or array.
|
|
223
|
-
*/
|
|
224
|
-
function _wp_rest_api_autosave_meta( $autosave ) {
|
|
225
|
-
// Ensure it's a REST API request.
|
|
226
|
-
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
$body = rest_get_server()->get_raw_data();
|
|
231
|
-
$body = json_decode( $body, true );
|
|
232
|
-
|
|
233
|
-
if ( ! isset( $body['meta']['footnotes'] ) ) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// `wp_creating_autosave` passes the array,
|
|
238
|
-
// `_wp_put_post_revision` passes the ID.
|
|
239
|
-
$id = is_int( $autosave ) ? $autosave : $autosave['ID'];
|
|
240
|
-
|
|
241
|
-
if ( ! $id ) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) );
|
|
246
|
-
}
|
|
247
|
-
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
|
|
248
|
-
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
|
|
249
|
-
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L398.
|
|
250
|
-
// Then https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/revision.php#L367.
|
|
251
|
-
add_action( '_wp_put_post_revision', '_wp_rest_api_autosave_meta' );
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* This is a workaround for the autosave endpoint returning early if the
|
|
255
|
-
* revision field are equal. The problem is that "footnotes" is not real
|
|
256
|
-
* revision post field, so there's nothing to compare against.
|
|
257
|
-
*
|
|
258
|
-
* This trick sets the "footnotes" field (value doesn't matter), which will
|
|
259
|
-
* cause the autosave endpoint to always update the latest revision. That should
|
|
260
|
-
* be fine, it should be ok to update the revision even if nothing changed. Of
|
|
261
|
-
* course, this is temporary fix.
|
|
262
|
-
*
|
|
263
|
-
* @since 6.3.0
|
|
264
|
-
*
|
|
265
|
-
* @param WP_Post $prepared_post The prepared post object.
|
|
266
|
-
* @param WP_REST_Request $request The request object.
|
|
267
|
-
*
|
|
268
|
-
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L365-L384.
|
|
269
|
-
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L219.
|
|
270
|
-
*/
|
|
271
|
-
function _wp_rest_api_force_autosave_difference( $prepared_post, $request ) {
|
|
272
|
-
// We only want to be altering POST requests.
|
|
273
|
-
if ( $request->get_method() !== 'POST' ) {
|
|
274
|
-
return $prepared_post;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// Only alter requests for the '/autosaves' route.
|
|
278
|
-
if ( substr( $request->get_route(), -strlen( '/autosaves' ) ) !== '/autosaves' ) {
|
|
279
|
-
return $prepared_post;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
$prepared_post->footnotes = '[]';
|
|
283
|
-
return $prepared_post;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
add_filter( 'rest_pre_insert_post', '_wp_rest_api_force_autosave_difference', 10, 2 );
|
package/src/image/image.js
CHANGED
|
@@ -372,7 +372,7 @@ export default function Image( {
|
|
|
372
372
|
const lightboxSetting = useSetting( 'lightbox' );
|
|
373
373
|
|
|
374
374
|
const showLightboxToggle =
|
|
375
|
-
|
|
375
|
+
!! lightbox || lightboxSetting?.allowEditing === true;
|
|
376
376
|
|
|
377
377
|
const lightboxChecked =
|
|
378
378
|
lightbox?.enabled || ( ! lightbox && lightboxSetting?.enabled );
|
package/src/image/index.php
CHANGED
|
@@ -64,7 +64,12 @@ function render_block_core_image( $attributes, $content, $block ) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
if ( $lightbox_enabled ) {
|
|
67
|
-
|
|
67
|
+
// This render needs to happen in a filter with priority 15 to ensure that it
|
|
68
|
+
// runs after the duotone filter and that duotone styles are applied to the image
|
|
69
|
+
// in the lightbox. We also need to ensure that the lightbox works with any plugins
|
|
70
|
+
// that might use filters as well. We can consider removing this in the future if the
|
|
71
|
+
// way the blocks are rendered changes, or if a new kind of filter is introduced.
|
|
72
|
+
add_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15, 2 );
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
return $processor->get_updated_html();
|
|
@@ -267,7 +272,9 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
|
|
267
272
|
aria-modal="false"
|
|
268
273
|
data-wp-effect="effects.core.image.initLightbox"
|
|
269
274
|
data-wp-on--keydown="actions.core.image.handleKeydown"
|
|
270
|
-
data-wp-on--
|
|
275
|
+
data-wp-on--touchstart="actions.core.image.handleTouchStart"
|
|
276
|
+
data-wp-on--touchmove="actions.core.image.handleTouchMove"
|
|
277
|
+
data-wp-on--touchend="actions.core.image.handleTouchEnd"
|
|
271
278
|
data-wp-on--click="actions.core.image.hideLightbox"
|
|
272
279
|
>
|
|
273
280
|
<button type="button" aria-label="$close_button_label" style="fill: $close_button_color" class="close-button" data-wp-on--click="actions.core.image.hideLightbox">
|
package/src/image/style.scss
CHANGED
|
@@ -186,8 +186,8 @@
|
|
|
186
186
|
|
|
187
187
|
.close-button {
|
|
188
188
|
position: absolute;
|
|
189
|
-
top: calc(env(safe-area-inset-top) +
|
|
190
|
-
right: calc(env(safe-area-inset-right) +
|
|
189
|
+
top: calc(env(safe-area-inset-top) + 20px);
|
|
190
|
+
right: calc(env(safe-area-inset-right) + 20px);
|
|
191
191
|
padding: 0;
|
|
192
192
|
cursor: pointer;
|
|
193
193
|
z-index: 5000000;
|
|
@@ -297,10 +297,6 @@
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
html.wp-has-lightbox-open {
|
|
301
|
-
overflow: hidden;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
300
|
@keyframes turn-on-visibility {
|
|
305
301
|
0% {
|
|
306
302
|
opacity: 0;
|