@wordpress/edit-post 7.5.0 → 7.7.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 (66) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/header/header-toolbar/index.native.js +5 -0
  3. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  4. package/build/components/header/post-publish-button-or-toggle.js +13 -15
  5. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  6. package/build/components/header/template-title/edit-template-title.js +6 -8
  7. package/build/components/header/template-title/edit-template-title.js.map +1 -1
  8. package/build/components/header/tools-more-menu-group/index.js +1 -7
  9. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  10. package/build/components/layout/index.js +6 -7
  11. package/build/components/layout/index.js.map +1 -1
  12. package/build/components/preferences-modal/index.js +1 -7
  13. package/build/components/preferences-modal/index.js.map +1 -1
  14. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +6 -8
  15. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  16. package/build/components/sidebar/post-template/create-modal.js +1 -1
  17. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  18. package/build/components/visual-editor/index.js +29 -27
  19. package/build/components/visual-editor/index.js.map +1 -1
  20. package/build/components/welcome-guide/default.js +1 -1
  21. package/build/components/welcome-guide/default.js.map +1 -1
  22. package/build/index.js +3 -0
  23. package/build/index.js.map +1 -1
  24. package/build/store/actions.js.map +1 -1
  25. package/build-module/components/header/header-toolbar/index.native.js +6 -0
  26. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  27. package/build-module/components/header/post-publish-button-or-toggle.js +13 -14
  28. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  29. package/build-module/components/header/template-title/edit-template-title.js +6 -7
  30. package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
  31. package/build-module/components/header/tools-more-menu-group/index.js +1 -6
  32. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  33. package/build-module/components/layout/index.js +6 -7
  34. package/build-module/components/layout/index.js.map +1 -1
  35. package/build-module/components/preferences-modal/index.js +1 -6
  36. package/build-module/components/preferences-modal/index.js.map +1 -1
  37. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +6 -7
  38. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  39. package/build-module/components/sidebar/post-template/create-modal.js +1 -1
  40. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  41. package/build-module/components/visual-editor/index.js +29 -27
  42. package/build-module/components/visual-editor/index.js.map +1 -1
  43. package/build-module/components/welcome-guide/default.js +1 -1
  44. package/build-module/components/welcome-guide/default.js.map +1 -1
  45. package/build-module/index.js +4 -1
  46. package/build-module/index.js.map +1 -1
  47. package/build-module/store/actions.js.map +1 -1
  48. package/build-style/style-rtl.css +15 -0
  49. package/build-style/style.css +15 -0
  50. package/package.json +30 -31
  51. package/src/components/header/header-toolbar/index.native.js +5 -0
  52. package/src/components/header/post-publish-button-or-toggle.js +4 -10
  53. package/src/components/header/template-title/edit-template-title.js +8 -12
  54. package/src/components/header/tools-more-menu-group/index.js +1 -6
  55. package/src/components/layout/index.js +6 -8
  56. package/src/components/preferences-modal/index.js +1 -9
  57. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +1 -1
  58. package/src/components/secondary-sidebar/style.scss +6 -0
  59. package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +2 -7
  60. package/src/components/sidebar/post-template/create-modal.js +1 -1
  61. package/src/components/visual-editor/index.js +32 -22
  62. package/src/components/welcome-guide/default.js +1 -1
  63. package/src/index.js +5 -1
  64. package/src/store/actions.js +1 -1
  65. package/src/style.scss +10 -0
  66. package/src/test/editor.native.js +1 -1
@@ -524,6 +524,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
524
524
  }
525
525
  .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
526
526
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
527
+ outline: 2px solid transparent;
528
+ }
529
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus-visible::before {
530
+ content: none;
527
531
  }
528
532
  .interface-preferences__tabs .components-tab-panel__tab-content {
529
533
  padding-right: 24px;
@@ -1447,6 +1451,9 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1447
1451
  .edit-post-editor__document-overview-panel-header li:only-child {
1448
1452
  width: 100%;
1449
1453
  }
1454
+ .edit-post-editor__document-overview-panel-header.components-panel__header.edit-post-sidebar__panel-tabs .components-button.has-icon {
1455
+ display: flex;
1456
+ }
1450
1457
 
1451
1458
  .edit-post-editor__list-view-panel-content,
1452
1459
  .edit-post-editor__list-view-container > .document-outline,
@@ -2135,11 +2142,19 @@ body.admin-color-sunrise {
2135
2142
  }
2136
2143
  }
