@wordpress/block-library 7.3.2 → 7.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/build/comment-template/hooks.js +11 -3
  2. package/build/comment-template/hooks.js.map +1 -1
  3. package/build/comments-pagination/edit.js +18 -1
  4. package/build/comments-pagination/edit.js.map +1 -1
  5. package/build/comments-query-loop/edit.js +2 -2
  6. package/build/comments-query-loop/edit.js.map +1 -1
  7. package/build/comments-title/edit.js +149 -0
  8. package/build/comments-title/edit.js.map +1 -0
  9. package/build/comments-title/index.js +101 -0
  10. package/build/comments-title/index.js.map +1 -0
  11. package/build/index.js +4 -2
  12. package/build/index.js.map +1 -1
  13. package/build/navigation/edit/index.js +17 -1
  14. package/build/navigation/edit/index.js.map +1 -1
  15. package/build/navigation/edit/navigation-menu-selector.js +7 -2
  16. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  17. package/build/post-comments/edit.js +141 -35
  18. package/build/post-comments/edit.js.map +1 -1
  19. package/build/post-comments/index.js +2 -1
  20. package/build/post-comments/index.js.map +1 -1
  21. package/build/post-comments-form/edit.js +22 -1
  22. package/build/post-comments-form/edit.js.map +1 -1
  23. package/build/post-comments-form/index.js +1 -0
  24. package/build/post-comments-form/index.js.map +1 -1
  25. package/build/query-no-results/edit.js +1 -1
  26. package/build/query-no-results/edit.js.map +1 -1
  27. package/build-module/comment-template/hooks.js +11 -3
  28. package/build-module/comment-template/hooks.js.map +1 -1
  29. package/build-module/comments-pagination/edit.js +19 -2
  30. package/build-module/comments-pagination/edit.js.map +1 -1
  31. package/build-module/comments-query-loop/edit.js +2 -2
  32. package/build-module/comments-query-loop/edit.js.map +1 -1
  33. package/build-module/comments-title/edit.js +133 -0
  34. package/build-module/comments-title/edit.js.map +1 -0
  35. package/build-module/comments-title/index.js +88 -0
  36. package/build-module/comments-title/index.js.map +1 -0
  37. package/build-module/index.js +3 -2
  38. package/build-module/index.js.map +1 -1
  39. package/build-module/navigation/edit/index.js +17 -1
  40. package/build-module/navigation/edit/index.js.map +1 -1
  41. package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
  42. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  43. package/build-module/post-comments/edit.js +143 -38
  44. package/build-module/post-comments/edit.js.map +1 -1
  45. package/build-module/post-comments/index.js +2 -1
  46. package/build-module/post-comments/index.js.map +1 -1
  47. package/build-module/post-comments-form/edit.js +21 -1
  48. package/build-module/post-comments-form/edit.js.map +1 -1
  49. package/build-module/post-comments-form/index.js +1 -0
  50. package/build-module/post-comments-form/index.js.map +1 -1
  51. package/build-module/query-no-results/edit.js +1 -1
  52. package/build-module/query-no-results/edit.js.map +1 -1
  53. package/build-style/comments-title/editor-rtl.css +79 -0
  54. package/build-style/comments-title/editor.css +79 -0
  55. package/build-style/editor-rtl.css +12 -0
  56. package/build-style/editor.css +12 -0
  57. package/build-style/post-comments/editor-rtl.css +79 -0
  58. package/build-style/post-comments/editor.css +79 -0
  59. package/build-style/post-comments/style-rtl.css +1 -3
  60. package/build-style/post-comments/style.css +1 -3
  61. package/build-style/post-comments-form/editor-rtl.css +79 -0
  62. package/build-style/post-comments-form/editor.css +79 -0
  63. package/build-style/post-comments-form/style-rtl.css +9 -0
  64. package/build-style/post-comments-form/style.css +9 -0
  65. package/build-style/style-rtl.css +10 -3
  66. package/build-style/style.css +10 -3
  67. package/package.json +9 -9
  68. package/src/comment-edit-link/index.php +1 -4
  69. package/src/comment-reply-link/index.php +1 -4
  70. package/src/comment-template/hooks.js +13 -1
  71. package/src/comment-template/index.php +13 -4
  72. package/src/comments-pagination/edit.js +23 -0
  73. package/src/comments-query-loop/edit.js +2 -0
  74. package/src/comments-title/block.json +70 -0
  75. package/src/comments-title/edit.js +197 -0
  76. package/src/comments-title/editor.scss +4 -0
  77. package/src/comments-title/index.js +18 -0
  78. package/src/comments-title/index.php +68 -0
  79. package/src/editor.scss +3 -0
  80. package/src/index.js +4 -1
  81. package/src/navigation/edit/index.js +24 -0
  82. package/src/navigation/edit/navigation-menu-selector.js +15 -9
  83. package/src/post-comments/block.json +2 -1
  84. package/src/post-comments/edit.js +204 -44
  85. package/src/post-comments/editor.scss +3 -0
  86. package/src/post-comments/style.scss +1 -5
  87. package/src/post-comments-form/block.json +1 -0
  88. package/src/post-comments-form/edit.js +39 -2
  89. package/src/post-comments-form/editor.scss +3 -0
  90. package/src/post-comments-form/style.scss +11 -0
  91. package/src/query-no-results/edit.js +1 -1
