From bd547d434936127f955dcb5339d05740eff23dd3 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 5 Feb 2020 20:14:43 +0600 Subject: [PATCH 01/12] EditorRegions: Move to editor package --- .../{edit-post => editor}/src/components/editor-regions/index.js | 0 .../src/components/editor-regions/style.scss | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename packages/{edit-post => editor}/src/components/editor-regions/index.js (100%) rename packages/{edit-post => editor}/src/components/editor-regions/style.scss (100%) diff --git a/packages/edit-post/src/components/editor-regions/index.js b/packages/editor/src/components/editor-regions/index.js similarity index 100% rename from packages/edit-post/src/components/editor-regions/index.js rename to packages/editor/src/components/editor-regions/index.js diff --git a/packages/edit-post/src/components/editor-regions/style.scss b/packages/editor/src/components/editor-regions/style.scss similarity index 100% rename from packages/edit-post/src/components/editor-regions/style.scss rename to packages/editor/src/components/editor-regions/style.scss From 3410c14708c4316f9ebf1910a33f35e88778ffc3 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 5 Feb 2020 20:19:59 +0600 Subject: [PATCH 02/12] Move style import --- packages/edit-post/src/style.scss | 1 - packages/editor/src/style.scss | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-post/src/style.scss b/packages/edit-post/src/style.scss index 43b69c59da22cc..babb793d4ac516 100644 --- a/packages/edit-post/src/style.scss +++ b/packages/edit-post/src/style.scss @@ -1,6 +1,5 @@ $footer-height: $icon-button-size-small; -@import "./components/editor-regions/style.scss"; @import "./components/fullscreen-mode/style.scss"; @import "./components/header/style.scss"; @import "./components/header/fullscreen-mode-close/style.scss"; diff --git a/packages/editor/src/style.scss b/packages/editor/src/style.scss index 83a75edd9013ac..143895813e7289 100644 --- a/packages/editor/src/style.scss +++ b/packages/editor/src/style.scss @@ -1,6 +1,7 @@ @import "./components/autocompleters/style.scss"; @import "./components/document-outline/style.scss"; @import "./components/editor-notices/style.scss"; +@import "./components/editor-regions/style.scss"; @import "./components/entities-saved-states/style.scss"; @import "./components/error-boundary/style.scss"; @import "./components/page-attributes/style.scss"; From ee0ec0825238c03a82f54af224a7eef509d77316 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 5 Feb 2020 20:20:55 +0600 Subject: [PATCH 03/12] Update EditorRegions import --- packages/edit-post/src/components/layout/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index f09141b9a89055..f95b1fd4781b09 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -13,6 +13,7 @@ import { EditorNotices, PostPublishPanel, EditorKeyboardShortcutsRegister, + EditorRegions, } from '@wordpress/editor'; import { useSelect, useDispatch } from '@wordpress/data'; import { @@ -39,7 +40,6 @@ import EditPostKeyboardShortcuts from '../keyboard-shortcuts'; import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal'; import ManageBlocksModal from '../manage-blocks-modal'; import OptionsModal from '../options-modal'; -import EditorRegions from '../editor-regions'; import FullscreenMode from '../fullscreen-mode'; import BrowserURL from '../browser-url'; import Header from '../header'; From 384aec47cc72b34a775b44b99b2a110ea326ac6d Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 5 Feb 2020 20:22:44 +0600 Subject: [PATCH 04/12] Export EditorRegions from editor package --- packages/editor/src/components/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/editor/src/components/index.js b/packages/editor/src/components/index.js index 377a2142987c5b..c7834bb3c2745d 100644 --- a/packages/editor/src/components/index.js +++ b/packages/editor/src/components/index.js @@ -14,6 +14,7 @@ export { default as EditorKeyboardShortcutsRegister } from './global-keyboard-sh export { default as EditorHistoryRedo } from './editor-history/redo'; export { default as EditorHistoryUndo } from './editor-history/undo'; export { default as EditorNotices } from './editor-notices'; +export { default as EditorRegions } from './editor-regions'; export { default as EntitiesSavedStates } from './entities-saved-states'; export { default as ErrorBoundary } from './error-boundary'; export { default as LocalAutosaveMonitor } from './local-autosave-monitor'; From eeac5422166738d4ea3222f6a1ea1d4195e1b330 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 5 Feb 2020 20:27:49 +0600 Subject: [PATCH 05/12] s/edit-post-editor-regions/components-editor-regions/g --- packages/base-styles/_z-index.scss | 8 +++--- .../editor/various/adding-blocks.test.js | 2 +- .../various/keyboard-navigable-blocks.test.js | 2 +- packages/edit-post/src/index.js | 4 +-- .../src/components/editor-regions/style.scss | 28 +++++++++---------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss index f28bf9c498bbeb..02d24d4981cd7d 100644 --- a/packages/base-styles/_z-index.scss +++ b/packages/base-styles/_z-index.scss @@ -24,7 +24,7 @@ $z-layers: ( ".block-library-gallery-item__inline-menu": 20, ".block-editor-url-input__suggestions": 30, ".edit-post-layout__footer": 30, - ".edit-post-editor-regions__header": 30, + ".components-editor-regions__header": 30, ".edit-site-header": 62, ".edit-widgets-header": 30, ".block-library-button__inline-link .block-editor-url-input__suggestions": 6, // URL suggestions for button block above sibling inserter @@ -64,7 +64,7 @@ $z-layers: ( // Show sidebar above wp-admin navigation bar for mobile viewports: // #wpadminbar { z-index: 99999 } - ".edit-post-editor-regions__sidebar": 100000, + ".components-editor-regions__sidebar": 100000, ".edit-site-sidebar": 100000, ".edit-widgets-sidebar": 100000, ".edit-post-layout .edit-post-post-publish-panel": 100001, @@ -74,7 +74,7 @@ $z-layers: ( // Show sidebar in greater than small viewports above editor related elements // but bellow #adminmenuback { z-index: 100 } - ".edit-post-editor-regions__sidebar {greater than small}": 90, + ".components-editor-regions__sidebar {greater than small}": 90, ".edit-site-sidebar {greater than small}": 90, ".edit-widgets-sidebar {greater than small}": 90, @@ -108,7 +108,7 @@ $z-layers: ( ".components-autocomplete__results": 1000000, ".skip-to-selected-block": 100000, - ".edit-post-editor-regions__publish": 100000, + ".components-editor-regions__publish": 100000, // Show NUX tips above popovers, wp-admin menus, submenus, and sidebar: ".nux-dot-tip": 1000001, diff --git a/packages/e2e-tests/specs/editor/various/adding-blocks.test.js b/packages/e2e-tests/specs/editor/various/adding-blocks.test.js index 2434e541990914..4474b1aed0a99e 100644 --- a/packages/e2e-tests/specs/editor/various/adding-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/adding-blocks.test.js @@ -42,7 +42,7 @@ describe( 'adding blocks', () => { // Click below editor to focus last field (block appender) await clickAtBottom( - await page.$( '.edit-post-editor-regions__content' ) + await page.$( '.components-editor-regions__content' ) ); expect( await page.$( '[data-type="core/paragraph"]' ) ).not.toBeNull(); await page.keyboard.type( 'Paragraph block' ); diff --git a/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js b/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js index a32474aad3b5ab..f4e80014a29ad6 100644 --- a/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js @@ -152,7 +152,7 @@ describe( 'Order of block keyboard navigation', () => { await page.evaluate( () => { document.querySelector( '.edit-post-visual-editor' ).focus(); document - .querySelector( '.edit-post-editor-regions__sidebar' ) + .querySelector( '.components-editor-regions__sidebar' ) .focus(); } ); diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 1f10cb7a36ba6d..35f58ac7066a10 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -113,14 +113,14 @@ export function initializeEditor( // Without this hack the browser scrolls the mobile toolbar off-screen. // Once supported in Safari we can replace this in favor of preventScroll. // For details see issue #18632 and PR #18686 - // Specifically, we scroll `edit-post-editor-regions__body` to enable a fixed top toolbar. + // Specifically, we scroll `components-editor-regions__body` to enable a fixed top toolbar. // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar. const isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1; if ( isIphone ) { window.addEventListener( 'scroll', function( event ) { const editorScrollContainer = document.getElementsByClassName( - 'edit-post-editor-regions__body' + 'components-editor-regions__body' )[ 0 ]; if ( event.target === document ) { // Scroll element into view by scrolling the editor container by the same amount diff --git a/packages/editor/src/components/editor-regions/style.scss b/packages/editor/src/components/editor-regions/style.scss index 671b782901fe59..39d8977d48b9c2 100644 --- a/packages/editor/src/components/editor-regions/style.scss +++ b/packages/editor/src/components/editor-regions/style.scss @@ -10,7 +10,7 @@ html { } } -.edit-post-editor-regions { +.components-editor-regions { display: flex; flex-direction: column; height: auto; @@ -33,9 +33,9 @@ html { } } -@include editor-left(".edit-post-editor-regions"); +@include editor-left(".components-editor-regions"); -.edit-post-editor-regions__body { +.components-editor-regions__body { flex-grow: 1; display: flex; @@ -57,7 +57,7 @@ html { overscroll-behavior-y: none; } -.edit-post-editor-regions__content { +.components-editor-regions__content { flex-grow: 1; // Treat as flex container to allow children to grow to occupy full @@ -73,12 +73,12 @@ html { } } -.edit-post-editor-regions__sidebar { +.components-editor-regions__sidebar { display: none; @include break-medium() { display: block; - z-index: z-index(".edit-post-editor-regions__sidebar"); + z-index: z-index(".components-editor-regions__sidebar"); position: fixed !important; // Need to override the default relative positionning top: -9999em; bottom: auto; @@ -93,12 +93,12 @@ html { } } -.is-sidebar-opened .edit-post-editor-regions__sidebar { +.is-sidebar-opened .components-editor-regions__sidebar { display: block; width: auto; // Keep the sidebar width flexible. flex-shrink: 0; position: absolute; - z-index: z-index(".edit-post-editor-regions__sidebar"); + z-index: z-index(".components-editor-regions__sidebar"); top: 0; right: 0; bottom: 0; @@ -110,15 +110,15 @@ html { overflow: auto; border-left: $border-width solid $light-gray-500; position: relative !important; - z-index: z-index(".edit-post-editor-regions__sidebar {greater than small}"); + z-index: z-index(".components-editor-regions__sidebar {greater than small}"); } } -.edit-post-editor-regions__header { +.components-editor-regions__header { flex-shrink: 0; height: auto; // Keep the height flexible. border-bottom: $border-width solid $light-gray-500; - z-index: z-index(".edit-post-editor-regions__header"); + z-index: z-index(".components-editor-regions__header"); // On Mobile the header is sticky. position: sticky; @@ -131,7 +131,7 @@ html { } } -.edit-post-editor-regions__footer { +.components-editor-regions__footer { height: auto; // Keep the height flexible. flex-shrink: 0; overflow: auto; @@ -144,8 +144,8 @@ html { } } -.edit-post-editor-regions__publish { - z-index: z-index(".edit-post-editor-regions__publish"); +.components-editor-regions__publish { + z-index: z-index(".components-editor-regions__publish"); position: fixed !important; // Need to override the default relative positionning top: -9999em; bottom: auto; From d3bbbedcfcfcb29778bc5189569f2914cd59c2ba Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 5 Feb 2020 20:31:58 +0600 Subject: [PATCH 06/12] Add new class names to EditorRegions component --- .../src/components/editor-regions/index.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/editor/src/components/editor-regions/index.js b/packages/editor/src/components/editor-regions/index.js index eee9dfcfdae9d6..4eac2427051b57 100644 --- a/packages/editor/src/components/editor-regions/index.js +++ b/packages/editor/src/components/editor-regions/index.js @@ -18,10 +18,16 @@ function EditorRegions( { className, } ) { return ( -
+
{ !! header && (
) } -
+
{ !! sidebar && (
{ !! footer && (
Date: Thu, 6 Feb 2020 18:34:17 +0600 Subject: [PATCH 07/12] Move to block-editor --- .../src/components/editor-regions/index.js | 0 .../src/components/editor-regions/style.scss | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename packages/{editor => block-editor}/src/components/editor-regions/index.js (100%) rename packages/{editor => block-editor}/src/components/editor-regions/style.scss (100%) diff --git a/packages/editor/src/components/editor-regions/index.js b/packages/block-editor/src/components/editor-regions/index.js similarity index 100% rename from packages/editor/src/components/editor-regions/index.js rename to packages/block-editor/src/components/editor-regions/index.js diff --git a/packages/editor/src/components/editor-regions/style.scss b/packages/block-editor/src/components/editor-regions/style.scss similarity index 100% rename from packages/editor/src/components/editor-regions/style.scss rename to packages/block-editor/src/components/editor-regions/style.scss From 90a0657c52270437553af41feaf0035719838d43 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 6 Feb 2020 19:33:13 +0600 Subject: [PATCH 08/12] Fix exports/imports --- packages/block-editor/README.md | 4 ++++ packages/block-editor/src/components/index.js | 1 + packages/block-editor/src/style.scss | 1 + packages/edit-post/src/components/layout/index.js | 2 +- packages/editor/src/components/index.js | 1 - packages/editor/src/style.scss | 1 - 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index cc1ee80f19420c..b9694c21d15a86 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -225,6 +225,10 @@ _Returns_ Undocumented declaration. +# **EditorRegions** + +Undocumented declaration. + # **FontSizePicker** Undocumented declaration. diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index b5039d38b46496..87f7b881f3e24e 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -21,6 +21,7 @@ export { default as ButtonBlockerAppender } from './button-block-appender'; export { default as ColorPalette } from './color-palette'; export { default as ColorPaletteControl } from './color-palette/control'; export { default as ContrastChecker } from './contrast-checker'; +export { default as EditorRegions } from './editor-regions'; export { default as __experimentalGradientPicker } from './gradient-picker'; export { default as __experimentalGradientPickerControl } from './gradient-picker/control'; export { default as __experimentalGradientPickerPanel } from './gradient-picker/panel'; diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index d170399ed8af61..33a3ab115f1dc0 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -19,6 +19,7 @@ @import "./components/colors-gradients/style.scss"; @import "./components/contrast-checker/style.scss"; @import "./components/default-block-appender/style.scss"; +@import "./components/editor-regions/style.scss"; @import "./components/link-control/style.scss"; @import "./components/image-size-control/style.scss"; @import "./components/inner-blocks/style.scss"; diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index f95b1fd4781b09..84e1790330c9d8 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -13,11 +13,11 @@ import { EditorNotices, PostPublishPanel, EditorKeyboardShortcutsRegister, - EditorRegions, } from '@wordpress/editor'; import { useSelect, useDispatch } from '@wordpress/data'; import { BlockBreadcrumb, + EditorRegions, __experimentalPageTemplatePicker, __experimentalUsePageTemplatePickerVisible, } from '@wordpress/block-editor'; diff --git a/packages/editor/src/components/index.js b/packages/editor/src/components/index.js index c7834bb3c2745d..377a2142987c5b 100644 --- a/packages/editor/src/components/index.js +++ b/packages/editor/src/components/index.js @@ -14,7 +14,6 @@ export { default as EditorKeyboardShortcutsRegister } from './global-keyboard-sh export { default as EditorHistoryRedo } from './editor-history/redo'; export { default as EditorHistoryUndo } from './editor-history/undo'; export { default as EditorNotices } from './editor-notices'; -export { default as EditorRegions } from './editor-regions'; export { default as EntitiesSavedStates } from './entities-saved-states'; export { default as ErrorBoundary } from './error-boundary'; export { default as LocalAutosaveMonitor } from './local-autosave-monitor'; diff --git a/packages/editor/src/style.scss b/packages/editor/src/style.scss index 143895813e7289..83a75edd9013ac 100644 --- a/packages/editor/src/style.scss +++ b/packages/editor/src/style.scss @@ -1,7 +1,6 @@ @import "./components/autocompleters/style.scss"; @import "./components/document-outline/style.scss"; @import "./components/editor-notices/style.scss"; -@import "./components/editor-regions/style.scss"; @import "./components/entities-saved-states/style.scss"; @import "./components/error-boundary/style.scss"; @import "./components/page-attributes/style.scss"; From 827b45027ae5c5e10cddd1a414759e278767a03f Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 6 Feb 2020 19:47:16 +0600 Subject: [PATCH 09/12] s/components-editor-regions/block-editor-editor-regions/g --- packages/base-styles/_z-index.scss | 8 +++--- .../src/components/editor-regions/index.js | 14 +++++----- .../src/components/editor-regions/style.scss | 28 +++++++++---------- .../editor/various/adding-blocks.test.js | 2 +- .../various/keyboard-navigable-blocks.test.js | 2 +- packages/edit-post/src/index.js | 4 +-- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss index 02d24d4981cd7d..a30da30153c1f3 100644 --- a/packages/base-styles/_z-index.scss +++ b/packages/base-styles/_z-index.scss @@ -24,7 +24,7 @@ $z-layers: ( ".block-library-gallery-item__inline-menu": 20, ".block-editor-url-input__suggestions": 30, ".edit-post-layout__footer": 30, - ".components-editor-regions__header": 30, + ".block-editor-editor-regions__header": 30, ".edit-site-header": 62, ".edit-widgets-header": 30, ".block-library-button__inline-link .block-editor-url-input__suggestions": 6, // URL suggestions for button block above sibling inserter @@ -64,7 +64,7 @@ $z-layers: ( // Show sidebar above wp-admin navigation bar for mobile viewports: // #wpadminbar { z-index: 99999 } - ".components-editor-regions__sidebar": 100000, + ".block-editor-editor-regions__sidebar": 100000, ".edit-site-sidebar": 100000, ".edit-widgets-sidebar": 100000, ".edit-post-layout .edit-post-post-publish-panel": 100001, @@ -74,7 +74,7 @@ $z-layers: ( // Show sidebar in greater than small viewports above editor related elements // but bellow #adminmenuback { z-index: 100 } - ".components-editor-regions__sidebar {greater than small}": 90, + ".block-editor-editor-regions__sidebar {greater than small}": 90, ".edit-site-sidebar {greater than small}": 90, ".edit-widgets-sidebar {greater than small}": 90, @@ -108,7 +108,7 @@ $z-layers: ( ".components-autocomplete__results": 1000000, ".skip-to-selected-block": 100000, - ".components-editor-regions__publish": 100000, + ".block-editor-editor-regions__publish": 100000, // Show NUX tips above popovers, wp-admin menus, submenus, and sidebar: ".nux-dot-tip": 1000001, diff --git a/packages/block-editor/src/components/editor-regions/index.js b/packages/block-editor/src/components/editor-regions/index.js index 4eac2427051b57..068be1a2b31ed3 100644 --- a/packages/block-editor/src/components/editor-regions/index.js +++ b/packages/block-editor/src/components/editor-regions/index.js @@ -21,13 +21,13 @@ function EditorRegions( {
{ !! header && (
) } -
+
{ !! sidebar && (
{ !! footer && (
{ // Click below editor to focus last field (block appender) await clickAtBottom( - await page.$( '.components-editor-regions__content' ) + await page.$( '.block-editor-editor-regions__content' ) ); expect( await page.$( '[data-type="core/paragraph"]' ) ).not.toBeNull(); await page.keyboard.type( 'Paragraph block' ); diff --git a/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js b/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js index f4e80014a29ad6..b41f72a3f514f7 100644 --- a/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js @@ -152,7 +152,7 @@ describe( 'Order of block keyboard navigation', () => { await page.evaluate( () => { document.querySelector( '.edit-post-visual-editor' ).focus(); document - .querySelector( '.components-editor-regions__sidebar' ) + .querySelector( '.block-editor-editor-regions__sidebar' ) .focus(); } ); diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 35f58ac7066a10..9b27973e727fcc 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -113,14 +113,14 @@ export function initializeEditor( // Without this hack the browser scrolls the mobile toolbar off-screen. // Once supported in Safari we can replace this in favor of preventScroll. // For details see issue #18632 and PR #18686 - // Specifically, we scroll `components-editor-regions__body` to enable a fixed top toolbar. + // Specifically, we scroll `block-editor-editor-regions__body` to enable a fixed top toolbar. // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar. const isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1; if ( isIphone ) { window.addEventListener( 'scroll', function( event ) { const editorScrollContainer = document.getElementsByClassName( - 'components-editor-regions__body' + 'block-editor-editor-regions__body' )[ 0 ]; if ( event.target === document ) { // Scroll element into view by scrolling the editor container by the same amount From 953c8b04e77767c9f06d95482c738cccafb4bfed Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 6 Feb 2020 19:58:49 +0600 Subject: [PATCH 10/12] Change classnames to block-editor-editor-skeleton* --- packages/base-styles/_z-index.scss | 8 +++--- .../src/components/editor-regions/index.js | 14 +++++----- .../src/components/editor-regions/style.scss | 28 +++++++++---------- .../editor/various/adding-blocks.test.js | 2 +- .../various/keyboard-navigable-blocks.test.js | 2 +- packages/edit-post/src/index.js | 4 +-- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss index a30da30153c1f3..ea6d3694635487 100644 --- a/packages/base-styles/_z-index.scss +++ b/packages/base-styles/_z-index.scss @@ -24,7 +24,7 @@ $z-layers: ( ".block-library-gallery-item__inline-menu": 20, ".block-editor-url-input__suggestions": 30, ".edit-post-layout__footer": 30, - ".block-editor-editor-regions__header": 30, + ".block-editor-editor-skeleton__header": 30, ".edit-site-header": 62, ".edit-widgets-header": 30, ".block-library-button__inline-link .block-editor-url-input__suggestions": 6, // URL suggestions for button block above sibling inserter @@ -64,7 +64,7 @@ $z-layers: ( // Show sidebar above wp-admin navigation bar for mobile viewports: // #wpadminbar { z-index: 99999 } - ".block-editor-editor-regions__sidebar": 100000, + ".block-editor-editor-skeleton__sidebar": 100000, ".edit-site-sidebar": 100000, ".edit-widgets-sidebar": 100000, ".edit-post-layout .edit-post-post-publish-panel": 100001, @@ -74,7 +74,7 @@ $z-layers: ( // Show sidebar in greater than small viewports above editor related elements // but bellow #adminmenuback { z-index: 100 } - ".block-editor-editor-regions__sidebar {greater than small}": 90, + ".block-editor-editor-skeleton__sidebar {greater than small}": 90, ".edit-site-sidebar {greater than small}": 90, ".edit-widgets-sidebar {greater than small}": 90, @@ -108,7 +108,7 @@ $z-layers: ( ".components-autocomplete__results": 1000000, ".skip-to-selected-block": 100000, - ".block-editor-editor-regions__publish": 100000, + ".block-editor-editor-skeleton__publish": 100000, // Show NUX tips above popovers, wp-admin menus, submenus, and sidebar: ".nux-dot-tip": 1000001, diff --git a/packages/block-editor/src/components/editor-regions/index.js b/packages/block-editor/src/components/editor-regions/index.js index 068be1a2b31ed3..6f15ba62f3ded3 100644 --- a/packages/block-editor/src/components/editor-regions/index.js +++ b/packages/block-editor/src/components/editor-regions/index.js @@ -21,13 +21,13 @@ function EditorRegions( {
{ !! header && (
) } -
+
{ !! sidebar && (
{ !! footer && (
{ // Click below editor to focus last field (block appender) await clickAtBottom( - await page.$( '.block-editor-editor-regions__content' ) + await page.$( '.block-editor-editor-skeleton__content' ) ); expect( await page.$( '[data-type="core/paragraph"]' ) ).not.toBeNull(); await page.keyboard.type( 'Paragraph block' ); diff --git a/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js b/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js index b41f72a3f514f7..815528f8c0e7ba 100644 --- a/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/keyboard-navigable-blocks.test.js @@ -152,7 +152,7 @@ describe( 'Order of block keyboard navigation', () => { await page.evaluate( () => { document.querySelector( '.edit-post-visual-editor' ).focus(); document - .querySelector( '.block-editor-editor-regions__sidebar' ) + .querySelector( '.block-editor-editor-skeleton__sidebar' ) .focus(); } ); diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 9b27973e727fcc..086553ee738b61 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -113,14 +113,14 @@ export function initializeEditor( // Without this hack the browser scrolls the mobile toolbar off-screen. // Once supported in Safari we can replace this in favor of preventScroll. // For details see issue #18632 and PR #18686 - // Specifically, we scroll `block-editor-editor-regions__body` to enable a fixed top toolbar. + // Specifically, we scroll `block-editor-editor-skeleton__body` to enable a fixed top toolbar. // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar. const isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1; if ( isIphone ) { window.addEventListener( 'scroll', function( event ) { const editorScrollContainer = document.getElementsByClassName( - 'block-editor-editor-regions__body' + 'block-editor-editor-skeleton__body' )[ 0 ]; if ( event.target === document ) { // Scroll element into view by scrolling the editor container by the same amount From 810cf80e784ff310f37a0ca3077b3a613116202a Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 6 Feb 2020 20:08:52 +0600 Subject: [PATCH 11/12] Rename to EditorSkeleton --- packages/block-editor/README.md | 2 +- .../components/{editor-regions => editor-skeleton}/index.js | 4 ++-- .../components/{editor-regions => editor-skeleton}/style.scss | 0 packages/block-editor/src/components/index.js | 2 +- packages/block-editor/src/style.scss | 2 +- packages/edit-post/src/components/layout/index.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) rename packages/block-editor/src/components/{editor-regions => editor-skeleton}/index.js (96%) rename packages/block-editor/src/components/{editor-regions => editor-skeleton}/style.scss (100%) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index b9694c21d15a86..9b47a959714c55 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -225,7 +225,7 @@ _Returns_ Undocumented declaration. -# **EditorRegions** +# **EditorSkeleton** Undocumented declaration. diff --git a/packages/block-editor/src/components/editor-regions/index.js b/packages/block-editor/src/components/editor-skeleton/index.js similarity index 96% rename from packages/block-editor/src/components/editor-regions/index.js rename to packages/block-editor/src/components/editor-skeleton/index.js index 6f15ba62f3ded3..bf3084436d79d9 100644 --- a/packages/block-editor/src/components/editor-regions/index.js +++ b/packages/block-editor/src/components/editor-skeleton/index.js @@ -9,7 +9,7 @@ import classnames from 'classnames'; import { navigateRegions } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -function EditorRegions( { +function EditorSkeleton( { footer, header, sidebar, @@ -84,4 +84,4 @@ function EditorRegions( { ); } -export default navigateRegions( EditorRegions ); +export default navigateRegions( EditorSkeleton ); diff --git a/packages/block-editor/src/components/editor-regions/style.scss b/packages/block-editor/src/components/editor-skeleton/style.scss similarity index 100% rename from packages/block-editor/src/components/editor-regions/style.scss rename to packages/block-editor/src/components/editor-skeleton/style.scss diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index 87f7b881f3e24e..f750ea66b60d0d 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -21,7 +21,7 @@ export { default as ButtonBlockerAppender } from './button-block-appender'; export { default as ColorPalette } from './color-palette'; export { default as ColorPaletteControl } from './color-palette/control'; export { default as ContrastChecker } from './contrast-checker'; -export { default as EditorRegions } from './editor-regions'; +export { default as EditorSkeleton } from './editor-skeleton'; export { default as __experimentalGradientPicker } from './gradient-picker'; export { default as __experimentalGradientPickerControl } from './gradient-picker/control'; export { default as __experimentalGradientPickerPanel } from './gradient-picker/panel'; diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index 33a3ab115f1dc0..896add8aff8a09 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -19,7 +19,7 @@ @import "./components/colors-gradients/style.scss"; @import "./components/contrast-checker/style.scss"; @import "./components/default-block-appender/style.scss"; -@import "./components/editor-regions/style.scss"; +@import "./components/editor-skeleton/style.scss"; @import "./components/link-control/style.scss"; @import "./components/image-size-control/style.scss"; @import "./components/inner-blocks/style.scss"; diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 84e1790330c9d8..a7e556db1e0dec 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -17,7 +17,7 @@ import { import { useSelect, useDispatch } from '@wordpress/data'; import { BlockBreadcrumb, - EditorRegions, + EditorSkeleton, __experimentalPageTemplatePicker, __experimentalUsePageTemplatePickerVisible, } from '@wordpress/block-editor'; @@ -124,7 +124,7 @@ function Layout() { - } sidebar={ From 5df731499d71bed47776ade06f711d3c8e80e358 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 6 Feb 2020 20:25:50 +0600 Subject: [PATCH 12/12] Prefix as __experimental --- packages/block-editor/README.md | 4 ---- packages/block-editor/src/components/index.js | 2 +- packages/edit-post/src/components/layout/index.js | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 9b47a959714c55..cc1ee80f19420c 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -225,10 +225,6 @@ _Returns_ Undocumented declaration. -# **EditorSkeleton** - -Undocumented declaration. - # **FontSizePicker** Undocumented declaration. diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index f750ea66b60d0d..44ed21295f6160 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -21,7 +21,7 @@ export { default as ButtonBlockerAppender } from './button-block-appender'; export { default as ColorPalette } from './color-palette'; export { default as ColorPaletteControl } from './color-palette/control'; export { default as ContrastChecker } from './contrast-checker'; -export { default as EditorSkeleton } from './editor-skeleton'; +export { default as __experimentalEditorSkeleton } from './editor-skeleton'; export { default as __experimentalGradientPicker } from './gradient-picker'; export { default as __experimentalGradientPickerControl } from './gradient-picker/control'; export { default as __experimentalGradientPickerPanel } from './gradient-picker/panel'; diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index a7e556db1e0dec..333137ab1723a3 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -17,7 +17,7 @@ import { import { useSelect, useDispatch } from '@wordpress/data'; import { BlockBreadcrumb, - EditorSkeleton, + __experimentalEditorSkeleton as EditorSkeleton, __experimentalPageTemplatePicker, __experimentalUsePageTemplatePickerVisible, } from '@wordpress/block-editor';