@wordpress/edit-post 7.0.0 → 7.2.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 (47) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/header/template-title/delete-template.js +5 -8
  4. package/build/components/header/template-title/delete-template.js.map +1 -1
  5. package/build/components/secondary-sidebar/list-view-outline.js +4 -4
  6. package/build/components/secondary-sidebar/list-view-outline.js.map +1 -1
  7. package/build/components/sidebar/post-template/form.js +1 -0
  8. package/build/components/sidebar/post-template/form.js.map +1 -1
  9. package/build/components/visual-editor/index.js +17 -25
  10. package/build/components/visual-editor/index.js.map +1 -1
  11. package/build/index.js +5 -0
  12. package/build/index.js.map +1 -1
  13. package/build/plugins/index.js +1 -3
  14. package/build/plugins/index.js.map +1 -1
  15. package/build-module/components/header/template-title/delete-template.js +5 -7
  16. package/build-module/components/header/template-title/delete-template.js.map +1 -1
  17. package/build-module/components/secondary-sidebar/list-view-outline.js +4 -4
  18. package/build-module/components/secondary-sidebar/list-view-outline.js.map +1 -1
  19. package/build-module/components/sidebar/post-template/form.js +1 -0
  20. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  21. package/build-module/components/visual-editor/index.js +18 -25
  22. package/build-module/components/visual-editor/index.js.map +1 -1
  23. package/build-module/index.js +4 -0
  24. package/build-module/index.js.map +1 -1
  25. package/build-module/plugins/index.js +1 -2
  26. package/build-module/plugins/index.js.map +1 -1
  27. package/build-style/classic-rtl.css +3 -3
  28. package/build-style/classic.css +3 -3
  29. package/build-style/style-rtl.css +11 -18
  30. package/build-style/style.css +11 -18
  31. package/package.json +28 -27
  32. package/src/components/editor-initialization/test/listener-hooks.js +1 -0
  33. package/src/components/header/fullscreen-mode-close/style.scss +1 -1
  34. package/src/components/header/template-title/delete-template.js +4 -10
  35. package/src/components/preferences-modal/options/test/enable-custom-fields.js +2 -0
  36. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +1 -0
  37. package/src/components/secondary-sidebar/list-view-outline.js +12 -12
  38. package/src/components/secondary-sidebar/style.scss +11 -12
  39. package/src/components/sidebar/post-template/form.js +1 -0
  40. package/src/components/visual-editor/index.js +36 -34
  41. package/src/index.js +2 -0
  42. package/src/plugins/index.js +0 -2
  43. package/build/plugins/navigation-list-view-menu-item.js +0 -48
  44. package/build/plugins/navigation-list-view-menu-item.js.map +0 -1
  45. package/build-module/plugins/navigation-list-view-menu-item.js +0 -40
  46. package/build-module/plugins/navigation-list-view-menu-item.js.map +0 -1
  47. package/src/plugins/navigation-list-view-menu-item.js +0 -56
@@ -58,15 +58,15 @@
58
58
  * @param {string} hex - the hexadecimal value to convert
59
59
  * @return {string} comma separated rgb values
60
60
  */
61
- /**
62
- * Breakpoint mixins
63
- */
64
61
  /**
65
62
  * Long content fade mixin
66
63
  *
67
64
  * Creates a fading overlay to signify that the content is longer
68
65
  * than the space allows.
69
66
  */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
70
70
  /**
71
71
  * Focus styles.
72
72
  */
@@ -58,15 +58,15 @@
58
58
  * @param {string} hex - the hexadecimal value to convert
59
59
  * @return {string} comma separated rgb values
60
60
  */
61
- /**
62
- * Breakpoint mixins
63
- */
64
61
  /**
65
62
  * Long content fade mixin
66
63
  *
67
64
  * Creates a fading overlay to signify that the content is longer
68
65
  * than the space allows.
69
66
  */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
70
70
  /**
71
71
  * Focus styles.
72
72
  */
