@wordpress/editor 13.34.0 → 14.0.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 (972) hide show
  1. package/CHANGELOG.md +17 -4
  2. package/README.md +333 -39
  3. package/build/bindings/index.js +1 -3
  4. package/build/bindings/index.js.map +1 -1
  5. package/build/bindings/pattern-overrides.js +71 -2
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +38 -2
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/autocompleters/user.js +12 -8
  10. package/build/components/autocompleters/user.js.map +1 -1
  11. package/build/components/block-manager/category.js +19 -17
  12. package/build/components/block-manager/category.js.map +1 -1
  13. package/build/components/block-manager/checklist.js +15 -14
  14. package/build/components/block-manager/checklist.js.map +1 -1
  15. package/build/components/block-manager/index.js +37 -33
  16. package/build/components/block-manager/index.js.map +1 -1
  17. package/build/components/block-removal-warnings/index.js +2 -2
  18. package/build/components/block-removal-warnings/index.js.map +1 -1
  19. package/build/components/block-settings-menu/content-only-settings-menu.js +140 -0
  20. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  21. package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
  22. package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  23. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  24. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  25. package/build/components/blog-title/index.js +116 -0
  26. package/build/components/blog-title/index.js.map +1 -0
  27. package/build/components/collapsible-block-toolbar/index.js +22 -19
  28. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  29. package/build/components/commands/index.js +109 -3
  30. package/build/components/commands/index.js.map +1 -1
  31. package/build/components/create-template-part-modal/index.js +167 -0
  32. package/build/components/create-template-part-modal/index.js.map +1 -0
  33. package/build/components/create-template-part-modal/utils.js +64 -0
  34. package/build/components/create-template-part-modal/utils.js.map +1 -0
  35. package/build/components/deprecated.js +2 -2
  36. package/build/components/deprecated.js.map +1 -1
  37. package/build/components/document-bar/index.js +96 -72
  38. package/build/components/document-bar/index.js.map +1 -1
  39. package/build/components/document-outline/index.js +124 -121
  40. package/build/components/document-outline/index.js.map +1 -1
  41. package/build/components/document-outline/item.js +20 -16
  42. package/build/components/document-outline/item.js.map +1 -1
  43. package/build/components/document-tools/index.js +69 -69
  44. package/build/components/document-tools/index.js.map +1 -1
  45. package/build/components/editor-help/add-blocks.native.js +14 -11
  46. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  47. package/build/components/editor-help/customize-blocks.native.js +14 -11
  48. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  49. package/build/components/editor-help/help-detail-navigation-screen.native.js +32 -22
  50. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  51. package/build/components/editor-help/help-get-support-button.native.js +8 -6
  52. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  53. package/build/components/editor-help/help-section-title.native.js +8 -6
  54. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  55. package/build/components/editor-help/help-topic-row.native.js +7 -6
  56. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  57. package/build/components/editor-help/icon-move-blocks.native.js +7 -6
  58. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  59. package/build/components/editor-help/index.native.js +94 -76
  60. package/build/components/editor-help/index.native.js.map +1 -1
  61. package/build/components/editor-help/intro-to-blocks.native.js +41 -37
  62. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  63. package/build/components/editor-help/move-blocks.native.js +25 -21
  64. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  65. package/build/components/editor-help/remove-blocks.native.js +12 -9
  66. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  67. package/build/components/editor-help/view-sections.native.js +24 -19
  68. package/build/components/editor-help/view-sections.native.js.map +1 -1
  69. package/build/components/editor-history/redo.js +2 -2
  70. package/build/components/editor-history/redo.js.map +1 -1
  71. package/build/components/editor-history/undo.js +2 -2
  72. package/build/components/editor-history/undo.js.map +1 -1
  73. package/build/components/editor-interface/content-slot-fill.js +23 -0
  74. package/build/components/editor-interface/content-slot-fill.js.map +1 -0
  75. package/build/components/editor-interface/index.js +178 -0
  76. package/build/components/editor-interface/index.js.map +1 -0
  77. package/build/components/editor-notices/index.js +22 -9
  78. package/build/components/editor-notices/index.js.map +1 -1
  79. package/build/components/editor-snackbars/index.js +2 -2
  80. package/build/components/editor-snackbars/index.js.map +1 -1
  81. package/build/components/entities-saved-states/entity-record-item.js +37 -10
  82. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  83. package/build/components/entities-saved-states/entity-type-list.js +25 -22
  84. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  85. package/build/components/entities-saved-states/index.js +53 -46
  86. package/build/components/entities-saved-states/index.js.map +1 -1
  87. package/build/components/error-boundary/index.js +27 -14
  88. package/build/components/error-boundary/index.js.map +1 -1
  89. package/build/components/error-boundary/index.native.js +45 -35
  90. package/build/components/error-boundary/index.native.js.map +1 -1
  91. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +4 -5
  92. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  93. package/build/components/global-styles-provider/index.js +195 -0
  94. package/build/components/global-styles-provider/index.js.map +1 -0
  95. package/build/components/header/back-button.js +34 -0
  96. package/build/components/header/back-button.js.map +1 -0
  97. package/build/components/header/index.js +176 -0
  98. package/build/components/header/index.js.map +1 -0
  99. package/build/components/inserter-sidebar/index.js +83 -32
  100. package/build/components/inserter-sidebar/index.js.map +1 -1
  101. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  102. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  103. package/build/components/keyboard-shortcut-help-modal/index.js +54 -49
  104. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  105. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  106. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  107. package/build/components/list-view-sidebar/index.js +59 -47
  108. package/build/components/list-view-sidebar/index.js.map +1 -1
  109. package/build/components/list-view-sidebar/list-view-outline.js +21 -4
  110. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  111. package/build/components/local-autosave-monitor/index.js +15 -2
  112. package/build/components/local-autosave-monitor/index.js.map +1 -1
  113. package/build/components/mode-switcher/index.js +10 -10
  114. package/build/components/mode-switcher/index.js.map +1 -1
  115. package/build/components/more-menu/copy-content-menu-item.js +5 -4
  116. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  117. package/build/components/more-menu/index.js +89 -76
  118. package/build/components/more-menu/index.js.map +1 -1
  119. package/build/components/more-menu/tools-more-menu-group.js +2 -2
  120. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  121. package/build/components/more-menu/view-more-menu-group.js +2 -2
  122. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  123. package/build/components/offline-status/index.native.js +12 -11
  124. package/build/components/offline-status/index.native.js.map +1 -1
  125. package/build/components/page-attributes/order.js +87 -14
  126. package/build/components/page-attributes/order.js.map +1 -1
  127. package/build/components/page-attributes/panel.js +10 -19
  128. package/build/components/page-attributes/panel.js.map +1 -1
  129. package/build/components/page-attributes/parent.js +86 -3
  130. package/build/components/page-attributes/parent.js.map +1 -1
  131. package/build/components/pattern-duplicate-modal/index.js +59 -0
  132. package/build/components/pattern-duplicate-modal/index.js.map +1 -0
  133. package/build/components/pattern-overrides-panel/index.js +2 -2
  134. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  135. package/build/components/pattern-rename-modal/index.js +58 -0
  136. package/build/components/pattern-rename-modal/index.js.map +1 -0
  137. package/build/components/plugin-document-setting-panel/index.js +17 -12
  138. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  139. package/build/components/plugin-post-publish-panel/index.js +10 -7
  140. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  141. package/build/components/plugin-post-status-info/index.js +7 -4
  142. package/build/components/plugin-post-status-info/index.js.map +1 -1
  143. package/build/components/plugin-pre-publish-panel/index.js +10 -7
  144. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  145. package/build/components/plugin-sidebar/index.js +3 -4
  146. package/build/components/plugin-sidebar/index.js.map +1 -1
  147. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
  148. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  149. package/build/components/post-actions/actions.js +454 -327
  150. package/build/components/post-actions/actions.js.map +1 -1
  151. package/build/components/post-actions/export-pattern-action.js +64 -0
  152. package/build/components/post-actions/export-pattern-action.js.map +1 -0
  153. package/build/components/post-actions/export-pattern-action.native.js +11 -0
  154. package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
  155. package/build/components/post-actions/index.js +71 -62
  156. package/build/components/post-actions/index.js.map +1 -1
  157. package/build/components/post-author/check.js +6 -6
  158. package/build/components/post-author/check.js.map +1 -1
  159. package/build/components/post-author/combobox.js +4 -3
  160. package/build/components/post-author/combobox.js.map +1 -1
  161. package/build/components/post-author/hook.js +2 -1
  162. package/build/components/post-author/hook.js.map +1 -1
  163. package/build/components/post-author/index.js +3 -3
  164. package/build/components/post-author/index.js.map +1 -1
  165. package/build/components/post-author/panel.js +72 -4
  166. package/build/components/post-author/panel.js.map +1 -1
  167. package/build/components/post-author/select.js +4 -3
  168. package/build/components/post-author/select.js.map +1 -1
  169. package/build/components/post-card-panel/index.js +46 -35
  170. package/build/components/post-card-panel/index.js.map +1 -1
  171. package/build/components/post-comments/index.js +44 -8
  172. package/build/components/post-comments/index.js.map +1 -1
  173. package/build/components/post-content-information/index.js +8 -5
  174. package/build/components/post-content-information/index.js.map +1 -1
  175. package/build/components/post-discussion/panel.js +122 -24
  176. package/build/components/post-discussion/panel.js.map +1 -1
  177. package/build/components/post-excerpt/check.js +6 -6
  178. package/build/components/post-excerpt/check.js.map +1 -1
  179. package/build/components/post-excerpt/index.js +18 -17
  180. package/build/components/post-excerpt/index.js.map +1 -1
  181. package/build/components/post-excerpt/panel.js +59 -42
  182. package/build/components/post-excerpt/panel.js.map +1 -1
  183. package/build/components/post-excerpt/plugin.js +7 -4
  184. package/build/components/post-excerpt/plugin.js.map +1 -1
  185. package/build/components/post-featured-image/check.js +17 -7
  186. package/build/components/post-featured-image/check.js.map +1 -1
  187. package/build/components/post-featured-image/index.js +77 -49
  188. package/build/components/post-featured-image/index.js.map +1 -1
  189. package/build/components/post-featured-image/panel.js +22 -7
  190. package/build/components/post-featured-image/panel.js.map +1 -1
  191. package/build/components/post-format/check.js +14 -4
  192. package/build/components/post-format/check.js.map +1 -1
  193. package/build/components/post-format/index.js +37 -20
  194. package/build/components/post-format/index.js.map +1 -1
  195. package/build/components/post-format/panel.js +93 -0
  196. package/build/components/post-format/panel.js.map +1 -0
  197. package/build/components/post-last-edited-panel/index.js +7 -4
  198. package/build/components/post-last-edited-panel/index.js.map +1 -1
  199. package/build/components/post-last-revision/check.js +13 -5
  200. package/build/components/post-last-revision/check.js.map +1 -1
  201. package/build/components/post-last-revision/index.js +19 -13
  202. package/build/components/post-last-revision/index.js.map +1 -1
  203. package/build/components/post-last-revision/panel.js +12 -5
  204. package/build/components/post-last-revision/panel.js.map +1 -1
  205. package/build/components/post-locked-modal/index.js +57 -35
  206. package/build/components/post-locked-modal/index.js.map +1 -1
  207. package/build/components/post-panel-row/index.js +13 -10
  208. package/build/components/post-panel-row/index.js.map +1 -1
  209. package/build/components/post-panel-section/index.js +29 -0
  210. package/build/components/post-panel-section/index.js.map +1 -0
  211. package/build/components/post-pending-status/check.js +10 -0
  212. package/build/components/post-pending-status/check.js.map +1 -1
  213. package/build/components/post-pending-status/index.js +14 -7
  214. package/build/components/post-pending-status/index.js.map +1 -1
  215. package/build/components/post-pingbacks/index.js +15 -4
  216. package/build/components/post-pingbacks/index.js.map +1 -1
  217. package/build/components/post-preview-button/index.js +45 -21
  218. package/build/components/post-preview-button/index.js.map +1 -1
  219. package/build/components/post-publish-button/index.js +21 -11
  220. package/build/components/post-publish-button/index.js.map +1 -1
  221. package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  222. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  223. package/build/components/post-publish-panel/index.js +46 -33
  224. package/build/components/post-publish-panel/index.js.map +1 -1
  225. package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
  226. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  227. package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
  228. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  229. package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
  230. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  231. package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
  232. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  233. package/build/components/post-publish-panel/postpublish.js +55 -38
  234. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  235. package/build/components/post-publish-panel/prepublish.js +41 -26
  236. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  237. package/build/components/post-saved-state/index.js +10 -10
  238. package/build/components/post-saved-state/index.js.map +1 -1
  239. package/build/components/post-schedule/check.js +8 -0
  240. package/build/components/post-schedule/check.js.map +1 -1
  241. package/build/components/post-schedule/index.js +30 -5
  242. package/build/components/post-schedule/index.js.map +1 -1
  243. package/build/components/post-schedule/label.js +16 -0
  244. package/build/components/post-schedule/label.js.map +1 -1
  245. package/build/components/post-schedule/panel.js +43 -30
  246. package/build/components/post-schedule/panel.js.map +1 -1
  247. package/build/components/post-slug/check.js +5 -4
  248. package/build/components/post-slug/check.js.map +1 -1
  249. package/build/components/post-slug/index.js +5 -3
  250. package/build/components/post-slug/index.js.map +1 -1
  251. package/build/components/post-slug/panel.js +30 -0
  252. package/build/components/post-slug/panel.js.map +1 -0
  253. package/build/components/post-status/index.js +118 -119
  254. package/build/components/post-status/index.js.map +1 -1
  255. package/build/components/post-sticky/index.js +16 -8
  256. package/build/components/post-sticky/index.js.map +1 -1
  257. package/build/components/post-sticky/panel.js +25 -0
  258. package/build/components/post-sticky/panel.js.map +1 -0
  259. package/build/components/post-switch-to-draft-button/index.js +25 -21
  260. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  261. package/build/components/post-sync-status/index.js +8 -6
  262. package/build/components/post-sync-status/index.js.map +1 -1
  263. package/build/components/post-taxonomies/flat-term-selector.js +21 -20
  264. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  265. package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
  266. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  267. package/build/components/post-taxonomies/index.js +6 -6
  268. package/build/components/post-taxonomies/index.js.map +1 -1
  269. package/build/components/post-taxonomies/most-used-terms.js +19 -15
  270. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  271. package/build/components/post-taxonomies/panel.js +15 -11
  272. package/build/components/post-taxonomies/panel.js.map +1 -1
  273. package/build/components/post-template/block-theme.js +42 -32
  274. package/build/components/post-template/block-theme.js.map +1 -1
  275. package/build/components/post-template/classic-theme.js +73 -50
  276. package/build/components/post-template/classic-theme.js.map +1 -1
  277. package/build/components/post-template/create-new-template-modal.js +33 -27
  278. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  279. package/build/components/post-template/create-new-template.js +14 -11
  280. package/build/components/post-template/create-new-template.js.map +1 -1
  281. package/build/components/post-template/panel.js +16 -10
  282. package/build/components/post-template/panel.js.map +1 -1
  283. package/build/components/post-template/reset-default-template.js +5 -4
  284. package/build/components/post-template/reset-default-template.js.map +1 -1
  285. package/build/components/post-template/swap-template-button.js +20 -15
  286. package/build/components/post-template/swap-template-button.js.map +1 -1
  287. package/build/components/post-text-editor/index.js +27 -20
  288. package/build/components/post-text-editor/index.js.map +1 -1
  289. package/build/components/post-title/index.js +31 -19
  290. package/build/components/post-title/index.js.map +1 -1
  291. package/build/components/post-title/index.native.js +81 -57
  292. package/build/components/post-title/index.native.js.map +1 -1
  293. package/build/components/post-title/post-title-raw.js +12 -5
  294. package/build/components/post-title/post-title-raw.js.map +1 -1
  295. package/build/components/post-title/use-post-title-focus.js +7 -0
  296. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  297. package/build/components/post-title/use-post-title.js +5 -0
  298. package/build/components/post-title/use-post-title.js.map +1 -1
  299. package/build/components/post-transform-panel/hooks.js +90 -0
  300. package/build/components/post-transform-panel/hooks.js.map +1 -0
  301. package/build/components/post-transform-panel/index.js +101 -0
  302. package/build/components/post-transform-panel/index.js.map +1 -0
  303. package/build/components/post-trash/index.js +19 -15
  304. package/build/components/post-trash/index.js.map +1 -1
  305. package/build/components/post-type-support-check/index.js +1 -1
  306. package/build/components/post-type-support-check/index.js.map +1 -1
  307. package/build/components/post-url/check.js +8 -0
  308. package/build/components/post-url/check.js.map +1 -1
  309. package/build/components/post-url/index.js +98 -73
  310. package/build/components/post-url/index.js.map +1 -1
  311. package/build/components/post-url/label.js +11 -0
  312. package/build/components/post-url/label.js.map +1 -1
  313. package/build/components/post-url/panel.js +33 -25
  314. package/build/components/post-url/panel.js.map +1 -1
  315. package/build/components/post-view-link/index.js +2 -2
  316. package/build/components/post-view-link/index.js.map +1 -1
  317. package/build/components/post-visibility/check.js +9 -0
  318. package/build/components/post-visibility/check.js.map +1 -1
  319. package/build/components/post-visibility/index.js +83 -68
  320. package/build/components/post-visibility/index.js.map +1 -1
  321. package/build/components/post-visibility/label.js +11 -0
  322. package/build/components/post-visibility/label.js.map +1 -1
  323. package/build/components/posts-per-page/index.js +109 -0
  324. package/build/components/posts-per-page/index.js.map +1 -0
  325. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  326. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  327. package/build/components/preferences-modal/index.js +124 -102
  328. package/build/components/preferences-modal/index.js.map +1 -1
  329. package/build/components/preview-dropdown/index.js +47 -31
  330. package/build/components/preview-dropdown/index.js.map +1 -1
  331. package/build/components/provider/index.js +96 -20
  332. package/build/components/provider/index.js.map +1 -1
  333. package/build/components/provider/index.native.js +55 -19
  334. package/build/components/provider/index.native.js.map +1 -1
  335. package/build/components/provider/use-block-editor-settings.js +23 -4
  336. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  337. package/build/components/provider/with-registry-provider.js +31 -24
  338. package/build/components/provider/with-registry-provider.js.map +1 -1
  339. package/build/components/resizable-editor/index.js +96 -0
  340. package/build/components/resizable-editor/index.js.map +1 -0
  341. package/build/components/resizable-editor/resize-handle.js +59 -0
  342. package/build/components/resizable-editor/resize-handle.js.map +1 -0
  343. package/build/components/save-publish-panels/index.js +35 -26
  344. package/build/components/save-publish-panels/index.js.map +1 -1
  345. package/build/components/sidebar/constants.js +11 -0
  346. package/build/components/sidebar/constants.js.map +1 -0
  347. package/build/components/sidebar/header.js +56 -0
  348. package/build/components/sidebar/header.js.map +1 -0
  349. package/build/components/sidebar/index.js +161 -0
  350. package/build/components/sidebar/index.js.map +1 -0
  351. package/build/components/sidebar/post-summary.js +89 -0
  352. package/build/components/sidebar/post-summary.js.map +1 -0
  353. package/build/components/site-discussion/index.js +133 -0
  354. package/build/components/site-discussion/index.js.map +1 -0
  355. package/build/components/start-page-options/index.js +18 -18
  356. package/build/components/start-page-options/index.js.map +1 -1
  357. package/build/components/start-template-options/index.js +198 -0
  358. package/build/components/start-template-options/index.js.map +1 -0
  359. package/build/components/table-of-contents/index.js +4 -4
  360. package/build/components/table-of-contents/index.js.map +1 -1
  361. package/build/components/table-of-contents/panel.js +53 -35
  362. package/build/components/table-of-contents/panel.js.map +1 -1
  363. package/build/components/template-areas/index.js +36 -22
  364. package/build/components/template-areas/index.js.map +1 -1
  365. package/build/components/template-content-panel/index.js +39 -0
  366. package/build/components/template-content-panel/index.js.map +1 -0
  367. package/build/components/template-validation-notice/index.js +25 -21
  368. package/build/components/template-validation-notice/index.js.map +1 -1
  369. package/build/components/text-editor/index.js +73 -0
  370. package/build/components/text-editor/index.js.map +1 -0
  371. package/build/components/time-to-read/index.js +8 -8
  372. package/build/components/time-to-read/index.js.map +1 -1
  373. package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
  374. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  375. package/build/components/{editor-canvas → visual-editor}/index.js +130 -78
  376. package/build/components/visual-editor/index.js.map +1 -0
  377. package/build/components/word-count/index.js +5 -4
  378. package/build/components/word-count/index.js.map +1 -1
  379. package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
  380. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  381. package/build/hooks/index.js +1 -0
  382. package/build/hooks/index.js.map +1 -1
  383. package/build/hooks/media-upload.js +10 -0
  384. package/build/hooks/media-upload.js.map +1 -0
  385. package/build/hooks/pattern-overrides.js +25 -16
  386. package/build/hooks/pattern-overrides.js.map +1 -1
  387. package/build/private-apis.js +15 -38
  388. package/build/private-apis.js.map +1 -1
  389. package/build/private-apis.native.js +48 -0
  390. package/build/private-apis.native.js.map +1 -0
  391. package/build/store/constants.js +4 -1
  392. package/build/store/constants.js.map +1 -1
  393. package/build/store/private-actions.js +10 -14
  394. package/build/store/private-actions.js.map +1 -1
  395. package/build/store/private-selectors.js +45 -2
  396. package/build/store/private-selectors.js.map +1 -1
  397. package/build/store/reducer.js +15 -0
  398. package/build/store/reducer.js.map +1 -1
  399. package/build/store/selectors.js +1 -1
  400. package/build/store/selectors.js.map +1 -1
  401. package/build/utils/set-nested-value.js +44 -0
  402. package/build/utils/set-nested-value.js.map +1 -0
  403. package/build-module/bindings/index.js +1 -3
  404. package/build-module/bindings/index.js.map +1 -1
  405. package/build-module/bindings/pattern-overrides.js +70 -2
  406. package/build-module/bindings/pattern-overrides.js.map +1 -1
  407. package/build-module/bindings/post-meta.js +38 -2
  408. package/build-module/bindings/post-meta.js.map +1 -1
  409. package/build-module/components/autocompleters/user.js +14 -9
  410. package/build-module/components/autocompleters/user.js.map +1 -1
  411. package/build-module/components/block-manager/category.js +20 -17
  412. package/build-module/components/block-manager/category.js.map +1 -1
  413. package/build-module/components/block-manager/checklist.js +16 -14
  414. package/build-module/components/block-manager/checklist.js.map +1 -1
  415. package/build-module/components/block-manager/index.js +38 -33
  416. package/build-module/components/block-manager/index.js.map +1 -1
  417. package/build-module/components/block-removal-warnings/index.js +2 -2
  418. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  419. package/build-module/components/block-settings-menu/content-only-settings-menu.js +135 -0
  420. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  421. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
  422. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  423. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  424. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  425. package/build-module/components/blog-title/index.js +110 -0
  426. package/build-module/components/blog-title/index.js.map +1 -0
  427. package/build-module/components/collapsible-block-toolbar/index.js +24 -19
  428. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  429. package/build-module/components/commands/index.js +111 -5
  430. package/build-module/components/commands/index.js.map +1 -1
  431. package/build-module/components/create-template-part-modal/index.js +160 -0
  432. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  433. package/build-module/components/create-template-part-modal/utils.js +54 -0
  434. package/build-module/components/create-template-part-modal/utils.js.map +1 -0
  435. package/build-module/components/deprecated.js +2 -2
  436. package/build-module/components/deprecated.js.map +1 -1
  437. package/build-module/components/document-bar/index.js +95 -70
  438. package/build-module/components/document-bar/index.js.map +1 -1
  439. package/build-module/components/document-outline/index.js +125 -120
  440. package/build-module/components/document-outline/index.js.map +1 -1
  441. package/build-module/components/document-outline/item.js +21 -16
  442. package/build-module/components/document-outline/item.js.map +1 -1
  443. package/build-module/components/document-tools/index.js +72 -70
  444. package/build-module/components/document-tools/index.js.map +1 -1
  445. package/build-module/components/editor-help/add-blocks.native.js +16 -11
  446. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  447. package/build-module/components/editor-help/customize-blocks.native.js +16 -11
  448. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  449. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +33 -22
  450. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  451. package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
  452. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  453. package/build-module/components/editor-help/help-section-title.native.js +8 -6
  454. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  455. package/build-module/components/editor-help/help-topic-row.native.js +7 -6
  456. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  457. package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
  458. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  459. package/build-module/components/editor-help/index.native.js +96 -76
  460. package/build-module/components/editor-help/index.native.js.map +1 -1
  461. package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
  462. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  463. package/build-module/components/editor-help/move-blocks.native.js +27 -21
  464. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  465. package/build-module/components/editor-help/remove-blocks.native.js +14 -9
  466. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  467. package/build-module/components/editor-help/view-sections.native.js +25 -19
  468. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  469. package/build-module/components/editor-history/redo.js +2 -2
  470. package/build-module/components/editor-history/redo.js.map +1 -1
  471. package/build-module/components/editor-history/undo.js +2 -2
  472. package/build-module/components/editor-history/undo.js.map +1 -1
  473. package/build-module/components/editor-interface/content-slot-fill.js +16 -0
  474. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
  475. package/build-module/components/editor-interface/index.js +172 -0
  476. package/build-module/components/editor-interface/index.js.map +1 -0
  477. package/build-module/components/editor-notices/index.js +25 -9
  478. package/build-module/components/editor-notices/index.js.map +1 -1
  479. package/build-module/components/editor-snackbars/index.js +2 -2
  480. package/build-module/components/editor-snackbars/index.js.map +1 -1
  481. package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
  482. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  483. package/build-module/components/entities-saved-states/entity-type-list.js +26 -22
  484. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  485. package/build-module/components/entities-saved-states/index.js +54 -46
  486. package/build-module/components/entities-saved-states/index.js.map +1 -1
  487. package/build-module/components/error-boundary/index.js +27 -14
  488. package/build-module/components/error-boundary/index.js.map +1 -1
  489. package/build-module/components/error-boundary/index.native.js +46 -35
  490. package/build-module/components/error-boundary/index.native.js.map +1 -1
  491. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  492. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  493. package/build-module/components/global-styles-provider/index.js +185 -0
  494. package/build-module/components/global-styles-provider/index.js.map +1 -0
  495. package/build-module/components/header/back-button.js +28 -0
  496. package/build-module/components/header/back-button.js.map +1 -0
  497. package/build-module/components/header/index.js +169 -0
  498. package/build-module/components/header/index.js.map +1 -0
  499. package/build-module/components/inserter-sidebar/index.js +85 -34
  500. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  501. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  502. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  503. package/build-module/components/keyboard-shortcut-help-modal/index.js +55 -49
  504. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  505. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  506. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  507. package/build-module/components/list-view-sidebar/index.js +60 -47
  508. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  509. package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
  510. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  511. package/build-module/components/local-autosave-monitor/index.js +15 -2
  512. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  513. package/build-module/components/mode-switcher/index.js +9 -8
  514. package/build-module/components/mode-switcher/index.js.map +1 -1
  515. package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
  516. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  517. package/build-module/components/more-menu/index.js +91 -76
  518. package/build-module/components/more-menu/index.js.map +1 -1
  519. package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
  520. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  521. package/build-module/components/more-menu/view-more-menu-group.js +2 -2
  522. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  523. package/build-module/components/offline-status/index.native.js +12 -9
  524. package/build-module/components/offline-status/index.native.js.map +1 -1
  525. package/build-module/components/page-attributes/order.js +90 -17
  526. package/build-module/components/page-attributes/order.js.map +1 -1
  527. package/build-module/components/page-attributes/panel.js +13 -21
  528. package/build-module/components/page-attributes/panel.js.map +1 -1
  529. package/build-module/components/page-attributes/parent.js +88 -5
  530. package/build-module/components/page-attributes/parent.js.map +1 -1
  531. package/build-module/components/pattern-duplicate-modal/index.js +51 -0
  532. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
  533. package/build-module/components/pattern-overrides-panel/index.js +2 -2
  534. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  535. package/build-module/components/pattern-rename-modal/index.js +50 -0
  536. package/build-module/components/pattern-rename-modal/index.js.map +1 -0
  537. package/build-module/components/plugin-document-setting-panel/index.js +19 -12
  538. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  539. package/build-module/components/plugin-post-publish-panel/index.js +10 -7
  540. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  541. package/build-module/components/plugin-post-status-info/index.js +7 -4
  542. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  543. package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
  544. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  545. package/build-module/components/plugin-sidebar/index.js +2 -2
  546. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  547. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
  548. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  549. package/build-module/components/post-actions/actions.js +458 -329
  550. package/build-module/components/post-actions/actions.js.map +1 -1
  551. package/build-module/components/post-actions/export-pattern-action.js +58 -0
  552. package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
  553. package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
  554. package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
  555. package/build-module/components/post-actions/index.js +73 -62
  556. package/build-module/components/post-actions/index.js.map +1 -1
  557. package/build-module/components/post-author/check.js +5 -4
  558. package/build-module/components/post-author/check.js.map +1 -1
  559. package/build-module/components/post-author/combobox.js +4 -3
  560. package/build-module/components/post-author/combobox.js.map +1 -1
  561. package/build-module/components/post-author/hook.js +2 -1
  562. package/build-module/components/post-author/hook.js.map +1 -1
  563. package/build-module/components/post-author/index.js +3 -3
  564. package/build-module/components/post-author/index.js.map +1 -1
  565. package/build-module/components/post-author/panel.js +72 -4
  566. package/build-module/components/post-author/panel.js.map +1 -1
  567. package/build-module/components/post-author/select.js +4 -3
  568. package/build-module/components/post-author/select.js.map +1 -1
  569. package/build-module/components/post-card-panel/index.js +49 -38
  570. package/build-module/components/post-card-panel/index.js.map +1 -1
  571. package/build-module/components/post-comments/index.js +47 -9
  572. package/build-module/components/post-comments/index.js.map +1 -1
  573. package/build-module/components/post-content-information/index.js +8 -5
  574. package/build-module/components/post-content-information/index.js.map +1 -1
  575. package/build-module/components/post-discussion/panel.js +125 -26
  576. package/build-module/components/post-discussion/panel.js.map +1 -1
  577. package/build-module/components/post-excerpt/check.js +5 -4
  578. package/build-module/components/post-excerpt/check.js.map +1 -1
  579. package/build-module/components/post-excerpt/index.js +17 -15
  580. package/build-module/components/post-excerpt/index.js.map +1 -1
  581. package/build-module/components/post-excerpt/panel.js +60 -40
  582. package/build-module/components/post-excerpt/panel.js.map +1 -1
  583. package/build-module/components/post-excerpt/plugin.js +7 -4
  584. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  585. package/build-module/components/post-featured-image/check.js +18 -6
  586. package/build-module/components/post-featured-image/check.js.map +1 -1
  587. package/build-module/components/post-featured-image/index.js +78 -49
  588. package/build-module/components/post-featured-image/index.js.map +1 -1
  589. package/build-module/components/post-featured-image/panel.js +22 -7
  590. package/build-module/components/post-featured-image/panel.js.map +1 -1
  591. package/build-module/components/post-format/check.js +14 -4
  592. package/build-module/components/post-format/check.js.map +1 -1
  593. package/build-module/components/post-format/index.js +39 -21
  594. package/build-module/components/post-format/index.js.map +1 -1
  595. package/build-module/components/post-format/panel.js +86 -0
  596. package/build-module/components/post-format/panel.js.map +1 -0
  597. package/build-module/components/post-last-edited-panel/index.js +7 -4
  598. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  599. package/build-module/components/post-last-revision/check.js +14 -4
  600. package/build-module/components/post-last-revision/check.js.map +1 -1
  601. package/build-module/components/post-last-revision/index.js +21 -13
  602. package/build-module/components/post-last-revision/index.js.map +1 -1
  603. package/build-module/components/post-last-revision/panel.js +13 -4
  604. package/build-module/components/post-last-revision/panel.js.map +1 -1
  605. package/build-module/components/post-locked-modal/index.js +60 -34
  606. package/build-module/components/post-locked-modal/index.js.map +1 -1
  607. package/build-module/components/post-panel-row/index.js +14 -10
  608. package/build-module/components/post-panel-row/index.js.map +1 -1
  609. package/build-module/components/post-panel-section/index.js +21 -0
  610. package/build-module/components/post-panel-section/index.js.map +1 -0
  611. package/build-module/components/post-pending-status/check.js +11 -0
  612. package/build-module/components/post-pending-status/check.js.map +1 -1
  613. package/build-module/components/post-pending-status/index.js +15 -7
  614. package/build-module/components/post-pending-status/index.js.map +1 -1
  615. package/build-module/components/post-pingbacks/index.js +16 -5
  616. package/build-module/components/post-pingbacks/index.js.map +1 -1
  617. package/build-module/components/post-preview-button/index.js +47 -21
  618. package/build-module/components/post-preview-button/index.js.map +1 -1
  619. package/build-module/components/post-publish-button/index.js +22 -11
  620. package/build-module/components/post-publish-button/index.js.map +1 -1
  621. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  622. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  623. package/build-module/components/post-publish-panel/index.js +48 -33
  624. package/build-module/components/post-publish-panel/index.js.map +1 -1
  625. package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
  626. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  627. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +22 -15
  628. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  629. package/build-module/components/post-publish-panel/maybe-tags-panel.js +14 -10
  630. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  631. package/build-module/components/post-publish-panel/maybe-upload-media.js +30 -24
  632. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  633. package/build-module/components/post-publish-panel/postpublish.js +57 -38
  634. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  635. package/build-module/components/post-publish-panel/prepublish.js +43 -26
  636. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  637. package/build-module/components/post-saved-state/index.js +10 -8
  638. package/build-module/components/post-saved-state/index.js.map +1 -1
  639. package/build-module/components/post-schedule/check.js +9 -0
  640. package/build-module/components/post-schedule/check.js.map +1 -1
  641. package/build-module/components/post-schedule/index.js +30 -6
  642. package/build-module/components/post-schedule/index.js.map +1 -1
  643. package/build-module/components/post-schedule/label.js +17 -0
  644. package/build-module/components/post-schedule/label.js.map +1 -1
  645. package/build-module/components/post-schedule/panel.js +43 -30
  646. package/build-module/components/post-schedule/panel.js.map +1 -1
  647. package/build-module/components/post-slug/check.js +5 -4
  648. package/build-module/components/post-slug/check.js.map +1 -1
  649. package/build-module/components/post-slug/index.js +5 -3
  650. package/build-module/components/post-slug/index.js.map +1 -1
  651. package/build-module/components/post-slug/panel.js +21 -0
  652. package/build-module/components/post-slug/panel.js.map +1 -0
  653. package/build-module/components/post-status/index.js +121 -120
  654. package/build-module/components/post-status/index.js.map +1 -1
  655. package/build-module/components/post-sticky/index.js +17 -9
  656. package/build-module/components/post-sticky/index.js.map +1 -1
  657. package/build-module/components/post-sticky/panel.js +16 -0
  658. package/build-module/components/post-sticky/panel.js.map +1 -0
  659. package/build-module/components/post-switch-to-draft-button/index.js +27 -21
  660. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  661. package/build-module/components/post-sync-status/index.js +8 -6
  662. package/build-module/components/post-sync-status/index.js.map +1 -1
  663. package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
  664. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  665. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
  666. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  667. package/build-module/components/post-taxonomies/index.js +6 -6
  668. package/build-module/components/post-taxonomies/index.js.map +1 -1
  669. package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
  670. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  671. package/build-module/components/post-taxonomies/panel.js +15 -11
  672. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  673. package/build-module/components/post-template/block-theme.js +44 -32
  674. package/build-module/components/post-template/block-theme.js.map +1 -1
  675. package/build-module/components/post-template/classic-theme.js +74 -50
  676. package/build-module/components/post-template/classic-theme.js.map +1 -1
  677. package/build-module/components/post-template/create-new-template-modal.js +34 -27
  678. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  679. package/build-module/components/post-template/create-new-template.js +16 -11
  680. package/build-module/components/post-template/create-new-template.js.map +1 -1
  681. package/build-module/components/post-template/panel.js +17 -9
  682. package/build-module/components/post-template/panel.js.map +1 -1
  683. package/build-module/components/post-template/reset-default-template.js +5 -4
  684. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  685. package/build-module/components/post-template/swap-template-button.js +22 -15
  686. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  687. package/build-module/components/post-text-editor/index.js +30 -19
  688. package/build-module/components/post-text-editor/index.js.map +1 -1
  689. package/build-module/components/post-title/index.js +31 -20
  690. package/build-module/components/post-title/index.js.map +1 -1
  691. package/build-module/components/post-title/index.native.js +81 -57
  692. package/build-module/components/post-title/index.native.js.map +1 -1
  693. package/build-module/components/post-title/post-title-raw.js +13 -4
  694. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  695. package/build-module/components/post-title/use-post-title-focus.js +8 -0
  696. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  697. package/build-module/components/post-title/use-post-title.js +6 -0
  698. package/build-module/components/post-title/use-post-title.js.map +1 -1
  699. package/build-module/components/post-transform-panel/hooks.js +83 -0
  700. package/build-module/components/post-transform-panel/hooks.js.map +1 -0
  701. package/build-module/components/post-transform-panel/index.js +94 -0
  702. package/build-module/components/post-transform-panel/index.js.map +1 -0
  703. package/build-module/components/post-trash/index.js +21 -15
  704. package/build-module/components/post-trash/index.js.map +1 -1
  705. package/build-module/components/post-type-support-check/index.js +1 -1
  706. package/build-module/components/post-type-support-check/index.js.map +1 -1
  707. package/build-module/components/post-url/check.js +9 -0
  708. package/build-module/components/post-url/check.js.map +1 -1
  709. package/build-module/components/post-url/index.js +100 -72
  710. package/build-module/components/post-url/index.js.map +1 -1
  711. package/build-module/components/post-url/label.js +12 -0
  712. package/build-module/components/post-url/label.js.map +1 -1
  713. package/build-module/components/post-url/panel.js +35 -24
  714. package/build-module/components/post-url/panel.js.map +1 -1
  715. package/build-module/components/post-view-link/index.js +2 -2
  716. package/build-module/components/post-view-link/index.js.map +1 -1
  717. package/build-module/components/post-visibility/check.js +10 -0
  718. package/build-module/components/post-visibility/check.js.map +1 -1
  719. package/build-module/components/post-visibility/index.js +85 -67
  720. package/build-module/components/post-visibility/index.js.map +1 -1
  721. package/build-module/components/post-visibility/label.js +12 -0
  722. package/build-module/components/post-visibility/label.js.map +1 -1
  723. package/build-module/components/posts-per-page/index.js +103 -0
  724. package/build-module/components/posts-per-page/index.js.map +1 -0
  725. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  726. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  727. package/build-module/components/preferences-modal/index.js +126 -102
  728. package/build-module/components/preferences-modal/index.js.map +1 -1
  729. package/build-module/components/preview-dropdown/index.js +49 -31
  730. package/build-module/components/preview-dropdown/index.js.map +1 -1
  731. package/build-module/components/provider/index.js +98 -20
  732. package/build-module/components/provider/index.js.map +1 -1
  733. package/build-module/components/provider/index.native.js +58 -20
  734. package/build-module/components/provider/index.native.js.map +1 -1
  735. package/build-module/components/provider/use-block-editor-settings.js +23 -4
  736. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  737. package/build-module/components/provider/with-registry-provider.js +33 -26
  738. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  739. package/build-module/components/resizable-editor/index.js +89 -0
  740. package/build-module/components/resizable-editor/index.js.map +1 -0
  741. package/build-module/components/resizable-editor/resize-handle.js +54 -0
  742. package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
  743. package/build-module/components/save-publish-panels/index.js +37 -26
  744. package/build-module/components/save-publish-panels/index.js.map +1 -1
  745. package/build-module/components/sidebar/constants.js +5 -0
  746. package/build-module/components/sidebar/constants.js.map +1 -0
  747. package/build-module/components/sidebar/header.js +50 -0
  748. package/build-module/components/sidebar/header.js.map +1 -0
  749. package/build-module/components/sidebar/index.js +154 -0
  750. package/build-module/components/sidebar/index.js.map +1 -0
  751. package/build-module/components/sidebar/post-summary.js +85 -0
  752. package/build-module/components/sidebar/post-summary.js.map +1 -0
  753. package/build-module/components/site-discussion/index.js +127 -0
  754. package/build-module/components/site-discussion/index.js.map +1 -0
  755. package/build-module/components/start-page-options/index.js +18 -18
  756. package/build-module/components/start-page-options/index.js.map +1 -1
  757. package/build-module/components/start-template-options/index.js +192 -0
  758. package/build-module/components/start-template-options/index.js.map +1 -0
  759. package/build-module/components/table-of-contents/index.js +4 -4
  760. package/build-module/components/table-of-contents/index.js.map +1 -1
  761. package/build-module/components/table-of-contents/panel.js +55 -35
  762. package/build-module/components/table-of-contents/panel.js.map +1 -1
  763. package/build-module/components/template-areas/index.js +37 -22
  764. package/build-module/components/template-areas/index.js.map +1 -1
  765. package/build-module/components/template-content-panel/index.js +32 -0
  766. package/build-module/components/template-content-panel/index.js.map +1 -0
  767. package/build-module/components/template-validation-notice/index.js +27 -21
  768. package/build-module/components/template-validation-notice/index.js.map +1 -1
  769. package/build-module/components/text-editor/index.js +66 -0
  770. package/build-module/components/text-editor/index.js.map +1 -0
  771. package/build-module/components/time-to-read/index.js +7 -6
  772. package/build-module/components/time-to-read/index.js.map +1 -1
  773. package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
  774. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  775. package/build-module/components/{editor-canvas → visual-editor}/index.js +133 -79
  776. package/build-module/components/visual-editor/index.js.map +1 -0
  777. package/build-module/components/word-count/index.js +5 -4
  778. package/build-module/components/word-count/index.js.map +1 -1
  779. package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
  780. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  781. package/build-module/hooks/index.js +1 -0
  782. package/build-module/hooks/index.js.map +1 -1
  783. package/build-module/hooks/media-upload.js +7 -0
  784. package/build-module/hooks/media-upload.js.map +1 -0
  785. package/build-module/hooks/pattern-overrides.js +27 -16
  786. package/build-module/hooks/pattern-overrides.js.map +1 -1
  787. package/build-module/private-apis.js +15 -38
  788. package/build-module/private-apis.js.map +1 -1
  789. package/build-module/private-apis.native.js +38 -0
  790. package/build-module/private-apis.native.js.map +1 -0
  791. package/build-module/store/constants.js +3 -0
  792. package/build-module/store/constants.js.map +1 -1
  793. package/build-module/store/private-actions.js +10 -14
  794. package/build-module/store/private-actions.js.map +1 -1
  795. package/build-module/store/private-selectors.js +41 -1
  796. package/build-module/store/private-selectors.js.map +1 -1
  797. package/build-module/store/reducer.js +14 -0
  798. package/build-module/store/reducer.js.map +1 -1
  799. package/build-module/store/selectors.js +1 -1
  800. package/build-module/store/selectors.js.map +1 -1
  801. package/build-module/utils/set-nested-value.js +38 -0
  802. package/build-module/utils/set-nested-value.js.map +1 -0
  803. package/build-style/style-rtl.css +623 -85
  804. package/build-style/style.css +623 -85
  805. package/package.json +43 -37
  806. package/src/bindings/index.js +1 -4
  807. package/src/bindings/pattern-overrides.js +84 -2
  808. package/src/bindings/post-meta.js +46 -6
  809. package/src/components/autocompleters/style.scss +1 -2
  810. package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
  811. package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
  812. package/src/components/block-settings-menu/style.scss +4 -0
  813. package/src/components/blog-title/index.js +124 -0
  814. package/src/components/blog-title/style.scss +4 -0
  815. package/src/components/collapsible-block-toolbar/index.js +2 -2
  816. package/src/components/commands/index.js +113 -3
  817. package/src/components/create-template-part-modal/index.js +205 -0
  818. package/src/components/create-template-part-modal/style.scss +69 -0
  819. package/src/components/create-template-part-modal/test/utils.js +60 -0
  820. package/src/components/create-template-part-modal/utils.js +67 -0
  821. package/src/components/document-bar/index.js +34 -23
  822. package/src/components/document-outline/item.js +2 -2
  823. package/src/components/document-tools/index.js +21 -28
  824. package/src/components/editor-help/help-get-support-button.native.js +1 -1
  825. package/src/components/editor-interface/content-slot-fill.js +15 -0
  826. package/src/components/editor-interface/index.js +230 -0
  827. package/src/components/editor-notices/index.js +10 -0
  828. package/src/components/entities-saved-states/entity-record-item.js +45 -16
  829. package/src/components/entities-saved-states/style.scss +13 -0
  830. package/src/components/error-boundary/index.js +10 -0
  831. package/src/components/error-boundary/index.native.js +1 -1
  832. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
  833. package/src/components/global-styles-provider/index.js +254 -0
  834. package/src/components/header/back-button.js +27 -0
  835. package/src/components/header/index.js +169 -0
  836. package/src/components/header/style.scss +236 -0
  837. package/src/components/inserter-sidebar/index.js +92 -36
  838. package/src/components/inserter-sidebar/style.scss +1 -7
  839. package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
  840. package/src/components/list-view-sidebar/style.scss +1 -0
  841. package/src/components/local-autosave-monitor/index.js +12 -0
  842. package/src/components/page-attributes/order.js +79 -3
  843. package/src/components/page-attributes/panel.js +10 -26
  844. package/src/components/page-attributes/parent.js +98 -2
  845. package/src/components/page-attributes/style.scss +19 -0
  846. package/src/components/page-attributes/test/order.js +5 -1
  847. package/src/components/pattern-duplicate-modal/index.js +50 -0
  848. package/src/components/pattern-rename-modal/index.js +44 -0
  849. package/src/components/post-actions/actions.js +522 -371
  850. package/src/components/post-actions/export-pattern-action.js +74 -0
  851. package/src/components/post-actions/export-pattern-action.native.js +4 -0
  852. package/src/components/post-actions/index.js +20 -42
  853. package/src/components/post-author/combobox.js +1 -0
  854. package/src/components/post-author/hook.js +1 -1
  855. package/src/components/post-author/panel.js +63 -2
  856. package/src/components/post-author/select.js +1 -0
  857. package/src/components/post-author/style.scss +6 -0
  858. package/src/components/post-card-panel/index.js +56 -55
  859. package/src/components/post-card-panel/style.scss +23 -1
  860. package/src/components/post-comments/index.js +52 -9
  861. package/src/components/post-discussion/panel.js +115 -31
  862. package/src/components/post-discussion/style.scss +24 -0
  863. package/src/components/post-excerpt/panel.js +45 -48
  864. package/src/components/post-excerpt/style.scss +0 -17
  865. package/src/components/post-featured-image/check.js +9 -0
  866. package/src/components/post-featured-image/index.js +15 -0
  867. package/src/components/post-featured-image/panel.js +9 -0
  868. package/src/components/post-format/check.js +8 -0
  869. package/src/components/post-format/index.js +15 -4
  870. package/src/components/post-format/panel.js +87 -0
  871. package/src/components/post-format/style.scss +12 -0
  872. package/src/components/post-last-revision/check.js +8 -0
  873. package/src/components/post-last-revision/index.js +7 -2
  874. package/src/components/post-last-revision/panel.js +5 -0
  875. package/src/components/post-last-revision/test/check.js +5 -1
  876. package/src/components/post-locked-modal/index.js +6 -0
  877. package/src/components/post-panel-row/index.js +2 -2
  878. package/src/components/post-panel-row/style.scss +15 -0
  879. package/src/components/post-panel-section/index.js +19 -0
  880. package/src/components/post-panel-section/style.scss +3 -0
  881. package/src/components/post-pending-status/check.js +10 -0
  882. package/src/components/post-pending-status/index.js +5 -0
  883. package/src/components/post-pingbacks/index.js +17 -2
  884. package/src/components/post-preview-button/index.js +15 -0
  885. package/src/components/post-publish-button/index.js +17 -4
  886. package/src/components/post-publish-panel/index.js +1 -0
  887. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  888. package/src/components/post-publish-panel/style.scss +5 -0
  889. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
  890. package/src/components/post-saved-state/index.js +2 -2
  891. package/src/components/post-schedule/check.js +8 -0
  892. package/src/components/post-schedule/index.js +30 -3
  893. package/src/components/post-schedule/label.js +15 -0
  894. package/src/components/post-schedule/panel.js +9 -1
  895. package/src/components/post-schedule/style.scss +0 -11
  896. package/src/components/post-slug/panel.js +22 -0
  897. package/src/components/post-slug/style.scss +5 -0
  898. package/src/components/post-slug/test/index.js +5 -1
  899. package/src/components/post-status/index.js +30 -52
  900. package/src/components/post-status/style.scss +4 -34
  901. package/src/components/post-sticky/index.js +12 -7
  902. package/src/components/post-sticky/panel.js +18 -0
  903. package/src/components/post-sticky/style.scss +3 -0
  904. package/src/components/post-template/block-theme.js +1 -0
  905. package/src/components/post-template/classic-theme.js +15 -0
  906. package/src/components/post-template/panel.js +5 -0
  907. package/src/components/post-template/style.scss +0 -8
  908. package/src/components/post-text-editor/index.js +5 -0
  909. package/src/components/post-title/index.js +10 -3
  910. package/src/components/post-title/index.native.js +70 -35
  911. package/src/components/post-title/post-title-raw.js +10 -2
  912. package/src/components/post-title/use-post-title-focus.js +7 -0
  913. package/src/components/post-title/use-post-title.js +5 -0
  914. package/src/components/post-transform-panel/hooks.js +114 -0
  915. package/src/components/post-transform-panel/index.js +91 -0
  916. package/src/components/post-type-support-check/index.js +1 -1
  917. package/src/components/post-type-support-check/test/index.js +2 -2
  918. package/src/components/post-url/check.js +8 -0
  919. package/src/components/post-url/index.js +41 -24
  920. package/src/components/post-url/label.js +10 -0
  921. package/src/components/post-url/panel.js +6 -1
  922. package/src/components/post-url/style.scss +0 -9
  923. package/src/components/post-visibility/check.js +9 -0
  924. package/src/components/post-visibility/index.js +7 -0
  925. package/src/components/post-visibility/label.js +10 -0
  926. package/src/components/posts-per-page/index.js +101 -0
  927. package/src/components/posts-per-page/style.scss +4 -0
  928. package/src/components/preferences-modal/index.js +3 -3
  929. package/src/components/provider/index.js +72 -0
  930. package/src/components/provider/index.native.js +43 -2
  931. package/src/components/provider/use-block-editor-settings.js +19 -6
  932. package/src/components/provider/with-registry-provider.js +32 -31
  933. package/src/components/resizable-editor/index.js +90 -0
  934. package/src/components/resizable-editor/resize-handle.js +62 -0
  935. package/src/components/resizable-editor/style.scss +53 -0
  936. package/src/components/save-publish-panels/index.js +10 -2
  937. package/src/components/sidebar/constants.js +4 -0
  938. package/src/components/sidebar/header.js +49 -0
  939. package/src/components/sidebar/index.js +196 -0
  940. package/src/components/sidebar/post-summary.js +97 -0
  941. package/src/components/sidebar/style.scss +18 -0
  942. package/src/components/site-discussion/index.js +138 -0
  943. package/src/components/site-discussion/style.scss +19 -0
  944. package/src/components/start-page-options/index.js +6 -4
  945. package/src/components/start-template-options/index.js +219 -0
  946. package/src/components/start-template-options/style.scss +47 -0
  947. package/src/components/template-areas/index.js +15 -6
  948. package/src/components/template-areas/style.scss +0 -1
  949. package/src/components/template-content-panel/index.js +36 -0
  950. package/src/components/text-editor/index.js +57 -0
  951. package/src/components/text-editor/style.scss +71 -0
  952. package/src/components/{editor-canvas → visual-editor}/index.js +191 -110
  953. package/src/components/visual-editor/style.scss +37 -0
  954. package/src/hooks/index.js +1 -0
  955. package/src/hooks/media-upload.js +11 -0
  956. package/src/hooks/pattern-overrides.js +12 -6
  957. package/src/private-apis.js +18 -38
  958. package/src/private-apis.native.js +37 -0
  959. package/src/store/constants.js +7 -0
  960. package/src/store/private-actions.js +22 -50
  961. package/src/store/private-selectors.js +48 -0
  962. package/src/store/reducer.js +12 -0
  963. package/src/store/selectors.js +1 -1
  964. package/src/style.scss +16 -0
  965. package/src/utils/set-nested-value.js +39 -0
  966. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  967. package/build/components/editor-canvas/index.js.map +0 -1
  968. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  969. package/build-module/components/editor-canvas/index.js.map +0 -1
  970. package/src/components/post-slug/test/check.js +0 -17
  971. package/src/components/provider/README.md +0 -37
  972. /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.PrivatePostExcerptPanel = PrivatePostExcerptPanel;
