@wordpress/editor 14.10.0 → 14.11.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 (292) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -2
  3. package/build/bindings/post-meta.js +2 -1
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/collab-sidebar/add-comment.js +120 -0
  6. package/build/components/collab-sidebar/add-comment.js.map +1 -0
  7. package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
  8. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  9. package/build/components/collab-sidebar/comment-button.js +37 -0
  10. package/build/components/collab-sidebar/comment-button.js.map +1 -0
  11. package/build/components/collab-sidebar/comments.js +321 -0
  12. package/build/components/collab-sidebar/comments.js.map +1 -0
  13. package/build/components/collab-sidebar/constants.js +8 -0
  14. package/build/components/collab-sidebar/constants.js.map +1 -0
  15. package/build/components/collab-sidebar/index.js +272 -0
  16. package/build/components/collab-sidebar/index.js.map +1 -0
  17. package/build/components/collab-sidebar/utils.js +16 -0
  18. package/build/components/collab-sidebar/utils.js.map +1 -0
  19. package/build/components/commands/index.js +6 -6
  20. package/build/components/commands/index.js.map +1 -1
  21. package/build/components/document-bar/index.js +8 -7
  22. package/build/components/document-bar/index.js.map +1 -1
  23. package/build/components/document-tools/index.js +1 -5
  24. package/build/components/document-tools/index.js.map +1 -1
  25. package/build/components/editor-interface/index.js +3 -2
  26. package/build/components/editor-interface/index.js.map +1 -1
  27. package/build/components/entities-saved-states/index.js +1 -1
  28. package/build/components/entities-saved-states/index.js.map +1 -1
  29. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  30. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  31. package/build/components/global-styles-provider/index.js +13 -3
  32. package/build/components/global-styles-provider/index.js.map +1 -1
  33. package/build/components/header/index.js +5 -2
  34. package/build/components/header/index.js.map +1 -1
  35. package/build/components/inserter-sidebar/index.js +2 -2
  36. package/build/components/inserter-sidebar/index.js.map +1 -1
  37. package/build/components/page-attributes/parent.js +5 -5
  38. package/build/components/page-attributes/parent.js.map +1 -1
  39. package/build/components/plugin-more-menu-item/index.js +13 -11
  40. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  41. package/build/components/plugin-preview-menu-item/index.js +15 -13
  42. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  43. package/build/components/plugin-sidebar/index.js +0 -15
  44. package/build/components/plugin-sidebar/index.js.map +1 -1
  45. package/build/components/post-actions/index.js +5 -5
  46. package/build/components/post-actions/index.js.map +1 -1
  47. package/build/components/post-author/panel.js +4 -4
  48. package/build/components/post-author/panel.js.map +1 -1
  49. package/build/components/post-card-panel/index.js +7 -36
  50. package/build/components/post-card-panel/index.js.map +1 -1
  51. package/build/components/post-content-information/index.js +1 -2
  52. package/build/components/post-content-information/index.js.map +1 -1
  53. package/build/components/post-featured-image/index.js +26 -7
  54. package/build/components/post-featured-image/index.js.map +1 -1
  55. package/build/components/post-last-revision/index.js +1 -1
  56. package/build/components/post-last-revision/index.js.map +1 -1
  57. package/build/components/post-schedule/label.js +1 -1
  58. package/build/components/post-schedule/label.js.map +1 -1
  59. package/build/components/post-taxonomies/flat-term-selector.js +9 -1
  60. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  61. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  62. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  63. package/build/components/post-url/index.js +1 -1
  64. package/build/components/post-url/index.js.map +1 -1
  65. package/build/components/post-url/panel.js +3 -3
  66. package/build/components/post-url/panel.js.map +1 -1
  67. package/build/components/preview-dropdown/index.js +0 -4
  68. package/build/components/preview-dropdown/index.js.map +1 -1
  69. package/build/components/provider/index.js +10 -12
  70. package/build/components/provider/index.js.map +1 -1
  71. package/build/components/provider/use-block-editor-settings.js +1 -1
  72. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  73. package/build/components/sidebar/header.js +2 -1
  74. package/build/components/sidebar/header.js.map +1 -1
  75. package/build/components/sidebar/index.js +3 -3
  76. package/build/components/sidebar/index.js.map +1 -1
  77. package/build/components/time-to-read/index.js +2 -2
  78. package/build/components/time-to-read/index.js.map +1 -1
  79. package/build/components/visual-editor/index.js +25 -27
  80. package/build/components/visual-editor/index.js.map +1 -1
  81. package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
  82. package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  83. package/build/components/zoom-out-toggle/index.js +37 -5
  84. package/build/components/zoom-out-toggle/index.js.map +1 -1
  85. package/build/dataviews/actions/duplicate-template-part.js +2 -2
  86. package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
  87. package/build/store/actions.js +4 -3
  88. package/build/store/actions.js.map +1 -1
  89. package/build/store/private-actions.js +2 -2
  90. package/build/store/private-actions.js.map +1 -1
  91. package/build/store/selectors.js +3 -2
  92. package/build/store/selectors.js.map +1 -1
  93. package/build/utils/pageTypeBadge.js +51 -0
  94. package/build/utils/pageTypeBadge.js.map +1 -0
  95. package/build/utils/terms.js +2 -2
  96. package/build/utils/terms.js.map +1 -1
  97. package/build-module/bindings/post-meta.js +2 -1
  98. package/build-module/bindings/post-meta.js.map +1 -1
  99. package/build-module/components/collab-sidebar/add-comment.js +114 -0
  100. package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
  101. package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
  102. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  103. package/build-module/components/collab-sidebar/comment-button.js +30 -0
  104. package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
  105. package/build-module/components/collab-sidebar/comments.js +314 -0
  106. package/build-module/components/collab-sidebar/comments.js.map +1 -0
  107. package/build-module/components/collab-sidebar/constants.js +2 -0
  108. package/build-module/components/collab-sidebar/constants.js.map +1 -0
  109. package/build-module/components/collab-sidebar/index.js +264 -0
  110. package/build-module/components/collab-sidebar/index.js.map +1 -0
  111. package/build-module/components/collab-sidebar/utils.js +10 -0
  112. package/build-module/components/collab-sidebar/utils.js.map +1 -0
  113. package/build-module/components/commands/index.js +6 -6
  114. package/build-module/components/commands/index.js.map +1 -1
  115. package/build-module/components/document-bar/index.js +9 -8
  116. package/build-module/components/document-bar/index.js.map +1 -1
  117. package/build-module/components/document-tools/index.js +2 -6
  118. package/build-module/components/document-tools/index.js.map +1 -1
  119. package/build-module/components/editor-interface/index.js +3 -2
  120. package/build-module/components/editor-interface/index.js.map +1 -1
  121. package/build-module/components/entities-saved-states/index.js +1 -1
  122. package/build-module/components/entities-saved-states/index.js.map +1 -1
  123. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  124. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +13 -3
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/index.js +5 -2
  128. package/build-module/components/header/index.js.map +1 -1
  129. package/build-module/components/inserter-sidebar/index.js +2 -2
  130. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  131. package/build-module/components/page-attributes/parent.js +5 -5
  132. package/build-module/components/page-attributes/parent.js.map +1 -1
  133. package/build-module/components/plugin-more-menu-item/index.js +12 -10
  134. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  135. package/build-module/components/plugin-preview-menu-item/index.js +14 -12
  136. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  137. package/build-module/components/plugin-sidebar/index.js +0 -15
  138. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  139. package/build-module/components/post-actions/index.js +5 -5
  140. package/build-module/components/post-actions/index.js.map +1 -1
  141. package/build-module/components/post-author/panel.js +4 -4
  142. package/build-module/components/post-author/panel.js.map +1 -1
  143. package/build-module/components/post-card-panel/index.js +8 -36
  144. package/build-module/components/post-card-panel/index.js.map +1 -1
  145. package/build-module/components/post-content-information/index.js +1 -2
  146. package/build-module/components/post-content-information/index.js.map +1 -1
  147. package/build-module/components/post-featured-image/index.js +26 -7
  148. package/build-module/components/post-featured-image/index.js.map +1 -1
  149. package/build-module/components/post-last-revision/index.js +1 -1
  150. package/build-module/components/post-last-revision/index.js.map +1 -1
  151. package/build-module/components/post-schedule/label.js +1 -1
  152. package/build-module/components/post-schedule/label.js.map +1 -1
  153. package/build-module/components/post-taxonomies/flat-term-selector.js +12 -4
  154. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  155. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  156. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  157. package/build-module/components/post-url/index.js +1 -1
  158. package/build-module/components/post-url/index.js.map +1 -1
  159. package/build-module/components/post-url/panel.js +3 -3
  160. package/build-module/components/post-url/panel.js.map +1 -1
  161. package/build-module/components/preview-dropdown/index.js +0 -4
  162. package/build-module/components/preview-dropdown/index.js.map +1 -1
  163. package/build-module/components/provider/index.js +10 -12
  164. package/build-module/components/provider/index.js.map +1 -1
  165. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  166. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  167. package/build-module/components/sidebar/header.js +2 -1
  168. package/build-module/components/sidebar/header.js.map +1 -1
  169. package/build-module/components/sidebar/index.js +4 -4
  170. package/build-module/components/sidebar/index.js.map +1 -1
  171. package/build-module/components/time-to-read/index.js +2 -2
  172. package/build-module/components/time-to-read/index.js.map +1 -1
  173. package/build-module/components/visual-editor/index.js +26 -28
  174. package/build-module/components/visual-editor/index.js.map +1 -1
  175. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
  176. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  177. package/build-module/components/zoom-out-toggle/index.js +37 -5
  178. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  179. package/build-module/dataviews/actions/duplicate-template-part.js +3 -3
  180. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
  181. package/build-module/store/actions.js +4 -3
  182. package/build-module/store/actions.js.map +1 -1
  183. package/build-module/store/private-actions.js +3 -3
  184. package/build-module/store/private-actions.js.map +1 -1
  185. package/build-module/store/selectors.js +3 -2
  186. package/build-module/store/selectors.js.map +1 -1
  187. package/build-module/utils/pageTypeBadge.js +45 -0
  188. package/build-module/utils/pageTypeBadge.js.map +1 -0
  189. package/build-module/utils/terms.js +2 -2
  190. package/build-module/utils/terms.js.map +1 -1
  191. package/build-style/style-rtl.css +96 -54
  192. package/build-style/style.css +96 -54
  193. package/build-types/bindings/post-meta.d.ts.map +1 -1
  194. package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
  195. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
  196. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
  197. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
  198. package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
  199. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
  200. package/build-types/components/collab-sidebar/comments.d.ts +19 -0
  201. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
  202. package/build-types/components/collab-sidebar/constants.d.ts +2 -0
  203. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
  204. package/build-types/components/collab-sidebar/index.d.ts +5 -0
  205. package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
  206. package/build-types/components/collab-sidebar/utils.d.ts +8 -0
  207. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
  208. package/build-types/components/commands/index.d.ts.map +1 -1
  209. package/build-types/components/document-bar/index.d.ts.map +1 -1
  210. package/build-types/components/document-tools/index.d.ts.map +1 -1
  211. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  212. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  213. package/build-types/components/header/index.d.ts.map +1 -1
  214. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  215. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  216. package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
  217. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  218. package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
  219. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  220. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  221. package/build-types/components/post-author/panel.d.ts.map +1 -1
  222. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  223. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  224. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  225. package/build-types/components/provider/index.d.ts.map +1 -1
  226. package/build-types/components/sidebar/index.d.ts.map +1 -1
  227. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  228. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
  229. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
  230. package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
  231. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  232. package/build-types/store/actions.d.ts.map +1 -1
  233. package/build-types/store/selectors.d.ts.map +1 -1
  234. package/build-types/utils/pageTypeBadge.d.ts +5 -0
  235. package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
  236. package/build-types/utils/terms.d.ts.map +1 -1
  237. package/package.json +38 -37
  238. package/src/bindings/post-meta.js +1 -0
  239. package/src/components/collab-sidebar/add-comment.js +124 -0
  240. package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
  241. package/src/components/collab-sidebar/comment-button.js +31 -0
  242. package/src/components/collab-sidebar/comments.js +404 -0
  243. package/src/components/collab-sidebar/constants.js +1 -0
  244. package/src/components/collab-sidebar/index.js +307 -0
  245. package/src/components/collab-sidebar/style.scss +111 -0
  246. package/src/components/collab-sidebar/utils.js +9 -0
  247. package/src/components/commands/index.js +9 -7
  248. package/src/components/document-bar/index.js +15 -7
  249. package/src/components/document-bar/style.scss +0 -4
  250. package/src/components/document-tools/index.js +1 -7
  251. package/src/components/editor-interface/index.js +4 -3
  252. package/src/components/entities-saved-states/index.js +2 -2
  253. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  254. package/src/components/global-styles-provider/index.js +20 -6
  255. package/src/components/header/index.js +3 -1
  256. package/src/components/inserter-sidebar/index.js +3 -6
  257. package/src/components/page-attributes/parent.js +6 -4
  258. package/src/components/plugin-more-menu-item/index.js +12 -11
  259. package/src/components/plugin-preview-menu-item/index.js +14 -13
  260. package/src/components/plugin-sidebar/index.js +0 -13
  261. package/src/components/post-actions/index.js +8 -11
  262. package/src/components/post-author/panel.js +4 -2
  263. package/src/components/post-card-panel/index.js +9 -43
  264. package/src/components/post-card-panel/style.scss +1 -9
  265. package/src/components/post-content-information/index.js +1 -1
  266. package/src/components/post-featured-image/index.js +31 -16
  267. package/src/components/post-featured-image/style.scss +5 -2
  268. package/src/components/post-last-revision/index.js +1 -1
  269. package/src/components/post-schedule/label.js +1 -1
  270. package/src/components/post-sticky/test/index.js +6 -6
  271. package/src/components/post-taxonomies/flat-term-selector.js +15 -4
  272. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  273. package/src/components/post-url/index.js +1 -1
  274. package/src/components/post-url/panel.js +4 -2
  275. package/src/components/preview-dropdown/index.js +0 -2
  276. package/src/components/provider/index.js +31 -24
  277. package/src/components/provider/use-block-editor-settings.js +1 -1
  278. package/src/components/sidebar/header.js +3 -2
  279. package/src/components/sidebar/index.js +5 -3
  280. package/src/components/time-to-read/index.js +3 -3
  281. package/src/components/visual-editor/index.js +32 -41
  282. package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
  283. package/src/components/zoom-out-toggle/index.js +39 -5
  284. package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
  285. package/src/store/actions.js +5 -3
  286. package/src/store/private-actions.js +3 -3
  287. package/src/store/selectors.js +3 -2
  288. package/src/style.scss +1 -0
  289. package/src/utils/pageTypeBadge.js +41 -0
  290. package/src/utils/terms.js +4 -2
  291. package/src/utils/test/terms.js +3 -3
  292. package/tsconfig.tsbuildinfo +1 -1
