@wordpress/block-library 7.3.1 → 7.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/build/audio/edit.js +1 -1
  2. package/build/audio/edit.js.map +1 -1
  3. package/build/comment-template/edit.js +3 -1
  4. package/build/comment-template/edit.js.map +1 -1
  5. package/build/comment-template/hooks.js +14 -4
  6. package/build/comment-template/hooks.js.map +1 -1
  7. package/build/comments-pagination/edit.js +18 -1
  8. package/build/comments-pagination/edit.js.map +1 -1
  9. package/build/comments-query-loop/edit.js +2 -2
  10. package/build/comments-query-loop/edit.js.map +1 -1
  11. package/build/comments-title/edit.js +151 -0
  12. package/build/comments-title/edit.js.map +1 -0
  13. package/build/comments-title/index.js +101 -0
  14. package/build/comments-title/index.js.map +1 -0
  15. package/build/cover/transforms.js +33 -32
  16. package/build/cover/transforms.js.map +1 -1
  17. package/build/index.js +6 -4
  18. package/build/index.js.map +1 -1
  19. package/build/list/index.js +13 -2
  20. package/build/list/index.js.map +1 -1
  21. package/build/navigation/edit/index.js +17 -1
  22. package/build/navigation/edit/index.js.map +1 -1
  23. package/build/navigation/edit/inner-blocks.js +5 -7
  24. package/build/navigation/edit/inner-blocks.js.map +1 -1
  25. package/build/navigation/edit/navigation-menu-selector.js +7 -2
  26. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  27. package/build/navigation-link/edit.js +29 -30
  28. package/build/navigation-link/edit.js.map +1 -1
  29. package/build/navigation-submenu/edit.js +14 -14
  30. package/build/navigation-submenu/edit.js.map +1 -1
  31. package/build/post-comments/edit.js +141 -35
  32. package/build/post-comments/edit.js.map +1 -1
  33. package/build/post-comments/index.js +2 -1
  34. package/build/post-comments/index.js.map +1 -1
  35. package/build/post-comments-form/edit.js +22 -1
  36. package/build/post-comments-form/edit.js.map +1 -1
  37. package/build/post-comments-form/index.js +1 -0
  38. package/build/post-comments-form/index.js.map +1 -1
  39. package/build/post-content/edit.js +1 -1
  40. package/build/post-content/edit.js.map +1 -1
  41. package/build/post-featured-image/edit.js +19 -7
  42. package/build/post-featured-image/edit.js.map +1 -1
  43. package/build/query-no-results/edit.js +1 -1
  44. package/build/query-no-results/edit.js.map +1 -1
  45. package/build/quote/index.js +13 -2
  46. package/build/quote/index.js.map +1 -1
  47. package/build-module/audio/edit.js +1 -1
  48. package/build-module/audio/edit.js.map +1 -1
  49. package/build-module/comment-template/edit.js +3 -1
  50. package/build-module/comment-template/edit.js.map +1 -1
  51. package/build-module/comment-template/hooks.js +14 -4
  52. package/build-module/comment-template/hooks.js.map +1 -1
  53. package/build-module/comments-pagination/edit.js +19 -2
  54. package/build-module/comments-pagination/edit.js.map +1 -1
  55. package/build-module/comments-query-loop/edit.js +2 -2
  56. package/build-module/comments-query-loop/edit.js.map +1 -1
  57. package/build-module/comments-title/edit.js +135 -0
  58. package/build-module/comments-title/edit.js.map +1 -0
  59. package/build-module/comments-title/index.js +88 -0
  60. package/build-module/comments-title/index.js.map +1 -0
  61. package/build-module/cover/transforms.js +33 -32
  62. package/build-module/cover/transforms.js.map +1 -1
  63. package/build-module/index.js +5 -4
  64. package/build-module/index.js.map +1 -1
  65. package/build-module/list/index.js +9 -3
  66. package/build-module/list/index.js.map +1 -1
  67. package/build-module/navigation/edit/index.js +17 -1
  68. package/build-module/navigation/edit/index.js.map +1 -1
  69. package/build-module/navigation/edit/inner-blocks.js +5 -7
  70. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  71. package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
  72. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  73. package/build-module/navigation-link/edit.js +29 -30
  74. package/build-module/navigation-link/edit.js.map +1 -1
  75. package/build-module/navigation-submenu/edit.js +14 -14
  76. package/build-module/navigation-submenu/edit.js.map +1 -1
  77. package/build-module/post-comments/edit.js +143 -38
  78. package/build-module/post-comments/edit.js.map +1 -1
  79. package/build-module/post-comments/index.js +2 -1
  80. package/build-module/post-comments/index.js.map +1 -1
  81. package/build-module/post-comments-form/edit.js +21 -1
  82. package/build-module/post-comments-form/edit.js.map +1 -1
  83. package/build-module/post-comments-form/index.js +1 -0
  84. package/build-module/post-comments-form/index.js.map +1 -1
  85. package/build-module/post-content/edit.js +1 -1
  86. package/build-module/post-content/edit.js.map +1 -1
  87. package/build-module/post-featured-image/edit.js +19 -7
  88. package/build-module/post-featured-image/edit.js.map +1 -1
  89. package/build-module/query-no-results/edit.js +1 -1
  90. package/build-module/query-no-results/edit.js.map +1 -1
  91. package/build-module/quote/index.js +9 -3
  92. package/build-module/quote/index.js.map +1 -1
  93. package/build-style/comment-content/style-rtl.css +81 -0
  94. package/build-style/comment-content/style.css +81 -0
  95. package/build-style/comments-title/editor-rtl.css +79 -0
  96. package/build-style/comments-title/editor.css +79 -0
  97. package/build-style/cover/style-rtl.css +1 -1
  98. package/build-style/cover/style.css +1 -1
  99. package/build-style/editor-rtl.css +12 -0
  100. package/build-style/editor.css +12 -0
  101. package/build-style/latest-posts/style-rtl.css +2 -0
  102. package/build-style/latest-posts/style.css +4 -0
  103. package/build-style/post-comments/editor-rtl.css +79 -0
  104. package/build-style/post-comments/editor.css +79 -0
  105. package/build-style/post-comments/style-rtl.css +1 -3
  106. package/build-style/post-comments/style.css +1 -3
  107. package/build-style/post-comments-form/editor-rtl.css +79 -0
  108. package/build-style/post-comments-form/editor.css +79 -0
  109. package/build-style/post-comments-form/style-rtl.css +9 -0
  110. package/build-style/post-comments-form/style.css +9 -0
  111. package/build-style/style-rtl.css +13 -4
  112. package/build-style/style.css +15 -4
  113. package/package.json +28 -28
  114. package/src/audio/edit.js +1 -1
  115. package/src/comment-author-name/index.php +7 -5
  116. package/src/comment-content/index.php +25 -3
  117. package/src/comment-content/style.scss +5 -0
  118. package/src/comment-edit-link/index.php +1 -4
  119. package/src/comment-reply-link/index.php +1 -4
  120. package/src/comment-template/edit.js +5 -2
  121. package/src/comment-template/hooks.js +15 -2
  122. package/src/comment-template/index.php +23 -2
  123. package/src/comments-pagination/edit.js +23 -0
  124. package/src/comments-query-loop/edit.js +2 -0
  125. package/src/comments-title/block.json +70 -0
  126. package/src/comments-title/edit.js +213 -0
  127. package/src/comments-title/editor.scss +4 -0
  128. package/src/comments-title/index.js +18 -0
  129. package/src/comments-title/index.php +75 -0
  130. package/src/cover/index.php +1 -1
  131. package/src/cover/style.scss +1 -1
  132. package/src/cover/transforms.js +51 -28
  133. package/src/editor.scss +3 -0
  134. package/src/index.js +8 -2
  135. package/src/latest-posts/style.scss +4 -0
  136. package/src/list/index.js +7 -3
  137. package/src/navigation/edit/index.js +24 -0
  138. package/src/navigation/edit/inner-blocks.js +5 -7
  139. package/src/navigation/edit/navigation-menu-selector.js +15 -9
  140. package/src/navigation-link/edit.js +40 -43
  141. package/src/navigation-submenu/edit.js +13 -17
  142. package/src/post-comments/block.json +2 -1
  143. package/src/post-comments/edit.js +204 -44
  144. package/src/post-comments/editor.scss +3 -0
  145. package/src/post-comments/style.scss +1 -5
  146. package/src/post-comments-form/block.json +1 -0
  147. package/src/post-comments-form/edit.js +39 -2
  148. package/src/post-comments-form/editor.scss +3 -0
  149. package/src/post-comments-form/index.php +16 -5
  150. package/src/post-comments-form/style.scss +11 -0
  151. package/src/post-content/edit.js +15 -1
  152. package/src/post-featured-image/edit.js +24 -12
  153. package/src/query-no-results/edit.js +1 -1
  154. package/src/quote/index.js +7 -3