8
8
  exports.default = PostExcerptPanel;
9
- var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
9
  var _i18n = require("@wordpress/i18n");
12
10
  var _components = require("@wordpress/components");
13
11
  var _data = require("@wordpress/data");
@@ -19,10 +17,7 @@ var _check = _interopRequireDefault(require("./check"));
19
17
  var _plugin = _interopRequireDefault(require("./plugin"));
20
18
  var _constants = require("../../store/constants");
21
19
  var _store = require("../../store");
22
- /**
23
- * External dependencies
24
- */
25
-
20
+ var _jsxRuntime = require("react/jsx-runtime");
26
21
  /**
27
22
  * WordPress dependencies
28
23
  */
@@ -33,8 +28,7 @@ var _store = require("../../store");
33
28
 
34
29
  /**
35
30
  * Module Constants
36
- */
37
- const PANEL_NAME = 'post-excerpt';
31
+ */const PANEL_NAME = 'post-excerpt';
38
32
  function ExcerptPanel() {
39
33
  const {
40
34
  isOpened,
@@ -62,17 +56,32 @@ function ExcerptPanel() {
62
56
 
63
57
  // There are special cases where we want to label the excerpt as a description.
64
58
  const shouldUseDescriptionLabel = ['wp_template', 'wp_template_part', 'wp_block'].includes(postType);
65
- return (0, _react.createElement)(_components.PanelBody, {
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
66
60
  title: shouldUseDescriptionLabel ? (0, _i18n.__)('Description') : (0, _i18n.__)('Excerpt'),
67
61
  opened: isOpened,
68
- onToggle: toggleExcerptPanel
69
- }, (0, _react.createElement)(_plugin.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_index.default, null), fills)));
62
+ onToggle: toggleExcerptPanel,
63
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_plugin.default.Slot, {
64
+ children: fills => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
65
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {}), fills]
66
+ })
67
+ })
68
+ });
70
69
  }