@@ -58,15 +58,15 @@
58
58
  * @param {string} hex - the hexadecimal value to convert
59
59
  * @return {string} comma separated rgb values
60
60
  */
61
- /**
62
- * Breakpoint mixins
63
- */
64
61
  /**
65
62
  * Long content fade mixin
66
63
  *
67
64
  * Creates a fading overlay to signify that the content is longer
68
65
  * than the space allows.
69
66
  */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
70
70
  /**
71
71
  * Focus styles.
72
72
  */
@@ -320,11 +320,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
320
320
  overflow: auto;
321
321
  z-index: 20;
322
322
  }
323
- .interface-interface-skeleton__content .interface-navigable-region__stacker {
324
- flex-grow: 1;
325
- display: flex;
326
- flex-direction: column;
327
- }
328
323
 
329
324
  .interface-interface-skeleton__secondary-sidebar,
330
325
  .interface-interface-skeleton__sidebar {
@@ -359,9 +354,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
359
354
  }
360
355
  }
361
356
 
362
- .interface-interface-skeleton__secondary-sidebar .interface-navigable-region__stacker {
363
- height: 100%;
364
- }
365
357
  @media (min-width: 782px) {
366
358
  .interface-interface-skeleton__secondary-sidebar {
367
359
  border-left: 1px solid #e0e0e0;
@@ -509,6 +501,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
509
501
  box-shadow: none;
510
502
  font-weight: 500;
511
503
  }
504
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active::after {
505
+ content: none;
506
+ }
512
507
  .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
513
508
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
514
509
  }
@@ -811,7 +806,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
811
806
  position: absolute;
812
807
  top: 9px;
813
808
  left: 9px;
814
- bottom: 9px;
809
+ bottom: 10px;
815
810
  right: 9px;
816
811
  border-radius: 4px;
817
812
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e;
@@ -1455,18 +1450,16 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1455
1450
  }
1456
1451
 
1457
1452
  .edit-post-editor__list-view-overview {
1458
- border-top: 1px solid #ddd;
1459
- width: calc(100% - 32px);
1453
+ display: flex;
1454
+ flex-direction: column;
1455
+ gap: 8px;
1456
+ border-bottom: 1px solid #ddd;
1460
1457
  padding: 16px;
1461
- height: 72px;
1462
1458
  }
1463
1459
  .edit-post-editor__list-view-overview > div > span:first-child {
1464
1460
  width: 90px;
1465
1461
  display: inline-block;
1466
1462
  }
1467
- .edit-post-editor__list-view-overview > div {
1468
- padding: 0 0 8px;
1469
- }
1470
1463
  .edit-post-editor__list-view-overview > div > span {
1471
1464
  font-size: 12px;
1472
1465
  line-height: 1.4;
@@ -58,15 +58,15 @@
58
58
  * @param {string} hex - the hexadecimal value to convert
59
59
  * @return {string} comma separated rgb values
60
60
  */
61
- /**
62
- * Breakpoint mixins
63
- */
64
61
  /**
65
62
  * Long content fade mixin
66
63
  *
67
64
  * Creates a fading overlay to signify that the content is longer
68
65
  * than the space allows.
69
66
  */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
70
70
  /**
71
71
  * Focus styles.
72
72
  */
@@ -320,11 +320,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
320
320
  overflow: auto;
321
321
  z-index: 20;
322
322
  }
323
- .interface-interface-skeleton__content .interface-navigable-region__stacker {
324
- flex-grow: 1;
325
- display: flex;
326
- flex-direction: column;
327
- }
328
323
 
329
324
  .interface-interface-skeleton__secondary-sidebar,
330
325
  .interface-interface-skeleton__sidebar {
@@ -359,9 +354,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
359
354
  }
360
355
  }
361
356
 
