@wordpress/editor 14.3.0 → 14.5.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 (537) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -1
  3. package/build/bindings/api.js +65 -0
  4. package/build/bindings/api.js.map +1 -0
  5. package/build/bindings/pattern-overrides.js +23 -13
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +35 -12
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/block-settings-menu/content-only-settings-menu.js +4 -1
  10. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  11. package/build/components/blog-title/index.js +7 -3
  12. package/build/components/blog-title/index.js.map +1 -1
  13. package/build/components/collapsible-block-toolbar/index.js +2 -3
  14. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  15. package/build/components/commands/index.js +8 -2
  16. package/build/components/commands/index.js.map +1 -1
  17. package/build/components/document-bar/index.js +1 -1
  18. package/build/components/document-bar/index.js.map +1 -1
  19. package/build/components/global-styles-provider/index.js +15 -3
  20. package/build/components/global-styles-provider/index.js.map +1 -1
  21. package/build/components/header/back-button.js +7 -8
  22. package/build/components/header/back-button.js.map +1 -1
  23. package/build/components/header/index.js +21 -20
  24. package/build/components/header/index.js.map +1 -1
  25. package/build/components/page-attributes/order.js +1 -67
  26. package/build/components/page-attributes/order.js.map +1 -1
  27. package/build/components/page-attributes/panel.js +1 -4
  28. package/build/components/page-attributes/panel.js.map +1 -1
  29. package/build/components/page-attributes/parent.js +6 -2
  30. package/build/components/page-attributes/parent.js.map +1 -1
  31. package/build/components/post-actions/actions.js +131 -344
  32. package/build/components/post-actions/actions.js.map +1 -1
  33. package/build/components/post-actions/index.js +16 -6
  34. package/build/components/post-actions/index.js.map +1 -1
  35. package/build/components/post-author/hook.js +10 -3
  36. package/build/components/post-author/hook.js.map +1 -1
  37. package/build/components/post-author/panel.js +2 -1
  38. package/build/components/post-author/panel.js.map +1 -1
  39. package/build/components/post-card-panel/index.js +9 -3
  40. package/build/components/post-card-panel/index.js.map +1 -1
  41. package/build/components/post-comments/index.js +6 -20
  42. package/build/components/post-comments/index.js.map +1 -1
  43. package/build/components/post-content-information/index.js +7 -1
  44. package/build/components/post-content-information/index.js.map +1 -1
  45. package/build/components/post-discussion/panel.js +2 -2
  46. package/build/components/post-discussion/panel.js.map +1 -1
  47. package/build/components/post-excerpt/panel.js +1 -1
  48. package/build/components/post-excerpt/panel.js.map +1 -1
  49. package/build/components/post-featured-image/index.js +3 -1
  50. package/build/components/post-featured-image/index.js.map +1 -1
  51. package/build/components/post-last-revision/index.js +2 -1
  52. package/build/components/post-last-revision/index.js.map +1 -1
  53. package/build/components/post-publish-button/index.js +4 -11
  54. package/build/components/post-publish-button/index.js.map +1 -1
  55. package/build/components/post-publish-panel/maybe-category-panel.js +4 -1
  56. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  57. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -1
  58. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  59. package/build/components/post-status/index.js +47 -51
  60. package/build/components/post-status/index.js.map +1 -1
  61. package/build/components/post-taxonomies/flat-term-selector.js +17 -6
  62. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  63. package/build/components/post-taxonomies/index.js +7 -1
  64. package/build/components/post-taxonomies/index.js.map +1 -1
  65. package/build/components/post-template/block-theme.js +4 -4
  66. package/build/components/post-template/block-theme.js.map +1 -1
  67. package/build/components/post-template/classic-theme.js +8 -2
  68. package/build/components/post-template/classic-theme.js.map +1 -1
  69. package/build/components/post-template/create-new-template-modal.js +3 -0
  70. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  71. package/build/components/post-template/create-new-template.js +4 -1
  72. package/build/components/post-template/create-new-template.js.map +1 -1
  73. package/build/components/post-template/hooks.js +5 -1
  74. package/build/components/post-template/hooks.js.map +1 -1
  75. package/build/components/post-template/panel.js +8 -2
  76. package/build/components/post-template/panel.js.map +1 -1
  77. package/build/components/post-trash/check.js +6 -4
  78. package/build/components/post-trash/check.js.map +1 -1
  79. package/build/components/post-url/panel.js +9 -4
  80. package/build/components/post-url/panel.js.map +1 -1
  81. package/build/components/posts-per-page/index.js +6 -2
  82. package/build/components/posts-per-page/index.js.map +1 -1
  83. package/build/components/preview-dropdown/index.js +82 -17
  84. package/build/components/preview-dropdown/index.js.map +1 -1
  85. package/build/components/provider/disable-non-page-content-blocks.js +14 -18
  86. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  87. package/build/components/provider/use-block-editor-settings.js +15 -6
  88. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  89. package/build/components/save-publish-panels/index.js +1 -2
  90. package/build/components/save-publish-panels/index.js.map +1 -1
  91. package/build/components/sidebar/index.js +3 -9
  92. package/build/components/sidebar/index.js.map +1 -1
  93. package/build/components/site-discussion/index.js +12 -22
  94. package/build/components/site-discussion/index.js.map +1 -1
  95. package/build/components/template-content-panel/index.js +17 -15
  96. package/build/components/template-content-panel/index.js.map +1 -1
  97. package/build/components/visual-editor/edit-template-blocks-notification.js +4 -4
  98. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  99. package/build/components/visual-editor/index.js +7 -3
  100. package/build/components/visual-editor/index.js.map +1 -1
  101. package/build/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  102. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  103. package/build/dataviews/actions/delete-post.js +2 -0
  104. package/build/dataviews/actions/delete-post.js.map +1 -1
  105. package/build/dataviews/actions/export-pattern.native.js +9 -0
  106. package/build/dataviews/actions/export-pattern.native.js.map +1 -0
  107. package/build/dataviews/actions/permanently-delete-post.js +107 -0
  108. package/build/dataviews/actions/permanently-delete-post.js.map +1 -0
  109. package/build/dataviews/actions/restore-post.js +112 -0
  110. package/build/dataviews/actions/restore-post.js.map +1 -0
  111. package/build/dataviews/actions/trash-post.js +142 -0
  112. package/build/dataviews/actions/trash-post.js.map +1 -0
  113. package/build/dataviews/store/private-actions.js +45 -0
  114. package/build/dataviews/store/private-actions.js.map +1 -1
  115. package/build/dataviews/store/private-selectors.js +10 -10
  116. package/build/dataviews/store/private-selectors.js.map +1 -1
  117. package/build/dataviews/store/reducer.js +15 -1
  118. package/build/dataviews/store/reducer.js.map +1 -1
  119. package/build/dataviews/types.js.map +1 -1
  120. package/build/hooks/pattern-overrides.js +1 -1
  121. package/build/hooks/pattern-overrides.js.map +1 -1
  122. package/build/index.js +0 -1
  123. package/build/index.js.map +1 -1
  124. package/build/private-apis.js +3 -2
  125. package/build/private-apis.js.map +1 -1
  126. package/build/store/actions.js +16 -2
  127. package/build/store/actions.js.map +1 -1
  128. package/build/store/private-actions.js +8 -1
  129. package/build/store/private-actions.js.map +1 -1
  130. package/build/store/private-selectors.js +33 -2
  131. package/build/store/private-selectors.js.map +1 -1
  132. package/build/utils/media-upload/index.js +35 -2
  133. package/build/utils/media-upload/index.js.map +1 -1
  134. package/build-module/bindings/api.js +57 -0
  135. package/build-module/bindings/api.js.map +1 -0
  136. package/build-module/bindings/pattern-overrides.js +23 -13
  137. package/build-module/bindings/pattern-overrides.js.map +1 -1
  138. package/build-module/bindings/post-meta.js +35 -12
  139. package/build-module/bindings/post-meta.js.map +1 -1
  140. package/build-module/components/block-settings-menu/content-only-settings-menu.js +4 -1
  141. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  142. package/build-module/components/blog-title/index.js +7 -3
  143. package/build-module/components/blog-title/index.js.map +1 -1
  144. package/build-module/components/collapsible-block-toolbar/index.js +1 -2
  145. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  146. package/build-module/components/commands/index.js +8 -2
  147. package/build-module/components/commands/index.js.map +1 -1
  148. package/build-module/components/document-bar/index.js +1 -1
  149. package/build-module/components/document-bar/index.js.map +1 -1
  150. package/build-module/components/global-styles-provider/index.js +15 -3
  151. package/build-module/components/global-styles-provider/index.js.map +1 -1
  152. package/build-module/components/header/back-button.js +5 -7
  153. package/build-module/components/header/back-button.js.map +1 -1
  154. package/build-module/components/header/index.js +21 -22
  155. package/build-module/components/header/index.js.map +1 -1
  156. package/build-module/components/page-attributes/order.js +4 -70
  157. package/build-module/components/page-attributes/order.js.map +1 -1
  158. package/build-module/components/page-attributes/panel.js +1 -6
  159. package/build-module/components/page-attributes/panel.js.map +1 -1
  160. package/build-module/components/page-attributes/parent.js +7 -3
  161. package/build-module/components/page-attributes/parent.js.map +1 -1
  162. package/build-module/components/post-actions/actions.js +137 -350
  163. package/build-module/components/post-actions/actions.js.map +1 -1
  164. package/build-module/components/post-actions/index.js +16 -6
  165. package/build-module/components/post-actions/index.js.map +1 -1
  166. package/build-module/components/post-author/hook.js +10 -3
  167. package/build-module/components/post-author/hook.js.map +1 -1
  168. package/build-module/components/post-author/panel.js +2 -1
  169. package/build-module/components/post-author/panel.js.map +1 -1
  170. package/build-module/components/post-card-panel/index.js +9 -3
  171. package/build-module/components/post-card-panel/index.js.map +1 -1
  172. package/build-module/components/post-comments/index.js +8 -24
  173. package/build-module/components/post-comments/index.js.map +1 -1
  174. package/build-module/components/post-content-information/index.js +7 -1
  175. package/build-module/components/post-content-information/index.js.map +1 -1
  176. package/build-module/components/post-discussion/panel.js +3 -3
  177. package/build-module/components/post-discussion/panel.js.map +1 -1
  178. package/build-module/components/post-excerpt/panel.js +1 -1
  179. package/build-module/components/post-excerpt/panel.js.map +1 -1
  180. package/build-module/components/post-featured-image/index.js +3 -1
  181. package/build-module/components/post-featured-image/index.js.map +1 -1
  182. package/build-module/components/post-last-revision/index.js +2 -1
  183. package/build-module/components/post-last-revision/index.js.map +1 -1
  184. package/build-module/components/post-publish-button/index.js +4 -11
  185. package/build-module/components/post-publish-button/index.js.map +1 -1
  186. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -1
  187. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  188. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -1
  189. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  190. package/build-module/components/post-status/index.js +49 -53
  191. package/build-module/components/post-status/index.js.map +1 -1
  192. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -6
  193. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  194. package/build-module/components/post-taxonomies/index.js +7 -1
  195. package/build-module/components/post-taxonomies/index.js.map +1 -1
  196. package/build-module/components/post-template/block-theme.js +4 -4
  197. package/build-module/components/post-template/block-theme.js.map +1 -1
  198. package/build-module/components/post-template/classic-theme.js +8 -2
  199. package/build-module/components/post-template/classic-theme.js.map +1 -1
  200. package/build-module/components/post-template/create-new-template-modal.js +3 -0
  201. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  202. package/build-module/components/post-template/create-new-template.js +4 -1
  203. package/build-module/components/post-template/create-new-template.js.map +1 -1
  204. package/build-module/components/post-template/hooks.js +5 -1
  205. package/build-module/components/post-template/hooks.js.map +1 -1
  206. package/build-module/components/post-template/panel.js +8 -2
  207. package/build-module/components/post-template/panel.js.map +1 -1
  208. package/build-module/components/post-trash/check.js +6 -4
  209. package/build-module/components/post-trash/check.js.map +1 -1
  210. package/build-module/components/post-url/panel.js +10 -7
  211. package/build-module/components/post-url/panel.js.map +1 -1
  212. package/build-module/components/posts-per-page/index.js +6 -2
  213. package/build-module/components/posts-per-page/index.js.map +1 -1
  214. package/build-module/components/preview-dropdown/index.js +84 -19
  215. package/build-module/components/preview-dropdown/index.js.map +1 -1
  216. package/build-module/components/provider/disable-non-page-content-blocks.js +15 -19
  217. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  218. package/build-module/components/provider/use-block-editor-settings.js +15 -6
  219. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  220. package/build-module/components/save-publish-panels/index.js +1 -2
  221. package/build-module/components/save-publish-panels/index.js.map +1 -1
  222. package/build-module/components/sidebar/index.js +3 -9
  223. package/build-module/components/sidebar/index.js.map +1 -1
  224. package/build-module/components/site-discussion/index.js +14 -24
  225. package/build-module/components/site-discussion/index.js.map +1 -1
  226. package/build-module/components/template-content-panel/index.js +18 -16
  227. package/build-module/components/template-content-panel/index.js.map +1 -1
  228. package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -4
  229. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  230. package/build-module/components/visual-editor/index.js +7 -3
  231. package/build-module/components/visual-editor/index.js.map +1 -1
  232. package/build-module/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  233. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  234. package/build-module/dataviews/actions/delete-post.js +2 -0
  235. package/build-module/dataviews/actions/delete-post.js.map +1 -1
  236. package/build-module/dataviews/actions/export-pattern.native.js +3 -0
  237. package/build-module/dataviews/actions/export-pattern.native.js.map +1 -0
  238. package/build-module/dataviews/actions/permanently-delete-post.js +99 -0
  239. package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -0
  240. package/build-module/dataviews/actions/restore-post.js +104 -0
  241. package/build-module/dataviews/actions/restore-post.js.map +1 -0
  242. package/build-module/dataviews/actions/trash-post.js +135 -0
  243. package/build-module/dataviews/actions/trash-post.js.map +1 -0
  244. package/build-module/dataviews/store/private-actions.js +40 -0
  245. package/build-module/dataviews/store/private-actions.js.map +1 -1
  246. package/build-module/dataviews/store/private-selectors.js +8 -9
  247. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  248. package/build-module/dataviews/store/reducer.js +15 -1
  249. package/build-module/dataviews/store/reducer.js.map +1 -1
  250. package/build-module/dataviews/types.js.map +1 -1
  251. package/build-module/hooks/pattern-overrides.js +1 -1
  252. package/build-module/hooks/pattern-overrides.js.map +1 -1
  253. package/build-module/index.js +0 -1
  254. package/build-module/index.js.map +1 -1
  255. package/build-module/private-apis.js +3 -2
  256. package/build-module/private-apis.js.map +1 -1
  257. package/build-module/store/actions.js +16 -2
  258. package/build-module/store/actions.js.map +1 -1
  259. package/build-module/store/private-actions.js +8 -1
  260. package/build-module/store/private-actions.js.map +1 -1
  261. package/build-module/store/private-selectors.js +32 -2
  262. package/build-module/store/private-selectors.js.map +1 -1
  263. package/build-module/utils/media-upload/index.js +36 -3
  264. package/build-module/utils/media-upload/index.js.map +1 -1
  265. package/build-style/style-rtl.css +97 -45
  266. package/build-style/style.css +97 -45
  267. package/build-types/bindings/api.d.ts +25 -0
  268. package/build-types/bindings/api.d.ts.map +1 -0
  269. package/build-types/bindings/pattern-overrides.d.ts +5 -6
  270. package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
  271. package/build-types/bindings/post-meta.d.ts +11 -7
  272. package/build-types/bindings/post-meta.d.ts.map +1 -1
  273. package/build-types/components/autocompleters/user.d.ts +2 -2
  274. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  275. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  276. package/build-types/components/blog-title/index.d.ts.map +1 -1
  277. package/build-types/components/collapsible-block-toolbar/index.d.ts +1 -2
  278. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -1
  279. package/build-types/components/commands/index.d.ts.map +1 -1
  280. package/build-types/components/document-bar/index.d.ts.map +1 -1
  281. package/build-types/components/document-outline/check.d.ts.map +1 -1
  282. package/build-types/components/document-outline/index.d.ts.map +1 -1
  283. package/build-types/components/editor-history/redo.d.ts +1 -1
  284. package/build-types/components/editor-history/undo.d.ts +1 -1
  285. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  286. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  287. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  288. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  289. package/build-types/components/header/back-button.d.ts +1 -0
  290. package/build-types/components/header/back-button.d.ts.map +1 -1
  291. package/build-types/components/header/index.d.ts.map +1 -1
  292. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  293. package/build-types/components/media-categories/index.d.ts.map +1 -1
  294. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  295. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  296. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  297. package/build-types/components/page-attributes/order.d.ts +1 -1
  298. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  299. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  300. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  301. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  302. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  303. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  304. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  305. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  306. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  307. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  308. package/build-types/components/post-actions/index.d.ts.map +1 -1
  309. package/build-types/components/post-author/check.d.ts.map +1 -1
  310. package/build-types/components/post-author/hook.d.ts +1 -1
  311. package/build-types/components/post-author/hook.d.ts.map +1 -1
  312. package/build-types/components/post-author/index.d.ts.map +1 -1
  313. package/build-types/components/post-author/panel.d.ts.map +1 -1
  314. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  315. package/build-types/components/post-comments/index.d.ts.map +1 -1
  316. package/build-types/components/post-content-information/index.d.ts.map +1 -1
  317. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  318. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  319. package/build-types/components/post-excerpt/index.d.ts.map +1 -1
  320. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  321. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  322. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  323. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  324. package/build-types/components/post-format/index.d.ts.map +1 -1
  325. package/build-types/components/post-format/panel.d.ts.map +1 -1
  326. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  327. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  328. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  329. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  330. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  331. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  332. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  333. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  334. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  335. package/build-types/components/post-saved-state/index.d.ts +1 -1
  336. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  337. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  338. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  339. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  340. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  341. package/build-types/components/post-slug/check.d.ts.map +1 -1
  342. package/build-types/components/post-slug/index.d.ts.map +1 -1
  343. package/build-types/components/post-status/index.d.ts +2 -1
  344. package/build-types/components/post-status/index.d.ts.map +1 -1
  345. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  346. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  347. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  348. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  349. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  350. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +9 -7
  351. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  352. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +13 -11
  353. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  354. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  355. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  356. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  357. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  358. package/build-types/components/post-template/create-new-template.d.ts.map +1 -1
  359. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  360. package/build-types/components/post-template/panel.d.ts.map +1 -1
  361. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  362. package/build-types/components/post-trash/check.d.ts.map +1 -1
  363. package/build-types/components/post-trash/index.d.ts.map +1 -1
  364. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  365. package/build-types/components/post-url/check.d.ts.map +1 -1
  366. package/build-types/components/post-url/index.d.ts.map +1 -1
  367. package/build-types/components/post-url/label.d.ts.map +1 -1
  368. package/build-types/components/post-url/panel.d.ts.map +1 -1
  369. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  370. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  371. package/build-types/components/posts-per-page/index.d.ts.map +1 -1
  372. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  373. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  374. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  375. package/build-types/components/provider/index.d.ts.map +1 -1
  376. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  377. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  378. package/build-types/components/sidebar/index.d.ts.map +1 -1
  379. package/build-types/components/site-discussion/index.d.ts.map +1 -1
  380. package/build-types/components/template-content-panel/index.d.ts +1 -3
  381. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  382. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  383. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  384. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  385. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
  386. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  387. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  388. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -0
  389. package/build-types/components/word-count/index.d.ts.map +1 -1
  390. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -1
  391. package/build-types/dataviews/actions/export-pattern.native.d.ts +3 -0
  392. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +1 -0
  393. package/build-types/dataviews/actions/permanently-delete-post.d.ts +5 -0
  394. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -0
  395. package/build-types/dataviews/actions/restore-post.d.ts +5 -0
  396. package/build-types/dataviews/actions/restore-post.d.ts.map +1 -0
  397. package/build-types/dataviews/actions/trash-post.d.ts +5 -0
  398. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -0
  399. package/build-types/dataviews/api.d.ts +1 -1
  400. package/build-types/dataviews/api.d.ts.map +1 -1
  401. package/build-types/dataviews/store/private-actions.d.ts +8 -3
  402. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  403. package/build-types/dataviews/store/private-selectors.d.ts +2 -2
  404. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  405. package/build-types/dataviews/store/reducer.d.ts +4 -1
  406. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  407. package/build-types/dataviews/types.d.ts +9 -0
  408. package/build-types/dataviews/types.d.ts.map +1 -1
  409. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +1 -1
  410. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  411. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  412. package/build-types/private-apis.d.ts.map +1 -1
  413. package/build-types/store/actions.d.ts.map +1 -1
  414. package/build-types/store/private-actions.d.ts.map +1 -1
  415. package/build-types/store/private-selectors.d.ts +11 -0
  416. package/build-types/store/private-selectors.d.ts.map +1 -1
  417. package/build-types/store/reducer.d.ts +1 -0
  418. package/build-types/store/reducer.d.ts.map +1 -1
  419. package/build-types/store/selectors.d.ts +0 -1
  420. package/build-types/store/selectors.d.ts.map +1 -1
  421. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  422. package/package.json +38 -37
  423. package/src/bindings/api.js +57 -0
  424. package/src/bindings/pattern-overrides.js +28 -17
  425. package/src/bindings/post-meta.js +39 -14
  426. package/src/components/block-settings-menu/content-only-settings-menu.js +4 -4
  427. package/src/components/blog-title/index.js +8 -3
  428. package/src/components/collapsible-block-toolbar/index.js +1 -3
  429. package/src/components/collapsible-block-toolbar/style.scss +0 -3
  430. package/src/components/commands/index.js +4 -2
  431. package/src/components/document-bar/index.js +1 -1
  432. package/src/components/document-bar/style.scss +2 -6
  433. package/src/components/document-tools/style.scss +4 -4
  434. package/src/components/editor-interface/style.scss +9 -0
  435. package/src/components/global-styles-provider/index.js +22 -11
  436. package/src/components/header/back-button.js +6 -6
  437. package/src/components/header/index.js +27 -27
  438. package/src/components/header/style.scss +64 -21
  439. package/src/components/inserter-sidebar/style.scss +1 -6
  440. package/src/components/list-view-sidebar/style.scss +4 -0
  441. package/src/components/page-attributes/order.js +3 -77
  442. package/src/components/page-attributes/panel.js +1 -7
  443. package/src/components/page-attributes/parent.js +25 -7
  444. package/src/components/post-actions/actions.js +158 -463
  445. package/src/components/post-actions/index.js +19 -7
  446. package/src/components/post-author/hook.js +11 -3
  447. package/src/components/post-author/panel.js +3 -1
  448. package/src/components/post-card-panel/index.js +9 -3
  449. package/src/components/post-comments/index.js +8 -21
  450. package/src/components/post-content-information/index.js +7 -1
  451. package/src/components/post-discussion/panel.js +5 -3
  452. package/src/components/post-excerpt/panel.js +2 -1
  453. package/src/components/post-featured-image/index.js +5 -1
  454. package/src/components/post-last-revision/index.js +1 -0
  455. package/src/components/post-panel-row/style.scss +0 -1
  456. package/src/components/post-publish-button/index.js +4 -17
  457. package/src/components/post-publish-panel/maybe-category-panel.js +4 -1
  458. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  459. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  460. package/src/components/post-status/index.js +29 -51
  461. package/src/components/post-taxonomies/flat-term-selector.js +19 -5
  462. package/src/components/post-taxonomies/index.js +8 -1
  463. package/src/components/post-template/block-theme.js +5 -1
  464. package/src/components/post-template/classic-theme.js +8 -3
  465. package/src/components/post-template/create-new-template-modal.js +7 -1
  466. package/src/components/post-template/create-new-template.js +4 -1
  467. package/src/components/post-template/hooks.js +8 -2
  468. package/src/components/post-template/panel.js +10 -2
  469. package/src/components/post-trash/check.js +9 -5
  470. package/src/components/post-url/panel.js +15 -4
  471. package/src/components/posts-per-page/index.js +7 -2
  472. package/src/components/preview-dropdown/index.js +113 -35
  473. package/src/components/preview-dropdown/style.scss +5 -0
  474. package/src/components/provider/disable-non-page-content-blocks.js +27 -24
  475. package/src/components/provider/use-block-editor-settings.js +15 -6
  476. package/src/components/save-publish-panels/index.js +1 -4
  477. package/src/components/sidebar/index.js +2 -5
  478. package/src/components/site-discussion/index.js +15 -22
  479. package/src/components/template-content-panel/index.js +37 -21
  480. package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
  481. package/src/components/visual-editor/index.js +13 -8
  482. package/src/components/visual-editor/style.scss +1 -4
  483. package/src/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  484. package/src/dataviews/actions/delete-post.tsx +2 -0
  485. package/src/dataviews/actions/export-pattern.native.tsx +3 -0
  486. package/src/dataviews/actions/permanently-delete-post.tsx +116 -0
  487. package/src/dataviews/actions/restore-post.tsx +134 -0
  488. package/src/dataviews/actions/trash-post.tsx +196 -0
  489. package/src/dataviews/store/private-actions.ts +68 -0
  490. package/src/dataviews/store/private-selectors.ts +9 -17
  491. package/src/dataviews/store/reducer.ts +20 -1
  492. package/src/dataviews/types.ts +11 -0
  493. package/src/hooks/pattern-overrides.js +1 -1
  494. package/src/index.js +0 -1
  495. package/src/private-apis.js +6 -2
  496. package/src/store/actions.js +36 -13
  497. package/src/store/private-actions.js +8 -4
  498. package/src/store/private-selectors.js +45 -2
  499. package/src/store/test/actions.js +9 -3
  500. package/src/store/test/private-selectors.js +78 -0
  501. package/src/utils/media-upload/index.js +38 -3
  502. package/tsconfig.tsbuildinfo +1 -1
  503. package/build/bindings/index.js +0 -22
  504. package/build/bindings/index.js.map +0 -1
  505. package/build/dataviews/actions/index.js +0 -32
  506. package/build/dataviews/actions/index.js.map +0 -1
  507. package/build/hooks/use-select-nearest-editable-block.js.map +0 -1
  508. package/build/store/utils/get-filtered-template-parts.js +0 -71
  509. package/build/store/utils/get-filtered-template-parts.js.map +0 -1
  510. package/build/utils/set-nested-value.js +0 -44
  511. package/build/utils/set-nested-value.js.map +0 -1
  512. package/build-module/bindings/index.js +0 -17
  513. package/build-module/bindings/index.js.map +0 -1
  514. package/build-module/dataviews/actions/index.js +0 -24
  515. package/build-module/dataviews/actions/index.js.map +0 -1
  516. package/build-module/hooks/use-select-nearest-editable-block.js.map +0 -1
  517. package/build-module/store/utils/get-filtered-template-parts.js +0 -64
  518. package/build-module/store/utils/get-filtered-template-parts.js.map +0 -1
  519. package/build-module/utils/set-nested-value.js +0 -38
  520. package/build-module/utils/set-nested-value.js.map +0 -1
  521. package/build-types/bindings/index.d.ts +0 -2
  522. package/build-types/bindings/index.d.ts.map +0 -1
  523. package/build-types/dataviews/actions/index.d.ts +0 -2
  524. package/build-types/dataviews/actions/index.d.ts.map +0 -1
  525. package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +0 -1
  526. package/build-types/store/utils/get-filtered-template-parts.d.ts +0 -3
  527. package/build-types/store/utils/get-filtered-template-parts.d.ts.map +0 -1
  528. package/build-types/utils/set-nested-value.d.ts +0 -20
  529. package/build-types/utils/set-nested-value.d.ts.map +0 -1
  530. package/src/bindings/index.js +0 -15
  531. package/src/components/document-outline/test/__snapshots__/index.js.snap +0 -111
  532. package/src/components/document-outline/test/index.js +0 -185
  533. package/src/dataviews/actions/index.ts +0 -25
  534. package/src/store/utils/get-filtered-template-parts.js +0 -69
  535. package/src/store/utils/test/get-filtered-template-parts.js +0 -189
  536. package/src/utils/set-nested-value.js +0 -39
  537. /package/build-types/{hooks → components/visual-editor}/use-select-nearest-editable-block.d.ts +0 -0
