@wordpress/edit-post 7.32.0 → 7.33.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 (261) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -196
  3. package/build/components/browser-url/index.js.map +1 -1
  4. package/build/components/editor-initialization/index.js +0 -1
  5. package/build/components/editor-initialization/index.js.map +1 -1
  6. package/build/components/editor-initialization/listener-hooks.js +1 -38
  7. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  8. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.js +4 -4
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/index.native.js +1 -1
  13. package/build/components/header/index.native.js.map +1 -1
  14. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  15. package/build/components/header/more-menu/index.js +7 -6
  16. package/build/components/header/more-menu/index.js.map +1 -1
  17. package/build/components/header/post-publish-button-or-toggle.js +9 -6
  18. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  19. package/build/components/header/preferences-menu-item/index.js +12 -4
  20. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  21. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  22. package/build/components/header/writing-menu/index.js.map +1 -1
  23. package/build/components/init-pattern-modal/index.js.map +1 -1
  24. package/build/components/keyboard-shortcuts/index.js +1 -36
  25. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  26. package/build/components/layout/actions-panel.js.map +1 -1
  27. package/build/components/layout/index.js +12 -20
  28. package/build/components/layout/index.js.map +1 -1
  29. package/build/components/layout/index.native.js.map +1 -1
  30. package/build/components/meta-boxes/index.js.map +1 -1
  31. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  32. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  33. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  34. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  35. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  36. package/build/components/preferences-modal/index.js +1 -21
  37. package/build/components/preferences-modal/index.js.map +1 -1
  38. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  39. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  40. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  41. package/build/components/sidebar/post-format/index.js.map +1 -1
  42. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  43. package/build/components/sidebar/post-slug/index.js.map +1 -1
  44. package/build/components/sidebar/post-status/index.js +9 -9
  45. package/build/components/sidebar/post-status/index.js.map +1 -1
  46. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  47. package/build/components/sidebar/post-trash/index.js.map +1 -1
  48. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  49. package/build/components/sidebar/settings-header/index.js.map +1 -1
  50. package/build/components/sidebar/settings-sidebar/index.js +37 -40
  51. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  52. package/build/components/text-editor/index.js.map +1 -1
  53. package/build/components/visual-editor/block-inspector-button.js +1 -1
  54. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  55. package/build/components/visual-editor/header.native.js.map +1 -1
  56. package/build/components/visual-editor/index.js +4 -1
  57. package/build/components/visual-editor/index.js.map +1 -1
  58. package/build/components/visual-editor/index.native.js.map +1 -1
  59. package/build/components/visual-editor/use-padding-appender.js +62 -0
  60. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  61. package/build/components/welcome-guide/default.js.map +1 -1
  62. package/build/components/welcome-guide/image.js.map +1 -1
  63. package/build/components/welcome-guide/index.js.map +1 -1
  64. package/build/components/welcome-guide/template.js.map +1 -1
  65. package/build/editor.js +2 -2
  66. package/build/editor.js.map +1 -1
  67. package/build/editor.native.js.map +1 -1
  68. package/build/hooks/commands/use-common-commands.js +5 -22
  69. package/build/hooks/commands/use-common-commands.js.map +1 -1
  70. package/build/hooks/components/index.js.map +1 -1
  71. package/build/hooks/index.js.map +1 -1
  72. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  73. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  74. package/build/index.js +4 -8
  75. package/build/index.js.map +1 -1
  76. package/build/index.native.js.map +1 -1
  77. package/build/lock-unlock.js.map +1 -1
  78. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  79. package/build/plugins/index.js.map +1 -1
  80. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
  81. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  82. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  83. package/build/store/actions.js +10 -8
  84. package/build/store/actions.js.map +1 -1
  85. package/build/store/constants.js.map +1 -1
  86. package/build/store/index.js +1 -1
  87. package/build/store/index.js.map +1 -1
  88. package/build/store/reducer.js.map +1 -1
  89. package/build/store/selectors.js +34 -19
  90. package/build/store/selectors.js.map +1 -1
  91. package/build/utils/meta-boxes.js.map +1 -1
  92. package/build-module/components/browser-url/index.js.map +1 -1
  93. package/build-module/components/editor-initialization/index.js +1 -2
  94. package/build-module/components/editor-initialization/index.js.map +1 -1
  95. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  96. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  97. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  98. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  99. package/build-module/components/header/index.js +3 -3
  100. package/build-module/components/header/index.js.map +1 -1
  101. package/build-module/components/header/index.native.js +1 -1
  102. package/build-module/components/header/index.native.js.map +1 -1
  103. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  104. package/build-module/components/header/more-menu/index.js +5 -4
  105. package/build-module/components/header/more-menu/index.js.map +1 -1
  106. package/build-module/components/header/post-publish-button-or-toggle.js +9 -6
  107. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  108. package/build-module/components/header/preferences-menu-item/index.js +11 -3
  109. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  110. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  111. package/build-module/components/header/writing-menu/index.js.map +1 -1
  112. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  113. package/build-module/components/keyboard-shortcuts/index.js +1 -36
  114. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  115. package/build-module/components/layout/actions-panel.js.map +1 -1
  116. package/build-module/components/layout/index.js +11 -19
  117. package/build-module/components/layout/index.js.map +1 -1
  118. package/build-module/components/layout/index.native.js.map +1 -1
  119. package/build-module/components/meta-boxes/index.js.map +1 -1
  120. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  121. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  122. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  123. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  124. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  125. package/build-module/components/preferences-modal/index.js +1 -20
  126. package/build-module/components/preferences-modal/index.js.map +1 -1
  127. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  128. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  129. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  130. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  131. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  132. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  133. package/build-module/components/sidebar/post-status/index.js +9 -10
  134. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  135. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  136. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  137. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  138. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  139. package/build-module/components/sidebar/settings-sidebar/index.js +38 -41
  140. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  141. package/build-module/components/text-editor/index.js.map +1 -1
  142. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  143. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  144. package/build-module/components/visual-editor/header.native.js.map +1 -1
  145. package/build-module/components/visual-editor/index.js +4 -1
  146. package/build-module/components/visual-editor/index.js.map +1 -1
  147. package/build-module/components/visual-editor/index.native.js.map +1 -1
  148. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  149. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  150. package/build-module/components/welcome-guide/default.js.map +1 -1
  151. package/build-module/components/welcome-guide/image.js.map +1 -1
  152. package/build-module/components/welcome-guide/index.js.map +1 -1
  153. package/build-module/components/welcome-guide/template.js.map +1 -1
  154. package/build-module/editor.js +2 -2
  155. package/build-module/editor.js.map +1 -1
  156. package/build-module/editor.native.js.map +1 -1
  157. package/build-module/hooks/commands/use-common-commands.js +7 -24
  158. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  159. package/build-module/hooks/components/index.js.map +1 -1
  160. package/build-module/hooks/index.js.map +1 -1
  161. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  162. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  163. package/build-module/index.js +5 -5
  164. package/build-module/index.js.map +1 -1
  165. package/build-module/index.native.js.map +1 -1
  166. package/build-module/lock-unlock.js.map +1 -1
  167. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  168. package/build-module/plugins/index.js.map +1 -1
  169. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
  170. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  171. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  172. package/build-module/store/actions.js +8 -7
  173. package/build-module/store/actions.js.map +1 -1
  174. package/build-module/store/constants.js.map +1 -1
  175. package/build-module/store/index.js.map +1 -1
  176. package/build-module/store/reducer.js.map +1 -1
  177. package/build-module/store/selectors.js +33 -18
  178. package/build-module/store/selectors.js.map +1 -1
  179. package/build-module/utils/meta-boxes.js.map +1 -1
  180. package/build-style/classic-rtl.css +2 -2
  181. package/build-style/classic.css +2 -2
  182. package/build-style/style-rtl.css +12 -448
  183. package/build-style/style.css +12 -448
  184. package/package.json +32 -34
  185. package/src/classic.scss +1 -1
  186. package/src/components/editor-initialization/index.js +1 -5
  187. package/src/components/editor-initialization/listener-hooks.js +1 -40
  188. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  189. package/src/components/header/index.js +2 -3
  190. package/src/components/header/index.native.js +1 -1
  191. package/src/components/header/more-menu/index.js +3 -4
  192. package/src/components/header/post-publish-button-or-toggle.js +8 -3
  193. package/src/components/header/preferences-menu-item/index.js +9 -3
  194. package/src/components/header/style.scss +5 -3
  195. package/src/components/header/test/index.js +13 -1
  196. package/src/components/keyboard-shortcuts/index.js +3 -44
  197. package/src/components/layout/index.js +14 -41
  198. package/src/components/preferences-modal/index.js +1 -24
  199. package/src/components/sidebar/post-status/index.js +6 -9
  200. package/src/components/sidebar/settings-sidebar/index.js +62 -58
  201. package/src/components/visual-editor/block-inspector-button.js +1 -1
  202. package/src/components/visual-editor/index.js +4 -0
  203. package/src/components/visual-editor/use-padding-appender.js +66 -0
  204. package/src/editor.js +2 -2
  205. package/src/hooks/commands/use-common-commands.js +11 -26
  206. package/src/index.js +8 -4
  207. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  208. package/src/store/actions.js +10 -12
  209. package/src/store/selectors.js +41 -33
  210. package/src/store/test/actions.js +11 -10
  211. package/src/style.scss +1 -19
  212. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  213. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  214. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  215. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  216. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  217. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  218. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  219. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  220. package/build/components/keyboard-shortcut-help-modal/index.js +0 -132
  221. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  222. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  223. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  224. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  225. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  226. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  227. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  228. package/build/components/start-page-options/index.js +0 -107
  229. package/build/components/start-page-options/index.js.map +0 -1
  230. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  231. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  232. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  233. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  234. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  235. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  236. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  237. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -122
  239. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  241. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  242. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  243. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  244. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  245. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  246. package/build-module/components/start-page-options/index.js +0 -100
  247. package/build-module/components/start-page-options/index.js.map +0 -1
  248. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  249. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  250. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  251. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  252. package/src/components/keyboard-shortcut-help-modal/index.js +0 -163
  253. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  254. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  255. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  256. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  257. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  258. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  259. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  260. package/src/components/start-page-options/index.js +0 -108
  261. package/src/components/start-page-options/style.scss +0 -26
