@wordpress/editor 13.31.0 → 13.33.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 (647) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1080 -0
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +107 -0
  16. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  17. package/build/components/character-count/index.js.map +1 -1
  18. package/build/components/commands/index.js +20 -1
  19. package/build/components/commands/index.js.map +1 -1
  20. package/build/components/commands/index.native.js.map +1 -1
  21. package/build/components/deprecated.js +158 -0
  22. package/build/components/deprecated.js.map +1 -1
  23. package/build/components/deprecated.native.js.map +1 -1
  24. package/build/components/document-bar/index.js +5 -8
  25. package/build/components/document-bar/index.js.map +1 -1
  26. package/build/components/document-outline/check.js.map +1 -1
  27. package/build/components/document-outline/index.js.map +1 -1
  28. package/build/components/document-outline/item.js.map +1 -1
  29. package/build/components/document-tools/index.js +1 -1
  30. package/build/components/document-tools/index.js.map +1 -1
  31. package/build/components/editor-canvas/edit-template-blocks-notification.js +12 -38
  32. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  33. package/build/components/editor-canvas/index.js +5 -2
  34. package/build/components/editor-canvas/index.js.map +1 -1
  35. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  36. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  37. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  38. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  39. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  40. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  41. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/index.native.js.map +1 -1
  43. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  44. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  46. package/build/components/editor-help/view-sections.native.js.map +1 -1
  47. package/build/components/editor-history/redo.js.map +1 -1
  48. package/build/components/editor-history/undo.js.map +1 -1
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js.map +1 -1
  51. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  53. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  54. package/build/components/entities-saved-states/index.js +11 -85
  55. package/build/components/entities-saved-states/index.js.map +1 -1
  56. package/build/components/error-boundary/index.js.map +1 -1
  57. package/build/components/error-boundary/index.native.js.map +1 -1
  58. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  59. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  60. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  61. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  62. package/build/components/index.js +57 -1
  63. package/build/components/index.js.map +1 -1
  64. package/build/components/index.native.js.map +1 -1
  65. package/build/components/inserter-sidebar/index.js +5 -1
  66. package/build/components/inserter-sidebar/index.js.map +1 -1
  67. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  68. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  69. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  70. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  71. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  72. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  73. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  74. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  75. package/build/components/list-view-sidebar/index.js +2 -1
  76. package/build/components/list-view-sidebar/index.js.map +1 -1
  77. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  78. package/build/components/local-autosave-monitor/index.js.map +1 -1
  79. package/build/components/media-categories/index.js.map +1 -1
  80. package/build/components/mode-switcher/index.js.map +1 -1
  81. package/build/components/offline-status/index.native.js.map +1 -1
  82. package/build/components/page-attributes/check.js.map +1 -1
  83. package/build/components/page-attributes/order.js.map +1 -1
  84. package/build/components/page-attributes/panel.js.map +1 -1
  85. package/build/components/page-attributes/parent.js.map +1 -1
  86. package/build/components/pattern-overrides-panel/index.js +30 -0
  87. package/build/components/pattern-overrides-panel/index.js.map +1 -0
  88. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  89. package/build/components/plugin-more-menu-item/index.js +78 -0
  90. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  91. package/build/components/plugin-post-publish-panel/index.js +68 -0
  92. package/build/components/plugin-post-publish-panel/index.js.map +1 -0
  93. package/build/components/plugin-post-status-info/index.js +73 -0
  94. package/build/components/plugin-post-status-info/index.js.map +1 -0
  95. package/build/components/plugin-pre-publish-panel/index.js +71 -0
  96. package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
  97. package/build/components/plugin-sidebar/index.js +108 -0
  98. package/build/components/plugin-sidebar/index.js.map +1 -0
  99. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  100. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  101. package/build/components/post-actions/actions.js +656 -0
  102. package/build/components/post-actions/actions.js.map +1 -0
  103. package/build/components/post-actions/index.js +137 -0
  104. package/build/components/post-actions/index.js.map +1 -0
  105. package/build/components/post-author/check.js.map +1 -1
  106. package/build/components/post-author/combobox.js.map +1 -1
  107. package/build/components/post-author/constants.js.map +1 -1
  108. package/build/components/post-author/hook.js.map +1 -1
  109. package/build/components/post-author/index.js.map +1 -1
  110. package/build/components/post-author/panel.js.map +1 -1
  111. package/build/components/post-author/select.js.map +1 -1
  112. package/build/components/post-card-panel/index.js +127 -0
  113. package/build/components/post-card-panel/index.js.map +1 -0
  114. package/build/components/post-comments/index.js.map +1 -1
  115. package/build/components/post-discussion/panel.js.map +1 -1
  116. package/build/components/post-excerpt/check.js +8 -0
  117. package/build/components/post-excerpt/check.js.map +1 -1
  118. package/build/components/post-excerpt/index.js.map +1 -1
  119. package/build/components/post-excerpt/panel.js.map +1 -1
  120. package/build/components/post-excerpt/plugin.js.map +1 -1
  121. package/build/components/post-featured-image/check.js.map +1 -1
  122. package/build/components/post-featured-image/index.js.map +1 -1
  123. package/build/components/post-featured-image/panel.js.map +1 -1
  124. package/build/components/post-format/check.js.map +1 -1
  125. package/build/components/post-format/index.js.map +1 -1
  126. package/build/components/post-last-revision/check.js.map +1 -1
  127. package/build/components/post-last-revision/index.js.map +1 -1
  128. package/build/components/post-last-revision/panel.js.map +1 -1
  129. package/build/components/post-locked-modal/index.js.map +1 -1
  130. package/build/components/post-panel-row/index.js.map +1 -1
  131. package/build/components/post-pending-status/check.js.map +1 -1
  132. package/build/components/post-pending-status/index.js.map +1 -1
  133. package/build/components/post-pingbacks/index.js.map +1 -1
  134. package/build/components/post-preview-button/index.js.map +1 -1
  135. package/build/components/post-publish-button/index.js +31 -31
  136. package/build/components/post-publish-button/index.js.map +1 -1
  137. package/build/components/post-publish-button/label.js +51 -43
  138. package/build/components/post-publish-button/label.js.map +1 -1
  139. package/build/components/post-publish-panel/index.js.map +1 -1
  140. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  141. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  142. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  143. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  144. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  145. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  146. package/build/components/post-saved-state/index.js +10 -6
  147. package/build/components/post-saved-state/index.js.map +1 -1
  148. package/build/components/post-schedule/check.js.map +1 -1
  149. package/build/components/post-schedule/index.js.map +1 -1
  150. package/build/components/post-schedule/label.js.map +1 -1
  151. package/build/components/post-schedule/panel.js +8 -0
  152. package/build/components/post-schedule/panel.js.map +1 -1
  153. package/build/components/post-slug/check.js.map +1 -1
  154. package/build/components/post-slug/index.js +43 -68
  155. package/build/components/post-slug/index.js.map +1 -1
  156. package/build/components/post-status/index.js +239 -0
  157. package/build/components/post-status/index.js.map +1 -0
  158. package/build/components/post-sticky/check.js.map +1 -1
  159. package/build/components/post-sticky/index.js.map +1 -1
  160. package/build/components/post-switch-to-draft-button/index.js +6 -1
  161. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  162. package/build/components/post-sync-status/index.js.map +1 -1
  163. package/build/components/post-taxonomies/check.js.map +1 -1
  164. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  165. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  166. package/build/components/post-taxonomies/index.js.map +1 -1
  167. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  168. package/build/components/post-taxonomies/panel.js.map +1 -1
  169. package/build/components/post-template/block-theme.js +6 -2
  170. package/build/components/post-template/block-theme.js.map +1 -1
  171. package/build/components/post-template/classic-theme.js.map +1 -1
  172. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  173. package/build/components/post-template/create-new-template.js.map +1 -1
  174. package/build/components/post-template/hooks.js.map +1 -1
  175. package/build/components/post-template/panel.js.map +1 -1
  176. package/build/components/post-template/reset-default-template.js.map +1 -1
  177. package/build/components/post-template/swap-template-button.js.map +1 -1
  178. package/build/components/post-text-editor/index.js.map +1 -1
  179. package/build/components/post-title/constants.js.map +1 -1
  180. package/build/components/post-title/index.js.map +1 -1
  181. package/build/components/post-title/index.native.js +1 -1
  182. package/build/components/post-title/index.native.js.map +1 -1
  183. package/build/components/post-title/post-title-raw.js.map +1 -1
  184. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  185. package/build/components/post-title/use-post-title.js.map +1 -1
  186. package/build/components/post-trash/check.js +23 -25
  187. package/build/components/post-trash/check.js.map +1 -1
  188. package/build/components/post-trash/index.js +2 -1
  189. package/build/components/post-trash/index.js.map +1 -1
  190. package/build/components/post-type-support-check/index.js.map +1 -1
  191. package/build/components/post-url/check.js.map +1 -1
  192. package/build/components/post-url/index.js +44 -19
  193. package/build/components/post-url/index.js.map +1 -1
  194. package/build/components/post-url/label.js.map +1 -1
  195. package/build/components/post-url/panel.js +14 -7
  196. package/build/components/post-url/panel.js.map +1 -1
  197. package/build/components/post-view-link/index.js.map +1 -1
  198. package/build/components/post-visibility/check.js.map +1 -1
  199. package/build/components/post-visibility/index.js +2 -1
  200. package/build/components/post-visibility/index.js.map +1 -1
  201. package/build/components/post-visibility/label.js.map +1 -1
  202. package/build/components/post-visibility/utils.js.map +1 -1
  203. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  204. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  205. package/build/components/preferences-modal/index.js +19 -17
  206. package/build/components/preferences-modal/index.js.map +1 -1
  207. package/build/components/preview-dropdown/index.js.map +1 -1
  208. package/build/components/provider/disable-non-page-content-blocks.js +36 -20
  209. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  210. package/build/components/provider/index.js +4 -2
  211. package/build/components/provider/index.js.map +1 -1
  212. package/build/components/provider/index.native.js +6 -1
  213. package/build/components/provider/index.native.js.map +1 -1
  214. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  215. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  216. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  217. package/build/components/provider/use-block-editor-settings.js +70 -50
  218. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  219. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  220. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  221. package/build/components/provider/with-registry-provider.js +1 -0
  222. package/build/components/provider/with-registry-provider.js.map +1 -1
  223. package/build/components/start-page-options/index.js +139 -0
  224. package/build/components/start-page-options/index.js.map +1 -0
  225. package/build/components/table-of-contents/index.js.map +1 -1
  226. package/build/components/table-of-contents/panel.js.map +1 -1
  227. package/build/components/template-areas/index.js +70 -0
  228. package/build/components/template-areas/index.js.map +1 -0
  229. package/build/components/template-validation-notice/index.js +23 -29
  230. package/build/components/template-validation-notice/index.js.map +1 -1
  231. package/build/components/theme-support-check/index.js +10 -16
  232. package/build/components/theme-support-check/index.js.map +1 -1
  233. package/build/components/time-to-read/index.js.map +1 -1
  234. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  235. package/build/components/word-count/index.js.map +1 -1
  236. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  237. package/build/hooks/default-autocompleters.js.map +1 -1
  238. package/build/hooks/index.js.map +1 -1
  239. package/build/hooks/index.native.js.map +1 -1
  240. package/build/hooks/pattern-overrides.js +22 -10
  241. package/build/hooks/pattern-overrides.js.map +1 -1
  242. package/build/hooks/use-select-nearest-editable-block.js +87 -0
  243. package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
  244. package/build/index.js.map +1 -1
  245. package/build/index.native.js.map +1 -1
  246. package/build/lock-unlock.js.map +1 -1
  247. package/build/private-apis.js +26 -1
  248. package/build/private-apis.js.map +1 -1
  249. package/build/store/actions.js +46 -6
  250. package/build/store/actions.js.map +1 -1
  251. package/build/store/actions.native.js.map +1 -1
  252. package/build/store/constants.js +10 -1
  253. package/build/store/constants.js.map +1 -1
  254. package/build/store/defaults.js.map +1 -1
  255. package/build/store/index.js +1 -1
  256. package/build/store/index.js.map +1 -1
  257. package/build/store/local-autosave.js.map +1 -1
  258. package/build/store/private-actions.js +253 -1
  259. package/build/store/private-actions.js.map +1 -1
  260. package/build/store/private-selectors.js +50 -3
  261. package/build/store/private-selectors.js.map +1 -1
  262. package/build/store/reducer.js +14 -1
  263. package/build/store/reducer.js.map +1 -1
  264. package/build/store/reducer.native.js.map +1 -1
  265. package/build/store/selectors.js +25 -20
  266. package/build/store/selectors.js.map +1 -1
  267. package/build/store/selectors.native.js.map +1 -1
  268. package/build/store/utils/get-filtered-template-parts.js +71 -0
  269. package/build/store/utils/get-filtered-template-parts.js.map +1 -0
  270. package/build/store/utils/is-template-revertable.js +28 -0
  271. package/build/store/utils/is-template-revertable.js.map +1 -0
  272. package/build/store/utils/notice-builder.js.map +1 -1
  273. package/build/utils/get-template-part-icon.js.map +1 -1
  274. package/build/utils/index.js.map +1 -1
  275. package/build/utils/index.native.js.map +1 -1
  276. package/build/utils/media-upload/index.js.map +1 -1
  277. package/build/utils/media-upload/index.native.js.map +1 -1
  278. package/build/utils/terms.js.map +1 -1
  279. package/build/utils/url.js.map +1 -1
  280. package/build-module/bindings/index.js.map +1 -1
  281. package/build-module/bindings/pattern-overrides.js.map +1 -1
  282. package/build-module/bindings/post-meta.js +14 -31
  283. package/build-module/bindings/post-meta.js.map +1 -1
  284. package/build-module/components/autocompleters/index.js.map +1 -1
  285. package/build-module/components/autocompleters/user.js.map +1 -1
  286. package/build-module/components/autosave-monitor/index.js +10 -0
  287. package/build-module/components/autosave-monitor/index.js.map +1 -1
  288. package/build-module/components/block-manager/category.js.map +1 -1
  289. package/build-module/components/block-manager/checklist.js.map +1 -1
  290. package/build-module/components/block-manager/index.js.map +1 -1
  291. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  292. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +100 -0
  293. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  294. package/build-module/components/character-count/index.js.map +1 -1
  295. package/build-module/components/commands/index.js +21 -2
  296. package/build-module/components/commands/index.js.map +1 -1
  297. package/build-module/components/commands/index.native.js.map +1 -1
  298. package/build-module/components/deprecated.js +159 -0
  299. package/build-module/components/deprecated.js.map +1 -1
  300. package/build-module/components/deprecated.native.js.map +1 -1
  301. package/build-module/components/document-bar/index.js +6 -9
  302. package/build-module/components/document-bar/index.js.map +1 -1
  303. package/build-module/components/document-outline/check.js.map +1 -1
  304. package/build-module/components/document-outline/index.js.map +1 -1
  305. package/build-module/components/document-outline/item.js.map +1 -1
  306. package/build-module/components/document-tools/index.js +1 -1
  307. package/build-module/components/document-tools/index.js.map +1 -1
  308. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +14 -40
  309. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  310. package/build-module/components/editor-canvas/index.js +5 -2
  311. package/build-module/components/editor-canvas/index.js.map +1 -1
  312. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  313. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  314. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  315. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  316. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  317. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  318. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  319. package/build-module/components/editor-help/index.native.js.map +1 -1
  320. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  321. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  322. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  323. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  324. package/build-module/components/editor-history/redo.js.map +1 -1
  325. package/build-module/components/editor-history/undo.js.map +1 -1
  326. package/build-module/components/editor-notices/index.js.map +1 -1
  327. package/build-module/components/editor-snackbars/index.js.map +1 -1
  328. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  329. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  330. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  331. package/build-module/components/entities-saved-states/index.js +11 -85
  332. package/build-module/components/entities-saved-states/index.js.map +1 -1
  333. package/build-module/components/error-boundary/index.js.map +1 -1
  334. package/build-module/components/error-boundary/index.native.js.map +1 -1
  335. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  336. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  337. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  338. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  339. package/build-module/components/index.js +7 -0
  340. package/build-module/components/index.js.map +1 -1
  341. package/build-module/components/index.native.js.map +1 -1
  342. package/build-module/components/inserter-sidebar/index.js +5 -1
  343. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  344. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  345. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  346. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  347. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  348. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  349. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  350. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  351. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  352. package/build-module/components/list-view-sidebar/index.js +2 -1
  353. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  354. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  355. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  356. package/build-module/components/media-categories/index.js.map +1 -1
  357. package/build-module/components/mode-switcher/index.js.map +1 -1
  358. package/build-module/components/offline-status/index.native.js.map +1 -1
  359. package/build-module/components/page-attributes/check.js.map +1 -1
  360. package/build-module/components/page-attributes/order.js.map +1 -1
  361. package/build-module/components/page-attributes/panel.js.map +1 -1
  362. package/build-module/components/page-attributes/parent.js.map +1 -1
  363. package/build-module/components/pattern-overrides-panel/index.js +23 -0
  364. package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
  365. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  366. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  367. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  368. package/build-module/components/plugin-post-publish-panel/index.js +61 -0
  369. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
  370. package/build-module/components/plugin-post-status-info/index.js +66 -0
  371. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  372. package/build-module/components/plugin-pre-publish-panel/index.js +64 -0
  373. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
  374. package/build-module/components/plugin-sidebar/index.js +102 -0
  375. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  376. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  377. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  378. package/build-module/components/post-actions/actions.js +648 -0
  379. package/build-module/components/post-actions/actions.js.map +1 -0
  380. package/build-module/components/post-actions/index.js +130 -0
  381. package/build-module/components/post-actions/index.js.map +1 -0
  382. package/build-module/components/post-author/check.js.map +1 -1
  383. package/build-module/components/post-author/combobox.js.map +1 -1
  384. package/build-module/components/post-author/constants.js.map +1 -1
  385. package/build-module/components/post-author/hook.js.map +1 -1
  386. package/build-module/components/post-author/index.js.map +1 -1
  387. package/build-module/components/post-author/panel.js.map +1 -1
  388. package/build-module/components/post-author/select.js.map +1 -1
  389. package/build-module/components/post-card-panel/index.js +119 -0
  390. package/build-module/components/post-card-panel/index.js.map +1 -0
  391. package/build-module/components/post-comments/index.js.map +1 -1
  392. package/build-module/components/post-discussion/panel.js.map +1 -1
  393. package/build-module/components/post-excerpt/check.js +9 -0
  394. package/build-module/components/post-excerpt/check.js.map +1 -1
  395. package/build-module/components/post-excerpt/index.js.map +1 -1
  396. package/build-module/components/post-excerpt/panel.js.map +1 -1
  397. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  398. package/build-module/components/post-featured-image/check.js.map +1 -1
  399. package/build-module/components/post-featured-image/index.js.map +1 -1
  400. package/build-module/components/post-featured-image/panel.js.map +1 -1
  401. package/build-module/components/post-format/check.js.map +1 -1
  402. package/build-module/components/post-format/index.js.map +1 -1
  403. package/build-module/components/post-last-revision/check.js.map +1 -1
  404. package/build-module/components/post-last-revision/index.js.map +1 -1
  405. package/build-module/components/post-last-revision/panel.js.map +1 -1
  406. package/build-module/components/post-locked-modal/index.js.map +1 -1
  407. package/build-module/components/post-panel-row/index.js.map +1 -1
  408. package/build-module/components/post-pending-status/check.js.map +1 -1
  409. package/build-module/components/post-pending-status/index.js.map +1 -1
  410. package/build-module/components/post-pingbacks/index.js.map +1 -1
  411. package/build-module/components/post-preview-button/index.js.map +1 -1
  412. package/build-module/components/post-publish-button/index.js +31 -31
  413. package/build-module/components/post-publish-button/index.js.map +1 -1
  414. package/build-module/components/post-publish-button/label.js +51 -42
  415. package/build-module/components/post-publish-button/label.js.map +1 -1
  416. package/build-module/components/post-publish-panel/index.js.map +1 -1
  417. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  418. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  419. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  420. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  421. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  422. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  423. package/build-module/components/post-saved-state/index.js +10 -6
  424. package/build-module/components/post-saved-state/index.js.map +1 -1
  425. package/build-module/components/post-schedule/check.js.map +1 -1
  426. package/build-module/components/post-schedule/index.js.map +1 -1
  427. package/build-module/components/post-schedule/label.js.map +1 -1
  428. package/build-module/components/post-schedule/panel.js +8 -0
  429. package/build-module/components/post-schedule/panel.js.map +1 -1
  430. package/build-module/components/post-slug/check.js.map +1 -1
  431. package/build-module/components/post-slug/index.js +44 -68
  432. package/build-module/components/post-slug/index.js.map +1 -1
  433. package/build-module/components/post-status/index.js +231 -0
  434. package/build-module/components/post-status/index.js.map +1 -0
  435. package/build-module/components/post-sticky/check.js.map +1 -1
  436. package/build-module/components/post-sticky/index.js.map +1 -1
  437. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  438. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  439. package/build-module/components/post-sync-status/index.js.map +1 -1
  440. package/build-module/components/post-taxonomies/check.js.map +1 -1
  441. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  442. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  443. package/build-module/components/post-taxonomies/index.js.map +1 -1
  444. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  445. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  446. package/build-module/components/post-template/block-theme.js +7 -3
  447. package/build-module/components/post-template/block-theme.js.map +1 -1
  448. package/build-module/components/post-template/classic-theme.js.map +1 -1
  449. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  450. package/build-module/components/post-template/create-new-template.js.map +1 -1
  451. package/build-module/components/post-template/hooks.js.map +1 -1
  452. package/build-module/components/post-template/panel.js.map +1 -1
  453. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  454. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  455. package/build-module/components/post-text-editor/index.js.map +1 -1
  456. package/build-module/components/post-title/constants.js.map +1 -1
  457. package/build-module/components/post-title/index.js.map +1 -1
  458. package/build-module/components/post-title/index.native.js +1 -1
  459. package/build-module/components/post-title/index.native.js.map +1 -1
  460. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  461. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  462. package/build-module/components/post-title/use-post-title.js.map +1 -1
  463. package/build-module/components/post-trash/check.js +24 -26
  464. package/build-module/components/post-trash/check.js.map +1 -1
  465. package/build-module/components/post-trash/index.js +2 -1
  466. package/build-module/components/post-trash/index.js.map +1 -1
  467. package/build-module/components/post-type-support-check/index.js.map +1 -1
  468. package/build-module/components/post-url/check.js.map +1 -1
  469. package/build-module/components/post-url/index.js +46 -21
  470. package/build-module/components/post-url/index.js.map +1 -1
  471. package/build-module/components/post-url/label.js.map +1 -1
  472. package/build-module/components/post-url/panel.js +14 -7
  473. package/build-module/components/post-url/panel.js.map +1 -1
  474. package/build-module/components/post-view-link/index.js.map +1 -1
  475. package/build-module/components/post-visibility/check.js.map +1 -1
  476. package/build-module/components/post-visibility/index.js +2 -1
  477. package/build-module/components/post-visibility/index.js.map +1 -1
  478. package/build-module/components/post-visibility/label.js.map +1 -1
  479. package/build-module/components/post-visibility/utils.js.map +1 -1
  480. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  481. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  482. package/build-module/components/preferences-modal/index.js +19 -17
  483. package/build-module/components/preferences-modal/index.js.map +1 -1
  484. package/build-module/components/preview-dropdown/index.js.map +1 -1
  485. package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
  486. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  487. package/build-module/components/provider/index.js +5 -3
  488. package/build-module/components/provider/index.js.map +1 -1
  489. package/build-module/components/provider/index.native.js.map +1 -1
  490. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  491. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  492. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  493. package/build-module/components/provider/use-block-editor-settings.js +73 -53
  494. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  495. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  496. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  497. package/build-module/components/provider/with-registry-provider.js +1 -0
  498. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  499. package/build-module/components/start-page-options/index.js +132 -0
  500. package/build-module/components/start-page-options/index.js.map +1 -0
  501. package/build-module/components/table-of-contents/index.js.map +1 -1
  502. package/build-module/components/table-of-contents/panel.js.map +1 -1
  503. package/build-module/components/template-areas/index.js +63 -0
  504. package/build-module/components/template-areas/index.js.map +1 -0
  505. package/build-module/components/template-validation-notice/index.js +25 -31
  506. package/build-module/components/template-validation-notice/index.js.map +1 -1
  507. package/build-module/components/theme-support-check/index.js +11 -16
  508. package/build-module/components/theme-support-check/index.js.map +1 -1
  509. package/build-module/components/time-to-read/index.js.map +1 -1
  510. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  511. package/build-module/components/word-count/index.js.map +1 -1
  512. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  513. package/build-module/hooks/default-autocompleters.js.map +1 -1
  514. package/build-module/hooks/index.js.map +1 -1
  515. package/build-module/hooks/index.native.js.map +1 -1
  516. package/build-module/hooks/pattern-overrides.js +22 -10
  517. package/build-module/hooks/pattern-overrides.js.map +1 -1
  518. package/build-module/hooks/use-select-nearest-editable-block.js +80 -0
  519. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
  520. package/build-module/index.js.map +1 -1
  521. package/build-module/index.native.js.map +1 -1
  522. package/build-module/lock-unlock.js.map +1 -1
  523. package/build-module/private-apis.js +24 -1
  524. package/build-module/private-apis.js.map +1 -1
  525. package/build-module/store/actions.js +37 -3
  526. package/build-module/store/actions.js.map +1 -1
  527. package/build-module/store/actions.native.js.map +1 -1
  528. package/build-module/store/constants.js +9 -0
  529. package/build-module/store/constants.js.map +1 -1
  530. package/build-module/store/defaults.js.map +1 -1
  531. package/build-module/store/index.js.map +1 -1
  532. package/build-module/store/local-autosave.js.map +1 -1
  533. package/build-module/store/private-actions.js +249 -1
  534. package/build-module/store/private-actions.js.map +1 -1
  535. package/build-module/store/private-selectors.js +50 -4
  536. package/build-module/store/private-selectors.js.map +1 -1
  537. package/build-module/store/reducer.js +13 -1
  538. package/build-module/store/reducer.js.map +1 -1
  539. package/build-module/store/reducer.native.js.map +1 -1
  540. package/build-module/store/selectors.js +20 -16
  541. package/build-module/store/selectors.js.map +1 -1
  542. package/build-module/store/selectors.native.js.map +1 -1
  543. package/build-module/store/utils/get-filtered-template-parts.js +64 -0
  544. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
  545. package/build-module/store/utils/is-template-revertable.js +22 -0
  546. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  547. package/build-module/store/utils/notice-builder.js.map +1 -1
  548. package/build-module/utils/get-template-part-icon.js.map +1 -1
  549. package/build-module/utils/index.js.map +1 -1
  550. package/build-module/utils/index.native.js.map +1 -1
  551. package/build-module/utils/media-upload/index.js.map +1 -1
  552. package/build-module/utils/media-upload/index.native.js.map +1 -1
  553. package/build-module/utils/terms.js.map +1 -1
  554. package/build-module/utils/url.js.map +1 -1
  555. package/build-style/style-rtl.css +565 -49
  556. package/build-style/style.css +565 -49
  557. package/package.json +36 -36
  558. package/src/bindings/post-meta.js +11 -27
  559. package/src/components/autosave-monitor/index.js +9 -0
  560. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
  561. package/src/components/commands/index.js +21 -2
  562. package/src/components/deprecated.js +157 -0
  563. package/src/components/document-bar/index.js +9 -15
  564. package/src/components/document-bar/style.scss +9 -12
  565. package/src/components/document-tools/index.js +16 -14
  566. package/src/components/document-tools/style.scss +4 -11
  567. package/src/components/editor-canvas/edit-template-blocks-notification.js +17 -53
  568. package/src/components/editor-canvas/index.js +8 -4
  569. package/src/components/entities-saved-states/index.js +12 -113
  570. package/src/components/error-boundary/style.native.scss +1 -1
  571. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  572. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  573. package/src/components/index.js +7 -0
  574. package/src/components/inserter-sidebar/index.js +7 -1
  575. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  576. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  577. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  578. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  579. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  580. package/src/components/list-view-sidebar/index.js +1 -0
  581. package/src/components/list-view-sidebar/style.scss +1 -1
  582. package/src/components/pattern-overrides-panel/index.js +26 -0
  583. package/src/components/plugin-more-menu-item/index.js +73 -0
  584. package/src/components/plugin-post-publish-panel/index.js +64 -0
  585. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
  586. package/src/components/plugin-post-publish-panel/test/index.js +33 -0
  587. package/src/components/plugin-post-status-info/index.js +63 -0
  588. package/src/components/plugin-pre-publish-panel/index.js +67 -0
  589. package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
  590. package/src/components/plugin-sidebar/index.js +98 -0
  591. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  592. package/src/components/post-actions/actions.js +862 -0
  593. package/src/components/post-actions/index.js +156 -0
  594. package/src/components/post-actions/style.scss +3 -0
  595. package/src/components/post-card-panel/index.js +168 -0
  596. package/src/components/post-card-panel/style.scss +32 -0
  597. package/src/components/post-excerpt/check.js +8 -0
  598. package/src/components/post-featured-image/style.scss +3 -2
  599. package/src/components/post-publish-button/index.js +23 -36
  600. package/src/components/post-publish-button/label.js +54 -39
  601. package/src/components/post-publish-button/test/index.js +15 -26
  602. package/src/components/post-publish-button/test/label.js +44 -21
  603. package/src/components/post-saved-state/index.js +13 -6
  604. package/src/components/post-saved-state/test/index.js +4 -0
  605. package/src/components/post-schedule/panel.js +22 -0
  606. package/src/components/post-slug/index.js +50 -68
  607. package/src/components/post-slug/test/index.js +29 -6
  608. package/src/components/post-status/index.js +310 -0
  609. package/src/components/post-status/style.scss +75 -0
  610. package/src/components/post-switch-to-draft-button/index.js +5 -0
  611. package/src/components/post-template/block-theme.js +31 -22
  612. package/src/components/post-title/index.native.js +1 -1
  613. package/src/components/post-trash/check.js +19 -19
  614. package/src/components/post-trash/index.js +1 -0
  615. package/src/components/post-url/index.js +131 -101
  616. package/src/components/post-url/panel.js +20 -7
  617. package/src/components/post-url/style.scss +8 -6
  618. package/src/components/post-visibility/index.js +1 -0
  619. package/src/components/preferences-modal/index.js +26 -22
  620. package/src/components/provider/disable-non-page-content-blocks.js +40 -20
  621. package/src/components/provider/index.js +17 -8
  622. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  623. package/src/components/provider/use-block-editor-settings.js +70 -44
  624. package/src/components/provider/with-registry-provider.js +1 -0
  625. package/src/components/start-page-options/index.js +135 -0
  626. package/src/components/start-page-options/style.scss +26 -0
  627. package/src/components/template-areas/index.js +85 -0
  628. package/src/components/template-areas/style.scss +23 -0
  629. package/src/components/template-validation-notice/index.js +48 -50
  630. package/src/components/theme-support-check/index.js +9 -16
  631. package/src/components/theme-support-check/test/index.js +44 -43
  632. package/src/hooks/pattern-overrides.js +25 -14
  633. package/src/hooks/use-select-nearest-editable-block.js +95 -0
  634. package/src/private-apis.js +21 -0
  635. package/src/store/actions.js +37 -3
  636. package/src/store/constants.js +9 -0
  637. package/src/store/private-actions.js +377 -1
  638. package/src/store/private-selectors.js +101 -18
  639. package/src/store/reducer.js +13 -0
  640. package/src/store/selectors.js +51 -46
  641. package/src/store/utils/get-filtered-template-parts.js +69 -0
  642. package/src/store/utils/is-template-revertable.js +23 -0
  643. package/src/store/utils/test/get-filtered-template-parts.js +189 -0
  644. package/src/style.scss +8 -2
  645. package/src/components/post-publish-button/style.scss +0 -8
  646. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -90
  647. package/src/components/template-validation-notice/style.scss +0 -9