@@ -8,51 +8,64 @@ import classnames from 'classnames';
8
8
  * WordPress dependencies
9
9
  */
10
10
 
11
+ import { AlignmentControl, BlockControls, Warning, useBlockProps, store as blockEditorStore } from '@wordpress/block-editor';
12
+ import { __, sprintf } from '@wordpress/i18n';
11
13
  import { useSelect } from '@wordpress/data';
12
- import { AlignmentControl, BlockControls, Warning, useBlockProps } from '@wordpress/block-editor';
13
- import { __ } from '@wordpress/i18n';
14
- import { RawHTML } from '@wordpress/element';
15
- import { store as coreStore } from '@wordpress/core-data';
16
-
17
- function PostCommentsDisplay(_ref) {
14
+ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
15
+ import { __experimentalUseDisabled as useDisabled, useInstanceId } from '@wordpress/compose';
16
+ export default function PostCommentsEdit(_ref) {
18
17
  let {
19
- postId
18
+ attributes: {
19
+ textAlign
20
+ },
21
+ setAttributes,
22
+ context: {
23
+ postType,
24
+ postId
25
+ }
20
26
  } = _ref;
21
- return useSelect(select => {
22
- const comments = select(coreStore).getEntityRecords('root', 'comment', {
23
- post: postId
24
- }); // TODO: "No Comments" placeholder should be editable.
27
+ let [postTitle] = useEntityProp('postType', postType, 'title', postId);
28
+ postTitle = postTitle || __('Post Title');
29
+ const [commentStatus] = useEntityProp('postType', postType, 'comment_status', postId);
30
+ const {
31
+ avatarURL,
32
+ defaultCommentStatus
33
+ } = useSelect(select => select(blockEditorStore).getSettings().__experimentalDiscussionSettings);
34
+ const isSiteEditor = postType === undefined || postId === undefined;
35
+ const postTypeSupportsComments = useSelect(select => {
36
+ var _select$getPostType;
25
37
 
26
- return comments && comments.length ? comments.map(comment => createElement(RawHTML, {
27
- className: "wp-block-post-comments__comment",
28
- key: comment.id
29
- }, comment.content.rendered)) : __('No comments.');
30
- }, [postId]);
31
- }
38
+ return postType ? !!((_select$getPostType = select(coreStore).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
39
+ });
40
+
41
+ let warning = __('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.');
42
+
43
+ let showPlacholder = true;
44
+
45
+ if (!isSiteEditor && 'open' !== commentStatus) {
46
+ if ('closed' === commentStatus) {
47
+ warning = sprintf(
48
+ /* translators: 1: Post type (i.e. "post", "page") */
49
+ __('Post Comments block: Comments to this %s are not allowed.'), postType);
50
+ showPlacholder = false;
51
+ } else if (!postTypeSupportsComments) {
52
+ warning = sprintf(
53
+ /* translators: 1: Post type (i.e. "post", "page") */
54
+ __('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
55
+ showPlacholder = false;
56
+ } else if ('open' !== defaultCommentStatus) {
57
+ warning = __('Post Comments block: Comments are not enabled.');
58
+ showPlacholder = false;
59
+ }
60
+ }
32
61
 
33
- export default function PostCommentsEdit(_ref2) {
34
- let {
35
- attributes,
36
- setAttributes,
37
- context
38
- } = _ref2;
39
- const {
40
- postType,
41
- postId
42
- } = context;
43
- const {
44
- textAlign
45
- } = attributes;
46
62
  const blockProps = useBlockProps({
47
63
  className: classnames({
48
64
  [`has-text-align-${textAlign}`]: textAlign
49
65
  })
50
66
  });
51
-
52
- if (!postType || !postId) {
53
- return createElement("div", blockProps, createElement(Warning, null, __('Post comments block: no post found.')));
54
- }
55
-
67
+ const disabledRef = useDisabled();
68
+ const textareaId = useInstanceId(PostCommentsEdit);
56
69
  return createElement(Fragment, null, createElement(BlockControls, {
57
70
  group: "block"
58
71
  }, createElement(AlignmentControl, {
@@ -62,8 +75,100 @@ export default function PostCommentsEdit(_ref2) {
62
75
  textAlign: nextAlign
63
76
  });
64
77
  }
65
- })), createElement("div", blockProps, createElement(PostCommentsDisplay, {
66
- postId: postId
67
- })));
78
+ })), createElement("div", blockProps, createElement(Warning, null, warning), showPlacholder && createElement("div", {
79
+ className: "wp-block-post-comments__placeholder",
80
+ ref: disabledRef
81
+ }, createElement("h3", null, __('One response to'), " \u201C", postTitle, "\u201D"), createElement("div", {
82
+ className: "navigation"
83
+ }, createElement("div", {
84
+ className: "alignleft"
85
+ }, createElement("a", {
86
+ href: "#top"
87
+ }, "\xAB ", __('Older Comments'))), createElement("div", {
88
+ className: "alignright"
89
+ }, createElement("a", {
90
+ href: "#top"
91
+ }, __('Newer Comments'), " \xBB"))), createElement("ol", {
92
+ className: "commentlist"
93
+ }, createElement("li", {
94
+ className: "comment even thread-even depth-1"
95
+ }, createElement("article", {
96
+ className: "comment-body"
97
+ }, createElement("footer", {
98
+ className: "comment-meta"
99
+ }, createElement("div", {
100
+ className: "comment-author vcard"
101
+ }, createElement("img", {
102
+ alt: "Commenter Avatar",
103
+ src: avatarURL,
104
+ className: "avatar avatar-32 photo",
105
+ height: "32",
106
+ width: "32",
107
+ 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", {
116
+ className: "comment-metadata"
117
+ }, createElement("a", {
118
+ href: "#top"
119
+ }, createElement("time", {
120
+ dateTime: "2000-01-01T00:00:00+00:00"
121
+ }, __('January 1, 2000 at 00:00 am'))), ' ', createElement("span", {
122
+ className: "edit-link"
123
+ }, createElement("a", {
124
+ className: "comment-edit-link",
125
+ href: "#top"
126
+ }, __('Edit'))))), createElement("div", {
127
+ 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", {
131
+ className: "reply"
132
+ }, createElement("a", {
133
+ className: "comment-reply-link",
134
+ href: "#top",
135
+ "aria-label": "Reply to A WordPress Commenter"
136
+ }, __('Reply')))))), createElement("div", {
137
+ className: "navigation"
138
+ }, createElement("div", {
139
+ className: "alignleft"
140
+ }, createElement("a", {
141
+ href: "#top"
142
+ }, "\xAB ", __('Older Comments'))), createElement("div", {
143
+ className: "alignright"
144
+ }, createElement("a", {
145
+ href: "#top"
146
+ }, __('Newer Comments'), " \xBB"))), createElement("div", {
147
+ className: "comment-respond"
148
+ }, createElement("h3", {
149
+ className: "comment-reply-title"
150
+ }, __('Leave a Reply')), createElement("form", {
151
+ className: "comment-form",
152
+ noValidate: true
153
+ }, createElement("p", {
154
+ className: "comment-form-comment"
155
+ }, createElement("label", {
156
+ htmlFor: `comment-${textareaId}`
157
+ }, __('Comment'), ' ', createElement("span", {
158
+ className: "required"
159
+ }, "*")), createElement("textarea", {
160
+ id: `comment-${textareaId}`,
161
+ name: "comment",
162
+ cols: "45",
163
+ rows: "8",
164
+ required: true
165
+ })), createElement("p", {
166
+ className: "form-submit wp-block-button"
167
+ }, createElement("input", {
168
+ name: "submit",
169
+ type: "submit",
170
+ className: "submit wp-block-button__link",
171
+ value: __('Post Comment')
172
+ })))))));
68
173
  }