70
+
71
+ /**
72
+ * Is rendered if the post type supports excerpts and allows editing the excerpt.
73
+ *
74
+ * @return {JSX.Element} The rendered PostExcerptPanel component.
75
+ */
71
76
  function PostExcerptPanel() {
72
- return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(ExcerptPanel, null));
77
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_check.default, {
78
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ExcerptPanel, {})
79
+ });
73
80
  }
74
81
  function PrivatePostExcerptPanel() {
75
- return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(PrivateExcerpt, null));
82
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_check.default, {
83
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PrivateExcerpt, {})
84
+ });
76
85
  }
77
86
  function PrivateExcerpt() {
78
87
  const {
@@ -124,43 +133,51 @@ function PrivateExcerpt() {
124
133
  if (!shouldRender) {
125
134
  return false;
126
135
  }
127
- const excerptText = !!excerpt && (0, _react.createElement)(_components.__experimentalText, {
136
+ const excerptText = !!excerpt && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
128
137
  align: "left",
129
138
  numberOfLines: 4,
130
- truncate: true
131
- }, excerpt);
139
+ truncate: true,
140
+ children: excerpt
141
+ });
132
142
  if (!allowEditing) {
133
143
  return excerptText;
134
144
  }
135
145
  const excerptPlaceholder = shouldBeUsedAsDescription ? (0, _i18n.__)('Add a description…') : (0, _i18n.__)('Add an excerpt…');
136
146
  const triggerEditLabel = shouldBeUsedAsDescription ? (0, _i18n.__)('Edit description') : (0, _i18n.__)('Edit excerpt');
137
- return (0, _react.createElement)(_components.Dropdown, {
138
- className: "editor-post-excerpt__dropdown",
139
- contentClassName: "editor-post-excerpt__dropdown__content",
140
- popoverProps: popoverProps,
141
- focusOnMount: true,
142
- ref: setPopoverAnchor,
143
- renderToggle: ({
144
- onToggle
145
- }) => (0, _react.createElement)(_components.Button, {
146
- className: (0, _classnames.default)('editor-post-excerpt__dropdown__trigger', {
147
- 'has-excerpt': !!excerpt
147
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
148
+ children: [excerptText, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
149
+ className: "editor-post-excerpt__dropdown",
150
+ contentClassName: "editor-post-excerpt__dropdown__content",
151
+ popoverProps: popoverProps,
152
+ focusOnMount: true,
153
+ ref: setPopoverAnchor,
154
+ renderToggle: ({
155
+ onToggle
156
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
157
+ className: "editor-post-excerpt__dropdown__trigger",
158
+ onClick: onToggle,
159
+ variant: "link",
160
+ children: excerptText ? triggerEditLabel : excerptPlaceholder
148
161
  }),
149
- onClick: onToggle,
150
- label: !!excerptText ? triggerEditLabel : excerptPlaceholder,
151
- showTooltip: !!excerptText
152
- }, excerptText || excerptPlaceholder),
153
- renderContent: ({
154
- onClose
155
- }) => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.__experimentalInspectorPopoverHeader, {
156
- title: label,
157
- onClose: onClose
158
- }), (0, _react.createElement)(_components.__experimentalVStack, {
159
- spacing: 4
160
- }, (0, _react.createElement)(_plugin.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_index.default, {
161
- hideLabelFromVision: true,
162
- updateOnBlur: true
163
- }), fills))))
162
+ renderContent: ({
163
+ onClose
164
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
165
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__experimentalInspectorPopoverHeader, {
166
+ title: label,
167
+ onClose: onClose
168
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
169
+ spacing: 4,
170
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_plugin.default.Slot, {
171
+ children: fills => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
172
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
173
+ hideLabelFromVision: true,
174
+ updateOnBlur: true
175
+ }), fills]
176
+ })
177
+ })
178
+ })]
179
+ })
180
+ })]
164
181
  });