2137
2144
 
2145
+ @supports (scrollbar-gutter: stable) {
2146
+ .interface-interface-skeleton__header .edit-post-header {
2147
+ scrollbar-gutter: stable;
2148
+ overflow: hidden;
2149
+ }
2150
+ }
2151
+
2138
2152
  .interface-interface-skeleton__sidebar {
2139
2153
  border-right: none;
2140
2154
  }
2141
2155
  @media (min-width: 782px) {
2142
2156
  .is-sidebar-opened .interface-interface-skeleton__sidebar {
2143
2157
  border-right: 1px solid #e0e0e0;
2158
+ overflow: hidden scroll;
2144
2159
  }
2145
2160
  }
@@ -524,6 +524,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
524
524
  }
525
525
  .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
526
526
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
527
+ outline: 2px solid transparent;
528
+ }
529
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus-visible::before {
530
+ content: none;
527
531
  }
528
532
  .interface-preferences__tabs .components-tab-panel__tab-content {
529
533
  padding-left: 24px;
@@ -1447,6 +1451,9 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1447
1451
  .edit-post-editor__document-overview-panel-header li:only-child {
1448
1452
  width: 100%;
1449
1453
  }
1454
+ .edit-post-editor__document-overview-panel-header.components-panel__header.edit-post-sidebar__panel-tabs .components-button.has-icon {
1455
+ display: flex;
1456
+ }
1450
1457
 
1451
1458
  .edit-post-editor__list-view-panel-content,
1452
1459
  .edit-post-editor__list-view-container > .document-outline,
@@ -2135,11 +2142,19 @@ body.admin-color-sunrise {
2135
2142
  }
2136
2143
  }
2137
2144
 
2145
+ @supports (scrollbar-gutter: stable) {
2146
+ .interface-interface-skeleton__header .edit-post-header {
2147
+ scrollbar-gutter: stable;
2148
+ overflow: hidden;
2149
+ }
2150
+ }
2151
+
2138
2152
  .interface-interface-skeleton__sidebar {
2139
2153
  border-left: none;
2140
2154
  }
