@tamagui/animations-moti 1.90.3 → 1.90.4
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.
- package/dist/cjs/createAnimations.js +14 -16
- package/dist/cjs/createAnimations.js.map +1 -1
- package/dist/cjs/createAnimations.native.js +14 -16
- package/dist/cjs/createAnimations.native.js.map +2 -2
- package/dist/esm/createAnimations.js +18 -18
- package/dist/esm/createAnimations.js.map +1 -1
- package/dist/esm/createAnimations.mjs +17 -19
- package/dist/esm/createAnimations.native.js +16 -18
- package/dist/esm/createAnimations.native.js.map +2 -2
- package/package.json +5 -5
- package/src/createAnimations.tsx +22 -20
- package/types/createAnimations.d.ts.map +1 -1
|
@@ -38,7 +38,11 @@ function createTamaguiAnimatedComponent(tag = "div") {
|
|
|
38
38
|
const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
39
39
|
alignItems: !0,
|
|
40
40
|
backdropFilter: !0,
|
|
41
|
+
borderBottomStyle: !0,
|
|
42
|
+
borderLeftStyle: !0,
|
|
43
|
+
borderRightStyle: !0,
|
|
41
44
|
borderStyle: !0,
|
|
45
|
+
borderTopStyle: !0,
|
|
42
46
|
boxSizing: !0,
|
|
43
47
|
contain: !0,
|
|
44
48
|
cursor: !0,
|
|
@@ -49,9 +53,13 @@ const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = creat
|
|
|
49
53
|
justifyContent: !0,
|
|
50
54
|
maxHeight: !0,
|
|
51
55
|
maxWidth: !0,
|
|
56
|
+
minHeight: !0,
|
|
57
|
+
minWidth: !0,
|
|
58
|
+
outlineStyle: !0,
|
|
52
59
|
overflow: !0,
|
|
53
60
|
overflowX: !0,
|
|
54
61
|
overflowY: !0,
|
|
62
|
+
pointerEvents: !0,
|
|
55
63
|
position: !0,
|
|
56
64
|
shadowColor: !0,
|
|
57
65
|
textAlign: !0,
|
|
@@ -62,10 +70,8 @@ const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = creat
|
|
|
62
70
|
};
|
|
63
71
|
function createAnimations(animations) {
|
|
64
72
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
View: import_react_native_reanimated.default.View,
|
|
68
|
-
Text: import_react_native_reanimated.default.Text,
|
|
73
|
+
View: import_web.isWeb ? AnimatedView : import_react_native_reanimated.default.View,
|
|
74
|
+
Text: import_web.isWeb ? AnimatedText : import_react_native_reanimated.default.Text,
|
|
69
75
|
isReactNative: !0,
|
|
70
76
|
animations,
|
|
71
77
|
usePresence: import_use_presence.usePresence,
|
|
@@ -120,21 +126,13 @@ function createAnimations(animations) {
|
|
|
120
126
|
else {
|
|
121
127
|
const animateOnly = props.animateOnly;
|
|
122
128
|
for (const key in style)
|
|
123
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
129
|
+
!import_web.stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
124
130
|
}
|
|
125
|
-
const animateStr = JSON.stringify(animate), styles = (0, import_react.useMemo)(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1],
|
|
126
|
-
onDidAnimate?.(), sendExitComplete?.();
|
|
127
|
-
}, []), motiProps = {
|
|
131
|
+
const animateStr = JSON.stringify(animate), styles = (0, import_react.useMemo)(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1], presenceContext = (0, import_react.useContext)(import_use_presence.PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
128
132
|
animate: isExiting || isHydrating ? {} : styles,
|
|
129
133
|
transition: animations[animationKey],
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// : componentState.unmounted
|
|
133
|
-
// ? { type: 'timing', duration: 0 }
|
|
134
|
-
// : animations[animationKey as keyof typeof animations]
|
|
135
|
-
onDidAnimate: onDidAnimateCombined,
|
|
136
|
-
usePresenceValue: presence,
|
|
137
|
-
presenceContext: (0, import_react.useContext)(import_use_presence.PresenceContext),
|
|
134
|
+
usePresenceValue,
|
|
135
|
+
presenceContext,
|
|
138
136
|
exit: isExiting ? styles : void 0
|
|
139
137
|
}, moti = (0, import_author.useMotify)(motiProps);
|
|
140
138
|
return process.env.NODE_ENV === "development" && props.debug && console.info("useMotify(", JSON.stringify(motiProps, null, 2) + ")", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createAnimations.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4D,kCAC5D,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4D,kCAC5D,aAOO,yBAEP,gBAA0B,wBAC1B,eAAgD,kBAEhD,iCASO,6CAaM;AATb,SAAS,+BAA+B,MAAM,OAAO;AACnD,QAAM,YAAY,+BAAAA,QAAS;AAAA,QACzB,yBAAW,CAAC,EAAE,cAAc,OAAO,GAAG,MAAM,GAAQ,QAAQ;AAC1D,YAAM,mBAAe,4BAAgB,cAAc,GAAG,GAChD,UAAU,MAAM,OAAO;AAE7B,aAAI,SAAS,MAAM,QAAQ,MAAM,SAAS,MACxC,MAAM,gBAAY,+BAAmB,MAAM,SAAS,IAE/C,4CAAC,WAAS,GAAG,OAAO,OAAc,KAAK,cAAc;AAAA,IAC9D,CAAC;AAAA,EACH;AACA,mBAAU,gBAAmB,IACtB;AACT;AAEA,MAAM,eAAe,+BAA+B,KAAK,GACnD,eAAe,+BAA+B,MAAM,GAEpD,eAAe;AAAA,EACnB,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,WA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AAI,QAAQ,IAAI,aAAa,iBAAiB,MAAM,SAClD,QAAQ,KAAK,cAAc,KAAK,UAAU,WAAW,MAAM,CAAC,IAAI,KAAK;AAAA,QACnE;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO,CAAC,aAAa,KAAK,KAAK;AAAA,MACjC,CAAC,GAGI;AAAA,QACL,OAAO,CAAC,aAAa,KAAK,KAAK;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF;",
|
|
5
5
|
"names": ["Animated"]
|
|
6
6
|
}
|
|
@@ -96,7 +96,11 @@ function createTamaguiAnimatedComponent() {
|
|
|
96
96
|
var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
97
97
|
alignItems: !0,
|
|
98
98
|
backdropFilter: !0,
|
|
99
|
+
borderBottomStyle: !0,
|
|
100
|
+
borderLeftStyle: !0,
|
|
101
|
+
borderRightStyle: !0,
|
|
99
102
|
borderStyle: !0,
|
|
103
|
+
borderTopStyle: !0,
|
|
100
104
|
boxSizing: !0,
|
|
101
105
|
contain: !0,
|
|
102
106
|
cursor: !0,
|
|
@@ -107,9 +111,13 @@ var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createT
|
|
|
107
111
|
justifyContent: !0,
|
|
108
112
|
maxHeight: !0,
|
|
109
113
|
maxWidth: !0,
|
|
114
|
+
minHeight: !0,
|
|
115
|
+
minWidth: !0,
|
|
116
|
+
outlineStyle: !0,
|
|
110
117
|
overflow: !0,
|
|
111
118
|
overflowX: !0,
|
|
112
119
|
overflowY: !0,
|
|
120
|
+
pointerEvents: !0,
|
|
113
121
|
position: !0,
|
|
114
122
|
shadowColor: !0,
|
|
115
123
|
textAlign: !0,
|
|
@@ -120,10 +128,8 @@ var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createT
|
|
|
120
128
|
};
|
|
121
129
|
function createAnimations(animations) {
|
|
122
130
|
return {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
View: import_react_native_reanimated.default.View,
|
|
126
|
-
Text: import_react_native_reanimated.default.Text,
|
|
131
|
+
View: import_web.isWeb ? AnimatedView : import_react_native_reanimated.default.View,
|
|
132
|
+
Text: import_web.isWeb ? AnimatedText : import_react_native_reanimated.default.Text,
|
|
127
133
|
isReactNative: !0,
|
|
128
134
|
animations,
|
|
129
135
|
usePresence: import_use_presence.usePresence,
|
|
@@ -206,25 +212,17 @@ function createAnimations(animations) {
|
|
|
206
212
|
else {
|
|
207
213
|
var animateOnly = props.animateOnly;
|
|
208
214
|
for (var key in style)
|
|
209
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
215
|
+
!import_web.stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
210
216
|
}
|
|
211
217
|
var animateStr = JSON.stringify(animate), styles = (0, import_react.useMemo)(function() {
|
|
212
218
|
return JSON.parse(animateStr);
|
|
213
219
|
}, [
|
|
214
220
|
animateStr
|
|
215
|
-
]), isExiting = !!(presence != null && presence[1]),
|
|
216
|
-
onDidAnimate == null || onDidAnimate(), sendExitComplete == null || sendExitComplete();
|
|
217
|
-
}, []), motiProps = {
|
|
221
|
+
]), isExiting = !!(presence != null && presence[1]), presenceContext = (0, import_react.useContext)(import_use_presence.PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
218
222
|
animate: isExiting || isHydrating ? {} : styles,
|
|
219
223
|
transition: animations[animationKey],
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
// : componentState.unmounted
|
|
223
|
-
// ? { type: 'timing', duration: 0 }
|
|
224
|
-
// : animations[animationKey as keyof typeof animations]
|
|
225
|
-
onDidAnimate: onDidAnimateCombined,
|
|
226
|
-
usePresenceValue: presence,
|
|
227
|
-
presenceContext: (0, import_react.useContext)(import_use_presence.PresenceContext),
|
|
224
|
+
usePresenceValue,
|
|
225
|
+
presenceContext,
|
|
228
226
|
exit: isExiting ? styles : void 0
|
|
229
227
|
}, moti = (0, import_author.useMotify)(motiProps);
|
|
230
228
|
return process.env.NODE_ENV === "development" && props.debug && console.info("useMotify(", JSON.stringify(motiProps, null, 2) + ")", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/packages/animations-moti/src/createAnimations.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,sBAA4D,kCAC5D,
|
|
5
|
-
"names": ["createTamaguiAnimatedComponent", "tag", "Component", "Animated", "createAnimatedComponent", "forwardRef", "ref", "forwardedRef", "style", "props", "composedRefs", "useComposedRefs", "Element", "Array", "isArray", "transform", "transformsToString", "_jsx", "AnimatedView", "AnimatedText", "neverAnimate", "alignItems", "backdropFilter", "borderStyle", "boxSizing", "contain", "cursor", "display", "flexBasis", "flexDirection", "flexShrink", "justifyContent", "maxHeight", "maxWidth", "overflow", "overflowX", "overflowY", "position", "shadowColor", "textAlign", "textOverflow", "whiteSpace", "wordWrap", "zIndex", "createAnimations", "animations", "View", "Text", "isReactNative", "usePresence", "ResetPresence", "useAnimatedNumber", "initial", "sharedValue", "useSharedValue", "useMemo", "getInstance", "getValue", "value", "setValue", "next", "config", "type", "withSpring", "withTiming", "stop", "cancelAnimation", "useAnimatedNumberReaction", "onValue", "instance", "useAnimatedReaction", "prev", "runOnJS", "useAnimatedNumberStyle", "val", "getStyle", "derivedValue", "useDerivedValue", "useAnimatedStyle", "useAnimations", "animationProps", "presence", "onDidAnimate", "componentState", "animationKey", "animation", "isHydrating", "unmounted", "animate", "dontAnimate", "animateOnly", "key", "includes", "animateStr", "JSON", "stringify", "styles", "parse", "isExiting", "Boolean", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,sBAA4D,kCAC5D,aAOO,yBAEP,gBAA0B,wBAC1B,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G;;MAC5B;IACF;EACF;AACF;",
|
|
5
|
+
"names": ["createTamaguiAnimatedComponent", "tag", "Component", "Animated", "createAnimatedComponent", "forwardRef", "ref", "forwardedRef", "style", "props", "composedRefs", "useComposedRefs", "Element", "Array", "isArray", "transform", "transformsToString", "_jsx", "AnimatedView", "AnimatedText", "neverAnimate", "alignItems", "backdropFilter", "borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderStyle", "borderTopStyle", "boxSizing", "contain", "cursor", "display", "flexBasis", "flexDirection", "flexShrink", "justifyContent", "maxHeight", "maxWidth", "minHeight", "minWidth", "outlineStyle", "overflow", "overflowX", "overflowY", "pointerEvents", "position", "shadowColor", "textAlign", "textOverflow", "whiteSpace", "wordWrap", "zIndex", "createAnimations", "animations", "View", "isWeb", "Text", "isReactNative", "usePresence", "ResetPresence", "useAnimatedNumber", "initial", "sharedValue", "useSharedValue", "useMemo", "getInstance", "getValue", "value", "setValue", "next", "config", "type", "withSpring", "withTiming", "stop", "cancelAnimation", "useAnimatedNumberReaction", "onValue", "instance", "useAnimatedReaction", "prev", "runOnJS", "useAnimatedNumberStyle", "val", "getStyle", "derivedValue", "useDerivedValue", "useAnimatedStyle", "useAnimations", "animationProps", "presence", "onDidAnimate", "componentState", "animationKey", "animation", "isHydrating", "unmounted", "animate", "dontAnimate", "animateOnly", "key", "stylePropsAll", "includes", "animateStr", "JSON", "stringify", "styles", "parse", "isExiting", "Boolean", "presenceContext", "useContext", "PresenceContext", "usePresenceValue", "undefined", "motiProps", "transition", "exit", "moti", "useMotify", "process", "env", "NODE_ENV", "console", "info"]
|
|
6
6
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PresenceContext, ResetPresence, usePresence } from "@tamagui/use-presence";
|
|
2
2
|
import {
|
|
3
|
+
isWeb,
|
|
3
4
|
transformsToString,
|
|
4
|
-
useComposedRefs
|
|
5
|
+
useComposedRefs,
|
|
6
|
+
stylePropsAll
|
|
5
7
|
} from "@tamagui/web";
|
|
6
8
|
import { useMotify } from "moti/author";
|
|
7
|
-
import { forwardRef,
|
|
9
|
+
import { forwardRef, useContext, useMemo } from "react";
|
|
8
10
|
import Animated, {
|
|
9
11
|
cancelAnimation,
|
|
10
12
|
runOnJS,
|
|
@@ -28,7 +30,11 @@ function createTamaguiAnimatedComponent(tag = "div") {
|
|
|
28
30
|
const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
29
31
|
alignItems: !0,
|
|
30
32
|
backdropFilter: !0,
|
|
33
|
+
borderBottomStyle: !0,
|
|
34
|
+
borderLeftStyle: !0,
|
|
35
|
+
borderRightStyle: !0,
|
|
31
36
|
borderStyle: !0,
|
|
37
|
+
borderTopStyle: !0,
|
|
32
38
|
boxSizing: !0,
|
|
33
39
|
contain: !0,
|
|
34
40
|
cursor: !0,
|
|
@@ -39,9 +45,13 @@ const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = creat
|
|
|
39
45
|
justifyContent: !0,
|
|
40
46
|
maxHeight: !0,
|
|
41
47
|
maxWidth: !0,
|
|
48
|
+
minHeight: !0,
|
|
49
|
+
minWidth: !0,
|
|
50
|
+
outlineStyle: !0,
|
|
42
51
|
overflow: !0,
|
|
43
52
|
overflowX: !0,
|
|
44
53
|
overflowY: !0,
|
|
54
|
+
pointerEvents: !0,
|
|
45
55
|
position: !0,
|
|
46
56
|
shadowColor: !0,
|
|
47
57
|
textAlign: !0,
|
|
@@ -52,10 +62,8 @@ const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = creat
|
|
|
52
62
|
};
|
|
53
63
|
function createAnimations(animations) {
|
|
54
64
|
return {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
View: Animated.View,
|
|
58
|
-
Text: Animated.Text,
|
|
65
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
66
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
59
67
|
isReactNative: !0,
|
|
60
68
|
animations,
|
|
61
69
|
usePresence,
|
|
@@ -110,21 +118,13 @@ function createAnimations(animations) {
|
|
|
110
118
|
else {
|
|
111
119
|
const animateOnly = props.animateOnly;
|
|
112
120
|
for (const key in style)
|
|
113
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
121
|
+
!stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
114
122
|
}
|
|
115
|
-
const animateStr = JSON.stringify(animate), styles = useMemo(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1],
|
|
116
|
-
onDidAnimate?.(), sendExitComplete?.();
|
|
117
|
-
}, []), motiProps = {
|
|
123
|
+
const animateStr = JSON.stringify(animate), styles = useMemo(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1], presenceContext = useContext(PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
118
124
|
animate: isExiting || isHydrating ? {} : styles,
|
|
119
125
|
transition: animations[animationKey],
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// : componentState.unmounted
|
|
123
|
-
// ? { type: 'timing', duration: 0 }
|
|
124
|
-
// : animations[animationKey as keyof typeof animations]
|
|
125
|
-
onDidAnimate: onDidAnimateCombined,
|
|
126
|
-
usePresenceValue: presence,
|
|
127
|
-
presenceContext: useContext(PresenceContext),
|
|
126
|
+
usePresenceValue,
|
|
127
|
+
presenceContext,
|
|
128
128
|
exit: isExiting ? styles : void 0
|
|
129
129
|
}, moti = useMotify(motiProps);
|
|
130
130
|
return process.env.NODE_ENV === "development" && props.debug && console.info("useMotify(", JSON.stringify(motiProps, null, 2) + ")", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createAnimations.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,iBAAiB,eAAe,mBAAmB;AAC5D;AAAA,EACE;AAA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}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PresenceContext, ResetPresence, usePresence } from "@tamagui/use-presence";
|
|
2
|
-
import { transformsToString, useComposedRefs } from "@tamagui/web";
|
|
2
|
+
import { isWeb, transformsToString, useComposedRefs, stylePropsAll } from "@tamagui/web";
|
|
3
3
|
import { useMotify } from "moti/author";
|
|
4
|
-
import { forwardRef,
|
|
4
|
+
import { forwardRef, useContext, useMemo } from "react";
|
|
5
5
|
import Animated, { cancelAnimation, runOnJS, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
function createTamaguiAnimatedComponent(tag = "div") {
|
|
@@ -25,7 +25,11 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
25
25
|
neverAnimate = {
|
|
26
26
|
alignItems: !0,
|
|
27
27
|
backdropFilter: !0,
|
|
28
|
+
borderBottomStyle: !0,
|
|
29
|
+
borderLeftStyle: !0,
|
|
30
|
+
borderRightStyle: !0,
|
|
28
31
|
borderStyle: !0,
|
|
32
|
+
borderTopStyle: !0,
|
|
29
33
|
boxSizing: !0,
|
|
30
34
|
contain: !0,
|
|
31
35
|
cursor: !0,
|
|
@@ -36,9 +40,13 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
36
40
|
justifyContent: !0,
|
|
37
41
|
maxHeight: !0,
|
|
38
42
|
maxWidth: !0,
|
|
43
|
+
minHeight: !0,
|
|
44
|
+
minWidth: !0,
|
|
45
|
+
outlineStyle: !0,
|
|
39
46
|
overflow: !0,
|
|
40
47
|
overflowX: !0,
|
|
41
48
|
overflowY: !0,
|
|
49
|
+
pointerEvents: !0,
|
|
42
50
|
position: !0,
|
|
43
51
|
shadowColor: !0,
|
|
44
52
|
textAlign: !0,
|
|
@@ -49,10 +57,8 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
49
57
|
};
|
|
50
58
|
function createAnimations(animations) {
|
|
51
59
|
return {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
View: Animated.View,
|
|
55
|
-
Text: Animated.Text,
|
|
60
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
61
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
56
62
|
isReactNative: !0,
|
|
57
63
|
animations,
|
|
58
64
|
usePresence,
|
|
@@ -116,26 +122,18 @@ function createAnimations(animations) {
|
|
|
116
122
|
dontAnimate = {};
|
|
117
123
|
if (isHydrating) dontAnimate = style;else {
|
|
118
124
|
const animateOnly = props.animateOnly;
|
|
119
|
-
for (const key in style) neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
125
|
+
for (const key in style) !stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
120
126
|
}
|
|
121
127
|
const animateStr = JSON.stringify(animate),
|
|
122
128
|
styles = useMemo(() => JSON.parse(animateStr), [animateStr]),
|
|
123
129
|
isExiting = !!presence?.[1],
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
onDidAnimate?.(), sendExitComplete?.();
|
|
127
|
-
}, []),
|
|
130
|
+
presenceContext = useContext(PresenceContext),
|
|
131
|
+
usePresenceValue = presence || void 0,
|
|
128
132
|
motiProps = {
|
|
129
133
|
animate: isExiting || isHydrating ? {} : styles,
|
|
130
134
|
transition: animations[animationKey],
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// : componentState.unmounted
|
|
134
|
-
// ? { type: 'timing', duration: 0 }
|
|
135
|
-
// : animations[animationKey as keyof typeof animations]
|
|
136
|
-
onDidAnimate: onDidAnimateCombined,
|
|
137
|
-
usePresenceValue: presence,
|
|
138
|
-
presenceContext: useContext(PresenceContext),
|
|
135
|
+
usePresenceValue,
|
|
136
|
+
presenceContext,
|
|
139
137
|
exit: isExiting ? styles : void 0
|
|
140
138
|
},
|
|
141
139
|
moti = useMotify(motiProps);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PresenceContext, ResetPresence, usePresence } from "@tamagui/use-presence";
|
|
3
|
-
import { transformsToString, useComposedRefs } from "@tamagui/web";
|
|
3
|
+
import { isWeb, transformsToString, useComposedRefs, stylePropsAll } from "@tamagui/web";
|
|
4
4
|
import { useMotify } from "moti/author";
|
|
5
|
-
import { forwardRef,
|
|
5
|
+
import { forwardRef, useContext, useMemo } from "react";
|
|
6
6
|
import Animated, { cancelAnimation, runOnJS, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
|
|
7
7
|
function _define_property(obj, key, value) {
|
|
8
8
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
@@ -73,7 +73,11 @@ function createTamaguiAnimatedComponent() {
|
|
|
73
73
|
var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
74
74
|
alignItems: !0,
|
|
75
75
|
backdropFilter: !0,
|
|
76
|
+
borderBottomStyle: !0,
|
|
77
|
+
borderLeftStyle: !0,
|
|
78
|
+
borderRightStyle: !0,
|
|
76
79
|
borderStyle: !0,
|
|
80
|
+
borderTopStyle: !0,
|
|
77
81
|
boxSizing: !0,
|
|
78
82
|
contain: !0,
|
|
79
83
|
cursor: !0,
|
|
@@ -84,9 +88,13 @@ var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createT
|
|
|
84
88
|
justifyContent: !0,
|
|
85
89
|
maxHeight: !0,
|
|
86
90
|
maxWidth: !0,
|
|
91
|
+
minHeight: !0,
|
|
92
|
+
minWidth: !0,
|
|
93
|
+
outlineStyle: !0,
|
|
87
94
|
overflow: !0,
|
|
88
95
|
overflowX: !0,
|
|
89
96
|
overflowY: !0,
|
|
97
|
+
pointerEvents: !0,
|
|
90
98
|
position: !0,
|
|
91
99
|
shadowColor: !0,
|
|
92
100
|
textAlign: !0,
|
|
@@ -97,10 +105,8 @@ var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createT
|
|
|
97
105
|
};
|
|
98
106
|
function createAnimations(animations) {
|
|
99
107
|
return {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
View: Animated.View,
|
|
103
|
-
Text: Animated.Text,
|
|
108
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
109
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
104
110
|
isReactNative: !0,
|
|
105
111
|
animations,
|
|
106
112
|
usePresence,
|
|
@@ -183,25 +189,17 @@ function createAnimations(animations) {
|
|
|
183
189
|
else {
|
|
184
190
|
var animateOnly = props.animateOnly;
|
|
185
191
|
for (var key in style)
|
|
186
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
192
|
+
!stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
187
193
|
}
|
|
188
194
|
var animateStr = JSON.stringify(animate), styles = useMemo(function() {
|
|
189
195
|
return JSON.parse(animateStr);
|
|
190
196
|
}, [
|
|
191
197
|
animateStr
|
|
192
|
-
]), isExiting = !!(presence != null && presence[1]),
|
|
193
|
-
onDidAnimate == null || onDidAnimate(), sendExitComplete == null || sendExitComplete();
|
|
194
|
-
}, []), motiProps = {
|
|
198
|
+
]), isExiting = !!(presence != null && presence[1]), presenceContext = useContext(PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
195
199
|
animate: isExiting || isHydrating ? {} : styles,
|
|
196
200
|
transition: animations[animationKey],
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
// : componentState.unmounted
|
|
200
|
-
// ? { type: 'timing', duration: 0 }
|
|
201
|
-
// : animations[animationKey as keyof typeof animations]
|
|
202
|
-
onDidAnimate: onDidAnimateCombined,
|
|
203
|
-
usePresenceValue: presence,
|
|
204
|
-
presenceContext: useContext(PresenceContext),
|
|
201
|
+
usePresenceValue,
|
|
202
|
+
presenceContext,
|
|
205
203
|
exit: isExiting ? styles : void 0
|
|
206
204
|
}, moti = useMotify(motiProps);
|
|
207
205
|
return process.env.NODE_ENV === "development" && props.debug && console.info("useMotify(", JSON.stringify(motiProps, null, 2) + ")", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/packages/animations-moti/src/createAnimations.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,iBAAiBC,eAAeC,mBAAmB;AAC5D,SACEC,oBACAC,
|
|
5
|
-
"names": ["PresenceContext", "ResetPresence", "usePresence", "transformsToString", "useComposedRefs", "
|
|
4
|
+
"mappings": ";AAAA,SAASA,iBAAiBC,eAAeC,mBAAmB;AAC5D,SACEC,OACAC,oBACAC,iBACAC,qBAGK;AAEP,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,YAAYC,eAAe;AAEhD,OAAOC,YACLC,iBACAC,SACAC,qBACAC,kBACAC,iBACAC,gBACAC,YACAC,kBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIP,SAASC,iCAAAA;MAA+BC,MAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAM,OACtCC,YAAYX,SAASY,wBACzBf,2BAAW,SAAA,QAAyCgB,KAAAA;QAAtCC,eAAAA,OAAAA,cAAcC,QAAAA,OAAAA,OAAUC,QAAAA,2BAAAA,QAAAA;MAAxBF;MAAcC;QACpBE,eAAevB,gBAAgBoB,cAAcD,GAAAA,GAC7CK,UAAUF,MAAMN,OAAOA;AAE7B,WAAIK,SAASI,MAAMC,QAAQL,MAAMM,SAAS,MACxCN,MAAMM,YAAY5B,mBAAmBsB,MAAMM,SAAS,IAE/C,qBAACH,SAAAA,qBA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6E,GAAAA;MAG3B;AAIA,UAAME,aAAaC,KAAKC,UAAUP,OAAAA,GAC5BQ,SAASlG,QAAQ,WAAA;eAAMgG,KAAKG,MAAMJ,UAAAA;SAAa;QAACA;OAAW,GAE3DK,YAAYC,GAAQlB,YAAAA,QAAAA,SAAW,CAAA,IAC/BmB,kBAAkBvG,WAAWT,eAAAA,GAC7BiH,mBAAoBpB,YAAYqB,QAIhCC,YAAY;QAChBf,SAASU,aAAaZ,cAAc,CAAC,IAAIU;QACzCQ,YAAYhD,WAAW4B,YAAAA;QACvBiB;QACAD;QACAK,MAAMP,YAAYF,SAASM;MAC7B,GAEMI,OAAO/G,UAAU4G,SAAAA;AAEvB,aAAII,QAAQC,IAAIC,aAAa,iBAAiB9F,MAAM,SAClD+F,QAAQC,KAAM,cAAajB,KAAKC,UAAUQ,WAAW,MAAM,CAAA,IAAK,KAAK;QACnEvB;QACAuB;QACAG;QACA5F,OAAO;UAAC2E;UAAaiB,KAAK5F;;MAC5B,CAAA,GAGK;QACLA,OAAO;UAAC2E;UAAaiB,KAAK5F;;MAC5B;IACF;EACF;AACF;",
|
|
5
|
+
"names": ["PresenceContext", "ResetPresence", "usePresence", "isWeb", "transformsToString", "useComposedRefs", "stylePropsAll", "useMotify", "forwardRef", "useContext", "useMemo", "Animated", "cancelAnimation", "runOnJS", "useAnimatedReaction", "useAnimatedStyle", "useDerivedValue", "useSharedValue", "withSpring", "withTiming", "createTamaguiAnimatedComponent", "tag", "Component", "createAnimatedComponent", "ref", "forwardedRef", "style", "props", "composedRefs", "Element", "Array", "isArray", "transform", "AnimatedView", "AnimatedText", "neverAnimate", "alignItems", "backdropFilter", "borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderStyle", "borderTopStyle", "boxSizing", "contain", "cursor", "display", "flexBasis", "flexDirection", "flexShrink", "justifyContent", "maxHeight", "maxWidth", "minHeight", "minWidth", "outlineStyle", "overflow", "overflowX", "overflowY", "pointerEvents", "position", "shadowColor", "textAlign", "textOverflow", "whiteSpace", "wordWrap", "zIndex", "createAnimations", "animations", "View", "Text", "isReactNative", "useAnimatedNumber", "initial", "sharedValue", "getInstance", "getValue", "value", "setValue", "next", "config", "type", "stop", "useAnimatedNumberReaction", "onValue", "instance", "prev", "useAnimatedNumberStyle", "val", "getStyle", "derivedValue", "useAnimations", "animationProps", "presence", "onDidAnimate", "componentState", "animationKey", "animation", "isHydrating", "unmounted", "animate", "dontAnimate", "animateOnly", "key", "includes", "animateStr", "JSON", "stringify", "styles", "parse", "isExiting", "Boolean", "presenceContext", "usePresenceValue", "undefined", "motiProps", "transition", "exit", "moti", "process", "env", "NODE_ENV", "console", "info"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/animations-moti",
|
|
3
|
-
"version": "1.90.
|
|
3
|
+
"version": "1.90.4",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@tamagui/use-presence": "1.90.
|
|
19
|
-
"@tamagui/web": "1.90.
|
|
20
|
-
"moti": "^0.27.
|
|
18
|
+
"@tamagui/use-presence": "1.90.4",
|
|
19
|
+
"@tamagui/web": "1.90.4",
|
|
20
|
+
"moti": "^0.27.4",
|
|
21
21
|
"react": "^18.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@tamagui/build": "1.90.
|
|
24
|
+
"@tamagui/build": "1.90.4",
|
|
25
25
|
"react-native-reanimated": "~3.6.2"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
package/src/createAnimations.tsx
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PresenceContext, ResetPresence, usePresence } from '@tamagui/use-presence'
|
|
2
2
|
import {
|
|
3
|
+
isWeb,
|
|
3
4
|
transformsToString,
|
|
4
5
|
useComposedRefs,
|
|
6
|
+
stylePropsAll,
|
|
5
7
|
type AnimationDriver,
|
|
6
8
|
type UniversalAnimatedNumber,
|
|
7
9
|
} from '@tamagui/web'
|
|
8
10
|
import type { MotiTransition } from 'moti'
|
|
9
11
|
import { useMotify } from 'moti/author'
|
|
10
|
-
import { forwardRef,
|
|
12
|
+
import { forwardRef, useContext, useMemo } from 'react'
|
|
11
13
|
import type { SharedValue } from 'react-native-reanimated'
|
|
12
14
|
import Animated, {
|
|
13
15
|
cancelAnimation,
|
|
@@ -44,7 +46,11 @@ const AnimatedText = createTamaguiAnimatedComponent('span')
|
|
|
44
46
|
const neverAnimate = {
|
|
45
47
|
alignItems: true,
|
|
46
48
|
backdropFilter: true,
|
|
49
|
+
borderBottomStyle: true,
|
|
50
|
+
borderLeftStyle: true,
|
|
51
|
+
borderRightStyle: true,
|
|
47
52
|
borderStyle: true,
|
|
53
|
+
borderTopStyle: true,
|
|
48
54
|
boxSizing: true,
|
|
49
55
|
contain: true,
|
|
50
56
|
cursor: true,
|
|
@@ -55,9 +61,13 @@ const neverAnimate = {
|
|
|
55
61
|
justifyContent: true,
|
|
56
62
|
maxHeight: true,
|
|
57
63
|
maxWidth: true,
|
|
64
|
+
minHeight: true,
|
|
65
|
+
minWidth: true,
|
|
66
|
+
outlineStyle: true,
|
|
58
67
|
overflow: true,
|
|
59
68
|
overflowX: true,
|
|
60
69
|
overflowY: true,
|
|
70
|
+
pointerEvents: true,
|
|
61
71
|
position: true,
|
|
62
72
|
shadowColor: true,
|
|
63
73
|
textAlign: true,
|
|
@@ -71,10 +81,8 @@ export function createAnimations<A extends Record<string, MotiTransition>>(
|
|
|
71
81
|
animations: A
|
|
72
82
|
): AnimationDriver<A> {
|
|
73
83
|
return {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
View: Animated.View,
|
|
77
|
-
Text: Animated.Text,
|
|
84
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
85
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
78
86
|
isReactNative: true,
|
|
79
87
|
animations,
|
|
80
88
|
usePresence,
|
|
@@ -163,7 +171,11 @@ export function createAnimations<A extends Record<string, MotiTransition>>(
|
|
|
163
171
|
} else {
|
|
164
172
|
const animateOnly = props.animateOnly as string[]
|
|
165
173
|
for (const key in style) {
|
|
166
|
-
if (
|
|
174
|
+
if (
|
|
175
|
+
!stylePropsAll[key] ||
|
|
176
|
+
neverAnimate[key] ||
|
|
177
|
+
(animateOnly && !animateOnly.includes(key))
|
|
178
|
+
) {
|
|
167
179
|
dontAnimate[key] = style[key]
|
|
168
180
|
} else {
|
|
169
181
|
animate[key] = style[key]
|
|
@@ -177,26 +189,16 @@ export function createAnimations<A extends Record<string, MotiTransition>>(
|
|
|
177
189
|
const styles = useMemo(() => JSON.parse(animateStr), [animateStr])
|
|
178
190
|
|
|
179
191
|
const isExiting = Boolean(presence?.[1])
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
const onDidAnimateCombined = useCallback(() => {
|
|
183
|
-
onDidAnimate?.()
|
|
184
|
-
sendExitComplete?.()
|
|
185
|
-
}, [])
|
|
192
|
+
const presenceContext = useContext(PresenceContext)
|
|
193
|
+
const usePresenceValue = (presence || undefined) as any
|
|
186
194
|
|
|
187
195
|
type UseMotiProps = Parameters<typeof useMotify>[0]
|
|
188
196
|
|
|
189
197
|
const motiProps = {
|
|
190
198
|
animate: isExiting || isHydrating ? {} : styles,
|
|
191
199
|
transition: animations[animationKey as keyof typeof animations],
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// : componentState.unmounted
|
|
195
|
-
// ? { type: 'timing', duration: 0 }
|
|
196
|
-
// : animations[animationKey as keyof typeof animations]
|
|
197
|
-
onDidAnimate: onDidAnimateCombined,
|
|
198
|
-
usePresenceValue: presence as any,
|
|
199
|
-
presenceContext: useContext(PresenceContext),
|
|
200
|
+
usePresenceValue,
|
|
201
|
+
presenceContext,
|
|
200
202
|
exit: isExiting ? styles : undefined,
|
|
201
203
|
} satisfies UseMotiProps
|
|
202
204
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnimations.d.ts","sourceRoot":"","sources":["../src/createAnimations.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"createAnimations.d.ts","sourceRoot":"","sources":["../src/createAnimations.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAA;AAsE1C,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EACvE,UAAU,EAAE,CAAC,GACZ,eAAe,CAAC,CAAC,CAAC,CA2IpB"}
|