165
182
  }
166
183
  //# sourceMappingURL=panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_components","_data","_element","_blockEditor","_coreData","_index","_check","_plugin","_constants","_store","PANEL_NAME","ExcerptPanel","isOpened","isEnabled","postType","useSelect","select","isEditorPanelOpened","isEditorPanelEnabled","getCurrentPostType","editorStore","toggleEditorPanelOpened","useDispatch","toggleExcerptPanel","shouldUseDescriptionLabel","includes","_react","createElement","PanelBody","title","__","opened","onToggle","default","Slot","fills","Fragment","PostExcerptPanel","PrivatePostExcerptPanel","PrivateExcerpt","shouldRender","excerpt","shouldBeUsedAsDescription","allowEditing","getCurrentPostId","getEditedPostAttribute","isTemplateOrTemplatePart","isPattern","_shouldBeUsedAsDescription","_usedAttribute","template","coreStore","getEntityRecord","_shouldRender","source","TEMPLATE_ORIGINS","custom","has_theme_file","popoverAnchor","setPopoverAnchor","useState","label","popoverProps","useMemo","anchor","headerTitle","placement","offset","shift","excerptText","__experimentalText","align","numberOfLines","truncate","excerptPlaceholder","triggerEditLabel","Dropdown","className","contentClassName","focusOnMount","ref","renderToggle","Button","classnames","onClick","showTooltip","renderContent","onClose","__experimentalInspectorPopoverHeader","__experimentalVStack","spacing","hideLabelFromVision","updateOnBlur"],"sources":["@wordpress/editor/src/components/post-excerpt/panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\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';\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\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};\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>\n\t\t\t{ 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<Dropdown\n\t\t\tclassName=\"editor-post-excerpt__dropdown\"\n\t\t\tcontentClassName=\"editor-post-excerpt__dropdown__content\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tfocusOnMount\n\t\t\tref={ setPopoverAnchor }\n\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'editor-post-excerpt__dropdown__trigger',\n\t\t\t\t\t\t{ 'has-excerpt': !! excerpt }\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tlabel={\n\t\t\t\t\t\t!! excerptText ? triggerEditLabel : excerptPlaceholder\n\t\t\t\t\t}\n\t\t\t\t\tshowTooltip={ !! excerptText }\n\t\t\t\t>\n\t\t\t\t\t{ excerptText || excerptPlaceholder }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t\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Aa,EAAE,CAAC,CAAE1C;MAAQ,CAC7B,CAAG;MACH2C,OAAO,EAAGpD,QAAU;MACpB6B,KAAK,EACJ,CAAC,CAAEQ,WAAW,GAAGM,gBAAgB,GAAGD,kBACpC;MACDW,WAAW,EAAG,CAAC,CAAEhB;IAAa,GAE5BA,WAAW,IAAIK,kBACV,CACN;IACHY,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5B,IAAA7D,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAU,QAAA,QACC,IAAAV,MAAA,CAAAC,aAAA,EAACxB,YAAA,CAAAqF,oCAAsB;MACtB3D,KAAK,EAAGgC,KAAO;MACf0B,OAAO,EAAGA;IAAS,CACnB,CAAC,EAEF,IAAA7D,MAAA,CAAAC,aAAA,EAAC3B,WAAA,CAAAyF,oBAAM;MAACC,OAAO,EAAG;IAAG,GACpB,IAAAhE,MAAA,CAAAC,aAAA,EAACpB,OAAA,CAAA0B,OAAiB,CAACC,IAAI,QAClBC,KAAK,IACR,IAAAT,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAU,QAAA,QACC,IAAAV,MAAA,CAAAC,aAAA,EAACtB,MAAA,CAAA4B,OAAe;MACf0D,mBAAmB;MACnBC,YAAY;IAAA,CACZ,CAAC,EACAzD,KACD,CAEoB,CACjB,CACP;EACA,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_element","_blockEditor","_coreData","_index","_interopRequireDefault","_check","_plugin","_constants","_store","_jsxRuntime","PANEL_NAME","ExcerptPanel","isOpened","isEnabled","postType","useSelect","select","isEditorPanelOpened","isEditorPanelEnabled","getCurrentPostType","editorStore","toggleEditorPanelOpened","useDispatch","toggleExcerptPanel","shouldUseDescriptionLabel","includes","jsx","PanelBody","title","__","opened","onToggle","children","default","Slot","fills","jsxs","Fragment","PostExcerptPanel","PrivatePostExcerptPanel","PrivateExcerpt","shouldRender","excerpt","shouldBeUsedAsDescription","allowEditing","getCurrentPostId","getEditedPostAttribute","isTemplateOrTemplatePart","isPattern","_shouldBeUsedAsDescription","_usedAttribute","template","coreStore","getEntityRecord","_shouldRender","source","TEMPLATE_ORIGINS","custom","has_theme_file","popoverAnchor","setPopoverAnchor","useState","label","popoverProps","useMemo","anchor","headerTitle","placement","offset","shift","excerptText","__experimentalText","align","numberOfLines","truncate","excerptPlaceholder","triggerEditLabel","__experimentalVStack","Dropdown","className","contentClassName","focusOnMount","ref","renderToggle","Button","onClick","variant","renderContent","onClose","__experimentalInspectorPopoverHeader","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';\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};\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>\n\t\t\t{ 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\tclassName=\"editor-post-excerpt__dropdown__trigger\"\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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
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = require("react");
8
7
  var _components = require("@wordpress/components");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
