@wordpress/editor 13.33.0 → 13.34.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 (303) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +132 -20
  3. package/build/components/autosave-monitor/index.js +15 -12
  4. package/build/components/autosave-monitor/index.js.map +1 -1
  5. package/build/components/character-count/index.js +5 -0
  6. package/build/components/character-count/index.js.map +1 -1
  7. package/build/components/collapsible-block-toolbar/index.js +73 -0
  8. package/build/components/collapsible-block-toolbar/index.js.map +1 -0
  9. package/build/components/document-outline/check.js +8 -0
  10. package/build/components/document-outline/check.js.map +1 -1
  11. package/build/components/document-outline/index.js +11 -0
  12. package/build/components/document-outline/index.js.map +1 -1
  13. package/build/components/document-tools/index.js +0 -7
  14. package/build/components/document-tools/index.js.map +1 -1
  15. package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  16. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  17. package/build/components/editor-history/redo.js +11 -0
  18. package/build/components/editor-history/redo.js.map +1 -1
  19. package/build/components/editor-history/undo.js +11 -0
  20. package/build/components/editor-history/undo.js.map +1 -1
  21. package/build/components/editor-snackbars/index.js +6 -0
  22. package/build/components/editor-snackbars/index.js.map +1 -1
  23. package/build/components/global-keyboard-shortcuts/index.js +7 -0
  24. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  25. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +34 -0
  26. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  27. package/build/components/inserter-sidebar/index.js +1 -4
  28. package/build/components/inserter-sidebar/index.js.map +1 -1
  29. package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
  30. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  31. package/build/components/list-view-sidebar/index.js +1 -1
  32. package/build/components/list-view-sidebar/index.js.map +1 -1
  33. package/build/components/more-menu/copy-content-menu-item.js +59 -0
  34. package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
  35. package/build/components/more-menu/index.js +119 -0
  36. package/build/components/more-menu/index.js.map +1 -0
  37. package/build/components/more-menu/tools-more-menu-group.js +23 -0
  38. package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
  39. package/build/components/more-menu/view-more-menu-group.js +24 -0
  40. package/build/components/more-menu/view-more-menu-group.js.map +1 -0
  41. package/build/components/page-attributes/check.js +8 -0
  42. package/build/components/page-attributes/check.js.map +1 -1
  43. package/build/components/page-attributes/order.js +7 -0
  44. package/build/components/page-attributes/order.js.map +1 -1
  45. package/build/components/page-attributes/panel.js +14 -8
  46. package/build/components/page-attributes/panel.js.map +1 -1
  47. package/build/components/page-attributes/parent.js +7 -0
  48. package/build/components/page-attributes/parent.js.map +1 -1
  49. package/build/components/plugin-post-publish-panel/index.js +1 -1
  50. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  51. package/build/components/plugin-pre-publish-panel/index.js +1 -1
  52. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  53. package/build/components/plugin-sidebar/index.js +1 -1
  54. package/build/components/plugin-sidebar/index.js.map +1 -1
  55. package/build/components/post-actions/actions.js +100 -5
  56. package/build/components/post-actions/actions.js.map +1 -1
  57. package/build/components/post-actions/index.js +30 -7
  58. package/build/components/post-actions/index.js.map +1 -1
  59. package/build/components/post-author/check.js +9 -0
  60. package/build/components/post-author/check.js.map +1 -1
  61. package/build/components/post-author/index.js +6 -0
  62. package/build/components/post-author/index.js.map +1 -1
  63. package/build/components/post-author/panel.js +5 -0
  64. package/build/components/post-author/panel.js.map +1 -1
  65. package/build/components/post-card-panel/index.js +14 -49
  66. package/build/components/post-card-panel/index.js.map +1 -1
  67. package/build/components/post-content-information/index.js +72 -0
  68. package/build/components/post-content-information/index.js.map +1 -0
  69. package/build/components/post-discussion/panel.js +9 -7
  70. package/build/components/post-discussion/panel.js.map +1 -1
  71. package/build/components/post-excerpt/check.js +0 -19
  72. package/build/components/post-excerpt/check.js.map +1 -1
  73. package/build/components/post-excerpt/index.js +52 -12
  74. package/build/components/post-excerpt/index.js.map +1 -1
  75. package/build/components/post-excerpt/panel.js +118 -7
  76. package/build/components/post-excerpt/panel.js.map +1 -1
  77. package/build/components/post-excerpt/plugin.js +2 -2
  78. package/build/components/post-excerpt/plugin.js.map +1 -1
  79. package/build/components/post-featured-image/index.js +1 -1
  80. package/build/components/post-featured-image/index.js.map +1 -1
  81. package/build/components/post-last-edited-panel/index.js +33 -0
  82. package/build/components/post-last-edited-panel/index.js.map +1 -0
  83. package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
  84. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  85. package/build/components/post-schedule/panel.js +1 -1
  86. package/build/components/post-schedule/panel.js.map +1 -1
  87. package/build/components/post-status/index.js +9 -9
  88. package/build/components/post-status/index.js.map +1 -1
  89. package/build/components/post-template/block-theme.js +2 -2
  90. package/build/components/post-template/block-theme.js.map +1 -1
  91. package/build/components/post-template/classic-theme.js +0 -1
  92. package/build/components/post-template/classic-theme.js.map +1 -1
  93. package/build/components/post-template/swap-template-button.js +2 -5
  94. package/build/components/post-template/swap-template-button.js.map +1 -1
  95. package/build/components/post-url/index.js +2 -1
  96. package/build/components/post-url/index.js.map +1 -1
  97. package/build/components/post-url/panel.js +1 -1
  98. package/build/components/post-url/panel.js.map +1 -1
  99. package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
  100. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  101. package/build/components/preferences-modal/index.js +8 -2
  102. package/build/components/preferences-modal/index.js.map +1 -1
  103. package/build/components/preview-dropdown/index.js +3 -1
  104. package/build/components/preview-dropdown/index.js.map +1 -1
  105. package/build/components/provider/disable-non-page-content-blocks.js +23 -16
  106. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  107. package/build/components/save-publish-panels/index.js +89 -0
  108. package/build/components/save-publish-panels/index.js.map +1 -0
  109. package/build/components/start-page-options/index.js +5 -1
  110. package/build/components/start-page-options/index.js.map +1 -1
  111. package/build/private-apis.js +18 -2
  112. package/build/private-apis.js.map +1 -1
  113. package/build/store/selectors.js +3 -1
  114. package/build/store/selectors.js.map +1 -1
  115. package/build-module/components/autosave-monitor/index.js +15 -13
  116. package/build-module/components/autosave-monitor/index.js.map +1 -1
  117. package/build-module/components/character-count/index.js +6 -0
  118. package/build-module/components/character-count/index.js.map +1 -1
  119. package/build-module/components/collapsible-block-toolbar/index.js +65 -0
  120. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
  121. package/build-module/components/document-outline/check.js +9 -0
  122. package/build-module/components/document-outline/check.js.map +1 -1
  123. package/build-module/components/document-outline/index.js +11 -0
  124. package/build-module/components/document-outline/index.js.map +1 -1
  125. package/build-module/components/document-tools/index.js +1 -8
  126. package/build-module/components/document-tools/index.js.map +1 -1
  127. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  128. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  129. package/build-module/components/editor-history/redo.js +11 -0
  130. package/build-module/components/editor-history/redo.js.map +1 -1
  131. package/build-module/components/editor-history/undo.js +11 -0
  132. package/build-module/components/editor-history/undo.js.map +1 -1
  133. package/build-module/components/editor-snackbars/index.js +6 -0
  134. package/build-module/components/editor-snackbars/index.js.map +1 -1
  135. package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
  136. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  137. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +35 -0
  138. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  139. package/build-module/components/inserter-sidebar/index.js +2 -5
  140. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  141. package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
  142. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  143. package/build-module/components/list-view-sidebar/index.js +1 -1
  144. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  145. package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
  146. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
  147. package/build-module/components/more-menu/index.js +111 -0
  148. package/build-module/components/more-menu/index.js.map +1 -0
  149. package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
  150. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
  151. package/build-module/components/more-menu/view-more-menu-group.js +17 -0
  152. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
  153. package/build-module/components/page-attributes/check.js +9 -0
  154. package/build-module/components/page-attributes/check.js.map +1 -1
  155. package/build-module/components/page-attributes/order.js +7 -0
  156. package/build-module/components/page-attributes/order.js.map +1 -1
  157. package/build-module/components/page-attributes/panel.js +13 -6
  158. package/build-module/components/page-attributes/panel.js.map +1 -1
  159. package/build-module/components/page-attributes/parent.js +7 -0
  160. package/build-module/components/page-attributes/parent.js.map +1 -1
  161. package/build-module/components/plugin-post-publish-panel/index.js +1 -1
  162. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  163. package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
  164. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  165. package/build-module/components/plugin-sidebar/index.js +1 -1
  166. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  167. package/build-module/components/post-actions/actions.js +100 -6
  168. package/build-module/components/post-actions/actions.js.map +1 -1
  169. package/build-module/components/post-actions/index.js +31 -8
  170. package/build-module/components/post-actions/index.js.map +1 -1
  171. package/build-module/components/post-author/check.js +10 -0
  172. package/build-module/components/post-author/check.js.map +1 -1
  173. package/build-module/components/post-author/index.js +6 -0
  174. package/build-module/components/post-author/index.js.map +1 -1
  175. package/build-module/components/post-author/panel.js +6 -0
  176. package/build-module/components/post-author/panel.js.map +1 -1
  177. package/build-module/components/post-card-panel/index.js +16 -51
  178. package/build-module/components/post-card-panel/index.js.map +1 -1
  179. package/build-module/components/post-content-information/index.js +66 -0
  180. package/build-module/components/post-content-information/index.js.map +1 -0
  181. package/build-module/components/post-discussion/panel.js +8 -6
  182. package/build-module/components/post-discussion/panel.js.map +1 -1
  183. package/build-module/components/post-excerpt/check.js +0 -19
  184. package/build-module/components/post-excerpt/check.js.map +1 -1
  185. package/build-module/components/post-excerpt/index.js +52 -11
  186. package/build-module/components/post-excerpt/index.js.map +1 -1
  187. package/build-module/components/post-excerpt/panel.js +118 -8
  188. package/build-module/components/post-excerpt/panel.js.map +1 -1
  189. package/build-module/components/post-excerpt/plugin.js +2 -2
  190. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  191. package/build-module/components/post-featured-image/index.js +1 -1
  192. package/build-module/components/post-featured-image/index.js.map +1 -1
  193. package/build-module/components/post-last-edited-panel/index.js +26 -0
  194. package/build-module/components/post-last-edited-panel/index.js.map +1 -0
  195. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
  196. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  197. package/build-module/components/post-schedule/panel.js +1 -1
  198. package/build-module/components/post-schedule/panel.js.map +1 -1
  199. package/build-module/components/post-status/index.js +9 -9
  200. package/build-module/components/post-status/index.js.map +1 -1
  201. package/build-module/components/post-template/block-theme.js +2 -2
  202. package/build-module/components/post-template/block-theme.js.map +1 -1
  203. package/build-module/components/post-template/classic-theme.js +0 -1
  204. package/build-module/components/post-template/classic-theme.js.map +1 -1
  205. package/build-module/components/post-template/swap-template-button.js +3 -6
  206. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  207. package/build-module/components/post-url/index.js +2 -1
  208. package/build-module/components/post-url/index.js.map +1 -1
  209. package/build-module/components/post-url/panel.js +1 -1
  210. package/build-module/components/post-url/panel.js.map +1 -1
  211. package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
  212. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  213. package/build-module/components/preferences-modal/index.js +8 -2
  214. package/build-module/components/preferences-modal/index.js.map +1 -1
  215. package/build-module/components/preview-dropdown/index.js +3 -1
  216. package/build-module/components/preview-dropdown/index.js.map +1 -1
  217. package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
  218. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  219. package/build-module/components/save-publish-panels/index.js +80 -0
  220. package/build-module/components/save-publish-panels/index.js.map +1 -0
  221. package/build-module/components/start-page-options/index.js +5 -1
  222. package/build-module/components/start-page-options/index.js.map +1 -1
  223. package/build-module/private-apis.js +18 -2
  224. package/build-module/private-apis.js.map +1 -1
  225. package/build-module/store/selectors.js +3 -1
  226. package/build-module/store/selectors.js.map +1 -1
  227. package/build-style/style-rtl.css +207 -30
  228. package/build-style/style.css +207 -30
  229. package/package.json +35 -35
  230. package/src/components/autosave-monitor/index.js +15 -12
  231. package/src/components/character-count/index.js +5 -0
  232. package/src/components/collapsible-block-toolbar/index.js +77 -0
  233. package/src/components/collapsible-block-toolbar/style.scss +80 -0
  234. package/src/components/document-outline/check.js +8 -0
  235. package/src/components/document-outline/index.js +10 -0
  236. package/src/components/document-tools/index.js +0 -5
  237. package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  238. package/src/components/editor-history/redo.js +10 -0
  239. package/src/components/editor-history/undo.js +10 -0
  240. package/src/components/editor-snackbars/index.js +5 -0
  241. package/src/components/entities-saved-states/style.scss +7 -0
  242. package/src/components/global-keyboard-shortcuts/index.js +7 -0
  243. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +41 -0
  244. package/src/components/inserter-sidebar/index.js +2 -5
  245. package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
  246. package/src/components/list-view-sidebar/index.js +1 -1
  247. package/src/components/list-view-sidebar/style.scss +2 -2
  248. package/src/components/more-menu/copy-content-menu-item.js +51 -0
  249. package/src/components/more-menu/index.js +158 -0
  250. package/src/components/more-menu/tools-more-menu-group.js +11 -0
  251. package/src/components/more-menu/view-more-menu-group.js +13 -0
  252. package/src/components/page-attributes/check.js +8 -0
  253. package/src/components/page-attributes/order.js +6 -0
  254. package/src/components/page-attributes/panel.js +21 -17
  255. package/src/components/page-attributes/parent.js +6 -0
  256. package/src/components/plugin-post-publish-panel/index.js +1 -1
  257. package/src/components/plugin-pre-publish-panel/index.js +1 -1
  258. package/src/components/plugin-sidebar/index.js +1 -1
  259. package/src/components/post-actions/actions.js +120 -5
  260. package/src/components/post-actions/index.js +41 -7
  261. package/src/components/post-author/check.js +9 -0
  262. package/src/components/post-author/index.js +5 -0
  263. package/src/components/post-author/panel.js +5 -0
  264. package/src/components/post-card-panel/index.js +27 -82
  265. package/src/components/post-card-panel/style.scss +2 -6
  266. package/src/components/post-content-information/index.js +83 -0
  267. package/src/components/post-content-information/style.scss +6 -0
  268. package/src/components/post-discussion/panel.js +24 -20
  269. package/src/components/post-excerpt/check.js +0 -18
  270. package/src/components/post-excerpt/index.js +66 -15
  271. package/src/components/post-excerpt/panel.js +196 -19
  272. package/src/components/post-excerpt/plugin.js +2 -2
  273. package/src/components/post-excerpt/style.scss +24 -0
  274. package/src/components/post-featured-image/index.js +1 -1
  275. package/src/components/post-featured-image/style.scss +2 -8
  276. package/src/components/post-last-edited-panel/index.js +35 -0
  277. package/src/components/post-last-edited-panel/style.scss +6 -0
  278. package/src/components/post-panel-row/style.scss +3 -3
  279. package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
  280. package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
  281. package/src/components/post-publish-panel/style.scss +43 -0
  282. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
  283. package/src/components/post-schedule/panel.js +1 -1
  284. package/src/components/post-schedule/style.scss +2 -4
  285. package/src/components/post-status/index.js +84 -76
  286. package/src/components/post-status/style.scss +0 -1
  287. package/src/components/post-template/block-theme.js +2 -2
  288. package/src/components/post-template/classic-theme.js +0 -1
  289. package/src/components/post-template/swap-template-button.js +3 -6
  290. package/src/components/post-text-editor/style.scss +1 -1
  291. package/src/components/post-title/style.scss +1 -1
  292. package/src/components/post-url/index.js +1 -0
  293. package/src/components/post-url/panel.js +1 -1
  294. package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
  295. package/src/components/preferences-modal/index.js +14 -0
  296. package/src/components/preview-dropdown/index.js +3 -1
  297. package/src/components/provider/disable-non-page-content-blocks.js +23 -21
  298. package/src/components/save-publish-panels/index.js +96 -0
  299. package/src/components/save-publish-panels/style.scss +36 -0
  300. package/src/components/start-page-options/index.js +6 -1
  301. package/src/private-apis.js +18 -2
  302. package/src/store/selectors.js +3 -1
  303. package/src/style.scss +4 -0
