@wordpress/editor 13.35.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 (924) hide show
  1. package/CHANGELOG.md +7 -0
  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 +1 -1
  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 +46 -32
  20. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  21. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  22. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  23. package/build/components/blog-title/index.js +116 -0
  24. package/build/components/blog-title/index.js.map +1 -0
  25. package/build/components/collapsible-block-toolbar/index.js +21 -18
  26. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  27. package/build/components/commands/index.js +109 -3
  28. package/build/components/commands/index.js.map +1 -1
  29. package/build/components/create-template-part-modal/index.js +167 -0
  30. package/build/components/create-template-part-modal/index.js.map +1 -0
  31. package/build/components/create-template-part-modal/utils.js +64 -0
  32. package/build/components/create-template-part-modal/utils.js.map +1 -0
  33. package/build/components/deprecated.js +2 -2
  34. package/build/components/deprecated.js.map +1 -1
  35. package/build/components/document-bar/index.js +94 -70
  36. package/build/components/document-bar/index.js.map +1 -1
  37. package/build/components/document-outline/index.js +124 -121
  38. package/build/components/document-outline/index.js.map +1 -1
  39. package/build/components/document-outline/item.js +18 -14
  40. package/build/components/document-outline/item.js.map +1 -1
  41. package/build/components/document-tools/index.js +56 -53
  42. package/build/components/document-tools/index.js.map +1 -1
  43. package/build/components/editor-help/add-blocks.native.js +14 -11
  44. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/customize-blocks.native.js +14 -11
  46. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  47. package/build/components/editor-help/help-detail-navigation-screen.native.js +32 -22
  48. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  49. package/build/components/editor-help/help-get-support-button.native.js +8 -6
  50. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  51. package/build/components/editor-help/help-section-title.native.js +8 -6
  52. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  53. package/build/components/editor-help/help-topic-row.native.js +7 -6
  54. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  55. package/build/components/editor-help/icon-move-blocks.native.js +7 -6
  56. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  57. package/build/components/editor-help/index.native.js +94 -76
  58. package/build/components/editor-help/index.native.js.map +1 -1
  59. package/build/components/editor-help/intro-to-blocks.native.js +41 -37
  60. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  61. package/build/components/editor-help/move-blocks.native.js +25 -21
  62. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  63. package/build/components/editor-help/remove-blocks.native.js +12 -9
  64. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  65. package/build/components/editor-help/view-sections.native.js +24 -19
  66. package/build/components/editor-help/view-sections.native.js.map +1 -1
  67. package/build/components/editor-history/redo.js +2 -2
  68. package/build/components/editor-history/redo.js.map +1 -1
  69. package/build/components/editor-history/undo.js +2 -2
  70. package/build/components/editor-history/undo.js.map +1 -1
  71. package/build/components/editor-interface/content-slot-fill.js +23 -0
  72. package/build/components/editor-interface/content-slot-fill.js.map +1 -0
  73. package/build/components/editor-interface/index.js +178 -0
  74. package/build/components/editor-interface/index.js.map +1 -0
  75. package/build/components/editor-notices/index.js +22 -9
  76. package/build/components/editor-notices/index.js.map +1 -1
  77. package/build/components/editor-snackbars/index.js +2 -2
  78. package/build/components/editor-snackbars/index.js.map +1 -1
  79. package/build/components/entities-saved-states/entity-record-item.js +37 -10
  80. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  81. package/build/components/entities-saved-states/entity-type-list.js +25 -22
  82. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  83. package/build/components/entities-saved-states/index.js +53 -46
  84. package/build/components/entities-saved-states/index.js.map +1 -1
  85. package/build/components/error-boundary/index.js +27 -14
  86. package/build/components/error-boundary/index.js.map +1 -1
  87. package/build/components/error-boundary/index.native.js +45 -35
  88. package/build/components/error-boundary/index.native.js.map +1 -1
  89. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -4
  90. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  91. package/build/components/global-styles-provider/index.js +81 -16
  92. package/build/components/global-styles-provider/index.js.map +1 -1
  93. package/build/components/header/back-button.js +34 -0
  94. package/build/components/header/back-button.js.map +1 -0
  95. package/build/components/header/index.js +88 -59
  96. package/build/components/header/index.js.map +1 -1
  97. package/build/components/inserter-sidebar/index.js +45 -19
  98. package/build/components/inserter-sidebar/index.js.map +1 -1
  99. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  100. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  101. package/build/components/keyboard-shortcut-help-modal/index.js +53 -48
  102. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  103. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  104. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  105. package/build/components/list-view-sidebar/index.js +59 -47
  106. package/build/components/list-view-sidebar/index.js.map +1 -1
  107. package/build/components/list-view-sidebar/list-view-outline.js +21 -4
  108. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  109. package/build/components/local-autosave-monitor/index.js +15 -2
  110. package/build/components/local-autosave-monitor/index.js.map +1 -1
  111. package/build/components/mode-switcher/index.js +10 -10
  112. package/build/components/mode-switcher/index.js.map +1 -1
  113. package/build/components/more-menu/copy-content-menu-item.js +5 -4
  114. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  115. package/build/components/more-menu/index.js +89 -76
  116. package/build/components/more-menu/index.js.map +1 -1
  117. package/build/components/more-menu/tools-more-menu-group.js +2 -2
  118. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  119. package/build/components/more-menu/view-more-menu-group.js +2 -2
  120. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  121. package/build/components/offline-status/index.native.js +12 -11
  122. package/build/components/offline-status/index.native.js.map +1 -1
  123. package/build/components/page-attributes/order.js +87 -14
  124. package/build/components/page-attributes/order.js.map +1 -1
  125. package/build/components/page-attributes/panel.js +10 -19
  126. package/build/components/page-attributes/panel.js.map +1 -1
  127. package/build/components/page-attributes/parent.js +86 -3
  128. package/build/components/page-attributes/parent.js.map +1 -1
  129. package/build/components/pattern-duplicate-modal/index.js +59 -0
  130. package/build/components/pattern-duplicate-modal/index.js.map +1 -0
  131. package/build/components/pattern-overrides-panel/index.js +2 -2
  132. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  133. package/build/components/pattern-rename-modal/index.js +58 -0
  134. package/build/components/pattern-rename-modal/index.js.map +1 -0
  135. package/build/components/plugin-document-setting-panel/index.js +17 -12
  136. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  137. package/build/components/plugin-post-publish-panel/index.js +10 -7
  138. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  139. package/build/components/plugin-post-status-info/index.js +7 -4
  140. package/build/components/plugin-post-status-info/index.js.map +1 -1
  141. package/build/components/plugin-pre-publish-panel/index.js +10 -7
  142. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  143. package/build/components/plugin-sidebar/index.js +3 -4
  144. package/build/components/plugin-sidebar/index.js.map +1 -1
  145. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
  146. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  147. package/build/components/post-actions/actions.js +378 -309
  148. package/build/components/post-actions/actions.js.map +1 -1
  149. package/build/components/post-actions/export-pattern-action.js +64 -0
  150. package/build/components/post-actions/export-pattern-action.js.map +1 -0
  151. package/build/components/post-actions/export-pattern-action.native.js +11 -0
  152. package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
  153. package/build/components/post-actions/index.js +66 -50
  154. package/build/components/post-actions/index.js.map +1 -1
  155. package/build/components/post-author/check.js +6 -6
  156. package/build/components/post-author/check.js.map +1 -1
  157. package/build/components/post-author/combobox.js +4 -3
  158. package/build/components/post-author/combobox.js.map +1 -1
  159. package/build/components/post-author/hook.js +2 -1
  160. package/build/components/post-author/hook.js.map +1 -1
  161. package/build/components/post-author/index.js +3 -3
  162. package/build/components/post-author/index.js.map +1 -1
  163. package/build/components/post-author/panel.js +72 -4
  164. package/build/components/post-author/panel.js.map +1 -1
  165. package/build/components/post-author/select.js +4 -3
  166. package/build/components/post-author/select.js.map +1 -1
  167. package/build/components/post-card-panel/index.js +54 -19
  168. package/build/components/post-card-panel/index.js.map +1 -1
  169. package/build/components/post-comments/index.js +38 -22
  170. package/build/components/post-comments/index.js.map +1 -1
  171. package/build/components/post-content-information/index.js +8 -5
  172. package/build/components/post-content-information/index.js.map +1 -1
  173. package/build/components/post-discussion/panel.js +54 -38
  174. package/build/components/post-discussion/panel.js.map +1 -1
  175. package/build/components/post-excerpt/check.js +6 -6
  176. package/build/components/post-excerpt/check.js.map +1 -1
  177. package/build/components/post-excerpt/index.js +18 -17
  178. package/build/components/post-excerpt/index.js.map +1 -1
  179. package/build/components/post-excerpt/panel.js +59 -42
  180. package/build/components/post-excerpt/panel.js.map +1 -1
  181. package/build/components/post-excerpt/plugin.js +7 -4
  182. package/build/components/post-excerpt/plugin.js.map +1 -1
  183. package/build/components/post-featured-image/check.js +17 -7
  184. package/build/components/post-featured-image/check.js.map +1 -1
  185. package/build/components/post-featured-image/index.js +77 -49
  186. package/build/components/post-featured-image/index.js.map +1 -1
  187. package/build/components/post-featured-image/panel.js +22 -7
  188. package/build/components/post-featured-image/panel.js.map +1 -1
  189. package/build/components/post-format/check.js +14 -4
  190. package/build/components/post-format/check.js.map +1 -1
  191. package/build/components/post-format/index.js +37 -20
  192. package/build/components/post-format/index.js.map +1 -1
  193. package/build/components/post-format/panel.js +73 -7
  194. package/build/components/post-format/panel.js.map +1 -1
  195. package/build/components/post-last-edited-panel/index.js +7 -4
  196. package/build/components/post-last-edited-panel/index.js.map +1 -1
  197. package/build/components/post-last-revision/check.js +13 -5
  198. package/build/components/post-last-revision/check.js.map +1 -1
  199. package/build/components/post-last-revision/index.js +19 -13
  200. package/build/components/post-last-revision/index.js.map +1 -1
  201. package/build/components/post-last-revision/panel.js +12 -5
  202. package/build/components/post-last-revision/panel.js.map +1 -1
  203. package/build/components/post-locked-modal/index.js +57 -35
  204. package/build/components/post-locked-modal/index.js.map +1 -1
  205. package/build/components/post-panel-row/index.js +11 -8
  206. package/build/components/post-panel-row/index.js.map +1 -1
  207. package/build/components/post-panel-section/index.js +5 -4
  208. package/build/components/post-panel-section/index.js.map +1 -1
  209. package/build/components/post-pending-status/check.js +10 -0
  210. package/build/components/post-pending-status/check.js.map +1 -1
  211. package/build/components/post-pending-status/index.js +14 -7
  212. package/build/components/post-pending-status/index.js.map +1 -1
  213. package/build/components/post-pingbacks/index.js +13 -5
  214. package/build/components/post-pingbacks/index.js.map +1 -1
  215. package/build/components/post-preview-button/index.js +45 -21
  216. package/build/components/post-preview-button/index.js.map +1 -1
  217. package/build/components/post-publish-button/index.js +21 -11
  218. package/build/components/post-publish-button/index.js.map +1 -1
  219. package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  220. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  221. package/build/components/post-publish-panel/index.js +46 -33
  222. package/build/components/post-publish-panel/index.js.map +1 -1
  223. package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
  224. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  225. package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
  226. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  227. package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
  228. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  229. package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
  230. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  231. package/build/components/post-publish-panel/postpublish.js +55 -38
  232. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  233. package/build/components/post-publish-panel/prepublish.js +41 -26
  234. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  235. package/build/components/post-saved-state/index.js +8 -8
  236. package/build/components/post-saved-state/index.js.map +1 -1
  237. package/build/components/post-schedule/check.js +8 -0
  238. package/build/components/post-schedule/check.js.map +1 -1
  239. package/build/components/post-schedule/index.js +30 -5
  240. package/build/components/post-schedule/index.js.map +1 -1
  241. package/build/components/post-schedule/label.js +16 -0
  242. package/build/components/post-schedule/label.js.map +1 -1
  243. package/build/components/post-schedule/panel.js +43 -30
  244. package/build/components/post-schedule/panel.js.map +1 -1
  245. package/build/components/post-slug/check.js +5 -4
  246. package/build/components/post-slug/check.js.map +1 -1
  247. package/build/components/post-slug/index.js +5 -3
  248. package/build/components/post-slug/index.js.map +1 -1
  249. package/build/components/post-slug/panel.js +7 -4
  250. package/build/components/post-slug/panel.js.map +1 -1
  251. package/build/components/post-status/index.js +118 -119
  252. package/build/components/post-status/index.js.map +1 -1
  253. package/build/components/post-sticky/index.js +16 -8
  254. package/build/components/post-sticky/index.js.map +1 -1
  255. package/build/components/post-sticky/panel.js +6 -2
  256. package/build/components/post-sticky/panel.js.map +1 -1
  257. package/build/components/post-switch-to-draft-button/index.js +25 -21
  258. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  259. package/build/components/post-sync-status/index.js +8 -6
  260. package/build/components/post-sync-status/index.js.map +1 -1
  261. package/build/components/post-taxonomies/flat-term-selector.js +21 -20
  262. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  263. package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
  264. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  265. package/build/components/post-taxonomies/index.js +6 -6
  266. package/build/components/post-taxonomies/index.js.map +1 -1
  267. package/build/components/post-taxonomies/most-used-terms.js +19 -15
  268. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  269. package/build/components/post-taxonomies/panel.js +15 -11
  270. package/build/components/post-taxonomies/panel.js.map +1 -1
  271. package/build/components/post-template/block-theme.js +42 -32
  272. package/build/components/post-template/block-theme.js.map +1 -1
  273. package/build/components/post-template/classic-theme.js +73 -50
  274. package/build/components/post-template/classic-theme.js.map +1 -1
  275. package/build/components/post-template/create-new-template-modal.js +33 -27
  276. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  277. package/build/components/post-template/create-new-template.js +14 -11
  278. package/build/components/post-template/create-new-template.js.map +1 -1
  279. package/build/components/post-template/panel.js +16 -10
  280. package/build/components/post-template/panel.js.map +1 -1
  281. package/build/components/post-template/reset-default-template.js +5 -4
  282. package/build/components/post-template/reset-default-template.js.map +1 -1
  283. package/build/components/post-template/swap-template-button.js +20 -15
  284. package/build/components/post-template/swap-template-button.js.map +1 -1
  285. package/build/components/post-text-editor/index.js +27 -20
  286. package/build/components/post-text-editor/index.js.map +1 -1
  287. package/build/components/post-title/index.js +29 -17
  288. package/build/components/post-title/index.js.map +1 -1
  289. package/build/components/post-title/index.native.js +81 -57
  290. package/build/components/post-title/index.native.js.map +1 -1
  291. package/build/components/post-title/post-title-raw.js +10 -3
  292. package/build/components/post-title/post-title-raw.js.map +1 -1
  293. package/build/components/post-title/use-post-title-focus.js +7 -0
  294. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  295. package/build/components/post-title/use-post-title.js +5 -0
  296. package/build/components/post-title/use-post-title.js.map +1 -1
  297. package/build/components/post-transform-panel/index.js +11 -11
  298. package/build/components/post-transform-panel/index.js.map +1 -1
  299. package/build/components/post-trash/index.js +19 -15
  300. package/build/components/post-trash/index.js.map +1 -1
  301. package/build/components/post-url/check.js +8 -0
  302. package/build/components/post-url/check.js.map +1 -1
  303. package/build/components/post-url/index.js +98 -73
  304. package/build/components/post-url/index.js.map +1 -1
  305. package/build/components/post-url/label.js +11 -0
  306. package/build/components/post-url/label.js.map +1 -1
  307. package/build/components/post-url/panel.js +33 -25
  308. package/build/components/post-url/panel.js.map +1 -1
  309. package/build/components/post-view-link/index.js +2 -2
  310. package/build/components/post-view-link/index.js.map +1 -1
  311. package/build/components/post-visibility/check.js +9 -0
  312. package/build/components/post-visibility/check.js.map +1 -1
  313. package/build/components/post-visibility/index.js +83 -68
  314. package/build/components/post-visibility/index.js.map +1 -1
  315. package/build/components/post-visibility/label.js +11 -0
  316. package/build/components/post-visibility/label.js.map +1 -1
  317. package/build/components/posts-per-page/index.js +109 -0
  318. package/build/components/posts-per-page/index.js.map +1 -0
  319. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  320. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  321. package/build/components/preferences-modal/index.js +124 -102
  322. package/build/components/preferences-modal/index.js.map +1 -1
  323. package/build/components/preview-dropdown/index.js +47 -31
  324. package/build/components/preview-dropdown/index.js.map +1 -1
  325. package/build/components/provider/index.js +94 -20
  326. package/build/components/provider/index.js.map +1 -1
  327. package/build/components/provider/index.native.js +55 -19
  328. package/build/components/provider/index.native.js.map +1 -1
  329. package/build/components/provider/use-block-editor-settings.js +7 -6
  330. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  331. package/build/components/provider/with-registry-provider.js +31 -24
  332. package/build/components/provider/with-registry-provider.js.map +1 -1
  333. package/build/components/resizable-editor/index.js +96 -0
  334. package/build/components/resizable-editor/index.js.map +1 -0
  335. package/build/components/resizable-editor/resize-handle.js +59 -0
  336. package/build/components/resizable-editor/resize-handle.js.map +1 -0
  337. package/build/components/save-publish-panels/index.js +35 -26
  338. package/build/components/save-publish-panels/index.js.map +1 -1
  339. package/build/components/sidebar/header.js +17 -14
  340. package/build/components/sidebar/header.js.map +1 -1
  341. package/build/components/sidebar/index.js +36 -32
  342. package/build/components/sidebar/index.js.map +1 -1
  343. package/build/components/sidebar/post-summary.js +38 -33
  344. package/build/components/sidebar/post-summary.js.map +1 -1
  345. package/build/components/site-discussion/index.js +133 -0
  346. package/build/components/site-discussion/index.js.map +1 -0
  347. package/build/components/start-page-options/index.js +13 -11
  348. package/build/components/start-page-options/index.js.map +1 -1
  349. package/build/components/start-template-options/index.js +29 -23
  350. package/build/components/start-template-options/index.js.map +1 -1
  351. package/build/components/table-of-contents/index.js +4 -4
  352. package/build/components/table-of-contents/index.js.map +1 -1
  353. package/build/components/table-of-contents/panel.js +53 -35
  354. package/build/components/table-of-contents/panel.js.map +1 -1
  355. package/build/components/template-areas/index.js +36 -22
  356. package/build/components/template-areas/index.js.map +1 -1
  357. package/build/components/template-content-panel/index.js +7 -6
  358. package/build/components/template-content-panel/index.js.map +1 -1
  359. package/build/components/template-validation-notice/index.js +25 -21
  360. package/build/components/template-validation-notice/index.js.map +1 -1
  361. package/build/components/text-editor/index.js +73 -0
  362. package/build/components/text-editor/index.js.map +1 -0
  363. package/build/components/time-to-read/index.js +8 -8
  364. package/build/components/time-to-read/index.js.map +1 -1
  365. package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
  366. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  367. package/build/components/{editor-canvas → visual-editor}/index.js +115 -74
  368. package/build/components/visual-editor/index.js.map +1 -0
  369. package/build/components/word-count/index.js +5 -4
  370. package/build/components/word-count/index.js.map +1 -1
  371. package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
  372. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  373. package/build/hooks/index.js +1 -0
  374. package/build/hooks/index.js.map +1 -1
  375. package/build/hooks/media-upload.js +10 -0
  376. package/build/hooks/media-upload.js.map +1 -0
  377. package/build/hooks/pattern-overrides.js +15 -11
  378. package/build/hooks/pattern-overrides.js.map +1 -1
  379. package/build/private-apis.js +10 -28
  380. package/build/private-apis.js.map +1 -1
  381. package/build/private-apis.native.js +2 -26
  382. package/build/private-apis.native.js.map +1 -1
  383. package/build/store/constants.js +4 -1
  384. package/build/store/constants.js.map +1 -1
  385. package/build/store/private-actions.js +10 -14
  386. package/build/store/private-actions.js.map +1 -1
  387. package/build/store/private-selectors.js +39 -1
  388. package/build/store/private-selectors.js.map +1 -1
  389. package/build/store/selectors.js +1 -1
  390. package/build/store/selectors.js.map +1 -1
  391. package/build/utils/set-nested-value.js +44 -0
  392. package/build/utils/set-nested-value.js.map +1 -0
  393. package/build-module/bindings/index.js +1 -3
  394. package/build-module/bindings/index.js.map +1 -1
  395. package/build-module/bindings/pattern-overrides.js +1 -1
  396. package/build-module/bindings/pattern-overrides.js.map +1 -1
  397. package/build-module/bindings/post-meta.js +38 -2
  398. package/build-module/bindings/post-meta.js.map +1 -1
  399. package/build-module/components/autocompleters/user.js +14 -9
  400. package/build-module/components/autocompleters/user.js.map +1 -1
  401. package/build-module/components/block-manager/category.js +20 -17
  402. package/build-module/components/block-manager/category.js.map +1 -1
  403. package/build-module/components/block-manager/checklist.js +16 -14
  404. package/build-module/components/block-manager/checklist.js.map +1 -1
  405. package/build-module/components/block-manager/index.js +38 -33
  406. package/build-module/components/block-manager/index.js.map +1 -1
  407. package/build-module/components/block-removal-warnings/index.js +2 -2
  408. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  409. package/build-module/components/block-settings-menu/content-only-settings-menu.js +48 -32
  410. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  411. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  412. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  413. package/build-module/components/blog-title/index.js +110 -0
  414. package/build-module/components/blog-title/index.js.map +1 -0
  415. package/build-module/components/collapsible-block-toolbar/index.js +23 -18
  416. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  417. package/build-module/components/commands/index.js +111 -5
  418. package/build-module/components/commands/index.js.map +1 -1
  419. package/build-module/components/create-template-part-modal/index.js +160 -0
  420. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  421. package/build-module/components/create-template-part-modal/utils.js +54 -0
  422. package/build-module/components/create-template-part-modal/utils.js.map +1 -0
  423. package/build-module/components/deprecated.js +2 -2
  424. package/build-module/components/deprecated.js.map +1 -1
  425. package/build-module/components/document-bar/index.js +93 -68
  426. package/build-module/components/document-bar/index.js.map +1 -1
  427. package/build-module/components/document-outline/index.js +125 -120
  428. package/build-module/components/document-outline/index.js.map +1 -1
  429. package/build-module/components/document-outline/item.js +19 -14
  430. package/build-module/components/document-outline/item.js.map +1 -1
  431. package/build-module/components/document-tools/index.js +58 -53
  432. package/build-module/components/document-tools/index.js.map +1 -1
  433. package/build-module/components/editor-help/add-blocks.native.js +16 -11
  434. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  435. package/build-module/components/editor-help/customize-blocks.native.js +16 -11
  436. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  437. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +33 -22
  438. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  439. package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
  440. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  441. package/build-module/components/editor-help/help-section-title.native.js +8 -6
  442. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  443. package/build-module/components/editor-help/help-topic-row.native.js +7 -6
  444. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  445. package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
  446. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  447. package/build-module/components/editor-help/index.native.js +96 -76
  448. package/build-module/components/editor-help/index.native.js.map +1 -1
  449. package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
  450. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  451. package/build-module/components/editor-help/move-blocks.native.js +27 -21
  452. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  453. package/build-module/components/editor-help/remove-blocks.native.js +14 -9
  454. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  455. package/build-module/components/editor-help/view-sections.native.js +25 -19
  456. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  457. package/build-module/components/editor-history/redo.js +2 -2
  458. package/build-module/components/editor-history/redo.js.map +1 -1
  459. package/build-module/components/editor-history/undo.js +2 -2
  460. package/build-module/components/editor-history/undo.js.map +1 -1
  461. package/build-module/components/editor-interface/content-slot-fill.js +16 -0
  462. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
  463. package/build-module/components/editor-interface/index.js +172 -0
  464. package/build-module/components/editor-interface/index.js.map +1 -0
  465. package/build-module/components/editor-notices/index.js +25 -9
  466. package/build-module/components/editor-notices/index.js.map +1 -1
  467. package/build-module/components/editor-snackbars/index.js +2 -2
  468. package/build-module/components/editor-snackbars/index.js.map +1 -1
  469. package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
  470. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  471. package/build-module/components/entities-saved-states/entity-type-list.js +26 -22
  472. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  473. package/build-module/components/entities-saved-states/index.js +54 -46
  474. package/build-module/components/entities-saved-states/index.js.map +1 -1
  475. package/build-module/components/error-boundary/index.js +27 -14
  476. package/build-module/components/error-boundary/index.js.map +1 -1
  477. package/build-module/components/error-boundary/index.native.js +46 -35
  478. package/build-module/components/error-boundary/index.native.js.map +1 -1
  479. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -2
  480. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  481. package/build-module/components/global-styles-provider/index.js +82 -17
  482. package/build-module/components/global-styles-provider/index.js.map +1 -1
  483. package/build-module/components/header/back-button.js +28 -0
  484. package/build-module/components/header/back-button.js.map +1 -0
  485. package/build-module/components/header/index.js +89 -59
  486. package/build-module/components/header/index.js.map +1 -1
  487. package/build-module/components/inserter-sidebar/index.js +47 -21
  488. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  489. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  490. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  491. package/build-module/components/keyboard-shortcut-help-modal/index.js +54 -48
  492. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  493. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  494. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  495. package/build-module/components/list-view-sidebar/index.js +60 -47
  496. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  497. package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
  498. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  499. package/build-module/components/local-autosave-monitor/index.js +15 -2
  500. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  501. package/build-module/components/mode-switcher/index.js +9 -8
  502. package/build-module/components/mode-switcher/index.js.map +1 -1
  503. package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
  504. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  505. package/build-module/components/more-menu/index.js +91 -76
  506. package/build-module/components/more-menu/index.js.map +1 -1
  507. package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
  508. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  509. package/build-module/components/more-menu/view-more-menu-group.js +2 -2
  510. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  511. package/build-module/components/offline-status/index.native.js +12 -9
  512. package/build-module/components/offline-status/index.native.js.map +1 -1
  513. package/build-module/components/page-attributes/order.js +90 -17
  514. package/build-module/components/page-attributes/order.js.map +1 -1
  515. package/build-module/components/page-attributes/panel.js +13 -21
  516. package/build-module/components/page-attributes/panel.js.map +1 -1
  517. package/build-module/components/page-attributes/parent.js +88 -5
  518. package/build-module/components/page-attributes/parent.js.map +1 -1
  519. package/build-module/components/pattern-duplicate-modal/index.js +51 -0
  520. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
  521. package/build-module/components/pattern-overrides-panel/index.js +2 -2
  522. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  523. package/build-module/components/pattern-rename-modal/index.js +50 -0
  524. package/build-module/components/pattern-rename-modal/index.js.map +1 -0
  525. package/build-module/components/plugin-document-setting-panel/index.js +19 -12
  526. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  527. package/build-module/components/plugin-post-publish-panel/index.js +10 -7
  528. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  529. package/build-module/components/plugin-post-status-info/index.js +7 -4
  530. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  531. package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
  532. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  533. package/build-module/components/plugin-sidebar/index.js +2 -2
  534. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  535. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
  536. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  537. package/build-module/components/post-actions/actions.js +379 -309
  538. package/build-module/components/post-actions/actions.js.map +1 -1
  539. package/build-module/components/post-actions/export-pattern-action.js +58 -0
  540. package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
  541. package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
  542. package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
  543. package/build-module/components/post-actions/index.js +68 -50
  544. package/build-module/components/post-actions/index.js.map +1 -1
  545. package/build-module/components/post-author/check.js +5 -4
  546. package/build-module/components/post-author/check.js.map +1 -1
  547. package/build-module/components/post-author/combobox.js +4 -3
  548. package/build-module/components/post-author/combobox.js.map +1 -1
  549. package/build-module/components/post-author/hook.js +2 -1
  550. package/build-module/components/post-author/hook.js.map +1 -1
  551. package/build-module/components/post-author/index.js +3 -3
  552. package/build-module/components/post-author/index.js.map +1 -1
  553. package/build-module/components/post-author/panel.js +72 -4
  554. package/build-module/components/post-author/panel.js.map +1 -1
  555. package/build-module/components/post-author/select.js +4 -3
  556. package/build-module/components/post-author/select.js.map +1 -1
  557. package/build-module/components/post-card-panel/index.js +54 -20
  558. package/build-module/components/post-card-panel/index.js.map +1 -1
  559. package/build-module/components/post-comments/index.js +40 -22
  560. package/build-module/components/post-comments/index.js.map +1 -1
  561. package/build-module/components/post-content-information/index.js +8 -5
  562. package/build-module/components/post-content-information/index.js.map +1 -1
  563. package/build-module/components/post-discussion/panel.js +56 -39
  564. package/build-module/components/post-discussion/panel.js.map +1 -1
  565. package/build-module/components/post-excerpt/check.js +5 -4
  566. package/build-module/components/post-excerpt/check.js.map +1 -1
  567. package/build-module/components/post-excerpt/index.js +17 -15
  568. package/build-module/components/post-excerpt/index.js.map +1 -1
  569. package/build-module/components/post-excerpt/panel.js +60 -40
  570. package/build-module/components/post-excerpt/panel.js.map +1 -1
  571. package/build-module/components/post-excerpt/plugin.js +7 -4
  572. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  573. package/build-module/components/post-featured-image/check.js +18 -6
  574. package/build-module/components/post-featured-image/check.js.map +1 -1
  575. package/build-module/components/post-featured-image/index.js +78 -49
  576. package/build-module/components/post-featured-image/index.js.map +1 -1
  577. package/build-module/components/post-featured-image/panel.js +22 -7
  578. package/build-module/components/post-featured-image/panel.js.map +1 -1
  579. package/build-module/components/post-format/check.js +14 -4
  580. package/build-module/components/post-format/check.js.map +1 -1
  581. package/build-module/components/post-format/index.js +39 -21
  582. package/build-module/components/post-format/index.js.map +1 -1
  583. package/build-module/components/post-format/panel.js +75 -7
  584. package/build-module/components/post-format/panel.js.map +1 -1
  585. package/build-module/components/post-last-edited-panel/index.js +7 -4
  586. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  587. package/build-module/components/post-last-revision/check.js +14 -4
  588. package/build-module/components/post-last-revision/check.js.map +1 -1
  589. package/build-module/components/post-last-revision/index.js +21 -13
  590. package/build-module/components/post-last-revision/index.js.map +1 -1
  591. package/build-module/components/post-last-revision/panel.js +13 -4
  592. package/build-module/components/post-last-revision/panel.js.map +1 -1
  593. package/build-module/components/post-locked-modal/index.js +60 -34
  594. package/build-module/components/post-locked-modal/index.js.map +1 -1
  595. package/build-module/components/post-panel-row/index.js +12 -8
  596. package/build-module/components/post-panel-row/index.js.map +1 -1
  597. package/build-module/components/post-panel-section/index.js +5 -4
  598. package/build-module/components/post-panel-section/index.js.map +1 -1
  599. package/build-module/components/post-pending-status/check.js +11 -0
  600. package/build-module/components/post-pending-status/check.js.map +1 -1
  601. package/build-module/components/post-pending-status/index.js +15 -7
  602. package/build-module/components/post-pending-status/index.js.map +1 -1
  603. package/build-module/components/post-pingbacks/index.js +13 -5
  604. package/build-module/components/post-pingbacks/index.js.map +1 -1
  605. package/build-module/components/post-preview-button/index.js +47 -21
  606. package/build-module/components/post-preview-button/index.js.map +1 -1
  607. package/build-module/components/post-publish-button/index.js +22 -11
  608. package/build-module/components/post-publish-button/index.js.map +1 -1
  609. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  610. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  611. package/build-module/components/post-publish-panel/index.js +48 -33
  612. package/build-module/components/post-publish-panel/index.js.map +1 -1
  613. package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
  614. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  615. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +22 -15
  616. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  617. package/build-module/components/post-publish-panel/maybe-tags-panel.js +14 -10
  618. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  619. package/build-module/components/post-publish-panel/maybe-upload-media.js +30 -24
  620. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  621. package/build-module/components/post-publish-panel/postpublish.js +57 -38
  622. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  623. package/build-module/components/post-publish-panel/prepublish.js +43 -26
  624. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  625. package/build-module/components/post-saved-state/index.js +8 -6
  626. package/build-module/components/post-saved-state/index.js.map +1 -1
  627. package/build-module/components/post-schedule/check.js +9 -0
  628. package/build-module/components/post-schedule/check.js.map +1 -1
  629. package/build-module/components/post-schedule/index.js +30 -6
  630. package/build-module/components/post-schedule/index.js.map +1 -1
  631. package/build-module/components/post-schedule/label.js +17 -0
  632. package/build-module/components/post-schedule/label.js.map +1 -1
  633. package/build-module/components/post-schedule/panel.js +43 -30
  634. package/build-module/components/post-schedule/panel.js.map +1 -1
  635. package/build-module/components/post-slug/check.js +5 -4
  636. package/build-module/components/post-slug/check.js.map +1 -1
  637. package/build-module/components/post-slug/index.js +5 -3
  638. package/build-module/components/post-slug/index.js.map +1 -1
  639. package/build-module/components/post-slug/panel.js +7 -4
  640. package/build-module/components/post-slug/panel.js.map +1 -1
  641. package/build-module/components/post-status/index.js +121 -120
  642. package/build-module/components/post-status/index.js.map +1 -1
  643. package/build-module/components/post-sticky/index.js +17 -9
  644. package/build-module/components/post-sticky/index.js.map +1 -1
  645. package/build-module/components/post-sticky/panel.js +6 -2
  646. package/build-module/components/post-sticky/panel.js.map +1 -1
  647. package/build-module/components/post-switch-to-draft-button/index.js +27 -21
  648. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  649. package/build-module/components/post-sync-status/index.js +8 -6
  650. package/build-module/components/post-sync-status/index.js.map +1 -1
  651. package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
  652. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  653. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
  654. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  655. package/build-module/components/post-taxonomies/index.js +6 -6
  656. package/build-module/components/post-taxonomies/index.js.map +1 -1
  657. package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
  658. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  659. package/build-module/components/post-taxonomies/panel.js +15 -11
  660. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  661. package/build-module/components/post-template/block-theme.js +44 -32
  662. package/build-module/components/post-template/block-theme.js.map +1 -1
  663. package/build-module/components/post-template/classic-theme.js +74 -50
  664. package/build-module/components/post-template/classic-theme.js.map +1 -1
  665. package/build-module/components/post-template/create-new-template-modal.js +34 -27
  666. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  667. package/build-module/components/post-template/create-new-template.js +16 -11
  668. package/build-module/components/post-template/create-new-template.js.map +1 -1
  669. package/build-module/components/post-template/panel.js +17 -9
  670. package/build-module/components/post-template/panel.js.map +1 -1
  671. package/build-module/components/post-template/reset-default-template.js +5 -4
  672. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  673. package/build-module/components/post-template/swap-template-button.js +22 -15
  674. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  675. package/build-module/components/post-text-editor/index.js +30 -19
  676. package/build-module/components/post-text-editor/index.js.map +1 -1
  677. package/build-module/components/post-title/index.js +29 -18
  678. package/build-module/components/post-title/index.js.map +1 -1
  679. package/build-module/components/post-title/index.native.js +81 -57
  680. package/build-module/components/post-title/index.native.js.map +1 -1
  681. package/build-module/components/post-title/post-title-raw.js +11 -2
  682. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  683. package/build-module/components/post-title/use-post-title-focus.js +8 -0
  684. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  685. package/build-module/components/post-title/use-post-title.js +6 -0
  686. package/build-module/components/post-title/use-post-title.js.map +1 -1
  687. package/build-module/components/post-transform-panel/index.js +12 -12
  688. package/build-module/components/post-transform-panel/index.js.map +1 -1
  689. package/build-module/components/post-trash/index.js +21 -15
  690. package/build-module/components/post-trash/index.js.map +1 -1
  691. package/build-module/components/post-url/check.js +9 -0
  692. package/build-module/components/post-url/check.js.map +1 -1
  693. package/build-module/components/post-url/index.js +100 -72
  694. package/build-module/components/post-url/index.js.map +1 -1
  695. package/build-module/components/post-url/label.js +12 -0
  696. package/build-module/components/post-url/label.js.map +1 -1
  697. package/build-module/components/post-url/panel.js +35 -24
  698. package/build-module/components/post-url/panel.js.map +1 -1
  699. package/build-module/components/post-view-link/index.js +2 -2
  700. package/build-module/components/post-view-link/index.js.map +1 -1
  701. package/build-module/components/post-visibility/check.js +10 -0
  702. package/build-module/components/post-visibility/check.js.map +1 -1
  703. package/build-module/components/post-visibility/index.js +85 -67
  704. package/build-module/components/post-visibility/index.js.map +1 -1
  705. package/build-module/components/post-visibility/label.js +12 -0
  706. package/build-module/components/post-visibility/label.js.map +1 -1
  707. package/build-module/components/posts-per-page/index.js +103 -0
  708. package/build-module/components/posts-per-page/index.js.map +1 -0
  709. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  710. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  711. package/build-module/components/preferences-modal/index.js +126 -102
  712. package/build-module/components/preferences-modal/index.js.map +1 -1
  713. package/build-module/components/preview-dropdown/index.js +49 -31
  714. package/build-module/components/preview-dropdown/index.js.map +1 -1
  715. package/build-module/components/provider/index.js +96 -20
  716. package/build-module/components/provider/index.js.map +1 -1
  717. package/build-module/components/provider/index.native.js +58 -20
  718. package/build-module/components/provider/index.native.js.map +1 -1
  719. package/build-module/components/provider/use-block-editor-settings.js +7 -6
  720. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  721. package/build-module/components/provider/with-registry-provider.js +33 -26
  722. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  723. package/build-module/components/resizable-editor/index.js +89 -0
  724. package/build-module/components/resizable-editor/index.js.map +1 -0
  725. package/build-module/components/resizable-editor/resize-handle.js +54 -0
  726. package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
  727. package/build-module/components/save-publish-panels/index.js +37 -26
  728. package/build-module/components/save-publish-panels/index.js.map +1 -1
  729. package/build-module/components/sidebar/header.js +18 -14
  730. package/build-module/components/sidebar/header.js.map +1 -1
  731. package/build-module/components/sidebar/index.js +36 -31
  732. package/build-module/components/sidebar/index.js.map +1 -1
  733. package/build-module/components/sidebar/post-summary.js +33 -25
  734. package/build-module/components/sidebar/post-summary.js.map +1 -1
  735. package/build-module/components/site-discussion/index.js +127 -0
  736. package/build-module/components/site-discussion/index.js.map +1 -0
  737. package/build-module/components/start-page-options/index.js +13 -11
  738. package/build-module/components/start-page-options/index.js.map +1 -1
  739. package/build-module/components/start-template-options/index.js +30 -23
  740. package/build-module/components/start-template-options/index.js.map +1 -1
  741. package/build-module/components/table-of-contents/index.js +4 -4
  742. package/build-module/components/table-of-contents/index.js.map +1 -1
  743. package/build-module/components/table-of-contents/panel.js +55 -35
  744. package/build-module/components/table-of-contents/panel.js.map +1 -1
  745. package/build-module/components/template-areas/index.js +37 -22
  746. package/build-module/components/template-areas/index.js.map +1 -1
  747. package/build-module/components/template-content-panel/index.js +7 -6
  748. package/build-module/components/template-content-panel/index.js.map +1 -1
  749. package/build-module/components/template-validation-notice/index.js +27 -21
  750. package/build-module/components/template-validation-notice/index.js.map +1 -1
  751. package/build-module/components/text-editor/index.js +66 -0
  752. package/build-module/components/text-editor/index.js.map +1 -0
  753. package/build-module/components/time-to-read/index.js +7 -6
  754. package/build-module/components/time-to-read/index.js.map +1 -1
  755. package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
  756. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  757. package/build-module/components/{editor-canvas → visual-editor}/index.js +118 -75
  758. package/build-module/components/visual-editor/index.js.map +1 -0
  759. package/build-module/components/word-count/index.js +5 -4
  760. package/build-module/components/word-count/index.js.map +1 -1
  761. package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
  762. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  763. package/build-module/hooks/index.js +1 -0
  764. package/build-module/hooks/index.js.map +1 -1
  765. package/build-module/hooks/media-upload.js +7 -0
  766. package/build-module/hooks/media-upload.js.map +1 -0
  767. package/build-module/hooks/pattern-overrides.js +17 -11
  768. package/build-module/hooks/pattern-overrides.js.map +1 -1
  769. package/build-module/private-apis.js +10 -28
  770. package/build-module/private-apis.js.map +1 -1
  771. package/build-module/private-apis.native.js +2 -26
  772. package/build-module/private-apis.native.js.map +1 -1
  773. package/build-module/store/constants.js +3 -0
  774. package/build-module/store/constants.js.map +1 -1
  775. package/build-module/store/private-actions.js +10 -14
  776. package/build-module/store/private-actions.js.map +1 -1
  777. package/build-module/store/private-selectors.js +38 -1
  778. package/build-module/store/private-selectors.js.map +1 -1
  779. package/build-module/store/selectors.js +1 -1
  780. package/build-module/store/selectors.js.map +1 -1
  781. package/build-module/utils/set-nested-value.js +38 -0
  782. package/build-module/utils/set-nested-value.js.map +1 -0
  783. package/build-style/style-rtl.css +318 -90
  784. package/build-style/style.css +318 -90
  785. package/package.json +40 -36
  786. package/src/bindings/index.js +1 -4
  787. package/src/bindings/pattern-overrides.js +1 -1
  788. package/src/bindings/post-meta.js +46 -6
  789. package/src/components/blog-title/index.js +124 -0
  790. package/src/components/blog-title/style.scss +4 -0
  791. package/src/components/commands/index.js +113 -3
  792. package/src/components/create-template-part-modal/index.js +205 -0
  793. package/src/components/create-template-part-modal/style.scss +69 -0
  794. package/src/components/create-template-part-modal/test/utils.js +60 -0
  795. package/src/components/create-template-part-modal/utils.js +67 -0
  796. package/src/components/document-bar/index.js +32 -21
  797. package/src/components/document-tools/index.js +2 -7
  798. package/src/components/editor-help/help-get-support-button.native.js +1 -1
  799. package/src/components/editor-interface/content-slot-fill.js +15 -0
  800. package/src/components/editor-interface/index.js +230 -0
  801. package/src/components/editor-notices/index.js +10 -0
  802. package/src/components/entities-saved-states/entity-record-item.js +45 -16
  803. package/src/components/entities-saved-states/style.scss +13 -0
  804. package/src/components/error-boundary/index.js +10 -0
  805. package/src/components/error-boundary/index.native.js +1 -1
  806. package/src/components/global-styles-provider/index.js +100 -8
  807. package/src/components/header/back-button.js +27 -0
  808. package/src/components/header/index.js +25 -10
  809. package/src/components/header/style.scss +5 -0
  810. package/src/components/inserter-sidebar/index.js +65 -32
  811. package/src/components/inserter-sidebar/style.scss +0 -13
  812. package/src/components/local-autosave-monitor/index.js +12 -0
  813. package/src/components/page-attributes/order.js +79 -3
  814. package/src/components/page-attributes/panel.js +10 -26
  815. package/src/components/page-attributes/parent.js +98 -2
  816. package/src/components/page-attributes/style.scss +19 -0
  817. package/src/components/pattern-duplicate-modal/index.js +50 -0
  818. package/src/components/pattern-rename-modal/index.js +44 -0
  819. package/src/components/post-actions/actions.js +306 -261
  820. package/src/components/post-actions/export-pattern-action.js +74 -0
  821. package/src/components/post-actions/export-pattern-action.native.js +4 -0
  822. package/src/components/post-actions/index.js +16 -5
  823. package/src/components/post-author/combobox.js +1 -0
  824. package/src/components/post-author/hook.js +1 -1
  825. package/src/components/post-author/panel.js +63 -2
  826. package/src/components/post-author/select.js +1 -0
  827. package/src/components/post-author/style.scss +6 -0
  828. package/src/components/post-card-panel/index.js +69 -22
  829. package/src/components/post-card-panel/style.scss +23 -1
  830. package/src/components/post-comments/index.js +5 -0
  831. package/src/components/post-discussion/panel.js +9 -2
  832. package/src/components/post-discussion/style.scss +1 -3
  833. package/src/components/post-excerpt/panel.js +45 -48
  834. package/src/components/post-excerpt/style.scss +0 -17
  835. package/src/components/post-featured-image/check.js +9 -0
  836. package/src/components/post-featured-image/index.js +15 -0
  837. package/src/components/post-featured-image/panel.js +9 -0
  838. package/src/components/post-format/check.js +8 -0
  839. package/src/components/post-format/index.js +15 -4
  840. package/src/components/post-format/panel.js +71 -6
  841. package/src/components/post-format/style.scss +10 -4
  842. package/src/components/post-last-revision/check.js +8 -0
  843. package/src/components/post-last-revision/index.js +7 -2
  844. package/src/components/post-last-revision/panel.js +5 -0
  845. package/src/components/post-locked-modal/index.js +6 -0
  846. package/src/components/post-panel-row/style.scss +15 -0
  847. package/src/components/post-pending-status/check.js +10 -0
  848. package/src/components/post-pending-status/index.js +5 -0
  849. package/src/components/post-pingbacks/index.js +6 -0
  850. package/src/components/post-preview-button/index.js +15 -0
  851. package/src/components/post-publish-button/index.js +17 -4
  852. package/src/components/post-publish-panel/index.js +1 -0
  853. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  854. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
  855. package/src/components/post-schedule/check.js +8 -0
  856. package/src/components/post-schedule/index.js +30 -3
  857. package/src/components/post-schedule/label.js +15 -0
  858. package/src/components/post-schedule/panel.js +9 -1
  859. package/src/components/post-schedule/style.scss +0 -11
  860. package/src/components/post-status/index.js +30 -52
  861. package/src/components/post-status/style.scss +4 -34
  862. package/src/components/post-sticky/index.js +12 -7
  863. package/src/components/post-sticky/style.scss +3 -0
  864. package/src/components/post-template/block-theme.js +1 -0
  865. package/src/components/post-template/classic-theme.js +15 -0
  866. package/src/components/post-template/panel.js +5 -0
  867. package/src/components/post-template/style.scss +0 -8
  868. package/src/components/post-text-editor/index.js +5 -0
  869. package/src/components/post-title/index.js +8 -1
  870. package/src/components/post-title/index.native.js +70 -35
  871. package/src/components/post-title/post-title-raw.js +8 -0
  872. package/src/components/post-title/use-post-title-focus.js +7 -0
  873. package/src/components/post-title/use-post-title.js +5 -0
  874. package/src/components/post-transform-panel/index.js +2 -10
  875. package/src/components/post-url/check.js +8 -0
  876. package/src/components/post-url/index.js +41 -24
  877. package/src/components/post-url/label.js +10 -0
  878. package/src/components/post-url/panel.js +6 -1
  879. package/src/components/post-url/style.scss +0 -9
  880. package/src/components/post-visibility/check.js +9 -0
  881. package/src/components/post-visibility/index.js +7 -0
  882. package/src/components/post-visibility/label.js +10 -0
  883. package/src/components/posts-per-page/index.js +101 -0
  884. package/src/components/posts-per-page/style.scss +4 -0
  885. package/src/components/provider/index.js +68 -0
  886. package/src/components/provider/index.native.js +43 -2
  887. package/src/components/provider/use-block-editor-settings.js +4 -6
  888. package/src/components/provider/with-registry-provider.js +32 -31
  889. package/src/components/resizable-editor/index.js +90 -0
  890. package/src/components/resizable-editor/resize-handle.js +62 -0
  891. package/src/components/resizable-editor/style.scss +53 -0
  892. package/src/components/save-publish-panels/index.js +10 -2
  893. package/src/components/sidebar/index.js +0 -4
  894. package/src/components/sidebar/post-summary.js +14 -21
  895. package/src/components/sidebar/style.scss +1 -1
  896. package/src/components/site-discussion/index.js +138 -0
  897. package/src/components/site-discussion/style.scss +19 -0
  898. package/src/components/start-template-options/style.scss +0 -8
  899. package/src/components/template-areas/index.js +15 -6
  900. package/src/components/text-editor/index.js +57 -0
  901. package/src/components/text-editor/style.scss +71 -0
  902. package/src/components/{editor-canvas → visual-editor}/index.js +177 -108
  903. package/src/components/visual-editor/style.scss +37 -0
  904. package/src/hooks/index.js +1 -0
  905. package/src/hooks/media-upload.js +11 -0
  906. package/src/private-apis.js +10 -28
  907. package/src/private-apis.native.js +2 -26
  908. package/src/store/constants.js +7 -0
  909. package/src/store/private-actions.js +22 -50
  910. package/src/store/private-selectors.js +45 -0
  911. package/src/store/selectors.js +1 -1
  912. package/src/style.scss +9 -0
  913. package/src/utils/set-nested-value.js +39 -0
  914. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  915. package/build/components/editor-canvas/index.js.map +0 -1
  916. package/build/components/post-trash/panel.js +0 -18
  917. package/build/components/post-trash/panel.js.map +0 -1
  918. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  919. package/build-module/components/editor-canvas/index.js.map +0 -1
  920. package/build-module/components/post-trash/panel.js +0 -10
  921. package/build-module/components/post-trash/panel.js.map +0 -1
  922. package/src/components/post-trash/panel.js +0 -13
  923. package/src/components/provider/README.md +0 -37
  924. /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * This component checks the publishing status of the current post.\n * If the post is already published or the user doesn't have the\n * capability to publish, it returns null.\n *\n * @param {Object} props Component properties.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.\n */\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -11,6 +10,13 @@ import { useDispatch, useSelect } from '@wordpress/data';
