@wordpress/editor 13.27.1 → 13.28.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 (360) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/post-meta.js +3 -4
  3. package/build/bindings/post-meta.js.map +1 -1
  4. package/build/components/autocompleters/user.js +1 -2
  5. package/build/components/autocompleters/user.js.map +1 -1
  6. package/build/components/autosave-monitor/index.js +1 -2
  7. package/build/components/autosave-monitor/index.js.map +1 -1
  8. package/build/components/block-manager/category.js +1 -2
  9. package/build/components/block-manager/category.js.map +1 -1
  10. package/build/components/block-manager/checklist.js +1 -2
  11. package/build/components/block-manager/checklist.js.map +1 -1
  12. package/build/components/block-manager/index.js +1 -2
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/deprecated.js +52 -104
  15. package/build/components/deprecated.js.map +1 -1
  16. package/build/components/document-bar/index.js +7 -23
  17. package/build/components/document-bar/index.js.map +1 -1
  18. package/build/components/document-outline/check.js +1 -2
  19. package/build/components/document-outline/check.js.map +1 -1
  20. package/build/components/document-outline/index.js +1 -2
  21. package/build/components/document-outline/index.js.map +1 -1
  22. package/build/components/document-outline/item.js +1 -2
  23. package/build/components/document-outline/item.js.map +1 -1
  24. package/build/components/document-tools/index.js +1 -2
  25. package/build/components/document-tools/index.js.map +1 -1
  26. package/build/components/editor-canvas/edit-template-blocks-notification.js +22 -13
  27. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  28. package/build/components/editor-canvas/index.js +16 -12
  29. package/build/components/editor-canvas/index.js.map +1 -1
  30. package/build/components/editor-help/add-blocks.native.js +1 -2
  31. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  32. package/build/components/editor-help/customize-blocks.native.js +1 -2
  33. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/help-detail-navigation-screen.native.js +1 -2
  35. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  36. package/build/components/editor-help/help-get-support-button.native.js +1 -2
  37. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  38. package/build/components/editor-help/help-section-title.native.js +1 -2
  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 +1 -2
  41. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  42. package/build/components/editor-help/icon-move-blocks.native.js +1 -2
  43. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  44. package/build/components/editor-help/index.native.js +1 -2
  45. package/build/components/editor-help/index.native.js.map +1 -1
  46. package/build/components/editor-help/intro-to-blocks.native.js +1 -2
  47. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  48. package/build/components/editor-help/move-blocks.native.js +1 -2
  49. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  50. package/build/components/editor-help/remove-blocks.native.js +1 -2
  51. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  52. package/build/components/editor-history/redo.js +1 -2
  53. package/build/components/editor-history/redo.js.map +1 -1
  54. package/build/components/editor-history/undo.js +1 -2
  55. package/build/components/editor-history/undo.js.map +1 -1
  56. package/build/components/editor-notices/index.js +1 -2
  57. package/build/components/editor-notices/index.js.map +1 -1
  58. package/build/components/editor-snackbars/index.js +3 -1
  59. package/build/components/editor-snackbars/index.js.map +1 -1
  60. package/build/components/entities-saved-states/entity-record-item.js +1 -1
  61. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  62. package/build/components/entities-saved-states/entity-type-list.js +7 -7
  63. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  64. package/build/components/entities-saved-states/index.js +4 -1
  65. package/build/components/entities-saved-states/index.js.map +1 -1
  66. package/build/components/error-boundary/index.js +1 -2
  67. package/build/components/error-boundary/index.js.map +1 -1
  68. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -2
  69. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  70. package/build/components/index.js +4 -6
  71. package/build/components/index.js.map +1 -1
  72. package/build/components/list-view-sidebar/index.js +43 -36
  73. package/build/components/list-view-sidebar/index.js.map +1 -1
  74. package/build/components/local-autosave-monitor/index.js +1 -2
  75. package/build/components/local-autosave-monitor/index.js.map +1 -1
  76. package/build/components/media-categories/index.js +1 -2
  77. package/build/components/media-categories/index.js.map +1 -1
  78. package/build/components/offline-status/index.native.js +1 -2
  79. package/build/components/offline-status/index.native.js.map +1 -1
  80. package/build/components/page-attributes/check.js +1 -2
  81. package/build/components/page-attributes/check.js.map +1 -1
  82. package/build/components/page-attributes/panel.js +1 -2
  83. package/build/components/page-attributes/panel.js.map +1 -1
  84. package/build/components/page-attributes/parent.js +1 -2
  85. package/build/components/page-attributes/parent.js.map +1 -1
  86. package/build/components/post-author/combobox.js +6 -60
  87. package/build/components/post-author/combobox.js.map +1 -1
  88. package/build/components/post-author/constants.js +7 -5
  89. package/build/components/post-author/constants.js.map +1 -1
  90. package/build/components/post-author/hook.js +72 -0
  91. package/build/components/post-author/hook.js.map +1 -0
  92. package/build/components/post-author/index.js +1 -2
  93. package/build/components/post-author/index.js.map +1 -1
  94. package/build/components/post-author/panel.js +1 -2
  95. package/build/components/post-author/panel.js.map +1 -1
  96. package/build/components/post-author/select.js +6 -24
  97. package/build/components/post-author/select.js.map +1 -1
  98. package/build/components/post-comments/index.js +1 -2
  99. package/build/components/post-comments/index.js.map +1 -1
  100. package/build/components/post-discussion/panel.js +1 -2
  101. package/build/components/post-discussion/panel.js.map +1 -1
  102. package/build/components/post-excerpt/check.js +1 -2
  103. package/build/components/post-excerpt/check.js.map +1 -1
  104. package/build/components/post-excerpt/index.js +1 -2
  105. package/build/components/post-excerpt/index.js.map +1 -1
  106. package/build/components/post-excerpt/plugin.js +1 -2
  107. package/build/components/post-excerpt/plugin.js.map +1 -1
  108. package/build/components/post-featured-image/check.js +1 -2
  109. package/build/components/post-featured-image/check.js.map +1 -1
  110. package/build/components/post-featured-image/index.js +1 -2
  111. package/build/components/post-featured-image/index.js.map +1 -1
  112. package/build/components/post-featured-image/panel.js +1 -2
  113. package/build/components/post-featured-image/panel.js.map +1 -1
  114. package/build/components/post-format/check.js +1 -2
  115. package/build/components/post-format/check.js.map +1 -1
  116. package/build/components/post-format/index.js +1 -2
  117. package/build/components/post-format/index.js.map +1 -1
  118. package/build/components/post-last-revision/check.js +1 -2
  119. package/build/components/post-last-revision/check.js.map +1 -1
  120. package/build/components/post-last-revision/index.js +6 -5
  121. package/build/components/post-last-revision/index.js.map +1 -1
  122. package/build/components/post-last-revision/panel.js +1 -2
  123. package/build/components/post-last-revision/panel.js.map +1 -1
  124. package/build/components/post-panel-row/index.js +1 -2
  125. package/build/components/post-panel-row/index.js.map +1 -1
  126. package/build/components/post-pending-status/check.js +1 -2
  127. package/build/components/post-pending-status/check.js.map +1 -1
  128. package/build/components/post-pending-status/index.js +1 -2
  129. package/build/components/post-pending-status/index.js.map +1 -1
  130. package/build/components/post-pingbacks/index.js +1 -2
  131. package/build/components/post-pingbacks/index.js.map +1 -1
  132. package/build/components/post-publish-button/index.js +1 -2
  133. package/build/components/post-publish-button/index.js.map +1 -1
  134. package/build/components/post-publish-button/label.js +1 -2
  135. package/build/components/post-publish-button/label.js.map +1 -1
  136. package/build/components/post-publish-panel/index.js +1 -2
  137. package/build/components/post-publish-panel/index.js.map +1 -1
  138. package/build/components/post-publish-panel/maybe-category-panel.js +1 -2
  139. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  140. package/build/components/post-publish-panel/maybe-tags-panel.js +22 -26
  141. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  142. package/build/components/post-publish-panel/postpublish.js +1 -2
  143. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  144. package/build/components/post-publish-panel/prepublish.js +1 -2
  145. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  146. package/build/components/post-schedule/index.js +0 -1
  147. package/build/components/post-schedule/index.js.map +1 -1
  148. package/build/components/post-schedule/label.js +1 -1
  149. package/build/components/post-schedule/label.js.map +1 -1
  150. package/build/components/post-schedule/panel.js +1 -0
  151. package/build/components/post-schedule/panel.js.map +1 -1
  152. package/build/components/post-slug/index.js +1 -2
  153. package/build/components/post-slug/index.js.map +1 -1
  154. package/build/components/post-switch-to-draft-button/index.js +1 -0
  155. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  156. package/build/components/post-sync-status/index.js +1 -1
  157. package/build/components/post-sync-status/index.js.map +1 -1
  158. package/build/components/post-taxonomies/check.js +8 -15
  159. package/build/components/post-taxonomies/check.js.map +1 -1
  160. package/build/components/post-taxonomies/flat-term-selector.js +1 -2
  161. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  162. package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -2
  163. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  164. package/build/components/post-taxonomies/index.js +14 -15
  165. package/build/components/post-taxonomies/index.js.map +1 -1
  166. package/build/components/post-taxonomies/panel.js +1 -2
  167. package/build/components/post-taxonomies/panel.js.map +1 -1
  168. package/build/components/post-template/block-theme.js +24 -11
  169. package/build/components/post-template/block-theme.js.map +1 -1
  170. package/build/components/post-template/classic-theme.js +17 -13
  171. package/build/components/post-template/classic-theme.js.map +1 -1
  172. package/build/components/post-template/create-new-template-modal.js +20 -5
  173. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  174. package/build/components/post-template/panel.js +5 -1
  175. package/build/components/post-template/panel.js.map +1 -1
  176. package/build/components/post-title/constants.js +2 -4
  177. package/build/components/post-title/constants.js.map +1 -1
  178. package/build/components/post-title/index.js +2 -3
  179. package/build/components/post-title/index.js.map +1 -1
  180. package/build/components/post-title/index.native.js +1 -2
  181. package/build/components/post-title/index.native.js.map +1 -1
  182. package/build/components/post-title/post-title-raw.js +1 -2
  183. package/build/components/post-title/post-title-raw.js.map +1 -1
  184. package/build/components/post-trash/check.js +1 -2
  185. package/build/components/post-trash/check.js.map +1 -1
  186. package/build/components/post-trash/index.js +1 -0
  187. package/build/components/post-trash/index.js.map +1 -1
  188. package/build/components/post-type-support-check/index.js +1 -2
  189. package/build/components/post-type-support-check/index.js.map +1 -1
  190. package/build/components/post-url/panel.js +1 -0
  191. package/build/components/post-url/panel.js.map +1 -1
  192. package/build/components/post-visibility/utils.js +1 -2
  193. package/build/components/post-visibility/utils.js.map +1 -1
  194. package/build/components/preferences-modal/enable-panel.js +1 -2
  195. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  196. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +1 -2
  197. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  198. package/build/components/preferences-modal/index.js +0 -1
  199. package/build/components/preferences-modal/index.js.map +1 -1
  200. package/build/components/provider/constants.js +1 -2
  201. package/build/components/provider/constants.js.map +1 -1
  202. package/build/components/provider/index.js +13 -7
  203. package/build/components/provider/index.js.map +1 -1
  204. package/build/components/provider/index.native.js +4 -6
  205. package/build/components/provider/index.native.js.map +1 -1
  206. package/build/components/provider/use-block-editor-settings.js +2 -3
  207. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  208. package/build/components/provider/use-block-editor-settings.native.js +1 -2
  209. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  210. package/build/components/provider/with-registry-provider.js +1 -2
  211. package/build/components/provider/with-registry-provider.js.map +1 -1
  212. package/build/components/table-of-contents/index.js +1 -2
  213. package/build/components/table-of-contents/index.js.map +1 -1
  214. package/build/components/table-of-contents/panel.js +1 -2
  215. package/build/components/table-of-contents/panel.js.map +1 -1
  216. package/build/components/template-validation-notice/index.js +1 -2
  217. package/build/components/template-validation-notice/index.js.map +1 -1
  218. package/build/components/theme-support-check/index.js +1 -2
  219. package/build/components/theme-support-check/index.js.map +1 -1
  220. package/build/hooks/pattern-partial-syncing.js +9 -2
  221. package/build/hooks/pattern-partial-syncing.js.map +1 -1
  222. package/build/private-apis.js +1 -2
  223. package/build/private-apis.js.map +1 -1
  224. package/build/store/actions.js +38 -65
  225. package/build/store/actions.js.map +1 -1
  226. package/build/store/constants.js +7 -14
  227. package/build/store/constants.js.map +1 -1
  228. package/build/store/defaults.js +1 -2
  229. package/build/store/defaults.js.map +1 -1
  230. package/build/store/index.js +4 -6
  231. package/build/store/index.js.map +1 -1
  232. package/build/store/private-actions.js +1 -0
  233. package/build/store/private-actions.js.map +1 -1
  234. package/build/store/private-selectors.js +1 -2
  235. package/build/store/private-selectors.js.map +1 -1
  236. package/build/store/reducer.js +1 -2
  237. package/build/store/reducer.js.map +1 -1
  238. package/build/store/reducer.native.js +2 -4
  239. package/build/store/reducer.native.js.map +1 -1
  240. package/build/store/selectors.js +82 -144
  241. package/build/store/selectors.js.map +1 -1
  242. package/build/store/selectors.native.js +1 -2
  243. package/build/store/selectors.native.js.map +1 -1
  244. package/build-module/bindings/post-meta.js +2 -2
  245. package/build-module/bindings/post-meta.js.map +1 -1
  246. package/build-module/components/document-bar/index.js +7 -23
  247. package/build-module/components/document-bar/index.js.map +1 -1
  248. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +22 -13
  249. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  250. package/build-module/components/editor-canvas/index.js +15 -10
  251. package/build-module/components/editor-canvas/index.js.map +1 -1
  252. package/build-module/components/editor-snackbars/index.js +4 -1
  253. package/build-module/components/editor-snackbars/index.js.map +1 -1
  254. package/build-module/components/entities-saved-states/entity-record-item.js +1 -1
  255. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  256. package/build-module/components/entities-saved-states/entity-type-list.js +8 -8
  257. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  258. package/build-module/components/entities-saved-states/index.js +6 -3
  259. package/build-module/components/entities-saved-states/index.js.map +1 -1
  260. package/build-module/components/list-view-sidebar/index.js +44 -37
  261. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  262. package/build-module/components/post-author/combobox.js +8 -61
  263. package/build-module/components/post-author/combobox.js.map +1 -1
  264. package/build-module/components/post-author/constants.js +5 -2
  265. package/build-module/components/post-author/constants.js.map +1 -1
  266. package/build-module/components/post-author/hook.js +65 -0
  267. package/build-module/components/post-author/hook.js.map +1 -0
  268. package/build-module/components/post-author/select.js +7 -24
  269. package/build-module/components/post-author/select.js.map +1 -1
  270. package/build-module/components/post-last-revision/index.js +6 -4
  271. package/build-module/components/post-last-revision/index.js.map +1 -1
  272. package/build-module/components/post-publish-panel/maybe-tags-panel.js +24 -27
  273. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  274. package/build-module/components/post-schedule/index.js +0 -1
  275. package/build-module/components/post-schedule/index.js.map +1 -1
  276. package/build-module/components/post-schedule/label.js +1 -1
  277. package/build-module/components/post-schedule/label.js.map +1 -1
  278. package/build-module/components/post-schedule/panel.js +1 -0
  279. package/build-module/components/post-schedule/panel.js.map +1 -1
  280. package/build-module/components/post-switch-to-draft-button/index.js +1 -0
  281. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  282. package/build-module/components/post-sync-status/index.js +1 -1
  283. package/build-module/components/post-sync-status/index.js.map +1 -1
  284. package/build-module/components/post-taxonomies/check.js +9 -14
  285. package/build-module/components/post-taxonomies/check.js.map +1 -1
  286. package/build-module/components/post-taxonomies/index.js +15 -15
  287. package/build-module/components/post-taxonomies/index.js.map +1 -1
  288. package/build-module/components/post-template/block-theme.js +24 -11
  289. package/build-module/components/post-template/block-theme.js.map +1 -1
  290. package/build-module/components/post-template/classic-theme.js +16 -11
  291. package/build-module/components/post-template/classic-theme.js.map +1 -1
  292. package/build-module/components/post-template/create-new-template-modal.js +20 -5
  293. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  294. package/build-module/components/post-template/panel.js +5 -1
  295. package/build-module/components/post-template/panel.js.map +1 -1
  296. package/build-module/components/post-title/index.js +1 -2
  297. package/build-module/components/post-title/index.js.map +1 -1
  298. package/build-module/components/post-trash/index.js +1 -0
  299. package/build-module/components/post-trash/index.js.map +1 -1
  300. package/build-module/components/post-url/panel.js +1 -0
  301. package/build-module/components/post-url/panel.js.map +1 -1
  302. package/build-module/components/preferences-modal/index.js +0 -1
  303. package/build-module/components/preferences-modal/index.js.map +1 -1
  304. package/build-module/components/provider/index.js +11 -3
  305. package/build-module/components/provider/index.js.map +1 -1
  306. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  307. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  308. package/build-module/components/table-of-contents/panel.js +0 -1
  309. package/build-module/components/table-of-contents/panel.js.map +1 -1
  310. package/build-module/hooks/pattern-partial-syncing.js +9 -2
  311. package/build-module/hooks/pattern-partial-syncing.js.map +1 -1
  312. package/build-module/store/actions.js +7 -3
  313. package/build-module/store/actions.js.map +1 -1
  314. package/build-module/store/private-actions.js +1 -0
  315. package/build-module/store/private-actions.js.map +1 -1
  316. package/build-module/store/selectors.js +10 -0
  317. package/build-module/store/selectors.js.map +1 -1
  318. package/build-style/style-rtl.css +28 -22
  319. package/build-style/style.css +28 -22
  320. package/package.json +32 -32
  321. package/src/bindings/post-meta.js +2 -2
  322. package/src/components/document-bar/index.js +24 -38
  323. package/src/components/editor-canvas/edit-template-blocks-notification.js +31 -14
  324. package/src/components/editor-canvas/index.js +16 -6
  325. package/src/components/editor-snackbars/index.js +6 -3
  326. package/src/components/entities-saved-states/entity-record-item.js +1 -4
  327. package/src/components/entities-saved-states/entity-type-list.js +8 -8
  328. package/src/components/entities-saved-states/index.js +17 -4
  329. package/src/components/entities-saved-states/style.scss +5 -0
  330. package/src/components/list-view-sidebar/index.js +60 -47
  331. package/src/components/list-view-sidebar/style.scss +20 -20
  332. package/src/components/post-author/combobox.js +5 -61
  333. package/src/components/post-author/constants.js +6 -2
  334. package/src/components/post-author/hook.js +63 -0
  335. package/src/components/post-author/select.js +5 -25
  336. package/src/components/post-last-revision/index.js +6 -6
  337. package/src/components/post-last-revision/style.scss +3 -6
  338. package/src/components/post-panel-row/style.scss +3 -3
  339. package/src/components/post-publish-panel/maybe-tags-panel.js +27 -37
  340. package/src/components/post-publish-panel/style.scss +3 -1
  341. package/src/components/post-schedule/label.js +1 -1
  342. package/src/components/post-schedule/panel.js +1 -0
  343. package/src/components/post-schedule/test/label.js +19 -7
  344. package/src/components/post-switch-to-draft-button/index.js +1 -0
  345. package/src/components/post-sync-status/index.js +8 -2
  346. package/src/components/post-taxonomies/check.js +11 -15
  347. package/src/components/post-taxonomies/index.js +15 -22
  348. package/src/components/post-taxonomies/test/index.js +37 -51
  349. package/src/components/post-template/block-theme.js +33 -14
  350. package/src/components/post-template/classic-theme.js +17 -10
  351. package/src/components/post-template/create-new-template-modal.js +17 -9
  352. package/src/components/post-template/panel.js +5 -1
  353. package/src/components/post-trash/index.js +1 -0
  354. package/src/components/post-url/panel.js +1 -0
  355. package/src/components/provider/index.js +18 -6
  356. package/src/components/provider/use-block-editor-settings.js +1 -1
  357. package/src/hooks/pattern-partial-syncing.js +23 -4
  358. package/src/store/actions.js +8 -3
  359. package/src/store/private-actions.js +1 -0
  360. package/src/store/selectors.js +12 -0
