not-react-native-macos 0.83.0-rc.1 → 0.87.1-rc.2
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/Libraries/ActionSheetIOS/ActionSheetIOS.js +22 -27
- package/Libraries/Alert/Alert.js +38 -120
- package/Libraries/Alert/RCTAlertManager.macos.js +12 -7
- package/Libraries/Animated/Animated.d.ts +8 -1
- package/Libraries/Animated/AnimatedEvent.js +7 -7
- package/Libraries/Animated/AnimatedExports.js +22 -0
- package/Libraries/Animated/AnimatedExports.js.flow +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +134 -13
- package/Libraries/Animated/AnimatedMock.js +1 -7
- package/Libraries/Animated/Easing.js +4 -3
- package/Libraries/Animated/NativeAnimatedAllowlist.js +58 -0
- package/Libraries/Animated/__tests__/Animated-benchmark-itest.js +133 -0
- package/Libraries/Animated/__tests__/Animated-itest.js +1010 -0
- package/Libraries/Animated/__tests__/Animated-test.js +1257 -0
- package/Libraries/Animated/__tests__/Animated-web-test.js +199 -0
- package/Libraries/Animated/__tests__/AnimatedBackend-benchmark-itest.js +198 -0
- package/Libraries/Animated/__tests__/AnimatedBackend-itest.js +733 -0
- package/Libraries/Animated/__tests__/AnimatedBackendSuspense-itest.js +592 -0
- package/Libraries/Animated/__tests__/AnimatedMock-itest.js +49 -0
- package/Libraries/Animated/__tests__/AnimatedObject-itest.js +90 -0
- package/Libraries/Animated/__tests__/AnimatedValue-itest.js +248 -0
- package/Libraries/Animated/__tests__/Easing-itest.js +249 -0
- package/Libraries/Animated/__tests__/Interpolation-itest.js +601 -0
- package/Libraries/Animated/__tests__/NativeAnimatedAllowlist-test.js +86 -0
- package/Libraries/Animated/__tests__/TimingAnimation-itest.js +40 -0
- package/Libraries/Animated/__tests__/bezier-itest.js +149 -0
- package/Libraries/Animated/animations/Animation.js +18 -11
- package/Libraries/Animated/animations/DecayAnimation.js +5 -4
- package/Libraries/Animated/animations/SpringAnimation.js +6 -5
- package/Libraries/Animated/animations/TimingAnimation.js +14 -5
- package/Libraries/Animated/components/AnimatedImage.js +3 -3
- package/Libraries/Animated/components/AnimatedText.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +21 -18
- package/Libraries/Animated/nodes/AnimatedAddition.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +18 -18
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +1 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +167 -27
- package/Libraries/Animated/nodes/AnimatedModulo.js +1 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +1 -1
- package/Libraries/Animated/nodes/AnimatedNode.js +6 -6
- package/Libraries/Animated/nodes/AnimatedObject.js +18 -13
- package/Libraries/Animated/nodes/AnimatedProps.js +73 -18
- package/Libraries/Animated/nodes/AnimatedStyle.js +19 -19
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +13 -13
- package/Libraries/Animated/nodes/AnimatedValue.js +17 -6
- package/Libraries/Animated/nodes/AnimatedValueXY.js +4 -4
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -1
- package/Libraries/Animated/useAnimatedColor.d.ts +15 -0
- package/Libraries/Animated/useAnimatedColor.js +25 -0
- package/Libraries/Animated/useAnimatedValueXY.d.ts +15 -0
- package/Libraries/Animated/useAnimatedValueXY.js +26 -0
- package/Libraries/AppDelegate/RCTAppDelegate.h +8 -16
- package/Libraries/AppDelegate/RCTAppDelegate.mm +4 -60
- package/Libraries/AppDelegate/RCTAppSetupUtils.h +0 -18
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +0 -80
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.h +1 -5
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +23 -22
- package/Libraries/AppDelegate/RCTReactNativeFactory.h +12 -45
- package/Libraries/AppDelegate/RCTReactNativeFactory.mm +22 -108
- package/Libraries/AppDelegate/RCTRootViewFactory.h +26 -17
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +35 -134
- package/Libraries/AppDelegate/RCTUIConfiguratorProtocol.h +2 -2
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
- package/Libraries/AppState/AppState.d.ts +4 -1
- package/Libraries/AppState/AppState.js +35 -22
- package/Libraries/BatchedBridge/MessageQueue.js +69 -76
- package/Libraries/BatchedBridge/NativeModules.js +20 -11
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +37 -0
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +24 -0
- package/Libraries/BatchedBridge/__tests__/MessageQueue-itest.js +183 -0
- package/Libraries/BatchedBridge/__tests__/NativeModules-test.js +253 -0
- package/Libraries/Blob/Blob.js +7 -1
- package/Libraries/Blob/FileReader.js +6 -0
- package/Libraries/Blob/RCTBlobCollector.h +1 -1
- package/Libraries/Blob/RCTBlobCollector.mm +14 -26
- package/Libraries/Blob/RCTBlobManager.mm +11 -3
- package/Libraries/Blob/RCTBlobPlugins.mm +14 -14
- package/Libraries/Blob/URL.js +34 -3
- package/Libraries/Blob/URLSearchParams.js +1 -0
- package/Libraries/Blob/URLSearchParams.js.flow +1 -1
- package/Libraries/Blob/__mocks__/BlobModule.js +16 -0
- package/Libraries/Blob/__mocks__/FileReaderModule.js +20 -0
- package/Libraries/Blob/__tests__/Blob-test.js +135 -0
- package/Libraries/Blob/__tests__/BlobManager-test.js +32 -0
- package/Libraries/Blob/__tests__/BlobRegistry-itest.js +49 -0
- package/Libraries/Blob/__tests__/File-test.js +89 -0
- package/Libraries/Blob/__tests__/FileReader-test.js +87 -0
- package/Libraries/Blob/__tests__/URL-itest.js +168 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +29 -19
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +118 -156
- package/Libraries/Components/AccessibilityInfo/__tests__/AccessibilityInfo-test.js +822 -0
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.macos.js +14 -7
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +61 -51
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -2
- package/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-itest.js +195 -0
- package/Libraries/Components/Button.js +104 -248
- package/Libraries/Components/Clipboard/Clipboard.js +5 -0
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +9 -70
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +10 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +2 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.macos.js +23 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +32 -37
- package/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js +38 -0
- package/Libraries/Components/DrawerAndroid/__tests__/__snapshots__/DrawerAndroid-test.js.snap +107 -0
- package/Libraries/Components/Keyboard/Keyboard.js +34 -71
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -9
- package/Libraries/Components/Keyboard/__tests__/Keyboard-test.js +83 -0
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +2 -28
- package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +1 -1
- package/Libraries/Components/Pressable/Pressable.d.ts +6 -0
- package/Libraries/Components/Pressable/Pressable.js +53 -172
- package/Libraries/Components/Pressable/__tests__/Pressable-itest.js +323 -0
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +11 -12
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +5 -6
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +5 -5
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -2
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +20 -3
- package/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-itest.js +31 -0
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -2
- package/Libraries/Components/RefreshControl/RefreshControl.js +44 -54
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +8 -8
- package/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-itest.js +38 -0
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +8 -12
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +1 -5
- package/Libraries/Components/ScrollView/ScrollView.d.ts +64 -43
- package/Libraries/Components/ScrollView/ScrollView.js +227 -165
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +6 -6
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +8 -32
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +4 -3
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +4 -4
- package/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js +240 -0
- package/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js +2602 -0
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.d.ts +7 -54
- package/Libraries/Components/StatusBar/StatusBar.js +93 -169
- package/Libraries/Components/StatusBar/__tests__/StatusBar-test.js +79 -0
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -2
- package/Libraries/Components/Switch/Switch.js +80 -79
- package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -2
- package/Libraries/Components/Switch/__tests__/Switch-itest.js +47 -0
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +58 -49
- package/Libraries/Components/TextInput/InputAccessoryView.js +14 -62
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +3 -3
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +6 -41
- package/Libraries/Components/TextInput/TextInput.d.ts +33 -127
- package/Libraries/Components/TextInput/TextInput.flow.js +79 -205
- package/Libraries/Components/TextInput/TextInput.js +163 -246
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +4 -16
- package/Libraries/Components/TextInput/TextInputState.js +3 -7
- package/Libraries/Components/TextInput/__tests__/InputAccessoryView-itest.js +33 -0
- package/Libraries/Components/TextInput/__tests__/TextInput-itest.js +633 -0
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +30 -24
- package/Libraries/Components/ToastAndroid/ToastAndroid.macos.js +23 -0
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +5 -5
- package/Libraries/Components/Touchable/PooledClass.js +6 -6
- package/Libraries/Components/Touchable/Touchable.js +95 -101
- package/Libraries/Components/Touchable/TouchableBounce.js +12 -32
- package/Libraries/Components/Touchable/TouchableHighlight.js +53 -139
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +27 -43
- package/Libraries/Components/Touchable/TouchableOpacity.js +20 -116
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +15 -49
- package/Libraries/Components/Touchable/__tests__/TouchableHighlight-itest.js +483 -0
- package/Libraries/Components/Touchable/__tests__/TouchableNativeFeedback-itest.js +160 -0
- package/Libraries/Components/Touchable/__tests__/TouchableOpacity-itest.js +235 -0
- package/Libraries/Components/Touchable/__tests__/TouchableWithoutFeedback-itest.js +170 -0
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -2
- package/Libraries/Components/UnimplementedViews/UnimplementedView.js +1 -1
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +79 -33
- package/Libraries/Components/View/View.js +21 -72
- package/Libraries/Components/View/ViewAccessibility.d.ts +11 -1
- package/Libraries/Components/View/ViewAccessibility.js +23 -13
- package/Libraries/Components/View/ViewNativeComponent.js +4 -6
- package/Libraries/Components/View/ViewPropTypes.d.ts +0 -26
- package/Libraries/Components/View/ViewPropTypes.js +98 -170
- package/Libraries/Components/View/__tests__/FantomEventHandlers-itest.js +80 -0
- package/Libraries/Components/View/__tests__/View-benchmark-itest.js +270 -0
- package/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js +87 -0
- package/Libraries/Components/View/__tests__/View-itest.js +1138 -0
- package/Libraries/Components/View/__tests__/View-vs-ViewNativeComponent-benchmark-itest.js +60 -0
- package/Libraries/Components/View/__tests__/View-yogaNodeOwnerAssertion-itest.js +120 -0
- package/Libraries/Components/View/__tests__/ViewProps-benchmark-itest.js +172 -0
- package/Libraries/Components/__tests__/Button-itest.js +290 -0
- package/Libraries/Core/Devtools/__tests__/loadBundleFromServer-test.js +269 -0
- package/Libraries/Core/Devtools/__tests__/parseErrorStack-itest.js +45 -0
- package/Libraries/Core/Devtools/__tests__/parseHermesStack-itest.js +241 -0
- package/Libraries/Core/Devtools/loadBundleFromServer.js +14 -3
- package/Libraries/Core/Devtools/parseHermesStack.js +8 -8
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +3 -3
- package/Libraries/Core/ExceptionsManager.js +5 -11
- package/Libraries/Core/ExtendedError.js +3 -3
- package/Libraries/Core/InitializeCore.js +9 -14
- package/Libraries/Core/RawEventEmitter.js +2 -2
- package/Libraries/Core/ReactFiberErrorDialog.js +6 -6
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +56 -54
- package/Libraries/Core/Timers/__tests__/JSTimers-test.js +427 -0
- package/Libraries/Core/Timers/immediateShim.js +1 -1
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +18 -0
- package/Libraries/Core/__tests__/ExceptionsManager-test.js +1102 -0
- package/Libraries/Core/__tests__/ReactNativeVersionCheck-itest.js +135 -0
- package/Libraries/Core/setUpAlert.js +0 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +5 -3
- package/Libraries/Core/setUpGlobals.js +9 -4
- package/Libraries/Core/setUpNavigator.js +6 -1
- package/Libraries/Core/setUpReactDevTools.js +0 -101
- package/Libraries/Core/setUpSegmentFetcher.js +2 -2
- package/Libraries/Core/setUpXHR.js +6 -2
- package/Libraries/Debugging/DebuggingOverlay.js +4 -4
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -2
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +41 -11
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +9 -9
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +3 -0
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +51 -0
- package/Libraries/FBLazyVector/FBLazyVector/FBLazyIterator.h +0 -6
- package/Libraries/Image/AssetSourceResolver.js +18 -27
- package/Libraries/Image/Image.android.js +170 -313
- package/Libraries/Image/Image.d.ts +0 -5
- package/Libraries/Image/Image.ios.js +5 -5
- package/Libraries/Image/Image.macos.js +15 -7
- package/Libraries/Image/ImageBackground.js +30 -18
- package/Libraries/Image/ImageProps.js +126 -134
- package/Libraries/Image/ImageSource.d.ts +1 -1
- package/Libraries/Image/ImageSource.js +11 -11
- package/Libraries/Image/ImageSourceUtils.js +14 -7
- package/Libraries/Image/ImageTypes.flow.js +6 -4
- package/Libraries/Image/ImageViewNativeComponent.js +8 -17
- package/Libraries/Image/RCTAnimatedImage.h +4 -8
- package/Libraries/Image/RCTAnimatedImage.mm +1 -12
- package/Libraries/Image/RCTBundleAssetImageLoader.mm +1 -1
- package/Libraries/Image/RCTDisplayWeakRefreshable.h +2 -4
- package/Libraries/Image/RCTDisplayWeakRefreshable.mm +3 -3
- package/Libraries/Image/RCTImageBlurUtils.h +2 -2
- package/Libraries/Image/RCTImageBlurUtils.mm +7 -20
- package/Libraries/Image/RCTImageCache.h +4 -4
- package/Libraries/Image/RCTImageCache.mm +3 -7
- package/Libraries/Image/RCTImageDataDecoder.h +1 -1
- package/Libraries/Image/RCTImageEditingManager.mm +4 -4
- package/Libraries/Image/RCTImageLoader.h +1 -2
- package/Libraries/Image/RCTImageLoader.mm +91 -144
- package/Libraries/Image/RCTImageLoaderProtocol.h +2 -1
- package/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h +2 -2
- package/Libraries/Image/RCTImagePlugins.h +1 -0
- package/Libraries/Image/RCTImagePlugins.mm +30 -17
- package/Libraries/Image/RCTImageStoreManager.h +5 -7
- package/Libraries/Image/RCTImageStoreManager.mm +6 -8
- package/Libraries/Image/RCTImageURLLoader.h +4 -4
- package/Libraries/Image/RCTImageURLLoaderWithAttribution.h +1 -1
- package/Libraries/Image/RCTImageUtils.h +5 -10
- package/Libraries/Image/RCTImageUtils.mm +44 -48
- package/Libraries/Image/RCTLocalAssetImageLoader.mm +1 -1
- package/Libraries/Image/RCTResizeMode.h +2 -13
- package/Libraries/Image/RCTUIImageViewAnimated.h +2 -1
- package/Libraries/Image/RCTUIImageViewAnimated.mm +24 -30
- package/Libraries/Image/React-RCTImage.podspec +1 -5
- package/Libraries/Image/RelativeImageStub.js +3 -3
- package/Libraries/Image/__tests__/AssetUtils-itest.js +50 -0
- package/Libraries/Image/__tests__/Image-benchmark-itest.js +80 -0
- package/Libraries/Image/__tests__/Image-itest.js +1085 -0
- package/Libraries/Image/__tests__/ImageBackground-itest.js +154 -0
- package/Libraries/Image/__tests__/ImageSourceUtils-itest.js +301 -0
- package/Libraries/Image/__tests__/assetRelativePathInSnapshot-itest.js +41 -0
- package/Libraries/Image/__tests__/img/img1.png +0 -0
- package/Libraries/Image/__tests__/img/img2.png +0 -0
- package/Libraries/Image/__tests__/resolveAssetSource-test.js +459 -0
- package/Libraries/Image/nativeImageSource.js +1 -3
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Interaction/PanResponder.js +104 -99
- package/Libraries/LayoutAnimation/LayoutAnimation.js +37 -21
- package/Libraries/Linking/Linking.js +27 -30
- package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -8
- package/Libraries/LinkingIOS/RCTLinkingManager.mm +0 -3
- package/Libraries/LinkingIOS/RCTLinkingPlugins.mm +10 -13
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -8
- package/Libraries/Lists/FillRateHelper.js +2 -2
- package/Libraries/Lists/FlatList.d.ts +7 -18
- package/Libraries/Lists/FlatList.js +16 -55
- package/Libraries/Lists/SectionList.d.ts +1 -1
- package/Libraries/Lists/SectionList.js +10 -3
- package/Libraries/Lists/SectionListModern.js +4 -4
- package/Libraries/Lists/ViewabilityHelper.js +2 -2
- package/Libraries/Lists/VirtualizeUtils.js +1 -1
- package/Libraries/Lists/VirtualizedList.js +5 -2
- package/Libraries/Lists/VirtualizedListContext.js +1 -1
- package/Libraries/Lists/VirtualizedSectionList.js +6 -2
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +118 -0
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +130 -0
- package/Libraries/Lists/__tests__/FlatList-itest.js +1160 -0
- package/Libraries/Lists/__tests__/SectionList-itest.js +728 -0
- package/Libraries/Lists/__tests__/VirtualizedList-stickyHeaders-benchmark-itest.js +85 -0
- package/Libraries/LogBox/Data/LogBoxData.js +69 -28
- package/Libraries/LogBox/Data/LogBoxLog.js +45 -114
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/__tests__/LogBoxData-test.js +867 -0
- package/Libraries/LogBox/Data/__tests__/LogBoxLog-test.js +600 -0
- package/Libraries/LogBox/Data/__tests__/LogBoxSymbolication-test.js +60 -0
- package/Libraries/LogBox/Data/__tests__/parseLogBoxLog-itest.js +776 -0
- package/Libraries/LogBox/Data/__tests__/parseLogBoxLog-test.js +365 -0
- package/Libraries/LogBox/Data/parseLogBoxLog.js +23 -119
- package/Libraries/LogBox/LogBox.js +53 -30
- package/Libraries/LogBox/LogBoxInspectorContainer.js +26 -4
- package/Libraries/LogBox/LogBoxNotificationContainer.js +29 -6
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -1
- package/Libraries/LogBox/UI/LogBoxButton.js +55 -34
- package/Libraries/LogBox/UI/LogBoxInspector.js +63 -3
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +10 -25
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +11 -2
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +4 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -4
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +18 -16
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +32 -24
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +7 -7
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +11 -11
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +8 -8
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +20 -30
- package/Libraries/LogBox/UI/LogBoxMessage.js +43 -39
- package/Libraries/LogBox/UI/LogBoxNotification.js +3 -1
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +4 -1
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +1 -0
- package/Libraries/LogBox/UI/LogBoxStyle.js +0 -4
- package/Libraries/LogBox/UI/__tests__/LogBoxButton-itest.js +54 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspector-itest.js +106 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorCodeFrame-itest.js +140 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorFooter-itest.js +81 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorHeader-itest.js +81 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorMessageHeader-itest.js +134 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorReactFrames-itest.js +196 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorSection-itest.js +46 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorSourceMapStatus-itest.js +50 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorStackFrame-itest.js +77 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxInspectorStackFrames-itest.js +110 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxMessage-itest.js +266 -0
- package/Libraries/LogBox/UI/__tests__/LogBoxNotification-itest.js +47 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxButton-itest.js.snap +38 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspector-itest.js.snap +367 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorCodeFrame-itest.js.snap +924 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorFooter-itest.js.snap +203 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorHeader-itest.js.snap +177 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorMessageHeader-itest.js.snap +289 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorReactFrames-itest.js.snap +475 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorSection-itest.js.snap +69 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorSourceMapStatus-itest.js.snap +76 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorStackFrame-itest.js.snap +121 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorStackFrames-itest.js.snap +100 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxMessage-itest.js.snap +332 -0
- package/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxNotification-itest.js.snap +102 -0
- package/Libraries/LogBox/__tests__/LogBox-test.js +464 -0
- package/Libraries/LogBox/__tests__/LogBoxInspectorContainer-test.js +168 -0
- package/Libraries/LogBox/__tests__/LogBoxNotificationContainer-test.js +362 -0
- package/Libraries/LogBox/__tests__/__snapshots__/LogBoxInspectorContainer-test.js.snap +78 -0
- package/Libraries/LogBox/__tests__/__snapshots__/LogBoxNotificationContainer-test.js.snap +231 -0
- package/Libraries/LogBox/__tests__/fantomHelpers.js +225 -0
- package/Libraries/Modal/Modal.d.ts +5 -4
- package/Libraries/Modal/Modal.js +87 -48
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -2
- package/Libraries/Modal/__tests__/Modal-itest.js +324 -0
- package/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.mm +1 -1
- package/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.mm +1 -1
- package/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.mm +1 -1
- package/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.mm +2 -4
- package/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.h +1 -1
- package/Libraries/NativeAnimation/RCTAnimationPlugins.mm +14 -14
- package/Libraries/NativeAnimation/RCTAnimationUtils.h +2 -2
- package/Libraries/NativeAnimation/RCTAnimationUtils.mm +1 -1
- package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +2 -2
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h +1 -2
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm +3 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +7 -0
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -5
- package/Libraries/NativeComponent/BaseViewConfig.android.js +72 -52
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +36 -21
- package/Libraries/NativeComponent/BaseViewConfig.macos.js +12 -89
- package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -2
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +4 -4
- package/Libraries/NativeComponent/ViewConfig.js +3 -3
- package/Libraries/NativeComponent/ViewConfigIgnore.js +6 -5
- package/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-itest.js +239 -0
- package/Libraries/Network/RCTFileRequestHandler.mm +0 -4
- package/Libraries/Network/RCTHTTPRequestHandler.h +10 -1
- package/Libraries/Network/RCTHTTPRequestHandler.mm +15 -1
- package/Libraries/Network/RCTInspectorNetworkReporter.mm +26 -3
- package/Libraries/Network/RCTNetworkConversions.h +1 -1
- package/Libraries/Network/RCTNetworkPlugins.mm +22 -16
- package/Libraries/Network/RCTNetworking.android.js +4 -4
- package/Libraries/Network/RCTNetworking.ios.js +3 -3
- package/Libraries/Network/RCTNetworking.js.flow +3 -3
- package/Libraries/Network/RCTNetworking.macos.js +15 -7
- package/Libraries/Network/RCTNetworking.mm +1 -2
- package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +1 -1
- package/Libraries/Network/React-RCTNetwork.podspec +1 -4
- package/Libraries/Network/XMLHttpRequest.js +30 -13
- package/Libraries/Network/__tests__/FormData-itest.js +130 -0
- package/Libraries/Network/__tests__/XMLHttpRequest-test.js +288 -0
- package/Libraries/Performance/Systrace.js +36 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +32 -20
- package/Libraries/Pressability/HoverState.js +0 -4
- package/Libraries/Pressability/Pressability.js +17 -82
- package/Libraries/Pressability/PressabilityDebug.js +1 -1
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
- package/Libraries/Pressability/__tests__/Pressability-itest.js +253 -0
- package/Libraries/Pressability/__tests__/Pressability-test.js +989 -0
- package/Libraries/Pressability/usePressability.js +3 -14
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +8 -7
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.h +0 -5
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +26 -27
- package/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm +10 -13
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -5
- package/Libraries/ReactNative/AppContainer-dev.js +22 -4
- package/Libraries/ReactNative/AppContainer-prod.js +1 -2
- package/Libraries/ReactNative/AppContainer.js +1 -2
- package/Libraries/ReactNative/AppRegistry.d.ts +1 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +4 -4
- package/Libraries/ReactNative/AppRegistry.js +15 -11
- package/Libraries/ReactNative/AppRegistryImpl.js +74 -28
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/Libraries/ReactNative/DeprecatedPerformanceLoggerStub.js +83 -0
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/FabricUIManager.js +36 -27
- package/Libraries/ReactNative/I18nManager.js +20 -0
- package/Libraries/ReactNative/IPerformanceLogger.d.ts +51 -0
- package/Libraries/ReactNative/IPerformanceLogger.flow.js +52 -0
- package/Libraries/ReactNative/PaperUIManager.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +15 -15
- package/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/ReactNativeAttributePayload-itest.js +495 -0
- package/Libraries/ReactNative/RendererImplementation.js +26 -142
- package/Libraries/ReactNative/RendererProxy.js +4 -15
- package/Libraries/ReactNative/UIManager.js +53 -0
- package/Libraries/ReactNative/UIManagerProperties.js +1 -1
- package/Libraries/ReactNative/__tests__/FabricUIManager-test.js +67 -0
- package/Libraries/ReactNative/__tests__/StaleEventHandlersFromInterruptedRender-itest.js +126 -0
- package/Libraries/ReactNative/__tests__/State-ForcedCloneCommitHook-itest.js +57 -0
- package/Libraries/ReactNative/__tests__/SyncOnCommit-itest.js +181 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
- package/Libraries/ReactNative/renderApplication.js +33 -59
- package/Libraries/ReactNative/requireNativeComponent.js +3 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -122
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -41
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +36 -66
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +4 -4
- package/Libraries/Settings/RCTSettingsManager.mm +1 -32
- package/Libraries/Settings/RCTSettingsPlugins.mm +10 -13
- package/Libraries/Settings/Settings.ios.js +24 -2
- package/Libraries/Settings/Settings.macos.js +25 -7
- package/Libraries/Share/Share.js +25 -28
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +4 -4
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +4 -4
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +10 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +11 -159
- package/Libraries/StyleSheet/PointPropType.js +1 -1
- package/Libraries/StyleSheet/Rect.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.d.ts +0 -5
- package/Libraries/StyleSheet/StyleSheet.js +42 -2
- package/Libraries/StyleSheet/StyleSheet.js.flow +2 -2
- package/Libraries/StyleSheet/StyleSheetExports.js +23 -30
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -8
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +123 -48
- package/Libraries/StyleSheet/StyleSheetTypes.js +79 -95
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +51 -0
- package/Libraries/StyleSheet/__tests__/StyleSheet-itest.js +53 -0
- package/Libraries/StyleSheet/__tests__/flattenStyle-benchmark-itest.js +72 -0
- package/Libraries/StyleSheet/__tests__/flattenStyle-itest.js +190 -0
- package/Libraries/StyleSheet/__tests__/normalizeColor-itest.js +99 -0
- package/Libraries/StyleSheet/__tests__/processAspectRatio-itest.js +75 -0
- package/Libraries/StyleSheet/__tests__/processBackgroundImage-itest.js +1158 -0
- package/Libraries/StyleSheet/__tests__/processBackgroundPosition-itest.js +477 -0
- package/Libraries/StyleSheet/__tests__/processBackgroundRepeat-itest.js +242 -0
- package/Libraries/StyleSheet/__tests__/processBackgroundSize-itest.js +227 -0
- package/Libraries/StyleSheet/__tests__/processBoxShadow-itest.js +353 -0
- package/Libraries/StyleSheet/__tests__/processColor-itest.js +125 -0
- package/Libraries/StyleSheet/__tests__/processColorArray-itest.js +141 -0
- package/Libraries/StyleSheet/__tests__/processFilter-itest.js +416 -0
- package/Libraries/StyleSheet/__tests__/processFontVariant-itest.js +50 -0
- package/Libraries/StyleSheet/__tests__/processTransform-itest.js +151 -0
- package/Libraries/StyleSheet/__tests__/processTransformOrigin-itest.js +117 -0
- package/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-itest.js +35 -0
- package/Libraries/StyleSheet/__tests__/splitLayoutProps-itest.js +54 -0
- package/Libraries/StyleSheet/flattenStyle.js +29 -14
- package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +5 -5
- package/Libraries/StyleSheet/private/_TransformStyle.js +22 -20
- package/Libraries/StyleSheet/processBackgroundImage.js +26 -16
- package/Libraries/StyleSheet/processBackgroundPosition.js +4 -4
- package/Libraries/StyleSheet/processBackgroundRepeat.js +4 -4
- package/Libraries/StyleSheet/processBackgroundSize.js +11 -16
- package/Libraries/StyleSheet/processBoxShadow.js +15 -13
- package/Libraries/StyleSheet/processColorArray.js +2 -2
- package/Libraries/StyleSheet/processFilter.js +19 -11
- package/Libraries/StyleSheet/processTransformOrigin.js +10 -3
- package/Libraries/Text/RCTConvert+Text.h +0 -16
- package/Libraries/Text/RCTConvert+Text.mm +0 -2
- package/Libraries/Text/React-RCTText.podspec +1 -6
- package/Libraries/Text/Text/NSTextStorage+FontScaling.h +1 -1
- package/Libraries/Text/Text/NSTextStorage+FontScaling.m +1 -1
- package/Libraries/Text/Text/RCTDynamicTypeRamp.h +0 -2
- package/Libraries/Text/Text/RCTDynamicTypeRamp.mm +6 -5
- package/Libraries/Text/Text.d.ts +0 -1
- package/Libraries/Text/Text.js +307 -626
- package/Libraries/Text/TextEffectNativeComponent.js +31 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +38 -62
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +18 -337
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +4 -22
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.h +1 -12
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +46 -215
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +5 -53
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +2 -41
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +8 -446
- package/Libraries/Text/TextNativeComponent.js +18 -12
- package/Libraries/Text/TextProps.js +67 -129
- package/Libraries/Text/__tests__/Text-benchmark-itest.js +76 -0
- package/Libraries/Text/__tests__/Text-itest.js +830 -0
- package/Libraries/Text/requireNativeTextEffect.js +28 -0
- package/Libraries/TurboModule/RCTExport.js +2 -2
- package/Libraries/TurboModule/TurboModuleRegistry.js +3 -3
- package/Libraries/TypeSafety/RCTTypedModuleConstants.h +36 -1
- package/Libraries/Types/CodegenTypes.js +9 -6
- package/Libraries/Types/CoreEventTypes.d.ts +8 -76
- package/Libraries/Types/CoreEventTypes.js +78 -125
- package/Libraries/Types/ReactDevToolsTypes.js +4 -4
- package/Libraries/Types/UIManagerJSInterface.js +2 -2
- package/Libraries/Utilities/Appearance.d.ts +32 -17
- package/Libraries/Utilities/Appearance.js +39 -17
- package/Libraries/Utilities/BackHandler.android.js +24 -33
- package/Libraries/Utilities/BackHandler.d.ts +11 -1
- package/Libraries/Utilities/BackHandler.ios.js +3 -1
- package/Libraries/Utilities/BackHandler.js.flow +22 -1
- package/Libraries/Utilities/BackHandler.macos.js +15 -10
- package/Libraries/Utilities/DevLoadingView.js +8 -1
- package/Libraries/Utilities/DevSettings.js +12 -5
- package/Libraries/Utilities/Dimensions.js +19 -13
- package/Libraries/Utilities/HMRClient.js +35 -7
- package/Libraries/Utilities/HardwareBackPressEvent.js +22 -0
- package/Libraries/Utilities/PixelRatio.js +5 -2
- package/Libraries/Utilities/Platform.js.flow +4 -0
- package/Libraries/Utilities/Platform.macos.js +11 -82
- package/Libraries/Utilities/PlatformTypes.js +77 -0
- package/Libraries/Utilities/RCTLog.js +3 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +6 -7
- package/Libraries/Utilities/__mocks__/BackHandler.js +52 -0
- package/Libraries/Utilities/__mocks__/PixelRatio.js +24 -0
- package/Libraries/Utilities/__tests__/BackHandler-itest.js +144 -0
- package/Libraries/Utilities/__tests__/DeviceInfo-itest.js +19 -0
- package/Libraries/Utilities/__tests__/Dimensions-itest.js +70 -0
- package/Libraries/Utilities/__tests__/HardwareBackPressEvent-itest.js +65 -0
- package/Libraries/Utilities/__tests__/PixelRatio-itest.js +53 -0
- package/Libraries/Utilities/__tests__/Platform-itest.js +50 -0
- package/Libraries/Utilities/__tests__/ReactNativeTestTools-test.js +103 -0
- package/Libraries/Utilities/__tests__/binaryToBase64-itest.js +47 -0
- package/Libraries/Utilities/__tests__/codegenNativeComponent-test.js +93 -0
- package/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-itest.js +165 -0
- package/Libraries/Utilities/__tests__/logError-itest.js +58 -0
- package/Libraries/Utilities/__tests__/mapWithSeparator-itest.js +70 -0
- package/Libraries/Utilities/__tests__/stringifySafe-itest.js +88 -0
- package/Libraries/Utilities/__tests__/useColorScheme-itest.js +60 -0
- package/Libraries/Utilities/__tests__/useMergeRefs-itest.js +299 -0
- package/Libraries/Utilities/__tests__/useRefEffect-itest.js +213 -0
- package/Libraries/Utilities/__tests__/warnOnce-itest.js +33 -0
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +6 -6
- package/Libraries/Utilities/codegenNativeComponent.d.ts +2 -0
- package/Libraries/Utilities/codegenNativeComponent.js +6 -6
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
- package/Libraries/Utilities/differ/__tests__/deepDiffer-itest.js +195 -0
- package/Libraries/Utilities/differ/__tests__/matricesDiffer-itest.js +45 -0
- package/Libraries/Utilities/differ/deepDiffer.js +5 -2
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +10 -10
- package/Libraries/Utilities/useColorScheme.js +11 -1
- package/Libraries/Utilities/useMergeRefs.js +2 -2
- package/Libraries/Utilities/useRefEffect.js +1 -1
- package/Libraries/Utilities/useWindowDimensions.js +6 -0
- package/Libraries/Vibration/RCTVibrationPlugins.mm +10 -13
- package/Libraries/Vibration/Vibration.js +14 -11
- package/Libraries/WebSocket/RCTReconnectingWebSocket.m +4 -1
- package/Libraries/WebSocket/WebSocket.js +1 -3
- package/Libraries/WebSocket/WebSocketInterceptor.js +4 -6
- package/Libraries/WebSocket/__tests__/WebSocket-itest.js +23 -0
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +30 -0
- package/Libraries/promiseRejectionTrackingOptions.js +9 -9
- package/Libraries/vendor/core/ErrorUtils.js +10 -10
- package/Libraries/vendor/emitter/EventEmitter.js +35 -25
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +81 -0
- package/Libraries/vendor/emitter/__tests__/EventEmitter-itest.js +422 -0
- package/README.md +40 -59
- package/React/Base/RCTAssert.m +2 -2
- package/React/Base/RCTBridge+Private.h +0 -22
- package/React/Base/RCTBridge.h +11 -13
- package/React/Base/RCTBridge.mm +5 -459
- package/React/Base/RCTBridgeDelegate.h +1 -56
- package/React/Base/RCTBridgeModule.h +3 -12
- package/React/Base/RCTBridgeProxy.h +8 -0
- package/React/Base/RCTBridgeProxy.mm +6 -23
- package/React/Base/RCTBundleManager.h +58 -9
- package/React/Base/RCTBundleManager.m +109 -29
- package/React/Base/RCTBundleURLProvider.h +43 -1
- package/React/Base/RCTBundleURLProvider.mm +163 -15
- package/React/Base/RCTCallableJSModules.m +0 -18
- package/React/Base/RCTConstants.h +1 -4
- package/React/Base/RCTConstants.m +7 -8
- package/React/Base/RCTConvert.h +12 -27
- package/React/Base/RCTConvert.mm +48 -458
- package/React/Base/RCTDefines.h +1 -9
- package/React/Base/RCTDevSupportHttpHeaders.h +24 -0
- package/React/Base/RCTDevSupportHttpHeaders.m +65 -0
- package/React/Base/RCTDisplayLink.h +3 -1
- package/React/Base/RCTDisplayLink.m +5 -10
- package/React/Base/RCTEventDispatcherProtocol.h +1 -1
- package/React/Base/RCTFrameUpdate.h +3 -2
- package/React/Base/RCTFrameUpdate.m +2 -2
- package/React/Base/RCTJSThread.h +1 -1
- package/React/Base/RCTJavaScriptExecutor.h +0 -69
- package/React/Base/RCTJavaScriptLoader.h +2 -1
- package/React/Base/RCTJavaScriptLoader.mm +6 -2
- package/React/Base/RCTKeyCommands.h +0 -2
- package/React/Base/RCTKeyCommands.m +0 -2
- package/React/Base/RCTModuleData.mm +2 -483
- package/React/Base/RCTModuleRegistry.m +0 -25
- package/React/Base/RCTMultipartDataTask.h +9 -0
- package/React/Base/RCTMultipartDataTask.m +16 -1
- package/React/Base/RCTPlatformDisplayLink.h +19 -31
- package/React/Base/RCTRedBoxSetEnabled.m +1 -1
- package/React/Base/RCTReloadCommand.m +2 -4
- package/React/Base/RCTRootView.h +10 -6
- package/React/Base/RCTRootView.m +4 -507
- package/React/Base/RCTRootViewDelegate.h +5 -2
- package/React/Base/RCTTextView.h +31 -0
- package/React/Base/RCTTouchHandler.h +3 -11
- package/React/Base/RCTTouchHandler.m +30 -285
- package/React/Base/RCTUIKit.h +89 -737
- package/React/Base/RCTUIKit.m +29 -0
- package/React/Base/RCTUtils.h +13 -24
- package/React/Base/RCTUtils.mm +107 -164
- package/React/Base/RCTUtilsUIOverride.h +1 -1
- package/React/Base/RCTUtilsUIOverride.m +0 -1
- package/React/Base/RCTVersion.m +3 -3
- package/React/Base/RCTViewRegistry.m +3 -31
- package/React/Base/Surface/RCTSurface.h +3 -0
- package/React/Base/Surface/RCTSurface.mm +1 -582
- package/React/Base/Surface/RCTSurfaceDelegate.h +8 -4
- package/React/Base/Surface/RCTSurfaceProtocol.h +1 -1
- package/React/Base/Surface/RCTSurfaceRootShadowView.m +0 -89
- package/React/Base/Surface/RCTSurfaceRootShadowViewDelegate.h +1 -1
- package/React/Base/Surface/RCTSurfaceRootView.h +1 -1
- package/React/Base/Surface/RCTSurfaceRootView.mm +1 -1
- package/React/Base/Surface/RCTSurfaceStage.h +1 -1
- package/React/Base/Surface/RCTSurfaceView+Internal.h +1 -1
- package/React/Base/Surface/RCTSurfaceView.h +2 -2
- package/React/Base/Surface/RCTSurfaceView.mm +2 -8
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +9 -4
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +32 -7
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h +3 -17
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +6 -57
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.mm +1 -1
- package/React/CoreModules/CoreModulesPlugins.mm +98 -39
- package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +1 -3
- package/React/CoreModules/RCTAccessibilityManager.h +0 -1
- package/React/CoreModules/RCTAccessibilityManager.mm +20 -153
- package/React/CoreModules/RCTActionSheetManager.h +1 -1
- package/React/CoreModules/RCTActionSheetManager.mm +21 -185
- package/React/CoreModules/RCTAlertController.h +1 -7
- package/React/CoreModules/RCTAlertController.mm +2 -6
- package/React/CoreModules/RCTAlertManager.h +1 -1
- package/React/CoreModules/RCTAlertManager.mm +1 -115
- package/React/CoreModules/RCTAppState.mm +3 -16
- package/React/CoreModules/RCTAppearance.h +2 -6
- package/React/CoreModules/RCTAppearance.mm +1 -56
- package/React/CoreModules/RCTClipboard.mm +7 -12
- package/React/CoreModules/RCTDevLoadingView.mm +144 -110
- package/React/CoreModules/RCTDevMenu.h +1 -8
- package/React/CoreModules/RCTDevMenu.mm +5 -209
- package/React/CoreModules/RCTDevMenuConfigurationDecorator.h +2 -2
- package/React/CoreModules/RCTDevSettings.h +36 -9
- package/React/CoreModules/RCTDevSettings.mm +56 -33
- package/React/CoreModules/RCTDeviceInfo.h +2 -2
- package/React/CoreModules/RCTDeviceInfo.mm +16 -48
- package/React/CoreModules/RCTEventDispatcher.h +1 -1
- package/React/CoreModules/RCTEventDispatcher.mm +1 -1
- package/React/CoreModules/RCTExceptionsManager.mm +5 -2
- package/React/CoreModules/RCTFPSGraph.h +3 -3
- package/React/CoreModules/RCTFPSGraph.mm +6 -13
- package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
- package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
- package/React/CoreModules/RCTKeyboardObserver.mm +11 -13
- package/React/CoreModules/RCTLogBox.h +1 -1
- package/React/CoreModules/RCTLogBox.mm +0 -11
- package/React/CoreModules/RCTLogBoxView.h +3 -17
- package/React/CoreModules/RCTLogBoxView.mm +5 -85
- package/React/CoreModules/RCTPerfMonitor.mm +58 -366
- package/React/CoreModules/RCTPlatform.mm +4 -20
- package/React/CoreModules/RCTRedBox+Internal.h +42 -0
- package/React/CoreModules/RCTRedBox.h +1 -1
- package/React/CoreModules/RCTRedBox.mm +35 -780
- package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
- package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
- package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
- package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
- package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
- package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
- package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
- package/React/CoreModules/RCTRedBoxController.mm +447 -0
- package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
- package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
- package/React/CoreModules/RCTStatusBarManager.h +3 -3
- package/React/CoreModules/RCTStatusBarManager.mm +1 -42
- package/React/CoreModules/RCTTiming.mm +1 -9
- package/React/CoreModules/RCTWebSocketModule.h +6 -0
- package/React/CoreModules/RCTWebSocketModule.mm +79 -30
- package/React/CoreModules/React-CoreModules.podspec +3 -5
- package/React/CxxModule/RCTCxxUtils.h +0 -8
- package/React/CxxModule/RCTCxxUtils.mm +1 -28
- package/React/DevSupport/RCTDevLoadingViewProtocol.h +5 -2
- package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
- package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
- package/React/DevSupport/RCTInspectorDevServerHelper.h +2 -1
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +41 -53
- package/React/DevSupport/RCTInspectorNetworkHelper.mm +2 -0
- package/React/DevSupport/RCTInspectorUtils.mm +9 -3
- package/React/DevSupport/RCTPackagerConnection.h +4 -2
- package/React/DevSupport/RCTPackagerConnection.mm +43 -44
- package/React/DevSupport/RCTPausedInDebuggerOverlayController.mm +8 -86
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +188 -23
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +162 -40
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +920 -566
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +71 -71
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +97 -96
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +357 -363
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +223 -210
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +107 -107
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +11 -11
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +2 -3
- package/React/Fabric/Mounting/ComponentViews/DebuggingOverlay/RCTDebuggingOverlayComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +4 -11
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +18 -16
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +6 -2
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +23 -13
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +5 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +6 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -3
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +14 -12
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +1 -4
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +18 -9
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +1 -0
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +1 -0
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +3 -15
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTCustomPullToRefreshViewProtocol.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +30 -14
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +18 -32
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +7 -7
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +56 -97
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +16 -30
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewProtocol.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +21 -13
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -5
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -3
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -4
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -6
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +56 -40
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +20 -368
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +5 -10
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +6 -27
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +1 -2
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +4 -10
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +4 -10
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -18
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +239 -799
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.h +3 -2
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +92 -204
- package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +9 -5
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +3 -6
- package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +1 -11
- package/React/Fabric/Mounting/RCTMountingManager.h +3 -3
- package/React/Fabric/Mounting/RCTMountingManager.mm +17 -20
- package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +5 -8
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +5 -23
- package/React/Fabric/RCTConversions.h +37 -56
- package/React/Fabric/RCTImageResponseDelegate.h +2 -2
- package/React/Fabric/RCTImageResponseObserverProxy.mm +1 -1
- package/React/Fabric/RCTLocalizationProvider.h +1 -1
- package/React/Fabric/RCTScheduler.h +3 -1
- package/React/Fabric/RCTScheduler.mm +75 -0
- package/React/Fabric/RCTSurfacePointerHandler.h +3 -3
- package/React/Fabric/RCTSurfacePointerHandler.mm +65 -209
- package/React/Fabric/RCTSurfacePresenter.h +2 -2
- package/React/Fabric/RCTSurfacePresenter.mm +94 -6
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +3 -1
- package/React/Fabric/RCTSurfaceRegistry.h +1 -1
- package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
- package/React/Fabric/RCTSurfaceTouchHandler.mm +37 -205
- package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +8 -3
- package/React/Fabric/Utils/RCTBoxShadow.h +1 -1
- package/React/Fabric/Utils/RCTBoxShadow.mm +1 -18
- package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
- package/React/Fabric/Utils/RCTGradientUtils.mm +3 -3
- package/React/Fabric/Utils/RCTLinearGradient.h +1 -1
- package/React/Fabric/Utils/RCTLinearGradient.mm +4 -10
- package/React/Fabric/Utils/RCTRadialGradient.h +1 -1
- package/React/Fabric/Utils/RCTRadialGradient.mm +0 -1
- package/React/Fabric/Utils/RCTReactTaggedView.h +5 -5
- package/React/Fabric/Utils/RCTReactTaggedView.mm +3 -5
- package/React/I18n/RCTLocalizedString.mm +38 -2
- package/React/I18n/strings/pt.lproj/fbt_language_pack.bin +0 -0
- package/React/Inspector/RCTCxxInspectorWebSocketAdapter.mm +11 -3
- package/React/Modules/RCTEventEmitter.h +7 -7
- package/React/Modules/RCTEventEmitter.m +31 -10
- package/React/Modules/RCTI18nUtil.m +4 -2
- package/React/Modules/RCTLayoutAnimation.h +1 -1
- package/React/Modules/RCTLayoutAnimation.m +8 -54
- package/React/Modules/RCTLayoutAnimationGroup.h +1 -1
- package/React/Modules/RCTRedBoxExtraDataViewController.h +1 -6
- package/React/Modules/RCTRedBoxExtraDataViewController.m +3 -18
- package/React/Modules/RCTSurfacePresenterStub.h +1 -1
- package/React/Modules/RCTUIManager.h +15 -14
- package/React/Modules/RCTUIManager.mm +5 -1561
- package/React/Modules/RCTUIManagerObserverCoordinator.h +1 -1
- package/React/Modules/RCTUIManagerUtils.h +0 -1
- package/React/Profiler/RCTProfile.h +5 -0
- package/React/Profiler/RCTProfile.m +19 -27
- package/React/Profiler/RCTProfileTrampoline-arm.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-arm64.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-i386.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-x86_64.S +1 -1
- package/React/React-RCTFBReactNativeSpec.podspec +1 -1
- package/React/React-RCTFabric.podspec +4 -4
- package/React/Runtime/React-RCTRuntime.podspec +1 -0
- package/React/Tests/Mounting/RCTViewComponentViewTests.mm +186 -0
- package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +32 -5
- package/React/Views/RCTAnimationType.h +0 -4
- package/React/Views/RCTAutoInsetsProtocol.h +1 -1
- package/React/Views/RCTBorderDrawing.h +7 -8
- package/React/Views/RCTBorderDrawing.m +19 -26
- package/React/Views/RCTComponentData.h +3 -3
- package/React/Views/RCTComponentData.mm +4 -4
- package/React/Views/RCTCursor.h +1 -44
- package/React/Views/RCTDebuggingOverlay.h +3 -3
- package/React/Views/RCTDebuggingOverlay.m +10 -9
- package/React/Views/RCTFont+Private.h +1 -5
- package/React/Views/RCTFont.h +1 -1
- package/React/Views/RCTFont.mm +0 -17
- package/React/Views/RCTLayout.h +1 -1
- package/React/Views/RCTLayout.m +4 -3
- package/React/Views/RCTModalHostViewController.h +0 -15
- package/React/Views/RCTModalHostViewManager.h +0 -26
- package/React/Views/RCTShadowView+Layout.h +1 -1
- package/React/Views/RCTShadowView.h +2 -4
- package/React/Views/RCTShadowView.m +0 -723
- package/React/Views/RCTView.h +14 -68
- package/React/Views/RCTView.m +54 -813
- package/React/Views/RCTViewManager.h +3 -22
- package/React/Views/RCTViewManager.m +10 -166
- package/React/Views/RCTViewUtils.h +2 -2
- package/React/Views/RCTViewUtils.m +1 -3
- package/React/Views/RCTWrapperViewController.h +2 -2
- package/React/Views/RCTWrapperViewController.m +1 -3
- package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
- package/React/Views/ScrollView/RCTScrollEvent.m +1 -1
- package/React/Views/ScrollView/RCTScrollView.h +1 -94
- package/React/Views/ScrollView/RCTScrollableProtocol.h +4 -10
- package/React/Views/UIView+Private.h +4 -4
- package/React/Views/UIView+React.h +8 -19
- package/React/Views/UIView+React.m +29 -123
- package/React-Core-prebuilt.podspec +46 -18
- package/React-Core.podspec +11 -2
- package/ReactAndroid/api/ReactAndroid.api +280 -521
- package/ReactAndroid/build.gradle.kts +65 -42
- package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +118 -51
- package/ReactAndroid/src/debug/AndroidManifest.xml +6 -0
- package/ReactAndroid/src/debugOptimized/AndroidManifest.xml +22 -0
- package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +3 -7
- package/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.kt +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +13 -18
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +56 -336
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.kt +2 -12
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.kt +212 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt +4 -29
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +96 -111
- package/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt +53 -4
- package/ReactAndroid/src/main/java/com/facebook/react/animated/AnimationDriver.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ColorAnimatedNode.kt +11 -11
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.kt +11 -11
- package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.kt +1 -26
- package/ReactAndroid/src/main/java/com/facebook/react/animated/InterpolationAnimatedNode.kt +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.kt +20 -100
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt +12 -33
- package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +13 -25
- package/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.kt +19 -19
- package/ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.kt +287 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.kt +0 -18
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/DynamicFromArray.kt +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.kt +15 -23
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.kt +8 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt +4 -34
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Promise.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/PromiseImpl.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +61 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNativeJNISoLoader.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNativeJniCommonSoLoader.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactSoftExceptionLogger.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeArray.kt +1 -12
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ScrollEndedListener.kt +70 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/common/assets/ReactFontManager.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +50 -2
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +67 -26
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +4 -12
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +14 -10
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +36 -34
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultSoLoader.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgelessDevSupportManager.kt +4 -5
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +59 -51
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/ChangeBundleLocationDialog.kt +11 -10
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +101 -17
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevLoadingViewImplementation.kt +61 -15
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.kt +10 -60
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +15 -15
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.kt +12 -12
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.kt +11 -14
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/FpsView.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorFlags.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LocalNetworkPermissionUtil.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LogBoxDialogSurfaceDelegate.kt +15 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.kt +101 -26
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PackagerStatusCheck.kt +10 -19
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxContentView.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/DevSupportHttpClient.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +274 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt +2 -13
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkRequestListener.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/TracingState.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/TracingStateListener.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/TracingStateProvider.kt +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevBundleDownloadListener.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevLoadingViewManager.kt +7 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/RedBoxHandler.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorInspectorTargetBinding.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt +31 -6
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +17 -16
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorUpdateListener.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/DevToolsReactPerfLogger.kt +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +199 -72
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +7 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/LongStreamingStats.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandlerBinding.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +227 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventBeatManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.kt +25 -8
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.kt +26 -22
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/__docs__/README.md +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/__docs__/life-of-an-event.excalidraw.svg +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +108 -69
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +10 -14
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +1395 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PreAllocateViewMountItem.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +12 -8
- package/ReactAndroid/src/main/java/com/facebook/react/interfaces/ExtraWindowEventListener.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +102 -84
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +196 -166
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +41 -35
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +44 -38
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +227 -194
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +8 -4
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +1 -6
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +41 -35
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlags.kt +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +3 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/__docs__/README.md +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/rewrite_feature_flag_defaults.py +76 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/tests/test_rewrite_feature_flag_defaults.py +63 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/interop/InteropEventEmitter.kt +1 -15
- package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +40 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt +5 -43
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.kt +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.kt +4 -10
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +40 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.kt +11 -6
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/DeviceEventManagerModule.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactChoreographer.kt +21 -20
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.kt +3 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.kt +63 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.kt +7 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.kt +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +108 -61
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +116 -54
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +26 -14
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressRequestBody.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +46 -112
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +10 -8
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.kt +28 -8
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.kt +2 -8
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessAtomicRef.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +10 -13
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +16 -11
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +108 -36
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImplDevHelper.kt +11 -4
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostInspectorTarget.kt +13 -19
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +10 -8
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +78 -24
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt +18 -6
- package/ReactAndroid/src/main/java/com/facebook/react/soloader/OpenSourceMergedSoMapping.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +139 -31
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +78 -37
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BlendModeHelper.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +11 -53
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/GuardedFrameCallback.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/HasChildPressedStateDelay.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSKeyDispatcher.kt +65 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt +796 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +3 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +751 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.kt +184 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt +47 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRootViewTagGenerator.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.kt +486 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +19 -62
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootViewUtil.kt +17 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/SkewMatrixHelper.kt +200 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +25 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +27 -17
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +20 -32
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIConstantsProviderBinding.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.kt +25 -109
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.kt +645 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.kt +142 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +0 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.kt +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/UIManagerType.kt +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt +44 -30
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/BackgroundImageDrawable.kt +5 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/InsetBoxShadowDrawable.kt +12 -13
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/OutlineDrawable.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +5 -42
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/KeyDownEvent.kt +23 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/KeyEvent.kt +156 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/KeyUpEvent.kt +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +30 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTEventEmitter.kt +2 -9
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.kt +42 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/SynchronousEventReceiver.kt +28 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.kt +1 -16
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.kt +9 -42
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundImageLayer.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundPosition.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundRepeat.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundSize.kt +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderColors.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderInsets.kt +25 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +52 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderStyle.kt +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BoxShadow.kt +23 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +51 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ComputedBorderRadius.kt +40 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/CornerRadii.kt +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/Gradient.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/LinearGradient.kt +34 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/LogicalEdge.kt +33 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/OutlineStyle.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/Overflow.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/RadialGradient.kt +42 -0
- package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +34 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.kt +19 -17
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +10 -9
- package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaView.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.kt +1 -14
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager.kt +1 -22
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +1640 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +11 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +1317 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +466 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +1309 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +16 -14
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +11 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +20 -67
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +15 -36
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +30 -44
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +263 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +8 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/MutableSpannableLayout.kt +107 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayout.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +154 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextUpdate.kt +4 -65
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +150 -267
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewAccessibilityDelegate.kt +37 -15
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +247 -21
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +42 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/SelectableTextViewManager.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +49 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +200 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectRegistry.kt +45 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectSpanFactory.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +542 -150
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/AnimatedEffectSpan.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CanvasEffectSpan.kt +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +24 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactClickableSpan.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactLinkSpan.kt +10 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactStrikethroughSpan.kt +30 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactUnderlineSpan.kt +25 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/StatefulSpan.kt +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextEffectSpan.kt +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TouchableSpan.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +90 -97
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextContentSizeWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +49 -40
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputTextWatcher.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextScrollWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextSelectionWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ImportantForInteractionHelper.kt +55 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.kt +59 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +95 -77
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +52 -69
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +87 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewRenderState.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +153 -308
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt +11 -13
- package/ReactAndroid/src/main/java/com/facebook/soloader/annotation/SoLoaderLibrary.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt +45 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +17 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +70 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.kt +30 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDirection.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt +31 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt +41 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt +43 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +17 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +254 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +205 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.kt +29 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +36 -3
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +94 -0
- package/ReactAndroid/src/main/jni/react/devsupport/CMakeLists.txt +7 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionDelegateImpl.cpp +3 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp +29 -2
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.h +2 -0
- package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +38 -0
- package/ReactAndroid/src/main/jni/react/fabric/ComponentFactory.cpp +0 -1
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +7 -6
- package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.cpp +26 -6
- package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.h +3 -3
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +152 -3
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h +22 -6
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +132 -28
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +15 -0
- package/ReactAndroid/src/main/jni/react/fabric/FocusOrderingHelper.cpp +0 -1
- package/ReactAndroid/src/main/jni/react/fabric/StateWrapperImpl.h +2 -1
- package/ReactAndroid/src/main/jni/react/fabric/SurfaceHandlerBinding.cpp +1 -0
- package/ReactAndroid/src/main/jni/react/fabric/test/FabricMountingManagerTest.cpp +159 -0
- package/ReactAndroid/src/main/jni/react/fabric/test_helper/FabricMountingManagerTestHelper.cpp +85 -0
- package/ReactAndroid/src/main/jni/react/fabric/test_helper/FabricMountingManagerTestHelper.h +46 -0
- package/ReactAndroid/src/main/jni/react/fabric/test_helper/OnLoad.cpp +16 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +255 -213
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +50 -41
- package/ReactAndroid/src/main/jni/react/hermes/instrumentation/HermesSamplingProfiler.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/CMakeLists.txt +0 -4
- package/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt +1 -4
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapperBase.h +0 -24
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +10 -24
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +0 -2
- package/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/jni/JSLoader.h +2 -1
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +1 -2
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp +1 -29
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h +1 -2
- package/ReactAndroid/src/main/jni/react/jni/OnLoad-common.cpp +0 -2
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +2 -12
- package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JWritableMapBuffer.cpp +13 -0
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.cpp +37 -30
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.h +11 -8
- package/ReactAndroid/src/main/jni/react/reactnativeblob/CMakeLists.txt +2 -1
- package/ReactAndroid/src/main/jni/react/reactnativeblob/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/CMakeLists.txt +0 -4
- package/ReactAndroid/src/main/jni/react/runtime/jni/CMakeLists.txt +0 -4
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +167 -51
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +205 -26
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +6 -2
- package/ReactAndroid/src/main/jni/react/tracing/CMakeLists.txt +28 -0
- package/ReactAndroid/src/main/jni/react/tracing/PerformanceTracerCxxInterop.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +79 -65
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +10 -7
- package/ReactAndroid/src/main/jni/react/uimanager/StateWrapper.h +19 -0
- package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +1 -0
- package/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml +10 -0
- package/ReactAndroid/src/main/res/devsupport/layout/dev_loading_view.xml +41 -15
- package/ReactAndroid/src/main/res/devsupport/layout/fps_view.xml +1 -1
- package/ReactAndroid/src/main/res/devsupport/values/strings.xml +1 -0
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +8 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml +18 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +3 -0
- package/ReactAndroid/src/test/java/com/facebook/react/ReactActivityDelegateTest.kt +64 -0
- package/ReactAndroid/src/test/java/com/facebook/react/RootViewTest.kt +194 -0
- package/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt +171 -0
- package/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt +1418 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/DimensionPropConverterTest.kt +45 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/DynamicFromMapTest.kt +64 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.kt +37 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyMapTest.kt +56 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaScriptModuleRegistryTest.kt +30 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.kt +75 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/ReadableArrayBuilderTest.kt +71 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/ReadableMapBuilderTest.kt +87 -0
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.kt +84 -0
- package/ReactAndroid/src/test/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPointTest.kt +115 -0
- package/ReactAndroid/src/test/java/com/facebook/react/devsupport/CxxInspectorPackagerConnectionTest.kt +28 -0
- package/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.kt +237 -0
- package/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.kt +134 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricMountingManagerInstrumentationTest.kt +261 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricMountingManagerTestHelper.kt +48 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricUIManagerTest.kt +64 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/MountingManagerTest.kt +81 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerEventOrderingTest.kt +353 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerSynchronousMountPropsTest.kt +273 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerTest.kt +195 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.kt +690 -0
- package/ReactAndroid/src/test/java/com/facebook/react/fabric/internal/interop/InteropUiBlockListenerTest.kt +131 -0
- package/ReactAndroid/src/test/java/com/facebook/react/interfaces/ExtraWindowEventListenerTest.kt +124 -0
- package/ReactAndroid/src/test/java/com/facebook/react/internal/interop/InteropEventEmitterTest.kt +61 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/appstate/AppStateModuleTest.kt +127 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.kt +227 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/camera/ImageStoreManagerTest.kt +85 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/clipboard/ClipboardModuleTest.kt +62 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.kt +261 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.kt +205 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcherTest.kt +139 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/image/ImageLoaderModuleTest.kt +274 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/intent/IntentModuleTest.kt +143 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/model/ReactModuleInfoTest.kt +50 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.kt +48 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkEventUtilTest.kt +454 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.kt +666 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/OkHttpClientProviderTest.kt +135 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/ProgressResponseBodyTest.kt +165 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/ProgressiveStringDecoderTest.kt +137 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/ReactCookieJarContainerTest.kt +59 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/RequestBodyUtilTest.kt +152 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/share/ShareModuleTest.kt +160 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.kt +307 -0
- package/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.kt +157 -0
- package/ReactAndroid/src/test/java/com/facebook/react/runtime/BridgelessReactContextTest.kt +99 -0
- package/ReactAndroid/src/test/java/com/facebook/react/runtime/ReactHostDelegateTest.kt +49 -0
- package/ReactAndroid/src/test/java/com/facebook/react/runtime/ReactHostTest.kt +171 -0
- package/ReactAndroid/src/test/java/com/facebook/react/runtime/ReactSurfaceTest.kt +162 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/BaseViewManagerTest.kt +133 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/BorderRadiusStyleTest.kt +208 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/DisplayMetricsHolderTest.kt +167 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/JSPointerDispatcherTest.kt +87 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/MatrixMathHelperTest.kt +775 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/OnLayoutEventTest.kt +63 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/PixelUtilTest.kt +189 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactAccessibilityDelegateTest.kt +376 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropAnnotationSetterSpecTest.kt +120 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropAnnotationSetterTest.kt +435 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropConstantsTest.kt +142 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSetterTest.kt +177 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSpecTest.kt +153 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/SimpleViewPropertyTest.kt +93 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/SkewMatrixHelperTest.kt +221 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/ThemedReactContextTest.kt +84 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/TouchTargetHelperTest.kt +169 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.kt +82 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsTest.kt +235 -0
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/style/ColorStopTest.kt +186 -0
- package/ReactAndroid/src/test/java/com/facebook/react/util/JSStackTraceTest.kt +109 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/image/ImageResizeModeTest.kt +52 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.kt +235 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextViewTest.kt +154 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/TextAttributePropsTest.kt +37 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/TextDecorationStyleTest.kt +53 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/TextLayoutManagerAbsoluteLayoutWithFractionalPixelTest.kt +131 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/TextLayoutManagerFontWeightAdjustmentTest.kt +70 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/TextTransformTest.kt +34 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/text/internal/span/CustomLineHeightSpanTest.kt +99 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactTextInputPropertyTest.kt +530 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/view/ColorUtilTest.kt +23 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/view/ReactViewGroupTest.kt +79 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/fakes/FakeBatchEventDispatchedListener.kt +17 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/fakes/FakeEventDispatcher.kt +41 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/fakes/FakeUIManager.kt +125 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowArguments.kt +35 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowNativeArray.kt +24 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowNativeLoader.kt +21 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowNativeMap.kt +46 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowReadableNativeArray.kt +45 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowReadableNativeMap.kt +53 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowSoLoader.kt +24 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowWritableNativeArray.kt +36 -0
- package/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowWritableNativeMap.kt +45 -0
- package/ReactAndroid/src/test/java/org/mockito/configuration/MockitoConfiguration.kt +17 -0
- package/ReactAndroid/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +1 -0
- package/ReactAndroid/src/test/resources/robolectric.properties +2 -0
- package/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.h +2 -0
- package/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm +45 -5
- package/ReactApple/RCTAnimatedModuleProvider/React-RCTAnimatedModuleProvider.podspec +63 -0
- package/ReactApple/RCTSwiftUI/RCTSwiftUI.podspec +12 -1
- package/ReactApple/RCTSwiftUI/RCTSwiftUIContainerView.swift +9 -41
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIContainerViewWrapper.h +0 -17
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIContainerViewWrapper.m +73 -11
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIWrapper.podspec +1 -2
- package/ReactCommon/React-Fabric.podspec +28 -9
- package/ReactCommon/React-FabricComponents.podspec +7 -9
- package/ReactCommon/ReactCommon.podspec +2 -12
- package/ReactCommon/cmake-utils/react-native-flags.cmake +1 -0
- package/ReactCommon/cxxreact/CMakeLists.txt +1 -0
- package/ReactCommon/cxxreact/ErrorUtils.h +2 -32
- package/ReactCommon/cxxreact/Instance.cpp +1 -26
- package/ReactCommon/cxxreact/Instance.h +0 -2
- package/ReactCommon/cxxreact/JSBigString.h +14 -5
- package/ReactCommon/cxxreact/NativeToJsBridge.cpp +3 -2
- package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +0 -12
- package/ReactCommon/cxxreact/RAMBundleRegistry.h +0 -5
- package/ReactCommon/cxxreact/React-cxxreact.podspec +3 -1
- package/ReactCommon/cxxreact/ReactMarker.cpp +4 -31
- package/ReactCommon/cxxreact/ReactMarker.h +38 -21
- package/ReactCommon/cxxreact/ReactNativeVersion.h +10 -8
- package/ReactCommon/cxxreact/TraceSection.h +1 -1
- package/ReactCommon/cxxreact/tests/methodcall.cpp +4 -0
- package/ReactCommon/devtoolsruntimesettings/DevToolsRuntimeSettings.cpp +1 -1
- package/ReactCommon/hermes/React-hermes.podspec +1 -0
- package/ReactCommon/hermes/executor/CMakeLists.txt +0 -4
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +9 -80
- package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +0 -4
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.cpp +25 -16
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h +1 -1
- package/ReactCommon/jsc/JSCRuntime.cpp +10 -31
- package/ReactCommon/jsc/JSCRuntime.h +0 -9
- package/ReactCommon/jserrorhandler/ErrorUtils.cpp +42 -0
- package/ReactCommon/jserrorhandler/ErrorUtils.h +16 -0
- package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +2 -1
- package/ReactCommon/jserrorhandler/JsErrorHandler.h +1 -1
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +2 -3
- package/ReactCommon/jsi/jsi/JSIDynamic.cpp +1 -0
- package/ReactCommon/jsi/jsi/decorator.h +93 -0
- package/ReactCommon/jsi/jsi/hermes-interfaces.h +242 -0
- package/ReactCommon/jsi/jsi/jsi-inl.h +97 -68
- package/ReactCommon/jsi/jsi/jsi.cpp +214 -28
- package/ReactCommon/jsi/jsi/jsi.h +621 -219
- package/ReactCommon/jsi/jsi/test/testlib.cpp +455 -2
- package/ReactCommon/jsiexecutor/CMakeLists.txt +3 -1
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +6 -1
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +5 -57
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +3 -8
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +5 -14
- package/ReactCommon/jsinspector-modern/ConsoleTask.cpp +27 -0
- package/ReactCommon/jsinspector-modern/ConsoleTask.h +38 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp +46 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskContext.h +102 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.cpp +55 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.h +48 -0
- package/ReactCommon/jsinspector-modern/EmulationAgent.cpp +108 -0
- package/ReactCommon/jsinspector-modern/EmulationAgent.h +47 -0
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +137 -26
- package/ReactCommon/jsinspector-modern/HostAgent.h +6 -7
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +40 -33
- package/ReactCommon/jsinspector-modern/HostTarget.h +136 -32
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +42 -8
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h +42 -5
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +54 -21
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +89 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +24 -2
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +24 -2
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.cpp +39 -2
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.h +12 -2
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +186 -56
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnectionImpl.h +42 -4
- package/ReactCommon/jsinspector-modern/InstanceAgent.cpp +2 -11
- package/ReactCommon/jsinspector-modern/InstanceTarget.h +2 -2
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +13 -4
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.h +13 -0
- package/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp +9 -1
- package/ReactCommon/jsinspector-modern/PerfMonitorV2.h +4 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +34 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.h +8 -1
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +99 -18
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +57 -13
- package/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +106 -1
- package/ReactCommon/jsinspector-modern/RuntimeTargetDebuggerSessionObserver.cpp +6 -95
- package/ReactCommon/jsinspector-modern/RuntimeTargetGlobalStateObserver.cpp +122 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetGlobalStateObserver.h +42 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetTracingStateObserver.cpp +27 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetTracingStateObserver.h +27 -0
- package/ReactCommon/jsinspector-modern/SessionState.h +31 -0
- package/ReactCommon/jsinspector-modern/TracingAgent.cpp +48 -54
- package/ReactCommon/jsinspector-modern/TracingAgent.h +1 -11
- package/ReactCommon/jsinspector-modern/UniqueMonostate.h +0 -4
- package/ReactCommon/jsinspector-modern/WeakList.h +60 -1
- package/ReactCommon/jsinspector-modern/__docs__/InspectorPackagerConnection.md +70 -0
- package/ReactCommon/jsinspector-modern/__docs__/consoleTimeStamp.md +96 -0
- package/ReactCommon/jsinspector-modern/network/NetworkHandler.cpp +25 -21
- package/ReactCommon/jsinspector-modern/network/NetworkHandler.h +21 -15
- package/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp +131 -0
- package/ReactCommon/jsinspector-modern/tests/GmockHelpers.h +1 -1
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +121 -3
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +23 -2
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionMultiSessionTest.cpp +692 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp +10 -123
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.h +140 -0
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +159 -6
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +60 -56
- package/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +335 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.h +95 -0
- package/ReactCommon/jsinspector-modern/tests/WeakListTest.cpp +31 -1
- package/ReactCommon/jsinspector-modern/tests/engines/JsiIntegrationTestHermesEngineAdapter.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +10 -0
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +61 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +56 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +165 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +50 -0
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +67 -16
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +21 -2
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +5 -0
- package/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h +5 -0
- package/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h +158 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEvent.h +2 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +100 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +60 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +44 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +29 -7
- package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +138 -0
- package/ReactCommon/jsinspector-modern/tracing/tests/TimeWindowedBufferTest.cpp +352 -0
- package/ReactCommon/jsitooling/React-jsitooling.podspec +5 -0
- package/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.cpp +54 -0
- package/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.h +20 -0
- package/ReactCommon/logger/react_native_log.cpp +0 -1
- package/ReactCommon/react/bridging/Array.h +1 -1
- package/ReactCommon/react/bridging/ArrayBuffer.h +180 -0
- package/ReactCommon/react/bridging/Bridging.h +1 -0
- package/ReactCommon/react/bridging/Convert.h +12 -0
- package/ReactCommon/react/bridging/React-bridging.podspec +44 -0
- package/ReactCommon/react/bridging/tests/BridgingTest.cpp +185 -11
- package/ReactCommon/react/bridging/tests/ClassTest.cpp +22 -0
- package/ReactCommon/react/cxxstableapi/CMakeLists.txt +18 -0
- package/ReactCommon/react/cxxstableapi/FrameworksGuard.h +35 -0
- package/ReactCommon/react/cxxstableapi/PrivateGuard.h +34 -0
- package/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec +34 -0
- package/ReactCommon/react/cxxstableapi/UmbrellaGuard.h +53 -0
- package/ReactCommon/react/debug/CMakeLists.txt +2 -1
- package/ReactCommon/react/debug/React-debug.podspec +7 -1
- package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
- package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
- package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
- package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
- package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +81 -69
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +93 -78
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +309 -255
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +54 -48
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +70 -58
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +151 -124
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +13 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +11 -3
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -12
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +27 -24
- package/ReactCommon/react/featureflags/__docs__/README.md +12 -0
- package/ReactCommon/react/featureflags/rewrite_feature_flag_defaults.py +111 -0
- package/ReactCommon/react/featureflags/tests/test_rewrite_feature_flag_defaults.py +60 -0
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +8 -2
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp +30 -10
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.h +17 -6
- package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +49 -1
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +4 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +4 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +7 -9
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +5 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h +0 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +106 -65
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +0 -9
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +47 -174
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleWithJSIBindings.h +0 -3
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +4 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +36 -3
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +8 -1
- package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
- package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -0
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp +33 -1
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.h +2 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +90 -75
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +41 -35
- package/ReactCommon/react/nativemodule/featureflags/__docs__/README.md +12 -0
- package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -0
- package/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h +4 -0
- package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +67 -0
- package/ReactCommon/react/nativemodule/intersectionobserver/__docs__/README.md +13 -0
- package/ReactCommon/react/nativemodule/microtasks/__docs__/README.md +13 -0
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +7 -2
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +67 -0
- package/ReactCommon/react/nativemodule/mutationobserver/__docs__/README.md +13 -0
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +2 -5
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.h +1 -1
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.h +1 -1
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +21 -26
- package/ReactCommon/react/nativemodule/viewtransition/CMakeLists.txt +24 -0
- package/ReactCommon/react/nativemodule/viewtransition/NativeViewTransition.cpp +92 -0
- package/ReactCommon/react/nativemodule/viewtransition/NativeViewTransition.h +37 -0
- package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +58 -0
- package/ReactCommon/react/nativemodule/webperformance/NativePerformance.cpp +10 -1
- package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +1 -0
- package/ReactCommon/react/networking/CMakeLists.txt +7 -0
- package/ReactCommon/react/networking/NetworkReporter.cpp +26 -22
- package/ReactCommon/react/networking/NetworkReporter.h +0 -1
- package/ReactCommon/react/networking/React-networking.podspec +0 -1
- package/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp +4 -2
- package/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.h +0 -1
- package/ReactCommon/react/performance/timeline/CMakeLists.txt +1 -0
- package/ReactCommon/react/performance/timeline/PerformanceEntry.h +1 -1
- package/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp +10 -2
- package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -0
- package/ReactCommon/react/performance/timeline/tests/PerformanceEntryTest.cpp +62 -0
- package/ReactCommon/react/renderer/animated/AnimatedModule.cpp +104 -78
- package/ReactCommon/react/renderer/animated/AnimatedModule.h +10 -2
- package/ReactCommon/react/renderer/animated/CMakeLists.txt +0 -1
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +281 -178
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +51 -9
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +85 -72
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.h +0 -1
- package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.cpp +21 -1
- package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.h +1 -0
- package/ReactCommon/react/renderer/animated/event_drivers/EventAnimationDriver.h +0 -1
- package/ReactCommon/react/renderer/animated/internal/AnimatedMountingOverrideDelegate.cpp +1 -1
- package/ReactCommon/react/renderer/animated/internal/AnimatedMountingOverrideDelegate.h +0 -2
- package/ReactCommon/react/renderer/animated/internal/NativeAnimatedAllowlist.h +2 -2
- package/ReactCommon/react/renderer/animated/nodes/ColorAnimatedNode.cpp +0 -1
- package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.cpp +169 -9
- package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.h +21 -0
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +59 -15
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +22 -0
- package/ReactCommon/react/renderer/animated/nodes/RoundAnimatedNode.cpp +1 -1
- package/ReactCommon/react/renderer/animated/nodes/ValueAnimatedNode.cpp +1 -1
- package/ReactCommon/react/renderer/animated/tests/AnimatedNodeTests.cpp +67 -0
- package/ReactCommon/react/renderer/animated/tests/AnimationDriverTests.cpp +107 -0
- package/ReactCommon/react/renderer/animated/tests/AnimationTestsBase.h +2 -1
- package/ReactCommon/react/renderer/animated/tests/DecayAnimationDriverTest.cpp +245 -0
- package/ReactCommon/react/renderer/animated/tests/ManagedPropsMountingOverrideTests.cpp +204 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +711 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedProps.h +388 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h +191 -2
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +118 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +303 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsSerializer.h +17 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +225 -113
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +54 -27
- package/ReactCommon/react/renderer/animationbackend/AnimationBackendCommitHook.cpp +85 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackendCommitHook.h +31 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +44 -0
- package/ReactCommon/react/renderer/animationbackend/CMakeLists.txt +0 -1
- package/ReactCommon/react/renderer/animationbackend/__docs__/AnimationBackend.md +88 -0
- package/ReactCommon/react/renderer/animationbackend/__docs__/AnimationBackend.svg +4 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +8 -3
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +3 -4
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +0 -2
- package/ReactCommon/react/renderer/animations/tests/MutationComparatorTest.cpp +273 -0
- package/ReactCommon/react/renderer/animations/utils.h +12 -1
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp +0 -6
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h +3 -1
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +0 -4
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +7 -3
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +25 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +193 -4
- package/ReactCommon/react/renderer/attributedstring/primitives.h +4 -2
- package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +73 -0
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +6 -0
- package/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp +3 -5
- package/ReactCommon/react/renderer/components/image/ImageProps.cpp +79 -126
- package/ReactCommon/react/renderer/components/image/ImageProps.h +3 -3
- package/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp +9 -2
- package/ReactCommon/react/renderer/components/image/conversions.h +7 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.cpp +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.cpp +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +39 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +182 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.mm +11 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +48 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +227 -0
- package/ReactCommon/react/renderer/components/root/RootShadowNode.cpp +1 -1
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +235 -352
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.h +0 -1
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.h +1 -1
- package/ReactCommon/react/renderer/components/scrollview/conversions.h +0 -1
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +30 -46
- package/ReactCommon/react/renderer/components/scrollview/primitives.h +1 -10
- package/ReactCommon/react/renderer/components/scrollview/tests/ScrollViewTest.cpp +83 -3
- package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +1 -1
- package/ReactCommon/react/renderer/components/text/BaseParagraphComponentDescriptor.h +49 -0
- package/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +17 -27
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +24 -25
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +19 -0
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +3 -28
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +10 -10
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +4 -4
- package/ReactCommon/react/renderer/components/text/SelectableParagraphComponentDescriptor.h +24 -0
- package/ReactCommon/react/renderer/components/text/SelectableParagraphShadowNode.h +32 -0
- package/ReactCommon/react/renderer/components/text/TextEffectComponentDescriptor.h +17 -0
- package/ReactCommon/react/renderer/components/text/TextEffectProps.cpp +59 -0
- package/ReactCommon/react/renderer/components/text/TextEffectProps.h +30 -0
- package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.cpp +14 -0
- package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.h +26 -0
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +19 -29
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.cpp +1 -1
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +2 -2
- package/ReactCommon/react/renderer/components/text/stateConversions.h +0 -1
- package/ReactCommon/react/renderer/components/text/tests/BaseTextShadowNodeTest.cpp +15 -0
- package/ReactCommon/react/renderer/components/textinput/BaseTextInputShadowNode.h +13 -1
- package/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp +2 -40
- package/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h +0 -20
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +42 -50
- package/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/conversions.h +0 -22
- package/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/primitives.h +0 -48
- package/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/propsConversions.h +0 -61
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +2 -36
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +149 -225
- package/ReactCommon/react/renderer/components/view/BackgroundImagePropsConversions.cpp +15 -24
- package/ReactCommon/react/renderer/components/view/BaseTouch.cpp +3 -16
- package/ReactCommon/react/renderer/components/view/BaseTouch.h +11 -30
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +256 -312
- package/ReactCommon/react/renderer/components/view/BaseViewProps.h +1 -1
- package/ReactCommon/react/renderer/components/view/ConcreteViewShadowNode.h +0 -3
- package/ReactCommon/react/renderer/components/view/FilterPropsConversions.h +57 -53
- package/ReactCommon/react/renderer/components/view/PointerEvent.cpp +2 -0
- package/ReactCommon/react/renderer/components/view/PointerEvent.h +5 -0
- package/ReactCommon/react/renderer/components/view/TouchEvent.h +0 -2
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +23 -5
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -6
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +2 -12
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +78 -27
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +7 -9
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +36 -39
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +0 -1
- package/ReactCommon/react/renderer/components/view/conversions.h +294 -36
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +110 -201
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/NativeDrawable.h +47 -16
- package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +2 -2
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformTouch.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewEventEmitter.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewProps.cpp +38 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewProps.h +29 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +30 -0
- package/ReactCommon/react/renderer/components/view/primitives.h +8 -87
- package/ReactCommon/react/renderer/components/view/propsConversions.h +81 -43
- package/ReactCommon/react/renderer/components/view/tests/ConversionsTest.cpp +301 -0
- package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +6 -6
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +384 -3
- package/ReactCommon/react/renderer/components/virtualview/VirtualViewComponentDescriptor.h +1 -1
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +59 -14
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +33 -0
- package/ReactCommon/react/renderer/core/DynamicEventPayload.cpp +10 -0
- package/ReactCommon/react/renderer/core/DynamicEventPayload.h +6 -1
- package/ReactCommon/react/renderer/core/DynamicPointerEvent.cpp +30 -0
- package/ReactCommon/react/renderer/core/DynamicPointerEvent.h +29 -0
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +1 -1
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +99 -21
- package/ReactCommon/react/renderer/core/EventEmitter.h +33 -8
- package/ReactCommon/react/renderer/core/EventPipe.h +4 -2
- package/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +21 -13
- package/ReactCommon/react/renderer/core/EventTarget.cpp +11 -8
- package/ReactCommon/react/renderer/core/EventTarget.h +7 -7
- package/ReactCommon/react/renderer/core/LayoutConstraints.h +0 -5
- package/ReactCommon/react/renderer/core/LayoutContext.h +9 -7
- package/ReactCommon/react/renderer/core/LayoutMetrics.cpp +5 -3
- package/ReactCommon/react/renderer/core/LayoutMetrics.h +3 -2
- package/ReactCommon/react/renderer/core/LayoutPrimitives.h +1 -0
- package/ReactCommon/react/renderer/core/Props.cpp +26 -22
- package/ReactCommon/react/renderer/core/Props.h +69 -17
- package/ReactCommon/react/renderer/core/RawEvent.cpp +4 -2
- package/ReactCommon/react/renderer/core/RawEvent.h +6 -6
- package/ReactCommon/react/renderer/core/RawProps.cpp +20 -3
- package/ReactCommon/react/renderer/core/RawProps.h +44 -0
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +15 -28
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +3 -3
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +5 -13
- package/ReactCommon/react/renderer/core/RawPropsParser.h +5 -9
- package/ReactCommon/react/renderer/core/RawValue.h +1 -2
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +63 -59
- package/ReactCommon/react/renderer/core/ShadowNode.h +21 -31
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +6 -6
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +16 -14
- package/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp +4 -2
- package/ReactCommon/react/renderer/core/ShadowNodeFragment.h +2 -2
- package/ReactCommon/react/renderer/core/StateData.h +4 -4
- package/ReactCommon/react/renderer/core/__docs__/RSNRU.excalidraw.svg +2 -0
- package/ReactCommon/react/renderer/core/__docs__/RSNRU.md +61 -0
- package/ReactCommon/react/renderer/core/__docs__/passChildrenWhenCloning.excalidraw.svg +2 -0
- package/ReactCommon/react/renderer/core/__docs__/passChildrenWhenCloning.md +52 -0
- package/ReactCommon/react/renderer/core/conversions.h +4 -0
- package/ReactCommon/react/renderer/core/graphicsConversions.h +4 -4
- package/ReactCommon/react/renderer/core/propsConversions.h +4 -8
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +8 -0
- package/ReactCommon/react/renderer/core/tests/EventQueueProcessorTest.cpp +52 -3
- package/ReactCommon/react/renderer/core/tests/EventTargetTests.cpp +26 -0
- package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +7 -7
- package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +19 -19
- package/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +135 -0
- package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +43 -53
- package/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp +88 -1
- package/ReactCommon/react/renderer/css/CSSBackgroundImage.h +112 -140
- package/ReactCommon/react/renderer/css/CSSColor.h +7 -8
- package/ReactCommon/react/renderer/css/CSSColorFunction.h +38 -39
- package/ReactCommon/react/renderer/css/CSSCompoundDataType.h +23 -17
- package/ReactCommon/react/renderer/css/CSSDataType.h +15 -10
- package/ReactCommon/react/renderer/css/CSSFilter.h +12 -17
- package/ReactCommon/react/renderer/css/CSSKeyword.h +8 -0
- package/ReactCommon/react/renderer/css/CSSList.h +11 -11
- package/ReactCommon/react/renderer/css/CSSRatio.h +4 -4
- package/ReactCommon/react/renderer/css/CSSShadow.h +7 -7
- package/ReactCommon/react/renderer/css/CSSSyntaxParser.h +17 -6
- package/ReactCommon/react/renderer/css/CSSTokenizer.h +2 -0
- package/ReactCommon/react/renderer/css/CSSTransform.h +20 -20
- package/ReactCommon/react/renderer/css/CSSTransformOrigin.h +4 -5
- package/ReactCommon/react/renderer/css/CSSValueParser.h +71 -67
- package/ReactCommon/react/renderer/css/tests/CSSValueParserTest.cpp +12 -11
- package/ReactCommon/react/renderer/debug/CMakeLists.txt +7 -0
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp +42 -26
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.h +4 -2
- package/ReactCommon/react/renderer/debug/flags.h +3 -2
- package/ReactCommon/react/renderer/debug/tests/DebugStringConvertibleTest.cpp +34 -3
- package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +3 -3
- package/ReactCommon/react/renderer/graphics/BackgroundPosition.h +0 -1
- package/ReactCommon/react/renderer/graphics/BackgroundRepeat.h +0 -1
- package/ReactCommon/react/renderer/graphics/BackgroundSize.h +0 -1
- package/ReactCommon/react/renderer/graphics/BlendMode.h +7 -0
- package/ReactCommon/react/renderer/graphics/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/graphics/ColorStop.h +3 -0
- package/ReactCommon/react/renderer/graphics/Filter.h +5 -2
- package/ReactCommon/react/renderer/graphics/LinearGradient.cpp +9 -15
- package/ReactCommon/react/renderer/graphics/LinearGradient.h +10 -19
- package/ReactCommon/react/renderer/graphics/Point.h +0 -2
- package/ReactCommon/react/renderer/graphics/RadialGradient.h +8 -35
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -6
- package/ReactCommon/react/renderer/graphics/Rect.h +1 -9
- package/ReactCommon/react/renderer/graphics/RectangleCorners.h +1 -10
- package/ReactCommon/react/renderer/graphics/RectangleEdges.h +1 -10
- package/ReactCommon/react/renderer/graphics/Size.h +0 -5
- package/ReactCommon/react/renderer/graphics/Transform.cpp +0 -4
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -13
- package/ReactCommon/react/renderer/graphics/TransformUtils.h +95 -0
- package/ReactCommon/react/renderer/graphics/ValueUnit.cpp +1 -1
- package/ReactCommon/react/renderer/graphics/ValueUnit.h +3 -11
- package/ReactCommon/react/renderer/graphics/fromRawValueShared.h +13 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +17 -53
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +3 -3
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm +13 -16
- package/ReactCommon/react/renderer/imagemanager/ImageManager.h +3 -4
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +11 -12
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.h +4 -3
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageFetcher.cpp +19 -13
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageFetcher.h +8 -3
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageManager.cpp +16 -4
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageRequestParams.h +6 -36
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +25 -4
- package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequestParams.h +1 -9
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequestParams.h +1 -9
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImageManager.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImageManager.mm +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImagePrimitivesConversions.h +1 -5
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +8 -4
- package/ReactCommon/react/renderer/imagemanager/primitives.h +15 -11
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +158 -47
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +28 -14
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +99 -48
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +4 -0
- package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +96 -1
- package/ReactCommon/react/renderer/mounting/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +39 -42
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +0 -11
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +0 -4
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +253 -21
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +32 -6
- package/ReactCommon/react/renderer/mounting/ShadowTreeDelegate.h +11 -0
- package/ReactCommon/react/renderer/mounting/ShadowView.cpp +0 -4
- package/ReactCommon/react/renderer/mounting/ShadowView.h +0 -1
- package/ReactCommon/react/renderer/mounting/internal/ShadowViewNodePair.h +0 -5
- package/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.h +3 -3
- package/ReactCommon/react/renderer/mounting/stubs/StubView.cpp +0 -4
- package/ReactCommon/react/renderer/mounting/stubs/StubView.h +0 -1
- package/ReactCommon/react/renderer/mounting/stubs/StubViewTree.cpp +0 -4
- package/ReactCommon/react/renderer/mounting/stubs/StubViewTree.h +0 -2
- package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +220 -0
- package/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +79 -18
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeReactBranchingTest.cpp +141 -0
- package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp +6 -0
- package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +37 -11
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp +2 -1
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp +0 -5
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h +0 -1
- package/ReactCommon/react/renderer/observers/intersection/__docs__/README.md +13 -0
- package/ReactCommon/react/renderer/observers/mutation/__docs__/README.md +13 -0
- package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +22 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +13 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +13 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +9 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +43 -5
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +17 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -0
- package/ReactCommon/react/renderer/runtimescheduler/__docs__/README.md +210 -0
- package/ReactCommon/react/renderer/runtimescheduler/__docs__/event-loop-async-task.excalidraw.svg +4 -0
- package/ReactCommon/react/renderer/runtimescheduler/__docs__/event-loop-sync-task.excalidraw.svg +4 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +134 -31
- package/ReactCommon/react/renderer/scheduler/CMakeLists.txt +2 -0
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +118 -10
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +17 -4
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +11 -0
- package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.h +7 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +1 -105
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +3 -9
- package/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +2 -3
- package/ReactCommon/react/renderer/scheduler/tests/SchedulerDelegateInvalidationTest.cpp +671 -0
- package/ReactCommon/react/renderer/textlayoutmanager/TextLayoutManagerExtended.h +18 -18
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +22 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +12 -16
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h +5 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +15 -4
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +82 -44
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontProperties.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +1 -25
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.h +2 -8
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +210 -32
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +18 -6
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +12 -2
- package/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +86 -5
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.cpp +1 -1
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.h +1 -3
- package/ReactCommon/react/renderer/uimanager/PointerHoverTracker.cpp +1 -1
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +144 -98
- package/ReactCommon/react/renderer/uimanager/UIManager.h +27 -10
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +20 -5
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +349 -7
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +7 -5
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +16 -1
- package/ReactCommon/react/renderer/uimanager/UIManagerViewTransitionDelegate.h +82 -0
- package/ReactCommon/react/renderer/uimanager/consistency/LazyShadowTreeRevisionConsistencyManager.cpp +19 -23
- package/ReactCommon/react/renderer/uimanager/consistency/LazyShadowTreeRevisionConsistencyManager.h +2 -3
- package/ReactCommon/react/renderer/uimanager/consistency/tests/LazyShadowTreeRevisionConsistencyManagerTest.cpp +13 -5
- package/ReactCommon/react/renderer/uimanager/primitives.h +16 -7
- package/ReactCommon/react/renderer/uimanager/tests/FabricUIManagerTest.cpp +144 -3
- package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +236 -0
- package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +4 -4
- package/ReactCommon/react/renderer/viewtransition/CMakeLists.txt +22 -0
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +569 -0
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +171 -0
- package/ReactCommon/react/runtime/CMakeLists.txt +0 -4
- package/ReactCommon/react/runtime/PlatformTimerRegistry.h +12 -0
- package/ReactCommon/react/runtime/ReactInstance.cpp +99 -77
- package/ReactCommon/react/runtime/ReactInstance.h +5 -1
- package/ReactCommon/react/runtime/TimerManager.cpp +30 -56
- package/ReactCommon/react/runtime/TimerManager.h +7 -12
- package/ReactCommon/react/runtime/hermes/CMakeLists.txt +0 -4
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +11 -95
- package/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +99 -0
- package/ReactCommon/react/runtime/iostests/RCTHostTests.mm +11 -0
- package/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +244 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +2 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +20 -5
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +170 -7
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +1 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +49 -39
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +3 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +3 -2
- package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +27 -3
- package/ReactCommon/react/runtime/tests/cxx/RuntimeExecutorShutdownTest.cpp +155 -0
- package/ReactCommon/react/test_utils/shadowTreeGeneration.h +8 -5
- package/ReactCommon/react/timing/PrivacyInfo.xcprivacy +21 -0
- package/ReactCommon/react/timing/React-timing.podspec +2 -0
- package/ReactCommon/react/timing/__docs__/README.md +107 -0
- package/ReactCommon/react/timing/primitives.h +33 -1
- package/ReactCommon/react/utils/Base64.h +99 -0
- package/ReactCommon/react/utils/ContextContainer.h +0 -2
- package/ReactCommon/react/utils/React-utils.podspec +3 -1
- package/ReactCommon/react/utils/Telemetry.h +0 -13
- package/ReactCommon/react/utils/tests/Base64Tests.cpp +36 -0
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +0 -1
- package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +21 -38
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/ReactCommon/yoga/yoga/YGEnums.cpp +34 -0
- package/ReactCommon/yoga/yoga/YGEnums.h +21 -4
- package/ReactCommon/yoga/yoga/YGMacros.h +2 -0
- package/ReactCommon/yoga/yoga/YGNode.cpp +41 -0
- package/ReactCommon/yoga/yoga/YGNode.h +70 -1
- package/ReactCommon/yoga/yoga/YGNodeLayout.h +0 -2
- package/ReactCommon/yoga/yoga/YGNodeStyle.cpp +269 -0
- package/ReactCommon/yoga/yoga/YGNodeStyle.h +93 -1
- package/ReactCommon/yoga/yoga/YGValue.h +0 -4
- package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +41 -9
- package/ReactCommon/yoga/yoga/algorithm/Align.h +12 -1
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +401 -32
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +22 -0
- package/ReactCommon/yoga/yoga/algorithm/FlexDirection.h +6 -6
- package/ReactCommon/yoga/yoga/algorithm/SizingMode.h +4 -4
- package/ReactCommon/yoga/yoga/config/Config.h +1 -1
- package/ReactCommon/yoga/yoga/enums/Align.h +3 -1
- package/ReactCommon/yoga/yoga/enums/Display.h +2 -1
- package/ReactCommon/yoga/yoga/enums/Errata.h +1 -0
- package/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h +2 -1
- package/ReactCommon/yoga/yoga/enums/GridTrackType.h +43 -0
- package/ReactCommon/yoga/yoga/enums/Justify.h +5 -1
- package/ReactCommon/yoga/yoga/enums/YogaEnums.h +0 -1
- package/ReactCommon/yoga/yoga/event/event.cpp +2 -0
- package/ReactCommon/yoga/yoga/event/event.h +1 -0
- package/ReactCommon/yoga/yoga/node/LayoutResults.h +8 -3
- package/ReactCommon/yoga/yoga/node/Node.cpp +38 -1
- package/ReactCommon/yoga/yoga/node/Node.h +37 -4
- package/ReactCommon/yoga/yoga/numeric/FloatOptional.h +0 -9
- package/ReactCommon/yoga/yoga/style/GridLine.h +53 -0
- package/ReactCommon/yoga/yoga/style/GridTrack.h +63 -0
- package/ReactCommon/yoga/yoga/style/Style.h +268 -82
- package/ReactCommon/yoga/yoga/style/StyleLength.h +7 -0
- package/ReactCommon/yoga/yoga/style/StyleSizeLength.h +14 -1
- package/ReactCommon/yoga/yoga/style/StyleValueHandle.h +8 -0
- package/ReactCommon/yoga/yoga/style/StyleValuePool.h +10 -0
- package/cli.js +4 -183
- package/flow/HermesInternalType.js +6 -6
- package/flow/bom.js.flow +152 -52
- package/flow/cssom.js.flow +24 -24
- package/flow/dom.js.flow +258 -250
- package/flow/global.js +7 -1
- package/gradle/libs.versions.toml +11 -7
- package/index.js +95 -100
- package/index.js.flow +92 -32
- package/macos/UIKitCompat/MobileCoreServices/MobileCoreServices.h +14 -0
- package/macos/UIKitCompat/MobileCoreServices/UTCoreTypes.h +14 -0
- package/macos/UIKitCompat/MobileCoreServices/UTType.h +14 -0
- package/macos/UIKitCompat/RCTPlatformViewCompat.h +68 -0
- package/macos/UIKitCompat/README.md +77 -0
- package/macos/UIKitCompat/React-UIKitCompat.podspec +61 -0
- package/macos/UIKitCompat/UIKit/UIAccessibility.h +72 -0
- package/macos/UIKitCompat/UIKit/UIAccessibility.m +103 -0
- package/macos/UIKitCompat/UIKit/UIAlertController.h +92 -0
- package/macos/UIKitCompat/UIKit/UIAlertController.m +172 -0
- package/macos/UIKitCompat/UIKit/UIApplication.h +39 -0
- package/macos/UIKitCompat/UIKit/UIApplication.m +30 -0
- package/macos/UIKitCompat/UIKit/UIApplicationDelegate.h +156 -0
- package/macos/UIKitCompat/UIKit/UIApplicationDelegate.m +116 -0
- package/macos/UIKitCompat/UIKit/UIColor.h +50 -0
- package/macos/UIKitCompat/UIKit/UIColor.m +84 -0
- package/macos/UIKitCompat/UIKit/UIControls.h +352 -0
- package/macos/UIKitCompat/UIKit/UIControls.m +609 -0
- package/macos/UIKitCompat/UIKit/UIDisplayLink.h +52 -0
- package/macos/UIKitCompat/UIKit/UIDisplayLink.m +168 -0
- package/macos/UIKitCompat/UIKit/UIEvent.h +110 -0
- package/macos/UIKitCompat/UIKit/UIEvent.m +109 -0
- package/macos/UIKitCompat/UIKit/UIGestureRecognizerSubclass.h +16 -0
- package/macos/UIKitCompat/UIKit/UIGraphics.h +66 -0
- package/macos/UIKitCompat/UIKit/UIGraphics.m +192 -0
- package/macos/UIKitCompat/UIKit/UIImage.h +90 -0
- package/macos/UIKitCompat/UIKit/UIImage.m +176 -0
- package/macos/UIKitCompat/UIKit/UIKeyCommand.h +95 -0
- package/macos/UIKitCompat/UIKit/UIKeyCommand.m +66 -0
- package/macos/UIKitCompat/UIKit/UIKit.h +51 -0
- package/macos/UIKitCompat/UIKit/UIKitDefines.h +417 -0
- package/macos/UIKitCompat/UIKit/UIPlatformGaps.h +405 -0
- package/macos/UIKitCompat/UIKit/UIPlatformGaps.m +1075 -0
- package/macos/UIKitCompat/UIKit/UIScrollView.h +106 -0
- package/macos/UIKitCompat/UIKit/UIScrollView.m +237 -0
- package/macos/UIKitCompat/UIKit/UIStatusBar.h +42 -0
- package/macos/UIKitCompat/UIKit/UIStatusBar.m +27 -0
- package/macos/UIKitCompat/UIKit/UIText.h +234 -0
- package/macos/UIKitCompat/UIKit/UIText.m +332 -0
- package/macos/UIKitCompat/UIKit/UITouch.h +24 -0
- package/macos/UIKitCompat/UIKit/UITraitCollection.h +57 -0
- package/macos/UIKitCompat/UIKit/UITraitCollection.m +114 -0
- package/macos/UIKitCompat/UIKit/UIUserActivity.h +14 -0
- package/macos/UIKitCompat/UIKit/UIView.h +166 -0
- package/macos/UIKitCompat/UIKit/UIView.m +555 -0
- package/macos/UIKitCompat/UIKit/UIViewAnimation.h +355 -0
- package/macos/UIKitCompat/UIKit/UIViewAnimation.m +481 -0
- package/macos/UIKitCompat/UIKit/UIViewController.h +24 -0
- package/macos/UIKitCompat/UIKit/UIWindow.h +24 -0
- package/macos/UIKitCompat/macos-excludes.txt +22 -0
- package/macos/metro-config.js +120 -0
- package/package.json +79 -89
- package/react-native.config.js +86 -57
- package/scripts/cocoapods/__docs__/prebuilt-deps.md +78 -0
- package/scripts/cocoapods/__tests__/codegen_utils-test.rb +315 -0
- package/scripts/cocoapods/__tests__/fabric-test.rb +57 -0
- package/scripts/cocoapods/__tests__/jsengine-test.rb +47 -0
- package/scripts/cocoapods/__tests__/local_podspec_patch-test.rb +167 -0
- package/scripts/cocoapods/__tests__/new_architecture-test.rb +402 -0
- package/scripts/cocoapods/__tests__/rndependencies-test.rb +89 -0
- package/scripts/cocoapods/__tests__/spm-test.rb +100 -0
- package/scripts/cocoapods/__tests__/test_utils/CodegenScriptPhaseExtractorMock.rb +21 -0
- package/scripts/cocoapods/__tests__/test_utils/CodegenUtilsMock.rb +108 -0
- package/scripts/cocoapods/__tests__/test_utils/DirMock.rb +72 -0
- package/scripts/cocoapods/__tests__/test_utils/EnvironmentMock.rb +21 -0
- package/scripts/cocoapods/__tests__/test_utils/FileMock.rb +113 -0
- package/scripts/cocoapods/__tests__/test_utils/FileUtilsMock.rb +40 -0
- package/scripts/cocoapods/__tests__/test_utils/FinderMock.rb +28 -0
- package/scripts/cocoapods/__tests__/test_utils/InstallerMock.rb +239 -0
- package/scripts/cocoapods/__tests__/test_utils/LocalPodspecPatchMock.rb +14 -0
- package/scripts/cocoapods/__tests__/test_utils/Open3Mock.rb +43 -0
- package/scripts/cocoapods/__tests__/test_utils/PathnameMock.rb +50 -0
- package/scripts/cocoapods/__tests__/test_utils/PodMock.rb +144 -0
- package/scripts/cocoapods/__tests__/test_utils/SpecMock.rb +30 -0
- package/scripts/cocoapods/__tests__/test_utils/SysctlCheckerMock.rb +21 -0
- package/scripts/cocoapods/__tests__/test_utils/TargetDefinitionMock.rb +12 -0
- package/scripts/cocoapods/__tests__/test_utils/XcodebuildMock.rb +26 -0
- package/scripts/cocoapods/__tests__/test_utils/XcodeprojMock.rb +21 -0
- package/scripts/cocoapods/__tests__/test_utils/podSpy.rb +39 -0
- package/scripts/cocoapods/__tests__/test_utils/systemUtils.rb +14 -0
- package/scripts/cocoapods/__tests__/utils-test.rb +1079 -0
- package/scripts/cocoapods/autolinking.rb +11 -2
- package/scripts/cocoapods/codegen.rb +3 -1
- package/scripts/cocoapods/codegen_utils.rb +7 -2
- package/scripts/cocoapods/fabric.rb +1 -1
- package/scripts/cocoapods/helpers.rb +27 -6
- package/scripts/cocoapods/jsengine.rb +1 -1
- package/scripts/cocoapods/new_architecture.rb +8 -2
- package/scripts/cocoapods/rncore.rb +153 -18
- package/scripts/cocoapods/rncore_facades.rb +232 -0
- package/scripts/cocoapods/rndependencies.rb +148 -27
- package/scripts/cocoapods/rndeps_facades.rb +197 -0
- package/scripts/cocoapods/spm.rb +104 -19
- package/scripts/cocoapods/utils.rb +65 -26
- package/scripts/codegen/__fixtures__/fixtures.js +133 -0
- package/scripts/codegen/__fixtures__/test-app/lib/test-library/package.json +66 -0
- package/scripts/codegen/__fixtures__/test-app/package.json +67 -0
- package/scripts/codegen/__fixtures__/test-app-legacy/package.json +37 -0
- package/scripts/codegen/__fixtures__/test-library/test-library.podspec +10 -0
- package/scripts/codegen/__fixtures__/test-library-2/test-library-2.podspec +12 -0
- package/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap +995 -0
- package/scripts/codegen/__tests__/generate-artifacts-executor-test.js +509 -0
- package/scripts/codegen/__tests__/generate-specs-cli-executor-test.js +74 -0
- package/scripts/codegen/generate-artifacts-executor/generateAppDependencyProvider.js +4 -4
- package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +4 -4
- package/scripts/codegen/generate-artifacts-executor/generateNativeCode.js +15 -7
- package/scripts/codegen/generate-artifacts-executor/generatePackageSwift.js +2 -2
- package/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +4 -3
- package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +12 -9
- package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +26 -11
- package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +8 -8
- package/scripts/codegen/generate-artifacts-executor/generateUnstableModulesRequiringMainQueueSetupProvider.js +4 -4
- package/scripts/codegen/generate-artifacts-executor/index.js +102 -33
- package/scripts/codegen/generate-artifacts-executor/utils.js +67 -6
- package/scripts/codegen/generate-specs-cli-executor.js +1 -1
- package/scripts/codegen/templates/Package.swift.spm-template +97 -0
- package/scripts/codegen/templates/Package.swift.template +7 -0
- package/scripts/codegen/templates/RCTThirdPartyComponentsProviderMM.template +22 -1
- package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -1
- package/scripts/generate-codegen-artifacts.js +20 -2
- package/scripts/generate-provider-cli.js +1 -1
- package/scripts/hermes/hermes-utils.js +27 -58
- package/scripts/ios-configure-glog.sh +24 -1
- package/scripts/node-binary.sh +0 -0
- package/scripts/react-native-xcode.sh +24 -6
- package/scripts/react_native_pods.rb +125 -30
- package/scripts/react_native_pods_utils/script_phases.rb +9 -3
- package/scripts/react_native_pods_utils/script_phases.sh +4 -3
- package/scripts/replace-rncore-version.js +110 -37
- package/scripts/setup-apple-spm.js +1283 -0
- package/scripts/spm/__docs__/README.md +92 -0
- package/scripts/spm/__docs__/spm-autolinking-plugins.md +359 -0
- package/scripts/spm/__docs__/spm-header-paths-contract.md +100 -0
- package/scripts/spm/__docs__/spm-scripts.md +646 -0
- package/scripts/spm/__tests__/__fixtures__/plain-app.pbxproj +171 -0
- package/scripts/spm/__tests__/autolinking-plugins-test.js +543 -0
- package/scripts/spm/__tests__/download-spm-artifacts-test.js +893 -0
- package/scripts/spm/__tests__/expand-spm-dependencies-test.js +959 -0
- package/scripts/spm/__tests__/flavored-frameworks-plist-dep-test.js +102 -0
- package/scripts/spm/__tests__/flavored-frameworks-test.js +439 -0
- package/scripts/spm/__tests__/generate-spm-autolinking-config-test.js +364 -0
- package/scripts/spm/__tests__/generate-spm-autolinking-test.js +1960 -0
- package/scripts/spm/__tests__/generate-spm-package-test.js +335 -0
- package/scripts/spm/__tests__/generate-spm-xcodeproj-test.js +443 -0
- package/scripts/spm/__tests__/inject-spm-xcodeproj-test.js +1169 -0
- package/scripts/spm/__tests__/pbxproj-oracles.js +33 -0
- package/scripts/spm/__tests__/read-podspec-test.js +487 -0
- package/scripts/spm/__tests__/remove-spm-injection-test.js +1379 -0
- package/scripts/spm/__tests__/scaffold-package-swift-test.js +1321 -0
- package/scripts/spm/__tests__/setup-apple-spm-test.js +652 -0
- package/scripts/spm/__tests__/spm-pbxproj-test.js +707 -0
- package/scripts/spm/__tests__/spm-utils-test.js +715 -0
- package/scripts/spm/__tests__/swift-tools-version-test.js +97 -0
- package/scripts/spm/__tests__/sync-spm-autolinking-test.js +118 -0
- package/scripts/spm/autolinking-plugins.js +411 -0
- package/scripts/spm/download-spm-artifacts.js +1467 -0
- package/scripts/spm/expand-spm-dependencies.js +435 -0
- package/scripts/spm/flavored-frameworks.js +1008 -0
- package/scripts/spm/generate-spm-autolinking-config.js +221 -0
- package/scripts/spm/generate-spm-autolinking.js +2005 -0
- package/scripts/spm/generate-spm-package.js +314 -0
- package/scripts/spm/generate-spm-xcodeproj.js +2790 -0
- package/scripts/spm/read-podspec.js +695 -0
- package/scripts/spm/scaffold-package-swift.js +1247 -0
- package/scripts/spm/spm-pbxproj.js +784 -0
- package/scripts/spm/spm-types.js +546 -0
- package/scripts/spm/spm-utils.js +760 -0
- package/scripts/spm/sync-spm-autolinking.js +160 -0
- package/scripts/xcode/with-environment.sh +7 -1
- package/sdks/.hermesv1version +1 -0
- package/sdks/hermes-engine/hermes-engine.podspec +12 -31
- package/sdks/hermes-engine/hermes-utils.rb +108 -133
- package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
- package/sdks/hermes-engine/version.properties +1 -2
- package/settings.gradle.kts +0 -23
- package/src/asset-registry.js +29 -0
- package/src/private/__tests__/MemoryBaseline-itest.js +113 -0
- package/src/private/__tests__/utilities/ShadowNodeReferenceCounter.js +60 -0
- package/src/private/__tests__/utilities/ShadowNodeRevisionGetter.js +49 -0
- package/src/private/__tests__/utilities/__tests__/ShadowNodeReferenceCounter-itest.js +196 -0
- package/src/private/__tests__/utilities/__tests__/ShadowNodeRevisionGetter-itest.js +79 -0
- package/src/private/__tests__/utilities/accessibilityPropsSuite.js +332 -0
- package/src/private/__tests__/utilities/commonPropsSuite.js +40 -0
- package/src/private/__tests__/utilities/ensureInstance.js +21 -0
- package/src/private/__tests__/utilities/isUnreachable.js +27 -0
- package/src/private/__tests__/utilities/measureRenderTime.js +46 -0
- package/src/private/animated/NativeAnimatedHelper.js +170 -143
- package/src/private/animated/NativeAnimatedValidation.js +7 -4
- package/src/private/animated/__tests__/AnimatedNative-test.js +1766 -0
- package/src/private/animated/__tests__/AnimatedProps-itest.js +80 -0
- package/src/private/animated/__tests__/createAnimatedPropsHook-itest.js +89 -0
- package/src/private/animated/__tests__/createAnimatedPropsMemoHook-itest.js +370 -0
- package/src/private/animated/createAnimatedPropsHook.js +15 -7
- package/src/private/animated/createAnimatedPropsMemoHook.js +20 -20
- package/src/private/assets/AssetRegistry.js +52 -0
- package/src/private/components/activityindicator/specs/ActivityIndicatorViewNativeComponent.js +56 -0
- package/src/private/components/debuggingoverlay/specs/DebuggingOverlayNativeComponent.js +62 -0
- package/src/private/components/drawerlayoutandroid/specs/AndroidDrawerLayoutNativeComponent.js +124 -0
- package/src/private/components/inputaccessoryview/specs/RCTInputAccessoryViewNativeComponent.js +29 -0
- package/src/private/components/modal/specs/RCTModalHostViewNativeComponent.js +151 -0
- package/src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent.js +39 -0
- package/src/private/components/refreshcontrol/specs/AndroidSwipeRefreshLayoutNativeComponent.js +74 -0
- package/src/private/components/refreshcontrol/specs/PullToRefreshViewNativeComponent.js +74 -0
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -2
- package/src/private/components/safeareaview/specs/RCTSafeAreaViewNativeComponent.js +28 -0
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +1 -1
- package/src/private/components/scrollview/specs/AndroidHorizontalScrollContentViewNativeComponent.js +27 -0
- package/src/private/components/switch/specs/AndroidSwitchNativeComponent.js +65 -0
- package/src/private/components/switch/specs/SwitchNativeComponent.js +65 -0
- package/src/private/components/unimplementedview/specs/UnimplementedNativeViewNativeComponent.js +26 -0
- package/src/private/components/virtualcollection/FlingConstants.js +21 -0
- package/src/private/components/virtualcollection/Virtual.js +62 -0
- package/src/private/components/virtualcollection/VirtualCollectionView.js +234 -0
- package/src/private/components/virtualcollection/column/VirtualColumn.js +43 -0
- package/src/private/components/virtualcollection/column/VirtualColumnGenerator.js +72 -0
- package/src/private/components/virtualcollection/dom/getScrollParent.js +43 -0
- package/src/private/components/virtualcollection/dom/isScrollableNode.js +22 -0
- package/src/private/components/virtualcollection/row/VirtualRow.js +43 -0
- package/src/private/components/virtualcollection/row/VirtualRowGenerator.js +72 -0
- package/src/private/components/virtualview/VirtualView.js +30 -30
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +11 -10
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +4 -4
- package/src/private/components/virtualview/__tests__/VirtualView-itest.js +409 -0
- package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
- package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
- package/src/private/devsupport/devmenu/elementinspector/BorderBox.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/BoxInspector.js +3 -3
- package/src/private/devsupport/devmenu/elementinspector/ElementBox.js +4 -4
- package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +42 -37
- package/src/private/devsupport/devmenu/elementinspector/InspectorOverlay.js +15 -3
- package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +3 -29
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -8
- package/src/private/devsupport/devmenu/elementinspector/StyleInspector.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +3 -2
- package/src/private/devsupport/devmenu/elementinspector/getInspectorDataForViewAtPoint.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/resolveBoxStyle.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/useExternalInspection.js +102 -0
- package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +5 -5
- package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +12 -25
- package/src/private/devsupport/rndevtools/GlobalStateObserver.js +56 -0
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.macos.js +7 -5
- package/src/private/devsupport/rndevtools/TracingStateObserver.js +28 -0
- package/src/private/devsupport/rndevtools/__docs__/FuseboxReactDevToolsDispatcher.excalidraw.svg +3 -0
- package/src/private/devsupport/rndevtools/__tests__/TracingStateObserver-itest.js +131 -0
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +6 -4
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +4 -4
- package/src/private/featureflags/ReactNativeFeatureFlags.js +136 -133
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +6 -6
- package/src/private/featureflags/__docs__/README.md +229 -0
- package/src/private/featureflags/__docs__/architecture.excalidraw.svg +4 -0
- package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-itest.js +104 -0
- package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js +91 -0
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +88 -85
- package/src/private/renderer/branching/__tests__/ShadowTreeBranching-itest.js +249 -0
- package/src/private/renderer/consistency/__tests__/UIConsistency-itest.js +159 -0
- package/src/private/renderer/core/__tests__/EventDispatching-benchmark-itest.js +326 -0
- package/src/private/renderer/core/__tests__/EventDispatching-itest.js +685 -0
- package/src/private/renderer/core/__tests__/EventTargetDispatching-itest.js +1630 -0
- package/src/private/renderer/core/__tests__/ResponderEventTarget-itest.js +910 -0
- package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -9
- package/src/private/renderer/events/LegacySyntheticEvent.js +90 -0
- package/src/private/renderer/events/ReactNativeEventTypeMapping.js +103 -0
- package/src/private/renderer/events/ReactNativeResponder.js +732 -0
- package/src/private/renderer/events/ResponderEvent.js +40 -0
- package/src/private/renderer/events/ResponderTouchHistoryStore.js +267 -0
- package/src/private/renderer/events/dispatchNativeEvent.js +118 -0
- package/src/private/renderer/mounting/__tests__/Mounting-itest.js +563 -0
- package/src/private/renderer/runtimescheduler/__tests__/RuntimeScheduler-benchmark-itest.js +62 -0
- package/src/private/setup/__tests__/setUpDefaultReactNativeEnvironment-ComponentSideEffects-itest.js +56 -0
- package/src/private/setup/__tests__/setUpDefaultReactNativeEnvironment-FeatureFlags-itest.js +28 -0
- package/src/private/setup/__tests__/setUpDefaultReactNativeEnvironment-Globals-IntersectionObserver-itest.js +44 -0
- package/src/private/setup/__tests__/setUpDefaultReactNativeEnvironment-Globals-MutationObserver-itest.js +44 -0
- package/src/private/setup/__tests__/setUpDefaultReactNativeEnvironment-Globals-itest.js +346 -0
- package/src/private/setup/setUpDOM.js +39 -9
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +12 -0
- package/src/private/setup/setUpIntersectionObserver.js +7 -0
- package/src/private/setup/setUpMutationObserver.js +3 -1
- package/src/private/specs_DEPRECATED/__docs__/README.md +12 -0
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +10 -10
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +26 -32
- package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +29 -29
- package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +2 -7
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +48 -24
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +44 -24
- package/src/private/specs_DEPRECATED/modules/NativeAppState.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +9 -7
- package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +8 -8
- package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +4 -3
- package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +12 -15
- package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +8 -8
- package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +5 -9
- package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +15 -15
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +10 -7
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +10 -7
- package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +7 -5
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +37 -33
- package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +26 -26
- package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSourceCode.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerAndroid.js +5 -17
- package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerIOS.js +10 -15
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +36 -23
- package/src/private/specs_DEPRECATED/modules/NativeVibration.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +9 -9
- package/src/private/styles/composeStyles.js +2 -2
- package/src/private/testing/fantom/specs/NativeCPUTime.js +24 -0
- package/src/private/testing/fantom/specs/NativeFantom.js +140 -0
- package/src/private/testing/fantom/specs/NativeFantomTestSpecificMethods.js +37 -0
- package/src/private/testing/fantom/specs/__docs__/README.md +19 -0
- package/src/private/timers/__tests__/Timers-itest.js +140 -0
- package/src/private/types/HostComponent.js +1 -1
- package/src/private/types/HostInstance.js +38 -80
- package/src/private/utilities/toError.js +27 -0
- package/src/private/utilities/toExtendedError.js +30 -0
- package/src/private/viewtransition/specs/NativeViewTransition.js +35 -0
- package/src/private/webapis/console/__tests__/consoleCreateTask-benchmark-itest.js +35 -0
- package/src/private/webapis/console/__tests__/consoleCreateTask-jsx-benchmark-itest.js +79 -0
- package/src/private/webapis/console/__tests__/no-consoleCreateTask-jsx-benchmark-itest.js +19 -0
- package/src/private/webapis/dom/abort-api/AbortController.js +92 -0
- package/src/private/webapis/dom/abort-api/AbortSignal.js +243 -0
- package/src/private/webapis/dom/abort-api/__tests__/AbortController-itest.js +466 -0
- package/src/private/webapis/dom/events/CustomEvent.js +3 -3
- package/src/private/webapis/dom/events/Event.js +22 -13
- package/src/private/webapis/dom/events/EventHandlerAttributes.js +2 -2
- package/src/private/webapis/dom/events/EventTarget.js +184 -33
- package/src/private/webapis/dom/events/__tests__/CustomEvent-itest.js +51 -0
- package/src/private/webapis/dom/events/__tests__/Event-itest.js +317 -0
- package/src/private/webapis/dom/events/__tests__/EventHandlerAttributes-itest.js +203 -0
- package/src/private/webapis/dom/events/__tests__/EventTarget-benchmark-itest.js +209 -0
- package/src/private/webapis/dom/events/__tests__/EventTarget-itest.js +1048 -0
- package/src/private/webapis/dom/events/__tests__/createEventTargetHierarchyWithDepth.js +37 -0
- package/src/private/webapis/dom/events/internals/EventInternals.js +56 -3
- package/src/private/webapis/dom/events/internals/EventTargetInternals.js +50 -3
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +11 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +127 -2
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +11 -0
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +14 -7
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +99 -3
- package/src/private/webapis/dom/nodes/ReadOnlyText.js +33 -0
- package/src/private/webapis/dom/nodes/__tests__/ReactNativeDocument-itest.js +319 -0
- package/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js +1810 -0
- package/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-traversal-benchmark-itest.js +181 -0
- package/src/private/webapis/dom/nodes/__tests__/ReadOnlyText-itest.js +462 -0
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +10 -0
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +88 -84
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +15 -3
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +7 -3
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +14 -4
- package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +8 -4
- package/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-itest.js +97 -0
- package/src/private/webapis/dom/oldstylecollections/__tests__/NodeList-itest.js +178 -0
- package/src/private/webapis/errors/DOMException.js +50 -50
- package/src/private/webapis/errors/__tests__/DOMException-itest.js +157 -0
- package/src/private/webapis/geometry/DOMRectList.js +14 -2
- package/src/private/webapis/geometry/DOMRectList.js.flow +4 -2
- package/src/private/webapis/geometry/DOMRectReadOnly.js +1 -1
- package/src/private/webapis/geometry/__tests__/DOMRectList-itest.js +102 -0
- package/src/private/webapis/html/events/MessageEvent.js +5 -5
- package/src/private/webapis/idlecallbacks/__tests__/requestIdleCallback-itest.js +172 -0
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +7 -7
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +61 -13
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +13 -0
- package/src/private/webapis/intersectionobserver/__docs__/README.md +53 -0
- package/src/private/webapis/intersectionobserver/__docs__/architecture.excalidraw.svg +5 -0
- package/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-benchmark-itest.js +449 -0
- package/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js +4295 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +10 -18
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +16 -16
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +3 -3
- package/src/private/webapis/mutationobserver/MutationObserver.js +9 -9
- package/src/private/webapis/mutationobserver/MutationRecord.js +15 -3
- package/src/private/webapis/mutationobserver/__docs__/README.md +46 -0
- package/src/private/webapis/mutationobserver/__docs__/architecture.excalidraw.svg +4 -0
- package/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js +943 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +6 -8
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +13 -13
- package/src/private/webapis/performance/EventTiming.js +3 -3
- package/src/private/webapis/performance/LongTasks.js +3 -3
- package/src/private/webapis/performance/Performance.js +5 -5
- package/src/private/webapis/performance/PerformanceEntry.js +4 -4
- package/src/private/webapis/performance/PerformanceObserver.js +6 -6
- package/src/private/webapis/performance/ResourceTiming.js +13 -13
- package/src/private/webapis/performance/UserTiming.js +4 -4
- package/src/private/webapis/performance/__tests__/EventTimingAPI-itest.js +403 -0
- package/src/private/webapis/performance/__tests__/LongTasksAPI-itest.js +207 -0
- package/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js +146 -0
- package/src/private/webapis/performance/__tests__/Performance-itest.js +77 -0
- package/src/private/webapis/performance/__tests__/PerformanceMemory-itest.js +28 -0
- package/src/private/webapis/performance/__tests__/PerformanceObserver-itest.js +127 -0
- package/src/private/webapis/performance/__tests__/UserTiming-itest.js +828 -0
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/internals/Utilities.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +34 -28
- package/src/private/webapis/structuredClone/__tests__/structuredClone-benchmark-itest.js +43 -0
- package/src/private/webapis/structuredClone/__tests__/structuredClone-itest.js +444 -0
- package/src/private/webapis/structuredClone/structuredClone.js +6 -6
- package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
- package/src/private/webapis/webidl/PlatformObjects.js +4 -4
- package/src/private/webapis/websockets/events/CloseEvent.js +3 -3
- package/src/private/webapis/xhr/events/ProgressEvent.js +3 -3
- package/src/react-private-interface.js +145 -0
- package/src/react-private-interface.js.flow +48 -0
- package/src/setup-env.js +22 -0
- package/src/types/globals.d.ts +67 -6
- package/src/unstable-internals-do-not-use.d.ts +214 -0
- package/src/unstable-internals-do-not-use.js +76 -0
- package/third-party-podspecs/RCT-Folly.podspec +2 -1
- package/third-party-podspecs/ReactNativeDependencies.podspec +2 -2
- package/third-party-podspecs/fmt.podspec +2 -2
- package/third-party-podspecs/glog.podspec +1 -0
- package/types/index.d.ts +3 -3
- package/types/public/DeprecatedPropertiesAlias.d.ts +0 -4
- package/types/public/ReactNativeTypes.d.ts +4 -2
- package/Libraries/AppDelegate/RCTArchConfiguratorProtocol.h +0 -38
- package/Libraries/Components/View/DraggedType.js +0 -23
- package/Libraries/Components/View/ReactNativeViewAttributes.js +0 -77
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.macos.js +0 -14
- package/Libraries/Image/AssetRegistry.js +0 -14
- package/Libraries/Image/RCTImageShadowView.h +0 -17
- package/Libraries/Image/RCTImageShadowView.mm +0 -28
- package/Libraries/Image/RCTImageView.h +0 -35
- package/Libraries/Image/RCTImageView.mm +0 -657
- package/Libraries/Image/RCTImageViewManager.h +0 -17
- package/Libraries/Image/RCTImageViewManager.mm +0 -119
- package/Libraries/Image/TextInlineImageNativeComponent.js +0 -49
- package/Libraries/Interaction/InteractionManager.d.ts +0 -87
- package/Libraries/Interaction/InteractionManager.js +0 -188
- package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +0 -123
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +0 -19660
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +0 -11121
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +0 -12922
- package/Libraries/Renderer/shims/ReactNative.js +0 -26
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.d.ts +0 -30
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +0 -44
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +0 -52
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.h +0 -35
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +0 -162
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.h +0 -21
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +0 -69
- package/Libraries/Text/RCTTextAttributes.h +0 -112
- package/Libraries/Text/RCTTextAttributes.mm +0 -381
- package/Libraries/Text/RCTTextUIKit.h +0 -50
- package/Libraries/Text/RawText/RCTRawTextShadowView.h +0 -23
- package/Libraries/Text/RawText/RCTRawTextShadowView.mm +0 -38
- package/Libraries/Text/RawText/RCTRawTextViewManager.h +0 -21
- package/Libraries/Text/RawText/RCTRawTextViewManager.mm +0 -32
- package/Libraries/Text/Text/RCTTextShadowView.h +0 -33
- package/Libraries/Text/Text/RCTTextShadowView.mm +0 -469
- package/Libraries/Text/Text/RCTTextView.h +0 -37
- package/Libraries/Text/Text/RCTTextView.mm +0 -571
- package/Libraries/Text/Text/RCTTextViewManager.h +0 -19
- package/Libraries/Text/Text/RCTTextViewManager.mm +0 -101
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +0 -29
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +0 -209
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h +0 -21
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +0 -42
- package/Libraries/Text/TextInput/Multiline/RCTWrappedTextView.h +0 -30
- package/Libraries/Text/TextInput/Multiline/RCTWrappedTextView.m +0 -210
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.h +0 -30
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +0 -379
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +0 -86
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -1217
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.h +0 -17
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +0 -217
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +0 -26
- package/Libraries/Text/TextInput/RCTInputAccessoryView.h +0 -22
- package/Libraries/Text/TextInput/RCTInputAccessoryView.mm +0 -82
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm +0 -78
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +0 -33
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h +0 -21
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.mm +0 -106
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h +0 -21
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +0 -37
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +0 -15
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +0 -14
- package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.h +0 -17
- package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.mm +0 -42
- package/Libraries/Text/VirtualText/RCTVirtualTextView.h +0 -28
- package/Libraries/Text/VirtualText/RCTVirtualTextView.mm +0 -16
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.h +0 -17
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +0 -30
- package/Libraries/Utilities/GlobalPerformanceLogger.js +0 -24
- package/Libraries/Utilities/IPerformanceLogger.d.ts +0 -48
- package/Libraries/Utilities/IPerformanceLogger.js +0 -49
- package/Libraries/Utilities/NativePlatformConstantsMacOS.js +0 -31
- package/Libraries/Utilities/PerformanceLoggerContext.js +0 -33
- package/Libraries/Utilities/SceneTracker.js +0 -42
- package/Libraries/Utilities/createPerformanceLogger.js +0 -329
- package/Libraries/Wrapper/Example/RCTWrapperExampleView.h +0 -21
- package/Libraries/Wrapper/Example/RCTWrapperExampleView.m +0 -57
- package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h +0 -21
- package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m +0 -27
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h +0 -29
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m +0 -50
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h +0 -23
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m +0 -35
- package/Libraries/Wrapper/RCTWrapper.h +0 -73
- package/Libraries/Wrapper/RCTWrapperShadowView.h +0 -27
- package/Libraries/Wrapper/RCTWrapperShadowView.m +0 -138
- package/Libraries/Wrapper/RCTWrapperView.h +0 -42
- package/Libraries/Wrapper/RCTWrapperView.m +0 -99
- package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.h +0 -34
- package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.m +0 -137
- package/Libraries/Wrapper/RCTWrapperViewManager.h +0 -25
- package/Libraries/Wrapper/RCTWrapperViewManager.m +0 -31
- package/React/Base/RCTFocusChangeEvent.h +0 -20
- package/React/Base/RCTFocusChangeEvent.m +0 -30
- package/React/Base/RCTRootContentView.h +0 -43
- package/React/Base/RCTRootContentView.m +0 -158
- package/React/Base/RCTRootViewInternal.h +0 -28
- package/React/Base/macOS/RCTPlatformDisplayLink.m +0 -165
- package/React/Base/macOS/RCTUIKit.m +0 -908
- package/React/CxxBridge/RCTCxxBridge.mm +0 -1585
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +0 -25
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +0 -34
- package/React/CxxBridge/RCTObjcExecutor.h +0 -34
- package/React/CxxBridge/RCTObjcExecutor.mm +0 -150
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.h +0 -16
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -35
- package/React/CxxModule/DispatchMessageQueueThread.h +0 -50
- package/React/CxxModule/RCTCxxMethod.h +0 -17
- package/React/CxxModule/RCTCxxMethod.mm +0 -147
- package/React/CxxModule/RCTCxxModule.h +0 -29
- package/React/CxxModule/RCTCxxModule.mm +0 -87
- package/React/CxxModule/RCTNativeModule.h +0 -34
- package/React/CxxModule/RCTNativeModule.mm +0 -241
- package/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h +0 -25
- package/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm +0 -325
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +0 -205
- package/React/Tests/Text/RCTTextAttributesTest.mm +0 -49
- package/React/Views/RCTActivityIndicatorView.h +0 -26
- package/React/Views/RCTActivityIndicatorView.m +0 -132
- package/React/Views/RCTActivityIndicatorViewManager.h +0 -23
- package/React/Views/RCTActivityIndicatorViewManager.m +0 -65
- package/React/Views/RCTCursor.m +0 -233
- package/React/Views/RCTDebuggingOverlayManager.h +0 -18
- package/React/Views/RCTDebuggingOverlayManager.m +0 -68
- package/React/Views/RCTHandledKey.h +0 -40
- package/React/Views/RCTHandledKey.m +0 -139
- package/React/Views/RCTModalHostView.h +0 -64
- package/React/Views/RCTModalHostView.m +0 -260
- package/React/Views/RCTModalHostViewController.m +0 -80
- package/React/Views/RCTModalHostViewManager.m +0 -133
- package/React/Views/RCTModalManager.h +0 -22
- package/React/Views/RCTModalManager.m +0 -46
- package/React/Views/RCTRootShadowView.h +0 -35
- package/React/Views/RCTRootShadowView.m +0 -53
- package/React/Views/RCTShadowView+Internal.h +0 -18
- package/React/Views/RCTShadowView+Internal.m +0 -23
- package/React/Views/RCTSwitch.h +0 -22
- package/React/Views/RCTSwitch.m +0 -24
- package/React/Views/RCTSwitchManager.h +0 -17
- package/React/Views/RCTSwitchManager.m +0 -77
- package/React/Views/RCTViewKeyboardEvent.h +0 -17
- package/React/Views/RCTViewKeyboardEvent.m +0 -109
- package/React/Views/RefreshControl/RCTRefreshControl.h +0 -26
- package/React/Views/RefreshControl/RCTRefreshControl.m +0 -232
- package/React/Views/RefreshControl/RCTRefreshControlManager.h +0 -17
- package/React/Views/RefreshControl/RCTRefreshControlManager.m +0 -49
- package/React/Views/SafeAreaView/RCTSafeAreaShadowView.h +0 -21
- package/React/Views/SafeAreaView/RCTSafeAreaShadowView.m +0 -57
- package/React/Views/SafeAreaView/RCTSafeAreaView.h +0 -27
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +0 -83
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +0 -25
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m +0 -25
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.h +0 -21
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +0 -34
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +0 -27
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +0 -26
- package/React/Views/ScrollView/RCTScrollContentShadowView.h +0 -19
- package/React/Views/ScrollView/RCTScrollContentShadowView.m +0 -53
- package/React/Views/ScrollView/RCTScrollContentView.h +0 -23
- package/React/Views/ScrollView/RCTScrollContentView.m +0 -81
- package/React/Views/ScrollView/RCTScrollContentViewManager.h +0 -17
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +0 -33
- package/React/Views/ScrollView/RCTScrollView.m +0 -1533
- package/React/Views/ScrollView/RCTScrollViewManager.h +0 -28
- package/React/Views/ScrollView/RCTScrollViewManager.m +0 -214
- package/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.kt +0 -146
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +0 -251
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +0 -315
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CallbackImpl.kt +0 -45
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +0 -710
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapper.kt +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapperBase.kt +0 -61
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.kt +0 -427
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener.kt +0 -36
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/OnBatchCompleteListener.kt +0 -21
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.kt +0 -54
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactInstanceManagerInspectorTarget.kt +0 -78
- package/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +0 -51
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.kt +0 -105
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/TracingState.kt +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/TracingStateProvider.kt +0 -12
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +0 -1410
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobCollector.kt +0 -31
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DidJSUpdateUiDuringFrameDetector.kt +0 -157
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +0 -714
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java +0 -985
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt +0 -32
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -904
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +0 -485
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -403
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -1008
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -848
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -1092
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +0 -111
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +0 -614
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.kt +0 -30
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherImpl.kt +0 -336
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventEmitterImpl.kt +0 -135
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.kt +0 -87
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationListener.kt +0 -23
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.kt +0 -81
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerLegacyView.kt +0 -47
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +0 -1783
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +0 -1605
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchShadowNode.kt +0 -72
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.kt +0 -677
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.kt +0 -218
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.kt +0 -369
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode.kt +0 -156
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.kt +0 -174
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.kt +0 -54
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.kt +0 -30
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextInlineImageSpan.kt +0 -58
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.kt +0 -228
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt +0 -314
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager.kt +0 -110
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +0 -47
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.java +0 -62
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.java +0 -31
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDirection.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +0 -47
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +0 -41
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +0 -31
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +0 -41
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +0 -45
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java +0 -279
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +0 -827
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.java +0 -197
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java +0 -43
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java +0 -35
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +0 -428
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +0 -118
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapper.h +0 -37
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +0 -20
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +0 -22
- package/ReactAndroid/src/main/jni/react/jni/ReactInstanceManagerInspectorTarget.cpp +0 -175
- package/ReactAndroid/src/main/jni/react/jni/ReactInstanceManagerInspectorTarget.h +0 -75
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +0 -136
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +0 -72
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +0 -143
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +0 -55
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +0 -37
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +0 -39
- package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +0 -148
- package/ReactCommon/jsi/jsi/hermes.h +0 -189
- package/ReactCommon/jsinspector-modern/Base64.h +0 -99
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingStateSerializer.cpp +0 -68
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingStateSerializer.h +0 -42
- package/ReactCommon/jsinspector-modern/tracing/TracingState.h +0 -24
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboCxxModule.cpp +0 -212
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboCxxModule.h +0 -40
- package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +0 -147
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +0 -416
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +0 -31
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +0 -71
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +0 -280
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +0 -35
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +0 -177
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.mm +0 -11
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +0 -44
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +0 -222
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.cpp +0 -14
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformTouch.h +0 -16
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +0 -197
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.h +0 -50
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEvents.h +0 -81
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.cpp +0 -160
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.h +0 -58
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +0 -30
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/KeyEvent.h +0 -137
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/MouseEvent.h +0 -83
- package/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h +0 -19
- package/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalShadowNode.h +0 -38
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +0 -72
- package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -40
- package/ReactCommon/react/renderer/graphics/DoubleConversions.cpp +0 -38
- package/ReactCommon/react/renderer/graphics/DoubleConversions.h +0 -16
- package/ReactCommon/react/renderer/mounting/internal/TinyMap.h +0 -147
- package/interface.js +0 -21
- package/jest/MockNativeMethods.js +0 -27
- package/jest/RefreshControlMock.js +0 -32
- package/jest/assetFileTransformer.js +0 -33
- package/jest/local-setup.js +0 -29
- package/jest/mock.js +0 -39
- package/jest/mockComponent.js +0 -104
- package/jest/mockNativeComponent.js +0 -52
- package/jest/mocks/AccessibilityInfo.js +0 -67
- package/jest/mocks/ActivityIndicator.js +0 -23
- package/jest/mocks/AppState.js +0 -19
- package/jest/mocks/Clipboard.js +0 -16
- package/jest/mocks/Image.js +0 -23
- package/jest/mocks/InitializeCore.js +0 -9
- package/jest/mocks/Linking.js +0 -28
- package/jest/mocks/Modal.js +0 -33
- package/jest/mocks/NativeComponentRegistry.js +0 -30
- package/jest/mocks/NativeModules.js +0 -239
- package/jest/mocks/RefreshControl.js +0 -31
- package/jest/mocks/RendererProxy.js +0 -45
- package/jest/mocks/ScrollView.js +0 -58
- package/jest/mocks/Text.js +0 -27
- package/jest/mocks/TextInput.js +0 -32
- package/jest/mocks/UIManager.js +0 -60
- package/jest/mocks/Vibration.js +0 -16
- package/jest/mocks/View.js +0 -27
- package/jest/mocks/ViewNativeComponent.js +0 -23
- package/jest/mocks/requireNativeComponent.js +0 -22
- package/jest/mocks/useColorScheme.js +0 -18
- package/jest/react-native-env.js +0 -17
- package/jest/renderer.js +0 -40
- package/jest/resolver.js +0 -32
- package/jest/setup.js +0 -140
- package/jest-preset.js +0 -30
- package/local-cli/cli.js +0 -18
- package/local-cli/generate-macos.js +0 -36
- package/local-cli/generator-common/index.js +0 -385
- package/local-cli/generator-macos/index.js +0 -135
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/AppDelegate.h +0 -6
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/AppDelegate.mm +0 -47
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -58
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/Assets.xcassets/Contents.json +0 -6
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/Base.lproj/Main.storyboard +0 -684
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/HelloWorld.entitlements +0 -12
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/Info.plist +0 -47
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/main.m +0 -5
- package/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj +0 -536
- package/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-iOS.xcscheme +0 -78
- package/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-macOS.xcscheme +0 -78
- package/local-cli/generator-macos/templates/macos/Podfile +0 -28
- package/local-cli/generator-macos/templates/macos/_gitignore +0 -2
- package/local-cli/runMacOS/runMacOS.js +0 -387
- package/rn-get-polyfills.js +0 -13
- package/sdks/.hermesversion +0 -1
- package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +0 -628
- package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +0 -66
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +0 -56
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +0 -124
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +0 -27
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +0 -74
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +0 -65
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +0 -62
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +0 -39
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +0 -74
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +0 -29
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +0 -156
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +0 -28
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +0 -62
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +0 -26
- package/third-party-podspecs/SocketRocket.podspec +0 -30
- package/types/tsconfig.json +0 -15
- /package/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental → VirtualView}/RCTVirtualViewMode.h +0 -0
- /package/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental → VirtualView}/RCTVirtualViewRenderState.h +0 -0
- /package/ReactAndroid/src/main/java/com/facebook/react/fabric/internal/interop/{InteropUiBlockListener.kt → InteropUIBlockListener.kt} +0 -0
- /package/ReactCommon/react/renderer/components/scrollview/{RCTComponentViewHelpers.h → platform/ios/react/renderer/components/scrollview/RCTComponentViewHelpers.h} +0 -0
- /package/ReactCommon/{cxxreact → react/utils}/MoveWrapper.h +0 -0
|
@@ -0,0 +1,4295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
|
|
12
|
+
|
|
13
|
+
import type {HostInstance} from 'react-native';
|
|
14
|
+
import type IntersectionObserverType from 'react-native/src/private/webapis/intersectionobserver/IntersectionObserver';
|
|
15
|
+
import type IntersectionObserverEntryType from 'react-native/src/private/webapis/intersectionobserver/IntersectionObserverEntry';
|
|
16
|
+
|
|
17
|
+
import ensureInstance from '../../../__tests__/utilities/ensureInstance';
|
|
18
|
+
import {createShadowNodeReferenceCountingRef} from '../../../__tests__/utilities/ShadowNodeReferenceCounter';
|
|
19
|
+
import * as Fantom from '@react-native/fantom';
|
|
20
|
+
import * as React from 'react';
|
|
21
|
+
import {createRef, useState} from 'react';
|
|
22
|
+
import {ScrollView, View} from 'react-native';
|
|
23
|
+
import setUpIntersectionObserver from 'react-native/src/private/setup/setUpIntersectionObserver';
|
|
24
|
+
import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement';
|
|
25
|
+
import DOMRectReadOnly from 'react-native/src/private/webapis/geometry/DOMRectReadOnly';
|
|
26
|
+
|
|
27
|
+
declare const IntersectionObserver: Class<IntersectionObserverType>;
|
|
28
|
+
declare const IntersectionObserverEntry: Class<IntersectionObserverEntryType>;
|
|
29
|
+
|
|
30
|
+
setUpIntersectionObserver();
|
|
31
|
+
|
|
32
|
+
function ensureReactNativeElement(value: unknown): ReactNativeElement {
|
|
33
|
+
return ensureInstance(value, ReactNativeElement);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function expectRectEquals(
|
|
37
|
+
rect: DOMRectReadOnly,
|
|
38
|
+
expected: {x: number, y: number, width: number, height: number},
|
|
39
|
+
): boolean {
|
|
40
|
+
const {x, y, width, height} = expected;
|
|
41
|
+
if (
|
|
42
|
+
!(
|
|
43
|
+
rect.x === x &&
|
|
44
|
+
rect.y === y &&
|
|
45
|
+
rect.width === width &&
|
|
46
|
+
rect.height === height
|
|
47
|
+
)
|
|
48
|
+
) {
|
|
49
|
+
const received = {
|
|
50
|
+
x: rect.x,
|
|
51
|
+
y: rect.y,
|
|
52
|
+
width: rect.width,
|
|
53
|
+
height: rect.height,
|
|
54
|
+
};
|
|
55
|
+
throw new Error(
|
|
56
|
+
`Expected ${JSON.stringify(expected)} but received ${JSON.stringify(received)}`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
describe('IntersectionObserver', () => {
|
|
63
|
+
let observer: IntersectionObserver;
|
|
64
|
+
|
|
65
|
+
afterEach(() => {
|
|
66
|
+
Fantom.runTask(() => {
|
|
67
|
+
if (observer != null) {
|
|
68
|
+
observer.disconnect();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('constructor(callback, {root, rootMargin, threshold, rnRootThreshold})', () => {
|
|
74
|
+
it('should throw if `callback` is not provided', () => {
|
|
75
|
+
expect(() => {
|
|
76
|
+
// $FlowExpectedError[incompatible-type]
|
|
77
|
+
return new IntersectionObserver();
|
|
78
|
+
}).toThrow(
|
|
79
|
+
"Failed to construct 'IntersectionObserver': 1 argument required, but only 0 present.",
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should throw if `callback` is not a function', () => {
|
|
84
|
+
expect(() => {
|
|
85
|
+
// $FlowExpectedError[incompatible-type]
|
|
86
|
+
return new IntersectionObserver('not a function!');
|
|
87
|
+
}).toThrow(
|
|
88
|
+
"Failed to construct 'IntersectionObserver': parameter 1 is not of type 'Function'.",
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should accept valid `rootMargin` values', () => {
|
|
93
|
+
expect(() => {
|
|
94
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
95
|
+
return new IntersectionObserver(() => {}, {rootMargin: '10px'});
|
|
96
|
+
}).not.toThrow();
|
|
97
|
+
|
|
98
|
+
expect(() => {
|
|
99
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
100
|
+
return new IntersectionObserver(() => {}, {rootMargin: '10px 20px'});
|
|
101
|
+
}).not.toThrow();
|
|
102
|
+
|
|
103
|
+
expect(() => {
|
|
104
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
105
|
+
return new IntersectionObserver(() => {}, {
|
|
106
|
+
rootMargin: '10px 20px 30px 40px',
|
|
107
|
+
});
|
|
108
|
+
}).not.toThrow();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe('rootMargin', () => {
|
|
112
|
+
it('should parse single value rootMargin', () => {
|
|
113
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
114
|
+
observer = new IntersectionObserver(() => {}, {rootMargin: '10px'});
|
|
115
|
+
expect(observer.rootMargin).toBe('10px 10px 10px 10px');
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('should parse two value rootMargin', () => {
|
|
119
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
120
|
+
observer = new IntersectionObserver(() => {}, {
|
|
121
|
+
rootMargin: '10px 20px',
|
|
122
|
+
});
|
|
123
|
+
expect(observer.rootMargin).toBe('10px 20px 10px 20px');
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should parse three value rootMargin', () => {
|
|
127
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
128
|
+
observer = new IntersectionObserver(() => {}, {
|
|
129
|
+
rootMargin: '10px 20px 30px',
|
|
130
|
+
});
|
|
131
|
+
expect(observer.rootMargin).toBe('10px 20px 30px 20px');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should parse four value rootMargin', () => {
|
|
135
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
136
|
+
observer = new IntersectionObserver(() => {}, {
|
|
137
|
+
rootMargin: '10px 20px 30px 40px',
|
|
138
|
+
});
|
|
139
|
+
expect(observer.rootMargin).toBe('10px 20px 30px 40px');
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('should handle negative rootMargin values', () => {
|
|
143
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
144
|
+
observer = new IntersectionObserver(() => {}, {
|
|
145
|
+
rootMargin: '-10px -20px',
|
|
146
|
+
});
|
|
147
|
+
expect(observer.rootMargin).toBe('-10px -20px -10px -20px');
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('should handle percentage rootMargin values', () => {
|
|
151
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
152
|
+
observer = new IntersectionObserver(() => {}, {
|
|
153
|
+
rootMargin: '10% 20%',
|
|
154
|
+
});
|
|
155
|
+
expect(observer.rootMargin).toBe('10% 20% 10% 20%');
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('default values', () => {
|
|
159
|
+
it('should default to "0px 0px 0px 0px" when rootMargin is not provided', () => {
|
|
160
|
+
observer = new IntersectionObserver(() => {});
|
|
161
|
+
expect(observer.rootMargin).toBe('0px 0px 0px 0px');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('should default to "0px 0px 0px 0px" when rootMargin is undefined', () => {
|
|
165
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
166
|
+
observer = new IntersectionObserver(() => {}, {
|
|
167
|
+
rootMargin: undefined,
|
|
168
|
+
});
|
|
169
|
+
expect(observer.rootMargin).toBe('0px 0px 0px 0px');
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('should default to "0px 0px 0px 0px" when rootMargin is empty string', () => {
|
|
173
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
174
|
+
observer = new IntersectionObserver(() => {}, {rootMargin: ''});
|
|
175
|
+
expect(observer.rootMargin).toBe('0px 0px 0px 0px');
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
describe('parsing failures', () => {
|
|
180
|
+
it('should throw when rootMargin is not a string', () => {
|
|
181
|
+
expect(() => {
|
|
182
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
183
|
+
// $FlowExpectedError[incompatible-type]
|
|
184
|
+
return new IntersectionObserver(() => {}, {rootMargin: 123});
|
|
185
|
+
}).toThrow(
|
|
186
|
+
"Failed to construct 'IntersectionObserver': Failed to read the 'rootMargin' property from 'IntersectionObserverInit': The provided value is not of type 'string'.",
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('should throw when rootMargin has too many values', () => {
|
|
191
|
+
expect(() => {
|
|
192
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
193
|
+
return new IntersectionObserver(() => {}, {
|
|
194
|
+
rootMargin: '10px 20px 30px 40px 50px',
|
|
195
|
+
});
|
|
196
|
+
}).toThrow(
|
|
197
|
+
"Failed to construct 'IntersectionObserver': Failed to parse rootMargin: Too many values (expected 1-4).",
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('should throw when rootMargin value is missing unit', () => {
|
|
202
|
+
expect(() => {
|
|
203
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
204
|
+
return new IntersectionObserver(() => {}, {rootMargin: '10'});
|
|
205
|
+
}).toThrow(
|
|
206
|
+
"Failed to construct 'IntersectionObserver': Failed to parse rootMargin: '10' is not a valid length. Only 'px' and '%' units are allowed.",
|
|
207
|
+
);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('should throw when rootMargin value has invalid unit', () => {
|
|
211
|
+
expect(() => {
|
|
212
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
213
|
+
return new IntersectionObserver(() => {}, {rootMargin: '10em'});
|
|
214
|
+
}).toThrow(
|
|
215
|
+
"Failed to construct 'IntersectionObserver': Failed to parse rootMargin: '10em' is not a valid length. Only 'px' and '%' units are allowed.",
|
|
216
|
+
);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('should throw when rootMargin value has invalid format', () => {
|
|
220
|
+
expect(() => {
|
|
221
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
222
|
+
return new IntersectionObserver(() => {}, {
|
|
223
|
+
rootMargin: 'invalid',
|
|
224
|
+
});
|
|
225
|
+
}).toThrow(
|
|
226
|
+
"Failed to construct 'IntersectionObserver': Failed to parse rootMargin: 'invalid' is not a valid length. Only 'px' and '%' units are allowed.",
|
|
227
|
+
);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it('should throw when rootMargin has mixed valid and invalid values', () => {
|
|
231
|
+
expect(() => {
|
|
232
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
233
|
+
return new IntersectionObserver(() => {}, {
|
|
234
|
+
rootMargin: '10px invalid',
|
|
235
|
+
});
|
|
236
|
+
}).toThrow(
|
|
237
|
+
"Failed to construct 'IntersectionObserver': Failed to parse rootMargin: 'invalid' is not a valid length. Only 'px' and '%' units are allowed.",
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('should throw when rootMargin value is only a unit', () => {
|
|
242
|
+
expect(() => {
|
|
243
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
244
|
+
return new IntersectionObserver(() => {}, {rootMargin: 'px'});
|
|
245
|
+
}).toThrow(
|
|
246
|
+
"Failed to construct 'IntersectionObserver': Failed to parse rootMargin: 'px' is not a valid length. Only 'px' and '%' units are allowed.",
|
|
247
|
+
);
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('should throw if `threshold` contains a value lower than 0 or greater than 1', () => {
|
|
253
|
+
expect(() => {
|
|
254
|
+
return new IntersectionObserver(() => {}, {threshold: 1.01});
|
|
255
|
+
}).toThrow(
|
|
256
|
+
"Failed to construct 'IntersectionObserver': Threshold values must be numbers between 0 and 1",
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
expect(() => {
|
|
260
|
+
return new IntersectionObserver(() => {}, {threshold: -0.01});
|
|
261
|
+
}).toThrow(
|
|
262
|
+
"Failed to construct 'IntersectionObserver': Threshold values must be numbers between 0 and 1",
|
|
263
|
+
);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('should throw if `threshold` contains a value that cannot be casted to a finite number', () => {
|
|
267
|
+
expect(() => {
|
|
268
|
+
// $FlowExpectedError[incompatible-type]
|
|
269
|
+
return new IntersectionObserver(() => {}, {threshold: ['test']});
|
|
270
|
+
}).toThrow(
|
|
271
|
+
"Failed to read the 'threshold' property from 'IntersectionObserverInit': The provided double value is non-finite.",
|
|
272
|
+
);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it('should throw if `root` is not a `ReactNativeElement`', () => {
|
|
276
|
+
expect(() => {
|
|
277
|
+
// $FlowExpectedError[incompatible-type]
|
|
278
|
+
observer = new IntersectionObserver(() => {}, {root: 'something'});
|
|
279
|
+
}).toThrow(
|
|
280
|
+
"Failed to construct 'IntersectionObserver': Failed to read the 'root' property from 'IntersectionObserverInit': The provided value is not of type '(null or ReactNativeElement)",
|
|
281
|
+
);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('should provide access to explicit `root`', () => {
|
|
285
|
+
const rootRef = React.createRef<HostInstance>();
|
|
286
|
+
|
|
287
|
+
const root = Fantom.createRoot();
|
|
288
|
+
Fantom.runTask(() => {
|
|
289
|
+
root.render(<View ref={rootRef} />);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
const rootNode = ensureReactNativeElement(rootRef.current);
|
|
293
|
+
|
|
294
|
+
Fantom.runTask(() => {
|
|
295
|
+
observer = new IntersectionObserver(() => {}, {root: rootNode});
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
expect(observer?.root).toBe(rootNode);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
it('should provide access to `root`, `rootMargin` and `thresholds`', () => {
|
|
302
|
+
observer = new IntersectionObserver(() => {});
|
|
303
|
+
|
|
304
|
+
expect(observer.root).toBe(null);
|
|
305
|
+
expect(observer.rootMargin).toBe('0px 0px 0px 0px');
|
|
306
|
+
expect(observer.thresholds).toEqual([0]);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
it('should normalize `threshold` values', () => {
|
|
310
|
+
// Sets default value
|
|
311
|
+
expect(new IntersectionObserver(() => {}).thresholds).toEqual([0]);
|
|
312
|
+
// Sets default value
|
|
313
|
+
expect(
|
|
314
|
+
new IntersectionObserver(() => {}, {threshold: []}).thresholds,
|
|
315
|
+
).toEqual([0]);
|
|
316
|
+
|
|
317
|
+
// Converts to array
|
|
318
|
+
expect(
|
|
319
|
+
new IntersectionObserver(() => {}, {threshold: 0.5}).thresholds,
|
|
320
|
+
).toEqual([0.5]);
|
|
321
|
+
|
|
322
|
+
// Sorts
|
|
323
|
+
expect(
|
|
324
|
+
new IntersectionObserver(() => {}, {threshold: [0.5, 0, 1]}).thresholds,
|
|
325
|
+
).toEqual([0, 0.5, 1]);
|
|
326
|
+
|
|
327
|
+
// Does NOT deduplicate (browsers don't do it - shrug)
|
|
328
|
+
expect(
|
|
329
|
+
new IntersectionObserver(() => {}, {threshold: [0.5, 0.5, 0.5]})
|
|
330
|
+
.thresholds,
|
|
331
|
+
).toEqual([0.5, 0.5, 0.5]);
|
|
332
|
+
|
|
333
|
+
// Casts to number
|
|
334
|
+
expect(
|
|
335
|
+
// $FlowExpectedError[incompatible-type]
|
|
336
|
+
new IntersectionObserver(() => {}, {threshold: [true]}).thresholds,
|
|
337
|
+
).toEqual([1]);
|
|
338
|
+
expect(
|
|
339
|
+
// $FlowExpectedError[incompatible-type]
|
|
340
|
+
new IntersectionObserver(() => {}, {threshold: [false]}).thresholds,
|
|
341
|
+
).toEqual([0]);
|
|
342
|
+
expect(
|
|
343
|
+
// $FlowExpectedError[incompatible-type]
|
|
344
|
+
new IntersectionObserver(() => {}, {threshold: ['']}).thresholds,
|
|
345
|
+
).toEqual([0]);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it('should not throw if rnRootThreshold is null or undefined', () => {
|
|
349
|
+
expect(() => {
|
|
350
|
+
// $FlowExpectedError[incompatible-type]
|
|
351
|
+
return new IntersectionObserver(() => {}, {rnRootThreshold: null});
|
|
352
|
+
}).not.toThrow();
|
|
353
|
+
|
|
354
|
+
expect(() => {
|
|
355
|
+
return new IntersectionObserver(() => {}, {
|
|
356
|
+
rnRootThreshold: undefined,
|
|
357
|
+
});
|
|
358
|
+
}).not.toThrow();
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it('should throw if rnRootThreshold is set to an invalid value', () => {
|
|
362
|
+
expect(() => {
|
|
363
|
+
return new IntersectionObserver(() => {}, {
|
|
364
|
+
// $FlowExpectedError[incompatible-call]
|
|
365
|
+
rnRootThreshold: 2,
|
|
366
|
+
});
|
|
367
|
+
}).toThrow(
|
|
368
|
+
"Failed to construct 'IntersectionObserver': Threshold values must be numbers between 0 and 1",
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
expect(() => {
|
|
372
|
+
return new IntersectionObserver(() => {}, {
|
|
373
|
+
// $FlowExpectedError[incompatible-type]
|
|
374
|
+
rnRootThreshold: 'invalid',
|
|
375
|
+
});
|
|
376
|
+
}).toThrow(
|
|
377
|
+
"Failed to read the 'rnRootThreshold' property from 'IntersectionObserverInit': The provided double value is non-finite.",
|
|
378
|
+
);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it('should default to null if rnRootThreshold is not set or invalid', () => {
|
|
382
|
+
expect(
|
|
383
|
+
new IntersectionObserver(() => {}, {}).rnRootThresholds,
|
|
384
|
+
).toBeNull();
|
|
385
|
+
|
|
386
|
+
expect(
|
|
387
|
+
new IntersectionObserver(() => {}, {threshold: 1}).rnRootThresholds,
|
|
388
|
+
).toBeNull();
|
|
389
|
+
expect(
|
|
390
|
+
// $FlowExpectedError[incompatible-type]
|
|
391
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: null})
|
|
392
|
+
.rnRootThresholds,
|
|
393
|
+
).toBeNull();
|
|
394
|
+
|
|
395
|
+
expect(
|
|
396
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: undefined})
|
|
397
|
+
.rnRootThresholds,
|
|
398
|
+
).toBeNull();
|
|
399
|
+
|
|
400
|
+
expect(
|
|
401
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: []})
|
|
402
|
+
.rnRootThresholds,
|
|
403
|
+
).toBeNull();
|
|
404
|
+
|
|
405
|
+
expect(
|
|
406
|
+
// $FlowExpectedError[incompatible-type]
|
|
407
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: [null]})
|
|
408
|
+
.rnRootThresholds,
|
|
409
|
+
).toBeNull();
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
it('should normalize `rnRootThreshold` values', () => {
|
|
413
|
+
// Sets default value
|
|
414
|
+
expect(new IntersectionObserver(() => {}).rnRootThresholds).toBeNull();
|
|
415
|
+
// Sets default value
|
|
416
|
+
expect(
|
|
417
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: []})
|
|
418
|
+
.rnRootThresholds,
|
|
419
|
+
).toBeNull();
|
|
420
|
+
|
|
421
|
+
// Converts to array
|
|
422
|
+
expect(
|
|
423
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: 0.5})
|
|
424
|
+
.rnRootThresholds,
|
|
425
|
+
).toEqual([0.5]);
|
|
426
|
+
|
|
427
|
+
// Sorts
|
|
428
|
+
expect(
|
|
429
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: [0.5, 0, 1]})
|
|
430
|
+
.rnRootThresholds,
|
|
431
|
+
).toEqual([0, 0.5, 1]);
|
|
432
|
+
|
|
433
|
+
// Does NOT deduplicate (browsers don't do it - shrug)
|
|
434
|
+
expect(
|
|
435
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: [0.5, 0.5, 0.5]})
|
|
436
|
+
.rnRootThresholds,
|
|
437
|
+
).toEqual([0.5, 0.5, 0.5]);
|
|
438
|
+
|
|
439
|
+
// Casts to number
|
|
440
|
+
expect(
|
|
441
|
+
// $FlowExpectedError[incompatible-type]
|
|
442
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: [true]})
|
|
443
|
+
.rnRootThresholds,
|
|
444
|
+
).toEqual([1]);
|
|
445
|
+
expect(
|
|
446
|
+
// $FlowExpectedError[incompatible-type]
|
|
447
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: [false]})
|
|
448
|
+
.rnRootThresholds,
|
|
449
|
+
).toEqual([0]);
|
|
450
|
+
expect(
|
|
451
|
+
// $FlowExpectedError[incompatible-type]
|
|
452
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: ['']})
|
|
453
|
+
.rnRootThresholds,
|
|
454
|
+
).toEqual([0]);
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it('should default thresholds to empty if rnRootThreshold is validly', () => {
|
|
458
|
+
expect(
|
|
459
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: 0.5}).thresholds,
|
|
460
|
+
).toEqual([]);
|
|
461
|
+
|
|
462
|
+
expect(
|
|
463
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: [1]}).thresholds,
|
|
464
|
+
).toEqual([]);
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
it('should default thresholds to [0] if rnRootThreshold is invalidly set', () => {
|
|
468
|
+
expect(
|
|
469
|
+
// $FlowExpectedError[incompatible-type]
|
|
470
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: null}).thresholds,
|
|
471
|
+
).toEqual([0]);
|
|
472
|
+
|
|
473
|
+
expect(
|
|
474
|
+
new IntersectionObserver(() => {}, {rnRootThreshold: []}).thresholds,
|
|
475
|
+
).toEqual([0]);
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
describe('unsupported options', () => {
|
|
479
|
+
it('should throw if `delay` option is specified', () => {
|
|
480
|
+
expect(() => {
|
|
481
|
+
// $FlowExpectedError[prop-missing] delay is not defined in Flow.
|
|
482
|
+
return new IntersectionObserver(() => {}, {delay: 100});
|
|
483
|
+
}).toThrow(
|
|
484
|
+
"Failed to construct 'IntersectionObserver': The 'delay' option is not supported.",
|
|
485
|
+
);
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
it('should throw if `scrollMargin` option is specified', () => {
|
|
489
|
+
expect(() => {
|
|
490
|
+
// $FlowExpectedError[prop-missing] scrollMargin is not defined in Flow.
|
|
491
|
+
return new IntersectionObserver(() => {}, {scrollMargin: '10px'});
|
|
492
|
+
}).toThrow(
|
|
493
|
+
"Failed to construct 'IntersectionObserver': The 'scrollMargin' option is not supported.",
|
|
494
|
+
);
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
it('should throw if `trackVisibility` option is specified', () => {
|
|
498
|
+
expect(() => {
|
|
499
|
+
// $FlowExpectedError[prop-missing] trackVisibility is not defined in Flow.
|
|
500
|
+
return new IntersectionObserver(() => {}, {trackVisibility: true});
|
|
501
|
+
}).toThrow(
|
|
502
|
+
"Failed to construct 'IntersectionObserver': The 'trackVisibility' option is not supported.",
|
|
503
|
+
);
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
it('should throw if `delay` option is set to undefined explicitly', () => {
|
|
507
|
+
expect(() => {
|
|
508
|
+
// $FlowExpectedError[prop-missing] delay is not defined in Flow.
|
|
509
|
+
return new IntersectionObserver(() => {}, {delay: undefined});
|
|
510
|
+
}).toThrow(
|
|
511
|
+
"Failed to construct 'IntersectionObserver': The 'delay' option is not supported.",
|
|
512
|
+
);
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
it('should throw if `scrollMargin` option is set to null explicitly', () => {
|
|
516
|
+
expect(() => {
|
|
517
|
+
// $FlowExpectedError[prop-missing] scrollMargin is not defined in Flow.
|
|
518
|
+
return new IntersectionObserver(() => {}, {scrollMargin: null});
|
|
519
|
+
}).toThrow(
|
|
520
|
+
"Failed to construct 'IntersectionObserver': The 'scrollMargin' option is not supported.",
|
|
521
|
+
);
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
it('should not throw when unsupported options are not specified', () => {
|
|
525
|
+
expect(() => {
|
|
526
|
+
return new IntersectionObserver(() => {}, {
|
|
527
|
+
threshold: 0.5,
|
|
528
|
+
rootMargin: '10px',
|
|
529
|
+
});
|
|
530
|
+
}).not.toThrow();
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
it('should throw if multiple unsupported options are specified', () => {
|
|
534
|
+
expect(() => {
|
|
535
|
+
// $FlowExpectedError[prop-missing] delay and trackVisibility are not defined in Flow.
|
|
536
|
+
return new IntersectionObserver(() => {}, {
|
|
537
|
+
delay: 100,
|
|
538
|
+
trackVisibility: true,
|
|
539
|
+
});
|
|
540
|
+
}).toThrow(
|
|
541
|
+
"Failed to construct 'IntersectionObserver': The 'delay' option is not supported.",
|
|
542
|
+
);
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
describe('unsupported property getters', () => {
|
|
547
|
+
it('should throw when accessing delay getter', () => {
|
|
548
|
+
observer = new IntersectionObserver(() => {});
|
|
549
|
+
expect(() => {
|
|
550
|
+
return observer.delay;
|
|
551
|
+
}).toThrow(
|
|
552
|
+
"Failed to read the 'delay' property from 'IntersectionObserver': This property is not supported.",
|
|
553
|
+
);
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
it('should throw when accessing scrollMargin getter', () => {
|
|
557
|
+
observer = new IntersectionObserver(() => {});
|
|
558
|
+
expect(() => {
|
|
559
|
+
return observer.scrollMargin;
|
|
560
|
+
}).toThrow(
|
|
561
|
+
"Failed to read the 'scrollMargin' property from 'IntersectionObserver': This property is not supported.",
|
|
562
|
+
);
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
it('should throw when accessing trackVisibility getter', () => {
|
|
566
|
+
observer = new IntersectionObserver(() => {});
|
|
567
|
+
expect(() => {
|
|
568
|
+
return observer.trackVisibility;
|
|
569
|
+
}).toThrow(
|
|
570
|
+
"Failed to read the 'trackVisibility' property from 'IntersectionObserver': This property is not supported.",
|
|
571
|
+
);
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
describe('observe(target)', () => {
|
|
577
|
+
it('should throw if `target` is not a `ReactNativeElement`', () => {
|
|
578
|
+
observer = new IntersectionObserver(() => {});
|
|
579
|
+
expect(() => {
|
|
580
|
+
// $FlowExpectedError[incompatible-type]
|
|
581
|
+
observer.observe('something');
|
|
582
|
+
}).toThrow(
|
|
583
|
+
"Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.",
|
|
584
|
+
);
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
it('should start observing the target when called for the first time (using normalized thresholds)', () => {
|
|
588
|
+
const nodeRef = createRef<HostInstance>();
|
|
589
|
+
const root = Fantom.createRoot({
|
|
590
|
+
viewportWidth: 1000,
|
|
591
|
+
viewportHeight: 1000,
|
|
592
|
+
});
|
|
593
|
+
Fantom.runTask(() => {
|
|
594
|
+
root.render(<View style={{width: 100, height: 100}} ref={nodeRef} />);
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
598
|
+
|
|
599
|
+
const intersectionObserverCallback = jest.fn();
|
|
600
|
+
|
|
601
|
+
Fantom.runTask(() => {
|
|
602
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
603
|
+
threshold: [1, 0.5, 0],
|
|
604
|
+
});
|
|
605
|
+
observer.observe(node);
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
expect(observer.thresholds).toEqual([0, 0.5, 1]);
|
|
609
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
610
|
+
const [entries, reportedObserver] =
|
|
611
|
+
intersectionObserverCallback.mock.lastCall;
|
|
612
|
+
expect(entries.length).toBe(1);
|
|
613
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
614
|
+
|
|
615
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
616
|
+
x: 0,
|
|
617
|
+
y: 0,
|
|
618
|
+
width: 100,
|
|
619
|
+
height: 100,
|
|
620
|
+
});
|
|
621
|
+
expect(entries[0].target).toBe(node);
|
|
622
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
623
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
624
|
+
x: 0,
|
|
625
|
+
y: 0,
|
|
626
|
+
width: 100,
|
|
627
|
+
height: 100,
|
|
628
|
+
});
|
|
629
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
630
|
+
x: 0,
|
|
631
|
+
y: 0,
|
|
632
|
+
width: 1000,
|
|
633
|
+
height: 1000,
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
expect(reportedObserver).toBe(observer);
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
it('should ignore subsequent calls to observe a target already being observed', () => {
|
|
640
|
+
const nodeRef = createRef<HostInstance>();
|
|
641
|
+
|
|
642
|
+
const root = Fantom.createRoot();
|
|
643
|
+
Fantom.runTask(() => {
|
|
644
|
+
root.render(<View style={{width: 100, height: 100}} ref={nodeRef} />);
|
|
645
|
+
});
|
|
646
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
647
|
+
|
|
648
|
+
const intersectionObserverCallback = jest.fn();
|
|
649
|
+
|
|
650
|
+
// Let observer to run
|
|
651
|
+
Fantom.runTask(() => {
|
|
652
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
653
|
+
threshold: [0, 0.5, 1],
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
observer.observe(node);
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
660
|
+
const [entries, reportedObserver] =
|
|
661
|
+
intersectionObserverCallback.mock.lastCall;
|
|
662
|
+
|
|
663
|
+
expect(entries.length).toBe(1);
|
|
664
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
665
|
+
expect(entries[0].target).toBe(node);
|
|
666
|
+
expect(reportedObserver).toBe(observer);
|
|
667
|
+
|
|
668
|
+
// Observe the same node and let observer run again
|
|
669
|
+
Fantom.runTask(() => {
|
|
670
|
+
observer.observe(node);
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// Expect no additional calls
|
|
674
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
it('should ignore disconnected targets', () => {
|
|
678
|
+
const nodeRef = createRef<HostInstance>();
|
|
679
|
+
|
|
680
|
+
const root = Fantom.createRoot();
|
|
681
|
+
Fantom.runTask(() => {
|
|
682
|
+
root.render(<View style={{width: 100, height: 100}} ref={nodeRef} />);
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
686
|
+
|
|
687
|
+
Fantom.runTask(() => {
|
|
688
|
+
root.render(<></>);
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
expect(node.isConnected).toBe(false);
|
|
692
|
+
|
|
693
|
+
const intersectionObserverCallback = jest.fn();
|
|
694
|
+
|
|
695
|
+
Fantom.runTask(() => {
|
|
696
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
697
|
+
observer.observe(node);
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
expect(intersectionObserverCallback).not.toHaveBeenCalled();
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
it('should report completely non-intersecting initial state correctly', () => {
|
|
704
|
+
const nodeRef = createRef<HostInstance>();
|
|
705
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
706
|
+
|
|
707
|
+
const root = Fantom.createRoot({
|
|
708
|
+
viewportWidth: 1000,
|
|
709
|
+
viewportHeight: 1000,
|
|
710
|
+
});
|
|
711
|
+
Fantom.runTask(() => {
|
|
712
|
+
root.render(
|
|
713
|
+
<ScrollView ref={scrollNodeRef}>
|
|
714
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
715
|
+
</ScrollView>,
|
|
716
|
+
);
|
|
717
|
+
});
|
|
718
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
719
|
+
// Ensure View is not intersecting with ScrollView
|
|
720
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
721
|
+
|
|
722
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
723
|
+
|
|
724
|
+
const intersectionObserverCallback = jest.fn();
|
|
725
|
+
|
|
726
|
+
Fantom.runTask(() => {
|
|
727
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
728
|
+
threshold: [0],
|
|
729
|
+
rnRootThreshold: [0.5],
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
observer.observe(node);
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
736
|
+
const [entries, reportedObserver] =
|
|
737
|
+
intersectionObserverCallback.mock.lastCall;
|
|
738
|
+
|
|
739
|
+
expect(reportedObserver).toBe(observer);
|
|
740
|
+
expect(entries.length).toBe(1);
|
|
741
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
742
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
743
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0);
|
|
744
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
745
|
+
expect(entries[0].target).toBe(node);
|
|
746
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
747
|
+
x: 0,
|
|
748
|
+
y: 0,
|
|
749
|
+
width: 0,
|
|
750
|
+
height: 0,
|
|
751
|
+
});
|
|
752
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
753
|
+
x: 0,
|
|
754
|
+
y: -200,
|
|
755
|
+
width: 50,
|
|
756
|
+
height: 50,
|
|
757
|
+
});
|
|
758
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
759
|
+
x: 0,
|
|
760
|
+
y: 0,
|
|
761
|
+
width: 1000,
|
|
762
|
+
height: 1000,
|
|
763
|
+
});
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
it('should report partial non-intersecting initial state correctly', () => {
|
|
767
|
+
const nodeRef = createRef<HostInstance>();
|
|
768
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
769
|
+
|
|
770
|
+
const root = Fantom.createRoot({
|
|
771
|
+
viewportWidth: 1000,
|
|
772
|
+
viewportHeight: 1000,
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
Fantom.runTask(() => {
|
|
776
|
+
root.render(
|
|
777
|
+
<ScrollView ref={scrollNodeRef}>
|
|
778
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
779
|
+
</ScrollView>,
|
|
780
|
+
);
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
784
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
785
|
+
|
|
786
|
+
// Scroll such that View is partially intersecting
|
|
787
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
788
|
+
|
|
789
|
+
const intersectionObserverCallback = jest.fn();
|
|
790
|
+
|
|
791
|
+
Fantom.runTask(() => {
|
|
792
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
793
|
+
threshold: [1],
|
|
794
|
+
});
|
|
795
|
+
|
|
796
|
+
observer.observe(node);
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
800
|
+
const [entries, reportedObserver] =
|
|
801
|
+
intersectionObserverCallback.mock.lastCall;
|
|
802
|
+
|
|
803
|
+
expect(reportedObserver).toBe(observer);
|
|
804
|
+
expect(entries.length).toBe(1);
|
|
805
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
806
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
807
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.00125);
|
|
808
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
809
|
+
expect(entries[0].target).toBe(node);
|
|
810
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
811
|
+
x: 0,
|
|
812
|
+
y: 0,
|
|
813
|
+
width: 50,
|
|
814
|
+
height: 25,
|
|
815
|
+
});
|
|
816
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
817
|
+
x: 0,
|
|
818
|
+
y: -25,
|
|
819
|
+
width: 50,
|
|
820
|
+
height: 50,
|
|
821
|
+
});
|
|
822
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
823
|
+
x: 0,
|
|
824
|
+
y: 0,
|
|
825
|
+
width: 1000,
|
|
826
|
+
height: 1000,
|
|
827
|
+
});
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
it('should report partial intersecting initial state correctly', () => {
|
|
831
|
+
const nodeRef = createRef<HostInstance>();
|
|
832
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
833
|
+
|
|
834
|
+
const root = Fantom.createRoot({
|
|
835
|
+
viewportWidth: 1000,
|
|
836
|
+
viewportHeight: 1000,
|
|
837
|
+
});
|
|
838
|
+
Fantom.runTask(() => {
|
|
839
|
+
root.render(
|
|
840
|
+
<ScrollView ref={scrollNodeRef}>
|
|
841
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
842
|
+
</ScrollView>,
|
|
843
|
+
);
|
|
844
|
+
});
|
|
845
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
846
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
847
|
+
|
|
848
|
+
// Scroll such that View is partially intersecting
|
|
849
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
850
|
+
|
|
851
|
+
const intersectionObserverCallback = jest.fn();
|
|
852
|
+
|
|
853
|
+
Fantom.runTask(() => {
|
|
854
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
855
|
+
threshold: [],
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
observer.observe(node);
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
862
|
+
const [entries, reportedObserver] =
|
|
863
|
+
intersectionObserverCallback.mock.lastCall;
|
|
864
|
+
|
|
865
|
+
expect(reportedObserver).toBe(observer);
|
|
866
|
+
expect(entries.length).toBe(1);
|
|
867
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
868
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
869
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.00125);
|
|
870
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
871
|
+
expect(entries[0].target).toBe(node);
|
|
872
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
873
|
+
x: 0,
|
|
874
|
+
y: 0,
|
|
875
|
+
width: 50,
|
|
876
|
+
height: 25,
|
|
877
|
+
});
|
|
878
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
879
|
+
x: 0,
|
|
880
|
+
y: -25,
|
|
881
|
+
width: 50,
|
|
882
|
+
height: 50,
|
|
883
|
+
});
|
|
884
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
885
|
+
x: 0,
|
|
886
|
+
y: 0,
|
|
887
|
+
width: 1000,
|
|
888
|
+
height: 1000,
|
|
889
|
+
});
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
describe('with offset', () => {
|
|
893
|
+
it('should report completely non-intersecting initial state correctly', () => {
|
|
894
|
+
const nodeRef = createRef<HostInstance>();
|
|
895
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
896
|
+
|
|
897
|
+
const root = Fantom.createRoot({
|
|
898
|
+
viewportWidth: 1000,
|
|
899
|
+
viewportHeight: 1000,
|
|
900
|
+
viewportOffsetX: 333,
|
|
901
|
+
viewportOffsetY: 333,
|
|
902
|
+
});
|
|
903
|
+
Fantom.runTask(() => {
|
|
904
|
+
root.render(
|
|
905
|
+
<ScrollView ref={scrollNodeRef}>
|
|
906
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
907
|
+
</ScrollView>,
|
|
908
|
+
);
|
|
909
|
+
});
|
|
910
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
911
|
+
// Ensure View is not intersecting with ScrollView
|
|
912
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
913
|
+
|
|
914
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
915
|
+
|
|
916
|
+
const intersectionObserverCallback = jest.fn();
|
|
917
|
+
|
|
918
|
+
Fantom.runTask(() => {
|
|
919
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
920
|
+
threshold: [0],
|
|
921
|
+
rnRootThreshold: [0.5],
|
|
922
|
+
});
|
|
923
|
+
|
|
924
|
+
observer.observe(node);
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
928
|
+
const [entries, reportedObserver] =
|
|
929
|
+
intersectionObserverCallback.mock.lastCall;
|
|
930
|
+
|
|
931
|
+
expect(reportedObserver).toBe(observer);
|
|
932
|
+
expect(entries.length).toBe(1);
|
|
933
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
934
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
935
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0);
|
|
936
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
937
|
+
expect(entries[0].target).toBe(node);
|
|
938
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
939
|
+
x: 0,
|
|
940
|
+
y: 0,
|
|
941
|
+
width: 0,
|
|
942
|
+
height: 0,
|
|
943
|
+
});
|
|
944
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
945
|
+
x: 333,
|
|
946
|
+
y: 133, // 333-200
|
|
947
|
+
width: 50,
|
|
948
|
+
height: 50,
|
|
949
|
+
});
|
|
950
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
951
|
+
x: 333,
|
|
952
|
+
y: 333,
|
|
953
|
+
width: 1000,
|
|
954
|
+
height: 1000,
|
|
955
|
+
});
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
it('should report partial non-intersecting initial state correctly', () => {
|
|
959
|
+
const nodeRef = createRef<HostInstance>();
|
|
960
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
961
|
+
|
|
962
|
+
const root = Fantom.createRoot({
|
|
963
|
+
viewportWidth: 1000,
|
|
964
|
+
viewportHeight: 1000,
|
|
965
|
+
viewportOffsetX: 333,
|
|
966
|
+
viewportOffsetY: 333,
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
Fantom.runTask(() => {
|
|
970
|
+
root.render(
|
|
971
|
+
<ScrollView ref={scrollNodeRef}>
|
|
972
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
973
|
+
</ScrollView>,
|
|
974
|
+
);
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
978
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
979
|
+
|
|
980
|
+
// Scroll such that View is partially intersecting
|
|
981
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
982
|
+
|
|
983
|
+
const intersectionObserverCallback = jest.fn();
|
|
984
|
+
|
|
985
|
+
Fantom.runTask(() => {
|
|
986
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
987
|
+
threshold: [1],
|
|
988
|
+
});
|
|
989
|
+
|
|
990
|
+
observer.observe(node);
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
994
|
+
const [entries, reportedObserver] =
|
|
995
|
+
intersectionObserverCallback.mock.lastCall;
|
|
996
|
+
|
|
997
|
+
expect(reportedObserver).toBe(observer);
|
|
998
|
+
expect(entries.length).toBe(1);
|
|
999
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1000
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
1001
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.00125);
|
|
1002
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
1003
|
+
expect(entries[0].target).toBe(node);
|
|
1004
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1005
|
+
x: 333,
|
|
1006
|
+
y: 333,
|
|
1007
|
+
width: 50,
|
|
1008
|
+
height: 25,
|
|
1009
|
+
});
|
|
1010
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1011
|
+
x: 333,
|
|
1012
|
+
y: 308, // 333-25
|
|
1013
|
+
width: 50,
|
|
1014
|
+
height: 50,
|
|
1015
|
+
});
|
|
1016
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1017
|
+
x: 333,
|
|
1018
|
+
y: 333,
|
|
1019
|
+
width: 1000,
|
|
1020
|
+
height: 1000,
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
|
|
1024
|
+
it('should report partial intersecting initial state correctly with offset', () => {
|
|
1025
|
+
const nodeRef = createRef<HostInstance>();
|
|
1026
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1027
|
+
|
|
1028
|
+
const root = Fantom.createRoot({
|
|
1029
|
+
viewportWidth: 1000,
|
|
1030
|
+
viewportHeight: 1000,
|
|
1031
|
+
viewportOffsetX: 333,
|
|
1032
|
+
viewportOffsetY: 333,
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
Fantom.runTask(() => {
|
|
1036
|
+
root.render(
|
|
1037
|
+
<ScrollView ref={scrollNodeRef}>
|
|
1038
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
1039
|
+
</ScrollView>,
|
|
1040
|
+
);
|
|
1041
|
+
});
|
|
1042
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1043
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1044
|
+
|
|
1045
|
+
// Scroll such that View is partially intersecting
|
|
1046
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
1047
|
+
|
|
1048
|
+
const intersectionObserverCallback = jest.fn();
|
|
1049
|
+
|
|
1050
|
+
Fantom.runTask(() => {
|
|
1051
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1052
|
+
threshold: [],
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
observer.observe(node);
|
|
1056
|
+
});
|
|
1057
|
+
|
|
1058
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1059
|
+
const [entries, reportedObserver] =
|
|
1060
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1061
|
+
|
|
1062
|
+
expect(reportedObserver).toBe(observer);
|
|
1063
|
+
|
|
1064
|
+
expect(entries.length).toBe(1);
|
|
1065
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1066
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
1067
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.00125);
|
|
1068
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1069
|
+
expect(entries[0].target).toBe(node);
|
|
1070
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1071
|
+
x: 333,
|
|
1072
|
+
y: 333,
|
|
1073
|
+
width: 50,
|
|
1074
|
+
height: 25,
|
|
1075
|
+
});
|
|
1076
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1077
|
+
x: 333,
|
|
1078
|
+
y: 308, // 333 - 25
|
|
1079
|
+
width: 50,
|
|
1080
|
+
height: 50,
|
|
1081
|
+
});
|
|
1082
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1083
|
+
x: 333,
|
|
1084
|
+
y: 333,
|
|
1085
|
+
width: 1000,
|
|
1086
|
+
height: 1000,
|
|
1087
|
+
});
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1090
|
+
it('should report subsequent updates correctly', () => {
|
|
1091
|
+
const nodeRef = createRef<HostInstance>();
|
|
1092
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1093
|
+
|
|
1094
|
+
const root = Fantom.createRoot({
|
|
1095
|
+
viewportWidth: 1000,
|
|
1096
|
+
viewportHeight: 1000,
|
|
1097
|
+
viewportOffsetX: 333,
|
|
1098
|
+
viewportOffsetY: 333,
|
|
1099
|
+
});
|
|
1100
|
+
|
|
1101
|
+
Fantom.runTask(() => {
|
|
1102
|
+
root.render(
|
|
1103
|
+
<ScrollView ref={scrollNodeRef}>
|
|
1104
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
1105
|
+
</ScrollView>,
|
|
1106
|
+
);
|
|
1107
|
+
});
|
|
1108
|
+
|
|
1109
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1110
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1111
|
+
|
|
1112
|
+
expect(node.isConnected).toBe(true);
|
|
1113
|
+
|
|
1114
|
+
const intersectionObserverCallback = jest.fn();
|
|
1115
|
+
|
|
1116
|
+
Fantom.runTask(() => {
|
|
1117
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
1118
|
+
observer.observe(node);
|
|
1119
|
+
});
|
|
1120
|
+
|
|
1121
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1122
|
+
const [entries, reportedObserver] =
|
|
1123
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1124
|
+
expect(entries.length).toBe(1);
|
|
1125
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1126
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
1127
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.01);
|
|
1128
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1129
|
+
|
|
1130
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1131
|
+
x: 333,
|
|
1132
|
+
y: 333,
|
|
1133
|
+
width: 100,
|
|
1134
|
+
height: 100,
|
|
1135
|
+
});
|
|
1136
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1137
|
+
x: 333,
|
|
1138
|
+
y: 333,
|
|
1139
|
+
width: 100,
|
|
1140
|
+
height: 100,
|
|
1141
|
+
});
|
|
1142
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1143
|
+
x: 333,
|
|
1144
|
+
y: 333,
|
|
1145
|
+
width: 1000,
|
|
1146
|
+
height: 1000,
|
|
1147
|
+
});
|
|
1148
|
+
|
|
1149
|
+
expect(reportedObserver).toBe(observer);
|
|
1150
|
+
|
|
1151
|
+
// Move the view out of the viewport
|
|
1152
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
1153
|
+
|
|
1154
|
+
expect(node.isConnected).toBe(true);
|
|
1155
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(2);
|
|
1156
|
+
const [entries2, reportedObserver2] =
|
|
1157
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1158
|
+
expect(entries2.length).toBe(1);
|
|
1159
|
+
expect(entries2[0].isIntersecting).toBe(false);
|
|
1160
|
+
expect(entries2[0].target).toBe(node);
|
|
1161
|
+
|
|
1162
|
+
expectRectEquals(entries2[0].intersectionRect, {
|
|
1163
|
+
x: 0,
|
|
1164
|
+
y: 0,
|
|
1165
|
+
width: 0,
|
|
1166
|
+
height: 0,
|
|
1167
|
+
});
|
|
1168
|
+
expectRectEquals(entries2[0].boundingClientRect, {
|
|
1169
|
+
x: 333,
|
|
1170
|
+
y: 133, // 333 - 200
|
|
1171
|
+
width: 100,
|
|
1172
|
+
height: 100,
|
|
1173
|
+
});
|
|
1174
|
+
expectRectEquals(entries2[0].rootBounds, {
|
|
1175
|
+
x: 333,
|
|
1176
|
+
y: 333,
|
|
1177
|
+
width: 1000,
|
|
1178
|
+
height: 1000,
|
|
1179
|
+
});
|
|
1180
|
+
expect(reportedObserver2).toBe(observer);
|
|
1181
|
+
});
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
it('should report subsequent updates correctly', () => {
|
|
1185
|
+
const nodeRef = createRef<HostInstance>();
|
|
1186
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1187
|
+
|
|
1188
|
+
const root = Fantom.createRoot({
|
|
1189
|
+
viewportWidth: 1000,
|
|
1190
|
+
viewportHeight: 1000,
|
|
1191
|
+
});
|
|
1192
|
+
|
|
1193
|
+
Fantom.runTask(() => {
|
|
1194
|
+
root.render(
|
|
1195
|
+
<ScrollView ref={scrollNodeRef}>
|
|
1196
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
1197
|
+
</ScrollView>,
|
|
1198
|
+
);
|
|
1199
|
+
});
|
|
1200
|
+
|
|
1201
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1202
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1203
|
+
|
|
1204
|
+
expect(node.isConnected).toBe(true);
|
|
1205
|
+
|
|
1206
|
+
const intersectionObserverCallback = jest.fn();
|
|
1207
|
+
|
|
1208
|
+
Fantom.runTask(() => {
|
|
1209
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
1210
|
+
observer.observe(node);
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1214
|
+
const [entries, reportedObserver] =
|
|
1215
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1216
|
+
expect(entries.length).toBe(1);
|
|
1217
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1218
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
1219
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.01);
|
|
1220
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1221
|
+
|
|
1222
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1223
|
+
x: 0,
|
|
1224
|
+
y: 0,
|
|
1225
|
+
width: 100,
|
|
1226
|
+
height: 100,
|
|
1227
|
+
});
|
|
1228
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1229
|
+
x: 0,
|
|
1230
|
+
y: 0,
|
|
1231
|
+
width: 100,
|
|
1232
|
+
height: 100,
|
|
1233
|
+
});
|
|
1234
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1235
|
+
x: 0,
|
|
1236
|
+
y: 0,
|
|
1237
|
+
width: 1000,
|
|
1238
|
+
height: 1000,
|
|
1239
|
+
});
|
|
1240
|
+
|
|
1241
|
+
expect(reportedObserver).toBe(observer);
|
|
1242
|
+
|
|
1243
|
+
// Move the view out of the viewport
|
|
1244
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
1245
|
+
|
|
1246
|
+
expect(node.isConnected).toBe(true);
|
|
1247
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(2);
|
|
1248
|
+
const [entries2, reportedObserver2] =
|
|
1249
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1250
|
+
expect(entries2.length).toBe(1);
|
|
1251
|
+
expect(entries2[0].isIntersecting).toBe(false);
|
|
1252
|
+
expect(entries2[0].target).toBe(node);
|
|
1253
|
+
|
|
1254
|
+
expectRectEquals(entries2[0].intersectionRect, {
|
|
1255
|
+
x: 0,
|
|
1256
|
+
y: 0,
|
|
1257
|
+
width: 0,
|
|
1258
|
+
height: 0,
|
|
1259
|
+
});
|
|
1260
|
+
expectRectEquals(entries2[0].boundingClientRect, {
|
|
1261
|
+
x: 0,
|
|
1262
|
+
y: -200,
|
|
1263
|
+
width: 100,
|
|
1264
|
+
height: 100,
|
|
1265
|
+
});
|
|
1266
|
+
expectRectEquals(entries2[0].rootBounds, {
|
|
1267
|
+
x: 0,
|
|
1268
|
+
y: 0,
|
|
1269
|
+
width: 1000,
|
|
1270
|
+
height: 1000,
|
|
1271
|
+
});
|
|
1272
|
+
expect(reportedObserver2).toBe(observer);
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
it('should report updates to the right observers', () => {
|
|
1276
|
+
let maybeNode1;
|
|
1277
|
+
let maybeNode2;
|
|
1278
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1279
|
+
let observer1: IntersectionObserver;
|
|
1280
|
+
let observer2: IntersectionObserver;
|
|
1281
|
+
|
|
1282
|
+
const root = Fantom.createRoot({
|
|
1283
|
+
viewportWidth: 1000,
|
|
1284
|
+
viewportHeight: 1000,
|
|
1285
|
+
});
|
|
1286
|
+
|
|
1287
|
+
Fantom.runTask(() => {
|
|
1288
|
+
root.render(
|
|
1289
|
+
<ScrollView ref={scrollNodeRef}>
|
|
1290
|
+
<View
|
|
1291
|
+
style={{width: 50, height: 50}}
|
|
1292
|
+
ref={receivedNode => {
|
|
1293
|
+
maybeNode1 = receivedNode;
|
|
1294
|
+
}}
|
|
1295
|
+
/>
|
|
1296
|
+
<View
|
|
1297
|
+
style={{width: 200, height: 200}}
|
|
1298
|
+
ref={receivedNode => {
|
|
1299
|
+
maybeNode2 = receivedNode;
|
|
1300
|
+
}}
|
|
1301
|
+
/>
|
|
1302
|
+
</ScrollView>,
|
|
1303
|
+
);
|
|
1304
|
+
});
|
|
1305
|
+
const node1 = ensureReactNativeElement(maybeNode1);
|
|
1306
|
+
const node2 = ensureReactNativeElement(maybeNode2);
|
|
1307
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1308
|
+
|
|
1309
|
+
// Scroll such that node1 is not intersecting and node 2 is intersecting
|
|
1310
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 100});
|
|
1311
|
+
|
|
1312
|
+
const intersectionObserverCallback1 = jest.fn();
|
|
1313
|
+
const intersectionObserverCallback2 = jest.fn();
|
|
1314
|
+
|
|
1315
|
+
Fantom.runTask(() => {
|
|
1316
|
+
observer1 = new IntersectionObserver(intersectionObserverCallback1, {
|
|
1317
|
+
threshold: [0],
|
|
1318
|
+
});
|
|
1319
|
+
|
|
1320
|
+
observer1.observe(node1);
|
|
1321
|
+
observer1.observe(node2);
|
|
1322
|
+
|
|
1323
|
+
observer2 = new IntersectionObserver(intersectionObserverCallback2, {
|
|
1324
|
+
threshold: [1],
|
|
1325
|
+
});
|
|
1326
|
+
observer2.observe(node2);
|
|
1327
|
+
});
|
|
1328
|
+
|
|
1329
|
+
// Verify observer1 is reporting right thing
|
|
1330
|
+
expect(intersectionObserverCallback1).toHaveBeenCalledTimes(1);
|
|
1331
|
+
const [entries1, reportedObserver1] =
|
|
1332
|
+
intersectionObserverCallback1.mock.lastCall;
|
|
1333
|
+
|
|
1334
|
+
expect(reportedObserver1).toBe(observer1);
|
|
1335
|
+
expect(entries1.length).toBe(2);
|
|
1336
|
+
|
|
1337
|
+
expect(entries1[0].isIntersecting).toBe(false);
|
|
1338
|
+
expect(entries1[0].intersectionRatio).toBe(0);
|
|
1339
|
+
expect(entries1[0].target).toBe(node1);
|
|
1340
|
+
|
|
1341
|
+
expectRectEquals(entries1[0].intersectionRect, {
|
|
1342
|
+
x: 0,
|
|
1343
|
+
y: 0,
|
|
1344
|
+
width: 0,
|
|
1345
|
+
height: 0,
|
|
1346
|
+
});
|
|
1347
|
+
expectRectEquals(entries1[0].boundingClientRect, {
|
|
1348
|
+
x: 0,
|
|
1349
|
+
y: -100,
|
|
1350
|
+
width: 50,
|
|
1351
|
+
height: 50,
|
|
1352
|
+
});
|
|
1353
|
+
expectRectEquals(entries1[0].rootBounds, {
|
|
1354
|
+
x: 0,
|
|
1355
|
+
y: 0,
|
|
1356
|
+
width: 1000,
|
|
1357
|
+
height: 1000,
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1360
|
+
expect(entries1[1].isIntersecting).toBe(true);
|
|
1361
|
+
expect(entries1[1].intersectionRatio).toBe(0.75);
|
|
1362
|
+
expect(entries1[1].target).toBe(node2);
|
|
1363
|
+
|
|
1364
|
+
// Verify observer2 is reporting no intersection because the threshold is 1
|
|
1365
|
+
expect(intersectionObserverCallback2).toHaveBeenCalledTimes(1);
|
|
1366
|
+
const [entries2, reportedObserver2] =
|
|
1367
|
+
intersectionObserverCallback2.mock.lastCall;
|
|
1368
|
+
|
|
1369
|
+
expect(reportedObserver2).toBe(observer2);
|
|
1370
|
+
expect(entries2.length).toBe(1);
|
|
1371
|
+
|
|
1372
|
+
expect(entries2[0].isIntersecting).toBe(false);
|
|
1373
|
+
expect(entries2[0].intersectionRatio).toBe(0.75);
|
|
1374
|
+
expect(entries2[0].target).toBe(node2);
|
|
1375
|
+
|
|
1376
|
+
expectRectEquals(entries2[0].intersectionRect, {
|
|
1377
|
+
x: 0,
|
|
1378
|
+
y: 0,
|
|
1379
|
+
width: 200,
|
|
1380
|
+
height: 150,
|
|
1381
|
+
});
|
|
1382
|
+
expectRectEquals(entries2[0].boundingClientRect, {
|
|
1383
|
+
x: 0,
|
|
1384
|
+
y: -50,
|
|
1385
|
+
width: 200,
|
|
1386
|
+
height: 200,
|
|
1387
|
+
});
|
|
1388
|
+
expectRectEquals(entries2[0].rootBounds, {
|
|
1389
|
+
x: 0,
|
|
1390
|
+
y: 0,
|
|
1391
|
+
width: 1000,
|
|
1392
|
+
height: 1000,
|
|
1393
|
+
});
|
|
1394
|
+
});
|
|
1395
|
+
|
|
1396
|
+
describe('with explicit root', () => {
|
|
1397
|
+
it('should report partial non-intersecting initial state correctly', () => {
|
|
1398
|
+
const nodeRef = createRef<HostInstance>();
|
|
1399
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1400
|
+
|
|
1401
|
+
const root = Fantom.createRoot({
|
|
1402
|
+
viewportWidth: 1000,
|
|
1403
|
+
viewportHeight: 1000,
|
|
1404
|
+
viewportOffsetX: 333,
|
|
1405
|
+
viewportOffsetY: 333,
|
|
1406
|
+
});
|
|
1407
|
+
|
|
1408
|
+
Fantom.runTask(() => {
|
|
1409
|
+
root.render(
|
|
1410
|
+
<ScrollView style={{width: 100}} ref={scrollNodeRef}>
|
|
1411
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
1412
|
+
</ScrollView>,
|
|
1413
|
+
);
|
|
1414
|
+
});
|
|
1415
|
+
|
|
1416
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1417
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1418
|
+
|
|
1419
|
+
// Scroll such that View is partially intersecting
|
|
1420
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
1421
|
+
|
|
1422
|
+
const intersectionObserverCallback = jest.fn();
|
|
1423
|
+
|
|
1424
|
+
Fantom.runTask(() => {
|
|
1425
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1426
|
+
threshold: [1],
|
|
1427
|
+
root: scrollNode,
|
|
1428
|
+
});
|
|
1429
|
+
|
|
1430
|
+
observer.observe(node);
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1434
|
+
const [entries, reportedObserver] =
|
|
1435
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1436
|
+
|
|
1437
|
+
expect(reportedObserver).toBe(observer);
|
|
1438
|
+
expect(entries.length).toBe(1);
|
|
1439
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1440
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
1441
|
+
// intersectionRectArea / rootboundsArea
|
|
1442
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.0125);
|
|
1443
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
1444
|
+
expect(entries[0].target).toBe(node);
|
|
1445
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1446
|
+
x: 333,
|
|
1447
|
+
y: 333,
|
|
1448
|
+
width: 50,
|
|
1449
|
+
height: 25,
|
|
1450
|
+
});
|
|
1451
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1452
|
+
x: 333,
|
|
1453
|
+
y: 308, // 333 - 25
|
|
1454
|
+
width: 50,
|
|
1455
|
+
height: 50,
|
|
1456
|
+
});
|
|
1457
|
+
// Expect this to be width of the viewport
|
|
1458
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1459
|
+
x: 333,
|
|
1460
|
+
y: 333,
|
|
1461
|
+
width: 100,
|
|
1462
|
+
height: 1000,
|
|
1463
|
+
});
|
|
1464
|
+
});
|
|
1465
|
+
|
|
1466
|
+
it('should report partial intersecting initial state correctly', () => {
|
|
1467
|
+
const nodeRef = createRef<HostInstance>();
|
|
1468
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1469
|
+
|
|
1470
|
+
const root = Fantom.createRoot({
|
|
1471
|
+
viewportWidth: 1000,
|
|
1472
|
+
viewportHeight: 1000,
|
|
1473
|
+
});
|
|
1474
|
+
Fantom.runTask(() => {
|
|
1475
|
+
root.render(
|
|
1476
|
+
<ScrollView style={{width: 100}} ref={scrollNodeRef}>
|
|
1477
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
1478
|
+
</ScrollView>,
|
|
1479
|
+
);
|
|
1480
|
+
});
|
|
1481
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1482
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1483
|
+
|
|
1484
|
+
// Scroll such that View is partially intersecting
|
|
1485
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
1486
|
+
|
|
1487
|
+
const intersectionObserverCallback = jest.fn();
|
|
1488
|
+
|
|
1489
|
+
Fantom.runTask(() => {
|
|
1490
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1491
|
+
threshold: [],
|
|
1492
|
+
root: scrollNode,
|
|
1493
|
+
});
|
|
1494
|
+
|
|
1495
|
+
observer.observe(node);
|
|
1496
|
+
});
|
|
1497
|
+
|
|
1498
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1499
|
+
const [entries, reportedObserver] =
|
|
1500
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1501
|
+
|
|
1502
|
+
expect(reportedObserver).toBe(observer);
|
|
1503
|
+
expect(entries.length).toBe(1);
|
|
1504
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1505
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
1506
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.0125);
|
|
1507
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1508
|
+
expect(entries[0].target).toBe(node);
|
|
1509
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1510
|
+
x: 0,
|
|
1511
|
+
y: 0,
|
|
1512
|
+
width: 50,
|
|
1513
|
+
height: 25,
|
|
1514
|
+
});
|
|
1515
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1516
|
+
x: 0,
|
|
1517
|
+
y: -25,
|
|
1518
|
+
width: 50,
|
|
1519
|
+
height: 50,
|
|
1520
|
+
});
|
|
1521
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1522
|
+
x: 0,
|
|
1523
|
+
y: 0,
|
|
1524
|
+
width: 100,
|
|
1525
|
+
height: 1000,
|
|
1526
|
+
});
|
|
1527
|
+
});
|
|
1528
|
+
|
|
1529
|
+
it('should report subsequent updates correctly', () => {
|
|
1530
|
+
const nodeRef = createRef<HostInstance>();
|
|
1531
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1532
|
+
|
|
1533
|
+
const root = Fantom.createRoot({
|
|
1534
|
+
viewportWidth: 1000,
|
|
1535
|
+
viewportHeight: 1000,
|
|
1536
|
+
});
|
|
1537
|
+
|
|
1538
|
+
Fantom.runTask(() => {
|
|
1539
|
+
root.render(
|
|
1540
|
+
<ScrollView style={{width: 100}} ref={scrollNodeRef}>
|
|
1541
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
1542
|
+
</ScrollView>,
|
|
1543
|
+
);
|
|
1544
|
+
});
|
|
1545
|
+
|
|
1546
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1547
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1548
|
+
|
|
1549
|
+
expect(node.isConnected).toBe(true);
|
|
1550
|
+
|
|
1551
|
+
const intersectionObserverCallback = jest.fn();
|
|
1552
|
+
|
|
1553
|
+
Fantom.runTask(() => {
|
|
1554
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1555
|
+
root: scrollNode,
|
|
1556
|
+
});
|
|
1557
|
+
observer.observe(node);
|
|
1558
|
+
});
|
|
1559
|
+
|
|
1560
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1561
|
+
const [entries, reportedObserver] =
|
|
1562
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1563
|
+
expect(entries.length).toBe(1);
|
|
1564
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
1565
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
1566
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.1);
|
|
1567
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1568
|
+
|
|
1569
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1570
|
+
x: 0,
|
|
1571
|
+
y: 0,
|
|
1572
|
+
width: 100,
|
|
1573
|
+
height: 100,
|
|
1574
|
+
});
|
|
1575
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1576
|
+
x: 0,
|
|
1577
|
+
y: 0,
|
|
1578
|
+
width: 100,
|
|
1579
|
+
height: 100,
|
|
1580
|
+
});
|
|
1581
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1582
|
+
x: 0,
|
|
1583
|
+
y: 0,
|
|
1584
|
+
width: 100,
|
|
1585
|
+
height: 1000,
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
expect(reportedObserver).toBe(observer);
|
|
1589
|
+
|
|
1590
|
+
// Move the view out of the viewport
|
|
1591
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
1592
|
+
|
|
1593
|
+
expect(node.isConnected).toBe(true);
|
|
1594
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(2);
|
|
1595
|
+
const [entries2, reportedObserver2] =
|
|
1596
|
+
intersectionObserverCallback.mock.lastCall;
|
|
1597
|
+
expect(entries2.length).toBe(1);
|
|
1598
|
+
expect(entries2[0].isIntersecting).toBe(false);
|
|
1599
|
+
expect(entries2[0].target).toBe(node);
|
|
1600
|
+
|
|
1601
|
+
expectRectEquals(entries2[0].intersectionRect, {
|
|
1602
|
+
x: 0,
|
|
1603
|
+
y: 0,
|
|
1604
|
+
width: 0,
|
|
1605
|
+
height: 0,
|
|
1606
|
+
});
|
|
1607
|
+
expectRectEquals(entries2[0].boundingClientRect, {
|
|
1608
|
+
x: 0,
|
|
1609
|
+
y: -200,
|
|
1610
|
+
width: 100,
|
|
1611
|
+
height: 100,
|
|
1612
|
+
});
|
|
1613
|
+
expectRectEquals(entries2[0].rootBounds, {
|
|
1614
|
+
x: 0,
|
|
1615
|
+
y: 0,
|
|
1616
|
+
width: 100,
|
|
1617
|
+
height: 1000,
|
|
1618
|
+
});
|
|
1619
|
+
expect(reportedObserver2).toBe(observer);
|
|
1620
|
+
});
|
|
1621
|
+
|
|
1622
|
+
it('should report updates to the right observers', () => {
|
|
1623
|
+
let maybeNode1;
|
|
1624
|
+
let maybeNode2;
|
|
1625
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
1626
|
+
let observer1: IntersectionObserver;
|
|
1627
|
+
let observer2: IntersectionObserver;
|
|
1628
|
+
|
|
1629
|
+
const root = Fantom.createRoot({
|
|
1630
|
+
viewportWidth: 1000,
|
|
1631
|
+
viewportHeight: 1000,
|
|
1632
|
+
});
|
|
1633
|
+
|
|
1634
|
+
Fantom.runTask(() => {
|
|
1635
|
+
root.render(
|
|
1636
|
+
<ScrollView ref={scrollNodeRef}>
|
|
1637
|
+
<View
|
|
1638
|
+
style={{width: 50, height: 50}}
|
|
1639
|
+
ref={receivedNode => {
|
|
1640
|
+
maybeNode1 = receivedNode;
|
|
1641
|
+
}}
|
|
1642
|
+
/>
|
|
1643
|
+
<View
|
|
1644
|
+
style={{width: 200, height: 200}}
|
|
1645
|
+
ref={receivedNode => {
|
|
1646
|
+
maybeNode2 = receivedNode;
|
|
1647
|
+
}}
|
|
1648
|
+
/>
|
|
1649
|
+
</ScrollView>,
|
|
1650
|
+
);
|
|
1651
|
+
});
|
|
1652
|
+
const node1 = ensureReactNativeElement(maybeNode1);
|
|
1653
|
+
const node2 = ensureReactNativeElement(maybeNode2);
|
|
1654
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
1655
|
+
|
|
1656
|
+
// Scroll such that node1 is not intersecting and node 2 is intersecting
|
|
1657
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 100});
|
|
1658
|
+
|
|
1659
|
+
const intersectionObserverCallback1 = jest.fn();
|
|
1660
|
+
const intersectionObserverCallback2 = jest.fn();
|
|
1661
|
+
|
|
1662
|
+
Fantom.runTask(() => {
|
|
1663
|
+
observer1 = new IntersectionObserver(intersectionObserverCallback1, {
|
|
1664
|
+
threshold: [0],
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
|
+
observer1.observe(node1);
|
|
1668
|
+
observer1.observe(node2);
|
|
1669
|
+
|
|
1670
|
+
observer2 = new IntersectionObserver(intersectionObserverCallback2, {
|
|
1671
|
+
threshold: [1],
|
|
1672
|
+
});
|
|
1673
|
+
observer2.observe(node2);
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
// Verify observer1 is reporting right thing
|
|
1677
|
+
expect(intersectionObserverCallback1).toHaveBeenCalledTimes(1);
|
|
1678
|
+
const [entries1, reportedObserver1] =
|
|
1679
|
+
intersectionObserverCallback1.mock.lastCall;
|
|
1680
|
+
|
|
1681
|
+
expect(reportedObserver1).toBe(observer1);
|
|
1682
|
+
expect(entries1.length).toBe(2);
|
|
1683
|
+
|
|
1684
|
+
expect(entries1[0].isIntersecting).toBe(false);
|
|
1685
|
+
expect(entries1[0].intersectionRatio).toBe(0);
|
|
1686
|
+
expect(entries1[0].target).toBe(node1);
|
|
1687
|
+
|
|
1688
|
+
expectRectEquals(entries1[0].intersectionRect, {
|
|
1689
|
+
x: 0,
|
|
1690
|
+
y: 0,
|
|
1691
|
+
width: 0,
|
|
1692
|
+
height: 0,
|
|
1693
|
+
});
|
|
1694
|
+
expectRectEquals(entries1[0].boundingClientRect, {
|
|
1695
|
+
x: 0,
|
|
1696
|
+
y: -100,
|
|
1697
|
+
width: 50,
|
|
1698
|
+
height: 50,
|
|
1699
|
+
});
|
|
1700
|
+
expectRectEquals(entries1[0].rootBounds, {
|
|
1701
|
+
x: 0,
|
|
1702
|
+
y: 0,
|
|
1703
|
+
width: 1000,
|
|
1704
|
+
height: 1000,
|
|
1705
|
+
});
|
|
1706
|
+
|
|
1707
|
+
expect(entries1[1].isIntersecting).toBe(true);
|
|
1708
|
+
expect(entries1[1].intersectionRatio).toBe(0.75);
|
|
1709
|
+
expect(entries1[1].target).toBe(node2);
|
|
1710
|
+
|
|
1711
|
+
// Verify observer2 is reporting no intersection because the threshold is 1
|
|
1712
|
+
expect(intersectionObserverCallback2).toHaveBeenCalledTimes(1);
|
|
1713
|
+
const [entries2, reportedObserver2] =
|
|
1714
|
+
intersectionObserverCallback2.mock.lastCall;
|
|
1715
|
+
|
|
1716
|
+
expect(reportedObserver2).toBe(observer2);
|
|
1717
|
+
expect(entries2.length).toBe(1);
|
|
1718
|
+
|
|
1719
|
+
expect(entries2[0].isIntersecting).toBe(false);
|
|
1720
|
+
expect(entries2[0].intersectionRatio).toBe(0.75);
|
|
1721
|
+
expect(entries2[0].target).toBe(node2);
|
|
1722
|
+
|
|
1723
|
+
expectRectEquals(entries2[0].intersectionRect, {
|
|
1724
|
+
x: 0,
|
|
1725
|
+
y: 0,
|
|
1726
|
+
width: 200,
|
|
1727
|
+
height: 150,
|
|
1728
|
+
});
|
|
1729
|
+
expectRectEquals(entries2[0].boundingClientRect, {
|
|
1730
|
+
x: 0,
|
|
1731
|
+
y: -50,
|
|
1732
|
+
width: 200,
|
|
1733
|
+
height: 200,
|
|
1734
|
+
});
|
|
1735
|
+
expectRectEquals(entries2[0].rootBounds, {
|
|
1736
|
+
x: 0,
|
|
1737
|
+
y: 0,
|
|
1738
|
+
width: 1000,
|
|
1739
|
+
height: 1000,
|
|
1740
|
+
});
|
|
1741
|
+
});
|
|
1742
|
+
});
|
|
1743
|
+
|
|
1744
|
+
describe('with rootMargin', () => {
|
|
1745
|
+
describe('expanding', () => {
|
|
1746
|
+
it('full intersect with implicit root', () => {
|
|
1747
|
+
const nodeRef = createRef<HostInstance>();
|
|
1748
|
+
|
|
1749
|
+
const root = Fantom.createRoot({
|
|
1750
|
+
viewportWidth: 1000,
|
|
1751
|
+
viewportHeight: 1000,
|
|
1752
|
+
});
|
|
1753
|
+
|
|
1754
|
+
Fantom.runTask(() => {
|
|
1755
|
+
root.render(
|
|
1756
|
+
// Position element at x: -50, y: -50 (outside viewport)
|
|
1757
|
+
<View
|
|
1758
|
+
style={{
|
|
1759
|
+
position: 'absolute',
|
|
1760
|
+
top: -50,
|
|
1761
|
+
left: -50,
|
|
1762
|
+
width: 100,
|
|
1763
|
+
height: 100,
|
|
1764
|
+
}}
|
|
1765
|
+
ref={nodeRef}
|
|
1766
|
+
/>,
|
|
1767
|
+
);
|
|
1768
|
+
});
|
|
1769
|
+
|
|
1770
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1771
|
+
const intersectionObserverCallback = jest.fn();
|
|
1772
|
+
|
|
1773
|
+
Fantom.runTask(() => {
|
|
1774
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1775
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
1776
|
+
rootMargin: '50px',
|
|
1777
|
+
});
|
|
1778
|
+
observer.observe(node);
|
|
1779
|
+
});
|
|
1780
|
+
|
|
1781
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1782
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
1783
|
+
expect(entries.length).toBe(1);
|
|
1784
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1785
|
+
x: -50,
|
|
1786
|
+
y: -50,
|
|
1787
|
+
width: 1100,
|
|
1788
|
+
height: 1100,
|
|
1789
|
+
});
|
|
1790
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1791
|
+
x: -50,
|
|
1792
|
+
y: -50,
|
|
1793
|
+
width: 100,
|
|
1794
|
+
height: 100,
|
|
1795
|
+
});
|
|
1796
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1797
|
+
x: -50,
|
|
1798
|
+
y: -50,
|
|
1799
|
+
width: 100,
|
|
1800
|
+
height: 100,
|
|
1801
|
+
});
|
|
1802
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1803
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
1804
|
+
});
|
|
1805
|
+
|
|
1806
|
+
it('no intersection with high threshold on explicit root', () => {
|
|
1807
|
+
const nodeRef = createRef<HostInstance>();
|
|
1808
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
1809
|
+
|
|
1810
|
+
const root = Fantom.createRoot({
|
|
1811
|
+
viewportWidth: 1000,
|
|
1812
|
+
viewportHeight: 1000,
|
|
1813
|
+
});
|
|
1814
|
+
|
|
1815
|
+
Fantom.runTask(() => {
|
|
1816
|
+
root.render(
|
|
1817
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
1818
|
+
<View
|
|
1819
|
+
style={{
|
|
1820
|
+
marginTop: -75,
|
|
1821
|
+
width: 50,
|
|
1822
|
+
height: 50,
|
|
1823
|
+
}}
|
|
1824
|
+
ref={nodeRef}
|
|
1825
|
+
/>
|
|
1826
|
+
</View>,
|
|
1827
|
+
);
|
|
1828
|
+
});
|
|
1829
|
+
|
|
1830
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1831
|
+
const rootNode = ensureReactNativeElement(rootNodeRef.current);
|
|
1832
|
+
const intersectionObserverCallback = jest.fn();
|
|
1833
|
+
|
|
1834
|
+
Fantom.runTask(() => {
|
|
1835
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1836
|
+
root: rootNode,
|
|
1837
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
1838
|
+
rootMargin: '50px 0px 0px 0px',
|
|
1839
|
+
threshold: 1,
|
|
1840
|
+
});
|
|
1841
|
+
observer.observe(node);
|
|
1842
|
+
});
|
|
1843
|
+
|
|
1844
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1845
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
1846
|
+
expect(entries.length).toBe(1);
|
|
1847
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
1848
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
1849
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1850
|
+
x: 0,
|
|
1851
|
+
y: -50,
|
|
1852
|
+
width: 200,
|
|
1853
|
+
height: 250,
|
|
1854
|
+
});
|
|
1855
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1856
|
+
x: 0,
|
|
1857
|
+
y: -50,
|
|
1858
|
+
width: 50,
|
|
1859
|
+
height: 25,
|
|
1860
|
+
});
|
|
1861
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1862
|
+
x: 0,
|
|
1863
|
+
y: -75,
|
|
1864
|
+
width: 50,
|
|
1865
|
+
height: 50,
|
|
1866
|
+
});
|
|
1867
|
+
});
|
|
1868
|
+
|
|
1869
|
+
it('no intersect with rnRootThreshold with implicit root', () => {
|
|
1870
|
+
const nodeRef = createRef<HostInstance>();
|
|
1871
|
+
|
|
1872
|
+
const root = Fantom.createRoot({
|
|
1873
|
+
viewportWidth: 1000,
|
|
1874
|
+
viewportHeight: 1000,
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1877
|
+
Fantom.runTask(() => {
|
|
1878
|
+
root.render(
|
|
1879
|
+
<View
|
|
1880
|
+
style={{
|
|
1881
|
+
position: 'absolute',
|
|
1882
|
+
top: -75,
|
|
1883
|
+
width: 100,
|
|
1884
|
+
height: 100,
|
|
1885
|
+
}}
|
|
1886
|
+
ref={nodeRef}
|
|
1887
|
+
/>,
|
|
1888
|
+
);
|
|
1889
|
+
});
|
|
1890
|
+
|
|
1891
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1892
|
+
const intersectionObserverCallback = jest.fn();
|
|
1893
|
+
|
|
1894
|
+
Fantom.runTask(() => {
|
|
1895
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1896
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
1897
|
+
rootMargin: '50px',
|
|
1898
|
+
threshold: 1,
|
|
1899
|
+
rnRootThreshold: 0.5,
|
|
1900
|
+
});
|
|
1901
|
+
observer.observe(node);
|
|
1902
|
+
});
|
|
1903
|
+
|
|
1904
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1905
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
1906
|
+
expect(entries.length).toBe(1);
|
|
1907
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
1908
|
+
expect(entries[0].intersectionRatio).toBe(0.75);
|
|
1909
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(
|
|
1910
|
+
(100 * 75) / (1100 * 1100),
|
|
1911
|
+
);
|
|
1912
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1913
|
+
x: -50,
|
|
1914
|
+
y: -50,
|
|
1915
|
+
width: 1100,
|
|
1916
|
+
height: 1100,
|
|
1917
|
+
});
|
|
1918
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1919
|
+
x: 0,
|
|
1920
|
+
y: -50,
|
|
1921
|
+
width: 100,
|
|
1922
|
+
height: 75,
|
|
1923
|
+
});
|
|
1924
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1925
|
+
x: 0,
|
|
1926
|
+
y: -75,
|
|
1927
|
+
width: 100,
|
|
1928
|
+
height: 100,
|
|
1929
|
+
});
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
it('no intersect with rnRootThreshold with explicit root', () => {
|
|
1933
|
+
const nodeRef = createRef<HostInstance>();
|
|
1934
|
+
const rootRef = createRef<HostInstance>();
|
|
1935
|
+
|
|
1936
|
+
const root = Fantom.createRoot({
|
|
1937
|
+
viewportWidth: 1000,
|
|
1938
|
+
viewportHeight: 1000,
|
|
1939
|
+
});
|
|
1940
|
+
|
|
1941
|
+
Fantom.runTask(() => {
|
|
1942
|
+
root.render(
|
|
1943
|
+
<View ref={rootRef} style={{width: 100, height: 100}}>
|
|
1944
|
+
<View
|
|
1945
|
+
style={{
|
|
1946
|
+
position: 'absolute',
|
|
1947
|
+
top: -75,
|
|
1948
|
+
width: 100,
|
|
1949
|
+
height: 100,
|
|
1950
|
+
}}
|
|
1951
|
+
ref={nodeRef}
|
|
1952
|
+
/>
|
|
1953
|
+
,
|
|
1954
|
+
</View>,
|
|
1955
|
+
);
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1958
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
1959
|
+
const rootNode = ensureReactNativeElement(rootRef.current);
|
|
1960
|
+
const intersectionObserverCallback = jest.fn();
|
|
1961
|
+
|
|
1962
|
+
Fantom.runTask(() => {
|
|
1963
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
1964
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
1965
|
+
rootMargin: '50px',
|
|
1966
|
+
root: rootNode,
|
|
1967
|
+
threshold: 1,
|
|
1968
|
+
rnRootThreshold: 0.1,
|
|
1969
|
+
});
|
|
1970
|
+
observer.observe(node);
|
|
1971
|
+
});
|
|
1972
|
+
|
|
1973
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
1974
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
1975
|
+
expect(entries.length).toBe(1);
|
|
1976
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
1977
|
+
expect(entries[0].intersectionRatio).toBe(0.75);
|
|
1978
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(
|
|
1979
|
+
(100 * 75) / (200 * 200),
|
|
1980
|
+
);
|
|
1981
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
1982
|
+
x: -50,
|
|
1983
|
+
y: -50,
|
|
1984
|
+
width: 200,
|
|
1985
|
+
height: 200,
|
|
1986
|
+
});
|
|
1987
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
1988
|
+
x: 0,
|
|
1989
|
+
y: -50,
|
|
1990
|
+
width: 100,
|
|
1991
|
+
height: 75,
|
|
1992
|
+
});
|
|
1993
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
1994
|
+
x: 0,
|
|
1995
|
+
y: -75,
|
|
1996
|
+
width: 100,
|
|
1997
|
+
height: 100,
|
|
1998
|
+
});
|
|
1999
|
+
});
|
|
2000
|
+
|
|
2001
|
+
it('no intersection high threshold on implicit root', () => {
|
|
2002
|
+
const nodeRef = createRef<HostInstance>();
|
|
2003
|
+
|
|
2004
|
+
const root = Fantom.createRoot({
|
|
2005
|
+
viewportWidth: 1000,
|
|
2006
|
+
viewportHeight: 1000,
|
|
2007
|
+
});
|
|
2008
|
+
|
|
2009
|
+
Fantom.runTask(() => {
|
|
2010
|
+
root.render(
|
|
2011
|
+
<View
|
|
2012
|
+
style={{
|
|
2013
|
+
position: 'absolute',
|
|
2014
|
+
top: -75,
|
|
2015
|
+
width: 100,
|
|
2016
|
+
height: 100,
|
|
2017
|
+
}}
|
|
2018
|
+
ref={nodeRef}
|
|
2019
|
+
/>,
|
|
2020
|
+
);
|
|
2021
|
+
});
|
|
2022
|
+
|
|
2023
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2024
|
+
const intersectionObserverCallback = jest.fn();
|
|
2025
|
+
|
|
2026
|
+
Fantom.runTask(() => {
|
|
2027
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2028
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2029
|
+
rootMargin: '50px',
|
|
2030
|
+
threshold: 1,
|
|
2031
|
+
});
|
|
2032
|
+
observer.observe(node);
|
|
2033
|
+
});
|
|
2034
|
+
|
|
2035
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2036
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2037
|
+
expect(entries.length).toBe(1);
|
|
2038
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2039
|
+
x: -50,
|
|
2040
|
+
y: -50,
|
|
2041
|
+
width: 1100,
|
|
2042
|
+
height: 1100,
|
|
2043
|
+
});
|
|
2044
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2045
|
+
x: 0,
|
|
2046
|
+
y: -50,
|
|
2047
|
+
width: 100,
|
|
2048
|
+
height: 75,
|
|
2049
|
+
});
|
|
2050
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2051
|
+
x: 0,
|
|
2052
|
+
y: -75,
|
|
2053
|
+
width: 100,
|
|
2054
|
+
height: 100,
|
|
2055
|
+
});
|
|
2056
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
2057
|
+
expect(entries[0].intersectionRatio).toBe(0.75);
|
|
2058
|
+
});
|
|
2059
|
+
|
|
2060
|
+
it('partial intersection implicit root', () => {
|
|
2061
|
+
const nodeRef = createRef<HostInstance>();
|
|
2062
|
+
|
|
2063
|
+
const root = Fantom.createRoot({
|
|
2064
|
+
viewportWidth: 1000,
|
|
2065
|
+
viewportHeight: 1000,
|
|
2066
|
+
});
|
|
2067
|
+
|
|
2068
|
+
Fantom.runTask(() => {
|
|
2069
|
+
root.render(
|
|
2070
|
+
<View
|
|
2071
|
+
style={{
|
|
2072
|
+
position: 'absolute',
|
|
2073
|
+
top: -75,
|
|
2074
|
+
width: 100,
|
|
2075
|
+
height: 100,
|
|
2076
|
+
}}
|
|
2077
|
+
ref={nodeRef}
|
|
2078
|
+
/>,
|
|
2079
|
+
);
|
|
2080
|
+
});
|
|
2081
|
+
|
|
2082
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2083
|
+
const intersectionObserverCallback = jest.fn();
|
|
2084
|
+
|
|
2085
|
+
Fantom.runTask(() => {
|
|
2086
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2087
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2088
|
+
rootMargin: '50px',
|
|
2089
|
+
threshold: 0.5,
|
|
2090
|
+
});
|
|
2091
|
+
observer.observe(node);
|
|
2092
|
+
});
|
|
2093
|
+
|
|
2094
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2095
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2096
|
+
expect(entries.length).toBe(1);
|
|
2097
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2098
|
+
expect(entries[0].intersectionRatio).toBe(0.75);
|
|
2099
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2100
|
+
x: -50,
|
|
2101
|
+
y: -50,
|
|
2102
|
+
width: 1100,
|
|
2103
|
+
height: 1100,
|
|
2104
|
+
});
|
|
2105
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2106
|
+
x: 0,
|
|
2107
|
+
y: -50,
|
|
2108
|
+
width: 100,
|
|
2109
|
+
height: 75,
|
|
2110
|
+
});
|
|
2111
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2112
|
+
x: 0,
|
|
2113
|
+
y: -75,
|
|
2114
|
+
width: 100,
|
|
2115
|
+
height: 100,
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
|
|
2119
|
+
it('no intersect with implicit root', () => {
|
|
2120
|
+
const nodeRef = createRef<HostInstance>();
|
|
2121
|
+
|
|
2122
|
+
const root = Fantom.createRoot({
|
|
2123
|
+
viewportWidth: 1000,
|
|
2124
|
+
viewportHeight: 1000,
|
|
2125
|
+
});
|
|
2126
|
+
|
|
2127
|
+
Fantom.runTask(() => {
|
|
2128
|
+
root.render(
|
|
2129
|
+
<View
|
|
2130
|
+
style={{
|
|
2131
|
+
position: 'absolute',
|
|
2132
|
+
top: -101,
|
|
2133
|
+
width: 50,
|
|
2134
|
+
height: 50,
|
|
2135
|
+
}}
|
|
2136
|
+
ref={nodeRef}
|
|
2137
|
+
/>,
|
|
2138
|
+
);
|
|
2139
|
+
});
|
|
2140
|
+
|
|
2141
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2142
|
+
const intersectionObserverCallback = jest.fn();
|
|
2143
|
+
|
|
2144
|
+
Fantom.runTask(() => {
|
|
2145
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2146
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2147
|
+
rootMargin: '50px',
|
|
2148
|
+
});
|
|
2149
|
+
observer.observe(node);
|
|
2150
|
+
});
|
|
2151
|
+
|
|
2152
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2153
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2154
|
+
expect(entries.length).toBe(1);
|
|
2155
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2156
|
+
x: -50,
|
|
2157
|
+
y: -50,
|
|
2158
|
+
width: 1100,
|
|
2159
|
+
height: 1100,
|
|
2160
|
+
});
|
|
2161
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2162
|
+
x: 0,
|
|
2163
|
+
y: 0,
|
|
2164
|
+
width: 0,
|
|
2165
|
+
height: 0,
|
|
2166
|
+
});
|
|
2167
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2168
|
+
x: 0,
|
|
2169
|
+
y: -101,
|
|
2170
|
+
width: 50,
|
|
2171
|
+
height: 50,
|
|
2172
|
+
});
|
|
2173
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
2174
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
2175
|
+
});
|
|
2176
|
+
|
|
2177
|
+
it('full intersect with explicit root', () => {
|
|
2178
|
+
const nodeRef = createRef<HostInstance>();
|
|
2179
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
2180
|
+
|
|
2181
|
+
const root = Fantom.createRoot({
|
|
2182
|
+
viewportWidth: 1000,
|
|
2183
|
+
viewportHeight: 1000,
|
|
2184
|
+
});
|
|
2185
|
+
|
|
2186
|
+
Fantom.runTask(() => {
|
|
2187
|
+
root.render(
|
|
2188
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
2189
|
+
<View
|
|
2190
|
+
style={{
|
|
2191
|
+
marginTop: 250,
|
|
2192
|
+
width: 50,
|
|
2193
|
+
height: 50,
|
|
2194
|
+
}}
|
|
2195
|
+
ref={nodeRef}
|
|
2196
|
+
/>
|
|
2197
|
+
</View>,
|
|
2198
|
+
);
|
|
2199
|
+
});
|
|
2200
|
+
|
|
2201
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2202
|
+
const scrollNode = ensureReactNativeElement(rootNodeRef.current);
|
|
2203
|
+
const intersectionObserverCallback = jest.fn();
|
|
2204
|
+
|
|
2205
|
+
Fantom.runTask(() => {
|
|
2206
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2207
|
+
root: scrollNode,
|
|
2208
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2209
|
+
rootMargin: '0px 0px 100px 0px',
|
|
2210
|
+
});
|
|
2211
|
+
observer.observe(node);
|
|
2212
|
+
});
|
|
2213
|
+
|
|
2214
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2215
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2216
|
+
expect(entries.length).toBe(1);
|
|
2217
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2218
|
+
});
|
|
2219
|
+
});
|
|
2220
|
+
|
|
2221
|
+
describe('contracting', () => {
|
|
2222
|
+
it('partial intersection on explicit root', () => {
|
|
2223
|
+
const nodeRef = createRef<HostInstance>();
|
|
2224
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
2225
|
+
|
|
2226
|
+
const root = Fantom.createRoot({
|
|
2227
|
+
viewportWidth: 1000,
|
|
2228
|
+
viewportHeight: 1000,
|
|
2229
|
+
});
|
|
2230
|
+
|
|
2231
|
+
Fantom.runTask(() => {
|
|
2232
|
+
root.render(
|
|
2233
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
2234
|
+
<View
|
|
2235
|
+
style={{
|
|
2236
|
+
marginTop: 30,
|
|
2237
|
+
width: 100,
|
|
2238
|
+
height: 100,
|
|
2239
|
+
}}
|
|
2240
|
+
ref={nodeRef}
|
|
2241
|
+
/>
|
|
2242
|
+
</View>,
|
|
2243
|
+
);
|
|
2244
|
+
});
|
|
2245
|
+
|
|
2246
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2247
|
+
const scrollNode = ensureReactNativeElement(rootNodeRef.current);
|
|
2248
|
+
const intersectionObserverCallback = jest.fn();
|
|
2249
|
+
|
|
2250
|
+
Fantom.runTask(() => {
|
|
2251
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2252
|
+
root: scrollNode,
|
|
2253
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2254
|
+
rootMargin: '-50px',
|
|
2255
|
+
});
|
|
2256
|
+
observer.observe(node);
|
|
2257
|
+
});
|
|
2258
|
+
|
|
2259
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2260
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2261
|
+
expect(entries.length).toBe(1);
|
|
2262
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2263
|
+
expect(entries[0].intersectionRatio).toBe(0.4);
|
|
2264
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2265
|
+
x: 50,
|
|
2266
|
+
y: 50,
|
|
2267
|
+
width: 100,
|
|
2268
|
+
height: 100,
|
|
2269
|
+
});
|
|
2270
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2271
|
+
x: 50,
|
|
2272
|
+
y: 50,
|
|
2273
|
+
width: 50,
|
|
2274
|
+
height: 80,
|
|
2275
|
+
});
|
|
2276
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2277
|
+
x: 0,
|
|
2278
|
+
y: 30,
|
|
2279
|
+
width: 100,
|
|
2280
|
+
height: 100,
|
|
2281
|
+
});
|
|
2282
|
+
});
|
|
2283
|
+
|
|
2284
|
+
it('partial intersection with threshold on explicit root', () => {
|
|
2285
|
+
const nodeRef = createRef<HostInstance>();
|
|
2286
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
2287
|
+
|
|
2288
|
+
const root = Fantom.createRoot({
|
|
2289
|
+
viewportWidth: 1000,
|
|
2290
|
+
viewportHeight: 1000,
|
|
2291
|
+
});
|
|
2292
|
+
|
|
2293
|
+
Fantom.runTask(() => {
|
|
2294
|
+
root.render(
|
|
2295
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
2296
|
+
<View
|
|
2297
|
+
style={{
|
|
2298
|
+
width: 100,
|
|
2299
|
+
height: 100,
|
|
2300
|
+
}}
|
|
2301
|
+
ref={nodeRef}
|
|
2302
|
+
/>
|
|
2303
|
+
</View>,
|
|
2304
|
+
);
|
|
2305
|
+
});
|
|
2306
|
+
|
|
2307
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2308
|
+
const customRoot = ensureReactNativeElement(rootNodeRef.current);
|
|
2309
|
+
const intersectionObserverCallback = jest.fn();
|
|
2310
|
+
|
|
2311
|
+
Fantom.runTask(() => {
|
|
2312
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2313
|
+
root: customRoot,
|
|
2314
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2315
|
+
rootMargin: '-40px',
|
|
2316
|
+
threshold: 0.3,
|
|
2317
|
+
});
|
|
2318
|
+
observer.observe(node);
|
|
2319
|
+
});
|
|
2320
|
+
|
|
2321
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2322
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2323
|
+
expect(entries.length).toBe(1);
|
|
2324
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2325
|
+
expect(entries[0].intersectionRatio).toBe((60 * 60) / (100 * 100));
|
|
2326
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2327
|
+
x: 40,
|
|
2328
|
+
y: 40,
|
|
2329
|
+
width: 120,
|
|
2330
|
+
height: 120,
|
|
2331
|
+
});
|
|
2332
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2333
|
+
x: 40,
|
|
2334
|
+
y: 40,
|
|
2335
|
+
width: 60,
|
|
2336
|
+
height: 60,
|
|
2337
|
+
});
|
|
2338
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2339
|
+
x: 0,
|
|
2340
|
+
y: 0,
|
|
2341
|
+
width: 100,
|
|
2342
|
+
height: 100,
|
|
2343
|
+
});
|
|
2344
|
+
});
|
|
2345
|
+
|
|
2346
|
+
it('partial intersection on implicit root', () => {
|
|
2347
|
+
const nodeRef = createRef<HostInstance>();
|
|
2348
|
+
|
|
2349
|
+
const root = Fantom.createRoot({
|
|
2350
|
+
viewportWidth: 1000,
|
|
2351
|
+
viewportHeight: 1000,
|
|
2352
|
+
});
|
|
2353
|
+
|
|
2354
|
+
Fantom.runTask(() => {
|
|
2355
|
+
root.render(
|
|
2356
|
+
<View
|
|
2357
|
+
style={{
|
|
2358
|
+
position: 'absolute',
|
|
2359
|
+
top: 25,
|
|
2360
|
+
width: 100,
|
|
2361
|
+
height: 100,
|
|
2362
|
+
}}
|
|
2363
|
+
ref={nodeRef}
|
|
2364
|
+
/>,
|
|
2365
|
+
);
|
|
2366
|
+
});
|
|
2367
|
+
|
|
2368
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2369
|
+
const intersectionObserverCallback = jest.fn();
|
|
2370
|
+
|
|
2371
|
+
Fantom.runTask(() => {
|
|
2372
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2373
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2374
|
+
rootMargin: '-50px',
|
|
2375
|
+
});
|
|
2376
|
+
observer.observe(node);
|
|
2377
|
+
});
|
|
2378
|
+
|
|
2379
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2380
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2381
|
+
expect(entries.length).toBe(1);
|
|
2382
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2383
|
+
expect(entries[0].intersectionRatio).toBe(0.375);
|
|
2384
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2385
|
+
x: 50,
|
|
2386
|
+
y: 50,
|
|
2387
|
+
width: 900,
|
|
2388
|
+
height: 900,
|
|
2389
|
+
});
|
|
2390
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2391
|
+
x: 50,
|
|
2392
|
+
y: 50,
|
|
2393
|
+
width: 50,
|
|
2394
|
+
height: 75,
|
|
2395
|
+
});
|
|
2396
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2397
|
+
x: 0,
|
|
2398
|
+
y: 25,
|
|
2399
|
+
width: 100,
|
|
2400
|
+
height: 100,
|
|
2401
|
+
});
|
|
2402
|
+
});
|
|
2403
|
+
|
|
2404
|
+
it('edge-intersection with implicit root', () => {
|
|
2405
|
+
const nodeRef = createRef<HostInstance>();
|
|
2406
|
+
|
|
2407
|
+
const root = Fantom.createRoot({
|
|
2408
|
+
viewportWidth: 1000,
|
|
2409
|
+
viewportHeight: 1000,
|
|
2410
|
+
});
|
|
2411
|
+
|
|
2412
|
+
Fantom.runTask(() => {
|
|
2413
|
+
root.render(
|
|
2414
|
+
<View
|
|
2415
|
+
style={{
|
|
2416
|
+
width: 100,
|
|
2417
|
+
height: 100,
|
|
2418
|
+
}}
|
|
2419
|
+
ref={nodeRef}
|
|
2420
|
+
/>,
|
|
2421
|
+
);
|
|
2422
|
+
});
|
|
2423
|
+
|
|
2424
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2425
|
+
const intersectionObserverCallback = jest.fn();
|
|
2426
|
+
|
|
2427
|
+
Fantom.runTask(() => {
|
|
2428
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2429
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2430
|
+
rootMargin: '-100px',
|
|
2431
|
+
});
|
|
2432
|
+
observer.observe(node);
|
|
2433
|
+
});
|
|
2434
|
+
|
|
2435
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2436
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2437
|
+
expect(entries.length).toBe(1);
|
|
2438
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2439
|
+
x: 100,
|
|
2440
|
+
y: 100,
|
|
2441
|
+
width: 800,
|
|
2442
|
+
height: 800,
|
|
2443
|
+
});
|
|
2444
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2445
|
+
x: 100,
|
|
2446
|
+
y: 100,
|
|
2447
|
+
width: 0,
|
|
2448
|
+
height: 0,
|
|
2449
|
+
});
|
|
2450
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2451
|
+
x: 0,
|
|
2452
|
+
y: 0,
|
|
2453
|
+
width: 100,
|
|
2454
|
+
height: 100,
|
|
2455
|
+
});
|
|
2456
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2457
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
2458
|
+
});
|
|
2459
|
+
|
|
2460
|
+
it('no intersection with implicit root threshold 1', () => {
|
|
2461
|
+
const nodeRef = createRef<HostInstance>();
|
|
2462
|
+
|
|
2463
|
+
const root = Fantom.createRoot({
|
|
2464
|
+
viewportWidth: 1000,
|
|
2465
|
+
viewportHeight: 1000,
|
|
2466
|
+
});
|
|
2467
|
+
|
|
2468
|
+
Fantom.runTask(() => {
|
|
2469
|
+
root.render(
|
|
2470
|
+
<View
|
|
2471
|
+
style={{
|
|
2472
|
+
position: 'absolute',
|
|
2473
|
+
top: 80,
|
|
2474
|
+
left: 10,
|
|
2475
|
+
width: 100,
|
|
2476
|
+
height: 100,
|
|
2477
|
+
}}
|
|
2478
|
+
ref={nodeRef}
|
|
2479
|
+
/>,
|
|
2480
|
+
);
|
|
2481
|
+
});
|
|
2482
|
+
|
|
2483
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2484
|
+
const intersectionObserverCallback = jest.fn();
|
|
2485
|
+
|
|
2486
|
+
Fantom.runTask(() => {
|
|
2487
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2488
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2489
|
+
rootMargin: '-100px 0px 0px 0px',
|
|
2490
|
+
threshold: 1,
|
|
2491
|
+
});
|
|
2492
|
+
observer.observe(node);
|
|
2493
|
+
});
|
|
2494
|
+
|
|
2495
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2496
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2497
|
+
expect(entries.length).toBe(1);
|
|
2498
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
2499
|
+
expect(entries[0].intersectionRatio).toBe(0.8);
|
|
2500
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2501
|
+
x: 0,
|
|
2502
|
+
y: 100,
|
|
2503
|
+
width: 1000,
|
|
2504
|
+
height: 900,
|
|
2505
|
+
});
|
|
2506
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2507
|
+
x: 10,
|
|
2508
|
+
y: 100,
|
|
2509
|
+
width: 100,
|
|
2510
|
+
height: 80,
|
|
2511
|
+
});
|
|
2512
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2513
|
+
x: 10,
|
|
2514
|
+
y: 80,
|
|
2515
|
+
width: 100,
|
|
2516
|
+
height: 100,
|
|
2517
|
+
});
|
|
2518
|
+
});
|
|
2519
|
+
|
|
2520
|
+
it('no intersection on implicit root completely outside', () => {
|
|
2521
|
+
const nodeRef = createRef<HostInstance>();
|
|
2522
|
+
|
|
2523
|
+
const root = Fantom.createRoot({
|
|
2524
|
+
viewportWidth: 1000,
|
|
2525
|
+
viewportHeight: 1000,
|
|
2526
|
+
});
|
|
2527
|
+
|
|
2528
|
+
Fantom.runTask(() => {
|
|
2529
|
+
root.render(
|
|
2530
|
+
<View
|
|
2531
|
+
style={{
|
|
2532
|
+
position: 'absolute',
|
|
2533
|
+
top: 10,
|
|
2534
|
+
width: 100,
|
|
2535
|
+
height: 100,
|
|
2536
|
+
}}
|
|
2537
|
+
ref={nodeRef}
|
|
2538
|
+
/>,
|
|
2539
|
+
);
|
|
2540
|
+
});
|
|
2541
|
+
|
|
2542
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2543
|
+
const intersectionObserverCallback = jest.fn();
|
|
2544
|
+
|
|
2545
|
+
Fantom.runTask(() => {
|
|
2546
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2547
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2548
|
+
rootMargin: '-150px',
|
|
2549
|
+
});
|
|
2550
|
+
observer.observe(node);
|
|
2551
|
+
});
|
|
2552
|
+
|
|
2553
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2554
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2555
|
+
expect(entries.length).toBe(1);
|
|
2556
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
2557
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
2558
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2559
|
+
x: 150,
|
|
2560
|
+
y: 150,
|
|
2561
|
+
width: 700,
|
|
2562
|
+
height: 700,
|
|
2563
|
+
});
|
|
2564
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2565
|
+
x: 0,
|
|
2566
|
+
y: 0,
|
|
2567
|
+
width: 0,
|
|
2568
|
+
height: 0,
|
|
2569
|
+
});
|
|
2570
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2571
|
+
x: 0,
|
|
2572
|
+
y: 10,
|
|
2573
|
+
width: 100,
|
|
2574
|
+
height: 100,
|
|
2575
|
+
});
|
|
2576
|
+
});
|
|
2577
|
+
|
|
2578
|
+
it('full intersection with explicit root', () => {
|
|
2579
|
+
const nodeRef = createRef<HostInstance>();
|
|
2580
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
2581
|
+
|
|
2582
|
+
const root = Fantom.createRoot({
|
|
2583
|
+
viewportWidth: 1000,
|
|
2584
|
+
viewportHeight: 1000,
|
|
2585
|
+
});
|
|
2586
|
+
|
|
2587
|
+
Fantom.runTask(() => {
|
|
2588
|
+
root.render(
|
|
2589
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
2590
|
+
<View
|
|
2591
|
+
style={{
|
|
2592
|
+
marginTop: 60,
|
|
2593
|
+
width: 80,
|
|
2594
|
+
height: 80,
|
|
2595
|
+
}}
|
|
2596
|
+
ref={nodeRef}
|
|
2597
|
+
/>
|
|
2598
|
+
</View>,
|
|
2599
|
+
);
|
|
2600
|
+
});
|
|
2601
|
+
|
|
2602
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2603
|
+
const rootNode = ensureReactNativeElement(rootNodeRef.current);
|
|
2604
|
+
const intersectionObserverCallback = jest.fn();
|
|
2605
|
+
|
|
2606
|
+
Fantom.runTask(() => {
|
|
2607
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2608
|
+
root: rootNode,
|
|
2609
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2610
|
+
rootMargin: '-50px',
|
|
2611
|
+
});
|
|
2612
|
+
observer.observe(node);
|
|
2613
|
+
});
|
|
2614
|
+
|
|
2615
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2616
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2617
|
+
expect(entries.length).toBe(1);
|
|
2618
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2619
|
+
x: 50,
|
|
2620
|
+
y: 50,
|
|
2621
|
+
width: 100,
|
|
2622
|
+
height: 100,
|
|
2623
|
+
});
|
|
2624
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2625
|
+
x: 50,
|
|
2626
|
+
y: 60,
|
|
2627
|
+
width: 30,
|
|
2628
|
+
height: 80,
|
|
2629
|
+
});
|
|
2630
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2631
|
+
x: 0,
|
|
2632
|
+
y: 60,
|
|
2633
|
+
width: 80,
|
|
2634
|
+
height: 80,
|
|
2635
|
+
});
|
|
2636
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2637
|
+
expect(entries[0].intersectionRatio).toBe(0.375);
|
|
2638
|
+
});
|
|
2639
|
+
|
|
2640
|
+
it('no intersection with explicit root', () => {
|
|
2641
|
+
const nodeRef = createRef<HostInstance>();
|
|
2642
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
2643
|
+
|
|
2644
|
+
const root = Fantom.createRoot({
|
|
2645
|
+
viewportWidth: 1000,
|
|
2646
|
+
viewportHeight: 1000,
|
|
2647
|
+
});
|
|
2648
|
+
|
|
2649
|
+
Fantom.runTask(() => {
|
|
2650
|
+
root.render(
|
|
2651
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
2652
|
+
<View
|
|
2653
|
+
style={{
|
|
2654
|
+
marginTop: -50,
|
|
2655
|
+
width: 50,
|
|
2656
|
+
height: 50,
|
|
2657
|
+
}}
|
|
2658
|
+
ref={nodeRef}
|
|
2659
|
+
/>
|
|
2660
|
+
</View>,
|
|
2661
|
+
);
|
|
2662
|
+
});
|
|
2663
|
+
|
|
2664
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2665
|
+
const scrollNode = ensureReactNativeElement(rootNodeRef.current);
|
|
2666
|
+
const intersectionObserverCallback = jest.fn();
|
|
2667
|
+
|
|
2668
|
+
Fantom.runTask(() => {
|
|
2669
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2670
|
+
root: scrollNode,
|
|
2671
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2672
|
+
rootMargin: '-50px',
|
|
2673
|
+
});
|
|
2674
|
+
observer.observe(node);
|
|
2675
|
+
});
|
|
2676
|
+
|
|
2677
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2678
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2679
|
+
expect(entries.length).toBe(1);
|
|
2680
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
2681
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
2682
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2683
|
+
x: 50,
|
|
2684
|
+
y: 50,
|
|
2685
|
+
width: 100,
|
|
2686
|
+
height: 100,
|
|
2687
|
+
});
|
|
2688
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2689
|
+
x: 0,
|
|
2690
|
+
y: 0,
|
|
2691
|
+
width: 0,
|
|
2692
|
+
height: 0,
|
|
2693
|
+
});
|
|
2694
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2695
|
+
x: 0,
|
|
2696
|
+
y: -50,
|
|
2697
|
+
width: 50,
|
|
2698
|
+
height: 50,
|
|
2699
|
+
});
|
|
2700
|
+
});
|
|
2701
|
+
});
|
|
2702
|
+
|
|
2703
|
+
describe('percentage', () => {
|
|
2704
|
+
it('full intersect with percentage rootMargin', () => {
|
|
2705
|
+
const nodeRef = createRef<HostInstance>();
|
|
2706
|
+
|
|
2707
|
+
const root = Fantom.createRoot({
|
|
2708
|
+
viewportWidth: 1000,
|
|
2709
|
+
viewportHeight: 1000,
|
|
2710
|
+
});
|
|
2711
|
+
|
|
2712
|
+
Fantom.runTask(() => {
|
|
2713
|
+
root.render(
|
|
2714
|
+
<View
|
|
2715
|
+
style={{
|
|
2716
|
+
position: 'absolute',
|
|
2717
|
+
top: -50,
|
|
2718
|
+
left: -50,
|
|
2719
|
+
width: 100,
|
|
2720
|
+
height: 100,
|
|
2721
|
+
}}
|
|
2722
|
+
ref={nodeRef}
|
|
2723
|
+
/>,
|
|
2724
|
+
);
|
|
2725
|
+
});
|
|
2726
|
+
|
|
2727
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2728
|
+
const intersectionObserverCallback = jest.fn();
|
|
2729
|
+
|
|
2730
|
+
Fantom.runTask(() => {
|
|
2731
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2732
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2733
|
+
rootMargin: '5%',
|
|
2734
|
+
});
|
|
2735
|
+
observer.observe(node);
|
|
2736
|
+
});
|
|
2737
|
+
|
|
2738
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2739
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2740
|
+
expect(entries.length).toBe(1);
|
|
2741
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2742
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
2743
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2744
|
+
x: -50,
|
|
2745
|
+
y: -50,
|
|
2746
|
+
width: 1100,
|
|
2747
|
+
height: 1100,
|
|
2748
|
+
});
|
|
2749
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2750
|
+
x: -50,
|
|
2751
|
+
y: -50,
|
|
2752
|
+
width: 100,
|
|
2753
|
+
height: 100,
|
|
2754
|
+
});
|
|
2755
|
+
});
|
|
2756
|
+
it('should calculate percentage rootMargin relative to root dimensions with custom root', () => {
|
|
2757
|
+
const nodeRef = createRef<HostInstance>();
|
|
2758
|
+
const rootNodeRef = createRef<HostInstance>();
|
|
2759
|
+
|
|
2760
|
+
const root = Fantom.createRoot({
|
|
2761
|
+
viewportWidth: 1000,
|
|
2762
|
+
viewportHeight: 1000,
|
|
2763
|
+
});
|
|
2764
|
+
|
|
2765
|
+
Fantom.runTask(() => {
|
|
2766
|
+
root.render(
|
|
2767
|
+
<View style={{width: 200, height: 200}} ref={rootNodeRef}>
|
|
2768
|
+
<View
|
|
2769
|
+
style={{
|
|
2770
|
+
width: 50,
|
|
2771
|
+
height: 50,
|
|
2772
|
+
}}
|
|
2773
|
+
ref={nodeRef}
|
|
2774
|
+
/>
|
|
2775
|
+
</View>,
|
|
2776
|
+
);
|
|
2777
|
+
});
|
|
2778
|
+
|
|
2779
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2780
|
+
const scrollNode = ensureReactNativeElement(rootNodeRef.current);
|
|
2781
|
+
const intersectionObserverCallback = jest.fn();
|
|
2782
|
+
|
|
2783
|
+
Fantom.runTask(() => {
|
|
2784
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2785
|
+
root: scrollNode,
|
|
2786
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2787
|
+
rootMargin: '-25%',
|
|
2788
|
+
});
|
|
2789
|
+
observer.observe(node);
|
|
2790
|
+
});
|
|
2791
|
+
|
|
2792
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2793
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2794
|
+
expect(entries.length).toBe(1);
|
|
2795
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2796
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
2797
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2798
|
+
x: 50,
|
|
2799
|
+
y: 50,
|
|
2800
|
+
width: 100,
|
|
2801
|
+
height: 100,
|
|
2802
|
+
});
|
|
2803
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2804
|
+
x: 50,
|
|
2805
|
+
y: 50,
|
|
2806
|
+
width: 0,
|
|
2807
|
+
height: 0,
|
|
2808
|
+
});
|
|
2809
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2810
|
+
x: 0,
|
|
2811
|
+
y: 0,
|
|
2812
|
+
width: 50,
|
|
2813
|
+
height: 50,
|
|
2814
|
+
});
|
|
2815
|
+
});
|
|
2816
|
+
it('should handle mixed px and percentage rootMargin values', () => {
|
|
2817
|
+
const nodeRef = createRef<HostInstance>();
|
|
2818
|
+
|
|
2819
|
+
const root = Fantom.createRoot({
|
|
2820
|
+
viewportWidth: 1000,
|
|
2821
|
+
viewportHeight: 1000,
|
|
2822
|
+
});
|
|
2823
|
+
|
|
2824
|
+
Fantom.runTask(() => {
|
|
2825
|
+
root.render(
|
|
2826
|
+
<View
|
|
2827
|
+
style={{
|
|
2828
|
+
position: 'absolute',
|
|
2829
|
+
top: -100,
|
|
2830
|
+
left: 0,
|
|
2831
|
+
width: 100,
|
|
2832
|
+
height: 100,
|
|
2833
|
+
}}
|
|
2834
|
+
ref={nodeRef}
|
|
2835
|
+
/>,
|
|
2836
|
+
);
|
|
2837
|
+
});
|
|
2838
|
+
|
|
2839
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2840
|
+
const intersectionObserverCallback = jest.fn();
|
|
2841
|
+
|
|
2842
|
+
Fantom.runTask(() => {
|
|
2843
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2844
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2845
|
+
rootMargin: '10% 0px 0px 0px',
|
|
2846
|
+
});
|
|
2847
|
+
observer.observe(node);
|
|
2848
|
+
});
|
|
2849
|
+
|
|
2850
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2851
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2852
|
+
expect(entries.length).toBe(1);
|
|
2853
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2854
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2855
|
+
x: 0,
|
|
2856
|
+
y: -100,
|
|
2857
|
+
width: 1000,
|
|
2858
|
+
height: 1100,
|
|
2859
|
+
});
|
|
2860
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2861
|
+
x: 0,
|
|
2862
|
+
y: -100,
|
|
2863
|
+
width: 100,
|
|
2864
|
+
height: 100,
|
|
2865
|
+
});
|
|
2866
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
2867
|
+
x: 0,
|
|
2868
|
+
y: -100,
|
|
2869
|
+
width: 100,
|
|
2870
|
+
height: 100,
|
|
2871
|
+
});
|
|
2872
|
+
});
|
|
2873
|
+
it('edge intersection with negative percentage rootMargin', () => {
|
|
2874
|
+
const nodeRef = createRef<HostInstance>();
|
|
2875
|
+
|
|
2876
|
+
const root = Fantom.createRoot({
|
|
2877
|
+
viewportWidth: 1000,
|
|
2878
|
+
viewportHeight: 1000,
|
|
2879
|
+
});
|
|
2880
|
+
|
|
2881
|
+
Fantom.runTask(() => {
|
|
2882
|
+
root.render(
|
|
2883
|
+
<View
|
|
2884
|
+
style={{
|
|
2885
|
+
width: 100,
|
|
2886
|
+
height: 100,
|
|
2887
|
+
}}
|
|
2888
|
+
ref={nodeRef}
|
|
2889
|
+
/>,
|
|
2890
|
+
);
|
|
2891
|
+
});
|
|
2892
|
+
|
|
2893
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2894
|
+
const intersectionObserverCallback = jest.fn();
|
|
2895
|
+
|
|
2896
|
+
Fantom.runTask(() => {
|
|
2897
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2898
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2899
|
+
rootMargin: '-10%',
|
|
2900
|
+
});
|
|
2901
|
+
observer.observe(node);
|
|
2902
|
+
});
|
|
2903
|
+
|
|
2904
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2905
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
2906
|
+
expect(entries.length).toBe(1);
|
|
2907
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
2908
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
2909
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
2910
|
+
x: 100,
|
|
2911
|
+
y: 100,
|
|
2912
|
+
width: 800,
|
|
2913
|
+
height: 800,
|
|
2914
|
+
});
|
|
2915
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
2916
|
+
x: 100,
|
|
2917
|
+
y: 100,
|
|
2918
|
+
width: 0,
|
|
2919
|
+
height: 0,
|
|
2920
|
+
});
|
|
2921
|
+
});
|
|
2922
|
+
});
|
|
2923
|
+
|
|
2924
|
+
it('should update intersection state when element moves with rootMargin', () => {
|
|
2925
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
2926
|
+
const nodeRef = createRef<HostInstance>();
|
|
2927
|
+
|
|
2928
|
+
const root = Fantom.createRoot({
|
|
2929
|
+
viewportWidth: 1000,
|
|
2930
|
+
viewportHeight: 1000,
|
|
2931
|
+
});
|
|
2932
|
+
|
|
2933
|
+
Fantom.runTask(() => {
|
|
2934
|
+
root.render(
|
|
2935
|
+
<ScrollView ref={scrollNodeRef}>
|
|
2936
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
2937
|
+
</ScrollView>,
|
|
2938
|
+
);
|
|
2939
|
+
});
|
|
2940
|
+
|
|
2941
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
2942
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
2943
|
+
const intersectionObserverCallback = jest.fn();
|
|
2944
|
+
|
|
2945
|
+
Fantom.runTask(() => {
|
|
2946
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
2947
|
+
// $FlowExpectedError[prop-missing] rootMargin is not even defined in Flow.
|
|
2948
|
+
rootMargin: '50px',
|
|
2949
|
+
});
|
|
2950
|
+
observer.observe(node);
|
|
2951
|
+
});
|
|
2952
|
+
|
|
2953
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
2954
|
+
const [entries1] = intersectionObserverCallback.mock.lastCall;
|
|
2955
|
+
expect(entries1[0].isIntersecting).toBe(true);
|
|
2956
|
+
|
|
2957
|
+
// Scroll element out of expanded viewport
|
|
2958
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
2959
|
+
|
|
2960
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(2);
|
|
2961
|
+
const [entries2] = intersectionObserverCallback.mock.lastCall;
|
|
2962
|
+
expect(entries2[0].isIntersecting).toBe(false);
|
|
2963
|
+
});
|
|
2964
|
+
});
|
|
2965
|
+
|
|
2966
|
+
it('should not retain initial children of observed targets', () => {
|
|
2967
|
+
const root = Fantom.createRoot();
|
|
2968
|
+
observer = new IntersectionObserver(() => {});
|
|
2969
|
+
|
|
2970
|
+
const [getReferenceCount, ref] = createShadowNodeReferenceCountingRef();
|
|
2971
|
+
|
|
2972
|
+
const observeRef: React.RefSetter<
|
|
2973
|
+
React.ElementRef<typeof View>,
|
|
2974
|
+
> = instance => {
|
|
2975
|
+
const element = ensureReactNativeElement(instance);
|
|
2976
|
+
observer.observe(element);
|
|
2977
|
+
return () => {
|
|
2978
|
+
observer.unobserve(element);
|
|
2979
|
+
};
|
|
2980
|
+
};
|
|
2981
|
+
|
|
2982
|
+
function Observe({children}: Readonly<{children?: React.Node}>) {
|
|
2983
|
+
return <View ref={observeRef}>{children}</View>;
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
Fantom.runTask(() => {
|
|
2987
|
+
root.render(
|
|
2988
|
+
<Observe>
|
|
2989
|
+
<View ref={ref} />
|
|
2990
|
+
</Observe>,
|
|
2991
|
+
);
|
|
2992
|
+
});
|
|
2993
|
+
|
|
2994
|
+
expect(getReferenceCount()).toBeGreaterThan(0);
|
|
2995
|
+
|
|
2996
|
+
Fantom.runTask(() => {
|
|
2997
|
+
root.render(<Observe />);
|
|
2998
|
+
});
|
|
2999
|
+
|
|
3000
|
+
expect(getReferenceCount()).toBe(0);
|
|
3001
|
+
});
|
|
3002
|
+
|
|
3003
|
+
it('should NOT report multiple entries when observing a target that exists and we modify it later in the same tick', () => {
|
|
3004
|
+
const root = Fantom.createRoot({
|
|
3005
|
+
viewportWidth: 1000,
|
|
3006
|
+
viewportHeight: 1000,
|
|
3007
|
+
});
|
|
3008
|
+
|
|
3009
|
+
const nodeRef = createRef<HostInstance>();
|
|
3010
|
+
|
|
3011
|
+
function TestComponent() {
|
|
3012
|
+
const [showView, setShowView] = useState(true);
|
|
3013
|
+
|
|
3014
|
+
return showView ? (
|
|
3015
|
+
<View
|
|
3016
|
+
onClick={() => {
|
|
3017
|
+
observer.observe(ensureReactNativeElement(nodeRef.current));
|
|
3018
|
+
setShowView(false);
|
|
3019
|
+
}}
|
|
3020
|
+
style={{width: 100, height: 100, backgroundColor: 'red'}}
|
|
3021
|
+
ref={nodeRef}
|
|
3022
|
+
/>
|
|
3023
|
+
) : null;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
Fantom.runTask(() => {
|
|
3027
|
+
root.render(<TestComponent />);
|
|
3028
|
+
});
|
|
3029
|
+
|
|
3030
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3031
|
+
|
|
3032
|
+
expect(node.isConnected).toBe(true);
|
|
3033
|
+
|
|
3034
|
+
const intersectionObserverCallback = jest.fn();
|
|
3035
|
+
|
|
3036
|
+
Fantom.runTask(() => {
|
|
3037
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
3038
|
+
});
|
|
3039
|
+
|
|
3040
|
+
// We use a discrete event to make sure React processes the update in the
|
|
3041
|
+
// same task.
|
|
3042
|
+
Fantom.dispatchNativeEvent(node, 'click');
|
|
3043
|
+
|
|
3044
|
+
expect(node.isConnected).toBe(false);
|
|
3045
|
+
|
|
3046
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3047
|
+
const [entries] = intersectionObserverCallback.mock.lastCall;
|
|
3048
|
+
expect(entries.length).toBe(1);
|
|
3049
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
3050
|
+
});
|
|
3051
|
+
|
|
3052
|
+
describe('rootThreshold', () => {
|
|
3053
|
+
it('should report partial intersecting initial state correctly', () => {
|
|
3054
|
+
const nodeRef = createRef<HostInstance>();
|
|
3055
|
+
|
|
3056
|
+
const root = Fantom.createRoot({
|
|
3057
|
+
viewportWidth: 1000,
|
|
3058
|
+
viewportHeight: 1000,
|
|
3059
|
+
});
|
|
3060
|
+
Fantom.runTask(() => {
|
|
3061
|
+
root.render(<View style={{width: 100, height: 100}} ref={nodeRef} />);
|
|
3062
|
+
});
|
|
3063
|
+
|
|
3064
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3065
|
+
|
|
3066
|
+
const intersectionObserverCallback = jest.fn();
|
|
3067
|
+
|
|
3068
|
+
Fantom.runTask(() => {
|
|
3069
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3070
|
+
rnRootThreshold: [1, 0.5, 0],
|
|
3071
|
+
});
|
|
3072
|
+
observer.observe(node);
|
|
3073
|
+
});
|
|
3074
|
+
|
|
3075
|
+
expect(observer.rnRootThresholds).toEqual([0, 0.5, 1]);
|
|
3076
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3077
|
+
|
|
3078
|
+
const [entries, reportedObserver] =
|
|
3079
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3080
|
+
expect(entries.length).toBe(1);
|
|
3081
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3082
|
+
expect(entries[0].target).toBe(node);
|
|
3083
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
3084
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.01);
|
|
3085
|
+
|
|
3086
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3087
|
+
x: 0,
|
|
3088
|
+
y: 0,
|
|
3089
|
+
width: 100,
|
|
3090
|
+
height: 100,
|
|
3091
|
+
});
|
|
3092
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3093
|
+
x: 0,
|
|
3094
|
+
y: 0,
|
|
3095
|
+
width: 100,
|
|
3096
|
+
height: 100,
|
|
3097
|
+
});
|
|
3098
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3099
|
+
x: 0,
|
|
3100
|
+
y: 0,
|
|
3101
|
+
width: 1000,
|
|
3102
|
+
height: 1000,
|
|
3103
|
+
});
|
|
3104
|
+
|
|
3105
|
+
expect(reportedObserver).toBe(observer);
|
|
3106
|
+
});
|
|
3107
|
+
|
|
3108
|
+
it('should report partial non-intersecting initial state correctly', () => {
|
|
3109
|
+
const nodeRef = createRef<HostInstance>();
|
|
3110
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
3111
|
+
|
|
3112
|
+
const root = Fantom.createRoot({
|
|
3113
|
+
viewportWidth: 1000,
|
|
3114
|
+
viewportHeight: 1000,
|
|
3115
|
+
});
|
|
3116
|
+
Fantom.runTask(() => {
|
|
3117
|
+
root.render(
|
|
3118
|
+
<ScrollView ref={scrollNodeRef}>
|
|
3119
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
3120
|
+
</ScrollView>,
|
|
3121
|
+
);
|
|
3122
|
+
});
|
|
3123
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3124
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
3125
|
+
|
|
3126
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 25});
|
|
3127
|
+
|
|
3128
|
+
const intersectionObserverCallback = jest.fn();
|
|
3129
|
+
|
|
3130
|
+
Fantom.runTask(() => {
|
|
3131
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3132
|
+
rnRootThreshold: [0.5],
|
|
3133
|
+
});
|
|
3134
|
+
|
|
3135
|
+
observer.observe(node);
|
|
3136
|
+
});
|
|
3137
|
+
|
|
3138
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3139
|
+
const [entries, reportedObserver] =
|
|
3140
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3141
|
+
|
|
3142
|
+
expect(reportedObserver).toBe(observer);
|
|
3143
|
+
expect(entries.length).toBe(1);
|
|
3144
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3145
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
3146
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.00125);
|
|
3147
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
3148
|
+
expect(entries[0].target).toBe(node);
|
|
3149
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3150
|
+
x: 0,
|
|
3151
|
+
y: 0,
|
|
3152
|
+
width: 50,
|
|
3153
|
+
height: 25,
|
|
3154
|
+
});
|
|
3155
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3156
|
+
x: 0,
|
|
3157
|
+
y: -25,
|
|
3158
|
+
width: 50,
|
|
3159
|
+
height: 50,
|
|
3160
|
+
});
|
|
3161
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3162
|
+
x: 0,
|
|
3163
|
+
y: 0,
|
|
3164
|
+
width: 1000,
|
|
3165
|
+
height: 1000,
|
|
3166
|
+
});
|
|
3167
|
+
});
|
|
3168
|
+
|
|
3169
|
+
it('should report completely non-intersecting initial state correctly', () => {
|
|
3170
|
+
const nodeRef = createRef<HostInstance>();
|
|
3171
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
3172
|
+
|
|
3173
|
+
const root = Fantom.createRoot({
|
|
3174
|
+
viewportWidth: 1000,
|
|
3175
|
+
viewportHeight: 1000,
|
|
3176
|
+
});
|
|
3177
|
+
Fantom.runTask(() => {
|
|
3178
|
+
root.render(
|
|
3179
|
+
<ScrollView ref={scrollNodeRef}>
|
|
3180
|
+
<View style={{width: 50, height: 50}} ref={nodeRef} />
|
|
3181
|
+
</ScrollView>,
|
|
3182
|
+
);
|
|
3183
|
+
});
|
|
3184
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3185
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
3186
|
+
|
|
3187
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 200});
|
|
3188
|
+
|
|
3189
|
+
const intersectionObserverCallback = jest.fn();
|
|
3190
|
+
|
|
3191
|
+
Fantom.runTask(() => {
|
|
3192
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3193
|
+
rnRootThreshold: [0.5],
|
|
3194
|
+
});
|
|
3195
|
+
|
|
3196
|
+
observer.observe(node);
|
|
3197
|
+
});
|
|
3198
|
+
|
|
3199
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3200
|
+
const [entries, reportedObserver] =
|
|
3201
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3202
|
+
|
|
3203
|
+
expect(reportedObserver).toBe(observer);
|
|
3204
|
+
expect(entries.length).toBe(1);
|
|
3205
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3206
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
3207
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0);
|
|
3208
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
3209
|
+
expect(entries[0].target).toBe(node);
|
|
3210
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3211
|
+
x: 0,
|
|
3212
|
+
y: 0,
|
|
3213
|
+
width: 0,
|
|
3214
|
+
height: 0,
|
|
3215
|
+
});
|
|
3216
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3217
|
+
x: 0,
|
|
3218
|
+
y: -200,
|
|
3219
|
+
width: 50,
|
|
3220
|
+
height: 50,
|
|
3221
|
+
});
|
|
3222
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3223
|
+
x: 0,
|
|
3224
|
+
y: 0,
|
|
3225
|
+
width: 1000,
|
|
3226
|
+
height: 1000,
|
|
3227
|
+
});
|
|
3228
|
+
});
|
|
3229
|
+
|
|
3230
|
+
it('should report subsequent updates correctly', () => {
|
|
3231
|
+
const nodeRef = createRef<HostInstance>();
|
|
3232
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
3233
|
+
|
|
3234
|
+
const root = Fantom.createRoot({
|
|
3235
|
+
viewportWidth: 1000,
|
|
3236
|
+
viewportHeight: 1000,
|
|
3237
|
+
});
|
|
3238
|
+
|
|
3239
|
+
Fantom.runTask(() => {
|
|
3240
|
+
root.render(
|
|
3241
|
+
<ScrollView ref={scrollNodeRef}>
|
|
3242
|
+
<View
|
|
3243
|
+
style={{
|
|
3244
|
+
width: 1000,
|
|
3245
|
+
height: 1000,
|
|
3246
|
+
}}
|
|
3247
|
+
ref={nodeRef}
|
|
3248
|
+
/>
|
|
3249
|
+
<View
|
|
3250
|
+
style={{
|
|
3251
|
+
width: 1000,
|
|
3252
|
+
height: 2000, // This view purely to add height
|
|
3253
|
+
}}
|
|
3254
|
+
/>
|
|
3255
|
+
</ScrollView>,
|
|
3256
|
+
);
|
|
3257
|
+
});
|
|
3258
|
+
|
|
3259
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3260
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
3261
|
+
|
|
3262
|
+
// Scroll such that target View is not intersecting
|
|
3263
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 2000});
|
|
3264
|
+
|
|
3265
|
+
expect(node.isConnected).toBe(true);
|
|
3266
|
+
|
|
3267
|
+
const intersectionObserverCallback = jest.fn();
|
|
3268
|
+
|
|
3269
|
+
Fantom.runTask(() => {
|
|
3270
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3271
|
+
rnRootThreshold: [1],
|
|
3272
|
+
});
|
|
3273
|
+
observer.observe(node);
|
|
3274
|
+
});
|
|
3275
|
+
|
|
3276
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3277
|
+
const [entries, reportedObserver] =
|
|
3278
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3279
|
+
expect(entries.length).toBe(1);
|
|
3280
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3281
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
3282
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0);
|
|
3283
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
3284
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3285
|
+
x: 0,
|
|
3286
|
+
y: 0,
|
|
3287
|
+
width: 0,
|
|
3288
|
+
height: 0,
|
|
3289
|
+
});
|
|
3290
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3291
|
+
x: 0,
|
|
3292
|
+
y: -2000,
|
|
3293
|
+
width: 1000,
|
|
3294
|
+
height: 1000,
|
|
3295
|
+
});
|
|
3296
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3297
|
+
x: 0,
|
|
3298
|
+
y: 0,
|
|
3299
|
+
width: 1000,
|
|
3300
|
+
height: 1000,
|
|
3301
|
+
});
|
|
3302
|
+
|
|
3303
|
+
expect(reportedObserver).toBe(observer);
|
|
3304
|
+
|
|
3305
|
+
// Scroll target View into viewport
|
|
3306
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 0});
|
|
3307
|
+
|
|
3308
|
+
expect(node.isConnected).toBe(true);
|
|
3309
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(2);
|
|
3310
|
+
const [entries2, reportedObserver2] =
|
|
3311
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3312
|
+
expect(entries2.length).toBe(1);
|
|
3313
|
+
expect(entries2[0].isIntersecting).toBe(true);
|
|
3314
|
+
expect(entries2[0].intersectionRatio).toBe(1);
|
|
3315
|
+
expect(entries2[0].rnRootIntersectionRatio).toBe(1);
|
|
3316
|
+
expect(entries2[0].target).toBe(node);
|
|
3317
|
+
|
|
3318
|
+
expectRectEquals(entries2[0].intersectionRect, {
|
|
3319
|
+
x: 0,
|
|
3320
|
+
y: 0,
|
|
3321
|
+
width: 1000,
|
|
3322
|
+
height: 1000,
|
|
3323
|
+
});
|
|
3324
|
+
expectRectEquals(entries2[0].boundingClientRect, {
|
|
3325
|
+
x: 0,
|
|
3326
|
+
y: 0,
|
|
3327
|
+
width: 1000,
|
|
3328
|
+
height: 1000,
|
|
3329
|
+
});
|
|
3330
|
+
expectRectEquals(entries2[0].rootBounds, {
|
|
3331
|
+
x: 0,
|
|
3332
|
+
y: 0,
|
|
3333
|
+
width: 1000,
|
|
3334
|
+
height: 1000,
|
|
3335
|
+
});
|
|
3336
|
+
|
|
3337
|
+
expect(reportedObserver2).toBe(observer);
|
|
3338
|
+
});
|
|
3339
|
+
});
|
|
3340
|
+
});
|
|
3341
|
+
|
|
3342
|
+
describe('intersectionRect is relative to root', () => {
|
|
3343
|
+
it('should report intersectionRect for implicit root', () => {
|
|
3344
|
+
const node1Ref = React.createRef<HostInstance>();
|
|
3345
|
+
|
|
3346
|
+
const root = Fantom.createRoot({
|
|
3347
|
+
viewportWidth: 1000,
|
|
3348
|
+
viewportHeight: 1000,
|
|
3349
|
+
});
|
|
3350
|
+
|
|
3351
|
+
Fantom.runTask(() => {
|
|
3352
|
+
root.render(
|
|
3353
|
+
<>
|
|
3354
|
+
<View
|
|
3355
|
+
style={{
|
|
3356
|
+
position: 'absolute',
|
|
3357
|
+
top: -50,
|
|
3358
|
+
width: 100,
|
|
3359
|
+
height: 100,
|
|
3360
|
+
}}
|
|
3361
|
+
ref={node1Ref}
|
|
3362
|
+
/>
|
|
3363
|
+
</>,
|
|
3364
|
+
);
|
|
3365
|
+
});
|
|
3366
|
+
|
|
3367
|
+
const node1 = ensureReactNativeElement(node1Ref.current);
|
|
3368
|
+
|
|
3369
|
+
const intersectionObserverCallback = jest.fn();
|
|
3370
|
+
|
|
3371
|
+
Fantom.runTask(() => {
|
|
3372
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
3373
|
+
observer.observe(node1);
|
|
3374
|
+
});
|
|
3375
|
+
|
|
3376
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3377
|
+
const [entries, reportedObserver] =
|
|
3378
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3379
|
+
|
|
3380
|
+
expect(reportedObserver).toBe(observer);
|
|
3381
|
+
expect(entries.length).toBe(1);
|
|
3382
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3383
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3384
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
3385
|
+
expect(entries[0].target).toBe(node1);
|
|
3386
|
+
|
|
3387
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3388
|
+
x: 0,
|
|
3389
|
+
y: 0,
|
|
3390
|
+
width: 100,
|
|
3391
|
+
height: 50,
|
|
3392
|
+
});
|
|
3393
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3394
|
+
x: 0,
|
|
3395
|
+
y: -50,
|
|
3396
|
+
width: 100,
|
|
3397
|
+
height: 100,
|
|
3398
|
+
});
|
|
3399
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3400
|
+
x: 0,
|
|
3401
|
+
y: 0,
|
|
3402
|
+
width: 1000,
|
|
3403
|
+
height: 1000,
|
|
3404
|
+
});
|
|
3405
|
+
});
|
|
3406
|
+
|
|
3407
|
+
it('should report intersectionRect for explicit root', () => {
|
|
3408
|
+
const node1Ref = React.createRef<HostInstance>();
|
|
3409
|
+
const node2Ref = React.createRef<HostInstance>();
|
|
3410
|
+
|
|
3411
|
+
const root = Fantom.createRoot({
|
|
3412
|
+
viewportWidth: 1000,
|
|
3413
|
+
viewportHeight: 1000,
|
|
3414
|
+
});
|
|
3415
|
+
|
|
3416
|
+
Fantom.runTask(() => {
|
|
3417
|
+
root.render(
|
|
3418
|
+
<>
|
|
3419
|
+
<View
|
|
3420
|
+
style={{
|
|
3421
|
+
position: 'relative',
|
|
3422
|
+
marginTop: -50,
|
|
3423
|
+
width: 500,
|
|
3424
|
+
height: 500,
|
|
3425
|
+
}}
|
|
3426
|
+
ref={node1Ref}>
|
|
3427
|
+
<View
|
|
3428
|
+
style={{
|
|
3429
|
+
position: 'absolute',
|
|
3430
|
+
width: 100,
|
|
3431
|
+
height: 100,
|
|
3432
|
+
top: -50,
|
|
3433
|
+
}}
|
|
3434
|
+
ref={node2Ref}
|
|
3435
|
+
/>
|
|
3436
|
+
</View>
|
|
3437
|
+
</>,
|
|
3438
|
+
);
|
|
3439
|
+
});
|
|
3440
|
+
|
|
3441
|
+
const node1 = ensureReactNativeElement(node1Ref.current);
|
|
3442
|
+
const node2 = ensureReactNativeElement(node2Ref.current);
|
|
3443
|
+
|
|
3444
|
+
const intersectionObserverCallback = jest.fn();
|
|
3445
|
+
|
|
3446
|
+
Fantom.runTask(() => {
|
|
3447
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3448
|
+
root: node1,
|
|
3449
|
+
});
|
|
3450
|
+
|
|
3451
|
+
observer.observe(node2);
|
|
3452
|
+
});
|
|
3453
|
+
|
|
3454
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3455
|
+
const [entries, reportedObserver] =
|
|
3456
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3457
|
+
|
|
3458
|
+
expect(reportedObserver).toBe(observer);
|
|
3459
|
+
expect(entries.length).toBe(1);
|
|
3460
|
+
|
|
3461
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3462
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3463
|
+
x: 0,
|
|
3464
|
+
y: -50,
|
|
3465
|
+
width: 100,
|
|
3466
|
+
height: 50,
|
|
3467
|
+
});
|
|
3468
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3469
|
+
x: 0,
|
|
3470
|
+
y: -100,
|
|
3471
|
+
width: 100,
|
|
3472
|
+
height: 100,
|
|
3473
|
+
});
|
|
3474
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3475
|
+
x: 0,
|
|
3476
|
+
y: -50,
|
|
3477
|
+
width: 500,
|
|
3478
|
+
height: 500,
|
|
3479
|
+
});
|
|
3480
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3481
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
3482
|
+
expect(entries[0].target).toBe(node2);
|
|
3483
|
+
});
|
|
3484
|
+
});
|
|
3485
|
+
|
|
3486
|
+
describe('edge-adjacent intersection', () => {
|
|
3487
|
+
it('should report edge intersect with implicit root', () => {
|
|
3488
|
+
const node1Ref = React.createRef<HostInstance>();
|
|
3489
|
+
|
|
3490
|
+
const root = Fantom.createRoot({
|
|
3491
|
+
viewportWidth: 1000,
|
|
3492
|
+
viewportHeight: 1000,
|
|
3493
|
+
});
|
|
3494
|
+
|
|
3495
|
+
Fantom.runTask(() => {
|
|
3496
|
+
root.render(
|
|
3497
|
+
<>
|
|
3498
|
+
<View
|
|
3499
|
+
style={{
|
|
3500
|
+
position: 'absolute',
|
|
3501
|
+
top: -100,
|
|
3502
|
+
width: 100,
|
|
3503
|
+
height: 100,
|
|
3504
|
+
}}
|
|
3505
|
+
ref={node1Ref}
|
|
3506
|
+
/>
|
|
3507
|
+
</>,
|
|
3508
|
+
);
|
|
3509
|
+
});
|
|
3510
|
+
|
|
3511
|
+
const node1 = ensureReactNativeElement(node1Ref.current);
|
|
3512
|
+
|
|
3513
|
+
const intersectionObserverCallback = jest.fn();
|
|
3514
|
+
|
|
3515
|
+
Fantom.runTask(() => {
|
|
3516
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
3517
|
+
observer.observe(node1);
|
|
3518
|
+
});
|
|
3519
|
+
|
|
3520
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3521
|
+
const [entries, reportedObserver] =
|
|
3522
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3523
|
+
|
|
3524
|
+
expect(reportedObserver).toBe(observer);
|
|
3525
|
+
expect(entries.length).toBe(1);
|
|
3526
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3527
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3528
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
3529
|
+
expect(entries[0].target).toBe(node1);
|
|
3530
|
+
|
|
3531
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3532
|
+
x: 0,
|
|
3533
|
+
y: 0,
|
|
3534
|
+
width: 100,
|
|
3535
|
+
height: 0,
|
|
3536
|
+
});
|
|
3537
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3538
|
+
x: 0,
|
|
3539
|
+
y: -100,
|
|
3540
|
+
width: 100,
|
|
3541
|
+
height: 100,
|
|
3542
|
+
});
|
|
3543
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3544
|
+
x: 0,
|
|
3545
|
+
y: 0,
|
|
3546
|
+
width: 1000,
|
|
3547
|
+
height: 1000,
|
|
3548
|
+
});
|
|
3549
|
+
});
|
|
3550
|
+
|
|
3551
|
+
it('should report edge-adjacent views with zero intersection area', () => {
|
|
3552
|
+
const node1Ref = React.createRef<HostInstance>();
|
|
3553
|
+
const node2Ref = React.createRef<HostInstance>();
|
|
3554
|
+
|
|
3555
|
+
const root = Fantom.createRoot({
|
|
3556
|
+
viewportWidth: 1000,
|
|
3557
|
+
viewportHeight: 1000,
|
|
3558
|
+
});
|
|
3559
|
+
|
|
3560
|
+
Fantom.runTask(() => {
|
|
3561
|
+
root.render(
|
|
3562
|
+
<>
|
|
3563
|
+
<View
|
|
3564
|
+
style={{
|
|
3565
|
+
position: 'relative',
|
|
3566
|
+
marginTop: 100,
|
|
3567
|
+
marginLeft: 100,
|
|
3568
|
+
width: 100,
|
|
3569
|
+
height: 100,
|
|
3570
|
+
}}
|
|
3571
|
+
ref={node1Ref}>
|
|
3572
|
+
<View
|
|
3573
|
+
style={{position: 'absolute', width: 50, height: 50, top: -50}}
|
|
3574
|
+
ref={node2Ref}
|
|
3575
|
+
/>
|
|
3576
|
+
</View>
|
|
3577
|
+
</>,
|
|
3578
|
+
);
|
|
3579
|
+
});
|
|
3580
|
+
|
|
3581
|
+
const node1 = ensureReactNativeElement(node1Ref.current);
|
|
3582
|
+
const node2 = ensureReactNativeElement(node2Ref.current);
|
|
3583
|
+
|
|
3584
|
+
const intersectionObserverCallback = jest.fn();
|
|
3585
|
+
|
|
3586
|
+
Fantom.runTask(() => {
|
|
3587
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3588
|
+
root: node1,
|
|
3589
|
+
});
|
|
3590
|
+
|
|
3591
|
+
observer.observe(node2);
|
|
3592
|
+
});
|
|
3593
|
+
|
|
3594
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3595
|
+
const [entries, reportedObserver] =
|
|
3596
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3597
|
+
|
|
3598
|
+
expect(reportedObserver).toBe(observer);
|
|
3599
|
+
expect(entries.length).toBe(1);
|
|
3600
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3601
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3602
|
+
expect(entries[0].intersectionRatio).toBe(0);
|
|
3603
|
+
expect(entries[0].target).toBe(node2);
|
|
3604
|
+
|
|
3605
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3606
|
+
x: 100,
|
|
3607
|
+
y: 100,
|
|
3608
|
+
width: 50,
|
|
3609
|
+
height: 0,
|
|
3610
|
+
});
|
|
3611
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3612
|
+
x: 100,
|
|
3613
|
+
y: 50,
|
|
3614
|
+
width: 50,
|
|
3615
|
+
height: 50,
|
|
3616
|
+
});
|
|
3617
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3618
|
+
x: 100,
|
|
3619
|
+
y: 100,
|
|
3620
|
+
width: 100,
|
|
3621
|
+
height: 100,
|
|
3622
|
+
});
|
|
3623
|
+
});
|
|
3624
|
+
});
|
|
3625
|
+
|
|
3626
|
+
describe('clipping behavior', () => {
|
|
3627
|
+
it('should report intersection for clipping ancestor', () => {
|
|
3628
|
+
const nodeRef = React.createRef<HostInstance>();
|
|
3629
|
+
const rootRef = React.createRef<HostInstance>();
|
|
3630
|
+
|
|
3631
|
+
const root = Fantom.createRoot({
|
|
3632
|
+
viewportWidth: 1000,
|
|
3633
|
+
viewportHeight: 1000,
|
|
3634
|
+
});
|
|
3635
|
+
Fantom.runTask(() => {
|
|
3636
|
+
root.render(
|
|
3637
|
+
<View style={{width: 99, height: 99, overflow: 'hidden'}}>
|
|
3638
|
+
<View ref={rootRef} style={{width: 200, height: 200}}>
|
|
3639
|
+
<View
|
|
3640
|
+
style={{width: 100, height: 100, marginTop: 100}}
|
|
3641
|
+
ref={nodeRef}
|
|
3642
|
+
/>
|
|
3643
|
+
</View>
|
|
3644
|
+
,
|
|
3645
|
+
</View>,
|
|
3646
|
+
);
|
|
3647
|
+
});
|
|
3648
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3649
|
+
const rootNode = ensureReactNativeElement(rootRef.current);
|
|
3650
|
+
|
|
3651
|
+
const intersectionObserverCallback = jest.fn();
|
|
3652
|
+
|
|
3653
|
+
Fantom.runTask(() => {
|
|
3654
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3655
|
+
root: rootNode,
|
|
3656
|
+
});
|
|
3657
|
+
|
|
3658
|
+
observer.observe(node);
|
|
3659
|
+
});
|
|
3660
|
+
|
|
3661
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3662
|
+
const [entries, reportedObserver] =
|
|
3663
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3664
|
+
|
|
3665
|
+
expect(reportedObserver).toBe(observer);
|
|
3666
|
+
expect(entries.length).toBe(1);
|
|
3667
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3668
|
+
expect(entries[0].intersectionRatio).toBe(1);
|
|
3669
|
+
// This is the ratio of intersection area / (explicit) root area
|
|
3670
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.25);
|
|
3671
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3672
|
+
expect(entries[0].target).toBe(node);
|
|
3673
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3674
|
+
x: 0,
|
|
3675
|
+
y: 100,
|
|
3676
|
+
width: 100,
|
|
3677
|
+
height: 100,
|
|
3678
|
+
});
|
|
3679
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3680
|
+
x: 0,
|
|
3681
|
+
y: 100,
|
|
3682
|
+
width: 100,
|
|
3683
|
+
height: 100,
|
|
3684
|
+
});
|
|
3685
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3686
|
+
x: 0,
|
|
3687
|
+
y: 0,
|
|
3688
|
+
width: 200,
|
|
3689
|
+
height: 200,
|
|
3690
|
+
});
|
|
3691
|
+
});
|
|
3692
|
+
|
|
3693
|
+
it('should report intersection for clipping root', () => {
|
|
3694
|
+
const nodeRef = React.createRef<HostInstance>();
|
|
3695
|
+
const rootRef = React.createRef<HostInstance>();
|
|
3696
|
+
|
|
3697
|
+
const root = Fantom.createRoot({
|
|
3698
|
+
viewportWidth: 1000,
|
|
3699
|
+
viewportHeight: 1000,
|
|
3700
|
+
});
|
|
3701
|
+
Fantom.runTask(() => {
|
|
3702
|
+
root.render(
|
|
3703
|
+
<View
|
|
3704
|
+
ref={rootRef}
|
|
3705
|
+
style={{width: 100, height: 100, overflow: 'hidden'}}>
|
|
3706
|
+
<View
|
|
3707
|
+
style={{width: 100, height: 100, marginTop: 50}}
|
|
3708
|
+
ref={nodeRef}
|
|
3709
|
+
/>
|
|
3710
|
+
</View>,
|
|
3711
|
+
);
|
|
3712
|
+
});
|
|
3713
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3714
|
+
const rootNode = ensureReactNativeElement(rootRef.current);
|
|
3715
|
+
|
|
3716
|
+
const intersectionObserverCallback = jest.fn();
|
|
3717
|
+
|
|
3718
|
+
Fantom.runTask(() => {
|
|
3719
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3720
|
+
root: rootNode,
|
|
3721
|
+
});
|
|
3722
|
+
|
|
3723
|
+
observer.observe(node);
|
|
3724
|
+
});
|
|
3725
|
+
|
|
3726
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3727
|
+
const [entries, reportedObserver] =
|
|
3728
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3729
|
+
|
|
3730
|
+
expect(reportedObserver).toBe(observer);
|
|
3731
|
+
expect(entries.length).toBe(1);
|
|
3732
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3733
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
3734
|
+
// This is the ratio of intersection area / (explicit) root area
|
|
3735
|
+
expect(entries[0].rnRootIntersectionRatio).toBe(0.5);
|
|
3736
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3737
|
+
expect(entries[0].target).toBe(node);
|
|
3738
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3739
|
+
x: 0,
|
|
3740
|
+
y: 50,
|
|
3741
|
+
width: 100,
|
|
3742
|
+
height: 50,
|
|
3743
|
+
});
|
|
3744
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3745
|
+
x: 0,
|
|
3746
|
+
y: 50,
|
|
3747
|
+
width: 100,
|
|
3748
|
+
height: 100,
|
|
3749
|
+
});
|
|
3750
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3751
|
+
x: 0,
|
|
3752
|
+
y: 0,
|
|
3753
|
+
width: 100,
|
|
3754
|
+
height: 100,
|
|
3755
|
+
});
|
|
3756
|
+
});
|
|
3757
|
+
|
|
3758
|
+
it('should report intersection for clipping ancestor with rootMargin', () => {
|
|
3759
|
+
const nodeRef = React.createRef<HostInstance>();
|
|
3760
|
+
const rootRef = React.createRef<HostInstance>();
|
|
3761
|
+
|
|
3762
|
+
const root = Fantom.createRoot({
|
|
3763
|
+
viewportWidth: 1000,
|
|
3764
|
+
viewportHeight: 1000,
|
|
3765
|
+
});
|
|
3766
|
+
Fantom.runTask(() => {
|
|
3767
|
+
root.render(
|
|
3768
|
+
<View style={{width: 5, height: 5, overflow: 'hidden'}}>
|
|
3769
|
+
<View ref={rootRef} style={{width: 200, height: 200}}>
|
|
3770
|
+
<View
|
|
3771
|
+
style={{width: 100, height: 100, marginTop: 100}}
|
|
3772
|
+
ref={nodeRef}
|
|
3773
|
+
/>
|
|
3774
|
+
</View>
|
|
3775
|
+
,
|
|
3776
|
+
</View>,
|
|
3777
|
+
);
|
|
3778
|
+
});
|
|
3779
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3780
|
+
const rootNode = ensureReactNativeElement(rootRef.current);
|
|
3781
|
+
|
|
3782
|
+
const intersectionObserverCallback = jest.fn();
|
|
3783
|
+
|
|
3784
|
+
Fantom.runTask(() => {
|
|
3785
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3786
|
+
root: rootNode,
|
|
3787
|
+
rootMargin: '-50px',
|
|
3788
|
+
});
|
|
3789
|
+
|
|
3790
|
+
observer.observe(node);
|
|
3791
|
+
});
|
|
3792
|
+
|
|
3793
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3794
|
+
const [entries, reportedObserver] =
|
|
3795
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3796
|
+
|
|
3797
|
+
expect(reportedObserver).toBe(observer);
|
|
3798
|
+
expect(entries.length).toBe(1);
|
|
3799
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3800
|
+
expect(entries[0].intersectionRatio).toBe((50 * 50) / (100 * 100));
|
|
3801
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3802
|
+
expect(entries[0].target).toBe(node);
|
|
3803
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3804
|
+
x: 50,
|
|
3805
|
+
y: 100,
|
|
3806
|
+
width: 50,
|
|
3807
|
+
height: 50,
|
|
3808
|
+
});
|
|
3809
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3810
|
+
x: 0,
|
|
3811
|
+
y: 100,
|
|
3812
|
+
width: 100,
|
|
3813
|
+
height: 100,
|
|
3814
|
+
});
|
|
3815
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3816
|
+
x: 50,
|
|
3817
|
+
y: 50,
|
|
3818
|
+
width: 100,
|
|
3819
|
+
height: 100,
|
|
3820
|
+
});
|
|
3821
|
+
});
|
|
3822
|
+
|
|
3823
|
+
it('should report intersection for clipping root with rootMargin', () => {
|
|
3824
|
+
const nodeRef = React.createRef<HostInstance>();
|
|
3825
|
+
const rootRef = React.createRef<HostInstance>();
|
|
3826
|
+
|
|
3827
|
+
const root = Fantom.createRoot({
|
|
3828
|
+
viewportWidth: 1000,
|
|
3829
|
+
viewportHeight: 1000,
|
|
3830
|
+
});
|
|
3831
|
+
Fantom.runTask(() => {
|
|
3832
|
+
root.render(
|
|
3833
|
+
<View
|
|
3834
|
+
ref={rootRef}
|
|
3835
|
+
style={{width: 100, height: 100, overflow: 'hidden'}}>
|
|
3836
|
+
<View
|
|
3837
|
+
style={{width: 100, height: 100, marginTop: 50}}
|
|
3838
|
+
ref={nodeRef}
|
|
3839
|
+
/>
|
|
3840
|
+
</View>,
|
|
3841
|
+
);
|
|
3842
|
+
});
|
|
3843
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3844
|
+
const rootNode = ensureReactNativeElement(rootRef.current);
|
|
3845
|
+
|
|
3846
|
+
const intersectionObserverCallback = jest.fn();
|
|
3847
|
+
|
|
3848
|
+
Fantom.runTask(() => {
|
|
3849
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
3850
|
+
root: rootNode,
|
|
3851
|
+
rootMargin: '10px',
|
|
3852
|
+
});
|
|
3853
|
+
|
|
3854
|
+
observer.observe(node);
|
|
3855
|
+
});
|
|
3856
|
+
|
|
3857
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
3858
|
+
const [entries, reportedObserver] =
|
|
3859
|
+
intersectionObserverCallback.mock.lastCall;
|
|
3860
|
+
|
|
3861
|
+
expect(reportedObserver).toBe(observer);
|
|
3862
|
+
expect(entries.length).toBe(1);
|
|
3863
|
+
expectRectEquals(entries[0].intersectionRect, {
|
|
3864
|
+
x: 0,
|
|
3865
|
+
y: 50,
|
|
3866
|
+
width: 100,
|
|
3867
|
+
height: 50,
|
|
3868
|
+
});
|
|
3869
|
+
expectRectEquals(entries[0].boundingClientRect, {
|
|
3870
|
+
x: 0,
|
|
3871
|
+
y: 50,
|
|
3872
|
+
width: 100,
|
|
3873
|
+
height: 100,
|
|
3874
|
+
});
|
|
3875
|
+
expectRectEquals(entries[0].rootBounds, {
|
|
3876
|
+
x: -10,
|
|
3877
|
+
y: -10,
|
|
3878
|
+
width: 120,
|
|
3879
|
+
height: 120,
|
|
3880
|
+
});
|
|
3881
|
+
|
|
3882
|
+
expect(entries[0]).toBeInstanceOf(IntersectionObserverEntry);
|
|
3883
|
+
expect(entries[0].intersectionRatio).toBe(0.5);
|
|
3884
|
+
expect(entries[0].isIntersecting).toBe(true);
|
|
3885
|
+
expect(entries[0].target).toBe(node);
|
|
3886
|
+
});
|
|
3887
|
+
});
|
|
3888
|
+
|
|
3889
|
+
describe('unobserve(target)', () => {
|
|
3890
|
+
it('should throw if `target` is not a `ReactNativeElement`', () => {
|
|
3891
|
+
observer = new IntersectionObserver(() => {});
|
|
3892
|
+
expect(() => {
|
|
3893
|
+
// $FlowExpectedError[incompatible-type]
|
|
3894
|
+
observer.unobserve('something');
|
|
3895
|
+
}).toThrow(
|
|
3896
|
+
"Failed to execute 'unobserve' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.",
|
|
3897
|
+
);
|
|
3898
|
+
});
|
|
3899
|
+
|
|
3900
|
+
it('should ignore the call if `target` was not observed (not fail)', () => {
|
|
3901
|
+
const nodeRef = createRef<HostInstance>();
|
|
3902
|
+
|
|
3903
|
+
const root = Fantom.createRoot();
|
|
3904
|
+
Fantom.runTask(() => {
|
|
3905
|
+
root.render(<View ref={nodeRef} />);
|
|
3906
|
+
});
|
|
3907
|
+
|
|
3908
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3909
|
+
const callback = jest.fn();
|
|
3910
|
+
|
|
3911
|
+
Fantom.runTask(() => {
|
|
3912
|
+
observer = new IntersectionObserver(callback);
|
|
3913
|
+
observer.unobserve(node);
|
|
3914
|
+
});
|
|
3915
|
+
|
|
3916
|
+
expect(callback).not.toHaveBeenCalled();
|
|
3917
|
+
});
|
|
3918
|
+
|
|
3919
|
+
it('should stop observing the target if it was observed', () => {
|
|
3920
|
+
const nodeRef = createRef<HostInstance>();
|
|
3921
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
3922
|
+
|
|
3923
|
+
const root = Fantom.createRoot();
|
|
3924
|
+
// View is not intersecting with ScrollView
|
|
3925
|
+
Fantom.runTask(() => {
|
|
3926
|
+
root.render(
|
|
3927
|
+
<ScrollView ref={scrollNodeRef}>
|
|
3928
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
3929
|
+
</ScrollView>,
|
|
3930
|
+
);
|
|
3931
|
+
});
|
|
3932
|
+
|
|
3933
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3934
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
3935
|
+
|
|
3936
|
+
Fantom.scrollTo(scrollNode, {x: 0, y: 100});
|
|
3937
|
+
|
|
3938
|
+
const callback = jest.fn();
|
|
3939
|
+
|
|
3940
|
+
Fantom.runTask(() => {
|
|
3941
|
+
observer = new IntersectionObserver(callback, {threshold: 1});
|
|
3942
|
+
observer.observe(node);
|
|
3943
|
+
});
|
|
3944
|
+
|
|
3945
|
+
// Should get initial non-intersecting entry on observation
|
|
3946
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
3947
|
+
const [entries] = callback.mock.lastCall;
|
|
3948
|
+
expect(entries.length).toBe(1);
|
|
3949
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
3950
|
+
|
|
3951
|
+
Fantom.runTask(() => {
|
|
3952
|
+
observer.unobserve(node);
|
|
3953
|
+
});
|
|
3954
|
+
|
|
3955
|
+
// Update View such that it is intersecting
|
|
3956
|
+
Fantom.runTask(() => {
|
|
3957
|
+
root.render(
|
|
3958
|
+
<ScrollView>
|
|
3959
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
3960
|
+
</ScrollView>,
|
|
3961
|
+
);
|
|
3962
|
+
});
|
|
3963
|
+
|
|
3964
|
+
// Expect no additional callback calls
|
|
3965
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
3966
|
+
});
|
|
3967
|
+
|
|
3968
|
+
it('should stop observing the target if it was observed (detached target after observing)', () => {
|
|
3969
|
+
const nodeRef = createRef<HostInstance>();
|
|
3970
|
+
|
|
3971
|
+
const root = Fantom.createRoot();
|
|
3972
|
+
Fantom.runTask(() => {
|
|
3973
|
+
root.render(<View ref={nodeRef} />);
|
|
3974
|
+
});
|
|
3975
|
+
|
|
3976
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
3977
|
+
|
|
3978
|
+
const callback = jest.fn();
|
|
3979
|
+
|
|
3980
|
+
Fantom.runTask(() => {
|
|
3981
|
+
observer = new IntersectionObserver(callback);
|
|
3982
|
+
observer.observe(node);
|
|
3983
|
+
});
|
|
3984
|
+
|
|
3985
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
3986
|
+
|
|
3987
|
+
Fantom.runTask(() => {
|
|
3988
|
+
root.render(<></>);
|
|
3989
|
+
});
|
|
3990
|
+
|
|
3991
|
+
expect(node.isConnected).toBe(false);
|
|
3992
|
+
|
|
3993
|
+
Fantom.runTask(() => {
|
|
3994
|
+
observer.unobserve(node);
|
|
3995
|
+
});
|
|
3996
|
+
|
|
3997
|
+
// expect no change in callback
|
|
3998
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
3999
|
+
});
|
|
4000
|
+
|
|
4001
|
+
it('should stop observing the target if it was observed (detached target before observing)', () => {
|
|
4002
|
+
const nodeRef = createRef<HostInstance>();
|
|
4003
|
+
|
|
4004
|
+
const root = Fantom.createRoot();
|
|
4005
|
+
Fantom.runTask(() => {
|
|
4006
|
+
root.render(<View ref={nodeRef} />);
|
|
4007
|
+
});
|
|
4008
|
+
|
|
4009
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
4010
|
+
|
|
4011
|
+
Fantom.runTask(() => {
|
|
4012
|
+
root.render(<></>);
|
|
4013
|
+
});
|
|
4014
|
+
expect(node.isConnected).toBe(false);
|
|
4015
|
+
|
|
4016
|
+
observer = new IntersectionObserver(() => {});
|
|
4017
|
+
observer.observe(node);
|
|
4018
|
+
observer.unobserve(node);
|
|
4019
|
+
});
|
|
4020
|
+
|
|
4021
|
+
it('should not report the initial state if the target is unobserved before it is delivered', () => {
|
|
4022
|
+
const nodeRef = createRef<HostInstance>();
|
|
4023
|
+
|
|
4024
|
+
const root = Fantom.createRoot();
|
|
4025
|
+
Fantom.runTask(() => {
|
|
4026
|
+
root.render(<View ref={nodeRef} />);
|
|
4027
|
+
});
|
|
4028
|
+
|
|
4029
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
4030
|
+
|
|
4031
|
+
const intersectionObserverCallback = jest.fn();
|
|
4032
|
+
|
|
4033
|
+
Fantom.runTask(() => {
|
|
4034
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
4035
|
+
observer.observe(node);
|
|
4036
|
+
observer.unobserve(node);
|
|
4037
|
+
});
|
|
4038
|
+
|
|
4039
|
+
expect(intersectionObserverCallback).not.toHaveBeenCalled();
|
|
4040
|
+
});
|
|
4041
|
+
|
|
4042
|
+
it('should not report updates if the target is unobserved before they are delivered', () => {
|
|
4043
|
+
const nodeRef = createRef<HostInstance>();
|
|
4044
|
+
const scrollNodeRef = createRef<HostInstance>();
|
|
4045
|
+
|
|
4046
|
+
const root = Fantom.createRoot();
|
|
4047
|
+
Fantom.runTask(() => {
|
|
4048
|
+
root.render(
|
|
4049
|
+
<ScrollView
|
|
4050
|
+
ref={receivedNode => {
|
|
4051
|
+
scrollNodeRef.current = receivedNode;
|
|
4052
|
+
}}>
|
|
4053
|
+
<View style={{width: 100, height: 100}} ref={nodeRef} />
|
|
4054
|
+
</ScrollView>,
|
|
4055
|
+
);
|
|
4056
|
+
});
|
|
4057
|
+
|
|
4058
|
+
const scrollNode = ensureReactNativeElement(scrollNodeRef.current);
|
|
4059
|
+
|
|
4060
|
+
// Scroll such that view is not intersecting with ScrollView
|
|
4061
|
+
Fantom.scrollTo(scrollNode, {
|
|
4062
|
+
x: 0,
|
|
4063
|
+
y: 100,
|
|
4064
|
+
});
|
|
4065
|
+
|
|
4066
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
4067
|
+
|
|
4068
|
+
const callback = jest.fn();
|
|
4069
|
+
|
|
4070
|
+
Fantom.runTask(() => {
|
|
4071
|
+
observer = new IntersectionObserver(callback, {threshold: 1});
|
|
4072
|
+
observer.observe(node);
|
|
4073
|
+
});
|
|
4074
|
+
|
|
4075
|
+
// Should get initial non-intersecting entry on observation
|
|
4076
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
4077
|
+
const [entries] = callback.mock.lastCall;
|
|
4078
|
+
expect(entries.length).toBe(1);
|
|
4079
|
+
expect(entries[0].isIntersecting).toBe(false);
|
|
4080
|
+
|
|
4081
|
+
Fantom.runTask(() => {
|
|
4082
|
+
observer.unobserve(node);
|
|
4083
|
+
});
|
|
4084
|
+
|
|
4085
|
+
// Scroll ScrollView such that View is intersecting
|
|
4086
|
+
Fantom.scrollTo(scrollNode, {
|
|
4087
|
+
x: 0,
|
|
4088
|
+
y: 0,
|
|
4089
|
+
});
|
|
4090
|
+
|
|
4091
|
+
// The callback should not be called again because the target was
|
|
4092
|
+
// unobserved before the callback was called with the update.
|
|
4093
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
4094
|
+
});
|
|
4095
|
+
|
|
4096
|
+
it('should not report updates if the target is unobserved before they are delivered (with other active targets)', () => {
|
|
4097
|
+
let maybeNode1;
|
|
4098
|
+
let maybeNode2;
|
|
4099
|
+
|
|
4100
|
+
const root = Fantom.createRoot();
|
|
4101
|
+
Fantom.runTask(() => {
|
|
4102
|
+
root.render(
|
|
4103
|
+
<>
|
|
4104
|
+
<View
|
|
4105
|
+
style={{width: 50, height: 50}}
|
|
4106
|
+
ref={receivedNode => {
|
|
4107
|
+
maybeNode1 = receivedNode;
|
|
4108
|
+
}}
|
|
4109
|
+
/>
|
|
4110
|
+
<View
|
|
4111
|
+
style={{width: 200, height: 200}}
|
|
4112
|
+
ref={receivedNode => {
|
|
4113
|
+
maybeNode2 = receivedNode;
|
|
4114
|
+
}}
|
|
4115
|
+
/>
|
|
4116
|
+
</>,
|
|
4117
|
+
);
|
|
4118
|
+
});
|
|
4119
|
+
const node1 = ensureReactNativeElement(maybeNode1);
|
|
4120
|
+
const node2 = ensureReactNativeElement(maybeNode2);
|
|
4121
|
+
|
|
4122
|
+
const intersectionObserverCallback = jest.fn();
|
|
4123
|
+
|
|
4124
|
+
Fantom.runTask(() => {
|
|
4125
|
+
observer = new IntersectionObserver(intersectionObserverCallback, {
|
|
4126
|
+
threshold: 0,
|
|
4127
|
+
});
|
|
4128
|
+
|
|
4129
|
+
observer.observe(node1);
|
|
4130
|
+
observer.observe(node2);
|
|
4131
|
+
});
|
|
4132
|
+
|
|
4133
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
4134
|
+
|
|
4135
|
+
Fantom.runTask(() => {
|
|
4136
|
+
observer.unobserve(node1);
|
|
4137
|
+
});
|
|
4138
|
+
|
|
4139
|
+
Fantom.runTask(() => {
|
|
4140
|
+
root.render(
|
|
4141
|
+
<>
|
|
4142
|
+
<View
|
|
4143
|
+
style={{width: 50, height: 50}}
|
|
4144
|
+
ref={receivedNode => {
|
|
4145
|
+
maybeNode1 = receivedNode;
|
|
4146
|
+
}}
|
|
4147
|
+
/>
|
|
4148
|
+
<View
|
|
4149
|
+
style={{width: 200, height: 200}}
|
|
4150
|
+
ref={receivedNode => {
|
|
4151
|
+
maybeNode2 = receivedNode;
|
|
4152
|
+
}}
|
|
4153
|
+
/>
|
|
4154
|
+
</>,
|
|
4155
|
+
);
|
|
4156
|
+
});
|
|
4157
|
+
|
|
4158
|
+
// There should be no additional callback becuase node1 was unobserved
|
|
4159
|
+
// and node2 has no change in intersecting state (threshold 0)
|
|
4160
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(1);
|
|
4161
|
+
});
|
|
4162
|
+
|
|
4163
|
+
// This is a regression test for a bug where the registration data for the
|
|
4164
|
+
// target was incorrectly cleaned up when a single observer stopped
|
|
4165
|
+
// observing it.
|
|
4166
|
+
it('should work with multiple intersection observer instances', () => {
|
|
4167
|
+
const nodeRef = createRef<HostInstance>();
|
|
4168
|
+
let observer1: IntersectionObserver;
|
|
4169
|
+
let observer2: IntersectionObserver;
|
|
4170
|
+
|
|
4171
|
+
const root = Fantom.createRoot();
|
|
4172
|
+
Fantom.runTask(() => {
|
|
4173
|
+
root.render(<View ref={nodeRef} />);
|
|
4174
|
+
});
|
|
4175
|
+
|
|
4176
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
4177
|
+
|
|
4178
|
+
Fantom.runTask(() => {
|
|
4179
|
+
observer1 = new IntersectionObserver(() => {});
|
|
4180
|
+
observer2 = new IntersectionObserver(() => {});
|
|
4181
|
+
|
|
4182
|
+
observer1.observe(node);
|
|
4183
|
+
observer2.observe(node);
|
|
4184
|
+
|
|
4185
|
+
observer1.unobserve(node);
|
|
4186
|
+
|
|
4187
|
+
// The second call shouldn't log errors (that would make the test fail).
|
|
4188
|
+
observer2.unobserve(node);
|
|
4189
|
+
});
|
|
4190
|
+
});
|
|
4191
|
+
});
|
|
4192
|
+
|
|
4193
|
+
describe('disconnect', () => {
|
|
4194
|
+
it('should do nothing if no targets are observed (not fail)', () => {
|
|
4195
|
+
const callback = jest.fn();
|
|
4196
|
+
|
|
4197
|
+
Fantom.runTask(() => {
|
|
4198
|
+
observer = new IntersectionObserver(callback);
|
|
4199
|
+
observer.disconnect();
|
|
4200
|
+
});
|
|
4201
|
+
|
|
4202
|
+
expect(callback).not.toHaveBeenCalled();
|
|
4203
|
+
});
|
|
4204
|
+
|
|
4205
|
+
it('should stop observing all observed targets', () => {
|
|
4206
|
+
let maybeNode1;
|
|
4207
|
+
let maybeNode2;
|
|
4208
|
+
|
|
4209
|
+
const root = Fantom.createRoot();
|
|
4210
|
+
Fantom.runTask(() => {
|
|
4211
|
+
root.render(
|
|
4212
|
+
<>
|
|
4213
|
+
<View
|
|
4214
|
+
style={{width: 50, height: 50}}
|
|
4215
|
+
ref={receivedNode => {
|
|
4216
|
+
maybeNode1 = receivedNode;
|
|
4217
|
+
}}
|
|
4218
|
+
/>
|
|
4219
|
+
<View
|
|
4220
|
+
style={{width: 200, height: 200}}
|
|
4221
|
+
ref={receivedNode => {
|
|
4222
|
+
maybeNode2 = receivedNode;
|
|
4223
|
+
}}
|
|
4224
|
+
/>
|
|
4225
|
+
</>,
|
|
4226
|
+
);
|
|
4227
|
+
});
|
|
4228
|
+
const node1 = ensureReactNativeElement(maybeNode1);
|
|
4229
|
+
const node2 = ensureReactNativeElement(maybeNode2);
|
|
4230
|
+
|
|
4231
|
+
const callback = jest.fn();
|
|
4232
|
+
|
|
4233
|
+
Fantom.runTask(() => {
|
|
4234
|
+
observer = new IntersectionObserver(callback);
|
|
4235
|
+
|
|
4236
|
+
observer.observe(node1);
|
|
4237
|
+
observer.observe(node2);
|
|
4238
|
+
|
|
4239
|
+
observer.disconnect();
|
|
4240
|
+
});
|
|
4241
|
+
|
|
4242
|
+
expect(callback).not.toHaveBeenCalled();
|
|
4243
|
+
});
|
|
4244
|
+
|
|
4245
|
+
it('should not dispatch pending entries when disconnecting', () => {
|
|
4246
|
+
const root = Fantom.createRoot({
|
|
4247
|
+
viewportWidth: 1000,
|
|
4248
|
+
viewportHeight: 1000,
|
|
4249
|
+
});
|
|
4250
|
+
|
|
4251
|
+
const nodeRef = createRef<HostInstance>();
|
|
4252
|
+
|
|
4253
|
+
Fantom.runTask(() => {
|
|
4254
|
+
root.render(<View ref={nodeRef} style={{width: 100, height: 100}} />);
|
|
4255
|
+
});
|
|
4256
|
+
|
|
4257
|
+
const node = ensureReactNativeElement(nodeRef.current);
|
|
4258
|
+
|
|
4259
|
+
const intersectionObserverCallback = jest.fn();
|
|
4260
|
+
|
|
4261
|
+
Fantom.runTask(() => {
|
|
4262
|
+
observer = new IntersectionObserver(intersectionObserverCallback);
|
|
4263
|
+
|
|
4264
|
+
// At the end of the current tick, we schedule the execution of the
|
|
4265
|
+
// intersection observer callback with the initial state of the
|
|
4266
|
+
// target.
|
|
4267
|
+
observer.observe(node);
|
|
4268
|
+
|
|
4269
|
+
// This is executed in the next tick, before the intersection observer
|
|
4270
|
+
// callback is called.
|
|
4271
|
+
Fantom.scheduleTask(() => {
|
|
4272
|
+
expect(intersectionObserverCallback).not.toHaveBeenCalled();
|
|
4273
|
+
|
|
4274
|
+
observer.disconnect();
|
|
4275
|
+
|
|
4276
|
+
expect(intersectionObserverCallback).toHaveBeenCalledTimes(0);
|
|
4277
|
+
});
|
|
4278
|
+
});
|
|
4279
|
+
});
|
|
4280
|
+
});
|
|
4281
|
+
|
|
4282
|
+
describe('IntersectionObserverEntry global constructor', () => {
|
|
4283
|
+
it('throws when called', () => {
|
|
4284
|
+
expect(
|
|
4285
|
+
() =>
|
|
4286
|
+
// The public stub throws regardless of arguments; the real class
|
|
4287
|
+
// requires two so Flow needs a suppression here.
|
|
4288
|
+
// $FlowExpectedError[incompatible-type]
|
|
4289
|
+
new IntersectionObserverEntry(),
|
|
4290
|
+
).toThrow(
|
|
4291
|
+
"Failed to construct 'IntersectionObserverEntry': Illegal constructor",
|
|
4292
|
+
);
|
|
4293
|
+
});
|
|
4294
|
+
});
|
|
4295
|
+
});
|