11
10
  */
12
11
  import PostPendingStatusCheck from './check';
13
12
  import { store as editorStore } from '../../store';
13
+
14
+ /**
15
+ * A component for displaying and toggling the pending status of a post.
16
+ *
17
+ * @return {JSX.Element} The rendered component.
18
+ */
19
+ import { jsx as _jsx } from "react/jsx-runtime";
14
20
  export function PostPendingStatus() {
15
21
  const status = useSelect(select => select(editorStore).getEditedPostAttribute('status'), []);
16
22
  const {
@@ -22,12 +28,14 @@ export function PostPendingStatus() {
22
28
  status: updatedStatus
23
29
  });
24
30
  };
25
- return createElement(PostPendingStatusCheck, null, createElement(CheckboxControl, {
26
- __nextHasNoMarginBottom: true,
27
- label: __('Pending review'),
28
- checked: status === 'pending',
29
- onChange: togglePendingStatus
30
- }));
31
+ return /*#__PURE__*/_jsx(PostPendingStatusCheck, {
32
+ children: /*#__PURE__*/_jsx(CheckboxControl, {
33
+ __nextHasNoMarginBottom: true,
34
+ label: __('Pending review'),
35
+ checked: status === 'pending',
36
+ onChange: togglePendingStatus
37
+ })
38
+ });
31
39
  }
