@wordpress/block-library 7.3.1 → 7.3.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.
Files changed (154) hide show
  1. package/build/audio/edit.js +1 -1
  2. package/build/audio/edit.js.map +1 -1
  3. package/build/comment-template/edit.js +3 -1
  4. package/build/comment-template/edit.js.map +1 -1
  5. package/build/comment-template/hooks.js +14 -4
  6. package/build/comment-template/hooks.js.map +1 -1
  7. package/build/comments-pagination/edit.js +18 -1
  8. package/build/comments-pagination/edit.js.map +1 -1
  9. package/build/comments-query-loop/edit.js +2 -2
  10. package/build/comments-query-loop/edit.js.map +1 -1
  11. package/build/comments-title/edit.js +151 -0
  12. package/build/comments-title/edit.js.map +1 -0
  13. package/build/comments-title/index.js +101 -0
  14. package/build/comments-title/index.js.map +1 -0
  15. package/build/cover/transforms.js +33 -32
  16. package/build/cover/transforms.js.map +1 -1
  17. package/build/index.js +6 -4
  18. package/build/index.js.map +1 -1
  19. package/build/list/index.js +13 -2
  20. package/build/list/index.js.map +1 -1
  21. package/build/navigation/edit/index.js +17 -1
  22. package/build/navigation/edit/index.js.map +1 -1
  23. package/build/navigation/edit/inner-blocks.js +5 -7
  24. package/build/navigation/edit/inner-blocks.js.map +1 -1
  25. package/build/navigation/edit/navigation-menu-selector.js +7 -2
  26. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  27. package/build/navigation-link/edit.js +29 -30
  28. package/build/navigation-link/edit.js.map +1 -1
  29. package/build/navigation-submenu/edit.js +14 -14
  30. package/build/navigation-submenu/edit.js.map +1 -1
  31. package/build/post-comments/edit.js +141 -35
  32. package/build/post-comments/edit.js.map +1 -1
  33. package/build/post-comments/index.js +2 -1
  34. package/build/post-comments/index.js.map +1 -1
  35. package/build/post-comments-form/edit.js +22 -1
  36. package/build/post-comments-form/edit.js.map +1 -1
  37. package/build/post-comments-form/index.js +1 -0
  38. package/build/post-comments-form/index.js.map +1 -1
  39. package/build/post-content/edit.js +1 -1
  40. package/build/post-content/edit.js.map +1 -1
  41. package/build/post-featured-image/edit.js +19 -7
  42. package/build/post-featured-image/edit.js.map +1 -1
  43. package/build/query-no-results/edit.js +1 -1
  44. package/build/query-no-results/edit.js.map +1 -1
  45. package/build/quote/index.js +13 -2
  46. package/build/quote/index.js.map +1 -1
  47. package/build-module/audio/edit.js +1 -1
  48. package/build-module/audio/edit.js.map +1 -1
  49. package/build-module/comment-template/edit.js +3 -1
  50. package/build-module/comment-template/edit.js.map +1 -1
  51. package/build-module/comment-template/hooks.js +14 -4
  52. package/build-module/comment-template/hooks.js.map +1 -1
  53. package/build-module/comments-pagination/edit.js +19 -2
  54. package/build-module/comments-pagination/edit.js.map +1 -1
  55. package/build-module/comments-query-loop/edit.js +2 -2
  56. package/build-module/comments-query-loop/edit.js.map +1 -1
  57. package/build-module/comments-title/edit.js +135 -0
  58. package/build-module/comments-title/edit.js.map +1 -0
  59. package/build-module/comments-title/index.js +88 -0
  60. package/build-module/comments-title/index.js.map +1 -0
  61. package/build-module/cover/transforms.js +33 -32
  62. package/build-module/cover/transforms.js.map +1 -1
  63. package/build-module/index.js +5 -4
  64. package/build-module/index.js.map +1 -1
  65. package/build-module/list/index.js +9 -3
  66. package/build-module/list/index.js.map +1 -1
  67. package/build-module/navigation/edit/index.js +17 -1
  68. package/build-module/navigation/edit/index.js.map +1 -1
  69. package/build-module/navigation/edit/inner-blocks.js +5 -7
  70. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  71. package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
  72. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  73. package/build-module/navigation-link/edit.js +29 -30
  74. package/build-module/navigation-link/edit.js.map +1 -1
  75. package/build-module/navigation-submenu/edit.js +14 -14
  76. package/build-module/navigation-submenu/edit.js.map +1 -1
  77. package/build-module/post-comments/edit.js +143 -38
  78. package/build-module/post-comments/edit.js.map +1 -1
  79. package/build-module/post-comments/index.js +2 -1
  80. package/build-module/post-comments/index.js.map +1 -1
  81. package/build-module/post-comments-form/edit.js +21 -1
  82. package/build-module/post-comments-form/edit.js.map +1 -1
  83. package/build-module/post-comments-form/index.js +1 -0
  84. package/build-module/post-comments-form/index.js.map +1 -1
  85. package/build-module/post-content/edit.js +1 -1
  86. package/build-module/post-content/edit.js.map +1 -1
  87. package/build-module/post-featured-image/edit.js +19 -7
  88. package/build-module/post-featured-image/edit.js.map +1 -1
  89. package/build-module/query-no-results/edit.js +1 -1
  90. package/build-module/query-no-results/edit.js.map +1 -1
  91. package/build-module/quote/index.js +9 -3
  92. package/build-module/quote/index.js.map +1 -1
  93. package/build-style/comment-content/style-rtl.css +81 -0
  94. package/build-style/comment-content/style.css +81 -0
  95. package/build-style/comments-title/editor-rtl.css +79 -0
  96. package/build-style/comments-title/editor.css +79 -0
  97. package/build-style/cover/style-rtl.css +1 -1
  98. package/build-style/cover/style.css +1 -1
  99. package/build-style/editor-rtl.css +12 -0
  100. package/build-style/editor.css +12 -0
  101. package/build-style/latest-posts/style-rtl.css +2 -0
  102. package/build-style/latest-posts/style.css +4 -0
  103. package/build-style/post-comments/editor-rtl.css +79 -0
  104. package/build-style/post-comments/editor.css +79 -0
  105. package/build-style/post-comments/style-rtl.css +1 -3
  106. package/build-style/post-comments/style.css +1 -3
  107. package/build-style/post-comments-form/editor-rtl.css +79 -0
  108. package/build-style/post-comments-form/editor.css +79 -0
  109. package/build-style/post-comments-form/style-rtl.css +9 -0
  110. package/build-style/post-comments-form/style.css +9 -0
  111. package/build-style/style-rtl.css +13 -4
  112. package/build-style/style.css +15 -4
  113. package/package.json +28 -28
  114. package/src/audio/edit.js +1 -1
  115. package/src/comment-author-name/index.php +7 -5
  116. package/src/comment-content/index.php +25 -3
  117. package/src/comment-content/style.scss +5 -0
  118. package/src/comment-edit-link/index.php +1 -4
  119. package/src/comment-reply-link/index.php +1 -4
  120. package/src/comment-template/edit.js +5 -2
  121. package/src/comment-template/hooks.js +15 -2
  122. package/src/comment-template/index.php +23 -2
  123. package/src/comments-pagination/edit.js +23 -0
  124. package/src/comments-query-loop/edit.js +2 -0
  125. package/src/comments-title/block.json +70 -0
  126. package/src/comments-title/edit.js +213 -0
  127. package/src/comments-title/editor.scss +4 -0
  128. package/src/comments-title/index.js +18 -0
  129. package/src/comments-title/index.php +75 -0
  130. package/src/cover/index.php +1 -1
  131. package/src/cover/style.scss +1 -1
  132. package/src/cover/transforms.js +51 -28
  133. package/src/editor.scss +3 -0
  134. package/src/index.js +8 -2
  135. package/src/latest-posts/style.scss +4 -0
  136. package/src/list/index.js +7 -3
  137. package/src/navigation/edit/index.js +24 -0
  138. package/src/navigation/edit/inner-blocks.js +5 -7
  139. package/src/navigation/edit/navigation-menu-selector.js +15 -9
  140. package/src/navigation-link/edit.js +40 -43
  141. package/src/navigation-submenu/edit.js +13 -17
  142. package/src/post-comments/block.json +2 -1
  143. package/src/post-comments/edit.js +204 -44
  144. package/src/post-comments/editor.scss +3 -0
  145. package/src/post-comments/style.scss +1 -5
  146. package/src/post-comments-form/block.json +1 -0
  147. package/src/post-comments-form/edit.js +39 -2
  148. package/src/post-comments-form/editor.scss +3 -0
  149. package/src/post-comments-form/index.php +16 -5
  150. package/src/post-comments-form/style.scss +11 -0
  151. package/src/post-content/edit.js +15 -1
  152. package/src/post-featured-image/edit.js +24 -12
  153. package/src/query-no-results/edit.js +1 -1
  154. package/src/quote/index.js +7 -3