362
- .interface-interface-skeleton__secondary-sidebar .interface-navigable-region__stacker {
363
- height: 100%;
364
- }
365
357
  @media (min-width: 782px) {
366
358
  .interface-interface-skeleton__secondary-sidebar {
367
359
  border-right: 1px solid #e0e0e0;
@@ -509,6 +501,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
509
501
  box-shadow: none;
510
502
  font-weight: 500;
511
503
  }
504
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active::after {
505
+ content: none;
506
+ }
512
507
  .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
513
508
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
514
509
  }
@@ -811,7 +806,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
811
806
  position: absolute;
812
807
  top: 9px;
813
808
  right: 9px;
814
- bottom: 9px;
809
+ bottom: 10px;
815
810
  left: 9px;
816
811
  border-radius: 4px;
817
812
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e;
@@ -1455,18 +1450,16 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
1455
1450
  }
1456
1451
 
1457
1452
  .edit-post-editor__list-view-overview {
1458
- border-top: 1px solid #ddd;
1459
- width: calc(100% - 32px);
1453
+ display: flex;
1454
+ flex-direction: column;
1455
+ gap: 8px;
1456
+ border-bottom: 1px solid #ddd;
1460
1457
  padding: 16px;
1461
- height: 72px;
1462
1458
  }
1463
1459
  .edit-post-editor__list-view-overview > div > span:first-child {
1464
1460
  width: 90px;
1465
1461
  display: inline-block;
1466
1462
  }
1467
- .edit-post-editor__list-view-overview > div {
1468
- padding: 0 0 8px;
1469
- }
1470
1463
  .edit-post-editor__list-view-overview > div > span {
1471
1464
  font-size: 12px;
1472
1465
  line-height: 1.4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "7.0.0",
3
+ "version": "7.2.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,31 +27,32 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.23.0",
31
- "@wordpress/api-fetch": "^6.20.0",
32
- "@wordpress/block-editor": "^11.0.0",
33
- "@wordpress/block-library": "^8.0.0",
34
- "@wordpress/blocks": "^12.0.0",
35
- "@wordpress/components": "^23.0.0",
36
- "@wordpress/compose": "^6.0.0",
37
- "@wordpress/core-data": "^6.0.0",
38
- "@wordpress/data": "^8.0.0",
39
- "@wordpress/deprecated": "^3.23.0",
40
- "@wordpress/editor": "^13.0.0",
41
- "@wordpress/element": "^5.0.0",
42
- "@wordpress/hooks": "^3.23.0",
43
- "@wordpress/i18n": "^4.23.0",
44
- "@wordpress/icons": "^9.14.0",
45
- "@wordpress/interface": "^5.0.0",
46
- "@wordpress/keyboard-shortcuts": "^4.0.0",
47
- "@wordpress/keycodes": "^3.23.0",
48
- "@wordpress/media-utils": "^4.14.0",
49
- "@wordpress/notices": "^3.23.0",
50
- "@wordpress/plugins": "^5.0.0",
51
- "@wordpress/preferences": "^3.0.0",
52
- "@wordpress/url": "^3.24.0",
53
- "@wordpress/viewport": "^5.0.0",
54
- "@wordpress/warning": "^2.23.0",
30
+ "@wordpress/a11y": "^3.25.0",
31
+ "@wordpress/api-fetch": "^6.22.0",
32
+ "@wordpress/block-editor": "^11.2.0",
33
+ "@wordpress/block-library": "^8.2.0",
34
+ "@wordpress/blocks": "^12.2.0",
35
+ "@wordpress/components": "^23.2.0",
36
+ "@wordpress/compose": "^6.2.0",
37
+ "@wordpress/core-data": "^6.2.0",
38
+ "@wordpress/data": "^8.2.0",
39
+ "@wordpress/deprecated": "^3.25.0",
40
+ "@wordpress/editor": "^13.2.0",
41
+ "@wordpress/element": "^5.2.0",
42
+ "@wordpress/hooks": "^3.25.0",
43
+ "@wordpress/i18n": "^4.25.0",
44
+ "@wordpress/icons": "^9.16.0",
45
+ "@wordpress/interface": "^5.2.0",
46
+ "@wordpress/keyboard-shortcuts": "^4.2.0",
47
+ "@wordpress/keycodes": "^3.25.0",
48
+ "@wordpress/media-utils": "^4.16.0",
49
+ "@wordpress/notices": "^3.25.0",
50
+ "@wordpress/plugins": "^5.2.0",
51
+ "@wordpress/preferences": "^3.2.0",
52
+ "@wordpress/url": "^3.26.0",
53
+ "@wordpress/viewport": "^5.2.0",
54
+ "@wordpress/warning": "^2.25.0",
55
+ "@wordpress/widgets": "^3.2.0",
55
56
  "classnames": "^2.3.1",
56
57
  "lodash": "^4.17.21",
57
58
  "memize": "^1.1.0",
@@ -64,5 +65,5 @@
64
65
  "publishConfig": {
65
66
  "access": "public"
66
67
  },
67
- "gitHead": "1eb65aabe6738097f4c062e78f69ae8f05879848"
68
+ "gitHead": "204c880ff65295768e9695dfee6c7a9fee1fdd05"
68
69
  }