9
  /**
10
10
  * Defines as extensibility slot for the Excerpt panel.
11
11
  */
@@ -62,9 +62,12 @@ const PluginPostExcerpt = ({
62
62
  children,
63
63
  className
64
64
  }) => {
65
- return (0, _react.createElement)(Fill, null, (0, _react.createElement)(_components.PanelRow, {
66
- className: className
67
- }, children));
65
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Fill, {
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelRow, {
67
+ className: className,
68
+ children: children
69
+ })
70
+ });
68
71
  };
69
72
  PluginPostExcerpt.Slot = Slot;
70
73
  var _default = exports.default = PluginPostExcerpt;
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","Fill","Slot","createSlotFill","PluginPostExcerpt","children","className","_react","createElement","PanelRow","_default","exports","default"],"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":";;;;;;;AAOA,IAAAA,WAAA,GAAAC,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGA,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,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,MAAMC,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACP,IAAI,QACJ,IAAAM,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,QAAQ;IAACH,SAAS,EAAGA;EAAW,GAAGD,QAAoB,CACnD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEfR,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_jsxRuntime","Fill","Slot","createSlotFill","PluginPostExcerpt","children","className","jsx","PanelRow","_default","exports","default"],"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":";;;;;;AAOA,IAAAA,WAAA,GAAAC,OAAA;AAAiE,IAAAC,WAAA,GAAAD,OAAA;AAPjE;AACA;AACA;;AAEA;AACA;AACA;;AAGA,MAAM;EAAEE,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,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,MAAMC,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACN,IAAI;IAAAI,QAAA,eACJ,IAAAL,WAAA,CAAAO,GAAA,EAACT,WAAA,CAAAU,QAAQ;MAACF,SAAS,EAAGA,SAAW;MAAAD,QAAA,EAAGA;IAAQ,CAAY;EAAC,CACpD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEfP,iBAAiB","ignoreList":[]}
@@ -5,21 +5,31 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _postTypeSupportCheck = _interopRequireDefault(require("../post-type-support-check"));
10
9
  var _themeSupportCheck = _interopRequireDefault(require("../theme-support-check"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
14
 
15
- function PostFeaturedImageCheck({
15
+ /**
16
+ * Wrapper component that renders its children only if the post type supports a featured image
17
+ * and the theme supports post thumbnails.
18
+ *
19
+ * @param {Object} props Props.
20
+ * @param {Element} props.children Children to be rendered.
21
+ *
22
+ * @return {Component} The component to be rendered.
23
+ */function PostFeaturedImageCheck({
16
24
  children
17
25
  }) {
18
- return (0, _react.createElement)(_themeSupportCheck.default, {
19
- supportKeys: "post-thumbnails"
20
- }, (0, _react.createElement)(_postTypeSupportCheck.default, {
21
- supportKeys: "thumbnail"
22
- }, children));
26
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_themeSupportCheck.default, {
27
+ supportKeys: "post-thumbnails",
28
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_postTypeSupportCheck.default, {
29
+ supportKeys: "thumbnail",
30
+ children: children
31
+ })
32
+ });
23
33
  }
24
34
  var _default = exports.default = PostFeaturedImageCheck;
25
35
  //# sourceMappingURL=check.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_postTypeSupportCheck","_interopRequireDefault","require","_themeSupportCheck","PostFeaturedImageCheck","children","_react","createElement","default","supportKeys","_default","exports"],"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\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":";;;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,kBAAA,CAAAK,OAAiB;IAACC,WAAW,EAAC;EAAiB,GAC/C,IAAAH,MAAA,CAAAC,aAAA,EAACP,qBAAA,CAAAQ,OAAoB;IAACC,WAAW,EAAC;EAAW,GAC1CJ,QACmB,CACJ,CAAC;AAEtB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcJ,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_postTypeSupportCheck","_interopRequireDefault","require","_themeSupportCheck","_jsxRuntime","PostFeaturedImageCheck","children","jsx","default","supportKeys","_default","exports"],"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":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAuD,IAAAE,WAAA,GAAAF,OAAA;AAJvD;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASG,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACJ,kBAAA,CAAAK,OAAiB;IAACC,WAAW,EAAC,iBAAiB;IAAAH,QAAA,eAC/C,IAAAF,WAAA,CAAAG,GAAA,EAACP,qBAAA,CAAAQ,OAAoB;MAACC,WAAW,EAAC,WAAW;MAAAH,QAAA,EAC1CA;IAAQ,CACW;EAAC,CACL,CAAC;AAEtB;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcH,sBAAsB","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _i18n = require("@wordpress/i18n");
10
9
  var _hooks = require("@wordpress/hooks");
11
10
  var _components = require("@wordpress/components");
@@ -17,6 +16,7 @@ var _blockEditor = require("@wordpress/block-editor");
17
16
  var _coreData = require("@wordpress/core-data");
18
17
  var _check = _interopRequireDefault(require("./check"));
19
18
  var _store = require("../../store");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
20
  /**
21
21
  * WordPress dependencies
22
22
  */
@@ -30,7 +30,9 @@ const ALLOWED_MEDIA_TYPES = ['image'];
30
30
  // Used when labels from post type were not yet loaded or when they are not present.
31
31
  const DEFAULT_FEATURE_IMAGE_LABEL = (0, _i18n.__)('Featured image');
32
32
  const DEFAULT_SET_FEATURE_IMAGE_LABEL = (0, _i18n.__)('Add a featured image');
33
- const instructions = (0, _react.createElement)("p", null, (0, _i18n.__)('To edit the featured image, you need permission to upload media.'));
33
+ const instructions = /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
34
+ children: (0, _i18n.__)('To edit the featured image, you need permission to upload media.')
35
+ });
34
36
  function getMediaDetails(media, postId) {
35
37
  var _media$media_details$, _media$media_details$2;
36
38
  if (!media) {
@@ -100,53 +102,63 @@ function PostFeaturedImage({
100
102
  }
101
103
  });
102
104
  }