2141
2155
  @media (min-width: 782px) {
2142
2156
  .is-sidebar-opened .interface-interface-skeleton__sidebar {
2143
2157
  border-left: 1px solid #e0e0e0;
2158
+ overflow: hidden scroll;
2144
2159
  }
2145
2160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "7.5.0",
3
+ "version": "7.7.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,36 +27,35 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.28.0",
31
- "@wordpress/api-fetch": "^6.25.0",
32
- "@wordpress/block-editor": "^11.5.0",
33
- "@wordpress/block-library": "^8.5.0",
34
- "@wordpress/blocks": "^12.5.0",
35
- "@wordpress/components": "^23.5.0",
36
- "@wordpress/compose": "^6.5.0",
37
- "@wordpress/core-data": "^6.5.0",
38
- "@wordpress/data": "^8.5.0",
39
- "@wordpress/deprecated": "^3.28.0",
40
- "@wordpress/dom": "^3.28.0",
41
- "@wordpress/editor": "^13.5.0",
42
- "@wordpress/element": "^5.5.0",
43
- "@wordpress/hooks": "^3.28.0",
44
- "@wordpress/i18n": "^4.28.0",
45
- "@wordpress/icons": "^9.19.0",
46
- "@wordpress/interface": "^5.5.0",
47
- "@wordpress/keyboard-shortcuts": "^4.5.0",
48
- "@wordpress/keycodes": "^3.28.0",
49
- "@wordpress/media-utils": "^4.19.0",
50
- "@wordpress/notices": "^3.28.0",
51
- "@wordpress/plugins": "^5.5.0",
52
- "@wordpress/preferences": "^3.5.0",
53
- "@wordpress/private-apis": "^0.10.0",
54
- "@wordpress/url": "^3.29.0",
55
- "@wordpress/viewport": "^5.5.0",
56
- "@wordpress/warning": "^2.28.0",
57
- "@wordpress/widgets": "^3.5.0",
30
+ "@wordpress/a11y": "^3.30.0",
31
+ "@wordpress/api-fetch": "^6.27.0",
32
+ "@wordpress/block-editor": "^11.7.0",
33
+ "@wordpress/block-library": "^8.7.0",
34
+ "@wordpress/blocks": "^12.7.0",
35
+ "@wordpress/components": "^23.7.0",
36
+ "@wordpress/compose": "^6.7.0",
37
+ "@wordpress/core-data": "^6.7.0",
38
+ "@wordpress/data": "^9.0.0",
39
+ "@wordpress/deprecated": "^3.30.0",
40
+ "@wordpress/dom": "^3.30.0",
41
+ "@wordpress/editor": "^13.7.0",
42
+ "@wordpress/element": "^5.7.0",
43
+ "@wordpress/hooks": "^3.30.0",
44
+ "@wordpress/i18n": "^4.30.0",
45
+ "@wordpress/icons": "^9.21.0",
46
+ "@wordpress/interface": "^5.7.0",
47
+ "@wordpress/keyboard-shortcuts": "^4.7.0",
48
+ "@wordpress/keycodes": "^3.30.0",
49
+ "@wordpress/media-utils": "^4.21.0",
50
+ "@wordpress/notices": "^3.30.0",
51
+ "@wordpress/plugins": "^5.7.0",
52
+ "@wordpress/preferences": "^3.7.0",
53
+ "@wordpress/private-apis": "^0.12.0",
54
+ "@wordpress/url": "^3.31.0",
55
+ "@wordpress/viewport": "^5.7.0",
56
+ "@wordpress/warning": "^2.30.0",
57
+ "@wordpress/widgets": "^3.7.0",
58
58
  "classnames": "^2.3.1",
59
- "lodash": "^4.17.21",
60
59
  "memize": "^1.1.0",
61
60
  "rememo": "^4.0.0"
62
61
  },
@@ -67,5 +66,5 @@
67
66
  "publishConfig": {
68
67
  "access": "public"
69
68
  },
70
- "gitHead": "d5e03a74b79e3ca84afda24375474a103a063ee4"
69
+ "gitHead": "d5c28a67b11e91e3e4b8e90346bfcb90909364d6"
71
70
  }