69
174
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["classnames","useSelect","AlignmentControl","BlockControls","Warning","useBlockProps","__","RawHTML","store","coreStore","PostCommentsDisplay","postId","select","comments","getEntityRecords","post","length","map","comment","id","content","rendered","PostCommentsEdit","attributes","setAttributes","context","postType","textAlign","blockProps","className","nextAlign"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AA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A8B;AAC7B,WACC,qBAAUiB,UAAV,EACC,cAAC,OAAD,QACGtB,EAAE,CAAE,qCAAF,CADL,CADD,CADD;AAOA;;AAED,SACC,8BACC,cAAC,aAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,cAAC,gBAAD;AACC,IAAA,KAAK,EAAGqB,SADT;AAEC,IAAA,QAAQ,EAAKG,SAAF,IAAiB;AAC3BN,MAAAA,aAAa,CAAE;AAAEG,QAAAA,SAAS,EAAEG;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EAUC,qBAAUF,UAAV,EACC,cAAC,mBAAD;AAAqB,IAAA,MAAM,EAAGjB;AAA9B,IADD,CAVD,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostCommentsDisplay( { postId } ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst comments = select( coreStore ).getEntityRecords(\n\t\t\t\t'root',\n\t\t\t\t'comment',\n\t\t\t\t{\n\t\t\t\t\tpost: postId,\n\t\t\t\t}\n\t\t\t);\n\t\t\t// TODO: \"No Comments\" placeholder should be editable.\n\t\t\treturn comments && comments.length\n\t\t\t\t? comments.map( ( comment ) => (\n\t\t\t\t\t\t<RawHTML\n\t\t\t\t\t\t\tclassName=\"wp-block-post-comments__comment\"\n\t\t\t\t\t\t\tkey={ comment.id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ comment.content.rendered }\n\t\t\t\t\t\t</RawHTML>\n\t\t\t\t ) )\n\t\t\t\t: __( 'No comments.' );\n\t\t},\n\t\t[ postId ]\n\t);\n}\n\nexport default function PostCommentsEdit( {\n\tattributes,\n\tsetAttributes,\n\tcontext,\n} ) {\n\tconst { postType, postId } = context;\n\tconst { textAlign } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tif ( ! postType || ! postId ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Post comments block: no post found.' ) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\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<PostCommentsDisplay postId={ postId } />\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","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,SAAS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E,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"]}
@@ -44,7 +44,8 @@ const metadata = {
44
44
  },
45
45
  inserter: false
46
46
  },
47
- style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"]
47
+ style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"],
48
+ editorStyle: "wp-block-post-comments-editor"
48
49
  };