@@ -21,6 +21,7 @@ import { useState, useMemo } from '@wordpress/element';
21
21
  import { store as coreStore } from '@wordpress/core-data';
22
22
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
23
23
  import { useInstanceId } from '@wordpress/compose';
24
+ import { Icon, chevronDownSmall } from '@wordpress/icons';
24
25
 
25
26
  /**
26
27
  * Internal dependencies
@@ -31,8 +32,8 @@ import {
31
32
  PATTERN_POST_TYPE,
32
33
  NAVIGATION_POST_TYPE,
33
34
  } from '../../store/constants';
35
+ import PostPanelRow from '../post-panel-row';
34
36
  import { store as editorStore } from '../../store';
35
- import { Icon, chevronDownSmall } from '@wordpress/icons';
36
37
 
37
38
  function PostStatusLabel( { canEdit } ) {
38
39
  const status = useSelect(
@@ -183,14 +184,6 @@ export default function PostStatus() {
183
184
  return null;
184
185
  }
185
186
 
186
- if ( ! canEdit ) {
187
- return (
188
- <div className="editor-post-status">
189
- <PostStatusLabel />
190
- </div>
191
- );
192
- }
193
-
194
187
  const updatePost = ( {
195
188
  status: newStatus = status,
196
189
  password: newPassword = password,
@@ -232,79 +225,94 @@ export default function PostStatus() {
232
225
  };
233
226
 
234
227
  return (
235
- <Dropdown
236
- className="editor-post-status"
237
- contentClassName="editor-change-status__content"
238
- popoverProps={ popoverProps }
239
- focusOnMount
240
- ref={ setPopoverAnchor }
241
- renderToggle={ ( { onToggle } ) => (
242
- <Button
243
- className="editor-post-status-trigger"
244
- onClick={ onToggle }
245
- >
246
- <PostStatusLabel canEdit={ canEdit } />
247
- </Button>
248
- ) }
249
- renderContent={ ( { onClose } ) => (
250
- <>
251
- <InspectorPopoverHeader
252
- title={ __( 'Status & visibility' ) }
253
- onClose={ onClose }
254
- />
255
- <form>
256
- <VStack spacing={ 4 }>
257
- <RadioControl
258
- className="editor-change-status__options"
259
- hideLabelFromVision
260
- label={ __( 'Status' ) }
261
- options={ STATUS_OPTIONS }
262
- onChange={ handleStatus }
263
- selected={
264
- status === 'auto-draft' ? 'draft' : status
265
- }
228
+ <PostPanelRow label={ __( 'Status' ) } ref={ setPopoverAnchor }>
229
+ { canEdit ? (
230
+ <Dropdown
231
+ className="editor-post-status"
232
+ contentClassName="editor-change-status__content"
233
+ popoverProps={ popoverProps }
234
+ focusOnMount
235
+ renderToggle={ ( { onToggle } ) => (
236
+ <Button
237
+ className="editor-post-status-trigger"
238
+ onClick={ onToggle }
239
+ >
240
+ <PostStatusLabel canEdit={ canEdit } />
241
+ </Button>
242
+ ) }
243
+ renderContent={ ( { onClose } ) => (
244
+ <>
245
+ <InspectorPopoverHeader
246
+ title={ __( 'Status & visibility' ) }
247
+ onClose={ onClose }
266
248
  />
267
- { status !== 'private' && (
268
- <VStack
269
- as="fieldset"
270
- spacing={ 4 }
271
- className="editor-change-status__password-fieldset"
272
- >
273
- <CheckboxControl
274
- __nextHasNoMarginBottom
275
- label={ __( 'Password protected' ) }
276
- help={ __(
277
- 'Only visible to those who know the password'
278
- ) }
279
- checked={ showPassword }
280
- onChange={ handleTogglePassword }
249
+ <form>
250
+ <VStack spacing={ 4 }>
251
+ <RadioControl
252
+ className="editor-change-status__options"
253
+ hideLabelFromVision
254
+ label={ __( 'Status' ) }
255
+ options={ STATUS_OPTIONS }
256
+ onChange={ handleStatus }
257
+ selected={
258
+ status === 'auto-draft'
259
+ ? 'draft'
260
+ : status
261
+ }
281
262
  />
282
- { showPassword && (
283
- <div className="editor-change-status__password-input">
284
- <TextControl
285
- label={ __( 'Password' ) }
286
- onChange={ ( value ) =>
287
- updatePost( {
288
- password: value,
289
- } )
290
- }
291
- value={ password }
292
- placeholder={ __(
293
- 'Use a secure password'
294
- ) }
295
- type="text"
296
- id={ passwordInputId }
297
- __next40pxDefaultSize
263
+ { status !== 'private' && (
264
+ <VStack
265
+ as="fieldset"
266
+ spacing={ 4 }
267
+ className="editor-change-status__password-fieldset"
268
+ >
269
+ <CheckboxControl
298
270
  __nextHasNoMarginBottom
271
+ label={ __(
272
+ 'Password protected'
273
+ ) }
274
+ help={ __(
275
+ 'Only visible to those who know the password'
276
+ ) }
277
+ checked={ showPassword }
278
+ onChange={
279
+ handleTogglePassword
280
+ }
299
281
  />
300
- </div>
282
+ { showPassword && (
283
+ <div className="editor-change-status__password-input">
284
+ <TextControl
285
+ label={ __(
286
+ 'Password'
287
+ ) }
288
+ onChange={ ( value ) =>
289
+ updatePost( {
290
+ password: value,
291
+ } )
292
+ }
293
+ value={ password }
294
+ placeholder={ __(
295
+ 'Use a secure password'
296
+ ) }
297
+ type="text"
298
+ id={ passwordInputId }
299
+ __next40pxDefaultSize
300
+ __nextHasNoMarginBottom
301
+ />
302
+ </div>
303
+ ) }
304
+ </VStack>
301
305
  ) }
302
306
  </VStack>
303
- ) }
304
- </VStack>
305
- </form>
306
- </>
307
+ </form>
308
+ </>
309
+ ) }
310
+ />
311
+ ) : (
312
+ <div className="editor-post-status">
313
+ <PostStatusLabel />
314
+ </div>
307
315
  ) }
308
- />
316
+ </PostPanelRow>
309
317
  );
310
318
  }
@@ -1,6 +1,5 @@
1
1
  .editor-post-status {
2
2
  max-width: 100%;
3
- margin-bottom: $grid-unit-20;
4
3
 
5
4
  .editor-post-status-trigger {
6
5
  padding: 1px;
@@ -76,7 +76,7 @@ export default function BlockThemeControl( { id } ) {
76
76
  popoverProps={ POPOVER_PROPS }
77
77
  focusOnMount
78
78
  toggleProps={ {
79
- __next40pxDefaultSize: true,
79
+ size: 'compact',
80
80
  variant: 'tertiary',
81
81
  } }
82
82
  label={ __( 'Template options' ) }
@@ -128,7 +128,7 @@ export default function BlockThemeControl( { id } ) {
128
128
  );
129
129
  } }
130
130
  >
131
- { __( 'Template preview' ) }
131
+ { __( 'Show template' ) }
132
132
  </MenuItem>
133
133
  </MenuGroup>
134
134
  </>
@@ -45,7 +45,6 @@ function PostTemplateToggle( { isOpen, onClick } ) {
45
45
  return (
46
46
  <Button
47
47
  __next40pxDefaultSize
48
- className="edit-post-post-template__toggle"
49
48
  variant="tertiary"
50
49
  aria-expanded={ isOpen }
51
50
  aria-label={ __( 'Template options' ) }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useMemo, useState, useCallback } from '@wordpress/element';
4
+ import { useMemo, useState } from '@wordpress/element';
5
5
  import { decodeEntities } from '@wordpress/html-entities';
6
6
  import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
7
7
  import { MenuItem, Modal } from '@wordpress/components';
@@ -18,9 +18,6 @@ import { useAvailableTemplates, useEditedPostContext } from './hooks';
18
18
 
19
19
  export default function SwapTemplateButton( { onClick } ) {
20
20
  const [ showModal, setShowModal ] = useState( false );
21
- const onClose = useCallback( () => {
22
- setShowModal( false );
23
- }, [] );
24
21
  const { postType, postId } = useEditedPostContext();
25
22
  const availableTemplates = useAvailableTemplates( postType );
26
23
  const { editEntityRecord } = useDispatch( coreStore );
@@ -35,7 +32,7 @@ export default function SwapTemplateButton( { onClick } ) {
35
32
  { template: template.name },
36
33
  { undoIgnore: true }
37
34
  );
38
- onClose(); // Close the template suggestions modal first.
35
+ setShowModal( false ); // Close the template suggestions modal first.
39
36
  onClick();
40
37
  };
41
38
  return (
@@ -46,7 +43,7 @@ export default function SwapTemplateButton( { onClick } ) {
46
43
  { showModal && (
47
44
  <Modal
48
45
  title={ __( 'Choose a template' ) }
49
- onRequestClose={ onClose }
46
+ onRequestClose={ () => setShowModal( false ) }
50
47
  overlayClassName="editor-post-template__swap-template-modal"
51
48
  isFullScreen
52
49
  >
@@ -1,4 +1,4 @@
1
- .edit-post-text-editor__body textarea.editor-post-text-editor {
1
+ textarea.editor-post-text-editor {
2
2
  border: $border-width solid $gray-600;
3
3
  border-radius: 0;
4
4
  display: block;
@@ -1,5 +1,5 @@
1
1
  // Raw Text Variant
2
- .edit-post-text-editor__body .editor-post-title.is-raw-text {
2
+ .editor-post-title.is-raw-text {
3
3
  margin-bottom: $grid-unit-30;
4
4
  margin-top: 2px; // space for focus outline to appear.
5
5
  max-width: none;
@@ -89,6 +89,7 @@ export default function PostURL( { onClose } ) {
89
89
  <Button
90
90
  icon={ copySmall }
91
91
  ref={ copyButtonRef }
92
+ label={ __( 'Copy' ) }
92
93
  />
93
94
  }
94
95
  label={ __( 'Link' ) }
@@ -60,7 +60,7 @@ function PostURLToggle( { isOpen, onClick } ) {
60
60
  const decodedSlug = safeDecodeURIComponent( slug );
61
61
  return (
62
62
  <Button
63
- __next40pxDefaultSize
63
+ size="compact"
64
64
  className="editor-post-url__panel-toggle"
65
65
  variant="tertiary"
66
66
  aria-expanded={ isOpen }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { compose } from '@wordpress/compose';
5
+ import { withSelect, withDispatch } from '@wordpress/data';
6
+ import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { unlock } from '../../lock-unlock';
12
+ import { store as editorStore } from '../../store';
13
+
14
+ const { PreferenceBaseOption } = unlock( preferencesPrivateApis );
15
+
16
+ export default compose(
17
+ withSelect( ( select ) => ( {
18
+ isChecked: select( editorStore ).isPublishSidebarEnabled(),
19
+ } ) ),
20
+ withDispatch( ( dispatch ) => {
21
+ const { enablePublishSidebar, disablePublishSidebar } =
22
+ dispatch( editorStore );
23
+ return {
24
+ onChange: ( isEnabled ) =>
25
+ isEnabled ? enablePublishSidebar() : disablePublishSidebar(),
26
+ };
27
+ } )
28
+ )( PreferenceBaseOption );
@@ -17,6 +17,7 @@ import { store as interfaceStore } from '@wordpress/interface';
17
17
  */