@@ -11,14 +11,16 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _data = require("@wordpress/data");
15
-
16
14
  var _blockEditor = require("@wordpress/block-editor");
17
15
 
18
16
  var _i18n = require("@wordpress/i18n");
19
17
 
18
+ var _data = require("@wordpress/data");
19
+
20
20
  var _coreData = require("@wordpress/core-data");
21
21
 
22
+ var _compose = require("@wordpress/compose");
23
+
22
24
  /**
23
25
  * External dependencies
24
26
  */
@@ -26,45 +28,57 @@ var _coreData = require("@wordpress/core-data");
26
28
  /**
27
29
  * WordPress dependencies
28
30
  */
29
- function PostCommentsDisplay(_ref) {
31
+ function PostCommentsEdit(_ref) {
30
32
  let {
31
- postId
33
+ attributes: {
34
+ textAlign
35
+ },
36
+ setAttributes,
37
+ context: {
38
+ postType,
39
+ postId
40
+ }
32
41
  } = _ref;
33
- return (0, _data.useSelect)(select => {
34
- const comments = select(_coreData.store).getEntityRecords('root', 'comment', {
35
- post: postId
36
- }); // TODO: "No Comments" placeholder should be editable.
42
+ let [postTitle] = (0, _coreData.useEntityProp)('postType', postType, 'title', postId);
43
+ postTitle = postTitle || (0, _i18n.__)('Post Title');
44
+ const [commentStatus] = (0, _coreData.useEntityProp)('postType', postType, 'comment_status', postId);
45
+ const {
46
+ avatarURL,
47
+ defaultCommentStatus
48
+ } = (0, _data.useSelect)(select => select(_blockEditor.store).getSettings().__experimentalDiscussionSettings);
49
+ const isSiteEditor = postType === undefined || postId === undefined;
50
+ const postTypeSupportsComments = (0, _data.useSelect)(select => {
51
+ var _select$getPostType;
37
52
 
38
- return comments && comments.length ? comments.map(comment => (0, _element.createElement)(_element.RawHTML, {
39
- className: "wp-block-post-comments__comment",
40
- key: comment.id
41
- }, comment.content.rendered)) : (0, _i18n.__)('No comments.');
42
- }, [postId]);
43
- }
53
+ return postType ? !!((_select$getPostType = select(_coreData.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
54
+ });
55
+ let warning = (0, _i18n.__)('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.');
56
+ let showPlacholder = true;
57
+
58
+ if (!isSiteEditor && 'open' !== commentStatus) {
59
+ if ('closed' === commentStatus) {
60
+ warning = (0, _i18n.sprintf)(
61
+ /* translators: 1: Post type (i.e. "post", "page") */
62
+ (0, _i18n.__)('Post Comments block: Comments to this %s are not allowed.'), postType);
63
+ showPlacholder = false;
64
+ } else if (!postTypeSupportsComments) {
65
+ warning = (0, _i18n.sprintf)(
66
+ /* translators: 1: Post type (i.e. "post", "page") */
67
+ (0, _i18n.__)('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
68
+ showPlacholder = false;
69
+ } else if ('open' !== defaultCommentStatus) {
70
+ warning = (0, _i18n.__)('Post Comments block: Comments are not enabled.');
71
+ showPlacholder = false;
72
+ }
73
+ }
44
74
 
45
- function PostCommentsEdit(_ref2) {
46
- let {
47
- attributes,
48
- setAttributes,
49
- context
50
- } = _ref2;
51
- const {
52
- postType,
53
- postId
54
- } = context;
55
- const {
56
- textAlign
57
- } = attributes;
58
75
  const blockProps = (0, _blockEditor.useBlockProps)({
59
76
  className: (0, _classnames.default)({
60
77
  [`has-text-align-${textAlign}`]: textAlign
61
78
  })
62
79
  });
63
-
64
- if (!postType || !postId) {
65
- return (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Post comments block: no post found.')));
66
- }
67
-
80
+ const disabledRef = (0, _compose.__experimentalUseDisabled)();
81
+ const textareaId = (0, _compose.useInstanceId)(PostCommentsEdit);
68
82
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
69
83
  group: "block"
70
84
  }, (0, _element.createElement)(_blockEditor.AlignmentControl, {
@@ -74,8 +88,100 @@ function PostCommentsEdit(_ref2) {
74
88
  textAlign: nextAlign
75
89
  });
76
90
  }
77
- })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)(PostCommentsDisplay, {
78
- postId: postId
79
- })));
91
+ })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_blockEditor.Warning, null, warning), showPlacholder && (0, _element.createElement)("div", {
92
+ className: "wp-block-post-comments__placeholder",
93
+ ref: disabledRef
94
+ }, (0, _element.createElement)("h3", null, (0, _i18n.__)('One response to'), " \u201C", postTitle, "\u201D"), (0, _element.createElement)("div", {
95
+ className: "navigation"
96
+ }, (0, _element.createElement)("div", {
97
+ className: "alignleft"
98
+ }, (0, _element.createElement)("a", {
99
+ href: "#top"
100
+ }, "\xAB ", (0, _i18n.__)('Older Comments'))), (0, _element.createElement)("div", {
101
+ className: "alignright"
102
+ }, (0, _element.createElement)("a", {
103
+ href: "#top"
104
+ }, (0, _i18n.__)('Newer Comments'), " \xBB"))), (0, _element.createElement)("ol", {
105
+ className: "commentlist"
106
+ }, (0, _element.createElement)("li", {
107
+ className: "comment even thread-even depth-1"
108
+ }, (0, _element.createElement)("article", {
109
+ className: "comment-body"
110
+ }, (0, _element.createElement)("footer", {
111
+ className: "comment-meta"
112
+ }, (0, _element.createElement)("div", {
113
+ className: "comment-author vcard"
114
+ }, (0, _element.createElement)("img", {
115
+ alt: "Commenter Avatar",
116
+ src: avatarURL,
117
+ className: "avatar avatar-32 photo",
118
+ height: "32",
119
+ width: "32",
120
+ 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", {
129
+ className: "comment-metadata"
130
+ }, (0, _element.createElement)("a", {
131
+ href: "#top"
132
+ }, (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", {
135
+ className: "edit-link"
136
+ }, (0, _element.createElement)("a", {
137
+ className: "comment-edit-link",
138
+ href: "#top"
139
+ }, (0, _i18n.__)('Edit'))))), (0, _element.createElement)("div", {
140
+ 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", {
144
+ className: "reply"
145
+ }, (0, _element.createElement)("a", {
146
+ className: "comment-reply-link",
147
+ href: "#top",
148
+ "aria-label": "Reply to A WordPress Commenter"
149
+ }, (0, _i18n.__)('Reply')))))), (0, _element.createElement)("div", {
150
+ className: "navigation"
151
+ }, (0, _element.createElement)("div", {
152
+ className: "alignleft"
153
+ }, (0, _element.createElement)("a", {
154
+ href: "#top"
155
+ }, "\xAB ", (0, _i18n.__)('Older Comments'))), (0, _element.createElement)("div", {
156
+ className: "alignright"
157
+ }, (0, _element.createElement)("a", {
158
+ href: "#top"
159
+ }, (0, _i18n.__)('Newer Comments'), " \xBB"))), (0, _element.createElement)("div", {
160
+ className: "comment-respond"
161
+ }, (0, _element.createElement)("h3", {
162
+ className: "comment-reply-title"
163
+ }, (0, _i18n.__)('Leave a Reply')), (0, _element.createElement)("form", {
164
+ className: "comment-form",
165
+ noValidate: true
166
+ }, (0, _element.createElement)("p", {
167
+ className: "comment-form-comment"
168
+ }, (0, _element.createElement)("label", {
169
+ htmlFor: `comment-${textareaId}`
170
+ }, (0, _i18n.__)('Comment'), ' ', (0, _element.createElement)("span", {
171
+ className: "required"
172
+ }, "*")), (0, _element.createElement)("textarea", {
173
+ id: `comment-${textareaId}`,
174
+ name: "comment",
175
+ cols: "45",
176
+ rows: "8",
177
+ required: true
178
+ })), (0, _element.createElement)("p", {
179
+ className: "form-submit wp-block-button"
180
+ }, (0, _element.createElement)("input", {
181
+ name: "submit",
182
+ type: "submit",
183
+ className: "submit wp-block-button__link",
184
+ value: (0, _i18n.__)('Post Comment')
185
+ })))))));
80
186
  }