@@ -1,7 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
1
  /**
6
2
  * WordPress dependencies
7
3
  */
@@ -22,27 +18,20 @@ import { store as editorStore } from '../../store';
22
18
  import {
23
19
  TEMPLATE_POST_TYPE,
24
20
  TEMPLATE_PART_POST_TYPE,
25
- PATTERN_POST_TYPE,
26
- GLOBAL_POST_TYPES,
27
21
  } from '../../store/constants';
28
22
  import { unlock } from '../../lock-unlock';
29
23
  import PostActions from '../post-actions';
24
+ import usePageTypeBadge from '../../utils/pageTypeBadge';
30
25
 
31
26
  export default function PostCardPanel( {
32
27
  postType,
33
28
  postId,
34
29
  onActionPerformed,
35
30
  } ) {
36
- const { isFrontPage, isPostsPage, title, icon, isSync } = useSelect(
31
+ const { title, icon } = useSelect(
37
32
  ( select ) => {
38
33
  const { __experimentalGetTemplateInfo } = select( editorStore );
39
- const { canUser, getEditedEntityRecord } = select( coreStore );
40
- const siteSettings = canUser( 'read', {
41
- kind: 'root',
42
- name: 'site',
43
- } )
44
- ? getEditedEntityRecord( 'root', 'site' )
45
- : undefined;
34
+ const { getEditedEntityRecord } = select( coreStore );
46
35
  const _record = getEditedEntityRecord(
47
36
  'postType',
48
37
  postType,
@@ -52,31 +41,18 @@ export default function PostCardPanel( {
52
41
  [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(
53
42
  postType
54
43
  ) && __experimentalGetTemplateInfo( _record );
55
- let _isSync = false;
56
- if ( GLOBAL_POST_TYPES.includes( postType ) ) {
57
- if ( PATTERN_POST_TYPE === postType ) {
58
- // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
59
- const currentSyncStatus =
60
- _record?.meta?.wp_pattern_sync_status === 'unsynced'
61
- ? 'unsynced'
62
- : _record?.wp_pattern_sync_status;
63
- _isSync = currentSyncStatus !== 'unsynced';
64
- } else {
65
- _isSync = true;
66
- }
67
- }
68
44
  return {
69
45
  title: _templateInfo?.title || _record?.title,
70
46
  icon: unlock( select( editorStore ) ).getPostIcon( postType, {
71
47
  area: _record?.area,
72
48
  } ),
73
- isSync: _isSync,
74
- isFrontPage: siteSettings?.page_on_front === postId,
75
- isPostsPage: siteSettings?.page_for_posts === postId,
76
49
  };
77
50
  },
78
51
  [ postId, postType ]
79
52
  );
53
+
54
+ const pageTypeBadge = usePageTypeBadge();
55
+
80
56
  return (
81
57
  <div className="editor-post-card-panel">
82
58
  <HStack
@@ -84,12 +60,7 @@ export default function PostCardPanel( {
84
60
  className="editor-post-card-panel__header"
85
61
  align="flex-start"
86
62
  >
87
- <Icon
88
- className={ clsx( 'editor-post-card-panel__icon', {
89
- 'is-sync': isSync,
90
- } ) }
91
- icon={ icon }
92
- />
63
+ <Icon className="editor-post-card-panel__icon" icon={ icon } />
93
64
  <Text
94
65
  numberOfLines={ 2 }
95
66
  truncate
@@ -99,14 +70,9 @@ export default function PostCardPanel( {
99
70
  lineHeight="20px"
100
71
  >
101
72
  { title ? decodeEntities( title ) : __( 'No title' ) }
102
- { isFrontPage && (
103
- <span className="editor-post-card-panel__title-badge">
104
- { __( 'Homepage' ) }
105
- </span>
106
- ) }
107
- { isPostsPage && (
73
+ { pageTypeBadge && (
108
74
  <span className="editor-post-card-panel__title-badge">
109
- { __( 'Posts Page' ) }
75
+ { pageTypeBadge }
110
76
  </span>
111
77
  ) }
112
78
  </Text>
@@ -34,17 +34,9 @@
34
34
  }
35
35
  }
36
36
 
37
- .editor-post-card-panel__icon.is-sync {
38
- fill: var(--wp-block-synced-color);
39
-
40
- & + .editor-post-card-panel__title {
41
- color: var(--wp-block-synced-color);
42
- }
43
- }
44
-
45
37
  .editor-post-card-panel__title-badge {
46
38
  background: $gray-100;
47
- color: $gray-700;
39
+ color: $gray-800;
48
40
  padding: 0 $grid-unit-05;
49
41
  border-radius: $radius-small;
50
42
  font-size: 12px;
@@ -70,7 +70,7 @@ export default function PostContentInformation() {
70
70
  readingTime <= 1
71
71
  ? __( '1 minute' )
72
72
  : sprintf(
73
- // translators: %s: the number of minutes to read the post.
73
+ /* translators: %s: the number of minutes to read the post. */
74
74
  _n( '%s minute', '%s minutes', readingTime ),
75
75
  readingTime.toLocaleString()
76
76
  );
@@ -121,6 +121,35 @@ function PostFeaturedImage( {
121
121
  } );
122
122
  }
123
123
 
124
+ /**
125
+ * Generates the featured image alt text for this editing context.
126
+ *
127
+ * @param {Object} imageMedia The image media object.
128
+ * @param {string} imageMedia.alt_text The alternative text of the image.
129
+ * @param {Object} imageMedia.media_details The media details of the image.
130
+ * @param {Object} imageMedia.media_details.sizes The sizes of the image.
131
+ * @param {Object} imageMedia.media_details.sizes.full The full size details of the image.
132
+ * @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image.
133
+ * @param {string} imageMedia.slug The slug of the image.
134
+ * @return {string} The featured image alt text.
135
+ */
136
+ function getImageDescription( imageMedia ) {
137
+ if ( imageMedia.alt_text ) {
138
+ return sprintf(
139
+ // Translators: %s: The selected image alt text.
140
+ __( 'Current image: %s' ),
141
+ imageMedia.alt_text
142
+ );
143
+ }
144
+ return sprintf(
145
+ // Translators: %s: The selected image filename.
146
+ __(
147
+ 'The current image has no alternative text. The file name is: %s'
148
+ ),
149
+ imageMedia.media_details.sizes?.full?.file || imageMedia.slug
150
+ );
151
+ }
152
+
124
153
  return (
125
154
  <PostFeaturedImageCheck>
126
155
  { noticeUI }
@@ -130,21 +159,7 @@ function PostFeaturedImage( {
130
159
  id={ `editor-post-featured-image-${ featuredImageId }-describedby` }
131
160
  className="hidden"
132
161
  >
133
- { media.alt_text &&
134
- sprintf(
135
- // Translators: %s: The selected image alt text.
136
- __( 'Current image: %s' ),
137
- media.alt_text
138
- ) }
139
- { ! media.alt_text &&
140
- sprintf(
141
- // Translators: %s: The selected image filename.
142
- __(
143
- 'The current image has no alternative text. The file name is: %s'
144
- ),
145
- media.media_details.sizes?.full?.file ||
146
- media.slug
147
- ) }
162
+ { getImageDescription( media ) }
148
163
  </div>
149
164
  ) }
150
165
  <MediaUploadCheck fallback={ instructions }>
@@ -188,7 +203,7 @@ function PostFeaturedImage( {
188
203
  <img
189
204
  className="editor-post-featured-image__preview-image"
190
205
  src={ mediaSourceUrl }
191
- alt=""
206
+ alt={ getImageDescription( media ) }
192
207
  />
193
208
  ) }
194
209
  { isLoading && <Spinner /> }
@@ -41,8 +41,6 @@
41
41
  .editor-post-featured-image__preview {
42
42
  width: 100%;
43
43
  padding: 0;
44
- transition: all 0.1s ease-out;
45
- @include reduce-motion("transition");
46
44
  box-shadow: 0 0 0 0 var(--wp-admin-theme-color);
47
45
  overflow: hidden; // Ensure the focus style properly encapsulates the image.
48
46
  outline-offset: -#{$border-width};
@@ -66,6 +64,11 @@
66
64
 
67
65
  .editor-post-featured-image__toggle {
68
66
  box-shadow: inset 0 0 0 $border-width $gray-400;
67
+
68
+ &:focus:not(:disabled) {
69
+ // Allow smooth transition between focused and unfocused box-shadow states.
70
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
71
+ }
69
72
  }
70
73
 
71
74
  .editor-post-featured-image__actions {
@@ -44,7 +44,7 @@ function PostLastRevision() {
44
44
  icon={ backup }
45
45
  iconPosition="right"
46
46
  text={ sprintf(
47
- /* translators: %s: number of revisions */
47
+ /* translators: %s: number of revisions. */
48
48
  __( 'Revisions (%s)' ),
49
49
  revisionsCount
50
50
  ) }
@@ -48,7 +48,7 @@ export function getFullPostScheduleLabel( dateAttribute ) {
48
48
 
49
49
  const timezoneAbbreviation = getTimezoneAbbreviation();
50
50
  const formattedDate = dateI18n(
51
- // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
51
+ // translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
52
52
  _x( 'F j, Y g:i\xa0a', 'post schedule full date format' ),
53
53
  date
54
54
  );
@@ -35,23 +35,23 @@ function setupUseSelectMock( { hasStickyAction, postType } ) {
35
35
  describe( 'PostSticky', () => {
36
36
  it( 'should not render anything if the post type is not "post"', () => {
37
37
  setupUseSelectMock( { hasStickyAction: true, postType: 'page' } );
38
- render( <PostStickyCheck>Can Toggle Sticky</PostStickyCheck> );
38
+ render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
39
39
  expect(
40
- screen.queryByText( 'Can Toggle Sticky' )
40
+ screen.queryByText( 'Can Show Sticky' )
41
41
  ).not.toBeInTheDocument();
42
42
  } );
43
43
 
44
44
  it( "should not render anything if post doesn't support stickying", () => {
45
45
  setupUseSelectMock( { hasStickyAction: false, postType: 'post' } );
46
- render( <PostStickyCheck>Can Toggle Sticky</PostStickyCheck> );
46
+ render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
47
47
  expect(
48
- screen.queryByText( 'Can Toggle Sticky' )
48
+ screen.queryByText( 'Can Show Sticky' )
49
49
  ).not.toBeInTheDocument();
50
50
  } );
51
51
 
52
52
  it( 'should render if the post supports stickying', () => {
53
53
  setupUseSelectMock( { hasStickyAction: true, postType: 'post' } );
54
- render( <PostStickyCheck>Can Toggle Sticky</PostStickyCheck> );
55
- expect( screen.getByText( 'Can Toggle Sticky' ) ).toBeVisible();
54
+ render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
55
+ expect( screen.getByText( 'Can Show Sticky' ) ).toBeVisible();
56
56
  } );
57
57
  } );
@@ -2,8 +2,12 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __, _x, sprintf } from '@wordpress/i18n';
5
- import { useEffect, useMemo, useState } from '@wordpress/element';
6
- import { FormTokenField, withFilters } from '@wordpress/components';
5
+ import { Fragment, useEffect, useMemo, useState } from '@wordpress/element';
6
+ import {
7
+ FormTokenField,
8
+ withFilters,
9
+ __experimentalVStack as VStack,
10
+ } from '@wordpress/components';
7
11
  import { useSelect, useDispatch } from '@wordpress/data';
8
12
  import deprecated from '@wordpress/deprecated';
9
13
  import { store as coreStore } from '@wordpress/core-data';
@@ -288,8 +292,15 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
288
292
  singularName
289
293
  );
290
294
 
295
+ const Wrapper = ( { children } ) =>
296
+ __nextHasNoMarginBottom ? (
297
+ <VStack spacing={ 4 }>{ children }</VStack>
298
+ ) : (
299
+ <Fragment>{ children }</Fragment>
300
+ );
301
+
291
302
  return (
292
- <>
303
+ <Wrapper>
293
304
  <FormTokenField
294
305
  __next40pxDefaultSize
295
306
  value={ values }
@@ -306,7 +317,7 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
306
317
  __nextHasNoMarginBottom={ __nextHasNoMarginBottom }
307
318
  />
308
319
  <MostUsedTerms taxonomy={ taxonomy } onSelect={ appendTerm } />
309
- </>
320
+ </Wrapper>
310
321
  );
311
322
  }
312
323
 
@@ -310,7 +310,7 @@ export function HierarchicalTermSelector( { slug } ) {
310
310
  const defaultName =
311
311
  slug === 'category' ? __( 'Category' ) : __( 'Term' );
312
312
  const termAddedMessage = sprintf(
313
- /* translators: %s: taxonomy name */
313
+ /* translators: %s: term name. */
314
314
  _x( '%s added', 'term' ),
315
315
  taxonomy?.labels?.singular_name ?? defaultName
316
316
  );
@@ -341,7 +341,7 @@ export function HierarchicalTermSelector( { slug } ) {
341
341
 
342
342
  const resultCount = getResultCount( newFilteredTermsTree );
343
343
  const resultsFoundMessage = sprintf(
344
- /* translators: %d: number of results */
344
+ /* translators: %d: number of results. */
345
345
  _n( '%d result found.', '%d results found.', resultCount ),
346
346
  resultCount
347
347
  );
@@ -76,7 +76,7 @@ export default function PostURL( { onClose } ) {
76
76
  } );
77
77
  } );
78
78
  const postUrlSlugDescriptionId =
79
- 'editor-post-url__slug-descriotion-' + useInstanceId( PostURL );
79
+ 'editor-post-url__slug-description-' + useInstanceId( PostURL );
80
80
 
81
81
  return (
82
82
  <div className="editor-post-url">
@@ -93,8 +93,10 @@ function PostURLToggle( { isOpen, onClick } ) {
93
93
  className="editor-post-url__panel-toggle"
94
94
  variant="tertiary"
95
95
  aria-expanded={ isOpen }
96
- // translators: %s: Current post link.
97
- aria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }
96
+ aria-label={
97
+ // translators: %s: Current post link.
98
+ sprintf( __( 'Change link: %s' ), decodedSlug )
99
+ }
98
100
  onClick={ onClick }
99
101
  >
100
102
  <>{ decodedSlug }</>
@@ -46,12 +46,10 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
46
46
  };
47
47
  }, [] );
48
48
  const { setDeviceType } = useDispatch( editorStore );
49
- const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
50
49
  const { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );
51
50
 
52
51
  const handleDevicePreviewChange = ( newDeviceType ) => {
53
52
  setDeviceType( newDeviceType );
54
- __unstableSetEditorMode( 'edit' );
55
53
  resetZoomLevel();
56
54
  };
57
55
 
@@ -164,40 +164,47 @@ export const ExperimentalEditorProvider = withRegistryProvider(
164
164
  BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
165
165
  __unstableTemplate: template,
166
166
  } ) => {
167
- const { editorSettings, selection, isReady, mode, postTypes } =
168
- useSelect( ( select ) => {
169
- const {
170
- getEditorSettings,
171
- getEditorSelection,
172
- getRenderingMode,
173
- __unstableIsEditorReady,
174
- } = select( editorStore );
175
- const { getPostTypes } = select( coreStore );
167
+ const { editorSettings, selection, isReady, mode, postTypeEntities } =
168
+ useSelect(
169
+ ( select ) => {
170
+ const {
171
+ getEditorSettings,
172
+ getEditorSelection,
173
+ getRenderingMode,
174
+ __unstableIsEditorReady,
175
+ } = select( editorStore );
176
+ const { getEntitiesConfig } = select( coreStore );
176
177
 
177
- return {
178
- editorSettings: getEditorSettings(),
179
- isReady: __unstableIsEditorReady(),
180
- mode: getRenderingMode(),
181
- selection: getEditorSelection(),
182
- postTypes: getPostTypes( { per_page: -1 } ),
183
- };
184
- }, [] );
178
+ return {
179
+ editorSettings: getEditorSettings(),
180
+ isReady: __unstableIsEditorReady(),
181
+ mode: getRenderingMode(),
182
+ selection: getEditorSelection(),
183
+ postTypeEntities:
184
+ post.type === 'wp_template'
185
+ ? getEntitiesConfig( 'postType' )
186
+ : null,
187
+ };
188
+ },
189
+ [ post.type ]
190
+ );
185
191
  const shouldRenderTemplate = !! template && mode !== 'post-only';
186
192
  const rootLevelPost = shouldRenderTemplate ? template : post;
187
193
  const defaultBlockContext = useMemo( () => {
188
194
  const postContext = {};
189
- // If it is a template, try to inherit the post type from the slug.
195
+ // If it is a template, try to inherit the post type from the name.
190
196
  if ( post.type === 'wp_template' ) {
191
197
  if ( post.slug === 'page' ) {
192
198
  postContext.postType = 'page';
193
199
  } else if ( post.slug === 'single' ) {
194
200
  postContext.postType = 'post';
195
201
  } else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {
196
- // If the slug is single-{postType}, infer the post type from the slug.
197
- const postTypesSlugs =
198
- postTypes?.map( ( entity ) => entity.slug ) || [];
202
+ // If the slug is single-{postType}, infer the post type from the name.
203
+ const postTypeNames =
204
+ postTypeEntities?.map( ( entity ) => entity.name ) ||
205
+ [];
199
206
  const match = post.slug.match(
200
- `^single-(${ postTypesSlugs.join( '|' ) })(?:-.+)?$`
207
+ `^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`
201
208
  );
202
209
  if ( match ) {
203
210
  postContext.postType = match[ 1 ];
@@ -225,7 +232,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
225
232
  post.slug,
226
233
  rootLevelPost.type,
227
234
  rootLevelPost.slug,
228
- postTypes,
235
+ postTypeEntities,
229
236
  ] );
230
237
  const { id, type } = rootLevelPost;
231
238
  const blockEditorSettings = useBlockEditorSettings(
@@ -323,7 +330,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
323
330
  useSubRegistry={ false }
324
331
  >
325
332
  { children }
326
- { ! settings.__unstableIsPreviewMode && (
333
+ { ! settings.isPreviewMode && (
327
334
  <>
328
335
  <PatternsMenuItems />
329
336
  <TemplatePartMenuItems />
@@ -74,6 +74,7 @@ const BLOCK_EDITOR_SETTINGS = [
74
74
  'imageDimensions',
75
75
  'imageEditing',
76
76
  'imageSizes',
77
+ 'isPreviewMode',
77
78
  'isRTL',
78
79
  'locale',
79
80
  'maxWidth',
@@ -85,7 +86,6 @@ const BLOCK_EDITOR_SETTINGS = [
85
86
  'supportsLayout',
86
87
  'widgetTypesToHideFromLegacyWidgetBlock',
87
88
  '__unstableHasCustomAppender',
88
- '__unstableIsPreviewMode',
89
89
  '__unstableResolvedAssets',
90
90
  '__unstableIsBlockBasedTheme',
91
91
  ];
@@ -20,8 +20,9 @@ const SidebarHeader = ( _, ref ) => {
20
20
  const { getPostTypeLabel } = select( editorStore );
21
21
 
22
22
  return {
23
- // translators: Default label for the Document sidebar tab, not selected.
24
- documentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),
23
+ documentLabel:
24
+ // translators: Default label for the Document sidebar tab, not selected.
25
+ getPostTypeLabel() || _x( 'Document', 'noun, sidebar' ),
25
26
  };
26
27
  }, [] );
27
28
 
@@ -13,7 +13,7 @@ import {
13
13
  useEffect,
14
14
  useRef,
15
15
  } from '@wordpress/element';
16
- import { isRTL, __ } from '@wordpress/i18n';
16
+ import { isRTL, __, _x } from '@wordpress/i18n';
17
17
  import { drawerLeft, drawerRight } from '@wordpress/icons';
18
18
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
19
19
  import { privateApis as componentsPrivateApis } from '@wordpress/components';
@@ -101,8 +101,10 @@ const SidebarContent = ( {
101
101
  // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
102
102
  className="editor-sidebar__panel"
103
103
  headerClassName="editor-sidebar__panel-tabs"
104
- /* translators: button label text should, if possible, be under 16 characters. */
105
- title={ __( 'Settings' ) }
104
+ title={
105
+ /* translators: button label text should, if possible, be under 16 characters. */
106
+ _x( 'Settings', 'sidebar button label' )
107
+ }
106
108
  toggleShortcut={ keyboardShortcut }
107
109
  icon={ isRTL() ? drawerLeft : drawerRight }
108
110
  isActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }
@@ -47,10 +47,10 @@ export default function TimeToRead() {
47
47
  } )
48
48
  : createInterpolateElement(
49
49
  sprintf(
50
- /* translators: %s is the number of minutes the post will take to read. */
50
+ /* translators: %s: the number of minutes to read the post. */
51
51
  _n(
52
- '<span>%d</span> minute',
53
- '<span>%d</span> minutes',
52
+ '<span>%s</span> minute',
53
+ '<span>%s</span> minutes',
54
54
  minutesToRead
55
55
  ),
56
56
  minutesToRead