@hanzogui/animations-moti 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,382 @@
1
+ // @ts-nocheck - deprecated package, moti dependency intentionally not included
2
+ import { PresenceContext, ResetPresence, usePresence } from '@hanzogui/use-presence'
3
+ // we need core for hooks.usePropsTransform
4
+ import {
5
+ getSplitStyles,
6
+ hooks,
7
+ isWeb,
8
+ Text,
9
+ useComposedRefs,
10
+ useThemeWithState,
11
+ View,
12
+ type AnimationDriver,
13
+ type UniversalAnimatedNumber,
14
+ } from '@hanzogui/core'
15
+
16
+ // Helper to resolve dynamic theme values like {dynamic: {dark: "value", light: undefined}}
17
+ const resolveDynamicValue = (value: any, isDark: boolean): any => {
18
+ if (value && typeof value === 'object' && 'dynamic' in value) {
19
+ const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light
20
+ return dynamicValue
21
+ }
22
+ return value
23
+ }
24
+ import type { TransitionConfig } from 'moti'
25
+ import { useMotify } from 'moti/author'
26
+ import type { CSSProperties } from 'react'
27
+ import React, { forwardRef, useMemo, useRef } from 'react'
28
+ import type { TextStyle } from 'react-native'
29
+ import type { SharedValue } from 'react-native-reanimated'
30
+ import Animated_, {
31
+ cancelAnimation,
32
+ runOnJS,
33
+ useAnimatedReaction,
34
+ useAnimatedStyle,
35
+ useDerivedValue,
36
+ useSharedValue,
37
+ withSpring,
38
+ withTiming,
39
+ } from 'react-native-reanimated'
40
+
41
+ // fix for building with type module
42
+ // see https://github.com/evanw/esbuild/issues/2480#issuecomment-1833104754
43
+ const safeESModule = <T,>(a: T | { default: T }): T => {
44
+ const b = a as any
45
+ const out = b.__esModule || b[Symbol.toStringTag] === 'Module' ? b.default : b
46
+ // add metro support
47
+ return out || a
48
+ }
49
+
50
+ const Animated = safeESModule(Animated_)
51
+
52
+ type ReanimatedAnimatedNumber = SharedValue<number>
53
+
54
+ // this is our own custom reanimated animated component so we can allow data- attributes, className etc
55
+ // this should ultimately be merged with react-native-web-lite
56
+
57
+ function createGuiAnimatedComponent(defaultTag = 'div') {
58
+ const isText = defaultTag === 'span'
59
+
60
+ const Component = Animated.createAnimatedComponent(
61
+ forwardRef((propsIn: any, ref) => {
62
+ const { forwardedRef, animation, render = defaultTag, ...propsRest } = propsIn
63
+ const hostRef = useRef(null)
64
+ const composedRefs = useComposedRefs(forwardedRef, ref, hostRef)
65
+ const stateRef = useRef<any>(null)
66
+ if (!stateRef.current) {
67
+ stateRef.current = {
68
+ get host() {
69
+ return hostRef.current
70
+ },
71
+ }
72
+ }
73
+
74
+ const [_, state] = useThemeWithState({})
75
+
76
+ // get styles but only inline style
77
+ const result = getSplitStyles(
78
+ propsRest,
79
+ isText ? Text.staticConfig : View.staticConfig,
80
+ state?.theme,
81
+ state?.name,
82
+ {
83
+ unmounted: false,
84
+ } as any,
85
+ {
86
+ isAnimated: false,
87
+ noClass: true,
88
+ }
89
+ )
90
+
91
+ const props = result?.viewProps || {}
92
+ const Element = render
93
+ const transformedProps = hooks.usePropsTransform?.(render, props, stateRef, false)
94
+
95
+ return <Element {...transformedProps} ref={composedRefs} />
96
+ })
97
+ )
98
+ Component['acceptRenderProp'] = true
99
+ return Component
100
+ }
101
+
102
+ const AnimatedView = createGuiAnimatedComponent('div')
103
+ const AnimatedText = createGuiAnimatedComponent('span')
104
+
105
+ // const AnimatedView = styled(View, {
106
+ // disableClassName: true,
107
+ // })
108
+
109
+ // const AnimatedText = styled(Text, {
110
+ // disableClassName: true,
111
+ // })
112
+
113
+ const onlyAnimateKeys: { [key in keyof TextStyle | keyof CSSProperties]?: boolean } = {
114
+ transform: true,
115
+ opacity: true,
116
+ height: true,
117
+ width: true,
118
+ backgroundColor: true,
119
+ borderColor: true,
120
+ borderLeftColor: true,
121
+ borderRightColor: true,
122
+ borderTopColor: true,
123
+ borderBottomColor: true,
124
+ borderRadius: true,
125
+ borderTopLeftRadius: true,
126
+ borderTopRightRadius: true,
127
+ borderBottomLeftRadius: true,
128
+ borderBottomRightRadius: true,
129
+ borderLeftWidth: true,
130
+ borderRightWidth: true,
131
+ borderTopWidth: true,
132
+ borderBottomWidth: true,
133
+ color: true,
134
+ left: true,
135
+ right: true,
136
+ top: true,
137
+ bottom: true,
138
+ fontSize: true,
139
+ fontWeight: true,
140
+ lineHeight: true,
141
+ letterSpacing: true,
142
+ }
143
+
144
+ export function createAnimations<A extends Record<string, TransitionConfig>>(
145
+ animations: A
146
+ ): AnimationDriver<A> {
147
+ return {
148
+ needsCustomComponent: true,
149
+ View: isWeb ? AnimatedView : Animated.View,
150
+ Text: isWeb ? AnimatedText : Animated.Text,
151
+ // View: Animated.View,
152
+ // Text: Animated.Text,
153
+ isReactNative: true,
154
+ inputStyle: 'value',
155
+ outputStyle: 'inline',
156
+ animations,
157
+ usePresence,
158
+ ResetPresence,
159
+
160
+ useAnimatedNumber(initial): UniversalAnimatedNumber<ReanimatedAnimatedNumber> {
161
+ const sharedValue = useSharedValue(initial)
162
+
163
+ return React.useMemo(
164
+ () => ({
165
+ getInstance() {
166
+ 'worklet'
167
+ return sharedValue
168
+ },
169
+ getValue() {
170
+ 'worklet'
171
+ return sharedValue.value
172
+ },
173
+ setValue(next, config = { type: 'spring' }, onFinish) {
174
+ 'worklet'
175
+ if (config.type === 'direct') {
176
+ sharedValue.value = next
177
+ onFinish?.()
178
+ } else if (config.type === 'spring') {
179
+ sharedValue.value = withSpring(
180
+ next,
181
+ config,
182
+ onFinish
183
+ ? () => {
184
+ 'worklet'
185
+ runOnJS(onFinish)()
186
+ }
187
+ : undefined
188
+ )
189
+ } else {
190
+ sharedValue.value = withTiming(
191
+ next,
192
+ config,
193
+ onFinish
194
+ ? () => {
195
+ 'worklet'
196
+ runOnJS(onFinish)()
197
+ }
198
+ : undefined
199
+ )
200
+ }
201
+ },
202
+ stop() {
203
+ 'worklet'
204
+ cancelAnimation(sharedValue)
205
+ },
206
+ }),
207
+ [sharedValue]
208
+ )
209
+ },
210
+
211
+ useAnimatedNumberReaction({ value }, onValue) {
212
+ const instance = value.getInstance()
213
+ return useAnimatedReaction(
214
+ () => {
215
+ return instance.value
216
+ },
217
+ (next, prev) => {
218
+ if (prev !== next) {
219
+ // @nate what is the point of this hook? is this necessary?
220
+ // without runOnJS, onValue would need to be a worklet
221
+ runOnJS(onValue)(next)
222
+ }
223
+ },
224
+ // dependency array is very important here
225
+ [onValue, instance]
226
+ )
227
+ },
228
+
229
+ /**
230
+ * `getStyle` must be a worklet
231
+ */
232
+ useAnimatedNumberStyle(val, getStyle) {
233
+ const instance = val.getInstance()
234
+
235
+ // this seems wrong but it works
236
+ const derivedValue = useDerivedValue(() => {
237
+ return instance.value
238
+ // dependency array is very important here
239
+ }, [instance, getStyle])
240
+
241
+ return useAnimatedStyle(() => {
242
+ return getStyle(derivedValue.value)
243
+ // dependency array is very important here
244
+ }, [val, getStyle, derivedValue, instance])
245
+ },
246
+
247
+ useAnimations: (animationProps) => {
248
+ const { props, presence, style, componentState } = animationProps
249
+ const animationKey = Array.isArray(props.transition)
250
+ ? props.transition[0]
251
+ : props.transition
252
+
253
+ const isHydrating = componentState.unmounted === true
254
+ const disableAnimation = isHydrating || !animationKey
255
+ const presenceContext = React.useContext(PresenceContext)
256
+ const [, themeState] = useThemeWithState({})
257
+ // Check scheme first, then fall back to checking theme name for 'dark'
258
+ const isDark = themeState?.scheme === 'dark' || themeState?.name?.startsWith('dark')
259
+
260
+ // this memo is very important for performance, there's a big cost to
261
+ // updating these values every render
262
+ const { dontAnimate, motiProps } = useMemo(() => {
263
+ let animate = {}
264
+ let dontAnimate = {}
265
+
266
+ if (disableAnimation) {
267
+ // Resolve dynamic objects based on current theme
268
+ for (const key in style) {
269
+ const rawValue = style[key]
270
+ const value = resolveDynamicValue(rawValue, isDark)
271
+ if (value === undefined) continue
272
+ dontAnimate[key] = value
273
+ }
274
+ } else {
275
+ const animateOnly = props.animateOnly as string[]
276
+ for (const key in style) {
277
+ const rawValue = style[key]
278
+ // Resolve dynamic theme values (like $theme-dark)
279
+ const value = resolveDynamicValue(rawValue, isDark)
280
+ if (value === undefined) continue
281
+ if (
282
+ !onlyAnimateKeys[key] ||
283
+ value === 'auto' ||
284
+ (typeof value === 'string' && value.startsWith('calc')) ||
285
+ (animateOnly && !animateOnly.includes(key))
286
+ ) {
287
+ dontAnimate[key] = value
288
+ } else {
289
+ animate[key] = value
290
+ }
291
+ }
292
+ }
293
+
294
+ // if we don't do this moti seems to flicker a frame before applying animation
295
+ if (componentState.unmounted === 'should-enter') {
296
+ // Resolve dynamic objects based on current theme
297
+ for (const key in style) {
298
+ const rawValue = style[key]
299
+ const value = resolveDynamicValue(rawValue, isDark)
300
+ if (value === undefined) continue
301
+ dontAnimate[key] = value
302
+ }
303
+ }
304
+
305
+ const styles = animate
306
+ const isExiting = Boolean(presence?.[1])
307
+ const usePresenceValue = (presence || undefined) as any
308
+
309
+ type UseMotiProps = Parameters<typeof useMotify>[0]
310
+
311
+ // TODO moti is giving us type troubles, but this should work
312
+ let transition = isHydrating
313
+ ? { type: 'transition', duration: 0 }
314
+ : (animations[animationKey as keyof typeof animations] as any)
315
+
316
+ let hasClonedTransition = false
317
+
318
+ if (Array.isArray(props.transition)) {
319
+ const config = props.transition[1]
320
+ if (config && typeof config === 'object') {
321
+ for (const key in config) {
322
+ const val = config[key]
323
+
324
+ // performance - this seems to have (strangely) huge performance effect in uniswap
325
+ // so instead of cloning up front, we clone only when we absolutely have to
326
+ if (!hasClonedTransition) {
327
+ transition = Object.assign({}, transition)
328
+ hasClonedTransition = true
329
+ }
330
+
331
+ // referencing a pre-defined config
332
+ if (typeof val === 'string') {
333
+ transition[key] = animations[val]
334
+ } else {
335
+ transition[key] = val
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ return {
342
+ dontAnimate,
343
+ motiProps: {
344
+ animate: isExiting || componentState.unmounted === true ? {} : styles,
345
+ transition: componentState.unmounted ? { duration: 0 } : transition,
346
+ usePresenceValue,
347
+ presenceContext,
348
+ exit: isExiting ? styles : undefined,
349
+ } satisfies UseMotiProps,
350
+ }
351
+ }, [
352
+ presenceContext,
353
+ presence,
354
+ animationKey,
355
+ componentState.unmounted,
356
+ JSON.stringify(style),
357
+ presenceContext,
358
+ isDark,
359
+ ])
360
+
361
+ const moti = useMotify(motiProps)
362
+
363
+ if (
364
+ process.env.NODE_ENV === 'development' &&
365
+ props['debug'] &&
366
+ props['debug'] !== 'profile'
367
+ ) {
368
+ console.info(`useMotify(`, JSON.stringify(motiProps, null, 2) + ')', {
369
+ 'componentState.unmounted': componentState.unmounted,
370
+ animationProps,
371
+ motiProps,
372
+ moti,
373
+ style: [dontAnimate, moti.style],
374
+ })
375
+ }
376
+
377
+ return {
378
+ style: [dontAnimate, moti.style],
379
+ }
380
+ },
381
+ }
382
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import './polyfill'
2
+
3
+ export * from './createAnimations'
@@ -0,0 +1,9 @@
1
+ // for SSR
2
+ if (typeof requestAnimationFrame === 'undefined') {
3
+ globalThis['requestAnimationFrame'] = setTimeout
4
+ }
5
+
6
+ // for reanimated
7
+ if (typeof global === 'undefined') {
8
+ globalThis['global'] = globalThis
9
+ }
@@ -0,0 +1,5 @@
1
+ import { type AnimationDriver } from "@hanzogui/core";
2
+ import type { TransitionConfig } from "moti";
3
+ export declare function createAnimations<A extends Record<string, TransitionConfig>>(animations: A): AnimationDriver<A>;
4
+
5
+ //# sourceMappingURL=createAnimations.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAGA,cAQO,uBAEA;AAUP,cAAc,wBAAwB;AAwHtC,OAAO,iBAAS,iBAAiB,UAAU,eAAe,mBACxD,YAAY,IACX,gBAAgB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/createAnimations.tsx"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// @ts-nocheck - deprecated package, moti dependency intentionally not included\nimport { PresenceContext, ResetPresence, usePresence } from '@hanzogui/use-presence'\n// we need core for hooks.usePropsTransform\nimport {\n getSplitStyles,\n hooks,\n isWeb,\n Text,\n useComposedRefs,\n useThemeWithState,\n View,\n type AnimationDriver,\n type UniversalAnimatedNumber,\n} from '@hanzogui/core'\n\n// Helper to resolve dynamic theme values like {dynamic: {dark: \"value\", light: undefined}}\nconst resolveDynamicValue = (value: any, isDark: boolean): any => {\n if (value && typeof value === 'object' && 'dynamic' in value) {\n const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light\n return dynamicValue\n }\n return value\n}\nimport type { TransitionConfig } from 'moti'\nimport { useMotify } from 'moti/author'\nimport type { CSSProperties } from 'react'\nimport React, { forwardRef, useMemo, useRef } from 'react'\nimport type { TextStyle } from 'react-native'\nimport type { SharedValue } from 'react-native-reanimated'\nimport Animated_, {\n cancelAnimation,\n runOnJS,\n useAnimatedReaction,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withSpring,\n withTiming,\n} from 'react-native-reanimated'\n\n// fix for building with type module\n// see https://github.com/evanw/esbuild/issues/2480#issuecomment-1833104754\nconst safeESModule = <T,>(a: T | { default: T }): T => {\n const b = a as any\n const out = b.__esModule || b[Symbol.toStringTag] === 'Module' ? b.default : b\n // add metro support\n return out || a\n}\n\nconst Animated = safeESModule(Animated_)\n\ntype ReanimatedAnimatedNumber = SharedValue<number>\n\n// this is our own custom reanimated animated component so we can allow data- attributes, className etc\n// this should ultimately be merged with react-native-web-lite\n\nfunction createGuiAnimatedComponent(defaultTag = 'div') {\n const isText = defaultTag === 'span'\n\n const Component = Animated.createAnimatedComponent(\n forwardRef((propsIn: any, ref) => {\n const { forwardedRef, animation, render = defaultTag, ...propsRest } = propsIn\n const hostRef = useRef(null)\n const composedRefs = useComposedRefs(forwardedRef, ref, hostRef)\n const stateRef = useRef<any>(null)\n if (!stateRef.current) {\n stateRef.current = {\n get host() {\n return hostRef.current\n },\n }\n }\n\n const [_, state] = useThemeWithState({})\n\n // get styles but only inline style\n const result = getSplitStyles(\n propsRest,\n isText ? Text.staticConfig : View.staticConfig,\n state?.theme,\n state?.name,\n {\n unmounted: false,\n } as any,\n {\n isAnimated: false,\n noClass: true,\n }\n )\n\n const props = result?.viewProps || {}\n const Element = render\n const transformedProps = hooks.usePropsTransform?.(render, props, stateRef, false)\n\n return <Element {...transformedProps} ref={composedRefs} />\n })\n )\n Component['acceptRenderProp'] = true\n return Component\n}\n\nconst AnimatedView = createGuiAnimatedComponent('div')\nconst AnimatedText = createGuiAnimatedComponent('span')\n\n// const AnimatedView = styled(View, {\n// disableClassName: true,\n// })\n\n// const AnimatedText = styled(Text, {\n// disableClassName: true,\n// })\n\nconst onlyAnimateKeys: { [key in keyof TextStyle | keyof CSSProperties]?: boolean } = {\n transform: true,\n opacity: true,\n height: true,\n width: true,\n backgroundColor: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true,\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n color: true,\n left: true,\n right: true,\n top: true,\n bottom: true,\n fontSize: true,\n fontWeight: true,\n lineHeight: true,\n letterSpacing: true,\n}\n\nexport function createAnimations<A extends Record<string, TransitionConfig>>(\n animations: A\n): AnimationDriver<A> {\n return {\n needsCustomComponent: true,\n View: isWeb ? AnimatedView : Animated.View,\n Text: isWeb ? AnimatedText : Animated.Text,\n // View: Animated.View,\n // Text: Animated.Text,\n isReactNative: true,\n inputStyle: 'value',\n outputStyle: 'inline',\n animations,\n usePresence,\n ResetPresence,\n\n useAnimatedNumber(initial): UniversalAnimatedNumber<ReanimatedAnimatedNumber> {\n const sharedValue = useSharedValue(initial)\n\n return React.useMemo(\n () => ({\n getInstance() {\n 'worklet'\n return sharedValue\n },\n getValue() {\n 'worklet'\n return sharedValue.value\n },\n setValue(next, config = { type: 'spring' }, onFinish) {\n 'worklet'\n if (config.type === 'direct') {\n sharedValue.value = next\n onFinish?.()\n } else if (config.type === 'spring') {\n sharedValue.value = withSpring(\n next,\n config,\n onFinish\n ? () => {\n 'worklet'\n runOnJS(onFinish)()\n }\n : undefined\n )\n } else {\n sharedValue.value = withTiming(\n next,\n config,\n onFinish\n ? () => {\n 'worklet'\n runOnJS(onFinish)()\n }\n : undefined\n )\n }\n },\n stop() {\n 'worklet'\n cancelAnimation(sharedValue)\n },\n }),\n [sharedValue]\n )\n },\n\n useAnimatedNumberReaction({ value }, onValue) {\n const instance = value.getInstance()\n return useAnimatedReaction(\n () => {\n return instance.value\n },\n (next, prev) => {\n if (prev !== next) {\n // @nate what is the point of this hook? is this necessary?\n // without runOnJS, onValue would need to be a worklet\n runOnJS(onValue)(next)\n }\n },\n // dependency array is very important here\n [onValue, instance]\n )\n },\n\n /**\n * `getStyle` must be a worklet\n */\n useAnimatedNumberStyle(val, getStyle) {\n const instance = val.getInstance()\n\n // this seems wrong but it works\n const derivedValue = useDerivedValue(() => {\n return instance.value\n // dependency array is very important here\n }, [instance, getStyle])\n\n return useAnimatedStyle(() => {\n return getStyle(derivedValue.value)\n // dependency array is very important here\n }, [val, getStyle, derivedValue, instance])\n },\n\n useAnimations: (animationProps) => {\n const { props, presence, style, componentState } = animationProps\n const animationKey = Array.isArray(props.transition)\n ? props.transition[0]\n : props.transition\n\n const isHydrating = componentState.unmounted === true\n const disableAnimation = isHydrating || !animationKey\n const presenceContext = React.useContext(PresenceContext)\n const [, themeState] = useThemeWithState({})\n // Check scheme first, then fall back to checking theme name for 'dark'\n const isDark = themeState?.scheme === 'dark' || themeState?.name?.startsWith('dark')\n\n // this memo is very important for performance, there's a big cost to\n // updating these values every render\n const { dontAnimate, motiProps } = useMemo(() => {\n let animate = {}\n let dontAnimate = {}\n\n if (disableAnimation) {\n // Resolve dynamic objects based on current theme\n for (const key in style) {\n const rawValue = style[key]\n const value = resolveDynamicValue(rawValue, isDark)\n if (value === undefined) continue\n dontAnimate[key] = value\n }\n } else {\n const animateOnly = props.animateOnly as string[]\n for (const key in style) {\n const rawValue = style[key]\n // Resolve dynamic theme values (like $theme-dark)\n const value = resolveDynamicValue(rawValue, isDark)\n if (value === undefined) continue\n if (\n !onlyAnimateKeys[key] ||\n value === 'auto' ||\n (typeof value === 'string' && value.startsWith('calc')) ||\n (animateOnly && !animateOnly.includes(key))\n ) {\n dontAnimate[key] = value\n } else {\n animate[key] = value\n }\n }\n }\n\n // if we don't do this moti seems to flicker a frame before applying animation\n if (componentState.unmounted === 'should-enter') {\n // Resolve dynamic objects based on current theme\n for (const key in style) {\n const rawValue = style[key]\n const value = resolveDynamicValue(rawValue, isDark)\n if (value === undefined) continue\n dontAnimate[key] = value\n }\n }\n\n const styles = animate\n const isExiting = Boolean(presence?.[1])\n const usePresenceValue = (presence || undefined) as any\n\n type UseMotiProps = Parameters<typeof useMotify>[0]\n\n // TODO moti is giving us type troubles, but this should work\n let transition = isHydrating\n ? { type: 'transition', duration: 0 }\n : (animations[animationKey as keyof typeof animations] as any)\n\n let hasClonedTransition = false\n\n if (Array.isArray(props.transition)) {\n const config = props.transition[1]\n if (config && typeof config === 'object') {\n for (const key in config) {\n const val = config[key]\n\n // performance - this seems to have (strangely) huge performance effect in uniswap\n // so instead of cloning up front, we clone only when we absolutely have to\n if (!hasClonedTransition) {\n transition = Object.assign({}, transition)\n hasClonedTransition = true\n }\n\n // referencing a pre-defined config\n if (typeof val === 'string') {\n transition[key] = animations[val]\n } else {\n transition[key] = val\n }\n }\n }\n }\n\n return {\n dontAnimate,\n motiProps: {\n animate: isExiting || componentState.unmounted === true ? {} : styles,\n transition: componentState.unmounted ? { duration: 0 } : transition,\n usePresenceValue,\n presenceContext,\n exit: isExiting ? styles : undefined,\n } satisfies UseMotiProps,\n }\n }, [\n presenceContext,\n presence,\n animationKey,\n componentState.unmounted,\n JSON.stringify(style),\n presenceContext,\n isDark,\n ])\n\n const moti = useMotify(motiProps)\n\n if (\n process.env.NODE_ENV === 'development' &&\n props['debug'] &&\n props['debug'] !== 'profile'\n ) {\n console.info(`useMotify(`, JSON.stringify(motiProps, null, 2) + ')', {\n 'componentState.unmounted': componentState.unmounted,\n animationProps,\n motiProps,\n moti,\n style: [dontAnimate, moti.style],\n })\n }\n\n return {\n style: [dontAnimate, moti.style],\n }\n },\n }\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,4 @@
1
+ import "./polyfill";
2
+ export * from "./createAnimations";
3
+
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,OAAO;AAEP,cAAc",
3
+ "names": [],
4
+ "sources": [
5
+ "src/index.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import './polyfill'\n\nexport * from './createAnimations'\n"
10
+ ]
11
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=polyfill.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "",
3
+ "names": [],
4
+ "sources": [
5
+ "src/polyfill.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// for SSR\nif (typeof requestAnimationFrame === 'undefined') {\n globalThis['requestAnimationFrame'] = setTimeout\n}\n\n// for reanimated\nif (typeof global === 'undefined') {\n globalThis['global'] = globalThis\n}\n"
10
+ ]
11
+ }