@wordpress/edit-post 7.3.6 → 7.5.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 (44) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/device-preview/index.js +3 -7
  3. package/build/components/device-preview/index.js.map +1 -1
  4. package/build/components/header/fullscreen-mode-close/index.js +3 -3
  5. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  6. package/build/components/header/index.js +1 -8
  7. package/build/components/header/index.js.map +1 -1
  8. package/build/components/keyboard-shortcuts/index.js +17 -12
  9. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  10. package/build/components/secondary-sidebar/list-view-sidebar.js +48 -3
  11. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  12. package/build/components/sidebar/featured-image/index.js +3 -7
  13. package/build/components/sidebar/featured-image/index.js.map +1 -1
  14. package/build/components/sidebar/page-attributes/index.js +3 -7
  15. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  16. package/build/editor.js +1 -1
  17. package/build/editor.js.map +1 -1
  18. package/build-module/components/device-preview/index.js +3 -6
  19. package/build-module/components/device-preview/index.js.map +1 -1
  20. package/build-module/components/header/fullscreen-mode-close/index.js +3 -2
  21. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  22. package/build-module/components/header/index.js +1 -7
  23. package/build-module/components/header/index.js.map +1 -1
  24. package/build-module/components/keyboard-shortcuts/index.js +17 -12
  25. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  26. package/build-module/components/secondary-sidebar/list-view-sidebar.js +46 -4
  27. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  28. package/build-module/components/sidebar/featured-image/index.js +3 -6
  29. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  30. package/build-module/components/sidebar/page-attributes/index.js +3 -6
  31. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  32. package/build-module/editor.js +1 -1
  33. package/build-module/editor.js.map +1 -1
  34. package/package.json +30 -29
  35. package/src/components/device-preview/index.js +1 -6
  36. package/src/components/header/fullscreen-mode-close/index.js +1 -6
  37. package/src/components/header/index.js +1 -8
  38. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +780 -778
  39. package/src/components/keyboard-shortcuts/index.js +19 -14
  40. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +481 -477
  41. package/src/components/secondary-sidebar/list-view-sidebar.js +58 -1
  42. package/src/components/sidebar/featured-image/index.js +3 -10
  43. package/src/components/sidebar/page-attributes/index.js +3 -10
  44. package/src/editor.js +1 -0
@@ -70,15 +70,18 @@ function KeyboardShortcuts() {
70
70
  if ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {
71
71
  return;
72
72
  }
73
- const currentAttributes = getBlockAttributes( currentClientId );
74
- const { content: currentContent, align: currentAlign } =
75
- currentAttributes;
73
+ const attributes = getBlockAttributes( currentClientId );
74
+ const textAlign =
75
+ blockName === 'core/paragraph' ? 'align' : 'textAlign';
76
+ const destinationTextAlign =
77
+ destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
78
+
76
79
  replaceBlocks(
77
80
  currentClientId,
78
81
  createBlock( destinationBlockName, {
79
82
  level,
80
- content: currentContent,
81
- align: currentAlign,
83
+ content: attributes.content,
84
+ ...{ [ destinationTextAlign ]: attributes[ textAlign ] },
82
85
  } )
83
86
  );
84
87
  };
@@ -181,7 +184,7 @@ function KeyboardShortcuts() {
181
184
  } );
182
185
 
183
186
  registerShortcut( {
184
- name: `core/block-editor/transform-heading-to-paragraph`,
187
+ name: `core/edit-post/transform-heading-to-paragraph`,
185
188
  category: 'block-library',
186
189
  description: __( 'Transform heading to paragraph.' ),
187
190
  keyCombination: {
@@ -192,7 +195,7 @@ function KeyboardShortcuts() {
192
195
 
193
196
  [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
194
197
  registerShortcut( {
195
- name: `core/block-editor/transform-paragraph-to-heading-${ level }`,
198
+ name: `core/edit-post/transform-paragraph-to-heading-${ level }`,
196
199
  category: 'block-library',
197
200
  description: __( 'Transform paragraph to heading.' ),
198
201
  keyCombination: {
@@ -250,13 +253,15 @@ function KeyboardShortcuts() {
250
253
  }
251
254
  } );
252
255
 
253
- useShortcut( 'core/edit-post/toggle-list-view', () =>
254
- setIsListViewOpened( ! isListViewOpened() )
255
- );
256
+ // Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.
257
+ useShortcut( 'core/edit-post/toggle-list-view', () => {
258
+ if ( ! isListViewOpened() ) {
259
+ setIsListViewOpened( true );
260
+ }
261
+ } );
256
262
 
257
- useShortcut(
258
- 'core/block-editor/transform-heading-to-paragraph',
259
- ( event ) => handleTextLevelShortcut( event, 0 )
263
+ useShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>
264
+ handleTextLevelShortcut( event, 0 )
260
265
  );
261
266
 
262
267
  [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
@@ -264,7 +269,7 @@ function KeyboardShortcuts() {
264
269
  //the hook will execute the same way every time
265
270
  //eslint-disable-next-line react-hooks/rules-of-hooks
266
271
  useShortcut(
267
- `core/block-editor/transform-paragraph-to-heading-${ level }`,
272
+ `core/edit-post/transform-paragraph-to-heading-${ level }`,
268
273
  ( event ) => handleTextLevelShortcut( event, level )
269
274
  );
270
275
  } );