@@ -1,393 +1,19 @@
1module Framer.Motion
1module Framer.Motion
29− , TargetAndTransition
66 , withMotion
3 , withMotion
68− , animateSharedLayout
69− , AnimateSharedLayoutProps
70− , AnimateSharedLayoutType
81− , AnimatePresenceProps
83 , animatePresence
4 , animatePresence
84− , svg
5+ , animateSharedLayout
85− , path
6+ , module Framer.Motion.Types
86− , rect
7+ , module Framer.Motion.MotionComponent
89−import Prelude
10+import Prelude hiding (div, map, sub)
90−import Data.Nullable (Nullable)
11+import Framer.Motion.Types (class EffectFnMaker, Animate, AnimatePresenceProps, AnimateSharedLayoutProps, AnimateSharedLayoutType(..), AnimationControls, BoundingBox2D, Drag, DragConstraints, DragElastic, DragMomentum, DragPropagation, EventInfo, Exit, Infinity, Initial, Layout, LayoutId, LayoutTransition, MakeVariantLabel(..), MotionProps, MotionPropsF, OnDrag, OnDragEnd, OnDragStart, OnHoverEnd, OnHoverStart, OnTap, OnTapCancel, OnTapEnd, OnTapStart, PanInfo, Point2D, TapInfo, Target(..), TargetAndTransition, Transition, VariantLabel(..), Variants, WhileHover, WhileTap, animate, boundingBox2D, callback, crossfade, customProp, drag, dragConstraints, dragElastic, dragMomentum, dragPropagation, exit, infinity, initial, layout, layoutId, makeVariantLabels, onDrag, onDragEnd, onDragStart, onHoverEnd, onHoverStart, onTap, onTapCancel, onTapEnd, onTapStart, prop, switch, toEffectFn, transition, variants, variantsFromObject, whileHover, whileTap)
91−import Data.Symbol (class IsSymbol, SProxy, reflectSymbol)
92−import Effect (Effect)
93−import Effect.Uncurried (EffectFn1, EffectFn2, mkEffectFn1, mkEffectFn2)
94−import Foreign (Foreign, unsafeToForeign)
95−import Foreign.Object (Object)
96−import Heterogeneous.Mapping (class HMapWithIndex, class MappingWithIndex, hmapWithIndex)
97−import Literals.Undefined (Undefined)
98import Prim.Row (class Nub, class Union)
12import Prim.Row (class Nub, class Union)
99−import React.Basic (JSX, ReactComponent)
13+import React.Basic (ReactComponent)
100−import React.Basic.DOM (CSS, Props_button, Props_div, Props_h1, Props_span, css)
101−import React.Basic.DOM.Internal (SharedSVGProps)
102−import React.Basic.DOM.SVG (Props_svg, Props_rect, Props_path)
103−import React.Basic.Events (EventHandler)
104−import React.Basic.Hooks (Ref)
105import Record (disjointUnion)
14import Record (disjointUnion)
106−import Type.Row (type (+))
107−import Unsafe.Coerce (unsafeCoerce)
108import Untagged.Castable (class Castable, cast)
15import Untagged.Castable (class Castable, cast)
109−import Untagged.Union (type (|+|))
16+import Framer.Motion.MotionComponent (_data, abbr, address, area, article, aside, audio, b, base, bdi, bdo, blockquote, body, br, button, canvas, caption, circle, cite, clipPath, code, col, colgroup, custom, datalist, dd, defs, del, desc, details, dfn, dialog, div, dl, dt, ellipse, em, embed, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feDiffuseLighting, feDisplacementMap, feDistantLight, feDropShadow, feFlood, feFuncA, feFuncB, feFuncG, feFuncR, feGaussianBlur, feImage, feMerge, feMergeNode, feMorphology, feOffset, fePointLight, feSpecularLighting, feSpotLight, feTile, feTurbulence, fieldset, figcaption, figure, filter, footer, foreignObject, form, g, h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, i, iframe, image, img, input, ins, kbd, keygen, label, legend, li, line, linearGradient, link, main, map, mark, marker, mask, menu, menuitem, meta, metadata, meter, motionComponentImpl, nav, noscript, object, ol, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, pre, progress, q, radialGradient, rect, rp, rt, ruby, s, samp, script, section, select, small, source, span, stop, strong, style, sub, summary, sup, svg, svgAnimate, svgSwitch, symbol, table, tbody, td, text, textPath, textarea, tfoot, th, thead, time, title, tr, track, tspan, u, ul, use, var, video, view, wbr)
110−import Web.DOM (Node)
111−import Web.Event.Internal.Types (Event)
112−import Web.UIEvent.MouseEvent (MouseEvent)
113−import Yoga.Block.Internal (Id)
115−foreign import divImpl ∷ ∀ a. ReactComponent { | a }
117−foreign import spanImpl ∷ ∀ a. ReactComponent { | a }
119−foreign import buttonImpl ∷ ∀ a. ReactComponent { | a }
121−foreign import h1Impl ∷ ∀ a. ReactComponent { | a }
123−foreign import svgImpl ∷ ∀ a. ReactComponent { | a }
125−foreign import pathImpl ∷ ∀ a. ReactComponent { | a }
127−foreign import rectImpl ∷ ∀ a. ReactComponent { | a }
132−newtype VariantLabel = VariantLabel String
138− CSS |+| VariantLabel |+| Array VariantLabel |+| Undefined
140−foreign import data AnimationControls ∷ Type
142−prop ∷ ∀ a b. Castable a b => a -> b
148− |+| Array VariantLabel
149− |+| AnimationControls
153− Boolean |+| CSS |+| VariantLabel |+| Array VariantLabel |+| Undefined
156− Boolean |+| Undefined
161−type LayoutTransition =
162− Boolean |+| Undefined
165− Boolean |+| String |+| Undefined
168− Boolean |+| Undefined
170−dragMomentum ∷ ∀ c. Castable c DragMomentum => c -> DragMomentum
173−type DragConstraints =
174− Ref (Nullable Node) |+| BoundingBox2D |+| Undefined
177− Boolean |+| Number |+| Undefined
179−dragElastic ∷ ∀ c. Castable c DragElastic => c -> DragElastic
183− { left ∷ Int |+| Number |+| Undefined
184− , right ∷ Int |+| Number |+| Undefined
185− , top ∷ Int |+| Number |+| Undefined
186− , bottom ∷ Int |+| Number |+| Undefined
189−boundingBox2D ∷ ∀ c. Castable c BoundingBox2D => c -> BoundingBox2D
193− { x ∷ Number, y ∷ Number }
196− { point ∷ Point2D, delta ∷ Point2D, offset ∷ Point2D, velocity ∷ Point2D }
199− (EffectFn2 Event PanInfo Unit |+| Undefined)
202− (EffectFn2 Event PanInfo Unit |+| Undefined)
205− (EffectFn2 Event PanInfo Unit |+| Undefined)
208− TargetAndTransition |+| String |+| Undefined
211− (EffectFn2 Event TapInfo Unit |+| Undefined)
214− (EffectFn2 Event TapInfo Unit |+| Undefined)
217− (EffectFn2 Event TapInfo Unit |+| Undefined)
220− (EffectFn2 Event TapInfo Unit |+| Undefined)
222−onTapStart ∷ (Event -> TapInfo -> Effect Unit) -> OnTapStart
223−onTapStart = cast <<< toEffectFn
225−onTapEnd ∷ (Event -> TapInfo -> Effect Unit) -> OnTapEnd
226−onTapEnd = cast <<< toEffectFn
228−onTap ∷ (Event -> TapInfo -> Effect Unit) -> OnTap
229−onTap fn2 = cast (mkEffectFn2 fn2)
231−onTapCancel ∷ (Event -> TapInfo -> Effect Unit) -> OnTap
232−onTapCancel fn2 = cast (mkEffectFn2 fn2)
235− { point ∷ { x ∷ Number, y ∷ Number }
239− (EffectFn2 MouseEvent EventInfo Unit |+| Undefined)
242− (EffectFn2 MouseEvent EventInfo Unit |+| Undefined)
245− (EffectFn2 MouseEvent EventInfo Unit |+| Undefined)
247−onHoverStart ∷ (MouseEvent -> EventInfo -> Effect Unit) -> OnHoverStart
248−onHoverStart = cast <<< toEffectFn
250−onHoverEnd ∷ (MouseEvent -> EventInfo -> Effect Unit) -> OnHoverEnd
251−onHoverEnd = cast <<< toEffectFn
253−whileHover ∷ ∀ c. Castable c WhileHover => c -> WhileHover
257− { x ∷ Number, y ∷ Number }
259−-- Can contain "transition" and "transitionEnd"
260−type TargetAndTransition =
263−type DragPropagation =
264− Boolean |+| Undefined
266−whileTap ∷ ∀ c. Castable c WhileTap => c -> WhileTap
269−class EffectFnMaker fn effectFn | fn -> effectFn where
270− toEffectFn ∷ fn -> effectFn
272−instance callbackableEffectFn2 ∷ EffectFnMaker (a -> b -> Effect c) (EffectFn2 a b c) where
273− toEffectFn = mkEffectFn2
275−instance callbackableEffectFn1 ∷ EffectFnMaker (a -> Effect b) (EffectFn1 a b) where
276− toEffectFn = mkEffectFn1
278−callback ∷ ∀ a c f. Castable c a => EffectFnMaker f c => f -> a
279−callback = cast <<< toEffectFn
281−onDragStart ∷ (Event -> PanInfo -> Effect Unit) -> OnDragStart
282−onDragStart = cast <<< toEffectFn
284−onDragEnd ∷ (Event -> PanInfo -> Effect Unit) -> OnDragEnd
285−onDragEnd = cast <<< toEffectFn
287−onDrag ∷ (Event -> PanInfo -> Effect Unit) -> OnDrag
288−onDrag fn2 = cast (mkEffectFn2 fn2)
290−customProp ∷ ∀ a. a -> Foreign
291−customProp = unsafeToForeign
294− String |+| Undefined
296−layoutId ∷ ∀ a. Castable a LayoutId => a -> LayoutId
299−type MotionPropsF f r =
300− ( initial ∷ f Initial
301− , animate ∷ f Animate
302− , custom ∷ f Foreign
304− , dragMomentum ∷ f DragMomentum
305− , dragElastic ∷ f DragElastic
306− , onDragStart ∷ f OnDragStart
308− , onDragEnd ∷ f OnDragEnd
309− , dragConstraints ∷ f DragConstraints
310− , dragPropagation ∷ f DragPropagation
311− , variants ∷ f Variants
312− , transition ∷ f Transition
314− , layoutId ∷ f LayoutId
315− , whileTap ∷ f WhileTap
317− , onTapStart ∷ f OnTapStart
318− , onTapEnd ∷ f OnTapEnd
319− , onTapCancel ∷ f OnTapCancel
320− , whileHover ∷ f WhileHover
321− , onHoverStart ∷ f OnHoverStart
322− , onHoverEnd ∷ f OnHoverEnd
330−animate ∷ ∀ a. Castable a Animate => a -> Animate
333−initial ∷ ∀ a. Castable a Initial => a -> Initial
336−transition ∷ ∀ r. { | r } -> Transition
337−transition = cast <<< css
339−drag ∷ ∀ a. Castable a Drag => a -> Drag
342−dragConstraints ∷ ∀ a. Castable a BoundingBox2D => a -> DragConstraints
343−dragConstraints x = cast ((cast x) ∷ BoundingBox2D)
345−dragPropagation ∷ ∀ a. Castable a DragPropagation => a -> DragPropagation
346−dragPropagation = cast
348−exit ∷ ∀ a. Castable a Exit => a -> Exit
351−variants ∷ ∀ r. { | r } -> Variants
352−variants = cast <<< css
354−variantsFromObject ∷ ∀ o. Object o -> Variants
355−variantsFromObject = cast <<< (unsafeCoerce ∷ _ -> CSS)
357−layout ∷ ∀ a. Castable a Layout => a -> Layout
360−data MakeVariantLabel
363−instance makeVariantLabels' ∷
365− MappingWithIndex MakeVariantLabel (SProxy sym) a VariantLabel where
366− mappingWithIndex MakeVariantLabel prop' _ = VariantLabel (reflectSymbol prop')
368−makeVariantLabels ∷ ∀ a b. HMapWithIndex MakeVariantLabel a b => a -> b
369−makeVariantLabels = hmapWithIndex MakeVariantLabel
371−div ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + Props_div) => ReactComponent { | attrs }
374−span ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + Props_span) => ReactComponent { | attrs }
377−button ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + Props_button) => ReactComponent { | attrs }
380−svg ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + (SharedSVGProps Props_svg)) => ReactComponent { | attrs }
383−path ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + (SharedSVGProps Props_path)) => ReactComponent { | attrs }
386−rect ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + (SharedSVGProps Props_rect)) => ReactComponent { | attrs }
389−h1 ∷ ∀ attrs attrs_. Union attrs attrs_ (MotionProps + Props_h1) => ReactComponent { | attrs }
392withMotion ∷
18withMotion ∷
393 ∀ result baseProps motionSubset.
19 ∀ result baseProps motionSubset.
@@ -399,177 +25,12 @@ motion ∷
399 Union baseProps (MotionProps ()) result => Nub result result => Castable motionSubset { | MotionProps () } => motionSubset -> Record baseProps -> Record result
25 Union baseProps (MotionProps ()) result => Nub result result => Castable motionSubset { | MotionProps () } => motionSubset -> Record baseProps -> Record result
400motion = flip withMotion
26motion = flip withMotion
402−infixr 7 withMotion as >>
404−foreign import data Infinity ∷ Type
406−foreign import infinity ∷ Infinity
408−foreign import custom ∷
410− ReactComponent { | old } ->
411− Effect (ReactComponent { | MotionProps old })
413−type AnimatePresenceProps =
416− , exitBeforeEnter ∷ Boolean
417− , onExitComplete ∷ Effect Unit
418− , children ∷ Array JSX
421foreign import animatePresence ∷
28foreign import animatePresence ∷
422 ∀ attrs attrs_.
29 ∀ attrs attrs_.
423 Union attrs attrs_ AnimatePresenceProps =>
30 Union attrs attrs_ AnimatePresenceProps =>
424 ReactComponent { | attrs }
31 ReactComponent { | attrs }
426−type AnimateSharedLayoutProps =
427− ( type ∷ AnimateSharedLayoutType
428− , children ∷ Array JSX
431−newtype AnimateSharedLayoutType = AnimateSharedLayoutType String
433−switch ∷ AnimateSharedLayoutType
434−switch = AnimateSharedLayoutType "switch"
436−crossfade ∷ AnimateSharedLayoutType
437−crossfade = AnimateSharedLayoutType "crossfade"
439foreign import animateSharedLayout ∷
33foreign import animateSharedLayout ∷
440 ∀ attrs attrs_.
34 ∀ attrs attrs_.
441 Union attrs attrs_ AnimateSharedLayoutProps =>
35 Union attrs attrs_ AnimateSharedLayoutProps =>
442 ReactComponent { | attrs }
36 ReactComponent { | attrs }
444−type Props_div_no_key =
445− ( _aria ∷ Object String
446− , _data ∷ Object String
448− , acceptCharset ∷ String
449− , accessKey ∷ String
450− , allowFullScreen ∷ Boolean
451− , allowTransparency ∷ Boolean
452− , autoFocus ∷ Boolean
453− , autoPlay ∷ Boolean
455− , cellPadding ∷ String
456− , cellSpacing ∷ String
458− , children ∷ Array JSX
460− , className ∷ String
462− , contentEditable ∷ Boolean
463− , contextMenu ∷ String
464− , crossOrigin ∷ String
465− , dangerouslySetInnerHTML ∷ { __html ∷ String }
469− , draggable ∷ Boolean
471− , formAction ∷ String
472− , formEncType ∷ String
473− , formMethod ∷ String
474− , formNoValidate ∷ Boolean
475− , formTarget ∷ String
476− , frameBorder ∷ String
480− , httpEquiv ∷ String
484− , inputMode ∷ String
489− , itemScope ∷ Boolean
491− , keyParams ∷ String
494− , marginHeight ∷ String
495− , marginWidth ∷ String
497− , mediaGroup ∷ String
499− , noValidate ∷ Boolean
500− , onAnimationEnd ∷ EventHandler
501− , onAnimationIteration ∷ EventHandler
502− , onAnimationStart ∷ EventHandler
503− , onBlur ∷ EventHandler
504− , onClick ∷ EventHandler
505− , onCompositionEnd ∷ EventHandler
506− , onCompositionStart ∷ EventHandler
507− , onCompositionUpdate ∷ EventHandler
508− , onContextMenu ∷ EventHandler
509− , onCopy ∷ EventHandler
510− , onCut ∷ EventHandler
511− , onDoubleClick ∷ EventHandler
512− , onDrag ∷ EventHandler
513− , onDragEnd ∷ EventHandler
514− , onDragEnter ∷ EventHandler
515− , onDragExit ∷ EventHandler
516− , onDragLeave ∷ EventHandler
517− , onDragOver ∷ EventHandler
518− , onDragStart ∷ EventHandler
519− , onDrop ∷ EventHandler
520− , onFocus ∷ EventHandler
521− , onGotPointerCapture ∷ EventHandler
522− , onInvalid ∷ EventHandler
523− , onKeyDown ∷ EventHandler
524− , onKeyPress ∷ EventHandler
525− , onKeyUp ∷ EventHandler
526− , onLostPointerCapture ∷ EventHandler
527− , onMouseDown ∷ EventHandler
528− , onMouseEnter ∷ EventHandler
529− , onMouseLeave ∷ EventHandler
530− , onMouseMove ∷ EventHandler
531− , onMouseOut ∷ EventHandler
532− , onMouseOver ∷ EventHandler
533− , onMouseUp ∷ EventHandler
534− , onPaste ∷ EventHandler
535− , onPointerCancel ∷ EventHandler
536− , onPointerDown ∷ EventHandler
537− , onPointerEnter ∷ EventHandler
538− , onPointerLeave ∷ EventHandler
539− , onPointerMove ∷ EventHandler
540− , onPointerOut ∷ EventHandler
541− , onPointerOver ∷ EventHandler
542− , onPointerUp ∷ EventHandler
543− , onSelect ∷ EventHandler
544− , onSubmit ∷ EventHandler
545− , onTouchCancel ∷ EventHandler
546− , onTouchEnd ∷ EventHandler
547− , onTouchMove ∷ EventHandler
548− , onTouchStart ∷ EventHandler
549− , onTransitionEnd ∷ EventHandler
550− , onWheel ∷ EventHandler
553− , radioGroup ∷ String
554− , readOnly ∷ Boolean
555− , ref ∷ Ref (Nullable Node)
560− , seamless ∷ Boolean
562− , spellCheck ∷ Boolean
567− , suppressContentEditableWarning ∷ Boolean
571− , unselectable ∷ Boolean