@@ -11,10 +11,7 @@ import { RegistryProvider, createRegistry } from '@wordpress/data';
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import {
15
- useBlockSelectionListener,
16
- useUpdatePostLinkListener,
17
- } from '../listener-hooks';
14
+ import { useUpdatePostLinkListener } from '../listener-hooks';
18
15
  import { STORE_NAME } from '../../../store/constants';
19
16
 
20
17
  describe( 'listener hook tests', () => {
@@ -71,10 +68,6 @@ describe( 'listener hook tests', () => {
71
68
  const setMockReturnValue = ( store, functionName, value ) => {
72
69
  mockStores[ store ].selectors[ functionName ].mockReturnValue( value );
73
70
  };
74
- const getSpyedFunction = ( store, functionName ) =>
75
- mockStores[ store ].selectors[ functionName ];
76
- const getSpyedAction = ( store, actionName ) =>
77
- mockStores[ store ].actions[ actionName ];
78
71
 
79
72
  afterEach( () => {
80
73
  Object.values( mockStores ).forEach( ( storeMocks ) => {
@@ -86,94 +79,6 @@ describe( 'listener hook tests', () => {
86
79
  } );
87
80
  } );
88
81
  } );
89
- describe( 'useBlockSelectionListener', () => {
90
- const registry = createRegistry( mockStores );
91
- const TestComponent = () => {
92
- useBlockSelectionListener();
93
- return null;
94
- };
95
- const TestedOutput = () => {
96
- return (
97
- <RegistryProvider value={ registry }>
98
- <TestComponent />
99
- </RegistryProvider>
100
- );
101
- };
102
-
103
- it( 'does nothing when editor sidebar is not open', () => {
104
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', false );
105
- render( <TestedOutput /> );
106
-
107
- expect(
108
- getSpyedFunction( STORE_NAME, 'isEditorSidebarOpened' )
109
- ).toHaveBeenCalled();
110
- expect(
111
- getSpyedAction( STORE_NAME, 'openGeneralSidebar' )
112
- ).not.toHaveBeenCalled();
113
- } );
114
- it( 'opens block sidebar if block is selected', () => {
115
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', true );
116
- setMockReturnValue(
117
- 'core/block-editor',
118
- 'getBlockSelectionStart',
119
- true
120
- );
121
- setMockReturnValue( 'core/preferences', 'get', false );
122
-
123
- render( <TestedOutput /> );
124
-
125
- expect(
126
- getSpyedAction( STORE_NAME, 'openGeneralSidebar' )
127
- ).toHaveBeenCalledWith( 'edit-post/block' );
128
- } );
129
- it( 'opens document sidebar if block is not selected', () => {
130
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', true );
131
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', true );
132
- setMockReturnValue(
133
- 'core/block-editor',
134
- 'getBlockSelectionStart',
135
- false
136
- );
137
- setMockReturnValue( 'core/preferences', 'get', false );
138
-
139
- render( <TestedOutput /> );
140
-
141
- expect(
142
- getSpyedAction( STORE_NAME, 'openGeneralSidebar' )
143
- ).toHaveBeenCalledWith( 'edit-post/document' );
144
- } );
145
- it( 'does not open block sidebar if block is selected and distraction free mode is on', () => {
146
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', true );
147
- setMockReturnValue(
148
- 'core/block-editor',
149
- 'getBlockSelectionStart',
150
- true
151
- );
152
- setMockReturnValue( 'core/preferences', 'get', true );
153
-
154
- render( <TestedOutput /> );
155
-
156
- expect(
157
- getSpyedAction( STORE_NAME, 'openGeneralSidebar' )
158
- ).toHaveBeenCalledTimes( 0 );
159
- } );
160
- it( 'does not open document sidebar if block is not selected and distraction free is on', () => {
161
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', true );
162
- setMockReturnValue( STORE_NAME, 'isEditorSidebarOpened', true );
163
- setMockReturnValue(
164
- 'core/block-editor',
165
- 'getBlockSelectionStart',
166
- false
167
- );
168
- setMockReturnValue( 'core/preferences', 'get', true );
169
-
170
- render( <TestedOutput /> );
171
-
172
- expect(
173
- getSpyedAction( STORE_NAME, 'openGeneralSidebar' )
174
- ).toHaveBeenCalledTimes( 0 );
175
- } );
176
- } );
177
82
 
178
83
  describe( 'useUpdatePostLinkListener', () => {
179
84
  const registry = createRegistry( mockStores );
@@ -22,7 +22,6 @@ import { useEffect, useRef, useState } from '@wordpress/element';
22
22
  import { useSelect } from '@wordpress/data';
23
23
  import { __ } from '@wordpress/i18n';
24
24
  import { next, previous } from '@wordpress/icons';
25
- import { PinnedItems } from '@wordpress/interface';
26
25
  import { useViewportMatch } from '@wordpress/compose';
27
26
  import {
28
27
  Button,
@@ -42,7 +41,7 @@ import { store as editPostStore } from '../../store';
42
41
  import { unlock } from '../../lock-unlock';
43
42
 
44
43
  const { useShowBlockTools } = unlock( blockEditorPrivateApis );
45
- const { DocumentTools, PostViewLink, PreviewDropdown } =
44
+ const { DocumentTools, PostViewLink, PreviewDropdown, PinnedItems } =
46
45
  unlock( editorPrivateApis );
47
46
 
48
47
  const slideY = {
@@ -191,7 +190,7 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
191
190
  }
192
191
  />
193
192
  { ( isWideViewport || ! showIconLabels ) && (
194
- <PinnedItems.Slot scope="core/edit-post" />
193
+ <PinnedItems.Slot scope="core" />
195
194
  ) }
196
195
  <MoreMenu showIconLabels={ showIconLabels } />
197
196
  </motion.div>
@@ -7,7 +7,7 @@ import { Keyboard } from 'react-native';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { Component } from '@wordpress/element';
10
- import '@wordpress/interface';
10
+ import '@wordpress/editor';
11
11
 
12
12
  /**
13
13
  * Internal dependencies
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { MenuGroup, DropdownMenu } from '@wordpress/components';
6
- import { ActionItem, PinnedItems } from '@wordpress/interface';
7
6
  import { useViewportMatch } from '@wordpress/compose';
8
7
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
9
8
  import { moreVertical } from '@wordpress/icons';
@@ -16,7 +15,7 @@ import ToolsMoreMenuGroup from '../tools-more-menu-group';
16
15
  import WritingMenu from '../writing-menu';
17
16
  import { unlock } from '../../../lock-unlock';
18
17
 
19
- const { ModeSwitcher } = unlock( editorPrivateApis );
18
+ const { ModeSwitcher, ActionItem, PinnedItems } = unlock( editorPrivateApis );
20
19
 
21
20
  const MoreMenu = ( { showIconLabels } ) => {
22
21
  const isLargeViewport = useViewportMatch( 'large' );
@@ -41,13 +40,13 @@ const MoreMenu = ( { showIconLabels } ) => {
41
40
  { showIconLabels && ! isLargeViewport && (
42
41
  <PinnedItems.Slot
43
42
  className={ showIconLabels && 'show-icon-labels' }
44
- scope="core/edit-post"
43
+ scope="core"
45
44
  />
46
45
  ) }
47
46
  <WritingMenu />
48
47
  <ModeSwitcher />
49
48
  <ActionItem.Slot
50
- name="core/edit-post/plugin-more-menu"
49
+ name="core/plugin-more-menu"
51
50
  label={ __( 'Plugins' ) }
52
51
  as={ MenuGroup }
53
52
  fillProps={ { onClick: onClose } }
@@ -16,6 +16,8 @@ export function PostPublishButtonOrToggle( {
16
16
  isScheduled,
17
17
  togglePublishSidebar,
18
18
  setEntitiesSavedStatesCallback,
19
+ postStatusHasChanged,
20
+ postStatus,
19
21
  } ) {
20
22
  const IS_TOGGLE = 'toggle';
21
23
  const IS_BUTTON = 'button';
@@ -29,6 +31,7 @@ export function PostPublishButtonOrToggle( {
29
31
  * for a particular role (see https://wordpress.org/documentation/article/post-status/):
30
32
  *
31
33
  * - is published
34
+ * - post status has changed explicitely to something different than 'future' or 'publish'
32
35
  * - is scheduled to be published
33
36
  * - is pending and can't be published (but only for viewports >= medium).
34
37
  * Originally, we considered showing a button for pending posts that couldn't be published
@@ -46,13 +49,13 @@ export function PostPublishButtonOrToggle( {
46
49
  */
47
50
  if (
48
51
  isPublished ||
52
+ ( postStatusHasChanged &&
53
+ ! [ 'future', 'publish' ].includes( postStatus ) ) ||
49
54
  ( isScheduled && isBeingScheduled ) ||
50
55
  ( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )
51
56
  ) {
52
57
  component = IS_BUTTON;
53
- } else if ( isSmallerThanMediumViewport ) {
54
- component = IS_TOGGLE;
55
- } else if ( isPublishSidebarEnabled ) {
58
+ } else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {
56
59
  component = IS_TOGGLE;
57
60
  } else {
58
61
  component = IS_BUTTON;
@@ -82,6 +85,8 @@ export default compose(
82
85
  select( editorStore ).isPublishSidebarEnabled(),
83
86
  isPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),
84
87
  isScheduled: select( editorStore ).isCurrentPostScheduled(),
88
+ postStatus: select( editorStore ).getEditedPostAttribute( 'status' ),
89
+ postStatusHasChanged: select( editorStore ).getPostEdits()?.status,
85
90
  } ) ),
86
91
  withDispatch( ( dispatch ) => {
87
92
  const { togglePublishSidebar } = dispatch( editorStore );
@@ -4,19 +4,25 @@
4
4
  import { useDispatch } from '@wordpress/data';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { MenuItem } from '@wordpress/components';
7
- import { store as interfaceStore } from '@wordpress/interface';
7
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { unlock } from '../../../lock-unlock';
13
+
14
+ const { interfaceStore } = unlock( editorPrivateApis );
8
15
 
9
16
  /**
10
17
  * Internal dependencies
11
18
  */
12
- import { PREFERENCES_MODAL_NAME } from '../../../components/preferences-modal';
13
19
 
14
20
  export default function PreferencesMenuItem() {
15
21
  const { openModal } = useDispatch( interfaceStore );
16
22
  return (
17
23
  <MenuItem
18
24
  onClick={ () => {
19
- openModal( PREFERENCES_MODAL_NAME );
25
+ openModal( 'editor/preferences' );
20
26
  } }
21
27
  >
22
28
  { __( 'Preferences' ) }
@@ -25,6 +25,10 @@
25
25
  // Leave enough room for the focus ring to show.
26
26
  padding: 2px 0;
27
27
  align-items: center;
28
+ // Allow focus ring to be fully visible on furthest right button.
29
+ @include break-medium() {
30
+ padding-right: var(--wp-admin-border-width-focus);
31
+ }
28
32
 
29
33
  .table-of-contents {
30
34
  display: none;
@@ -286,8 +290,7 @@
286
290
  }
287
291
 
288
292
  .edit-post-header {
289
- backdrop-filter: blur(20px) !important;
290
- background-color: rgba(255, 255, 255, 0.9);
293
+ background-color: $white;
291
294
  border-bottom: 1px solid #e0e0e0;
292
295
  position: absolute;
293
296
  width: 100%;
@@ -298,7 +301,6 @@
298
301
  visibility: hidden;
299
302
  }
300
303
 
301
- & > .edit-post-header__toolbar .editor-document-tools__inserter-toggle,
302
304
  & > .edit-post-header__toolbar .editor-document-tools__document-overview-toggle,
303
305
  & > .edit-post-header__settings > .editor-preview-dropdown,
304
306
  & > .edit-post-header__settings > .interface-pinned-items {
@@ -3,12 +3,23 @@
3
3
  */
4
4
  import { render, screen } from '@testing-library/react';
5
5
 
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { useViewportMatch } from '@wordpress/compose';
10
+
6
11
  /**
7
12
  * Internal dependencies
8
13
  */
9
14
  import { PostPublishButtonOrToggle } from '../post-publish-button-or-toggle';
10
15
 
16
+ jest.mock( '@wordpress/compose/src/hooks/use-viewport-match' );
17
+
11
18
  describe( 'PostPublishButtonOrToggle should render a', () => {
19
+ afterEach( () => {
20
+ useViewportMatch.mockRestore();
21
+ } );
22
+
12
23
  it( 'button when the post is published (1)', () => {
13
24
  render( <PostPublishButtonOrToggle isPublished /> );
14
25
  expect(
@@ -33,7 +44,8 @@ describe( 'PostPublishButtonOrToggle should render a', () => {
33
44
  ).toBeVisible();
34
45
  } );
35
46
 
36
- it( 'toggle when post is not (1), (2), (3), the viewport is >= medium, and the publish sidebar is enabled', () => {
47
+ it( 'toggle when post is not (1), (2), (3), the viewport is <= medium, and the publish sidebar is enabled', () => {
48
+ useViewportMatch.mockReturnValue( true );
37
49
  render( <PostPublishButtonOrToggle isPublishSidebarEnabled /> );
38
50
  expect(
39
51
  screen.getByRole( 'button', { name: 'Publish' } )
@@ -17,17 +17,11 @@ import { createBlock } from '@wordpress/blocks';
17
17
  import { store as editPostStore } from '../../store';
18
18
 
19
19
  function KeyboardShortcuts() {
20
- const { isEditorSidebarOpened } = useSelect( editPostStore );
21
- const { openGeneralSidebar, closeGeneralSidebar, toggleFeature } =
22
- useDispatch( editPostStore );
20
+ const { toggleFeature } = useDispatch( editPostStore );
23
21
  const { registerShortcut } = useDispatch( keyboardShortcutsStore );
24
22
  const { replaceBlocks } = useDispatch( blockEditorStore );
25
- const {
26
- getBlockName,
27
- getSelectedBlockClientId,
28
- getBlockAttributes,
29
- getBlockSelectionStart,
30
- } = useSelect( blockEditorStore );
23
+ const { getBlockName, getSelectedBlockClientId, getBlockAttributes } =
24
+ useSelect( blockEditorStore );
31
25
 
32
26
  const handleTextLevelShortcut = ( event, level ) => {
33
27
  event.preventDefault();
@@ -68,16 +62,6 @@ function KeyboardShortcuts() {
68
62
  },
69
63
  } );
70
64
 
71
- registerShortcut( {
72
- name: 'core/edit-post/toggle-sidebar',
73
- category: 'global',
74
- description: __( 'Show or hide the Settings sidebar.' ),
75
- keyCombination: {
76
- modifier: 'primaryShift',
77
- character: ',',
78
- },
79
- } );
80
-
81
65
  registerShortcut( {
82
66
  name: 'core/edit-post/next-region',
83
67
  category: 'global',
@@ -114,16 +98,6 @@ function KeyboardShortcuts() {
114
98
  ],
115
99
  } );
116
100
 
117
- registerShortcut( {
118
- name: 'core/edit-post/keyboard-shortcuts',
119
- category: 'main',
120
- description: __( 'Display these keyboard shortcuts.' ),
121
- keyCombination: {
122
- modifier: 'access',
123
- character: 'h',
124
- },
125
- } );
126
-
127
101
  registerShortcut( {
128
102
  name: 'core/edit-post/transform-heading-to-paragraph',
129
103
  category: 'block-library',
@@ -151,21 +125,6 @@ function KeyboardShortcuts() {
151
125
  toggleFeature( 'fullscreenMode' );
152
126
  } );
153
127
 
154
- useShortcut( 'core/edit-post/toggle-sidebar', ( event ) => {
155
- // This shortcut has no known clashes, but use preventDefault to prevent any
156
- // obscure shortcuts from triggering.
157
- event.preventDefault();
158
-
159
- if ( isEditorSidebarOpened() ) {
160
- closeGeneralSidebar();
161
- } else {
162
- const sidebarToOpen = getBlockSelectionStart()
163
- ? 'edit-post/block'
164
- : 'edit-post/document';
165
- openGeneralSidebar( sidebarToOpen );
166
- }
167
- } );
168
-
169
128
  useShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>
170
129
  handleTextLevelShortcut( event, 0 )
171
130
  );
@@ -24,16 +24,10 @@ import {
24
24
  privateApis as blockEditorPrivateApis,
25
25
  store as blockEditorStore,
26
26
  } from '@wordpress/block-editor';
27
- import { Button, ScrollLock } from '@wordpress/components';
27
+ import { ScrollLock } from '@wordpress/components';
28
28
  import { useViewportMatch } from '@wordpress/compose';
29
29
  import { PluginArea } from '@wordpress/plugins';
30
30
  import { __, _x, sprintf } from '@wordpress/i18n';
31
- import {
32
- ComplementaryArea,
33
- FullscreenMode,
34
- InterfaceSkeleton,
35
- store as interfaceStore,
36
- } from '@wordpress/interface';
37
31
  import { useState, useEffect, useCallback, useMemo } from '@wordpress/element';
38
32
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
39
33
  import { store as noticesStore } from '@wordpress/notices';
@@ -47,7 +41,6 @@ import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands
47
41
  import TextEditor from '../text-editor';
48
42
  import VisualEditor from '../visual-editor';
49
43
  import EditPostKeyboardShortcuts from '../keyboard-shortcuts';
50
- import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
51
44
  import EditPostPreferencesModal from '../preferences-modal';
52
45
  import InitPatternModal from '../init-pattern-modal';
53
46
  import BrowserURL from '../browser-url';
@@ -56,7 +49,6 @@ import SettingsSidebar from '../sidebar/settings-sidebar';
56
49
  import MetaBoxes from '../meta-boxes';
57
50
  import WelcomeGuide from '../welcome-guide';
58
51
  import ActionsPanel from './actions-panel';
59
- import StartPageOptions from '../start-page-options';
60
52
  import { store as editPostStore } from '../../store';
61
53
  import { unlock } from '../../lock-unlock';
62
54
  import useCommonCommands from '../../hooks/commands/use-common-commands';
@@ -64,7 +56,14 @@ import useCommonCommands from '../../hooks/commands/use-common-commands';
64
56
  const { getLayoutStyles } = unlock( blockEditorPrivateApis );
65
57
  const { useCommands } = unlock( coreCommandsPrivateApis );
66
58
  const { useCommandContext } = unlock( commandsPrivateApis );
67
- const { InserterSidebar, ListViewSidebar } = unlock( editorPrivateApis );
59
+ const {
60
+ InserterSidebar,
61
+ ListViewSidebar,
62
+ ComplementaryArea,
63
+ FullscreenMode,
64
+ InterfaceSkeleton,
65
+ interfaceStore,
66
+ } = unlock( editorPrivateApis );
68
67
 
69
68
  const interfaceLabels = {
70
69
  /* translators: accessibility text for the editor top bar landmark region. */
@@ -139,8 +138,7 @@ function Layout( { initialPost } ) {
139
138
  const isWideViewport = useViewportMatch( 'large' );
140
139
  const isLargeViewport = useViewportMatch( 'medium' );
141
140
 
142
- const { openGeneralSidebar, closeGeneralSidebar } =
143
- useDispatch( editPostStore );
141
+ const { closeGeneralSidebar } = useDispatch( editPostStore );
144
142
  const { createErrorNotice } = useDispatch( noticesStore );
145
143
  const { setIsInserterOpened } = useDispatch( editorStore );
146
144
  const {
@@ -170,9 +168,8 @@ function Layout( { initialPost } ) {
170
168
  showMetaBoxes:
171
169
  select( editorStore ).getRenderingMode() === 'post-only',
172
170
  sidebarIsOpened: !! (
173
- select( interfaceStore ).getActiveComplementaryArea(
174
- editPostStore.name
175
- ) || select( editorStore ).isPublishSidebarOpened()
171
+ select( interfaceStore ).getActiveComplementaryArea( 'core' ) ||
172
+ select( editorStore ).isPublishSidebarOpened()
176
173
  ),
177
174
  isFullscreenActive:
178
175
  select( editPostStore ).isFeatureActive( 'fullscreenMode' ),
@@ -206,11 +203,6 @@ function Layout( { initialPost } ) {
206
203
 
207
204
  const styles = useEditorStyles();
208
205
 
209
- const openSidebarPanel = () =>
210
- openGeneralSidebar(
211
- hasBlockSelected ? 'edit-post/block' : 'edit-post/document'
212
- );
213
-
214
206
  // Inserter and Sidebars are mutually exclusive
215
207
  useEffect( () => {
216
208
  if ( sidebarIsOpened && ! isHugeViewport ) {
@@ -313,25 +305,8 @@ function Layout( { initialPost } ) {
313
305
  editorNotices={ <EditorNotices /> }
314
306
  secondarySidebar={ secondarySidebar() }
315
307
  sidebar={
316
- ( ( isMobileViewport && sidebarIsOpened ) ||
317
- ( ! isMobileViewport && ! isDistractionFree ) ) && (
318
- <>
319
- { ! isMobileViewport && ! sidebarIsOpened && (
320
- <div className="edit-post-layout__toggle-sidebar-panel">
321
- <Button
322
- variant="secondary"
323
- className="edit-post-layout__toggle-sidebar-panel-button"
324
- onClick={ openSidebarPanel }
325
- aria-expanded={ false }
326
- >
327
- { hasBlockSelected
328
- ? __( 'Open block settings' )
329
- : __( 'Open document settings' ) }
330
- </Button>
331
- </div>
332
- ) }
333
- <ComplementaryArea.Slot scope="core/edit-post" />
334
- </>
308
+ ! isDistractionFree && (
309
+ <ComplementaryArea.Slot scope="core" />
335
310
  )
336
311
  }
337
312
  notices={ <EditorSnackbars /> }
@@ -384,10 +359,8 @@ function Layout( { initialPost } ) {
384
359
  } }
385
360
  />
386
361
  <EditPostPreferencesModal />
387
- <KeyboardShortcutHelpModal />
388
362
  <WelcomeGuide />
389
363
  <InitPatternModal />
390
- <StartPageOptions />
391
364
  <PluginArea onError={ onPluginAreaError } />
392
365
  { ! isDistractionFree && <SettingsSidebar /> }
393
366
  </>
@@ -4,8 +4,6 @@
4
4
 
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useViewportMatch } from '@wordpress/compose';
7
- import { useSelect, useDispatch } from '@wordpress/data';
8
- import { store as interfaceStore } from '@wordpress/interface';
9
7
  import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
10
8
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
11
9
 
@@ -21,19 +19,8 @@ const { PreferencesModalSection, PreferenceToggleControl } = unlock(
21
19
  );
22
20
  const { PreferencesModal } = unlock( editorPrivateApis );
23
21
 
24
- export const PREFERENCES_MODAL_NAME = 'edit-post/preferences';
25
-
26
22
  export default function EditPostPreferencesModal() {
27
23
  const isLargeViewport = useViewportMatch( 'medium' );
28
- const { closeModal } = useDispatch( interfaceStore );
29
- const { isModalActive } = useSelect( ( select ) => {
30
- const modalActive = select( interfaceStore ).isModalActive(
31
- PREFERENCES_MODAL_NAME
32
- );
33
- return {
34
- isModalActive: modalActive,
35
- };
36
- }, [] );
37
24
 
38
25
  const extraSections = {
39
26
  general: (
@@ -61,15 +48,5 @@ export default function EditPostPreferencesModal() {
61
48
  ),
62
49
  };
63
50
 
64
- if ( ! isModalActive ) {
65
- return null;
66
- }
67
-
68
- return (
69
- <PreferencesModal
70
- extraSections={ extraSections }
71
- isActive={ isModalActive }
72
- onClose={ closeModal }
73
- />
74
- );
51
+ return <PreferencesModal extraSections={ extraSections } />;
75
52
  }
@@ -8,26 +8,27 @@ import {
8
8
  } from '@wordpress/components';
9
9
  import { useDispatch, useSelect } from '@wordpress/data';
10
10
  import {
11
+ PluginPostStatusInfo,
11
12
  PostAuthorPanel,
12
13
  PostSchedulePanel,
13
- PostSwitchToDraftButton,
14
14
  PostSyncStatus,
15
15
  PostURLPanel,
16
16
  PostTemplatePanel,
17
17
  PostFeaturedImagePanel,
18
18
  store as editorStore,
19
+ privateApis as editorPrivateApis,
19
20
  } from '@wordpress/editor';
20
21
 
21
22
  /**
22
23
  * Internal dependencies
23
24
  */
24
- import PostVisibility from '../post-visibility';
25
25
  import PostTrash from '../post-trash';
26
26
  import PostSticky from '../post-sticky';
27
27
  import PostSlug from '../post-slug';
28
28
  import PostFormat from '../post-format';
29
- import PostPendingStatus from '../post-pending-status';
30
- import PluginPostStatusInfo from '../plugin-post-status-info';
29
+ import { unlock } from '../../../lock-unlock';
30
+
31
+ const { PostStatus: PostStatusPanel } = unlock( editorPrivateApis );
31
32
 
32
33
  /**
33
34
  * Module Constants
@@ -61,14 +62,13 @@ export default function PostStatus() {
61
62
  <PluginPostStatusInfo.Slot>
62
63
  { ( fills ) => (
63
64
  <>
65
+ <PostStatusPanel />
64
66
  <PostFeaturedImagePanel withPanelBody={ false } />
65
- <PostVisibility />
66
67
  <PostSchedulePanel />
67
68
  <PostTemplatePanel />
68
69
  <PostURLPanel />
69
70
  <PostSyncStatus />
70
71
  <PostSticky />
71
- <PostPendingStatus />
72
72
  <PostFormat />
73
73
  <PostSlug />
74
74
  <PostAuthorPanel />
@@ -77,10 +77,7 @@ export default function PostStatus() {
77
77
  style={ {
78
78
  marginTop: '16px',
79
79
  } }
80
- spacing={ 4 }
81
- wrap
82
80
  >
83
- <PostSwitchToDraftButton />
84
81
  <PostTrash />
85
82
  </HStack>
86
83
  </>