@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.
Files changed (50) hide show
  1. package/build/footnotes/edit.js +20 -1
  2. package/build/footnotes/edit.js.map +1 -1
  3. package/build/footnotes/format.js +2 -7
  4. package/build/footnotes/format.js.map +1 -1
  5. package/build/footnotes/index.js +0 -1
  6. package/build/footnotes/index.js.map +1 -1
  7. package/build/image/deprecated.js +453 -175
  8. package/build/image/deprecated.js.map +1 -1
  9. package/build/image/save.js +3 -1
  10. package/build/image/save.js.map +1 -1
  11. package/build/list/edit.js +4 -4
  12. package/build/list/edit.js.map +1 -1
  13. package/build/navigation-link/edit.js +10 -5
  14. package/build/navigation-link/edit.js.map +1 -1
  15. package/build/quote/transforms.js +8 -0
  16. package/build/quote/transforms.js.map +1 -1
  17. package/build-module/footnotes/edit.js +18 -2
  18. package/build-module/footnotes/edit.js.map +1 -1
  19. package/build-module/footnotes/format.js +2 -7
  20. package/build-module/footnotes/format.js.map +1 -1
  21. package/build-module/footnotes/index.js +0 -1
  22. package/build-module/footnotes/index.js.map +1 -1
  23. package/build-module/image/deprecated.js +454 -176
  24. package/build-module/image/deprecated.js.map +1 -1
  25. package/build-module/image/save.js +3 -1
  26. package/build-module/image/save.js.map +1 -1
  27. package/build-module/list/edit.js +4 -4
  28. package/build-module/list/edit.js.map +1 -1
  29. package/build-module/navigation-link/edit.js +10 -5
  30. package/build-module/navigation-link/edit.js.map +1 -1
  31. package/build-module/quote/transforms.js +8 -0
  32. package/build-module/quote/transforms.js.map +1 -1
  33. package/build-style/footnotes/style-rtl.css +4 -3
  34. package/build-style/footnotes/style.css +4 -3
  35. package/build-style/style-rtl.css +4 -3
  36. package/build-style/style.css +4 -3
  37. package/package.json +8 -8
  38. package/src/comment-template/index.php +5 -2
  39. package/src/footnotes/block.json +0 -1
  40. package/src/footnotes/edit.js +21 -2
  41. package/src/footnotes/format.js +2 -6
  42. package/src/footnotes/style.scss +6 -3
  43. package/src/image/deprecated.js +597 -320
  44. package/src/image/save.js +2 -0
  45. package/src/list/edit.js +6 -4
  46. package/src/navigation-link/edit.js +59 -45
  47. package/src/post-template/index.php +4 -2
  48. package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
  49. package/src/quote/test/transforms.native.js +5 -1
  50. 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.7",
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.5",
40
+ "@wordpress/block-editor": "^12.3.6",
41
41
  "@wordpress/blocks": "^12.12.3",
42
- "@wordpress/components": "^25.1.5",
42
+ "@wordpress/components": "^25.1.6",
43
43
  "@wordpress/compose": "^6.12.1",
44
- "@wordpress/core-data": "^6.12.5",
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.5",
60
- "@wordpress/rich-text": "^6.12.3",
61
- "@wordpress/server-side-render": "^4.12.5",
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": "3eeb607ebb76c3bf06cb8acb462f0dc068f340f9"
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
 
@@ -11,7 +11,6 @@
11
11
  "supports": {
12
12
  "html": false,
13
13
  "multiple": false,
14
- "inserter": false,
15
14
  "reusable": false
16
15
  },
17
16
  "style": "wp-block-footnotes"
@@ -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 { ...useBlockProps() }>
35
+ <ol { ...blockProps }>
17
36
  { footnotes.map( ( { id, content } ) => (
18
37
  <li key={ id }>
19
38
  <RichText
@@ -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: 'a',
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
@@ -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-block;
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;