@@ -152,6 +152,7 @@ describe( 'listener hook tests', () => {
152
152
  const setAttribute = jest.fn();
153
153
  const mockSelector = jest.fn();
154
154
  beforeEach( () => {
155
+ // eslint-disable-next-line testing-library/no-node-access
155
156
  document.querySelector = mockSelector.mockReturnValue( {
156
157
  setAttribute,
157
158
  } );
@@ -35,7 +35,7 @@
35
35
  position: absolute;
36
36
  top: 9px;
37
37
  right: 9px;
38
- bottom: 9px;
38
+ bottom: 9px + $border-width; // Height of toolbar in edit-post (not edit-site) is 61px tall.
39
39
  left: 9px;
40
40
  border-radius: $radius-block-ui + $border-width + $border-width;
41
41
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-900;
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { pickBy } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -58,11 +53,10 @@ export default function DeleteTemplate() {
58
53
  template: '',
59
54
  } );
60
55
  const settings = getEditorSettings();
61
- const newAvailableTemplates = pickBy(
62
- settings.availableTemplates,
63
- ( _title, id ) => {
64
- return id !== template.slug;
65
- }
56
+ const newAvailableTemplates = Object.fromEntries(
57
+ Object.entries( settings.availableTemplates ?? {} ).filter(
58
+ ( [ id ] ) => id !== template.slug
59
+ )
66
60
  );
67
61
  updateEditorSettings( {
68
62
  ...settings,
@@ -12,6 +12,8 @@ import {
12
12
  CustomFieldsConfirmation,
13
13
  } from '../enable-custom-fields';
14
14
 
15
+ jest.useFakeTimers();
16
+
15
17
  describe( 'EnableCustomFieldsOption', () => {
16
18
  it( 'renders a checked checkbox when custom fields are enabled', () => {
17
19
  const { container } = render(
@@ -597,6 +597,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
597
597
  background: none;
598
598
  text-align: start;
599
599
  padding: calc((36px - calc(13px * 1.2) - 2px) / 2) 12px;
600
+ box-sizing: border-box;
600
601
  width: 100%;
601
602
  display: block;
602
603
  margin: 0;
@@ -65,18 +65,6 @@ export default function ListViewOutline() {
65
65
  }, [] );
66
66
  return (
67
67
  <>
68
- { headingCount > 0 ? (
69
- <DocumentOutline />
70
- ) : (
71
- <div className="edit-post-editor__list-view-empty-headings">
72
- <EmptyOutlineIllustration />
73
- <p>
74
- { __(
75
- 'Navigate the structure of your document and address issues like empty or incorrect heading levels.'
76
- ) }
77
- </p>
78
- </div>
79
- ) }
80
68
  <div className="edit-post-editor__list-view-overview">
81
69
  <div>
82
70
  <Text>{ __( 'Characters:' ) }</Text>
@@ -93,6 +81,18 @@ export default function ListViewOutline() {
93
81
  <TimeToRead />
94
82
  </div>
95
83
  </div>
84
+ { headingCount > 0 ? (
85
+ <DocumentOutline />
86
+ ) : (
87
+ <div className="edit-post-editor__list-view-empty-headings">
88
+ <EmptyOutlineIllustration />
89
+ <p>
90
+ { __(
91
+ 'Navigate the structure of your document and address issues like empty or incorrect heading levels.'
92
+ ) }
93
+ </p>
94
+ </div>
95
+ ) }
96
96
  </>
97
97
  );
98
98
  }
@@ -76,24 +76,23 @@
76
76
  }
77
77
 
78
78
  .edit-post-editor__list-view-overview {
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: $grid-unit-10;
82
+ border-bottom: $border-width solid $gray-300;
83
+ padding: $grid-unit-20;
84
+
79
85
  & > div > span:first-child {
80
86
  // Width of the text information fields.
81
87
  width: 90px;
82
88
  display: inline-block;
83
89
  }
84
- border-top: $border-width solid $gray-300;
85
- width: calc(100% - #{ $grid-unit-40 });
86
- padding: $grid-unit-20;
87
- & > div {
88
- padding: 0 0 $grid-unit-10;
89
- & > span {
90
- font-size: $helptext-font-size;
91
- line-height: $default-line-height;
92
- color: $gray-700;
93
- }
90
+
91
+ & > div > span {
92
+ font-size: $helptext-font-size;
93
+ line-height: $default-line-height;
94
+ color: $gray-700;
94
95
  }
95
- // Height of the overview container.
96
- height: 72px;
97
96
  }
98
97
 
99
98
  .edit-post-editor__list-view-container {
@@ -111,6 +111,7 @@ export default function PostTemplateForm( { onClose } ) {
111
111
  </Notice>
112
112
  ) : (
113
113
  <SelectControl
114
+ __nextHasNoMarginBottom
114
115
  hideLabelFromVision
115
116
  label={ __( 'Template' ) }
116
117
  value={ selectedOption?.value ?? '' }
@@ -20,7 +20,6 @@ import {
20
20
  __unstableUseTypewriter as useTypewriter,
21
21
  __unstableUseClipboardHandler as useClipboardHandler,
22
22
  __unstableUseTypingObserver as useTypingObserver,
23
- __unstableBlockSettingsMenuFirstItem,
24
23
  __experimentalUseResizeCanvas as useResizeCanvas,
25
24
  __unstableEditorStyles as EditorStyles,
26
25
  useSetting,
@@ -43,17 +42,9 @@ import { store as coreStore } from '@wordpress/core-data';
43
42
  /**
44
43
  * Internal dependencies
45
44
  */
46
- import BlockInspectorButton from './block-inspector-button';
47
45
  import { store as editPostStore } from '../../store';
48
46
 
49
- function MaybeIframe( {
50
- children,
51
- contentRef,
52
- shouldIframe,
53
- styles,
54
- assets,
55
- style,
56
- } ) {
47
+ function MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {
57
48
  const ref = useMouseMoveTypingReset();
58
49
 
59
50
  if ( ! shouldIframe ) {
@@ -75,7 +66,6 @@ function MaybeIframe( {
75
66
  return (
76
67
  <Iframe
77
68
  head={ <EditorStyles styles={ styles } /> }
78
- assets={ assets }
79
69
  ref={ ref }
80
70
  contentRef={ contentRef }
81
71
  style={ { width: '100%', height: '100%', display: 'block' } }
@@ -119,6 +109,7 @@ export default function VisualEditor( { styles } ) {
119
109
  editedPostTemplate = {},
120
110
  wrapperBlockName,
121
111
  wrapperUniqueId,
112
+ isBlockBasedTheme,
122
113
  } = useSelect( ( select ) => {
123
114
  const {
124
115
  isFeatureActive,
@@ -137,7 +128,8 @@ export default function VisualEditor( { styles } ) {
137
128
  _wrapperBlockName = 'core/post-content';
138
129
  }
139
130
 
140
- const supportsTemplateMode = getEditorSettings().supportsTemplateMode;
131
+ const editorSettings = getEditorSettings();
132
+ const supportsTemplateMode = editorSettings.supportsTemplateMode;
141
133
  const canEditTemplate = select( coreStore ).canUser(
142
134
  'create',
143
135
  'templates'
@@ -155,6 +147,7 @@ export default function VisualEditor( { styles } ) {
155
147
  : undefined,
156
148
  wrapperBlockName: _wrapperBlockName,
157
149
  wrapperUniqueId: getCurrentPostId(),
150
+ isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
158
151
  };
159
152
  }, [] );
160
153
  const { isCleanNewPost } = useSelect( editorStore );
@@ -162,20 +155,15 @@ export default function VisualEditor( { styles } ) {
162
155
  ( select ) => select( editPostStore ).hasMetaBoxes(),
163
156
  []
164
157
  );
165
- const {
166
- themeHasDisabledLayoutStyles,
167
- themeSupportsLayout,
168
- assets,
169
- isFocusMode,
170
- } = useSelect( ( select ) => {
171
- const _settings = select( blockEditorStore ).getSettings();
172
- return {
173
- themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
174
- themeSupportsLayout: _settings.supportsLayout,
175
- assets: _settings.__unstableResolvedAssets,
176
- isFocusMode: _settings.focusMode,
177
- };
178
- }, [] );
158
+ const { themeHasDisabledLayoutStyles, themeSupportsLayout, isFocusMode } =
159
+ useSelect( ( select ) => {
160
+ const _settings = select( blockEditorStore ).getSettings();
161
+ return {
162
+ themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
163
+ themeSupportsLayout: _settings.supportsLayout,
164
+ isFocusMode: _settings.focusMode,
165
+ };
166
+ }, [] );
179
167
  const { clearSelectedBlock } = useDispatch( blockEditorStore );
180
168
  const { setIsEditingTemplate } = useDispatch( editPostStore );
181
169
  const desktopCanvasStyles = {
@@ -302,6 +290,21 @@ export default function VisualEditor( { styles } ) {
302
290
  titleRef?.current?.focus();
303
291
  }, [ isWelcomeGuideVisible, isCleanNewPost ] );
304
292
 
293
+ styles = useMemo(
294
+ () => [
295
+ ...styles,
296
+ {
297
+ // We should move this in to future to the body.
298
+ css:
299
+ `.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}` +
300
+ ( paddingBottom
301
+ ? `body{padding-bottom:${ paddingBottom }}`
302
+ : '' ),
303
+ },
304
+ ],
305
+ [ styles ]
306
+ );
307
+
305
308
  return (
306
309
  <BlockTools
307
310
  __unstableContentRef={ ref }
@@ -336,14 +339,13 @@ export default function VisualEditor( { styles } ) {
336
339
  >
337
340
  <MaybeIframe
338
341
  shouldIframe={
342
+ ( isBlockBasedTheme && ! hasMetaBoxes ) ||
339
343
  isTemplateMode ||
340
344
  deviceType === 'Tablet' ||
341
345
  deviceType === 'Mobile'
342
346
  }
343
347
  contentRef={ contentRef }
344
348
  styles={ styles }
345
- assets={ assets }
346
- style={ { paddingBottom } }
347
349
  >
348
350
  { themeSupportsLayout &&
349
351
  ! themeHasDisabledLayoutStyles &&
@@ -370,10 +372,15 @@ export default function VisualEditor( { styles } ) {
370
372
  { ! isTemplateMode && (
371
373
  <div
372
374
  className={ classnames(
375
+ // This wrapper div should have the same
376
+ // classes as the block list beneath.
377
+ 'is-root-container',
378
+ 'block-editor-block-list__layout',
373
379
  'edit-post-visual-editor__post-title-wrapper',
374
380
  {
375
381
  'is-focus-mode': isFocusMode,
376
- }
382
+ },
383
+ blockListLayoutClass
377
384
  ) }
378
385
  contentEditable={ false }
379
386
  >
@@ -396,11 +403,6 @@ export default function VisualEditor( { styles } ) {
396
403
  </MaybeIframe>
397
404
  </motion.div>
398
405
  </motion.div>
399
- <__unstableBlockSettingsMenuFirstItem>
400
- { ( { onClose } ) => (
401
- <BlockInspectorButton onClick={ onClose } />
402
- ) }
403
- </__unstableBlockSettingsMenuFirstItem>
404
406
  </BlockTools>
405
407
  );
406
408
  }
package/src/index.js CHANGED
@@ -10,6 +10,7 @@ import { render, unmountComponentAtNode } from '@wordpress/element';
10
10
  import { dispatch, select } from '@wordpress/data';
11
11
  import { addFilter } from '@wordpress/hooks';
12
12
  import { store as preferencesStore } from '@wordpress/preferences';
13
+ import { registerLegacyWidgetBlock } from '@wordpress/widgets';
13
14
 
14
15
  /**
15
16
  * Internal dependencies
@@ -115,6 +116,7 @@ export function initializeEditor(
115
116
  }
116
117
 
117
118
  registerCoreBlocks();
119
+ registerLegacyWidgetBlock( { inserter: false } );
118
120
  if ( process.env.IS_GUTENBERG_PLUGIN ) {
119
121
  __experimentalRegisterExperimentalCoreBlocks( {
120
122
  enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,
@@ -14,7 +14,6 @@ import CopyContentMenuItem from './copy-content-menu-item';
14
14
  import KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';
15
15
  import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
16
16
  import WelcomeGuideMenuItem from './welcome-guide-menu-item';
17
- import NavigationListViewMenuItem from './navigation-list-view-menu-item';
18
17
 
19
18
  registerPlugin( 'edit-post', {
20
19
  render() {
@@ -56,7 +55,6 @@ registerPlugin( 'edit-post', {
56
55
  </>
57
56
  ) }
58
57
  </ToolsMoreMenuGroup>
59
- <NavigationListViewMenuItem />
60
58
  </>
61
59
  );
62
60
  },
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _element = require("@wordpress/element");
9
-
10
- var _blockEditor = require("@wordpress/block-editor");
11
-
12
- var _components = require("@wordpress/components");
13
-
14
- var _data = require("@wordpress/data");
15
-
16
- var _i18n = require("@wordpress/i18n");
17
-
18
- var _icons = require("@wordpress/icons");
19
-
20
- var _window;
21
-
22
- const NavMenuSidebarToggle = () => {
23
- // eslint-disable-next-line @wordpress/data-no-store-string-literals
24
- const {
25
- openGeneralSidebar
26
- } = (0, _data.useDispatch)('core/edit-post');
27
- return (0, _element.createElement)(_components.ToolbarGroup, null, (0, _element.createElement)(_components.ToolbarButton, {
28
- className: "components-toolbar__control",
29
- label: (0, _i18n.__)('Open navigation list view'),
30
- onClick: () => openGeneralSidebar('edit-post/block'),
31
- icon: _icons.listView
32
- }));
33
- };
34
-
35
- let MaybeNavMenuSidebarToggle = _element.Fragment;
36
- const isOffCanvasNavigationEditorEnabled = ((_window = window) === null || _window === void 0 ? void 0 : _window.__experimentalEnableOffCanvasNavigationEditor) === true;
37
-
38
- if (isOffCanvasNavigationEditorEnabled) {
39
- MaybeNavMenuSidebarToggle = NavMenuSidebarToggle;
40
- }
41
-
42
- const NavigationEditMenuItem = () => {
43
- return (0, _element.createElement)(_blockEditor.BlockEditorProvider, null, (0, _element.createElement)(_blockEditor.__unstableBlockToolbarLastItem, null, (0, _element.createElement)(_blockEditor.__unstableBlockNameContext.Consumer, null, blockName => blockName === 'core/navigation' && (0, _element.createElement)(MaybeNavMenuSidebarToggle, null))));
44
- };
45
-
46
- var _default = NavigationEditMenuItem;
47
- exports.default = _default;
48
- //# sourceMappingURL=navigation-list-view-menu-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/plugins/navigation-list-view-menu-item.js"],"names":["NavMenuSidebarToggle","openGeneralSidebar","listView","MaybeNavMenuSidebarToggle","Fragment","isOffCanvasNavigationEditorEnabled","window","__experimentalEnableOffCanvasNavigationEditor","NavigationEditMenuItem","blockName"],"mappings":";;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;;;AAEA,MAAMA,oBAAoB,GAAG,MAAM;AAClC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAa,gBAAb,CAA/B;AAEA,SACC,4BAAC,wBAAD,QACC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,KAAK,EAAG,cAAI,2BAAJ,CAFT;AAGC,IAAA,OAAO,EAAG,MAAMA,kBAAkB,CAAE,iBAAF,CAHnC;AAIC,IAAA,IAAI,EAAGC;AAJR,IADD,CADD;AAUA,CAdD;;AAgBA,IAAIC,yBAAyB,GAAGC,iBAAhC;AAEA,MAAMC,kCAAkC,GACvC,YAAAC,MAAM,UAAN,0CAAQC,6CAAR,MAA0D,IAD3D;;AAGA,IAAKF,kCAAL,EAA0C;AACzCF,EAAAA,yBAAyB,GAAGH,oBAA5B;AACA;;AAED,MAAMQ,sBAAsB,GAAG,MAAM;AACpC,SACC,4BAAC,gCAAD,QACC,4BAAC,2CAAD,QACC,4BAAC,uCAAD,CAA4B,QAA5B,QACKC,SAAF,IACDA,SAAS,KAAK,iBAAd,IACC,4BAAC,yBAAD,OAHH,CADD,CADD,CADD;AAaA,CAdD;;eAgBeD,sB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockEditorProvider,\n\t__unstableBlockToolbarLastItem,\n\t__unstableBlockNameContext,\n} from '@wordpress/block-editor';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { Fragment } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { listView } from '@wordpress/icons';\n\nconst NavMenuSidebarToggle = () => {\n\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\tconst { openGeneralSidebar } = useDispatch( 'core/edit-post' );\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\tlabel={ __( 'Open navigation list view' ) }\n\t\t\t\tonClick={ () => openGeneralSidebar( 'edit-post/block' ) }\n\t\t\t\ticon={ listView }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nlet MaybeNavMenuSidebarToggle = Fragment;\n\nconst isOffCanvasNavigationEditorEnabled =\n\twindow?.__experimentalEnableOffCanvasNavigationEditor === true;\n\nif ( isOffCanvasNavigationEditorEnabled ) {\n\tMaybeNavMenuSidebarToggle = NavMenuSidebarToggle;\n}\n\nconst NavigationEditMenuItem = () => {\n\treturn (\n\t\t<BlockEditorProvider>\n\t\t\t<__unstableBlockToolbarLastItem>\n\t\t\t\t<__unstableBlockNameContext.Consumer>\n\t\t\t\t\t{ ( blockName ) =>\n\t\t\t\t\t\tblockName === 'core/navigation' && (\n\t\t\t\t\t\t\t<MaybeNavMenuSidebarToggle />\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t</__unstableBlockNameContext.Consumer>\n\t\t\t</__unstableBlockToolbarLastItem>\n\t\t</BlockEditorProvider>\n\t);\n};\n\nexport default NavigationEditMenuItem;\n"]}