@wordpress/block-library 8.12.7 → 8.12.8
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/footnotes/edit.js +20 -1
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js +2 -7
- package/build/footnotes/format.js.map +1 -1
- package/build/footnotes/index.js +0 -1
- package/build/footnotes/index.js.map +1 -1
- package/build/image/deprecated.js +453 -175
- package/build/image/deprecated.js.map +1 -1
- package/build/image/save.js +3 -1
- package/build/image/save.js.map +1 -1
- package/build/list/edit.js +4 -4
- package/build/list/edit.js.map +1 -1
- package/build/navigation-link/edit.js +10 -5
- package/build/navigation-link/edit.js.map +1 -1
- package/build/quote/transforms.js +8 -0
- package/build/quote/transforms.js.map +1 -1
- package/build-module/footnotes/edit.js +18 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/footnotes/format.js +2 -7
- package/build-module/footnotes/format.js.map +1 -1
- package/build-module/footnotes/index.js +0 -1
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/image/deprecated.js +454 -176
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/save.js +3 -1
- package/build-module/image/save.js.map +1 -1
- package/build-module/list/edit.js +4 -4
- package/build-module/list/edit.js.map +1 -1
- package/build-module/navigation-link/edit.js +10 -5
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/quote/transforms.js +8 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-style/footnotes/style-rtl.css +4 -3
- package/build-style/footnotes/style.css +4 -3
- package/build-style/style-rtl.css +4 -3
- package/build-style/style.css +4 -3
- package/package.json +8 -8
- package/src/comment-template/index.php +5 -2
- package/src/footnotes/block.json +0 -1
- package/src/footnotes/edit.js +21 -2
- package/src/footnotes/format.js +2 -6
- package/src/footnotes/style.scss +6 -3
- package/src/image/deprecated.js +597 -320
- package/src/image/save.js +2 -0
- package/src/list/edit.js +6 -4
- package/src/navigation-link/edit.js +59 -45
- package/src/post-template/index.php +4 -2
- package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
- package/src/quote/test/transforms.native.js +5 -1
- package/src/quote/transforms.js +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.8",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@wordpress/api-fetch": "^6.32.1",
|
|
38
38
|
"@wordpress/autop": "^3.35.1",
|
|
39
39
|
"@wordpress/blob": "^3.35.1",
|
|
40
|
-
"@wordpress/block-editor": "^12.3.
|
|
40
|
+
"@wordpress/block-editor": "^12.3.6",
|
|
41
41
|
"@wordpress/blocks": "^12.12.3",
|
|
42
|
-
"@wordpress/components": "^25.1.
|
|
42
|
+
"@wordpress/components": "^25.1.6",
|
|
43
43
|
"@wordpress/compose": "^6.12.1",
|
|
44
|
-
"@wordpress/core-data": "^6.12.
|
|
44
|
+
"@wordpress/core-data": "^6.12.6",
|
|
45
45
|
"@wordpress/data": "^9.5.3",
|
|
46
46
|
"@wordpress/date": "^4.35.1",
|
|
47
47
|
"@wordpress/deprecated": "^3.35.1",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"@wordpress/notices": "^4.3.3",
|
|
57
57
|
"@wordpress/primitives": "^3.33.1",
|
|
58
58
|
"@wordpress/private-apis": "^0.17.1",
|
|
59
|
-
"@wordpress/reusable-blocks": "^4.12.
|
|
60
|
-
"@wordpress/rich-text": "^6.12.
|
|
61
|
-
"@wordpress/server-side-render": "^4.12.
|
|
59
|
+
"@wordpress/reusable-blocks": "^4.12.6",
|
|
60
|
+
"@wordpress/rich-text": "^6.12.4",
|
|
61
|
+
"@wordpress/server-side-render": "^4.12.6",
|
|
62
62
|
"@wordpress/url": "^3.36.1",
|
|
63
63
|
"@wordpress/viewport": "^5.12.3",
|
|
64
64
|
"@wordpress/wordcount": "^3.35.1",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "86ecd96b3bcada6b4cc35bb2455b3029cebb0ff3"
|
|
87
87
|
}
|
|
@@ -35,8 +35,11 @@ function block_core_comment_template_render_comments( $comments, $block ) {
|
|
|
35
35
|
* We set commentId context through the `render_block_context` filter so
|
|
36
36
|
* that dynamically inserted blocks (at `render_block` filter stage)
|
|
37
37
|
* will also receive that context.
|
|
38
|
+
*
|
|
39
|
+
* Use an early priority to so that other 'render_block_context' filters
|
|
40
|
+
* have access to the values.
|
|
38
41
|
*/
|
|
39
|
-
add_filter( 'render_block_context', $filter_block_context );
|
|
42
|
+
add_filter( 'render_block_context', $filter_block_context, 1 );
|
|
40
43
|
|
|
41
44
|
/*
|
|
42
45
|
* We construct a new WP_Block instance from the parsed block so that
|
|
@@ -44,7 +47,7 @@ function block_core_comment_template_render_comments( $comments, $block ) {
|
|
|
44
47
|
*/
|
|
45
48
|
$block_content = ( new WP_Block( $block->parsed_block ) )->render( array( 'dynamic' => false ) );
|
|
46
49
|
|
|
47
|
-
remove_filter( 'render_block_context', $filter_block_context );
|
|
50
|
+
remove_filter( 'render_block_context', $filter_block_context, 1 );
|
|
48
51
|
|
|
49
52
|
$children = $comment->get_children();
|
|
50
53
|
|
package/src/footnotes/block.json
CHANGED
package/src/footnotes/edit.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
4
|
+
import { BlockIcon, RichText, useBlockProps } from '@wordpress/block-editor';
|
|
5
5
|
import { useEntityProp } from '@wordpress/core-data';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { Placeholder } from '@wordpress/components';
|
|
8
|
+
import { formatListNumbered as icon } from '@wordpress/icons';
|
|
6
9
|
|
|
7
10
|
export default function FootnotesEdit( { context: { postType, postId } } ) {
|
|
8
11
|
const [ meta, updateMeta ] = useEntityProp(
|
|
@@ -12,8 +15,24 @@ export default function FootnotesEdit( { context: { postType, postId } } ) {
|
|
|
12
15
|
postId
|
|
13
16
|
);
|
|
14
17
|
const footnotes = meta?.footnotes ? JSON.parse( meta.footnotes ) : [];
|
|
18
|
+
const blockProps = useBlockProps();
|
|
19
|
+
|
|
20
|
+
if ( ! footnotes.length ) {
|
|
21
|
+
return (
|
|
22
|
+
<div { ...blockProps }>
|
|
23
|
+
<Placeholder
|
|
24
|
+
icon={ <BlockIcon icon={ icon } /> }
|
|
25
|
+
label={ __( 'Footnotes' ) }
|
|
26
|
+
instructions={ __(
|
|
27
|
+
'Footnotes found in blocks within this document will be displayed here.'
|
|
28
|
+
) }
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
return (
|
|
16
|
-
<ol { ...
|
|
35
|
+
<ol { ...blockProps }>
|
|
17
36
|
{ footnotes.map( ( { id, content } ) => (
|
|
18
37
|
<li key={ id }>
|
|
19
38
|
<RichText
|
package/src/footnotes/format.js
CHANGED
|
@@ -24,11 +24,9 @@ import { name } from './block.json';
|
|
|
24
24
|
export const formatName = 'core/footnote';
|
|
25
25
|
export const format = {
|
|
26
26
|
title: __( 'Footnote' ),
|
|
27
|
-
tagName: '
|
|
27
|
+
tagName: 'sup',
|
|
28
28
|
className: 'fn',
|
|
29
29
|
attributes: {
|
|
30
|
-
id: 'id',
|
|
31
|
-
href: 'href',
|
|
32
30
|
'data-fn': 'data-fn',
|
|
33
31
|
},
|
|
34
32
|
contentEditable: false,
|
|
@@ -50,11 +48,9 @@ export const format = {
|
|
|
50
48
|
{
|
|
51
49
|
type: formatName,
|
|
52
50
|
attributes: {
|
|
53
|
-
href: '#' + id,
|
|
54
|
-
id: `${ id }-link`,
|
|
55
51
|
'data-fn': id,
|
|
56
52
|
},
|
|
57
|
-
innerHTML:
|
|
53
|
+
innerHTML: `<a href="#${ id }" id="${ id }-link">*</a>`,
|
|
58
54
|
},
|
|
59
55
|
value.end,
|
|
60
56
|
value.end
|
package/src/footnotes/style.scss
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
// These styles are for backwards compatibility with the old footnotes anchors.
|
|
2
|
+
// Can be removed in the future.
|
|
1
3
|
.editor-styles-wrapper,
|
|
2
4
|
.entry-content {
|
|
3
5
|
counter-reset: footnotes;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
|
-
[data-fn].fn {
|
|
8
|
+
a[data-fn].fn {
|
|
7
9
|
vertical-align: super;
|
|
8
10
|
font-size: smaller;
|
|
9
11
|
counter-increment: footnotes;
|
|
10
|
-
display: inline-
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
text-decoration: none;
|
|
11
14
|
text-indent: -9999999px;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
[data-fn].fn::after {
|
|
17
|
+
a[data-fn].fn::after {
|
|
15
18
|
content: "[" counter(footnotes) "]";
|
|
16
19
|
text-indent: 0;
|
|
17
20
|
float: left;
|