@wordpress/editor 14.12.0 → 14.13.0

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 (742) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +120 -99
  3. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  4. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  5. package/build/components/collab-sidebar/add-comment.js +17 -65
  6. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  7. package/build/components/collab-sidebar/comment-author-info.js +76 -0
  8. package/build/components/collab-sidebar/comment-author-info.js.map +1 -0
  9. package/build/components/collab-sidebar/comment-button-toolbar.js +2 -2
  10. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  11. package/build/components/collab-sidebar/comment-button.js +2 -2
  12. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  13. package/build/components/collab-sidebar/comment-form.js +64 -0
  14. package/build/components/collab-sidebar/comment-form.js.map +1 -0
  15. package/build/components/collab-sidebar/comments.js +33 -91
  16. package/build/components/collab-sidebar/comments.js.map +1 -1
  17. package/build/components/create-template-part-modal/index.js +1 -2
  18. package/build/components/create-template-part-modal/index.js.map +1 -1
  19. package/build/components/document-bar/index.js +10 -3
  20. package/build/components/document-bar/index.js.map +1 -1
  21. package/build/components/document-outline/check.js +4 -4
  22. package/build/components/document-outline/check.js.map +1 -1
  23. package/build/components/document-outline/index.js +8 -8
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-tools/index.js +1 -1
  26. package/build/components/document-tools/index.js.map +1 -1
  27. package/build/components/editor-history/redo.js +1 -1
  28. package/build/components/editor-history/redo.js.map +1 -1
  29. package/build/components/editor-history/undo.js +1 -1
  30. package/build/components/editor-history/undo.js.map +1 -1
  31. package/build/components/editor-interface/content-slot-fill.js +1 -10
  32. package/build/components/editor-interface/content-slot-fill.js.map +1 -1
  33. package/build/components/editor-interface/index.js +3 -9
  34. package/build/components/editor-interface/index.js.map +1 -1
  35. package/build/components/editor-notices/index.js +1 -1
  36. package/build/components/editor-notices/index.js.map +1 -1
  37. package/build/components/editor-snackbars/index.js +1 -1
  38. package/build/components/editor-snackbars/index.js.map +1 -1
  39. package/build/components/entities-saved-states/entity-record-item.js +9 -1
  40. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  41. package/build/components/entities-saved-states/index.js +2 -2
  42. package/build/components/entities-saved-states/index.js.map +1 -1
  43. package/build/components/page-attributes/check.js +3 -3
  44. package/build/components/page-attributes/check.js.map +1 -1
  45. package/build/components/page-attributes/order.js +1 -1
  46. package/build/components/page-attributes/order.js.map +1 -1
  47. package/build/components/page-attributes/panel.js +1 -1
  48. package/build/components/page-attributes/panel.js.map +1 -1
  49. package/build/components/page-attributes/parent.js +1 -1
  50. package/build/components/page-attributes/parent.js.map +1 -1
  51. package/build/components/plugin-document-setting-panel/index.js +2 -2
  52. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  53. package/build/components/plugin-more-menu-item/index.js +2 -1
  54. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  55. package/build/components/plugin-post-publish-panel/index.js +2 -2
  56. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  57. package/build/components/plugin-post-status-info/index.js +4 -4
  58. package/build/components/plugin-post-status-info/index.js.map +1 -1
  59. package/build/components/plugin-pre-publish-panel/index.js +2 -2
  60. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  61. package/build/components/plugin-preview-menu-item/index.js +2 -1
  62. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  63. package/build/components/plugin-sidebar/index.js +1 -0
  64. package/build/components/plugin-sidebar/index.js.map +1 -1
  65. package/build/components/plugin-sidebar-more-menu-item/index.js +2 -1
  66. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  67. package/build/components/post-actions/actions.js +3 -3
  68. package/build/components/post-actions/actions.js.map +1 -1
  69. package/build/components/post-author/check.js +3 -3
  70. package/build/components/post-author/check.js.map +1 -1
  71. package/build/components/post-author/index.js +1 -1
  72. package/build/components/post-author/index.js.map +1 -1
  73. package/build/components/post-author/panel.js +1 -1
  74. package/build/components/post-author/panel.js.map +1 -1
  75. package/build/components/post-card-panel/index.js +9 -4
  76. package/build/components/post-card-panel/index.js.map +1 -1
  77. package/build/components/post-comments/index.js +1 -1
  78. package/build/components/post-comments/index.js.map +1 -1
  79. package/build/components/post-discussion/panel.js +1 -1
  80. package/build/components/post-discussion/panel.js.map +1 -1
  81. package/build/components/post-excerpt/check.js +3 -3
  82. package/build/components/post-excerpt/check.js.map +1 -1
  83. package/build/components/post-excerpt/panel.js +1 -1
  84. package/build/components/post-excerpt/panel.js.map +1 -1
  85. package/build/components/post-excerpt/plugin.js +4 -4
  86. package/build/components/post-excerpt/plugin.js.map +1 -1
  87. package/build/components/post-featured-image/check.js +3 -3
  88. package/build/components/post-featured-image/check.js.map +1 -1
  89. package/build/components/post-featured-image/index.js +39 -9
  90. package/build/components/post-featured-image/index.js.map +1 -1
  91. package/build/components/post-featured-image/panel.js +1 -1
  92. package/build/components/post-featured-image/panel.js.map +1 -1
  93. package/build/components/post-fields/index.js +70 -0
  94. package/build/components/post-fields/index.js.map +1 -0
  95. package/build/components/post-format/check.js +9 -12
  96. package/build/components/post-format/check.js.map +1 -1
  97. package/build/components/post-format/index.js +1 -1
  98. package/build/components/post-format/index.js.map +1 -1
  99. package/build/components/post-format/panel.js +1 -1
  100. package/build/components/post-format/panel.js.map +1 -1
  101. package/build/components/post-last-revision/check.js +3 -3
  102. package/build/components/post-last-revision/check.js.map +1 -1
  103. package/build/components/post-last-revision/index.js +1 -1
  104. package/build/components/post-last-revision/index.js.map +1 -1
  105. package/build/components/post-last-revision/panel.js +1 -1
  106. package/build/components/post-last-revision/panel.js.map +1 -1
  107. package/build/components/post-locked-modal/index.js +1 -1
  108. package/build/components/post-locked-modal/index.js.map +1 -1
  109. package/build/components/post-pending-status/check.js +3 -3
  110. package/build/components/post-pending-status/check.js.map +1 -1
  111. package/build/components/post-pending-status/index.js +1 -1
  112. package/build/components/post-pending-status/index.js.map +1 -1
  113. package/build/components/post-preview-button/index.js +1 -1
  114. package/build/components/post-preview-button/index.js.map +1 -1
  115. package/build/components/post-publish-panel/index.js +5 -2
  116. package/build/components/post-publish-panel/index.js.map +1 -1
  117. package/build/components/post-schedule/check.js +3 -3
  118. package/build/components/post-schedule/check.js.map +1 -1
  119. package/build/components/post-schedule/index.js +1 -1
  120. package/build/components/post-schedule/index.js.map +1 -1
  121. package/build/components/post-schedule/label.js +1 -1
  122. package/build/components/post-schedule/label.js.map +1 -1
  123. package/build/components/post-schedule/panel.js +1 -1
  124. package/build/components/post-schedule/panel.js.map +1 -1
  125. package/build/components/post-slug/check.js +3 -3
  126. package/build/components/post-slug/check.js.map +1 -1
  127. package/build/components/post-slug/index.js +1 -1
  128. package/build/components/post-slug/index.js.map +1 -1
  129. package/build/components/post-sticky/check.js +3 -3
  130. package/build/components/post-sticky/check.js.map +1 -1
  131. package/build/components/post-sticky/index.js +1 -1
  132. package/build/components/post-sticky/index.js.map +1 -1
  133. package/build/components/post-switch-to-draft-button/index.js +1 -1
  134. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  135. package/build/components/post-sync-status/index.js +1 -1
  136. package/build/components/post-sync-status/index.js.map +1 -1
  137. package/build/components/post-taxonomies/check.js +3 -3
  138. package/build/components/post-taxonomies/check.js.map +1 -1
  139. package/build/components/post-taxonomies/flat-term-selector.js +1 -1
  140. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  141. package/build/components/post-taxonomies/panel.js +16 -13
  142. package/build/components/post-taxonomies/panel.js.map +1 -1
  143. package/build/components/post-template/classic-theme.js +2 -2
  144. package/build/components/post-template/classic-theme.js.map +1 -1
  145. package/build/components/post-template/panel.js +1 -1
  146. package/build/components/post-template/panel.js.map +1 -1
  147. package/build/components/post-text-editor/index.js +1 -1
  148. package/build/components/post-text-editor/index.js.map +1 -1
  149. package/build/components/post-title/index.js +20 -18
  150. package/build/components/post-title/index.js.map +1 -1
  151. package/build/components/post-title/post-title-raw.js +1 -1
  152. package/build/components/post-title/post-title-raw.js.map +1 -1
  153. package/build/components/post-trash/check.js +3 -3
  154. package/build/components/post-trash/check.js.map +1 -1
  155. package/build/components/post-trash/index.js +1 -1
  156. package/build/components/post-trash/index.js.map +1 -1
  157. package/build/components/post-type-support-check/index.js +6 -6
  158. package/build/components/post-type-support-check/index.js.map +1 -1
  159. package/build/components/post-url/check.js +3 -3
  160. package/build/components/post-url/check.js.map +1 -1
  161. package/build/components/post-url/index.js +1 -1
  162. package/build/components/post-url/index.js.map +1 -1
  163. package/build/components/post-url/label.js +1 -1
  164. package/build/components/post-url/label.js.map +1 -1
  165. package/build/components/post-url/panel.js +1 -1
  166. package/build/components/post-url/panel.js.map +1 -1
  167. package/build/components/post-visibility/check.js +1 -1
  168. package/build/components/post-visibility/check.js.map +1 -1
  169. package/build/components/post-visibility/index.js +1 -1
  170. package/build/components/post-visibility/index.js.map +1 -1
  171. package/build/components/preferences-modal/block-visibility.js +87 -0
  172. package/build/components/preferences-modal/block-visibility.js.map +1 -0
  173. package/build/components/preferences-modal/enable-panel.js +27 -19
  174. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  175. package/build/components/preferences-modal/enable-publish-sidebar.js +13 -10
  176. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  177. package/build/components/preferences-modal/index.js +2 -2
  178. package/build/components/preferences-modal/index.js.map +1 -1
  179. package/build/components/provider/index.js +14 -8
  180. package/build/components/provider/index.js.map +1 -1
  181. package/build/components/table-of-contents/index.js +1 -1
  182. package/build/components/table-of-contents/index.js.map +1 -1
  183. package/build/components/theme-support-check/index.js +4 -4
  184. package/build/components/theme-support-check/index.js.map +1 -1
  185. package/build/components/time-to-read/index.js +1 -1
  186. package/build/components/time-to-read/index.js.map +1 -1
  187. package/build/components/unsaved-changes-warning/index.js +1 -1
  188. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  189. package/build/components/word-count/index.js +1 -1
  190. package/build/components/word-count/index.js.map +1 -1
  191. package/build/components/zoom-out-toggle/index.js +8 -3
  192. package/build/components/zoom-out-toggle/index.js.map +1 -1
  193. package/build/dataviews/api.js +41 -0
  194. package/build/dataviews/api.js.map +1 -1
  195. package/build/dataviews/store/private-actions.js +26 -4
  196. package/build/dataviews/store/private-actions.js.map +1 -1
  197. package/build/dataviews/store/private-selectors.js +5 -0
  198. package/build/dataviews/store/private-selectors.js.map +1 -1
  199. package/build/dataviews/store/reducer.js +23 -0
  200. package/build/dataviews/store/reducer.js.map +1 -1
  201. package/build/private-apis.js +4 -0
  202. package/build/private-apis.js.map +1 -1
  203. package/build/store/actions.js +11 -9
  204. package/build/store/actions.js.map +1 -1
  205. package/build/store/private-selectors.js +5 -1
  206. package/build/store/private-selectors.js.map +1 -1
  207. package/build/store/reducer.native.js +1 -0
  208. package/build/store/reducer.native.js.map +1 -1
  209. package/build/store/selectors.js +34 -42
  210. package/build/store/selectors.js.map +1 -1
  211. package/build/utils/get-template-info.js +60 -0
  212. package/build/utils/get-template-info.js.map +1 -0
  213. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  214. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  215. package/build-module/components/collab-sidebar/add-comment.js +18 -67
  216. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  217. package/build-module/components/collab-sidebar/comment-author-info.js +71 -0
  218. package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -0
  219. package/build-module/components/collab-sidebar/comment-button-toolbar.js +2 -2
  220. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  221. package/build-module/components/collab-sidebar/comment-button.js +2 -2
  222. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  223. package/build-module/components/collab-sidebar/comment-form.js +59 -0
  224. package/build-module/components/collab-sidebar/comment-form.js.map +1 -0
  225. package/build-module/components/collab-sidebar/comments.js +33 -91
  226. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  227. package/build-module/components/create-template-part-modal/index.js +1 -2
  228. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  229. package/build-module/components/document-bar/index.js +10 -3
  230. package/build-module/components/document-bar/index.js.map +1 -1
  231. package/build-module/components/document-outline/check.js +4 -4
  232. package/build-module/components/document-outline/check.js.map +1 -1
  233. package/build-module/components/document-outline/index.js +8 -8
  234. package/build-module/components/document-outline/index.js.map +1 -1
  235. package/build-module/components/document-tools/index.js +1 -1
  236. package/build-module/components/document-tools/index.js.map +1 -1
  237. package/build-module/components/editor-history/redo.js +1 -1
  238. package/build-module/components/editor-history/redo.js.map +1 -1
  239. package/build-module/components/editor-history/undo.js +1 -1
  240. package/build-module/components/editor-history/undo.js.map +1 -1
  241. package/build-module/components/editor-interface/content-slot-fill.js +2 -11
  242. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -1
  243. package/build-module/components/editor-interface/index.js +4 -10
  244. package/build-module/components/editor-interface/index.js.map +1 -1
  245. package/build-module/components/editor-notices/index.js +1 -1
  246. package/build-module/components/editor-notices/index.js.map +1 -1
  247. package/build-module/components/editor-snackbars/index.js +1 -1
  248. package/build-module/components/editor-snackbars/index.js.map +1 -1
  249. package/build-module/components/entities-saved-states/entity-record-item.js +9 -1
  250. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  251. package/build-module/components/entities-saved-states/index.js +2 -2
  252. package/build-module/components/entities-saved-states/index.js.map +1 -1
  253. package/build-module/components/page-attributes/check.js +3 -3
  254. package/build-module/components/page-attributes/check.js.map +1 -1
  255. package/build-module/components/page-attributes/order.js +1 -1
  256. package/build-module/components/page-attributes/order.js.map +1 -1
  257. package/build-module/components/page-attributes/panel.js +1 -1
  258. package/build-module/components/page-attributes/panel.js.map +1 -1
  259. package/build-module/components/page-attributes/parent.js +1 -1
  260. package/build-module/components/page-attributes/parent.js.map +1 -1
  261. package/build-module/components/plugin-document-setting-panel/index.js +2 -2
  262. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  263. package/build-module/components/plugin-more-menu-item/index.js +2 -1
  264. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  265. package/build-module/components/plugin-post-publish-panel/index.js +2 -2
  266. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  267. package/build-module/components/plugin-post-status-info/index.js +4 -4
  268. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  269. package/build-module/components/plugin-pre-publish-panel/index.js +2 -2
  270. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  271. package/build-module/components/plugin-preview-menu-item/index.js +2 -1
  272. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  273. package/build-module/components/plugin-sidebar/index.js +1 -0
  274. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  275. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
  276. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  277. package/build-module/components/post-actions/actions.js +3 -3
  278. package/build-module/components/post-actions/actions.js.map +1 -1
  279. package/build-module/components/post-author/check.js +3 -3
  280. package/build-module/components/post-author/check.js.map +1 -1
  281. package/build-module/components/post-author/index.js +1 -1
  282. package/build-module/components/post-author/index.js.map +1 -1
  283. package/build-module/components/post-author/panel.js +1 -1
  284. package/build-module/components/post-author/panel.js.map +1 -1
  285. package/build-module/components/post-card-panel/index.js +9 -4
  286. package/build-module/components/post-card-panel/index.js.map +1 -1
  287. package/build-module/components/post-comments/index.js +1 -1
  288. package/build-module/components/post-comments/index.js.map +1 -1
  289. package/build-module/components/post-discussion/panel.js +1 -1
  290. package/build-module/components/post-discussion/panel.js.map +1 -1
  291. package/build-module/components/post-excerpt/check.js +3 -3
  292. package/build-module/components/post-excerpt/check.js.map +1 -1
  293. package/build-module/components/post-excerpt/panel.js +1 -1
  294. package/build-module/components/post-excerpt/panel.js.map +1 -1
  295. package/build-module/components/post-excerpt/plugin.js +4 -4
  296. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  297. package/build-module/components/post-featured-image/check.js +3 -3
  298. package/build-module/components/post-featured-image/check.js.map +1 -1
  299. package/build-module/components/post-featured-image/index.js +40 -10
  300. package/build-module/components/post-featured-image/index.js.map +1 -1
  301. package/build-module/components/post-featured-image/panel.js +1 -1
  302. package/build-module/components/post-featured-image/panel.js.map +1 -1
  303. package/build-module/components/post-fields/index.js +62 -0
  304. package/build-module/components/post-fields/index.js.map +1 -0
  305. package/build-module/components/post-format/check.js +10 -11
  306. package/build-module/components/post-format/check.js.map +1 -1
  307. package/build-module/components/post-format/index.js +1 -1
  308. package/build-module/components/post-format/index.js.map +1 -1
  309. package/build-module/components/post-format/panel.js +1 -1
  310. package/build-module/components/post-format/panel.js.map +1 -1
  311. package/build-module/components/post-last-revision/check.js +3 -3
  312. package/build-module/components/post-last-revision/check.js.map +1 -1
  313. package/build-module/components/post-last-revision/index.js +1 -1
  314. package/build-module/components/post-last-revision/index.js.map +1 -1
  315. package/build-module/components/post-last-revision/panel.js +1 -1
  316. package/build-module/components/post-last-revision/panel.js.map +1 -1
  317. package/build-module/components/post-locked-modal/index.js +1 -1
  318. package/build-module/components/post-locked-modal/index.js.map +1 -1
  319. package/build-module/components/post-pending-status/check.js +3 -3
  320. package/build-module/components/post-pending-status/check.js.map +1 -1
  321. package/build-module/components/post-pending-status/index.js +1 -1
  322. package/build-module/components/post-pending-status/index.js.map +1 -1
  323. package/build-module/components/post-preview-button/index.js +1 -1
  324. package/build-module/components/post-preview-button/index.js.map +1 -1
  325. package/build-module/components/post-publish-panel/index.js +5 -2
  326. package/build-module/components/post-publish-panel/index.js.map +1 -1
  327. package/build-module/components/post-schedule/check.js +3 -3
  328. package/build-module/components/post-schedule/check.js.map +1 -1
  329. package/build-module/components/post-schedule/index.js +1 -1
  330. package/build-module/components/post-schedule/index.js.map +1 -1
  331. package/build-module/components/post-schedule/label.js +1 -1
  332. package/build-module/components/post-schedule/label.js.map +1 -1
  333. package/build-module/components/post-schedule/panel.js +1 -1
  334. package/build-module/components/post-schedule/panel.js.map +1 -1
  335. package/build-module/components/post-slug/check.js +3 -3
  336. package/build-module/components/post-slug/check.js.map +1 -1
  337. package/build-module/components/post-slug/index.js +1 -1
  338. package/build-module/components/post-slug/index.js.map +1 -1
  339. package/build-module/components/post-sticky/check.js +3 -3
  340. package/build-module/components/post-sticky/check.js.map +1 -1
  341. package/build-module/components/post-sticky/index.js +1 -1
  342. package/build-module/components/post-sticky/index.js.map +1 -1
  343. package/build-module/components/post-switch-to-draft-button/index.js +1 -1
  344. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  345. package/build-module/components/post-sync-status/index.js +1 -1
  346. package/build-module/components/post-sync-status/index.js.map +1 -1
  347. package/build-module/components/post-taxonomies/check.js +3 -3
  348. package/build-module/components/post-taxonomies/check.js.map +1 -1
  349. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -1
  350. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  351. package/build-module/components/post-taxonomies/panel.js +17 -12
  352. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  353. package/build-module/components/post-template/classic-theme.js +2 -2
  354. package/build-module/components/post-template/classic-theme.js.map +1 -1
  355. package/build-module/components/post-template/panel.js +1 -1
  356. package/build-module/components/post-template/panel.js.map +1 -1
  357. package/build-module/components/post-text-editor/index.js +1 -1
  358. package/build-module/components/post-text-editor/index.js.map +1 -1
  359. package/build-module/components/post-title/index.js +20 -18
  360. package/build-module/components/post-title/index.js.map +1 -1
  361. package/build-module/components/post-title/post-title-raw.js +1 -1
  362. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  363. package/build-module/components/post-trash/check.js +3 -3
  364. package/build-module/components/post-trash/check.js.map +1 -1
  365. package/build-module/components/post-trash/index.js +1 -1
  366. package/build-module/components/post-trash/index.js.map +1 -1
  367. package/build-module/components/post-type-support-check/index.js +6 -6
  368. package/build-module/components/post-type-support-check/index.js.map +1 -1
  369. package/build-module/components/post-url/check.js +3 -3
  370. package/build-module/components/post-url/check.js.map +1 -1
  371. package/build-module/components/post-url/index.js +1 -1
  372. package/build-module/components/post-url/index.js.map +1 -1
  373. package/build-module/components/post-url/label.js +1 -1
  374. package/build-module/components/post-url/label.js.map +1 -1
  375. package/build-module/components/post-url/panel.js +1 -1
  376. package/build-module/components/post-url/panel.js.map +1 -1
  377. package/build-module/components/post-visibility/check.js +1 -1
  378. package/build-module/components/post-visibility/check.js.map +1 -1
  379. package/build-module/components/post-visibility/index.js +1 -1
  380. package/build-module/components/post-visibility/index.js.map +1 -1
  381. package/build-module/components/preferences-modal/block-visibility.js +80 -0
  382. package/build-module/components/preferences-modal/block-visibility.js.map +1 -0
  383. package/build-module/components/preferences-modal/enable-panel.js +27 -19
  384. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  385. package/build-module/components/preferences-modal/enable-publish-sidebar.js +13 -10
  386. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  387. package/build-module/components/preferences-modal/index.js +2 -2
  388. package/build-module/components/preferences-modal/index.js.map +1 -1
  389. package/build-module/components/provider/index.js +14 -8
  390. package/build-module/components/provider/index.js.map +1 -1
  391. package/build-module/components/table-of-contents/index.js +1 -1
  392. package/build-module/components/table-of-contents/index.js.map +1 -1
  393. package/build-module/components/theme-support-check/index.js +4 -4
  394. package/build-module/components/theme-support-check/index.js.map +1 -1
  395. package/build-module/components/time-to-read/index.js +1 -1
  396. package/build-module/components/time-to-read/index.js.map +1 -1
  397. package/build-module/components/unsaved-changes-warning/index.js +1 -1
  398. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  399. package/build-module/components/word-count/index.js +1 -1
  400. package/build-module/components/word-count/index.js.map +1 -1
  401. package/build-module/components/zoom-out-toggle/index.js +8 -3
  402. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  403. package/build-module/dataviews/api.js +39 -0
  404. package/build-module/dataviews/api.js.map +1 -1
  405. package/build-module/dataviews/store/private-actions.js +23 -3
  406. package/build-module/dataviews/store/private-actions.js.map +1 -1
  407. package/build-module/dataviews/store/private-selectors.js +4 -0
  408. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  409. package/build-module/dataviews/store/reducer.js +23 -0
  410. package/build-module/dataviews/store/reducer.js.map +1 -1
  411. package/build-module/private-apis.js +4 -0
  412. package/build-module/private-apis.js.map +1 -1
  413. package/build-module/store/actions.js +11 -9
  414. package/build-module/store/actions.js.map +1 -1
  415. package/build-module/store/private-selectors.js +6 -3
  416. package/build-module/store/private-selectors.js.map +1 -1
  417. package/build-module/store/reducer.native.js +2 -1
  418. package/build-module/store/reducer.native.js.map +1 -1
  419. package/build-module/store/selectors.js +33 -39
  420. package/build-module/store/selectors.js.map +1 -1
  421. package/build-module/utils/get-template-info.js +51 -0
  422. package/build-module/utils/get-template-info.js.map +1 -0
  423. package/build-style/style-rtl.css +11 -81
  424. package/build-style/style.css +11 -81
  425. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +2 -2
  426. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  427. package/build-types/components/collab-sidebar/add-comment.d.ts +2 -2
  428. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  429. package/build-types/components/collab-sidebar/comment-author-info.d.ts +17 -0
  430. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
  431. package/build-types/components/collab-sidebar/comment-form.d.ts +18 -0
  432. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
  433. package/build-types/components/collab-sidebar/comments.d.ts +2 -2
  434. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  435. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  436. package/build-types/components/document-bar/index.d.ts +2 -2
  437. package/build-types/components/document-bar/index.d.ts.map +1 -1
  438. package/build-types/components/document-outline/check.d.ts +5 -5
  439. package/build-types/components/document-outline/check.d.ts.map +1 -1
  440. package/build-types/components/document-outline/index.d.ts +4 -6
  441. package/build-types/components/document-outline/index.d.ts.map +1 -1
  442. package/build-types/components/document-tools/index.d.ts.map +1 -1
  443. package/build-types/components/editor-interface/content-slot-fill.d.ts +12 -1
  444. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -1
  445. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  446. package/build-types/components/editor-notices/index.d.ts +2 -2
  447. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  448. package/build-types/components/editor-snackbars/index.d.ts +2 -2
  449. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  450. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  451. package/build-types/components/entities-saved-states/index.d.ts +4 -4
  452. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  453. package/build-types/components/header/back-button.d.ts.map +1 -1
  454. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  455. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  456. package/build-types/components/page-attributes/check.d.ts +5 -5
  457. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  458. package/build-types/components/page-attributes/order.d.ts +2 -2
  459. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  460. package/build-types/components/page-attributes/panel.d.ts +2 -2
  461. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  462. package/build-types/components/page-attributes/parent.d.ts +2 -2
  463. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  464. package/build-types/components/plugin-document-setting-panel/index.d.ts +4 -4
  465. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  466. package/build-types/components/plugin-more-menu-item/index.d.ts +4 -2
  467. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  468. package/build-types/components/plugin-post-publish-panel/index.d.ts +4 -4
  469. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  470. package/build-types/components/plugin-post-status-info/index.d.ts +6 -6
  471. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  472. package/build-types/components/plugin-pre-publish-panel/index.d.ts +4 -4
  473. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  474. package/build-types/components/plugin-preview-menu-item/index.d.ts +4 -2
  475. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  476. package/build-types/components/plugin-sidebar/index.d.ts +2 -0
  477. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  478. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +4 -2
  479. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  480. package/build-types/components/post-author/check.d.ts +5 -5
  481. package/build-types/components/post-author/check.d.ts.map +1 -1
  482. package/build-types/components/post-author/index.d.ts +2 -2
  483. package/build-types/components/post-author/index.d.ts.map +1 -1
  484. package/build-types/components/post-author/panel.d.ts +2 -2
  485. package/build-types/components/post-author/panel.d.ts.map +1 -1
  486. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  487. package/build-types/components/post-discussion/panel.d.ts +2 -2
  488. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  489. package/build-types/components/post-excerpt/check.d.ts +5 -5
  490. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  491. package/build-types/components/post-excerpt/panel.d.ts +2 -2
  492. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  493. package/build-types/components/post-excerpt/plugin.d.ts +6 -6
  494. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  495. package/build-types/components/post-featured-image/check.d.ts +5 -5
  496. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  497. package/build-types/components/post-featured-image/panel.d.ts +2 -2
  498. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  499. package/build-types/components/post-fields/index.d.ts +12 -0
  500. package/build-types/components/post-fields/index.d.ts.map +1 -0
  501. package/build-types/components/post-format/check.d.ts +11 -4
  502. package/build-types/components/post-format/check.d.ts.map +1 -1
  503. package/build-types/components/post-format/index.d.ts +2 -2
  504. package/build-types/components/post-format/index.d.ts.map +1 -1
  505. package/build-types/components/post-format/panel.d.ts +2 -2
  506. package/build-types/components/post-format/panel.d.ts.map +1 -1
  507. package/build-types/components/post-last-revision/check.d.ts +5 -5
  508. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  509. package/build-types/components/post-last-revision/index.d.ts +2 -2
  510. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  511. package/build-types/components/post-last-revision/panel.d.ts +2 -2
  512. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  513. package/build-types/components/post-locked-modal/index.d.ts +2 -2
  514. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  515. package/build-types/components/post-pending-status/check.d.ts +5 -5
  516. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  517. package/build-types/components/post-pending-status/index.d.ts +2 -2
  518. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  519. package/build-types/components/post-preview-button/index.d.ts +2 -2
  520. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  521. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  522. package/build-types/components/post-schedule/check.d.ts +5 -5
  523. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  524. package/build-types/components/post-schedule/index.d.ts +2 -2
  525. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  526. package/build-types/components/post-schedule/label.d.ts +2 -2
  527. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  528. package/build-types/components/post-schedule/panel.d.ts +2 -2
  529. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  530. package/build-types/components/post-slug/check.d.ts +5 -5
  531. package/build-types/components/post-slug/check.d.ts.map +1 -1
  532. package/build-types/components/post-slug/index.d.ts +2 -2
  533. package/build-types/components/post-slug/index.d.ts.map +1 -1
  534. package/build-types/components/post-sticky/check.d.ts +5 -5
  535. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  536. package/build-types/components/post-sticky/index.d.ts +2 -2
  537. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  538. package/build-types/components/post-switch-to-draft-button/index.d.ts +2 -2
  539. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  540. package/build-types/components/post-sync-status/index.d.ts +2 -2
  541. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  542. package/build-types/components/post-taxonomies/check.d.ts +5 -5
  543. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  544. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +2 -2
  545. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  546. package/build-types/components/post-taxonomies/panel.d.ts +6 -2
  547. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
  548. package/build-types/components/post-template/panel.d.ts +2 -2
  549. package/build-types/components/post-template/panel.d.ts.map +1 -1
  550. package/build-types/components/post-text-editor/index.d.ts +2 -2
  551. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  552. package/build-types/components/post-title/index.d.ts +1 -1
  553. package/build-types/components/post-trash/check.d.ts +5 -5
  554. package/build-types/components/post-trash/check.d.ts.map +1 -1
  555. package/build-types/components/post-trash/index.d.ts +2 -2
  556. package/build-types/components/post-trash/index.d.ts.map +1 -1
  557. package/build-types/components/post-type-support-check/index.d.ts +8 -8
  558. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  559. package/build-types/components/post-url/check.d.ts +5 -5
  560. package/build-types/components/post-url/check.d.ts.map +1 -1
  561. package/build-types/components/post-url/index.d.ts +2 -2
  562. package/build-types/components/post-url/index.d.ts.map +1 -1
  563. package/build-types/components/post-url/label.d.ts +2 -2
  564. package/build-types/components/post-url/label.d.ts.map +1 -1
  565. package/build-types/components/post-url/panel.d.ts +2 -2
  566. package/build-types/components/post-url/panel.d.ts.map +1 -1
  567. package/build-types/components/post-visibility/check.d.ts +2 -2
  568. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  569. package/build-types/components/post-visibility/index.d.ts +2 -2
  570. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  571. package/build-types/components/preferences-modal/block-visibility.d.ts +2 -0
  572. package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -0
  573. package/build-types/components/preferences-modal/enable-panel.d.ts +1 -2
  574. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
  575. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  576. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +1 -2
  577. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
  578. package/build-types/components/provider/index.d.ts +2 -2
  579. package/build-types/components/provider/index.d.ts.map +1 -1
  580. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  581. package/build-types/components/theme-support-check/index.d.ts +6 -6
  582. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  583. package/build-types/components/time-to-read/index.d.ts +2 -2
  584. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  585. package/build-types/components/unsaved-changes-warning/index.d.ts +2 -2
  586. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  587. package/build-types/components/word-count/index.d.ts +2 -2
  588. package/build-types/components/word-count/index.d.ts.map +1 -1
  589. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  590. package/build-types/dataviews/api.d.ts +24 -0
  591. package/build-types/dataviews/api.d.ts.map +1 -1
  592. package/build-types/dataviews/store/private-actions.d.ts +14 -2
  593. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  594. package/build-types/dataviews/store/private-selectors.d.ts +1 -0
  595. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  596. package/build-types/dataviews/store/reducer.d.ts +10 -2
  597. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  598. package/build-types/private-apis.d.ts.map +1 -1
  599. package/build-types/store/actions.d.ts +7 -5
  600. package/build-types/store/actions.d.ts.map +1 -1
  601. package/build-types/store/private-selectors.d.ts +1 -0
  602. package/build-types/store/private-selectors.d.ts.map +1 -1
  603. package/build-types/store/reducer.d.ts +5 -0
  604. package/build-types/store/reducer.d.ts.map +1 -1
  605. package/build-types/store/selectors.d.ts +4 -11
  606. package/build-types/store/selectors.d.ts.map +1 -1
  607. package/build-types/utils/get-template-info.d.ts +6 -0
  608. package/build-types/utils/get-template-info.d.ts.map +1 -0
  609. package/package.json +2 -2
  610. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  611. package/src/components/collab-sidebar/add-comment.js +21 -78
  612. package/src/components/collab-sidebar/comment-author-info.js +68 -0
  613. package/src/components/collab-sidebar/comment-button-toolbar.js +3 -3
  614. package/src/components/collab-sidebar/comment-button.js +3 -3
  615. package/src/components/collab-sidebar/comment-form.js +62 -0
  616. package/src/components/collab-sidebar/comments.js +39 -101
  617. package/src/components/create-template-part-modal/index.js +3 -2
  618. package/src/components/document-bar/index.js +12 -3
  619. package/src/components/document-outline/check.js +4 -4
  620. package/src/components/document-outline/index.js +9 -9
  621. package/src/components/document-tools/index.js +3 -2
  622. package/src/components/editor-history/redo.js +1 -1
  623. package/src/components/editor-history/undo.js +1 -1
  624. package/src/components/editor-interface/content-slot-fill.js +4 -9
  625. package/src/components/editor-interface/index.js +1 -11
  626. package/src/components/editor-notices/index.js +1 -1
  627. package/src/components/editor-snackbars/index.js +1 -1
  628. package/src/components/entities-saved-states/entity-record-item.js +12 -4
  629. package/src/components/entities-saved-states/index.js +2 -2
  630. package/src/components/header/style.scss +2 -1
  631. package/src/components/page-attributes/check.js +3 -3
  632. package/src/components/page-attributes/order.js +1 -1
  633. package/src/components/page-attributes/panel.js +1 -1
  634. package/src/components/page-attributes/parent.js +1 -1
  635. package/src/components/plugin-document-setting-panel/index.js +2 -2
  636. package/src/components/plugin-more-menu-item/index.js +2 -1
  637. package/src/components/plugin-post-publish-panel/index.js +2 -2
  638. package/src/components/plugin-post-status-info/index.js +4 -4
  639. package/src/components/plugin-pre-publish-panel/index.js +2 -2
  640. package/src/components/plugin-preview-menu-item/index.js +2 -1
  641. package/src/components/plugin-sidebar/index.js +1 -0
  642. package/src/components/plugin-sidebar-more-menu-item/index.js +2 -2
  643. package/src/components/post-actions/actions.js +3 -3
  644. package/src/components/post-author/check.js +3 -3
  645. package/src/components/post-author/index.js +1 -1
  646. package/src/components/post-author/panel.js +1 -1
  647. package/src/components/post-card-panel/index.js +18 -5
  648. package/src/components/post-comments/index.js +1 -1
  649. package/src/components/post-discussion/panel.js +1 -1
  650. package/src/components/post-excerpt/check.js +3 -3
  651. package/src/components/post-excerpt/panel.js +1 -1
  652. package/src/components/post-excerpt/plugin.js +4 -4
  653. package/src/components/post-featured-image/check.js +3 -3
  654. package/src/components/post-featured-image/index.js +107 -43
  655. package/src/components/post-featured-image/panel.js +1 -1
  656. package/src/components/post-featured-image/style.scss +23 -13
  657. package/src/components/post-fields/index.ts +76 -0
  658. package/src/components/post-format/check.js +9 -11
  659. package/src/components/post-format/index.js +1 -1
  660. package/src/components/post-format/panel.js +1 -1
  661. package/src/components/post-last-revision/check.js +3 -3
  662. package/src/components/post-last-revision/index.js +1 -1
  663. package/src/components/post-last-revision/panel.js +1 -1
  664. package/src/components/post-locked-modal/index.js +1 -1
  665. package/src/components/post-pending-status/check.js +3 -3
  666. package/src/components/post-pending-status/index.js +1 -1
  667. package/src/components/post-preview-button/index.js +1 -1
  668. package/src/components/post-publish-panel/index.js +7 -3
  669. package/src/components/post-schedule/check.js +3 -3
  670. package/src/components/post-schedule/index.js +1 -1
  671. package/src/components/post-schedule/label.js +1 -1
  672. package/src/components/post-schedule/panel.js +1 -1
  673. package/src/components/post-slug/check.js +3 -3
  674. package/src/components/post-slug/index.js +1 -1
  675. package/src/components/post-sticky/check.js +3 -3
  676. package/src/components/post-sticky/index.js +1 -1
  677. package/src/components/post-switch-to-draft-button/index.js +1 -1
  678. package/src/components/post-sync-status/index.js +1 -1
  679. package/src/components/post-taxonomies/check.js +3 -3
  680. package/src/components/post-taxonomies/flat-term-selector.js +1 -1
  681. package/src/components/post-taxonomies/panel.js +15 -12
  682. package/src/components/post-template/classic-theme.js +2 -2
  683. package/src/components/post-template/panel.js +1 -1
  684. package/src/components/post-text-editor/index.js +1 -1
  685. package/src/components/post-title/index.js +20 -18
  686. package/src/components/post-title/post-title-raw.js +1 -1
  687. package/src/components/post-trash/check.js +3 -3
  688. package/src/components/post-trash/index.js +1 -1
  689. package/src/components/post-type-support-check/index.js +6 -6
  690. package/src/components/post-url/check.js +3 -3
  691. package/src/components/post-url/index.js +1 -1
  692. package/src/components/post-url/label.js +1 -1
  693. package/src/components/post-url/panel.js +1 -1
  694. package/src/components/post-visibility/check.js +1 -1
  695. package/src/components/post-visibility/index.js +1 -1
  696. package/src/components/preferences-modal/block-visibility.js +96 -0
  697. package/src/components/preferences-modal/enable-panel.js +27 -17
  698. package/src/components/preferences-modal/enable-publish-sidebar.js +18 -15
  699. package/src/components/preferences-modal/index.js +2 -2
  700. package/src/components/provider/index.js +55 -30
  701. package/src/components/table-of-contents/index.js +1 -1
  702. package/src/components/theme-support-check/index.js +4 -4
  703. package/src/components/time-to-read/index.js +1 -1
  704. package/src/components/unsaved-changes-warning/index.js +1 -1
  705. package/src/components/word-count/index.js +1 -1
  706. package/src/components/zoom-out-toggle/index.js +26 -13
  707. package/src/dataviews/api.js +41 -0
  708. package/src/dataviews/store/private-actions.ts +57 -3
  709. package/src/dataviews/store/private-selectors.ts +4 -0
  710. package/src/dataviews/store/reducer.ts +38 -1
  711. package/src/private-apis.js +4 -1
  712. package/src/store/actions.js +13 -9
  713. package/src/store/private-selectors.js +13 -8
  714. package/src/store/reducer.native.js +2 -0
  715. package/src/store/selectors.js +80 -62
  716. package/src/store/test/selectors.js +0 -255
  717. package/src/style.scss +0 -1
  718. package/src/utils/get-template-info.js +52 -0
  719. package/src/utils/test/get-template-info.js +224 -0
  720. package/tsconfig.tsbuildinfo +1 -1
  721. package/build/components/block-manager/category.js +0 -107
  722. package/build/components/block-manager/category.js.map +0 -1
  723. package/build/components/block-manager/checklist.js +0 -35
  724. package/build/components/block-manager/checklist.js.map +0 -1
  725. package/build/components/block-manager/index.js +0 -115
  726. package/build/components/block-manager/index.js.map +0 -1
  727. package/build-module/components/block-manager/category.js +0 -99
  728. package/build-module/components/block-manager/category.js.map +0 -1
  729. package/build-module/components/block-manager/checklist.js +0 -28
  730. package/build-module/components/block-manager/checklist.js.map +0 -1
  731. package/build-module/components/block-manager/index.js +0 -107
  732. package/build-module/components/block-manager/index.js.map +0 -1
  733. package/build-types/components/block-manager/category.d.ts +0 -6
  734. package/build-types/components/block-manager/category.d.ts.map +0 -1
  735. package/build-types/components/block-manager/checklist.d.ts +0 -7
  736. package/build-types/components/block-manager/checklist.d.ts.map +0 -1
  737. package/build-types/components/block-manager/index.d.ts +0 -2
  738. package/build-types/components/block-manager/index.d.ts.map +0 -1
  739. package/src/components/block-manager/category.js +0 -96
  740. package/src/components/block-manager/checklist.js +0 -30
  741. package/src/components/block-manager/index.js +0 -145
  742. package/src/components/block-manager/style.scss +0 -82
