Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try moving hover animation from resizable frame to editor #67659

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ export default function EditSiteEditor( { isPostsList = false } ) {
) }
{ isReady && (
<Editor
as={ motion.div }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for trying things out.

I tried to hack in the browser too but .edit-site-resizable-frame__inner-content has overflow hidden so it's very tricky!

I know I mentioned it, but I hacked it by sending a prop to the resizable iframe:

119c8e5 (#65619)

I know that's not ideal as you mentioned.

whileHover={
canvas === 'view'
? {
scale: 1.005,
transition: {
duration: disableMotion ? 0 : 0.5,
ease: 'easeOut',
},
}
: {}
}
postType={ postWithTemplate ? context.postType : postType }
postId={ postWithTemplate ? context.postId : postId }
templateId={ postWithTemplate ? postId : undefined }
Expand Down
4 changes: 2 additions & 2 deletions packages/edit-site/src/components/editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.edit-site-editor__editor-interface {
opacity: 1;
transition: opacity 0.1s ease-out;
@include reduce-motion( "transition" );
// transition: opacity 0.1s ease-out;
// @include reduce-motion( "transition" );

&.is-loading {
opacity: 0;
Expand Down
14 changes: 1 addition & 13 deletions packages/edit-site/src/components/resizable-frame/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Tooltip,
__unstableMotion as motion,
} from '@wordpress/components';
import { useInstanceId, useReducedMotion } from '@wordpress/compose';
import { useInstanceId } from '@wordpress/compose';
import { __, isRTL } from '@wordpress/i18n';
import { privateApis as routerPrivateApis } from '@wordpress/router';

Expand Down Expand Up @@ -91,7 +91,6 @@ function ResizableFrame( {
const history = useHistory();
const { path, query } = useLocation();
const { canvas = 'view' } = query;
const disableMotion = useReducedMotion();
const [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );
// The width of the resizable frame when a new resize gesture starts.
const [ startingWidth, setStartingWidth ] = useState();
Expand Down Expand Up @@ -244,17 +243,6 @@ function ResizableFrame( {
setFrameSize( { width: '100%', height: '100%' } );
}
} }
whileHover={
canvas === 'view'
? {
scale: 1.005,
transition: {
duration: disableMotion ? 0 : 0.5,
ease: 'easeOut',
},
}
: {}
}
transition={ FRAME_TRANSITION }
size={ frameSize }
enable={ {
Expand Down
Loading