32
40
  export default PostPendingStatus;
33
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","PostPendingStatusCheck","store","editorStore","PostPendingStatus","status","select","getEditedPostAttribute","editPost","togglePendingStatus","updatedStatus","createElement","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGL,SAAS,CACrBM,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGT,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAMM,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGL,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEG,QAAQ,CAAE;MAAEH,MAAM,EAAEK;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,OACCC,aAAA,CAACV,sBAAsB,QACtBU,aAAA,CAACb,eAAe;IACfc,uBAAuB;IACvBC,KAAK,EAAGhB,EAAE,CAAE,gBAAiB,CAAG;IAChCiB,OAAO,EAAGT,MAAM,KAAK,SAAW;IAChCU,QAAQ,EAAGN;EAAqB,CAChC,CACsB,CAAC;AAE3B;AAEA,eAAeL,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","PostPendingStatusCheck","store","editorStore","jsx","_jsx","PostPendingStatus","status","select","getEditedPostAttribute","editPost","togglePendingStatus","updatedStatus","children","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\n/**\n * A component for displaying and toggling the pending status of a post.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGP,SAAS,CACrBQ,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGX,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAMQ,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGL,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEG,QAAQ,CAAE;MAAEH,MAAM,EAAEK;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,oBACCP,IAAA,CAACJ,sBAAsB;IAAAY,QAAA,eACtBR,IAAA,CAACP,eAAe;MACfgB,uBAAuB;MACvBC,KAAK,EAAGlB,EAAE,CAAE,gBAAiB,CAAG;MAChCmB,OAAO,EAAGT,MAAM,KAAK,SAAW;MAChCU,QAAQ,EAAGN;IAAqB,CAChC;EAAC,CACqB,CAAC;AAE3B;AAEA,eAAeL,iBAAiB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -10,6 +9,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
10
9
  * Internal dependencies
11
10
  */