18
18
  import EnablePanelOption from './enable-panel';
19
19
  import EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';
20
+ import EnablePublishSidebarOption from './enable-publish-sidebar';
20
21
  import BlockManager from '../block-manager';
21
22
  import PostTaxonomies from '../post-taxonomies';
22
23
  import PostFeaturedImageCheck from '../post-featured-image/check';
@@ -136,6 +137,18 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
136
137
  />
137
138
  </PageAttributesCheck>
138
139
  </PreferencesModalSection>
140
+ { isLargeViewport && (
141
+ <PreferencesModalSection
142
+ title={ __( 'Publishing' ) }
143
+ >
144
+ <EnablePublishSidebarOption
145
+ help={ __(
146
+ 'Review settings, such as visibility and tags.'
147
+ ) }
148
+ label={ __( 'Enable pre-publish checks' ) }
149
+ />
150
+ </PreferencesModalSection>
151
+ ) }
139
152
  { extraSections?.general }
140
153
  </>
141
154
  ),
@@ -258,6 +271,7 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
258
271
  setIsInserterOpened,
259
272
  setIsListViewOpened,
260
273
  setPreference,
274
+ isLargeViewport,
261
275
  ]
262
276
  );
263
277
 
@@ -38,7 +38,9 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
38
38
  }, [] );