@@ -0,0 +1,156 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect } from '@wordpress/data';
5
+ import { useState } from '@wordpress/element';
6
+ import { __ } from '@wordpress/i18n';
7
+ import {
8
+ privateApis as componentsPrivateApis,
9
+ Button,
10
+ Modal,
11
+ } from '@wordpress/components';
12
+ import { moreVertical } from '@wordpress/icons';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { unlock } from '../../lock-unlock';
18
+ import { usePostActions } from './actions';
19
+ import { store as editorStore } from '../../store';
20
+ import {
21
+ TEMPLATE_POST_TYPE,
22
+ TEMPLATE_PART_POST_TYPE,
23
+ PATTERN_POST_TYPE,
24
+ } from '../../store/constants';
25
+
26
+ const {
27
+ DropdownMenuV2: DropdownMenu,
28
+ DropdownMenuGroupV2: DropdownMenuGroup,
29
+ DropdownMenuItemV2: DropdownMenuItem,
30
+ DropdownMenuItemLabelV2: DropdownMenuItemLabel,
31
+ kebabCase,
32
+ } = unlock( componentsPrivateApis );
33
+
34
+ const POST_ACTIONS_WHILE_EDITING = [
35
+ 'view-post',
36
+ 'view-post-revisions',
37
+ 'rename-post',
38
+ 'move-to-trash',
39
+ ];
40
+
41
+ export default function PostActions( { onActionPerformed, buttonProps } ) {
42
+ const { postType, item } = useSelect( ( select ) => {
43
+ const { getCurrentPostType, getCurrentPost } = select( editorStore );
44
+ return {
45
+ postType: getCurrentPostType(),
46
+ item: getCurrentPost(),
47
+ };
48
+ } );
49
+ const actions = usePostActions(
50
+ onActionPerformed,
51
+ POST_ACTIONS_WHILE_EDITING
52
+ );
53
+
54
+ if (
55
+ [
56
+ TEMPLATE_POST_TYPE,
57
+ TEMPLATE_PART_POST_TYPE,
58
+ PATTERN_POST_TYPE,
59
+ ].includes( postType )
60
+ ) {
61
+ return null;
62
+ }
63
+ return (
64
+ <DropdownMenu
65
+ trigger={
66
+ <Button
67
+ size="small"
68
+ icon={ moreVertical }
69
+ label={ __( 'Actions' ) }
70
+ disabled={ ! actions.length }
71
+ className="editor-all-actions-button"
72
+ { ...buttonProps }
73
+ />
74
+ }
75
+ placement="bottom-end"
76
+ >
77
+ <ActionsDropdownMenuGroup actions={ actions } item={ item } />
78
+ </DropdownMenu>
79
+ );
80
+ }
81
+
82
+ // From now on all the functions on this file are copied as from the dataviews packages,
83
+ // The editor packages should not be using the dataviews packages directly,
84
+ // and the dataviews package should not be using the editor packages directly,
85
+ // so duplicating the code here seems like the least bad option.
86
+
87
+ // Copied as is from packages/dataviews/src/item-actions.js
88
+ function DropdownMenuItemTrigger( { action, onClick } ) {
89
+ return (
90
+ <DropdownMenuItem
91
+ onClick={ onClick }
92
+ hideOnClick={ ! action.RenderModal }
93
+ >
94
+ <DropdownMenuItemLabel>{ action.label }</DropdownMenuItemLabel>
95
+ </DropdownMenuItem>
96
+ );
97
+ }
98
+
99
+ // Copied as is from packages/dataviews/src/item-actions.js
100
+ function ActionWithModal( { action, item, ActionTrigger } ) {
101
+ const [ isModalOpen, setIsModalOpen ] = useState( false );
102
+ const actionTriggerProps = {
103
+ action,
104
+ onClick: () => setIsModalOpen( true ),
105
+ };
106
+ const { RenderModal, hideModalHeader } = action;
107
+ return (
108
+ <>
109
+ <ActionTrigger { ...actionTriggerProps } />
110
+ { isModalOpen && (
111
+ <Modal
112
+ title={ action.modalHeader || action.label }
113
+ __experimentalHideHeader={ !! hideModalHeader }
114
+ onRequestClose={ () => {
115
+ setIsModalOpen( false );
116
+ } }
117
+ overlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(
118
+ action.id
119
+ ) }` }
120
+ >
121
+ <RenderModal
122
+ items={ [ item ] }
123
+ closeModal={ () => setIsModalOpen( false ) }
124
+ />
125
+ </Modal>
126
+ ) }
127
+ </>
128
+ );
129
+ }
130
+
131
+ // Copied as is from packages/dataviews/src/item-actions.js
132
+ function ActionsDropdownMenuGroup( { actions, item } ) {
133
+ return (
134
+ <DropdownMenuGroup>
135
+ { actions.map( ( action ) => {
136
+ if ( action.RenderModal ) {
137
+ return (
138
+ <ActionWithModal
139
+ key={ action.id }
140
+ action={ action }
141
+ item={ item }
142
+ ActionTrigger={ DropdownMenuItemTrigger }
143
+ />
144
+ );
145
+ }
146
+ return (
147
+ <DropdownMenuItemTrigger
148
+ key={ action.id }
149
+ action={ action }
150
+ onClick={ () => action.callback( [ item ] ) }
151
+ />
152
+ );
153
+ } ) }
154
+ </DropdownMenuGroup>
155
+ );
156
+ }
@@ -0,0 +1,3 @@
1
+ .editor-action-modal {
2
+ z-index: z-index(".editor-action-modal");
3
+ }
@@ -0,0 +1,168 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import {
10
+ Icon,
11
+ __experimentalHStack as HStack,
12
+ __experimentalVStack as VStack,
13
+ __experimentalText as Text,
14
+ PanelBody,
15
+ } from '@wordpress/components';
16
+ import { store as coreStore } from '@wordpress/core-data';
17
+ import { useSelect } from '@wordpress/data';
18
+ import { __, _x, _n, sprintf } from '@wordpress/i18n';
19
+ import { humanTimeDiff } from '@wordpress/date';
20
+ import { decodeEntities } from '@wordpress/html-entities';
21
+ import { count as wordCount } from '@wordpress/wordcount';
22
+ import { useMemo } from '@wordpress/element';
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ import { store as editorStore } from '../../store';
28
+ import {
29
+ TEMPLATE_POST_TYPE,
30
+ TEMPLATE_PART_POST_TYPE,
31
+ } from '../../store/constants';
32
+ import { unlock } from '../../lock-unlock';
33
+ import TemplateAreas from '../template-areas';
34
+
35
+ export default function PostCardPanel( { className, actions } ) {
36
+ const { modified, title, templateInfo, icon, postType, isPostsPage } =
37
+ useSelect( ( select ) => {
38
+ const {
39
+ getEditedPostAttribute,
40
+ getCurrentPostType,
41
+ getCurrentPostId,
42
+ __experimentalGetTemplateInfo,
43
+ } = select( editorStore );
44
+ const { getEditedEntityRecord, getEntityRecord } =
45
+ select( coreStore );
46
+ const siteSettings = getEntityRecord( 'root', 'site' );
47
+ const _type = getCurrentPostType();
48
+ const _id = getCurrentPostId();
49
+ const _record = getEditedEntityRecord( 'postType', _type, _id );
50
+ const _templateInfo = __experimentalGetTemplateInfo( _record );
51
+ return {
52
+ title:
53
+ _templateInfo?.title || getEditedPostAttribute( 'title' ),
54
+ modified: getEditedPostAttribute( 'modified' ),
55
+ id: _id,
56
+ postType: _type,
57
+ templateInfo: _templateInfo,
58
+ icon: unlock( select( editorStore ) ).getPostIcon( _type, {
59
+ area: _record?.area,
60
+ } ),
61
+ isPostsPage: +_id === siteSettings?.page_for_posts,
62
+ };
63
+ }, [] );
64
+ const description = templateInfo?.description;
65
+ const lastEditedText =
66
+ modified &&
67
+ sprintf(
68
+ // translators: %s: Human-readable time difference, e.g. "2 days ago".
69
+ __( 'Last edited %s.' ),
70
+ humanTimeDiff( modified )
71
+ );
72
+ const showPostContentInfo =
73
+ ! isPostsPage &&
74
+ ! [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes( postType );
75
+ return (
76
+ <PanelBody>
77
+ <div
78
+ className={ classnames( 'editor-post-card-panel', className ) }
79
+ >
80
+ <HStack
81
+ spacing={ 2 }
82
+ className="editor-post-card-panel__header"
83
+ align="flex-start"
84
+ >
85
+ <Icon
86
+ className="editor-post-card-panel__icon"
87
+ icon={ icon }
88
+ />
89
+ <Text
90
+ numberOfLines={ 2 }
91
+ truncate
92
+ className="editor-post-card-panel__title"
93
+ weight={ 500 }
94
+ as="h2"
95
+ >
96
+ { title ? decodeEntities( title ) : __( 'No Title' ) }
97
+ </Text>
98
+ { actions }
99
+ </HStack>
100
+ <VStack className="editor-post-card-panel__content">
101
+ { ( description ||
102
+ lastEditedText ||
103
+ showPostContentInfo ) && (
104
+ <VStack
105
+ className="editor-post-card-panel__description"
106
+ spacing={ 2 }
107
+ >
108
+ { description && <Text>{ description }</Text> }
109
+ { showPostContentInfo && <PostContentInfo /> }
110
+ { lastEditedText && (
111
+ <Text>{ lastEditedText }</Text>
112
+ ) }
113
+ </VStack>
114
+ ) }
115
+ { postType === TEMPLATE_POST_TYPE && <TemplateAreas /> }
116
+ </VStack>
117
+ </div>
118
+ </PanelBody>
119
+ );
120
+ }
121
+
122
+ // Taken from packages/editor/src/components/time-to-read/index.js.
123
+ const AVERAGE_READING_RATE = 189;
124
+
125
+ // This component renders the wordcount and reading time for the post.
126
+ function PostContentInfo() {
127
+ const postContent = useSelect(
128
+ ( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),
129
+ []
130
+ );
131
+ /*
132
+ * translators: If your word count is based on single characters (e.g. East Asian characters),
133
+ * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
134
+ * Do not translate into your own language.
135
+ */
136
+ const wordCountType = _x( 'words', 'Word count type. Do not translate!' );
137
+ const wordsCounted = useMemo(
138
+ () => ( postContent ? wordCount( postContent, wordCountType ) : 0 ),
139
+ [ postContent, wordCountType ]
140
+ );
141
+ if ( ! wordsCounted ) {
142
+ return null;
143
+ }
144
+ const readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );
145
+ const wordsCountText = sprintf(
146
+ // translators: %s: the number of words in the post.
147
+ _n( '%s word', '%s words', wordsCounted ),
148
+ wordsCounted.toLocaleString()
149
+ );
150
+ const minutesText =
151
+ readingTime <= 1
152
+ ? __( '1 minute' )
153
+ : sprintf(
154
+ // translators: %s: the number of minutes to read the post.
155
+ _n( '%s minute', '%s minutes', readingTime ),
156
+ readingTime.toLocaleString()
157
+ );
158
+ return (
159
+ <Text>
160
+ { sprintf(
161
+ /* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */
162
+ __( '%1$s, %2$s read time.' ),
163
+ wordsCountText,
164
+ minutesText
165
+ ) }
166
+ </Text>
167
+ );
168
+ }
@@ -0,0 +1,32 @@
1
+ .editor-post-card-panel {
2
+ &__content {
3
+ flex-grow: 1;
4
+ }
5
+
6
+ &__title {
7
+ width: 100%;
8
+
9
+ &.editor-post-card-panel__title {
10
+ margin: 3px 0 0 0;
11
+ }
12
+ }
13
+
14
+ &__icon {
15
+ flex: 0 0 $icon-size;
16
+ width: $icon-size;
17
+ height: $icon-size;
18
+ }
19
+
20
+ &__header {
21
+ display: flex;
22
+ justify-content: space-between;
23
+ margin: 0 0 $grid-unit-10;
24
+ }
25
+
26
+ &__description {
27
+ color: $gray-700;
28
+ & .components-text {
29
+ color: inherit;
30
+ }
31
+ }
32
+ }
@@ -9,6 +9,14 @@ import { useSelect } from '@wordpress/data';
9
9
  import PostTypeSupportCheck from '../post-type-support-check';
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
+ /**
13
+ * Component for checking if the post type supports the excerpt field.
14
+ *
15
+ * @param {Object} props Props.
16
+ * @param {Element} props.children Children to be rendered.
17
+ *
18
+ * @return {Component} The component to be rendered.
19
+ */
12
20
  function PostExcerptCheck( { children } ) {
13
21
  const postType = useSelect( ( select ) => {
14
22
  const { getEditedPostAttribute } = select( editorStore );
@@ -12,7 +12,6 @@
12
12
 
13
13
  .editor-post-featured-image__container {
14
14
  position: relative;
15
- aspect-ratio: 2/1;
16
15
 
17
16
  &:hover,
18
17
  &:focus,
@@ -31,8 +30,9 @@
31
30
  @include reduce-motion("transition");
32
31
  box-shadow: 0 0 0 0 var(--wp-admin-theme-color);
33
32
  overflow: hidden; // Ensure the focus style properly encapsulates the image.
34
- outline: $border-width solid rgba(0, 0, 0, 0.1);
35
33
  outline-offset: -#{$border-width};
34
+ min-height: $grid-unit-50 * 2;
35
+ margin-bottom: $grid-unit-20;
36
36
 
37
37
  display: flex;
38
38
  justify-content: center;
@@ -40,6 +40,7 @@
40
40
 
41
41
  .editor-post-featured-image__preview {
42
42
  height: auto;
43
+ outline: $border-width solid rgba($black, 0.1);
43
44
 
44
45
  .editor-post-featured-image__preview-image {
45
46
  object-fit: cover;
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import classnames from 'classnames';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -10,7 +5,6 @@ import { Button } from '@wordpress/components';
10
5
  import { Component, createRef } from '@wordpress/element';
11
6
  import { withSelect, withDispatch } from '@wordpress/data';
12
7
  import { compose } from '@wordpress/compose';
13
- import { __ } from '@wordpress/i18n';
14
8
 
15
9
  /**
16
10
  * Internal dependencies
@@ -112,13 +106,14 @@ export class PostPublishButton extends Component {
112
106
  isSaving,
113
107
  isAutoSaving,
114
108
  isToggle,
115
- onSave,
116
- onStatusChange,
109
+ savePostStatus,
117
110
  onSubmit = noop,
118
111
  onToggle,
119
112
  visibility,
120
113
  hasNonPostEntityChanges,
121
114
  isSavingNonPostEntityChanges,
115
+ postStatus,
116
+ postStatusHasChanged,
122
117
  } = this.props;
123
118
 
124
119
  const isButtonDisabled =
@@ -135,15 +130,19 @@ export class PostPublishButton extends Component {
135
130
  ( ! isPublishable && ! forceIsDirty ) ) &&
136
131
  ( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );
137
132
 
138
- let publishStatus;
139
- if ( ! hasPublishAction ) {
133
+ // If the new status has not changed explicitely, we derive it from
134
+ // other factors, like having a publish action, etc.. We need to preserve
135
+ // this because it affects when to show the pre and post publish panels.
136
+ // If it has changed though explicitely, we need to respect that.
137
+ let publishStatus = 'publish';
138
+ if ( postStatusHasChanged ) {
139
+ publishStatus = postStatus;
140
+ } else if ( ! hasPublishAction ) {
140
141
  publishStatus = 'pending';
141
142
  } else if ( visibility === 'private' ) {
142
143
  publishStatus = 'private';
143
144
  } else if ( isBeingScheduled ) {
144
145
  publishStatus = 'future';
145
- } else {
146
- publishStatus = 'publish';
147
146
  }
148
147
 
149
148
  const onClickButton = () => {
@@ -151,10 +150,10 @@ export class PostPublishButton extends Component {
151
150
  return;
152
151
  }
153
152
  onSubmit();
154
- onStatusChange( publishStatus );
155
- onSave();
153
+ savePostStatus( publishStatus );
156
154
  };
157
155
 
156
+ // Callback to open the publish panel.
158
157
  const onClickToggle = () => {
159
158
  if ( isToggleDisabled ) {
160
159
  return;
@@ -179,33 +178,16 @@ export class PostPublishButton extends Component {
179
178
  size: 'compact',
180
179
  onClick: this.createOnClick( onClickToggle ),
181
180
  };
182
-
183
- const toggleChildren = isBeingScheduled
184
- ? __( 'Schedule…' )
185
- : __( 'Publish' );
186
- const buttonChildren = (
187
- <PublishButtonLabel
188
- hasNonPostEntityChanges={ hasNonPostEntityChanges }
189
- />
190
- );
191
-
192
181
  const componentProps = isToggle ? toggleProps : buttonProps;
193
- const componentChildren = isToggle ? toggleChildren : buttonChildren;
194
182
  return (
195
183
  <>
196
184
  <Button
197
185
  ref={ this.buttonNode }
198
186
  { ...componentProps }
199
- className={ classnames(
200
- componentProps.className,
201
- 'editor-post-publish-button__button',
202
- {
203
- 'has-changes-dot': hasNonPostEntityChanges,
204
- }
205
- ) }
187
+ className={ `${ componentProps.className } editor-post-publish-button__button` }
206
188
  size="compact"
207
189
  >
208
- { componentChildren }
190
+ <PublishButtonLabel />
209
191
  </Button>
210
192
  </>
211
193
  );
@@ -228,6 +210,8 @@ export default compose( [
228
210
  getCurrentPostId,
229
211
  hasNonPostEntityChanges,
230
212
  isSavingNonPostEntityChanges,
213
+ getEditedPostAttribute,
214
+ getPostEdits,
231
215
  } = select( editorStore );
232
216
  return {
233
217
  isSaving: isSavingPost(),
@@ -242,6 +226,8 @@ export default compose( [
242
226
  getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
243
227
  postType: getCurrentPostType(),
244
228
  postId: getCurrentPostId(),
229
+ postStatus: getEditedPostAttribute( 'status' ),
230
+ postStatusHasChanged: getPostEdits()?.status,
245
231
  hasNonPostEntityChanges: hasNonPostEntityChanges(),
246
232
  isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
247
233
  };
@@ -249,9 +235,10 @@ export default compose( [
249
235
  withDispatch( ( dispatch ) => {
250
236
  const { editPost, savePost } = dispatch( editorStore );
251
237
  return {
252
- onStatusChange: ( status ) =>
253
- editPost( { status }, { undoIgnore: true } ),
254
- onSave: savePost,
238
+ savePostStatus: ( status ) => {
239
+ editPost( { status }, { undoIgnore: true } );
240
+ savePost();
241
+ },
255
242
  };
256
243
  } ),
257
244
  ] )( PostPublishButton );
@@ -2,49 +2,27 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { compose } from '@wordpress/compose';
6
- import { withSelect } from '@wordpress/data';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { useViewportMatch } from '@wordpress/compose';
7
7
 
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
11
11
  import { store as editorStore } from '../../store';
12
12
 
13
- export function PublishButtonLabel( {
14
- isPublished,
15
- isBeingScheduled,
16
- isSaving,
17
- isPublishing,
18
- hasPublishAction,
19
- isAutosaving,
20
- hasNonPostEntityChanges,
21
- } ) {
22
- if ( isPublishing ) {
23
- /* translators: button label text should, if possible, be under 16 characters. */
24
- return __( 'Publishing…' );
25
- } else if ( isPublished && isSaving && ! isAutosaving ) {
26
- /* translators: button label text should, if possible, be under 16 characters. */
27
- return __( 'Updating…' );
28
- } else if ( isBeingScheduled && isSaving && ! isAutosaving ) {
29
- /* translators: button label text should, if possible, be under 16 characters. */
30
- return __( 'Scheduling…' );
31
- }
32
-
33
- if ( ! hasPublishAction ) {
34
- return hasNonPostEntityChanges
35
- ? __( 'Submit for Review…' )
36
- : __( 'Submit for Review' );
37
- } else if ( isPublished ) {
38
- return hasNonPostEntityChanges ? __( 'Update…' ) : __( 'Update' );
39
- } else if ( isBeingScheduled ) {
40
- return hasNonPostEntityChanges ? __( 'Schedule…' ) : __( 'Schedule' );
41
- }
42
-
43
- return __( 'Publish' );
44
- }
45
-
46
- export default compose( [
47
- withSelect( ( select ) => {
13
+ export default function PublishButtonLabel() {
14
+ const isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );
15
+ const {
16
+ isPublished,
17
+ isBeingScheduled,
18
+ isSaving,
19
+ isPublishing,
20
+ hasPublishAction,
21
+ isAutosaving,
22
+ hasNonPostEntityChanges,
23
+ postStatusHasChanged,
24
+ postStatus,
25
+ } = useSelect( ( select ) => {
48
26
  const {
49
27
  isCurrentPostPublished,
50
28
  isEditedPostBeingScheduled,
@@ -53,6 +31,8 @@ export default compose( [
53
31
  getCurrentPost,
54
32
  getCurrentPostType,
55
33
  isAutosavingPost,
34
+ getPostEdits,
35
+ getEditedPostAttribute,
56
36
  } = select( editorStore );
57
37
  return {
58
38
  isPublished: isCurrentPostPublished(),
@@ -63,6 +43,41 @@ export default compose( [
63
43
  getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
64
44
  postType: getCurrentPostType(),
65
45
  isAutosaving: isAutosavingPost(),
46
+ hasNonPostEntityChanges:
47
+ select( editorStore ).hasNonPostEntityChanges(),
48
+ postStatusHasChanged: !! getPostEdits()?.status,
49
+ postStatus: getEditedPostAttribute( 'status' ),
66
50
  };
67
- } ),
68
- ] )( PublishButtonLabel );
51
+ }, [] );
52
+ if ( isPublishing ) {
53
+ /* translators: button label text should, if possible, be under 16 characters. */
54
+ return __( 'Publishing…' );
55
+ } else if (
56
+ ( isPublished || isBeingScheduled ) &&
57
+ isSaving &&
58
+ ! isAutosaving
59
+ ) {
60
+ /* translators: button label text should, if possible, be under 16 characters. */
61
+ return __( 'Saving…' );
62
+ }
63
+ if ( ! hasPublishAction ) {
64
+ // TODO: this is because "Submit for review" string is too long in some languages.
65
+ // @see https://github.com/WordPress/gutenberg/issues/10475
66
+ return isSmallerThanMediumViewport
67
+ ? __( 'Publish' )
68
+ : __( 'Submit for Review' );
69
+ }
70
+ if (
71
+ hasNonPostEntityChanges ||
72
+ isPublished ||
73
+ ( postStatusHasChanged &&
74
+ ! [ 'future', 'publish' ].includes( postStatus ) ) ||
75
+ ( ! postStatusHasChanged && postStatus === 'future' )
76
+ ) {
77
+ return __( 'Save' );
78
+ }
79
+ if ( isBeingScheduled ) {
80
+ return __( 'Schedule' );
81
+ }
82
+ return __( 'Publish' );
83
+ }