@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
@@ -0,0 +1,111 @@
1
+ .editor-collab-sidebar-panel {
2
+ padding: $grid-unit-20;
3
+
4
+ &__thread {
5
+ position: relative;
6
+ padding: $grid-unit-20;
7
+ border-radius: $radius-large;
8
+ border: 1px solid $gray-300;
9
+ background-color: $gray-100;
10
+ margin-bottom: $grid-unit-20;
11
+ }
12
+
13
+ &__active-thread {
14
+ border: 1.5px solid #3858e9;
15
+ background-color: $white;
16
+ box-shadow: 0 5.5px 7.8px -0.3px rgba(0, 0, 0, 0.102);
17
+ }
18
+
19
+ &__comment-field {
20
+ flex: 1;
21
+ }
22
+
23
+ &__child-thread {
24
+ margin-top: 15px;
25
+ }
26
+
27
+ &__user-name {
28
+ font-size: 12px;
29
+ font-weight: 400;
30
+ line-height: 16px;
31
+ text-align: left;
32
+ color: $gray-700;
33
+ text-transform: capitalize;
34
+ }
35
+
36
+ &__user-time {
37
+ font-size: 12px;
38
+ font-weight: 400;
39
+ line-height: 16px;
40
+ text-align: left;
41
+ color: $gray-700;
42
+ }
43
+
44
+ &__user-comment {
45
+ font-size: 13px;
46
+ font-weight: 400;
47
+ line-height: 20px;
48
+ text-align: left;
49
+ color: $gray-900;
50
+
51
+ p {
52
+ margin-bottom: 0;
53
+ }
54
+ }
55
+
56
+ &__user-avatar {
57
+ border-radius: $radius-round;
58
+ flex-shrink: 0;
59
+ }
60
+
61
+ &__thread-overlay {
62
+ background-color: rgba(0, 0, 0, 0.7);
63
+ width: 100%;
64
+ height: 100%;
65
+ text-align: center;
66
+ position: absolute;
67
+ top: 0;
68
+ left: 0;
69
+ z-index: 1;
70
+ padding: 15px;
71
+ border-radius: $radius-large;
72
+ color: $white;
73
+
74
+ p {
75
+ margin-bottom: 15px;
76
+ }
77
+
78
+ button {
79
+ padding: 4px 10px;
80
+ color: $white;
81
+ }
82
+ }
83
+
84
+ &__comment-status {
85
+ margin-left: auto;
86
+
87
+ button {
88
+ &.has-icon:not(.has-text) {
89
+ min-width: 24px;
90
+ padding: 0;
91
+ width: 24px;
92
+ height: 24px;
93
+ flex-shrink: 0;
94
+ }
95
+ }
96
+ }
97
+
98
+ &__comment-dropdown-menu {
99
+ flex-shrink: 0;
100
+
101
+ button {
102
+ &.has-icon {
103
+ min-width: 24px;
104
+ padding: 0;
105
+ width: 24px;
106
+ height: 24px;
107
+ }
108
+ }
109
+ }
110
+
111
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sanitizes a comment string by removing non-printable ASCII characters.
3
+ *
4
+ * @param {string} str - The comment string to sanitize.
5
+ * @return {string} - The sanitized comment string.
6
+ */
7
+ export function sanitizeCommentString( str ) {
8
+ return str.trim();
9
+ }
@@ -57,7 +57,7 @@ function useEditorCommandLoader() {
57
57
  isDistractionFree: get( 'core', 'distractionFree' ),
58
58
  isFocusMode: get( 'core', 'focusMode' ),
59
59
  isTopToolbar: get( 'core', 'fixedToolbar' ),
60
- isPreviewMode: getSettings().__unstableIsPreviewMode,
60
+ isPreviewMode: getSettings().isPreviewMode,
61
61
  isViewable: getPostType( getCurrentPostType() )?.viewable ?? false,
62
62
  isCodeEditingEnabled: getEditorSettings().codeEditingEnabled,
63
63
  isRichEditingEnabled: getEditorSettings().richEditingEnabled,
@@ -98,8 +98,8 @@ function useEditorCommandLoader() {
98
98
  commands.push( {
99
99
  name: 'core/toggle-distraction-free',
100
100
  label: isDistractionFree
101
- ? __( 'Exit Distraction Free' )
102
- : __( 'Enter Distraction Free' ),
101
+ ? __( 'Exit Distraction free' )
102
+ : __( 'Enter Distraction free' ),
103
103
  callback: ( { close } ) => {
104
104
  toggleDistractionFree();
105
105
  close();
@@ -117,7 +117,9 @@ function useEditorCommandLoader() {
117
117
 
118
118
  commands.push( {
119
119
  name: 'core/toggle-spotlight-mode',
120
- label: __( 'Toggle spotlight' ),
120
+ label: isFocusMode
121
+ ? __( 'Exit Spotlight mode' )
122
+ : __( 'Enter Spotlight mode' ),
121
123
  callback: ( { close } ) => {
122
124
  toggle( 'core', 'focusMode' );
123
125
  close();
@@ -160,7 +162,7 @@ function useEditorCommandLoader() {
160
162
 
161
163
  commands.push( {
162
164
  name: 'core/toggle-top-toolbar',
163
- label: __( 'Toggle top toolbar' ),
165
+ label: __( 'Top toolbar' ),
164
166
  callback: ( { close } ) => {
165
167
  toggle( 'core', 'fixedToolbar' );
166
168
  if ( isDistractionFree ) {
@@ -224,7 +226,7 @@ function useEditorCommandLoader() {
224
226
 
225
227
  commands.push( {
226
228
  name: 'core/open-settings-sidebar',
227
- label: __( 'Toggle settings sidebar' ),
229
+ label: __( 'Show or hide the Settings panel.' ),
228
230
  icon: isRTL() ? drawerLeft : drawerRight,
229
231
  callback: ( { close } ) => {
230
232
  const activeSidebar = getActiveComplementaryArea( 'core' );
@@ -239,7 +241,7 @@ function useEditorCommandLoader() {
239
241
 
240
242
  commands.push( {
241
243
  name: 'core/open-block-inspector',
242
- label: __( 'Toggle block inspector' ),
244
+ label: __( 'Show or hide the Block settings panel' ),
243
245
  icon: blockDefault,
244
246
  callback: ( { close } ) => {
245
247
  const activeSidebar = getActiveComplementaryArea( 'core' );
@@ -26,8 +26,9 @@ import { decodeEntities } from '@wordpress/html-entities';
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- import { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';
29
+ import { TEMPLATE_POST_TYPES } from '../../store/constants';
30
30
  import { store as editorStore } from '../../store';
31
+ import usePageTypeBadge from '../../utils/pageTypeBadge';
31
32
 
32
33
  /** @typedef {import("@wordpress/components").IconType} IconType */
33
34
 
@@ -56,7 +57,6 @@ export default function DocumentBar( props ) {
56
57
  postTypeLabel,
57
58
  documentTitle,
58
59
  isNotFound,
59
- isUnsyncedPattern,
60
60
  templateTitle,
61
61
  onNavigateToPreviousEntityRecord,
62
62
  } = useSelect( ( select ) => {
@@ -93,7 +93,6 @@ export default function DocumentBar( props ) {
93
93
  _postType,
94
94
  _postId
95
95
  ),
96
- isUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',
97
96
  templateTitle: _templateInfo.title,
98
97
  onNavigateToPreviousEntityRecord:
99
98
  getEditorSettings().onNavigateToPreviousEntityRecord,
@@ -104,12 +103,13 @@ export default function DocumentBar( props ) {
104
103
  const isReducedMotion = useReducedMotion();
105
104
 
106
105
  const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
107
- const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
108
106
  const hasBackButton = !! onNavigateToPreviousEntityRecord;
109
107
  const entityTitle = isTemplate ? templateTitle : documentTitle;
110
108
  const title = props.title || entityTitle;
111
109
  const icon = props.icon;
112
110
 
111
+ const pageTypeBadge = usePageTypeBadge();
112
+
113
113
  const mountedRef = useRef( false );
114
114
  useEffect( () => {
115
115
  mountedRef.current = true;
@@ -119,7 +119,6 @@ export default function DocumentBar( props ) {
119
119
  <div
120
120
  className={ clsx( 'editor-document-bar', {
121
121
  'has-back-button': hasBackButton,
122
- 'is-global': isGlobalEntity && ! isUnsyncedPattern,
123
122
  } ) }
124
123
  >
125
124
  <AnimatePresence>
@@ -184,11 +183,20 @@ export default function DocumentBar( props ) {
184
183
  ? decodeEntities( title )
185
184
  : __( 'No title' ) }
186
185
  </span>
187
- { postTypeLabel && ! props.title && (
186
+ { pageTypeBadge && (
188
187
  <span className="editor-document-bar__post-type-label">
189
- { ' + decodeEntities( postTypeLabel ) }
188
+ { ${ pageTypeBadge }` }
190
189
  </span>
191
190
  ) }
191
+ { postTypeLabel &&
192
+ ! props.title &&
193
+ ! pageTypeBadge && (
194
+ <span className="editor-document-bar__post-type-label">
195
+ { `· ${ decodeEntities(
196
+ postTypeLabel
197
+ ) }` }
198
+ </span>
199
+ ) }
192
200
  </Text>
193
201
  </motion.div>
194
202
  <span className="editor-document-bar__shortcut">
@@ -67,10 +67,6 @@
67
67
  flex: 1;
68
68
  overflow: hidden;
69
69
  text-overflow: ellipsis;
70
-
71
- .editor-document-bar.is-global & {
72
- color: var(--wp-block-synced-color);
73
- }
74
70
  }
75
71
 
76
72
  .editor-document-bar__post-type-label {
@@ -9,11 +9,7 @@ import clsx from 'clsx';
9
9
  import { useViewportMatch } from '@wordpress/compose';
10
10
  import { useSelect, useDispatch } from '@wordpress/data';
11
11
  import { __, _x } from '@wordpress/i18n';
12
- import {
13
- NavigableToolbar,
14
- ToolSelector,
15
- store as blockEditorStore,
16
- } from '@wordpress/block-editor';
12
+ import { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';
17
13
  import { Button, ToolbarItem } from '@wordpress/components';
18
14
  import { listView, plus } from '@wordpress/icons';
19
15
  import { useCallback } from '@wordpress/element';
@@ -48,7 +44,6 @@ function DocumentTools( { className, disableBlockTools = false } ) {
48
44
  getListViewToggleRef,
49
45
  } = unlock( select( editorStore ) );
50
46
  const { getShortcutRepresentation } = select( keyboardShortcutsStore );
51
- const { __unstableGetEditorMode } = select( blockEditorStore );
52
47
 
53
48
  return {
54
49
  isInserterOpened: select( editorStore ).isInserterOpened(),
@@ -61,7 +56,6 @@ function DocumentTools( { className, disableBlockTools = false } ) {
61
56
  showIconLabels: get( 'core', 'showIconLabels' ),
62
57
  isDistractionFree: get( 'core', 'distractionFree' ),
63
58
  isVisualMode: getEditorMode() === 'visual',
64
- isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
65
59
  };
66
60
  }, [] );
67
61
 
@@ -83,10 +83,11 @@ export default function EditorInterface( {
83
83
  isInserterOpened: select( editorStore ).isInserterOpened(),
84
84
  isListViewOpened: select( editorStore ).isListViewOpened(),
85
85
  isDistractionFree: get( 'core', 'distractionFree' ),
86
- isPreviewMode: editorSettings.__unstableIsPreviewMode,
86
+ isPreviewMode: editorSettings.isPreviewMode,
87
87
  showBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),
88
- // translators: Default label for the Document in the Block Breadcrumb.
89
- documentLabel: postTypeLabel || _x( 'Document', 'noun' ),
88
+ documentLabel:
89
+ // translators: Default label for the Document in the Block Breadcrumb.
90
+ postTypeLabel || _x( 'Document', 'noun, breadcrumb' ),
90
91
  isZoomOut: _isZoomOut(),
91
92
  };
92
93
  }, [] );
@@ -177,9 +177,9 @@ export function EntitiesSavedStatesExtensible( {
177
177
  _n(
178
178
  'There is <strong>%d site change</strong> waiting to be saved.',
179
179
  'There are <strong>%d site changes</strong> waiting to be saved.',
180
- sortedPartitionedSavables.length
180
+ dirtyEntityRecords.length
181
181
  ),
182
- sortedPartitionedSavables.length
182
+ dirtyEntityRecords.length
183
183
  ),
184
184
  { strong: <strong /> }
185
185
  )
@@ -72,7 +72,7 @@ function EditorKeyboardShortcutsRegister() {
72
72
  registerShortcut( {
73
73
  name: 'core/editor/toggle-list-view',
74
74
  category: 'global',
75
- description: __( 'Open the List View.' ),
75
+ description: __( 'Show or hide the List View.' ),
76
76
  keyCombination: {
77
77
  modifier: 'access',
78
78
  character: 'o',
@@ -82,7 +82,7 @@ function EditorKeyboardShortcutsRegister() {
82
82
  registerShortcut( {
83
83
  name: 'core/editor/toggle-distraction-free',
84
84
  category: 'global',
85
- description: __( 'Toggle distraction free mode.' ),
85
+ description: __( 'Enter or exit distraction free mode.' ),
86
86
  keyCombination: {
87
87
  modifier: 'primaryShift',
88
88
  character: '\\',
@@ -92,7 +92,7 @@ function EditorKeyboardShortcutsRegister() {
92
92
  registerShortcut( {
93
93
  name: 'core/editor/toggle-sidebar',
94
94
  category: 'global',
95
- description: __( 'Show or hide the Settings sidebar.' ),
95
+ description: __( 'Show or hide the Settings panel.' ),
96
96
  keyCombination: {
97
97
  modifier: 'primaryShift',
98
98
  character: ',',
@@ -56,13 +56,27 @@ function useGlobalStylesUserConfig() {
56
56
  select( coreStore ).__experimentalGetCurrentGlobalStylesId();
57
57
 
58
58
  let record;
59
- const userCanEditGlobalStyles = canUser( 'update', {
60
- kind: 'root',
61
- name: 'globalStyles',
62
- id: _globalStylesId,
63
- } );
64
59
 
65
- if ( _globalStylesId ) {
60
+ // We want the global styles ID request to finish before triggering
61
+ // the OPTIONS request for user capabilities, otherwise it will
62
+ // fetch `/wp/v2/global-styles` instead of
63
+ // `/wp/v2/global-styles/{id}`!
64
+ // Please adjust the preloaded requests if this changes!
65
+ const userCanEditGlobalStyles = _globalStylesId
66
+ ? canUser( 'update', {
67
+ kind: 'root',
68
+ name: 'globalStyles',
69
+ id: _globalStylesId,
70
+ } )
71
+ : null;
72
+
73
+ if (
74
+ _globalStylesId &&
75
+ // We want the OPTIONS request for user capabilities to finish
76
+ // before getting the records, otherwise we'll fetch both!
77
+ typeof userCanEditGlobalStyles === 'boolean'
78
+ ) {
79
+ // Please adjust the preloaded requests if this changes!
66
80
  if ( userCanEditGlobalStyles ) {
67
81
  record = getEditedEntityRecord(
68
82
  'root',
@@ -12,6 +12,7 @@ import { PinnedItems } from '@wordpress/interface';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
+ import CollabSidebar from '../collab-sidebar';
15
16
  import BackButton, { useHasBackButton } from './back-button';
16
17
  import CollapsibleBlockToolbar from '../collapsible-block-toolbar';
17
18
  import DocumentBar from '../document-bar';
@@ -149,7 +150,7 @@ function Header( {
149
150
  ) }
150
151
 
151
152
  { canBeZoomedOut && isEditorIframed && isWideViewport && (
152
- <ZoomOutToggle />
153
+ <ZoomOutToggle disabled={ forceDisableBlockTools } />
153
154
  ) }
154
155
 
155
156
  <PreviewDropdown
@@ -174,6 +175,7 @@ function Header( {
174
175
  }
175
176
  />
176
177
  ) }
178
+ <CollabSidebar />
177
179
 
178
180
  { customSaveButton }
179
181
  <MoreMenu />
@@ -33,15 +33,12 @@ export default function InserterSidebar() {
33
33
  getInserter,
34
34
  isPublishSidebarOpened,
35
35
  } = unlock( select( editorStore ) );
36
- const {
37
- getBlockRootClientId,
38
- __unstableGetEditorMode,
39
- getSectionRootClientId,
40
- } = unlock( select( blockEditorStore ) );
36
+ const { getBlockRootClientId, isZoomOut, getSectionRootClientId } =
37
+ unlock( select( blockEditorStore ) );
41
38
  const { get } = select( preferencesStore );
42
39
  const { getActiveComplementaryArea } = select( interfaceStore );
43
40
  const getBlockSectionRootClientId = () => {
44
- if ( __unstableGetEditorMode() === 'zoom-out' ) {
41
+ if ( isZoomOut() ) {
45
42
  const sectionRootClientId = getSectionRootClientId();
46
43
 
47
44
  if ( sectionRootClientId ) {
@@ -212,8 +212,10 @@ function PostParentToggle( { isOpen, onClick } ) {
212
212
  className="editor-post-parent__panel-toggle"
213
213
  variant="tertiary"
214
214
  aria-expanded={ isOpen }
215
- // translators: %s: Current post parent.
216
- aria-label={ sprintf( __( 'Change parent: %s' ), parentTitle ) }
215
+ aria-label={
216
+ // translators: %s: Current post parent.
217
+ sprintf( __( 'Change parent: %s' ), parentTitle )
218
+ }
217
219
  onClick={ onClick }
218
220
  >
219
221
  { parentTitle }
@@ -261,9 +263,9 @@ export function ParentRow() {
261
263
  <div>
262
264
  { createInterpolateElement(
263
265
  sprintf(
264
- /* translators: %1$s The home URL of the WordPress installation without the scheme. */
266
+ /* translators: %s: The home URL of the WordPress installation without the scheme. */
265
267
  __(
266
- 'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'
268
+ 'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'
267
269
  ),
268
270
  filterURLForDisplay( homeUrl ).replace(
269
271
  /([/.])/g,
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { compose } from '@wordpress/compose';
5
4
  import { MenuItem } from '@wordpress/components';
6
- import { withPluginContext } from '@wordpress/plugins';
5
+ import { usePluginContext } from '@wordpress/plugins';
7
6
  import { ActionItem } from '@wordpress/interface';
8
7
 
9
8
  /**
@@ -62,12 +61,14 @@ import { ActionItem } from '@wordpress/interface';
62
61
  *
63
62
  * @return {Component} The component to be rendered.
64
63
  */
65
- export default compose(
66
- withPluginContext( ( context, ownProps ) => {
67
- return {
68
- as: ownProps.as ?? MenuItem,
69
- icon: ownProps.icon || context.icon,
70
- name: 'core/plugin-more-menu',
71
- };
72
- } )
73
- )( ActionItem );
64
+ export default function PluginMoreMenuItem( props ) {
65
+ const context = usePluginContext();
66
+ return (
67
+ <ActionItem
68
+ name="core/plugin-more-menu"
69
+ as={ props.as ?? MenuItem }
70
+ icon={ props.icon || context.icon }
71
+ { ...props }
72
+ />
73
+ );
74
+ }
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { compose } from '@wordpress/compose';
5
4
  import { MenuItem } from '@wordpress/components';
6
- import { withPluginContext } from '@wordpress/plugins';
5
+ import { usePluginContext } from '@wordpress/plugins';
7
6
  import { ActionItem } from '@wordpress/interface';
8
7
 
9
8
  /**
@@ -27,12 +26,12 @@ import { ActionItem } from '@wordpress/interface';
27
26
  * }
28
27
  *
29
28
  * const ExternalPreviewMenuItem = () => (
30
- * <PreviewDropdownMenuItem
29
+ * <PluginPreviewMenuItem
31
30
  * icon={ external }
32
31
  * onClick={ onPreviewClick }
33
32
  * >
34
33
  * { __( 'Preview in new tab' ) }
35
- * </PreviewDropdownMenuItem>
34
+ * </PluginPreviewMenuItem>
36
35
  * );
37
36
  * registerPlugin( 'external-preview-menu-item', {
38
37
  * render: ExternalPreviewMenuItem,
@@ -41,12 +40,14 @@ import { ActionItem } from '@wordpress/interface';
41
40
  *
42
41
  * @return {Component} The rendered menu item component.
43
42
  */
44
- export default compose(
45
- withPluginContext( ( context, ownProps ) => {
46
- return {
47
- as: ownProps.as ?? MenuItem,
48
- icon: ownProps.icon || context.icon,
49
- name: 'core/plugin-preview-menu',
50
- };
51
- } )
52
- )( ActionItem );
43
+ export default function PluginPreviewMenuItem( props ) {
44
+ const context = usePluginContext();
45
+ return (
46
+ <ActionItem
47
+ name="core/plugin-preview-menu"
48
+ as={ props.as ?? MenuItem }
49
+ icon={ props.icon || context.icon }
50
+ { ...props }
51
+ />
52
+ );
53
+ }
@@ -1,15 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useSelect } from '@wordpress/data';
5
- import { __ } from '@wordpress/i18n';
6
4
  import { ComplementaryArea } from '@wordpress/interface';
7
5
 
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editorStore } from '../../store';
12
-
13
6
  /**
14
7
  * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
15
8
  * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
@@ -76,16 +69,10 @@ import { store as editorStore } from '../../store';
76
69
  * ```
77
70
  */
78
71
  export default function PluginSidebar( { className, ...props } ) {
79
- const { postTitle } = useSelect( ( select ) => {
80
- return {
81
- postTitle: select( editorStore ).getEditedPostAttribute( 'title' ),
82
- };
83
- }, [] );
84
72
  return (
85
73
  <ComplementaryArea
86
74
  panelClassName={ className }
87
75
  className="editor-sidebar"
88
- smallScreenTitle={ postTitle || __( '(no title)' ) }
89
76
  scope="core"
90
77
  { ...props }
91
78
  />
@@ -18,7 +18,7 @@ import { store as coreStore } from '@wordpress/core-data';
18
18
  import { unlock } from '../../lock-unlock';
19
19
  import { usePostActions } from './actions';
20
20
 
21
- const { DropdownMenuV2, kebabCase } = unlock( componentsPrivateApis );
21
+ const { Menu, kebabCase } = unlock( componentsPrivateApis );
22
22
 
23
23
  export default function PostActions( { postType, postId, onActionPerformed } ) {
24
24
  const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
@@ -54,7 +54,7 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
54
54
  }, [ allActions, itemWithPermissions ] );
55
55
 
56
56
  return (
57
- <DropdownMenuV2
57
+ <Menu
58
58
  open={ isActionsMenuOpen }
59
59
  trigger={
60
60
  <Button
@@ -79,7 +79,7 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
79
79
  setIsActionsMenuOpen( false );
80
80
  } }
81
81
  />
82
- </DropdownMenuV2>
82
+ </Menu>
83
83
  );
84
84
  }
85
85
 
@@ -93,12 +93,9 @@ function DropdownMenuItemTrigger( { action, onClick, items } ) {
93
93
  const label =
94
94
  typeof action.label === 'string' ? action.label : action.label( items );
95
95
  return (
96
- <DropdownMenuV2.Item
97
- onClick={ onClick }
98
- hideOnClick={ ! action.RenderModal }
99
- >
100
- <DropdownMenuV2.ItemLabel>{ label }</DropdownMenuV2.ItemLabel>
101
- </DropdownMenuV2.Item>
96
+ <Menu.Item onClick={ onClick } hideOnClick={ ! action.RenderModal }>
97
+ <Menu.ItemLabel>{ label }</Menu.ItemLabel>
98
+ </Menu.Item>
102
99
  );
103
100
  }
104
101
 
@@ -145,7 +142,7 @@ function ActionWithModal( { action, item, ActionTrigger, onClose } ) {
145
142
  // With an added onClose prop.
146
143
  function ActionsDropdownMenuGroup( { actions, item, onClose } ) {
147
144
  return (
148
- <DropdownMenuV2.Group>
145
+ <Menu.Group>
149
146
  { actions.map( ( action ) => {
150
147
  if ( action.RenderModal ) {
151
148
  return (
@@ -167,6 +164,6 @@ function ActionsDropdownMenuGroup( { actions, item, onClose } ) {
167
164
  />
168
165
  );
169
166
  } ) }
170
- </DropdownMenuV2.Group>
167
+ </Menu.Group>
171
168
  );
172
169
  }
@@ -25,8 +25,10 @@ function PostAuthorToggle( { isOpen, onClick } ) {
25
25
  className="editor-post-author__panel-toggle"
26
26
  variant="tertiary"
27
27
  aria-expanded={ isOpen }
28
- // translators: %s: Current post link.
29
- aria-label={ sprintf( __( 'Change author: %s' ), authorName ) }
28
+ aria-label={
29
+ // translators: %s: Author name.
30
+ sprintf( __( 'Change author: %s' ), authorName )
31
+ }
30
32
  onClick={ onClick }
31
33
  >
32
34
  { authorName }