Skip to content

Commit

Permalink
Editor: Move the InterfaceSkeleton to the editor package (#62118)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: draganescu <[email protected]>
  • Loading branch information
3 people authored May 30, 2024
1 parent 9c5897f commit 097d4c6
Show file tree
Hide file tree
Showing 25 changed files with 432 additions and 450 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useReducedMotion } from '@wordpress/compose';
/**
* Internal dependencies
*/
import { store as editPostStore } from '../../../store';
import { store as editPostStore } from '../../store';

function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
const { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(
Expand Down
34 changes: 34 additions & 0 deletions packages/edit-post/src/components/back-button/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* WordPress dependencies
*/
import { privateApis as editorPrivateApis } from '@wordpress/editor';
import { __unstableMotion as motion } from '@wordpress/components';

/**
* Internal dependencies
*/
import FullscreenModeClose from './fullscreen-mode-close';
import { unlock } from '../../lock-unlock';

const { BackButton: BackButtonFill } = unlock( editorPrivateApis );

const slideX = {
hidden: { x: '-100%' },
distractionFreeInactive: { x: 0 },
hover: { x: 0, transition: { type: 'tween', delay: 0.2 } },
};

function BackButton( { initialPost } ) {
return (
<BackButtonFill>
<motion.div
variants={ slideX }
transition={ { type: 'tween', delay: 0.8 } }
>
<FullscreenModeClose showTooltip initialPost={ initialPost } />
</motion.div>
</BackButtonFill>
);
}

export default BackButton;
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@
margin-top: -($border-width);
}
}

/**
* Show icon label overrides.
*/
.show-icon-labels .editor-header {
.edit-post-fullscreen-mode-close.has-icon {
width: $header-height;
svg {
display: block;
}
&::after {
content: none;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useSelect } from '@wordpress/data';
/**
* Internal dependencies
*/
import FullscreenModeClose from '../';
import FullscreenModeClose from '../fullscreen-mode-close';

jest.mock( '@wordpress/data/src/components/use-select', () => {
// This allows us to tweak the returned value on each test.
Expand Down
53 changes: 0 additions & 53 deletions packages/edit-post/src/components/header/index.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/edit-post/src/components/header/style.scss

This file was deleted.

Loading

0 comments on commit 097d4c6

Please sign in to comment.