49
50
  import edit from './edit';
50
51
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/index.js"],"names":["postComments","icon","edit","name","metadata","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,IAAIC,IAAzB,QAAqC,kBAArC;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBJ,EAAAA,IADuB;AAEvBC,EAAAA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postComments as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-comments/index.js"],"names":["postComments","icon","edit","name","metadata","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,IAAIC,IAAzB,QAAqC,kBAArC;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBJ,EAAAA,IADuB;AAEvBC,EAAAA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postComments as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
@@ -11,6 +11,7 @@ import classnames from 'classnames';
11
11
  import { AlignmentControl, BlockControls, Warning, useBlockProps } from '@wordpress/block-editor';
12
12
  import { useEntityProp } from '@wordpress/core-data';
13
13
  import { __, sprintf } from '@wordpress/i18n';
14
+ import { __experimentalUseDisabled as useDisabled, useInstanceId } from '@wordpress/compose';
14
15
  export default function PostCommentsFormEdit(_ref) {
15
16
  let {
16
17
  attributes,
@@ -31,6 +32,8 @@ export default function PostCommentsFormEdit(_ref) {
31
32
  })
32
33
  });
33
34
  const isInSiteEditor = postType === undefined || postId === undefined;
35
+ const disabledFormRef = useDisabled();
36
+ const instanceId = useInstanceId(PostCommentsFormEdit);
34
37
  return createElement(Fragment, null, createElement(BlockControls, {
35
38
  group: "block"
36
39
  }, createElement(AlignmentControl, {
@@ -42,6 +45,23 @@ export default function PostCommentsFormEdit(_ref) {
42
45
  }
43
46
  })), createElement("div", blockProps, !commentStatus && !isInSiteEditor && createElement(Warning, null, __('Post Comments Form block: comments are not enabled for this post type.')), 'open' !== commentStatus && !isInSiteEditor && createElement(Warning, null, sprintf(
44
47
  /* translators: 1: Post type (i.e. "post", "page") */
45
- __('Post Comments Form block: comments to this %s are not allowed.'), postType)), ('open' === commentStatus || isInSiteEditor) && __('Post Comments Form')));
48
+ __('Post Comments Form block: comments to this %s are not allowed.'), postType)), ('open' === commentStatus || isInSiteEditor) && createElement("div", null, createElement("h3", null, __('Leave a Reply')), createElement("form", {
49
+ noValidate: true,
50
+ className: "comment-form",
51
+ ref: disabledFormRef
52
+ }, createElement("p", null, createElement("label", {
53
+ htmlFor: `comment-${instanceId}`
54
+ }, __('Comment')), createElement("textarea", {
55
+ id: `comment-${instanceId}`,
56
+ name: "comment",
57
+ cols: "45",
58
+ rows: "8"
59
+ })), createElement("p", null, createElement("input", {
60
+ name: "submit",
61
+ className: "submit wp-block-button__link",
62
+ label: __('Post Comment'),
63
+ value: __('Post Comment'),
64
+ readOnly: true
65
+ }))))));
46
66
  }
