@wordpress/editor 14.0.0 → 14.1.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 (301) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +164 -20
  3. package/build/components/block-settings-menu/content-only-settings-menu.js +14 -5
  4. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  5. package/build/components/document-tools/index.js +12 -3
  6. package/build/components/document-tools/index.js.map +1 -1
  7. package/build/components/editor/index.js +77 -0
  8. package/build/components/editor/index.js.map +1 -0
  9. package/build/components/editor-interface/index.js +6 -8
  10. package/build/components/editor-interface/index.js.map +1 -1
  11. package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  12. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +28 -0
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-styles-provider/index.js +9 -2
  16. package/build/components/global-styles-provider/index.js.map +1 -1
  17. package/build/components/header/back-button.js +4 -1
  18. package/build/components/header/back-button.js.map +1 -1
  19. package/build/components/header/index.js +1 -5
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/index.js +7 -0
  22. package/build/components/index.js.map +1 -1
  23. package/build/components/media-categories/index.js +1 -1
  24. package/build/components/media-categories/index.js.map +1 -1
  25. package/build/components/post-actions/actions.js +10 -4
  26. package/build/components/post-actions/actions.js.map +1 -1
  27. package/build/components/post-last-revision/index.js +35 -9
  28. package/build/components/post-last-revision/index.js.map +1 -1
  29. package/build/components/post-preview-button/index.js +1 -0
  30. package/build/components/post-preview-button/index.js.map +1 -1
  31. package/build/components/post-publish-button/index.js +4 -0
  32. package/build/components/post-publish-button/index.js.map +1 -1
  33. package/build/components/post-publish-button/label.js +5 -0
  34. package/build/components/post-publish-button/label.js.map +1 -1
  35. package/build/components/post-publish-panel/index.js +5 -0
  36. package/build/components/post-publish-panel/index.js.map +1 -1
  37. package/build/components/post-sticky/check.js +8 -0
  38. package/build/components/post-sticky/check.js.map +1 -1
  39. package/build/components/post-sticky/index.js +5 -1
  40. package/build/components/post-sticky/index.js.map +1 -1
  41. package/build/components/post-switch-to-draft-button/index.js +11 -2
  42. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  43. package/build/components/post-sync-status/index.js +6 -2
  44. package/build/components/post-sync-status/index.js.map +1 -1
  45. package/build/components/post-taxonomies/check.js +8 -0
  46. package/build/components/post-taxonomies/check.js.map +1 -1
  47. package/build/components/post-taxonomies/flat-term-selector.js +14 -2
  48. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  49. package/build/components/post-taxonomies/index.js +9 -0
  50. package/build/components/post-taxonomies/index.js.map +1 -1
  51. package/build/components/post-taxonomies/panel.js +10 -0
  52. package/build/components/post-taxonomies/panel.js.map +1 -1
  53. package/build/components/post-title/index.js +4 -8
  54. package/build/components/post-title/index.js.map +1 -1
  55. package/build/components/post-title/post-title-raw.js +3 -7
  56. package/build/components/post-title/post-title-raw.js.map +1 -1
  57. package/build/components/post-trash/check.js +8 -0
  58. package/build/components/post-trash/check.js.map +1 -1
  59. package/build/components/post-trash/index.js +6 -1
  60. package/build/components/post-trash/index.js.map +1 -1
  61. package/build/components/post-url/panel.js +25 -3
  62. package/build/components/post-url/panel.js.map +1 -1
  63. package/build/components/post-visibility/index.js +1 -0
  64. package/build/components/post-visibility/index.js.map +1 -1
  65. package/build/components/provider/disable-non-page-content-blocks.js +5 -3
  66. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  67. package/build/components/provider/index.js +18 -15
  68. package/build/components/provider/index.js.map +1 -1
  69. package/build/components/sidebar/post-summary.js +3 -2
  70. package/build/components/sidebar/post-summary.js.map +1 -1
  71. package/build/components/table-of-contents/index.js +11 -0
  72. package/build/components/table-of-contents/index.js.map +1 -1
  73. package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
  74. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  75. package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
  76. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  77. package/build/components/template-part-menu-items/index.js +67 -0
  78. package/build/components/template-part-menu-items/index.js.map +1 -0
  79. package/build/components/template-part-menu-items/index.native.js +10 -0
  80. package/build/components/template-part-menu-items/index.native.js.map +1 -0
  81. package/build/components/template-validation-notice/index.js +1 -0
  82. package/build/components/template-validation-notice/index.js.map +1 -1
  83. package/build/components/theme-support-check/index.js +9 -0
  84. package/build/components/theme-support-check/index.js.map +1 -1
  85. package/build/components/time-to-read/index.js +6 -0
  86. package/build/components/time-to-read/index.js.map +1 -1
  87. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -0
  88. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  89. package/build/components/word-count/index.js +5 -1
  90. package/build/components/word-count/index.js.map +1 -1
  91. package/build/dataviews/api.js +61 -0
  92. package/build/dataviews/api.js.map +1 -0
  93. package/build/dataviews/store/private-actions.js +28 -0
  94. package/build/dataviews/store/private-actions.js.map +1 -0
  95. package/build/dataviews/store/private-selectors.js +20 -0
  96. package/build/dataviews/store/private-selectors.js.map +1 -0
  97. package/build/dataviews/store/reducer.js +36 -0
  98. package/build/dataviews/store/reducer.js.map +1 -0
  99. package/build/hooks/pattern-overrides.js +2 -1
  100. package/build/hooks/pattern-overrides.js.map +1 -1
  101. package/build/index.js +12 -0
  102. package/build/index.js.map +1 -1
  103. package/build/private-apis.js +2 -6
  104. package/build/private-apis.js.map +1 -1
  105. package/build/private-apis.native.js +0 -2
  106. package/build/private-apis.native.js.map +1 -1
  107. package/build/store/private-actions.js +21 -0
  108. package/build/store/private-actions.js.map +1 -1
  109. package/build/store/private-selectors.js +5 -0
  110. package/build/store/private-selectors.js.map +1 -1
  111. package/build/store/reducer.js +4 -1
  112. package/build/store/reducer.js.map +1 -1
  113. package/build-module/components/block-settings-menu/content-only-settings-menu.js +14 -5
  114. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  115. package/build-module/components/document-tools/index.js +12 -3
  116. package/build-module/components/document-tools/index.js.map +1 -1
  117. package/build-module/components/editor/index.js +71 -0
  118. package/build-module/components/editor/index.js.map +1 -0
  119. package/build-module/components/editor-interface/index.js +6 -8
  120. package/build-module/components/editor-interface/index.js.map +1 -1
  121. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
  122. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  123. package/build-module/components/entities-saved-states/index.js +28 -0
  124. package/build-module/components/entities-saved-states/index.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +9 -2
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/back-button.js +4 -1
  128. package/build-module/components/header/back-button.js.map +1 -1
  129. package/build-module/components/header/index.js +1 -5
  130. package/build-module/components/header/index.js.map +1 -1
  131. package/build-module/components/index.js +7 -0
  132. package/build-module/components/index.js.map +1 -1
  133. package/build-module/components/media-categories/index.js +1 -1
  134. package/build-module/components/media-categories/index.js.map +1 -1
  135. package/build-module/components/post-actions/actions.js +10 -4
  136. package/build-module/components/post-actions/actions.js.map +1 -1
  137. package/build-module/components/post-last-revision/index.js +34 -11
  138. package/build-module/components/post-last-revision/index.js.map +1 -1
  139. package/build-module/components/post-preview-button/index.js +1 -0
  140. package/build-module/components/post-preview-button/index.js.map +1 -1
  141. package/build-module/components/post-publish-button/index.js +4 -0
  142. package/build-module/components/post-publish-button/index.js.map +1 -1
  143. package/build-module/components/post-publish-button/label.js +6 -0
  144. package/build-module/components/post-publish-button/label.js.map +1 -1
  145. package/build-module/components/post-publish-panel/index.js +5 -0
  146. package/build-module/components/post-publish-panel/index.js.map +1 -1
  147. package/build-module/components/post-sticky/check.js +9 -0
  148. package/build-module/components/post-sticky/check.js.map +1 -1
  149. package/build-module/components/post-sticky/index.js +6 -0
  150. package/build-module/components/post-sticky/index.js.map +1 -1
  151. package/build-module/components/post-switch-to-draft-button/index.js +10 -1
  152. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build-module/components/post-sync-status/index.js +7 -1
  154. package/build-module/components/post-sync-status/index.js.map +1 -1
  155. package/build-module/components/post-taxonomies/check.js +9 -0
  156. package/build-module/components/post-taxonomies/check.js.map +1 -1
  157. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
  158. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  159. package/build-module/components/post-taxonomies/index.js +9 -0
  160. package/build-module/components/post-taxonomies/index.js.map +1 -1
  161. package/build-module/components/post-taxonomies/panel.js +10 -0
  162. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  163. package/build-module/components/post-title/index.js +4 -8
  164. package/build-module/components/post-title/index.js.map +1 -1
  165. package/build-module/components/post-title/post-title-raw.js +3 -7
  166. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  167. package/build-module/components/post-trash/check.js +9 -0
  168. package/build-module/components/post-trash/check.js.map +1 -1
  169. package/build-module/components/post-trash/index.js +7 -0
  170. package/build-module/components/post-trash/index.js.map +1 -1
  171. package/build-module/components/post-url/panel.js +26 -3
  172. package/build-module/components/post-url/panel.js.map +1 -1
  173. package/build-module/components/post-visibility/index.js +1 -0
  174. package/build-module/components/post-visibility/index.js.map +1 -1
  175. package/build-module/components/provider/disable-non-page-content-blocks.js +5 -3
  176. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  177. package/build-module/components/provider/index.js +18 -15
  178. package/build-module/components/provider/index.js.map +1 -1
  179. package/build-module/components/sidebar/post-summary.js +3 -2
  180. package/build-module/components/sidebar/post-summary.js.map +1 -1
  181. package/build-module/components/table-of-contents/index.js +11 -0
  182. package/build-module/components/table-of-contents/index.js.map +1 -1
  183. package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
  184. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  185. package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
  186. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  187. package/build-module/components/template-part-menu-items/index.js +59 -0
  188. package/build-module/components/template-part-menu-items/index.js.map +1 -0
  189. package/build-module/components/template-part-menu-items/index.native.js +4 -0
  190. package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
  191. package/build-module/components/template-validation-notice/index.js +1 -0
  192. package/build-module/components/template-validation-notice/index.js.map +1 -1
  193. package/build-module/components/theme-support-check/index.js +10 -0
  194. package/build-module/components/theme-support-check/index.js.map +1 -1
  195. package/build-module/components/time-to-read/index.js +6 -0
  196. package/build-module/components/time-to-read/index.js.map +1 -1
  197. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -0
  198. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  199. package/build-module/components/word-count/index.js +6 -0
  200. package/build-module/components/word-count/index.js.map +1 -1
  201. package/build-module/dataviews/api.js +54 -0
  202. package/build-module/dataviews/api.js.map +1 -0
  203. package/build-module/dataviews/store/private-actions.js +21 -0
  204. package/build-module/dataviews/store/private-actions.js.map +1 -0
  205. package/build-module/dataviews/store/private-selectors.js +14 -0
  206. package/build-module/dataviews/store/private-selectors.js.map +1 -0
  207. package/build-module/dataviews/store/reducer.js +29 -0
  208. package/build-module/dataviews/store/reducer.js.map +1 -0
  209. package/build-module/hooks/pattern-overrides.js +2 -1
  210. package/build-module/hooks/pattern-overrides.js.map +1 -1
  211. package/build-module/index.js +1 -0
  212. package/build-module/index.js.map +1 -1
  213. package/build-module/private-apis.js +2 -6
  214. package/build-module/private-apis.js.map +1 -1
  215. package/build-module/private-apis.native.js +0 -2
  216. package/build-module/private-apis.native.js.map +1 -1
  217. package/build-module/store/private-actions.js +1 -0
  218. package/build-module/store/private-actions.js.map +1 -1
  219. package/build-module/store/private-selectors.js +4 -0
  220. package/build-module/store/private-selectors.js.map +1 -1
  221. package/build-module/store/reducer.js +3 -1
  222. package/build-module/store/reducer.js.map +1 -1
  223. package/build-style/style-rtl.css +35 -43
  224. package/build-style/style.css +35 -43
  225. package/build-types/dataviews/store/private-actions.d.ts +17 -0
  226. package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
  227. package/build-types/dataviews/store/private-selectors.d.ts +10 -0
  228. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
  229. package/build-types/dataviews/store/reducer.d.ts +11 -0
  230. package/build-types/dataviews/store/reducer.d.ts.map +1 -0
  231. package/package.json +35 -35
  232. package/src/components/block-settings-menu/content-only-settings-menu.js +26 -12
  233. package/src/components/collapsible-block-toolbar/style.scss +3 -1
  234. package/src/components/document-tools/index.js +13 -4
  235. package/src/components/editor/index.js +88 -0
  236. package/src/components/editor-interface/index.js +5 -5
  237. package/src/components/editor-interface/style.scss +3 -0
  238. package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  239. package/src/components/entities-saved-states/index.js +26 -0
  240. package/src/components/entities-saved-states/style.scss +0 -7
  241. package/src/components/global-styles-provider/index.js +12 -2
  242. package/src/components/header/back-button.js +6 -1
  243. package/src/components/header/index.js +1 -8
  244. package/src/components/header/style.scss +1 -1
  245. package/src/components/index.js +7 -0
  246. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
  247. package/src/components/media-categories/index.js +1 -3
  248. package/src/components/post-actions/actions.js +9 -3
  249. package/src/components/post-card-panel/style.scss +4 -0
  250. package/src/components/post-last-revision/index.js +30 -7
  251. package/src/components/post-last-revision/style.scss +4 -0
  252. package/src/components/post-panel-row/style.scss +2 -1
  253. package/src/components/post-preview-button/index.js +1 -0
  254. package/src/components/post-preview-button/test/index.js +10 -2
  255. package/src/components/post-publish-button/index.js +3 -0
  256. package/src/components/post-publish-button/label.js +5 -0
  257. package/src/components/post-publish-panel/index.js +4 -0
  258. package/src/components/post-publish-panel/style.scss +28 -36
  259. package/src/components/post-status/style.scss +5 -0
  260. package/src/components/post-sticky/check.js +8 -0
  261. package/src/components/post-sticky/index.js +5 -0
  262. package/src/components/post-switch-to-draft-button/index.js +10 -1
  263. package/src/components/post-sync-status/index.js +7 -8
  264. package/src/components/post-taxonomies/check.js +8 -0
  265. package/src/components/post-taxonomies/flat-term-selector.js +13 -2
  266. package/src/components/post-taxonomies/index.js +8 -0
  267. package/src/components/post-taxonomies/panel.js +9 -0
  268. package/src/components/post-title/index.js +2 -5
  269. package/src/components/post-title/post-title-raw.js +2 -5
  270. package/src/components/post-trash/check.js +8 -0
  271. package/src/components/post-trash/index.js +6 -0
  272. package/src/components/post-url/panel.js +13 -5
  273. package/src/components/post-visibility/index.js +1 -0
  274. package/src/components/provider/disable-non-page-content-blocks.js +9 -4
  275. package/src/components/provider/index.js +17 -17
  276. package/src/components/save-publish-panels/style.scss +0 -8
  277. package/src/components/sidebar/post-summary.js +3 -1
  278. package/src/components/table-of-contents/index.js +10 -0
  279. package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
  280. package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
  281. package/src/components/template-part-menu-items/index.js +59 -0
  282. package/src/components/template-part-menu-items/index.native.js +3 -0
  283. package/src/components/template-validation-notice/index.js +1 -0
  284. package/src/components/theme-support-check/index.js +9 -0
  285. package/src/components/time-to-read/index.js +5 -0
  286. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -0
  287. package/src/components/word-count/index.js +5 -0
  288. package/src/dataviews/api.js +55 -0
  289. package/src/dataviews/store/private-actions.ts +30 -0
  290. package/src/dataviews/store/private-selectors.ts +15 -0
  291. package/src/dataviews/store/reducer.ts +44 -0
  292. package/src/hooks/pattern-overrides.js +2 -0
  293. package/src/index.js +1 -0
  294. package/src/private-apis.js +2 -6
  295. package/src/private-apis.native.js +0 -2
  296. package/src/store/private-actions.js +1 -0
  297. package/src/store/private-selectors.js +5 -0
  298. package/src/store/reducer.js +2 -0
  299. package/src/style.scss +1 -0
  300. package/tsconfig.json +36 -0
  301. package/tsconfig.tsbuildinfo +1 -0
