-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from kurucaner/development
development
- Loading branch information
Showing
4 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
var Q=Object.defineProperty;var Y=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var L=(t,e,o)=>e in t?Q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,I=(t,e)=>{for(var o in e||(e={}))Z.call(e,o)&&L(t,o,e[o]);if(Y)for(var o of Y(e))$.call(e,o)&&L(t,o,e[o]);return t};import{memo as rt,useCallback as _,useMemo as G,useState as D}from"react";import{Pressable as at,View as lt}from"react-native";import{Gesture as ut,GestureDetector as ct}from"react-native-gesture-handler";import U,{useAnimatedStyle as mt,useSharedValue as O,withSpring as ht,withTiming as g}from"react-native-reanimated";import{StyleSheet as j}from"react-native";var i=j.create({container:{width:"90%",maxWidth:400,position:"absolute",top:60,zIndex:9999,alignSelf:"center",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:"#f5f3f4"},blurContainer:{flex:1,backgroundColor:"rgba(255, 255, 255, 0.95)",borderRadius:10,padding:10,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.1,shadowRadius:8,elevation:5},notification:{flexDirection:"row",alignItems:"center",gap:12},stick:{height:4,width:40,position:"absolute",bottom:8,alignSelf:"center",borderRadius:2,backgroundColor:"#ffcad4"},smoothPushContainer:{flexDirection:"row",alignItems:"center",gap:12,paddingVertical:8,paddingHorizontal:6},iconContainer:{width:28,height:28,borderRadius:14,justifyContent:"center",alignItems:"center"},icon:{fontSize:16,fontWeight:"700"},successIcon:{color:"#2E7D32"},errorIcon:{color:"#D32F2F"},messageContainer:{flex:1,paddingRight:4},toastMessage:{fontSize:14,lineHeight:18,color:"#1a1a1a",fontWeight:"500"}});import{memo as tt,useEffect as et}from"react";import{Text as b,View as ot}from"react-native";import x,{Easing as C,Extrapolation as it,interpolate as F,useAnimatedStyle as N,useSharedValue as V,withDelay as M,withTiming as A}from"react-native-reanimated";import{jsx as l,jsxs as nt}from"react/jsx-runtime";var E=tt(({type:t,message:e,textStyle:o})=>{let u=V(0),a=V(0),s=V(0);et(()=>{u.value=0,a.value=0,s.value=0,u.value=A(1,{duration:400,easing:C.bezier(.34,1.56,.64,1)}),a.value=M(100,A(1,{duration:500,easing:C.bezier(.65,0,.35,1)})),s.value=M(200,A(1,{duration:300,easing:C.bezier(.4,0,.2,1)}))},[t,e]);let y=N(()=>({transform:[{scale:u.value}],backgroundColor:t==="success"?"#E7F6E7":"#FEE7E7"})),P=N(()=>({opacity:a.value,transform:[{scale:F(a.value,[0,.6,1],[.6,1.1,1],it.CLAMP)}]})),m=N(()=>({opacity:s.value,transform:[{translateX:F(s.value,[0,1],[-10,0])}]})),h=()=>t==="success"?l(b,{style:[i.icon,i.successIcon],children:"\u2713"}):t==="error"?l(b,{style:[i.icon,i.errorIcon],children:"\u2715"}):null;return e?nt(ot,{style:i.smoothPushContainer,children:[l(x.View,{style:[i.iconContainer,y],children:l(x.View,{style:P,children:h()})}),l(x.View,{style:[i.messageContainer,m],children:l(b,{style:[i.toastMessage,o],numberOfLines:3,children:e})})]}):null});E.displayName="SmoothPush";import{jsx as c,jsxs as ft}from"react/jsx-runtime";var k,R=null,dt=rt(({defaultConfig:t})=>{let[e,o]=D(null),[u,a]=D(null),[s,y]=D(t!=null?t:{}),{duration:P=6e3,position:m="top",offset:h=60,maxWidth:z=400,swipeThreshold:X=-55,stickColor:H="#ffcad4",onPress:d,onClose:f}=s,r=O(-180),v=O(!1),w=O(!1),W=mt(()=>({transform:[{translateY:r.value}]})),q=ut.Pan().onStart(n=>{v.value=!0,n.translationY=r.value}).onUpdate(n=>{n.translationY>0?r.value=n.translationY/15:r.value=n.translationY}).onEnd(n=>{v.value=!1,n.translationY<X?r.value=g(-180,{duration:400}):r.value=ht(0),w.value&&(r.value=g(-180,{duration:400}))}),T=_(()=>{r.value=g(-180,{duration:400}),f==null||f()},[f]),B=_(()=>{d==null||d(),T()},[d,T]);k=n=>{w.value=!1,R&&clearTimeout(R),a(n.toastType),o(n.message),y(I(I({},t),n.config)),r.value=g(0,{duration:400}),R=setTimeout(()=>{v.value||T(),w.value=!0},P)};let J=G(()=>[i.container,{[m]:h,maxWidth:z},s.containerStyle,W],[m,h,z,s.containerStyle,W]),K=G(()=>[i.stick,{backgroundColor:H}],[H]);return c(ct,{gesture:q,children:ft(U.View,{style:J,children:[c(U.View,{style:i.blurContainer,children:c(at,{onPress:B,style:i.notification,children:c(E,{type:u,message:e,textStyle:s.textStyle})})}),c(lt,{style:K})]})})});dt.displayName="SmoothPushProvider";var Ot=t=>{k&&k(t)};export{dt as SmoothPushProvider,Ot as show}; | ||
var Q=Object.defineProperty;var Y=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var L=(t,e,o)=>e in t?Q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,I=(t,e)=>{for(var o in e||(e={}))Z.call(e,o)&&L(t,o,e[o]);if(Y)for(var o of Y(e))$.call(e,o)&&L(t,o,e[o]);return t};import{memo as rt,useCallback as _,useMemo as G,useState as D}from"react";import{Pressable as at,View as lt}from"react-native";import{Gesture as ut,GestureDetector as ct}from"react-native-gesture-handler";import U,{useAnimatedStyle as mt,useSharedValue as O,withSpring as ht,withTiming as g}from"react-native-reanimated";import{StyleSheet as j}from"react-native";var i=j.create({container:{width:"90%",maxWidth:400,position:"absolute",top:60,zIndex:9999,alignSelf:"center",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:"#f5f3f4"},blurContainer:{flex:1,backgroundColor:"rgb(255, 255, 255)",borderRadius:10,padding:10,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.1,shadowRadius:8,elevation:5},notification:{flexDirection:"row",alignItems:"center",gap:12},stick:{height:4,width:40,position:"absolute",bottom:8,alignSelf:"center",borderRadius:2,backgroundColor:"#ffcad4"},smoothPushContainer:{flexDirection:"row",alignItems:"center",gap:12,paddingVertical:8,paddingHorizontal:6},iconContainer:{width:28,height:28,borderRadius:14,justifyContent:"center",alignItems:"center"},icon:{fontSize:16,fontWeight:"700"},successIcon:{color:"#2E7D32"},errorIcon:{color:"#D32F2F"},messageContainer:{flex:1,paddingRight:4},toastMessage:{fontSize:14,lineHeight:18,color:"#1a1a1a",fontWeight:"500"}});import{memo as tt,useEffect as et}from"react";import{Text as b,View as ot}from"react-native";import x,{Easing as C,Extrapolation as it,interpolate as F,useAnimatedStyle as N,useSharedValue as V,withDelay as M,withTiming as A}from"react-native-reanimated";import{jsx as l,jsxs as nt}from"react/jsx-runtime";var E=tt(({type:t,message:e,textStyle:o})=>{let u=V(0),a=V(0),s=V(0);et(()=>{u.value=0,a.value=0,s.value=0,u.value=A(1,{duration:400,easing:C.bezier(.34,1.56,.64,1)}),a.value=M(100,A(1,{duration:500,easing:C.bezier(.65,0,.35,1)})),s.value=M(200,A(1,{duration:300,easing:C.bezier(.4,0,.2,1)}))},[t,e]);let y=N(()=>({transform:[{scale:u.value}],backgroundColor:t==="success"?"#E7F6E7":"#FEE7E7"})),P=N(()=>({opacity:a.value,transform:[{scale:F(a.value,[0,.6,1],[.6,1.1,1],it.CLAMP)}]})),m=N(()=>({opacity:s.value,transform:[{translateX:F(s.value,[0,1],[-10,0])}]})),h=()=>t==="success"?l(b,{style:[i.icon,i.successIcon],children:"\u2713"}):t==="error"?l(b,{style:[i.icon,i.errorIcon],children:"\u2715"}):null;return e?nt(ot,{style:i.smoothPushContainer,children:[l(x.View,{style:[i.iconContainer,y],children:l(x.View,{style:P,children:h()})}),l(x.View,{style:[i.messageContainer,m],children:l(b,{style:[i.toastMessage,o],numberOfLines:3,children:e})})]}):null});E.displayName="SmoothPush";import{jsx as c,jsxs as ft}from"react/jsx-runtime";var k,R=null,dt=rt(({defaultConfig:t})=>{let[e,o]=D(null),[u,a]=D(null),[s,y]=D(t!=null?t:{}),{duration:P=6e3,position:m="top",offset:h=60,maxWidth:z=400,swipeThreshold:X=-55,stickColor:H="#ffcad4",onPress:d,onClose:f}=s,r=O(-180),v=O(!1),w=O(!1),W=mt(()=>({transform:[{translateY:r.value}]})),q=ut.Pan().onStart(n=>{v.value=!0,n.translationY=r.value}).onUpdate(n=>{n.translationY>0?r.value=n.translationY/15:r.value=n.translationY}).onEnd(n=>{v.value=!1,n.translationY<X?r.value=g(-180,{duration:400}):r.value=ht(0),w.value&&(r.value=g(-180,{duration:400}))}),T=_(()=>{r.value=g(-180,{duration:400}),f==null||f()},[f]),B=_(()=>{d==null||d(),T()},[d,T]);k=n=>{w.value=!1,R&&clearTimeout(R),a(n.toastType),o(n.message),y(I(I({},t),n.config)),r.value=g(0,{duration:400}),R=setTimeout(()=>{v.value||T(),w.value=!0},P)};let J=G(()=>[i.container,{[m]:h,maxWidth:z},s.containerStyle,W],[m,h,z,s.containerStyle,W]),K=G(()=>[i.stick,{backgroundColor:H}],[H]);return c(ct,{gesture:q,children:ft(U.View,{style:J,children:[c(U.View,{style:i.blurContainer,children:c(at,{onPress:B,style:i.notification,children:c(E,{type:u,message:e,textStyle:s.textStyle})})}),c(lt,{style:K})]})})});dt.displayName="SmoothPushProvider";var Ot=t=>{k&&k(t)};export{dt as SmoothPushProvider,Ot as show}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters