Skip to content

Commit 2e8dc51

Browse files
authored
Interface: move EditorSkeleton to interface package (WordPress#21335)
Rename EditorSkeleton component to InterfaceSkeleton and move it from block-editor to interface package.
1 parent 7601a5a commit 2e8dc51

File tree

17 files changed

+76
-64
lines changed

17 files changed

+76
-64
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/base-styles/_z-index.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $z-layers: (
2424
".block-library-gallery-item__inline-menu": 20,
2525
".block-editor-url-input__suggestions": 30,
2626
".edit-post-layout__footer": 30,
27-
".block-editor-editor-skeleton__header": 30,
27+
".interface-interface-skeleton__header": 30,
2828
".edit-site-header": 62,
2929
".edit-widgets-header": 30,
3030
".block-library-button__inline-link .block-editor-url-input__suggestions": 6, // URL suggestions for button block above sibling inserter
@@ -62,7 +62,7 @@ $z-layers: (
6262

6363
// Show sidebar above wp-admin navigation bar for mobile viewports:
6464
// #wpadminbar { z-index: 99999 }
65-
".block-editor-editor-skeleton__sidebar": 100000,
65+
".interface-interface-skeleton__sidebar": 100000,
6666
".edit-post-layout__toogle-sidebar-panel": 100000,
6767
".edit-site-sidebar": 100000,
6868
".edit-widgets-sidebar": 100000,
@@ -73,7 +73,7 @@ $z-layers: (
7373

7474
// Show sidebar in greater than small viewports above editor related elements
7575
// but bellow #adminmenuback { z-index: 100 }
76-
".block-editor-editor-skeleton__sidebar {greater than small}": 90,
76+
".interface-interface-skeleton__sidebar {greater than small}": 90,
7777
".edit-site-sidebar {greater than small}": 90,
7878
".edit-widgets-sidebar {greater than small}": 90,
7979

@@ -108,7 +108,7 @@ $z-layers: (
108108
".components-autocomplete__results": 1000000,
109109

110110
".skip-to-selected-block": 100000,
111-
".block-editor-editor-skeleton__publish": 100000,
111+
".interface-interface-skeleton__actions": 100000,
112112

113113
// Show NUX tips above popovers, wp-admin menus, submenus, and sidebar:
114114
".nux-dot-tip": 1000001,

packages/block-editor/src/components/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export { default as ButtonBlockerAppender } from './button-block-appender';
2222
export { default as ColorPalette } from './color-palette';
2323
export { default as ColorPaletteControl } from './color-palette/control';
2424
export { default as ContrastChecker } from './contrast-checker';
25-
export { default as __experimentalEditorSkeleton } from './editor-skeleton';
2625
export { default as __experimentalGradientPicker } from './gradient-picker';
2726
export { default as __experimentalGradientPickerControl } from './gradient-picker/control';
2827
export { default as __experimentalGradientPickerPanel } from './gradient-picker/panel';

packages/block-editor/src/style.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,5 @@
5454
// Styles for components that are used outside of the editing canvas go here:
5555

5656
@import "./components/block-toolbar/style.scss";
57-
@import "./components/editor-skeleton/style.scss";
5857
@import "./components/inserter/style.scss";
5958

packages/e2e-tests/specs/editor/various/adding-blocks.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe( 'adding blocks', () => {
4242

4343
// Click below editor to focus last field (block appender)
4444
await clickAtBottom(
45-
await page.$( '.block-editor-editor-skeleton__content' )
45+
await page.$( '.interface-interface-skeleton__content' )
4646
);
4747
expect( await page.$( '[data-type="core/paragraph"]' ) ).not.toBeNull();
4848
await page.keyboard.type( 'Paragraph block' );

packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe( 'Order of block keyboard navigation', () => {
149149
await page.evaluate( () => {
150150
document.querySelector( '.edit-post-visual-editor' ).focus();
151151
document
152-
.querySelector( '.block-editor-editor-skeleton__sidebar' )
152+
.querySelector( '.interface-interface-skeleton__sidebar' )
153153
.focus();
154154
} );
155155

packages/edit-post/src/components/layout/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import {
1515
EditorKeyboardShortcutsRegister,
1616
} from '@wordpress/editor';
1717
import { useSelect, useDispatch } from '@wordpress/data';
18-
import {
19-
BlockBreadcrumb,
20-
__experimentalEditorSkeleton as EditorSkeleton,
21-
} from '@wordpress/block-editor';
18+
import { BlockBreadcrumb } from '@wordpress/block-editor';
2219
import {
2320
Button,
2421
ScrollLock,
@@ -28,7 +25,11 @@ import {
2825
import { useViewportMatch } from '@wordpress/compose';
2926
import { PluginArea } from '@wordpress/plugins';
3027
import { __ } from '@wordpress/i18n';
31-
import { ComplementaryArea, FullscreenMode } from '@wordpress/interface';
28+
import {
29+
ComplementaryArea,
30+
FullscreenMode,
31+
InterfaceSkeleton,
32+
} from '@wordpress/interface';
3233

3334
/**
3435
* Internal dependencies
@@ -121,7 +122,7 @@ function Layout() {
121122
<EditPostKeyboardShortcuts />
122123
<EditorKeyboardShortcutsRegister />
123124
<FocusReturnProvider>
124-
<EditorSkeleton
125+
<InterfaceSkeleton
125126
className={ className }
126127
header={ <Header /> }
127128
sidebar={
@@ -175,7 +176,7 @@ function Layout() {
175176
</div>
176177
)
177178
}
178-
publish={
179+
actions={
179180
publishSidebarOpened ? (
180181
<PostPublishPanel
181182
onClose={ closePublishSidebar }

packages/edit-post/src/components/layout/style.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
}
5858
}
5959

60-
.block-editor-editor-skeleton__sidebar > div {
60+
.interface-interface-skeleton__sidebar > div {
6161
height: 100%;
6262
}
6363

@@ -82,10 +82,10 @@
8282
display: flex;
8383
justify-content: center;
8484

85-
.block-editor-editor-skeleton__publish:focus &,
86-
.block-editor-editor-skeleton__publish:focus-within &,
87-
.block-editor-editor-skeleton__sidebar:focus &,
88-
.block-editor-editor-skeleton__sidebar:focus-within & {
85+
.interface-interface-skeleton__actions:focus &,
86+
.interface-interface-skeleton__actions:focus-within &,
87+
.interface-interface-skeleton__actions:focus &,
88+
.interface-interface-skeleton__actions:focus-within & {
8989
top: auto;
9090
bottom: 0;
9191
}
@@ -106,7 +106,7 @@
106106
}
107107
}
108108

109-
.edit-post-layout .block-editor-editor-skeleton__content {
109+
.edit-post-layout .interface-interface-skeleton__content {
110110
background-color: $light-gray-700;
111111
}
112112

packages/edit-post/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ export function initializeEditor(
113113
// Without this hack the browser scrolls the mobile toolbar off-screen.
114114
// Once supported in Safari we can replace this in favor of preventScroll.
115115
// For details see issue #18632 and PR #18686
116-
// Specifically, we scroll `block-editor-editor-skeleton__body` to enable a fixed top toolbar.
116+
// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.
117117
// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.
118118

119119
const isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;
120120
if ( isIphone ) {
121121
window.addEventListener( 'scroll', function( event ) {
122122
const editorScrollContainer = document.getElementsByClassName(
123-
'block-editor-editor-skeleton__body'
123+
'interface-interface-skeleton__body'
124124
)[ 0 ];
125125
if ( event.target === document ) {
126126
// Scroll element into view by scrolling the editor container by the same amount

packages/edit-site/src/components/editor/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ import {
1717
import { EntityProvider } from '@wordpress/core-data';
1818
import {
1919
BlockBreadcrumb,
20-
__experimentalEditorSkeleton as EditorSkeleton,
2120
__unstableEditorStyles as EditorStyles,
2221
} from '@wordpress/block-editor';
2322
import { useViewportMatch } from '@wordpress/compose';
24-
import { FullscreenMode } from '@wordpress/interface';
23+
import { FullscreenMode, InterfaceSkeleton } from '@wordpress/interface';
2524

2625
/**
2726
* Internal dependencies
@@ -75,7 +74,7 @@ function Editor( { settings: _settings } ) {
7574
>
7675
<Context.Provider value={ context }>
7776
<FocusReturnProvider>
78-
<EditorSkeleton
77+
<InterfaceSkeleton
7978
sidebar={ ! isMobile && <Sidebar /> }
8079
header={ <Header /> }
8180
content={

0 commit comments

Comments
 (0)