39
39
  const { setDeviceType } = useDispatch( editorStore );
40
40
  const isMobile = useViewportMatch( 'medium', '<' );
41
- if ( isMobile ) return null;
41
+ if ( isMobile ) {
42
+ return null;
43
+ }
42
44
 
43
45
  const popoverProps = {
44
46
  placement: 'bottom-end',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useSelect, useDispatch } from '@wordpress/data';
4
+ import { useSelect, useRegistry } from '@wordpress/data';
5
5
  import { store as blockEditorStore } from '@wordpress/block-editor';
6
6
  import { useEffect } from '@wordpress/element';
7
7
  import { applyFilters } from '@wordpress/hooks';
@@ -18,6 +18,8 @@ const CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [
18
18
  * page content to be edited.
19
19
  */
20
20
  export default function DisableNonPageContentBlocks() {
21
+ // Note that there are two separate subscription because the result for each
22
+ // returns a new array.
21
23
  const contentOnlyIds = useSelect( ( select ) => {
22
24
  const { getBlocksByName, getBlockParents, getBlockName } =
23
25
  select( blockEditorStore );
@@ -33,7 +35,6 @@ export default function DisableNonPageContentBlocks() {
33
35
  } )
34
36
  );
35
37
  }, [] );
36
-
37
38
  const disabledIds = useSelect( ( select ) => {
38
39
  const { getBlocksByName, getBlockOrder } = select( blockEditorStore );
39
40
  return getBlocksByName( [ 'core/template-part' ] ).flatMap(
@@ -41,33 +42,34 @@ export default function DisableNonPageContentBlocks() {
41
42
  );
42
43
  }, [] );
43
44
 
44
- const { setBlockEditingMode, unsetBlockEditingMode } =
45
- useDispatch( blockEditorStore );
45
+ const registry = useRegistry();
46
46
 
47
47
  useEffect( () => {
48
- setBlockEditingMode( '', 'disabled' );
49
- for ( const clientId of contentOnlyIds ) {
50
- setBlockEditingMode( clientId, 'contentOnly' );
51
- }
52
- for ( const clientId of disabledIds ) {
53
- setBlockEditingMode( clientId, 'disabled' );
54
- }
48
+ const { setBlockEditingMode, unsetBlockEditingMode } =
49
+ registry.dispatch( blockEditorStore );
55
50
 
56
- return () => {
57
- unsetBlockEditingMode( '' );
51
+ registry.batch( () => {
52
+ setBlockEditingMode( '', 'disabled' );
58
53
  for ( const clientId of contentOnlyIds ) {
59
- unsetBlockEditingMode( clientId );
54
+ setBlockEditingMode( clientId, 'contentOnly' );
60
55
  }
61
56
  for ( const clientId of disabledIds ) {
62
- unsetBlockEditingMode( clientId );
57
+ setBlockEditingMode( clientId, 'disabled' );
63
58
  }
59
+ } );
60
+
61
+ return () => {
62
+ registry.batch( () => {
63
+ unsetBlockEditingMode( '' );
64
+ for ( const clientId of contentOnlyIds ) {
65
+ unsetBlockEditingMode( clientId );
66
+ }
67
+ for ( const clientId of disabledIds ) {
68
+ unsetBlockEditingMode( clientId );
69
+ }
70
+ } );
64
71
  };
65
- }, [
66
- contentOnlyIds,
67
- disabledIds,
68
- setBlockEditingMode,
69
- unsetBlockEditingMode,
70
- ] );
72
+ }, [ contentOnlyIds, disabledIds, registry ] );
71
73
 
