From 40c6648d9e464d16f7af1d1b342bcc819b2e2401 Mon Sep 17 00:00:00 2001 From: Michael Dougall Date: Wed, 3 Jul 2019 10:44:44 +1000 Subject: [PATCH] hmm --- packages/motions/src/Move/New.tsx | 14 -------------- packages/motions/src/Move/stories.tsx | 9 --------- packages/motions/src/Scale/index.tsx | 2 +- packages/motions/src/Translate/index.tsx | 16 +++++++++------- packages/motions/src/Translate/stories.tsx | 4 ++-- packages/motions/src/index.tsx | 2 ++ 6 files changed, 14 insertions(+), 33 deletions(-) delete mode 100644 packages/motions/src/Move/New.tsx diff --git a/packages/motions/src/Move/New.tsx b/packages/motions/src/Move/New.tsx deleted file mode 100644 index ed5cbf5..0000000 --- a/packages/motions/src/Move/New.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import Translate, { TranslateProps } from '../Translate'; -import Scale, { ScaleProps } from '../Scale'; - -export default class NewMove extends React.Component { - render() { - const { children, ...props } = this.props; - return ( - - {children} - - ); - } -} diff --git a/packages/motions/src/Move/stories.tsx b/packages/motions/src/Move/stories.tsx index 843d6be..31416f6 100644 --- a/packages/motions/src/Move/stories.tsx +++ b/packages/motions/src/Move/stories.tsx @@ -2,7 +2,6 @@ import { storiesOf } from '@storybook/react'; import { createMoveExamples } from '@element-motion/dev'; import { Motion } from '@element-motion/utils'; import Move from './index'; -import NewMove from './New'; const Examples = createMoveExamples({ namePrefix: 'Move', @@ -11,11 +10,3 @@ const Examples = createMoveExamples({ const stories = storiesOf('@element-motion/motions/Move', module); Object.keys(Examples).forEach(key => stories.add(key, Examples[key])); - -const NewExamples = createMoveExamples({ - namePrefix: 'NewMove', - useDistinctEnd: false, -})(Motion, NewMove as any); - -const newStories = storiesOf('@element-motion/core/NewMove', module); -Object.keys(NewExamples).forEach(key => newStories.add(key, NewExamples[key])); diff --git a/packages/motions/src/Scale/index.tsx b/packages/motions/src/Scale/index.tsx index 05e350d..2da5459 100644 --- a/packages/motions/src/Scale/index.tsx +++ b/packages/motions/src/Scale/index.tsx @@ -119,7 +119,7 @@ const Scale: React.FC = ({ }), }); - // onFinish(); + onFinish(); }, animate: (_, onFinish, setChildProps) => { setChildProps({ diff --git a/packages/motions/src/Translate/index.tsx b/packages/motions/src/Translate/index.tsx index d3e2c19..ccb37b0 100644 --- a/packages/motions/src/Translate/index.tsx +++ b/packages/motions/src/Translate/index.tsx @@ -1,15 +1,17 @@ import * as React from 'react'; import { css, keyframes, cx } from 'emotion'; -import { dynamic } from '../../../core/src/lib/duration'; -import { recalculateElementBoundingBoxFromScroll } from '../../../core/src/lib/dom'; -import { bezierToFunc, standard } from '../../../core/src/lib/curves'; -import { combine } from '../../../core/src/lib/style'; -import { MotionProps } from '../types'; -import Collector, { +import { + Collector, CollectorChildrenProps, CollectorActions, MotionData, -} from '../../../core/src/Collector'; + bezierToFunc, + combine, + standard, + dynamic, + recalculateElementBoundingBoxFromScroll, +} from '@element-motion/utils'; +import { MotionProps } from '../types'; export interface TranslateProps extends CollectorChildrenProps, MotionProps {} diff --git a/packages/motions/src/Translate/stories.tsx b/packages/motions/src/Translate/stories.tsx index 654e7de..1fa1022 100644 --- a/packages/motions/src/Translate/stories.tsx +++ b/packages/motions/src/Translate/stories.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; import styled from 'styled-components'; import { Toggler, colors } from '@element-motion/dev'; -import Motion from '../../../core/src/Motion'; +import { Motion } from '@element-motion/utils'; import Translate from './index'; import InverseTranslate from './InverseTranslate'; @@ -17,7 +17,7 @@ const Menu = styled.div` cursor: pointer; `; -storiesOf('@element-motion/core/Translate', module) +storiesOf('@element-motion/motions/Translate', module) .add('Default', () => ( {toggler => ( diff --git a/packages/motions/src/index.tsx b/packages/motions/src/index.tsx index d6b795b..c13151c 100644 --- a/packages/motions/src/index.tsx +++ b/packages/motions/src/index.tsx @@ -12,6 +12,8 @@ export { default as Reveal } from './Reveal'; export { default as RevealReshapingContainer } from './RevealReshapingContainer'; export { default as Scale } from './Scale'; export { default as InverseScale } from './Scale/InverseScale'; +export { default as Translate } from './Translate'; +export { default as InverseTranslate } from './Translate/InverseTranslate'; export { default as Swipe } from './Swipe'; export { default as SimpleKeyframe } from './SimpleKeyframe'; export { default as SimpleTween } from './SimpleTween';