@tamagui/animations-moti 1.90.3 → 1.90.5
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 +22 -19
- package/dist/cjs/createAnimations.js.map +1 -1
- package/dist/cjs/createAnimations.native.js +22 -19
- package/dist/cjs/createAnimations.native.js.map +2 -2
- package/dist/esm/createAnimations.js +28 -21
- package/dist/esm/createAnimations.js.map +1 -1
- package/dist/esm/createAnimations.mjs +25 -22
- package/dist/esm/createAnimations.native.js +24 -21
- package/dist/esm/createAnimations.native.js.map +2 -2
- package/package.json +5 -5
- package/src/createAnimations.tsx +36 -22
- package/types/createAnimations.d.ts.map +1 -1
|
@@ -29,8 +29,11 @@ var import_use_presence = require("@tamagui/use-presence"), import_web = require
|
|
|
29
29
|
function createTamaguiAnimatedComponent(tag = "div") {
|
|
30
30
|
const Component = import_react_native_reanimated.default.createAnimatedComponent(
|
|
31
31
|
(0, import_react.forwardRef)(({ forwardedRef, style, ...props }, ref) => {
|
|
32
|
-
const composedRefs = (0, import_web.useComposedRefs)(forwardedRef, ref), Element = props.tag || tag;
|
|
33
|
-
|
|
32
|
+
const composedRefs = (0, import_web.useComposedRefs)(forwardedRef, ref), Element = props.tag || tag, webStyle = style;
|
|
33
|
+
(0, import_web.styleToCSS)(style), Array.isArray(webStyle.transform) && (style.transform = (0, import_web.transformsToString)(style.transform));
|
|
34
|
+
for (const key in style)
|
|
35
|
+
style[key] = (0, import_web.normalizeValueWithProperty)(style[key], key);
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Element, { ...props, style, ref: composedRefs });
|
|
34
37
|
})
|
|
35
38
|
);
|
|
36
39
|
return Component.acceptTagProp = !0, Component;
|
|
@@ -38,7 +41,11 @@ function createTamaguiAnimatedComponent(tag = "div") {
|
|
|
38
41
|
const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
39
42
|
alignItems: !0,
|
|
40
43
|
backdropFilter: !0,
|
|
44
|
+
borderBottomStyle: !0,
|
|
45
|
+
borderLeftStyle: !0,
|
|
46
|
+
borderRightStyle: !0,
|
|
41
47
|
borderStyle: !0,
|
|
48
|
+
borderTopStyle: !0,
|
|
42
49
|
boxSizing: !0,
|
|
43
50
|
contain: !0,
|
|
44
51
|
cursor: !0,
|
|
@@ -49,23 +56,27 @@ const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = creat
|
|
|
49
56
|
justifyContent: !0,
|
|
50
57
|
maxHeight: !0,
|
|
51
58
|
maxWidth: !0,
|
|
59
|
+
minHeight: !0,
|
|
60
|
+
minWidth: !0,
|
|
61
|
+
outlineStyle: !0,
|
|
52
62
|
overflow: !0,
|
|
53
63
|
overflowX: !0,
|
|
54
64
|
overflowY: !0,
|
|
65
|
+
pointerEvents: !0,
|
|
55
66
|
position: !0,
|
|
56
67
|
shadowColor: !0,
|
|
57
68
|
textAlign: !0,
|
|
58
69
|
textOverflow: !0,
|
|
59
70
|
whiteSpace: !0,
|
|
60
71
|
wordWrap: !0,
|
|
61
|
-
zIndex: !0
|
|
72
|
+
zIndex: !0,
|
|
73
|
+
fontFamily: !0,
|
|
74
|
+
lineHeight: !0
|
|
62
75
|
};
|
|
63
76
|
function createAnimations(animations) {
|
|
64
77
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
View: import_react_native_reanimated.default.View,
|
|
68
|
-
Text: import_react_native_reanimated.default.Text,
|
|
78
|
+
View: import_web.isWeb ? AnimatedView : import_react_native_reanimated.default.View,
|
|
79
|
+
Text: import_web.isWeb ? AnimatedText : import_react_native_reanimated.default.Text,
|
|
69
80
|
isReactNative: !0,
|
|
70
81
|
animations,
|
|
71
82
|
usePresence: import_use_presence.usePresence,
|
|
@@ -120,21 +131,13 @@ function createAnimations(animations) {
|
|
|
120
131
|
else {
|
|
121
132
|
const animateOnly = props.animateOnly;
|
|
122
133
|
for (const key in style)
|
|
123
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
134
|
+
!import_web.stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
124
135
|
}
|
|
125
|
-
const animateStr = JSON.stringify(animate), styles = (0, import_react.useMemo)(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1],
|
|
126
|
-
onDidAnimate?.(), sendExitComplete?.();
|
|
127
|
-
}, []), motiProps = {
|
|
136
|
+
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
137
|
animate: isExiting || isHydrating ? {} : styles,
|
|
129
138
|
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),
|
|
139
|
+
usePresenceValue,
|
|
140
|
+
presenceContext,
|
|
138
141
|
exit: isExiting ? styles : void 0
|
|
139
142
|
}, moti = (0, import_author.useMotify)(motiProps);
|
|
140
143
|
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": ";;;;;;;;;;;;;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createTamaguiAnimatedComponent() {
|
|
|
85
85
|
var forwardedRef = _param.forwardedRef, style = _param.style, props = _object_without_properties(_param, [
|
|
86
86
|
"forwardedRef",
|
|
87
87
|
"style"
|
|
88
|
-
]), composedRefs = (0, import_web.useComposedRefs)(forwardedRef, ref), Element = props.tag || tag;
|
|
89
|
-
|
|
88
|
+
]), composedRefs = (0, import_web.useComposedRefs)(forwardedRef, ref), Element = props.tag || tag, webStyle = style;
|
|
89
|
+
(0, import_web.styleToCSS)(style), Array.isArray(webStyle.transform) && (style.transform = (0, import_web.transformsToString)(style.transform));
|
|
90
|
+
for (var key in style)
|
|
91
|
+
style[key] = (0, import_web.normalizeValueWithProperty)(style[key], key);
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Element, _object_spread_props(_object_spread({}, props), {
|
|
90
93
|
style,
|
|
91
94
|
ref: composedRefs
|
|
92
95
|
}));
|
|
@@ -96,7 +99,11 @@ function createTamaguiAnimatedComponent() {
|
|
|
96
99
|
var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
97
100
|
alignItems: !0,
|
|
98
101
|
backdropFilter: !0,
|
|
102
|
+
borderBottomStyle: !0,
|
|
103
|
+
borderLeftStyle: !0,
|
|
104
|
+
borderRightStyle: !0,
|
|
99
105
|
borderStyle: !0,
|
|
106
|
+
borderTopStyle: !0,
|
|
100
107
|
boxSizing: !0,
|
|
101
108
|
contain: !0,
|
|
102
109
|
cursor: !0,
|
|
@@ -107,23 +114,27 @@ var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createT
|
|
|
107
114
|
justifyContent: !0,
|
|
108
115
|
maxHeight: !0,
|
|
109
116
|
maxWidth: !0,
|
|
117
|
+
minHeight: !0,
|
|
118
|
+
minWidth: !0,
|
|
119
|
+
outlineStyle: !0,
|
|
110
120
|
overflow: !0,
|
|
111
121
|
overflowX: !0,
|
|
112
122
|
overflowY: !0,
|
|
123
|
+
pointerEvents: !0,
|
|
113
124
|
position: !0,
|
|
114
125
|
shadowColor: !0,
|
|
115
126
|
textAlign: !0,
|
|
116
127
|
textOverflow: !0,
|
|
117
128
|
whiteSpace: !0,
|
|
118
129
|
wordWrap: !0,
|
|
119
|
-
zIndex: !0
|
|
130
|
+
zIndex: !0,
|
|
131
|
+
fontFamily: !0,
|
|
132
|
+
lineHeight: !0
|
|
120
133
|
};
|
|
121
134
|
function createAnimations(animations) {
|
|
122
135
|
return {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
View: import_react_native_reanimated.default.View,
|
|
126
|
-
Text: import_react_native_reanimated.default.Text,
|
|
136
|
+
View: import_web.isWeb ? AnimatedView : import_react_native_reanimated.default.View,
|
|
137
|
+
Text: import_web.isWeb ? AnimatedText : import_react_native_reanimated.default.Text,
|
|
127
138
|
isReactNative: !0,
|
|
128
139
|
animations,
|
|
129
140
|
usePresence: import_use_presence.usePresence,
|
|
@@ -206,25 +217,17 @@ function createAnimations(animations) {
|
|
|
206
217
|
else {
|
|
207
218
|
var animateOnly = props.animateOnly;
|
|
208
219
|
for (var key in style)
|
|
209
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
220
|
+
!import_web.stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
210
221
|
}
|
|
211
222
|
var animateStr = JSON.stringify(animate), styles = (0, import_react.useMemo)(function() {
|
|
212
223
|
return JSON.parse(animateStr);
|
|
213
224
|
}, [
|
|
214
225
|
animateStr
|
|
215
|
-
]), isExiting = !!(presence != null && presence[1]),
|
|
216
|
-
onDidAnimate == null || onDidAnimate(), sendExitComplete == null || sendExitComplete();
|
|
217
|
-
}, []), motiProps = {
|
|
226
|
+
]), isExiting = !!(presence != null && presence[1]), presenceContext = (0, import_react.useContext)(import_use_presence.PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
218
227
|
animate: isExiting || isHydrating ? {} : styles,
|
|
219
228
|
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),
|
|
229
|
+
usePresenceValue,
|
|
230
|
+
presenceContext,
|
|
228
231
|
exit: isExiting ? styles : void 0
|
|
229
232
|
}, moti = (0, import_author.useMotify)(motiProps);
|
|
230
233
|
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", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,sBAA4D,kCAC5D,aASO,yBAEP,gBAA0B,wBAC1B,eAAgD,kBAEhD,iCASO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIP,SAASA,iCAAAA;MAA+BC,MAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAM,OACtCC,YAAYC,+BAAAA,QAASC,wBACzBC,6CAAW,SAAA,QAAyCC,KAAAA;QAAtCC,eAAAA,OAAAA,cAAcC,QAAAA,OAAAA,OAAUC,QAAAA,2BAAAA,QAAAA;MAAxBF;MAAcC;QACpBE,mBAAeC,4BAAgBJ,cAAcD,GAAAA,GAC7CM,UAAUH,MAAMR,OAAOA,KAGvBY,WAAWL;AACjBM,+BAAWN,KAAAA,GACPO,MAAMC,QAAQH,SAASI,SAAS,MAClCT,MAAMS,gBAAYC,+BAAmBV,MAAMS,SAAS;AAEtD,aAAWE,OAAOX;AAChBA,YAAMW,GAAAA,QAAOC,uCAA2BZ,MAAMW,GAAAA,GAAMA,GAAAA;AAGtD,WAAO,uCAAAE,KAACT,SAAAA,qBAAAA,eAAAA,CAAAA,GAAYH,KAAAA,GAAAA;MAAOD;MAAcF,KAAKI;;EAChD,CAAA,CAAA;AAEFR,mBAAU,gBAAmB,IACtBA;AACT;AAEA,IAAMoB,eAAetB,+BAA+B,KAAA,GAC9CuB,eAAevB,+BAA+B,MAAA,GAE9CwB,eAAe;EACnBC,YAAY;EACZC,gBAAgB;EAChBC,mBAAmB;EACnBC,iBAAiB;EACjBC,kBAAkB;EAClBC,aAAa;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BAAoBtB,YAAYuB,QAIhCC,YAAY;QAChBjB,SAASU,aAAaZ,cAAc,CAAC,IAAIU;QACzCU,YAAY9D,WAAWwC,YAAAA;QACvBmB;QACAH;QACAO,MAAMT,YAAYF,SAASQ;MAC7B,GAEMI,WAAOC,yBAAUJ,SAAAA;AAEvB,aAAIK,QAAQC,IAAIC,aAAa,iBAAiBtH,MAAM,SAClDuH,QAAQC,KAAM,cAAapB,KAAKC,UAAUU,WAAW,MAAM,CAAA,IAAK,KAAK;QACnEzB;QACAyB;QACAG;QACAnH,OAAO;UAACgG;UAAamB,KAAKnH;;MAC5B,CAAA,GAGK;QACLA,OAAO;UAACgG;UAAamB,KAAKnH;;MAC5B;IACF;EACF;AACF;",
|
|
5
|
+
"names": ["createTamaguiAnimatedComponent", "tag", "Component", "Animated", "createAnimatedComponent", "forwardRef", "ref", "forwardedRef", "style", "props", "composedRefs", "useComposedRefs", "Element", "webStyle", "styleToCSS", "Array", "isArray", "transform", "transformsToString", "key", "normalizeValueWithProperty", "_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", "fontFamily", "lineHeight", "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", "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,14 @@
|
|
|
1
1
|
import { PresenceContext, ResetPresence, usePresence } from "@tamagui/use-presence";
|
|
2
2
|
import {
|
|
3
|
+
isWeb,
|
|
3
4
|
transformsToString,
|
|
4
|
-
useComposedRefs
|
|
5
|
+
useComposedRefs,
|
|
6
|
+
stylePropsAll,
|
|
7
|
+
styleToCSS,
|
|
8
|
+
normalizeValueWithProperty
|
|
5
9
|
} from "@tamagui/web";
|
|
6
10
|
import { useMotify } from "moti/author";
|
|
7
|
-
import { forwardRef,
|
|
11
|
+
import { forwardRef, useContext, useMemo } from "react";
|
|
8
12
|
import Animated, {
|
|
9
13
|
cancelAnimation,
|
|
10
14
|
runOnJS,
|
|
@@ -19,8 +23,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
19
23
|
function createTamaguiAnimatedComponent(tag = "div") {
|
|
20
24
|
const Component = Animated.createAnimatedComponent(
|
|
21
25
|
forwardRef(({ forwardedRef, style, ...props }, ref) => {
|
|
22
|
-
const composedRefs = useComposedRefs(forwardedRef, ref), Element = props.tag || tag;
|
|
23
|
-
|
|
26
|
+
const composedRefs = useComposedRefs(forwardedRef, ref), Element = props.tag || tag, webStyle = style;
|
|
27
|
+
styleToCSS(style), Array.isArray(webStyle.transform) && (style.transform = transformsToString(style.transform));
|
|
28
|
+
for (const key in style)
|
|
29
|
+
style[key] = normalizeValueWithProperty(style[key], key);
|
|
30
|
+
return /* @__PURE__ */ jsx(Element, { ...props, style, ref: composedRefs });
|
|
24
31
|
})
|
|
25
32
|
);
|
|
26
33
|
return Component.acceptTagProp = !0, Component;
|
|
@@ -28,7 +35,11 @@ function createTamaguiAnimatedComponent(tag = "div") {
|
|
|
28
35
|
const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
29
36
|
alignItems: !0,
|
|
30
37
|
backdropFilter: !0,
|
|
38
|
+
borderBottomStyle: !0,
|
|
39
|
+
borderLeftStyle: !0,
|
|
40
|
+
borderRightStyle: !0,
|
|
31
41
|
borderStyle: !0,
|
|
42
|
+
borderTopStyle: !0,
|
|
32
43
|
boxSizing: !0,
|
|
33
44
|
contain: !0,
|
|
34
45
|
cursor: !0,
|
|
@@ -39,23 +50,27 @@ const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = creat
|
|
|
39
50
|
justifyContent: !0,
|
|
40
51
|
maxHeight: !0,
|
|
41
52
|
maxWidth: !0,
|
|
53
|
+
minHeight: !0,
|
|
54
|
+
minWidth: !0,
|
|
55
|
+
outlineStyle: !0,
|
|
42
56
|
overflow: !0,
|
|
43
57
|
overflowX: !0,
|
|
44
58
|
overflowY: !0,
|
|
59
|
+
pointerEvents: !0,
|
|
45
60
|
position: !0,
|
|
46
61
|
shadowColor: !0,
|
|
47
62
|
textAlign: !0,
|
|
48
63
|
textOverflow: !0,
|
|
49
64
|
whiteSpace: !0,
|
|
50
65
|
wordWrap: !0,
|
|
51
|
-
zIndex: !0
|
|
66
|
+
zIndex: !0,
|
|
67
|
+
fontFamily: !0,
|
|
68
|
+
lineHeight: !0
|
|
52
69
|
};
|
|
53
70
|
function createAnimations(animations) {
|
|
54
71
|
return {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
View: Animated.View,
|
|
58
|
-
Text: Animated.Text,
|
|
72
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
73
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
59
74
|
isReactNative: !0,
|
|
60
75
|
animations,
|
|
61
76
|
usePresence,
|
|
@@ -110,21 +125,13 @@ function createAnimations(animations) {
|
|
|
110
125
|
else {
|
|
111
126
|
const animateOnly = props.animateOnly;
|
|
112
127
|
for (const key in style)
|
|
113
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
128
|
+
!stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
114
129
|
}
|
|
115
|
-
const animateStr = JSON.stringify(animate), styles = useMemo(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1],
|
|
116
|
-
onDidAnimate?.(), sendExitComplete?.();
|
|
117
|
-
}, []), motiProps = {
|
|
130
|
+
const animateStr = JSON.stringify(animate), styles = useMemo(() => JSON.parse(animateStr), [animateStr]), isExiting = !!presence?.[1], presenceContext = useContext(PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
118
131
|
animate: isExiting || isHydrating ? {} : styles,
|
|
119
132
|
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),
|
|
133
|
+
usePresenceValue,
|
|
134
|
+
presenceContext,
|
|
128
135
|
exit: isExiting ? styles : void 0
|
|
129
136
|
}, moti = useMotify(motiProps);
|
|
130
137
|
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;AAAA,EACA;AAAA,
|
|
4
|
+
"mappings": "AAAA,SAAS,iBAAiB,eAAe,mBAAm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F;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -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, styleToCSS, normalizeValueWithProperty } 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") {
|
|
@@ -11,8 +11,11 @@ function createTamaguiAnimatedComponent(tag = "div") {
|
|
|
11
11
|
...props
|
|
12
12
|
}, ref) => {
|
|
13
13
|
const composedRefs = useComposedRefs(forwardedRef, ref),
|
|
14
|
-
Element = props.tag || tag
|
|
15
|
-
|
|
14
|
+
Element = props.tag || tag,
|
|
15
|
+
webStyle = style;
|
|
16
|
+
styleToCSS(style), Array.isArray(webStyle.transform) && (style.transform = transformsToString(style.transform));
|
|
17
|
+
for (const key in style) style[key] = normalizeValueWithProperty(style[key], key);
|
|
18
|
+
return /* @__PURE__ */jsx(Element, {
|
|
16
19
|
...props,
|
|
17
20
|
style,
|
|
18
21
|
ref: composedRefs
|
|
@@ -25,7 +28,11 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
25
28
|
neverAnimate = {
|
|
26
29
|
alignItems: !0,
|
|
27
30
|
backdropFilter: !0,
|
|
31
|
+
borderBottomStyle: !0,
|
|
32
|
+
borderLeftStyle: !0,
|
|
33
|
+
borderRightStyle: !0,
|
|
28
34
|
borderStyle: !0,
|
|
35
|
+
borderTopStyle: !0,
|
|
29
36
|
boxSizing: !0,
|
|
30
37
|
contain: !0,
|
|
31
38
|
cursor: !0,
|
|
@@ -36,23 +43,27 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
36
43
|
justifyContent: !0,
|
|
37
44
|
maxHeight: !0,
|
|
38
45
|
maxWidth: !0,
|
|
46
|
+
minHeight: !0,
|
|
47
|
+
minWidth: !0,
|
|
48
|
+
outlineStyle: !0,
|
|
39
49
|
overflow: !0,
|
|
40
50
|
overflowX: !0,
|
|
41
51
|
overflowY: !0,
|
|
52
|
+
pointerEvents: !0,
|
|
42
53
|
position: !0,
|
|
43
54
|
shadowColor: !0,
|
|
44
55
|
textAlign: !0,
|
|
45
56
|
textOverflow: !0,
|
|
46
57
|
whiteSpace: !0,
|
|
47
58
|
wordWrap: !0,
|
|
48
|
-
zIndex: !0
|
|
59
|
+
zIndex: !0,
|
|
60
|
+
fontFamily: !0,
|
|
61
|
+
lineHeight: !0
|
|
49
62
|
};
|
|
50
63
|
function createAnimations(animations) {
|
|
51
64
|
return {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
View: Animated.View,
|
|
55
|
-
Text: Animated.Text,
|
|
65
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
66
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
56
67
|
isReactNative: !0,
|
|
57
68
|
animations,
|
|
58
69
|
usePresence,
|
|
@@ -116,26 +127,18 @@ function createAnimations(animations) {
|
|
|
116
127
|
dontAnimate = {};
|
|
117
128
|
if (isHydrating) dontAnimate = style;else {
|
|
118
129
|
const animateOnly = props.animateOnly;
|
|
119
|
-
for (const key in style) neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
130
|
+
for (const key in style) !stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
120
131
|
}
|
|
121
132
|
const animateStr = JSON.stringify(animate),
|
|
122
133
|
styles = useMemo(() => JSON.parse(animateStr), [animateStr]),
|
|
123
134
|
isExiting = !!presence?.[1],
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
onDidAnimate?.(), sendExitComplete?.();
|
|
127
|
-
}, []),
|
|
135
|
+
presenceContext = useContext(PresenceContext),
|
|
136
|
+
usePresenceValue = presence || void 0,
|
|
128
137
|
motiProps = {
|
|
129
138
|
animate: isExiting || isHydrating ? {} : styles,
|
|
130
139
|
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),
|
|
140
|
+
usePresenceValue,
|
|
141
|
+
presenceContext,
|
|
139
142
|
exit: isExiting ? styles : void 0
|
|
140
143
|
},
|
|
141
144
|
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, styleToCSS, normalizeValueWithProperty } 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, {
|
|
@@ -62,8 +62,11 @@ function createTamaguiAnimatedComponent() {
|
|
|
62
62
|
var forwardedRef = _param.forwardedRef, style = _param.style, props = _object_without_properties(_param, [
|
|
63
63
|
"forwardedRef",
|
|
64
64
|
"style"
|
|
65
|
-
]), composedRefs = useComposedRefs(forwardedRef, ref), Element = props.tag || tag;
|
|
66
|
-
|
|
65
|
+
]), composedRefs = useComposedRefs(forwardedRef, ref), Element = props.tag || tag, webStyle = style;
|
|
66
|
+
styleToCSS(style), Array.isArray(webStyle.transform) && (style.transform = transformsToString(style.transform));
|
|
67
|
+
for (var key in style)
|
|
68
|
+
style[key] = normalizeValueWithProperty(style[key], key);
|
|
69
|
+
return /* @__PURE__ */ _jsx(Element, _object_spread_props(_object_spread({}, props), {
|
|
67
70
|
style,
|
|
68
71
|
ref: composedRefs
|
|
69
72
|
}));
|
|
@@ -73,7 +76,11 @@ function createTamaguiAnimatedComponent() {
|
|
|
73
76
|
var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), neverAnimate = {
|
|
74
77
|
alignItems: !0,
|
|
75
78
|
backdropFilter: !0,
|
|
79
|
+
borderBottomStyle: !0,
|
|
80
|
+
borderLeftStyle: !0,
|
|
81
|
+
borderRightStyle: !0,
|
|
76
82
|
borderStyle: !0,
|
|
83
|
+
borderTopStyle: !0,
|
|
77
84
|
boxSizing: !0,
|
|
78
85
|
contain: !0,
|
|
79
86
|
cursor: !0,
|
|
@@ -84,23 +91,27 @@ var AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createT
|
|
|
84
91
|
justifyContent: !0,
|
|
85
92
|
maxHeight: !0,
|
|
86
93
|
maxWidth: !0,
|
|
94
|
+
minHeight: !0,
|
|
95
|
+
minWidth: !0,
|
|
96
|
+
outlineStyle: !0,
|
|
87
97
|
overflow: !0,
|
|
88
98
|
overflowX: !0,
|
|
89
99
|
overflowY: !0,
|
|
100
|
+
pointerEvents: !0,
|
|
90
101
|
position: !0,
|
|
91
102
|
shadowColor: !0,
|
|
92
103
|
textAlign: !0,
|
|
93
104
|
textOverflow: !0,
|
|
94
105
|
whiteSpace: !0,
|
|
95
106
|
wordWrap: !0,
|
|
96
|
-
zIndex: !0
|
|
107
|
+
zIndex: !0,
|
|
108
|
+
fontFamily: !0,
|
|
109
|
+
lineHeight: !0
|
|
97
110
|
};
|
|
98
111
|
function createAnimations(animations) {
|
|
99
112
|
return {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
View: Animated.View,
|
|
103
|
-
Text: Animated.Text,
|
|
113
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
114
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
104
115
|
isReactNative: !0,
|
|
105
116
|
animations,
|
|
106
117
|
usePresence,
|
|
@@ -183,25 +194,17 @@ function createAnimations(animations) {
|
|
|
183
194
|
else {
|
|
184
195
|
var animateOnly = props.animateOnly;
|
|
185
196
|
for (var key in style)
|
|
186
|
-
neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
197
|
+
!stylePropsAll[key] || neverAnimate[key] || animateOnly && !animateOnly.includes(key) ? dontAnimate[key] = style[key] : animate[key] = style[key];
|
|
187
198
|
}
|
|
188
199
|
var animateStr = JSON.stringify(animate), styles = useMemo(function() {
|
|
189
200
|
return JSON.parse(animateStr);
|
|
190
201
|
}, [
|
|
191
202
|
animateStr
|
|
192
|
-
]), isExiting = !!(presence != null && presence[1]),
|
|
193
|
-
onDidAnimate == null || onDidAnimate(), sendExitComplete == null || sendExitComplete();
|
|
194
|
-
}, []), motiProps = {
|
|
203
|
+
]), isExiting = !!(presence != null && presence[1]), presenceContext = useContext(PresenceContext), usePresenceValue = presence || void 0, motiProps = {
|
|
195
204
|
animate: isExiting || isHydrating ? {} : styles,
|
|
196
205
|
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),
|
|
206
|
+
usePresenceValue,
|
|
207
|
+
presenceContext,
|
|
205
208
|
exit: isExiting ? styles : void 0
|
|
206
209
|
}, moti = useMotify(motiProps);
|
|
207
210
|
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,eAGAC,YACAC,kCACK;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,eAAezB,gBAAgBsB,cAAcD,GAAAA,GAC7CK,UAAUF,MAAMN,OAAOA,KAGvBS,WAAWJ;AACjBrB,eAAWqB,KAAAA,GACPK,MAAMC,QAAQF,SAASG,SAAS,MAClCP,MAAMO,YAAY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;AAChB,UACE,CAACtB,cAAc8B,GAAAA,KACfG,aAAaH,GAAAA,KACZwE,eAAe,CAACA,YAAYC,SAASzE,GAAAA,IAEtCuE,YAAYvE,GAAAA,IAAOR,MAAMQ,GAAAA,IAEzBsE,QAAQtE,GAAAA,IAAOR,MAAMQ,GAAAA;MAG3B;AAIA,UAAM0E,aAAaC,KAAKC,UAAUN,OAAAA,GAC5BO,SAASrG,QAAQ,WAAA;eAAMmG,KAAKG,MAAMJ,UAAAA;SAAa;QAACA;OAAW,GAE3DK,YAAYC,GAAQjB,YAAAA,QAAAA,SAAW,CAAA,IAC/BkB,kBAAkB1G,WAAWX,eAAAA,GAC7BsH,mBAAoBnB,YAAYoB,QAIhCC,YAAY;QAChBd,SAASS,aAAaX,cAAc,CAAC,IAAIS;QACzCQ,YAAY/C,WAAW4B,YAAAA;QACvBgB;QACAD;QACAK,MAAMP,YAAYF,SAASM;MAC7B,GAEMI,OAAOlH,UAAU+G,SAAAA;AAEvB,aAAII,QAAQC,IAAIC,aAAa,iBAAiBjG,MAAM,SAClDkG,QAAQC,KAAM,cAAajB,KAAKC,UAAUQ,WAAW,MAAM,CAAA,IAAK,KAAK;QACnEtB;QACAsB;QACAG;QACA/F,OAAO;UAAC+E;UAAagB,KAAK/F;;MAC5B,CAAA,GAGK;QACLA,OAAO;UAAC+E;UAAagB,KAAK/F;;MAC5B;IACF;EACF;AACF;",
|
|
5
|
+
"names": ["PresenceContext", "ResetPresence", "usePresence", "isWeb", "transformsToString", "useComposedRefs", "stylePropsAll", "styleToCSS", "normalizeValueWithProperty", "useMotify", "forwardRef", "useContext", "useMemo", "Animated", "cancelAnimation", "runOnJS", "useAnimatedReaction", "useAnimatedStyle", "useDerivedValue", "useSharedValue", "withSpring", "withTiming", "createTamaguiAnimatedComponent", "tag", "Component", "createAnimatedComponent", "ref", "forwardedRef", "style", "props", "composedRefs", "Element", "webStyle", "Array", "isArray", "transform", "key", "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", "fontFamily", "lineHeight", "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", "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.5",
|
|
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.5",
|
|
19
|
+
"@tamagui/web": "1.90.5",
|
|
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.5",
|
|
25
25
|
"react-native-reanimated": "~3.6.2"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
package/src/createAnimations.tsx
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
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,
|
|
9
|
+
styleToCSS,
|
|
10
|
+
normalizeValueWithProperty,
|
|
7
11
|
} from '@tamagui/web'
|
|
8
12
|
import type { MotiTransition } from 'moti'
|
|
9
13
|
import { useMotify } from 'moti/author'
|
|
10
|
-
import { forwardRef,
|
|
14
|
+
import { forwardRef, useContext, useMemo } from 'react'
|
|
11
15
|
import type { SharedValue } from 'react-native-reanimated'
|
|
12
16
|
import Animated, {
|
|
13
17
|
cancelAnimation,
|
|
@@ -27,10 +31,17 @@ function createTamaguiAnimatedComponent(tag = 'div') {
|
|
|
27
31
|
forwardRef(({ forwardedRef, style, ...props }: any, ref) => {
|
|
28
32
|
const composedRefs = useComposedRefs(forwardedRef, ref)
|
|
29
33
|
const Element = props.tag || tag
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
|
|
35
|
+
// TODO this block should be exported by web as styleToWebStyle()
|
|
36
|
+
const webStyle = style
|
|
37
|
+
styleToCSS(style)
|
|
38
|
+
if (Array.isArray(webStyle.transform)) {
|
|
32
39
|
style.transform = transformsToString(style.transform)
|
|
33
40
|
}
|
|
41
|
+
for (const key in style) {
|
|
42
|
+
style[key] = normalizeValueWithProperty(style[key], key)
|
|
43
|
+
}
|
|
44
|
+
|
|
34
45
|
return <Element {...props} style={style} ref={composedRefs} />
|
|
35
46
|
})
|
|
36
47
|
)
|
|
@@ -44,7 +55,11 @@ const AnimatedText = createTamaguiAnimatedComponent('span')
|
|
|
44
55
|
const neverAnimate = {
|
|
45
56
|
alignItems: true,
|
|
46
57
|
backdropFilter: true,
|
|
58
|
+
borderBottomStyle: true,
|
|
59
|
+
borderLeftStyle: true,
|
|
60
|
+
borderRightStyle: true,
|
|
47
61
|
borderStyle: true,
|
|
62
|
+
borderTopStyle: true,
|
|
48
63
|
boxSizing: true,
|
|
49
64
|
contain: true,
|
|
50
65
|
cursor: true,
|
|
@@ -55,9 +70,13 @@ const neverAnimate = {
|
|
|
55
70
|
justifyContent: true,
|
|
56
71
|
maxHeight: true,
|
|
57
72
|
maxWidth: true,
|
|
73
|
+
minHeight: true,
|
|
74
|
+
minWidth: true,
|
|
75
|
+
outlineStyle: true,
|
|
58
76
|
overflow: true,
|
|
59
77
|
overflowX: true,
|
|
60
78
|
overflowY: true,
|
|
79
|
+
pointerEvents: true,
|
|
61
80
|
position: true,
|
|
62
81
|
shadowColor: true,
|
|
63
82
|
textAlign: true,
|
|
@@ -65,16 +84,17 @@ const neverAnimate = {
|
|
|
65
84
|
whiteSpace: true,
|
|
66
85
|
wordWrap: true,
|
|
67
86
|
zIndex: true,
|
|
87
|
+
|
|
88
|
+
fontFamily: true,
|
|
89
|
+
lineHeight: true,
|
|
68
90
|
}
|
|
69
91
|
|
|
70
92
|
export function createAnimations<A extends Record<string, MotiTransition>>(
|
|
71
93
|
animations: A
|
|
72
94
|
): AnimationDriver<A> {
|
|
73
95
|
return {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
View: Animated.View,
|
|
77
|
-
Text: Animated.Text,
|
|
96
|
+
View: isWeb ? AnimatedView : Animated.View,
|
|
97
|
+
Text: isWeb ? AnimatedText : Animated.Text,
|
|
78
98
|
isReactNative: true,
|
|
79
99
|
animations,
|
|
80
100
|
usePresence,
|
|
@@ -163,7 +183,11 @@ export function createAnimations<A extends Record<string, MotiTransition>>(
|
|
|
163
183
|
} else {
|
|
164
184
|
const animateOnly = props.animateOnly as string[]
|
|
165
185
|
for (const key in style) {
|
|
166
|
-
if (
|
|
186
|
+
if (
|
|
187
|
+
!stylePropsAll[key] ||
|
|
188
|
+
neverAnimate[key] ||
|
|
189
|
+
(animateOnly && !animateOnly.includes(key))
|
|
190
|
+
) {
|
|
167
191
|
dontAnimate[key] = style[key]
|
|
168
192
|
} else {
|
|
169
193
|
animate[key] = style[key]
|
|
@@ -177,26 +201,16 @@ export function createAnimations<A extends Record<string, MotiTransition>>(
|
|
|
177
201
|
const styles = useMemo(() => JSON.parse(animateStr), [animateStr])
|
|
178
202
|
|
|
179
203
|
const isExiting = Boolean(presence?.[1])
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
const onDidAnimateCombined = useCallback(() => {
|
|
183
|
-
onDidAnimate?.()
|
|
184
|
-
sendExitComplete?.()
|
|
185
|
-
}, [])
|
|
204
|
+
const presenceContext = useContext(PresenceContext)
|
|
205
|
+
const usePresenceValue = (presence || undefined) as any
|
|
186
206
|
|
|
187
207
|
type UseMotiProps = Parameters<typeof useMotify>[0]
|
|
188
208
|
|
|
189
209
|
const motiProps = {
|
|
190
210
|
animate: isExiting || isHydrating ? {} : styles,
|
|
191
211
|
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),
|
|
212
|
+
usePresenceValue,
|
|
213
|
+
presenceContext,
|
|
200
214
|
exit: isExiting ? styles : undefined,
|
|
201
215
|
} satisfies UseMotiProps
|
|
202
216
|
|
|
@@ -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,EAIrB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAA;AAgF1C,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EACvE,UAAU,EAAE,CAAC,GACZ,eAAe,CAAC,CAAC,CAAC,CA2IpB"}
|