81
187
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["PostCommentsDisplay","postId","select","comments","coreStore","getEntityRecords","post","length","map","comment","id","content","rendered","PostCommentsEdit","attributes","setAttributes","context","postType","textAlign","blockPro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AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGD,SADT;AAEC,IAAA,QAAQ,EAAKG,SAAF,IAAiB;AAC3BN,MAAAA,aAAa,CAAE;AAAEG,QAAAA,SAAS,EAAEG;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EAUC,mCAAUF,UAAV,EACC,4BAAC,mBAAD;AAAqB,IAAA,MAAM,EAAGlB;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":["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,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AAb,KACC;AACC,IAAA,OAAO,EAAI,WAAWkB,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,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"]}
@@ -56,7 +56,8 @@ const metadata = {
56
56
  },
57
57
  inserter: false
58
58
  },
59
- style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"]
59
+ style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"],
60
+ editorStyle: "wp-block-post-comments-editor"
60
61
  };
61
62
  exports.metadata = metadata;
62
63
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/index.js"],"names":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,mBADuB;AAEvBC,EAAAA,IAAI,EAAJA;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":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,mBADuB;AAEvBC,EAAAA,IAAI,EAAJA;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"]}
@@ -17,6 +17,8 @@ var _coreData = require("@wordpress/core-data");
17
17
 
18
18
  var _i18n = require("@wordpress/i18n");
19
19
 
20
+ var _compose = require("@wordpress/compose");
21
+
20
22
  /**
21
23
  * External dependencies
22
24
  */
@@ -44,6 +46,8 @@ function PostCommentsFormEdit(_ref) {
44
46
  })
45
47
  });
46
48
  const isInSiteEditor = postType === undefined || postId === undefined;
49
+ const disabledFormRef = (0, _compose.__experimentalUseDisabled)();
50
+ const instanceId = (0, _compose.useInstanceId)(PostCommentsFormEdit);
47
51
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
48
52
  group: "block"
49
53
  }, (0, _element.createElement)(_blockEditor.AlignmentControl, {
@@ -55,6 +59,23 @@ function PostCommentsFormEdit(_ref) {
55
59
  }
56
60
  })), (0, _element.createElement)("div", blockProps, !commentStatus && !isInSiteEditor && (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Post Comments Form block: comments are not enabled for this post type.')), 'open' !== commentStatus && !isInSiteEditor && (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.sprintf)(
57
61
  /* translators: 1: Post type (i.e. "post", "page") */
58
- (0, _i18n.__)('Post Comments Form block: comments to this %s are not allowed.'), postType)), ('open' === commentStatus || isInSiteEditor) && (0, _i18n.__)('Post Comments Form')));
62
+ (0, _i18n.__)('Post Comments Form block: comments to this %s are not allowed.'), postType)), ('open' === commentStatus || isInSiteEditor) && (0, _element.createElement)("div", null, (0, _element.createElement)("h3", null, (0, _i18n.__)('Leave a Reply')), (0, _element.createElement)("form", {
63
+ noValidate: true,
64
+ className: "comment-form",
65
+ ref: disabledFormRef
66
+ }, (0, _element.createElement)("p", null, (0, _element.createElement)("label", {
67
+ htmlFor: `comment-${instanceId}`
68
+ }, (0, _i18n.__)('Comment')), (0, _element.createElement)("textarea", {
69
+ id: `comment-${instanceId}`,
70
+ name: "comment",
71
+ cols: "45",
72
+ rows: "8"
73
+ })), (0, _element.createElement)("p", null, (0, _element.createElement)("input", {
74
+ name: "submit",
75
+ className: "submit wp-block-button__link",
76
+ label: (0, _i18n.__)('Post Comment'),
77
+ value: (0, _i18n.__)('Post Comment'),
78
+ readOnly: true
79
+ }))))));
59
80
  }