@@ -99,8 +99,13 @@ function HeaderToolbar( {
99
99
  ? wasNoContentSelected.current
100
100
  : noContentSelected;
101
101
 
102
+ /* translators: accessibility text for the editor toolbar */
103
+ const toolbarAriaLabel = __( 'Document tools' );
104
+
102
105
  return (
103
106
  <View
107
+ testID={ toolbarAriaLabel }
108
+ accessibilityLabel={ toolbarAriaLabel }
104
109
  style={ [
105
110
  getStylesFromColorScheme(
106
111
  styles[ 'header-toolbar__container' ],
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -83,11 +78,10 @@ export function PostPublishButtonOrToggle( {
83
78
 
84
79
  export default compose(
85
80
  withSelect( ( select ) => ( {
86
- hasPublishAction: get(
87
- select( editorStore ).getCurrentPost(),
88
- [ '_links', 'wp:action-publish' ],
89
- false
90
- ),
81
+ hasPublishAction:
82
+ select( editorStore ).getCurrentPost()?._links?.[
83
+ 'wp:action-publish'
84
+ ] ?? false,
91
85
  isBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),
92
86
  isPending: select( editorStore ).isCurrentPostPending(),
93
87
  isPublished: select( editorStore ).isCurrentPostPublished(),
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { mapValues } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -61,14 +56,15 @@ export default function EditTemplateTitle() {
61
56
  setForceEmpty( false );
62
57
 
63
58
  const settings = getEditorSettings();
64
- const newAvailableTemplates = mapValues(
65
- settings.availableTemplates,
66
- ( existingTitle, id ) => {
67
- if ( id !== template.slug ) {
68
- return existingTitle;
59
+ const newAvailableTemplates = Object.fromEntries(
60
+ Object.entries( settings.availableTemplates ?? {} ).map(
61
+ ( [ id, existingTitle ] ) => {
62
+ if ( id !== template.slug ) {
63
+ return existingTitle;
64
+ }
65
+ return newTitle;
69
66
  }
70
- return newTitle;
71
- }
67
+ )
72
68
  );
73
69
  updateEditorSettings( {
74
70
  ...settings,
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { isEmpty } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -15,7 +10,7 @@ const { Fill: ToolsMoreMenuGroup, Slot } =
15
10
  ToolsMoreMenuGroup.Slot = ( { fillProps } ) => (
16
11
  <Slot fillProps={ fillProps }>
17
12
  { ( fills ) =>
18
- ! isEmpty( fills ) && (
13
+ fills.length > 0 && (
19
14
  <MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>
20
15
  )
21
16
  }
@@ -83,7 +83,7 @@ function Layout( { styles } ) {
83
83
  isInserterOpened,
84
84
  isListViewOpened,
85
85
  showIconLabels,
86
- isDistractionFreeMode,
86
+ isDistractionFree,
87
87
  showBlockBreadcrumbs,
88
88
  isTemplateMode,
89
89
  documentLabel,
@@ -116,7 +116,7 @@ function Layout( { styles } ) {
116
116
  ).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),
117
117
  showIconLabels:
118
118
  select( editPostStore ).isFeatureActive( 'showIconLabels' ),
119
- isDistractionFreeMode:
119
+ isDistractionFree:
120
120
  select( editPostStore ).isFeatureActive( 'distractionFree' ),
121
121
  showBlockBreadcrumbs: select( editPostStore ).isFeatureActive(
122
122
  'showBlockBreadcrumbs'
@@ -126,8 +126,6 @@ function Layout( { styles } ) {
126
126
  };
127
127
  }, [] );
128
128
 
129
- const isDistractionFree = isDistractionFreeMode && isLargeViewport;
130
-
131
129
  const openSidebarPanel = () =>
132
130
  openGeneralSidebar(
133
131
  hasBlockSelected ? 'edit-post/block' : 'edit-post/document'
@@ -164,7 +162,7 @@ function Layout( { styles } ) {
164
162
  'has-fixed-toolbar': hasFixedToolbar,
165
163
  'has-metaboxes': hasActiveMetaboxes,
166
164
  'show-icon-labels': showIconLabels,
167
- 'is-distraction-free': isDistractionFree,
165
+ 'is-distraction-free': isDistractionFree && isLargeViewport,
168
166
  'is-entity-save-view-open': !! entitiesSavedStatesCallback,
169
167
  } );
170
168
 
@@ -206,7 +204,7 @@ function Layout( { styles } ) {
206
204
  <EditorKeyboardShortcutsRegister />
207
205
  <SettingsSidebar />
208
206
  <InterfaceSkeleton
209
- isDistractionFree={ isDistractionFree }
207
+ isDistractionFree={ isDistractionFree && isLargeViewport }
210
208
  className={ className }
211
209
  labels={ {
212
210
  ...interfaceLabels,
@@ -252,7 +250,7 @@ function Layout( { styles } ) {
252
250
  { isRichEditingEnabled && mode === 'visual' && (
253
251
  <VisualEditor styles={ styles } />
254
252
  ) }
255
- { ! isTemplateMode && (
253
+ { ! isDistractionFree && ! isTemplateMode && (
256
254
  <div className="edit-post-layout__metaboxes">
257
255
  <MetaBoxes location="normal" />
258
256
  <MetaBoxes location="advanced" />
@@ -265,8 +263,8 @@ function Layout( { styles } ) {
265
263
  }
266
264
  footer={
267
265
  ! isDistractionFree &&
268
- showBlockBreadcrumbs &&
269
266
  ! isMobileViewport &&
267
+ showBlockBreadcrumbs &&
270
268
  isRichEditingEnabled &&
271
269
  mode === 'visual' && (
272
270
  <div className="edit-post-layout__footer">
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -213,10 +208,7 @@ export default function EditPostPreferencesModal() {
213
208
  <PostTaxonomies
214
209
  taxonomyWrapper={ ( content, taxonomy ) => (
215
210
  <EnablePanelOption
216
- label={ get( taxonomy, [
217
- 'labels',
218
- 'menu_name',
219
- ] ) }
211
+ label={ taxonomy.labels.menu_name }
220
212
  panelName={ `taxonomy-panel-${ taxonomy.slug }` }
221
213
  />
222
214
  ) }
@@ -733,7 +733,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
733
733
  class="emotion-2 components-navigator-screen"
734
734
  data-wp-c16t="true"
735
735
  data-wp-component="NavigatorScreen"
736
- style="opacity: 0; transform: translateX(50px) translateZ(0);"
736
+ style="opacity: 1; transform: none;"
737
737
  >
738
738
  <div
739
739
  class="components-surface components-card emotion-3 emotion-1"
@@ -51,6 +51,12 @@
51
51
  li:only-child {
52
52
  width: 100%;
53
53
  }
54
+
55
+ &.components-panel__header.edit-post-sidebar__panel-tabs {
56
+ .components-button.has-icon {
57
+ display: flex;
58
+ }
59
+ }
54
60
  }
55
61
 
56
62
  .edit-post-editor__list-view-panel-content,
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -26,7 +21,7 @@ function TaxonomyPanel( {
26
21
  return null;
27
22
  }
28
23
 
29
- const taxonomyMenuName = get( taxonomy, [ 'labels', 'menu_name' ] );
24
+ const taxonomyMenuName = taxonomy?.labels?.menu_name;
30
25
  if ( ! taxonomyMenuName ) {
31
26
  return null;
32
27
  }
@@ -44,7 +39,7 @@ function TaxonomyPanel( {
44
39
 
45
40
  export default compose(
46
41
  withSelect( ( select, ownProps ) => {
47
- const slug = get( ownProps.taxonomy, [ 'slug' ] );
42
+ const slug = ownProps.taxonomy?.slug;
48
43
  const panelName = slug ? `taxonomy-panel-${ slug }` : '';
49
44
  return {
50
45
  panelName,
@@ -116,7 +116,7 @@ export default function PostTemplateCreateModal( { onClose } ) {
116
116
  placeholder={ DEFAULT_TITLE }
117
117
  disabled={ isBusy }
118
118
  help={ __(
119
- 'Describe the template, e.g. "Post with sidebar". Custom templates can be applied to any post or page.'
119
+ 'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.'
120
120
  ) }
121
121
  />
122
122
  <HStack justify="right">
@@ -67,12 +67,12 @@ function MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {
67
67
 
68
68
  return (
69
69
  <Iframe
70
- head={ <EditorStyles styles={ styles } /> }
71
70
  ref={ ref }
72
71
  contentRef={ contentRef }
73
72
  style={ { width: '100%', height: '100%', display: 'block' } }
74
73
  name="editor-canvas"
75
74
  >
75
+ <EditorStyles styles={ styles } />
76
76
  { children }
77
77
  </Iframe>
78
78
  );
@@ -80,19 +80,20 @@ function MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {
80
80
 
81
81
  /**
82
82
  * Given an array of nested blocks, find the first Post Content
83
- * block inside it, recursing through any nesting levels.
83
+ * block inside it, recursing through any nesting levels,
84
+ * and return its attributes.
84
85
  *
85
86
  * @param {Array} blocks A list of blocks.
86
87
  *
87
88
  * @return {Object | undefined} The Post Content block.
88
89
  */
89
- function findPostContent( blocks ) {
90
+ function getPostContentAttributes( blocks ) {
90
91
  for ( let i = 0; i < blocks.length; i++ ) {
91
92
  if ( blocks[ i ].name === 'core/post-content' ) {
92
- return blocks[ i ];
93
+ return blocks[ i ].attributes;
93
94
  }
94
95
  if ( blocks[ i ].innerBlocks.length ) {
95
- const nestedPostContent = findPostContent(
96
+ const nestedPostContent = getPostContentAttributes(
96
97
  blocks[ i ].innerBlocks
97
98
  );
98
99
 
@@ -108,6 +109,7 @@ export default function VisualEditor( { styles } ) {
108
109
  deviceType,
109
110
  isWelcomeGuideVisible,
110
111
  isTemplateMode,
112
+ postContentAttributes,
111
113
  editedPostTemplate = {},
112
114
  wrapperBlockName,
113
115
  wrapperUniqueId,
@@ -116,8 +118,8 @@ export default function VisualEditor( { styles } ) {
116
118
  const {
117
119
  isFeatureActive,
118
120
  isEditingTemplate,
119
- __experimentalGetPreviewDeviceType,
120
121
  getEditedPostTemplate,
122
+ __experimentalGetPreviewDeviceType,
121
123
  } = select( editPostStore );
122
124
  const { getCurrentPostId, getCurrentPostType, getEditorSettings } =
123
125
  select( editorStore );
@@ -141,8 +143,9 @@ export default function VisualEditor( { styles } ) {
141
143
  deviceType: __experimentalGetPreviewDeviceType(),
142
144
  isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),
143
145
  isTemplateMode: _isTemplateMode,
146
+ postContentAttributes: getEditorSettings().postContentAttributes,
144
147
  // Post template fetch returns a 404 on classic themes, which
145
- // messes with e2e tests, so we check it's a block theme first.
148
+ // messes with e2e tests, so check it's a block theme first.
146
149
  editedPostTemplate:
147
150
  supportsTemplateMode && canEditTemplate
148
151
  ? getEditedPostTemplate()
@@ -230,10 +233,13 @@ export default function VisualEditor( { styles } ) {
230
233
  return { type: 'default' };
231
234
  }, [ isTemplateMode, themeSupportsLayout, globalLayoutSettings ] );
232
235
 
233
- const postContentBlock = useMemo( () => {
236
+ const newestPostContentAttributes = useMemo( () => {
237
+ if ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {
238
+ return postContentAttributes;
239
+ }
234
240
  // When in template editing mode, we can access the blocks directly.
235
241
  if ( editedPostTemplate?.blocks ) {
236
- return findPostContent( editedPostTemplate?.blocks );
242
+ return getPostContentAttributes( editedPostTemplate?.blocks );
237
243
  }
238
244
  // If there are no blocks, we have to parse the content string.
239
245
  // Best double-check it's a string otherwise the parse function gets unhappy.
@@ -242,10 +248,19 @@ export default function VisualEditor( { styles } ) {
242
248
  ? editedPostTemplate?.content
243
249
  : '';
244
250
 
245
- return findPostContent( parse( parseableContent ) ) || {};
246
- }, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );
251
+ return getPostContentAttributes( parse( parseableContent ) ) || {};
252
+ }, [
253
+ editedPostTemplate?.content,
254
+ editedPostTemplate?.blocks,
255
+ postContentAttributes,
256
+ ] );
257
+
258
+ const layout = newestPostContentAttributes?.layout || {};
247
259
 
248
- const postContentLayoutClasses = useLayoutClasses( postContentBlock );
260
+ const postContentLayoutClasses = useLayoutClasses(
261
+ newestPostContentAttributes,
262
+ 'core/post-content'
263
+ );
249
264
 
250
265
  const blockListLayoutClass = classnames(
251
266
  {
@@ -255,12 +270,11 @@ export default function VisualEditor( { styles } ) {
255
270
  );
256
271
 
257
272
  const postContentLayoutStyles = useLayoutStyles(
258
- postContentBlock,
273
+ newestPostContentAttributes,
274
+ 'core/post-content',
259
275
  '.block-editor-block-list__layout.is-root-container'
260
276
  );
261
277
 
262
- const layout = postContentBlock?.attributes?.layout || {};
263
-
264
278
  // Update type for blocks using legacy layouts.
265
279
  const postContentLayout = useMemo( () => {
266
280
  return layout &&
@@ -280,7 +294,7 @@ export default function VisualEditor( { styles } ) {
280
294
 
281
295
  // If there is a Post Content block we use its layout for the block list;
282
296
  // if not, this must be a classic theme, in which case we use the fallback layout.
283
- const blockListLayout = postContentBlock?.isValid
297
+ const blockListLayout = postContentAttributes
284
298
  ? postContentLayout
285
299
  : fallbackLayout;
286
300
 
@@ -318,7 +332,7 @@ export default function VisualEditor( { styles } ) {
318
332
  <motion.div
319
333
  className="edit-post-visual-editor__content-area"
320
334
  animate={ {
321
- padding: isTemplateMode ? '48px 48px 0' : '0',
335
+ padding: isTemplateMode ? '48px 48px 0' : 0,
322
336
  } }
323
337
  ref={ blockSelectionClearerRef }
324
338
  >
@@ -376,15 +390,11 @@ export default function VisualEditor( { styles } ) {
376
390
  { ! isTemplateMode && (
377
391
  <div
378
392
  className={ classnames(
379
- // This wrapper div should have the same
380
- // classes as the block list beneath.
381
- 'is-root-container',
382
- 'block-editor-block-list__layout',
383
393
  'edit-post-visual-editor__post-title-wrapper',
384
394
  {
385
395
  'is-focus-mode': isFocusMode,
386
396
  },
387
- blockListLayoutClass
397
+ 'is-layout-flow'
388
398
  ) }
389
399
  contentEditable={ false }
390
400
  >
@@ -110,7 +110,7 @@ export default function WelcomeGuideDefault() {
110
110
  ) }
111
111
  <ExternalLink
112
112
  href={ __(
113
- 'https://wordpress.org/support/article/wordpress-editor/'
113
+ 'https://wordpress.org/documentation/article/wordpress-block-editor/'
114
114
  ) }
115
115
  >
116
116
  { __( "Here's a detailed guide." ) }
package/src/index.js CHANGED
@@ -11,7 +11,10 @@ import { createRoot } from '@wordpress/element';
11
11
  import { dispatch, select } from '@wordpress/data';
12
12
  import { addFilter } from '@wordpress/hooks';
13
13
  import { store as preferencesStore } from '@wordpress/preferences';
14
- import { registerLegacyWidgetBlock } from '@wordpress/widgets';
14
+ import {
15
+ registerLegacyWidgetBlock,
16
+ registerWidgetGroupBlock,
17
+ } from '@wordpress/widgets';
15
18
 
16
19
  /**
17
20
  * Internal dependencies
@@ -68,6 +71,7 @@ export function initializeEditor(
68
71
 
69
72
  registerCoreBlocks();
70
73
  registerLegacyWidgetBlock( { inserter: false } );
74
+ registerWidgetGroupBlock( { inserter: false } );
71
75
  if ( process.env.IS_GUTENBERG_PLUGIN ) {
72
76
  __experimentalRegisterExperimentalCoreBlocks( {
73
77
  enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,
@@ -294,7 +294,7 @@ export const showBlockTypes =
294
294
  ( type ) =>
295
295
  ! (
296
296
  Array.isArray( blockNames ) ? blockNames : [ blockNames ]
297
- ).includes( type )
297
+ ).includes( type )
298
298
  );
299
299
 
300
300
  registry
package/src/style.scss CHANGED
@@ -99,6 +99,15 @@ body.block-editor-page {
99
99
 
100
100
  @include wordpress-admin-schemes();
101
101
 
102
+ .interface-interface-skeleton__header .edit-post-header {
103
+ @supports (scrollbar-gutter: stable) {
104
+ // The scrollbar-gutter property ensures space is reserved for the scrollbar to appear,
105
+ // when scrollbars are set to be always visible. This ensure icons stay visually aligned.
106
+ scrollbar-gutter: stable;
107
+ overflow: hidden;
108
+ }
109
+ }
110
+
102
111
  // The edit-site package adds or removes the sidebar when it's opened or closed.
103
112
  // The edit-post package, however, always has the sidebar in the canvas.
104
113
  // These edit-post specific rules ensures there isn't a border on the right of
@@ -109,6 +118,7 @@ body.block-editor-page {
109
118
  .is-sidebar-opened & {
110
119
  @include break-medium() {
111
120
  border-left: $border-width solid $gray-200;
121
+ overflow: hidden scroll;
112
122
  }
113
123
  }
114
124
  }
@@ -26,7 +26,7 @@ const unsupportedBlock = `
26
26
  `;
27
27
 
28
28
  beforeAll( () => {
29
- jest.useFakeTimers( 'legacy' );
29
+ jest.useFakeTimers( { legacyFakeTimers: true } );
30
30
  } );
31
31
 
32
32
  afterAll( () => {