47
67
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments-form/edit.js"],"names":["classnames","AlignmentControl","BlockControls","Warning","useBlockProps","useEntityProp","__","sprintf","PostCommentsFormEdit","attributes","context","setAttributes","textAlign","postId","postType","commentStatus","blockProps","className","isInSiteEditor","undefined","nextAlign"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,aAFD,EAGCC,OAHD,EAICC,aAJD,QAKO,yBALP;AAMA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AAEA,eAAe,SAASC,oBAAT,OAIX;AAAA,MAJ0C;AAC7CC,IAAAA,UAD6C;AAE7CC,IAAAA,OAF6C;AAG7CC,IAAAA;AAH6C,GAI1C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAgBH,UAAtB;AACA,QAAM;AAAEI,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAuBJ,OAA7B;AACA,QAAM,CAAEK,aAAF,IAAoBV,aAAa,CACtC,UADsC,EAEtCS,QAFsC,EAGtC,gBAHsC,EAItCD,MAJsC,CAAvC;AAMA,QAAMG,UAAU,GAAGZ,aAAa,CAAE;AACjCa,IAAAA,SAAS,EAAEjB,UAAU,CAAE;AACtB,OAAG,kBAAkBY,SAAW,EAAhC,GAAqCA;AADf,KAAF;AADY,GAAF,CAAhC;AAMA,QAAMM,cAAc,GAAGJ,QAAQ,KAAKK,SAAb,IAA0BN,MAAM,KAAKM,SAA5D;AAEA,SACC,8BACC,cAAC,aAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,cAAC,gBAAD;AACC,IAAA,KAAK,EAAGP,SADT;AAEC,IAAA,QAAQ,EAAKQ,SAAF,IAAiB;AAC3BT,MAAAA,aAAa,CAAE;AAAEC,QAAAA,SAAS,EAAEQ;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,qBAAUJ,UAAV,EACG,CAAED,aAAF,IAAmB,CAAEG,cAArB,IACD,cAAC,OAAD,QACGZ,EAAE,CACH,wEADG,CADL,CAFF,EASG,WAAWS,aAAX,IAA4B,CAAEG,cAA9B,IACD,cAAC,OAAD,QACGX,OAAO;AACR;AACAD,EAAAA,EAAE,CACD,gEADC,CAFM,EAKRQ,QALQ,CADV,CAVF,EAqBG,CAAE,WAAWC,aAAX,IAA4BG,cAA9B,KACDZ,EAAE,CAAE,oBAAF,CAtBJ,CATD,CADD;AAoCA","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} from '@wordpress/block-editor';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nexport default function PostCommentsFormEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId, postType } = context;\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\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 isInSiteEditor = postType === undefined || postId === undefined;\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\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! commentStatus && ! isInSiteEditor && (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Post Comments Form block: comments are not enabled for this post type.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\n\t\t\t\t{ 'open' !== commentStatus && ! isInSiteEditor && (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'Post Comments Form block: comments to this %s are not allowed.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tpostType\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\n\t\t\t\t{ ( 'open' === commentStatus || isInSiteEditor ) &&\n\t\t\t\t\t__( 'Post Comments Form' ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-comments-form/edit.js"],"names":["classnames","AlignmentControl","BlockControls","Warning","useBlockProps","useEntityProp","__","sprintf","__experimentalUseDisabled","useDisabled","useInstanceId","PostCommentsFormEdit","attributes","context","setAttributes","textAlign","postId","postType","commentStatus","blockProps","className","isInSiteEditor","undefined","disabledFormRef","instanceId","nextAlign"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,aAFD,EAGCC,OAHD,EAICC,aAJD,QAKO,yBALP;AAMA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,yBAAyB,IAAIC,WAD9B,EAECC,aAFD,QAGO,oBAHP;AAKA,eAAe,SAASC,oBAAT,OAIX;AAAA,MAJ0C;AAC7CC,IAAAA,UAD6C;AAE7CC,IAAAA,OAF6C;AAG7CC,IAAAA;AAH6C,GAI1C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAgBH,UAAtB;AACA,QAAM;AAAEI,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAuBJ,OAA7B;AACA,QAAM,CAAEK,aAAF,IAAoBb,aAAa,CACtC,UADsC,EAEtCY,QAFsC,EAGtC,gBAHsC,EAItCD,MAJsC,CAAvC;AAMA,QAAMG,UAAU,GAAGf,aAAa,CAAE;AACjCgB,IAAAA,SAAS,EAAEpB,UAAU,CAAE;AACtB,OAAG,kBAAkBe,SAAW,EAAhC,GAAqCA;AADf,KAAF;AADY,GAAF,CAAhC;AAMA,QAAMM,cAAc,GAAGJ,QAAQ,KAAKK,SAAb,IAA0BN,MAAM,KAAKM,SAA5D;AAEA,QAAMC,eAAe,GAAGd,WAAW,EAAnC;AAEA,QAAMe,UAAU,GAAGd,aAAa,CAAEC,oBAAF,CAAhC;AAEA,SACC,8BACC,cAAC,aAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,cAAC,gBAAD;AACC,IAAA,KAAK,EAAGI,SADT;AAEC,IAAA,QAAQ,EAAKU,SAAF,IAAiB;AAC3BX,MAAAA,aAAa,CAAE;AAAEC,QAAAA,SAAS,EAAEU;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,qBAAUN,UAAV,EACG,CAAED,aAAF,IAAmB,CAAEG,cAArB,IACD,cAAC,OAAD,QACGf,EAAE,CACH,wEADG,CADL,CAFF,EASG,WAAWY,aAAX,IAA4B,CAAEG,cAA9B,IACD,cAAC,OAAD,QACGd,OAAO;AACR;AACAD,EAAAA,EAAE,CACD,gEADC,CAFM,EAKRW,QALQ,CADV,CAVF,EAqBG,CAAE,WAAWC,aAAX,IAA4BG,cAA9B,KACD,2BACC,0BAAMf,EAAE,CAAE,eAAF,CAAR,CADD,EAEC;AACC,IAAA,UAAU,MADX;AAEC,IAAA,SAAS,EAAC,cAFX;AAGC,IAAA,GAAG,EAAGiB;AAHP,KAKC,yBACC;AAAO,IAAA,OAAO,EAAI,WAAWC,UAAY;AAAzC,KACGlB,EAAE,CAAE,SAAF,CADL,CADD,EAIC;AACC,IAAA,EAAE,EAAI,WAAWkB,UAAY,EAD9B;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,IAAA,IAAI,EAAC,IAHN;AAIC,IAAA,IAAI,EAAC;AAJN,IAJD,CALD,EAgBC,yBACC;AACC,IAAA,IAAI,EAAC,QADN;AAEC,IAAA,SAAS,EAAC,8BAFX;AAGC,IAAA,KAAK,EAAGlB,EAAE,CAAE,cAAF,CAHX;AAIC,IAAA,KAAK,EAAGA,EAAE,CAAE,cAAF,CAJX;AAKC,IAAA,QAAQ;AALT,IADD,CAhBD,CAFD,CAtBF,CATD,CADD;AAiEA","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} from '@wordpress/block-editor';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalUseDisabled as useDisabled,\n\tuseInstanceId,\n} from '@wordpress/compose';\n\nexport default function PostCommentsFormEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId, postType } = context;\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\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 isInSiteEditor = postType === undefined || postId === undefined;\n\n\tconst disabledFormRef = useDisabled();\n\n\tconst instanceId = useInstanceId( PostCommentsFormEdit );\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\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! commentStatus && ! isInSiteEditor && (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Post Comments Form block: comments are not enabled for this post type.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\n\t\t\t\t{ 'open' !== commentStatus && ! isInSiteEditor && (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'Post Comments Form block: comments to this %s are not allowed.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tpostType\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\n\t\t\t\t{ ( 'open' === commentStatus || isInSiteEditor ) && (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h3>{ __( 'Leave a Reply' ) }</h3>\n\t\t\t\t\t\t<form\n\t\t\t\t\t\t\tnoValidate\n\t\t\t\t\t\t\tclassName=\"comment-form\"\n\t\t\t\t\t\t\tref={ disabledFormRef }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label htmlFor={ `comment-${ instanceId }` }>\n\t\t\t\t\t\t\t\t\t{ __( 'Comment' ) }\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\tid={ `comment-${ instanceId }` }\n\t\t\t\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\t\t\t\tclassName=\"submit wp-block-button__link\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Post Comment' ) }\n\t\t\t\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
@@ -42,6 +42,7 @@ const metadata = {
42
42
  }
43
43
  }