103
- return (0, _react.createElement)(_check.default, null, noticeUI, (0, _react.createElement)("div", {
104
- className: "editor-post-featured-image"
105
- }, media && (0, _react.createElement)("div", {
106
- id: `editor-post-featured-image-${featuredImageId}-describedby`,
107
- className: "hidden"
108
- }, media.alt_text && (0, _i18n.sprintf)(
109
- // Translators: %s: The selected image alt text.
110
- (0, _i18n.__)('Current image: %s'), media.alt_text), !media.alt_text && (0, _i18n.sprintf)(
111
- // Translators: %s: The selected image filename.
112
- (0, _i18n.__)('The current image has no alternative text. The file name is: %s'), media.media_details.sizes?.full?.file || media.slug)), (0, _react.createElement)(_blockEditor.MediaUploadCheck, {
113
- fallback: instructions
114
- }, (0, _react.createElement)(_blockEditor.MediaUpload, {
115
- title: postType?.labels?.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
116
- onSelect: onUpdateImage,
117
- unstableFeaturedImageFlow: true,
118
- allowedTypes: ALLOWED_MEDIA_TYPES,
119
- modalClass: "editor-post-featured-image__media-modal",
120
- render: ({
121
- open
122
- }) => (0, _react.createElement)("div", {
123
- className: "editor-post-featured-image__container"
124
- }, (0, _react.createElement)(_components.Button, {
125
- ref: toggleRef,
126
- className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview',
127
- onClick: open,
128
- "aria-label": !featuredImageId ? null : (0, _i18n.__)('Edit or replace the image'),
129
- "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby`
130
- }, !!featuredImageId && media && (0, _react.createElement)("img", {
131
- className: "editor-post-featured-image__preview-image",
132
- src: mediaSourceUrl,
133
- alt: ""
134
- }), isLoading && (0, _react.createElement)(_components.Spinner, null), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)), !!featuredImageId && (0, _react.createElement)(_components.__experimentalHStack, {
135
- className: "editor-post-featured-image__actions"
136
- }, (0, _react.createElement)(_components.Button, {
137
- className: "editor-post-featured-image__action",
138
- onClick: open
139
- }, (0, _i18n.__)('Replace')), (0, _react.createElement)(_components.Button, {
140
- className: "editor-post-featured-image__action",
141
- onClick: () => {
142
- onRemoveImage();
143
- toggleRef.current.focus();
144
- }
145
- }, (0, _i18n.__)('Remove'))), (0, _react.createElement)(_components.DropZone, {
146
- onFilesDrop: onDropFiles
147
- })),
148
- value: featuredImageId
149
- }))));
105
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_check.default, {
106
+ children: [noticeUI, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
107
+ className: "editor-post-featured-image",
108
+ children: [media && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
109
+ id: `editor-post-featured-image-${featuredImageId}-describedby`,
110
+ className: "hidden",
111
+ children: [media.alt_text && (0, _i18n.sprintf)(
112
+ // Translators: %s: The selected image alt text.
113
+ (0, _i18n.__)('Current image: %s'), media.alt_text), !media.alt_text && (0, _i18n.sprintf)(
114
+ // Translators: %s: The selected image filename.
115
+ (0, _i18n.__)('The current image has no alternative text. The file name is: %s'), media.media_details.sizes?.full?.file || media.slug)]
116
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.MediaUploadCheck, {
117
+ fallback: instructions,
118
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.MediaUpload, {
119
+ title: postType?.labels?.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
120
+ onSelect: onUpdateImage,
121
+ unstableFeaturedImageFlow: true,
122
+ allowedTypes: ALLOWED_MEDIA_TYPES,
123
+ modalClass: "editor-post-featured-image__media-modal",
124
+ render: ({
125
+ open
126
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
127
+ className: "editor-post-featured-image__container",
128
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Button, {
129
+ ref: toggleRef,
130
+ className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview',
131
+ onClick: open,
132
+ "aria-label": !featuredImageId ? null : (0, _i18n.__)('Edit or replace the image'),
133
+ "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby`,
134
+ children: [!!featuredImageId && media && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
135
+ className: "editor-post-featured-image__preview-image",
136
+ src: mediaSourceUrl,
137
+ alt: ""
138
+ }), isLoading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)]
139
+ }), !!featuredImageId && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
140
+ className: "editor-post-featured-image__actions",
141
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
142
+ className: "editor-post-featured-image__action",
143
+ onClick: open,
144
+ children: (0, _i18n.__)('Replace')
145
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
146
+ className: "editor-post-featured-image__action",
147
+ onClick: () => {
148
+ onRemoveImage();
149
+ toggleRef.current.focus();
150
+ },
151
+ children: (0, _i18n.__)('Remove')
152
+ })]
153
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropZone, {
154
+ onFilesDrop: onDropFiles
155
+ })]
156
+ }),
157
+ value: featuredImageId
158
+ })
159
+ })]
160
+ })]
161
+ });
150
162
  }