72
74
  return null;
73
75
  }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { Button, createSlotFill } from '@wordpress/components';
6
+ import { __ } from '@wordpress/i18n';
7
+ import { useCallback } from '@wordpress/element';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import EntitiesSavedStates from '../entities-saved-states';
13
+ import PostPublishPanel from '../post-publish-panel';
14
+ import PluginPrePublishPanel from '../plugin-pre-publish-panel';
15
+ import PluginPostPublishPanel from '../plugin-post-publish-panel';
16
+ import { store as editorStore } from '../../store';
17
+
18
+ const { Fill, Slot } = createSlotFill( 'ActionsPanel' );
19
+
20
+ export const ActionsPanelFill = Fill;
21
+
22
+ export default function SavePublishPanels( {
23
+ setEntitiesSavedStatesCallback,
24
+ closeEntitiesSavedStates,
25
+ isEntitiesSavedStatesOpen,
26
+ forceIsDirtyPublishPanel,
27
+ } ) {
28
+ const { closePublishSidebar, togglePublishSidebar } =
29
+ useDispatch( editorStore );
30
+ const { publishSidebarOpened, hasNonPostEntityChanges } = useSelect(
31
+ ( select ) => ( {
32
+ publishSidebarOpened:
33
+ select( editorStore ).isPublishSidebarOpened(),
34
+ hasNonPostEntityChanges:
35
+ select( editorStore ).hasNonPostEntityChanges(),
36
+ } ),
37
+ []
38
+ );
39
+
40
+ const openEntitiesSavedStates = useCallback(
41
+ () => setEntitiesSavedStatesCallback( true ),
42
+ []
43
+ );
44
+
45
+ // It is ok for these components to be unmounted when not in visual use.
46
+ // We don't want more than one present at a time, decide which to render.
47
+ let unmountableContent;
48
+ if ( publishSidebarOpened ) {
49
+ unmountableContent = (
50
+ <PostPublishPanel
51
+ onClose={ closePublishSidebar }
52
+ forceIsDirty={ forceIsDirtyPublishPanel }
53
+ PrePublishExtension={ PluginPrePublishPanel.Slot }
54
+ PostPublishExtension={ PluginPostPublishPanel.Slot }
55
+ />
56
+ );
57
+ } else if ( hasNonPostEntityChanges ) {
58
+ unmountableContent = (
59
+ <div className="editor-layout__toggle-entities-saved-states-panel">
60
+ <Button
61
+ variant="secondary"
62
+ className="editor-layout__toggle-entities-saved-states-panel-button"
63
+ onClick={ openEntitiesSavedStates }
64
+ aria-expanded={ false }
65
+ >
66
+ { __( 'Open save panel' ) }
67
+ </Button>
68
+ </div>
69
+ );
70
+ } else {
71
+ unmountableContent = (
72
+ <div className="editor-layout__toggle-publish-panel">
73
+ <Button
74
+ variant="secondary"
75
+ className="editor-layout__toggle-publish-panel-button"
76
+ onClick={ togglePublishSidebar }
77
+ aria-expanded={ false }
78
+ >
79
+ { __( 'Open publish panel' ) }
80
+ </Button>
81
+ </div>
82
+ );
83
+ }
84
+
85
+ // Since EntitiesSavedStates controls its own panel, we can keep it
86
+ // always mounted to retain its own component state (such as checkboxes).
87
+ return (
88
+ <>
89
+ { isEntitiesSavedStatesOpen && (
90
+ <EntitiesSavedStates close={ closeEntitiesSavedStates } />
91
+ ) }
92
+ <Slot bubblesVirtually />
93
+ { ! isEntitiesSavedStatesOpen && unmountableContent }
94
+ </>
95
+ );
96
+ }
@@ -0,0 +1,36 @@
1
+
2
+ .editor-layout__toggle-publish-panel,
3
+ .editor-layout__toggle-sidebar-panel,
4
+ .editor-layout__toggle-entities-saved-states-panel {
5
+ z-index: z-index(".editor-layout__toggle-sidebar-panel");
6
+ position: fixed !important; // Need to override the default relative positionning
7
+ top: -9999em;
8
+ bottom: auto;
9
+ left: auto;
10
+ right: 0;
11
+ box-sizing: border-box;
12
+ width: $sidebar-width;
13
+ background-color: $white;
14
+ border: 1px dotted $gray-300;
15
+ height: auto !important; // Need to override the default sidebar positionnings
16
+ padding: $grid-unit-30;
17
+ display: flex;
18
+ justify-content: center;
19
+ }
20
+
21
+ .editor-layout__toggle-entities-saved-states-panel,
22
+ .editor-layout__toggle-publish-panel {
23
+ .interface-interface-skeleton__actions:focus &,
24
+ .interface-interface-skeleton__actions:focus-within & {
25
+ top: auto;
26
+ bottom: 0;
27
+ }
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
+ }
@@ -11,6 +11,7 @@ import {
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
12
  import { useAsyncList } from '@wordpress/compose';
13
13
  import { store as coreStore } from '@wordpress/core-data';
14
+ import { __unstableSerializeAndClean } from '@wordpress/blocks';
14
15
 
15
16
  /**
16
17
  * Internal dependencies
@@ -71,7 +72,11 @@ function PatternSelection( { blockPatterns, onChoosePattern } ) {
71
72
  blockPatterns={ blockPatterns }
72
73
  shownPatterns={ shownBlockPatterns }
73
74
  onClickPattern={ ( _pattern, blocks ) => {
74
- editEntityRecord( 'postType', postType, postId, { blocks } );
75
+ editEntityRecord( 'postType', postType, postId, {
76
+ blocks,
77
+ content: ( { blocks: blocksForSerialization = [] } ) =>
78
+ __unstableSerializeAndClean( blocksForSerialization ),
79
+ } );
75
80
  onChoosePattern();
76
81
  } }
77
82
  />
@@ -6,6 +6,7 @@ import * as interfaceApis from '@wordpress/interface';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
+ import CollapsableBlockToolbar from './components/collapsible-block-toolbar';
9
10
  import EditorCanvas from './components/editor-canvas';
10
11
  import { ExperimentalEditorProvider } from './components/provider';
11
12
  import { lock } from './lock-unlock';
@@ -15,7 +16,7 @@ import useBlockEditorSettings from './components/provider/use-block-editor-setti
15
16
  import DocumentTools from './components/document-tools';
16
17
  import InserterSidebar from './components/inserter-sidebar';
17
18
  import ListViewSidebar from './components/list-view-sidebar';
18
- import ModeSwitcher from './components/mode-switcher';
19
+ import MoreMenu from './components/more-menu';
19
20
  import PatternOverridesPanel from './components/pattern-overrides-panel';
20
21
  import PluginPostExcerpt from './components/post-excerpt/plugin';
21
22
  import PostPanelRow from './components/post-panel-row';
@@ -26,18 +27,26 @@ import PostActions from './components/post-actions';
26
27
  import { usePostActions } from './components/post-actions/actions';
27
28
  import PostCardPanel from './components/post-card-panel';
28
29
  import PostStatus from './components/post-status';
30
+ import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
31
+ import ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';
32
+ import { PrivatePostExcerptPanel } from './components/post-excerpt/panel';
33
+ import PostPublishButtonOrToggle from './components/post-publish-button/post-publish-button-or-toggle';
34
+ import SavePublishPanels from './components/save-publish-panels';
35
+ import PostContentInformation from './components/post-content-information';
36
+ import PostLastEditedPanel from './components/post-last-edited-panel';
29
37
 
30
38
  const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
31
39
 
32
40
  export const privateApis = {};
33
41
  lock( privateApis, {
42
+ CollapsableBlockToolbar,
34
43
  DocumentTools,
35
44
  EditorCanvas,
36
45
  ExperimentalEditorProvider,
37
46
  EntitiesSavedStatesExtensible,
38
47
  InserterSidebar,
39
48
  ListViewSidebar,
40
- ModeSwitcher,
49
+ MoreMenu,
41
50
  PatternOverridesPanel,
42
51
  PluginPostExcerpt,
43
52
  PostActions,
@@ -48,6 +57,13 @@ lock( privateApis, {
48
57
  usePostActions,
49
58
  PostCardPanel,
50
59
  PostStatus,
60
+ ToolsMoreMenuGroup,
61
+ ViewMoreMenuGroup,
62
+ PrivatePostExcerptPanel,
63
+ PostPublishButtonOrToggle,
64
+ SavePublishPanels,
65
+ PostContentInformation,
66
+ PostLastEditedPanel,
51
67
 
52
68
  // This is a temporary private API while we're updating the site editor to use EditorProvider.
53
69
  useAutoSwitchEditorSidebars,