@@ -6,7 +6,7 @@
6
6
  }
7
7
 
8
8
  .editor-post-panel__row-label {
9
- width: 30%;
9
+ width: 38%;
10
10
  flex-shrink: 0;
11
11
  min-height: $grid-unit-40;
12
12
  display: flex;
@@ -25,6 +25,7 @@
25
25
  .components-button {
26
26
  max-width: 100%;
27
27
  text-align: left;
28
+ text-wrap: balance; // Fallback for Safari.
28
29
  text-wrap: pretty;
29
30
  height: auto;
30
31
  min-height: $button-size-compact;
@@ -183,6 +183,7 @@ export default function PostPreviewButton( {
183
183
  className={ className || 'editor-post-preview' }
184
184
  href={ href }
185
185
  target={ targetId }
186
+ __experimentalIsFocusable
186
187
  disabled={ ! isSaveable }
187
188
  onClick={ openPreviewWindow }
188
189
  role={ role }
@@ -139,12 +139,16 @@ describe( 'PostPreviewButton', () => {
139
139
  ).toBeInTheDocument();
140
140
  } );
141
141
 
142
- it( 'should be disabled if post is not saveable.', () => {
142
+ it( 'should be accessibly disabled if post is not saveable.', () => {
143
143
  mockUseSelect( { isEditedPostSaveable: () => false } );
144
144
 
145
145
  render( <PostPreviewButton /> );
146
146
 
147
- expect( screen.getByRole( 'button' ) ).toBeDisabled();
147
+ expect( screen.getByRole( 'button' ) ).toBeEnabled();
148
+ expect( screen.getByRole( 'button' ) ).toHaveAttribute(
149
+ 'aria-disabled',
150
+ 'true'
151
+ );
148
152
  } );
149
153
 
150
154
  it( 'should not be disabled if post is saveable.', () => {
@@ -153,6 +157,10 @@ describe( 'PostPreviewButton', () => {
153
157
  render( <PostPreviewButton /> );
154
158
 
155
159
  expect( screen.getByRole( 'button' ) ).toBeEnabled();
160
+ expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
161
+ 'aria-disabled',
162
+ 'true'
163
+ );
156
164
  } );
157
165
 
158
166
  it( 'should set `href` to edited post preview link if specified.', () => {
@@ -205,6 +205,9 @@ export class PostPublishButton extends Component {
205
205
  }
206
206
  }
207
207
 
208
+ /**
209
+ * Renders the publish button.
210
+ */
208
211
  export default compose( [
209
212
  withSelect( ( select ) => {
210
213
  const {
@@ -10,6 +10,11 @@ import { useViewportMatch } from '@wordpress/compose';
10
10
  */
11
11
  import { store as editorStore } from '../../store';
12
12
 
13
+ /**
14
+ * Renders the label for the publish button.
15
+ *
16
+ * @return {string} The label for the publish button.
17
+ */
13
18
  export default function PublishButtonLabel() {
14
19
  const isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );
15
20
  const {
@@ -93,6 +93,7 @@ export class PostPublishPanel extends Component {
93
93
  </div>
94
94
  <div className="editor-post-publish-panel__header-cancel-button">
95
95
  <Button
96
+ __experimentalIsFocusable
96
97
  disabled={ isSavingNonPostEntityChanges }
97
98
  onClick={ onClose }
98
99
  variant="secondary"
@@ -130,6 +131,9 @@ export class PostPublishPanel extends Component {
130
131
  }
131
132
  }
132
133
 
134
+ /**
135
+ * Renders a panel for publishing a post.
136
+ */
133
137
  export default compose( [
134
138
  withSelect( ( select ) => {
135
139
  const { getPostType } = select( coreStore );
@@ -1,7 +1,3 @@
1
- .editor-post-publish-panel {
2
- background: $white;
3
- }
4
-
5
1
  .editor-post-publish-panel__content {
6
2
  // Ensure the post-publish panel accounts for the header and footer height.
7
3
  min-height: calc(100% - #{$header-height + 84px});
@@ -71,6 +67,7 @@
71
67
 
72
68
  .editor-post-publish-panel__header-publish-button {
73
69
  padding-right: $grid-unit-05;
70
+ justify-content: center;
74
71
  }
75
72
 
76
73
  .editor-post-publish-panel__header-cancel-button {
@@ -122,6 +119,7 @@
122
119
 
123
120
  .components-panel__body-title .components-button {
124
121
  align-items: flex-start;
122
+ text-wrap: balance; // Fallback for Safari.
125
123
  text-wrap: pretty;
126
124
  }
127
125
  }
@@ -194,40 +192,34 @@
194
192
  }
195
193
  }
196
194
 
197
- .edit-post-layout,
198
- .edit-site-editor__interface-skeleton {
199
- .editor-post-publish-panel {
200
- position: fixed;
201
- z-index: z-index(".edit-post-layout .edit-post-post-publish-panel");
202
- top: $admin-bar-height-big;
203
- bottom: 0;
204
- right: 0;
205
- left: 0;
206
- overflow: auto;
207
-
208
- @include break-medium() {
209
- z-index: z-index(".edit-post-layout .edit-post-post-publish-panel {greater than small}");
210
- top: $admin-bar-height;
211
- left: auto;
212
- width: $sidebar-width + $border-width;
213
- border-left: $border-width solid $gray-300;
214
- transform: translateX(+100%);
215
- animation: editor-post-publish-panel__slide-in-animation 0.1s forwards;
216
- @include reduce-motion("animation");
217
-
218
- body.is-fullscreen-mode & {
219
- top: 0;
220
- }
221
-
222
- // Keep it open on focus to avoid conflict with navigate-regions animation.
223
- [role="region"]:focus & {
224
- transform: translateX(0%);
225
- }
195
+ .editor-post-publish-panel {
196
+ position: fixed;
197
+ z-index: z-index(".editor-post-publish-panel");
198
+ background: $white;
199
+ top: 0;
200
+ bottom: 0;
201
+ right: 0;
202
+ left: 0;
203
+ overflow: auto;
204
+
205
+ @include break-medium() {
206
+ z-index: z-index(".editor-post-publish-panel {greater than small}");
207
+ top: $admin-bar-height;
208
+ left: auto;
209
+ width: $sidebar-width + $border-width;
210
+ border-left: $border-width solid $gray-300;
211
+ transform: translateX(+100%);
212
+ animation: editor-post-publish-panel__slide-in-animation 0.1s forwards;
213
+ @include reduce-motion("animation");
214
+
215
+ body.is-fullscreen-mode & {
216
+ top: 0;
226
217
  }
227
- }
228
218
 
229
- .editor-post-publish-panel__header-publish-button {
230
- justify-content: center;
219
+ // Keep it open on focus to avoid conflict with navigate-regions animation.
220
+ [role="region"]:focus & {
221
+ transform: translateX(0%);
222
+ }
231
223
  }
232
224
  }
233
225
 
@@ -41,4 +41,9 @@
41
41
  padding: 0;
42
42
  margin-bottom: $grid-unit-10;
43
43
  }
44
+
45
+ p.components-base-control__help:has(.components-checkbox-control__help) {
46
+ margin-top: $grid-unit-05;
47
+ }
48
+
44
49
  }
@@ -8,6 +8,14 @@ import { useSelect } from '@wordpress/data';
8
8
  */
9
9
  import { store as editorStore } from '../../store';
10
10
 
11
+ /**
12
+ * Wrapper component that renders its children only if post has a sticky action.
13
+ *
14
+ * @param {Object} props Props.
15
+ * @param {Element} props.children Children to be rendered.
16
+ *
17
+ * @return {Component} The component to be rendered or null if post type is not 'post' or hasStickyAction is false.
18
+ */
11
19
  export default function PostStickyCheck( { children } ) {
12
20
  const { hasStickyAction, postType } = useSelect( ( select ) => {
13
21
  const post = select( editorStore ).getCurrentPost();
@@ -12,6 +12,11 @@ import PostStickyCheck from './check';
12
12
  import { store as editorStore } from '../../store';
13
13
  import PostPanelRow from '../post-panel-row';
14
14
 
15
+ /**
16
+ * Renders the PostSticky component. It provide toggle control for the sticky post feature.
17
+ *
18
+ * @return {Component} The component to be rendered.
19
+ */
15
20
  export default function PostSticky() {
16
21
  const postSticky = useSelect( ( select ) => {
17
22
  return (
@@ -8,14 +8,23 @@ import {
8
8
  import { __ } from '@wordpress/i18n';
9
9
  import { useDispatch, useSelect } from '@wordpress/data';
10
10
  import { useState } from '@wordpress/element';
11
+ import deprecated from '@wordpress/deprecated';
11
12
 
12
13
  /**
13
14
  * Internal dependencies
14
15
  */
15
16
  import { store as editorStore } from '../../store';
16
17
 
17
- // TODO: deprecate..
18
+ /**
19
+ * Renders a button component that allows the user to switch a post to draft status.
20
+ *
21
+ * @return {JSX.Element} The rendered component.
22
+ */
18
23
  export default function PostSwitchToDraftButton() {
24
+ deprecated( 'wp.editor.PostSwitchToDraftButton', {
25
+ since: '6.7',
26
+ version: '6.9',
27
+ } );
19
28
  const [ showConfirmDialog, setShowConfirmDialog ] = useState( false );
20
29
 
21
30
  const { editPost, savePost } = useDispatch( editorStore );
@@ -10,6 +10,11 @@ import { __, _x } from '@wordpress/i18n';
10
10
  import PostPanelRow from '../post-panel-row';
11
11
  import { store as editorStore } from '../../store';
12
12
 
13
+ /**
14
+ * Renders the sync status of a post.
15
+ *
16
+ * @return {JSX.Element|null} The rendered sync status component.
17
+ */
13
18
  export default function PostSyncStatus() {
14
19
  const { syncStatus, postType } = useSelect( ( select ) => {
15
20
  const { getEditedPostAttribute } = select( editorStore );
@@ -35,14 +40,8 @@ export default function PostSyncStatus() {
35
40
  <PostPanelRow label={ __( 'Sync status' ) }>
36
41
  <div className="editor-post-sync-status__value">
37
42
  { syncStatus === 'unsynced'
38
- ? _x(
39
- 'Not synced',
40
- 'Text that indicates that the pattern is not synchronized'
41
- )
42
- : _x(
43
- 'Synced',
44
- 'Text that indicates that the pattern is synchronized'
45
- ) }
43
+ ? _x( 'Not synced', 'pattern (singular)' )
44
+ : _x( 'Synced', 'pattern (singular)' ) }
46
45
  </div>
47
46
  </PostPanelRow>
48
47
  );
@@ -9,6 +9,14 @@ import { store as coreStore } from '@wordpress/core-data';
9
9
  */
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
+ /**
13
+ * Renders the children components only if the current post type has taxonomies.
14
+ *
15
+ * @param {Object} props The component props.
16
+ * @param {Element} props.children The children components to render.
17
+ *
18
+ * @return {Component|null} The rendered children components or null if the current post type has no taxonomies.
19
+ */
12
20
  export default function PostTaxonomiesCheck( { children } ) {
13
21
  const hasTaxonomies = useSelect( ( select ) => {
14
22
  const postType = select( editorStore ).getCurrentPostType();
@@ -26,9 +26,12 @@ import MostUsedTerms from './most-used-terms';
26
26
  const EMPTY_ARRAY = [];
27
27
 
28
28
  /**
29
- * Module constants
29
+ * How the max suggestions limit was chosen:
30
+ * - Matches the `per_page` range set by the REST API.
31
+ * - Can't use "unbound" query. The `FormTokenField` needs a fixed number.
32
+ * - Matches default for `FormTokenField`.
30
33
  */
31
- const MAX_TERMS_SUGGESTIONS = 20;
34
+ const MAX_TERMS_SUGGESTIONS = 100;
32
35
  const DEFAULT_QUERY = {
33
36
  per_page: MAX_TERMS_SUGGESTIONS,
34
37
  _fields: 'id,name',
@@ -49,6 +52,14 @@ const termNamesToIds = ( names, terms ) => {
49
52
  .filter( ( id ) => id !== undefined );
50
53
  };
51
54
 
55
+ /**
56
+ * Renders a flat term selector component.
57
+ *
58
+ * @param {Object} props The component props.
59
+ * @param {string} props.slug The slug of the taxonomy.
60
+ *
61
+ * @return {JSX.Element} The rendered flat term selector component.
62
+ */
52
63
  export function FlatTermSelector( { slug } ) {
53
64
  const [ values, setValues ] = useState( [] );
54
65
  const [ search, setSearch ] = useState( '' );
@@ -43,4 +43,12 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
43
43
  } );
44
44
  }
45
45
 
46
+ /**
47
+ * Renders the taxonomies associated with a post.
48
+ *
49
+ * @param {Object} props The component props.
50
+ * @param {Function} props.taxonomyWrapper The wrapper function for each taxonomy component.
51
+ *
52
+ * @return {Array} An array of JSX elements representing the visible taxonomies.
53
+ */
46
54
  export default PostTaxonomies;
@@ -63,4 +63,13 @@ function PostTaxonomies() {
63
63
  );
64
64
  }
65
65
 
66
+ /**
67
+ * Renders a panel for a specific taxonomy.
68
+ *
69
+ * @param {Object} props The component props.
70
+ * @param {Object} props.taxonomy The taxonomy object.
71
+ * @param {Element} props.children The child components.
72
+ *
73
+ * @return {Component} The rendered taxonomy panel.
74
+ */
66
75
  export default PostTaxonomies;
@@ -30,14 +30,12 @@ import usePostTitle from './use-post-title';
30
30
  import PostTypeSupportCheck from '../post-type-support-check';
31
31
 
32
32
  function PostTitle( _, forwardedRef ) {
33
- const { placeholder, hasFixedToolbar } = useSelect( ( select ) => {
33
+ const { placeholder } = useSelect( ( select ) => {
34
34
  const { getSettings } = select( blockEditorStore );
35
- const { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =
36
- getSettings();
35
+ const { titlePlaceholder } = getSettings();
37
36
 
38
37
  return {
39
38
  placeholder: titlePlaceholder,
40
- hasFixedToolbar: _hasFixedToolbar,
41
39
  };
42
40
  }, [] );
43
41
 
@@ -186,7 +184,6 @@ function PostTitle( _, forwardedRef ) {
186
184
  // This same block is used in both the visual and the code editor.
187
185
  const className = clsx( DEFAULT_CLASSNAMES, {
188
186
  'is-selected': isSelected,
189
- 'has-fixed-toolbar': hasFixedToolbar,
190
187
  } );
191
188
 
192
189
  return (
@@ -29,14 +29,12 @@ import usePostTitle from './use-post-title';
29
29
  * @return {Component} The rendered component.
30
30
  */
31
31
  function PostTitleRaw( _, forwardedRef ) {
32
- const { placeholder, hasFixedToolbar } = useSelect( ( select ) => {
32
+ const { placeholder } = useSelect( ( select ) => {
33
33
  const { getSettings } = select( blockEditorStore );
34
- const { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =
35
- getSettings();
34
+ const { titlePlaceholder } = getSettings();
36
35
 
37
36
  return {
38
37
  placeholder: titlePlaceholder,
39
- hasFixedToolbar: _hasFixedToolbar,
40
38
  };
41
39
  }, [] );
42
40
 
@@ -61,7 +59,6 @@ function PostTitleRaw( _, forwardedRef ) {
61
59
  // This same block is used in both the visual and the code editor.
62
60
  const className = clsx( DEFAULT_CLASSNAMES, {
63
61
  'is-selected': isSelected,
64
- 'has-fixed-toolbar': hasFixedToolbar,
65
62
  'is-raw-text': true,
66
63
  } );
67
64
 
@@ -9,6 +9,14 @@ import { store as coreStore } from '@wordpress/core-data';
9
9
  */
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
+ /**
13
+ * Wrapper component that renders its children only if the post can trashed.
14
+ *
15
+ * @param {Object} props - The component props.
16
+ * @param {Element} props.children - The child components to render.
17
+ *
18
+ * @return {Component|null} The rendered child components or null if the post can not trashed.
19
+ */
12
20
  export default function PostTrashCheck( { children } ) {
13
21
  const { canTrashPost } = useSelect( ( select ) => {
14
22
  const { isEditedPostNew, getCurrentPostId, getCurrentPostType } =
@@ -14,6 +14,11 @@ import { useState } from '@wordpress/element';
14
14
  */
15
15
  import { store as editorStore } from '../../store';
16
16
 
17
+ /**
18
+ * Displays the Post Trash Button and Confirm Dialog in the Editor.
19
+ *
20
+ * @return {JSX.Element|null} The rendered PostTrash component.
21
+ */
17
22
  export default function PostTrash() {
18
23
  const { isNew, isDeleting, postId } = useSelect( ( select ) => {
19
24
  const store = select( editorStore );
@@ -55,6 +60,7 @@ export default function PostTrash() {
55
60
  onConfirm={ handleConfirm }
56
61
  onCancel={ () => setShowConfirmDialog( false ) }
57
62
  confirmButtonText={ __( 'Move to trash' ) }
63
+ size="medium"
58
64
  >
59
65
  { __(
60
66
  'Are you sure you want to move this post to the trash?'
@@ -6,6 +6,7 @@ import { useSelect } from '@wordpress/data';
6
6
  import { Dropdown, Button } from '@wordpress/components';
7
7
  import { __, sprintf } from '@wordpress/i18n';
8
8
  import { safeDecodeURIComponent } from '@wordpress/url';
9
+ import { store as coreStore } from '@wordpress/core-data';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
@@ -58,10 +59,17 @@ export default function PostURLPanel() {
58
59
  }
59
60
 
60
61
  function PostURLToggle( { isOpen, onClick } ) {
61
- const slug = useSelect(
62
- ( select ) => select( editorStore ).getEditedPostSlug(),
63
- []
64
- );
62
+ const { slug, isFrontPage, postLink } = useSelect( ( select ) => {
63
+ const { getCurrentPostId, getCurrentPost } = select( editorStore );
64
+ const { getEditedEntityRecord } = select( coreStore );
65
+ const siteSettings = getEditedEntityRecord( 'root', 'site' );
66
+ const _id = getCurrentPostId();
67
+ return {
68
+ slug: select( editorStore ).getEditedPostSlug(),
69
+ isFrontPage: siteSettings?.page_on_front === _id,
70
+ postLink: getCurrentPost()?.link,
71
+ };
72
+ }, [] );
65
73
  const decodedSlug = safeDecodeURIComponent( slug );
66
74
  return (
67
75
  <Button
@@ -73,7 +81,7 @@ function PostURLToggle( { isOpen, onClick } ) {
73
81
  aria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }
74
82
  onClick={ onClick }
75
83
  >
76
- /{ decodedSlug }
84
+ { isFrontPage ? postLink : <>/{ decodedSlug }</> }
77
85
  </Button>
78
86
  );
79
87
  }
@@ -133,6 +133,7 @@ export default function PostVisibility( { onClose } ) {
133
133
  onConfirm={ confirmPrivate }
134
134
  onCancel={ handleDialogCancel }
135
135
  confirmButtonText={ __( 'Publish' ) }
136
+ size="medium"
136
137
  >
137
138
  { __( 'Would you like to privately publish this post now?' ) }
138
139
  </ConfirmDialog>
@@ -6,31 +6,36 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
6
6
  import { useEffect } from '@wordpress/element';
7
7
  import { applyFilters } from '@wordpress/hooks';
8
8
 
9
- const CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [
9
+ const DEFAULT_CONTENT_ONLY_BLOCKS = [
10
10
  'core/post-title',
11
11
  'core/post-featured-image',
12
12
  'core/post-content',
13
13
  'core/template-part',
14
- ] );
14
+ ];
15
15
 
16
16
  /**
17
17
  * Component that when rendered, makes it so that the site editor allows only
18
18
  * page content to be edited.
19
19
  */
20
20
  export default function DisableNonPageContentBlocks() {
21
+ const contentOnlyBlocks = applyFilters(
22
+ 'editor.postContentBlockTypes',
23
+ DEFAULT_CONTENT_ONLY_BLOCKS
24
+ );
25
+
21
26
  // Note that there are two separate subscription because the result for each
22
27
  // returns a new array.
23
28
  const contentOnlyIds = useSelect( ( select ) => {
24
29
  const { getBlocksByName, getBlockParents, getBlockName } =
25
30
  select( blockEditorStore );
26
- return getBlocksByName( CONTENT_ONLY_BLOCKS ).filter( ( clientId ) =>
31
+ return getBlocksByName( contentOnlyBlocks ).filter( ( clientId ) =>
27
32
  getBlockParents( clientId ).every( ( parentClientId ) => {
28
33
  const parentBlockName = getBlockName( parentClientId );
29
34
  return (
30
35
  // Ignore descendents of the query block.
31
36
  parentBlockName !== 'core/query' &&
32
37
  // Enable only the top-most block.
33
- ! CONTENT_ONLY_BLOCKS.includes( parentBlockName )
38
+ ! contentOnlyBlocks.includes( parentBlockName )
34
39
  );
35
40
  } )
36
41
  );
@@ -33,6 +33,7 @@ import StartTemplateOptions from '../start-template-options';
33
33
  import EditorKeyboardShortcuts from '../global-keyboard-shortcuts';
34
34
  import PatternRenameModal from '../pattern-rename-modal';
35
35
  import PatternDuplicateModal from '../pattern-duplicate-modal';
36
+ import TemplatePartMenuItems from '../template-part-menu-items';
36
37
 
37
38
  const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
38
39
  const { PatternsMenuItems } = unlock( editPatternsPrivateApis );
@@ -160,8 +161,21 @@ export const ExperimentalEditorProvider = withRegistryProvider(
160
161
  BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
161
162
  __unstableTemplate: template,
162
163
  } ) => {
163
- const mode = useSelect(
164
- ( select ) => select( editorStore ).getRenderingMode(),
164
+ const { editorSettings, selection, isReady, mode } = useSelect(
165
+ ( select ) => {
166
+ const {
167
+ getEditorSettings,
168
+ getEditorSelection,
169
+ getRenderingMode,
170
+ __unstableIsEditorReady,
171
+ } = select( editorStore );
172
+ return {
173
+ editorSettings: getEditorSettings(),
174
+ isReady: __unstableIsEditorReady(),
175
+ mode: getRenderingMode(),
176
+ selection: getEditorSelection(),
177
+ };
178
+ },
165
179
  []
166
180
  );
167
181
  const shouldRenderTemplate = !! template && mode !== 'post-only';
@@ -187,21 +201,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(
187
201
  rootLevelPost.type,
188
202
  rootLevelPost.slug,
189
203
  ] );
190
- const { editorSettings, selection, isReady } = useSelect(
191
- ( select ) => {
192
- const {
193
- getEditorSettings,
194
- getEditorSelection,
195
- __unstableIsEditorReady,
196
- } = select( editorStore );
197
- return {
198
- editorSettings: getEditorSettings(),
199
- isReady: __unstableIsEditorReady(),
200
- selection: getEditorSelection(),
201
- };
202
- },
203
- []
204
- );
205
204
  const { id, type } = rootLevelPost;
206
205
  const blockEditorSettings = useBlockEditorSettings(
207
206
  editorSettings,
@@ -301,6 +300,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
301
300
  { ! settings.__unstableIsPreviewMode && (
302
301
  <>
303
302
  <PatternsMenuItems />
303
+ <TemplatePartMenuItems />
304
304
  <ContentOnlySettingsMenu />
305
305
  { mode === 'template-locked' && (
306
306
  <DisableNonPageContentBlocks />
@@ -26,11 +26,3 @@
26
26
  bottom: 0;
27
27
  }
28
28
  }
29
-
30
- .edit-post-layout__toggle-sidebar-panel {
31
- .interface-interface-skeleton__sidebar:focus &,
32
- .interface-interface-skeleton__sidebar:focus-within & {
33
- top: auto;
34
- bottom: 0;
35
- }
36
- }
@@ -30,6 +30,7 @@ import PostsPerPage from '../posts-per-page';
30
30
  import SiteDiscussion from '../site-discussion';
31
31
  import { store as editorStore } from '../../store';
32
32
  import TemplateAreas from '../template-areas';
33
+ import { PrivatePostLastRevision } from '../post-last-revision';
33
34
 
34
35
  /**
35
36
  * Module Constants
@@ -68,7 +69,7 @@ export default function PostSummary( { onActionPerformed } ) {
68
69
  <PostLastEditedPanel />
69
70
  </VStack>
70
71
  { ! isRemovedPostStatusPanel && (
71
- <VStack spacing={ 2 }>
72
+ <VStack spacing={ 4 }>
72
73
  <VStack spacing={ 1 }>
73
74
  <PostStatusPanel />
74
75
  <PostSchedulePanel />
@@ -76,6 +77,7 @@ export default function PostSummary( { onActionPerformed } ) {
76
77
  <PostAuthorPanel />
77
78
  <PostTemplatePanel />
78
79
  <PostDiscussionPanel />
80
+ <PrivatePostLastRevision />
79
81
  <PageAttributesPanel />
80
82
  <PostSyncStatus />
81
83
  <BlogTitle />
@@ -52,4 +52,14 @@ function TableOfContents(
52
52
  );
53
53
  }
54
54
 
55
+ /**
56
+ * Renders a table of contents component.
57
+ *
58
+ * @param {Object} props The component props.
59
+ * @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.
60
+ * @param {boolean} props.repositionDropdown Whether to reposition the dropdown.
61
+ * @param {Element.ref} ref The component's ref.
62
+ *
63
+ * @return {JSX.Element} The rendered table of contents component.
64
+ */
55
65
  export default forwardRef( TableOfContents );