@@ -15,6 +15,7 @@ import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE } from '../../store/constan
15
15
  import { unlock } from '../../lock-unlock';
16
16
  import PostActions from '../post-actions';
17
17
  import usePageTypeBadge from '../../utils/pageTypeBadge';
18
+ import { getTemplateInfo } from '../../utils/get-template-info';
18
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
20
  export default function PostCardPanel({
20
21
  postType,
@@ -25,14 +26,18 @@ export default function PostCardPanel({
25
26
  title,
26
27
  icon
27
28
  } = useSelect(select => {
28
- const {
29
- __experimentalGetTemplateInfo
30
- } = select(editorStore);
29
+ var _select$getEntityReco;
31
30
  const {
32
31
  getEditedEntityRecord
33
32
  } = select(coreStore);
34
33
  const _record = getEditedEntityRecord('postType', postType, postId);
35
- const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType) && __experimentalGetTemplateInfo(_record);
34
+ const {
35
+ default_template_types: templateTypes = []
36
+ } = (_select$getEntityReco = select(coreStore).getEntityRecord('root', '__unstableBase')) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : {};
37
+ const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType) ? getTemplateInfo({
38
+ template: _record,
39
+ templateTypes
40
+ }) : {};
36
41
  return {
37
42
  title: _templateInfo?.title || _record?.title,
38
43
  icon: unlock(select(editorStore)).getPostIcon(postType, {
@@ -1 +1 @@
1
- {"version":3,"names":["Icon","__experimentalHStack","HStack","__experimentalText","Text","store","coreStore","useSelect","__","decodeEntities","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","unlock","PostActions","usePageTypeBadge","jsx","_jsx","jsxs","_jsxs","PostCardPanel","postType","postId","onActionPerformed","title","icon","select","__experimentalGetTemplateInfo","getEditedEntityRecord","_record","_templateInfo","includes","getPostIcon","area","pageTypeBadge","className","children","spacing","align","numberOfLines","truncate","weight","as","lineHeight"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\n\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst { title, icon } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __experimentalGetTemplateInfo } = select( editorStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst _templateInfo =\n\t\t\t\t[ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(\n\t\t\t\t\tpostType\n\t\t\t\t) && __experimentalGetTemplateInfo( _record );\n\t\t\treturn {\n\t\t\t\ttitle: _templateInfo?.title || _record?.title,\n\t\t\t\ticon: unlock( select( editorStore ) ).getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\n\tconst pageTypeBadge = usePageTypeBadge();\n\n\treturn (\n\t\t<div className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon className=\"editor-post-card-panel__icon\" icon={ icon } />\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t\tlineHeight=\"20px\"\n\t\t\t\t>\n\t\t\t\t\t{ title ? decodeEntities( title ) : __( 'No title' ) }\n\t\t\t\t\t{ pageTypeBadge && (\n\t\t\t\t\t\t<span className=\"editor-post-card-panel__title-badge\">\n\t\t\t\t\t\t\t{ pageTypeBadge }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t<PostActions\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAA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ExC,oBACCE,IAAA;IAAKkB,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACtCjB,KAAA,CAACjB,MAAM;MACNmC,OAAO,EAAG,CAAG;MACbF,SAAS,EAAC,gCAAgC;MAC1CG,KAAK,EAAC,YAAY;MAAAF,QAAA,gBAElBnB,IAAA,CAACjB,IAAI;QAACmC,SAAS,EAAC,8BAA8B;QAACV,IAAI,EAAGA;MAAM,CAAE,CAAC,eAC/DN,KAAA,CAACf,IAAI;QACJmC,aAAa,EAAG,CAAG;QACnBC,QAAQ;QACRL,SAAS,EAAC,+BAA+B;QACzCM,MAAM,EAAG,GAAK;QACdC,EAAE,EAAC,IAAI;QACPC,UAAU,EAAC,MAAM;QAAAP,QAAA,GAEfZ,KAAK,GAAGf,cAAc,CAAEe,KAAM,CAAC,GAAGhB,EAAE,CAAE,UAAW,CAAC,EAClD0B,aAAa,iBACdjB,IAAA;UAAMkB,SAAS,EAAC,qCAAqC;UAAAC,QAAA,EAClDF;QAAa,CACV,CACN;MAAA,CACI,CAAC,eACPjB,IAAA,CAACH,WAAW;QACXO,QAAQ,EAAGA,QAAU;QACrBC,MAAM,EAAGA,MAAQ;QACjBC,iBAAiB,EAAGA;MAAmB,CACvC,CAAC;IAAA,CACK;EAAC,CACL,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["Icon","__experimentalHStack","HStack","__experimentalText","Text","store","coreStore","useSelect","__","decodeEntities","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","unlock","PostActions","usePageTypeBadge","getTemplateInfo","jsx","_jsx","jsxs","_jsxs","PostCardPanel","postType","postId","onActionPerformed","title","icon","select","_select$getEntityReco","getEditedEntityRecord","_record","default_template_types","templateTypes","getEntityRecord","_templateInfo","includes","template","getPostIcon","area","pageTypeBadge","className","children","spacing","align","numberOfLines","truncate","weight","as","lineHeight"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\n\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst { title, icon } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase'\n\t\t\t\t) ?? {};\n\n\t\t\tconst _templateInfo = [\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t].includes( postType )\n\t\t\t\t? getTemplateInfo( {\n\t\t\t\t\t\ttemplate: _record,\n\t\t\t\t\t\ttemplateTypes,\n\t\t\t\t } )\n\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\ttitle: _templateInfo?.title || _record?.title,\n\t\t\t\ticon: unlock( select( editorStore ) ).getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\n\tconst pageTypeBadge = usePageTypeBadge();\n\n\treturn (\n\t\t<div className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon className=\"editor-post-card-panel__icon\" icon={ icon } />\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t\tlineHeight=\"20px\"\n\t\t\t\t>\n\t\t\t\t\t{ title ? decodeEntities( title ) : __( 'No title' ) }\n\t\t\t\t\t{ pageTypeBadge && (\n\t\t\t\t\t\t<span className=\"editor-post-card-panel__title-badge\">\n\t\t\t\t\t\t\t{ pageTypeBadge }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t<PostActions\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAClD,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,gBAAgB,MAAM,2BAA2B;AACxD,SAASC,eAAe,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA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,YAAY;MAAAF,QAAA,gBAElBvB,IAAA,CAAClB,IAAI;QAACwC,SAAS,EAAC,8BAA8B;QAACd,IAAI,EAAGA;MAAM,CAAE,CAAC,eAC/DN,KAAA,CAAChB,IAAI;QACJwC,aAAa,EAAG,CAAG;QACnBC,QAAQ;QACRL,SAAS,EAAC,+BAA+B;QACzCM,MAAM,EAAG,GAAK;QACdC,EAAE,EAAC,IAAI;QACPC,UAAU,EAAC,MAAM;QAAAP,QAAA,GAEfhB,KAAK,GAAGhB,cAAc,CAAEgB,KAAM,CAAC,GAAGjB,EAAE,CAAE,UAAW,CAAC,EAClD+B,aAAa,iBACdrB,IAAA;UAAMsB,SAAS,EAAC,qCAAqC;UAAAC,QAAA,EAClDF;QAAa,CACV,CACN;MAAA,CACI,CAAC,eACPrB,IAAA,CAACJ,WAAW;QACXQ,QAAQ,EAAGA,QAAU;QACrBC,MAAM,EAAGA,MAAQ;QACjBC,iBAAiB,EAAGA;MAAmB,CACvC,CAAC;IAAA,CACK;EAAC,CACL,CAAC;AAER","ignoreList":[]}
@@ -48,7 +48,7 @@ function PostComments() {
48
48
  /**
49
49
  * A form for managing comment status.
50
50
  *
51
- * @return {JSX.Element} The rendered PostComments component.
51
+ * @return {React.ReactNode} The rendered PostComments component.
52
52
  */
53
53
  export default PostComments;
54
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","RadioControl","__experimentalVStack","VStack","useDispatch","useSelect","store","editorStore","jsx","_jsx","COMMENT_OPTIONS","label","value","description","join","PostComments","commentStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","handleStatus","newCommentStatus","comment_status","children","spacing","className","hideLabelFromVision","options","onChange","selected"],"sources":["@wordpress/editor/src/components/post-comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tRadioControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst COMMENT_OPTIONS = [\n\t{\n\t\tlabel: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' ),\n\t\tvalue: 'open',\n\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t},\n\t{\n\t\tlabel: __( 'Closed' ),\n\t\tvalue: 'closed',\n\t\tdescription: [\n\t\t\t__( 'Visitors cannot add new comments or replies.' ),\n\t\t\t__( 'Existing comments remain visible.' ),\n\t\t].join( ' ' ),\n\t},\n];\n\nfunction PostComments() {\n\tconst commentStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'comment_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst handleStatus = ( newCommentStatus ) =>\n\t\teditPost( {\n\t\t\tcomment_status: newCommentStatus,\n\t\t} );\n\n\treturn (\n\t\t<form>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<RadioControl\n\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Comment status' ) }\n\t\t\t\t\toptions={ COMMENT_OPTIONS }\n\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\tselected={ commentStatus }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\n/**\n * A form for managing comment status.\n *\n * @return {JSX.Element} The rendered PostComments component.\n */\nexport default PostComments;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,YAAY,EACZC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,MAAMC,eAAe,GAAG,CACvB;EACCC,KAAK,EAAEX,EAAE,CAAE,MAAM,EAAE,qCAAsC,CAAC;EAC1DY,KAAK,EAAE,MAAM;EACbC,WAAW,EAAEd,EAAE,CAAE,4CAA6C;AAC/D,CAAC,EACD;EACCY,KAAK,EAAEZ,EAAE,CAAE,QAAS,CAAC;EACrBa,KAAK,EAAE,QAAQ;EACfC,WAAW,EAAE,CACZd,EAAE,CAAE,8CAA+C,CAAC,EACpDA,EAAE,CAAE,mCAAoC,CAAC,CACzC,CAACe,IAAI,CAAE,GAAI;AACb,CAAC,CACD;AAED,SAASC,YAAYA,CAAA,EAAG;EACvB,MAAMC,aAAa,GAAGX,SAAS,CAC5BY,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEV,WAAY,CAAC,CAACY,sBAAsB,CAAE,gBAAiB,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAChE,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGhB,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMc,YAAY,GAAKC,gBAAgB,IACtCF,QAAQ,CAAE;IACTG,cAAc,EAAED;EACjB,CAAE,CAAC;EAEJ,oBACCb,IAAA;IAAAe,QAAA,eACCf,IAAA,CAACN,MAAM;MAACsB,OAAO,EAAG,CAAG;MAAAD,QAAA,eACpBf,IAAA,CAACR,YAAY;QACZyB,SAAS,EAAC,+BAA+B;QACzCC,mBAAmB;QACnBhB,KAAK,EAAGZ,EAAE,CAAE,gBAAiB,CAAG;QAChC6B,OAAO,EAAGlB,eAAiB;QAC3BmB,QAAQ,EAAGR,YAAc;QACzBS,QAAQ,EAAGd;MAAe,CAC1B;IAAC,CACK;EAAC,CACJ,CAAC;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeD,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","RadioControl","__experimentalVStack","VStack","useDispatch","useSelect","store","editorStore","jsx","_jsx","COMMENT_OPTIONS","label","value","description","join","PostComments","commentStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","handleStatus","newCommentStatus","comment_status","children","spacing","className","hideLabelFromVision","options","onChange","selected"],"sources":["@wordpress/editor/src/components/post-comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tRadioControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst COMMENT_OPTIONS = [\n\t{\n\t\tlabel: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' ),\n\t\tvalue: 'open',\n\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t},\n\t{\n\t\tlabel: __( 'Closed' ),\n\t\tvalue: 'closed',\n\t\tdescription: [\n\t\t\t__( 'Visitors cannot add new comments or replies.' ),\n\t\t\t__( 'Existing comments remain visible.' ),\n\t\t].join( ' ' ),\n\t},\n];\n\nfunction PostComments() {\n\tconst commentStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'comment_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst handleStatus = ( newCommentStatus ) =>\n\t\teditPost( {\n\t\t\tcomment_status: newCommentStatus,\n\t\t} );\n\n\treturn (\n\t\t<form>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<RadioControl\n\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Comment status' ) }\n\t\t\t\t\toptions={ COMMENT_OPTIONS }\n\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\tselected={ commentStatus }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\n/**\n * A form for managing comment status.\n *\n * @return {React.ReactNode} The rendered PostComments component.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;QACnBhB,KAAK,EAAGZ,EAAE,CAAE,gBAAiB,CAAG;QAChC6B,OAAO,EAAGlB,eAAiB;QAC3BmB,QAAQ,EAAGR,YAAc;QACzBS,QAAQ,EAAGd;MAAe,CAC1B;IAAC,CACK;EAAC,CACJ,CAAC;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeD,YAAY","ignoreList":[]}
@@ -92,7 +92,7 @@ function PostDiscussionToggle({
92
92
  * checks whether the current post has support for the
93
93
  * above and if the `discussion-panel` panel is enabled.
94
94
  *
95
- * @return {JSX.Element|null} The rendered PostDiscussionPanel component.
95
+ * @return {React.ReactNode} The rendered PostDiscussionPanel component.
96
96
  */
97
97
  export default function PostDiscussionPanel() {
98
98
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","Dropdown","Button","__experimentalVStack","VStack","useSelect","useState","useMemo","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","store","coreStore","editorStore","PostTypeSupportCheck","PostComments","PostPingbacks","PostPanelRow","jsx","_jsx","jsxs","_jsxs","PANEL_NAME","ModalContents","onClose","className","children","title","spacing","supportKeys","PostDiscussionToggle","isOpen","onClick","commentStatus","pingStatus","commentsSupported","trackbacksSupported","select","_getEditedPostAttribu","_getEditedPostAttribu2","getEditedPostAttribute","getPostType","postType","supports","comments","trackbacks","label","size","variant","PostDiscussionPanel","isEnabled","isEditorPanelEnabled","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent"],"sources":["@wordpress/editor/src/components/post-discussion/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tDropdown,\n\tButton,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport PostComments from '../post-comments';\nimport PostPingbacks from '../post-pingbacks';\nimport PostPanelRow from '../post-panel-row';\n\nconst PANEL_NAME = 'discussion-panel';\n\nfunction ModalContents( { onClose } ) {\n\treturn (\n\t\t<div className=\"editor-post-discussion\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PostComments />\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PostPingbacks />\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nfunction PostDiscussionToggle( { isOpen, onClick } ) {\n\tconst {\n\t\tcommentStatus,\n\t\tpingStatus,\n\t\tcommentsSupported,\n\t\ttrackbacksSupported,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tcommentStatus: getEditedPostAttribute( 'comment_status' ) ?? 'open',\n\t\t\tpingStatus: getEditedPostAttribute( 'ping_status' ) ?? 'open',\n\t\t\tcommentsSupported: !! postType.supports.comments,\n\t\t\ttrackbacksSupported: !! postType.supports.trackbacks,\n\t\t};\n\t}, [] );\n\tlet label;\n\tif ( commentStatus === 'open' ) {\n\t\tif ( pingStatus === 'open' ) {\n\t\t\tlabel = _x( 'Open', 'Adjective: e.g. \"Comments are open\"' );\n\t\t} else {\n\t\t\tlabel = trackbacksSupported\n\t\t\t\t? __( 'Comments only' )\n\t\t\t\t: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' );\n\t\t}\n\t} else if ( pingStatus === 'open' ) {\n\t\tlabel = commentsSupported ? __( 'Pings only' ) : __( 'Pings enabled' );\n\t} else {\n\t\tlabel = __( 'Closed' );\n\t}\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-discussion__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-label={ __( 'Change discussion options' ) }\n\t\t\taria-expanded={ isOpen }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\n/**\n * This component allows to update comment and pingback\n * settings for the current post. Internally there are\n * checks whether the current post has support for the\n * above and if the `discussion-panel` panel is enabled.\n *\n * @return {JSX.Element|null} The rendered PostDiscussionPanel component.\n */\nexport default function PostDiscussionPanel() {\n\tconst { isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled } = select( editorStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PostPanelRow label={ __( 'Discussion' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-discussion__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-discussion__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostDiscussionToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<ModalContents onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,QAAQ,EACRC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;AACxG,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,YAAY,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,UAAU,GAAG,kBAAkB;AAErC,SAASC,aAAaA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACrC,oBACCH,KAAA;IAAKI,SAAS,EAAC,wBAAwB;IAAAC,QAAA,gBACtCP,IAAA,CAACT,sBAAsB;MACtBiB,KAAK,EAAG3B,EAAE,CAAE,YAAa,CAAG;MAC5BwB,OAAO,EAAGA;IA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AAE;EACR,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EAED,IAAK,CAAEF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,oBACC/B,IAAA,CAACL,oBAAoB;IAACe,WAAW,EAAG,CAAE,UAAU,EAAE,YAAY,CAAI;IAAAH,QAAA,eACjEP,IAAA,CAACF,YAAY;MAAC6B,KAAK,EAAG9C,EAAE,CAAE,YAAa,CAAG;MAAC2D,GAAG,EAAGN,gBAAkB;MAAA3B,QAAA,eAClEP,IAAA,CAACjB,QAAQ;QACRoD,YAAY,EAAGA,YAAc;QAC7B7B,SAAS,EAAC,wCAAwC;QAClDmC,gBAAgB,EAAC,sCAAsC;QACvDC,YAAY;QACZC,YAAY,EAAGA,CAAE;UAAE/B,MAAM;UAAEgC;QAAS,CAAC,kBACpC5C,IAAA,CAACW,oBAAoB;UACpBC,MAAM,EAAGA,MAAQ;UACjBC,OAAO,EAAG+B;QAAU,CACpB,CACC;QACHC,aAAa,EAAGA,CAAE;UAAExC;QAAQ,CAAC,kBAC5BL,IAAA,CAACI,aAAa;UAACC,OAAO,EAAGA;QAAS,CAAE;MAClC,CACH;IAAC,CACW;EAAC,CACM,CAAC;AAEzB","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","Dropdown","Button","__experimentalVStack","VStack","useSelect","useState","useMemo","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","store","coreStore","editorStore","PostTypeSupportCheck","PostComments","PostPingbacks","PostPanelRow","jsx","_jsx","jsxs","_jsxs","PANEL_NAME","ModalContents","onClose","className","children","title","spacing","supportKeys","PostDiscussionToggle","isOpen","onClick","commentStatus","pingStatus","commentsSupported","trackbacksSupported","select","_getEditedPostAttribu","_getEditedPostAttribu2","getEditedPostAttribute","getPostType","postType","supports","comments","trackbacks","label","size","variant","PostDiscussionPanel","isEnabled","isEditorPanelEnabled","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent"],"sources":["@wordpress/editor/src/components/post-discussion/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tDropdown,\n\tButton,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport PostComments from '../post-comments';\nimport PostPingbacks from '../post-pingbacks';\nimport PostPanelRow from '../post-panel-row';\n\nconst PANEL_NAME = 'discussion-panel';\n\nfunction ModalContents( { onClose } ) {\n\treturn (\n\t\t<div className=\"editor-post-discussion\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PostComments />\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PostPingbacks />\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nfunction PostDiscussionToggle( { isOpen, onClick } ) {\n\tconst {\n\t\tcommentStatus,\n\t\tpingStatus,\n\t\tcommentsSupported,\n\t\ttrackbacksSupported,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tcommentStatus: getEditedPostAttribute( 'comment_status' ) ?? 'open',\n\t\t\tpingStatus: getEditedPostAttribute( 'ping_status' ) ?? 'open',\n\t\t\tcommentsSupported: !! postType.supports.comments,\n\t\t\ttrackbacksSupported: !! postType.supports.trackbacks,\n\t\t};\n\t}, [] );\n\tlet label;\n\tif ( commentStatus === 'open' ) {\n\t\tif ( pingStatus === 'open' ) {\n\t\t\tlabel = _x( 'Open', 'Adjective: e.g. \"Comments are open\"' );\n\t\t} else {\n\t\t\tlabel = trackbacksSupported\n\t\t\t\t? __( 'Comments only' )\n\t\t\t\t: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' );\n\t\t}\n\t} else if ( pingStatus === 'open' ) {\n\t\tlabel = commentsSupported ? __( 'Pings only' ) : __( 'Pings enabled' );\n\t} else {\n\t\tlabel = __( 'Closed' );\n\t}\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-discussion__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-label={ __( 'Change discussion options' ) }\n\t\t\taria-expanded={ isOpen }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\n/**\n * This component allows to update comment and pingback\n * settings for the current post. Internally there are\n * checks whether the current post has support for the\n * above and if the `discussion-panel` panel is enabled.\n *\n * @return {React.ReactNode} The rendered PostDiscussionPanel component.\n */\nexport default function PostDiscussionPanel() {\n\tconst { isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled } = select( editorStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PostPanelRow label={ __( 'Discussion' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-discussion__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-discussion__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostDiscussionToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<ModalContents onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,QAAQ,EACRC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;AACxG,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,YAAY,MAAM,mBAAmB;AAAC,SAA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,UAAW;IAC7C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA;EACA,MAAM,CAAE8B,aAAa,EAAEC,gBAAgB,CAAE,GAAG9C,QAAQ,CAAE,IAAK,CAAC;EAC5D;EACA,MAAM+C,YAAY,GAAG9C,OAAO,CAC3B,OAAQ;IACP;IACA;IACA+C,MAAM,EAAEH,aAAa;IACrBI,SAAS,EAAE,YAAY;IACvBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE;EACR,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EAED,IAAK,CAAEF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,oBACC/B,IAAA,CAACL,oBAAoB;IAACe,WAAW,EAAG,CAAE,UAAU,EAAE,YAAY,CAAI;IAAAH,QAAA,eACjEP,IAAA,CAACF,YAAY;MAAC6B,KAAK,EAAG9C,EAAE,CAAE,YAAa,CAAG;MAAC2D,GAAG,EAAGN,gBAAkB;MAAA3B,QAAA,eAClEP,IAAA,CAACjB,QAAQ;QACRoD,YAAY,EAAGA,YAAc;QAC7B7B,SAAS,EAAC,wCAAwC;QAClDmC,gBAAgB,EAAC,sCAAsC;QACvDC,YAAY;QACZC,YAAY,EAAGA,CAAE;UAAE/B,MAAM;UAAEgC;QAAS,CAAC,kBACpC5C,IAAA,CAACW,oBAAoB;UACpBC,MAAM,EAAGA,MAAQ;UACjBC,OAAO,EAAG+B;QAAU,CACpB,CACC;QACHC,aAAa,EAAGA,CAAE;UAAExC;QAAQ,CAAC,kBAC5BL,IAAA,CAACI,aAAa;UAACC,OAAO,EAAGA;QAAS,CAAE;MAClC,CACH;IAAC,CACW;EAAC,CACM,CAAC;AAEzB","ignoreList":[]}
@@ -6,10 +6,10 @@ import PostTypeSupportCheck from '../post-type-support-check';
6
6
  /**
7
7
  * Component for checking if the post type supports the excerpt field.
8
8
  *
9
- * @param {Object} props Props.
10
- * @param {Element} props.children Children to be rendered.
9
+ * @param {Object} props Props.
10
+ * @param {React.ReactNode} props.children Children to be rendered.
11
11
  *
12
- * @return {Component} The component to be rendered.
12
+ * @return {React.ReactNode} The rendered component.
13
13
  */
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  function PostExcerptCheck({
@@ -1 +1 @@
1
- {"version":3,"names":["PostTypeSupportCheck","jsx","_jsx","PostExcerptCheck","children","supportKeys"],"sources":["@wordpress/editor/src/components/post-excerpt/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\n/**\n * Component for checking if the post type supports the excerpt field.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component} The component to be rendered.\n */\nfunction PostExcerptCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"excerpt\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostExcerptCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,4BAA4B;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,SAASC,gBAAgBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzC,oBACCF,IAAA,CAACF,oBAAoB;IAACK,WAAW,EAAC,SAAS;IAAAD,QAAA,EACxCA;EAAQ,CACW,CAAC;AAEzB;AAEA,eAAeD,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["PostTypeSupportCheck","jsx","_jsx","PostExcerptCheck","children","supportKeys"],"sources":["@wordpress/editor/src/components/post-excerpt/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\n/**\n * Component for checking if the post type supports the excerpt field.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostExcerptCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"excerpt\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostExcerptCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,4BAA4B;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,SAASC,gBAAgBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzC,oBACCF,IAAA,CAACF,oBAAoB;IAACK,WAAW,EAAC,SAAS;IAAAD,QAAA,EACxCA;EAAQ,CACW,CAAC;AAEzB;AAEA,eAAeD,gBAAgB","ignoreList":[]}
@@ -65,7 +65,7 @@ function ExcerptPanel() {
65
65
  /**
66
66
  * Is rendered if the post type supports excerpts and allows editing the excerpt.
67
67
  *
68
- * @return {JSX.Element} The rendered PostExcerptPanel component.
68
+ * @return {React.ReactNode} The rendered PostExcerptPanel component.
69
69
  */
70
70
  export default function PostExcerptPanel() {
71
71
  return /*#__PURE__*/_jsx(PostExcerptCheck, {
@@ -1 +1 @@
1
- {"version":3,"names":["__","PanelBody","__experimentalText","Text","Dropdown","Button","__experimentalVStack","VStack","useDispatch","useSelect","useMemo","useState","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","store","coreStore","decodeEntities","PostExcerptForm","PostExcerptCheck","PluginPostExcerpt","TEMPLATE_ORIGINS","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PANEL_NAME","ExcerptPanel","isOpened","isEnabled","postType","select","isEditorPanelOpened","isEditorPanelEnabled","getCurrentPostType","toggleEditorPanelOpened","toggleExcerptPanel","shouldUseDescriptionLabel","includes","title","opened","onToggle","children","Slot","fills","PostExcerptPanel","PrivatePostExcerptPanel","PrivateExcerpt","shouldRender","excerpt","shouldBeUsedAsDescription","allowEditing","getCurrentPostId","getEditedPostAttribute","isTemplateOrTemplatePart","isPattern","_shouldBeUsedAsDescription","_usedAttribute","template","getEntityRecord","_shouldRender","source","custom","has_theme_file","is_custom","popoverAnchor","setPopoverAnchor","label","popoverProps","anchor","headerTitle","placement","offset","shift","excerptText","align","numberOfLines","truncate","excerptPlaceholder","triggerEditLabel","className","contentClassName","focusOnMount","ref","renderToggle","__next40pxDefaultSize","onClick","variant","renderContent","onClose","spacing","hideLabelFromVision","updateOnBlur"],"sources":["@wordpress/editor/src/components/post-excerpt/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tPanelBody,\n\t__experimentalText as Text,\n\tDropdown,\n\tButton,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo, useState } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostExcerptForm from './index';\nimport PostExcerptCheck from './check';\nimport PluginPostExcerpt from './plugin';\nimport { TEMPLATE_ORIGINS } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nfunction ExcerptPanel() {\n\tconst { isOpened, isEnabled, postType } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditorPanelOpened,\n\t\t\tisEditorPanelEnabled,\n\t\t\tgetCurrentPostType,\n\t\t} = select( editorStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\t// There are special cases where we want to label the excerpt as a description.\n\tconst shouldUseDescriptionLabel = [\n\t\t'wp_template',\n\t\t'wp_template_part',\n\t\t'wp_block',\n\t].includes( postType );\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={\n\t\t\t\tshouldUseDescriptionLabel\n\t\t\t\t\t? __( 'Description' )\n\t\t\t\t\t: __( 'Excerpt' )\n\t\t\t}\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ toggleExcerptPanel }\n\t\t>\n\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostExcerpt.Slot>\n\t\t</PanelBody>\n\t);\n}\n\n/**\n * Is rendered if the post type supports excerpts and allows editing the excerpt.\n *\n * @return {JSX.Element} The rendered PostExcerptPanel component.\n */\nexport default function PostExcerptPanel() {\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<ExcerptPanel />\n\t\t</PostExcerptCheck>\n\t);\n}\n\nexport function PrivatePostExcerptPanel() {\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PrivateExcerpt />\n\t\t</PostExcerptCheck>\n\t);\n}\n\nfunction PrivateExcerpt() {\n\tconst { shouldRender, excerpt, shouldBeUsedAsDescription, allowEditing } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tisEditorPanelEnabled,\n\t\t\t} = select( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\tconst isTemplateOrTemplatePart = [\n\t\t\t\t'wp_template',\n\t\t\t\t'wp_template_part',\n\t\t\t].includes( postType );\n\t\t\tconst isPattern = postType === 'wp_block';\n\t\t\t// These post types use the `excerpt` field as a description semantically, so we need to\n\t\t\t// handle proper labeling and some flows where we should always render them as text.\n\t\t\tconst _shouldBeUsedAsDescription =\n\t\t\t\tisTemplateOrTemplatePart || isPattern;\n\t\t\tconst _usedAttribute = isTemplateOrTemplatePart\n\t\t\t\t? 'description'\n\t\t\t\t: 'excerpt';\n\t\t\t// We need to fetch the entity in this case to check if we'll allow editing.\n\t\t\tconst template =\n\t\t\t\tisTemplateOrTemplatePart &&\n\t\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tgetCurrentPostId()\n\t\t\t\t);\n\t\t\t// For post types that use excerpt as description, we do not abide\n\t\t\t// by the `isEnabled` panel flag in order to render them as text.\n\t\t\tconst _shouldRender =\n\t\t\t\tisEditorPanelEnabled( PANEL_NAME ) ||\n\t\t\t\t_shouldBeUsedAsDescription;\n\t\t\treturn {\n\t\t\t\texcerpt: getEditedPostAttribute( _usedAttribute ),\n\t\t\t\tshouldRender: _shouldRender,\n\t\t\t\tshouldBeUsedAsDescription: _shouldBeUsedAsDescription,\n\t\t\t\t// If we should render, allow editing for all post types that are not used as description.\n\t\t\t\t// For the rest allow editing only for user generated entities.\n\t\t\t\tallowEditing:\n\t\t\t\t\t_shouldRender &&\n\t\t\t\t\t( ! _shouldBeUsedAsDescription ||\n\t\t\t\t\t\tisPattern ||\n\t\t\t\t\t\t( template &&\n\t\t\t\t\t\t\ttemplate.source === TEMPLATE_ORIGINS.custom &&\n\t\t\t\t\t\t\t! template.has_theme_file &&\n\t\t\t\t\t\t\ttemplate.is_custom ) ),\n\t\t\t};\n\t\t}, [] );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst label = shouldBeUsedAsDescription\n\t\t? __( 'Description' )\n\t\t: __( 'Excerpt' );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': label,\n\t\t\theaderTitle: label,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor, label ]\n\t);\n\tif ( ! shouldRender ) {\n\t\treturn false;\n\t}\n\tconst excerptText = !! excerpt && (\n\t\t<Text align=\"left\" numberOfLines={ 4 } truncate={ allowEditing }>\n\t\t\t{ decodeEntities( excerpt ) }\n\t\t</Text>\n\t);\n\tif ( ! allowEditing ) {\n\t\treturn excerptText;\n\t}\n\tconst excerptPlaceholder = shouldBeUsedAsDescription\n\t\t? __( 'Add a description…' )\n\t\t: __( 'Add an excerpt…' );\n\tconst triggerEditLabel = shouldBeUsedAsDescription\n\t\t? __( 'Edit description' )\n\t\t: __( 'Edit excerpt' );\n\treturn (\n\t\t<VStack>\n\t\t\t{ excerptText }\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"editor-post-excerpt__dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-excerpt__dropdown__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ excerptText ? triggerEditLabel : excerptPlaceholder }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<PostExcerptForm\n\t\t\t\t\t\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AqB;QACrBC,OAAO,EAAG7C,QAAU;QACpB8C,OAAO,EAAC,MAAM;QAAA7C,QAAA,EAEZgC,WAAW,GAAGK,gBAAgB,GAAGD;MAAkB,CAC9C,CACN;MACHU,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5BhE,KAAA,CAAAF,SAAA;QAAAmB,QAAA,gBACCrB,IAAA,CAACV,sBAAsB;UACtB4B,KAAK,EAAG4B,KAAO;UACfsB,OAAO,EAAGA;QAAS,CACnB,CAAC,eAEFpE,IAAA,CAAChB,MAAM;UAACqF,OAAO,EAAG,CAAG;UAAAhD,QAAA,eACpBrB,IAAA,CAACJ,iBAAiB,CAAC0B,IAAI;YAAAD,QAAA,EAClBE,KAAK,iBACRnB,KAAA,CAAAF,SAAA;cAAAmB,QAAA,gBACCrB,IAAA,CAACN,eAAe;gBACf4E,mBAAmB;gBACnBC,YAAY;cAAA,CACZ,CAAC,EACAhD,KAAK;YAAA,CACN;UACF,CACsB;QAAC,CAClB,CAAC;MAAA,CACR;IACA,CACH,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["__","PanelBody","__experimentalText","Text","Dropdown","Button","__experimentalVStack","VStack","useDispatch","useSelect","useMemo","useState","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","store","coreStore","decodeEntities","PostExcerptForm","PostExcerptCheck","PluginPostExcerpt","TEMPLATE_ORIGINS","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PANEL_NAME","ExcerptPanel","isOpened","isEnabled","postType","select","isEditorPanelOpened","isEditorPanelEnabled","getCurrentPostType","toggleEditorPanelOpened","toggleExcerptPanel","shouldUseDescriptionLabel","includes","title","opened","onToggle","children","Slot","fills","PostExcerptPanel","PrivatePostExcerptPanel","PrivateExcerpt","shouldRender","excerpt","shouldBeUsedAsDescription","allowEditing","getCurrentPostId","getEditedPostAttribute","isTemplateOrTemplatePart","isPattern","_shouldBeUsedAsDescription","_usedAttribute","template","getEntityRecord","_shouldRender","source","custom","has_theme_file","is_custom","popoverAnchor","setPopoverAnchor","label","popoverProps","anchor","headerTitle","placement","offset","shift","excerptText","align","numberOfLines","truncate","excerptPlaceholder","triggerEditLabel","className","contentClassName","focusOnMount","ref","renderToggle","__next40pxDefaultSize","onClick","variant","renderContent","onClose","spacing","hideLabelFromVision","updateOnBlur"],"sources":["@wordpress/editor/src/components/post-excerpt/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tPanelBody,\n\t__experimentalText as Text,\n\tDropdown,\n\tButton,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo, useState } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostExcerptForm from './index';\nimport PostExcerptCheck from './check';\nimport PluginPostExcerpt from './plugin';\nimport { TEMPLATE_ORIGINS } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nfunction ExcerptPanel() {\n\tconst { isOpened, isEnabled, postType } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditorPanelOpened,\n\t\t\tisEditorPanelEnabled,\n\t\t\tgetCurrentPostType,\n\t\t} = select( editorStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\t// There are special cases where we want to label the excerpt as a description.\n\tconst shouldUseDescriptionLabel = [\n\t\t'wp_template',\n\t\t'wp_template_part',\n\t\t'wp_block',\n\t].includes( postType );\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={\n\t\t\t\tshouldUseDescriptionLabel\n\t\t\t\t\t? __( 'Description' )\n\t\t\t\t\t: __( 'Excerpt' )\n\t\t\t}\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ toggleExcerptPanel }\n\t\t>\n\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostExcerpt.Slot>\n\t\t</PanelBody>\n\t);\n}\n\n/**\n * Is rendered if the post type supports excerpts and allows editing the excerpt.\n *\n * @return {React.ReactNode} The rendered PostExcerptPanel component.\n */\nexport default function PostExcerptPanel() {\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<ExcerptPanel />\n\t\t</PostExcerptCheck>\n\t);\n}\n\nexport function PrivatePostExcerptPanel() {\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PrivateExcerpt />\n\t\t</PostExcerptCheck>\n\t);\n}\n\nfunction PrivateExcerpt() {\n\tconst { shouldRender, excerpt, shouldBeUsedAsDescription, allowEditing } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tisEditorPanelEnabled,\n\t\t\t} = select( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\tconst isTemplateOrTemplatePart = [\n\t\t\t\t'wp_template',\n\t\t\t\t'wp_template_part',\n\t\t\t].includes( postType );\n\t\t\tconst isPattern = postType === 'wp_block';\n\t\t\t// These post types use the `excerpt` field as a description semantically, so we need to\n\t\t\t// handle proper labeling and some flows where we should always render them as text.\n\t\t\tconst _shouldBeUsedAsDescription =\n\t\t\t\tisTemplateOrTemplatePart || isPattern;\n\t\t\tconst _usedAttribute = isTemplateOrTemplatePart\n\t\t\t\t? 'description'\n\t\t\t\t: 'excerpt';\n\t\t\t// We need to fetch the entity in this case to check if we'll allow editing.\n\t\t\tconst template =\n\t\t\t\tisTemplateOrTemplatePart &&\n\t\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tgetCurrentPostId()\n\t\t\t\t);\n\t\t\t// For post types that use excerpt as description, we do not abide\n\t\t\t// by the `isEnabled` panel flag in order to render them as text.\n\t\t\tconst _shouldRender =\n\t\t\t\tisEditorPanelEnabled( PANEL_NAME ) ||\n\t\t\t\t_shouldBeUsedAsDescription;\n\t\t\treturn {\n\t\t\t\texcerpt: getEditedPostAttribute( _usedAttribute ),\n\t\t\t\tshouldRender: _shouldRender,\n\t\t\t\tshouldBeUsedAsDescription: _shouldBeUsedAsDescription,\n\t\t\t\t// If we should render, allow editing for all post types that are not used as description.\n\t\t\t\t// For the rest allow editing only for user generated entities.\n\t\t\t\tallowEditing:\n\t\t\t\t\t_shouldRender &&\n\t\t\t\t\t( ! _shouldBeUsedAsDescription ||\n\t\t\t\t\t\tisPattern ||\n\t\t\t\t\t\t( template &&\n\t\t\t\t\t\t\ttemplate.source === TEMPLATE_ORIGINS.custom &&\n\t\t\t\t\t\t\t! template.has_theme_file &&\n\t\t\t\t\t\t\ttemplate.is_custom ) ),\n\t\t\t};\n\t\t}, [] );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst label = shouldBeUsedAsDescription\n\t\t? __( 'Description' )\n\t\t: __( 'Excerpt' );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': label,\n\t\t\theaderTitle: label,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor, label ]\n\t);\n\tif ( ! shouldRender ) {\n\t\treturn false;\n\t}\n\tconst excerptText = !! excerpt && (\n\t\t<Text align=\"left\" numberOfLines={ 4 } truncate={ allowEditing }>\n\t\t\t{ decodeEntities( excerpt ) }\n\t\t</Text>\n\t);\n\tif ( ! allowEditing ) {\n\t\treturn excerptText;\n\t}\n\tconst excerptPlaceholder = shouldBeUsedAsDescription\n\t\t? __( 'Add a description…' )\n\t\t: __( 'Add an excerpt…' );\n\tconst triggerEditLabel = shouldBeUsedAsDescription\n\t\t? __( 'Edit description' )\n\t\t: __( 'Edit excerpt' );\n\treturn (\n\t\t<VStack>\n\t\t\t{ excerptText }\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"editor-post-excerpt__dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-excerpt__dropdown__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ excerptText ? triggerEditLabel : excerptPlaceholder }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\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BpB,IAAA,CAAClB,MAAM;QACNkF,qBAAqB;QACrBC,OAAO,EAAG7C,QAAU;QACpB8C,OAAO,EAAC,MAAM;QAAA7C,QAAA,EAEZgC,WAAW,GAAGK,gBAAgB,GAAGD;MAAkB,CAC9C,CACN;MACHU,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5BhE,KAAA,CAAAF,SAAA;QAAAmB,QAAA,gBACCrB,IAAA,CAACV,sBAAsB;UACtB4B,KAAK,EAAG4B,KAAO;UACfsB,OAAO,EAAGA;QAAS,CACnB,CAAC,eAEFpE,IAAA,CAAChB,MAAM;UAACqF,OAAO,EAAG,CAAG;UAAAhD,QAAA,eACpBrB,IAAA,CAACJ,iBAAiB,CAAC0B,IAAI;YAAAD,QAAA,EAClBE,KAAK,iBACRnB,KAAA,CAAAF,SAAA;cAAAmB,QAAA,gBACCrB,IAAA,CAACN,eAAe;gBACf4E,mBAAmB;gBACnBC,YAAY;cAAA,CACZ,CAAC,EACAhD,KAAK;YAAA,CACN;UACF,CACsB;QAAC,CAClB,CAAC;MAAA,CACR;IACA,CACH,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
@@ -15,9 +15,9 @@ const {
15
15
  /**
16
16
  * Renders a post excerpt panel in the post sidebar.
17
17
  *
18
- * @param {Object} props Component properties.
19
- * @param {string} [props.className] An optional class name added to the row.
20
- * @param {Element} props.children Children to be rendered.
18
+ * @param {Object} props Component properties.
19
+ * @param {string} [props.className] An optional class name added to the row.
20
+ * @param {React.ReactNode} props.children Children to be rendered.
21
21
  *
22
22
  * @example
23
23
  * ```js
@@ -49,7 +49,7 @@ const {
49
49
  * );
50
50
  * ```
51
51
  *
52
- * @return {Component} The component to be rendered.
52
+ * @return {React.ReactNode} The rendered component.
53
53
  */
54
54
  const PluginPostExcerpt = ({
55
55
  children,
@@ -1 +1 @@
1
- {"version":3,"names":["createSlotFill","PanelRow","jsx","_jsx","Fill","Slot","PluginPostExcerpt","children","className"],"sources":["@wordpress/editor/src/components/post-excerpt/plugin.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {Element} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostExcerpt = wp.editPost.__experimentalPluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { __experimentalPluginPostExcerpt as PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGL,cAAc,CAAE,mBAAoB,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,oBACCL,IAAA,CAACC,IAAI;IAAAG,QAAA,eACJJ,IAAA,CAACF,QAAQ;MAACO,SAAS,EAAGA,SAAW;MAAAD,QAAA,EAAGA;IAAQ,CAAY;EAAC,CACpD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACD,IAAI,GAAGA,IAAI;AAE7B,eAAeC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["createSlotFill","PanelRow","jsx","_jsx","Fill","Slot","PluginPostExcerpt","children","className"],"sources":["@wordpress/editor/src/components/post-excerpt/plugin.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostExcerpt = wp.editPost.__experimentalPluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { __experimentalPluginPostExcerpt as PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGL,cAAc,CAAE,mBAAoB,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,oBACCL,IAAA,CAACC,IAAI;IAAAG,QAAA,eACJJ,IAAA,CAACF,QAAQ;MAACO,SAAS,EAAGA,SAAW;MAAAD,QAAA,EAAGA;IAAQ,CAAY;EAAC,CACpD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACD,IAAI,GAAGA,IAAI;AAE7B,eAAeC,iBAAiB","ignoreList":[]}
@@ -8,10 +8,10 @@ import ThemeSupportCheck from '../theme-support-check';
8
8
  * Wrapper component that renders its children only if the post type supports a featured image
9
9
  * and the theme supports post thumbnails.
10
10
  *
11
- * @param {Object} props Props.
12
- * @param {Element} props.children Children to be rendered.
11
+ * @param {Object} props Props.
12
+ * @param {React.ReactNode} props.children Children to be rendered.
13
13
  *
14
- * @return {Component} The component to be rendered.
14
+ * @return {React.ReactNode} The rendered component.
15
15
  */
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  function PostFeaturedImageCheck({
@@ -1 +1 @@
1
- {"version":3,"names":["PostTypeSupportCheck","ThemeSupportCheck","jsx","_jsx","PostFeaturedImageCheck","children","supportKeys"],"sources":["@wordpress/editor/src/components/post-featured-image/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport ThemeSupportCheck from '../theme-support-check';\n\n/**\n * Wrapper component that renders its children only if the post type supports a featured image\n * and the theme supports post thumbnails.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component} The component to be rendered.\n */\nfunction PostFeaturedImageCheck( { children } ) {\n\treturn (\n\t\t<ThemeSupportCheck supportKeys=\"post-thumbnails\">\n\t\t\t<PostTypeSupportCheck supportKeys=\"thumbnail\">\n\t\t\t\t{ children }\n\t\t\t</PostTypeSupportCheck>\n\t\t</ThemeSupportCheck>\n\t);\n}\n\nexport default PostFeaturedImageCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,iBAAiB,MAAM,wBAAwB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AASA,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,oBACCF,IAAA,CAACF,iBAAiB;IAACK,WAAW,EAAC,iBAAiB;IAAAD,QAAA,eAC/CF,IAAA,CAACH,oBAAoB;MAACM,WAAW,EAAC,WAAW;MAAAD,QAAA,EAC1CA;IAAQ,CACW;EAAC,CACL,CAAC;AAEtB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["PostTypeSupportCheck","ThemeSupportCheck","jsx","_jsx","PostFeaturedImageCheck","children","supportKeys"],"sources":["@wordpress/editor/src/components/post-featured-image/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport ThemeSupportCheck from '../theme-support-check';\n\n/**\n * Wrapper component that renders its children only if the post type supports a featured image\n * and the theme supports post thumbnails.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostFeaturedImageCheck( { children } ) {\n\treturn (\n\t\t<ThemeSupportCheck supportKeys=\"post-thumbnails\">\n\t\t\t<PostTypeSupportCheck supportKeys=\"thumbnail\">\n\t\t\t\t{ children }\n\t\t\t</PostTypeSupportCheck>\n\t\t</ThemeSupportCheck>\n\t);\n}\n\nexport default PostFeaturedImageCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,iBAAiB,MAAM,wBAAwB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AASA,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,oBACCF,IAAA,CAACF,iBAAiB;IAACK,WAAW,EAAC,iBAAiB;IAAAD,QAAA,eAC/CF,IAAA,CAACH,oBAAoB;MAACM,WAAW,EAAC,WAAW;MAAAD,QAAA,EAC1CA;IAAQ,CACW;EAAC,CACL,CAAC;AAEtB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
@@ -1,9 +1,14 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
4
9
  import { __, sprintf } from '@wordpress/i18n';
5
10
  import { applyFilters } from '@wordpress/hooks';
6
- import { DropZone, Button, Spinner, withNotices, withFilters, __experimentalHStack as HStack } from '@wordpress/components';
11
+ import { DropZone, Button, Spinner, withNotices, withFilters, __experimentalHStack as HStack, Notice } from '@wordpress/components';
7
12
  import { isBlobURL } from '@wordpress/blob';
8
13
  import { useState, useRef } from '@wordpress/element';
9
14
  import { compose } from '@wordpress/compose';
@@ -64,9 +69,10 @@ function PostFeaturedImage({
64
69
  media,
65
70
  postType,
66
71
  noticeUI,
67
- noticeOperations
72
+ noticeOperations,
73
+ isRequestingFeaturedImageMedia
68
74
  }) {
69
- const toggleRef = useRef();
75
+ const returnsFocusRef = useRef(false);
70
76
  const [isLoading, setIsLoading] = useState(false);
71
77
  const {
72
78
  getSettings
@@ -117,6 +123,13 @@ function PostFeaturedImage({
117
123
  // Translators: %s: The selected image filename.
118
124
  __('The current image has no alternative text. The file name is: %s'), imageMedia.media_details.sizes?.full?.file || imageMedia.slug);
119
125
  }
126
+ function returnFocus(node) {
127
+ if (returnsFocusRef.current && node) {
128
+ node.focus();
129
+ returnsFocusRef.current = false;
130
+ }
131
+ }
132
+ const isMissingMedia = !isRequestingFeaturedImageMedia && !!featuredImageId && !media;
120
133
  return /*#__PURE__*/_jsxs(PostFeaturedImageCheck, {
121
134
  children: [noticeUI, /*#__PURE__*/_jsxs("div", {
122
135
  className: "editor-post-featured-image",
@@ -136,9 +149,13 @@ function PostFeaturedImage({
136
149
  open
137
150
  }) => /*#__PURE__*/_jsxs("div", {
138
151
  className: "editor-post-featured-image__container",
139
- children: [/*#__PURE__*/_jsxs(Button, {
152
+ children: [isMissingMedia ? /*#__PURE__*/_jsx(Notice, {
153
+ status: "warning",
154
+ isDismissible: false,
155
+ children: __('Could not retrieve the featured image data.')
156
+ }) : /*#__PURE__*/_jsxs(Button, {
140
157
  __next40pxDefaultSize: true,
141
- ref: toggleRef,
158
+ ref: returnFocus,
142
159
  className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview',
143
160
  onClick: open,
144
161
  "aria-label": !featuredImageId ? null : __('Edit or replace the featured image'),
@@ -150,22 +167,31 @@ function PostFeaturedImage({
150
167
  className: "editor-post-featured-image__preview-image",
151
168
  src: mediaSourceUrl,
152
169
  alt: getImageDescription(media)
153
- }), isLoading && /*#__PURE__*/_jsx(Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)]
170
+ }), (isLoading || isRequestingFeaturedImageMedia) && /*#__PURE__*/_jsx(Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)]
154
171
  }), !!featuredImageId && /*#__PURE__*/_jsxs(HStack, {
155
- className: "editor-post-featured-image__actions",
172
+ className: clsx('editor-post-featured-image__actions', {
173
+ 'editor-post-featured-image__actions-missing-image': isMissingMedia,
174
+ 'editor-post-featured-image__actions-is-requesting-image': isRequestingFeaturedImageMedia
175
+ }),
156
176
  children: [/*#__PURE__*/_jsx(Button, {
157
177
  __next40pxDefaultSize: true,
158
178
  className: "editor-post-featured-image__action",
159
179
  onClick: open,
160
180
  "aria-haspopup": "dialog",
181
+ variant: isMissingMedia ? 'secondary' : undefined,
161
182
  children: __('Replace')
162
183
  }), /*#__PURE__*/_jsx(Button, {
163
184
  __next40pxDefaultSize: true,
164
185
  className: "editor-post-featured-image__action",
165
186
  onClick: () => {
166
187
  onRemoveImage();
167
- toggleRef.current.focus();
188
+ // Signal that the toggle button should be focused,
189
+ // when it is rendered. Can't focus it directly here
190
+ // because it's rendered conditionally.
191
+ returnsFocusRef.current = true;
168
192
  },
193
+ variant: isMissingMedia ? 'secondary' : undefined,
194
+ isDestructive: isMissingMedia,
169
195
  children: __('Remove')
170
196
  })]
171
197
  }), /*#__PURE__*/_jsx(DropZone, {
@@ -181,7 +207,8 @@ function PostFeaturedImage({
181
207
  const applyWithSelect = withSelect(select => {
182
208
  const {
183
209
  getMedia,
184
- getPostType
210
+ getPostType,
211
+ hasFinishedResolution
185
212
  } = select(coreStore);
186
213
  const {
187
214
  getCurrentPostId,
@@ -194,7 +221,10 @@ const applyWithSelect = withSelect(select => {
194
221
  }) : null,
195
222
  currentPostId: getCurrentPostId(),
196
223
  postType: getPostType(getEditedPostAttribute('type')),
197
- featuredImageId
224
+ featuredImageId,
225
+ isRequestingFeaturedImageMedia: !!featuredImageId && !hasFinishedResolution('getMedia', [featuredImageId, {
226
+ context: 'view'
227
+ }])
198
228
  };
199
229
  });
200
230
  const applyWithDispatch = withDispatch((dispatch, {
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","applyFilters","DropZone","Button","Spinner","withNotices","withFilters","__experimentalHStack","HStack","isBlobURL","useState","useRef","compose","useSelect","withDispatch","withSelect","MediaUpload","MediaUploadCheck","store","blockEditorStore","coreStore","PostFeaturedImageCheck","editorStore","jsx","_jsx","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","children","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","isLoading","setIsLoading","getSettings","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","url","onError","message","removeAllNotices","createErrorNotice","getImageDescription","imageMedia","alt_text","full","file","slug","className","fallback","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","__next40pxDefaultSize","ref","onClick","disabled","accessibleWhenDisabled","src","alt","set_featured_image","current","focus","onFilesDrop","value","applyWithSelect","select","getMedia","getPostType","getCurrentPostId","getEditedPostAttribute","context","applyWithDispatch","dispatch","editPost","featured_media","onDropImage"],"sources":["@wordpress/editor/src/components/post-featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Add a featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n} ) {\n\tconst toggleRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t} );\n\t}\n\n\t/**\n\t * Generates the featured image alt text for this editing context.\n\t *\n\t * @param {Object} imageMedia The image media object.\n\t * @param {string} imageMedia.alt_text The alternative text of the image.\n\t * @param {Object} imageMedia.media_details The media details of the image.\n\t * @param {Object} imageMedia.media_details.sizes The sizes of the image.\n\t * @param {Object} imageMedia.media_details.sizes.full The full size details of the image.\n\t * @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image.\n\t * @param {string} imageMedia.slug The slug of the image.\n\t * @return {string} The featured image alt text.\n\t */\n\tfunction getImageDescription( imageMedia ) {\n\t\tif ( imageMedia.alt_text ) {\n\t\t\treturn sprintf(\n\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\timageMedia.alt_text\n\t\t\t);\n\t\t}\n\t\treturn sprintf(\n\t\t\t// Translators: %s: The selected image filename.\n\t\t\t__(\n\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t),\n\t\t\timageMedia.media_details.sizes?.full?.file || imageMedia.slug\n\t\t);\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ getImageDescription( media ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\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\t'Edit or replace the featured image'\n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\talt={ getImageDescription( media ) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isLoading && <Spinner /> }\n\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack className=\"editor-post-featured-image__actions\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\ttoggleRef.current.focus();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getMedia, getPostType } = select( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getMedia( featuredImageId, { context: 'view' } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\n/**\n * Renders the component for managing the featured image of a post.\n *\n * @param {Object} props Props.\n * @param {number} props.currentPostId ID of the current post.\n * @param {number} props.featuredImageId ID of the featured image.\n * @param {Function} props.onUpdateImage Function to call when the image is updated.\n * @param {Function} props.onRemoveImage Function to call when the image is removed.\n * @param {Object} props.media The media object representing the featured image.\n * @param {string} props.postType Post type.\n * @param {Element} props.noticeUI UI for displaying notices.\n * @param {Object} props.noticeOperations Operations for managing notices.\n *\n * @return {Element} Component to be rendered .\n */\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,QACxB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AE6C;AAAO,CAAC,KAAM;EACjD,MAAM;IAAEQ;EAAS,CAAC,GAAGD,QAAQ,CAAErF,WAAY,CAAC;EAC5C,OAAO;IACN6B,aAAaA,CAAEc,KAAK,EAAG;MACtB2C,QAAQ,CAAE;QAAEC,cAAc,EAAE5C,KAAK,CAAC3B;MAAG,CAAE,CAAC;IACzC,CAAC;IACDwE,WAAWA,CAAEjD,SAAS,EAAG;MACxBuC,MAAM,CAAEjF,gBAAiB,CAAC,CACxBwC,WAAW,CAAC,CAAC,CACbG,WAAW,CAAE;QACbC,YAAY,EAAE,CAAE,OAAO,CAAE;QACzBF,SAAS;QACTG,YAAYA,CAAE,CAAEC,KAAK,CAAE,EAAG;UACzB2C,QAAQ,CAAE;YAAEC,cAAc,EAAE5C,KAAK,CAAC3B;UAAG,CAAE,CAAC;QACzC,CAAC;QACD6B,OAAOA,CAAEC,OAAO,EAAG;UAClBb,gBAAgB,CAACc,gBAAgB,CAAC,CAAC;UACnCd,gBAAgB,CAACe,iBAAiB,CAAEF,OAAQ,CAAC;QAC9C;MACD,CAAE,CAAC;IACL,CAAC;IACDhB,aAAaA,CAAA,EAAG;MACfwD,QAAQ,CAAE;QAAEC,cAAc,EAAE;MAAE,CAAE,CAAC;IAClC;EACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAejG,OAAO,CACrBP,WAAW,EACX8F,eAAe,EACfO,iBAAiB,EACjBpG,WAAW,CAAE,0BAA2B,CACzC,CAAC,CAAE0C,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","sprintf","applyFilters","DropZone","Button","Spinner","withNotices","withFilters","__experimentalHStack","HStack","Notice","isBlobURL","useState","useRef","compose","useSelect","withDispatch","withSelect","MediaUpload","MediaUploadCheck","store","blockEditorStore","coreStore","PostFeaturedImageCheck","editorStore","jsx","_jsx","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","children","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","isRequestingFeaturedImageMedia","returnsFocusRef","isLoading","setIsLoading","getSettings","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","url","onError","message","removeAllNotices","createErrorNotice","getImageDescription","imageMedia","alt_text","full","file","slug","returnFocus","node","current","focus","isMissingMedia","className","fallback","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","status","isDismissible","__next40pxDefaultSize","ref","onClick","disabled","accessibleWhenDisabled","src","alt","set_featured_image","variant","undefined","isDestructive","onFilesDrop","value","applyWithSelect","select","getMedia","getPostType","hasFinishedResolution","getCurrentPostId","getEditedPostAttribute","context","applyWithDispatch","dispatch","editPost","featured_media","onDropImage"],"sources":["@wordpress/editor/src/components/post-featured-image/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n\tNotice,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Add a featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n\tisRequestingFeaturedImageMedia,\n} ) {\n\tconst returnsFocusRef = useRef( false );\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t} );\n\t}\n\n\t/**\n\t * Generates the featured image alt text for this editing context.\n\t *\n\t * @param {Object} imageMedia The image media object.\n\t * @param {string} imageMedia.alt_text The alternative text of the image.\n\t * @param {Object} imageMedia.media_details The media details of the image.\n\t * @param {Object} imageMedia.media_details.sizes The sizes of the image.\n\t * @param {Object} imageMedia.media_details.sizes.full The full size details of the image.\n\t * @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image.\n\t * @param {string} imageMedia.slug The slug of the image.\n\t * @return {string} The featured image alt text.\n\t */\n\tfunction getImageDescription( imageMedia ) {\n\t\tif ( imageMedia.alt_text ) {\n\t\t\treturn sprintf(\n\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\timageMedia.alt_text\n\t\t\t);\n\t\t}\n\t\treturn sprintf(\n\t\t\t// Translators: %s: The selected image filename.\n\t\t\t__(\n\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t),\n\t\t\timageMedia.media_details.sizes?.full?.file || imageMedia.slug\n\t\t);\n\t}\n\n\tfunction returnFocus( node ) {\n\t\tif ( returnsFocusRef.current && node ) {\n\t\t\tnode.focus();\n\t\t\treturnsFocusRef.current = false;\n\t\t}\n\t}\n\n\tconst isMissingMedia =\n\t\t! isRequestingFeaturedImageMedia && !! featuredImageId && ! media;\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ getImageDescription( media ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t{ isMissingMedia ? (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'Could not retrieve the featured image data.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\tref={ returnFocus }\n\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t\t? null\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\t'Edit or replace the featured image'\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\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\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\t\talt={ getImageDescription(\n\t\t\t\t\t\t\t\t\t\t\t\t\tmedia\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ ( isLoading ||\n\t\t\t\t\t\t\t\t\t\t\tisRequestingFeaturedImageMedia ) && (\n\t\t\t\t\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'editor-post-featured-image__actions',\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'editor-post-featured-image__actions-missing-image':\n\t\t\t\t\t\t\t\t\t\t\t\t\tisMissingMedia,\n\t\t\t\t\t\t\t\t\t\t\t\t'editor-post-featured-image__actions-is-requesting-image':\n\t\t\t\t\t\t\t\t\t\t\t\t\tisRequestingFeaturedImageMedia,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\tisMissingMedia\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'secondary'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\t// Signal that the toggle button should be focused,\n\t\t\t\t\t\t\t\t\t\t\t\t// when it is rendered. Can't focus it directly here\n\t\t\t\t\t\t\t\t\t\t\t\t// because it's rendered conditionally.\n\t\t\t\t\t\t\t\t\t\t\t\treturnsFocusRef.current = true;\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\tisMissingMedia\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'secondary'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tisDestructive={ isMissingMedia }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getMedia, getPostType, hasFinishedResolution } =\n\t\tselect( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getMedia( featuredImageId, { context: 'view' } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t\tisRequestingFeaturedImageMedia:\n\t\t\t!! featuredImageId &&\n\t\t\t! hasFinishedResolution( 'getMedia', [\n\t\t\t\tfeaturedImageId,\n\t\t\t\t{ context: 'view' },\n\t\t\t] ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\n/**\n * Renders the component for managing the featured image of a post.\n *\n * @param {Object} props Props.\n * @param {number} props.currentPostId ID of the current post.\n * @param {number} props.featuredImageId ID of the featured image.\n * @param {Function} props.onUpdateImage Function to call when the image is updated.\n * @param {Function} props.onRemoveImage Function to call when the image is removed.\n * @param {Object} props.media The media object representing the featured image.\n * @param {string} props.postType Post type.\n * @param {Element} props.noticeUI UI for displaying notices.\n * @param {Object} props.noticeOperations Operations for managing notices.\n *\n * @return {Element} Component to be rendered .\n */\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,QACA,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACrE,SACCC,WAAW,EACXC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAMC,mBAAmB,GAAG,CAAE,OAAO,CAAE;;AAEvC;AACA,MAAMC,2BAA2B,GAAG9B,EAAE,CAAE,gBAAiB,CAAC;AAC1D,MAAM+B,+BAA+B,GAAG/B,EAAE,CAAE,sBAAuB,CAAC;AAEpE,MAAMgC,YAAY,gBACjBN,IAAA;EAAAO,QAAA,EACGjC,EAAE,CACH,kEACD;AAAC,CACC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ACF,CAAE,CAAC;AAEH,MAAMC,iBAAiB,GAAGtG,YAAY,CACrC,CAAEuG,QAAQ,EAAE;EAAE9D;AAAiB,CAAC,EAAE;EAAEsD;AAAO,CAAC,KAAM;EACjD,MAAM;IAAES;EAAS,CAAC,GAAGD,QAAQ,CAAE/F,WAAY,CAAC;EAC5C,OAAO;IACN6B,aAAaA,CAAEe,KAAK,EAAG;MACtBoD,QAAQ,CAAE;QAAEC,cAAc,EAAErD,KAAK,CAAC5B;MAAG,CAAE,CAAC;IACzC,CAAC;IACDkF,WAAWA,CAAE1D,SAAS,EAAG;MACxB+C,MAAM,CAAE1F,gBAAiB,CAAC,CACxByC,WAAW,CAAC,CAAC,CACbG,WAAW,CAAE;QACbC,YAAY,EAAE,CAAE,OAAO,CAAE;QACzBF,SAAS;QACTG,YAAYA,CAAE,CAAEC,KAAK,CAAE,EAAG;UACzBoD,QAAQ,CAAE;YAAEC,cAAc,EAAErD,KAAK,CAAC5B;UAAG,CAAE,CAAC;QACzC,CAAC;QACD8B,OAAOA,CAAEC,OAAO,EAAG;UAClBd,gBAAgB,CAACe,gBAAgB,CAAC,CAAC;UACnCf,gBAAgB,CAACgB,iBAAiB,CAAEF,OAAQ,CAAC;QAC9C;MACD,CAAE,CAAC;IACL,CAAC;IACDjB,aAAaA,CAAA,EAAG;MACfkE,QAAQ,CAAE;QAAEC,cAAc,EAAE;MAAE,CAAE,CAAC;IAClC;EACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe3G,OAAO,CACrBR,WAAW,EACXwG,eAAe,EACfQ,iBAAiB,EACjB/G,WAAW,CAAE,0BAA2B,CACzC,CAAC,CAAE2C,iBAAkB,CAAC","ignoreList":[]}
@@ -21,7 +21,7 @@ const PANEL_NAME = 'featured-image';
21
21
  * @param {Object} props Props.
22
22
  * @param {boolean} props.withPanelBody Whether to include the panel body. Default true.
23
23
  *
24
- * @return {Component|null} The component to be rendered.
24
+ * @return {React.ReactNode} The component to be rendered.
25
25
  * Return Null if the editor panel is disabled for featured image.
26
26
  */
27
27
  export default function PostFeaturedImagePanel({
@@ -1 +1 @@
1
- {"version":3,"names":["__","PanelBody","useSelect","useDispatch","store","coreStore","editorStore","PostFeaturedImage","PostFeaturedImageCheck","jsx","_jsx","PANEL_NAME","PostFeaturedImagePanel","withPanelBody","_postType$labels$feat","postType","isEnabled","isOpened","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","children","title","labels","featured_image","opened","onToggle"],"sources":["@wordpress/editor/src/components/post-featured-image/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostFeaturedImage from './index';\nimport PostFeaturedImageCheck from './check';\n\nconst PANEL_NAME = 'featured-image';\n\n/**\n * Renders the panel for the post featured image.\n *\n * @param {Object} props Props.\n * @param {boolean} props.withPanelBody Whether to include the panel body. Default true.\n *\n * @return {Component|null} The component to be rendered.\n * Return Null if the editor panel is disabled for featured image.\n */\nexport default function PostFeaturedImagePanel( { withPanelBody = true } ) {\n\tconst { postType, isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tif ( ! withPanelBody ) {\n\t\treturn (\n\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PostFeaturedImageCheck>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,SAAS;AACvC,OAAOC,sBAAsB,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,UAAU,GAAG,gBAAgB;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAE;EAAEC,aAAa,GAAG;AAAK,CAAC,EAAG;EAAA,IAAAC,qBAAA;EAC1E,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGf,SAAS,CAAIgB,MAAM,IAAM;IAClE,MAAM;MACLC,sBAAsB;MACtBC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEZ,WAAY,CAAC;IACzB,MAAM;MAAEgB;IAAY,CAAC,GAAGJ,MAAM,CAAEb,SAAU,CAAC;IAE3C,OAAO;MACNU,QAAQ,EAAEO,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE,CAAC;MACzDH,SAAS,EAAEI,oBAAoB,CAAET,UAAW,CAAC;MAC7CM,QAAQ,EAAEI,mBAAmB,CAAEV,UAAW;IAC3C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEY;EAAwB,CAAC,GAAGpB,WAAW,CAAEG,WAAY,CAAC;EAE9D,IAAK,CAAEU,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,IAAK,CAAEH,aAAa,EAAG;IACtB,oBACCH,IAAA,CAACF,sBAAsB;MAAAgB,QAAA,eACtBd,IAAA,CAACH,iBAAiB,IAAE;IAAC,CACE,CAAC;EAE3B;EAEA,oBACCG,IAAA,CAACF,sBAAsB;IAAAgB,QAAA,eACtBd,IAAA,CAACT,SAAS;MACTwB,KAAK,GAAAX,qBAAA,GACJC,QAAQ,EAAEW,MAAM,EAAEC,cAAc,cAAAb,qBAAA,cAAAA,qBAAA,GAAId,EAAE,CAAE,gBAAiB,CACzD;MACD4B,MAAM,EAAGX,QAAU;MACnBY,QAAQ,EAAGA,CAAA,KAAMN,uBAAuB,CAAEZ,UAAW,CAAG;MAAAa,QAAA,eAExDd,IAAA,CAACH,iBAAiB,IAAE;IAAC,CACX;EAAC,CACW,CAAC;AAE3B","ignoreList":[]}
1
+ {"version":3,"names":["__","PanelBody","useSelect","useDispatch","store","coreStore","editorStore","PostFeaturedImage","PostFeaturedImageCheck","jsx","_jsx","PANEL_NAME","PostFeaturedImagePanel","withPanelBody","_postType$labels$feat","postType","isEnabled","isOpened","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","children","title","labels","featured_image","opened","onToggle"],"sources":["@wordpress/editor/src/components/post-featured-image/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostFeaturedImage from './index';\nimport PostFeaturedImageCheck from './check';\n\nconst PANEL_NAME = 'featured-image';\n\n/**\n * Renders the panel for the post featured image.\n *\n * @param {Object} props Props.\n * @param {boolean} props.withPanelBody Whether to include the panel body. Default true.\n *\n * @return {React.ReactNode} The component to be rendered.\n * Return Null if the editor panel is disabled for featured image.\n */\nexport default function PostFeaturedImagePanel( { withPanelBody = true } ) {\n\tconst { postType, isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tif ( ! withPanelBody ) {\n\t\treturn (\n\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PostFeaturedImageCheck>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,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