44
44
  },
45
+ editorStyle: "wp-block-post-comments-form-editor",
45
46
  style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
46
47
  };
47
48
  import edit from './edit';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments-form/index.js"],"names":["postCommentsForm","icon","edit","name","metadata","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,IAAIC,IAA7B,QAAyC,kBAAzC;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBJ,EAAAA,IADuB;AAEvBC,EAAAA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsForm as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-comments-form/index.js"],"names":["postCommentsForm","icon","edit","name","metadata","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,IAAIC,IAA7B,QAAyC,kBAAzC;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBJ,EAAAA,IADuB;AAEvBC,EAAAA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsForm as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
@@ -6,7 +6,7 @@ import { createElement, Fragment } from "@wordpress/element";
6
6
  import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  const TEMPLATE = [['core/paragraph', {
9
- placeholder: __('Add a text or blocks that will display when the query returns no results.')
9
+ placeholder: __('Add text or blocks that will display when the query returns no results.')
10
10
  }]];
11
11
  export default function QueryNoResultsEdit() {
12
12
  const blockProps = useBlockProps();
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-no-results/edit.js"],"names":["useBlockProps","useInnerBlocksProps","__","TEMPLATE","placeholder","QueryNoResultsEdit","blockProps","innerBlocksProps","template"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,mBAAxB,QAAmD,yBAAnD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAEF,EAAE,CACd,2EADc;AADhB,CAFD,CADgB,CAAjB;AAWA,eAAe,SAASG,kBAAT,GAA8B;AAC5C,QAAMC,UAAU,GAAGN,aAAa,EAAhC;AACA,QAAMO,gBAAgB,GAAGN,mBAAmB,CAAEK,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAEL;AAD+C,GAAd,CAA5C;AAGA,SACC,8BACC,qBAAUI,gBAAV,CADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\nconst TEMPLATE = [\n\t[\n\t\t'core/paragraph',\n\t\t{\n\t\t\tplaceholder: __(\n\t\t\t\t'Add a text or blocks that will display when the query returns no results.'\n\t\t\t),\n\t\t},\n\t],\n];\n\nexport default function QueryNoResultsEdit() {\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\treturn (\n\t\t<>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/query-no-results/edit.js"],"names":["useBlockProps","useInnerBlocksProps","__","TEMPLATE","placeholder","QueryNoResultsEdit","blockProps","innerBlocksProps","template"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,mBAAxB,QAAmD,yBAAnD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAEF,EAAE,CACd,yEADc;AADhB,CAFD,CADgB,CAAjB;AAWA,eAAe,SAASG,kBAAT,GAA8B;AAC5C,QAAMC,UAAU,GAAGN,aAAa,EAAhC;AACA,QAAMO,gBAAgB,GAAGN,mBAAmB,CAAEK,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAEL;AAD+C,GAAd,CAA5C;AAGA,SACC,8BACC,qBAAUI,gBAAV,CADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\nconst TEMPLATE = [\n\t[\n\t\t'core/paragraph',\n\t\t{\n\t\t\tplaceholder: __(\n\t\t\t\t'Add text or blocks that will display when the query returns no results.'\n\t\t\t),\n\t\t},\n\t],\n];\n\nexport default function QueryNoResultsEdit() {\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\treturn (\n\t\t<>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Colors
3
+ */
4
+ /**
5
+ * Breakpoints & Media Queries
6
+ */
7
+ /**
8
+ * SCSS Variables.
9
+ *
10
+ * Please use variables from this sheet to ensure consistency across the UI.
11
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
12
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
13
+ */
14
+ /**
15
+ * Colors
16
+ */
17
+ /**
18
+ * Fonts & basic variables.
19
+ */
20
+ /**
21
+ * Grid System.
22
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
23
+ */
24
+ /**
25
+ * Dimensions.
26
+ */
27
+ /**
28
+ * Shadows.
29
+ */
30
+ /**
31
+ * Editor widths.
32
+ */
33
+ /**
34
+ * Block & Editor UI.
35
+ */
36
+ /**
37
+ * Block paddings.
38
+ */
39
+ /**
40
+ * React Native specific.
41
+ * These variables do not appear to be used anywhere else.
42
+ */
43
+ /**
44
+ * Converts a hex value into the rgb equivalent.
45
+ *
46
+ * @param {string} hex - the hexadecimal value to convert
47
+ * @return {string} comma separated rgb values
48
+ */
49
+ /**
50
+ * Breakpoint mixins
51
+ */
52
+ /**
53
+ * Long content fade mixin
54
+ *
55
+ * Creates a fading overlay to signify that the content is longer
56
+ * than the space allows.
57
+ */
58
+ /**
59
+ * Focus styles.
60
+ */
61
+ /**
62
+ * Applies editor left position to the selector passed as argument
63
+ */
64
+ /**
65
+ * Styles that are reused verbatim in a few places
66
+ */
67
+ /**
68
+ * Allows users to opt-out of animations via OS-level preferences.
69
+ */
70
+ /**
71
+ * Reset default styles for JavaScript UI based pages.
72
+ * This is a WP-admin agnostic reset
73
+ */
74
+ /**
75
+ * Reset the WP Admin page styles for Gutenberg-like pages.
76
+ */
77
+ .wp-block-comments-title.has-background {
78
+ padding: inherit;
79
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Colors
3
+ */
4
+ /**
5
+ * Breakpoints & Media Queries
6
+ */
7
+ /**
8
+ * SCSS Variables.
9
+ *
10
+ * Please use variables from this sheet to ensure consistency across the UI.
11
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
12
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
13
+ */
14
+ /**
15
+ * Colors
16
+ */
17
+ /**
18
+ * Fonts & basic variables.
19
+ */
20
+ /**
21
+ * Grid System.
22
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
23
+ */
24
+ /**
25
+ * Dimensions.
26
+ */
27
+ /**
28
+ * Shadows.
29
+ */
30
+ /**
31
+ * Editor widths.
32
+ */
33
+ /**
34
+ * Block & Editor UI.
35
+ */
36
+ /**
37
+ * Block paddings.
38
+ */
39
+ /**
40
+ * React Native specific.
41
+ * These variables do not appear to be used anywhere else.
42
+ */
43
+ /**
44
+ * Converts a hex value into the rgb equivalent.
45
+ *
46
+ * @param {string} hex - the hexadecimal value to convert
47
+ * @return {string} comma separated rgb values
48
+ */
49
+ /**
50
+ * Breakpoint mixins
51
+ */
52
+ /**
53
+ * Long content fade mixin
54
+ *
55
+ * Creates a fading overlay to signify that the content is longer
56
+ * than the space allows.
57
+ */
58
+ /**
59
+ * Focus styles.
60
+ */
61
+ /**
62
+ * Applies editor left position to the selector passed as argument
63
+ */
64
+ /**
65
+ * Styles that are reused verbatim in a few places
66
+ */
67
+ /**
68
+ * Allows users to opt-out of animations via OS-level preferences.
69
+ */
70
+ /**
71
+ * Reset default styles for JavaScript UI based pages.
72
+ * This is a WP-admin agnostic reset
73
+ */
74
+ /**
75
+ * Reset the WP Admin page styles for Gutenberg-like pages.
76
+ */
77
+ .wp-block-comments-title.has-background {
78
+ padding: inherit;
79
+ }
@@ -287,6 +287,10 @@ html :where(.wp-block-column) {
287
287
  margin-right: 0;
288
288
  }
289
289
 
290
+ .wp-block-comments-title.has-background {
291
+ padding: inherit;
292
+ }
293
+
290
294
  .wp-block-cover {
291
295
  /* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */
292
296
  }
@@ -2690,6 +2694,14 @@ div[data-type="core/post-featured-image"] img {
2690
2694
  display: block;
2691
2695
  }
2692
2696
 
2697
+ .wp-block-post-comments__placeholder * {
2698
+ pointer-events: none;
2699
+ }
2700
+
2701
+ .wp-block-post-comments-form * {
2702
+ pointer-events: none;
2703
+ }
2704
+
2693
2705
  :root .editor-styles-wrapper {
2694
2706
  /*
2695
2707
  * Our classes uses the same values we set for gradient value attributes,
@@ -291,6 +291,10 @@ html :where(.wp-block-column) {
291
291
  margin-right: 0;
292
292
  }
293
293
 
294
+ .wp-block-comments-title.has-background {
295
+ padding: inherit;
296
+ }
297
+
294
298
  .wp-block-cover {
295
299
  /* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */
296
300
  }
@@ -2701,6 +2705,14 @@ div[data-type="core/post-featured-image"] img {
2701
2705
  display: block;
2702
2706
  }
2703
2707
 
2708
+ .wp-block-post-comments__placeholder * {
2709
+ pointer-events: none;
2710
+ }
2711
+
2712
+ .wp-block-post-comments-form * {
2713
+ pointer-events: none;
2714
+ }
2715
+
2704
2716
  :root .editor-styles-wrapper {
2705
2717
  /*
2706
2718
  * Our classes uses the same values we set for gradient value attributes,