@tamagui/animations-moti 2.0.0-rc.3 → 2.0.0-rc.30
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.cjs +2 -2
- package/dist/cjs/createAnimations.native.js +2 -2
- package/dist/cjs/createAnimations.native.js.map +1 -1
- package/dist/cjs/index.js +12 -9
- package/dist/esm/createAnimations.mjs +2 -2
- package/dist/esm/createAnimations.mjs.map +1 -1
- package/dist/esm/createAnimations.native.js +2 -2
- package/dist/esm/createAnimations.native.js.map +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +0 -1
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +9 -12
- package/src/createAnimations.tsx +2 -2
- package/types/createAnimations.d.ts.map +3 -3
- package/types/index.d.ts.map +2 -2
- package/types/polyfill.d.ts.map +2 -2
- package/dist/cjs/createAnimations.js +0 -220
- package/dist/cjs/createAnimations.js.map +0 -6
- package/dist/cjs/polyfill.js +0 -3
- package/dist/cjs/polyfill.js.map +0 -6
- package/dist/esm/createAnimations.js +0 -218
- package/dist/esm/createAnimations.js.map +0 -6
- package/dist/esm/polyfill.js +0 -3
- package/dist/esm/polyfill.js.map +0 -6
|
@@ -77,7 +77,7 @@ function createTamaguiAnimatedComponent(defaultTag = "div") {
|
|
|
77
77
|
ref: composedRefs
|
|
78
78
|
});
|
|
79
79
|
}));
|
|
80
|
-
return Component.
|
|
80
|
+
return Component.acceptRenderProp = !0, Component;
|
|
81
81
|
}
|
|
82
82
|
const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
83
83
|
AnimatedText = createTamaguiAnimatedComponent("span"),
|
|
@@ -113,12 +113,12 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
113
113
|
};
|
|
114
114
|
function createAnimations(animations) {
|
|
115
115
|
return {
|
|
116
|
+
needsCustomComponent: !0,
|
|
116
117
|
View: import_core.isWeb ? AnimatedView : Animated.View,
|
|
117
118
|
Text: import_core.isWeb ? AnimatedText : Animated.Text,
|
|
118
119
|
// View: Animated.View,
|
|
119
120
|
// Text: Animated.Text,
|
|
120
121
|
isReactNative: !0,
|
|
121
|
-
supportsCSS: !1,
|
|
122
122
|
inputStyle: "value",
|
|
123
123
|
outputStyle: "inline",
|
|
124
124
|
animations,
|
|
@@ -94,7 +94,7 @@ function createTamaguiAnimatedComponent() {
|
|
|
94
94
|
ref: composedRefs
|
|
95
95
|
});
|
|
96
96
|
}));
|
|
97
|
-
return Component.
|
|
97
|
+
return Component.acceptRenderProp = !0, Component;
|
|
98
98
|
}
|
|
99
99
|
var AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
100
100
|
AnimatedText = createTamaguiAnimatedComponent("span"),
|
|
@@ -130,12 +130,12 @@ var AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
130
130
|
};
|
|
131
131
|
function createAnimations(animations) {
|
|
132
132
|
return {
|
|
133
|
+
needsCustomComponent: !0,
|
|
133
134
|
View: import_core.isWeb ? AnimatedView : Animated.View,
|
|
134
135
|
Text: import_core.isWeb ? AnimatedText : Animated.Text,
|
|
135
136
|
// View: Animated.View,
|
|
136
137
|
// Text: Animated.Text,
|
|
137
138
|
isReactNative: !0,
|
|
138
|
-
supportsCSS: !1,
|
|
139
139
|
inputStyle: "value",
|
|
140
140
|
outputStyle: "inline",
|
|
141
141
|
animations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","createAnimations_exports","__export","createAnimations","module","exports","import_jsx_runtime","require","import_use_presence","import_core","import_author","import_react","__toESM","import_react_native_reanimated","_type_of","obj","Symbol","constructor","resolveDynamicValue","isDark","dynamicValue","dynamic","dark","light","safeESModule","a","b","out","__esModule","toStringTag","default","Animated","createTamaguiAnimatedComponent","defaultTag","arguments","length","isText","Component","createAnimatedComponent","forwardRef","propsIn","ref","_hooks_usePropsTransform","forwardedRef","animation","render","propsRest","hostRef","useRef","composedRefs","useComposedRefs","stateRef","current","host","_","state","useThemeWithState","result","getSplitStyles","Text","staticConfig","View","theme","name","unmounted","isAnimated","noClass","props","viewProps","Element","transformedProps","hooks","usePropsTransform","call","jsx","
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","createAnimations_exports","__export","createAnimations","module","exports","import_jsx_runtime","require","import_use_presence","import_core","import_author","import_react","__toESM","import_react_native_reanimated","_type_of","obj","Symbol","constructor","resolveDynamicValue","isDark","dynamicValue","dynamic","dark","light","safeESModule","a","b","out","__esModule","toStringTag","default","Animated","createTamaguiAnimatedComponent","defaultTag","arguments","length","isText","Component","createAnimatedComponent","forwardRef","propsIn","ref","_hooks_usePropsTransform","forwardedRef","animation","render","propsRest","hostRef","useRef","composedRefs","useComposedRefs","stateRef","current","host","_","state","useThemeWithState","result","getSplitStyles","Text","staticConfig","View","theme","name","unmounted","isAnimated","noClass","props","viewProps","Element","transformedProps","hooks","usePropsTransform","call","jsx","acceptRenderProp","AnimatedView","AnimatedText","onlyAnimateKeys","transform","opacity","height","width","backgroundColor","borderColor","borderLeftColor","borderRightColor","borderTopColor","borderBottomColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","color","left","right","top","bottom","fontSize","fontWeight","lineHeight","letterSpacing","animations","needsCustomComponent","isWeb","isReactNative","inputStyle","outputStyle","usePresence","ResetPresence","useAnimatedNumber","initial","sharedValue","useSharedValue","useMemo","getInstance","getValue","setValue","next","config","type","onFinish","withSpring","runOnJS","withTiming","stop","cancelAnimation","useAnimatedNumberReaction","param","onValue","instance","useAnimatedReaction","prev","useAnimatedNumberStyle","val","getStyle","derivedValue","useDerivedValue","useAnimatedStyle","useAnimations","animationProps","_themeState_name","presence","style","componentState","animationKey","Array","isArray","transition","isHydrating","disableAnimation","presenceContext","useContext","PresenceContext","themeState","scheme","startsWith","dontAnimate","motiProps","animate","dontAnimate2","key","rawValue","animateOnly","key1","rawValue1","value1","includes","key2","rawValue2","value2","styles","isExiting","usePresenceValue","duration","hasClonedTransition","key3","Object","assign"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAT,YAA4D,CAAAK,wBAAA;AAe5D,IAAAK,kBAAM,GAAAC,OAAuB,oBACvB;EAAAC,mBAA0B,GAAAD,OAAY,wBACnB;EAAAE,WAAe,GAAAF,OAAQ,gBAAa,CAAQ;EAAAG,aAwB/D,GAAAH,OAAA,cAAiD;EAAAI,YAAA,GAAAC,OAAA,CAAAL,OAAA;EAAAM,8BAAA,GAAAD,OAAA,CAAAL,OAAA;AACrD,SAAMO,QAAIA,CAAAC,GAAA;EAGV,uBAFc;;EAGhB,OAEMA,GAAA,IAAW,OAAAC,MAAa,UAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAS,qBAAAD,GAAA;AAOvC;AACE,IAAAG,mBAAe,YAAAA,CAAelB,KAExB,EAAAmB,MAAA;IAAqB,IAAAnB,KACzB,YAAAA,KAAA,MAAY,cAAc,GAAQc,QAAA,CAAAd,KAAA,gCAAAA,KAAA;MAChC,IAAAoB,YAAQ,GAAAD,MAAc,GAAAnB,KAAA,CAAAqB,OAAW,CAAAC,IAAS,GAAAtB,KAAA,CAAAqB,OAAe,CAAAE,KAAA;MAIzD,OAAKH,YAAS;IACO;IAEf,OAAApB,KAAA;EAAe;EAAAwB,YACjB,YAAAA,CAAAC,CAAA;IAAA,IACFC,C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;YAC5B,IAAA7B,MAAA,GAAAzD,KAAA,CAAAsF,UAAA;YACA,IAAA7B,MAAA,YAAAA,MAAA,uBAAA9G,QAAA,CAAA8G,MAAA,iBACA,SAAAyD,IAAA,IAAAzD,MAAA;cACA,IAAQe,GAAA,GAAAf,MAAa,CAAAyD,IAAK;cAIvBD,mBAAA,KAAA3B,UAAA,GAAA6B,MAAA,CAAAC,MAAA,KAAA9B,UAAA,GAAA2B,mBAAA,eAAAzC,GAAA,eAAAc,UAAA,CAAA4B,IAAA,IAAA1E,UAAA,CAAAgC,GAAA,IAAAc,UAAA,CAAA4B,IAAA,IAAA1C,GAAA;YACL;UACF;UACF;YACFuB,WAAA,EAAAG,YAAA;YACFF,SAAA","ignoreList":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,14 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
12
16
|
var index_exports = {};
|
|
13
17
|
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
var import_polyfill = require("./polyfill");
|
|
15
|
-
__reExport(index_exports, require("./createAnimations"), module.exports);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
18
|
+
var import_polyfill = require("./polyfill.cjs");
|
|
19
|
+
__reExport(index_exports, require("./createAnimations.cjs"), module.exports);
|
|
@@ -41,7 +41,7 @@ function createTamaguiAnimatedComponent(defaultTag = "div") {
|
|
|
41
41
|
ref: composedRefs
|
|
42
42
|
});
|
|
43
43
|
}));
|
|
44
|
-
return Component.
|
|
44
|
+
return Component.acceptRenderProp = !0, Component;
|
|
45
45
|
}
|
|
46
46
|
const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
47
47
|
AnimatedText = createTamaguiAnimatedComponent("span"),
|
|
@@ -77,12 +77,12 @@ const AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
77
77
|
};
|
|
78
78
|
function createAnimations(animations) {
|
|
79
79
|
return {
|
|
80
|
+
needsCustomComponent: !0,
|
|
80
81
|
View: isWeb ? AnimatedView : Animated.View,
|
|
81
82
|
Text: isWeb ? AnimatedText : Animated.Text,
|
|
82
83
|
// View: Animated.View,
|
|
83
84
|
// Text: Animated.Text,
|
|
84
85
|
isReactNative: !0,
|
|
85
|
-
supportsCSS: !1,
|
|
86
86
|
inputStyle: "value",
|
|
87
87
|
outputStyle: "inline",
|
|
88
88
|
animations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PresenceContext","ResetPresence","usePresence","getSplitStyles","hooks","isWeb","Text","useComposedRefs","useThemeWithState","View","useMotify","React","forwardRef","useMemo","useRef","Animated_","cancelAnimation","runOnJS","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","withTiming","jsx","resolveDynamicValue","value","isDark","dynamic","dark","light","safeESModule","a","b","__esModule","Symbol","toStringTag","default","Animated","createTamaguiAnimatedComponent","defaultTag","isText","Component","createAnimatedComponent","propsIn","ref","forwardedRef","animation","render","propsRest","hostRef","composedRefs","stateRef","current","host","_","state","props","staticConfig","theme","name","unmounted","isAnimated","noClass","viewProps","Element","transformedProps","usePropsTransform","
|
|
1
|
+
{"version":3,"names":["PresenceContext","ResetPresence","usePresence","getSplitStyles","hooks","isWeb","Text","useComposedRefs","useThemeWithState","View","useMotify","React","forwardRef","useMemo","useRef","Animated_","cancelAnimation","runOnJS","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","withTiming","jsx","resolveDynamicValue","value","isDark","dynamic","dark","light","safeESModule","a","b","__esModule","Symbol","toStringTag","default","Animated","createTamaguiAnimatedComponent","defaultTag","isText","Component","createAnimatedComponent","propsIn","ref","forwardedRef","animation","render","propsRest","hostRef","composedRefs","stateRef","current","host","_","state","props","staticConfig","theme","name","unmounted","isAnimated","noClass","viewProps","Element","transformedProps","usePropsTransform","acceptRenderProp","AnimatedView","AnimatedText","onlyAnimateKeys","transform","opacity","height","width","backgroundColor","borderColor","borderLeftColor","borderRightColor","borderTopColor","borderBottomColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","color","left","right","top","bottom","fontSize","fontWeight","lineHeight","letterSpacing","createAnimations","animations","needsCustomComponent","isReactNative","inputStyle","outputStyle","useAnimatedNumber","initial","sharedValue","getInstance","getValue","setValue","next","config","type","onFinish","stop","useAnimatedNumberReaction","onValue","instance","prev","useAnimatedNumberStyle","val","getStyle","derivedValue","useAnimations","animationProps","presence","style","componentState","animationKey","Array","isArray","transition","isHydrating","disableAnimation","presenceContext","useContext","themeState","scheme","startsWith","dontAnimate","motiProps","animate","dontAnimate2","key","rawValue","animateOnly","includes","styles","isExiting","usePresenceValue","duration","hasClonedTransition","Object","assign","exit","JSON","stringify","moti","process","env","NODE_ENV","debug","console","info"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,eAAA,EAAiBC,aAAA,EAAeC,WAAA,QAAmB;AAE5D,SACEC,cAAA,EACAC,KAAA,EACAC,KAAA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A,CAAUoI,SAAS;MAEhC,OACEkB,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBACzBzG,KAAA,CAAM0G,KAAA,IACN1G,KAAA,CAAM0G,KAAA,KAAa,aAEnBC,OAAA,CAAQC,IAAA,CAAK,cAAcR,IAAA,CAAKC,SAAA,CAAUhB,SAAA,EAAW,MAAM,CAAC,IAAI,KAAK;QACnE,4BAA4Bb,cAAA,CAAepE,SAAA;QAC3CiE,cAAA;QACAgB,SAAA;QACAiB,IAAA;QACA/B,KAAA,EAAO,CAACa,WAAA,EAAakB,IAAA,CAAK/B,KAAK;MACjC,CAAC,GAGI;QACLA,KAAA,EAAO,CAACa,WAAA,EAAakB,IAAA,CAAK/B,KAAK;MACjC;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -56,7 +56,7 @@ function createTamaguiAnimatedComponent() {
|
|
|
56
56
|
ref: composedRefs
|
|
57
57
|
});
|
|
58
58
|
}));
|
|
59
|
-
return Component.
|
|
59
|
+
return Component.acceptRenderProp = !0, Component;
|
|
60
60
|
}
|
|
61
61
|
var AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
62
62
|
AnimatedText = createTamaguiAnimatedComponent("span"),
|
|
@@ -92,12 +92,12 @@ var AnimatedView = createTamaguiAnimatedComponent("div"),
|
|
|
92
92
|
};
|
|
93
93
|
function createAnimations(animations) {
|
|
94
94
|
return {
|
|
95
|
+
needsCustomComponent: !0,
|
|
95
96
|
View: isWeb ? AnimatedView : Animated.View,
|
|
96
97
|
Text: isWeb ? AnimatedText : Animated.Text,
|
|
97
98
|
// View: Animated.View,
|
|
98
99
|
// Text: Animated.Text,
|
|
99
100
|
isReactNative: !0,
|
|
100
|
-
supportsCSS: !1,
|
|
101
101
|
inputStyle: "value",
|
|
102
102
|
outputStyle: "inline",
|
|
103
103
|
animations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","PresenceContext","ResetPresence","usePresence","getSplitStyles","hooks","isWeb","Text","useComposedRefs","useThemeWithState","View","useMotify","React","forwardRef","useMemo","useRef","Animated_","cancelAnimation","runOnJS","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","withTiming","_type_of","obj","Symbol","constructor","resolveDynamicValue","value","isDark","dynamicValue","dynamic","dark","light","safeESModule","a","b","out","__esModule","toStringTag","default","Animated","createTamaguiAnimatedComponent","defaultTag","arguments","length","isText","Component","createAnimatedComponent","propsIn","ref","_hooks_usePropsTransform","forwardedRef","animation","render","propsRest","hostRef","composedRefs","stateRef","current","host","_","state","result","staticConfig","theme","name","unmounted","isAnimated","noClass","props","viewProps","Element","transformedProps","usePropsTransform","call","
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","PresenceContext","ResetPresence","usePresence","getSplitStyles","hooks","isWeb","Text","useComposedRefs","useThemeWithState","View","useMotify","React","forwardRef","useMemo","useRef","Animated_","cancelAnimation","runOnJS","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","withTiming","_type_of","obj","Symbol","constructor","resolveDynamicValue","value","isDark","dynamicValue","dynamic","dark","light","safeESModule","a","b","out","__esModule","toStringTag","default","Animated","createTamaguiAnimatedComponent","defaultTag","arguments","length","isText","Component","createAnimatedComponent","propsIn","ref","_hooks_usePropsTransform","forwardedRef","animation","render","propsRest","hostRef","composedRefs","stateRef","current","host","_","state","result","staticConfig","theme","name","unmounted","isAnimated","noClass","props","viewProps","Element","transformedProps","usePropsTransform","call","acceptRenderProp","AnimatedView","AnimatedText","onlyAnimateKeys","transform","opacity","height","width","backgroundColor","borderColor","borderLeftColor","borderRightColor","borderTopColor","borderBottomColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","color","left","right","top","bottom","fontSize","fontWeight","lineHeight","letterSpacing","createAnimations","animations","needsCustomComponent","isReactNative","inputStyle","outputStyle","useAnimatedNumber","initial","sharedValue","getInstance","getValue","setValue","next","config","type","onFinish","stop","useAnimatedNumberReaction","param","onValue","instance","prev","useAnimatedNumberStyle","val","getStyle","derivedValue","useAnimations","animationProps","_themeState_name","presence","style","componentState","animationKey","Array","isArray","transition","isHydrating","disableAnimation","presenceContext","useContext","themeState","scheme","startsWith","dontAnimate","motiProps","animate","dontAnimate2","key","rawValue","animateOnly","key1","rawValue1","value1","includes","key2","rawValue2","value2","styles","isExiting","usePresenceValue","duration","hasClonedTransition","key3","Object","assign","exit","JSON","stringify","moti"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,QAAiB,mBAAe;AAEzC,SAAAC,eAAA,EAAAC,aAAA,EAAAC,WAAA;AAAA,SACEC,cAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,IAAA,EAAAC,eAAA,EAAAC,iBAAA,EAAAC,IAAA;AAAA,SACAC,SAAA;AAAA,OACAC,KAAA,IAAAC,UAAA,EAAAC,OAAA,EAAAC,MAAA;AAAA,OACAC,SAAA,IAAAC,eAAA,EAAAC,OAAA,EAAAC,mBAAA,EAAAC,gBAAA,EAAAC,eAAA,EAAAC,cAAA,EAAAC,UAAA,EAAAC,UAAA;AAAA,SACAC,SAAAC,GAAA;EACA;;EACA,OAAAA,GAAA,WAAAC,MAAA,UAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAAA;AAcF,IAAAG,mBAAS,GAAiB,SAAAA,CAAAC,KAAA,EAAAC,MAAA;IAE1B,IAAAD,KAAO,KAAS,OAAAA,KAAY,SAAS,cAAcL,QAAA,CAAAK,KAAA,gCAAAA,KAAA;MAGnD,IAAOE,YAAA,GAAAD,MAAA,GAAAD,KAAA,CAAAG,OAAA,CAAAC,IAAA,GAAAJ,KAAA,CAAAG,OAAA,CAAAE,KAAA;MACL,OAAAH,YAAA;IACA;IACA,OAAAF,KAAA;EAAA;EACAM,YAAA,YAAAA,CAAAC,CAAA;IACA,IAAAC,CA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ACAF,SAAA;cACAC,OAAA,EAAAa,SAAA,IAAA3B,cAAA,CAAAxE,SAAA,eAAAkG,MAAA;cACAtB,UAAA,EAAeJ,cAAA,CAAAxE,SAAA;gBACVqG,QAAA,EAAU;cACf,IAAAzB,UAAA;cACAwB,gBAAA;cAGIrB,eAAiB;cAEvB2B,IACE,EAAAP,SAAY,GAAAD,MAAA,GAAa;YAKvB;UACA;QAAA,GACA,CACAnB,eAAA,EACAT,QAAQ,EACTG,YAGI,EACLD,cAAQ,CAAAxE,SAAa,EACvB2G,IAAA,CAAAC,SAAA,CAAArC,KAAA,GACFQ,eAAA,EACFrH,MAAA,CACF;QAAAmJ,IAAA,GAAAvK,SAAA,CAAA+I,SAAA","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAEA,cAAc","ignoreList":[]}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAEA,cAAc","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/animations-moti",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.30",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -21,15 +21,12 @@
|
|
|
21
21
|
"./package.json": "./package.json",
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./types/index.d.ts",
|
|
24
|
-
"react-native":
|
|
25
|
-
|
|
26
|
-
"import": "./dist/esm/index.native.js",
|
|
27
|
-
"require": "./dist/cjs/index.native.js"
|
|
28
|
-
},
|
|
24
|
+
"react-native": "./dist/esm/index.native.js",
|
|
25
|
+
"browser": "./dist/esm/index.mjs",
|
|
29
26
|
"module": "./dist/esm/index.mjs",
|
|
30
27
|
"import": "./dist/esm/index.mjs",
|
|
31
28
|
"require": "./dist/cjs/index.cjs",
|
|
32
|
-
"default": "./dist/
|
|
29
|
+
"default": "./dist/esm/index.mjs"
|
|
33
30
|
}
|
|
34
31
|
},
|
|
35
32
|
"publishConfig": {
|
|
@@ -42,14 +39,14 @@
|
|
|
42
39
|
"clean:build": "tamagui-build clean:build"
|
|
43
40
|
},
|
|
44
41
|
"dependencies": {
|
|
45
|
-
"@tamagui/core": "2.0.0-rc.
|
|
46
|
-
"@tamagui/use-presence": "2.0.0-rc.
|
|
42
|
+
"@tamagui/core": "2.0.0-rc.30",
|
|
43
|
+
"@tamagui/use-presence": "2.0.0-rc.30"
|
|
47
44
|
},
|
|
48
45
|
"devDependencies": {
|
|
49
|
-
"@tamagui/build": "2.0.0-rc.
|
|
46
|
+
"@tamagui/build": "2.0.0-rc.30",
|
|
50
47
|
"react": ">=19",
|
|
51
|
-
"react-native": "0.
|
|
52
|
-
"react-native-reanimated": "~4.
|
|
48
|
+
"react-native": "0.83.2",
|
|
49
|
+
"react-native-reanimated": "~4.2.2"
|
|
53
50
|
},
|
|
54
51
|
"peerDependencies": {
|
|
55
52
|
"react": ">=19",
|
package/src/createAnimations.tsx
CHANGED
|
@@ -95,7 +95,7 @@ function createTamaguiAnimatedComponent(defaultTag = 'div') {
|
|
|
95
95
|
return <Element {...transformedProps} ref={composedRefs} />
|
|
96
96
|
})
|
|
97
97
|
)
|
|
98
|
-
Component['
|
|
98
|
+
Component['acceptRenderProp'] = true
|
|
99
99
|
return Component
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -145,12 +145,12 @@ export function createAnimations<A extends Record<string, TransitionConfig>>(
|
|
|
145
145
|
animations: A
|
|
146
146
|
): AnimationDriver<A> {
|
|
147
147
|
return {
|
|
148
|
+
needsCustomComponent: true,
|
|
148
149
|
View: isWeb ? AnimatedView : Animated.View,
|
|
149
150
|
Text: isWeb ? AnimatedText : Animated.Text,
|
|
150
151
|
// View: Animated.View,
|
|
151
152
|
// Text: Animated.Text,
|
|
152
153
|
isReactNative: true,
|
|
153
|
-
supportsCSS: false,
|
|
154
154
|
inputStyle: 'value',
|
|
155
155
|
outputStyle: 'inline',
|
|
156
156
|
animations,
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/createAnimations.tsx"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"// @ts-nocheck - deprecated package, moti dependency intentionally not included\nimport { PresenceContext, ResetPresence, usePresence } from '@tamagui/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 '@tamagui/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 createTamaguiAnimatedComponent(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['acceptTagProp'] = true\n return Component\n}\n\nconst AnimatedView = createTamaguiAnimatedComponent('div')\nconst AnimatedText = createTamaguiAnimatedComponent('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 View: isWeb ? AnimatedView : Animated.View,\n Text: isWeb ? AnimatedText : Animated.Text,\n // View: Animated.View,\n // Text: Animated.Text,\n isReactNative: true,\n supportsCSS: false,\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"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
9
|
+
"// @ts-nocheck - deprecated package, moti dependency intentionally not included\nimport { PresenceContext, ResetPresence, usePresence } from '@tamagui/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 '@tamagui/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 createTamaguiAnimatedComponent(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 = createTamaguiAnimatedComponent('div')\nconst AnimatedText = createTamaguiAnimatedComponent('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
11
|
}
|
package/types/index.d.ts.map
CHANGED
package/types/polyfill.d.ts.map
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/polyfill.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
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"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var createAnimations_exports = {};
|
|
24
|
-
__export(createAnimations_exports, {
|
|
25
|
-
createAnimations: () => createAnimations
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(createAnimations_exports);
|
|
28
|
-
var import_use_presence = require("@tamagui/use-presence"), import_core = require("@tamagui/core"), import_author = require("moti/author"), import_react = __toESM(require("react"), 1), import_react_native_reanimated = __toESM(require("react-native-reanimated"), 1), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
const resolveDynamicValue = (value, isDark) => value && typeof value == "object" && "dynamic" in value ? isDark ? value.dynamic.dark : value.dynamic.light : value, safeESModule = (a) => {
|
|
30
|
-
const b = a;
|
|
31
|
-
return (b.__esModule || b[Symbol.toStringTag] === "Module" ? b.default : b) || a;
|
|
32
|
-
}, Animated = safeESModule(import_react_native_reanimated.default);
|
|
33
|
-
function createTamaguiAnimatedComponent(defaultTag = "div") {
|
|
34
|
-
const isText = defaultTag === "span", Component = Animated.createAnimatedComponent(
|
|
35
|
-
(0, import_react.forwardRef)((propsIn, ref) => {
|
|
36
|
-
const { forwardedRef, animation, render = defaultTag, ...propsRest } = propsIn, hostRef = (0, import_react.useRef)(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref, hostRef), stateRef = (0, import_react.useRef)(null);
|
|
37
|
-
stateRef.current || (stateRef.current = {
|
|
38
|
-
get host() {
|
|
39
|
-
return hostRef.current;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const [_, state] = (0, import_core.useThemeWithState)({}), props = (0, import_core.getSplitStyles)(
|
|
43
|
-
propsRest,
|
|
44
|
-
isText ? import_core.Text.staticConfig : import_core.View.staticConfig,
|
|
45
|
-
state?.theme,
|
|
46
|
-
state?.name,
|
|
47
|
-
{
|
|
48
|
-
unmounted: !1
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
isAnimated: !1,
|
|
52
|
-
noClass: !0
|
|
53
|
-
}
|
|
54
|
-
)?.viewProps || {}, Element = render, transformedProps = import_core.hooks.usePropsTransform?.(render, props, stateRef, !1);
|
|
55
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Element, { ...transformedProps, ref: composedRefs });
|
|
56
|
-
})
|
|
57
|
-
);
|
|
58
|
-
return Component.acceptTagProp = !0, Component;
|
|
59
|
-
}
|
|
60
|
-
const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), onlyAnimateKeys = {
|
|
61
|
-
transform: !0,
|
|
62
|
-
opacity: !0,
|
|
63
|
-
height: !0,
|
|
64
|
-
width: !0,
|
|
65
|
-
backgroundColor: !0,
|
|
66
|
-
borderColor: !0,
|
|
67
|
-
borderLeftColor: !0,
|
|
68
|
-
borderRightColor: !0,
|
|
69
|
-
borderTopColor: !0,
|
|
70
|
-
borderBottomColor: !0,
|
|
71
|
-
borderRadius: !0,
|
|
72
|
-
borderTopLeftRadius: !0,
|
|
73
|
-
borderTopRightRadius: !0,
|
|
74
|
-
borderBottomLeftRadius: !0,
|
|
75
|
-
borderBottomRightRadius: !0,
|
|
76
|
-
borderLeftWidth: !0,
|
|
77
|
-
borderRightWidth: !0,
|
|
78
|
-
borderTopWidth: !0,
|
|
79
|
-
borderBottomWidth: !0,
|
|
80
|
-
color: !0,
|
|
81
|
-
left: !0,
|
|
82
|
-
right: !0,
|
|
83
|
-
top: !0,
|
|
84
|
-
bottom: !0,
|
|
85
|
-
fontSize: !0,
|
|
86
|
-
fontWeight: !0,
|
|
87
|
-
lineHeight: !0,
|
|
88
|
-
letterSpacing: !0
|
|
89
|
-
};
|
|
90
|
-
function createAnimations(animations) {
|
|
91
|
-
return {
|
|
92
|
-
View: import_core.isWeb ? AnimatedView : Animated.View,
|
|
93
|
-
Text: import_core.isWeb ? AnimatedText : Animated.Text,
|
|
94
|
-
// View: Animated.View,
|
|
95
|
-
// Text: Animated.Text,
|
|
96
|
-
isReactNative: !0,
|
|
97
|
-
supportsCSS: !1,
|
|
98
|
-
inputStyle: "value",
|
|
99
|
-
outputStyle: "inline",
|
|
100
|
-
animations,
|
|
101
|
-
usePresence: import_use_presence.usePresence,
|
|
102
|
-
ResetPresence: import_use_presence.ResetPresence,
|
|
103
|
-
useAnimatedNumber(initial) {
|
|
104
|
-
const sharedValue = (0, import_react_native_reanimated.useSharedValue)(initial);
|
|
105
|
-
return import_react.default.useMemo(
|
|
106
|
-
() => ({
|
|
107
|
-
getInstance() {
|
|
108
|
-
"worklet";
|
|
109
|
-
return sharedValue;
|
|
110
|
-
},
|
|
111
|
-
getValue() {
|
|
112
|
-
"worklet";
|
|
113
|
-
return sharedValue.value;
|
|
114
|
-
},
|
|
115
|
-
setValue(next, config = { type: "spring" }, onFinish) {
|
|
116
|
-
"worklet";
|
|
117
|
-
config.type === "direct" ? (sharedValue.value = next, onFinish?.()) : config.type === "spring" ? sharedValue.value = (0, import_react_native_reanimated.withSpring)(
|
|
118
|
-
next,
|
|
119
|
-
config,
|
|
120
|
-
onFinish ? () => {
|
|
121
|
-
"worklet";
|
|
122
|
-
(0, import_react_native_reanimated.runOnJS)(onFinish)();
|
|
123
|
-
} : void 0
|
|
124
|
-
) : sharedValue.value = (0, import_react_native_reanimated.withTiming)(
|
|
125
|
-
next,
|
|
126
|
-
config,
|
|
127
|
-
onFinish ? () => {
|
|
128
|
-
"worklet";
|
|
129
|
-
(0, import_react_native_reanimated.runOnJS)(onFinish)();
|
|
130
|
-
} : void 0
|
|
131
|
-
);
|
|
132
|
-
},
|
|
133
|
-
stop() {
|
|
134
|
-
"worklet";
|
|
135
|
-
(0, import_react_native_reanimated.cancelAnimation)(sharedValue);
|
|
136
|
-
}
|
|
137
|
-
}),
|
|
138
|
-
[sharedValue]
|
|
139
|
-
);
|
|
140
|
-
},
|
|
141
|
-
useAnimatedNumberReaction({ value }, onValue) {
|
|
142
|
-
const instance = value.getInstance();
|
|
143
|
-
return (0, import_react_native_reanimated.useAnimatedReaction)(
|
|
144
|
-
() => instance.value,
|
|
145
|
-
(next, prev) => {
|
|
146
|
-
prev !== next && (0, import_react_native_reanimated.runOnJS)(onValue)(next);
|
|
147
|
-
},
|
|
148
|
-
// dependency array is very important here
|
|
149
|
-
[onValue, instance]
|
|
150
|
-
);
|
|
151
|
-
},
|
|
152
|
-
/**
|
|
153
|
-
* `getStyle` must be a worklet
|
|
154
|
-
*/
|
|
155
|
-
useAnimatedNumberStyle(val, getStyle) {
|
|
156
|
-
const instance = val.getInstance(), derivedValue = (0, import_react_native_reanimated.useDerivedValue)(() => instance.value, [instance, getStyle]);
|
|
157
|
-
return (0, import_react_native_reanimated.useAnimatedStyle)(() => getStyle(derivedValue.value), [val, getStyle, derivedValue, instance]);
|
|
158
|
-
},
|
|
159
|
-
useAnimations: (animationProps) => {
|
|
160
|
-
const { props, presence, style, componentState } = animationProps, animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition, isHydrating = componentState.unmounted === !0, disableAnimation = isHydrating || !animationKey, presenceContext = import_react.default.useContext(import_use_presence.PresenceContext), [, themeState] = (0, import_core.useThemeWithState)({}), isDark = themeState?.scheme === "dark" || themeState?.name?.startsWith("dark"), { dontAnimate, motiProps } = (0, import_react.useMemo)(() => {
|
|
161
|
-
let animate = {}, dontAnimate2 = {};
|
|
162
|
-
if (disableAnimation)
|
|
163
|
-
for (const key in style) {
|
|
164
|
-
const rawValue = style[key], value = resolveDynamicValue(rawValue, isDark);
|
|
165
|
-
value !== void 0 && (dontAnimate2[key] = value);
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
const animateOnly = props.animateOnly;
|
|
169
|
-
for (const key in style) {
|
|
170
|
-
const rawValue = style[key], value = resolveDynamicValue(rawValue, isDark);
|
|
171
|
-
value !== void 0 && (!onlyAnimateKeys[key] || value === "auto" || typeof value == "string" && value.startsWith("calc") || animateOnly && !animateOnly.includes(key) ? dontAnimate2[key] = value : animate[key] = value);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if (componentState.unmounted === "should-enter")
|
|
175
|
-
for (const key in style) {
|
|
176
|
-
const rawValue = style[key], value = resolveDynamicValue(rawValue, isDark);
|
|
177
|
-
value !== void 0 && (dontAnimate2[key] = value);
|
|
178
|
-
}
|
|
179
|
-
const styles = animate, isExiting = !!presence?.[1], usePresenceValue = presence || void 0;
|
|
180
|
-
let transition = isHydrating ? { type: "transition", duration: 0 } : animations[animationKey], hasClonedTransition = !1;
|
|
181
|
-
if (Array.isArray(props.transition)) {
|
|
182
|
-
const config = props.transition[1];
|
|
183
|
-
if (config && typeof config == "object")
|
|
184
|
-
for (const key in config) {
|
|
185
|
-
const val = config[key];
|
|
186
|
-
hasClonedTransition || (transition = Object.assign({}, transition), hasClonedTransition = !0), typeof val == "string" ? transition[key] = animations[val] : transition[key] = val;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
dontAnimate: dontAnimate2,
|
|
191
|
-
motiProps: {
|
|
192
|
-
animate: isExiting || componentState.unmounted === !0 ? {} : styles,
|
|
193
|
-
transition: componentState.unmounted ? { duration: 0 } : transition,
|
|
194
|
-
usePresenceValue,
|
|
195
|
-
presenceContext,
|
|
196
|
-
exit: isExiting ? styles : void 0
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}, [
|
|
200
|
-
presenceContext,
|
|
201
|
-
presence,
|
|
202
|
-
animationKey,
|
|
203
|
-
componentState.unmounted,
|
|
204
|
-
JSON.stringify(style),
|
|
205
|
-
presenceContext,
|
|
206
|
-
isDark
|
|
207
|
-
]), moti = (0, import_author.useMotify)(motiProps);
|
|
208
|
-
return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.info("useMotify(", JSON.stringify(motiProps, null, 2) + ")", {
|
|
209
|
-
"componentState.unmounted": componentState.unmounted,
|
|
210
|
-
animationProps,
|
|
211
|
-
motiProps,
|
|
212
|
-
moti,
|
|
213
|
-
style: [dontAnimate, moti.style]
|
|
214
|
-
}), {
|
|
215
|
-
style: [dontAnimate, moti.style]
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=createAnimations.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/createAnimations.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA4D,kCAE5D,cAUO,0BAWP,gBAA0B,wBAE1B,eAAmD,8BAGnD,iCASO,gDAwDM;AA9Eb,MAAM,sBAAsB,CAAC,OAAY,WACnC,SAAS,OAAO,SAAU,YAAY,aAAa,QAChC,SAAS,MAAM,QAAQ,OAAO,MAAM,QAAQ,QAG5D,OAqBH,eAAe,CAAK,MAA6B;AACrD,QAAM,IAAI;AAGV,UAFY,EAAE,cAAc,EAAE,OAAO,WAAW,MAAM,WAAW,EAAE,UAAU,MAE/D;AAChB,GAEM,WAAW,aAAa,+BAAAA,OAAS;AAOvC,SAAS,+BAA+B,aAAa,OAAO;AAC1D,QAAM,SAAS,eAAe,QAExB,YAAY,SAAS;AAAA,QACzB,yBAAW,CAAC,SAAc,QAAQ;AAChC,YAAM,EAAE,cAAc,WAAW,SAAS,YAAY,GAAG,UAAU,IAAI,SACjE,cAAU,qBAAO,IAAI,GACrB,mBAAe,6BAAgB,cAAc,KAAK,OAAO,GACzD,eAAW,qBAAY,IAAI;AACjC,MAAK,SAAS,YACZ,SAAS,UAAU;AAAA,QACjB,IAAI,OAAO;AACT,iBAAO,QAAQ;AAAA,QACjB;AAAA,MACF;AAGF,YAAM,CAAC,GAAG,KAAK,QAAI,+BAAkB,CAAC,CAAC,GAiBjC,YAdS;AAAA,QACb;AAAA,QACA,SAAS,iBAAK,eAAe,iBAAK;AAAA,QAClC,OAAO;AAAA,QACP,OAAO;AAAA,QAC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AW,CAAC;AACjC,cAAI,UAAU,OAAO,UAAW;AAC9B,uBAAW,OAAO,QAAQ;AACxB,oBAAM,MAAM,OAAO,GAAG;AAItB,cAAK,wBACH,aAAa,OAAO,OAAO,CAAC,GAAG,UAAU,GACzC,sBAAsB,KAIpB,OAAO,OAAQ,WACjB,WAAW,GAAG,IAAI,WAAW,GAAG,IAEhC,WAAW,GAAG,IAAI;AAAA,YAEtB;AAAA,QAEJ;AAEA,eAAO;AAAA,UACL,aAAAA;AAAA,UACA,WAAW;AAAA,YACT,SAAS,aAAa,eAAe,cAAc,KAAO,CAAC,IAAI;AAAA,YAC/D,YAAY,eAAe,YAAY,EAAE,UAAU,EAAE,IAAI;AAAA,YACzD;AAAA,YACA;AAAA,YACA,MAAM,YAAY,SAAS;AAAA,UAC7B;AAAA,QACF;AAAA,MACF,GAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf,KAAK,UAAU,KAAK;AAAA,QACpB;AAAA,QACA;AAAA,MACF,CAAC,GAEK,WAAO,yBAAU,SAAS;AAEhC,aACE,QAAQ,IAAI,aAAa,iBACzB,MAAM,SACN,MAAM,UAAa,aAEnB,QAAQ,KAAK,cAAc,KAAK,UAAU,WAAW,MAAM,CAAC,IAAI,KAAK;AAAA,QACnE,4BAA4B,eAAe;AAAA,QAC3C;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
|
-
"names": ["Animated_", "React", "dontAnimate"]
|
|
6
|
-
}
|
package/dist/cjs/polyfill.js
DELETED
package/dist/cjs/polyfill.js.map
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { PresenceContext, ResetPresence, usePresence } from "@tamagui/use-presence";
|
|
2
|
-
import {
|
|
3
|
-
getSplitStyles,
|
|
4
|
-
hooks,
|
|
5
|
-
isWeb,
|
|
6
|
-
Text,
|
|
7
|
-
useComposedRefs,
|
|
8
|
-
useThemeWithState,
|
|
9
|
-
View
|
|
10
|
-
} from "@tamagui/core";
|
|
11
|
-
import { useMotify } from "moti/author";
|
|
12
|
-
import React, { forwardRef, useMemo, useRef } from "react";
|
|
13
|
-
import Animated_, {
|
|
14
|
-
cancelAnimation,
|
|
15
|
-
runOnJS,
|
|
16
|
-
useAnimatedReaction,
|
|
17
|
-
useAnimatedStyle,
|
|
18
|
-
useDerivedValue,
|
|
19
|
-
useSharedValue,
|
|
20
|
-
withSpring,
|
|
21
|
-
withTiming
|
|
22
|
-
} from "react-native-reanimated";
|
|
23
|
-
import { jsx } from "react/jsx-runtime";
|
|
24
|
-
const resolveDynamicValue = (value, isDark) => value && typeof value == "object" && "dynamic" in value ? isDark ? value.dynamic.dark : value.dynamic.light : value, safeESModule = (a) => {
|
|
25
|
-
const b = a;
|
|
26
|
-
return (b.__esModule || b[Symbol.toStringTag] === "Module" ? b.default : b) || a;
|
|
27
|
-
}, Animated = safeESModule(Animated_);
|
|
28
|
-
function createTamaguiAnimatedComponent(defaultTag = "div") {
|
|
29
|
-
const isText = defaultTag === "span", Component = Animated.createAnimatedComponent(
|
|
30
|
-
forwardRef((propsIn, ref) => {
|
|
31
|
-
const { forwardedRef, animation, render = defaultTag, ...propsRest } = propsIn, hostRef = useRef(null), composedRefs = useComposedRefs(forwardedRef, ref, hostRef), stateRef = useRef(null);
|
|
32
|
-
stateRef.current || (stateRef.current = {
|
|
33
|
-
get host() {
|
|
34
|
-
return hostRef.current;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const [_, state] = useThemeWithState({}), props = getSplitStyles(
|
|
38
|
-
propsRest,
|
|
39
|
-
isText ? Text.staticConfig : View.staticConfig,
|
|
40
|
-
state?.theme,
|
|
41
|
-
state?.name,
|
|
42
|
-
{
|
|
43
|
-
unmounted: !1
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
isAnimated: !1,
|
|
47
|
-
noClass: !0
|
|
48
|
-
}
|
|
49
|
-
)?.viewProps || {}, Element = render, transformedProps = hooks.usePropsTransform?.(render, props, stateRef, !1);
|
|
50
|
-
return /* @__PURE__ */ jsx(Element, { ...transformedProps, ref: composedRefs });
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
return Component.acceptTagProp = !0, Component;
|
|
54
|
-
}
|
|
55
|
-
const AnimatedView = createTamaguiAnimatedComponent("div"), AnimatedText = createTamaguiAnimatedComponent("span"), onlyAnimateKeys = {
|
|
56
|
-
transform: !0,
|
|
57
|
-
opacity: !0,
|
|
58
|
-
height: !0,
|
|
59
|
-
width: !0,
|
|
60
|
-
backgroundColor: !0,
|
|
61
|
-
borderColor: !0,
|
|
62
|
-
borderLeftColor: !0,
|
|
63
|
-
borderRightColor: !0,
|
|
64
|
-
borderTopColor: !0,
|
|
65
|
-
borderBottomColor: !0,
|
|
66
|
-
borderRadius: !0,
|
|
67
|
-
borderTopLeftRadius: !0,
|
|
68
|
-
borderTopRightRadius: !0,
|
|
69
|
-
borderBottomLeftRadius: !0,
|
|
70
|
-
borderBottomRightRadius: !0,
|
|
71
|
-
borderLeftWidth: !0,
|
|
72
|
-
borderRightWidth: !0,
|
|
73
|
-
borderTopWidth: !0,
|
|
74
|
-
borderBottomWidth: !0,
|
|
75
|
-
color: !0,
|
|
76
|
-
left: !0,
|
|
77
|
-
right: !0,
|
|
78
|
-
top: !0,
|
|
79
|
-
bottom: !0,
|
|
80
|
-
fontSize: !0,
|
|
81
|
-
fontWeight: !0,
|
|
82
|
-
lineHeight: !0,
|
|
83
|
-
letterSpacing: !0
|
|
84
|
-
};
|
|
85
|
-
function createAnimations(animations) {
|
|
86
|
-
return {
|
|
87
|
-
View: isWeb ? AnimatedView : Animated.View,
|
|
88
|
-
Text: isWeb ? AnimatedText : Animated.Text,
|
|
89
|
-
// View: Animated.View,
|
|
90
|
-
// Text: Animated.Text,
|
|
91
|
-
isReactNative: !0,
|
|
92
|
-
supportsCSS: !1,
|
|
93
|
-
inputStyle: "value",
|
|
94
|
-
outputStyle: "inline",
|
|
95
|
-
animations,
|
|
96
|
-
usePresence,
|
|
97
|
-
ResetPresence,
|
|
98
|
-
useAnimatedNumber(initial) {
|
|
99
|
-
const sharedValue = useSharedValue(initial);
|
|
100
|
-
return React.useMemo(
|
|
101
|
-
() => ({
|
|
102
|
-
getInstance() {
|
|
103
|
-
"worklet";
|
|
104
|
-
return sharedValue;
|
|
105
|
-
},
|
|
106
|
-
getValue() {
|
|
107
|
-
"worklet";
|
|
108
|
-
return sharedValue.value;
|
|
109
|
-
},
|
|
110
|
-
setValue(next, config = { type: "spring" }, onFinish) {
|
|
111
|
-
"worklet";
|
|
112
|
-
config.type === "direct" ? (sharedValue.value = next, onFinish?.()) : config.type === "spring" ? sharedValue.value = withSpring(
|
|
113
|
-
next,
|
|
114
|
-
config,
|
|
115
|
-
onFinish ? () => {
|
|
116
|
-
"worklet";
|
|
117
|
-
runOnJS(onFinish)();
|
|
118
|
-
} : void 0
|
|
119
|
-
) : sharedValue.value = withTiming(
|
|
120
|
-
next,
|
|
121
|
-
config,
|
|
122
|
-
onFinish ? () => {
|
|
123
|
-
"worklet";
|
|
124
|
-
runOnJS(onFinish)();
|
|
125
|
-
} : void 0
|
|
126
|
-
);
|
|
127
|
-
},
|
|
128
|
-
stop() {
|
|
129
|
-
"worklet";
|
|
130
|
-
cancelAnimation(sharedValue);
|
|
131
|
-
}
|
|
132
|
-
}),
|
|
133
|
-
[sharedValue]
|
|
134
|
-
);
|
|
135
|
-
},
|
|
136
|
-
useAnimatedNumberReaction({ value }, onValue) {
|
|
137
|
-
const instance = value.getInstance();
|
|
138
|
-
return useAnimatedReaction(
|
|
139
|
-
() => instance.value,
|
|
140
|
-
(next, prev) => {
|
|
141
|
-
prev !== next && runOnJS(onValue)(next);
|
|
142
|
-
},
|
|
143
|
-
// dependency array is very important here
|
|
144
|
-
[onValue, instance]
|
|
145
|
-
);
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* `getStyle` must be a worklet
|
|
149
|
-
*/
|
|
150
|
-
useAnimatedNumberStyle(val, getStyle) {
|
|
151
|
-
const instance = val.getInstance(), derivedValue = useDerivedValue(() => instance.value, [instance, getStyle]);
|
|
152
|
-
return useAnimatedStyle(() => getStyle(derivedValue.value), [val, getStyle, derivedValue, instance]);
|
|
153
|
-
},
|
|
154
|
-
useAnimations: (animationProps) => {
|
|
155
|
-
const { props, presence, style, componentState } = animationProps, animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition, isHydrating = componentState.unmounted === !0, disableAnimation = isHydrating || !animationKey, presenceContext = React.useContext(PresenceContext), [, themeState] = useThemeWithState({}), isDark = themeState?.scheme === "dark" || themeState?.name?.startsWith("dark"), { dontAnimate, motiProps } = useMemo(() => {
|
|
156
|
-
let animate = {}, dontAnimate2 = {};
|
|
157
|
-
if (disableAnimation)
|
|
158
|
-
for (const key in style) {
|
|
159
|
-
const rawValue = style[key], value = resolveDynamicValue(rawValue, isDark);
|
|
160
|
-
value !== void 0 && (dontAnimate2[key] = value);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
const animateOnly = props.animateOnly;
|
|
164
|
-
for (const key in style) {
|
|
165
|
-
const rawValue = style[key], value = resolveDynamicValue(rawValue, isDark);
|
|
166
|
-
value !== void 0 && (!onlyAnimateKeys[key] || value === "auto" || typeof value == "string" && value.startsWith("calc") || animateOnly && !animateOnly.includes(key) ? dontAnimate2[key] = value : animate[key] = value);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
if (componentState.unmounted === "should-enter")
|
|
170
|
-
for (const key in style) {
|
|
171
|
-
const rawValue = style[key], value = resolveDynamicValue(rawValue, isDark);
|
|
172
|
-
value !== void 0 && (dontAnimate2[key] = value);
|
|
173
|
-
}
|
|
174
|
-
const styles = animate, isExiting = !!presence?.[1], usePresenceValue = presence || void 0;
|
|
175
|
-
let transition = isHydrating ? { type: "transition", duration: 0 } : animations[animationKey], hasClonedTransition = !1;
|
|
176
|
-
if (Array.isArray(props.transition)) {
|
|
177
|
-
const config = props.transition[1];
|
|
178
|
-
if (config && typeof config == "object")
|
|
179
|
-
for (const key in config) {
|
|
180
|
-
const val = config[key];
|
|
181
|
-
hasClonedTransition || (transition = Object.assign({}, transition), hasClonedTransition = !0), typeof val == "string" ? transition[key] = animations[val] : transition[key] = val;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return {
|
|
185
|
-
dontAnimate: dontAnimate2,
|
|
186
|
-
motiProps: {
|
|
187
|
-
animate: isExiting || componentState.unmounted === !0 ? {} : styles,
|
|
188
|
-
transition: componentState.unmounted ? { duration: 0 } : transition,
|
|
189
|
-
usePresenceValue,
|
|
190
|
-
presenceContext,
|
|
191
|
-
exit: isExiting ? styles : void 0
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
}, [
|
|
195
|
-
presenceContext,
|
|
196
|
-
presence,
|
|
197
|
-
animationKey,
|
|
198
|
-
componentState.unmounted,
|
|
199
|
-
JSON.stringify(style),
|
|
200
|
-
presenceContext,
|
|
201
|
-
isDark
|
|
202
|
-
]), moti = useMotify(motiProps);
|
|
203
|
-
return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.info("useMotify(", JSON.stringify(motiProps, null, 2) + ")", {
|
|
204
|
-
"componentState.unmounted": componentState.unmounted,
|
|
205
|
-
animationProps,
|
|
206
|
-
motiProps,
|
|
207
|
-
moti,
|
|
208
|
-
style: [dontAnimate, moti.style]
|
|
209
|
-
}), {
|
|
210
|
-
style: [dontAnimate, moti.style]
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
export {
|
|
216
|
-
createAnimations
|
|
217
|
-
};
|
|
218
|
-
//# sourceMappingURL=createAnimations.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-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