151
163
  const applyWithSelect = (0, _data.withSelect)(select => {
152
164
  const {
@@ -203,5 +215,21 @@ const applyWithDispatch = (0, _data.withDispatch)((dispatch, {
203
215
  }
204
216
  };
205
217
  });
218
+
219
+ /**
220
+ * Renders the component for managing the featured image of a post.
221
+ *
222
+ * @param {Object} props Props.
223
+ * @param {number} props.currentPostId ID of the current post.
224
+ * @param {number} props.featuredImageId ID of the featured image.
225
+ * @param {Function} props.onUpdateImage Function to call when the image is updated.
226
+ * @param {Function} props.onRemoveImage Function to call when the image is removed.
227
+ * @param {Object} props.media The media object representing the featured image.
228
+ * @param {string} props.postType Post type.
229
+ * @param {Element} props.noticeUI UI for displaying notices.
230
+ * @param {Object} props.noticeOperations Operations for managing notices.
231
+ *
232
+ * @return {Element} Component to be rendered .
233
+ */
206
234
  var _default = exports.default = (0, _compose.compose)(_components.withNotices, applyWithSelect, applyWithDispatch, (0, _components.withFilters)('editor.PostFeaturedImage'))(PostFeaturedImage);
207
235
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_hooks","_components","_blob","_element","_compose","_data","_blockEditor","_coreData","_check","_interopRequireDefault","_store","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","__","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","_react","createElement","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","applyFilters","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","useRef","isLoading","setIsLoading","useState","getSettings","useSelect","blockEditorStore","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","isBlobURL","url","onError","message","removeAllNotices","createErrorNotice","default","className","alt_text","sprintf","full","file","slug","MediaUploadCheck","fallback","MediaUpload","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","Button","ref","onClick","src","alt","Spinner","set_featured_image","__experimentalHStack","current","focus","DropZone","onFilesDrop","value","applyWithSelect","withSelect","select","getMedia","getPostType","coreStore","getCurrentPostId","getEditedPostAttribute","editorStore","context","applyWithDispatch","withDispatch","dispatch","editPost","featured_media","onDropImage","_default","exports","compose","withNotices","withFilters"],"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\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{ media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image filename.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmedia.media_details.sizes?.full?.file ||\n\t\t\t\t\t\t\t\t\tmedia.slug\n\t\t\t\t\t\t\t) }\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\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: __( 'Edit or replace the image' )\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>\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=\"\"\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\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>\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\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\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,SAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AA5BA;AACA;AACA;;A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;QACDkC,OAAOA,CAAEC,OAAO,EAAG;UAClBlB,gBAAgB,CAACmB,gBAAgB,CAAC,CAAC;UACnCnB,gBAAgB,CAACoB,iBAAiB,CAAEF,OAAQ,CAAC;QAC9C;MACD,CAAE,CAAC;IACL,CAAC;IACDrB,aAAaA,CAAA,EAAG;MACfoE,QAAQ,CAAE;QAAEC,cAAc,EAAE;MAAE,CAAE,CAAC;IAClC;EACD,CAAC;AACF,CACD,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAEa,IAAAiD,gBAAO,EACrBC,uBAAW,EACXnB,eAAe,EACfU,iBAAiB,EACjB,IAAAU,uBAAW,EAAE,0BAA2B,CACzC,CAAC,CAAE/E,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_hooks","_components","_blob","_element","_compose","_data","_blockEditor","_coreData","_check","_interopRequireDefault","_store","_jsxRuntime","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","__","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","jsx","children","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","applyFilters","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","useRef","isLoading","setIsLoading","useState","getSettings","useSelect","blockEditorStore","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","isBlobURL","url","onError","message","removeAllNotices","createErrorNotice","jsxs","default","className","alt_text","sprintf","full","file","slug","MediaUploadCheck","fallback","MediaUpload","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","Button","ref","onClick","src","alt","Spinner","set_featured_image","__experimentalHStack","current","focus","DropZone","onFilesDrop","value","applyWithSelect","withSelect","select","getMedia","getPostType","coreStore","getCurrentPostId","getEditedPostAttribute","editorStore","context","applyWithDispatch","withDispatch","dispatch","editPost","featured_media","onDropImage","_default","exports","compose","withNotices","withFilters"],"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\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{ media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image filename.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmedia.media_details.sizes?.full?.file ||\n\t\t\t\t\t\t\t\t\tmedia.slug\n\t\t\t\t\t\t\t) }\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\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: __( 'Edit or replace the image' )\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>\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=\"\"\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\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>\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\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,SAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAmD,IAAAY,WAAA,GAAAZ,OAAA;AA5BnD;AACA;AACA;;AAsBA;AAC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