60
81
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments-form/edit.js"],"names":["PostCommentsFormEdit","attributes","context","setAttributes","textAlign","postId","postType","commentStatus","blockProps","className","isInSiteEditor","undefined","nextAlign"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAMA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;AAUe,SAASA,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,IAAoB,6BACzB,UADyB,EAEzBD,QAFyB,EAGzB,gBAHyB,EAIzBD,MAJyB,CAA1B;AAMA,QAAMG,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBL,SAAW,EAAhC,GAAqCA;AADf,KAAZ;AADsB,GAAf,CAAnB;AAMA,QAAMM,cAAc,GAAGJ,QAAQ,KAAKK,SAAb,IAA0BN,MAAM,KAAKM,SAA5D;AAEA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;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,mCAAUJ,UAAV,EACG,CAAED,aAAF,IAAmB,CAAEG,cAArB,IACD,4BAAC,oBAAD,QACG,cACD,wEADC,CADH,CAFF,EASG,WAAWH,aAAX,IAA4B,CAAEG,cAA9B,IACD,4BAAC,oBAAD,QACG;AACD;AACA,gBACC,gEADD,CAFC,EAKDJ,QALC,CADH,CAVF,EAqBG,CAAE,WAAWC,aAAX,IAA4BG,cAA9B,KACD,cAAI,oBAAJ,CAtBF,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":["PostCommentsFormEdit","attributes","context","setAttributes","textAlign","postId","postType","commentStatus","blockProps","className","isInSiteEditor","undefined","disabledFormRef","instanceId","nextAlign"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAMA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;AAce,SAASA,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,IAAoB,6BACzB,UADyB,EAEzBD,QAFyB,EAGzB,gBAHyB,EAIzBD,MAJyB,CAA1B;AAMA,QAAMG,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBL,SAAW,EAAhC,GAAqCA;AADf,KAAZ;AADsB,GAAf,CAAnB;AAMA,QAAMM,cAAc,GAAGJ,QAAQ,KAAKK,SAAb,IAA0BN,MAAM,KAAKM,SAA5D;AAEA,QAAMC,eAAe,GAAG,yCAAxB;AAEA,QAAMC,UAAU,GAAG,4BAAeb,oBAAf,CAAnB;AAEA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;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,mCAAUN,UAAV,EACG,CAAED,aAAF,IAAmB,CAAEG,cAArB,IACD,4BAAC,oBAAD,QACG,cACD,wEADC,CADH,CAFF,EASG,WAAWH,aAAX,IAA4B,CAAEG,cAA9B,IACD,4BAAC,oBAAD,QACG;AACD;AACA,gBACC,gEADD,CAFC,EAKDJ,QALC,CADH,CAVF,EAqBG,CAAE,WAAWC,aAAX,IAA4BG,cAA9B,KACD,yCACC,wCAAM,cAAI,eAAJ,CAAN,CADD,EAEC;AACC,IAAA,UAAU,MADX;AAEC,IAAA,SAAS,EAAC,cAFX;AAGC,IAAA,GAAG,EAAGE;AAHP,KAKC,uCACC;AAAO,IAAA,OAAO,EAAI,WAAWC,UAAY;AAAzC,KACG,cAAI,SAAJ,CADH,CADD,EAIC;AACC,IAAA,EAAE,EAAI,WAAWA,UAAY,EAD9B;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,IAAA,IAAI,EAAC,IAHN;AAIC,IAAA,IAAI,EAAC;AAJN,IAJD,CALD,EAgBC,uCACC;AACC,IAAA,IAAI,EAAC,QADN;AAEC,IAAA,SAAS,EAAC,8BAFX;AAGC,IAAA,KAAK,EAAG,cAAI,cAAJ,CAHT;AAIC,IAAA,KAAK,EAAG,cAAI,cAAJ,CAJT;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"]}
@@ -54,6 +54,7 @@ const metadata = {
54
54
  }
55
55
  }
56
56
  },
57
+ editorStyle: "wp-block-post-comments-form-editor",
57
58
  style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
58
59
  };
59
60
  exports.metadata = metadata;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments-form/index.js"],"names":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,uBADuB;AAEvBC,EAAAA,IAAI,EAAJA;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":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,uBADuB;AAEvBC,EAAAA,IAAI,EAAJA;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"]}