@@ -29,26 +29,38 @@ const {
29
29
 
30
30
  export default function PostActions( { onActionPerformed, buttonProps } ) {
31
31
  const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
32
- const { item, postType } = useSelect( ( select ) => {
32
+ const { item, permissions, postType } = useSelect( ( select ) => {
33
33
  const { getCurrentPostType, getCurrentPostId } = select( editorStore );
34
- const { getEditedEntityRecord } = select( coreStore );
34
+ const { getEditedEntityRecord, getEntityRecordPermissions } = unlock(
35
+ select( coreStore )
36
+ );
35
37
  const _postType = getCurrentPostType();
38
+ const _id = getCurrentPostId();
36
39
  return {
37
- item: getEditedEntityRecord(
40
+ item: getEditedEntityRecord( 'postType', _postType, _id ),
41
+ permissions: getEntityRecordPermissions(
38
42
  'postType',
39
43
  _postType,
40
- getCurrentPostId()
44
+ _id
41
45
  ),
42
46
  postType: _postType,
43
47
  };
44
48
  }, [] );
49
+ const itemWithPermissions = useMemo( () => {
50
+ return {
51
+ ...item,
52
+ permissions,
53
+ };
54
+ }, [ item, permissions ] );
45
55
  const allActions = usePostActions( { postType, onActionPerformed } );
46
56
 
47
57
  const actions = useMemo( () => {
48
58
  return allActions.filter( ( action ) => {
49
- return ! action.isEligible || action.isEligible( item );
59
+ return (
60
+ ! action.isEligible || action.isEligible( itemWithPermissions )
61
+ );
50
62
  } );
51
- }, [ allActions, item ] );
63
+ }, [ allActions, itemWithPermissions ] );
52
64
 
53
65
  return (
54
66
  <DropdownMenu
@@ -72,7 +84,7 @@ export default function PostActions( { onActionPerformed, buttonProps } ) {
72
84
  >
73
85
  <ActionsDropdownMenuGroup
74
86
  actions={ actions }
75
- item={ item }
87
+ item={ itemWithPermissions }
76
88
  onClose={ () => {
77
89
  setIsActionsMenuOpen( false );
78
90
  } }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { __ } from '@wordpress/i18n';
4
5
  import { useMemo } from '@wordpress/element';
5
6
  import { useSelect } from '@wordpress/data';
6
7
  import { decodeEntities } from '@wordpress/html-entities';
@@ -46,17 +47,24 @@ export function useAuthorsQuery( search ) {
46
47
  ( { value } ) => postAuthor?.id === value
47
48
  );
48
49
 
50
+ let currentAuthor = [];
49
51
  if ( foundAuthor < 0 && postAuthor ) {
50
- return [
52
+ currentAuthor = [
51
53
  {
52
54
  value: postAuthor.id,
53
55
  label: decodeEntities( postAuthor.name ),
54
56
  },
55
- ...fetchedAuthors,
57
+ ];
58
+ } else if ( foundAuthor < 0 && ! postAuthor ) {
59
+ currentAuthor = [
60
+ {
61
+ value: 0,
62
+ label: __( '(No author)' ),
63
+ },
56
64
  ];
57
65
  }
58
66
 
59
- return fetchedAuthors;
67
+ return [ ...currentAuthor, ...fetchedAuthors ];
60
68
  }, [ authors, postAuthor ] );
61
69
 
62
70
  return { authorId, authorOptions, postAuthor };
@@ -4,6 +4,7 @@
4
4
  import { __, sprintf } from '@wordpress/i18n';
5
5
  import { Button, Dropdown } from '@wordpress/components';
6
6
  import { useState, useMemo } from '@wordpress/element';
7
+ import { decodeEntities } from '@wordpress/html-entities';
7
8
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
8
9
 
9
10
  /**
@@ -16,7 +17,8 @@ import { useAuthorsQuery } from './hook';
16
17
 
17
18
  function PostAuthorToggle( { isOpen, onClick } ) {
18
19
  const { postAuthor } = useAuthorsQuery();
19
- const authorName = postAuthor?.name || '';
20
+ const authorName =
21
+ decodeEntities( postAuthor?.name ) || __( '(No author)' );
20
22
  return (
21
23
  <Button
22
24
  size="compact"
@@ -36,8 +36,14 @@ export default function PostCardPanel( { actions } ) {
36
36
  getCurrentPostId,
37
37
  __experimentalGetTemplateInfo,
38
38
  } = select( editorStore );
39
+ const { canUser } = select( coreStore );
39
40
  const { getEditedEntityRecord } = select( coreStore );
40
- const siteSettings = getEditedEntityRecord( 'root', 'site' );
41
+ const siteSettings = canUser( 'read', {
42
+ kind: 'root',
43
+ name: 'site',
44
+ } )
45
+ ? getEditedEntityRecord( 'root', 'site' )
46
+ : undefined;
41
47
  const _type = getCurrentPostType();
42
48
  const _id = getCurrentPostId();
43
49
  const _record = getEditedEntityRecord( 'postType', _type, _id );
@@ -95,10 +101,10 @@ export default function PostCardPanel( { actions } ) {
95
101
  as="h2"
96
102
  lineHeight="20px"
97
103
  >
98
- { title ? decodeEntities( title ) : __( 'No Title' ) }
104
+ { title ? decodeEntities( title ) : __( 'No title' ) }
99
105
  { isFrontPage && (
100
106
  <span className="editor-post-card-panel__title-badge">
101
- { __( 'Front Page' ) }
107
+ { __( 'Homepage' ) }
102
108
  </span>
103
109
  ) }
104
110
  { isPostsPage && (
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __ } from '@wordpress/i18n';
4
+ import { __, _x } from '@wordpress/i18n';
5
5
  import {
6
6
  RadioControl,
7
- __experimentalText as Text,
8
7
  __experimentalVStack as VStack,
9
8
  } from '@wordpress/components';
10
9
  import { useDispatch, useSelect } from '@wordpress/data';
@@ -16,29 +15,17 @@ import { store as editorStore } from '../../store';
16
15
 
17
16
  const COMMENT_OPTIONS = [
18
17
  {
19
- label: (
20
- <>
21
- { __( 'Open' ) }
22
- <Text variant="muted" size={ 12 }>
23
- { __( 'Visitors can add new comments and replies.' ) }
24
- </Text>
25
- </>
26
- ),
18
+ label: _x( 'Open', 'Adjective: e.g. "Comments are open"' ),
27
19
  value: 'open',
20
+ description: __( 'Visitors can add new comments and replies.' ),
28
21
  },
29
22
  {
30
- label: (
31
- <>
32
- { __( 'Closed' ) }
33
- <Text variant="muted" size={ 12 }>
34
- { __( 'Visitors cannot add new comments or replies.' ) }
35
- </Text>
36
- <Text variant="muted" size={ 12 }>
37
- { __( 'Existing comments remain visible.' ) }
38
- </Text>
39
- </>
40
- ),
23
+ label: __( 'Closed' ),
41
24
  value: 'closed',
25
+ description: [
26
+ __( 'Visitors cannot add new comments or replies.' ),
27
+ __( 'Existing comments remain visible.' ),
28
+ ].join( ' ' ),
42
29
  },
43
30
  ];
44
31
 
@@ -25,8 +25,14 @@ export default function PostContentInformation() {
25
25
  const { postContent } = useSelect( ( select ) => {
26
26
  const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } =
27
27
  select( editorStore );
28
+ const { canUser } = select( coreStore );
28
29
  const { getEntityRecord } = select( coreStore );
29
- const siteSettings = getEntityRecord( 'root', 'site' );
30
+ const siteSettings = canUser( 'read', {
31
+ kind: 'root',
32
+ name: 'site',
33
+ } )
34
+ ? getEntityRecord( 'root', 'site' )
35
+ : undefined;
30
36
  const postType = getCurrentPostType();
31
37
  const _id = getCurrentPostId();
32
38
  const isPostsPage = +_id === siteSettings?.page_for_posts;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __ } from '@wordpress/i18n';
4
+ import { __, _x } from '@wordpress/i18n';
5
5
  import {
6
6
  Dropdown,
7
7
  Button,
@@ -62,9 +62,11 @@ function PostDiscussionToggle( { isOpen, onClick } ) {
62
62
  let label;
63
63
  if ( commentStatus === 'open' ) {
64
64
  if ( pingStatus === 'open' ) {
65
- label = __( 'Open' );
65
+ label = _x( 'Open', 'Adjective: e.g. "Comments are open"' );
66
66
  } else {
67
- label = trackbacksSupported ? __( 'Comments only' ) : __( 'Open' );
67
+ label = trackbacksSupported
68
+ ? __( 'Comments only' )
69
+ : _x( 'Open', 'Adjective: e.g. "Comments are open"' );
68
70
  }
69
71
  } else if ( pingStatus === 'open' ) {
70
72
  label = commentsSupported ? __( 'Pings only' ) : __( 'Pings enabled' );
@@ -148,7 +148,8 @@ function PrivateExcerpt() {
148
148
  isPattern ||
149
149
  ( template &&
150
150
  template.source === TEMPLATE_ORIGINS.custom &&
151
- ! template.has_theme_file ) ),
151
+ ! template.has_theme_file &&
152
+ template.is_custom ) ),
152
153
  };
153
154
  }, [] );
154
155
  const [ popoverAnchor, setPopoverAnchor ] = useState( null );
@@ -170,13 +170,16 @@ function PostFeaturedImage( {
170
170
  aria-label={
171
171
  ! featuredImageId
172
172
  ? null
173
- : __( 'Edit or replace the image' )
173
+ : __(
174
+ 'Edit or replace the featured image'
175
+ )
174
176
  }
175
177
  aria-describedby={
176
178
  ! featuredImageId
177
179
  ? null
178
180
  : `editor-post-featured-image-${ featuredImageId }-describedby`
179
181
  }
182
+ aria-haspopup="dialog"
180
183
  >
181
184
  { !! featuredImageId && media && (
182
185
  <img
@@ -197,6 +200,7 @@ function PostFeaturedImage( {
197
200
  <Button
198
201
  className="editor-post-featured-image__action"
199
202
  onClick={ open }
203
+ aria-haspopup="dialog"
200
204
  >
201
205
  { __( 'Replace' ) }
202
206
  </Button>
@@ -64,6 +64,7 @@ export function PrivatePostLastRevision() {
64
64
  className="editor-private-post-last-revision__button"
65
65
  text={ revisionsCount }
66
66
  variant="tertiary"
67
+ size="compact"
67
68
  />
68
69
  </PostPanelRow>
69
70
  </PostLastRevisionCheck>
@@ -28,7 +28,6 @@
28
28
  white-space: normal;
29
29
  text-wrap: balance; // Fallback for Safari.
30
30
  text-wrap: pretty;
31
- height: auto;
32
31
  min-height: $button-size-compact;
33
32
  }
34
33
 
@@ -11,7 +11,6 @@ import { compose } from '@wordpress/compose';
11
11
  */
12
12
  import PublishButtonLabel from './label';
13
13
  import { store as editorStore } from '../../store';
14
- import { unlock } from '../../lock-unlock';
15
14
 
16
15
  const noop = () => {};
17
16
 
@@ -46,24 +45,14 @@ export class PostPublishButton extends Component {
46
45
 
47
46
  createOnClick( callback ) {
48
47
  return ( ...args ) => {
49
- const {
50
- hasNonPostEntityChanges,
51
- hasPostMetaChanges,
52
- setEntitiesSavedStatesCallback,
53
- isPublished,
54
- } = this.props;
48
+ const { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =
49
+ this.props;
55
50
  // If a post with non-post entities is published, but the user
56
51
  // elects to not save changes to the non-post entities, those
57
52
  // entities will still be dirty when the Publish button is clicked.
58
53
  // We also need to check that the `setEntitiesSavedStatesCallback`
59
54
  // prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
60
- //
61
- // TODO: Explore how to manage `hasPostMetaChanges` and pre-publish workflow properly.
62
- if (
63
- ( hasNonPostEntityChanges ||
64
- ( hasPostMetaChanges && isPublished ) ) &&
65
- setEntitiesSavedStatesCallback
66
- ) {
55
+ if ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {
67
56
  // The modal for multiple entity saving will open,
68
57
  // hold the callback for saving/publishing the post
69
58
  // so that we can call it if the post entity is checked.
@@ -226,8 +215,7 @@ export default compose( [
226
215
  isSavingNonPostEntityChanges,
227
216
  getEditedPostAttribute,
228
217
  getPostEdits,
229
- hasPostMetaChanges,
230
- } = unlock( select( editorStore ) );
218
+ } = select( editorStore );
231
219
  return {
232
220
  isSaving: isSavingPost(),
233
221
  isAutoSaving: isAutosavingPost(),
@@ -244,7 +232,6 @@ export default compose( [
244
232
  postStatus: getEditedPostAttribute( 'status' ),
245
233
  postStatusHasChanged: getPostEdits()?.status,
246
234
  hasNonPostEntityChanges: hasNonPostEntityChanges(),
247
- hasPostMetaChanges: hasPostMetaChanges(),
248
235
  isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
249
236
  };
250
237
  } ),
@@ -18,7 +18,10 @@ function MaybeCategoryPanel() {
18
18
  const postType = select( editorStore ).getCurrentPostType();
19
19
  const { canUser, getEntityRecord, getTaxonomy } = select( coreStore );
20
20
  const categoriesTaxonomy = getTaxonomy( 'category' );
21
- const defaultCategoryId = canUser( 'read', 'settings' )
21
+ const defaultCategoryId = canUser( 'read', {
22
+ kind: 'root',
23
+ name: 'site',
24
+ } )
22
25
  ? getEntityRecord( 'root', 'site' )?.default_category
23
26
  : undefined;
24
27
  const defaultCategory = defaultCategoryId
@@ -28,7 +28,7 @@ const TagsPanel = () => {
28
28
  'Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.'
29
29
  ) }
30
30
  </p>
31
- <FlatTermSelector slug="post_tag" />
31
+ <FlatTermSelector slug="post_tag" __nextHasNoMarginBottom />
32
32
  </PanelBody>
33
33
  );
34
34
  };
@@ -22,7 +22,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
22
22
  font-weight: 500;
23
23
  line-height: 1.4;
24
24
  text-transform: uppercase;
25
- display: inline-block;
25
+ display: block;
26
26
  margin-bottom: calc(4px * 2);
27
27
  padding: 0;
28
28
  }
@@ -214,7 +214,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
214
214
  font-weight: 500;
215
215
  line-height: 1.4;
216
216
  text-transform: uppercase;
217
- display: inline-block;
217
+ display: block;
218
218
  margin-bottom: calc(4px * 2);
219
219
  padding: 0;
220
220
  }
@@ -5,7 +5,6 @@ import {
5
5
  Button,
6
6
  CheckboxControl,
7
7
  Dropdown,
8
- __experimentalText as Text,
9
8
  __experimentalVStack as VStack,
10
9
  TextControl,
11
10
  RadioControl,
@@ -16,6 +15,13 @@ import { useState, useMemo } from '@wordpress/element';
16
15
  import { store as coreStore } from '@wordpress/core-data';
17
16
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
18
17
  import { useInstanceId } from '@wordpress/compose';
18
+ import {
19
+ drafts,
20
+ published,
21
+ scheduled,
22
+ pending,
23
+ notAllowed,
24
+ } from '@wordpress/icons';
19
25
 
20
26
  /**
21
27
  * Internal dependencies
@@ -31,70 +37,40 @@ import PostSticky from '../post-sticky';
31
37
  import { PrivatePostSchedule } from '../post-schedule';
32
38
  import { store as editorStore } from '../../store';
33
39
 
34
- const labels = {
35
- 'auto-draft': __( 'Draft' ),
36
- draft: __( 'Draft' ),
37
- pending: __( 'Pending' ),
38
- private: __( 'Private' ),
39
- future: __( 'Scheduled' ),
40
- publish: __( 'Published' ),
40
+ const postStatusesInfo = {
41
+ 'auto-draft': { label: __( 'Draft' ), icon: drafts },
42
+ draft: { label: __( 'Draft' ), icon: drafts },
43
+ pending: { label: __( 'Pending' ), icon: pending },
44
+ private: { label: __( 'Private' ), icon: notAllowed },
45
+ future: { label: __( 'Scheduled' ), icon: scheduled },
46
+ publish: { label: __( 'Published' ), icon: published },
41
47
  };
42
48
 
43
49
  export const STATUS_OPTIONS = [
44
50
  {
45
- label: (
46
- <>
47
- { __( 'Draft' ) }
48
- <Text variant="muted" size={ 12 }>
49
- { __( 'Not ready to publish.' ) }
50
- </Text>
51
- </>
52
- ),
51
+ label: __( 'Draft' ),
53
52
  value: 'draft',
53
+ description: __( 'Not ready to publish.' ),
54
54
  },
55
55
  {
56
- label: (
57
- <>
58
- { __( 'Pending' ) }
59
- <Text variant="muted" size={ 12 }>
60
- { __( 'Waiting for review before publishing.' ) }
61
- </Text>
62
- </>
63
- ),
56
+ label: __( 'Pending' ),
64
57
  value: 'pending',
58
+ description: __( 'Waiting for review before publishing.' ),
65
59
  },
66
60
  {
67
- label: (
68
- <>
69
- { __( 'Private' ) }
70
- <Text variant="muted" size={ 12 }>
71
- { __( 'Only visible to site admins and editors.' ) }
72
- </Text>
73
- </>
74
- ),
61
+ label: __( 'Private' ),
75
62
  value: 'private',
63
+ description: __( 'Only visible to site admins and editors.' ),
76
64
  },
77
65
  {
78
- label: (
79
- <>
80
- { __( 'Scheduled' ) }
81
- <Text variant="muted" size={ 12 }>
82
- { __( 'Publish automatically on a chosen date.' ) }
83
- </Text>
84
- </>
85
- ),
66
+ label: __( 'Scheduled' ),
86
67
  value: 'future',
68
+ description: __( 'Publish automatically on a chosen date.' ),
87
69
  },
88
70
  {
89
- label: (
90
- <>
91
- { __( 'Published' ) }
92
- <Text variant="muted" size={ 12 }>
93
- { __( 'Visible to everyone.' ) }
94
- </Text>
95
- </>
96
- ),
71
+ label: __( 'Published' ),
97
72
  value: 'publish',
73
+ description: __( 'Visible to everyone.' ),
98
74
  },
99
75
  ];
100
76
 
@@ -200,13 +176,14 @@ export default function PostStatus() {
200
176
  variant="tertiary"
201
177
  size="compact"
202
178
  onClick={ onToggle }
179
+ icon={ postStatusesInfo[ status ]?.icon }
203
180
  aria-label={ sprintf(
204
181
  // translators: %s: Current post status.
205
182
  __( 'Change post status: %s' ),
206
- labels[ status ]
183
+ postStatusesInfo[ status ]?.label
207
184
  ) }
208
185
  >
209
- { labels[ status ] }
186
+ { postStatusesInfo[ status ]?.label }
210
187
  </Button>
211
188
  ) }
212
189
  renderContent={ ( { onClose } ) => (
@@ -277,6 +254,7 @@ export default function PostStatus() {
277
254
  id={ passwordInputId }
278
255
  __next40pxDefaultSize
279
256
  __nextHasNoMarginBottom
257
+ maxLength={ 255 }
280
258
  />
281
259
  </div>
282
260
  ) }
@@ -290,7 +268,7 @@ export default function PostStatus() {
290
268
  />
291
269
  ) : (
292
270
  <div className="editor-post-status is-read-only">
293
- { labels[ status ] }
271
+ { postStatusesInfo[ status ]?.label }
294
272
  </div>
295
273
  ) }
296
274
  </PostPanelRow>
@@ -5,6 +5,7 @@ import { __, _x, sprintf } from '@wordpress/i18n';
5
5
  import { useEffect, useMemo, useState } from '@wordpress/element';
6
6
  import { FormTokenField, withFilters } from '@wordpress/components';
7
7
  import { useSelect, useDispatch } from '@wordpress/data';
8
+ import deprecated from '@wordpress/deprecated';
8
9
  import { store as coreStore } from '@wordpress/core-data';
9
10
  import { useDebounce } from '@wordpress/compose';
10
11
  import { speak } from '@wordpress/a11y';
@@ -55,16 +56,28 @@ const termNamesToIds = ( names, terms ) => {
55
56
  /**
56
57
  * Renders a flat term selector component.
57
58
  *
58
- * @param {Object} props The component props.
59
- * @param {string} props.slug The slug of the taxonomy.
59
+ * @param {Object} props The component props.
60
+ * @param {string} props.slug The slug of the taxonomy.
61
+ * @param {boolean} props.__nextHasNoMarginBottom Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.)
60
62
  *
61
63
  * @return {JSX.Element} The rendered flat term selector component.
62
64
  */
63
- export function FlatTermSelector( { slug } ) {
65
+ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
64
66
  const [ values, setValues ] = useState( [] );
65
67
  const [ search, setSearch ] = useState( '' );
66
68
  const debouncedSearch = useDebounce( setSearch, 500 );
67
69
 
70
+ if ( ! __nextHasNoMarginBottom ) {
71
+ deprecated(
72
+ 'Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector',
73
+ {
74
+ since: '6.7',
75
+ version: '7.0',
76
+ hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',
77
+ }
78
+ );
79
+ }
80
+
68
81
  const {
69
82
  terms,
70
83
  termIds,
@@ -86,7 +99,7 @@ export function FlatTermSelector( { slug } ) {
86
99
 
87
100
  const query = {
88
101
  ...DEFAULT_QUERY,
89
- include: _termIds.join( ',' ),
102
+ include: _termIds?.join( ',' ),
90
103
  per_page: -1,
91
104
  };
92
105
 
@@ -103,7 +116,7 @@ export function FlatTermSelector( { slug } ) {
103
116
  : false,
104
117
  taxonomy: _taxonomy,
105
118
  termIds: _termIds,
106
- terms: _termIds.length
119
+ terms: _termIds?.length
107
120
  ? getEntityRecords( 'taxonomy', slug, query )
108
121
  : EMPTY_ARRAY,
109
122
  hasResolvedTerms: hasFinishedResolution( 'getEntityRecords', [
@@ -290,6 +303,7 @@ export function FlatTermSelector( { slug } ) {
290
303
  removed: termRemovedLabel,
291
304
  remove: removeTermLabel,
292
305
  } }
306
+ __nextHasNoMarginBottom={ __nextHasNoMarginBottom }
293
307
  />
294
308
  <MostUsedTerms taxonomy={ taxonomy } onSelect={ appendTerm } />
295
309
  </>
@@ -32,10 +32,17 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
32
32
  const TaxonomyComponent = taxonomy.hierarchical
33
33
  ? HierarchicalTermSelector
34
34
  : FlatTermSelector;
35
+ const taxonomyComponentProps = {
36
+ slug: taxonomy.slug,
37
+ ...( taxonomy.hierarchical
38
+ ? {}
39
+ : { __nextHasNoMarginBottom: true } ),
40
+ };
41
+
35
42
  return (
36
43
  <Fragment key={ `taxonomy-${ taxonomy.slug }` }>
37
44
  { taxonomyWrapper(
38
- <TaxonomyComponent slug={ taxonomy.slug } />,
45
+ <TaxonomyComponent { ...taxonomyComponentProps } />,
39
46
  taxonomy
40
47
  ) }
41
48
  </Fragment>
@@ -53,7 +53,11 @@ export default function BlockThemeControl( { id } ) {
53
53
 
54
54
  const canCreateTemplate = useSelect(
55
55
  ( select ) =>
56
- select( coreStore ).canUser( 'create', 'templates' ) ?? false
56
+ !! select( coreStore ).canUser( 'create', {
57
+ kind: 'postType',
58
+ name: 'wp_template',
59
+ } ),
60
+ []
57
61
  );
58
62
 
59
63
  if ( ! hasResolved ) {
@@ -33,8 +33,10 @@ function PostTemplateToggle( { isOpen, onClick } ) {
33
33
  return availableTemplates[ templateSlug ];
34
34
  }
35
35
  const template =
36
- select( coreStore ).canUser( 'create', 'templates' ) &&
37
- select( editorStore ).getCurrentTemplateId();
36
+ select( coreStore ).canUser( 'create', {
37
+ kind: 'postType',
38
+ name: 'wp_template',
39
+ } ) && select( editorStore ).getCurrentTemplateId();
38
40
  return (
39
41
  template?.title ||
40
42
  template?.slug ||
@@ -78,7 +80,10 @@ function PostTemplateDropdownContent( { onClose } ) {
78
80
  ( select ) => {
79
81
  const { canUser, getEntityRecords } = select( coreStore );
80
82
  const editorSettings = select( editorStore ).getEditorSettings();
81
- const canCreateTemplates = canUser( 'create', 'templates' );
83
+ const canCreateTemplates = canUser( 'create', {
84
+ kind: 'postType',
85
+ name: 'wp_template',
86
+ } );
82
87
  const _currentTemplateId =
83
88
  select( editorStore ).getCurrentTemplateId();
84
89
  return {
@@ -118,6 +118,7 @@ export default function CreateNewTemplateModal( { onClose } ) {
118
118
  >
119
119
  <VStack spacing="3">
120
120
  <TextControl
121
+ __next40pxDefaultSize
121
122
  __nextHasNoMarginBottom
122
123
  label={ __( 'Name' ) }
123
124
  value={ title }
@@ -129,11 +130,16 @@ export default function CreateNewTemplateModal( { onClose } ) {
129
130
  ) }
130
131
  />
131
132
  <HStack justify="right">
132
- <Button variant="tertiary" onClick={ cancel }>
133
+ <Button
134
+ __next40pxDefaultSize
135
+ variant="tertiary"
136
+ onClick={ cancel }
137
+ >
133
138
  { __( 'Cancel' ) }
134
139
  </Button>
135
140
 
136
141
  <Button
142
+ __next40pxDefaultSize
137
143
  variant="primary"
138
144
  type="submit"
139
145
  isBusy={ isBusy }