@wordpress/block-library 7.3.7 → 7.3.10

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.
@@ -91,7 +91,9 @@ function PostCommentsEdit(_ref) {
91
91
  })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_blockEditor.Warning, null, warning), showPlacholder && (0, _element.createElement)("div", {
92
92
  className: "wp-block-post-comments__placeholder",
93
93
  ref: disabledRef
94
- }, (0, _element.createElement)("h3", null, (0, _i18n.__)('One response to'), " \u201C", postTitle, "\u201D"), (0, _element.createElement)("div", {
94
+ }, (0, _element.createElement)("h3", null,
95
+ /* translators: %s: Post title. */
96
+ (0, _i18n.sprintf)((0, _i18n.__)('One response to %s'), postTitle)), (0, _element.createElement)("div", {
95
97
  className: "navigation"
96
98
  }, (0, _element.createElement)("div", {
97
99
  className: "alignleft"
@@ -118,34 +120,50 @@ function PostCommentsEdit(_ref) {
118
120
  height: "32",
119
121
  width: "32",
120
122
  loading: "lazy"
121
- }), (0, _element.createElement)("b", {
122
- className: "fn"
123
- }, (0, _element.createElement)("a", {
124
- href: "#top",
125
- className: "url"
126
- }, (0, _i18n.__)('A WordPress Commenter'))), ' ', (0, _element.createElement)("span", {
127
- className: "says"
128
- }, (0, _i18n.__)('says'), ":")), (0, _element.createElement)("div", {
123
+ }), (0, _element.createInterpolateElement)((0, _i18n.sprintf)(
124
+ /* translators: %s: Comment author link. */
125
+ (0, _i18n.__)('%s <span>says:</span>'), (0, _i18n.sprintf)('<cite><a>%s</a></cite>', (0, _i18n.__)('A WordPress Commenter'))), {
126
+ span: (0, _element.createElement)("span", {
127
+ className: "says"
128
+ }),
129
+ a:
130
+ /* eslint-disable jsx-a11y/anchor-has-content */
131
+ (0, _element.createElement)("a", {
132
+ href: "#top",
133
+ className: "url"
134
+ })
135
+ /* eslint-enable jsx-a11y/anchor-has-content */
136
+ ,
137
+ cite: (0, _element.createElement)("cite", {
138
+ className: "fn"
139
+ })
140
+ })), (0, _element.createElement)("div", {
129
141
  className: "comment-metadata"
130
142
  }, (0, _element.createElement)("a", {
131
143
  href: "#top"
132
144
  }, (0, _element.createElement)("time", {
133
- dateTime: "2000-01-01T00:00:00+00:00"
134
- }, (0, _i18n.__)('January 1, 2000 at 00:00 am'))), ' ', (0, _element.createElement)("span", {
145
+ dateTime: "2000-01-01T12:00:00+00:00"
146
+ }, (0, _i18n.__)('January 1, 2000 at 12:00 am'))), ' ', (0, _element.createElement)("span", {
135
147
  className: "edit-link"
136
148
  }, (0, _element.createElement)("a", {
137
149
  className: "comment-edit-link",
138
150
  href: "#top"
139
151
  }, (0, _i18n.__)('Edit'))))), (0, _element.createElement)("div", {
140
152
  className: "comment-content"
141
- }, (0, _element.createElement)("p", null, (0, _i18n.__)('Hi, this is a comment.'), (0, _element.createElement)("br", null), (0, _i18n.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0, _element.createElement)("br", null), (0, _i18n.__)('Commenter avatars come from'), ' ', (0, _element.createElement)("a", {
142
- href: "https://gravatar.com/"
143
- }, "Gravatar"), ".")), (0, _element.createElement)("div", {
153
+ }, (0, _element.createElement)("p", null, (0, _i18n.__)('Hi, this is a comment.'), (0, _element.createElement)("br", null), (0, _i18n.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0, _element.createElement)("br", null), (0, _element.createInterpolateElement)((0, _i18n.__)('Commenter avatars come from <a>Gravatar</a>'), {
154
+ a:
155
+ /* eslint-disable-next-line jsx-a11y/anchor-has-content */
156
+ (0, _element.createElement)("a", {
157
+ href: "https://gravatar.com/"
158
+ })
159
+ }))), (0, _element.createElement)("div", {
144
160
  className: "reply"
145
161
  }, (0, _element.createElement)("a", {
146
162
  className: "comment-reply-link",
147
163
  href: "#top",
148
- "aria-label": "Reply to A WordPress Commenter"
164
+ "aria-label": (0, _i18n.sprintf)(
165
+ /* translators: Comment reply button text. %s: Comment author name. */
166
+ (0, _i18n.__)('Reply to %s'), (0, _i18n.__)('A WordPress Commenter'))
149
167
  }, (0, _i18n.__)('Reply')))))), (0, _element.createElement)("div", {
150
168
  className: "navigation"
151
169
  }, (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["PostCommentsEdit","attributes","textAlign","setAttributes","context","postType","postId","postTitle","commentStatus","avatarURL","defaultCommentStatus","select","blockEditorStore","getSettings","__experimentalDiscussionSettings","isSiteEditor","undefined","postTypeSupportsComments","coreStore","getPostType","supports","comments","warning","showPlacholder","blockProps","className","disabledRef","textareaId","nextAlign"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAOA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;AAgBe,SAASA,gBAAT,OAIX;AAAA,MAJsC;AACzCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA;AAAF,KAD6B;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AAHgC,GAItC;AACH,MAAI,CAAEC,SAAF,IAAgB,6BAAe,UAAf,EAA2BF,QAA3B,EAAqC,OAArC,EAA8CC,MAA9C,CAApB;AACAC,EAAAA,SAAS,GAAGA,SAAS,IAAI,cAAI,YAAJ,CAAzB;AAEA,QAAM,CAAEC,aAAF,IAAoB,6BACzB,UADyB,EAEzBH,QAFyB,EAGzB,gBAHyB,EAIzBC,MAJyB,CAA1B;AAOA,QAAM;AAAEG,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAAsC,qBACzCC,MAAF,IACCA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,WAA3B,GACEC,gCAHwC,CAA5C;AAMA,QAAMC,YAAY,GAAGV,QAAQ,KAAKW,SAAb,IAA0BV,MAAM,KAAKU,SAA1D;AAEA,QAAMC,wBAAwB,GAAG,qBAAaN,MAAF;AAAA;;AAAA,WAC3CN,QAAQ,GACL,CAAC,yBAAEM,MAA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IAAI,EAAC,QADN;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,SAAS,EAAC,8BAHX;AAIC,IAAA,KAAK,EAAG,cAAI,cAAJ;AAJT,IADD,CAhBD,CALD,CArGD,CAJF,CAVD,CADD;AAwJA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseDisabled as useDisabled,\n\tuseInstanceId,\n} from '@wordpress/compose';\n\nexport default function PostCommentsEdit( {\n\tattributes: { textAlign },\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst { avatarURL, defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tlet warning = __(\n\t\t'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the \"Comments Query Loop\" block.'\n\t);\n\tlet showPlacholder = true;\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments to this %s are not allowed.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments for this post type (%s) are not enabled.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\twarning = __( 'Post Comments block: Comments are not enabled.' );\n\t\t\tshowPlacholder = false;\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst disabledRef = useDisabled();\n\n\tconst textareaId = useInstanceId( PostCommentsEdit );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ warning }</Warning>\n\n\t\t\t\t{ showPlacholder && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"wp-block-post-comments__placeholder\"\n\t\t\t\t\t\tref={ disabledRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t{ __( 'One response to' ) } “{ postTitle }”\n\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ol className=\"commentlist\">\n\t\t\t\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"Commenter Avatar\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<b className=\"fn\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\" className=\"url\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'A WordPress Commenter'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</b>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"says\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'says' ) }:\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T00:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'January 1, 2000 at 00:00 am'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from'\n\t\t\t\t\t\t\t\t\t\t\t) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\">\n\t\t\t\t\t\t\t\t\t\t\t\tGravatar\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t.\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Reply to A WordPress Commenter\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</article>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"comment-respond\">\n\t\t\t\t\t\t\t<h3 className=\"comment-reply-title\">\n\t\t\t\t\t\t\t\t{ __( 'Leave a Reply' ) }\n\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t<form className=\"comment-form\" noValidate>\n\t\t\t\t\t\t\t\t<p className=\"comment-form-comment\">\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\thtmlFor={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Comment' ) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<span className=\"required\">*</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\tid={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p className=\"form-submit wp-block-button\">\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"submit wp-block-button__link\"\n\t\t\t\t\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["PostCommentsEdit","attributes","textAlign","setAttributes","context","postType","postId","postTitle","commentStatus","avatarURL","defaultCommentStatus","select","blockEditorStore","getSettings","__experimentalDiscussionSettings","isSiteEditor","undefined","postTypeSupportsComments","coreStore","getPostType","supports","comments","warning","showPlacholder","blockProps","className","disabledRef","textareaId","nextAlign","span","a","cite"],"mappings":";;;;;;;;;AAsBA;;AAnBA;;AAKA;;AAOA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;AAiBe,SAASA,gBAAT,OAIX;AAAA,MAJsC;AACzCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA;AAAF,KAD6B;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AAHgC,GAItC;AACH,MAAI,CAAEC,SAAF,IAAgB,6BAAe,UAAf,EA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AAAG,IAAA,IAAI,EAAC;AAAR,cAAmB,cAAI,gBAAJ,CAAnB,CADD,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,IAAI,EAAC;AAAR,KAAiB,cAAI,gBAAJ,CAAjB,UADD,CAJD,CA3HD,EAoIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACG,cAAI,eAAJ,CADH,CADD,EAKC;AAAM,IAAA,SAAS,EAAC,cAAhB;AAA+B,IAAA,UAAU;AAAzC,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACC;AACC,IAAA,OAAO,EAAI,WAAWH,UAAY;AADnC,KAGG,cAAI,SAAJ,CAHH,EAGsB,GAHtB,EAIC;AAAM,IAAA,SAAS,EAAC;AAAhB,SAJD,CADD,EAOC;AACC,IAAA,EAAE,EAAI,WAAWA,UAAY,EAD9B;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,IAAA,IAAI,EAAC,IAHN;AAIC,IAAA,IAAI,EAAC,GAJN;AAKC,IAAA,QAAQ;AALT,IAPD,CADD,EAgBC;AAAG,IAAA,SAAS,EAAC;AAAb,KACC;AACC,IAAA,IAAI,EAAC,QADN;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,SAAS,EAAC,8BAHX;AAIC,IAAA,KAAK,EAAG,cAAI,cAAJ;AAJT,IADD,CAhBD,CALD,CApID,CAJF,CAVD,CADD;AAuLA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseDisabled as useDisabled,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function PostCommentsEdit( {\n\tattributes: { textAlign },\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst { avatarURL, defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tlet warning = __(\n\t\t'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the \"Comments Query Loop\" block.'\n\t);\n\tlet showPlacholder = true;\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments to this %s are not allowed.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments for this post type (%s) are not enabled.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\twarning = __( 'Post Comments block: Comments are not enabled.' );\n\t\t\tshowPlacholder = false;\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst disabledRef = useDisabled();\n\n\tconst textareaId = useInstanceId( PostCommentsEdit );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ warning }</Warning>\n\n\t\t\t\t{ showPlacholder && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"wp-block-post-comments__placeholder\"\n\t\t\t\t\t\tref={ disabledRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t\t\t\tsprintf( __( 'One response to %s' ), postTitle )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ol className=\"commentlist\">\n\t\t\t\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"Commenter Avatar\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Comment author link. */\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'%s <span>says:</span>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<cite><a>%s</a></cite>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'A WordPress Commenter'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span className=\"says\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"url\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcite: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<cite className=\"fn\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T12:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'January 1, 2000 at 12:00 am'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from <a>Gravatar</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: Comment reply button text. %s: Comment author name. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Reply to %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'A WordPress Commenter' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</article>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"comment-respond\">\n\t\t\t\t\t\t\t<h3 className=\"comment-reply-title\">\n\t\t\t\t\t\t\t\t{ __( 'Leave a Reply' ) }\n\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t<form className=\"comment-form\" noValidate>\n\t\t\t\t\t\t\t\t<p className=\"comment-form-comment\">\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\thtmlFor={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Comment' ) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<span className=\"required\">*</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\tid={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p className=\"form-submit wp-block-button\">\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"submit wp-block-button__link\"\n\t\t\t\t\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
@@ -13,6 +13,7 @@ import { __, sprintf } from '@wordpress/i18n';
13
13
  import { useSelect } from '@wordpress/data';
14
14
  import { useEntityProp, store as coreStore } from '@wordpress/core-data';
15
15
  import { __experimentalUseDisabled as useDisabled, useInstanceId } from '@wordpress/compose';
16
+ import { createInterpolateElement } from '@wordpress/element';
16
17
  export default function PostCommentsEdit(_ref) {
17
18
  let {
18
19
  attributes: {
@@ -78,7 +79,9 @@ export default function PostCommentsEdit(_ref) {
78
79
  })), createElement("div", blockProps, createElement(Warning, null, warning), showPlacholder && createElement("div", {
79
80
  className: "wp-block-post-comments__placeholder",
80
81
  ref: disabledRef
81
- }, createElement("h3", null, __('One response to'), " \u201C", postTitle, "\u201D"), createElement("div", {
82
+ }, createElement("h3", null,
83
+ /* translators: %s: Post title. */
84
+ sprintf(__('One response to %s'), postTitle)), createElement("div", {
82
85
  className: "navigation"
83
86
  }, createElement("div", {
84
87
  className: "alignleft"
@@ -105,34 +108,50 @@ export default function PostCommentsEdit(_ref) {
105
108
  height: "32",
106
109
  width: "32",
107
110
  loading: "lazy"
108
- }), createElement("b", {
109
- className: "fn"
110
- }, createElement("a", {
111
- href: "#top",
112
- className: "url"
113
- }, __('A WordPress Commenter'))), ' ', createElement("span", {
114
- className: "says"
115
- }, __('says'), ":")), createElement("div", {
111
+ }), createInterpolateElement(sprintf(
112
+ /* translators: %s: Comment author link. */
113
+ __('%s <span>says:</span>'), sprintf('<cite><a>%s</a></cite>', __('A WordPress Commenter'))), {
114
+ span: createElement("span", {
115
+ className: "says"
116
+ }),
117
+ a:
118
+ /* eslint-disable jsx-a11y/anchor-has-content */
119
+ createElement("a", {
120
+ href: "#top",
121
+ className: "url"
122
+ })
123
+ /* eslint-enable jsx-a11y/anchor-has-content */
124
+ ,
125
+ cite: createElement("cite", {
126
+ className: "fn"
127
+ })
128
+ })), createElement("div", {
116
129
  className: "comment-metadata"
117
130
  }, createElement("a", {
118
131
  href: "#top"
119
132
  }, createElement("time", {
120
- dateTime: "2000-01-01T00:00:00+00:00"
121
- }, __('January 1, 2000 at 00:00 am'))), ' ', createElement("span", {
133
+ dateTime: "2000-01-01T12:00:00+00:00"
134
+ }, __('January 1, 2000 at 12:00 am'))), ' ', createElement("span", {
122
135
  className: "edit-link"
123
136
  }, createElement("a", {
124
137
  className: "comment-edit-link",
125
138
  href: "#top"
126
139
  }, __('Edit'))))), createElement("div", {
127
140
  className: "comment-content"
128
- }, createElement("p", null, __('Hi, this is a comment.'), createElement("br", null), __('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), createElement("br", null), __('Commenter avatars come from'), ' ', createElement("a", {
129
- href: "https://gravatar.com/"
130
- }, "Gravatar"), ".")), createElement("div", {
141
+ }, createElement("p", null, __('Hi, this is a comment.'), createElement("br", null), __('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), createElement("br", null), createInterpolateElement(__('Commenter avatars come from <a>Gravatar</a>'), {
142
+ a:
143
+ /* eslint-disable-next-line jsx-a11y/anchor-has-content */
144
+ createElement("a", {
145
+ href: "https://gravatar.com/"
146
+ })
147
+ }))), createElement("div", {
131
148
  className: "reply"
132
149
  }, createElement("a", {
133
150
  className: "comment-reply-link",
134
151
  href: "#top",
135
- "aria-label": "Reply to A WordPress Commenter"
152
+ "aria-label": sprintf(
153
+ /* translators: Comment reply button text. %s: Comment author name. */
154
+ __('Reply to %s'), __('A WordPress Commenter'))
136
155
  }, __('Reply')))))), createElement("div", {
137
156
  className: "navigation"
138
157
  }, createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["classnames","AlignmentControl","BlockControls","Warning","useBlockProps","store","blockEditorStore","__","sprintf","useSelect","useEntityProp","coreStore","__experimentalUseDisabled","useDisabled","useInstanceId","PostCommentsEdit","attributes","textAlign","setAttributes","context","postType","postId","postTitle","commentStatus","avatarURL","defaultCommentStatus","select","getSettings","__experimentalDiscussionSettings","isSiteEditor","undefined","postTypeSupportsComments","getPostType","supports","comments","warning","showPlacholder","blockProps","className","disabledRef","textareaId","nextAlign"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,aAFD,EAGCC,OAHD,EAICC,aAJD,EAKCC,KAAK,IAAIC,gBALV,QAMO,yBANP;AAOA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,aAAT,EAAwBL,KAAK,IAAIM,SAAjC,QAAkD,sBAAlD;AACA,SACCC,yBAAyB,IAAIC,WAD9B,EAECC,aAFD,QAGO,oBAHP;AAKA,eAAe,SAASC,gBAAT,OAIX;AAAA,MAJsC;AACzCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA;AAAF,KAD6B;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AAHgC,GAItC;AACH,MAAI,CAAEC,SAAF,IAAgBZ,aAAa,CAAE,UAAF,EAAcU,QAAd,EAAwB,OAAxB,EAAiCC,MAAjC,CAAjC;AACAC,EAAAA,SAAS,GAAGA,SAAS,IAAIf,EAAE,CAAE,YAAF,CAA3B;AAEA,QAAM,CAAEgB,aAAF,IAAoBb,aAAa,CACtC,UADsC,EAEtCU,QAFsC,EAGtC,gBAHsC,EAItCC,MAJsC,CAAvC;AAOA,QAAM;AAAEG,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAAsChB,SAAS,CAClDiB,MAAF,IACCA,MAAM,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;AAA+B,IAAA,UAAU;AAAzC,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACC;AACC,IAAA,OAAO,EAAI,WAAWiC,UAAY;AADnC,KAGGjC,EAAE,CAAE,SAAF,CAHL,EAGsB,GAHtB,EAIC;AAAM,IAAA,SAAS,EAAC;AAAhB,SAJD,CADD,EAOC;AACC,IAAA,EAAE,EAAI,WAAWiC,UAAY,EAD9B;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,IAAA,IAAI,EAAC,IAHN;AAIC,IAAA,IAAI,EAAC,GAJN;AAKC,IAAA,QAAQ;AALT,IAPD,CADD,EAgBC;AAAG,IAAA,SAAS,EAAC;AAAb,KACC;AACC,IAAA,IAAI,EAAC,QADN;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,SAAS,EAAC,8BAHX;AAIC,IAAA,KAAK,EAAGjC,EAAE,CAAE,cAAF;AAJX,IADD,CAhBD,CALD,CArGD,CAJF,CAVD,CADD;AAwJA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseDisabled as useDisabled,\n\tuseInstanceId,\n} from '@wordpress/compose';\n\nexport default function PostCommentsEdit( {\n\tattributes: { textAlign },\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst { avatarURL, defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tlet warning = __(\n\t\t'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the \"Comments Query Loop\" block.'\n\t);\n\tlet showPlacholder = true;\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments to this %s are not allowed.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments for this post type (%s) are not enabled.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\twarning = __( 'Post Comments block: Comments are not enabled.' );\n\t\t\tshowPlacholder = false;\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst disabledRef = useDisabled();\n\n\tconst textareaId = useInstanceId( PostCommentsEdit );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ warning }</Warning>\n\n\t\t\t\t{ showPlacholder && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"wp-block-post-comments__placeholder\"\n\t\t\t\t\t\tref={ disabledRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t{ __( 'One response to' ) } “{ postTitle }”\n\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ol className=\"commentlist\">\n\t\t\t\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"Commenter Avatar\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<b className=\"fn\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\" className=\"url\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'A WordPress Commenter'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</b>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"says\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'says' ) }:\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T00:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'January 1, 2000 at 00:00 am'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from'\n\t\t\t\t\t\t\t\t\t\t\t) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\">\n\t\t\t\t\t\t\t\t\t\t\t\tGravatar\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t.\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Reply to A WordPress Commenter\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</article>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"comment-respond\">\n\t\t\t\t\t\t\t<h3 className=\"comment-reply-title\">\n\t\t\t\t\t\t\t\t{ __( 'Leave a Reply' ) }\n\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t<form className=\"comment-form\" noValidate>\n\t\t\t\t\t\t\t\t<p className=\"comment-form-comment\">\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\thtmlFor={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Comment' ) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<span className=\"required\">*</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\tid={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p className=\"form-submit wp-block-button\">\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"submit wp-block-button__link\"\n\t\t\t\t\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["classnames","AlignmentControl","BlockControls","Warning","useBlockProps","store","blockEditorStore","__","sprintf","useSelect","useEntityProp","coreStore","__experimentalUseDisabled","useDisabled","useInstanceId","createInterpolateElement","PostCommentsEdit","attributes","textAlign","setAttributes","context","postType","postId","postTitle","commentStatus","avatarURL","defaultCommentStatus","select","getSettings","__experimentalDiscussionSettings","isSiteEditor","undefined","postTypeSupportsComments","getPostType","supports","comments","warning","showPlacholder","blockProps","className","disabledRef","textareaId","nextAlign","span","a","cite"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,aAFD,EAGCC,OAHD,EAICC,aAJD,EAKCC,KAAK,IAAIC,gBALV,QAMO,yBANP;AAOA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,aAAT,EAAwBL,KAAK,IAAIM,SAAjC,QAAkD,sBAAlD;AACA,SACCC,yBAAyB,IAAIC,WAD9B,EAECC,aAFD,QAGO,oBAHP;AAIA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA,eAAe,SAASC,gBAAT,OAIX;AAAA,MAJsC;AACzCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA;AAAF,KAD6B;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AAHgC,GAItC;AACH,MAAI,CAAEC,SAAF,IAAgBb,aAAa,CAAE,UAAF,EAAcW,QAAd,EAAwB,OAAxB,EAAiCC,MAAjC,CAAjC;AACAC,EAAAA,SAAS,GAAGA,SAAS,IAAIhB,EAAE,CAAE,YAAF,CAA3B;AAEA,QAAM,CAAEiB,aAAF,IAAoBd,aAAa,CACtC,UADsC,EAEtCW,QAFsC,EAGtC,gBAHsC,EAItCC,MAJsC,CAAvC;AAOA,QAAM;AAAEG,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAAsCjB,SAAS,CAClDkB,MAAF,IACCA,MAAM,CAAErB,gBAAF,CAAN,CAA2BsB,WAA3B,GACEC,gCAHiD,CAArD;AAMA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C;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,IAAI,EAAC;AAAR,KAAiBA,EAAE,CAAE,gBAAF,CAAnB,UADD,CAJD,CA3HD,EAoIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGA,EAAE,CAAE,eAAF,CADL,CADD,EAKC;AAAM,IAAA,SAAS,EAAC,cAAhB;AAA+B,IAAA,UAAU;AAAzC,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACC;AACC,IAAA,OAAO,EAAI,WAAWkC,UAAY;AADnC,KAGGlC,EAAE,CAAE,SAAF,CAHL,EAGsB,GAHtB,EAIC;AAAM,IAAA,SAAS,EAAC;AAAhB,SAJD,CADD,EAOC;AACC,IAAA,EAAE,EAAI,WAAWkC,UAAY,EAD9B;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,IAAA,IAAI,EAAC,IAHN;AAIC,IAAA,IAAI,EAAC,GAJN;AAKC,IAAA,QAAQ;AALT,IAPD,CADD,EAgBC;AAAG,IAAA,SAAS,EAAC;AAAb,KACC;AACC,IAAA,IAAI,EAAC,QADN;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,SAAS,EAAC,8BAHX;AAIC,IAAA,KAAK,EAAGlC,EAAE,CAAE,cAAF;AAJX,IADD,CAhBD,CALD,CApID,CAJF,CAVD,CADD;AAuLA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseDisabled as useDisabled,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function PostCommentsEdit( {\n\tattributes: { textAlign },\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst { avatarURL, defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tlet warning = __(\n\t\t'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the \"Comments Query Loop\" block.'\n\t);\n\tlet showPlacholder = true;\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments to this %s are not allowed.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments for this post type (%s) are not enabled.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlacholder = false;\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\twarning = __( 'Post Comments block: Comments are not enabled.' );\n\t\t\tshowPlacholder = false;\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst disabledRef = useDisabled();\n\n\tconst textareaId = useInstanceId( PostCommentsEdit );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ warning }</Warning>\n\n\t\t\t\t{ showPlacholder && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"wp-block-post-comments__placeholder\"\n\t\t\t\t\t\tref={ disabledRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t\t\t\tsprintf( __( 'One response to %s' ), postTitle )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ol className=\"commentlist\">\n\t\t\t\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"Commenter Avatar\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Comment author link. */\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'%s <span>says:</span>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<cite><a>%s</a></cite>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'A WordPress Commenter'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span className=\"says\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"url\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcite: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<cite className=\"fn\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T12:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'January 1, 2000 at 12:00 am'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from <a>Gravatar</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: Comment reply button text. %s: Comment author name. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Reply to %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'A WordPress Commenter' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</article>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"comment-respond\">\n\t\t\t\t\t\t\t<h3 className=\"comment-reply-title\">\n\t\t\t\t\t\t\t\t{ __( 'Leave a Reply' ) }\n\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t<form className=\"comment-form\" noValidate>\n\t\t\t\t\t\t\t\t<p className=\"comment-form-comment\">\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\thtmlFor={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Comment' ) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<span className=\"required\">*</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\tid={ `comment-${ textareaId }` }\n\t\t\t\t\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p className=\"form-submit wp-block-button\">\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"submit wp-block-button__link\"\n\t\t\t\t\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
@@ -74,6 +74,21 @@
74
74
  /**
75
75
  * Reset the WP Admin page styles for Gutenberg-like pages.
76
76
  */
77
+ .wp-block-post-comments {
78
+ /* utility classes */
79
+ /* end utility classes */
80
+ }
81
+ .wp-block-post-comments .alignleft {
82
+ float: right;
83
+ }
84
+ .wp-block-post-comments .alignright {
85
+ float: left;
86
+ }
87
+ .wp-block-post-comments .navigation::after {
88
+ content: "";
89
+ display: table;
90
+ clear: both;
91
+ }
77
92
  .wp-block-post-comments .commentlist {
78
93
  clear: both;
79
94
  list-style: none;
@@ -144,6 +159,13 @@
144
159
  .wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
145
160
  margin-top: 0.35em;
146
161
  }
162
+ .wp-block-post-comments .comment-reply-title {
163
+ margin-bottom: 0;
164
+ }
165
+ .wp-block-post-comments .comment-reply-title :where(small) {
166
+ font-size: var(--wp--preset--font-size--medium, smaller);
167
+ margin-right: 0.5em;
168
+ }
147
169
  .wp-block-post-comments .reply {
148
170
  font-size: 0.875em;
149
171
  margin-bottom: 1.4em;
@@ -74,6 +74,21 @@
74
74
  /**
75
75
  * Reset the WP Admin page styles for Gutenberg-like pages.
76
76
  */
77
+ .wp-block-post-comments {
78
+ /* utility classes */
79
+ /* end utility classes */
80
+ }
81
+ .wp-block-post-comments .alignleft {
82
+ float: left;
83
+ }
84
+ .wp-block-post-comments .alignright {
85
+ float: right;
86
+ }
87
+ .wp-block-post-comments .navigation::after {
88
+ content: "";
89
+ display: table;
90
+ clear: both;
91
+ }
77
92
  .wp-block-post-comments .commentlist {
78
93
  clear: both;
79
94
  list-style: none;
@@ -144,6 +159,13 @@
144
159
  .wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
145
160
  margin-top: 0.35em;
146
161
  }
162
+ .wp-block-post-comments .comment-reply-title {
163
+ margin-bottom: 0;
164
+ }
165
+ .wp-block-post-comments .comment-reply-title :where(small) {
166
+ font-size: var(--wp--preset--font-size--medium, smaller);
167
+ margin-left: 0.5em;
168
+ }
147
169
  .wp-block-post-comments .reply {
148
170
  font-size: 0.875em;
149
171
  margin-bottom: 1.4em;
@@ -130,11 +130,9 @@
130
130
  margin-top: 0.35em;
131
131
  }
132
132
  .wp-block-post-comments-form .comment-reply-title {
133
- align-items: baseline;
134
- display: flex;
135
- justify-content: space-between;
136
133
  margin-bottom: 0;
137
134
  }
138
135
  .wp-block-post-comments-form .comment-reply-title :where(small) {
139
136
  font-size: var(--wp--preset--font-size--medium, smaller);
137
+ margin-right: 0.5em;
140
138
  }
@@ -130,11 +130,9 @@
130
130
  margin-top: 0.35em;
131
131
  }
132
132
  .wp-block-post-comments-form .comment-reply-title {
133
- align-items: baseline;
134
- display: flex;
135
- justify-content: space-between;
136
133
  margin-bottom: 0;
137
134
  }
138
135
  .wp-block-post-comments-form .comment-reply-title :where(small) {
139
136
  font-size: var(--wp--preset--font-size--medium, smaller);
137
+ margin-left: 0.5em;
140
138
  }
@@ -2101,6 +2101,21 @@ p.has-background {
2101
2101
  margin: 0;
2102
2102
  }
2103
2103
 
2104
+ .wp-block-post-comments {
2105
+ /* utility classes */
2106
+ /* end utility classes */
2107
+ }
2108
+ .wp-block-post-comments .alignleft {
2109
+ float: right;
2110
+ }
2111
+ .wp-block-post-comments .alignright {
2112
+ float: left;
2113
+ }
2114
+ .wp-block-post-comments .navigation::after {
2115
+ content: "";
2116
+ display: table;
2117
+ clear: both;
2118
+ }
2104
2119
  .wp-block-post-comments .commentlist {
2105
2120
  clear: both;
2106
2121
  list-style: none;
@@ -2171,6 +2186,13 @@ p.has-background {
2171
2186
  .wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
2172
2187
  margin-top: 0.35em;
2173
2188
  }
2189
+ .wp-block-post-comments .comment-reply-title {
2190
+ margin-bottom: 0;
2191
+ }
2192
+ .wp-block-post-comments .comment-reply-title :where(small) {
2193
+ font-size: var(--wp--preset--font-size--medium, smaller);
2194
+ margin-right: 0.5em;
2195
+ }
2174
2196
  .wp-block-post-comments .reply {
2175
2197
  font-size: 0.875em;
2176
2198
  margin-bottom: 1.4em;
@@ -2245,13 +2267,11 @@ p.has-background {
2245
2267
  margin-top: 0.35em;
2246
2268
  }
2247
2269
  .wp-block-post-comments-form .comment-reply-title {
2248
- align-items: baseline;
2249
- display: flex;
2250
- justify-content: space-between;
2251
2270
  margin-bottom: 0;
2252
2271
  }
2253
2272
  .wp-block-post-comments-form .comment-reply-title :where(small) {
2254
2273
  font-size: var(--wp--preset--font-size--medium, smaller);
2274
+ margin-right: 0.5em;
2255
2275
  }
2256
2276
 
2257
2277
  .wp-block-post-excerpt__more-link {
@@ -2127,6 +2127,21 @@ p.has-background {
2127
2127
  margin: 0;
2128
2128
  }
2129
2129
 
2130
+ .wp-block-post-comments {
2131
+ /* utility classes */
2132
+ /* end utility classes */
2133
+ }
2134
+ .wp-block-post-comments .alignleft {
2135
+ float: left;
2136
+ }
2137
+ .wp-block-post-comments .alignright {
2138
+ float: right;
2139
+ }
2140
+ .wp-block-post-comments .navigation::after {
2141
+ content: "";
2142
+ display: table;
2143
+ clear: both;
2144
+ }
2130
2145
  .wp-block-post-comments .commentlist {
2131
2146
  clear: both;
2132
2147
  list-style: none;
@@ -2197,6 +2212,13 @@ p.has-background {
2197
2212
  .wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
2198
2213
  margin-top: 0.35em;
2199
2214
  }
2215
+ .wp-block-post-comments .comment-reply-title {
2216
+ margin-bottom: 0;
2217
+ }
2218
+ .wp-block-post-comments .comment-reply-title :where(small) {
2219
+ font-size: var(--wp--preset--font-size--medium, smaller);
2220
+ margin-left: 0.5em;
2221
+ }
2200
2222
  .wp-block-post-comments .reply {
2201
2223
  font-size: 0.875em;
2202
2224
  margin-bottom: 1.4em;
@@ -2271,13 +2293,11 @@ p.has-background {
2271
2293
  margin-top: 0.35em;
2272
2294
  }
2273
2295
  .wp-block-post-comments-form .comment-reply-title {
2274
- align-items: baseline;
2275
- display: flex;
2276
- justify-content: space-between;
2277
2296
  margin-bottom: 0;
2278
2297
  }
2279
2298
  .wp-block-post-comments-form .comment-reply-title :where(small) {
2280
2299
  font-size: var(--wp--preset--font-size--medium, smaller);
2300
+ margin-left: 0.5em;
2281
2301
  }
2282
2302
 
2283
2303
  .wp-block-post-excerpt__more-link {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.3.7",
3
+ "version": "7.3.10",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,7 +37,7 @@
37
37
  "@wordpress/api-fetch": "^6.3.1",
38
38
  "@wordpress/autop": "^3.6.1",
39
39
  "@wordpress/blob": "^3.6.1",
40
- "@wordpress/block-editor": "^8.5.6",
40
+ "@wordpress/block-editor": "^8.5.7",
41
41
  "@wordpress/blocks": "^11.5.3",
42
42
  "@wordpress/components": "^19.8.4",
43
43
  "@wordpress/compose": "^5.4.1",
@@ -54,7 +54,7 @@
54
54
  "@wordpress/keycodes": "^3.6.1",
55
55
  "@wordpress/notices": "^3.6.1",
56
56
  "@wordpress/primitives": "^3.4.1",
57
- "@wordpress/reusable-blocks": "^3.4.6",
57
+ "@wordpress/reusable-blocks": "^3.4.7",
58
58
  "@wordpress/rich-text": "^5.4.2",
59
59
  "@wordpress/server-side-render": "^3.4.5",
60
60
  "@wordpress/url": "^3.7.1",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "89fbea298119228eea3ebdc8d30e87033a497f43"
77
+ "gitHead": "d9042594d77ee2d9e28326266de078a505fdf645"
78
78
  }
@@ -23,8 +23,9 @@ function render_block_core_comments_title( $attributes ) {
23
23
  $show_comments_count = ! empty( $attributes['showCommentsCount'] ) && $attributes['showCommentsCount'];
24
24
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
25
25
  $comments_count = get_comments_number();
26
- $post_title = '&#8220;' . get_the_title() . '&#8221;';
27
- $tag_name = 'h2';
26
+ /* translators: %s: Post title. */
27
+ $post_title = sprintf( __( '&#8220;%s&#8221;' ), get_the_title() );
28
+ $tag_name = 'h2';
28
29
  if ( isset( $attributes['level'] ) ) {
29
30
  $tag_name = 'h' . $attributes['level'];
30
31
  }
@@ -37,11 +37,12 @@ function render_block_core_latest_posts( $attributes ) {
37
37
  global $post, $block_core_latest_posts_excerpt_length;
38
38
 
39
39
  $args = array(
40
- 'posts_per_page' => $attributes['postsToShow'],
41
- 'post_status' => 'publish',
42
- 'order' => $attributes['order'],
43
- 'orderby' => $attributes['orderBy'],
44
- 'suppress_filters' => false,
40
+ 'posts_per_page' => $attributes['postsToShow'],
41
+ 'post_status' => 'publish',
42
+ 'order' => $attributes['order'],
43
+ 'orderby' => $attributes['orderBy'],
44
+ 'ignore_sticky_posts' => true,
45
+ 'no_found_rows' => true,
45
46
  );
46
47
 
47
48
  $block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
@@ -54,7 +55,12 @@ function render_block_core_latest_posts( $attributes ) {
54
55
  $args['author'] = $attributes['selectedAuthor'];
55
56
  }
56
57
 
57
- $recent_posts = get_posts( $args );
58
+ $query = new WP_Query;
59
+ $recent_posts = $query->query( $args );
60
+
61
+ if ( isset( $attributes['displayFeaturedImage'] ) && $attributes['displayFeaturedImage'] ) {
62
+ update_post_thumbnail_cache( $query );
63
+ }
58
64
 
59
65
  $list_items_markup = '';
60
66
 
@@ -350,6 +350,41 @@ function block_core_navigation_get_fallback_blocks() {
350
350
  return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks );
351
351
  }
352
352
 
353
+ /**
354
+ * Iterate through all inner blocks recursively and get navigation link block's post IDs.
355
+ *
356
+ * @param WP_Block_List $inner_blocks Block list class instance.
357
+ *
358
+ * @return array Array of post IDs.
359
+ */
360
+ function block_core_navigation_get_post_ids( $inner_blocks ) {
361
+ $post_ids = array_map( 'block_core_navigation_from_block_get_post_ids', iterator_to_array( $inner_blocks ) );
362
+ return array_unique( array_merge( ...$post_ids ) );
363
+ }
364
+
365
+ /**
366
+ * Get post IDs from a navigation link block instance.
367
+ *
368
+ * @param WP_Block $block Instance of a block.
369
+ *
370
+ * @return array Array of post IDs.
371
+ */
372
+ function block_core_navigation_from_block_get_post_ids( $block ) {
373
+ $post_ids = array();
374
+
375
+ if ( $block->inner_blocks ) {
376
+ $post_ids = block_core_navigation_get_post_ids( $block->inner_blocks );
377
+ }
378
+
379
+ if ( 'core/navigation-link' === $block->name || 'core/navigation-submenu' === $block->name ) {
380
+ if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] ) {
381
+ $post_ids[] = $block->attributes['id'];
382
+ }
383
+ }
384
+
385
+ return $post_ids;
386
+ }
387
+
353
388
  /**
354
389
  * Renders the `core/navigation` block on server.
355
390
  *
@@ -501,6 +536,11 @@ function render_block_core_navigation( $attributes, $content, $block ) {
501
536
  $text_decoration ? array( $text_decoration_class ) : array()
502
537
  );
503
538
 
539
+ $post_ids = block_core_navigation_get_post_ids( $inner_blocks );
540
+ if ( $post_ids ) {
541
+ _prime_post_caches( $post_ids, false, false );
542
+ }
543
+
504
544
  $inner_blocks_html = '';
505
545
  $is_list_open = false;
506
546
  foreach ( $inner_blocks as $inner_block ) {
@@ -20,6 +20,7 @@ import {
20
20
  __experimentalUseDisabled as useDisabled,
21
21
  useInstanceId,
22
22
  } from '@wordpress/compose';
23
+ import { createInterpolateElement } from '@wordpress/element';
23
24
 
24
25
  export default function PostCommentsEdit( {
25
26
  attributes: { textAlign },
@@ -110,7 +111,10 @@ export default function PostCommentsEdit( {
110
111
  ref={ disabledRef }
111
112
  >
112
113
  <h3>
113
- { __( 'One response to' ) } “{ postTitle }”
114
+ {
115
+ /* translators: %s: Post title. */
116
+ sprintf( __( 'One response to %s' ), postTitle )
117
+ }
114
118
  </h3>
115
119
 
116
120
  <div className="navigation">
@@ -135,23 +139,43 @@ export default function PostCommentsEdit( {
135
139
  width="32"
136
140
  loading="lazy"
137
141
  />
138
- <b className="fn">
139
- <a href="#top" className="url">
140
- { __(
141
- 'A WordPress Commenter'
142
- ) }
143
- </a>
144
- </b>{ ' ' }
145
- <span className="says">
146
- { __( 'says' ) }:
147
- </span>
142
+ { createInterpolateElement(
143
+ sprintf(
144
+ /* translators: %s: Comment author link. */
145
+ __(
146
+ '%s <span>says:</span>'
147
+ ),
148
+ sprintf(
149
+ '<cite><a>%s</a></cite>',
150
+ __(
151
+ 'A WordPress Commenter'
152
+ )
153
+ )
154
+ ),
155
+ {
156
+ span: (
157
+ <span className="says" />
158
+ ),
159
+ a: (
160
+ /* eslint-disable jsx-a11y/anchor-has-content */
161
+ <a
162
+ href="#top"
163
+ className="url"
164
+ />
165
+ /* eslint-enable jsx-a11y/anchor-has-content */
166
+ ),
167
+ cite: (
168
+ <cite className="fn" />
169
+ ),
170
+ }
171
+ ) }
148
172
  </div>
149
173
 
150
174
  <div className="comment-metadata">
151
175
  <a href="#top">
152
- <time dateTime="2000-01-01T00:00:00+00:00">
176
+ <time dateTime="2000-01-01T12:00:00+00:00">
153
177
  { __(
154
- 'January 1, 2000 at 00:00 am'
178
+ 'January 1, 2000 at 12:00 am'
155
179
  ) }
156
180
  </time>
157
181
  </a>{ ' ' }
@@ -174,13 +198,17 @@ export default function PostCommentsEdit( {
174
198
  'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'
175
199
  ) }
176
200
  <br />
177
- { __(
178
- 'Commenter avatars come from'
179
- ) }{ ' ' }
180
- <a href="https://gravatar.com/">
181
- Gravatar
182
- </a>
183
- .
201
+ { createInterpolateElement(
202
+ __(
203
+ 'Commenter avatars come from <a>Gravatar</a>'
204
+ ),
205
+ {
206
+ a: (
207
+ /* eslint-disable-next-line jsx-a11y/anchor-has-content */
208
+ <a href="https://gravatar.com/" />
209
+ ),
210
+ }
211
+ ) }
184
212
  </p>
185
213
  </div>
186
214
 
@@ -188,7 +216,11 @@ export default function PostCommentsEdit( {
188
216
  <a
189
217
  className="comment-reply-link"
190
218
  href="#top"
191
- aria-label="Reply to A WordPress Commenter"
219
+ aria-label={ sprintf(
220
+ /* translators: Comment reply button text. %s: Comment author name. */
221
+ __( 'Reply to %s' ),
222
+ __( 'A WordPress Commenter' )
223
+ ) }
192
224
  >
193
225
  { __( 'Reply' ) }
194
226
  </a>
@@ -1,4 +1,22 @@
1
1
  .wp-block-post-comments {
2
+ /* utility classes */
3
+ .alignleft {
4
+ float: left;
5
+ }
6
+
7
+ .alignright {
8
+ float: right;
9
+ }
10
+ /* end utility classes */
11
+
12
+ .navigation {
13
+ &::after {
14
+ content: "";
15
+ display: table;
16
+ clear: both;
17
+ }
18
+ }
19
+
2
20
  .commentlist {
3
21
  clear: both;
4
22
  list-style: none;
@@ -86,6 +104,14 @@
86
104
  }
87
105
  }
88
106
 
107
+ .comment-reply-title {
108
+ margin-bottom: 0;
109
+ :where(small) {
110
+ font-size: var(--wp--preset--font-size--medium, smaller);
111
+ margin-left: 0.5em;
112
+ }
113
+ }
114
+
89
115
  .reply {
90
116
  font-size: 0.875em;
91
117
  margin-bottom: 1.4em;
@@ -69,13 +69,10 @@
69
69
  }
70
70
 
71
71
  .comment-reply-title {
72
- align-items: baseline;
73
- display: flex;
74
- justify-content: space-between;
75
72
  margin-bottom: 0;
76
-
77
73
  :where(small) {
78
74
  font-size: var(--wp--preset--font-size--medium, smaller);
75
+ margin-left: 0.5em;
79
76
  }
80
77
  }
81
78
  }
@@ -5,6 +5,32 @@
5
5
  * @package WordPress
6
6
  */
7
7
 
8
+ /**
9
+ * Determines whether a block list contains a block that uses the featured image.
10
+ *
11
+ * @param WP_Block_List $inner_blocks Inner block instance.
12
+ *
13
+ * @return bool Whether the block list contains a block that uses the featured image.
14
+ */
15
+ function block_core_post_template_uses_featured_image( $inner_blocks ) {
16
+ foreach ( $inner_blocks as $block ) {
17
+ if ( 'core/post-featured-image' === $block->name ) {
18
+ return true;
19
+ }
20
+ if (
21
+ 'core/cover' === $block->name &&
22
+ ! empty( $block->attributes['useFeaturedImage'] )
23
+ ) {
24
+ return true;
25
+ }
26
+ if ( $block->inner_blocks && block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
27
+ return true;
28
+ }
29
+ }
30
+
31
+ return false;
32
+ }
33
+
8
34
  /**
9
35
  * Renders the `core/post-template` block on the server.
10
36
  *
@@ -40,6 +66,10 @@ function render_block_core_post_template( $attributes, $content, $block ) {
40
66
  return '';
41
67
  }
42
68
 
69
+ if ( block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
70
+ update_post_thumbnail_cache( $query );
71
+ }
72
+
43
73
  $classnames = '';
44
74
  if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) {
45
75
  if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) {