@@ -96,7 +96,7 @@ function Content(props) {
96
96
 
97
97
  function Placeholder() {
98
98
  const blockProps = (0, _blockEditor.useBlockProps)();
99
- return (0, _element.createElement)("div", blockProps, (0, _element.createElement)("p", null, (0, _i18n.__)('Post Content')));
99
+ return (0, _element.createElement)("div", blockProps, (0, _element.createElement)("p", null, (0, _i18n.__)('This is the Post Content block, it will display all the blocks in any single post or page.')), (0, _element.createElement)("p", null, (0, _i18n.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')), (0, _element.createElement)("p", null, (0, _i18n.__)('If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.')));
100
100
  }
101
101
 
102
102
  function RecursionError() {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-content/edit.js"],"names":["ReadOnlyContent","userCanEdit","postType","postId","content","blockProps","protected","__html","rendered","EditableContent","layout","context","themeSupportsLayout","select","getSettings","blockEditorStore","supportsLayout","defaultLayout","usedLayout","inherit","blocks","onInput","onChange","id","props","className","value","__experimentalLayout","undefined","Content","queryId","isDescendentOfQueryLoop","Number","isFinite","isEditable","Placeholder","RecursionError","PostContentEdit","attributes","contextPostId","contextPostType","hasAlreadyRendered","RecursionProvider"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAQA;;AAKA;;AAlBA;AACA;AACA;;AAaA;AACA;AACA;AAGA,SAASA,eAAT,OAA8D;AAAA,MAApC;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,QAAf;AAAyBC,IAAAA;AAAzB,GAAoC;AAC7D,QAAM,IAAMC,OAAN,IAAkB,6BACvB,UADuB,EAEvBF,QAFuB,EAGvB,SAHuB,EAIvBC,MAJuB,CAAxB;AAMA,QAAME,UAAU,GAAG,iCAAnB;AACA,SAAOD,OAAO,SAAP,IAAAA,OAAO,WAAP,IAAAA,OAAO,CAAEE,SAAT,IAAsB,CAAEL,WAAxB,GACN,mCAAUI,UAAV,EACC,4BAAC,oBAAD,QAAW,cAAI,qCAAJ,CAAX,CADD,CADM,GAKN,8DACMA,UADN;AAEC,IAAA,uBAAuB,EAAG;AAAEE,MAAAA,MAAM,EAAEH,OAAF,aAAEA,OAAF,uBAAEA,OAAO,CAAEI;AAAnB;AAF3B,KALD;AAUA;;AAED,SAASC,eAAT,QAAqD;AAAA,MAA3B;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,OAAO,GAAG;AAApB,GAA2B;AACpD,QAAM;AAAET,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAuBQ,OAA7B;AACA,QAAMC,mBAAmB,GAAG,qBAAaC,MAAF,IAAc;AAAA;;AAC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EAAGC,QAFZ;AAGC,IAAA,MAAM,EAAGC;AAHV,IAHD;AASA;;AAED,SAASgC,WAAT,GAAuB;AACtB,QAAM9B,UAAU,GAAG,iCAAnB;AACA,SACC,mCAAUA,UAAV,EACC,uCAAK,cAAI,cAAJ,CAAL,CADD,CADD;AAKA;;AAED,SAAS+B,cAAT,GAA0B;AACzB,QAAM/B,UAAU,GAAG,iCAAnB;AACA,SACC,mCAAUA,UAAV,EACC,4BAAC,oBAAD,QACG,cAAI,yCAAJ,CADH,CADD,CADD;AAOA;;AAEc,SAASgC,eAAT,QAAoD;AAAA,MAA1B;AAAE1B,IAAAA,OAAF;AAAW2B,IAAAA;AAAX,GAA0B;AAClE,QAAM;AAAEnC,IAAAA,MAAM,EAAEoC,aAAV;AAAyBrC,IAAAA,QAAQ,EAAEsC;AAAnC,MAAuD7B,OAA7D;AACA,QAAM;AAAED,IAAAA,MAAM,GAAG;AAAX,MAAkB4B,UAAxB;AACA,QAAM,CAAEG,kBAAF,EAAsBC,iBAAtB,IAA4C,sDACjDH,aADiD,CAAlD;;AAIA,MAAKA,aAAa,IAAIC,eAAjB,IAAoCC,kBAAzC,EAA8D;AAC7D,WAAO,4BAAC,cAAD,OAAP;AACA;;AAED,SACC,4BAAC,iBAAD,QACGF,aAAa,IAAIC,eAAjB,GACD,4BAAC,OAAD;AAAS,IAAA,OAAO,EAAG7B,OAAnB;AAA6B,IAAA,MAAM,EAAGD;AAAtC,IADC,GAGD,4BAAC,WAAD,OAJF,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\t__experimentalUseNoRecursiveRenders as useNoRecursiveRenders,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport { useEntityProp, useEntityBlockEditor } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nfunction ReadOnlyContent( { userCanEdit, postType, postId } ) {\n\tconst [ , , content ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\tconst blockProps = useBlockProps();\n\treturn content?.protected && ! userCanEdit ? (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>{ __( 'This content is password protected.' ) }</Warning>\n\t\t</div>\n\t) : (\n\t\t<div\n\t\t\t{ ...blockProps }\n\t\t\tdangerouslySetInnerHTML={ { __html: content?.rendered } }\n\t\t></div>\n\t);\n}\n\nfunction EditableContent( { layout, context = {} } ) {\n\tconst { postType, postId } = context;\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings()?.supportsLayout;\n\t}, [] );\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpostType,\n\t\t{ id: postId }\n\t);\n\n\tconst props = useInnerBlocksProps(\n\t\tuseBlockProps( { className: 'entry-content' } ),\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\t__experimentalLayout: themeSupportsLayout ? usedLayout : undefined,\n\t\t}\n\t);\n\treturn <div { ...props } />;\n}\n\nfunction Content( props ) {\n\tconst { context: { queryId, postType, postId } = {} } = props;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\n\treturn isEditable ? (\n\t\t<EditableContent { ...props } />\n\t) : (\n\t\t<ReadOnlyContent\n\t\t\tuserCanEdit={ userCanEdit }\n\t\t\tpostType={ postType }\n\t\t\tpostId={ postId }\n\t\t/>\n\t);\n}\n\nfunction Placeholder() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<p>{ __( 'Post Content' ) }</p>\n\t\t</div>\n\t);\n}\n\nfunction RecursionError() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nexport default function PostContentEdit( { context, attributes } ) {\n\tconst { postId: contextPostId, postType: contextPostType } = context;\n\tconst { layout = {} } = attributes;\n\tconst [ hasAlreadyRendered, RecursionProvider ] = useNoRecursiveRenders(\n\t\tcontextPostId\n\t);\n\n\tif ( contextPostId && contextPostType && hasAlreadyRendered ) {\n\t\treturn <RecursionError />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider>\n\t\t\t{ contextPostId && contextPostType ? (\n\t\t\t\t<Content context={ context } layout={ layout } />\n\t\t\t) : (\n\t\t\t\t<Placeholder />\n\t\t\t) }\n\t\t</RecursionProvider>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-content/edit.js"],"names":["ReadOnlyContent","userCanEdit","postType","postId","content","blockProps","protected","__html","rendered","EditableContent","layout","context","themeSupportsLayout","select","getSettings","blockEditorStore","supportsLayout","defaultLayout","usedLayout","inherit","blocks","onInput","onChange","id","props","className","value","__experimentalLayout","undefined","Content","queryId","isDescendentOfQueryLoop","Number","isFinite","isEditable","Placeholder","RecursionError","PostContentEdit","attributes","contextPostId","contextPostType","hasAlreadyRendered","RecursionProvider"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAQA;;AAKA;;AAlBA;AACA;AACA;;AAaA;AACA;AACA;AAGA,SAASA,eAAT,OAA8D;AAAA,MAApC;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,QAAf;AAAyBC,IAAAA;AAAzB,GAAoC;AAC7D,QAAM,IAAMC,OAAN,IAAkB,6BACvB,UADuB,EAEvBF,QAFuB,EAGvB,SAHuB,EAIvBC,MAJuB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,CAAEG,kBAAF,EAAsBC,iBAAtB,IAA4C,sDACjDH,aADiD,CAAlD;;AAIA,MAAKA,aAAa,IAAIC,eAAjB,IAAoCC,kBAAzC,EAA8D;AAC7D,WAAO,4BAAC,cAAD,OAAP;AACA;;AAED,SACC,4BAAC,iBAAD,QACGF,aAAa,IAAIC,eAAjB,GACD,4BAAC,OAAD;AAAS,IAAA,OAAO,EAAG7B,OAAnB;AAA6B,IAAA,MAAM,EAAGD;AAAtC,IADC,GAGD,4BAAC,WAAD,OAJF,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\t__experimentalUseNoRecursiveRenders as useNoRecursiveRenders,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport { useEntityProp, useEntityBlockEditor } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nfunction ReadOnlyContent( { userCanEdit, postType, postId } ) {\n\tconst [ , , content ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\tconst blockProps = useBlockProps();\n\treturn content?.protected && ! userCanEdit ? (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>{ __( 'This content is password protected.' ) }</Warning>\n\t\t</div>\n\t) : (\n\t\t<div\n\t\t\t{ ...blockProps }\n\t\t\tdangerouslySetInnerHTML={ { __html: content?.rendered } }\n\t\t></div>\n\t);\n}\n\nfunction EditableContent( { layout, context = {} } ) {\n\tconst { postType, postId } = context;\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings()?.supportsLayout;\n\t}, [] );\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpostType,\n\t\t{ id: postId }\n\t);\n\n\tconst props = useInnerBlocksProps(\n\t\tuseBlockProps( { className: 'entry-content' } ),\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\t__experimentalLayout: themeSupportsLayout ? usedLayout : undefined,\n\t\t}\n\t);\n\treturn <div { ...props } />;\n}\n\nfunction Content( props ) {\n\tconst { context: { queryId, postType, postId } = {} } = props;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\n\treturn isEditable ? (\n\t\t<EditableContent { ...props } />\n\t) : (\n\t\t<ReadOnlyContent\n\t\t\tuserCanEdit={ userCanEdit }\n\t\t\tpostType={ postType }\n\t\t\tpostId={ postId }\n\t\t/>\n\t);\n}\n\nfunction Placeholder() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'This is the Post Content block, it will display all the blocks in any single post or page.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n\nfunction RecursionError() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nexport default function PostContentEdit( { context, attributes } ) {\n\tconst { postId: contextPostId, postType: contextPostType } = context;\n\tconst { layout = {} } = attributes;\n\tconst [ hasAlreadyRendered, RecursionProvider ] = useNoRecursiveRenders(\n\t\tcontextPostId\n\t);\n\n\tif ( contextPostId && contextPostType && hasAlreadyRendered ) {\n\t\treturn <RecursionError />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider>\n\t\t\t{ contextPostId && contextPostType ? (\n\t\t\t\t<Content context={ context } layout={ layout } />\n\t\t\t) : (\n\t\t\t\t<Placeholder />\n\t\t\t) }\n\t\t</RecursionProvider>\n\t);\n}\n"]}
@@ -62,7 +62,7 @@ function PostFeaturedImageDisplay(_ref) {
62
62
  setAttributes,
63
63
  context: {
64
64
  postId,
65
- postType,
65
+ postType: postTypeSlug,
66
66
  queryId
67
67
  }
68
68
  } = _ref;
@@ -74,10 +74,22 @@ function PostFeaturedImageDisplay(_ref) {
74
74
  scale,
75
75
  sizeSlug
76
76
  } = attributes;
77
- const [featuredImage, setFeaturedImage] = (0, _coreData.useEntityProp)('postType', postType, 'featured_media', postId);
78
- const media = (0, _data.useSelect)(select => featuredImage && select(_coreData.store).getMedia(featuredImage, {
79
- context: 'view'
80
- }), [featuredImage]);
77
+ const [featuredImage, setFeaturedImage] = (0, _coreData.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
78
+ const {
79
+ media,
80
+ postType
81
+ } = (0, _data.useSelect)(select => {
82
+ const {
83
+ getMedia,
84
+ getPostType
85
+ } = select(_coreData.store);
86
+ return {
87
+ media: featuredImage && getMedia(featuredImage, {
88
+ context: 'view'
89
+ }),
90
+ postType: postTypeSlug && getPostType(postTypeSlug)
91
+ };
92
+ }, [featuredImage, postTypeSlug]);
81
93
  const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
82
94
  const imageSizes = (0, _data.useSelect)(select => select(_blockEditor.store).getSettings().imageSizes, []);
83
95
  const imageSizeOptions = imageSizes.filter(_ref2 => {
@@ -134,8 +146,8 @@ function PostFeaturedImageDisplay(_ref) {
134
146
  }), (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
135
147
  title: (0, _i18n.__)('Link settings')
136
148
  }, (0, _element.createElement)(_components.ToggleControl, {
137
- label: (0, _i18n.sprintf)( // translators: %s: Name of the post type e.g: "post".
138
- (0, _i18n.__)('Link to %s'), postType),
149
+ label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0, _i18n.sprintf)( // translators: %s: Name of the post type e.g: "post".
150
+ (0, _i18n.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0, _i18n.__)('Link to post'),
139
151
  onChange: () => setAttributes({
140
152
  isLink: !isLink
141
153
  }),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"names":["placeholderIllustration","ALLOWED_MEDIA_TYPES","placeholderChip","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","PostFeaturedImageDisplay","clientId","attributes","setAttributes","context","postId","postType","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","height","width","scale","sizeSlug","featuredImage","setFeaturedImage","select","coreStore","getMedia","mediaUrl","imageSizes","blockEditorStore","getSettings","imageSizeOptions","filter","map","name","value","label","blockProps","style","placeholder","content","onSelectImage","id","createErrorNotice","noticesStore","onUploadError","message","type","controls","image","open","upload","alt_text","objectFit","PostFeaturedImageEdit","props"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAOA;;AAQA;;AACA;;AACA;;AACA;;AAKA;;AA5BA;AACA;AACA;;AAuBA;AACA;AACA;AAGA,MAAMA,uBAAuB,GAC5B,4BAAC,eAAD;AACC,EAAA,SAAS,EAAC,sCADX;AAEC,EAAA,IAAI,EAAC,MAFN;AAGC,EAAA,KAAK,EAAC,4BAHP;AAIC,EAAA,OAAO,EAAC,WAJT;AAKC,EAAA,mBAAmB,EAAC;AALrB,GAOC,4BAAC,gBAAD;AAAM,EAAA,YAAY,EAAC,oBAAnB;AAAwC,EAAA,CAAC,EAAC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UADD;AAYA;AAnBF,MADD;AAuBA,GAxBD,MAwBO;AACN;AACAD,IAAAA,KAAK,GAAG,CAAEhD,KAAF,GACPF,eADO,GAGP;AACC,MAAA,GAAG,EAAG4B,QADP;AAEC,MAAA,GAAG,EACF1B,KAAK,CAACmD,QAAN,GACG,oBACA;AACA,oBAAI,oBAAJ,CAFA,EAGAnD,KAAK,CAACmD,QAHN,CADH,GAMG,cAAI,gBAAJ,CATL;AAWC,MAAA,KAAK,EAAG;AAAElC,QAAAA,MAAF;AAAUmC,QAAAA,SAAS,EAAEnC,MAAM,IAAIE;AAA/B;AAXT,MAHD;AAiBA;;AAED,SACC,qDACG4B,QADH,EAEG,CAAC,CAAE/C,KAAH,IAAY,CAAEa,uBAAd,IACD,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,OAAO,EAAGQ,aADX;AAEC,IAAA,QAAQ,EAAGK,QAFZ;AAGC,IAAA,YAAY,EAAG7B,mBAHhB;AAIC,IAAA,MAAM,EAAC,SAJR;AAKC,IAAA,QAAQ,EAAG2C,aALZ;AAMC,IAAA,OAAO,EAAGI;AANX,KAQC,4BAAC,oBAAD;AAAU,IAAA,OAAO,EAAG,MAAMtB,gBAAgB,CAAE,CAAF;AAA1C,KACG,cAAI,OAAJ,CADH,CARD,CADD,CAHF,EAkBC,sCAAac,UAAb,EAA4BY,KAA5B,CAlBD,CADD;AAsBA;;AAEc,SAASK,qBAAT,CAAgCC,KAAhC,EAAwC;AAAA;;AACtD,QAAMlB,UAAU,GAAG,iCAAnB;;AACA,MAAK,oBAAEkB,KAAK,CAAC7C,OAAR,2CAAE,eAAeC,MAAjB,CAAL,EAA+B;AAC9B,WAAO,mCAAU0B,UAAV,EAAyBtC,eAAzB,CAAP;AACA;;AACD,SAAO,4BAAC,wBAAD,EAA+BwD,KAA/B,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tMenuItem,\n\tToggleControl,\n\tPanelBody,\n\tPlaceholder,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { SVG, Path } from '@wordpress/primitives';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\n\nconst placeholderIllustration = (\n\t<SVG\n\t\tclassName=\"components-placeholder__illustration\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 60 60\"\n\t\tpreserveAspectRatio=\"none\"\n\t>\n\t\t<Path vectorEffect=\"non-scaling-stroke\" d=\"M60 60 0 0\" />\n\t</SVG>\n);\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst placeholderChip = (\n\t<div className=\"wp-block-post-featured-image__placeholder\">\n\t\t{ placeholderIllustration }\n\t</div>\n);\n\nfunction getMediaSourceUrlBySizeSlug( media, slug ) {\n\treturn (\n\t\tmedia?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url\n\t);\n}\n\nfunction PostFeaturedImageDisplay( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { isLink, height, width, scale, sizeSlug } = attributes;\n\tconst [ featuredImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst imageSizes = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().imageSizes,\n\t\t[]\n\t);\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => {\n\t\t\treturn media?.media_details?.sizes?.[ slug ]?.source_url;\n\t\t} )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height },\n\t} );\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder className=\"block-editor-media-placeholder\">\n\t\t\t\t{ placeholderIllustration }\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message[ 2 ], { type: 'snackbar' } );\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<DimensionControls\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\tpostType\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\tlet image;\n\tif ( ! featuredImage && isDescendentOfQueryLoop ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>{ placeholderChip }</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\n\tif ( ! featuredImage ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage = ! media ? (\n\t\t\tplaceholderChip\n\t\t) : (\n\t\t\t<img\n\t\t\t\tsrc={ mediaUrl }\n\t\t\t\talt={\n\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\tstyle={ { height, objectFit: height && scale } }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MenuItem onClick={ () => setFeaturedImage( 0 ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>{ image }</figure>\n\t\t</>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( props ) {\n\tconst blockProps = useBlockProps();\n\tif ( ! props.context?.postId ) {\n\t\treturn <div { ...blockProps }>{ placeholderChip }</div>;\n\t}\n\treturn <PostFeaturedImageDisplay { ...props } />;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"names":["placeholderIllustration","ALLOWED_MEDIA_TYPES","placeholderChip","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","PostFeaturedImageDisplay","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","height","width","scale","sizeSlug","featuredImage","setFeaturedImage","select","getMedia","getPostType","coreStore","mediaUrl","imageSizes","blockEditorStore","getSettings","imageSizeOptions","filter","map","name","value","label","blockProps","style","placeholder","content","onSelectImage","id","createErrorNotice","noticesStore","onUploadError","message","type","controls","labels","singular_name","toLowerCase","image","open","upload","alt_text","objectFit","PostFeaturedImageEdit","props"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAOA;;AAQA;;AACA;;AACA;;AACA;;AAKA;;AA5BA;AACA;AACA;;AAuBA;AACA;A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AGQ,aADX;AAEC,IAAA,QAAQ,EAAGM,QAFZ;AAGC,IAAA,YAAY,EAAG/B,mBAHhB;AAIC,IAAA,MAAM,EAAC,SAJR;AAKC,IAAA,QAAQ,EAAG6C,aALZ;AAMC,IAAA,OAAO,EAAGI;AANX,KAQC,4BAAC,oBAAD;AAAU,IAAA,OAAO,EAAG,MAAMvB,gBAAgB,CAAE,CAAF;AAA1C,KACG,cAAI,OAAJ,CADH,CARD,CADD,CAHF,EAkBC,sCAAae,UAAb,EAA4Be,KAA5B,CAlBD,CADD;AAsBA;;AAEc,SAASK,qBAAT,CAAgCC,KAAhC,EAAwC;AAAA;;AACtD,QAAMrB,UAAU,GAAG,iCAAnB;;AACA,MAAK,oBAAEqB,KAAK,CAAClD,OAAR,2CAAE,eAAeC,MAAjB,CAAL,EAA+B;AAC9B,WAAO,mCAAU4B,UAAV,EAAyBxC,eAAzB,CAAP;AACA;;AACD,SAAO,4BAAC,wBAAD,EAA+B6D,KAA/B,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tMenuItem,\n\tToggleControl,\n\tPanelBody,\n\tPlaceholder,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { SVG, Path } from '@wordpress/primitives';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\n\nconst placeholderIllustration = (\n\t<SVG\n\t\tclassName=\"components-placeholder__illustration\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 60 60\"\n\t\tpreserveAspectRatio=\"none\"\n\t>\n\t\t<Path vectorEffect=\"non-scaling-stroke\" d=\"M60 60 0 0\" />\n\t</SVG>\n);\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst placeholderChip = (\n\t<div className=\"wp-block-post-featured-image__placeholder\">\n\t\t{ placeholderIllustration }\n\t</div>\n);\n\nfunction getMediaSourceUrlBySizeSlug( media, slug ) {\n\treturn (\n\t\tmedia?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url\n\t);\n}\n\nfunction PostFeaturedImageDisplay( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { isLink, height, width, scale, sizeSlug } = attributes;\n\tconst [ featuredImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { media, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage &&\n\t\t\t\t\tgetMedia( featuredImage, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} ),\n\t\t\t\tpostType: postTypeSlug && getPostType( postTypeSlug ),\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug ]\n\t);\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst imageSizes = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().imageSizes,\n\t\t[]\n\t);\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => {\n\t\t\treturn media?.media_details?.sizes?.[ slug ]?.source_url;\n\t\t} )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height },\n\t} );\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder className=\"block-editor-media-placeholder\">\n\t\t\t\t{ placeholderIllustration }\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message[ 2 ], { type: 'snackbar' } );\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<DimensionControls\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\tlet image;\n\tif ( ! featuredImage && isDescendentOfQueryLoop ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>{ placeholderChip }</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\n\tif ( ! featuredImage ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage = ! media ? (\n\t\t\tplaceholderChip\n\t\t) : (\n\t\t\t<img\n\t\t\t\tsrc={ mediaUrl }\n\t\t\t\talt={\n\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\tstyle={ { height, objectFit: height && scale } }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MenuItem onClick={ () => setFeaturedImage( 0 ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>{ image }</figure>\n\t\t</>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( props ) {\n\tconst blockProps = useBlockProps();\n\tif ( ! props.context?.postId ) {\n\t\treturn <div { ...blockProps }>{ placeholderChip }</div>;\n\t}\n\treturn <PostFeaturedImageDisplay { ...props } />;\n}\n"]}
@@ -15,7 +15,7 @@ var _i18n = require("@wordpress/i18n");
15
15
  * WordPress dependencies
16
16
  */
17
17
  const TEMPLATE = [['core/paragraph', {
18
- placeholder: (0, _i18n.__)('Add a text or blocks that will display when the query returns no results.')
18
+ placeholder: (0, _i18n.__)('Add text or blocks that will display when the query returns no results.')
19
19
  }]];
20
20
 
21
21
  function QueryNoResultsEdit() {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/query-no-results/edit.js"],"names":["TEMPLATE","placeholder","QueryNoResultsEdit","blockProps","innerBlocksProps","template"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAE,cACZ,2EADY;AADd,CAFD,CADgB,CAAjB;;AAWe,SAASC,kBAAT,GAA8B;AAC5C,QAAMC,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ,EAAEL;AAD+C,GAAjC,CAAzB;AAGA,SACC,qDACC,mCAAUI,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":["TEMPLATE","placeholder","QueryNoResultsEdit","blockProps","innerBlocksProps","template"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAE,cACZ,yEADY;AADd,CAFD,CADgB,CAAjB;;AAWe,SAASC,kBAAT,GAA8B;AAC5C,QAAMC,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ,EAAEL;AAD+C,GAAjC,CAAzB;AAGA,SACC,qDACC,mCAAUI,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"]}
@@ -21,8 +21,13 @@ var _transforms = _interopRequireDefault(require("./transforms"));
21
21
 
22
22
  var _v = _interopRequireDefault(require("./v2"));
23
23
 
24
- var _window;
24
+ /**
25
+ * WordPress dependencies
26
+ */
25
27
 
28
+ /**
29
+ * Internal dependencies
30
+ */
26
31
  const metadata = {
27
32
  $schema: "https://schemas.wp.org/trunk/block.json",
28
33
  apiVersion: 2,
@@ -131,6 +136,12 @@ const settingsV1 = {
131
136
  deprecated: _deprecated.default
132
137
  };
133
138
  exports.settingsV1 = settingsV1;
134
- const settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableQuoteBlockV2 ? _v.default : settingsV1;
139
+ let settings = settingsV1;
135
140
  exports.settings = settings;
141
+
142
+ if (process.env.IS_GUTENBERG_PLUGIN) {
143
+ var _window;
144
+
145
+ exports.settings = settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableQuoteBlockV2 ? _v.default : settingsV1;
146
+ }
136
147
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["name","metadata","settingsV1","icon","example","attributes","value","citation","transforms","edit","save","merge","deprecated","settings","window","__experimentalEnableQuoteBlockV2","settingsV2"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,UAAU,GAAG;AACzBC,EAAAA,IAAI,EAAJA,YADyB;AAEzBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,KAAK,EACJ,QAAQ,cAAI,uCAAJ,CAAR,GAAwD,MAF9C;AAGXC,MAAAA,QAAQ,EAAE;AAHC;AADJ,GAFgB;AASzBC,EAAAA,UAAU,EAAVA,mBATyB;AAUzBC,EAAAA,IAAI,EAAJA,aAVyB;AAWzBC,EAAAA,IAAI,EAAJA,aAXyB;;AAYzBC,EAAAA,KAAK,CAAEN,UAAF,QAAoC;AAAA,QAAtB;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KAAsB;;AACxC;AACA;AACA,QAAK,CAAEA,QAAP,EAAkB;AACjBA,MAAAA,QAAQ,GAAGF,UAAU,CAACE,QAAtB;AACA;;AAED,QAAK,CAAED,KAAF,IAAWA,KAAK,KAAK,SAA1B,EAAsC;AACrC,aAAO,EACN,GAAGD,UADG;AAENE,QAAAA;AAFM,OAAP;AAIA;;AAED,WAAO,EACN,GAAGF,UADG;AAENC,MAAAA,KAAK,EAAED,UAAU,CAACC,KAAX,GAAmBA,KAFpB;AAGNC,MAAAA;AAHM,KAAP;AAKA,GA/BwB;;AAgCzBK,EAAAA,UAAU,EAAVA;AAhCyB,CAAnB;;AAmCA,MAAMC,QAAQ,GAAG,WAAAC,MAAM,UAAN,kCAAQC,gCAAR,GACrBC,UADqB,GAErBd,UAFI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t'<p>' + __( 'In quoting others, we cite ourselves.' ) + '</p>',\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, { value, citation } ) {\n\t\t// Quote citations cannot be merged. Pick the second one unless it's\n\t\t// empty.\n\t\tif ( ! citation ) {\n\t\t\tcitation = attributes.citation;\n\t\t}\n\n\t\tif ( ! value || value === '<p></p>' ) {\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tcitation,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalue: attributes.value + value,\n\t\t\tcitation,\n\t\t};\n\t},\n\tdeprecated,\n};\n\nexport const settings = window?.__experimentalEnableQuoteBlockV2\n\t? settingsV2\n\t: settingsV1;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["name","metadata","settingsV1","icon","example","attributes","value","citation","transforms","edit","save","merge","deprecated","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableQuoteBlockV2","settingsV2"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,UAAU,GAAG;AACzBC,EAAAA,IAAI,EAAJA,YADyB;AAEzBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,KAAK,EACJ,QAAQ,cAAI,uCAAJ,CAAR,GAAwD,MAF9C;AAGXC,MAAAA,QAAQ,EAAE;AAHC;AADJ,GAFgB;AASzBC,EAAAA,UAAU,EAAVA,mBATyB;AAUzBC,EAAAA,IAAI,EAAJA,aAVyB;AAWzBC,EAAAA,IAAI,EAAJA,aAXyB;;AAYzBC,EAAAA,KAAK,CAAEN,UAAF,QAAoC;AAAA,QAAtB;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KAAsB;;AACxC;AACA;AACA,QAAK,CAAEA,QAAP,EAAkB;AACjBA,MAAAA,QAAQ,GAAGF,UAAU,CAACE,QAAtB;AACA;;AAED,QAAK,CAAED,KAAF,IAAWA,KAAK,KAAK,SAA1B,EAAsC;AACrC,aAAO,EACN,GAAGD,UADG;AAENE,QAAAA;AAFM,OAAP;AAIA;;AAED,WAAO,EACN,GAAGF,UADG;AAENC,MAAAA,KAAK,EAAED,UAAU,CAACC,KAAX,GAAmBA,KAFpB;AAGNC,MAAAA;AAHM,KAAP;AAKA,GA/BwB;;AAgCzBK,EAAAA,UAAU,EAAVA;AAhCyB,CAAnB;;AAmCP,IAAIC,QAAQ,GAAGX,UAAf;;;AACA,IAAKY,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AAAA;;AACtC,qBAAAH,QAAQ,GAAG,WAAAI,MAAM,UAAN,kCAAQC,gCAAR,GACRC,UADQ,GAERjB,UAFH;AAGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t'<p>' + __( 'In quoting others, we cite ourselves.' ) + '</p>',\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, { value, citation } ) {\n\t\t// Quote citations cannot be merged. Pick the second one unless it's\n\t\t// empty.\n\t\tif ( ! citation ) {\n\t\t\tcitation = attributes.citation;\n\t\t}\n\n\t\tif ( ! value || value === '<p></p>' ) {\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tcitation,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalue: attributes.value + value,\n\t\t\tcitation,\n\t\t};\n\t},\n\tdeprecated,\n};\n\nlet settings = settingsV1;\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tsettings = window?.__experimentalEnableQuoteBlockV2\n\t\t? settingsV2\n\t\t: settingsV1;\n}\nexport { settings };\n"]}
@@ -199,7 +199,7 @@ function AudioEdit(_ref) {
199
199
  label: __('Metadata')
200
200
  }, {
201
201
  value: 'none',
202
- label: _x('None', '"Preload" value')
202
+ label: _x('None', 'Preload value')
203
203
  }]
204
204
  }))), createElement("figure", blockProps, createElement(Disabled, {
205
205
  isDisabled: !isSelected