12
11
  import { store as editorStore } from '../../store';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  function PostPingbacks() {
14
14
  const pingStatus = useSelect(select => {
15
15
  var _select$getEditedPost;
@@ -21,15 +21,23 @@ function PostPingbacks() {
21
21
  const onTogglePingback = () => editPost({
22
22
  ping_status: pingStatus === 'open' ? 'closed' : 'open'
23
23
  });
24
- return createElement(CheckboxControl, {
24
+ return /*#__PURE__*/_jsx(CheckboxControl, {
25
25
  __nextHasNoMarginBottom: true,
26
26
  label: __('Enable pingbacks & trackbacks'),
27
27
  checked: pingStatus === 'open',
28
28
  onChange: onTogglePingback,
29
- help: createElement(ExternalLink, {
30
- href: __('https://wordpress.org/documentation/article/trackbacks-and-pingbacks/')
31
- }, __('Learn more about pingbacks & trackbacks'))
29
+ help: /*#__PURE__*/_jsx(ExternalLink, {
30
+ href: __('https://wordpress.org/documentation/article/trackbacks-and-pingbacks/'),
31
+ children: __('Learn more about pingbacks & trackbacks')
32
+ })
32
33
  });
33
34
  }
35
+
36
+ /**
37
+ * Renders a control for enabling or disabling pingbacks and trackbacks
38
+ * in a WordPress post.
39
+ *
40
+ * @module PostPingbacks
41
+ */
34
42
  export default PostPingbacks;
35
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","CheckboxControl","ExternalLink","useDispatch","useSelect","store","editorStore","PostPingbacks","pingStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","onTogglePingback","ping_status","createElement","__nextHasNoMarginBottom","label","checked","onChange","help","href"],"sources":["@wordpress/editor/src/components/post-pingbacks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl, ExternalLink } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostPingbacks() {\n\tconst pingStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'ping_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onTogglePingback = () =>\n\t\teditPost( {\n\t\t\tping_status: pingStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Enable pingbacks & trackbacks' ) }\n\t\t\tchecked={ pingStatus === 'open' }\n\t\t\tonChange={ onTogglePingback }\n\t\t\thelp={\n\t\t\t\t<ExternalLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/trackbacks-and-pingbacks/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Learn more about pingbacks & trackbacks' ) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default PostPingbacks;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,YAAY,QAAQ,uBAAuB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,aAAaA,CAAA,EAAG;EACxB,MAAMC,UAAU,GAAGJ,SAAS,CACzBK,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEH,WAAY,CAAC,CAACK,sBAAsB,CAAE,aAAc,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAC7D,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGT,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMO,gBAAgB,GAAGA,CAAA,KACxBD,QAAQ,CAAE;IACTE,WAAW,EAAEN,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG;EACjD,CAAE,CAAC;EAEJ,OACCO,aAAA,CAACd,eAAe;IACfe,uBAAuB;IACvBC,KAAK,EAAGjB,EAAE,CAAE,+BAAgC,CAAG;IAC/CkB,OAAO,EAAGV,UAAU,KAAK,MAAQ;IACjCW,QAAQ,EAAGN,gBAAkB;IAC7BO,IAAI,EACHL,aAAA,CAACb,YAAY;MACZmB,IAAI,EAAGrB,EAAE,CACR,uEACD;IAAG,GAEDA,EAAE,CAAE,yCAA0C,CACnC;EACd,CACD,CAAC;AAEJ;AAEA,eAAeO,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["__","CheckboxControl","ExternalLink","useDispatch","useSelect","store","editorStore","jsx","_jsx","PostPingbacks","pingStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","onTogglePingback","ping_status","__nextHasNoMarginBottom","label","checked","onChange","help","href","children"],"sources":["@wordpress/editor/src/components/post-pingbacks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl, ExternalLink } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostPingbacks() {\n\tconst pingStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'ping_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onTogglePingback = () =>\n\t\teditPost( {\n\t\t\tping_status: pingStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Enable pingbacks & trackbacks' ) }\n\t\t\tchecked={ pingStatus === 'open' }\n\t\t\tonChange={ onTogglePingback }\n\t\t\thelp={\n\t\t\t\t<ExternalLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/trackbacks-and-pingbacks/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Learn more about pingbacks & trackbacks' ) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t/>\n\t);\n}\n\n/**\n * Renders a control for enabling or disabling pingbacks and trackbacks\n * in a WordPress post.\n *\n * @module PostPingbacks\n */\nexport default PostPingbacks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,YAAY,QAAQ,uBAAuB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,aAAaA,CAAA,EAAG;EACxB,MAAMC,UAAU,GAAGN,SAAS,CACzBO,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEL,WAAY,CAAC,CAACO,sBAAsB,CAAE,aAAc,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAC7D,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGX,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMS,gBAAgB,GAAGA,CAAA,KACxBD,QAAQ,CAAE;IACTE,WAAW,EAAEN,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG;EACjD,CAAE,CAAC;EAEJ,oBACCF,IAAA,CAACP,eAAe;IACfgB,uBAAuB;IACvBC,KAAK,EAAGlB,EAAE,CAAE,+BAAgC,CAAG;IAC/CmB,OAAO,EAAGT,UAAU,KAAK,MAAQ;IACjCU,QAAQ,EAAGL,gBAAkB;IAC7BM,IAAI,eACHb,IAAA,CAACN,YAAY;MACZoB,IAAI,EAAGtB,EAAE,CACR,uEACD,CAAG;MAAAuB,QAAA,EAEDvB,EAAE,CAAE,yCAA0C;IAAC,CACpC;EACd,CACD,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeS,aAAa","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -13,21 +12,28 @@ import { store as coreStore } from '@wordpress/core-data';
13
12
  * Internal dependencies
14
13
  */
15
14
  import { store as editorStore } from '../../store';
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
16
18
  function writeInterstitialMessage(targetDocument) {
17
- let markup = renderToString(createElement("div", {
18
- className: "editor-post-preview-button__interstitial-message"
19
- }, createElement(SVG, {
20
- xmlns: "http://www.w3.org/2000/svg",
21
- viewBox: "0 0 96 96"
22
- }, createElement(Path, {
23
- className: "outer",
24
- d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
25
- fill: "none"
26
- }), createElement(Path, {
27
- className: "inner",
28
- d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",
29
- fill: "none"
30
- })), createElement("p", null, __('Generating preview…'))));
19
+ let markup = renderToString( /*#__PURE__*/_jsxs("div", {
20
+ className: "editor-post-preview-button__interstitial-message",
21
+ children: [/*#__PURE__*/_jsxs(SVG, {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ viewBox: "0 0 96 96",
24
+ children: [/*#__PURE__*/_jsx(Path, {
25
+ className: "outer",
26
+ d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
27
+ fill: "none"
28
+ }), /*#__PURE__*/_jsx(Path, {
29
+ className: "inner",
30
+ d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",
31
+ fill: "none"
32
+ })]
33
+ }), /*#__PURE__*/_jsx("p", {
34
+ children: __('Generating preview…')
35
+ })]
36
+ }));
31
37
  markup += `
32
38
  <style>
33
39
  body {
@@ -93,6 +99,22 @@ function writeInterstitialMessage(targetDocument) {
93
99
  targetDocument.title = __('Generating preview…');
94
100
  targetDocument.close();
95
101
  }
102
+
103
+ /**
104
+ * Renders a button that opens a new window or tab for the preview,
105
+ * writes the interstitial message to this window, and then navigates
106
+ * to the actual preview link. The button is not rendered if the post
107
+ * is not viewable and disabled if the post is not saveable.
108
+ *
109
+ * @param {Object} props The component props.
110
+ * @param {string} props.className The class name for the button.
111
+ * @param {string} props.textContent The text content for the button.
112
+ * @param {boolean} props.forceIsAutosaveable Whether to force autosave.
113
+ * @param {string} props.role The role attribute for the button.
114
+ * @param {Function} props.onPreview The callback function for preview event.
115
+ *
116
+ * @return {JSX.Element|null} The rendered button component.
117
+ */
96
118
  export default function PostPreviewButton({
97
119
  className,
98
120
  textContent,
@@ -153,7 +175,7 @@ export default function PostPreviewButton({
153
175
  // changes that were autosaved since the post was last published. Otherwise,
154
176
  // just link to the post's URL.
155
177
  const href = previewLink || currentPostLink;
156
- return createElement(Button, {
178
+ return /*#__PURE__*/_jsx(Button, {
157
179
  variant: !className ? 'tertiary' : undefined,
158
180
  className: className || 'editor-post-preview',
159
181
  href: href,
@@ -161,10 +183,14 @@ export default function PostPreviewButton({
161
183
  disabled: !isSaveable,
162
184
  onClick: openPreviewWindow,
163
185
  role: role,
164
- size: "compact"
165
- }, textContent || createElement(Fragment, null, _x('Preview', 'imperative verb'), createElement(VisuallyHidden, {
166
- as: "span"
167
- }, /* translators: accessibility text */
168
- __('(opens in a new tab)'))));
186
+ size: "compact",
187
+ children: textContent || /*#__PURE__*/_jsxs(_Fragment, {
188
+ children: [_x('Preview', 'imperative verb'), /*#__PURE__*/_jsx(VisuallyHidden, {
189
+ as: "span",
190
+ children: /* translators: accessibility text */
191
+ __('(opens in a new tab)')
192
+ })]
193
+ })
194
+ });
169
195
  }
170
196
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["renderToString","Button","Path","SVG","VisuallyHidden","__","_x","useSelect","useDispatch","applyFilters","store","coreStore","editorStore","writeInterstitialMessage","targetDocument","markup","createElement","className","xmlns","viewBox","d","fill","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","_postType$viewable","editor","core","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","variant","undefined","target","disabled","onClick","size","Fragment","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,cAAc,QAAQ,uBAAuB;AACzE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAElD,SAASC,wBAAwBA,CAAEC,cAAc,EAAG;EACnD,IAAIC,MAAM,GAAGf,cAAc,CAC1BgB,aAAA;IAAKC,SAAS,EAAC;EAAkD,GAChED,aAAA,CAACb,GAAG;IAACe,KAAK,EAAC,4BAA4B;IAACC,OAAO,EAAC;EAAW,GAC1DH,aAAA,CAACd,IAAI;IACJe,SAAS,EAAC,OAAO;IACjBG,CAAC,EAAC,uEAAuE;IACzEC,IAAI,EAAC;EAAM,CACX,CAAC,EACFL,aAAA,CAACd,IAAI;IACJe,SAAS,EAAC,OAAO;IACjBG,CAAC,EAAC,0nBAA0nB;IAC5nBC,IAAI,EAAC;EAAM,CACX,CACG,CAAC,EACNL,aAAA,YAAKX,EAAE,CAAE,qBAAsB,CAAM,CACjC,CACN,CAAC;EAEDU,MAAM,IAAK;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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vC,WAAW,CAAEI,WAAY,CAAC;EAE/D,IAAK,CAAEsB,UAAU,EAAG;IACnB,OAAO,IAAI;EACZ;EAEA,MAAMc,QAAQ,GAAI,cAAclB,MAAQ,EAAC;EAEzC,MAAMmB,iBAAiB,GAAG,MAAQC,KAAK,IAAM;IAC5C;IACA;IACA;IACA;IACA;IACAA,KAAK,CAACC,cAAc,CAAC,CAAC;;IAEtB;IACA,MAAMC,aAAa,GAAGC,MAAM,CAACC,IAAI,CAAE,EAAE,EAAEN,QAAS,CAAC;;IAEjD;IACA;IACA;IACAI,aAAa,CAACG,KAAK,CAAC,CAAC;IAErB1C,wBAAwB,CAAEuC,aAAa,CAACI,QAAS,CAAC;IAElD,MAAMC,IAAI,GAAG,MAAMV,wBAAwB,CAAE;MAAEpB;IAAoB,CAAE,CAAC;IAEtEyB,aAAa,CAACM,QAAQ,GAAGD,IAAI;IAE7B5B,SAAS,GAAG,CAAC;EACd,CAAC;;EAED;EACA;EACA;EACA,MAAM8B,IAAI,GAAG3B,WAAW,IAAID,eAAe;EAE3C,OACCf,aAAA,CAACf,MAAM;IACN2D,OAAO,EAAG,CAAE3C,SAAS,GAAG,UAAU,GAAG4C,SAAW;IAChD5C,SAAS,EAAGA,SAAS,IAAI,qBAAuB;IAChD0C,IAAI,EAAGA,IAAM;IACbG,MAAM,EAAGd,QAAU;IACnBe,QAAQ,EAAG,CAAE9B,UAAY;IACzB+B,OAAO,EAAGf,iBAAmB;IAC7BrB,IAAI,EAAGA,IAAM;IACbqC,IAAI,EAAC;EAAS,GAEZvC,WAAW,IACZV,aAAA,CAAAkD,QAAA,QACG5D,EAAE,CAAE,SAAS,EAAE,iBAAkB,CAAC,EACpCU,aAAA,CAACZ,cAAc;IAAC+D,EAAE,EAAC;EAAM,GAEvB;EACA9D,EAAE,CAAE,sBAAuB,CAEb,CACf,CAEI,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["renderToString","Button","Path","SVG","VisuallyHidden","__","_x","useSelect","useDispatch","applyFilters","store","coreStore","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","writeInterstitialMessage","targetDocument","markup","className","children","xmlns","viewBox","d","fill","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","_postType$viewable","editor","core","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","variant","undefined","target","disabled","onClick","size","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\n/**\n * Renders a button that opens a new window or tab for the preview,\n * writes the interstitial message to this window, and then navigates\n * to the actual preview link. The button is not rendered if the post\n * is not viewable and disabled if the post is not saveable.\n *\n * @param {Object} props The component props.\n * @param {string} props.className The class name for the button.\n * @param {string} props.textContent The text content for the button.\n * @param {boolean} props.forceIsAutosaveable Whether to force autosave.\n * @param {string} props.role The role attribute for the button.\n * @param {Function} props.onPreview The callback function for preview event.\n *\n * @return {JSX.Element|null} The rendered button component.\n */\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,cAAc,QAAQ,uBAAuB;AACzE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEnD,SAASC,wBAAwBA,CAAEC,cAAc,EAAG;EACnD,IAAIC,MAAM,GAAGrB,cAAc,eAC1BgB,KAAA;IAAKM,SAAS,EAAC,kDAAkD;IAAAC,QAAA,gBAChEP,KAAA,CAACb,GAAG;MAACqB,KAAK,EAAC,4BAA4B;MAACC,OAAO,EAAC,WAAW;MAAAF,QAAA,gBAC1DT,IAAA,CAACZ,IAAI;QACJoB,SAAS,EAAC,OAAO;QACjBI,CAAC,EAAC,uEAAuE;QACzEC,IAAI,EAAC;MAAM,CACX,CAAC,eACFb,IAAA,CAACZ,IAAI;QACJoB,SAAS,EAAC,OAAO;QACjBI,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AAQ,EAAG,CAAE9B,UAAY;IACzB+B,OAAO,EAAGf,iBAAmB;IAC7BrB,IAAI,EAAGA,IAAM;IACbqC,IAAI,EAAC,SAAS;IAAAhD,QAAA,EAEZS,WAAW,iBACZhB,KAAA,CAAAE,SAAA;MAAAK,QAAA,GACGjB,EAAE,CAAE,SAAS,EAAE,iBAAkB,CAAC,eACpCQ,IAAA,CAACV,cAAc;QAACoE,EAAE,EAAC,MAAM;QAAAjD,QAAA,EAEvB;QACAlB,EAAE,CAAE,sBAAuB;MAAC,CAEd,CAAC;IAAA,CAChB;EACF,CACM,CAAC;AAEX","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -12,6 +11,9 @@ import { compose } from '@wordpress/compose';
12
11
  */
13
12
  import PublishButtonLabel from './label';
14
13
  import { store as editorStore } from '../../store';
14
+ import { unlock } from '../../lock-unlock';
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
17
  const noop = () => {};
16
18
  export class PostPublishButton extends Component {
17
19
  constructor(props) {
@@ -40,14 +42,18 @@ export class PostPublishButton extends Component {
40
42
  return (...args) => {
41
43
  const {
42
44
  hasNonPostEntityChanges,
43
- setEntitiesSavedStatesCallback
45
+ hasPostMetaChanges,
46
+ setEntitiesSavedStatesCallback,
47
+ isPublished
44
48
  } = this.props;
45
49
  // If a post with non-post entities is published, but the user
46
50
  // elects to not save changes to the non-post entities, those
47
51
  // entities will still be dirty when the Publish button is clicked.
48
52
  // We also need to check that the `setEntitiesSavedStatesCallback`
49
53
  // prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
50
- if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
54
+ //
55
+ // TODO: Explore how to manage `hasPostMetaChanges` and pre-publish workflow properly.
56
+ if ((hasNonPostEntityChanges || hasPostMetaChanges && isPublished) && setEntitiesSavedStatesCallback) {
51
57
  // The modal for multiple entity saving will open,
52
58
  // hold the callback for saving/publishing the post
53
59
  // so that we can call it if the post entity is checked.
@@ -153,12 +159,15 @@ export class PostPublishButton extends Component {
153
159
  onClick: this.createOnClick(onClickToggle)
154
160
  };
155
161
  const componentProps = isToggle ? toggleProps : buttonProps;
156
- return createElement(Fragment, null, createElement(Button, {
157
- ref: this.buttonNode,
158
- ...componentProps,
159
- className: `${componentProps.className} editor-post-publish-button__button`,
160
- size: "compact"
161
- }, createElement(PublishButtonLabel, null)));
162
+ return /*#__PURE__*/_jsx(_Fragment, {
163
+ children: /*#__PURE__*/_jsx(Button, {
164
+ ref: this.buttonNode,
165
+ ...componentProps,
166
+ className: `${componentProps.className} editor-post-publish-button__button`,
167
+ size: "compact",
168
+ children: /*#__PURE__*/_jsx(PublishButtonLabel, {})
169
+ })
170
+ });
162
171
  }
163
172
  }
164
173
  export default compose([withSelect(select => {
@@ -178,8 +187,9 @@ export default compose([withSelect(select => {
178
187
  hasNonPostEntityChanges,
179
188
  isSavingNonPostEntityChanges,
180
189
  getEditedPostAttribute,
181
- getPostEdits
182
- } = select(editorStore);
190
+ getPostEdits,
191
+ hasPostMetaChanges
192
+ } = unlock(select(editorStore));
183
193
  return {
184
194
  isSaving: isSavingPost(),
185
195
  isAutoSaving: isAutosavingPost(),
@@ -195,6 +205,7 @@ export default compose([withSelect(select => {
195
205
  postStatus: getEditedPostAttribute('status'),
196
206
  postStatusHasChanged: getPostEdits()?.status,
197
207
  hasNonPostEntityChanges: hasNonPostEntityChanges(),
208
+ hasPostMetaChanges: hasPostMetaChanges(),
198
209
  isSavingNonPostEntityChanges: isSavingNonPostEntityChanges()
199
210
  };
200
211
  }), withDispatch(dispatch => {
@@ -1 +1 @@
1
- {"version":3,"names":["Button","Component","createRef","withSelect","withDispatch","compose","PublishButtonLabel","store","editorStore","noop","PostPublishButton","constructor","props","buttonNode","createOnClick","bind","closeEntitiesSavedStates","state","entitiesSavedStatesCallback","componentDidMount","focusOnMount","timeoutID","setTimeout","current","focus","componentWillUnmount","clearTimeout","callback","args","hasNonPostEntityChanges","setEntitiesSavedStatesCallback","setState","savedEntities","postType","postId","some","elt","kind","name","key","render","forceIsDirty","hasPublishAction","isBeingScheduled","isOpen","isPostSavingLocked","isPublishable","isPublished","isSaveable","isSaving","isAutoSaving","isToggle","savePostStatus","onSubmit","onToggle","visibility","isSavingNonPostEntityChanges","postStatus","postStatusHasChanged","isButtonDisabled","isToggleDisabled","publishStatus","onClickButton","onClickToggle","buttonProps","className","isBusy","variant","onClick","toggleProps","size","componentProps","createElement","Fragment","ref","select","_getCurrentPost$_link","isSavingPost","isAutosavingPost","isEditedPostBeingScheduled","getEditedPostVisibility","isCurrentPostPublished","isEditedPostSaveable","isEditedPostPublishable","getCurrentPost","getCurrentPostType","getCurrentPostId","getEditedPostAttribute","getPostEdits","_links","status","dispatch","editPost","savePost","undoIgnore"],"sources":["@wordpress/editor/src/components/post-publish-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\nexport class PostPublishButton extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.buttonNode = createRef();\n\n\t\tthis.createOnClick = this.createOnClick.bind( this );\n\t\tthis.closeEntitiesSavedStates =\n\t\t\tthis.closeEntitiesSavedStates.bind( this );\n\n\t\tthis.state = {\n\t\t\tentitiesSavedStatesCallback: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t\t// PostPublishPanel) otherwise it will get this button.\n\t\t\tthis.timeoutID = setTimeout( () => {\n\t\t\t\tthis.buttonNode.current.focus();\n\t\t\t}, 0 );\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcreateOnClick( callback ) {\n\t\treturn ( ...args ) => {\n\t\t\tconst { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =\n\t\t\t\tthis.props;\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\tif ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {\n\t\t\t\t// The modal for multiple entity saving will open,\n\t\t\t\t// hold the callback for saving/publishing the post\n\t\t\t\t// so that we can call it if the post entity is checked.\n\t\t\t\tthis.setState( {\n\t\t\t\t\tentitiesSavedStatesCallback: () => callback( ...args ),\n\t\t\t\t} );\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback(\n\t\t\t\t\t() => this.closeEntitiesSavedStates\n\t\t\t\t);\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\t}\n\n\tcloseEntitiesSavedStates( savedEntities ) {\n\t\tconst { postType, postId } = this.props;\n\t\tconst { entitiesSavedStatesCallback } = this.state;\n\t\tthis.setState( { entitiesSavedStatesCallback: false }, () => {\n\t\t\tif (\n\t\t\t\tsavedEntities &&\n\t\t\t\tsavedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\telt.key === postId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// The post entity was checked, call the held callback from `createOnClick`.\n\t\t\t\tentitiesSavedStatesCallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\thasPublishAction,\n\t\t\tisBeingScheduled,\n\t\t\tisOpen,\n\t\t\tisPostSavingLocked,\n\t\t\tisPublishable,\n\t\t\tisPublished,\n\t\t\tisSaveable,\n\t\t\tisSaving,\n\t\t\tisAutoSaving,\n\t\t\tisToggle,\n\t\t\tsavePostStatus,\n\t\t\tonSubmit = noop,\n\t\t\tonToggle,\n\t\t\tvisibility,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tpostStatus,\n\t\t\tpostStatusHasChanged,\n\t\t} = this.props;\n\n\t\tconst isButtonDisabled =\n\t\t\t( isSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\tisPostSavingLocked ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tconst isToggleDisabled =\n\t\t\t( isPublished ||\n\t\t\t\tisSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\t// If the new status has not changed explicitely, we derive it from\n\t\t// other factors, like having a publish action, etc.. We need to preserve\n\t\t// this because it affects when to show the pre and post publish panels.\n\t\t// If it has changed though explicitely, we need to respect that.\n\t\tlet publishStatus = 'publish';\n\t\tif ( postStatusHasChanged ) {\n\t\t\tpublishStatus = postStatus;\n\t\t} else if ( ! hasPublishAction ) {\n\t\t\tpublishStatus = 'pending';\n\t\t} else if ( visibility === 'private' ) {\n\t\t\tpublishStatus = 'private';\n\t\t} else if ( isBeingScheduled ) {\n\t\t\tpublishStatus = 'future';\n\t\t}\n\n\t\tconst onClickButton = () => {\n\t\t\tif ( isButtonDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSubmit();\n\t\t\tsavePostStatus( publishStatus );\n\t\t};\n\n\t\t// Callback to open the publish panel.\n\t\tconst onClickToggle = () => {\n\t\t\tif ( isToggleDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonToggle();\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t'aria-disabled': isButtonDisabled,\n\t\t\tclassName: 'editor-post-publish-button',\n\t\t\tisBusy: ! isAutoSaving && isSaving,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickButton ),\n\t\t};\n\n\t\tconst toggleProps = {\n\t\t\t'aria-disabled': isToggleDisabled,\n\t\t\t'aria-expanded': isOpen,\n\t\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\t\tisBusy: isSaving && isPublished,\n\t\t\tvariant: 'primary',\n\t\t\tsize: 'compact',\n\t\t\tonClick: this.createOnClick( onClickToggle ),\n\t\t};\n\t\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ this.buttonNode }\n\t\t\t\t\t{ ...componentProps }\n\t\t\t\t\tclassName={ `${ componentProps.className } editor-post-publish-button__button` }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<PublishButtonLabel />\n\t\t\t\t</Button>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisAutosavingPost,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tgetEditedPostVisibility,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostSaveable,\n\t\t\tisEditedPostPublishable,\n\t\t\tisPostSavingLocked,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetPostEdits,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisAutoSaving: isAutosavingPost(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: isPostSavingLocked(),\n\t\t\tisPublishable: isEditedPostPublishable(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: getPostEdits()?.status,\n\t\t\thasNonPostEntityChanges: hasNonPostEntityChanges(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tsavePostStatus: ( status ) => {\n\t\t\t\teditPost( { status }, { undoIgnore: true } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostPublishButton );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,SAAS;AACxC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,MAAMC,iBAAiB,SAAST,SAAS,CAAC;EAChDU,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IA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ACtD,OAAO;IACN4C,cAAc,EAAIsC,MAAM,IAAM;MAC7BE,QAAQ,CAAE;QAAEF;MAAO,CAAC,EAAE;QAAEI,UAAU,EAAE;MAAK,CAAE,CAAC;MAC5CD,QAAQ,CAAC,CAAC;IACX;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEnF,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Button","Component","createRef","withSelect","withDispatch","compose","PublishButtonLabel","store","editorStore","unlock","jsx","_jsx","Fragment","_Fragment","noop","PostPublishButton","constructor","props","buttonNode","createOnClick","bind","closeEntitiesSavedStates","state","entitiesSavedStatesCallback","componentDidMount","focusOnMount","timeoutID","setTimeout","current","focus","componentWillUnmount","clearTimeout","callback","args","hasNonPostEntityChanges","hasPostMetaChanges","setEntitiesSavedStatesCallback","isPublished","setState","savedEntities","postType","postId","some","elt","kind","name","key","render","forceIsDirty","hasPublishAction","isBeingScheduled","isOpen","isPostSavingLocked","isPublishable","isSaveable","isSaving","isAutoSaving","isToggle","savePostStatus","onSubmit","onToggle","visibility","isSavingNonPostEntityChanges","postStatus","postStatusHasChanged","isButtonDisabled","isToggleDisabled","publishStatus","onClickButton","onClickToggle","buttonProps","className","isBusy","variant","onClick","toggleProps","size","componentProps","children","ref","select","_getCurrentPost$_link","isSavingPost","isAutosavingPost","isEditedPostBeingScheduled","getEditedPostVisibility","isCurrentPostPublished","isEditedPostSaveable","isEditedPostPublishable","getCurrentPost","getCurrentPostType","getCurrentPostId","getEditedPostAttribute","getPostEdits","_links","status","dispatch","editPost","savePost","undoIgnore"],"sources":["@wordpress/editor/src/components/post-publish-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst noop = () => {};\n\nexport class PostPublishButton extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.buttonNode = createRef();\n\n\t\tthis.createOnClick = this.createOnClick.bind( this );\n\t\tthis.closeEntitiesSavedStates =\n\t\t\tthis.closeEntitiesSavedStates.bind( this );\n\n\t\tthis.state = {\n\t\t\tentitiesSavedStatesCallback: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t\t// PostPublishPanel) otherwise it will get this button.\n\t\t\tthis.timeoutID = setTimeout( () => {\n\t\t\t\tthis.buttonNode.current.focus();\n\t\t\t}, 0 );\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcreateOnClick( callback ) {\n\t\treturn ( ...args ) => {\n\t\t\tconst {\n\t\t\t\thasNonPostEntityChanges,\n\t\t\t\thasPostMetaChanges,\n\t\t\t\tsetEntitiesSavedStatesCallback,\n\t\t\t\tisPublished,\n\t\t\t} = this.props;\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\t//\n\t\t\t// TODO: Explore how to manage `hasPostMetaChanges` and pre-publish workflow properly.\n\t\t\tif (\n\t\t\t\t( hasNonPostEntityChanges ||\n\t\t\t\t\t( hasPostMetaChanges && isPublished ) ) &&\n\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t) {\n\t\t\t\t// The modal for multiple entity saving will open,\n\t\t\t\t// hold the callback for saving/publishing the post\n\t\t\t\t// so that we can call it if the post entity is checked.\n\t\t\t\tthis.setState( {\n\t\t\t\t\tentitiesSavedStatesCallback: () => callback( ...args ),\n\t\t\t\t} );\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback(\n\t\t\t\t\t() => this.closeEntitiesSavedStates\n\t\t\t\t);\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\t}\n\n\tcloseEntitiesSavedStates( savedEntities ) {\n\t\tconst { postType, postId } = this.props;\n\t\tconst { entitiesSavedStatesCallback } = this.state;\n\t\tthis.setState( { entitiesSavedStatesCallback: false }, () => {\n\t\t\tif (\n\t\t\t\tsavedEntities &&\n\t\t\t\tsavedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\telt.key === postId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// The post entity was checked, call the held callback from `createOnClick`.\n\t\t\t\tentitiesSavedStatesCallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\thasPublishAction,\n\t\t\tisBeingScheduled,\n\t\t\tisOpen,\n\t\t\tisPostSavingLocked,\n\t\t\tisPublishable,\n\t\t\tisPublished,\n\t\t\tisSaveable,\n\t\t\tisSaving,\n\t\t\tisAutoSaving,\n\t\t\tisToggle,\n\t\t\tsavePostStatus,\n\t\t\tonSubmit = noop,\n\t\t\tonToggle,\n\t\t\tvisibility,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tpostStatus,\n\t\t\tpostStatusHasChanged,\n\t\t} = this.props;\n\n\t\tconst isButtonDisabled =\n\t\t\t( isSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\tisPostSavingLocked ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tconst isToggleDisabled =\n\t\t\t( isPublished ||\n\t\t\t\tisSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\t// If the new status has not changed explicitely, we derive it from\n\t\t// other factors, like having a publish action, etc.. We need to preserve\n\t\t// this because it affects when to show the pre and post publish panels.\n\t\t// If it has changed though explicitely, we need to respect that.\n\t\tlet publishStatus = 'publish';\n\t\tif ( postStatusHasChanged ) {\n\t\t\tpublishStatus = postStatus;\n\t\t} else if ( ! hasPublishAction ) {\n\t\t\tpublishStatus = 'pending';\n\t\t} else if ( visibility === 'private' ) {\n\t\t\tpublishStatus = 'private';\n\t\t} else if ( isBeingScheduled ) {\n\t\t\tpublishStatus = 'future';\n\t\t}\n\n\t\tconst onClickButton = () => {\n\t\t\tif ( isButtonDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSubmit();\n\t\t\tsavePostStatus( publishStatus );\n\t\t};\n\n\t\t// Callback to open the publish panel.\n\t\tconst onClickToggle = () => {\n\t\t\tif ( isToggleDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonToggle();\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t'aria-disabled': isButtonDisabled,\n\t\t\tclassName: 'editor-post-publish-button',\n\t\t\tisBusy: ! isAutoSaving && isSaving,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickButton ),\n\t\t};\n\n\t\tconst toggleProps = {\n\t\t\t'aria-disabled': isToggleDisabled,\n\t\t\t'aria-expanded': isOpen,\n\t\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\t\tisBusy: isSaving && isPublished,\n\t\t\tvariant: 'primary',\n\t\t\tsize: 'compact',\n\t\t\tonClick: this.createOnClick( onClickToggle ),\n\t\t};\n\t\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ this.buttonNode }\n\t\t\t\t\t{ ...componentProps }\n\t\t\t\t\tclassName={ `${ componentProps.className } editor-post-publish-button__button` }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<PublishButtonLabel />\n\t\t\t\t</Button>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisAutosavingPost,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tgetEditedPostVisibility,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostSaveable,\n\t\t\tisEditedPostPublishable,\n\t\t\tisPostSavingLocked,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetPostEdits,\n\t\t\thasPostMetaChanges,\n\t\t} = unlock( select( editorStore ) );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisAutoSaving: isAutosavingPost(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: isPostSavingLocked(),\n\t\t\tisPublishable: isEditedPostPublishable(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: getPostEdits()?.status,\n\t\t\thasNonPostEntityChanges: hasNonPostEntityChanges(),\n\t\t\thasPostMetaChanges: hasPostMetaChanges(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tsavePostStatus: ( status ) => {\n\t\t\t\teditPost( { status }, { undoIgnore: true } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostPublishButton );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,SAAS;AACxC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,MAAMC,iBAAiB,SAASd,SAAS,CAAC;EAChDe,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,UAAU,GAAGhB,SAAS,CAAC,CAAC;IAE7B,IAAI,CAACiB,aAAa,GAAG,IAAI,CAACA,aAAa,CAACC,IAAI,CAAE,IAAK,CAAC;IACpD,IAAI,CAACC,wBAAwB,GAC5B,IAAI,CAACA,wBAAwB,CAACD,IAAI,CAAE,IAAK,CAAC;IAE3C,IAAI,CAACE,KAAK,GAAG;MACZC,2BAA2B,EAAE;IAC9B,CAAC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAK,IAAI,CAACP,KAAK,CAACQ,YAAY,EAAG;MAC9B;MACA;MACA;MACA,IAAI,CAACC,SAAS,GAAGC,UAAU,C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AkB,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -10,6 +9,7 @@ import { withDispatch, withSelect } from '@wordpress/data';
10
9
  */
11
10
  import PostPublishButton from './index';
12
11
  import { store as editorStore } from '../../store';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  export function PostPublishButtonOrToggle({
14
14
  forceIsDirty,
15
15
  hasPublishAction,
@@ -59,7 +59,7 @@ export function PostPublishButtonOrToggle({
59
59
  } else {
60
60
  component = IS_BUTTON;
61
61
  }
62
- return createElement(PostPublishButton, {
62
+ return /*#__PURE__*/_jsx(PostPublishButton, {
63
63
  forceIsDirty: forceIsDirty,
64
64
  isOpen: isPublishSidebarOpened,
65
65
  isToggle: component === IS_TOGGLE,
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","postStatusHasChanged","postStatus","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","includes","createElement","isOpen","isToggle","onToggle","select","_select$getCurrentPos","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","getEditedPostAttribute","getPostEdits","status","dispatch"],"sources":["@wordpress/editor/src/components/post-publish-button/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from './index';\nimport { store as editorStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n\tpostStatusHasChanged,\n\tpostStatus,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitely to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\tpostStatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,OAAO,QAAQ,oBAAoB;AAC9D,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;;AAE1D;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,SAAS;AACvC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC,8BAA8B;EAC9BC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,2BAA2B,GAAGtB,gBAAgB,CAAE,QAAQ,E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,MAAM,CAAEvB,WAAY,CAAC,CAACO,uBAAuB,CAAC,CAAC;IAChDC,sBAAsB,EAAEe,MAAM,CAAEvB,WAAY,CAAC,CAACQ,sBAAsB,CAAC,CAAC;IACtEC,WAAW,EAAEc,MAAM,CAAEvB,WAAY,CAAC,CAAC8B,sBAAsB,CAAC,CAAC;IAC3DjB,UAAU,EAAEU,MAAM,CAAEvB,WAAY,CAAC,CAAC+B,sBAAsB,CAAE,QAAS,CAAC;IACpEnB,oBAAoB,EAAEW,MAAM,CAAEvB,WAAY,CAAC,CAACgC,YAAY,CAAC,CAAC,EAAEC;EAC7D,CAAC;AAAA,CAAG,CAAC,EACLrC,YAAY,CAAIsC,QAAQ,IAAM;EAC7B,MAAM;IAAExB;EAAqB,CAAC,GAAGwB,QAAQ,CAAElC,WAAY,CAAC;EACxD,OAAO;IACNU;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","jsx","_jsx","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","postStatusHasChanged","postStatus","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","includes","isOpen","isToggle","onToggle","select","_select$getCurrentPos","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","getEditedPostAttribute","getPostEdits","status","dispatch"],"sources":["@wordpress/editor/src/components/post-publish-button/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from './index';\nimport { store as editorStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n\tpostStatusHasChanged,\n\tpostStatus,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitely to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\tpostStatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,OAAO,QAAQ,oBAAoB;AAC9D,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;;AAE1D;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,SAAS;AACvC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,SAASC,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC,8BAA8B;EAC9BC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,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DrB,WAAW,EAAEgB,MAAM,CAAExB,WAAY,CAAC,CAAC8B,sBAAsB,CAAC,CAAC;IAC3DrB,uBAAuB,EACtBe,MAAM,CAAExB,WAAY,CAAC,CAACS,uBAAuB,CAAC,CAAC;IAChDC,sBAAsB,EAAEc,MAAM,CAAExB,WAAY,CAAC,CAACU,sBAAsB,CAAC,CAAC;IACtEC,WAAW,EAAEa,MAAM,CAAExB,WAAY,CAAC,CAAC+B,sBAAsB,CAAC,CAAC;IAC3DhB,UAAU,EAAES,MAAM,CAAExB,WAAY,CAAC,CAACgC,sBAAsB,CAAE,QAAS,CAAC;IACpElB,oBAAoB,EAAEU,MAAM,CAAExB,WAAY,CAAC,CAACiC,YAAY,CAAC,CAAC,EAAEC;EAC7D,CAAC;AAAA,CAAG,CAAC,EACLtC,YAAY,CAAIuC,QAAQ,IAAM;EAC7B,MAAM;IAAEvB;EAAqB,CAAC,GAAGuB,QAAQ,CAAEnC,WAAY,CAAC;EACxD,OAAO;IACNY;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -17,6 +16,9 @@ import PostPublishButton from '../post-publish-button';
17
16
  import PostPublishPanelPrepublish from './prepublish';
18
17
  import PostPublishPanelPostpublish from './postpublish';
19
18
  import { store as editorStore } from '../../store';
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { Fragment as _Fragment } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
20
22
  export class PostPublishPanel extends Component {
21
23
  constructor() {
22
24
  super(...arguments);
@@ -63,39 +65,52 @@ export class PostPublishPanel extends Component {
63
65
  const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
64
66
  const isPrePublish = !isPublishedOrScheduled && !isSaving;
65
67
  const isPostPublish = isPublishedOrScheduled && !isSaving;
66
- return createElement("div", {
68
+ return /*#__PURE__*/_jsxs("div", {
67
69
  className: "editor-post-publish-panel",
68
- ...propsForPanel
69
- }, createElement("div", {
70
- className: "editor-post-publish-panel__header"
71
- }, isPostPublish ? createElement(Button, {
72
- onClick: onClose,
73
- icon: closeSmall,
74
- label: __('Close panel')
75
- }) : createElement(Fragment, null, createElement("div", {
76
- className: "editor-post-publish-panel__header-publish-button"
77
- }, createElement(PostPublishButton, {
78
- focusOnMount: true,
79
- onSubmit: this.onSubmit,
80
- forceIsDirty: forceIsDirty
81
- })), createElement("div", {
82
- className: "editor-post-publish-panel__header-cancel-button"
83
- }, createElement(Button, {
84
- disabled: isSavingNonPostEntityChanges,
85
- onClick: onClose,
86
- variant: "secondary"
87
- }, __('Cancel'))))), createElement("div", {
88
- className: "editor-post-publish-panel__content"
89
- }, isPrePublish && createElement(PostPublishPanelPrepublish, null, PrePublishExtension && createElement(PrePublishExtension, null)), isPostPublish && createElement(PostPublishPanelPostpublish, {
90
- focusOnMount: true
91
- }, PostPublishExtension && createElement(PostPublishExtension, null)), isSaving && createElement(Spinner, null)), createElement("div", {
92
- className: "editor-post-publish-panel__footer"
93
- }, createElement(CheckboxControl, {
94
- __nextHasNoMarginBottom: true,
95
- label: __('Always show pre-publish checks.'),
96
- checked: isPublishSidebarEnabled,
97
- onChange: onTogglePublishSidebar
98
- })));
70
+ ...propsForPanel,
71
+ children: [/*#__PURE__*/_jsx("div", {
72
+ className: "editor-post-publish-panel__header",
73
+ children: isPostPublish ? /*#__PURE__*/_jsx(Button, {
74
+ onClick: onClose,
75
+ icon: closeSmall,
76
+ label: __('Close panel')
77
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
78
+ children: [/*#__PURE__*/_jsx("div", {
79
+ className: "editor-post-publish-panel__header-publish-button",
80
+ children: /*#__PURE__*/_jsx(PostPublishButton, {
81
+ focusOnMount: true,
82
+ onSubmit: this.onSubmit,
83
+ forceIsDirty: forceIsDirty
84
+ })
85
+ }), /*#__PURE__*/_jsx("div", {
86
+ className: "editor-post-publish-panel__header-cancel-button",
87
+ children: /*#__PURE__*/_jsx(Button, {
88
+ disabled: isSavingNonPostEntityChanges,
89
+ onClick: onClose,
90
+ variant: "secondary",
91
+ size: "compact",
92
+ children: __('Cancel')
93
+ })
94
+ })]
95
+ })
96
+ }), /*#__PURE__*/_jsxs("div", {
97
+ className: "editor-post-publish-panel__content",
98
+ children: [isPrePublish && /*#__PURE__*/_jsx(PostPublishPanelPrepublish, {
99
+ children: PrePublishExtension && /*#__PURE__*/_jsx(PrePublishExtension, {})
100
+ }), isPostPublish && /*#__PURE__*/_jsx(PostPublishPanelPostpublish, {
101
+ focusOnMount: true,
102
+ children: PostPublishExtension && /*#__PURE__*/_jsx(PostPublishExtension, {})
103
+ }), isSaving && /*#__PURE__*/_jsx(Spinner, {})]
104
+ }), /*#__PURE__*/_jsx("div", {
105
+ className: "editor-post-publish-panel__footer",
106
+ children: /*#__PURE__*/_jsx(CheckboxControl, {
107
+ __nextHasNoMarginBottom: true,
108
+ label: __('Always show pre-publish checks.'),
109
+ checked: isPublishSidebarEnabled,
110
+ onChange: onTogglePublishSidebar
111
+ })
112
+ })]
113
+ });
99
114
  }
100
115
  }
101
116
  export default compose([withSelect(select => {