@tamagui/react-native-web-lite 2.7.6 → 3.0.0-beta.637.1
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/AccessibilityInfo/index.cjs +82 -87
- package/dist/cjs/ActivityIndicator/index.cjs +83 -103
- package/dist/cjs/Alert/index.cjs +17 -20
- package/dist/cjs/AppRegistry/AppContainer.cjs +37 -52
- package/dist/cjs/AppRegistry/index.cjs +69 -81
- package/dist/cjs/AppRegistry/renderApplication.cjs +42 -54
- package/dist/cjs/AppState/index.cjs +60 -67
- package/dist/cjs/Appearance/index.cjs +40 -49
- package/dist/cjs/BackHandler/index.cjs +20 -25
- package/dist/cjs/Clipboard/index.cjs +50 -53
- package/dist/cjs/DeviceEmitter.cjs +15 -18
- package/dist/cjs/DeviceInfo/index.cjs +50 -63
- package/dist/cjs/Dimensions/index.cjs +86 -89
- package/dist/cjs/FlatList.cjs +177 -211
- package/dist/cjs/I18nManager/index.cjs +24 -29
- package/dist/cjs/Image/index.cjs +277 -308
- package/dist/cjs/Image/types.cjs +10 -11
- package/dist/cjs/ImageBackground/index.cjs +35 -48
- package/dist/cjs/InteractionManager/TaskQueue.cjs +95 -100
- package/dist/cjs/InteractionManager/index.cjs +105 -115
- package/dist/cjs/Keyboard/index.cjs +23 -28
- package/dist/cjs/KeyboardAvoidingView/index.cjs +41 -54
- package/dist/cjs/Libraries/Pressability/Pressability.cjs +15 -18
- package/dist/cjs/Libraries/Pressability/usePressability.cjs +15 -18
- package/dist/cjs/Linking/index.cjs +86 -89
- package/dist/cjs/LogBox/index.cjs +20 -21
- package/dist/cjs/Modal/ModalAnimation.cjs +131 -151
- package/dist/cjs/Modal/ModalContent.cjs +57 -77
- package/dist/cjs/Modal/ModalPortal.cjs +38 -46
- package/dist/cjs/Modal/index.cjs +15 -18
- package/dist/cjs/NativeModules/index.cjs +15 -20
- package/dist/cjs/PanResponder/index.cjs +18 -26
- package/dist/cjs/PixelRatio/index.cjs +45 -48
- package/dist/cjs/Pressable/index.cjs +130 -142
- package/dist/cjs/RefreshControl/index.cjs +18 -35
- package/dist/cjs/SafeAreaView/index.cjs +35 -46
- package/dist/cjs/ScrollView/WebScrollView.cjs +270 -0
- package/dist/cjs/ScrollView/index.cjs +15 -662
- package/dist/cjs/SectionList.cjs +19 -25
- package/dist/cjs/Share/index.cjs +44 -47
- package/dist/cjs/StatusBar/index.cjs +17 -18
- package/dist/cjs/Text/index.cjs +133 -171
- package/dist/cjs/Text/types.cjs +10 -11
- package/dist/cjs/TextInput/index.cjs +281 -359
- package/dist/cjs/TextInput/types.cjs +10 -11
- package/dist/cjs/TouchableNativeFeedback.cjs +15 -18
- package/dist/cjs/TouchableOpacity.cjs +91 -99
- package/dist/cjs/TouchableWithoutFeedback.cjs +65 -74
- package/dist/cjs/UnimplementedView.cjs +26 -36
- package/dist/cjs/Vibration/index.cjs +25 -28
- package/dist/cjs/View/index.cjs +89 -121
- package/dist/cjs/View/types.cjs +10 -11
- package/dist/cjs/VirtualizedList.cjs +19 -25
- package/dist/cjs/codegenNativeCommands.cjs +32 -0
- package/dist/cjs/codegenNativeComponent.cjs +19 -18
- package/dist/cjs/createElement/index.cjs +52 -70
- package/dist/cjs/createReactDOMStyle.cjs +16 -17
- package/dist/cjs/index.cjs +106 -106
- package/dist/cjs/modules/requestIdleCallback.cjs +28 -29
- package/dist/cjs/preprocess.cjs +19 -20
- package/dist/cjs/render/index.cjs +18 -19
- package/dist/cjs/styleTypes.cjs +10 -11
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/useColorScheme/index.cjs +27 -37
- package/dist/cjs/useLocaleContext/index.cjs +15 -18
- package/dist/cjs/useWindowDimensions/index.cjs +32 -42
- package/dist/cjs/vendor/react-native/Animated/Animated.cjs +23 -24
- package/dist/cjs/vendor/react-native/Animated/AnimatedEvent.cjs +136 -141
- package/dist/cjs/vendor/react-native/Animated/AnimatedImplementation.cjs +500 -533
- package/dist/cjs/vendor/react-native/Animated/AnimatedMock.cjs +100 -109
- package/dist/cjs/vendor/react-native/Animated/AnimatedPlatformConfig.cjs +2 -1
- package/dist/cjs/vendor/react-native/Animated/Easing.cjs +182 -183
- package/dist/cjs/vendor/react-native/Animated/NativeAnimatedHelper.cjs +302 -328
- package/dist/cjs/vendor/react-native/Animated/NativeAnimatedModule.cjs +48 -56
- package/dist/cjs/vendor/react-native/Animated/NativeAnimatedTurboModule.cjs +46 -53
- package/dist/cjs/vendor/react-native/Animated/SpringConfig.cjs +63 -64
- package/dist/cjs/vendor/react-native/Animated/animations/Animation.cjs +52 -56
- package/dist/cjs/vendor/react-native/Animated/animations/DecayAnimation.cjs +74 -79
- package/dist/cjs/vendor/react-native/Animated/animations/SpringAnimation.cjs +210 -215
- package/dist/cjs/vendor/react-native/Animated/animations/TimingAnimation.cjs +107 -116
- package/dist/cjs/vendor/react-native/Animated/bezier.cjs +83 -88
- package/dist/cjs/vendor/react-native/Animated/components/AnimatedFlatList.cjs +23 -29
- package/dist/cjs/vendor/react-native/Animated/components/AnimatedImage.cjs +19 -25
- package/dist/cjs/vendor/react-native/Animated/components/AnimatedScrollView.cjs +23 -29
- package/dist/cjs/vendor/react-native/Animated/components/AnimatedSectionList.cjs +23 -29
- package/dist/cjs/vendor/react-native/Animated/components/AnimatedText.cjs +16 -17
- package/dist/cjs/vendor/react-native/Animated/components/AnimatedView.cjs +16 -17
- package/dist/cjs/vendor/react-native/Animated/createAnimatedComponent.cjs +32 -44
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedAddition.cjs +51 -52
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedColor.cjs +244 -247
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDiffClamp.cjs +59 -60
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDivision.cjs +65 -66
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedInterpolation.cjs +185 -188
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedModulo.cjs +49 -50
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedMultiplication.cjs +51 -52
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedNode.cjs +152 -156
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedProps.cjs +133 -134
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedStyle.cjs +113 -116
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedSubtraction.cjs +51 -52
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTracking.cjs +73 -75
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTransform.cjs +109 -110
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValue.cjs +212 -216
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValueXY.cjs +96 -103
- package/dist/cjs/vendor/react-native/Animated/nodes/AnimatedWithChildren.cjs +70 -71
- package/dist/cjs/vendor/react-native/Animated/useAnimatedProps.cjs +75 -76
- package/dist/cjs/vendor/react-native/Batchinator/index.cjs +46 -57
- package/dist/cjs/vendor/react-native/EventEmitter/NativeEventEmitter.cjs +54 -57
- package/dist/cjs/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.cjs +16 -17
- package/dist/cjs/vendor/react-native/FeatureFlags.cjs +21 -24
- package/dist/cjs/vendor/react-native/FillRateHelper/index.cjs +165 -173
- package/dist/cjs/vendor/react-native/FlatList/index.cjs +259 -294
- package/dist/cjs/vendor/react-native/JSEventLoopWatchdog/index.cjs +66 -69
- package/dist/cjs/vendor/react-native/LayoutAnimation/index.cjs +87 -91
- package/dist/cjs/vendor/react-native/PanResponder/index.cjs +170 -176
- package/dist/cjs/vendor/react-native/PooledClass/index.cjs +42 -43
- package/dist/cjs/vendor/react-native/ReactNative/ReactNativeFeatureFlags.cjs +21 -22
- package/dist/cjs/vendor/react-native/SectionList/index.cjs +95 -110
- package/dist/cjs/vendor/react-native/StaticContainer/index.cjs +28 -34
- package/dist/cjs/vendor/react-native/StaticRenderer/index.cjs +27 -33
- package/dist/cjs/vendor/react-native/TouchHistoryMath/index.cjs +82 -111
- package/dist/cjs/vendor/react-native/TurboModule/RCTExport.cjs +17 -22
- package/dist/cjs/vendor/react-native/TurboModule/TurboModuleRegistry.cjs +20 -21
- package/dist/cjs/vendor/react-native/Types/CoreEventTypes.cjs +124 -127
- package/dist/cjs/vendor/react-native/Utilities/Platform.cjs +16 -17
- package/dist/cjs/vendor/react-native/Utilities/clamp.cjs +23 -24
- package/dist/cjs/vendor/react-native/Utilities/setAndForwardRef.cjs +26 -30
- package/dist/cjs/vendor/react-native/Utilities/useMergeRefs.cjs +27 -30
- package/dist/cjs/vendor/react-native/Utilities/useRefEffect.cjs +26 -27
- package/dist/cjs/vendor/react-native/ViewabilityHelper/index.cjs +154 -163
- package/dist/cjs/vendor/react-native/ViewabilityHelper.cjs +147 -156
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.cjs +124 -125
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.cjs +100 -99
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.cjs +63 -64
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.cjs +66 -75
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.cjs +104 -160
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.cjs +56 -64
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.cjs +51 -52
- package/dist/cjs/vendor/react-native/VirtualizedList/index.cjs +222 -284
- package/dist/cjs/vendor/react-native/VirtualizedSectionList/index.cjs +124 -144
- package/dist/cjs/vendor/react-native/deepDiffer/index.cjs +58 -59
- package/dist/cjs/vendor/react-native/emitter/EventEmitter.cjs +16 -17
- package/dist/cjs/vendor/react-native/emitter/EventSubscription.cjs +2 -1
- package/dist/cjs/vendor/react-native/emitter/_EmitterSubscription.cjs +43 -44
- package/dist/cjs/vendor/react-native/emitter/_EventEmitter.cjs +115 -120
- package/dist/cjs/vendor/react-native/emitter/_EventSubscription.cjs +31 -32
- package/dist/cjs/vendor/react-native/emitter/_EventSubscriptionVendor.cjs +80 -81
- package/dist/cjs/vendor/react-native/infoLog/index.cjs +17 -18
- package/dist/cjs/vendor/react-native/useRefEffect.cjs +26 -27
- package/dist/cjs/vendor/react-native/vendor/emitter/EventEmitter.cjs +88 -89
- package/dist/cjs/without-animated.cjs +255 -267
- package/dist/esm/AccessibilityInfo/index.mjs +69 -69
- package/dist/esm/AccessibilityInfo/index.mjs.map +1 -1
- package/dist/esm/ActivityIndicator/index.mjs +66 -78
- package/dist/esm/ActivityIndicator/index.mjs.map +1 -1
- package/dist/esm/Alert/index.mjs +4 -3
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/AppRegistry/AppContainer.mjs +21 -28
- package/dist/esm/AppRegistry/AppContainer.mjs.map +1 -1
- package/dist/esm/AppRegistry/index.mjs +58 -65
- package/dist/esm/AppRegistry/index.mjs.map +1 -1
- package/dist/esm/AppRegistry/renderApplication.mjs +30 -40
- package/dist/esm/AppRegistry/renderApplication.mjs.map +1 -1
- package/dist/esm/AppState/index.mjs +48 -50
- package/dist/esm/AppState/index.mjs.map +1 -1
- package/dist/esm/Appearance/index.mjs +27 -31
- package/dist/esm/Appearance/index.mjs.map +1 -1
- package/dist/esm/BackHandler/index.mjs +6 -7
- package/dist/esm/BackHandler/index.mjs.map +1 -1
- package/dist/esm/Clipboard/index.mjs +37 -36
- package/dist/esm/Clipboard/index.mjs.map +1 -1
- package/dist/esm/DeviceEmitter.mjs +2 -0
- package/dist/esm/DeviceEmitter.mjs.map +1 -1
- package/dist/esm/DeviceInfo/index.mjs +37 -45
- package/dist/esm/DeviceInfo/index.mjs.map +1 -1
- package/dist/esm/Dimensions/index.mjs +72 -72
- package/dist/esm/Dimensions/index.mjs.map +1 -1
- package/dist/esm/FlatList.mjs +162 -188
- package/dist/esm/FlatList.mjs.map +1 -1
- package/dist/esm/I18nManager/index.mjs +10 -11
- package/dist/esm/I18nManager/index.mjs.map +1 -1
- package/dist/esm/Image/index.mjs +261 -285
- package/dist/esm/Image/index.mjs.map +1 -1
- package/dist/esm/Image/types.mjs +0 -2
- package/dist/esm/ImageBackground/index.mjs +21 -31
- package/dist/esm/ImageBackground/index.mjs.map +1 -1
- package/dist/esm/InteractionManager/TaskQueue.mjs +83 -83
- package/dist/esm/InteractionManager/TaskQueue.mjs.map +1 -1
- package/dist/esm/InteractionManager/index.mjs +89 -89
- package/dist/esm/InteractionManager/index.mjs.map +1 -1
- package/dist/esm/Keyboard/index.mjs +10 -10
- package/dist/esm/Keyboard/index.mjs.map +1 -1
- package/dist/esm/KeyboardAvoidingView/index.mjs +24 -29
- package/dist/esm/KeyboardAvoidingView/index.mjs.map +1 -1
- package/dist/esm/Libraries/Pressability/Pressability.mjs +1 -0
- package/dist/esm/Libraries/Pressability/Pressability.mjs.map +1 -1
- package/dist/esm/Libraries/Pressability/usePressability.mjs +2 -1
- package/dist/esm/Libraries/Pressability/usePressability.mjs.map +1 -1
- package/dist/esm/Linking/index.mjs +73 -71
- package/dist/esm/Linking/index.mjs.map +1 -1
- package/dist/esm/LogBox/index.mjs +5 -4
- package/dist/esm/LogBox/index.mjs.map +1 -1
- package/dist/esm/Modal/ModalAnimation.mjs +116 -126
- package/dist/esm/Modal/ModalAnimation.mjs.map +1 -1
- package/dist/esm/Modal/ModalContent.mjs +41 -51
- package/dist/esm/Modal/ModalContent.mjs.map +1 -1
- package/dist/esm/Modal/ModalPortal.mjs +22 -20
- package/dist/esm/Modal/ModalPortal.mjs.map +1 -1
- package/dist/esm/Modal/index.mjs +1 -0
- package/dist/esm/Modal/index.mjs.map +1 -1
- package/dist/esm/NativeModules/index.mjs +3 -3
- package/dist/esm/NativeModules/index.mjs.map +1 -1
- package/dist/esm/PanResponder/index.mjs +3 -3
- package/dist/esm/PixelRatio/index.mjs +33 -31
- package/dist/esm/PixelRatio/index.mjs.map +1 -1
- package/dist/esm/Pressable/index.mjs +114 -119
- package/dist/esm/Pressable/index.mjs.map +1 -1
- package/dist/esm/RefreshControl/index.mjs +4 -18
- package/dist/esm/RefreshControl/index.mjs.map +1 -1
- package/dist/esm/SafeAreaView/index.mjs +18 -21
- package/dist/esm/SafeAreaView/index.mjs.map +1 -1
- package/dist/esm/ScrollView/WebScrollView.mjs +244 -0
- package/dist/esm/ScrollView/WebScrollView.mjs.map +1 -0
- package/dist/esm/ScrollView/index.mjs +3 -635
- package/dist/esm/SectionList.mjs +3 -4
- package/dist/esm/Share/index.mjs +32 -30
- package/dist/esm/Share/index.mjs.map +1 -1
- package/dist/esm/StatusBar/index.mjs +2 -1
- package/dist/esm/StatusBar/index.mjs.map +1 -1
- package/dist/esm/Text/index.mjs +116 -146
- package/dist/esm/Text/index.mjs.map +1 -1
- package/dist/esm/Text/types.mjs +0 -2
- package/dist/esm/TextInput/index.mjs +265 -336
- package/dist/esm/TextInput/index.mjs.map +1 -1
- package/dist/esm/TextInput/types.mjs +0 -2
- package/dist/esm/TouchableNativeFeedback.mjs +2 -2
- package/dist/esm/TouchableOpacity.mjs +75 -73
- package/dist/esm/TouchableOpacity.mjs.map +1 -1
- package/dist/esm/TouchableWithoutFeedback.mjs +49 -48
- package/dist/esm/TouchableWithoutFeedback.mjs.map +1 -1
- package/dist/esm/UnimplementedView.mjs +11 -11
- package/dist/esm/UnimplementedView.mjs.map +1 -1
- package/dist/esm/Vibration/index.mjs +11 -10
- package/dist/esm/Vibration/index.mjs.map +1 -1
- package/dist/esm/View/index.mjs +73 -97
- package/dist/esm/View/index.mjs.map +1 -1
- package/dist/esm/View/types.mjs +0 -2
- package/dist/esm/VirtualizedList.mjs +3 -4
- package/dist/esm/codegenNativeCommands.mjs +8 -0
- package/dist/esm/codegenNativeCommands.mjs.map +1 -0
- package/dist/esm/codegenNativeComponent.mjs +5 -3
- package/dist/esm/codegenNativeComponent.mjs.map +1 -1
- package/dist/esm/createElement/index.mjs +35 -45
- package/dist/esm/createElement/index.mjs.map +1 -1
- package/dist/esm/createReactDOMStyle.mjs +2 -0
- package/dist/esm/createReactDOMStyle.mjs.map +1 -1
- package/dist/esm/index.js +15 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +15 -10
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/modules/requestIdleCallback.mjs +13 -12
- package/dist/esm/modules/requestIdleCallback.mjs.map +1 -1
- package/dist/esm/preprocess.mjs +3 -3
- package/dist/esm/render/index.mjs +1 -0
- package/dist/esm/render/index.mjs.map +1 -1
- package/dist/esm/styleTypes.mjs +0 -2
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/useColorScheme/index.mjs +11 -11
- package/dist/esm/useColorScheme/index.mjs.map +1 -1
- package/dist/esm/useLocaleContext/index.mjs +2 -2
- package/dist/esm/useWindowDimensions/index.mjs +16 -16
- package/dist/esm/useWindowDimensions/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/Animated.mjs +12 -10
- package/dist/esm/vendor/react-native/Animated/Animated.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/AnimatedEvent.mjs +124 -127
- package/dist/esm/vendor/react-native/Animated/AnimatedEvent.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/AnimatedImplementation.mjs +485 -515
- package/dist/esm/vendor/react-native/Animated/AnimatedImplementation.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/AnimatedMock.mjs +85 -91
- package/dist/esm/vendor/react-native/Animated/AnimatedMock.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/AnimatedPlatformConfig.mjs +0 -2
- package/dist/esm/vendor/react-native/Animated/Easing.mjs +169 -167
- package/dist/esm/vendor/react-native/Animated/Easing.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/NativeAnimatedHelper.mjs +273 -296
- package/dist/esm/vendor/react-native/Animated/NativeAnimatedHelper.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/NativeAnimatedModule.mjs +26 -26
- package/dist/esm/vendor/react-native/Animated/NativeAnimatedModule.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/NativeAnimatedTurboModule.mjs +24 -23
- package/dist/esm/vendor/react-native/Animated/NativeAnimatedTurboModule.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/SpringConfig.mjs +48 -47
- package/dist/esm/vendor/react-native/Animated/SpringConfig.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/animations/Animation.mjs +38 -39
- package/dist/esm/vendor/react-native/Animated/animations/Animation.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/animations/DecayAnimation.mjs +60 -62
- package/dist/esm/vendor/react-native/Animated/animations/DecayAnimation.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/animations/SpringAnimation.mjs +196 -198
- package/dist/esm/vendor/react-native/Animated/animations/SpringAnimation.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/animations/TimingAnimation.mjs +93 -99
- package/dist/esm/vendor/react-native/Animated/animations/TimingAnimation.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/bezier.mjs +68 -71
- package/dist/esm/vendor/react-native/Animated/bezier.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedFlatList.mjs +7 -5
- package/dist/esm/vendor/react-native/Animated/components/AnimatedFlatList.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedImage.mjs +3 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedImage.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedScrollView.mjs +7 -5
- package/dist/esm/vendor/react-native/Animated/components/AnimatedScrollView.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedSectionList.mjs +7 -5
- package/dist/esm/vendor/react-native/Animated/components/AnimatedSectionList.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedText.mjs +2 -0
- package/dist/esm/vendor/react-native/Animated/components/AnimatedText.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/components/AnimatedView.mjs +2 -0
- package/dist/esm/vendor/react-native/Animated/components/AnimatedView.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/createAnimatedComponent.mjs +15 -19
- package/dist/esm/vendor/react-native/Animated/createAnimatedComponent.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedAddition.mjs +37 -35
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedAddition.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedColor.mjs +230 -230
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedColor.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDiffClamp.mjs +45 -43
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDiffClamp.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDivision.mjs +51 -49
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDivision.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedInterpolation.mjs +172 -172
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedInterpolation.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedModulo.mjs +35 -33
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedModulo.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedMultiplication.mjs +37 -35
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedMultiplication.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedNode.mjs +138 -139
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedNode.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedProps.mjs +119 -117
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedProps.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedStyle.mjs +99 -99
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedStyle.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedSubtraction.mjs +37 -35
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedSubtraction.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTracking.mjs +60 -59
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTracking.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTransform.mjs +95 -93
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTransform.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValue.mjs +198 -199
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValue.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValueXY.mjs +82 -86
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValueXY.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedWithChildren.mjs +56 -54
- package/dist/esm/vendor/react-native/Animated/nodes/AnimatedWithChildren.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Animated/useAnimatedProps.mjs +61 -59
- package/dist/esm/vendor/react-native/Animated/useAnimatedProps.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Batchinator/index.mjs +32 -40
- package/dist/esm/vendor/react-native/Batchinator/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/EventEmitter/NativeEventEmitter.mjs +40 -40
- package/dist/esm/vendor/react-native/EventEmitter/NativeEventEmitter.mjs.map +1 -1
- package/dist/esm/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.mjs +2 -0
- package/dist/esm/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.mjs.map +1 -1
- package/dist/esm/vendor/react-native/FeatureFlags.mjs +7 -6
- package/dist/esm/vendor/react-native/FeatureFlags.mjs.map +1 -1
- package/dist/esm/vendor/react-native/FillRateHelper/index.mjs +150 -156
- package/dist/esm/vendor/react-native/FillRateHelper/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/FlatList/index.mjs +244 -271
- package/dist/esm/vendor/react-native/FlatList/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/JSEventLoopWatchdog/index.mjs +52 -52
- package/dist/esm/vendor/react-native/JSEventLoopWatchdog/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/LayoutAnimation/index.mjs +73 -74
- package/dist/esm/vendor/react-native/LayoutAnimation/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/PanResponder/index.mjs +153 -151
- package/dist/esm/vendor/react-native/PanResponder/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/PooledClass/index.mjs +27 -26
- package/dist/esm/vendor/react-native/PooledClass/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/ReactNative/ReactNativeFeatureFlags.mjs +6 -5
- package/dist/esm/vendor/react-native/ReactNative/ReactNativeFeatureFlags.mjs.map +1 -1
- package/dist/esm/vendor/react-native/SectionList/index.mjs +78 -85
- package/dist/esm/vendor/react-native/SectionList/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/StaticContainer/index.mjs +11 -9
- package/dist/esm/vendor/react-native/StaticContainer/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/StaticRenderer/index.mjs +10 -8
- package/dist/esm/vendor/react-native/StaticRenderer/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/TouchHistoryMath/index.mjs +67 -94
- package/dist/esm/vendor/react-native/TouchHistoryMath/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/TurboModule/RCTExport.mjs +3 -6
- package/dist/esm/vendor/react-native/TurboModule/RCTExport.mjs.map +1 -1
- package/dist/esm/vendor/react-native/TurboModule/TurboModuleRegistry.mjs +6 -4
- package/dist/esm/vendor/react-native/TurboModule/TurboModuleRegistry.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Types/CoreEventTypes.mjs +105 -106
- package/dist/esm/vendor/react-native/Types/CoreEventTypes.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Utilities/Platform.mjs +2 -0
- package/dist/esm/vendor/react-native/Utilities/Platform.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Utilities/clamp.mjs +8 -7
- package/dist/esm/vendor/react-native/Utilities/clamp.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Utilities/setAndForwardRef.mjs +11 -13
- package/dist/esm/vendor/react-native/Utilities/setAndForwardRef.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Utilities/useMergeRefs.mjs +13 -13
- package/dist/esm/vendor/react-native/Utilities/useMergeRefs.mjs.map +1 -1
- package/dist/esm/vendor/react-native/Utilities/useRefEffect.mjs +12 -10
- package/dist/esm/vendor/react-native/Utilities/useRefEffect.mjs.map +1 -1
- package/dist/esm/vendor/react-native/ViewabilityHelper/index.mjs +140 -146
- package/dist/esm/vendor/react-native/ViewabilityHelper/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/ViewabilityHelper.mjs +133 -139
- package/dist/esm/vendor/react-native/ViewabilityHelper.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.mjs +107 -106
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.mjs +88 -82
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.mjs +49 -47
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.mjs +49 -50
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.mjs +87 -135
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.mjs +38 -38
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.mjs +36 -35
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedList/index.mjs +207 -266
- package/dist/esm/vendor/react-native/VirtualizedList/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/VirtualizedSectionList/index.mjs +107 -119
- package/dist/esm/vendor/react-native/VirtualizedSectionList/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/deepDiffer/index.mjs +43 -42
- package/dist/esm/vendor/react-native/deepDiffer/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/emitter/EventEmitter.mjs +2 -0
- package/dist/esm/vendor/react-native/emitter/EventEmitter.mjs.map +1 -1
- package/dist/esm/vendor/react-native/emitter/EventSubscription.mjs +0 -2
- package/dist/esm/vendor/react-native/emitter/_EmitterSubscription.mjs +29 -27
- package/dist/esm/vendor/react-native/emitter/_EmitterSubscription.mjs.map +1 -1
- package/dist/esm/vendor/react-native/emitter/_EventEmitter.mjs +101 -103
- package/dist/esm/vendor/react-native/emitter/_EventEmitter.mjs.map +1 -1
- package/dist/esm/vendor/react-native/emitter/_EventSubscription.mjs +16 -15
- package/dist/esm/vendor/react-native/emitter/_EventSubscription.mjs.map +1 -1
- package/dist/esm/vendor/react-native/emitter/_EventSubscriptionVendor.mjs +66 -64
- package/dist/esm/vendor/react-native/emitter/_EventSubscriptionVendor.mjs.map +1 -1
- package/dist/esm/vendor/react-native/infoLog/index.mjs +2 -1
- package/dist/esm/vendor/react-native/infoLog/index.mjs.map +1 -1
- package/dist/esm/vendor/react-native/useRefEffect.mjs +12 -10
- package/dist/esm/vendor/react-native/useRefEffect.mjs.map +1 -1
- package/dist/esm/vendor/react-native/vendor/emitter/EventEmitter.mjs +71 -70
- package/dist/esm/vendor/react-native/vendor/emitter/EventEmitter.mjs.map +1 -1
- package/dist/esm/without-animated.mjs +172 -187
- package/dist/esm/without-animated.mjs.map +1 -1
- package/package.json +12 -12
- package/src/ScrollView/WebScrollView.tsx +383 -0
- package/src/ScrollView/index.tsx +6 -892
- package/src/codegenNativeCommands.ts +6 -0
- package/src/codegenNativeComponent.ts +2 -2
- package/src/index.tsx +3 -0
- package/src/without-animated.tsx +1 -0
- package/dist/cjs/ActivityIndicator/__tests__/index-test.cjs +0 -209
- package/dist/cjs/AppRegistry/__tests__/index-test.cjs +0 -97
- package/dist/cjs/AppRegistry/__tests__/index-test.node.cjs +0 -162
- package/dist/cjs/AppState/__tests__/index-test.cjs +0 -38
- package/dist/cjs/Dimensions/__tests__/index-test.cjs +0 -67
- package/dist/cjs/ImageBackground/__tests__/index-test.cjs +0 -72
- package/dist/cjs/Linking/__tests__/index-test.cjs +0 -56
- package/dist/cjs/ScrollView/ScrollViewBase.cjs +0 -167
- package/dist/cjs/codegenNativeCommand.cjs +0 -31
- package/dist/cjs/createElement/__tests__/index-test.cjs +0 -828
- package/dist/esm/ActivityIndicator/__tests__/index-test.mjs +0 -186
- package/dist/esm/ActivityIndicator/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/AppRegistry/__tests__/index-test.mjs +0 -74
- package/dist/esm/AppRegistry/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/AppRegistry/__tests__/index-test.node.mjs +0 -139
- package/dist/esm/AppRegistry/__tests__/index-test.node.mjs.map +0 -1
- package/dist/esm/AppState/__tests__/index-test.mjs +0 -15
- package/dist/esm/AppState/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/Dimensions/__tests__/index-test.mjs +0 -44
- package/dist/esm/Dimensions/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/Image/types.mjs.map +0 -1
- package/dist/esm/ImageBackground/__tests__/index-test.mjs +0 -49
- package/dist/esm/ImageBackground/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/Linking/__tests__/index-test.mjs +0 -33
- package/dist/esm/Linking/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/PanResponder/index.mjs.map +0 -1
- package/dist/esm/ScrollView/ScrollViewBase.mjs +0 -130
- package/dist/esm/ScrollView/ScrollViewBase.mjs.map +0 -1
- package/dist/esm/ScrollView/index.mjs.map +0 -1
- package/dist/esm/SectionList.mjs.map +0 -1
- package/dist/esm/Text/types.mjs.map +0 -1
- package/dist/esm/TextInput/types.mjs.map +0 -1
- package/dist/esm/TouchableNativeFeedback.mjs.map +0 -1
- package/dist/esm/View/types.mjs.map +0 -1
- package/dist/esm/VirtualizedList.mjs.map +0 -1
- package/dist/esm/codegenNativeCommand.mjs +0 -6
- package/dist/esm/codegenNativeCommand.mjs.map +0 -1
- package/dist/esm/createElement/__tests__/index-test.mjs +0 -805
- package/dist/esm/createElement/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/preprocess.mjs.map +0 -1
- package/dist/esm/styleTypes.mjs.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/useLocaleContext/index.mjs.map +0 -1
- package/dist/esm/vendor/react-native/Animated/AnimatedPlatformConfig.mjs.map +0 -1
- package/dist/esm/vendor/react-native/emitter/EventSubscription.mjs.map +0 -1
- package/src/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap +0 -466
- package/src/ActivityIndicator/__tests__/index-test.tsx +0 -147
- package/src/AppRegistry/__tests__/index-test.node.tsx +0 -144
- package/src/AppRegistry/__tests__/index-test.tsx +0 -94
- package/src/AppState/__tests__/index-test.tsx +0 -24
- package/src/Dimensions/__tests__/index-test.tsx +0 -54
- package/src/ImageBackground/__tests__/index-test.tsx +0 -49
- package/src/Linking/__tests__/index-test.tsx +0 -37
- package/src/Pressable/__tests__/__snapshots__/index-test.js.snap +0 -196
- package/src/ScrollView/ScrollViewBase.tsx +0 -183
- package/src/ScrollView/__tests__/__snapshots__/index-test.js.snap +0 -49
- package/src/Text/__tests__/__snapshots__/index-test.js.snap +0 -218
- package/src/codegenNativeCommand.ts +0 -6
- package/src/createElement/__tests__/__snapshots__/index-test.js.snap +0 -13
- package/src/createElement/__tests__/index-test.tsx +0 -647
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/react-native-web-lite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.637.1",
|
|
4
4
|
"description": "React Native for Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"import": "./dist/esm/codegenNativeComponent.mjs",
|
|
59
59
|
"require": "./dist/cjs/codegenNativeComponent.cjs"
|
|
60
60
|
},
|
|
61
|
-
"./Libraries/Utilities/
|
|
62
|
-
"browser": "./dist/esm/
|
|
63
|
-
"module": "./dist/esm/
|
|
64
|
-
"import": "./dist/esm/
|
|
65
|
-
"require": "./dist/cjs/
|
|
61
|
+
"./Libraries/Utilities/codegenNativeCommands": {
|
|
62
|
+
"browser": "./dist/esm/codegenNativeCommands.mjs",
|
|
63
|
+
"module": "./dist/esm/codegenNativeCommands.mjs",
|
|
64
|
+
"import": "./dist/esm/codegenNativeCommands.mjs",
|
|
65
|
+
"require": "./dist/cjs/codegenNativeCommands.cjs"
|
|
66
66
|
},
|
|
67
67
|
"./dist/exports/StyleSheet/compiler/createReactDOMStyle": {
|
|
68
68
|
"browser": "./dist/esm/createReactDOMStyle.mjs",
|
|
@@ -102,16 +102,16 @@
|
|
|
102
102
|
"clean:build": "tamagui-build clean:build"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@tamagui/normalize-css-color": "
|
|
106
|
-
"@tamagui/react-native-use-pressable": "
|
|
107
|
-
"@tamagui/react-native-use-responder-events": "
|
|
108
|
-
"@tamagui/react-native-web-internals": "
|
|
109
|
-
"@tamagui/web": "
|
|
105
|
+
"@tamagui/normalize-css-color": "3.0.0-beta.637.1",
|
|
106
|
+
"@tamagui/react-native-use-pressable": "3.0.0-beta.637.1",
|
|
107
|
+
"@tamagui/react-native-use-responder-events": "3.0.0-beta.637.1",
|
|
108
|
+
"@tamagui/react-native-web-internals": "3.0.0-beta.637.1",
|
|
109
|
+
"@tamagui/web": "3.0.0-beta.637.1",
|
|
110
110
|
"invariant": "^2.2.4",
|
|
111
111
|
"memoize-one": "^6.0.0"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
|
-
"@tamagui/build": "
|
|
114
|
+
"@tamagui/build": "3.0.0-beta.637.1",
|
|
115
115
|
"react": ">=19",
|
|
116
116
|
"react-dom": "*"
|
|
117
117
|
},
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { View as LiteView } from '../View/index'
|
|
4
|
+
|
|
5
|
+
// self-contained copy of @tamagui/scroll-view's WebScrollView built on lite's
|
|
6
|
+
// own View: lite IS the react-native substitute in native-target bundles, so
|
|
7
|
+
// it must not import tamagui packages (their native builds import
|
|
8
|
+
// react-native = lite, a require cycle that leaves exports undefined).
|
|
9
|
+
// keep in sync with code/ui/scroll-view/src/WebScrollView.tsx.
|
|
10
|
+
const View = LiteView as any
|
|
11
|
+
|
|
12
|
+
// clean-room web ScrollView: an overflow-scrolling tamagui View that maps the
|
|
13
|
+
// subset of the react-native ScrollView API that tamagui + its consumers use.
|
|
14
|
+
// this replaces the previous dependency on react-native (aliased to
|
|
15
|
+
// react-native-web-lite) so @tamagui/scroll-view no longer pulls react-native
|
|
16
|
+
// into web bundles. the native implementation lives in ScrollView.native.tsx.
|
|
17
|
+
|
|
18
|
+
export interface ScrollViewMethods {
|
|
19
|
+
getScrollResponder: () => any
|
|
20
|
+
getScrollableNode: () => HTMLElement
|
|
21
|
+
getInnerViewNode: () => HTMLElement
|
|
22
|
+
getInnerViewRef: () => HTMLElement
|
|
23
|
+
getNativeScrollRef: () => HTMLElement
|
|
24
|
+
scrollTo: (options?: { x?: number; y?: number; animated?: boolean }) => void
|
|
25
|
+
scrollToEnd: (options?: { animated?: boolean }) => void
|
|
26
|
+
flashScrollIndicators: () => void
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ScrollViewRef = HTMLElement & ScrollViewMethods
|
|
30
|
+
|
|
31
|
+
function mergeRefs(...refs: any[]) {
|
|
32
|
+
return (node: any) => {
|
|
33
|
+
for (const ref of refs) {
|
|
34
|
+
if (!ref) continue
|
|
35
|
+
if (typeof ref === 'function') ref(node)
|
|
36
|
+
else ref.current = node
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function normalizeScrollEvent(e: any) {
|
|
42
|
+
const target = e.target
|
|
43
|
+
return {
|
|
44
|
+
nativeEvent: {
|
|
45
|
+
contentOffset: {
|
|
46
|
+
get x() {
|
|
47
|
+
return target.scrollLeft
|
|
48
|
+
},
|
|
49
|
+
get y() {
|
|
50
|
+
return target.scrollTop
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
contentSize: {
|
|
54
|
+
get height() {
|
|
55
|
+
return target.scrollHeight
|
|
56
|
+
},
|
|
57
|
+
get width() {
|
|
58
|
+
return target.scrollWidth
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
layoutMeasurement: {
|
|
62
|
+
get height() {
|
|
63
|
+
return target.offsetHeight
|
|
64
|
+
},
|
|
65
|
+
get width() {
|
|
66
|
+
return target.offsetWidth
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
timeStamp: Date.now(),
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function shouldEmitScrollEvent(lastTick: number, eventThrottle: number) {
|
|
75
|
+
const timeSinceLastTick = Date.now() - lastTick
|
|
76
|
+
return eventThrottle > 0 && timeSinceLastTick >= eventThrottle
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// tamagui hands styled(non-tamagui) bases react-native-web style objects: real
|
|
80
|
+
// style values are plain keys, resolved atomic styles arrive as { $$css: true,
|
|
81
|
+
// className: className } maps. split those apart so classNames land on className
|
|
82
|
+
// and only real values land on style (merging them poisons the whole object as a
|
|
83
|
+
// className map). arrays are flattened recursively.
|
|
84
|
+
function resolveStyles(...inputs: any[]): { style: any; className: string } {
|
|
85
|
+
const style: any = {}
|
|
86
|
+
const classNames: string[] = []
|
|
87
|
+
const walk = (s: any) => {
|
|
88
|
+
if (!s) return
|
|
89
|
+
if (Array.isArray(s)) {
|
|
90
|
+
for (const item of s) walk(item)
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
if (s.$$css) {
|
|
94
|
+
for (const k in s) {
|
|
95
|
+
if (k !== '$$css') classNames.push(s[k])
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
Object.assign(style, s)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
for (const input of inputs) walk(input)
|
|
102
|
+
return { style, className: classNames.join(' ') }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function joinClassNames(...parts: (string | undefined | false)[]): string | undefined {
|
|
106
|
+
const joined = parts.filter(Boolean).join(' ').trim()
|
|
107
|
+
return joined || undefined
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const commonStyle = {
|
|
111
|
+
flexGrow: 1,
|
|
112
|
+
flexShrink: 1,
|
|
113
|
+
} as const
|
|
114
|
+
|
|
115
|
+
const styles = {
|
|
116
|
+
baseVertical: {
|
|
117
|
+
...commonStyle,
|
|
118
|
+
flexDirection: 'column',
|
|
119
|
+
overflowX: 'hidden',
|
|
120
|
+
overflowY: 'auto',
|
|
121
|
+
},
|
|
122
|
+
baseHorizontal: {
|
|
123
|
+
...commonStyle,
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
overflowX: 'auto',
|
|
126
|
+
overflowY: 'hidden',
|
|
127
|
+
},
|
|
128
|
+
contentContainerHorizontal: {
|
|
129
|
+
flexDirection: 'row',
|
|
130
|
+
},
|
|
131
|
+
contentContainerCenterContent: {
|
|
132
|
+
justifyContent: 'center',
|
|
133
|
+
flexGrow: 1,
|
|
134
|
+
},
|
|
135
|
+
stickyHeader: {
|
|
136
|
+
position: 'sticky',
|
|
137
|
+
top: 0,
|
|
138
|
+
zIndex: 10,
|
|
139
|
+
},
|
|
140
|
+
pagingEnabledHorizontal: {
|
|
141
|
+
scrollSnapType: 'x mandatory',
|
|
142
|
+
},
|
|
143
|
+
pagingEnabledVertical: {
|
|
144
|
+
scrollSnapType: 'y mandatory',
|
|
145
|
+
},
|
|
146
|
+
pagingEnabledChild: {
|
|
147
|
+
scrollSnapAlign: 'start',
|
|
148
|
+
},
|
|
149
|
+
scrollDisabled: {
|
|
150
|
+
overflowX: 'hidden',
|
|
151
|
+
overflowY: 'hidden',
|
|
152
|
+
touchAction: 'none',
|
|
153
|
+
},
|
|
154
|
+
} as const
|
|
155
|
+
|
|
156
|
+
export const WebScrollView = React.forwardRef<ScrollViewRef, any>(
|
|
157
|
+
(props, forwardedRef) => {
|
|
158
|
+
const {
|
|
159
|
+
children,
|
|
160
|
+
contentContainerStyle,
|
|
161
|
+
horizontal,
|
|
162
|
+
onContentSizeChange,
|
|
163
|
+
onScroll,
|
|
164
|
+
refreshControl,
|
|
165
|
+
stickyHeaderIndices,
|
|
166
|
+
pagingEnabled,
|
|
167
|
+
centerContent,
|
|
168
|
+
scrollEnabled = true,
|
|
169
|
+
scrollEventThrottle = 0,
|
|
170
|
+
showsHorizontalScrollIndicator,
|
|
171
|
+
showsVerticalScrollIndicator,
|
|
172
|
+
style,
|
|
173
|
+
// strip react-native-only props that shouldn't reach the DOM
|
|
174
|
+
keyboardShouldPersistTaps,
|
|
175
|
+
keyboardDismissMode,
|
|
176
|
+
contentOffset,
|
|
177
|
+
contentInset,
|
|
178
|
+
contentInsetAdjustmentBehavior,
|
|
179
|
+
decelerationRate,
|
|
180
|
+
directionalLockEnabled,
|
|
181
|
+
disableIntervalMomentum,
|
|
182
|
+
disableScrollViewPanResponder,
|
|
183
|
+
endFillColor,
|
|
184
|
+
fadingEdgeLength,
|
|
185
|
+
indicatorStyle,
|
|
186
|
+
invertStickyHeaders,
|
|
187
|
+
maintainVisibleContentPosition,
|
|
188
|
+
maximumZoomScale,
|
|
189
|
+
minimumZoomScale,
|
|
190
|
+
nestedScrollEnabled,
|
|
191
|
+
onScrollToTop,
|
|
192
|
+
overScrollMode,
|
|
193
|
+
pinchGestureEnabled,
|
|
194
|
+
removeClippedSubviews,
|
|
195
|
+
scrollIndicatorInsets,
|
|
196
|
+
scrollPerfTag,
|
|
197
|
+
scrollToOverflowEnabled,
|
|
198
|
+
snapToAlignment,
|
|
199
|
+
snapToEnd,
|
|
200
|
+
snapToInterval,
|
|
201
|
+
snapToOffsets,
|
|
202
|
+
snapToStart,
|
|
203
|
+
bounces,
|
|
204
|
+
...rest
|
|
205
|
+
} = props
|
|
206
|
+
|
|
207
|
+
// tamagui treats this styled base as a react-native component, so it hands
|
|
208
|
+
// data-* attributes down as a `dataSet` map (the react-native-web convention).
|
|
209
|
+
// @tamagui/web's View doesn't expand that back, so do it here to keep
|
|
210
|
+
// data-testid and friends on the DOM node.
|
|
211
|
+
const { dataSet, ...domRest } = rest as any
|
|
212
|
+
const dataAttrs: Record<string, any> = {}
|
|
213
|
+
if (dataSet) {
|
|
214
|
+
for (const key in dataSet) {
|
|
215
|
+
dataAttrs[`data-${key}`] = dataSet[key]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const scrollNodeRef = React.useRef<any>(null)
|
|
220
|
+
const innerViewRef = React.useRef<any>(null)
|
|
221
|
+
const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 })
|
|
222
|
+
const scrollTimeout = React.useRef<any>(null)
|
|
223
|
+
|
|
224
|
+
const scrollTo = (options?: { x?: number; y?: number; animated?: boolean }) => {
|
|
225
|
+
const node = scrollNodeRef.current
|
|
226
|
+
if (node == null) return
|
|
227
|
+
const { x = 0, y = 0, animated = true } = options || {}
|
|
228
|
+
if (typeof node.scroll === 'function') {
|
|
229
|
+
node.scroll({ top: y, left: x, behavior: animated ? 'smooth' : 'auto' })
|
|
230
|
+
} else {
|
|
231
|
+
node.scrollLeft = x
|
|
232
|
+
node.scrollTop = y
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const scrollToEnd = (options?: { animated?: boolean }) => {
|
|
237
|
+
const node = scrollNodeRef.current
|
|
238
|
+
if (node == null) return
|
|
239
|
+
const animated = (options && options.animated) !== false
|
|
240
|
+
const x = horizontal ? node.scrollWidth : 0
|
|
241
|
+
const y = horizontal ? 0 : node.scrollHeight
|
|
242
|
+
scrollTo({ x, y, animated })
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const setScrollNodeRef = React.useCallback(
|
|
246
|
+
(node: any) => {
|
|
247
|
+
scrollNodeRef.current = node
|
|
248
|
+
if (node != null) {
|
|
249
|
+
node.getScrollResponder = () => node
|
|
250
|
+
node.getScrollableNode = () => node
|
|
251
|
+
node.getInnerViewNode = () => innerViewRef.current
|
|
252
|
+
node.getInnerViewRef = () => innerViewRef.current
|
|
253
|
+
node.getNativeScrollRef = () => node
|
|
254
|
+
node.scrollTo = scrollTo
|
|
255
|
+
node.scrollToEnd = scrollToEnd
|
|
256
|
+
node.flashScrollIndicators = () => {}
|
|
257
|
+
}
|
|
258
|
+
mergeRefs(forwardedRef)(node)
|
|
259
|
+
},
|
|
260
|
+
[forwardedRef, horizontal]
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
function handleScroll(e: any) {
|
|
264
|
+
e.stopPropagation()
|
|
265
|
+
if (e.target !== scrollNodeRef.current) return
|
|
266
|
+
if (scrollTimeout.current != null) {
|
|
267
|
+
clearTimeout(scrollTimeout.current)
|
|
268
|
+
}
|
|
269
|
+
scrollTimeout.current = setTimeout(() => {
|
|
270
|
+
scrollState.current.isScrolling = false
|
|
271
|
+
onScroll?.(normalizeScrollEvent(e))
|
|
272
|
+
}, 100)
|
|
273
|
+
if (scrollState.current.isScrolling) {
|
|
274
|
+
if (
|
|
275
|
+
shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)
|
|
276
|
+
) {
|
|
277
|
+
scrollState.current.scrollLastTick = Date.now()
|
|
278
|
+
onScroll?.(normalizeScrollEvent(e))
|
|
279
|
+
}
|
|
280
|
+
} else {
|
|
281
|
+
scrollState.current.isScrolling = true
|
|
282
|
+
scrollState.current.scrollLastTick = Date.now()
|
|
283
|
+
onScroll?.(normalizeScrollEvent(e))
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const handleContentLayout = onContentSizeChange
|
|
288
|
+
? (e: any) => {
|
|
289
|
+
const { width, height } = e.nativeEvent.layout
|
|
290
|
+
onContentSizeChange(width, height)
|
|
291
|
+
}
|
|
292
|
+
: undefined
|
|
293
|
+
|
|
294
|
+
const hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices)
|
|
295
|
+
const renderedChildren =
|
|
296
|
+
hasStickyHeaderIndices || pagingEnabled
|
|
297
|
+
? React.Children.map(children, (child, i) => {
|
|
298
|
+
const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1
|
|
299
|
+
if (child != null && (isSticky || pagingEnabled)) {
|
|
300
|
+
const resolved = resolveStyles(
|
|
301
|
+
isSticky && styles.stickyHeader,
|
|
302
|
+
pagingEnabled && styles.pagingEnabledChild
|
|
303
|
+
)
|
|
304
|
+
return (
|
|
305
|
+
<View
|
|
306
|
+
style={resolved.style}
|
|
307
|
+
className={joinClassNames(resolved.className)}
|
|
308
|
+
>
|
|
309
|
+
{child}
|
|
310
|
+
</View>
|
|
311
|
+
)
|
|
312
|
+
}
|
|
313
|
+
return child
|
|
314
|
+
})
|
|
315
|
+
: children
|
|
316
|
+
|
|
317
|
+
const contentResolved = resolveStyles(
|
|
318
|
+
horizontal && styles.contentContainerHorizontal,
|
|
319
|
+
centerContent && styles.contentContainerCenterContent,
|
|
320
|
+
contentContainerStyle
|
|
321
|
+
)
|
|
322
|
+
const contentContainer = (
|
|
323
|
+
<View
|
|
324
|
+
ref={innerViewRef}
|
|
325
|
+
onLayout={handleContentLayout}
|
|
326
|
+
style={contentResolved.style}
|
|
327
|
+
className={joinClassNames(contentResolved.className)}
|
|
328
|
+
>
|
|
329
|
+
{renderedChildren}
|
|
330
|
+
</View>
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical
|
|
334
|
+
const pagingEnabledStyle = horizontal
|
|
335
|
+
? styles.pagingEnabledHorizontal
|
|
336
|
+
: styles.pagingEnabledVertical
|
|
337
|
+
|
|
338
|
+
const hideHorizontalScrollbar = showsHorizontalScrollIndicator === false
|
|
339
|
+
const hideVerticalScrollbar = showsVerticalScrollIndicator === false
|
|
340
|
+
const extraClassName =
|
|
341
|
+
(hideHorizontalScrollbar ? ' _hsb-x' : '') +
|
|
342
|
+
(hideVerticalScrollbar ? ' _hsb-y' : '')
|
|
343
|
+
|
|
344
|
+
const scrollResolved = resolveStyles(
|
|
345
|
+
baseStyle,
|
|
346
|
+
pagingEnabled && pagingEnabledStyle,
|
|
347
|
+
style,
|
|
348
|
+
!scrollEnabled && styles.scrollDisabled
|
|
349
|
+
)
|
|
350
|
+
const scrollView = (
|
|
351
|
+
<View
|
|
352
|
+
{...domRest}
|
|
353
|
+
{...dataAttrs}
|
|
354
|
+
className={joinClassNames(
|
|
355
|
+
domRest.className,
|
|
356
|
+
scrollResolved.className,
|
|
357
|
+
extraClassName
|
|
358
|
+
)}
|
|
359
|
+
ref={setScrollNodeRef}
|
|
360
|
+
onScroll={handleScroll}
|
|
361
|
+
style={scrollResolved.style}
|
|
362
|
+
>
|
|
363
|
+
{contentContainer}
|
|
364
|
+
</View>
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
if (refreshControl) {
|
|
368
|
+
const refreshResolved = resolveStyles(baseStyle, style)
|
|
369
|
+
return React.cloneElement(
|
|
370
|
+
refreshControl,
|
|
371
|
+
{
|
|
372
|
+
style: refreshResolved.style,
|
|
373
|
+
className: joinClassNames(refreshResolved.className),
|
|
374
|
+
},
|
|
375
|
+
scrollView
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return scrollView
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
WebScrollView.displayName = 'ScrollView'
|