@@ -85,7 +85,21 @@ function Placeholder() {
85
85
  const blockProps = useBlockProps();
86
86
  return (
87
87
  <div { ...blockProps }>
88
- <p>{ __( 'Post Content' ) }</p>
88
+ <p>
89
+ { __(
90
+ 'This is the Post Content block, it will display all the blocks in any single post or page.'
91
+ ) }
92
+ </p>
93
+ <p>
94
+ { __(
95
+ 'That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.'
96
+ ) }
97
+ </p>
98
+ <p>
99
+ { __(
100
+ 'If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.'
101
+ ) }
102
+ </p>
89
103
  </div>
90
104
  );
91
105
  }
@@ -57,22 +57,30 @@ function PostFeaturedImageDisplay( {
57
57
  clientId,
58
58
  attributes,
59
59
  setAttributes,
60
- context: { postId, postType, queryId },
60
+ context: { postId, postType: postTypeSlug, queryId },
61
61
  } ) {
62
62
  const isDescendentOfQueryLoop = Number.isFinite( queryId );
63
63
  const { isLink, height, width, scale, sizeSlug } = attributes;
64
64
  const [ featuredImage, setFeaturedImage ] = useEntityProp(
65
65
  'postType',
66
- postType,
66
+ postTypeSlug,
67
67
  'featured_media',
68
68
  postId
69
69
  );
70
70
 
71
- const media = useSelect(
72
- ( select ) =>
73
- featuredImage &&
74
- select( coreStore ).getMedia( featuredImage, { context: 'view' } ),
75
- [ featuredImage ]
71
+ const { media, postType } = useSelect(
72
+ ( select ) => {
73
+ const { getMedia, getPostType } = select( coreStore );
74
+ return {
75
+ media:
76
+ featuredImage &&
77
+ getMedia( featuredImage, {
78
+ context: 'view',
79
+ } ),
80
+ postType: postTypeSlug && getPostType( postTypeSlug ),
81
+ };
82
+ },
83
+ [ featuredImage, postTypeSlug ]
76
84
  );
77
85
  const mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );
78
86
 
@@ -124,11 +132,15 @@ function PostFeaturedImageDisplay( {
124
132
  <InspectorControls>
125
133
  <PanelBody title={ __( 'Link settings' ) }>
126
134
  <ToggleControl
127
- label={ sprintf(
128
- // translators: %s: Name of the post type e.g: "post".
129
- __( 'Link to %s' ),
130
- postType
131
- ) }
135
+ label={
136
+ postType?.labels.singular_name
137
+ ? sprintf(
138
+ // translators: %s: Name of the post type e.g: "post".
139
+ __( 'Link to %s' ),
140
+ postType.labels.singular_name.toLowerCase()
141
+ )
142
+ : __( 'Link to post' )
143
+ }
132
144
  onChange={ () => setAttributes( { isLink: ! isLink } ) }
133
145
  checked={ isLink }
134
146
  />
@@ -9,7 +9,7 @@ const TEMPLATE = [
9
9
  'core/paragraph',
10
10
  {
11
11
  placeholder: __(
12
- 'Add a text or blocks that will display when the query returns no results.'
12
+ 'Add text or blocks that will display when the query returns no results.'
13
13
  ),
14
14
  },
15
15
  ],
@@ -53,6 +53,10 @@ export const settingsV1 = {
53
53
  deprecated,
54
54
  };
55
55
 
56
- export const settings = window?.__experimentalEnableQuoteBlockV2
57
- ? settingsV2
58
- : settingsV1;
56
+ let settings = settingsV1;
57
+ if ( process.env.IS_GUTENBERG_PLUGIN ) {
58
+ settings = window?.__experimentalEnableQuoteBlockV2
59
+ ? settingsV2
60
+ : settingsV1;
61
+ }
62
+ export { settings };