GT2/Ejectable/node_modules/react-native-gesture-handler/lib/module/GestureHandlerRootView.andr...

1 line
1.9 KiB
Plaintext

{"version":3,"sources":["GestureHandlerRootView.android.tsx"],"names":["React","View","requireNativeComponent","GestureHandlerRootViewNative","GestureHandlerRootViewContext","createContext","GestureHandlerRootView","children","rest","available"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,IAAT,EAAeC,sBAAf,QAA6C,cAA7C;AAEA,MAAMC,4BAA4B,GAAGD,sBAAsB,CACzD,wBADyD,CAA3D;AAIA,MAAME,6BAA6B,gBAAGJ,KAAK,CAACK,aAAN,CAAoB,KAApB,CAAtC;AAIA,eAAe,SAASC,sBAAT,CAAgC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAhC,EAA8D;AAC3E,sBACE,oBAAC,6BAAD,CAA+B,QAA/B,QACIC,SAAD,IAAe;AACd,QAAIA,SAAJ,EAAe;AACb;AACA;AACA;AACA,0BAAO,oBAAC,IAAD,EAAUD,IAAV,EAAiBD,QAAjB,CAAP;AACD;;AAED,wBACE,oBAAC,6BAAD,CAA+B,QAA/B;AAAwC,MAAA,KAAK;AAA7C,oBACE,oBAAC,4BAAD,EAAkCC,IAAlC,EACGD,QADH,CADF,CADF;AAOD,GAhBH,CADF;AAoBD","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { View, requireNativeComponent } from 'react-native';\n\nconst GestureHandlerRootViewNative = requireNativeComponent(\n 'GestureHandlerRootView'\n);\n\nconst GestureHandlerRootViewContext = React.createContext(false);\n\ntype Props = PropsWithChildren<Record<string, unknown>>;\n\nexport default function GestureHandlerRootView({ children, ...rest }: Props) {\n return (\n <GestureHandlerRootViewContext.Consumer>\n {(available) => {\n if (available) {\n // If we already have a parent wrapped in the gesture handler root view,\n // We don't need to wrap it again in root view\n // We still wrap it in a normal view so our styling stays the same\n return <View {...rest}>{children}</View>;\n }\n\n return (\n <GestureHandlerRootViewContext.Provider value>\n <GestureHandlerRootViewNative {...rest}>\n {children}\n </GestureHandlerRootViewNative>\n </GestureHandlerRootViewContext.Provider>\n );\n }}\n </GestureHandlerRootViewContext.Consumer>\n );\n}\n"]}