@@ -2,7 +2,10 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __experimentalListView as ListView } from '@wordpress/block-editor';
5
- import { Button, TabPanel } from '@wordpress/components';
5
+ import {
6
+ Button,
7
+ privateApis as componentsPrivateApis,
8
+ } from '@wordpress/components';
6
9
  import { useFocusOnMount, useMergeRefs } from '@wordpress/compose';
7
10
  import { useDispatch, useSelect } from '@wordpress/data';
8
11
  import { focus } from '@wordpress/dom';
@@ -19,6 +22,8 @@ import ListViewOutline from './list-view-outline';
19
22
  import { unlock } from '../../lock-unlock';
20
23
  import { store as editorStore } from '../../store';
21
24
 
25
+ const { Tabs } = unlock( componentsPrivateApis );
26
+
22
27
  export default function ListViewSidebar() {
23
28
  const { setIsListViewOpened } = useDispatch( editorStore );
24
29
  const { getListViewToggleRef } = unlock( useSelect( editorStore ) );
@@ -51,7 +56,7 @@ export default function ListViewSidebar() {
51
56
  // This ref refers to the sidebar as a whole.
52
57
  const sidebarRef = useRef();
53
58
  // This ref refers to the tab panel.
54
- const tabPanelRef = useRef();
59
+ const tabsRef = useRef();
55
60
  // This ref refers to the list view application area.
56
61
  const listViewRef = useRef();
57
62
 
@@ -71,7 +76,7 @@ export default function ListViewSidebar() {
71
76
  */
72
77
  function handleSidebarFocus( currentTab ) {
73
78
  // Tab panel focus.
74
- const tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];
79
+ const tabPanelFocus = focus.tabbable.find( tabsRef.current )[ 0 ];
75
80
  // List view tab is selected.
76
81
  if ( currentTab === 'list-view' ) {
77
82
  // Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
@@ -108,22 +113,6 @@ export default function ListViewSidebar() {
108
113
  // It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
109
114
  useShortcut( 'core/editor/toggle-list-view', handleToggleListViewShortcut );
110
115
 
111
- /**
112
- * Render tab content for a given tab name.
113
- *
114
- * @param {string} tabName The name of the tab to render.
115
- */
116
- function renderTabContent( tabName ) {
117
- if ( tabName === 'list-view' ) {
118
- return (
119
- <div className="editor-list-view-sidebar__list-view-panel-content">
120
- <ListView dropZoneElement={ dropZoneElement } />
121
- </div>
122
- );
123
- }
124
- return <ListViewOutline />;
125
- }
126
-
127
116
  return (
128
117
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
129
118
  <div
@@ -131,39 +120,63 @@ export default function ListViewSidebar() {
131
120
  onKeyDown={ closeOnEscape }
132
121
  ref={ sidebarRef }
133
122
  >
134
- <Button
135
- className="editor-list-view-sidebar__close-button"
136
- icon={ closeSmall }
137
- label={ __( 'Close' ) }
138
- onClick={ closeListView }
139
- />
140
- <TabPanel
141
- className="editor-list-view-sidebar__tab-panel"
142
- ref={ tabPanelRef }
123
+ <Tabs
143
124
  onSelect={ ( tabName ) => setTab( tabName ) }
144
125
  selectOnMove={ false }
145
- tabs={ [
146
- {
147
- name: 'list-view',
148
- title: _x( 'List View', 'Post overview' ),
149
- className: 'editor-list-view-sidebar__panel-tab',
150
- },
151
- {
152
- name: 'outline',
153
- title: _x( 'Outline', 'Post overview' ),
154
- className: 'editor-list-view-sidebar__panel-tab',
155
- },
156
- ] }
126
+ // The initial tab value is set explicitly to avoid an initial
127
+ // render where no tab is selected. This ensures that the
128
+ // tabpanel height is correct so the relevant scroll container
129
+ // can be rendered internally.
130
+ initialTabId="list-view"
157
131
  >
158
- { ( currentTab ) => (
159
- <div
160
- className="editor-list-view-sidebar__list-view-container"
161
- ref={ listViewContainerRef }
132
+ <div className="edit-post-editor__document-overview-panel__header">
133
+ <Button
134
+ className="editor-list-view-sidebar__close-button"
135
+ icon={ closeSmall }
136
+ label={ __( 'Close' ) }
137
+ onClick={ closeListView }
138
+ />
139
+ <Tabs.TabList
140
+ className="editor-list-view-sidebar__tabs-tablist"
141
+ ref={ tabsRef }
162
142
  >
163
- { renderTabContent( currentTab.name ) }
143
+ <Tabs.Tab
144
+ className="editor-list-view-sidebar__tabs-tab"
145
+ tabId="list-view"
146
+ >
147
+ { _x( 'List View', 'Post overview' ) }
148
+ </Tabs.Tab>
149
+ <Tabs.Tab
150
+ className="editor-list-view-sidebar__tabs-tab"
151
+ tabId="outline"
152
+ >
153
+ { _x( 'Outline', 'Post overview' ) }
154
+ </Tabs.Tab>
155
+ </Tabs.TabList>
156
+ </div>
157
+
158
+ <Tabs.TabPanel
159
+ ref={ listViewContainerRef }
160
+ className="editor-list-view-sidebar__tabs-tabpanel"
161
+ tabId="list-view"
162
+ focusable={ false }
163
+ >
164
+ <div className="editor-list-view-sidebar__list-view-container">
165
+ <div className="editor-list-view-sidebar__list-view-panel-content">
166
+ <ListView dropZoneElement={ dropZoneElement } />
167
+ </div>
168
+ </div>
169
+ </Tabs.TabPanel>
170
+ <Tabs.TabPanel
171
+ className="editor-list-view-sidebar__tabs-tabpanel"
172
+ tabId="outline"
173
+ focusable={ false }
174
+ >
175
+ <div className="editor-list-view-sidebar__list-view-container">
176
+ <ListViewOutline />
164
177
  </div>
165
- ) }
166
- </TabPanel>
178
+ </Tabs.TabPanel>
179
+ </Tabs>
167
180
  </div>
168
181
  );
169
182
  }
@@ -8,32 +8,31 @@
8
8
  // @see packages/block-editor/src/components/inserter/style.scss
9
9
  width: 350px;
10
10
  }
11
-
11
+ .edit-post-editor__document-overview-panel__header {
12
+ display: flex;
13
+ border-bottom: $border-width solid $gray-300;
14
+ }
12
15
  .editor-list-view-sidebar__close-button {
13
- position: absolute;
14
- right: $grid-unit-10;
15
- top: math.div($grid-unit-60 - $button-size, 2); // ( tab height - button size ) / 2
16
- z-index: 1;
17
16
  background: $white;
17
+ order: 1;
18
+ align-self: center;
19
+ margin-right: $grid-unit-10;
18
20
  }
21
+ }
19
22
 
20
- // The TabPanel style overrides in the following blocks should be removed when the new TabPanel is available.
21
- .components-tab-panel__tabs {
22
- border-bottom: $border-width solid $gray-300;
23
- box-sizing: border-box;
24
- display: flex;
25
- width: 100%;
26
- padding-right: $grid-unit-70;
23
+ .editor-list-view-sidebar__tabs-tablist {
24
+ box-sizing: border-box;
25
+ flex-grow: 1;
27
26
 
28
- .editor-list-view-sidebar__panel-tab {
29
- width: 50%;
30
- margin-bottom: -$border-width;
31
- }
32
- }
27
+ }
33
28
 
34
- .components-tab-panel__tab-content {
35
- height: calc(100% - #{$grid-unit-60 - $border-width});
36
- }
29
+ .editor-list-view-sidebar__tabs-tab {
30
+ width: 50%;
31
+ margin-bottom: -$border-width;
32
+ }
33
+
34
+ .editor-list-view-sidebar__tabs-tabpanel {
35
+ height: calc(100% - #{$grid-unit-60 - $border-width});
37
36
  }
38
37
 
39
38
  .editor-list-view-sidebar__list-view-panel-content,
@@ -82,3 +81,4 @@
82
81
  color: $gray-700;
83
82
  }
84
83
  }
84
+
@@ -2,71 +2,22 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { debounce } from '@wordpress/compose';
5
- import { useState, useMemo } from '@wordpress/element';
6
- import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { useState } from '@wordpress/element';
6
+ import { useDispatch } from '@wordpress/data';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  import { ComboboxControl } from '@wordpress/components';
9
- import { decodeEntities } from '@wordpress/html-entities';
10
- import { store as coreStore } from '@wordpress/core-data';
11
9
 
12
10
  /**
13
11
  * Internal dependencies
14
12
  */
15
13
  import { store as editorStore } from '../../store';
16
- import { AUTHORS_QUERY } from './constants';
14
+ import { useAuthorsQuery } from './hook';
17
15
 
18
- function PostAuthorCombobox() {
16
+ export default function PostAuthorCombobox() {
19
17
  const [ fieldValue, setFieldValue ] = useState();
20
18
 
21
- const { authorId, isLoading, authors, postAuthor } = useSelect(
22
- ( select ) => {
23
- const { getUser, getUsers, isResolving } = select( coreStore );
24
- const { getEditedPostAttribute } = select( editorStore );
25
- const author = getUser( getEditedPostAttribute( 'author' ), {
26
- context: 'view',
27
- } );
28
- const query = { ...AUTHORS_QUERY };
29
-
30
- if ( fieldValue ) {
31
- query.search = fieldValue;
32
- }
33
-
34
- return {
35
- authorId: getEditedPostAttribute( 'author' ),
36
- postAuthor: author,
37
- authors: getUsers( query ),
38
- isLoading: isResolving( 'core', 'getUsers', [ query ] ),
39
- };
40
- },
41
- [ fieldValue ]
42
- );
43
19
  const { editPost } = useDispatch( editorStore );
44
-
45
- const authorOptions = useMemo( () => {
46
- const fetchedAuthors = ( authors ?? [] ).map( ( author ) => {
47
- return {
48
- value: author.id,
49
- label: decodeEntities( author.name ),
50
- };
51
- } );
52
-
53
- // Ensure the current author is included in the dropdown list.
54
- const foundAuthor = fetchedAuthors.findIndex(
55
- ( { value } ) => postAuthor?.id === value
56
- );
57
-
58
- if ( foundAuthor < 0 && postAuthor ) {
59
- return [
60
- {
61
- value: postAuthor.id,
62
- label: decodeEntities( postAuthor.name ),
63
- },
64
- ...fetchedAuthors,
65
- ];
66
- }
67
-
68
- return fetchedAuthors;
69
- }, [ authors, postAuthor ] );
20
+ const { authorId, authorOptions } = useAuthorsQuery( fieldValue );
70
21
 
71
22
  /**
72
23
  * Handle author selection.
@@ -89,10 +40,6 @@ function PostAuthorCombobox() {
89
40
  setFieldValue( inputValue );
90
41
  };
91
42
 
92
- if ( ! postAuthor ) {
93
- return null;
94
- }
95
-
96
43
  return (
97
44
  <ComboboxControl
98
45
  __nextHasNoMarginBottom
@@ -102,10 +49,7 @@ function PostAuthorCombobox() {
102
49
  value={ authorId }
103
50
  onFilterValueChange={ debounce( handleKeydown, 300 ) }
104
51
  onChange={ handleSelect }
105
- isLoading={ isLoading }
106
52
  allowReset={ false }
107
53
  />
108
54
  );
109
55
  }
110
-
111
- export default PostAuthorCombobox;
@@ -1,6 +1,10 @@
1
+ export const BASE_QUERY = {
2
+ _fields: 'id,name',
3
+ context: 'view', // Allows non-admins to perform requests.
4
+ };
5
+
1
6
  export const AUTHORS_QUERY = {
2
7
  who: 'authors',
3
8
  per_page: 50,
4
- _fields: 'id,name',
5
- context: 'view', // Allows non-admins to perform requests.
9
+ ...BASE_QUERY,
6
10
  };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useMemo } from '@wordpress/element';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { decodeEntities } from '@wordpress/html-entities';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { store as editorStore } from '../../store';
13
+ import { AUTHORS_QUERY, BASE_QUERY } from './constants';
14
+
15
+ export function useAuthorsQuery( search ) {
16
+ const { authorId, authors, postAuthor } = useSelect(
17
+ ( select ) => {
18
+ const { getUser, getUsers } = select( coreStore );
19
+ const { getEditedPostAttribute } = select( editorStore );
20
+ const _authorId = getEditedPostAttribute( 'author' );
21
+ const query = { ...AUTHORS_QUERY };
22
+
23
+ if ( search ) {
24
+ query.search = search;
25
+ }
26
+
27
+ return {
28
+ authorId: _authorId,
29
+ authors: getUsers( query ),
30
+ postAuthor: getUser( _authorId, BASE_QUERY ),
31
+ };
32
+ },
33
+ [ search ]
34
+ );
35
+
36
+ const authorOptions = useMemo( () => {
37
+ const fetchedAuthors = ( authors ?? [] ).map( ( author ) => {
38
+ return {
39
+ value: author.id,
40
+ label: decodeEntities( author.name ),
41
+ };
42
+ } );
43
+
44
+ // Ensure the current author is included in the dropdown list.
45
+ const foundAuthor = fetchedAuthors.findIndex(
46
+ ( { value } ) => postAuthor?.id === value
47
+ );
48
+
49
+ if ( foundAuthor < 0 && postAuthor ) {
50
+ return [
51
+ {
52
+ value: postAuthor.id,
53
+ label: decodeEntities( postAuthor.name ),
54
+ },
55
+ ...fetchedAuthors,
56
+ ];
57
+ }
58
+
59
+ return fetchedAuthors;
60
+ }, [ authors, postAuthor ] );
61
+
62
+ return { authorId, authorOptions };
63
+ }
@@ -2,36 +2,18 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useMemo } from '@wordpress/element';
6
- import { useSelect, useDispatch } from '@wordpress/data';
7
- import { decodeEntities } from '@wordpress/html-entities';
5
+ import { useDispatch } from '@wordpress/data';
8
6
  import { SelectControl } from '@wordpress/components';
9
- import { store as coreStore } from '@wordpress/core-data';
10
7
 
11
8
  /**
12
9
  * Internal dependencies
13
10
  */
14
11
  import { store as editorStore } from '../../store';
15
- import { AUTHORS_QUERY } from './constants';
12
+ import { useAuthorsQuery } from './hook';
16
13
 
17
- function PostAuthorSelect() {
14
+ export default function PostAuthorSelect() {
18
15
  const { editPost } = useDispatch( editorStore );
19
- const { postAuthor, authors } = useSelect( ( select ) => {
20
- return {
21
- postAuthor:
22
- select( editorStore ).getEditedPostAttribute( 'author' ),
23
- authors: select( coreStore ).getUsers( AUTHORS_QUERY ),
24
- };
25
- }, [] );
26
-
27
- const authorOptions = useMemo( () => {
28
- return ( authors ?? [] ).map( ( author ) => {
29
- return {
30
- value: author.id,
31
- label: decodeEntities( author.name ),
32
- };
33
- } );
34
- }, [ authors ] );
16
+ const { authorId, authorOptions } = useAuthorsQuery();
35
17
 
36
18
  const setAuthorId = ( value ) => {
37
19
  const author = Number( value );
@@ -46,9 +28,7 @@ function PostAuthorSelect() {
46
28
  label={ __( 'Author' ) }
47
29
  options={ authorOptions }
48
30
  onChange={ setAuthorId }
49
- value={ postAuthor }
31
+ value={ authorId }
50
32
  />
51
33
  );
52
34
  }
53
-
54
- export default PostAuthorSelect;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { sprintf, _n } from '@wordpress/i18n';
4
+ import { sprintf, __ } from '@wordpress/i18n';
5
5
  import { Button } from '@wordpress/components';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { backup } from '@wordpress/icons';
@@ -31,13 +31,13 @@ function LastRevision() {
31
31
  } ) }
32
32
  className="editor-post-last-revision__title"
33
33
  icon={ backup }
34
- >
35
- { sprintf(
36
- /* translators: %d: number of revisions */
37
- _n( '%d Revision', '%d Revisions', revisionsCount ),
34
+ iconPosition="right"
35
+ text={ sprintf(
36
+ /* translators: %s: number of revisions */
37
+ __( 'Revisions (%s)' ),
38
38
  revisionsCount
39
39
  ) }
40
- </Button>
40
+ />
41
41
  </PostLastRevisionCheck>
42
42
  );
43
43
  }
@@ -1,14 +1,11 @@
1
1
  .editor-post-last-revision__title {
2
2
  width: 100%;
3
- font-weight: 600;
4
-
5
- .dashicon {
6
- margin-right: 5px;
7
- }
3
+ font-weight: 500;
8
4
  }
9
5
 
10
- .components-button.editor-post-last-revision__title {
6
+ .editor-post-last-revision__title.components-button.has-icon {
11
7
  height: 100%;
8
+ justify-content: space-between;
12
9
 
13
10
  &:hover,
14
11
  &:active {
@@ -1,6 +1,6 @@
1
1
  .editor-post-panel__row {
2
2
  width: 100%;
3
- min-height: $button-size;
3
+ min-height: $button-size-next-default-40px;
4
4
  justify-content: flex-start !important;
5
5
  align-items: flex-start !important;
6
6
  }
@@ -8,14 +8,14 @@
8
8
  .editor-post-panel__row-label {
9
9
  width: 30%;
10
10
  flex-shrink: 0;
11
- min-height: $button-size;
11
+ min-height: $button-size-next-default-40px;
12
12
  display: flex;
13
13
  align-items: center;
14
14
  }
15
15
 
16
16
  .editor-post-panel__row-control {
17
17
  flex-grow: 1;
18
- min-height: $button-size;
18
+ min-height: $button-size-next-default-40px;
19
19
  display: flex;
20
20
  align-items: center;
21
21
  }
@@ -2,9 +2,8 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { Component } from '@wordpress/element';
6
- import { compose, ifCondition } from '@wordpress/compose';
7
- import { withSelect } from '@wordpress/data';
5
+ import { useState } from '@wordpress/element';
6
+ import { useSelect } from '@wordpress/data';
8
7
  import { PanelBody } from '@wordpress/components';
9
8
  import { store as coreStore } from '@wordpress/core-data';
10
9
 
@@ -34,12 +33,26 @@ const TagsPanel = () => {
34
33
  );
35
34
  };
36
35
 
37
- class MaybeTagsPanel extends Component {
38
- constructor( props ) {
39
- super( props );
40
- this.state = {
41
- hadTagsWhenOpeningThePanel: props.hasTags,
36
+ const MaybeTagsPanel = () => {
37
+ const { hasTags, isPostTypeSupported } = useSelect( ( select ) => {
38
+ const postType = select( editorStore ).getCurrentPostType();
39
+ const tagsTaxonomy = select( coreStore ).getTaxonomy( 'post_tag' );
40
+ const _isPostTypeSupported = tagsTaxonomy?.types?.includes( postType );
41
+ const areTagsFetched = tagsTaxonomy !== undefined;
42
+ const tags =
43
+ tagsTaxonomy &&
44
+ select( editorStore ).getEditedPostAttribute(
45
+ tagsTaxonomy.rest_base
46
+ );
47
+ return {
48
+ hasTags: !! tags?.length,
49
+ isPostTypeSupported: areTagsFetched && _isPostTypeSupported,
42
50
  };
51
+ }, [] );
52
+ const [ hadTagsWhenOpeningThePanel ] = useState( hasTags );
53
+
54
+ if ( ! isPostTypeSupported ) {
55
+ return null;
43
56
  }
44
57
 
45
58
  /*
@@ -52,34 +65,11 @@ class MaybeTagsPanel extends Component {
52
65
  * hiding this panel and keeping the user from adding
53
66
  * more than one tag.
54
67
  */
55
- render() {
56
- if ( ! this.state.hadTagsWhenOpeningThePanel ) {
57
- return <TagsPanel />;
58
- }
59
-
60
- return null;
68
+ if ( ! hadTagsWhenOpeningThePanel ) {
69
+ return <TagsPanel />;
61
70
  }
62
- }
63
71
 
64
- export default compose(
65
- withSelect( ( select ) => {
66
- const postType = select( editorStore ).getCurrentPostType();
67
- const tagsTaxonomy = select( coreStore ).getTaxonomy( 'post_tag' );
68
- const tags =
69
- tagsTaxonomy &&
70
- select( editorStore ).getEditedPostAttribute(
71
- tagsTaxonomy.rest_base
72
- );
73
- return {
74
- areTagsFetched: tagsTaxonomy !== undefined,
75
- isPostTypeSupported:
76
- tagsTaxonomy &&
77
- tagsTaxonomy.types.some( ( type ) => type === postType ),
78
- hasTags: tags && tags.length,
79
- };
80
- } ),
81
- ifCondition(
82
- ( { areTagsFetched, isPostTypeSupported } ) =>
83
- isPostTypeSupported && areTagsFetched
84
- )
85
- )( MaybeTagsPanel );
72
+ return null;
73
+ };
74
+
75
+ export default MaybeTagsPanel;
@@ -152,7 +152,9 @@
152
152
  }
153
153
 
154
154
  input[readonly] {
155
- padding: $grid-unit-20;
155
+ // Do not increase top and bottom padding otherwise Firefox won't show the text overflow ellipsis.
156
+ // See https://github.com/WordPress/gutenberg/pull/57310
157
+ padding: $grid-unit-15;
156
158
  background: $gray-100;
157
159
  border-color: $gray-400;
158
160
  overflow: hidden;
@@ -102,7 +102,7 @@ function getTimezoneAbbreviation() {
102
102
  }
103
103
 
104
104
  const symbol = timezone.offset < 0 ? '' : '+';
105
- return `UTC${ symbol }${ timezone.offset }`;
105
+ return `UTC${ symbol }${ timezone.offsetFormatted }`;
106
106
  }
107
107
 
108
108
  function isTimezoneSameAsSiteTimezone( date ) {
@@ -40,6 +40,7 @@ export default function PostSchedulePanel() {
40
40
  contentClassName="editor-post-schedule__dialog"
41
41
  renderToggle={ ( { onToggle, isOpen } ) => (
42
42
  <Button
43
+ __next40pxDefaultSize
43
44
  className="editor-post-schedule__dialog-toggle"
44
45
  variant="tertiary"
45
46
  onClick={ onToggle }