react-native-windows 0.0.0 → 0.0.1-0
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/.flowconfig +42 -17
- package/Chakra/Chakra.vcxitems +0 -5
- package/Chakra/Chakra.vcxitems.filters +2 -17
- package/Chakra/ChakraHelpers.cpp +2 -268
- package/Chakra/ChakraInstanceArgs.h +0 -29
- package/Chakra/ChakraPlatform.cpp +1 -1
- package/Chakra/ChakraPlatform.h +0 -4
- package/Chakra/ChakraTracing.cpp +0 -33
- package/Chakra/ChakraUtils.cpp +10 -14
- package/Chakra/ChakraUtils.h +2 -2
- package/Chakra/ChakraValue.cpp +6 -3
- package/Chakra/ChakraValue.h +2 -6
- package/Chakra/Utf8DebugExtensions.cpp +0 -5
- package/Chakra/Utf8DebugExtensions.h +0 -6
- package/Common/Common.vcxproj +7 -10
- package/Common/Common.vcxproj.filters +4 -1
- package/Common/Utilities.cpp +59 -0
- package/Common/packages.lock.json +26 -0
- package/Common/utilities.h +11 -0
- package/Directory.Build.props +53 -28
- package/Directory.Build.targets +13 -71
- package/Folly/.clang-format +2 -0
- package/Folly/Folly.vcxproj +75 -33
- package/Folly/Folly.vcxproj.filters +24 -5
- package/Folly/TEMP_UntilFollyUpdate/dynamic-inl.h +1439 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/SafeAssert.h +195 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +338 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +182 -0
- package/Folly/TEMP_UntilFollyUpdate/portability/Unistd.cpp +33 -0
- package/Folly/cgmanifest.json +15 -0
- package/Folly/packages.lock.json +23 -0
- package/Folly/pch.cpp +4 -0
- package/Folly/pch.h +18 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +86 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +36 -9
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +5 -43
- package/Libraries/Alert/Alert.d.ts +91 -0
- package/Libraries/Alert/Alert.js +28 -10
- package/Libraries/Alert/Alert.windows.js +68 -21
- package/Libraries/Alert/NativeAlertManager.js +5 -26
- package/Libraries/Alert/RCTAlertManager.android.js +2 -4
- package/Libraries/Alert/RCTAlertManager.ios.js +2 -3
- package/Libraries/Animated/Animated.d.ts +626 -0
- package/Libraries/Animated/Animated.js +14 -14
- package/Libraries/Animated/AnimatedEvent.js +53 -30
- package/Libraries/Animated/AnimatedImplementation.js +152 -111
- package/Libraries/Animated/AnimatedMock.js +79 -40
- package/Libraries/Animated/AnimatedPlatformConfig.js +13 -0
- package/Libraries/Animated/AnimatedWeb.js +9 -6
- package/Libraries/Animated/Easing.d.ts +37 -0
- package/Libraries/Animated/Easing.js +40 -42
- package/Libraries/Animated/NativeAnimatedHelper.js +352 -146
- package/Libraries/Animated/NativeAnimatedModule.js +5 -62
- package/Libraries/Animated/NativeAnimatedTurboModule.js +5 -64
- package/Libraries/Animated/SpringConfig.js +13 -18
- package/Libraries/Animated/animations/Animation.js +55 -15
- package/Libraries/Animated/animations/DecayAnimation.js +22 -9
- package/Libraries/Animated/animations/SpringAnimation.js +37 -18
- package/Libraries/Animated/animations/TimingAnimation.js +35 -20
- package/Libraries/Animated/bezier.js +23 -12
- package/Libraries/Animated/components/AnimatedFlatList.js +5 -17
- package/Libraries/Animated/components/AnimatedImage.js +5 -8
- package/Libraries/Animated/components/AnimatedScrollView.js +120 -16
- package/Libraries/Animated/components/AnimatedSectionList.js +5 -17
- package/Libraries/Animated/components/AnimatedText.js +5 -8
- package/Libraries/Animated/components/AnimatedView.js +5 -8
- package/Libraries/Animated/createAnimatedComponent.js +46 -265
- package/Libraries/Animated/nodes/AnimatedAddition.js +15 -14
- package/Libraries/Animated/nodes/AnimatedColor.js +320 -0
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +13 -12
- package/Libraries/Animated/nodes/AnimatedDivision.js +15 -14
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +200 -158
- package/Libraries/Animated/nodes/AnimatedModulo.js +13 -12
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +15 -15
- package/Libraries/Animated/nodes/AnimatedNode.js +38 -25
- package/Libraries/Animated/nodes/AnimatedObject.js +146 -0
- package/Libraries/Animated/nodes/AnimatedProps.js +51 -41
- package/Libraries/Animated/nodes/AnimatedStyle.js +57 -54
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +15 -14
- package/Libraries/Animated/nodes/AnimatedTracking.js +16 -18
- package/Libraries/Animated/nodes/AnimatedTransform.js +45 -36
- package/Libraries/Animated/nodes/AnimatedValue.js +66 -34
- package/Libraries/Animated/nodes/AnimatedValueXY.js +48 -38
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +12 -11
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +17 -0
- package/Libraries/Animated/useAnimatedProps.js +220 -0
- package/Libraries/Animated/useAnimatedValue.d.ts +15 -0
- package/Libraries/Animated/useAnimatedValue.js +25 -0
- package/Libraries/AppState/AppState.d.ts +58 -0
- package/Libraries/AppState/AppState.js +91 -142
- package/Libraries/AppState/NativeAppState.js +5 -22
- package/Libraries/AppTheme/AppTheme.js +90 -90
- package/Libraries/AppTheme/AppThemeTypes.d.ts +44 -23
- package/Libraries/AppTheme/NativeAppTheme.js +11 -0
- package/Libraries/BatchedBridge/BatchedBridge.js +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +77 -54
- package/Libraries/BatchedBridge/NativeModules.d.ts +25 -0
- package/Libraries/BatchedBridge/NativeModules.js +11 -6
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +1 -1
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +3 -3
- package/Libraries/Blob/Blob.js +13 -2
- package/Libraries/Blob/BlobManager.js +7 -10
- package/Libraries/Blob/BlobRegistry.js +15 -10
- package/Libraries/Blob/BlobTypes.js +1 -1
- package/Libraries/Blob/File.js +3 -4
- package/Libraries/Blob/FileReader.js +35 -15
- package/Libraries/Blob/NativeBlobModule.js +5 -52
- package/Libraries/Blob/NativeFileReaderModule.js +5 -15
- package/Libraries/Blob/URL.js +60 -47
- package/Libraries/Blob/__mocks__/BlobModule.js +1 -1
- package/Libraries/Blob/__mocks__/FileReaderModule.js +1 -1
- package/Libraries/BugReporting/BugReporting.js +3 -3
- package/Libraries/BugReporting/NativeBugReporting.js +5 -12
- package/Libraries/BugReporting/dumpReactTree.js +1 -1
- package/Libraries/BugReporting/getReactData.js +17 -8
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +157 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +421 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +350 -81
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +4 -18
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +5 -51
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js +36 -0
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.ios.js +26 -0
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.windows.js +36 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +86 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +18 -50
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +4 -47
- package/Libraries/Components/Button.d.ts +42 -0
- package/Libraries/Components/Button.js +152 -78
- package/Libraries/Components/Button.windows.js +273 -69
- package/Libraries/Components/Clipboard/Clipboard.d.ts +28 -0
- package/Libraries/Components/Clipboard/Clipboard.js +2 -4
- package/Libraries/Components/Clipboard/NativeClipboard.js +4 -13
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +4 -116
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +30 -29
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +141 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +12 -0
- package/Libraries/Components/Flyout/Flyout.d.ts +55 -20
- package/Libraries/Components/Flyout/Flyout.js +110 -75
- package/Libraries/Components/Flyout/FlyoutNativeComponent.js +45 -0
- package/Libraries/Components/Glyph/Glyph.d.ts +29 -13
- package/Libraries/Components/Glyph/Glyph.js +43 -56
- package/Libraries/Components/Glyph/GlyphNativeComponent.js +31 -0
- package/Libraries/Components/Keyboard/Keyboard.d.ts +109 -0
- package/Libraries/Components/Keyboard/Keyboard.js +78 -66
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +46 -0
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +81 -37
- package/Libraries/Components/Keyboard/KeyboardExt.d.ts +8 -6
- package/Libraries/Components/Keyboard/KeyboardExt.js +27 -60
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/Keyboard/KeyboardExtProps.d.ts +17 -43
- package/Libraries/Components/Keyboard/KeyboardExtProps.js +7 -24
- package/Libraries/Components/Keyboard/KeyboardExtProps.js.map +1 -1
- package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +4 -12
- package/Libraries/Components/Popup/Popup.d.ts +41 -20
- package/Libraries/Components/Popup/Popup.js +86 -76
- package/Libraries/Components/Popup/PopupNativeComponent.js +49 -0
- package/Libraries/Components/Pressable/Pressable.d.ts +167 -0
- package/Libraries/Components/Pressable/Pressable.js +128 -18
- package/Libraries/Components/Pressable/Pressable.windows.js +169 -44
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +27 -22
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +9 -10
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +83 -0
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +20 -0
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +5 -27
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +4 -77
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +4 -56
- package/Libraries/Components/RefreshControl/RefreshControl.d.ts +87 -0
- package/Libraries/Components/RefreshControl/RefreshControl.js +15 -37
- package/Libraries/Components/RefreshControl/RefreshControl.windows.js +15 -37
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +6 -9
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +4 -20
- package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +24 -0
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +12 -39
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +5 -32
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +34 -21
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +13 -20
- package/Libraries/Components/ScrollView/ScrollView.d.ts +910 -0
- package/Libraries/Components/ScrollView/ScrollView.js +1062 -410
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +4 -4
- package/Libraries/Components/ScrollView/ScrollViewContext.js +1 -3
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +164 -18
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +179 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +11 -16
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +237 -247
- package/Libraries/Components/ScrollView/processDecelerationRate.js +1 -3
- package/Libraries/Components/Sound/NativeSoundManager.js +4 -14
- package/Libraries/Components/Sound/SoundManager.js +2 -3
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +4 -60
- package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +4 -81
- package/Libraries/Components/StatusBar/StatusBar.d.ts +138 -0
- package/Libraries/Components/StatusBar/StatusBar.js +33 -33
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +5 -56
- package/Libraries/Components/Switch/Switch.d.ts +115 -0
- package/Libraries/Components/Switch/Switch.js +119 -127
- package/Libraries/Components/Switch/Switch.windows.js +257 -0
- package/Libraries/Components/Switch/SwitchNativeComponent.js +5 -50
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +241 -36
- package/Libraries/Components/TextInput/InputAccessoryView.d.ts +34 -0
- package/Libraries/Components/TextInput/InputAccessoryView.js +20 -24
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +5 -20
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +24 -9
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +16 -16
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +169 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +973 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +1092 -0
- package/Libraries/Components/TextInput/TextInput.js +935 -372
- package/Libraries/Components/TextInput/TextInput.windows.js +1096 -378
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +2 -4
- package/Libraries/Components/TextInput/TextInputState.js +33 -10
- package/Libraries/Components/TextInput/TextInputState.windows.js +42 -16
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +772 -9
- package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +4 -30
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +4 -5
- package/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +47 -0
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +45 -0
- package/Libraries/Components/Touchable/BoundingDimensions.js +4 -5
- package/Libraries/Components/Touchable/PooledClass.js +26 -15
- package/Libraries/Components/Touchable/Position.js +3 -4
- package/Libraries/Components/Touchable/Touchable.d.ts +90 -0
- package/Libraries/Components/Touchable/Touchable.js +99 -90
- package/Libraries/Components/Touchable/Touchable.windows.js +974 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +52 -18
- package/Libraries/Components/Touchable/TouchableHighlight.d.ts +68 -0
- package/Libraries/Components/Touchable/TouchableHighlight.js +60 -22
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +59 -17
- package/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +114 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +85 -37
- package/Libraries/Components/Touchable/TouchableOpacity.d.ts +109 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +89 -26
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +88 -21
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +143 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +87 -20
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +87 -20
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +4 -19
- package/Libraries/Components/UnimplementedViews/UnimplementedView.js +3 -4
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +167 -69
- package/Libraries/Components/View/ReactNativeViewAttributes.js +4 -3
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +61 -0
- package/Libraries/Components/View/View.d.ts +29 -0
- package/Libraries/Components/View/View.js +116 -13
- package/Libraries/Components/View/View.windows.js +250 -30
- package/Libraries/Components/View/ViewAccessibility.d.ts +415 -0
- package/Libraries/Components/View/ViewAccessibility.js +84 -3
- package/Libraries/Components/View/ViewAccessibility.windows.js +86 -3
- package/Libraries/Components/View/ViewNativeComponent.js +96 -57
- package/Libraries/Components/View/ViewPropTypes.d.ts +363 -0
- package/Libraries/Components/View/ViewPropTypes.js +200 -59
- package/Libraries/Components/View/ViewPropTypes.windows.js +221 -61
- package/Libraries/Core/Devtools/getDevServer.js +1 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.js +152 -0
- package/Libraries/Core/Devtools/openFileInEditor.js +5 -1
- package/Libraries/Core/Devtools/openURLInBrowser.js +2 -1
- package/Libraries/Core/Devtools/parseErrorStack.js +8 -17
- package/Libraries/Core/Devtools/parseHermesStack.js +70 -43
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +5 -4
- package/Libraries/Core/ExceptionsManager.js +90 -98
- package/Libraries/Core/ExtendedError.js +33 -0
- package/Libraries/Core/InitializeCore.js +5 -4
- package/Libraries/Core/NativeExceptionsManager.js +4 -98
- package/Libraries/Core/RawEventEmitter.js +39 -0
- package/Libraries/Core/ReactFiberErrorDialog.js +45 -35
- package/Libraries/Core/ReactNativeVersion.js +12 -6
- package/Libraries/Core/ReactNativeVersionCheck.js +10 -7
- package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +4 -20
- package/Libraries/Core/Timers/JSTimers.js +82 -77
- package/Libraries/Core/Timers/NativeTiming.js +4 -18
- package/Libraries/Core/Timers/immediateShim.js +68 -0
- package/Libraries/Core/Timers/queueMicrotask.js +41 -0
- package/Libraries/Core/__mocks__/ErrorUtils.js +1 -1
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +20 -0
- package/Libraries/Core/checkNativeVersion.js +1 -1
- package/Libraries/Core/polyfillPromise.js +2 -2
- package/Libraries/Core/registerCallableModule.js +42 -0
- package/Libraries/Core/setUpAlert.js +2 -2
- package/Libraries/Core/setUpBatchedBridge.js +21 -9
- package/Libraries/Core/setUpDeveloperTools.js +57 -60
- package/Libraries/Core/setUpErrorHandling.js +2 -2
- package/Libraries/Core/setUpGlobals.js +6 -5
- package/Libraries/Core/setUpIntersectionObserver.js +16 -0
- package/Libraries/Core/setUpMutationObserver.js +16 -0
- package/Libraries/Core/setUpNavigator.js +7 -6
- package/Libraries/Core/setUpPerformance.js +18 -15
- package/Libraries/Core/setUpPerformanceObserver.js +18 -0
- package/Libraries/Core/setUpReactDevTools.js +28 -5
- package/Libraries/Core/setUpReactRefresh.js +4 -2
- package/Libraries/Core/setUpRegeneratorRuntime.js +28 -9
- package/Libraries/Core/setUpSegmentFetcher.js +3 -44
- package/Libraries/Core/setUpTimers.js +77 -8
- package/Libraries/Core/setUpXHR.js +5 -5
- package/Libraries/Debugging/DebuggingOverlay.js +111 -0
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +13 -0
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +513 -0
- package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +32 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +35 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +20 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +49 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.windows.js +35 -0
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +13 -0
- package/Libraries/EventEmitter/NativeEventEmitter.d.ts +63 -0
- package/Libraries/EventEmitter/NativeEventEmitter.js +90 -48
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +29 -0
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +26 -66
- package/Libraries/EventEmitter/RCTEventEmitter.js +6 -2
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +32 -0
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +1 -3
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +33 -8
- package/Libraries/Events/CustomEvent.js +32 -0
- package/Libraries/Events/EventPolyfill.js +239 -0
- package/Libraries/HeapCapture/HeapCapture.js +2 -4
- package/Libraries/HeapCapture/NativeJSCHeapCapture.js +4 -11
- package/Libraries/Image/AssetRegistry.js +2 -2
- package/Libraries/Image/AssetSourceResolver.js +20 -32
- package/Libraries/Image/AssetSourceResolver.windows.js +186 -0
- package/Libraries/Image/AssetUtils.js +47 -0
- package/Libraries/Image/Image.android.js +200 -298
- package/Libraries/Image/Image.d.ts +382 -0
- package/Libraries/Image/Image.ios.js +122 -105
- package/Libraries/Image/Image.windows.js +123 -106
- package/Libraries/Image/ImageAnalyticsTagContext.js +3 -6
- package/Libraries/Image/ImageBackground.js +38 -12
- package/Libraries/Image/ImageInjection.js +87 -0
- package/Libraries/Image/ImageProps.js +133 -22
- package/Libraries/Image/ImageResizeMode.d.ts +49 -0
- package/Libraries/Image/ImageResizeMode.js +1 -1
- package/Libraries/Image/ImageSource.d.ts +76 -0
- package/Libraries/Image/ImageSource.js +60 -17
- package/Libraries/Image/ImageSourceUtils.js +80 -0
- package/Libraries/Image/ImageTypes.flow.js +76 -0
- package/Libraries/Image/ImageUtils.js +21 -0
- package/Libraries/Image/ImageViewNativeComponent.js +143 -29
- package/Libraries/Image/NativeImageEditor.js +4 -44
- package/Libraries/Image/NativeImageLoaderAndroid.js +5 -32
- package/Libraries/Image/NativeImageLoaderIOS.js +5 -29
- package/Libraries/Image/NativeImageStoreAndroid.js +4 -18
- package/Libraries/Image/NativeImageStoreIOS.js +4 -25
- package/Libraries/Image/RelativeImageStub.js +2 -2
- package/Libraries/Image/TextInlineImageNativeComponent.js +38 -7
- package/Libraries/Image/assetPaths.js +36 -0
- package/Libraries/Image/nativeImageSource.js +4 -6
- package/Libraries/Image/resolveAssetSource.js +65 -31
- package/Libraries/Image/resolveAssetSource.windows.js +148 -0
- package/Libraries/Inspector/BorderBox.js +2 -2
- package/Libraries/Inspector/BoxInspector.js +4 -5
- package/Libraries/Inspector/ElementBox.js +10 -8
- package/Libraries/Inspector/ElementProperties.js +34 -61
- package/Libraries/Inspector/Inspector.js +131 -275
- package/Libraries/Inspector/InspectorOverlay.js +26 -38
- package/Libraries/Inspector/InspectorPanel.js +15 -27
- package/Libraries/Inspector/NetworkOverlay.js +24 -18
- package/Libraries/Inspector/PerformanceOverlay.js +4 -4
- package/Libraries/Inspector/ReactDevToolsOverlay.js +171 -0
- package/Libraries/Inspector/StyleInspector.js +3 -3
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +83 -0
- package/Libraries/Inspector/resolveBoxStyle.js +1 -1
- package/Libraries/Interaction/FrameRateLogger.js +10 -22
- package/Libraries/Interaction/InteractionManager.d.ts +74 -0
- package/Libraries/Interaction/InteractionManager.js +17 -29
- package/Libraries/Interaction/JSEventLoopWatchdog.js +7 -11
- package/Libraries/Interaction/NativeFrameRateLogger.js +5 -16
- package/Libraries/Interaction/PanResponder.d.ts +202 -0
- package/Libraries/Interaction/PanResponder.js +26 -28
- package/Libraries/Interaction/TaskQueue.js +6 -5
- package/Libraries/Interaction/TouchHistoryMath.js +12 -12
- package/Libraries/IntersectionObserver/IntersectionObserver.js +252 -0
- package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +141 -0
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +299 -0
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +13 -0
- package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +172 -0
- package/Libraries/JSInspector/InspectorAgent.js +1 -1
- package/Libraries/JSInspector/JSInspector.js +1 -4
- package/Libraries/JSInspector/NetworkAgent.js +5 -10
- package/Libraries/LayoutAnimation/LayoutAnimation.d.ts +84 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +71 -21
- package/Libraries/Linking/Linking.d.ts +61 -0
- package/Libraries/Linking/Linking.js +23 -27
- package/Libraries/Linking/NativeIntentAndroid.js +4 -22
- package/Libraries/Linking/NativeLinkingManager.js +4 -19
- package/Libraries/Lists/FillRateHelper.js +6 -228
- package/Libraries/Lists/FlatList.d.ts +245 -0
- package/Libraries/Lists/FlatList.js +193 -113
- package/Libraries/Lists/FlatList.windows.js +717 -0
- package/Libraries/Lists/SectionList.d.ts +267 -0
- package/Libraries/Lists/SectionList.js +36 -31
- package/Libraries/Lists/SectionListModern.js +249 -0
- package/Libraries/Lists/ViewabilityHelper.js +10 -327
- package/Libraries/Lists/VirtualizeUtils.js +6 -235
- package/Libraries/Lists/VirtualizedList.js +10 -2109
- package/Libraries/Lists/VirtualizedListContext.js +5 -142
- package/Libraries/Lists/VirtualizedSectionList.js +9 -565
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -1
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +8 -8
- package/Libraries/LogBox/Data/LogBoxData.js +37 -34
- package/Libraries/LogBox/Data/LogBoxLog.js +11 -10
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +10 -9
- package/Libraries/LogBox/Data/parseLogBoxLog.js +97 -61
- package/Libraries/LogBox/LogBox.d.ts +28 -0
- package/Libraries/LogBox/LogBox.js +124 -76
- package/Libraries/LogBox/LogBoxInspectorContainer.js +6 -6
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -5
- package/Libraries/LogBox/UI/AnsiHighlight.js +17 -8
- package/Libraries/LogBox/UI/LogBoxButton.js +6 -7
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/LogBox/UI/LogBoxInspector.js +8 -10
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +12 -10
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.windows.js +167 -0
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +27 -35
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -9
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +172 -0
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +6 -7
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +8 -9
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +193 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +3 -5
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +4 -8
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +8 -10
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.windows.js +118 -0
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +19 -11
- package/Libraries/LogBox/UI/LogBoxMessage.js +100 -19
- package/Libraries/LogBox/UI/LogBoxNotification.js +15 -14
- package/Libraries/LogBox/UI/LogBoxStyle.js +1 -3
- package/Libraries/Modal/Modal.d.ts +104 -0
- package/Libraries/Modal/Modal.js +107 -49
- package/Libraries/Modal/ModalInjection.js +15 -0
- package/Libraries/Modal/NativeModalManager.js +4 -13
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +4 -126
- package/Libraries/MutationObserver/MutationObserver.js +184 -0
- package/Libraries/MutationObserver/MutationObserverManager.js +218 -0
- package/Libraries/MutationObserver/MutationRecord.js +84 -0
- package/Libraries/MutationObserver/NativeMutationObserver.js +13 -0
- package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +327 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +339 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +401 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +454 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +157 -0
- package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +30 -0
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +25 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +163 -0
- package/Libraries/NativeComponent/ViewConfig.js +52 -0
- package/Libraries/NativeComponent/ViewConfigIgnore.js +51 -0
- package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +4 -12
- package/Libraries/NativeModules/specs/NativeDevMenu.js +4 -15
- package/Libraries/NativeModules/specs/NativeDevSettings.js +4 -25
- package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +4 -11
- package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +4 -40
- package/Libraries/NativeModules/specs/NativeDialogManagerWindows.js +11 -0
- package/Libraries/NativeModules/specs/NativeLogBox.js +4 -12
- package/Libraries/NativeModules/specs/NativeRedBox.js +5 -13
- package/Libraries/NativeModules/specs/NativeSourceCode.js +3 -27
- package/Libraries/Network/FormData.js +11 -3
- package/Libraries/Network/NativeNetworkingAndroid.js +5 -30
- package/Libraries/Network/NativeNetworkingIOS.js +5 -30
- package/Libraries/Network/RCTNetworking.android.js +15 -9
- package/Libraries/Network/RCTNetworking.ios.js +65 -21
- package/Libraries/Network/RCTNetworking.windows.js +112 -1
- package/Libraries/Network/XHRInterceptor.js +6 -7
- package/Libraries/Network/XMLHttpRequest.js +61 -22
- package/Libraries/Network/convertRequestBody.js +4 -4
- package/Libraries/Network/fetch.js +1 -1
- package/Libraries/NewAppScreen/components/Colors.js +1 -3
- package/Libraries/NewAppScreen/components/DebugInstructions.js +9 -6
- package/Libraries/NewAppScreen/components/DebugInstructions.windows.js +7 -5
- package/Libraries/NewAppScreen/components/Header.js +8 -4
- package/Libraries/NewAppScreen/components/HermesBadge.js +11 -4
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +18 -13
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +5 -2
- package/Libraries/NewAppScreen/components/ReloadInstructions.windows.js +4 -2
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/NewAppScreen/index.js +2 -4
- package/Libraries/Performance/NativeJSCSamplingProfiler.js +4 -11
- package/Libraries/Performance/SamplingProfiler.js +4 -4
- package/Libraries/Performance/Systrace.d.ts +66 -0
- package/Libraries/Performance/Systrace.js +114 -194
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +5 -52
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +116 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +59 -22
- package/Libraries/Pressability/HoverState.js +5 -3
- package/Libraries/Pressability/Pressability.js +211 -135
- package/Libraries/Pressability/Pressability.windows.js +318 -167
- package/Libraries/Pressability/PressabilityDebug.js +30 -26
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +49 -0
- package/Libraries/Pressability/PressabilityTypes.js +18 -0
- package/Libraries/Pressability/usePressability.js +8 -3
- package/Libraries/Promise.js +1 -2
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +5 -66
- package/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +295 -0
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +132 -81
- package/Libraries/ReactNative/AppContainer-dev.js +192 -0
- package/Libraries/ReactNative/AppContainer-prod.js +53 -0
- package/Libraries/ReactNative/AppContainer.js +9 -136
- package/Libraries/ReactNative/AppRegistry.d.ts +114 -0
- package/Libraries/ReactNative/AppRegistry.js +130 -71
- package/Libraries/ReactNative/BridgelessUIManager.js +438 -0
- package/Libraries/ReactNative/DisplayMode.js +32 -0
- package/Libraries/ReactNative/FabricUIManager.js +164 -32
- package/Libraries/ReactNative/HeadlessJsTaskError.js +1 -3
- package/Libraries/ReactNative/I18nManager.d.ts +25 -0
- package/Libraries/ReactNative/I18nManager.js +17 -12
- package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +4 -12
- package/Libraries/ReactNative/NativeI18nManager.js +4 -17
- package/Libraries/ReactNative/NativeUIManager.js +5 -113
- package/Libraries/ReactNative/PaperUIManager.js +79 -52
- package/Libraries/ReactNative/PaperUIManager.windows.js +71 -40
- package/Libraries/ReactNative/ReactFabricInternals.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +151 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +100 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +38 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +492 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +32 -0
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +31 -0
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
- package/Libraries/ReactNative/RendererImplementation.js +123 -0
- package/Libraries/ReactNative/RendererProxy.d.ts +20 -0
- package/Libraries/ReactNative/RendererProxy.js +26 -0
- package/Libraries/ReactNative/RootTag.d.ts +13 -0
- package/Libraries/ReactNative/RootTag.js +5 -9
- package/Libraries/ReactNative/UIManager.d.ts +134 -0
- package/Libraries/ReactNative/UIManager.js +178 -24
- package/Libraries/ReactNative/UIManagerProperties.js +2 -3
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +670 -0
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +35 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +34 -18
- package/Libraries/ReactNative/renderApplication.js +62 -19
- package/Libraries/ReactNative/requireNativeComponent.d.ts +23 -0
- package/Libraries/ReactNative/requireNativeComponent.js +4 -4
- package/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +66 -11
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +25088 -18550
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +5698 -3917
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +6388 -4402
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +25418 -19040
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5768 -3968
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +6269 -4235
- package/Libraries/Renderer/shims/ReactFabric.js +9 -8
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +4 -2
- package/Libraries/Renderer/shims/ReactNative.js +4 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +160 -100
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +23 -32
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +7 -6
- package/Libraries/Settings/NativeSettingsManager.js +5 -18
- package/Libraries/Settings/Settings.d.ts +18 -0
- package/Libraries/Settings/Settings.ios.js +5 -3
- package/Libraries/Settings/Settings.js +33 -0
- package/Libraries/Share/NativeShareModule.js +4 -15
- package/Libraries/Share/Share.d.ts +74 -0
- package/Libraries/Share/Share.js +8 -8
- package/Libraries/StyleSheet/EdgeInsetsPropType.js +5 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +10 -7
- package/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +18 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +52 -16
- package/Libraries/StyleSheet/PlatformColorValueTypes.windows.js +11 -7
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +25 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +11 -5
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +3 -3
- package/Libraries/StyleSheet/PointPropType.js +1 -1
- package/Libraries/StyleSheet/Rect.js +1 -3
- package/Libraries/StyleSheet/StyleSheet.d.ts +150 -0
- package/Libraries/StyleSheet/StyleSheet.js +29 -46
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +410 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +362 -114
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +3 -3
- package/Libraries/StyleSheet/flattenStyle.js +13 -9
- package/Libraries/StyleSheet/normalizeColor.js +7 -9
- package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
- package/Libraries/StyleSheet/private/_TransformStyle.js +69 -0
- package/Libraries/StyleSheet/processAspectRatio.js +63 -0
- package/Libraries/StyleSheet/processColor.d.ts +16 -0
- package/Libraries/StyleSheet/processColor.js +6 -8
- package/Libraries/StyleSheet/processColorArray.js +18 -7
- package/Libraries/StyleSheet/processFontVariant.js +30 -0
- package/Libraries/StyleSheet/processTransform.js +141 -111
- package/Libraries/StyleSheet/processTransformOrigin.js +136 -0
- package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
- package/Libraries/StyleSheet/splitLayoutProps.js +57 -49
- package/Libraries/Text/Text.d.ts +219 -0
- package/Libraries/Text/Text.js +283 -224
- package/Libraries/Text/Text.windows.js +395 -292
- package/Libraries/Text/TextAncestor.js +3 -4
- package/Libraries/Text/TextNativeComponent.js +56 -43
- package/Libraries/Text/TextProps.js +97 -31
- package/Libraries/Text/TextProps.windows.js +275 -0
- package/Libraries/TurboModule/RCTExport.d.ts +12 -0
- package/Libraries/TurboModule/RCTExport.js +2 -2
- package/Libraries/TurboModule/TurboModuleRegistry.d.ts +13 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +55 -36
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +5 -29
- package/Libraries/Types/CodegenTypes.js +4 -2
- package/Libraries/Types/CoreEventTypes.d.ts +266 -0
- package/Libraries/Types/CoreEventTypes.js +142 -5
- package/Libraries/Types/CoreEventTypes.windows.js +154 -5
- package/Libraries/Types/ReactDevToolsTypes.js +58 -0
- package/Libraries/Types/RootTagTypes.js +11 -0
- package/Libraries/Types/UIManagerJSInterface.js +16 -0
- package/Libraries/UTFSequence.js +5 -3
- package/Libraries/Utilities/Appearance.d.ts +53 -0
- package/Libraries/Utilities/Appearance.js +35 -15
- package/Libraries/Utilities/BackHandler.android.js +8 -12
- package/Libraries/Utilities/BackHandler.d.ts +38 -0
- package/Libraries/Utilities/BackHandler.ios.js +1 -1
- package/Libraries/Utilities/BackHandler.windows.js +8 -12
- package/Libraries/Utilities/DebugEnvironment.js +3 -8
- package/Libraries/Utilities/DevSettings.d.ts +32 -0
- package/Libraries/Utilities/DevSettings.js +55 -58
- package/Libraries/Utilities/DeviceInfo.js +1 -3
- package/Libraries/Utilities/Dimensions.d.ts +79 -0
- package/Libraries/Utilities/Dimensions.js +29 -49
- package/Libraries/Utilities/FeatureDetection.js +31 -0
- package/Libraries/Utilities/GlobalPerformanceLogger.js +2 -3
- package/Libraries/Utilities/HMRClient.js +51 -25
- package/Libraries/Utilities/HMRClientProdShim.js +1 -1
- package/Libraries/Utilities/IPerformanceLogger.d.ts +48 -0
- package/Libraries/Utilities/IPerformanceLogger.js +49 -0
- package/Libraries/Utilities/LoadingView.android.js +29 -14
- package/Libraries/Utilities/LoadingView.ios.js +2 -4
- package/Libraries/Utilities/LoadingView.js +1 -1
- package/Libraries/Utilities/NativeAppearance.js +4 -27
- package/Libraries/Utilities/NativeDevLoadingView.js +4 -16
- package/Libraries/Utilities/NativeDeviceInfo.js +3 -50
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +4 -31
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +4 -25
- package/Libraries/Utilities/NativePlatformConstantsWin.js +3 -21
- package/Libraries/Utilities/PerformanceLoggerContext.js +14 -10
- package/Libraries/Utilities/PixelRatio.d.ts +64 -0
- package/Libraries/Utilities/PixelRatio.js +3 -3
- package/Libraries/Utilities/Platform.android.js +29 -14
- package/Libraries/Utilities/Platform.d.ts +106 -0
- package/Libraries/Utilities/Platform.flow.js +91 -0
- package/Libraries/Utilities/Platform.flow.windows.js +120 -0
- package/Libraries/Utilities/Platform.ios.js +32 -18
- package/Libraries/Utilities/Platform.windows.js +31 -14
- package/Libraries/Utilities/PolyfillFunctions.js +3 -3
- package/Libraries/Utilities/RCTLog.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +29 -44
- package/Libraries/Utilities/SceneTracker.js +6 -5
- package/Libraries/Utilities/__mocks__/BackHandler.js +4 -4
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +1 -1
- package/Libraries/Utilities/__mocks__/PixelRatio.js +2 -2
- package/Libraries/Utilities/binaryToBase64.js +2 -2
- package/Libraries/Utilities/codegenNativeCommands.js +6 -6
- package/Libraries/Utilities/codegenNativeComponent.js +21 -11
- package/Libraries/Utilities/createPerformanceLogger.js +21 -53
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +6 -3
- package/Libraries/Utilities/defineLazyObjectProperty.js +2 -2
- package/Libraries/Utilities/differ/deepDiffer.js +3 -3
- package/Libraries/Utilities/differ/insetsDiffer.js +2 -2
- package/Libraries/Utilities/differ/matricesDiffer.js +6 -2
- package/Libraries/Utilities/differ/pointsDiffer.js +2 -2
- package/Libraries/Utilities/differ/sizesDiffer.js +11 -5
- package/Libraries/Utilities/dismissKeyboard.js +1 -1
- package/Libraries/Utilities/infoLog.js +1 -1
- package/Libraries/Utilities/logError.js +2 -2
- package/Libraries/Utilities/mapWithSeparator.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +7 -7
- package/Libraries/Utilities/useColorScheme.js +10 -16
- package/Libraries/Utilities/useMergeRefs.js +40 -0
- package/Libraries/Utilities/useRefEffect.js +45 -0
- package/Libraries/Utilities/useWindowDimensions.js +15 -8
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +31 -35
- package/Libraries/Utilities/warnOnce.js +1 -1
- package/Libraries/Vibration/NativeVibration.js +4 -16
- package/Libraries/Vibration/Vibration.d.ts +43 -0
- package/Libraries/Vibration/Vibration.js +8 -9
- package/Libraries/WebSocket/NativeWebSocketModule.js +5 -27
- package/Libraries/WebSocket/WebSocket.js +38 -16
- package/Libraries/WebSocket/WebSocketEvent.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +13 -10
- package/Libraries/WebSocket/__mocks__/event-target-shim.js +1 -1
- package/Libraries/YellowBox/YellowBoxDeprecated.d.ts +19 -0
- package/Libraries/YellowBox/YellowBoxDeprecated.js +6 -6
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +2 -3
- package/Libraries/__tests__/ViewWindows-test.js +16 -0
- package/Libraries/platform-types.d.ts +19 -0
- package/Libraries/promiseRejectionTrackingOptions.js +29 -12
- package/Libraries/vendor/core/ErrorUtils.d.ts +15 -0
- package/Libraries/vendor/core/ErrorUtils.js +2 -2
- package/Libraries/vendor/emitter/EventEmitter.d.ts +164 -0
- package/Libraries/vendor/emitter/EventEmitter.js +145 -8
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +81 -0
- package/Microsoft.ReactNative/ABIViewManager.cpp +82 -5
- package/Microsoft.ReactNative/ABIViewManager.h +25 -1
- package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +50 -0
- package/Microsoft.ReactNative/AsynchronousEventBeat.h +23 -0
- package/Microsoft.ReactNative/Base/CoreUIManagers.cpp +4 -4
- package/Microsoft.ReactNative/Base/CxxReactIncludes.h +4 -6
- package/Microsoft.ReactNative/Base/FollyIncludes.h +2 -2
- package/Microsoft.ReactNative/ComponentView.idl +106 -0
- package/Microsoft.ReactNative/Composition.Input.idl +117 -0
- package/Microsoft.ReactNative/CompositionComponentView.idl +132 -0
- package/Microsoft.ReactNative/CompositionContext.idl +54 -0
- package/Microsoft.ReactNative/CompositionHwndHost.idl +39 -0
- package/Microsoft.ReactNative/CompositionRootView.idl +106 -0
- package/Microsoft.ReactNative/CompositionSwitcher.idl +164 -0
- package/Microsoft.ReactNative/CompositionUIService.idl +26 -0
- package/Microsoft.ReactNative/DesktopWindowMessage.idl +15 -0
- package/Microsoft.ReactNative/DevMenuControl.idl +6 -3
- package/Microsoft.ReactNative/DevMenuControl.xaml +15 -15
- package/Microsoft.ReactNative/DynamicReader.cpp +8 -2
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +189 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.h +80 -0
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.cpp +83 -0
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +83 -0
- package/Microsoft.ReactNative/Fabric/AbiState.cpp +71 -0
- package/Microsoft.ReactNative/Fabric/AbiState.h +38 -0
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +190 -0
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +80 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +152 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.h +92 -0
- package/Microsoft.ReactNative/Fabric/AbiViewShadowNode.cpp +90 -0
- package/Microsoft.ReactNative/Fabric/AbiViewShadowNode.h +87 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +340 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.h +176 -0
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +162 -0
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.h +63 -0
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +125 -0
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.h +37 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +670 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +226 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +1971 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.h +65 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper_emptyimpl.cpp +79 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +419 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +53 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +1183 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +175 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHelpers.cpp +137 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHelpers.h +81 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +160 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.h +48 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +444 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +82 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.cpp +701 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.h +158 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView_emptyimpl.cpp +138 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.cpp +42 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.h +25 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService_emptyimpl.cpp +21 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +1836 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +236 -0
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +113 -0
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +39 -0
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +432 -0
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +101 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h +39 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +342 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +67 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.cpp +18 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.h +39 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +361 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +76 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +114 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +61 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +196 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +62 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +1219 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +145 -0
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +390 -0
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +83 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +179 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.h +25 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +170 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +1567 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +143 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +49 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +45 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +61 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +123 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +198 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +82 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +47 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +74 -0
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +560 -0
- package/Microsoft.ReactNative/Fabric/Composition/Theme.h +81 -0
- package/Microsoft.ReactNative/Fabric/Composition/Theme_emptyimpl.cpp +85 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +165 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +32 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +124 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +41 -0
- package/Microsoft.ReactNative/Fabric/DWriteHelpers.cpp +19 -0
- package/Microsoft.ReactNative/Fabric/DWriteHelpers.h +13 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +446 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +99 -0
- package/Microsoft.ReactNative/Fabric/IComponentViewRegistry.h +35 -0
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +25 -0
- package/Microsoft.ReactNative/Fabric/ImageRequest.cpp +40 -0
- package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.cpp +53 -0
- package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.h +26 -0
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +39 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +108 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.h +48 -0
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +125 -0
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformTouch.h +10 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +57 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +31 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +69 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +33 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +27 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/KeyEvent.h +113 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/WindowsViewEvents.h +73 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Float.h +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +86 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorParser.h +38 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +145 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.h +12 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +315 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +97 -0
- package/Microsoft.ReactNative/GlyphViewManager.cpp +10 -9
- package/Microsoft.ReactNative/GlyphViewManager.h +1 -1
- package/Microsoft.ReactNative/IJSValueReader.idl +62 -14
- package/Microsoft.ReactNative/IJSValueWriter.idl +39 -19
- package/Microsoft.ReactNative/INativeUIManager.h +1 -1
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +28 -0
- package/Microsoft.ReactNative/IReactContext.cpp +32 -15
- package/Microsoft.ReactNative/IReactContext.h +7 -8
- package/Microsoft.ReactNative/IReactContext.idl +158 -26
- package/Microsoft.ReactNative/IReactDispatcher.cpp +79 -4
- package/Microsoft.ReactNative/IReactDispatcher.h +35 -3
- package/Microsoft.ReactNative/IReactDispatcher.idl +40 -12
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +57 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +25 -20
- package/Microsoft.ReactNative/IReactNonAbiValue.idl +8 -10
- package/Microsoft.ReactNative/IReactNotificationService.cpp +220 -65
- package/Microsoft.ReactNative/IReactNotificationService.h +47 -26
- package/Microsoft.ReactNative/IReactNotificationService.idl +56 -54
- package/Microsoft.ReactNative/IReactPackageBuilder.idl +14 -13
- package/Microsoft.ReactNative/IReactPackageBuilderFabric.idl +23 -0
- package/Microsoft.ReactNative/IReactPackageProvider.idl +8 -6
- package/Microsoft.ReactNative/IReactPropertyBag.cpp +10 -1
- package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
- package/Microsoft.ReactNative/IReactPropertyBag.idl +48 -43
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +93 -0
- package/Microsoft.ReactNative/IViewManager.idl +73 -2
- package/Microsoft.ReactNative/IViewManagerCore.idl +2 -0
- package/Microsoft.ReactNative/JSDispatcherWriter.cpp +146 -0
- package/Microsoft.ReactNative/JSDispatcherWriter.h +47 -0
- package/Microsoft.ReactNative/JsiApi.cpp +565 -255
- package/Microsoft.ReactNative/JsiApi.h +55 -12
- package/Microsoft.ReactNative/JsiApi.idl +148 -9
- package/Microsoft.ReactNative/JsiWriter.cpp +1 -13
- package/Microsoft.ReactNative/JsiWriter.h +0 -3
- package/Microsoft.ReactNative/LayoutService.cpp +51 -0
- package/Microsoft.ReactNative/LayoutService.h +32 -0
- package/Microsoft.ReactNative/LayoutService.idl +41 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +130 -173
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +111 -87
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +24 -20
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +13 -4
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +215 -54
- package/Microsoft.ReactNative/Modules/AlertModule.h +32 -21
- package/Microsoft.ReactNative/Modules/Animated/AdditionAnimatedNode.cpp +35 -18
- package/Microsoft.ReactNative/Modules/Animated/AdditionAnimatedNode.h +5 -4
- package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.cpp +19 -4
- package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.h +21 -3
- package/Microsoft.ReactNative/Modules/Animated/AnimatedPlatformConfig.cpp +23 -0
- package/Microsoft.ReactNative/Modules/Animated/AnimatedPlatformConfig.h +17 -0
- package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.cpp +74 -38
- package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.h +37 -11
- package/Microsoft.ReactNative/Modules/Animated/AnimationUtils.h +45 -0
- package/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp +13 -10
- package/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.h +4 -6
- package/Microsoft.ReactNative/Modules/Animated/DecayAnimationDriver.cpp +33 -17
- package/Microsoft.ReactNative/Modules/Animated/DecayAnimationDriver.h +6 -6
- package/Microsoft.ReactNative/Modules/Animated/DiffClampAnimatedNode.cpp +31 -16
- package/Microsoft.ReactNative/Modules/Animated/DiffClampAnimatedNode.h +6 -4
- package/Microsoft.ReactNative/Modules/Animated/DivisionAnimatedNode.cpp +44 -21
- package/Microsoft.ReactNative/Modules/Animated/DivisionAnimatedNode.h +5 -4
- package/Microsoft.ReactNative/Modules/Animated/EventAnimationDriver.cpp +4 -4
- package/Microsoft.ReactNative/Modules/Animated/EventAnimationDriver.h +3 -3
- package/Microsoft.ReactNative/Modules/Animated/FacadeType.h +8 -3
- package/Microsoft.ReactNative/Modules/Animated/FrameAnimationDriver.cpp +51 -12
- package/Microsoft.ReactNative/Modules/Animated/FrameAnimationDriver.h +9 -4
- package/Microsoft.ReactNative/Modules/Animated/InterpolationAnimatedNode.cpp +82 -42
- package/Microsoft.ReactNative/Modules/Animated/InterpolationAnimatedNode.h +8 -7
- package/Microsoft.ReactNative/Modules/Animated/ModulusAnimatedNode.cpp +27 -15
- package/Microsoft.ReactNative/Modules/Animated/ModulusAnimatedNode.h +6 -4
- package/Microsoft.ReactNative/Modules/Animated/MultiplicationAnimatedNode.cpp +35 -18
- package/Microsoft.ReactNative/Modules/Animated/MultiplicationAnimatedNode.h +5 -4
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.cpp +251 -206
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.h +95 -43
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +395 -65
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.h +50 -15
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +213 -59
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +30 -7
- package/Microsoft.ReactNative/Modules/Animated/SpringAnimationDriver.cpp +78 -23
- package/Microsoft.ReactNative/Modules/Animated/SpringAnimationDriver.h +12 -8
- package/Microsoft.ReactNative/Modules/Animated/StyleAnimatedNode.cpp +27 -8
- package/Microsoft.ReactNative/Modules/Animated/StyleAnimatedNode.h +5 -4
- package/Microsoft.ReactNative/Modules/Animated/SubtractionAnimatedNode.cpp +44 -22
- package/Microsoft.ReactNative/Modules/Animated/SubtractionAnimatedNode.h +5 -3
- package/Microsoft.ReactNative/Modules/Animated/TrackingAnimatedNode.cpp +25 -13
- package/Microsoft.ReactNative/Modules/Animated/TrackingAnimatedNode.h +7 -8
- package/Microsoft.ReactNative/Modules/Animated/TransformAnimatedNode.cpp +42 -12
- package/Microsoft.ReactNative/Modules/Animated/TransformAnimatedNode.h +7 -4
- package/Microsoft.ReactNative/Modules/Animated/ValueAnimatedNode.cpp +62 -34
- package/Microsoft.ReactNative/Modules/Animated/ValueAnimatedNode.h +14 -6
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +82 -32
- package/Microsoft.ReactNative/Modules/AppStateModule.h +19 -13
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.cpp +83 -48
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +26 -26
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +71 -36
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +30 -30
- package/Microsoft.ReactNative/Modules/ClipboardModule.cpp +4 -4
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +5 -2
- package/Microsoft.ReactNative/Modules/CreateModules.cpp +5 -15
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +3 -0
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +151 -54
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +22 -12
- package/Microsoft.ReactNative/Modules/ExceptionsManager.cpp +110 -0
- package/Microsoft.ReactNative/Modules/ExceptionsManager.h +54 -0
- package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +8 -6
- package/Microsoft.ReactNative/Modules/I18nManagerModule.h +5 -2
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +109 -104
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +37 -19
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +57 -67
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +39 -15
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +156 -38
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +12 -3
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +216 -160
- package/Microsoft.ReactNative/Modules/NativeUIManager.h +19 -9
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +148 -100
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +13 -3
- package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.cpp +49 -0
- package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.h +18 -0
- package/Microsoft.ReactNative/Modules/ReactRootViewTagGenerator.h +0 -3
- package/Microsoft.ReactNative/Modules/SourceCode.cpp +31 -0
- package/Microsoft.ReactNative/Modules/SourceCode.h +28 -0
- package/Microsoft.ReactNative/Modules/StatusBarManager.h +12 -0
- package/Microsoft.ReactNative/Modules/Timing.cpp +325 -0
- package/Microsoft.ReactNative/Modules/Timing.h +121 -0
- package/Microsoft.ReactNative/NativeModulesProvider.cpp +1 -1
- package/Microsoft.ReactNative/Pch/pch.h +30 -4
- package/Microsoft.ReactNative/PropertySheet.props +1 -1
- package/Microsoft.ReactNative/QuirkSettings.cpp +109 -12
- package/Microsoft.ReactNative/QuirkSettings.h +36 -2
- package/Microsoft.ReactNative/QuirkSettings.idl +54 -14
- package/Microsoft.ReactNative/ReactApplication.cpp +74 -22
- package/Microsoft.ReactNative/ReactApplication.h +47 -12
- package/Microsoft.ReactNative/ReactApplication.idl +24 -12
- package/Microsoft.ReactNative/ReactCoreInjection.cpp +209 -0
- package/Microsoft.ReactNative/ReactCoreInjection.h +86 -0
- package/Microsoft.ReactNative/ReactCoreInjection.idl +116 -0
- package/Microsoft.ReactNative/ReactHost/AsyncActionQueue.cpp +1 -2
- package/Microsoft.ReactNative/ReactHost/CrashManager.cpp +125 -0
- package/Microsoft.ReactNative/ReactHost/CrashManager.h +25 -0
- package/Microsoft.ReactNative/ReactHost/IReactInstance.h +4 -7
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.cpp +7 -4
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.h +2 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +238 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +71 -0
- package/Microsoft.ReactNative/ReactHost/MsoUtils.cpp +4 -5
- package/Microsoft.ReactNative/ReactHost/MsoUtils.h +2 -2
- package/Microsoft.ReactNative/ReactHost/React.h +38 -14
- package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +108 -34
- package/Microsoft.ReactNative/ReactHost/ReactHost.h +24 -7
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +921 -348
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +65 -28
- package/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +1 -3
- package/Microsoft.ReactNative/ReactHost/ViewManagerProvider.h +2 -6
- package/Microsoft.ReactNative/ReactInstanceSettings.cpp +14 -22
- package/Microsoft.ReactNative/ReactInstanceSettings.h +68 -31
- package/Microsoft.ReactNative/ReactInstanceSettings.idl +207 -53
- package/Microsoft.ReactNative/ReactNativeHost.cpp +36 -10
- package/Microsoft.ReactNative/ReactNativeHost.h +4 -4
- package/Microsoft.ReactNative/ReactNativeHost.idl +32 -7
- package/Microsoft.ReactNative/ReactPackageBuilder.cpp +26 -3
- package/Microsoft.ReactNative/ReactPackageBuilder.h +27 -3
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +55 -0
- package/Microsoft.ReactNative/ReactPointerEventArgs.h +32 -0
- package/Microsoft.ReactNative/ReactPointerEventArgs.idl +79 -0
- package/Microsoft.ReactNative/ReactRootView.cpp +410 -13
- package/Microsoft.ReactNative/ReactRootView.h +71 -7
- package/Microsoft.ReactNative/ReactRootView.idl +21 -3
- package/Microsoft.ReactNative/ReactSupport.h +1 -1
- package/Microsoft.ReactNative/RedBox.cpp +121 -46
- package/Microsoft.ReactNative/RedBox.h +4 -3
- package/Microsoft.ReactNative/RedBoxHandler.cpp +7 -1
- package/Microsoft.ReactNative/RedBoxHandler.idl +56 -32
- package/Microsoft.ReactNative/SchedulerSettings.cpp +74 -0
- package/Microsoft.ReactNative/SchedulerSettings.h +35 -0
- package/Microsoft.ReactNative/SynchronousEventBeat.cpp +41 -0
- package/Microsoft.ReactNative/SynchronousEventBeat.h +29 -0
- package/Microsoft.ReactNative/TestHook.cpp +1 -1
- package/Microsoft.ReactNative/Theme.idl +68 -0
- package/Microsoft.ReactNative/Timer.cpp +63 -0
- package/Microsoft.ReactNative/Timer.h +22 -0
- package/Microsoft.ReactNative/Timer.idl +32 -0
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +300 -169
- package/Microsoft.ReactNative/TurboModulesProvider.h +14 -12
- package/Microsoft.ReactNative/Utils/AccessibilityUtils.cpp +2 -2
- package/Microsoft.ReactNative/Utils/AccessibilityUtils.h +2 -2
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +171 -0
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.h +72 -0
- package/Microsoft.ReactNative/Utils/Helpers.cpp +31 -34
- package/Microsoft.ReactNative/Utils/Helpers.h +7 -11
- package/Microsoft.ReactNative/Utils/ImageUtils.cpp +191 -0
- package/Microsoft.ReactNative/Utils/ImageUtils.h +36 -0
- package/Microsoft.ReactNative/Utils/KeyboardUtils.cpp +416 -0
- package/Microsoft.ReactNative/Utils/KeyboardUtils.h +15 -0
- package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +53 -12
- package/Microsoft.ReactNative/Utils/LocalBundleReader.h +5 -5
- package/Microsoft.ReactNative/Utils/PropertyUtils.h +52 -23
- package/Microsoft.ReactNative/Utils/ResourceBrushUtils.cpp +54 -22
- package/Microsoft.ReactNative/Utils/ResourceBrushUtils.h +12 -4
- package/Microsoft.ReactNative/Utils/ShadowNodeTypeUtils.h +26 -0
- package/Microsoft.ReactNative/Utils/TextTransform.h +8 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +33 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +13 -0
- package/Microsoft.ReactNative/Utils/TransformableText.h +10 -15
- package/Microsoft.ReactNative/Utils/UwpPreparedScriptStore.cpp +2 -2
- package/Microsoft.ReactNative/Utils/UwpPreparedScriptStore.h +4 -4
- package/Microsoft.ReactNative/Utils/UwpScriptStore.cpp +2 -2
- package/Microsoft.ReactNative/Utils/UwpScriptStore.h +3 -3
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +140 -56
- package/Microsoft.ReactNative/Utils/ValueUtils.h +11 -8
- package/Microsoft.ReactNative/Utils/XamlIslandUtils.cpp +93 -0
- package/Microsoft.ReactNative/Utils/XamlIslandUtils.h +48 -0
- package/Microsoft.ReactNative/Version.rc +8 -25
- package/Microsoft.ReactNative/ViewProps.idl +57 -0
- package/Microsoft.ReactNative/Views/ActivityIndicatorViewManager.cpp +11 -1
- package/Microsoft.ReactNative/Views/ActivityIndicatorViewManager.h +2 -1
- package/Microsoft.ReactNative/Views/ConfigureBundlerDlg.cpp +6 -7
- package/Microsoft.ReactNative/Views/ControlViewManager.cpp +48 -1
- package/Microsoft.ReactNative/Views/ControlViewManager.h +9 -0
- package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.cpp +54 -0
- package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.h +30 -0
- package/Microsoft.ReactNative/Views/DevMenu.cpp +356 -182
- package/Microsoft.ReactNative/Views/DevMenu.h +3 -14
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +271 -140
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.h +19 -15
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +61 -71
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.h +24 -37
- package/Microsoft.ReactNative/Views/DynamicValueProvider.cpp +2 -2
- package/Microsoft.ReactNative/Views/DynamicValueProvider.h +4 -4
- package/Microsoft.ReactNative/Views/ExpressionAnimationStore.cpp +2 -2
- package/Microsoft.ReactNative/Views/ExpressionAnimationStore.h +2 -2
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +88 -20
- package/Microsoft.ReactNative/Views/FlyoutViewManager.h +1 -2
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +126 -0
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.h +23 -0
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +538 -257
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.h +0 -8
- package/Microsoft.ReactNative/Views/ICompositionRootView.h +18 -0
- package/Microsoft.ReactNative/Views/IXamlRootView.h +2 -15
- package/Microsoft.ReactNative/Views/Image/Effects.h +4 -6
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +66 -37
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.h +13 -2
- package/Microsoft.ReactNative/Views/Image/Microsoft.UI.Composition.Effects_Impl.h +7 -13
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +179 -157
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +14 -29
- package/Microsoft.ReactNative/Views/Image/ReactImageBrush.cpp +39 -37
- package/Microsoft.ReactNative/Views/Image/ReactImageBrush.h +6 -7
- package/Microsoft.ReactNative/Views/Impl/ScrollViewUWPImplementation.cpp +2 -2
- package/Microsoft.ReactNative/Views/Impl/ScrollViewUWPImplementation.h +2 -2
- package/Microsoft.ReactNative/Views/Impl/SnapPointManagingContentControl.cpp +2 -2
- package/Microsoft.ReactNative/Views/Impl/SnapPointManagingContentControl.h +2 -2
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.cpp +35 -413
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.h +3 -6
- package/Microsoft.ReactNative/Views/PaperShadowNode.h +2 -1
- package/Microsoft.ReactNative/Views/PopupViewManager.cpp +7 -10
- package/Microsoft.ReactNative/Views/PopupViewManager.h +1 -1
- package/Microsoft.ReactNative/Views/RawTextViewManager.cpp +8 -39
- package/Microsoft.ReactNative/Views/RawTextViewManager.h +10 -5
- package/Microsoft.ReactNative/Views/ReactViewInstance.cpp +43 -0
- package/Microsoft.ReactNative/Views/ReactViewInstance.h +53 -0
- package/Microsoft.ReactNative/Views/RefreshControlManager.cpp +9 -7
- package/Microsoft.ReactNative/Views/RefreshControlManager.h +1 -1
- package/Microsoft.ReactNative/Views/RootViewManager.cpp +9 -10
- package/Microsoft.ReactNative/Views/RootViewManager.h +1 -1
- package/Microsoft.ReactNative/Views/SIPEventHandler.cpp +7 -8
- package/Microsoft.ReactNative/Views/SIPEventHandler.h +1 -1
- package/Microsoft.ReactNative/Views/ScrollViewManager.cpp +79 -50
- package/Microsoft.ReactNative/Views/ScrollViewManager.h +4 -1
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +40 -5
- package/Microsoft.ReactNative/Views/ShadowNodeBase.h +33 -6
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.cpp +0 -12
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.h +2 -4
- package/Microsoft.ReactNative/Views/SliderViewManager.cpp +16 -8
- package/Microsoft.ReactNative/Views/SliderViewManager.h +1 -1
- package/Microsoft.ReactNative/Views/SwitchViewManager.cpp +70 -23
- package/Microsoft.ReactNative/Views/SwitchViewManager.h +1 -1
- package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.cpp +52 -0
- package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.h +37 -0
- package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.cpp +348 -0
- package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.h +13 -0
- package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.cpp +76 -0
- package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.h +32 -0
- package/Microsoft.ReactNative/Views/Text/TextParentVisitor.cpp +12 -0
- package/Microsoft.ReactNative/Views/Text/TextParentVisitor.h +19 -0
- package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.cpp +75 -0
- package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.h +43 -0
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.cpp +21 -0
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +23 -0
- package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.cpp +70 -0
- package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.h +34 -0
- package/Microsoft.ReactNative/Views/Text/TextVisitor.cpp +56 -0
- package/Microsoft.ReactNative/Views/Text/TextVisitor.h +34 -0
- package/Microsoft.ReactNative/Views/Text/TextVisitorScope.h +35 -0
- package/Microsoft.ReactNative/Views/Text/TextVisitors.h +47 -0
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +320 -119
- package/Microsoft.ReactNative/Views/TextInputViewManager.h +1 -1
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +245 -89
- package/Microsoft.ReactNative/Views/TextViewManager.h +12 -2
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +261 -165
- package/Microsoft.ReactNative/Views/TouchEventHandler.h +34 -21
- package/Microsoft.ReactNative/Views/UnimplementedViewManager.cpp +79 -0
- package/Microsoft.ReactNative/Views/UnimplementedViewManager.h +27 -0
- package/Microsoft.ReactNative/Views/ViewControl.cpp +5 -5
- package/Microsoft.ReactNative/Views/ViewControl.h +5 -5
- package/Microsoft.ReactNative/Views/ViewManager.h +4 -0
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +161 -43
- package/Microsoft.ReactNative/Views/ViewManagerBase.h +20 -6
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +28 -243
- package/Microsoft.ReactNative/Views/ViewPanel.h +12 -52
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +110 -206
- package/Microsoft.ReactNative/Views/ViewViewManager.h +3 -2
- package/Microsoft.ReactNative/Views/VirtualTextViewManager.cpp +64 -25
- package/Microsoft.ReactNative/Views/VirtualTextViewManager.h +14 -12
- package/Microsoft.ReactNative/Views/XamlFeatures.cpp +2 -2
- package/Microsoft.ReactNative/Views/XamlFeatures.h +2 -2
- package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +88 -13
- package/Microsoft.ReactNative/Views/cppwinrt/ViewPanel.idl +4 -12
- package/Microsoft.ReactNative/XamlHelper.cpp +52 -3
- package/Microsoft.ReactNative/XamlHelper.h +32 -1
- package/Microsoft.ReactNative/XamlHelper.idl +18 -5
- package/Microsoft.ReactNative/XamlLoadState.cpp +6 -5
- package/Microsoft.ReactNative/XamlLoadState.h +2 -2
- package/Microsoft.ReactNative/XamlUIService.cpp +54 -6
- package/Microsoft.ReactNative/XamlUIService.h +9 -2
- package/Microsoft.ReactNative/XamlUIService.idl +43 -10
- package/Microsoft.ReactNative/XamlView.cpp +18 -11
- package/Microsoft.ReactNative/XamlView.h +20 -6
- package/Microsoft.ReactNative/microsoft.reactnative.def +1 -1
- package/Microsoft.ReactNative/packages.lock.json +159 -0
- package/Microsoft.ReactNative.Cxx/AppModelHelpers.h +17 -0
- package/Microsoft.ReactNative.Cxx/AutoDraw.h +40 -0
- package/Microsoft.ReactNative.Cxx/CompositionSwitcher.Experimental.interop.h +34 -0
- package/Microsoft.ReactNative.Cxx/CppWinRTIncludes.h +3 -5
- package/Microsoft.ReactNative.Cxx/DesktopWindowBridge.h +114 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +231 -165
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +39 -56
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.cpp +69 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +64 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.cpp +53 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.h +32 -0
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +84 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiLoader.cpp +16 -0
- package/Microsoft.ReactNative.Cxx/JSValue.cpp +5 -6
- package/Microsoft.ReactNative.Cxx/JSValue.h +14 -2
- package/Microsoft.ReactNative.Cxx/JSValueComposition.h +22 -0
- package/Microsoft.ReactNative.Cxx/JSValueReader.h +47 -3
- package/Microsoft.ReactNative.Cxx/JSValueWriter.h +18 -12
- package/Microsoft.ReactNative.Cxx/JSValueXaml.h +48 -3
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +102 -12
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +70 -5
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +14 -4
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +28 -3
- package/Microsoft.ReactNative.Cxx/NamespaceRedirect.h +2 -0
- package/Microsoft.ReactNative.Cxx/NativeModules.h +189 -39
- package/Microsoft.ReactNative.Cxx/ReactContext.h +6 -5
- package/Microsoft.ReactNative.Cxx/ReactHandleHelper.h +1 -1
- package/Microsoft.ReactNative.Cxx/ReactNonAbiValue.h +5 -5
- package/Microsoft.ReactNative.Cxx/ReactNotificationService.h +20 -11
- package/Microsoft.ReactNative.Cxx/ReactPromise.cpp +21 -1
- package/Microsoft.ReactNative.Cxx/ReactPromise.h +27 -0
- package/Microsoft.ReactNative.Cxx/ReactPropertyBag.h +15 -13
- package/Microsoft.ReactNative.Cxx/StructInfo.h +4 -4
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.cpp +32 -0
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.h +34 -0
- package/Microsoft.ReactNative.Cxx/VersionMacros.h +19 -0
- package/Microsoft.ReactNative.Cxx/XamlUtils.h +44 -5
- package/Microsoft.ReactNative.Cxx/cppapi.md.mustache +13 -0
- package/Microsoft.ReactNative.Cxx/doxysaurus.json +53 -0
- package/Microsoft.ReactNative.Managed/IReactPromise.cs +0 -20
- package/Microsoft.ReactNative.Managed/JSValue.cs +1 -1
- package/Microsoft.ReactNative.Managed/JSValueReader.cs +438 -444
- package/Microsoft.ReactNative.Managed/JSValueReaderGenerator.cs +5 -5
- package/Microsoft.ReactNative.Managed/JSValueWriter.cs +8 -7
- package/Microsoft.ReactNative.Managed/JSValueWriterGenerator.cs +5 -5
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +39 -35
- package/Microsoft.ReactNative.Managed/ReactAttributes.cs +16 -0
- package/Microsoft.ReactNative.Managed/ReactConstantProvider.cs +5 -0
- package/Microsoft.ReactNative.Managed/ReactContext.cs +21 -4
- package/Microsoft.ReactNative.Managed/ReactDispatcher.cs +34 -0
- package/Microsoft.ReactNative.Managed/ReactError.cs +36 -0
- package/Microsoft.ReactNative.Managed/ReactNotificationArgsOf.cs +23 -0
- package/Microsoft.ReactNative.Managed/ReactNotificationHandlerOf.cs +7 -0
- package/Microsoft.ReactNative.Managed/ReactNotificationIdOf.cs +44 -0
- package/Microsoft.ReactNative.Managed/ReactNotificationService.cs +146 -0
- package/Microsoft.ReactNative.Managed/ReactNotificationSubscription.cs +43 -0
- package/Microsoft.ReactNative.Managed/ReactNotificationSubscriptionRevoker.cs +64 -0
- package/Microsoft.ReactNative.Managed/ReactPackageBuilderExtensions.cs +1 -1
- package/Microsoft.ReactNative.Managed/ReactPromise.cs +123 -81
- package/Microsoft.ReactNative.Managed/ReactPropertyBag.cs +91 -0
- package/Microsoft.ReactNative.Managed/ReactPropertyIdOf.cs +44 -0
- package/Microsoft.ReactNative.Managed/ReactPropertyName.cs +39 -0
- package/Microsoft.ReactNative.Managed/ReactPropertyNamespace.cs +26 -0
- package/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs +50 -0
- package/Microsoft.ReactNative.Managed/ReactTaskExtensions.cs +15 -4
- package/Microsoft.ReactNative.Managed/ReflectionReactPackageProvider.cs +1 -1
- package/Microsoft.ReactNative.Managed/packages.lock.json +373 -0
- package/Microsoft.ReactNative.Managed.CodeGen/App.cs +1 -1
- package/Microsoft.ReactNative.Managed.CodeGen/CodeAnalyzer.cs +795 -731
- package/Microsoft.ReactNative.Managed.CodeGen/CodeGenerator.Module.cs +96 -61
- package/Microsoft.ReactNative.Managed.CodeGen/CodeGenerator.Serializers.cs +57 -18
- package/Microsoft.ReactNative.Managed.CodeGen/CodeGenerator.ViewManager.cs +1 -1
- package/Microsoft.ReactNative.Managed.CodeGen/DiagnosticDescriptors.cs +37 -5
- package/Microsoft.ReactNative.Managed.CodeGen/Microsoft.ReactNative.Managed.CodeGen.csproj +7 -7
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactAssembly.cs +3 -3
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactGetConstants.cs +17 -0
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactMethod.cs +11 -2
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactModule.cs +2 -0
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactTypes.cs +10 -4
- package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Debug.pubxml +4 -4
- package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Release.pubxml +4 -4
- package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +29 -3
- package/Microsoft.ReactNative.Managed.CodeGen/SyntaxHelpers.cs +18 -4
- package/Microsoft.ReactNative.Managed.CodeGen/packages.lock.json +3197 -0
- package/Mso/Mso.vcxitems.filters +2 -2
- package/Mso/activeObject/activeObject.h +8 -14
- package/Mso/comUtil/IUnknownShim.h +4 -0
- package/Mso/comUtil/qiCastCore.h +0 -6
- package/Mso/compilerAdapters/compilerFeatures.h +1 -1
- package/Mso/compilerAdapters/cppMacros.h +3 -5
- package/Mso/compilerAdapters/functionDecorations.h +6 -6
- package/Mso/cppExtensions/autoRestore.h +1 -6
- package/Mso/debugAssertApi/debugAssertApi.h +1 -3
- package/Mso/debugAssertApi/debugAssertDetails.h +4 -6
- package/Mso/dispatchQueue/dispatchQueue.h +21 -8
- package/Mso/errorCode/errorProvider.h +2 -2
- package/Mso/errorCode/maybe.h +4 -4
- package/Mso/functional/functor.h +6 -6
- package/Mso/functional/functorRef.h +2 -2
- package/Mso/future/details/executor.h +3 -3
- package/Mso/future/details/futureFuncInl.h +4 -4
- package/Mso/future/details/ifuture.h +3 -3
- package/Mso/future/details/maybeInvoker.h +6 -6
- package/Mso/future/details/promiseGroupInl.h +4 -4
- package/Mso/future/details/promiseInl.h +4 -4
- package/Mso/future/details/resultTraits.h +4 -4
- package/Mso/future/details/whenAllInl.h +1 -1
- package/Mso/future/future.h +13 -13
- package/Mso/future/futureWait.h +1 -1
- package/Mso/future/futureWinRT.h +11 -7
- package/Mso/guid/msoGuidDetails.h +16 -15
- package/Mso/memoryApi/memoryApi.h +13 -7
- package/Mso/motifCpp/assert_IgnorePlat_emptyImpl.h +2 -0
- package/Mso/motifCpp/assert_motifApi.h +2 -0
- package/Mso/motifCpp/gTestAdapter.h +3 -1
- package/Mso/motifCpp/libletAwareMemLeakDetection.h +2 -0
- package/Mso/motifCpp/motifCppTest.h +5 -1
- package/Mso/motifCpp/motifCppTestBase.h +2 -0
- package/Mso/motifCpp/testCheck.h +9 -4
- package/Mso/motifCpp/testInfo.h +9 -9
- package/Mso/oacr/oacr.h +1 -1
- package/Mso/object/make.h +8 -8
- package/Mso/object/objectRefCount.h +3 -5
- package/Mso/object/objectWithWeakRef.h +10 -14
- package/Mso/object/queryCast.h +4 -6
- package/Mso/object/refCountedObject.h +4 -4
- package/Mso/object/unknownObject.h +7 -7
- package/Mso/platformAdapters/windowsFirst.h +1 -1
- package/Mso/smartPtr/cntPtr.h +21 -21
- package/Mso/smartPtr/smartPointerBase.h +1 -5
- package/Mso/src/debugAssertApi/debugAssertApi.cpp +1 -1
- package/Mso/src/dispatchQueue/looperScheduler.cpp +38 -11
- package/Mso/src/dispatchQueue/queueService.cpp +4 -6
- package/Mso/src/dispatchQueue/queueService.h +2 -2
- package/Mso/src/dispatchQueue/taskQueue.h +1 -1
- package/Mso/src/dispatchQueue/threadPoolScheduler_win.cpp +98 -6
- package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +135 -44
- package/Mso/src/eventWaitHandle/eventWaitHandleImpl_win.cpp +2 -3
- package/Mso/src/future/futureImpl.cpp +5 -5
- package/Mso/src/future/futureImpl.h +2 -2
- package/Mso/src/memoryApi/memoryApi.cpp +7 -4
- package/PropertySheets/Appx.props +19 -0
- package/PropertySheets/Autolink.props +1 -1
- package/PropertySheets/Bundle.Common.targets +5 -4
- package/PropertySheets/Bundle.props +9 -10
- package/PropertySheets/Codegen.props +15 -0
- package/PropertySheets/Codegen.targets +19 -0
- package/PropertySheets/CppAppConsumeCSharpModule.props +18 -3
- package/PropertySheets/CppAppConsumeCSharpModule.targets +0 -3
- package/PropertySheets/Debug.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.CSharp.Dependencies.props +17 -0
- package/PropertySheets/External/Microsoft.ReactNative.CSharp.PackageReferences.props +12 -0
- package/PropertySheets/External/Microsoft.ReactNative.CSharp.ProjectReferences.props +20 -0
- package/PropertySheets/External/Microsoft.ReactNative.Common.props +33 -3
- package/PropertySheets/External/Microsoft.ReactNative.Common.targets +34 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.Common.props +28 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.props +25 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.targets +19 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.props +24 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.targets +20 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.Package.props +14 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.Package.targets +18 -0
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.Dependencies.props +26 -0
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.PackageReferences.props +12 -0
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.ProjectReferences.props +22 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.props +3 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +26 -12
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.targets +13 -12
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.props +4 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +23 -10
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +11 -1
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets +18 -9
- package/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props +32 -0
- package/PropertySheets/FastBuild.targets +64 -0
- package/PropertySheets/FixupRoslynCscWarnings.targets +38 -0
- package/PropertySheets/Generated/PackageVersion.g.props +20 -0
- package/PropertySheets/HybridCRT.props +34 -0
- package/PropertySheets/JSEngine.props +17 -9
- package/PropertySheets/ManagedCodeGen/Microsoft.ReactNative.Managed.CodeGen.targets +1 -1
- package/PropertySheets/NewAPIDeclarations.props +25 -0
- package/PropertySheets/NuGet.CSharp.props +15 -0
- package/PropertySheets/NuGet.Cpp.props +32 -0
- package/PropertySheets/OutputMSBuildProperties.targets +31 -0
- package/PropertySheets/PackageVersionDefinitions.props +46 -0
- package/PropertySheets/React.Cpp.props +45 -13
- package/PropertySheets/ReactCommunity.cpp.props +2 -2
- package/PropertySheets/Release.props +8 -1
- package/PropertySheets/Warnings.props +8 -3
- package/PropertySheets/WinUI.props +30 -11
- package/PropertySheets/x64.props +3 -0
- package/PropertySheets/x86.props +3 -0
- package/README.md +6 -6
- package/ReactCommon/ReactCommon.vcxproj +110 -48
- package/ReactCommon/ReactCommon.vcxproj.filters +100 -41
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +1556 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +20 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +103 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.cpp +66 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +59 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +535 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.cpp +39 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.h +31 -0
- package/ReactCommon/cgmanifest.json +15 -0
- package/ReactCommon/packages.lock.json +30 -0
- package/ReactCommon/pch.h +11 -1
- package/Scripts/Analyze-Crash.ps1 +116 -0
- package/Scripts/EnableInternalWinAppSDKFeed.ps1 +21 -0
- package/Scripts/Install-WindowsSDKISO.ps1 +1 -1
- package/Scripts/IntegrationTests.ps1 +26 -11
- package/Scripts/JustMyXaml.ps1 +8 -8
- package/Scripts/Microsoft.ReactNative.Managed.nuspec +23 -30
- package/Scripts/Microsoft.ReactNative.nuspec +16 -17
- package/Scripts/Microsoft.ReactNative.targets +3 -2
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +22 -0
- package/Scripts/OfficeReact.Win32.nuspec +23 -9
- package/Scripts/OpenSSL.targets +1 -1
- package/Scripts/StripAdditionalPlatformsFromNuspec.ps1 +1 -1
- package/Scripts/TestServers.ps1 +2 -28
- package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +132 -0
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +110 -0
- package/Scripts/Tfs/Make-AnyCPU-RefAssemblies.ps1 +39 -0
- package/Scripts/Tfs/Start-TestServers.ps1 +2 -14
- package/Scripts/Tfs/Stop-TestServers.ps1 +0 -5
- package/Scripts/Tracing/Start-Tracing.ps1 +28 -0
- package/Scripts/Tracing/Stop-Tracing.ps1 +57 -0
- package/Scripts/Tracing/rnw.wprp +27 -0
- package/Scripts/UnitTest.ps1 +3 -3
- package/Scripts/rnw-dependencies.ps1 +485 -143
- package/Scripts/utils.js +1 -1
- package/Shared/AbiSafe.h +3 -3
- package/Shared/BaseFileReaderResource.cpp +89 -0
- package/Shared/BaseFileReaderResource.h +41 -0
- package/Shared/BaseScriptStoreImpl.cpp +69 -25
- package/Shared/BaseScriptStoreImpl.h +2 -2
- package/Shared/BatchingMessageQueueThread.h +3 -0
- package/Shared/ChakraRuntimeHolder.cpp +5 -3
- package/Shared/ChakraRuntimeHolder.h +4 -3
- package/Shared/CppRuntimeOptions.h +50 -0
- package/Shared/CreateInstance.h +25 -0
- package/Shared/CreateModules.h +46 -14
- package/Shared/CxxMessageQueue.cpp +1 -1
- package/Shared/DevServerHelper.h +33 -6
- package/Shared/DevSettings.h +30 -25
- package/Shared/DevSupportManager.cpp +64 -15
- package/Shared/DevSupportManager.h +27 -1
- package/Shared/Executors/WebSocketJSExecutor.cpp +17 -22
- package/Shared/Executors/WebSocketJSExecutor.h +2 -6
- package/Shared/Executors/WebSocketJSExecutorFactory.cpp +2 -1
- package/Shared/Hasher.cpp +64 -0
- package/Shared/Hasher.h +24 -0
- package/Shared/HermesRuntimeHolder.cpp +397 -17
- package/Shared/HermesRuntimeHolder.h +59 -12
- package/Shared/HermesSamplingProfiler.cpp +115 -0
- package/Shared/HermesSamplingProfiler.h +26 -0
- package/Shared/IBlobPersistor.h +30 -0
- package/Shared/IDevSupportManager.h +7 -2
- package/Shared/IFileReaderResource.h +36 -0
- package/Shared/IReactRootView.h +0 -1
- package/Shared/InspectorPackagerConnection.cpp +235 -0
- package/Shared/InspectorPackagerConnection.h +61 -0
- package/Shared/InstanceManager.cpp +40 -9
- package/Shared/InstanceManager.h +9 -5
- package/Shared/JSI/ChakraApi.cpp +436 -0
- package/Shared/JSI/ChakraApi.h +474 -0
- package/Shared/JSI/ChakraJsiRuntime_edgemode.cpp +100 -0
- package/Shared/JSI/ChakraRuntime.cpp +1128 -0
- package/Shared/JSI/ChakraRuntime.h +510 -0
- package/Shared/JSI/ChakraRuntimeArgs.h +45 -0
- package/Shared/JSI/ChakraRuntimeFactory.h +15 -0
- package/Shared/JSI/JSExecutorFactoryDelegate.h +12 -0
- package/Shared/JSI/JSExecutorFactorySettings.cpp +30 -0
- package/Shared/JSI/JSExecutorFactorySettings.h +21 -0
- package/Shared/JSI/RuntimeHolder.h +28 -0
- package/Shared/JSI/ScriptStore.h +77 -0
- package/Shared/JSI/V8RuntimeHolder.cpp +260 -0
- package/Shared/JSI/V8RuntimeHolder.h +37 -0
- package/Shared/Logging.cpp +1 -1
- package/Shared/MemoryMappedBuffer.cpp +2 -36
- package/Shared/MemoryMappedBuffer.h +1 -1
- package/Shared/Modules/BlobCollector.cpp +21 -0
- package/Shared/Modules/BlobCollector.h +23 -0
- package/Shared/Modules/BlobModule.cpp +191 -0
- package/Shared/Modules/BlobModule.h +91 -0
- package/Shared/Modules/CxxModuleUtilities.cpp +51 -0
- package/Shared/Modules/CxxModuleUtilities.h +40 -0
- package/Shared/Modules/ExceptionsManagerModule.cpp +57 -55
- package/Shared/Modules/FileReaderModule.cpp +218 -0
- package/Shared/Modules/FileReaderModule.h +80 -0
- package/Shared/Modules/HttpModule.cpp +329 -0
- package/Shared/Modules/HttpModule.h +92 -0
- package/Shared/Modules/I18nModule.cpp +3 -2
- package/Shared/Modules/IHttpModuleProxy.h +30 -0
- package/Shared/Modules/IRequestBodyHandler.h +54 -0
- package/Shared/Modules/IResponseHandler.h +27 -0
- package/Shared/Modules/IUriHandler.h +37 -0
- package/Shared/Modules/IWebSocketModuleContentHandler.h +28 -0
- package/Shared/Modules/IWebSocketModuleProxy.h +22 -0
- package/Shared/Modules/NetworkingModule.cpp +2 -5
- package/Shared/Modules/PlatformConstantsModule.cpp +6 -16
- package/Shared/Modules/SourceCodeModule.h +0 -3
- package/Shared/Modules/WebSocketModule.cpp +415 -106
- package/Shared/Modules/WebSocketModule.h +54 -15
- package/Shared/Modules/WebSocketTurboModule.h +71 -0
- package/Shared/Networking/DefaultBlobResource.cpp +331 -0
- package/Shared/Networking/DefaultBlobResource.h +133 -0
- package/Shared/Networking/IBlobResource.h +56 -0
- package/Shared/Networking/IHttpResource.h +229 -0
- package/Shared/Networking/IRedirectEventSource.h +18 -0
- package/Shared/Networking/IWebSocketResource.h +185 -0
- package/Shared/Networking/IWinRTHttpRequestFactory.h +22 -0
- package/Shared/Networking/OriginPolicy.h +15 -0
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +798 -0
- package/Shared/Networking/OriginPolicyHttpFilter.h +123 -0
- package/Shared/Networking/RedirectHttpFilter.cpp +292 -0
- package/Shared/Networking/RedirectHttpFilter.h +97 -0
- package/Shared/Networking/WinRTHttpResource.cpp +692 -0
- package/Shared/Networking/WinRTHttpResource.h +110 -0
- package/Shared/Networking/WinRTTypes.h +33 -0
- package/Shared/Networking/WinRTWebSocketResource.cpp +461 -0
- package/Shared/Networking/WinRTWebSocketResource.h +129 -0
- package/Shared/OInstance.cpp +346 -247
- package/Shared/OInstance.h +31 -17
- package/Shared/PackagerConnection.cpp +7 -5
- package/Shared/PackagerConnection.h +2 -2
- package/Shared/RuntimeOptions.cpp +126 -0
- package/Shared/RuntimeOptions.h +32 -8
- package/Shared/SafeLoadLibrary.cpp +77 -0
- package/Shared/SafeLoadLibrary.h +19 -0
- package/Shared/Shared.vcxitems +566 -32
- package/Shared/Shared.vcxitems.filters +596 -99
- package/Shared/SystemChakraRuntime.h +38 -0
- package/Shared/Threading/BatchingQueueThread.cpp +73 -25
- package/Shared/Threading/BatchingQueueThread.h +30 -15
- package/Shared/Threading/MessageDispatchQueue.cpp +83 -4
- package/Shared/Threading/MessageDispatchQueue.h +31 -0
- package/Shared/Threading/MessageQueueThreadFactory.cpp +2 -2
- package/Shared/Threading/MessageQueueThreadFactory.h +3 -3
- package/Shared/TurboModuleManager.cpp +1 -1
- package/Shared/Utils/CppWinrtLessExceptions.h +10 -4
- package/Shared/Utils/WinRTConversions.cpp +22 -0
- package/Shared/Utils/WinRTConversions.h +15 -0
- package/Shared/Utils.cpp +58 -1
- package/Shared/Utils.h +3 -0
- package/Shared/V8JSIRuntimeHolder.cpp +13 -133
- package/Shared/V8JSIRuntimeHolder.h +14 -6
- package/Shared/WebSocketJSExecutorFactory.h +1 -0
- package/Shared/tracing/fbsystrace.h +3 -3
- package/Shared/tracing/tracing.cpp +105 -34
- package/Shared/tracing/tracing.h +20 -0
- package/codegen/.clang-format +2 -0
- package/codegen/NativeAccessibilityInfoSpec.g.h +27 -14
- package/codegen/NativeAccessibilityManagerSpec.g.h +89 -32
- package/codegen/NativeActionSheetManagerSpec.g.h +85 -7
- package/codegen/NativeAlertManagerSpec.g.h +34 -4
- package/codegen/NativeAnimatedModuleSpec.g.h +122 -83
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +122 -83
- package/codegen/NativeAnimationsDebugModuleSpec.g.h +6 -5
- package/codegen/NativeAppStateSpec.g.h +31 -8
- package/codegen/NativeAppThemeSpec.g.h +68 -0
- package/codegen/NativeAppearanceSpec.g.h +18 -11
- package/codegen/NativeBlobModuleSpec.g.h +29 -15
- package/codegen/NativeBugReportingSpec.g.h +7 -12
- package/codegen/NativeClipboardSpec.g.h +7 -6
- package/codegen/NativeDevLoadingViewSpec.g.h +7 -6
- package/codegen/NativeDevMenuSpec.g.h +12 -11
- package/codegen/NativeDevSettingsSpec.g.h +24 -23
- package/codegen/NativeDevToolsSettingsManagerSpec.g.h +52 -0
- package/codegen/NativeDeviceEventManagerSpec.g.h +4 -3
- package/codegen/NativeDeviceInfoSpec.g.h +68 -1
- package/codegen/NativeDialogManagerAndroidSpec.g.h +57 -4
- package/codegen/NativeDialogManagerWindowsSpec.g.h +90 -0
- package/codegen/NativeExceptionsManagerSpec.g.h +60 -15
- package/codegen/NativeFileReaderModuleSpec.g.h +8 -7
- package/codegen/NativeFrameRateLoggerSpec.g.h +22 -10
- package/codegen/NativeHeadlessJsTaskSupportSpec.g.h +7 -6
- package/codegen/NativeI18nManagerSpec.g.h +23 -7
- package/codegen/NativeImageEditorSpec.g.h +63 -4
- package/codegen/NativeImageLoaderAndroidSpec.g.h +29 -15
- package/codegen/NativeImageLoaderIOSSpec.g.h +30 -16
- package/codegen/NativeImageStoreAndroidSpec.g.h +5 -4
- package/codegen/NativeImageStoreIOSSpec.g.h +35 -12
- package/codegen/NativeIntentAndroidSpec.g.h +17 -16
- package/codegen/NativeIntersectionObserverSpec.g.h +96 -0
- package/codegen/NativeJSCHeapCaptureSpec.g.h +5 -4
- package/codegen/NativeJSCSamplingProfilerSpec.g.h +5 -4
- package/codegen/NativeKeyboardObserverSpec.g.h +6 -5
- package/codegen/NativeLinkingManagerSpec.g.h +18 -17
- package/codegen/NativeLogBoxSpec.g.h +6 -5
- package/codegen/NativeModalManagerSpec.g.h +6 -5
- package/codegen/NativeMutationObserverSpec.g.h +90 -0
- package/codegen/NativeNetworkingAndroidSpec.g.h +14 -13
- package/codegen/NativeNetworkingIOSSpec.g.h +39 -13
- package/codegen/NativePerformanceObserverSpec.g.h +130 -0
- package/codegen/NativePerformanceSpec.g.h +52 -0
- package/codegen/NativePermissionsAndroidSpec.g.h +14 -13
- package/codegen/NativePlatformConstantsAndroidSpec.g.h +54 -3
- package/codegen/NativePlatformConstantsIOSSpec.g.h +44 -1
- package/codegen/NativePlatformConstantsWinSpec.g.h +53 -1
- package/codegen/NativePushNotificationManagerIOSSpec.g.h +112 -48
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +100 -0
- package/codegen/NativeRedBoxSpec.g.h +7 -6
- package/codegen/NativeSampleTurboModuleSpec.g.h +110 -36
- package/codegen/NativeSegmentFetcherSpec.g.h +8 -7
- package/codegen/NativeSettingsManagerSpec.g.h +29 -7
- package/codegen/NativeShareModuleSpec.g.h +29 -4
- package/codegen/NativeSoundManagerSpec.g.h +4 -3
- package/codegen/NativeSourceCodeSpec.g.h +13 -1
- package/codegen/NativeStatusBarManagerAndroidSpec.g.h +34 -10
- package/codegen/NativeStatusBarManagerIOSSpec.g.h +50 -15
- package/codegen/NativeTimingSpec.g.h +8 -7
- package/codegen/NativeToastAndroidSpec.g.h +37 -7
- package/codegen/NativeUIManagerSpec.g.h +94 -105
- package/codegen/NativeVibrationSpec.g.h +9 -8
- package/codegen/NativeWebSocketModuleSpec.g.h +28 -16
- package/codegen/react/components/rnwcore/ComponentDescriptors.h +31 -0
- package/codegen/react/components/rnwcore/EventEmitters.cpp +132 -0
- package/codegen/react/components/rnwcore/EventEmitters.h +169 -0
- package/codegen/react/components/rnwcore/Props.cpp +155 -0
- package/codegen/react/components/rnwcore/Props.h +392 -0
- package/codegen/react/components/rnwcore/ShadowNodes.cpp +24 -0
- package/codegen/react/components/rnwcore/ShadowNodes.h +109 -0
- package/codegen/react/components/rnwcore/States.cpp +16 -0
- package/codegen/react/components/rnwcore/States.h +139 -0
- package/codegen/rnwcoreJSI-generated.cpp +2939 -0
- package/codegen/rnwcoreJSI.h +10018 -0
- package/fmt/.clang-format +2 -0
- package/fmt/cgmanifest.json +15 -0
- package/fmt/fmt.vcxproj +153 -0
- package/fmt/fmt.vcxproj.filters +59 -0
- package/fmt/packages.lock.json +13 -0
- package/fmt/pch.cpp +4 -0
- package/fmt/pch.h +2 -0
- package/generate.js +6 -1
- package/include/Include.vcxitems +0 -1
- package/include/Include.vcxitems.filters +1 -4
- package/include/Shared/cdebug.h +43 -34
- package/index.js +319 -233
- package/index.windows.js +335 -253
- package/interface.js +9 -9
- package/jest/MockNativeMethods.js +21 -0
- package/jest/ReactNativeInternalFeatureFlagsMock.js +13 -0
- package/jest/__tests__/setup-test.js +18 -0
- package/jest/assetFileTransformer.js +32 -0
- package/jest/local-setup.js +28 -0
- package/jest/mockComponent.js +64 -0
- package/jest/mockModal.js +34 -0
- package/jest/mockNativeComponent.js +40 -0
- package/jest/mockScrollView.js +35 -0
- package/jest/react-native-env.js +16 -0
- package/jest/renderer.js +30 -0
- package/jest/setup.js +411 -0
- package/just-task.js +25 -35
- package/metro.config.js +3 -62
- package/package.json +75 -60
- package/react-native.config.js +47 -10
- package/rn-get-polyfills.js +2 -2
- package/src/private/core/setUpDOM.js +18 -0
- package/src/private/featureflags/NativeReactNativeFeatureFlags.js +44 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +150 -0
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +101 -0
- package/src/private/specs/components/ActivityIndicatorViewNativeComponent.js +53 -0
- package/src/private/specs/components/AndroidDrawerLayoutNativeComponent.js +124 -0
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +26 -0
- package/src/private/specs/components/AndroidSwipeRefreshLayoutNativeComponent.js +74 -0
- package/src/private/specs/components/AndroidSwitchNativeComponent.js +62 -0
- package/src/private/specs/components/DebuggingOverlayNativeComponent.js +61 -0
- package/src/private/specs/components/ProgressBarAndroidNativeComponent.js +36 -0
- package/src/private/specs/components/PullToRefreshViewNativeComponent.js +71 -0
- package/src/private/specs/components/RCTInputAccessoryViewNativeComponent.js +26 -0
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +139 -0
- package/src/private/specs/components/RCTSafeAreaViewNativeComponent.js +25 -0
- package/src/private/specs/components/SwitchNativeComponent.js +61 -0
- package/src/private/specs/components/UnimplementedNativeViewNativeComponent.js +26 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +33 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +66 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +54 -0
- package/src/private/specs/modules/NativeAlertManager.js +35 -0
- package/src/private/specs/modules/NativeAnimatedModule.js +77 -0
- package/src/private/specs/modules/NativeAnimatedTurboModule.js +78 -0
- package/src/private/specs/modules/NativeAnimationsDebugModule.js +20 -0
- package/src/private/specs/modules/NativeAppState.js +33 -0
- package/src/private/specs/modules/NativeAppTheme.js +33 -0
- package/src/private/specs/modules/NativeAppearance.js +36 -0
- package/src/private/specs/modules/NativeBlobModule.js +61 -0
- package/src/private/specs/modules/NativeBugReporting.js +20 -0
- package/src/private/specs/modules/NativeClipboard.js +21 -0
- package/src/private/specs/modules/NativeDevLoadingView.js +24 -0
- package/src/private/specs/modules/NativeDevMenu.js +23 -0
- package/src/private/specs/modules/NativeDevSettings.js +33 -0
- package/src/private/specs/modules/NativeDevToolsSettingsManager.js +24 -0
- package/src/private/specs/modules/NativeDeviceEventManager.js +19 -0
- package/src/private/specs/modules/NativeDeviceInfo.js +58 -0
- package/src/private/specs/modules/NativeDialogManagerAndroid.js +48 -0
- package/src/private/specs/modules/NativeDialogManagerWindows.js +51 -0
- package/src/private/specs/modules/NativeExceptionsManager.js +103 -0
- package/src/private/specs/modules/NativeFileReaderModule.js +22 -0
- package/src/private/specs/modules/NativeFrameRateLogger.js +22 -0
- package/src/private/specs/modules/NativeHeadlessJsTaskSupport.js +20 -0
- package/src/private/specs/modules/NativeI18nManager.js +28 -0
- package/src/private/specs/modules/NativeImageEditor.js +52 -0
- package/src/private/specs/modules/NativeImageLoaderAndroid.js +30 -0
- package/src/private/specs/modules/NativeImageLoaderIOS.js +37 -0
- package/src/private/specs/modules/NativeImageStoreAndroid.js +26 -0
- package/src/private/specs/modules/NativeImageStoreIOS.js +33 -0
- package/src/private/specs/modules/NativeIntentAndroid.js +30 -0
- package/src/private/specs/modules/NativeIntersectionObserver.js +41 -0
- package/src/private/specs/modules/NativeJSCHeapCapture.js +19 -0
- package/src/private/specs/modules/NativeJSCSamplingProfiler.js +19 -0
- package/src/private/specs/modules/NativeKeyboardObserver.js +20 -0
- package/src/private/specs/modules/NativeLinkingManager.js +27 -0
- package/src/private/specs/modules/NativeLogBox.js +20 -0
- package/src/private/specs/modules/NativeModalManager.js +21 -0
- package/src/private/specs/modules/NativeMutationObserver.js +58 -0
- package/src/private/specs/modules/NativeNetworkingAndroid.js +37 -0
- package/src/private/specs/modules/NativeNetworkingIOS.js +37 -0
- package/src/private/specs/modules/NativePermissionsAndroid.js +77 -0
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +44 -0
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +37 -0
- package/src/private/specs/modules/NativePlatformConstantsWin.js +38 -0
- package/src/private/specs/modules/NativePushNotificationManagerIOS.js +103 -0
- package/src/private/specs/modules/NativeRedBox.js +20 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +53 -0
- package/src/private/specs/modules/NativeSegmentFetcher.js +28 -0
- package/src/private/specs/modules/NativeSettingsManager.js +25 -0
- package/src/private/specs/modules/NativeShareModule.js +23 -0
- package/src/private/specs/modules/NativeSoundManager.js +22 -0
- package/src/private/specs/modules/NativeSourceCode.js +36 -0
- package/src/private/specs/modules/NativeStatusBarManagerAndroid.js +68 -0
- package/src/private/specs/modules/NativeStatusBarManagerIOS.js +89 -0
- package/src/private/specs/modules/NativeTiming.js +26 -0
- package/src/private/specs/modules/NativeToastAndroid.js +38 -0
- package/src/private/specs/modules/NativeUIManager.js +118 -0
- package/src/private/specs/modules/NativeVibration.js +24 -0
- package/src/private/specs/modules/NativeWebSocketModule.js +34 -0
- package/src/private/webapis/dom/geometry/DOMRect.js +82 -0
- package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +188 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +192 -0
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +72 -0
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +275 -0
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +363 -0
- package/src/private/webapis/dom/nodes/ReadOnlyText.js +30 -0
- package/src/private/webapis/dom/nodes/utilities/Traversal.js +54 -0
- package/src/private/webapis/dom/oldstylecollections/ArrayLikeUtils.js +46 -0
- package/src/private/webapis/dom/oldstylecollections/DOMRectList.js +76 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +82 -0
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +104 -0
- package/src/private/webapis/performance/EventCounts.js +78 -0
- package/src/private/webapis/performance/MemoryInfo.js +54 -0
- package/src/private/webapis/performance/NativePerformance.js +33 -0
- package/src/private/webapis/performance/NativePerformanceObserver.js +61 -0
- package/src/private/webapis/performance/Performance.js +339 -0
- package/src/private/webapis/performance/PerformanceEntry.js +53 -0
- package/src/private/webapis/performance/PerformanceEventTiming.js +55 -0
- package/src/private/webapis/performance/PerformanceObserver.js +337 -0
- package/src/private/webapis/performance/RawPerformanceEntry.js +87 -0
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +91 -0
- package/src/private/webapis/performance/__mocks__/NativePerformance.js +67 -0
- package/src/private/webapis/performance/__mocks__/NativePerformanceObserver.js +128 -0
- package/stubs/double-conversion/double-conversion.h +23 -6
- package/stubs/glog/logging.h +7 -0
- package/template/.clang-format +4 -0
- package/template/cpp-app/proj/MyApp.sln +21 -52
- package/template/cpp-app/proj/MyApp.vcxproj +12 -57
- package/template/cpp-app/proj/MyApp.vcxproj.filters +1 -2
- package/template/cpp-app/src/App.cpp +23 -10
- package/template/cpp-app/src/App.h +5 -9
- package/template/cpp-app/src/MainPage.cpp +1 -5
- package/template/cpp-app/src/MainPage.h +0 -2
- package/template/cpp-app/src/MainPage.idl +3 -1
- package/template/cpp-app/src/PropertySheet.props +3 -3
- package/template/cpp-app/src/ReactPackageProvider.cpp +1 -4
- package/template/cpp-app/src/ReactPackageProvider.h +0 -2
- package/template/cpp-app/src/pch.h +6 -9
- package/template/cpp-lib/proj/MyLib.sln +21 -52
- package/template/cpp-lib/proj/MyLib.vcxproj +19 -50
- package/template/cpp-lib/proj/MyLib.vcxproj.filters +1 -2
- package/template/cpp-lib/src/PropertySheet.props +3 -3
- package/template/cpp-lib/src/ReactNativeModule.h +0 -4
- package/template/cpp-lib/src/ReactPackageProvider.cpp +1 -4
- package/template/cpp-lib/src/ReactPackageProvider.h +0 -3
- package/template/cpp-lib/src/pch.h +4 -9
- package/template/cs-app/proj/MyApp.csproj +18 -47
- package/template/cs-app/proj/MyApp.sln +21 -60
- package/template/cs-app/src/App.xaml.cs +22 -11
- package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
- package/template/cs-app/src/MainPage.xaml.cs +8 -7
- package/template/cs-lib/proj/MyLib.csproj +17 -35
- package/template/cs-lib/proj/MyLib.sln +21 -60
- package/template/metro.config.js +22 -8
- package/template/metro.devMode.config.js +33 -18
- package/template/shared-app/proj/ExperimentalFeatures.props +40 -0
- package/template/shared-app/proj/NuGet_Config +19 -0
- package/template/shared-app/src/MainPage.xaml +1 -1
- package/template/shared-lib/proj/ExperimentalFeatures.props +40 -0
- package/template/shared-lib/proj/NuGet_Config +17 -0
- package/templates/.clang-format +4 -0
- package/templates/cpp-app/jest.config.windows.js +3 -0
- package/templates/cpp-app/metro.config.js +54 -0
- package/templates/cpp-app/template.config.js +134 -0
- package/templates/cpp-app/windows/ExperimentalFeatures.props +11 -0
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +13 -0
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +10 -0
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +164 -0
- package/templates/cpp-app/windows/MyApp/MyApp.h +3 -0
- package/templates/cpp-app/windows/MyApp/MyApp.ico +0 -0
- package/templates/cpp-app/windows/MyApp/MyApp.rc +0 -0
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +143 -0
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj.filters +58 -0
- package/templates/cpp-app/windows/MyApp/_gitignore +1 -0
- package/templates/cpp-app/windows/MyApp/pch.cpp +1 -0
- package/templates/cpp-app/windows/MyApp/pch.h +38 -0
- package/templates/cpp-app/windows/MyApp/resource.h +17 -0
- package/templates/cpp-app/windows/MyApp/small.ico +0 -0
- package/templates/cpp-app/windows/MyApp/targetver.h +8 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/LockScreenLogo.scale-200.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/SplashScreen.scale-200.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/Square150x150Logo.scale-200.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/Square44x44Logo.scale-200.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/StoreLogo.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/Images/Wide310x150Logo.scale-200.png +0 -0
- package/templates/cpp-app/windows/MyApp.Package/MyApp.Package.wapproj +78 -0
- package/templates/cpp-app/windows/MyApp.Package/Package.appxmanifest +49 -0
- package/templates/cpp-app/windows/MyApp.sln +176 -0
- package/templates/cpp-app/windows/_gitignore +41 -0
- package/templates/cpp-lib/example/metro.config.js +74 -0
- package/templates/cpp-lib/template.config.js +235 -0
- package/templates/cpp-lib/windows/ExperimentalFeatures.props +11 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.cpp +18 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.def +3 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.h +31 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.rc +0 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +148 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj.filters +44 -0
- package/templates/cpp-lib/windows/MyLib/ReactPackageProvider.cpp +20 -0
- package/templates/cpp-lib/windows/MyLib/ReactPackageProvider.h +24 -0
- package/templates/cpp-lib/windows/MyLib/ReactPackageProvider.idl +9 -0
- package/templates/cpp-lib/windows/MyLib/pch.cpp +1 -0
- package/templates/cpp-lib/windows/MyLib/pch.h +30 -0
- package/templates/cpp-lib/windows/MyLib/resource.h +5 -0
- package/templates/cpp-lib/windows/MyLib/targetver.h +8 -0
- package/templates/cpp-lib/windows/MyLib.sln +156 -0
- package/templates/cpp-lib/windows/_gitignore +41 -0
- package/templates/old/generateWrapper.js +67 -0
- package/templates/old/uwp-cpp-app/template.config.js +15 -0
- package/templates/old/uwp-cpp-lib/template.config.js +15 -0
- package/templates/old/uwp-cs-app/template.config.js +15 -0
- package/templates/old/uwp-cs-lib/template.config.js +15 -0
- package/templates/templateUtils.js +137 -0
- package/types/experimental.d.ts +145 -0
- package/types/index.d.ts +217 -0
- package/types/modules/BatchedBridge.d.ts +32 -0
- package/types/modules/Codegen.d.ts +74 -0
- package/types/modules/Devtools.d.ts +32 -0
- package/types/modules/LaunchScreen.d.ts +18 -0
- package/types/modules/globals.d.ts +599 -0
- package/types/private/TimerMixin.d.ts +19 -0
- package/types/private/Utilities.d.ts +10 -0
- package/types/public/DeprecatedPropertiesAlias.d.ts +185 -0
- package/types/public/Insets.d.ts +15 -0
- package/types/public/ReactNativeRenderer.d.ts +144 -0
- package/types/public/ReactNativeTypes.d.ts +143 -0
- package/CHANGELOG.json +0 -10261
- package/CHANGELOG.md +0 -3715
- package/Chakra/ChakraCoreDebugger.h +0 -147
- package/Chakra/ChakraExecutor.cpp +0 -802
- package/Chakra/ChakraExecutor.h +0 -163
- package/Chakra/ChakraNativeModules.cpp +0 -67
- package/Chakra/ChakraNativeModules.h +0 -36
- package/Folly/TEMP_UntilFollyUpdate/portability/Builtins.h +0 -153
- package/Folly/packages.config +0 -4
- package/JSI/Desktop/ChakraJsiRuntime_core.cpp +0 -328
- package/JSI/Desktop/JSI.Desktop.vcxproj +0 -97
- package/JSI/Desktop/JSI.Desktop.vcxproj.filters +0 -19
- package/JSI/Desktop/packages.config +0 -6
- package/JSI/Shared/ChakraApi.cpp +0 -458
- package/JSI/Shared/ChakraApi.h +0 -478
- package/JSI/Shared/ChakraRuntime.cpp +0 -972
- package/JSI/Shared/ChakraRuntime.h +0 -501
- package/JSI/Shared/ChakraRuntimeArgs.h +0 -50
- package/JSI/Shared/ChakraRuntimeFactory.h +0 -14
- package/JSI/Shared/JSI.Shared.vcxitems +0 -29
- package/JSI/Shared/JSI.Shared.vcxitems.filters +0 -42
- package/JSI/Shared/RuntimeHolder.h +0 -21
- package/JSI/Shared/ScriptStore.h +0 -79
- package/JSI/Universal/ChakraJsiRuntime_edgemode.cpp +0 -90
- package/JSI/Universal/JSI.Universal.vcxproj +0 -100
- package/JSI/Universal/JSI.Universal.vcxproj.filters +0 -16
- package/Libraries/AppTheme/AppTheme.d.ts +0 -25
- package/Libraries/AppTheme/AppTheme.d.ts.map +0 -1
- package/Libraries/AppTheme/AppTheme.js.map +0 -1
- package/Libraries/AppTheme/AppThemeTypes.d.ts.map +0 -1
- package/Libraries/AppTheme/AppThemeTypes.js +0 -8
- package/Libraries/AppTheme/AppThemeTypes.js.map +0 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js +0 -158
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js +0 -273
- package/Libraries/Components/DatePicker/DatePicker.d.ts +0 -11
- package/Libraries/Components/DatePicker/DatePicker.d.ts.map +0 -1
- package/Libraries/Components/DatePicker/DatePicker.js +0 -96
- package/Libraries/Components/DatePicker/DatePicker.js.map +0 -1
- package/Libraries/Components/DatePicker/DatePickerIOS.android.js +0 -46
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +0 -189
- package/Libraries/Components/DatePicker/DatePickerIOS.windows.js +0 -8
- package/Libraries/Components/DatePicker/DatePickerProps.d.ts +0 -33
- package/Libraries/Components/DatePicker/DatePickerProps.d.ts.map +0 -1
- package/Libraries/Components/DatePicker/DatePickerProps.js +0 -16
- package/Libraries/Components/DatePicker/DatePickerProps.js.map +0 -1
- package/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +0 -60
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -89
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.windows.js +0 -8
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +0 -22
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +0 -12
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.windows.js +0 -8
- package/Libraries/Components/Flyout/Flyout.d.ts.map +0 -1
- package/Libraries/Components/Flyout/Flyout.js.map +0 -1
- package/Libraries/Components/Flyout/FlyoutProps.d.ts +0 -22
- package/Libraries/Components/Flyout/FlyoutProps.d.ts.map +0 -1
- package/Libraries/Components/Flyout/FlyoutProps.js +0 -3
- package/Libraries/Components/Flyout/FlyoutProps.js.map +0 -1
- package/Libraries/Components/Glyph/Glyph.d.ts.map +0 -1
- package/Libraries/Components/Glyph/Glyph.js.map +0 -1
- package/Libraries/Components/Glyph/GlyphProps.d.ts +0 -17
- package/Libraries/Components/Glyph/GlyphProps.d.ts.map +0 -1
- package/Libraries/Components/Glyph/GlyphProps.js +0 -8
- package/Libraries/Components/Glyph/GlyphProps.js.map +0 -1
- package/Libraries/Components/Keyboard/KeyboardExt.d.ts.map +0 -1
- package/Libraries/Components/Keyboard/KeyboardExtProps.d.ts.map +0 -1
- package/Libraries/Components/MaskedView/MaskedViewIOS.android.js +0 -13
- package/Libraries/Components/MaskedView/MaskedViewIOS.ios.js +0 -93
- package/Libraries/Components/MaskedView/MaskedViewIOS.windows.js +0 -9
- package/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js +0 -21
- package/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js +0 -82
- package/Libraries/Components/Picker/AndroidDialogPickerViewConfig.js +0 -30
- package/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js +0 -69
- package/Libraries/Components/Picker/Picker.js +0 -165
- package/Libraries/Components/Picker/Picker.windows.js +0 -170
- package/Libraries/Components/Picker/PickerAndroid.android.js +0 -145
- package/Libraries/Components/Picker/PickerAndroid.ios.js +0 -12
- package/Libraries/Components/Picker/PickerAndroid.windows.js +0 -8
- package/Libraries/Components/Picker/PickerIOS.android.js +0 -14
- package/Libraries/Components/Picker/PickerIOS.ios.js +0 -164
- package/Libraries/Components/Picker/PickerIOS.windows.js +0 -8
- package/Libraries/Components/Picker/PickerProps.d.ts +0 -30
- package/Libraries/Components/Picker/PickerProps.d.ts.map +0 -1
- package/Libraries/Components/Picker/PickerProps.js +0 -8
- package/Libraries/Components/Picker/PickerProps.js.map +0 -1
- package/Libraries/Components/Picker/PickerWindows.d.ts +0 -38
- package/Libraries/Components/Picker/PickerWindows.d.ts.map +0 -1
- package/Libraries/Components/Picker/PickerWindows.js +0 -118
- package/Libraries/Components/Picker/PickerWindows.js.map +0 -1
- package/Libraries/Components/Picker/RCTPickerNativeComponent.js +0 -72
- package/Libraries/Components/Picker/RCTPickerViewConfig.js +0 -41
- package/Libraries/Components/Popup/Popup.d.ts.map +0 -1
- package/Libraries/Components/Popup/Popup.js.map +0 -1
- package/Libraries/Components/Popup/PopupProps.d.ts +0 -27
- package/Libraries/Components/Popup/PopupProps.d.ts.map +0 -1
- package/Libraries/Components/Popup/PopupProps.js +0 -8
- package/Libraries/Components/Popup/PopupProps.js.map +0 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js +0 -12
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.windows.js +0 -8
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +0 -46
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +0 -77
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.windows.js +0 -8
- package/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +0 -35
- package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +0 -63
- package/Libraries/Components/ScrollResponder.js +0 -772
- package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +0 -75
- package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -46
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -46
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.windows.js +0 -8
- package/Libraries/Components/Slider/Slider.js +0 -273
- package/Libraries/Components/Slider/SliderNativeComponent.js +0 -60
- package/Libraries/Components/StaticContainer.react.js +0 -51
- package/Libraries/Components/StatusBar/StatusBarIOS.js +0 -21
- package/Libraries/Components/TextInput/AndroidTextInputViewConfig.js +0 -114
- package/Libraries/Components/TextInput/RCTSinglelineTextInputViewConfig.js +0 -134
- package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +0 -37
- package/Libraries/Components/ToastAndroid/ToastAndroid.windows.js +0 -37
- package/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js +0 -12
- package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -26
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -347
- package/Libraries/Components/View/ReactNativeViewViewConfig.windows.js +0 -377
- package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
- package/Libraries/Components/View/ViewWindows.d.ts +0 -20
- package/Libraries/Components/View/ViewWindows.d.ts.map +0 -1
- package/Libraries/Components/View/ViewWindows.js +0 -30
- package/Libraries/Components/View/ViewWindows.js.map +0 -1
- package/Libraries/Components/View/ViewWindowsProps.d.ts +0 -30
- package/Libraries/Components/View/ViewWindowsProps.d.ts.map +0 -1
- package/Libraries/Components/View/ViewWindowsProps.js +0 -8
- package/Libraries/Components/View/ViewWindowsProps.js.map +0 -1
- package/Libraries/Core/setUpSystrace.js +0 -21
- package/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js +0 -28
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js +0 -82
- package/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType.js +0 -40
- package/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js +0 -233
- package/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js +0 -24
- package/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js +0 -30
- package/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js +0 -32
- package/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js +0 -622
- package/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js +0 -158
- package/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js +0 -157
- package/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js +0 -99
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js +0 -44
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.windows.js +0 -71
- package/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js +0 -408
- package/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js +0 -68
- package/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js +0 -86
- package/Libraries/Image/ImagePickerIOS.js +0 -105
- package/Libraries/Image/ImageViewViewConfig.js +0 -68
- package/Libraries/Image/NativeImagePickerIOS.js +0 -40
- package/Libraries/Interaction/Batchinator.js +0 -76
- package/Libraries/Interaction/BridgeSpyStallHandler.js +0 -62
- package/Libraries/Interaction/InteractionMixin.js +0 -55
- package/Libraries/Interaction/InteractionStallDebugger.js +0 -23
- package/Libraries/Network/RCTNetworkingWinShared.js +0 -69
- package/Libraries/Performance/PureComponentDebug.js +0 -73
- package/Libraries/Performance/QuickPerformanceLogger.js +0 -101
- package/Libraries/ReactNative/DummyUIManager.js +0 -122
- package/Libraries/ReactNative/queryLayoutByID.js +0 -58
- package/Libraries/Reliability/UserFlow.js +0 -136
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -21758
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -7714
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8009
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -22404
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -7938
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -8230
- package/Libraries/Settings/Settings.android.js +0 -33
- package/Libraries/Settings/Settings.windows.js +0 -28
- package/Libraries/Storage/AsyncStorage.js +0 -361
- package/Libraries/Storage/NativeAsyncLocalStorage.js +0 -43
- package/Libraries/Storage/NativeAsyncSQLiteDBStorage.js +0 -43
- package/Libraries/StyleSheet/StyleSheetValidation.js +0 -100
- package/Libraries/Text/TextInjection.js +0 -17
- package/Libraries/Utilities/JSDevSupportModule.js +0 -40
- package/Libraries/Utilities/MatrixMath.js +0 -748
- package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -20
- package/Libraries/Utilities/NativeJSDevSupport.js +0 -25
- package/Libraries/Utilities/buildStyleInterpolator.js +0 -209
- package/Libraries/Utilities/clamp.js +0 -23
- package/Libraries/Utilities/deprecatedPropType.js +0 -38
- package/Libraries/Utilities/groupByEveryN.js +0 -51
- package/Libraries/Utilities/mergeIntoFast.js +0 -26
- package/Libraries/Utilities/registerGeneratedViewConfig.js +0 -83
- package/Libraries/Utilities/setAndForwardRef.js +0 -71
- package/Libraries/Utilities/truncate.js +0 -51
- package/Libraries/promiseRejectionIsError.js +0 -24
- package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -60
- package/Libraries/vendor/emitter/_EventEmitter.js +0 -173
- package/Libraries/vendor/emitter/_EventSubscription.js +0 -40
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -101
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +0 -112
- package/Microsoft.ReactNative/Base/CoreNativeModules.h +0 -34
- package/Microsoft.ReactNative/Modules/TimingModule.cpp +0 -215
- package/Microsoft.ReactNative/Modules/TimingModule.h +0 -91
- package/Microsoft.ReactNative/Modules/WebSocketModuleUwp.cpp +0 -321
- package/Microsoft.ReactNative/Modules/WebSocketModuleUwp.h +0 -28
- package/Microsoft.ReactNative/ReactHost/ReactContext.cpp +0 -190
- package/Microsoft.ReactNative/ReactHost/ReactContext.h +0 -73
- package/Microsoft.ReactNative/Views/DatePickerViewManager.cpp +0 -176
- package/Microsoft.ReactNative/Views/DatePickerViewManager.h +0 -28
- package/Microsoft.ReactNative/Views/PickerViewManager.cpp +0 -212
- package/Microsoft.ReactNative/Views/PickerViewManager.h +0 -29
- package/Microsoft.ReactNative/Views/ReactRootControl.cpp +0 -489
- package/Microsoft.ReactNative/Views/ReactRootControl.h +0 -154
- package/Microsoft.ReactNative/packages.config +0 -12
- package/Microsoft.ReactNative.Cxx/JSI/JsiApi.h +0 -31
- package/PropertySheets/ARM.props +0 -13
- package/PropertySheets/Application/ARM.props +0 -13
- package/PropertySheets/DynamicLibrary/ARM.props +0 -13
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.SourceReferences.targets +0 -20
- package/PropertySheets/StaticLibrary/ARM.props +0 -13
- package/ReactCommon/Yoga.cpp +0 -4424
- package/ReactCommon/packages.config +0 -4
- package/Scripts/Microsoft.ChakraCore.ARM64.nuspec +0 -50
- package/Scripts/Microsoft.ChakraCore.ARM64.targets +0 -15
- package/Scripts/Microsoft.ReactNative.Cxx.NugetSignConfig.xml +0 -6
- package/Scripts/Microsoft.ReactNative.Managed.CodeGen.NugetSignConfig.xml +0 -6
- package/Scripts/Microsoft.ReactNative.Managed.CodeGen.SignConfig.xml +0 -12
- package/Scripts/Microsoft.ReactNative.Managed.NugetSignConfig.xml +0 -6
- package/Scripts/Microsoft.ReactNative.Managed.SignConfig.xml +0 -26
- package/Scripts/Microsoft.ReactNative.NugetSignConfig.xml +0 -6
- package/Scripts/Microsoft.ReactNative.SignConfig.xml +0 -32
- package/Scripts/Tfs/Install-VSFeatures.ps1 +0 -112
- package/Scripts/Tfs/Layout-Headers.ps1 +0 -155
- package/Scripts/copyRNLibraries.js +0 -87
- package/Shared/AsyncStorage/AsyncStorageManager.cpp +0 -149
- package/Shared/AsyncStorage/AsyncStorageManager.h +0 -71
- package/Shared/AsyncStorage/FollyDynamicConverter.cpp +0 -51
- package/Shared/AsyncStorage/FollyDynamicConverter.h +0 -24
- package/Shared/AsyncStorage/KeyValueStorage.cpp +0 -248
- package/Shared/AsyncStorage/KeyValueStorage.h +0 -50
- package/Shared/AsyncStorage/StorageFileIO.cpp +0 -160
- package/Shared/AsyncStorage/StorageFileIO.h +0 -40
- package/Shared/AsyncStorageModule.h +0 -25
- package/Shared/IHttpResource.h +0 -34
- package/Shared/IUIManager.h +0 -90
- package/Shared/IWebSocketResource.h +0 -184
- package/Shared/MemoryTracker.cpp +0 -157
- package/Shared/MemoryTracker.h +0 -141
- package/Shared/Modules/AsyncStorageModule.cpp +0 -91
- package/Shared/Modules/AsyncStorageModuleWin32.cpp +0 -495
- package/Shared/Modules/AsyncStorageModuleWin32.h +0 -75
- package/Shared/WinRTWebSocketResource.cpp +0 -397
- package/Shared/WinRTWebSocketResource.h +0 -138
- package/Shared/cdebug.cpp +0 -7
- package/Shared/etw/build.bat +0 -4
- package/Shared/etw/react_native_windows.h +0 -1275
- package/Shared/etw/react_native_windows.man +0 -86
- package/Shared/etw/react_native_windows_etw_res.dll +0 -0
- package/Shared/etw/register.bat +0 -3
- package/codegen/NativeAsyncLocalStorageSpec.g.h +0 -63
- package/codegen/NativeAsyncSQLiteDBStorageSpec.g.h +0 -63
- package/codegen/NativeDatePickerAndroidSpec.g.h +0 -33
- package/codegen/NativeDevSplitBundleLoaderSpec.g.h +0 -33
- package/codegen/NativeImagePickerIOSSpec.g.h +0 -63
- package/codegen/NativeJSDevSupportSpec.g.h +0 -39
- package/include/Shared/AsyncStorageModuleWin32Config.h +0 -15
- package/include/Shared/ViewManager.h +0 -34
- package/template/cpp-app/keys/MyApp_TemporaryKey.pfx +0 -0
- package/template/cpp-app/proj/packages.config +0 -6
- package/template/cpp-lib/proj/packages.config +0 -6
- package/template/cs-app/keys/MyApp_TemporaryKey.pfx +0 -0
- package/template/shared-app/proj/BuildFlags.props +0 -10
- package/template/shared-app/proj/NuGet.Config +0 -13
- package/template/shared-lib/proj/NuGet.Config +0 -13
- package/typings-index.d.ts +0 -23
- package/typings-index.d.ts.map +0 -1
- package/typings-index.js +0 -42
- package/typings-index.js.map +0 -1
- /package/{JSI/Shared → Shared/JSI}/ByteArrayBuffer.h +0 -0
|
@@ -1,2122 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @flow
|
|
7
|
+
* @flow strict-local
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
const FillRateHelper = require('./FillRateHelper');
|
|
15
|
-
const ReactNative = require('../Renderer/shims/ReactNative');
|
|
16
|
-
const RefreshControl = require('../Components/RefreshControl/RefreshControl');
|
|
17
|
-
const ScrollView = require('../Components/ScrollView/ScrollView');
|
|
18
|
-
const StyleSheet = require('../StyleSheet/StyleSheet');
|
|
19
|
-
const View = require('../Components/View/View');
|
|
20
|
-
const ViewabilityHelper = require('./ViewabilityHelper');
|
|
13
|
+
import {typeof VirtualizedList as VirtualizedListType} from '@react-native/virtualized-lists';
|
|
21
14
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const invariant = require('invariant');
|
|
25
|
-
|
|
26
|
-
const {computeWindowedRenderLimits} = require('./VirtualizeUtils');
|
|
27
|
-
|
|
28
|
-
import * as React from 'react';
|
|
29
|
-
import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
|
|
30
|
-
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
31
|
-
import type {
|
|
32
|
-
ViewabilityConfig,
|
|
33
|
-
ViewToken,
|
|
34
|
-
ViewabilityConfigCallbackPair,
|
|
35
|
-
} from './ViewabilityHelper';
|
|
36
|
-
import {
|
|
37
|
-
VirtualizedListCellContextProvider,
|
|
38
|
-
VirtualizedListContext,
|
|
39
|
-
VirtualizedListContextProvider,
|
|
40
|
-
type ChildListState,
|
|
41
|
-
type ListDebugInfo,
|
|
42
|
-
} from './VirtualizedListContext.js';
|
|
43
|
-
|
|
44
|
-
type Item = any;
|
|
45
|
-
|
|
46
|
-
export type Separators = {
|
|
47
|
-
highlight: () => void,
|
|
48
|
-
unhighlight: () => void,
|
|
49
|
-
updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,
|
|
50
|
-
...
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export type RenderItemProps<ItemT> = {
|
|
54
|
-
item: ItemT,
|
|
55
|
-
index: number,
|
|
56
|
-
separators: Separators,
|
|
57
|
-
...
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type RenderItemType<ItemT> = (
|
|
61
|
-
info: RenderItemProps<ItemT>,
|
|
62
|
-
) => React.Node;
|
|
63
|
-
|
|
64
|
-
type ViewabilityHelperCallbackTuple = {
|
|
65
|
-
viewabilityHelper: ViewabilityHelper,
|
|
66
|
-
onViewableItemsChanged: (info: {
|
|
67
|
-
viewableItems: Array<ViewToken>,
|
|
68
|
-
changed: Array<ViewToken>,
|
|
69
|
-
...
|
|
70
|
-
}) => void,
|
|
71
|
-
...
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
type RequiredProps = {|
|
|
75
|
-
/**
|
|
76
|
-
* The default accessor functions assume this is an Array<{key: string} | {id: string}> but you can override
|
|
77
|
-
* getItem, getItemCount, and keyExtractor to handle any type of index-based data.
|
|
78
|
-
*/
|
|
79
|
-
data?: any,
|
|
80
|
-
/**
|
|
81
|
-
* A generic accessor for extracting an item from any sort of data blob.
|
|
82
|
-
*/
|
|
83
|
-
getItem: (data: any, index: number) => ?Item,
|
|
84
|
-
/**
|
|
85
|
-
* Determines how many items are in the data blob.
|
|
86
|
-
*/
|
|
87
|
-
getItemCount: (data: any) => number,
|
|
88
|
-
|};
|
|
89
|
-
type OptionalProps = {|
|
|
90
|
-
renderItem?: ?RenderItemType<Item>,
|
|
91
|
-
/**
|
|
92
|
-
* `debug` will turn on extra logging and visual overlays to aid with debugging both usage and
|
|
93
|
-
* implementation, but with a significant perf hit.
|
|
94
|
-
*/
|
|
95
|
-
debug?: ?boolean,
|
|
96
|
-
/**
|
|
97
|
-
* DEPRECATED: Virtualization provides significant performance and memory optimizations, but fully
|
|
98
|
-
* unmounts react instances that are outside of the render window. You should only need to disable
|
|
99
|
-
* this for debugging purposes.
|
|
100
|
-
*/
|
|
101
|
-
disableVirtualization?: ?boolean,
|
|
102
|
-
/**
|
|
103
|
-
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
|
|
104
|
-
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
|
|
105
|
-
* `data` prop, stick it here and treat it immutably.
|
|
106
|
-
*/
|
|
107
|
-
extraData?: any,
|
|
108
|
-
// e.g. height, y
|
|
109
|
-
getItemLayout?: (
|
|
110
|
-
data: any,
|
|
111
|
-
index: number,
|
|
112
|
-
) => {
|
|
113
|
-
length: number,
|
|
114
|
-
offset: number,
|
|
115
|
-
index: number,
|
|
116
|
-
...
|
|
117
|
-
},
|
|
118
|
-
horizontal?: ?boolean,
|
|
119
|
-
/**
|
|
120
|
-
* How many items to render in the initial batch. This should be enough to fill the screen but not
|
|
121
|
-
* much more. Note these items will never be unmounted as part of the windowed rendering in order
|
|
122
|
-
* to improve perceived performance of scroll-to-top actions.
|
|
123
|
-
*/
|
|
124
|
-
initialNumToRender: number,
|
|
125
|
-
/**
|
|
126
|
-
* Instead of starting at the top with the first item, start at `initialScrollIndex`. This
|
|
127
|
-
* disables the "scroll to top" optimization that keeps the first `initialNumToRender` items
|
|
128
|
-
* always rendered and immediately renders the items starting at this initial index. Requires
|
|
129
|
-
* `getItemLayout` to be implemented.
|
|
130
|
-
*/
|
|
131
|
-
initialScrollIndex?: ?number,
|
|
132
|
-
/**
|
|
133
|
-
* Reverses the direction of scroll. Uses scale transforms of -1.
|
|
134
|
-
*/
|
|
135
|
-
inverted?: ?boolean,
|
|
136
|
-
keyExtractor: (item: Item, index: number) => string,
|
|
137
|
-
/**
|
|
138
|
-
* Each cell is rendered using this element. Can be a React Component Class,
|
|
139
|
-
* or a render function. Defaults to using View.
|
|
140
|
-
*/
|
|
141
|
-
CellRendererComponent?: ?React.ComponentType<any>,
|
|
142
|
-
/**
|
|
143
|
-
* Rendered in between each item, but not at the top or bottom. By default, `highlighted` and
|
|
144
|
-
* `leadingItem` props are provided. `renderItem` provides `separators.highlight`/`unhighlight`
|
|
145
|
-
* which will update the `highlighted` prop, but you can also add custom props with
|
|
146
|
-
* `separators.updateProps`.
|
|
147
|
-
*/
|
|
148
|
-
ItemSeparatorComponent?: ?React.ComponentType<any>,
|
|
149
|
-
/**
|
|
150
|
-
* Takes an item from `data` and renders it into the list. Example usage:
|
|
151
|
-
*
|
|
152
|
-
* <FlatList
|
|
153
|
-
* ItemSeparatorComponent={Platform.OS !== 'android' && ({highlighted}) => (
|
|
154
|
-
* <View style={[style.separator, highlighted && {marginLeft: 0}]} />
|
|
155
|
-
* )}
|
|
156
|
-
* data={[{title: 'Title Text', key: 'item1'}]}
|
|
157
|
-
* ListItemComponent={({item, separators}) => (
|
|
158
|
-
* <TouchableHighlight
|
|
159
|
-
* onPress={() => this._onPress(item)}
|
|
160
|
-
* onShowUnderlay={separators.highlight}
|
|
161
|
-
* onHideUnderlay={separators.unhighlight}>
|
|
162
|
-
* <View style={{backgroundColor: 'white'}}>
|
|
163
|
-
* <Text>{item.title}</Text>
|
|
164
|
-
* </View>
|
|
165
|
-
* </TouchableHighlight>
|
|
166
|
-
* )}
|
|
167
|
-
* />
|
|
168
|
-
*
|
|
169
|
-
* Provides additional metadata like `index` if you need it, as well as a more generic
|
|
170
|
-
* `separators.updateProps` function which let's you set whatever props you want to change the
|
|
171
|
-
* rendering of either the leading separator or trailing separator in case the more common
|
|
172
|
-
* `highlight` and `unhighlight` (which set the `highlighted: boolean` prop) are insufficient for
|
|
173
|
-
* your use-case.
|
|
174
|
-
*/
|
|
175
|
-
ListItemComponent?: ?(React.ComponentType<any> | React.Element<any>),
|
|
176
|
-
/**
|
|
177
|
-
* Rendered when the list is empty. Can be a React Component Class, a render function, or
|
|
178
|
-
* a rendered element.
|
|
179
|
-
*/
|
|
180
|
-
ListEmptyComponent?: ?(React.ComponentType<any> | React.Element<any>),
|
|
181
|
-
/**
|
|
182
|
-
* Rendered at the bottom of all the items. Can be a React Component Class, a render function, or
|
|
183
|
-
* a rendered element.
|
|
184
|
-
*/
|
|
185
|
-
ListFooterComponent?: ?(React.ComponentType<any> | React.Element<any>),
|
|
186
|
-
/**
|
|
187
|
-
* Styling for internal View for ListFooterComponent
|
|
188
|
-
*/
|
|
189
|
-
ListFooterComponentStyle?: ViewStyleProp,
|
|
190
|
-
/**
|
|
191
|
-
* Rendered at the top of all the items. Can be a React Component Class, a render function, or
|
|
192
|
-
* a rendered element.
|
|
193
|
-
*/
|
|
194
|
-
ListHeaderComponent?: ?(React.ComponentType<any> | React.Element<any>),
|
|
195
|
-
/**
|
|
196
|
-
* Styling for internal View for ListHeaderComponent
|
|
197
|
-
*/
|
|
198
|
-
ListHeaderComponentStyle?: ViewStyleProp,
|
|
199
|
-
/**
|
|
200
|
-
* A unique identifier for this list. If there are multiple VirtualizedLists at the same level of
|
|
201
|
-
* nesting within another VirtualizedList, this key is necessary for virtualization to
|
|
202
|
-
* work properly.
|
|
203
|
-
*/
|
|
204
|
-
listKey?: string,
|
|
205
|
-
/**
|
|
206
|
-
* The maximum number of items to render in each incremental render batch. The more rendered at
|
|
207
|
-
* once, the better the fill rate, but responsiveness may suffer because rendering content may
|
|
208
|
-
* interfere with responding to button taps or other interactions.
|
|
209
|
-
*/
|
|
210
|
-
maxToRenderPerBatch: number,
|
|
211
|
-
/**
|
|
212
|
-
* Called once when the scroll position gets within `onEndReachedThreshold` of the rendered
|
|
213
|
-
* content.
|
|
214
|
-
*/
|
|
215
|
-
onEndReached?: ?(info: {distanceFromEnd: number, ...}) => void,
|
|
216
|
-
/**
|
|
217
|
-
* How far from the end (in units of visible length of the list) the bottom edge of the
|
|
218
|
-
* list must be from the end of the content to trigger the `onEndReached` callback.
|
|
219
|
-
* Thus a value of 0.5 will trigger `onEndReached` when the end of the content is
|
|
220
|
-
* within half the visible length of the list.
|
|
221
|
-
*/
|
|
222
|
-
onEndReachedThreshold?: ?number,
|
|
223
|
-
/**
|
|
224
|
-
* If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. Make
|
|
225
|
-
* sure to also set the `refreshing` prop correctly.
|
|
226
|
-
*/
|
|
227
|
-
onRefresh?: ?() => void,
|
|
228
|
-
/**
|
|
229
|
-
* Used to handle failures when scrolling to an index that has not been measured yet. Recommended
|
|
230
|
-
* action is to either compute your own offset and `scrollTo` it, or scroll as far as possible and
|
|
231
|
-
* then try again after more items have been rendered.
|
|
232
|
-
*/
|
|
233
|
-
onScrollToIndexFailed?: ?(info: {
|
|
234
|
-
index: number,
|
|
235
|
-
highestMeasuredFrameIndex: number,
|
|
236
|
-
averageItemLength: number,
|
|
237
|
-
...
|
|
238
|
-
}) => void,
|
|
239
|
-
/**
|
|
240
|
-
* Called when the viewability of rows changes, as defined by the
|
|
241
|
-
* `viewabilityConfig` prop.
|
|
242
|
-
*/
|
|
243
|
-
onViewableItemsChanged?: ?(info: {
|
|
244
|
-
viewableItems: Array<ViewToken>,
|
|
245
|
-
changed: Array<ViewToken>,
|
|
246
|
-
...
|
|
247
|
-
}) => void,
|
|
248
|
-
persistentScrollbar?: ?boolean,
|
|
249
|
-
/**
|
|
250
|
-
* Set this when offset is needed for the loading indicator to show correctly.
|
|
251
|
-
* @platform android
|
|
252
|
-
*/
|
|
253
|
-
progressViewOffset?: number,
|
|
254
|
-
/**
|
|
255
|
-
* A custom refresh control element. When set, it overrides the default
|
|
256
|
-
* <RefreshControl> component built internally. The onRefresh and refreshing
|
|
257
|
-
* props are also ignored. Only works for vertical VirtualizedList.
|
|
258
|
-
*/
|
|
259
|
-
refreshControl?: ?React.Element<any>,
|
|
260
|
-
/**
|
|
261
|
-
* Set this true while waiting for new data from a refresh.
|
|
262
|
-
*/
|
|
263
|
-
refreshing?: ?boolean,
|
|
264
|
-
/**
|
|
265
|
-
* Note: may have bugs (missing content) in some circumstances - use at your own risk.
|
|
266
|
-
*
|
|
267
|
-
* This may improve scroll performance for large lists.
|
|
268
|
-
*/
|
|
269
|
-
removeClippedSubviews?: boolean,
|
|
270
|
-
/**
|
|
271
|
-
* Render a custom scroll component, e.g. with a differently styled `RefreshControl`.
|
|
272
|
-
*/
|
|
273
|
-
renderScrollComponent?: (props: Object) => React.Element<any>,
|
|
274
|
-
/**
|
|
275
|
-
* Amount of time between low-pri item render batches, e.g. for rendering items quite a ways off
|
|
276
|
-
* screen. Similar fill rate/responsiveness tradeoff as `maxToRenderPerBatch`.
|
|
277
|
-
*/
|
|
278
|
-
updateCellsBatchingPeriod: number,
|
|
279
|
-
/**
|
|
280
|
-
* See `ViewabilityHelper` for flow type and further documentation.
|
|
281
|
-
*/
|
|
282
|
-
viewabilityConfig?: ViewabilityConfig,
|
|
283
|
-
/**
|
|
284
|
-
* List of ViewabilityConfig/onViewableItemsChanged pairs. A specific onViewableItemsChanged
|
|
285
|
-
* will be called when its corresponding ViewabilityConfig's conditions are met.
|
|
286
|
-
*/
|
|
287
|
-
viewabilityConfigCallbackPairs?: Array<ViewabilityConfigCallbackPair>,
|
|
288
|
-
/**
|
|
289
|
-
* Determines the maximum number of items rendered outside of the visible area, in units of
|
|
290
|
-
* visible lengths. So if your list fills the screen, then `windowSize={21}` (the default) will
|
|
291
|
-
* render the visible screen area plus up to 10 screens above and 10 below the viewport. Reducing
|
|
292
|
-
* this number will reduce memory consumption and may improve performance, but will increase the
|
|
293
|
-
* chance that fast scrolling may reveal momentary blank areas of unrendered content.
|
|
294
|
-
*/
|
|
295
|
-
windowSize: number,
|
|
296
|
-
/**
|
|
297
|
-
* The legacy implementation is no longer supported.
|
|
298
|
-
*/
|
|
299
|
-
legacyImplementation?: empty,
|
|
300
|
-
|};
|
|
301
|
-
|
|
302
|
-
type Props = {|
|
|
303
|
-
...React.ElementConfig<typeof ScrollView>,
|
|
304
|
-
...RequiredProps,
|
|
305
|
-
...OptionalProps,
|
|
306
|
-
|};
|
|
307
|
-
|
|
308
|
-
type DefaultProps = {|
|
|
309
|
-
disableVirtualization: boolean,
|
|
310
|
-
horizontal: boolean,
|
|
311
|
-
initialNumToRender: number,
|
|
312
|
-
keyExtractor: (item: Item, index: number) => string,
|
|
313
|
-
maxToRenderPerBatch: number,
|
|
314
|
-
onEndReachedThreshold: number,
|
|
315
|
-
scrollEventThrottle: number,
|
|
316
|
-
updateCellsBatchingPeriod: number,
|
|
317
|
-
windowSize: number,
|
|
318
|
-
|};
|
|
319
|
-
|
|
320
|
-
let _usedIndexForKey = false;
|
|
321
|
-
let _keylessItemComponentName: string = '';
|
|
322
|
-
|
|
323
|
-
type State = {
|
|
324
|
-
first: number,
|
|
325
|
-
last: number,
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Base implementation for the more convenient [`<FlatList>`](https://reactnative.dev/docs/flatlist.html)
|
|
330
|
-
* and [`<SectionList>`](https://reactnative.dev/docs/sectionlist.html) components, which are also better
|
|
331
|
-
* documented. In general, this should only really be used if you need more flexibility than
|
|
332
|
-
* `FlatList` provides, e.g. for use with immutable data instead of plain arrays.
|
|
333
|
-
*
|
|
334
|
-
* Virtualization massively improves memory consumption and performance of large lists by
|
|
335
|
-
* maintaining a finite render window of active items and replacing all items outside of the render
|
|
336
|
-
* window with appropriately sized blank space. The window adapts to scrolling behavior, and items
|
|
337
|
-
* are rendered incrementally with low-pri (after any running interactions) if they are far from the
|
|
338
|
-
* visible area, or with hi-pri otherwise to minimize the potential of seeing blank space.
|
|
339
|
-
*
|
|
340
|
-
* Some caveats:
|
|
341
|
-
*
|
|
342
|
-
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
|
|
343
|
-
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
|
|
344
|
-
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
|
|
345
|
-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
|
|
346
|
-
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
|
|
347
|
-
* changes. This includes the `data` prop and parent component state.
|
|
348
|
-
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
|
|
349
|
-
* offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see
|
|
350
|
-
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
|
|
351
|
-
* and we are working on improving it behind the scenes.
|
|
352
|
-
* - By default, the list looks for a `key` or `id` prop on each item and uses that for the React key.
|
|
353
|
-
* Alternatively, you can provide a custom `keyExtractor` prop.
|
|
354
|
-
*
|
|
355
|
-
*/
|
|
356
|
-
class VirtualizedList extends React.PureComponent<Props, State> {
|
|
357
|
-
static contextType: typeof VirtualizedListContext = VirtualizedListContext;
|
|
358
|
-
|
|
359
|
-
// scrollToEnd may be janky without getItemLayout prop
|
|
360
|
-
scrollToEnd(params?: ?{animated?: ?boolean, ...}) {
|
|
361
|
-
const animated = params ? params.animated : true;
|
|
362
|
-
const veryLast = this.props.getItemCount(this.props.data) - 1;
|
|
363
|
-
const frame = this._getFrameMetricsApprox(veryLast);
|
|
364
|
-
const offset = Math.max(
|
|
365
|
-
0,
|
|
366
|
-
frame.offset +
|
|
367
|
-
frame.length +
|
|
368
|
-
this._footerLength -
|
|
369
|
-
this._scrollMetrics.visibleLength,
|
|
370
|
-
);
|
|
371
|
-
|
|
372
|
-
if (this._scrollRef == null) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
if (this._scrollRef.scrollTo == null) {
|
|
377
|
-
console.warn(
|
|
378
|
-
'No scrollTo method provided. This may be because you have two nested ' +
|
|
379
|
-
'VirtualizedLists with the same orientation, or because you are ' +
|
|
380
|
-
'using a custom component that does not implement scrollTo.',
|
|
381
|
-
);
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
this._scrollRef.scrollTo(
|
|
386
|
-
this.props.horizontal ? {x: offset, animated} : {y: offset, animated},
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// scrollToIndex may be janky without getItemLayout prop
|
|
391
|
-
scrollToIndex(params: {
|
|
392
|
-
animated?: ?boolean,
|
|
393
|
-
index: number,
|
|
394
|
-
viewOffset?: number,
|
|
395
|
-
viewPosition?: number,
|
|
396
|
-
...
|
|
397
|
-
}) {
|
|
398
|
-
const {
|
|
399
|
-
data,
|
|
400
|
-
horizontal,
|
|
401
|
-
getItemCount,
|
|
402
|
-
getItemLayout,
|
|
403
|
-
onScrollToIndexFailed,
|
|
404
|
-
} = this.props;
|
|
405
|
-
const {animated, index, viewOffset, viewPosition} = params;
|
|
406
|
-
invariant(
|
|
407
|
-
index >= 0,
|
|
408
|
-
`scrollToIndex out of range: requested index ${index} but minimum is 0`,
|
|
409
|
-
);
|
|
410
|
-
invariant(
|
|
411
|
-
getItemCount(data) >= 1,
|
|
412
|
-
`scrollToIndex out of range: item length ${getItemCount(
|
|
413
|
-
data,
|
|
414
|
-
)} but minimum is 1`,
|
|
415
|
-
);
|
|
416
|
-
invariant(
|
|
417
|
-
index < getItemCount(data),
|
|
418
|
-
`scrollToIndex out of range: requested index ${index} is out of 0 to ${getItemCount(
|
|
419
|
-
data,
|
|
420
|
-
) - 1}`,
|
|
421
|
-
);
|
|
422
|
-
if (!getItemLayout && index > this._highestMeasuredFrameIndex) {
|
|
423
|
-
invariant(
|
|
424
|
-
!!onScrollToIndexFailed,
|
|
425
|
-
'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' +
|
|
426
|
-
'otherwise there is no way to know the location of offscreen indices or handle failures.',
|
|
427
|
-
);
|
|
428
|
-
onScrollToIndexFailed({
|
|
429
|
-
averageItemLength: this._averageCellLength,
|
|
430
|
-
highestMeasuredFrameIndex: this._highestMeasuredFrameIndex,
|
|
431
|
-
index,
|
|
432
|
-
});
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
const frame = this._getFrameMetricsApprox(index);
|
|
436
|
-
const offset =
|
|
437
|
-
Math.max(
|
|
438
|
-
0,
|
|
439
|
-
frame.offset -
|
|
440
|
-
(viewPosition || 0) *
|
|
441
|
-
(this._scrollMetrics.visibleLength - frame.length),
|
|
442
|
-
) - (viewOffset || 0);
|
|
443
|
-
|
|
444
|
-
if (this._scrollRef == null) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
if (this._scrollRef.scrollTo == null) {
|
|
449
|
-
console.warn(
|
|
450
|
-
'No scrollTo method provided. This may be because you have two nested ' +
|
|
451
|
-
'VirtualizedLists with the same orientation, or because you are ' +
|
|
452
|
-
'using a custom component that does not implement scrollTo.',
|
|
453
|
-
);
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
this._scrollRef.scrollTo(
|
|
458
|
-
horizontal ? {x: offset, animated} : {y: offset, animated},
|
|
459
|
-
);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
// scrollToItem may be janky without getItemLayout prop. Required linear scan through items -
|
|
463
|
-
// use scrollToIndex instead if possible.
|
|
464
|
-
scrollToItem(params: {
|
|
465
|
-
animated?: ?boolean,
|
|
466
|
-
item: Item,
|
|
467
|
-
viewPosition?: number,
|
|
468
|
-
...
|
|
469
|
-
}) {
|
|
470
|
-
const {item} = params;
|
|
471
|
-
const {data, getItem, getItemCount} = this.props;
|
|
472
|
-
const itemCount = getItemCount(data);
|
|
473
|
-
for (let index = 0; index < itemCount; index++) {
|
|
474
|
-
if (getItem(data, index) === item) {
|
|
475
|
-
this.scrollToIndex({...params, index});
|
|
476
|
-
break;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Scroll to a specific content pixel offset in the list.
|
|
483
|
-
*
|
|
484
|
-
* Param `offset` expects the offset to scroll to.
|
|
485
|
-
* In case of `horizontal` is true, the offset is the x-value,
|
|
486
|
-
* in any other case the offset is the y-value.
|
|
487
|
-
*
|
|
488
|
-
* Param `animated` (`true` by default) defines whether the list
|
|
489
|
-
* should do an animation while scrolling.
|
|
490
|
-
*/
|
|
491
|
-
scrollToOffset(params: {animated?: ?boolean, offset: number, ...}) {
|
|
492
|
-
const {animated, offset} = params;
|
|
493
|
-
|
|
494
|
-
if (this._scrollRef == null) {
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
if (this._scrollRef.scrollTo == null) {
|
|
499
|
-
console.warn(
|
|
500
|
-
'No scrollTo method provided. This may be because you have two nested ' +
|
|
501
|
-
'VirtualizedLists with the same orientation, or because you are ' +
|
|
502
|
-
'using a custom component that does not implement scrollTo.',
|
|
503
|
-
);
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
this._scrollRef.scrollTo(
|
|
508
|
-
this.props.horizontal ? {x: offset, animated} : {y: offset, animated},
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
recordInteraction() {
|
|
513
|
-
this._nestedChildLists.forEach(childList => {
|
|
514
|
-
childList.ref && childList.ref.recordInteraction();
|
|
515
|
-
});
|
|
516
|
-
this._viewabilityTuples.forEach(t => {
|
|
517
|
-
t.viewabilityHelper.recordInteraction();
|
|
518
|
-
});
|
|
519
|
-
this._updateViewableItems(this.props.data);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
flashScrollIndicators() {
|
|
523
|
-
if (this._scrollRef == null) {
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
this._scrollRef.flashScrollIndicators();
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* Provides a handle to the underlying scroll responder.
|
|
532
|
-
* Note that `this._scrollRef` might not be a `ScrollView`, so we
|
|
533
|
-
* need to check that it responds to `getScrollResponder` before calling it.
|
|
534
|
-
*/
|
|
535
|
-
getScrollResponder(): ?ScrollResponderType {
|
|
536
|
-
if (this._scrollRef && this._scrollRef.getScrollResponder) {
|
|
537
|
-
return this._scrollRef.getScrollResponder();
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
getScrollableNode(): ?number {
|
|
542
|
-
if (this._scrollRef && this._scrollRef.getScrollableNode) {
|
|
543
|
-
return this._scrollRef.getScrollableNode();
|
|
544
|
-
} else {
|
|
545
|
-
return ReactNative.findNodeHandle(this._scrollRef);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
getScrollRef():
|
|
550
|
-
| ?React.ElementRef<typeof ScrollView>
|
|
551
|
-
| ?React.ElementRef<typeof View> {
|
|
552
|
-
if (this._scrollRef && this._scrollRef.getScrollRef) {
|
|
553
|
-
return this._scrollRef.getScrollRef();
|
|
554
|
-
} else {
|
|
555
|
-
return this._scrollRef;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
setNativeProps(props: Object) {
|
|
560
|
-
if (this._scrollRef) {
|
|
561
|
-
this._scrollRef.setNativeProps(props);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
static defaultProps: DefaultProps = {
|
|
566
|
-
disableVirtualization: false,
|
|
567
|
-
horizontal: false,
|
|
568
|
-
initialNumToRender: 10,
|
|
569
|
-
keyExtractor: (item: Item, index: number) => {
|
|
570
|
-
if (item.key != null) {
|
|
571
|
-
return item.key;
|
|
572
|
-
}
|
|
573
|
-
if (item.id != null) {
|
|
574
|
-
return item.id;
|
|
575
|
-
}
|
|
576
|
-
_usedIndexForKey = true;
|
|
577
|
-
if (item.type && item.type.displayName) {
|
|
578
|
-
_keylessItemComponentName = item.type.displayName;
|
|
579
|
-
}
|
|
580
|
-
return String(index);
|
|
581
|
-
},
|
|
582
|
-
maxToRenderPerBatch: 10,
|
|
583
|
-
onEndReachedThreshold: 2, // multiples of length
|
|
584
|
-
scrollEventThrottle: 50,
|
|
585
|
-
updateCellsBatchingPeriod: 50,
|
|
586
|
-
windowSize: 21, // multiples of length
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
_getCellKey(): string {
|
|
590
|
-
return this.context?.cellKey || 'rootList';
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
_getListKey(): string {
|
|
594
|
-
return this.props.listKey || this._getCellKey();
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
_getDebugInfo(): ListDebugInfo {
|
|
598
|
-
return {
|
|
599
|
-
listKey: this._getListKey(),
|
|
600
|
-
cellKey: this._getCellKey(),
|
|
601
|
-
horizontal: !!this.props.horizontal,
|
|
602
|
-
parent: this.context?.debugInfo,
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
_getScrollMetrics = () => {
|
|
607
|
-
return this._scrollMetrics;
|
|
608
|
-
};
|
|
609
|
-
|
|
610
|
-
hasMore(): boolean {
|
|
611
|
-
return this._hasMore;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
_getOutermostParentListRef = () => {
|
|
615
|
-
if (this._isNestedWithSameOrientation()) {
|
|
616
|
-
return this.context.getOutermostParentListRef();
|
|
617
|
-
} else {
|
|
618
|
-
return this;
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
_getNestedChildState = (key: string): ?ChildListState => {
|
|
623
|
-
const existingChildData = this._nestedChildLists.get(key);
|
|
624
|
-
return existingChildData && existingChildData.state;
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
_registerAsNestedChild = (childList: {
|
|
628
|
-
cellKey: string,
|
|
629
|
-
key: string,
|
|
630
|
-
ref: VirtualizedList,
|
|
631
|
-
parentDebugInfo: ListDebugInfo,
|
|
632
|
-
...
|
|
633
|
-
}): ?ChildListState => {
|
|
634
|
-
// Register the mapping between this child key and the cellKey for its cell
|
|
635
|
-
const childListsInCell =
|
|
636
|
-
this._cellKeysToChildListKeys.get(childList.cellKey) || new Set();
|
|
637
|
-
childListsInCell.add(childList.key);
|
|
638
|
-
this._cellKeysToChildListKeys.set(childList.cellKey, childListsInCell);
|
|
639
|
-
const existingChildData = this._nestedChildLists.get(childList.key);
|
|
640
|
-
if (existingChildData && existingChildData.ref !== null) {
|
|
641
|
-
console.error(
|
|
642
|
-
'A VirtualizedList contains a cell which itself contains ' +
|
|
643
|
-
'more than one VirtualizedList of the same orientation as the parent ' +
|
|
644
|
-
'list. You must pass a unique listKey prop to each sibling list.\n\n' +
|
|
645
|
-
describeNestedLists({
|
|
646
|
-
...childList,
|
|
647
|
-
// We're called from the child's componentDidMount, so it's safe to
|
|
648
|
-
// read the child's props here (albeit weird).
|
|
649
|
-
horizontal: !!childList.ref.props.horizontal,
|
|
650
|
-
}),
|
|
651
|
-
);
|
|
652
|
-
}
|
|
653
|
-
this._nestedChildLists.set(childList.key, {
|
|
654
|
-
ref: childList.ref,
|
|
655
|
-
state: null,
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
if (this._hasInteracted) {
|
|
659
|
-
childList.ref.recordInteraction();
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
_unregisterAsNestedChild = (childList: {
|
|
664
|
-
key: string,
|
|
665
|
-
state: ChildListState,
|
|
666
|
-
...
|
|
667
|
-
}): void => {
|
|
668
|
-
this._nestedChildLists.set(childList.key, {
|
|
669
|
-
ref: null,
|
|
670
|
-
state: childList.state,
|
|
671
|
-
});
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
state: State;
|
|
675
|
-
|
|
676
|
-
constructor(props: Props) {
|
|
677
|
-
super(props);
|
|
678
|
-
invariant(
|
|
679
|
-
// $FlowFixMe
|
|
680
|
-
!props.onScroll || !props.onScroll.__isNative,
|
|
681
|
-
'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' +
|
|
682
|
-
'to support native onScroll events with useNativeDriver',
|
|
683
|
-
);
|
|
684
|
-
|
|
685
|
-
invariant(
|
|
686
|
-
props.windowSize > 0,
|
|
687
|
-
'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.',
|
|
688
|
-
);
|
|
689
|
-
|
|
690
|
-
this._fillRateHelper = new FillRateHelper(this._getFrameMetrics);
|
|
691
|
-
this._updateCellsToRenderBatcher = new Batchinator(
|
|
692
|
-
this._updateCellsToRender,
|
|
693
|
-
this.props.updateCellsBatchingPeriod,
|
|
694
|
-
);
|
|
695
|
-
|
|
696
|
-
if (this.props.viewabilityConfigCallbackPairs) {
|
|
697
|
-
this._viewabilityTuples = this.props.viewabilityConfigCallbackPairs.map(
|
|
698
|
-
pair => ({
|
|
699
|
-
viewabilityHelper: new ViewabilityHelper(pair.viewabilityConfig),
|
|
700
|
-
onViewableItemsChanged: pair.onViewableItemsChanged,
|
|
701
|
-
}),
|
|
702
|
-
);
|
|
703
|
-
} else if (this.props.onViewableItemsChanged) {
|
|
704
|
-
this._viewabilityTuples.push({
|
|
705
|
-
viewabilityHelper: new ViewabilityHelper(this.props.viewabilityConfig),
|
|
706
|
-
onViewableItemsChanged: this.props.onViewableItemsChanged,
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
let initialState = {
|
|
711
|
-
first: this.props.initialScrollIndex || 0,
|
|
712
|
-
last:
|
|
713
|
-
Math.min(
|
|
714
|
-
this.props.getItemCount(this.props.data),
|
|
715
|
-
(this.props.initialScrollIndex || 0) + this.props.initialNumToRender,
|
|
716
|
-
) - 1,
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
if (this._isNestedWithSameOrientation()) {
|
|
720
|
-
const storedState = this.context.getNestedChildState(this._getListKey());
|
|
721
|
-
if (storedState) {
|
|
722
|
-
initialState = storedState;
|
|
723
|
-
this.state = storedState;
|
|
724
|
-
this._frames = storedState.frames;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
this.state = initialState;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
componentDidMount() {
|
|
732
|
-
if (this._isNestedWithSameOrientation()) {
|
|
733
|
-
this.context.registerAsNestedChild({
|
|
734
|
-
cellKey: this._getCellKey(),
|
|
735
|
-
key: this._getListKey(),
|
|
736
|
-
ref: this,
|
|
737
|
-
// NOTE: When the child mounts (here) it's not necessarily safe to read
|
|
738
|
-
// the parent's props. This is why we explicitly propagate debugInfo
|
|
739
|
-
// "down" via context and "up" again via this method call on the
|
|
740
|
-
// parent.
|
|
741
|
-
parentDebugInfo: this.context.debugInfo,
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
componentWillUnmount() {
|
|
747
|
-
if (this._isNestedWithSameOrientation()) {
|
|
748
|
-
this.context.unregisterAsNestedChild({
|
|
749
|
-
key: this._getListKey(),
|
|
750
|
-
state: {
|
|
751
|
-
first: this.state.first,
|
|
752
|
-
last: this.state.last,
|
|
753
|
-
frames: this._frames,
|
|
754
|
-
},
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
this._updateViewableItems(null);
|
|
758
|
-
this._updateCellsToRenderBatcher.dispose({abort: true});
|
|
759
|
-
this._viewabilityTuples.forEach(tuple => {
|
|
760
|
-
tuple.viewabilityHelper.dispose();
|
|
761
|
-
});
|
|
762
|
-
this._fillRateHelper.deactivateAndFlush();
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
static getDerivedStateFromProps(newProps: Props, prevState: State): State {
|
|
766
|
-
const {data, getItemCount, maxToRenderPerBatch} = newProps;
|
|
767
|
-
// first and last could be stale (e.g. if a new, shorter items props is passed in), so we make
|
|
768
|
-
// sure we're rendering a reasonable range here.
|
|
769
|
-
return {
|
|
770
|
-
first: Math.max(
|
|
771
|
-
0,
|
|
772
|
-
Math.min(prevState.first, getItemCount(data) - 1 - maxToRenderPerBatch),
|
|
773
|
-
),
|
|
774
|
-
last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1)),
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
_pushCells(
|
|
779
|
-
cells: Array<Object>,
|
|
780
|
-
stickyHeaderIndices: Array<number>,
|
|
781
|
-
stickyIndicesFromProps: Set<number>,
|
|
782
|
-
first: number,
|
|
783
|
-
last: number,
|
|
784
|
-
inversionStyle: ViewStyleProp,
|
|
785
|
-
) {
|
|
786
|
-
const {
|
|
787
|
-
CellRendererComponent,
|
|
788
|
-
ItemSeparatorComponent,
|
|
789
|
-
data,
|
|
790
|
-
getItem,
|
|
791
|
-
getItemCount,
|
|
792
|
-
horizontal,
|
|
793
|
-
keyExtractor,
|
|
794
|
-
} = this.props;
|
|
795
|
-
const stickyOffset = this.props.ListHeaderComponent ? 1 : 0;
|
|
796
|
-
const end = getItemCount(data) - 1;
|
|
797
|
-
let prevCellKey;
|
|
798
|
-
last = Math.min(end, last);
|
|
799
|
-
for (let ii = first; ii <= last; ii++) {
|
|
800
|
-
const item = getItem(data, ii);
|
|
801
|
-
const key = keyExtractor(item, ii);
|
|
802
|
-
this._indicesToKeys.set(ii, key);
|
|
803
|
-
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
|
|
804
|
-
stickyHeaderIndices.push(cells.length);
|
|
805
|
-
}
|
|
806
|
-
cells.push(
|
|
807
|
-
<CellRenderer
|
|
808
|
-
CellRendererComponent={CellRendererComponent}
|
|
809
|
-
ItemSeparatorComponent={ii < end ? ItemSeparatorComponent : undefined}
|
|
810
|
-
cellKey={key}
|
|
811
|
-
fillRateHelper={this._fillRateHelper}
|
|
812
|
-
horizontal={horizontal}
|
|
813
|
-
index={ii}
|
|
814
|
-
inversionStyle={inversionStyle}
|
|
815
|
-
item={item}
|
|
816
|
-
key={key}
|
|
817
|
-
prevCellKey={prevCellKey}
|
|
818
|
-
onUpdateSeparators={this._onUpdateSeparators}
|
|
819
|
-
onLayout={e => this._onCellLayout(e, key, ii)}
|
|
820
|
-
onUnmount={this._onCellUnmount}
|
|
821
|
-
parentProps={this.props}
|
|
822
|
-
ref={ref => {
|
|
823
|
-
this._cellRefs[key] = ref;
|
|
824
|
-
}}
|
|
825
|
-
/>,
|
|
826
|
-
);
|
|
827
|
-
prevCellKey = key;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
_onUpdateSeparators = (keys: Array<?string>, newProps: Object) => {
|
|
832
|
-
keys.forEach(key => {
|
|
833
|
-
const ref = key != null && this._cellRefs[key];
|
|
834
|
-
ref && ref.updateSeparatorProps(newProps);
|
|
835
|
-
});
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
_isVirtualizationDisabled(): boolean {
|
|
839
|
-
return this.props.disableVirtualization || false;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
_isNestedWithSameOrientation(): boolean {
|
|
843
|
-
const nestedContext = this.context;
|
|
844
|
-
return !!(
|
|
845
|
-
nestedContext && !!nestedContext.horizontal === !!this.props.horizontal
|
|
846
|
-
);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
render(): React.Node {
|
|
850
|
-
if (__DEV__) {
|
|
851
|
-
const flatStyles = flattenStyle(this.props.contentContainerStyle);
|
|
852
|
-
if (flatStyles != null && flatStyles.flexWrap === 'wrap') {
|
|
853
|
-
console.warn(
|
|
854
|
-
'`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' +
|
|
855
|
-
'Consider using `numColumns` with `FlatList` instead.',
|
|
856
|
-
);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
const {
|
|
860
|
-
ListEmptyComponent,
|
|
861
|
-
ListFooterComponent,
|
|
862
|
-
ListHeaderComponent,
|
|
863
|
-
} = this.props;
|
|
864
|
-
const {data, horizontal} = this.props;
|
|
865
|
-
const isVirtualizationDisabled = this._isVirtualizationDisabled();
|
|
866
|
-
const inversionStyle = this.props.inverted
|
|
867
|
-
? this.props.horizontal
|
|
868
|
-
? styles.horizontallyInverted
|
|
869
|
-
: styles.verticallyInverted
|
|
870
|
-
: null;
|
|
871
|
-
const cells = [];
|
|
872
|
-
const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
|
|
873
|
-
const stickyHeaderIndices = [];
|
|
874
|
-
if (ListHeaderComponent) {
|
|
875
|
-
if (stickyIndicesFromProps.has(0)) {
|
|
876
|
-
stickyHeaderIndices.push(0);
|
|
877
|
-
}
|
|
878
|
-
const element = React.isValidElement(ListHeaderComponent) ? (
|
|
879
|
-
ListHeaderComponent
|
|
880
|
-
) : (
|
|
881
|
-
// $FlowFixMe
|
|
882
|
-
<ListHeaderComponent />
|
|
883
|
-
);
|
|
884
|
-
cells.push(
|
|
885
|
-
<VirtualizedListCellContextProvider
|
|
886
|
-
cellKey={this._getCellKey() + '-header'}
|
|
887
|
-
key="$header">
|
|
888
|
-
<View
|
|
889
|
-
onLayout={this._onLayoutHeader}
|
|
890
|
-
style={StyleSheet.compose(
|
|
891
|
-
inversionStyle,
|
|
892
|
-
this.props.ListHeaderComponentStyle,
|
|
893
|
-
)}>
|
|
894
|
-
{
|
|
895
|
-
// $FlowFixMe - Typing ReactNativeComponent revealed errors
|
|
896
|
-
element
|
|
897
|
-
}
|
|
898
|
-
</View>
|
|
899
|
-
</VirtualizedListCellContextProvider>,
|
|
900
|
-
);
|
|
901
|
-
}
|
|
902
|
-
const itemCount = this.props.getItemCount(data);
|
|
903
|
-
if (itemCount > 0) {
|
|
904
|
-
_usedIndexForKey = false;
|
|
905
|
-
_keylessItemComponentName = '';
|
|
906
|
-
const spacerKey = !horizontal ? 'height' : 'width';
|
|
907
|
-
const lastInitialIndex = this.props.initialScrollIndex
|
|
908
|
-
? -1
|
|
909
|
-
: this.props.initialNumToRender - 1;
|
|
910
|
-
const {first, last} = this.state;
|
|
911
|
-
this._pushCells(
|
|
912
|
-
cells,
|
|
913
|
-
stickyHeaderIndices,
|
|
914
|
-
stickyIndicesFromProps,
|
|
915
|
-
0,
|
|
916
|
-
lastInitialIndex,
|
|
917
|
-
inversionStyle,
|
|
918
|
-
);
|
|
919
|
-
const firstAfterInitial = Math.max(lastInitialIndex + 1, first);
|
|
920
|
-
if (!isVirtualizationDisabled && first > lastInitialIndex + 1) {
|
|
921
|
-
let insertedStickySpacer = false;
|
|
922
|
-
if (stickyIndicesFromProps.size > 0) {
|
|
923
|
-
const stickyOffset = ListHeaderComponent ? 1 : 0;
|
|
924
|
-
// See if there are any sticky headers in the virtualized space that we need to render.
|
|
925
|
-
for (let ii = firstAfterInitial - 1; ii > lastInitialIndex; ii--) {
|
|
926
|
-
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
|
|
927
|
-
const initBlock = this._getFrameMetricsApprox(lastInitialIndex);
|
|
928
|
-
const stickyBlock = this._getFrameMetricsApprox(ii);
|
|
929
|
-
const leadSpace =
|
|
930
|
-
stickyBlock.offset -
|
|
931
|
-
initBlock.offset -
|
|
932
|
-
(this.props.initialScrollIndex ? 0 : initBlock.length);
|
|
933
|
-
cells.push(
|
|
934
|
-
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment
|
|
935
|
-
* suppresses an error found when Flow v0.111 was deployed. To
|
|
936
|
-
* see the error, delete this comment and run Flow. */
|
|
937
|
-
<View key="$sticky_lead" style={{[spacerKey]: leadSpace}} />,
|
|
938
|
-
);
|
|
939
|
-
this._pushCells(
|
|
940
|
-
cells,
|
|
941
|
-
stickyHeaderIndices,
|
|
942
|
-
stickyIndicesFromProps,
|
|
943
|
-
ii,
|
|
944
|
-
ii,
|
|
945
|
-
inversionStyle,
|
|
946
|
-
);
|
|
947
|
-
const trailSpace =
|
|
948
|
-
this._getFrameMetricsApprox(first).offset -
|
|
949
|
-
(stickyBlock.offset + stickyBlock.length);
|
|
950
|
-
cells.push(
|
|
951
|
-
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment
|
|
952
|
-
* suppresses an error found when Flow v0.111 was deployed. To
|
|
953
|
-
* see the error, delete this comment and run Flow. */
|
|
954
|
-
<View key="$sticky_trail" style={{[spacerKey]: trailSpace}} />,
|
|
955
|
-
);
|
|
956
|
-
insertedStickySpacer = true;
|
|
957
|
-
break;
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
if (!insertedStickySpacer) {
|
|
962
|
-
const initBlock = this._getFrameMetricsApprox(lastInitialIndex);
|
|
963
|
-
const firstSpace =
|
|
964
|
-
this._getFrameMetricsApprox(first).offset -
|
|
965
|
-
(initBlock.offset + initBlock.length);
|
|
966
|
-
cells.push(
|
|
967
|
-
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment
|
|
968
|
-
* suppresses an error found when Flow v0.111 was deployed. To see
|
|
969
|
-
* the error, delete this comment and run Flow. */
|
|
970
|
-
<View key="$lead_spacer" style={{[spacerKey]: firstSpace}} />,
|
|
971
|
-
);
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
this._pushCells(
|
|
975
|
-
cells,
|
|
976
|
-
stickyHeaderIndices,
|
|
977
|
-
stickyIndicesFromProps,
|
|
978
|
-
firstAfterInitial,
|
|
979
|
-
last,
|
|
980
|
-
inversionStyle,
|
|
981
|
-
);
|
|
982
|
-
if (!this._hasWarned.keys && _usedIndexForKey) {
|
|
983
|
-
console.warn(
|
|
984
|
-
'VirtualizedList: missing keys for items, make sure to specify a key or id property on each ' +
|
|
985
|
-
'item or provide a custom keyExtractor.',
|
|
986
|
-
_keylessItemComponentName,
|
|
987
|
-
);
|
|
988
|
-
this._hasWarned.keys = true;
|
|
989
|
-
}
|
|
990
|
-
if (!isVirtualizationDisabled && last < itemCount - 1) {
|
|
991
|
-
const lastFrame = this._getFrameMetricsApprox(last);
|
|
992
|
-
// Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to
|
|
993
|
-
// prevent the user for hyperscrolling into un-measured area because otherwise content will
|
|
994
|
-
// likely jump around as it renders in above the viewport.
|
|
995
|
-
const end = this.props.getItemLayout
|
|
996
|
-
? itemCount - 1
|
|
997
|
-
: Math.min(itemCount - 1, this._highestMeasuredFrameIndex);
|
|
998
|
-
const endFrame = this._getFrameMetricsApprox(end);
|
|
999
|
-
const tailSpacerLength =
|
|
1000
|
-
endFrame.offset +
|
|
1001
|
-
endFrame.length -
|
|
1002
|
-
(lastFrame.offset + lastFrame.length);
|
|
1003
|
-
cells.push(
|
|
1004
|
-
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses
|
|
1005
|
-
* an error found when Flow v0.111 was deployed. To see the error,
|
|
1006
|
-
* delete this comment and run Flow. */
|
|
1007
|
-
<View key="$tail_spacer" style={{[spacerKey]: tailSpacerLength}} />,
|
|
1008
|
-
);
|
|
1009
|
-
}
|
|
1010
|
-
} else if (ListEmptyComponent) {
|
|
1011
|
-
const element: React.Element<any> = ((React.isValidElement(
|
|
1012
|
-
ListEmptyComponent,
|
|
1013
|
-
) ? (
|
|
1014
|
-
ListEmptyComponent
|
|
1015
|
-
) : (
|
|
1016
|
-
// $FlowFixMe
|
|
1017
|
-
<ListEmptyComponent />
|
|
1018
|
-
)): any);
|
|
1019
|
-
cells.push(
|
|
1020
|
-
React.cloneElement(element, {
|
|
1021
|
-
key: '$empty',
|
|
1022
|
-
onLayout: event => {
|
|
1023
|
-
this._onLayoutEmpty(event);
|
|
1024
|
-
if (element.props.onLayout) {
|
|
1025
|
-
element.props.onLayout(event);
|
|
1026
|
-
}
|
|
1027
|
-
},
|
|
1028
|
-
style: StyleSheet.compose(inversionStyle, element.props.style),
|
|
1029
|
-
}),
|
|
1030
|
-
);
|
|
1031
|
-
}
|
|
1032
|
-
if (ListFooterComponent) {
|
|
1033
|
-
const element = React.isValidElement(ListFooterComponent) ? (
|
|
1034
|
-
ListFooterComponent
|
|
1035
|
-
) : (
|
|
1036
|
-
// $FlowFixMe
|
|
1037
|
-
<ListFooterComponent />
|
|
1038
|
-
);
|
|
1039
|
-
cells.push(
|
|
1040
|
-
<VirtualizedListCellContextProvider
|
|
1041
|
-
cellKey={this._getFooterCellKey()}
|
|
1042
|
-
key="$footer">
|
|
1043
|
-
<View
|
|
1044
|
-
onLayout={this._onLayoutFooter}
|
|
1045
|
-
style={StyleSheet.compose(
|
|
1046
|
-
inversionStyle,
|
|
1047
|
-
this.props.ListFooterComponentStyle,
|
|
1048
|
-
)}>
|
|
1049
|
-
{
|
|
1050
|
-
// $FlowFixMe - Typing ReactNativeComponent revealed errors
|
|
1051
|
-
element
|
|
1052
|
-
}
|
|
1053
|
-
</View>
|
|
1054
|
-
</VirtualizedListCellContextProvider>,
|
|
1055
|
-
);
|
|
1056
|
-
}
|
|
1057
|
-
const scrollProps = {
|
|
1058
|
-
...this.props,
|
|
1059
|
-
onContentSizeChange: this._onContentSizeChange,
|
|
1060
|
-
onLayout: this._onLayout,
|
|
1061
|
-
onScroll: this._onScroll,
|
|
1062
|
-
onScrollBeginDrag: this._onScrollBeginDrag,
|
|
1063
|
-
onScrollEndDrag: this._onScrollEndDrag,
|
|
1064
|
-
onMomentumScrollBegin: this._onMomentumScrollBegin,
|
|
1065
|
-
onMomentumScrollEnd: this._onMomentumScrollEnd,
|
|
1066
|
-
scrollEventThrottle: this.props.scrollEventThrottle, // TODO: Android support
|
|
1067
|
-
invertStickyHeaders:
|
|
1068
|
-
this.props.invertStickyHeaders !== undefined
|
|
1069
|
-
? this.props.invertStickyHeaders
|
|
1070
|
-
: this.props.inverted,
|
|
1071
|
-
stickyHeaderIndices,
|
|
1072
|
-
style: inversionStyle
|
|
1073
|
-
? [inversionStyle, this.props.style]
|
|
1074
|
-
: this.props.style,
|
|
1075
|
-
};
|
|
1076
|
-
|
|
1077
|
-
this._hasMore =
|
|
1078
|
-
this.state.last < this.props.getItemCount(this.props.data) - 1;
|
|
1079
|
-
|
|
1080
|
-
const innerRet = (
|
|
1081
|
-
<VirtualizedListContextProvider
|
|
1082
|
-
value={{
|
|
1083
|
-
cellKey: null,
|
|
1084
|
-
getScrollMetrics: this._getScrollMetrics,
|
|
1085
|
-
horizontal: this.props.horizontal,
|
|
1086
|
-
getOutermostParentListRef: this._getOutermostParentListRef,
|
|
1087
|
-
getNestedChildState: this._getNestedChildState,
|
|
1088
|
-
registerAsNestedChild: this._registerAsNestedChild,
|
|
1089
|
-
unregisterAsNestedChild: this._unregisterAsNestedChild,
|
|
1090
|
-
debugInfo: this._getDebugInfo(),
|
|
1091
|
-
}}>
|
|
1092
|
-
{React.cloneElement(
|
|
1093
|
-
(
|
|
1094
|
-
this.props.renderScrollComponent ||
|
|
1095
|
-
this._defaultRenderScrollComponent
|
|
1096
|
-
)(scrollProps),
|
|
1097
|
-
{
|
|
1098
|
-
ref: this._captureScrollRef,
|
|
1099
|
-
},
|
|
1100
|
-
cells,
|
|
1101
|
-
)}
|
|
1102
|
-
</VirtualizedListContextProvider>
|
|
1103
|
-
);
|
|
1104
|
-
let ret = innerRet;
|
|
1105
|
-
if (__DEV__) {
|
|
1106
|
-
ret = (
|
|
1107
|
-
<ScrollView.Context.Consumer>
|
|
1108
|
-
{scrollContext => {
|
|
1109
|
-
if (
|
|
1110
|
-
scrollContext != null &&
|
|
1111
|
-
!scrollContext.horizontal === !this.props.horizontal &&
|
|
1112
|
-
!this._hasWarned.nesting &&
|
|
1113
|
-
this.context == null
|
|
1114
|
-
) {
|
|
1115
|
-
// TODO (T46547044): use React.warn once 16.9 is sync'd: https://github.com/facebook/react/pull/15170
|
|
1116
|
-
console.error(
|
|
1117
|
-
'VirtualizedLists should never be nested inside plain ScrollViews with the same ' +
|
|
1118
|
-
'orientation because it can break windowing and other functionality - use another ' +
|
|
1119
|
-
'VirtualizedList-backed container instead.',
|
|
1120
|
-
);
|
|
1121
|
-
this._hasWarned.nesting = true;
|
|
1122
|
-
}
|
|
1123
|
-
return innerRet;
|
|
1124
|
-
}}
|
|
1125
|
-
</ScrollView.Context.Consumer>
|
|
1126
|
-
);
|
|
1127
|
-
}
|
|
1128
|
-
if (this.props.debug) {
|
|
1129
|
-
return (
|
|
1130
|
-
<View style={styles.debug}>
|
|
1131
|
-
{ret}
|
|
1132
|
-
{this._renderDebugOverlay()}
|
|
1133
|
-
</View>
|
|
1134
|
-
);
|
|
1135
|
-
} else {
|
|
1136
|
-
return ret;
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
componentDidUpdate(prevProps: Props) {
|
|
1141
|
-
const {data, extraData} = this.props;
|
|
1142
|
-
if (data !== prevProps.data || extraData !== prevProps.extraData) {
|
|
1143
|
-
// clear the viewableIndices cache to also trigger
|
|
1144
|
-
// the onViewableItemsChanged callback with the new data
|
|
1145
|
-
this._viewabilityTuples.forEach(tuple => {
|
|
1146
|
-
tuple.viewabilityHelper.resetViewableIndices();
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
// The `this._hiPriInProgress` is guaranteeing a hiPri cell update will only happen
|
|
1150
|
-
// once per fiber update. The `_scheduleCellsToRenderUpdate` will set it to true
|
|
1151
|
-
// if a hiPri update needs to perform. If `componentDidUpdate` is triggered with
|
|
1152
|
-
// `this._hiPriInProgress=true`, means it's triggered by the hiPri update. The
|
|
1153
|
-
// `_scheduleCellsToRenderUpdate` will check this condition and not perform
|
|
1154
|
-
// another hiPri update.
|
|
1155
|
-
const hiPriInProgress = this._hiPriInProgress;
|
|
1156
|
-
this._scheduleCellsToRenderUpdate();
|
|
1157
|
-
// Make sure setting `this._hiPriInProgress` back to false after `componentDidUpdate`
|
|
1158
|
-
// is triggered with `this._hiPriInProgress = true`
|
|
1159
|
-
if (hiPriInProgress) {
|
|
1160
|
-
this._hiPriInProgress = false;
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
_averageCellLength = 0;
|
|
1165
|
-
// Maps a cell key to the set of keys for all outermost child lists within that cell
|
|
1166
|
-
_cellKeysToChildListKeys: Map<string, Set<string>> = new Map();
|
|
1167
|
-
_cellRefs = {};
|
|
1168
|
-
_fillRateHelper: FillRateHelper;
|
|
1169
|
-
_frames = {};
|
|
1170
|
-
_footerLength = 0;
|
|
1171
|
-
_hasDoneInitialScroll = false;
|
|
1172
|
-
_hasInteracted = false;
|
|
1173
|
-
_hasMore = false;
|
|
1174
|
-
_hasWarned = {};
|
|
1175
|
-
_headerLength = 0;
|
|
1176
|
-
_hiPriInProgress: boolean = false; // flag to prevent infinite hiPri cell limit update
|
|
1177
|
-
_highestMeasuredFrameIndex = 0;
|
|
1178
|
-
_indicesToKeys: Map<number, string> = new Map();
|
|
1179
|
-
_nestedChildLists: Map<
|
|
1180
|
-
string,
|
|
1181
|
-
{
|
|
1182
|
-
ref: ?VirtualizedList,
|
|
1183
|
-
state: ?ChildListState,
|
|
1184
|
-
...
|
|
1185
|
-
},
|
|
1186
|
-
> = new Map();
|
|
1187
|
-
_offsetFromParentVirtualizedList: number = 0;
|
|
1188
|
-
_prevParentOffset: number = 0;
|
|
1189
|
-
_scrollMetrics = {
|
|
1190
|
-
contentLength: 0,
|
|
1191
|
-
dOffset: 0,
|
|
1192
|
-
dt: 10,
|
|
1193
|
-
offset: 0,
|
|
1194
|
-
timestamp: 0,
|
|
1195
|
-
velocity: 0,
|
|
1196
|
-
visibleLength: 0,
|
|
1197
|
-
};
|
|
1198
|
-
_scrollRef: ?React.ElementRef<any> = null;
|
|
1199
|
-
_sentEndForContentLength = 0;
|
|
1200
|
-
_totalCellLength = 0;
|
|
1201
|
-
_totalCellsMeasured = 0;
|
|
1202
|
-
_updateCellsToRenderBatcher: Batchinator;
|
|
1203
|
-
_viewabilityTuples: Array<ViewabilityHelperCallbackTuple> = [];
|
|
1204
|
-
|
|
1205
|
-
_captureScrollRef = ref => {
|
|
1206
|
-
this._scrollRef = ref;
|
|
1207
|
-
};
|
|
1208
|
-
|
|
1209
|
-
_computeBlankness() {
|
|
1210
|
-
this._fillRateHelper.computeBlankness(
|
|
1211
|
-
this.props,
|
|
1212
|
-
this.state,
|
|
1213
|
-
this._scrollMetrics,
|
|
1214
|
-
);
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
_defaultRenderScrollComponent = props => {
|
|
1218
|
-
const onRefresh = props.onRefresh;
|
|
1219
|
-
if (this._isNestedWithSameOrientation()) {
|
|
1220
|
-
// $FlowFixMe - Typing ReactNativeComponent revealed errors
|
|
1221
|
-
return <View {...props} />;
|
|
1222
|
-
} else if (onRefresh) {
|
|
1223
|
-
invariant(
|
|
1224
|
-
typeof props.refreshing === 'boolean',
|
|
1225
|
-
'`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' +
|
|
1226
|
-
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses
|
|
1227
|
-
* an error found when Flow v0.111 was deployed. To see the error,
|
|
1228
|
-
* delete this comment and run Flow. */
|
|
1229
|
-
JSON.stringify(props.refreshing) +
|
|
1230
|
-
'`',
|
|
1231
|
-
);
|
|
1232
|
-
return (
|
|
1233
|
-
// $FlowFixMe Invalid prop usage
|
|
1234
|
-
<ScrollView
|
|
1235
|
-
{...props}
|
|
1236
|
-
refreshControl={
|
|
1237
|
-
props.refreshControl == null ? (
|
|
1238
|
-
<RefreshControl
|
|
1239
|
-
refreshing={props.refreshing}
|
|
1240
|
-
onRefresh={onRefresh}
|
|
1241
|
-
progressViewOffset={props.progressViewOffset}
|
|
1242
|
-
/>
|
|
1243
|
-
) : (
|
|
1244
|
-
props.refreshControl
|
|
1245
|
-
)
|
|
1246
|
-
}
|
|
1247
|
-
/>
|
|
1248
|
-
);
|
|
1249
|
-
} else {
|
|
1250
|
-
// $FlowFixMe Invalid prop usage
|
|
1251
|
-
return <ScrollView {...props} />;
|
|
1252
|
-
}
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
_onCellLayout(e, cellKey, index) {
|
|
1256
|
-
const layout = e.nativeEvent.layout;
|
|
1257
|
-
const next = {
|
|
1258
|
-
offset: this._selectOffset(layout),
|
|
1259
|
-
length: this._selectLength(layout),
|
|
1260
|
-
index,
|
|
1261
|
-
inLayout: true,
|
|
1262
|
-
};
|
|
1263
|
-
const curr = this._frames[cellKey];
|
|
1264
|
-
if (
|
|
1265
|
-
!curr ||
|
|
1266
|
-
next.offset !== curr.offset ||
|
|
1267
|
-
next.length !== curr.length ||
|
|
1268
|
-
index !== curr.index
|
|
1269
|
-
) {
|
|
1270
|
-
this._totalCellLength += next.length - (curr ? curr.length : 0);
|
|
1271
|
-
this._totalCellsMeasured += curr ? 0 : 1;
|
|
1272
|
-
this._averageCellLength =
|
|
1273
|
-
this._totalCellLength / this._totalCellsMeasured;
|
|
1274
|
-
this._frames[cellKey] = next;
|
|
1275
|
-
this._highestMeasuredFrameIndex = Math.max(
|
|
1276
|
-
this._highestMeasuredFrameIndex,
|
|
1277
|
-
index,
|
|
1278
|
-
);
|
|
1279
|
-
this._scheduleCellsToRenderUpdate();
|
|
1280
|
-
} else {
|
|
1281
|
-
this._frames[cellKey].inLayout = true;
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
this._triggerRemeasureForChildListsInCell(cellKey);
|
|
1285
|
-
|
|
1286
|
-
this._computeBlankness();
|
|
1287
|
-
this._updateViewableItems(this.props.data);
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
_onCellUnmount = (cellKey: string) => {
|
|
1291
|
-
const curr = this._frames[cellKey];
|
|
1292
|
-
if (curr) {
|
|
1293
|
-
this._frames[cellKey] = {...curr, inLayout: false};
|
|
1294
|
-
}
|
|
1295
|
-
};
|
|
1296
|
-
|
|
1297
|
-
_triggerRemeasureForChildListsInCell(cellKey: string): void {
|
|
1298
|
-
const childListKeys = this._cellKeysToChildListKeys.get(cellKey);
|
|
1299
|
-
if (childListKeys) {
|
|
1300
|
-
for (let childKey of childListKeys) {
|
|
1301
|
-
const childList = this._nestedChildLists.get(childKey);
|
|
1302
|
-
childList &&
|
|
1303
|
-
childList.ref &&
|
|
1304
|
-
childList.ref.measureLayoutRelativeToContainingList();
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
measureLayoutRelativeToContainingList(): void {
|
|
1310
|
-
// TODO (T35574538): findNodeHandle sometimes crashes with "Unable to find
|
|
1311
|
-
// node on an unmounted component" during scrolling
|
|
1312
|
-
try {
|
|
1313
|
-
if (!this._scrollRef) {
|
|
1314
|
-
return;
|
|
1315
|
-
}
|
|
1316
|
-
// We are assuming that getOutermostParentListRef().getScrollRef()
|
|
1317
|
-
// is a non-null reference to a ScrollView
|
|
1318
|
-
this._scrollRef.measureLayout(
|
|
1319
|
-
this.context.getOutermostParentListRef().getScrollRef(),
|
|
1320
|
-
(x, y, width, height) => {
|
|
1321
|
-
this._offsetFromParentVirtualizedList = this._selectOffset({x, y});
|
|
1322
|
-
this._scrollMetrics.contentLength = this._selectLength({
|
|
1323
|
-
width,
|
|
1324
|
-
height,
|
|
1325
|
-
});
|
|
1326
|
-
const scrollMetrics = this._convertParentScrollMetrics(
|
|
1327
|
-
this.context.getScrollMetrics(),
|
|
1328
|
-
);
|
|
1329
|
-
this._scrollMetrics.visibleLength = scrollMetrics.visibleLength;
|
|
1330
|
-
this._scrollMetrics.offset = scrollMetrics.offset;
|
|
1331
|
-
},
|
|
1332
|
-
error => {
|
|
1333
|
-
console.warn(
|
|
1334
|
-
"VirtualizedList: Encountered an error while measuring a list's" +
|
|
1335
|
-
' offset from its containing VirtualizedList.',
|
|
1336
|
-
);
|
|
1337
|
-
},
|
|
1338
|
-
);
|
|
1339
|
-
} catch (error) {
|
|
1340
|
-
console.warn(
|
|
1341
|
-
'measureLayoutRelativeToContainingList threw an error',
|
|
1342
|
-
error.stack,
|
|
1343
|
-
);
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
_onLayout = (e: Object) => {
|
|
1348
|
-
if (this._isNestedWithSameOrientation()) {
|
|
1349
|
-
// Need to adjust our scroll metrics to be relative to our containing
|
|
1350
|
-
// VirtualizedList before we can make claims about list item viewability
|
|
1351
|
-
this.measureLayoutRelativeToContainingList();
|
|
1352
|
-
} else {
|
|
1353
|
-
this._scrollMetrics.visibleLength = this._selectLength(
|
|
1354
|
-
e.nativeEvent.layout,
|
|
1355
|
-
);
|
|
1356
|
-
}
|
|
1357
|
-
this.props.onLayout && this.props.onLayout(e);
|
|
1358
|
-
this._scheduleCellsToRenderUpdate();
|
|
1359
|
-
this._maybeCallOnEndReached();
|
|
1360
|
-
};
|
|
1361
|
-
|
|
1362
|
-
_onLayoutEmpty = e => {
|
|
1363
|
-
this.props.onLayout && this.props.onLayout(e);
|
|
1364
|
-
};
|
|
1365
|
-
|
|
1366
|
-
_getFooterCellKey(): string {
|
|
1367
|
-
return this._getCellKey() + '-footer';
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
_onLayoutFooter = e => {
|
|
1371
|
-
this._triggerRemeasureForChildListsInCell(this._getFooterCellKey());
|
|
1372
|
-
this._footerLength = this._selectLength(e.nativeEvent.layout);
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
_onLayoutHeader = e => {
|
|
1376
|
-
this._headerLength = this._selectLength(e.nativeEvent.layout);
|
|
1377
|
-
};
|
|
1378
|
-
|
|
1379
|
-
_renderDebugOverlay() {
|
|
1380
|
-
const normalize =
|
|
1381
|
-
this._scrollMetrics.visibleLength /
|
|
1382
|
-
(this._scrollMetrics.contentLength || 1);
|
|
1383
|
-
const framesInLayout = [];
|
|
1384
|
-
const itemCount = this.props.getItemCount(this.props.data);
|
|
1385
|
-
for (let ii = 0; ii < itemCount; ii++) {
|
|
1386
|
-
const frame = this._getFrameMetricsApprox(ii);
|
|
1387
|
-
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
|
1388
|
-
* error found when Flow v0.68 was deployed. To see the error delete this
|
|
1389
|
-
* comment and run Flow. */
|
|
1390
|
-
if (frame.inLayout) {
|
|
1391
|
-
framesInLayout.push(frame);
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
const windowTop = this._getFrameMetricsApprox(this.state.first).offset;
|
|
1395
|
-
const frameLast = this._getFrameMetricsApprox(this.state.last);
|
|
1396
|
-
const windowLen = frameLast.offset + frameLast.length - windowTop;
|
|
1397
|
-
const visTop = this._scrollMetrics.offset;
|
|
1398
|
-
const visLen = this._scrollMetrics.visibleLength;
|
|
1399
|
-
|
|
1400
|
-
return (
|
|
1401
|
-
<View style={[styles.debugOverlayBase, styles.debugOverlay]}>
|
|
1402
|
-
{framesInLayout.map((f, ii) => (
|
|
1403
|
-
<View
|
|
1404
|
-
key={'f' + ii}
|
|
1405
|
-
style={[
|
|
1406
|
-
styles.debugOverlayBase,
|
|
1407
|
-
styles.debugOverlayFrame,
|
|
1408
|
-
{
|
|
1409
|
-
top: f.offset * normalize,
|
|
1410
|
-
height: f.length * normalize,
|
|
1411
|
-
},
|
|
1412
|
-
]}
|
|
1413
|
-
/>
|
|
1414
|
-
))}
|
|
1415
|
-
<View
|
|
1416
|
-
style={[
|
|
1417
|
-
styles.debugOverlayBase,
|
|
1418
|
-
styles.debugOverlayFrameLast,
|
|
1419
|
-
{
|
|
1420
|
-
top: windowTop * normalize,
|
|
1421
|
-
height: windowLen * normalize,
|
|
1422
|
-
},
|
|
1423
|
-
]}
|
|
1424
|
-
/>
|
|
1425
|
-
<View
|
|
1426
|
-
style={[
|
|
1427
|
-
styles.debugOverlayBase,
|
|
1428
|
-
styles.debugOverlayFrameVis,
|
|
1429
|
-
{
|
|
1430
|
-
top: visTop * normalize,
|
|
1431
|
-
height: visLen * normalize,
|
|
1432
|
-
},
|
|
1433
|
-
]}
|
|
1434
|
-
/>
|
|
1435
|
-
</View>
|
|
1436
|
-
);
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
_selectLength(
|
|
1440
|
-
metrics: $ReadOnly<{
|
|
1441
|
-
height: number,
|
|
1442
|
-
width: number,
|
|
1443
|
-
...
|
|
1444
|
-
}>,
|
|
1445
|
-
): number {
|
|
1446
|
-
return !this.props.horizontal ? metrics.height : metrics.width;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
_selectOffset(
|
|
1450
|
-
metrics: $ReadOnly<{
|
|
1451
|
-
x: number,
|
|
1452
|
-
y: number,
|
|
1453
|
-
...
|
|
1454
|
-
}>,
|
|
1455
|
-
): number {
|
|
1456
|
-
return !this.props.horizontal ? metrics.y : metrics.x;
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
_maybeCallOnEndReached() {
|
|
1460
|
-
const {
|
|
1461
|
-
data,
|
|
1462
|
-
getItemCount,
|
|
1463
|
-
onEndReached,
|
|
1464
|
-
onEndReachedThreshold,
|
|
1465
|
-
} = this.props;
|
|
1466
|
-
const {contentLength, visibleLength, offset} = this._scrollMetrics;
|
|
1467
|
-
const distanceFromEnd = contentLength - visibleLength - offset;
|
|
1468
|
-
const threshold = onEndReachedThreshold
|
|
1469
|
-
? onEndReachedThreshold * visibleLength
|
|
1470
|
-
: 2;
|
|
1471
|
-
if (
|
|
1472
|
-
onEndReached &&
|
|
1473
|
-
this.state.last === getItemCount(data) - 1 &&
|
|
1474
|
-
distanceFromEnd < threshold &&
|
|
1475
|
-
this._scrollMetrics.contentLength !== this._sentEndForContentLength
|
|
1476
|
-
) {
|
|
1477
|
-
// Only call onEndReached once for a given content length
|
|
1478
|
-
this._sentEndForContentLength = this._scrollMetrics.contentLength;
|
|
1479
|
-
onEndReached({distanceFromEnd});
|
|
1480
|
-
} else if (distanceFromEnd > threshold) {
|
|
1481
|
-
// If the user scrolls away from the end and back again cause
|
|
1482
|
-
// an onEndReached to be triggered again
|
|
1483
|
-
this._sentEndForContentLength = 0;
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
_onContentSizeChange = (width: number, height: number) => {
|
|
1488
|
-
if (
|
|
1489
|
-
width > 0 &&
|
|
1490
|
-
height > 0 &&
|
|
1491
|
-
this.props.initialScrollIndex != null &&
|
|
1492
|
-
this.props.initialScrollIndex > 0 &&
|
|
1493
|
-
!this._hasDoneInitialScroll
|
|
1494
|
-
) {
|
|
1495
|
-
if (this.props.contentOffset == null) {
|
|
1496
|
-
this.scrollToIndex({
|
|
1497
|
-
animated: false,
|
|
1498
|
-
index: this.props.initialScrollIndex,
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1501
|
-
this._hasDoneInitialScroll = true;
|
|
1502
|
-
}
|
|
1503
|
-
if (this.props.onContentSizeChange) {
|
|
1504
|
-
this.props.onContentSizeChange(width, height);
|
|
1505
|
-
}
|
|
1506
|
-
this._scrollMetrics.contentLength = this._selectLength({height, width});
|
|
1507
|
-
this._scheduleCellsToRenderUpdate();
|
|
1508
|
-
this._maybeCallOnEndReached();
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
/* Translates metrics from a scroll event in a parent VirtualizedList into
|
|
1512
|
-
* coordinates relative to the child list.
|
|
1513
|
-
*/
|
|
1514
|
-
_convertParentScrollMetrics = (metrics: {
|
|
1515
|
-
visibleLength: number,
|
|
1516
|
-
offset: number,
|
|
1517
|
-
...
|
|
1518
|
-
}) => {
|
|
1519
|
-
// Offset of the top of the nested list relative to the top of its parent's viewport
|
|
1520
|
-
const offset = metrics.offset - this._offsetFromParentVirtualizedList;
|
|
1521
|
-
// Child's visible length is the same as its parent's
|
|
1522
|
-
const visibleLength = metrics.visibleLength;
|
|
1523
|
-
const dOffset = offset - this._scrollMetrics.offset;
|
|
1524
|
-
const contentLength = this._scrollMetrics.contentLength;
|
|
1525
|
-
|
|
1526
|
-
return {
|
|
1527
|
-
visibleLength,
|
|
1528
|
-
contentLength,
|
|
1529
|
-
offset,
|
|
1530
|
-
dOffset,
|
|
1531
|
-
};
|
|
1532
|
-
};
|
|
1533
|
-
|
|
1534
|
-
_onScroll = (e: Object) => {
|
|
1535
|
-
this._nestedChildLists.forEach(childList => {
|
|
1536
|
-
childList.ref && childList.ref._onScroll(e);
|
|
1537
|
-
});
|
|
1538
|
-
if (this.props.onScroll) {
|
|
1539
|
-
this.props.onScroll(e);
|
|
1540
|
-
}
|
|
1541
|
-
const timestamp = e.timeStamp;
|
|
1542
|
-
let visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);
|
|
1543
|
-
let contentLength = this._selectLength(e.nativeEvent.contentSize);
|
|
1544
|
-
let offset = this._selectOffset(e.nativeEvent.contentOffset);
|
|
1545
|
-
let dOffset = offset - this._scrollMetrics.offset;
|
|
1546
|
-
|
|
1547
|
-
if (this._isNestedWithSameOrientation()) {
|
|
1548
|
-
if (this._scrollMetrics.contentLength === 0) {
|
|
1549
|
-
// Ignore scroll events until onLayout has been called and we
|
|
1550
|
-
// know our offset from our offset from our parent
|
|
1551
|
-
return;
|
|
1552
|
-
}
|
|
1553
|
-
({
|
|
1554
|
-
visibleLength,
|
|
1555
|
-
contentLength,
|
|
1556
|
-
offset,
|
|
1557
|
-
dOffset,
|
|
1558
|
-
} = this._convertParentScrollMetrics({
|
|
1559
|
-
visibleLength,
|
|
1560
|
-
offset,
|
|
1561
|
-
}));
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
const dt = this._scrollMetrics.timestamp
|
|
1565
|
-
? Math.max(1, timestamp - this._scrollMetrics.timestamp)
|
|
1566
|
-
: 1;
|
|
1567
|
-
const velocity = dOffset / dt;
|
|
1568
|
-
|
|
1569
|
-
if (
|
|
1570
|
-
dt > 500 &&
|
|
1571
|
-
this._scrollMetrics.dt > 500 &&
|
|
1572
|
-
contentLength > 5 * visibleLength &&
|
|
1573
|
-
!this._hasWarned.perf
|
|
1574
|
-
) {
|
|
1575
|
-
infoLog(
|
|
1576
|
-
'VirtualizedList: You have a large list that is slow to update - make sure your ' +
|
|
1577
|
-
'renderItem function renders components that follow React performance best practices ' +
|
|
1578
|
-
'like PureComponent, shouldComponentUpdate, etc.',
|
|
1579
|
-
{dt, prevDt: this._scrollMetrics.dt, contentLength},
|
|
1580
|
-
);
|
|
1581
|
-
this._hasWarned.perf = true;
|
|
1582
|
-
}
|
|
1583
|
-
this._scrollMetrics = {
|
|
1584
|
-
contentLength,
|
|
1585
|
-
dt,
|
|
1586
|
-
dOffset,
|
|
1587
|
-
offset,
|
|
1588
|
-
timestamp,
|
|
1589
|
-
velocity,
|
|
1590
|
-
visibleLength,
|
|
1591
|
-
};
|
|
1592
|
-
this._updateViewableItems(this.props.data);
|
|
1593
|
-
if (!this.props) {
|
|
1594
|
-
return;
|
|
1595
|
-
}
|
|
1596
|
-
this._maybeCallOnEndReached();
|
|
1597
|
-
if (velocity !== 0) {
|
|
1598
|
-
this._fillRateHelper.activate();
|
|
1599
|
-
}
|
|
1600
|
-
this._computeBlankness();
|
|
1601
|
-
this._scheduleCellsToRenderUpdate();
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
_scheduleCellsToRenderUpdate() {
|
|
1605
|
-
const {first, last} = this.state;
|
|
1606
|
-
const {offset, visibleLength, velocity} = this._scrollMetrics;
|
|
1607
|
-
const itemCount = this.props.getItemCount(this.props.data);
|
|
1608
|
-
let hiPri = false;
|
|
1609
|
-
const scrollingThreshold =
|
|
1610
|
-
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
|
1611
|
-
* error found when Flow v0.63 was deployed. To see the error delete
|
|
1612
|
-
* this comment and run Flow. */
|
|
1613
|
-
(this.props.onEndReachedThreshold * visibleLength) / 2;
|
|
1614
|
-
// Mark as high priority if we're close to the start of the first item
|
|
1615
|
-
// But only if there are items before the first rendered item
|
|
1616
|
-
if (first > 0) {
|
|
1617
|
-
const distTop = offset - this._getFrameMetricsApprox(first).offset;
|
|
1618
|
-
hiPri =
|
|
1619
|
-
hiPri || distTop < 0 || (velocity < -2 && distTop < scrollingThreshold);
|
|
1620
|
-
}
|
|
1621
|
-
// Mark as high priority if we're close to the end of the last item
|
|
1622
|
-
// But only if there are items after the last rendered item
|
|
1623
|
-
if (last < itemCount - 1) {
|
|
1624
|
-
const distBottom =
|
|
1625
|
-
this._getFrameMetricsApprox(last).offset - (offset + visibleLength);
|
|
1626
|
-
hiPri =
|
|
1627
|
-
hiPri ||
|
|
1628
|
-
distBottom < 0 ||
|
|
1629
|
-
(velocity > 2 && distBottom < scrollingThreshold);
|
|
1630
|
-
}
|
|
1631
|
-
// Only trigger high-priority updates if we've actually rendered cells,
|
|
1632
|
-
// and with that size estimate, accurately compute how many cells we should render.
|
|
1633
|
-
// Otherwise, it would just render as many cells as it can (of zero dimension),
|
|
1634
|
-
// each time through attempting to render more (limited by maxToRenderPerBatch),
|
|
1635
|
-
// starving the renderer from actually laying out the objects and computing _averageCellLength.
|
|
1636
|
-
// If this is triggered in an `componentDidUpdate` followed by a hiPri cellToRenderUpdate
|
|
1637
|
-
// We shouldn't do another hipri cellToRenderUpdate
|
|
1638
|
-
if (
|
|
1639
|
-
hiPri &&
|
|
1640
|
-
(this._averageCellLength || this.props.getItemLayout) &&
|
|
1641
|
-
!this._hiPriInProgress
|
|
1642
|
-
) {
|
|
1643
|
-
this._hiPriInProgress = true;
|
|
1644
|
-
// Don't worry about interactions when scrolling quickly; focus on filling content as fast
|
|
1645
|
-
// as possible.
|
|
1646
|
-
this._updateCellsToRenderBatcher.dispose({abort: true});
|
|
1647
|
-
this._updateCellsToRender();
|
|
1648
|
-
return;
|
|
1649
|
-
} else {
|
|
1650
|
-
this._updateCellsToRenderBatcher.schedule();
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
_onScrollBeginDrag = (e): void => {
|
|
1655
|
-
this._nestedChildLists.forEach(childList => {
|
|
1656
|
-
childList.ref && childList.ref._onScrollBeginDrag(e);
|
|
1657
|
-
});
|
|
1658
|
-
this._viewabilityTuples.forEach(tuple => {
|
|
1659
|
-
tuple.viewabilityHelper.recordInteraction();
|
|
1660
|
-
});
|
|
1661
|
-
this._hasInteracted = true;
|
|
1662
|
-
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
|
|
1663
|
-
};
|
|
1664
|
-
|
|
1665
|
-
_onScrollEndDrag = (e): void => {
|
|
1666
|
-
this._nestedChildLists.forEach(childList => {
|
|
1667
|
-
childList.ref && childList.ref._onScrollEndDrag(e);
|
|
1668
|
-
});
|
|
1669
|
-
const {velocity} = e.nativeEvent;
|
|
1670
|
-
if (velocity) {
|
|
1671
|
-
this._scrollMetrics.velocity = this._selectOffset(velocity);
|
|
1672
|
-
}
|
|
1673
|
-
this._computeBlankness();
|
|
1674
|
-
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
|
|
1675
|
-
};
|
|
1676
|
-
|
|
1677
|
-
_onMomentumScrollBegin = (e): void => {
|
|
1678
|
-
this._nestedChildLists.forEach(childList => {
|
|
1679
|
-
childList.ref && childList.ref._onMomentumScrollBegin(e);
|
|
1680
|
-
});
|
|
1681
|
-
this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
_onMomentumScrollEnd = (e): void => {
|
|
1685
|
-
this._nestedChildLists.forEach(childList => {
|
|
1686
|
-
childList.ref && childList.ref._onMomentumScrollEnd(e);
|
|
1687
|
-
});
|
|
1688
|
-
this._scrollMetrics.velocity = 0;
|
|
1689
|
-
this._computeBlankness();
|
|
1690
|
-
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);
|
|
1691
|
-
};
|
|
1692
|
-
|
|
1693
|
-
_updateCellsToRender = () => {
|
|
1694
|
-
const {data, getItemCount, onEndReachedThreshold} = this.props;
|
|
1695
|
-
const isVirtualizationDisabled = this._isVirtualizationDisabled();
|
|
1696
|
-
this._updateViewableItems(data);
|
|
1697
|
-
if (!data) {
|
|
1698
|
-
return;
|
|
1699
|
-
}
|
|
1700
|
-
this.setState(state => {
|
|
1701
|
-
let newState;
|
|
1702
|
-
const {contentLength, offset, visibleLength} = this._scrollMetrics;
|
|
1703
|
-
if (!isVirtualizationDisabled) {
|
|
1704
|
-
// If we run this with bogus data, we'll force-render window {first: 0, last: 0},
|
|
1705
|
-
// and wipe out the initialNumToRender rendered elements.
|
|
1706
|
-
// So let's wait until the scroll view metrics have been set up. And until then,
|
|
1707
|
-
// we will trust the initialNumToRender suggestion
|
|
1708
|
-
if (visibleLength > 0 && contentLength > 0) {
|
|
1709
|
-
// If we have a non-zero initialScrollIndex and run this before we've scrolled,
|
|
1710
|
-
// we'll wipe out the initialNumToRender rendered elements starting at initialScrollIndex.
|
|
1711
|
-
// So let's wait until we've scrolled the view to the right place. And until then,
|
|
1712
|
-
// we will trust the initialScrollIndex suggestion.
|
|
1713
|
-
if (!this.props.initialScrollIndex || this._scrollMetrics.offset) {
|
|
1714
|
-
newState = computeWindowedRenderLimits(
|
|
1715
|
-
this.props,
|
|
1716
|
-
state,
|
|
1717
|
-
this._getFrameMetricsApprox,
|
|
1718
|
-
this._scrollMetrics,
|
|
1719
|
-
);
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
} else {
|
|
1723
|
-
const distanceFromEnd = contentLength - visibleLength - offset;
|
|
1724
|
-
const renderAhead =
|
|
1725
|
-
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses
|
|
1726
|
-
* an error found when Flow v0.63 was deployed. To see the error
|
|
1727
|
-
* delete this comment and run Flow. */
|
|
1728
|
-
distanceFromEnd < onEndReachedThreshold * visibleLength
|
|
1729
|
-
? this.props.maxToRenderPerBatch
|
|
1730
|
-
: 0;
|
|
1731
|
-
newState = {
|
|
1732
|
-
first: 0,
|
|
1733
|
-
last: Math.min(state.last + renderAhead, getItemCount(data) - 1),
|
|
1734
|
-
};
|
|
1735
|
-
}
|
|
1736
|
-
if (newState && this._nestedChildLists.size > 0) {
|
|
1737
|
-
const newFirst = newState.first;
|
|
1738
|
-
const newLast = newState.last;
|
|
1739
|
-
// If some cell in the new state has a child list in it, we should only render
|
|
1740
|
-
// up through that item, so that we give that list a chance to render.
|
|
1741
|
-
// Otherwise there's churn from multiple child lists mounting and un-mounting
|
|
1742
|
-
// their items.
|
|
1743
|
-
for (let ii = newFirst; ii <= newLast; ii++) {
|
|
1744
|
-
const cellKeyForIndex = this._indicesToKeys.get(ii);
|
|
1745
|
-
const childListKeys =
|
|
1746
|
-
cellKeyForIndex &&
|
|
1747
|
-
this._cellKeysToChildListKeys.get(cellKeyForIndex);
|
|
1748
|
-
if (!childListKeys) {
|
|
1749
|
-
continue;
|
|
1750
|
-
}
|
|
1751
|
-
let someChildHasMore = false;
|
|
1752
|
-
// For each cell, need to check whether any child list in it has more elements to render
|
|
1753
|
-
for (let childKey of childListKeys) {
|
|
1754
|
-
const childList = this._nestedChildLists.get(childKey);
|
|
1755
|
-
if (childList && childList.ref && childList.ref.hasMore()) {
|
|
1756
|
-
someChildHasMore = true;
|
|
1757
|
-
break;
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
|
-
if (someChildHasMore) {
|
|
1761
|
-
newState.last = ii;
|
|
1762
|
-
break;
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
if (
|
|
1767
|
-
newState != null &&
|
|
1768
|
-
newState.first === state.first &&
|
|
1769
|
-
newState.last === state.last
|
|
1770
|
-
) {
|
|
1771
|
-
newState = null;
|
|
1772
|
-
}
|
|
1773
|
-
return newState;
|
|
1774
|
-
});
|
|
1775
|
-
};
|
|
1776
|
-
|
|
1777
|
-
_createViewToken = (index: number, isViewable: boolean) => {
|
|
1778
|
-
const {data, getItem, keyExtractor} = this.props;
|
|
1779
|
-
const item = getItem(data, index);
|
|
1780
|
-
return {index, item, key: keyExtractor(item, index), isViewable};
|
|
1781
|
-
};
|
|
1782
|
-
|
|
1783
|
-
_getFrameMetricsApprox = (
|
|
1784
|
-
index: number,
|
|
1785
|
-
): {
|
|
1786
|
-
length: number,
|
|
1787
|
-
offset: number,
|
|
1788
|
-
...
|
|
1789
|
-
} => {
|
|
1790
|
-
const frame = this._getFrameMetrics(index);
|
|
1791
|
-
if (frame && frame.index === index) {
|
|
1792
|
-
// check for invalid frames due to row re-ordering
|
|
1793
|
-
return frame;
|
|
1794
|
-
} else {
|
|
1795
|
-
const {getItemLayout} = this.props;
|
|
1796
|
-
invariant(
|
|
1797
|
-
!getItemLayout,
|
|
1798
|
-
'Should not have to estimate frames when a measurement metrics function is provided',
|
|
1799
|
-
);
|
|
1800
|
-
return {
|
|
1801
|
-
length: this._averageCellLength,
|
|
1802
|
-
offset: this._averageCellLength * index,
|
|
1803
|
-
};
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
|
|
1807
|
-
_getFrameMetrics = (
|
|
1808
|
-
index: number,
|
|
1809
|
-
): ?{
|
|
1810
|
-
length: number,
|
|
1811
|
-
offset: number,
|
|
1812
|
-
index: number,
|
|
1813
|
-
inLayout?: boolean,
|
|
1814
|
-
...
|
|
1815
|
-
} => {
|
|
1816
|
-
const {
|
|
1817
|
-
data,
|
|
1818
|
-
getItem,
|
|
1819
|
-
getItemCount,
|
|
1820
|
-
getItemLayout,
|
|
1821
|
-
keyExtractor,
|
|
1822
|
-
} = this.props;
|
|
1823
|
-
invariant(
|
|
1824
|
-
getItemCount(data) > index,
|
|
1825
|
-
'Tried to get frame for out of range index ' + index,
|
|
1826
|
-
);
|
|
1827
|
-
const item = getItem(data, index);
|
|
1828
|
-
let frame = item && this._frames[keyExtractor(item, index)];
|
|
1829
|
-
if (!frame || frame.index !== index) {
|
|
1830
|
-
if (getItemLayout) {
|
|
1831
|
-
frame = getItemLayout(data, index);
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
|
1835
|
-
* error found when Flow v0.63 was deployed. To see the error delete this
|
|
1836
|
-
* comment and run Flow. */
|
|
1837
|
-
return frame;
|
|
1838
|
-
};
|
|
1839
|
-
|
|
1840
|
-
_updateViewableItems(data: any) {
|
|
1841
|
-
const {getItemCount} = this.props;
|
|
1842
|
-
|
|
1843
|
-
this._viewabilityTuples.forEach(tuple => {
|
|
1844
|
-
tuple.viewabilityHelper.onUpdate(
|
|
1845
|
-
getItemCount(data),
|
|
1846
|
-
this._scrollMetrics.offset,
|
|
1847
|
-
this._scrollMetrics.visibleLength,
|
|
1848
|
-
this._getFrameMetrics,
|
|
1849
|
-
this._createViewToken,
|
|
1850
|
-
tuple.onViewableItemsChanged,
|
|
1851
|
-
this.state,
|
|
1852
|
-
);
|
|
1853
|
-
});
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
type CellRendererProps = {
|
|
1858
|
-
CellRendererComponent?: ?React.ComponentType<any>,
|
|
1859
|
-
ItemSeparatorComponent: ?React.ComponentType<*>,
|
|
1860
|
-
cellKey: string,
|
|
1861
|
-
fillRateHelper: FillRateHelper,
|
|
1862
|
-
horizontal: ?boolean,
|
|
1863
|
-
index: number,
|
|
1864
|
-
inversionStyle: ViewStyleProp,
|
|
1865
|
-
item: Item,
|
|
1866
|
-
// This is extracted by ScrollViewStickyHeader
|
|
1867
|
-
onLayout: (event: Object) => void,
|
|
1868
|
-
onUnmount: (cellKey: string) => void,
|
|
1869
|
-
onUpdateSeparators: (cellKeys: Array<?string>, props: Object) => void,
|
|
1870
|
-
parentProps: {
|
|
1871
|
-
// e.g. height, y,
|
|
1872
|
-
getItemLayout?: (
|
|
1873
|
-
data: any,
|
|
1874
|
-
index: number,
|
|
1875
|
-
) => {
|
|
1876
|
-
length: number,
|
|
1877
|
-
offset: number,
|
|
1878
|
-
index: number,
|
|
1879
|
-
...
|
|
1880
|
-
},
|
|
1881
|
-
renderItem?: ?RenderItemType<Item>,
|
|
1882
|
-
ListItemComponent?: ?(React.ComponentType<any> | React.Element<any>),
|
|
1883
|
-
...
|
|
1884
|
-
},
|
|
1885
|
-
prevCellKey: ?string,
|
|
1886
|
-
...
|
|
1887
|
-
};
|
|
1888
|
-
|
|
1889
|
-
type CellRendererState = {
|
|
1890
|
-
separatorProps: $ReadOnly<{|
|
|
1891
|
-
highlighted: boolean,
|
|
1892
|
-
leadingItem: ?Item,
|
|
1893
|
-
|}>,
|
|
1894
|
-
...
|
|
1895
|
-
};
|
|
1896
|
-
|
|
1897
|
-
class CellRenderer extends React.Component<
|
|
1898
|
-
CellRendererProps,
|
|
1899
|
-
CellRendererState,
|
|
1900
|
-
> {
|
|
1901
|
-
state = {
|
|
1902
|
-
separatorProps: {
|
|
1903
|
-
highlighted: false,
|
|
1904
|
-
leadingItem: this.props.item,
|
|
1905
|
-
},
|
|
1906
|
-
};
|
|
1907
|
-
|
|
1908
|
-
static getDerivedStateFromProps(
|
|
1909
|
-
props: CellRendererProps,
|
|
1910
|
-
prevState: CellRendererState,
|
|
1911
|
-
): ?CellRendererState {
|
|
1912
|
-
return {
|
|
1913
|
-
separatorProps: {
|
|
1914
|
-
...prevState.separatorProps,
|
|
1915
|
-
leadingItem: props.item,
|
|
1916
|
-
},
|
|
1917
|
-
};
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
// TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not
|
|
1921
|
-
// reused by SectionList and we can keep VirtualizedList simpler.
|
|
1922
|
-
_separators = {
|
|
1923
|
-
highlight: () => {
|
|
1924
|
-
const {cellKey, prevCellKey} = this.props;
|
|
1925
|
-
this.props.onUpdateSeparators([cellKey, prevCellKey], {
|
|
1926
|
-
highlighted: true,
|
|
1927
|
-
});
|
|
1928
|
-
},
|
|
1929
|
-
unhighlight: () => {
|
|
1930
|
-
const {cellKey, prevCellKey} = this.props;
|
|
1931
|
-
this.props.onUpdateSeparators([cellKey, prevCellKey], {
|
|
1932
|
-
highlighted: false,
|
|
1933
|
-
});
|
|
1934
|
-
},
|
|
1935
|
-
updateProps: (select: 'leading' | 'trailing', newProps: Object) => {
|
|
1936
|
-
const {cellKey, prevCellKey} = this.props;
|
|
1937
|
-
this.props.onUpdateSeparators(
|
|
1938
|
-
[select === 'leading' ? prevCellKey : cellKey],
|
|
1939
|
-
newProps,
|
|
1940
|
-
);
|
|
1941
|
-
},
|
|
1942
|
-
};
|
|
1943
|
-
|
|
1944
|
-
updateSeparatorProps(newProps: Object) {
|
|
1945
|
-
this.setState(state => ({
|
|
1946
|
-
separatorProps: {...state.separatorProps, ...newProps},
|
|
1947
|
-
}));
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
componentWillUnmount() {
|
|
1951
|
-
this.props.onUnmount(this.props.cellKey);
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
_renderElement(renderItem, ListItemComponent, item, index) {
|
|
1955
|
-
if (renderItem && ListItemComponent) {
|
|
1956
|
-
console.warn(
|
|
1957
|
-
'VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take' +
|
|
1958
|
-
' precedence over renderItem.',
|
|
1959
|
-
);
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
if (ListItemComponent) {
|
|
1963
|
-
/* $FlowFixMe(>=0.108.0 site=react_native_fb) This comment suppresses an
|
|
1964
|
-
* error found when Flow v0.108 was deployed. To see the error, delete
|
|
1965
|
-
* this comment and run Flow. */
|
|
1966
|
-
return React.createElement(ListItemComponent, {
|
|
1967
|
-
item,
|
|
1968
|
-
index,
|
|
1969
|
-
separators: this._separators,
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
if (renderItem) {
|
|
1974
|
-
return renderItem({
|
|
1975
|
-
item,
|
|
1976
|
-
index,
|
|
1977
|
-
separators: this._separators,
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
invariant(
|
|
1982
|
-
false,
|
|
1983
|
-
'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.',
|
|
1984
|
-
);
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
render() {
|
|
1988
|
-
const {
|
|
1989
|
-
CellRendererComponent,
|
|
1990
|
-
ItemSeparatorComponent,
|
|
1991
|
-
fillRateHelper,
|
|
1992
|
-
horizontal,
|
|
1993
|
-
item,
|
|
1994
|
-
index,
|
|
1995
|
-
inversionStyle,
|
|
1996
|
-
parentProps,
|
|
1997
|
-
} = this.props;
|
|
1998
|
-
const {renderItem, getItemLayout, ListItemComponent} = parentProps;
|
|
1999
|
-
const element = this._renderElement(
|
|
2000
|
-
renderItem,
|
|
2001
|
-
ListItemComponent,
|
|
2002
|
-
item,
|
|
2003
|
-
index,
|
|
2004
|
-
);
|
|
2005
|
-
|
|
2006
|
-
const onLayout =
|
|
2007
|
-
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
|
2008
|
-
* error found when Flow v0.68 was deployed. To see the error delete this
|
|
2009
|
-
* comment and run Flow. */
|
|
2010
|
-
getItemLayout && !parentProps.debug && !fillRateHelper.enabled()
|
|
2011
|
-
? undefined
|
|
2012
|
-
: this.props.onLayout;
|
|
2013
|
-
// NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and
|
|
2014
|
-
// called explicitly by `ScrollViewStickyHeader`.
|
|
2015
|
-
const itemSeparator = ItemSeparatorComponent && (
|
|
2016
|
-
<ItemSeparatorComponent {...this.state.separatorProps} />
|
|
2017
|
-
);
|
|
2018
|
-
const cellStyle = inversionStyle
|
|
2019
|
-
? horizontal
|
|
2020
|
-
? [styles.rowReverse, inversionStyle]
|
|
2021
|
-
: [styles.columnReverse, inversionStyle]
|
|
2022
|
-
: horizontal
|
|
2023
|
-
? [styles.row, inversionStyle]
|
|
2024
|
-
: inversionStyle;
|
|
2025
|
-
const result = !CellRendererComponent ? (
|
|
2026
|
-
/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an
|
|
2027
|
-
* error found when Flow v0.89 was deployed. To see the error, delete
|
|
2028
|
-
* this comment and run Flow. */
|
|
2029
|
-
<View style={cellStyle} onLayout={onLayout}>
|
|
2030
|
-
{element}
|
|
2031
|
-
{itemSeparator}
|
|
2032
|
-
</View>
|
|
2033
|
-
) : (
|
|
2034
|
-
<CellRendererComponent
|
|
2035
|
-
{...this.props}
|
|
2036
|
-
style={cellStyle}
|
|
2037
|
-
onLayout={onLayout}>
|
|
2038
|
-
{element}
|
|
2039
|
-
{itemSeparator}
|
|
2040
|
-
</CellRendererComponent>
|
|
2041
|
-
);
|
|
2042
|
-
|
|
2043
|
-
return (
|
|
2044
|
-
<VirtualizedListCellContextProvider cellKey={this.props.cellKey}>
|
|
2045
|
-
{result}
|
|
2046
|
-
</VirtualizedListCellContextProvider>
|
|
2047
|
-
);
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
function describeNestedLists(childList: {
|
|
2052
|
-
+cellKey: string,
|
|
2053
|
-
+key: string,
|
|
2054
|
-
+ref: VirtualizedList,
|
|
2055
|
-
+parentDebugInfo: ListDebugInfo,
|
|
2056
|
-
+horizontal: boolean,
|
|
2057
|
-
...
|
|
2058
|
-
}) {
|
|
2059
|
-
let trace =
|
|
2060
|
-
'VirtualizedList trace:\n' +
|
|
2061
|
-
` Child (${childList.horizontal ? 'horizontal' : 'vertical'}):\n` +
|
|
2062
|
-
` listKey: ${childList.key}\n` +
|
|
2063
|
-
` cellKey: ${childList.cellKey}`;
|
|
2064
|
-
|
|
2065
|
-
let debugInfo = childList.parentDebugInfo;
|
|
2066
|
-
while (debugInfo) {
|
|
2067
|
-
trace +=
|
|
2068
|
-
`\n Parent (${debugInfo.horizontal ? 'horizontal' : 'vertical'}):\n` +
|
|
2069
|
-
` listKey: ${debugInfo.listKey}\n` +
|
|
2070
|
-
` cellKey: ${debugInfo.cellKey}`;
|
|
2071
|
-
debugInfo = debugInfo.parent;
|
|
2072
|
-
}
|
|
2073
|
-
return trace;
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
const styles = StyleSheet.create({
|
|
2077
|
-
verticallyInverted: {
|
|
2078
|
-
transform: [{scaleY: -1}],
|
|
2079
|
-
},
|
|
2080
|
-
horizontallyInverted: {
|
|
2081
|
-
transform: [{scaleX: -1}],
|
|
2082
|
-
},
|
|
2083
|
-
row: {
|
|
2084
|
-
flexDirection: 'row',
|
|
2085
|
-
},
|
|
2086
|
-
rowReverse: {
|
|
2087
|
-
flexDirection: 'row-reverse',
|
|
2088
|
-
},
|
|
2089
|
-
columnReverse: {
|
|
2090
|
-
flexDirection: 'column-reverse',
|
|
2091
|
-
},
|
|
2092
|
-
debug: {
|
|
2093
|
-
flex: 1,
|
|
2094
|
-
},
|
|
2095
|
-
debugOverlayBase: {
|
|
2096
|
-
position: 'absolute',
|
|
2097
|
-
top: 0,
|
|
2098
|
-
right: 0,
|
|
2099
|
-
},
|
|
2100
|
-
debugOverlay: {
|
|
2101
|
-
bottom: 0,
|
|
2102
|
-
width: 20,
|
|
2103
|
-
borderColor: 'blue',
|
|
2104
|
-
borderWidth: 1,
|
|
2105
|
-
},
|
|
2106
|
-
debugOverlayFrame: {
|
|
2107
|
-
left: 0,
|
|
2108
|
-
backgroundColor: 'orange',
|
|
2109
|
-
},
|
|
2110
|
-
debugOverlayFrameLast: {
|
|
2111
|
-
left: 0,
|
|
2112
|
-
borderColor: 'green',
|
|
2113
|
-
borderWidth: 2,
|
|
2114
|
-
},
|
|
2115
|
-
debugOverlayFrameVis: {
|
|
2116
|
-
left: 0,
|
|
2117
|
-
borderColor: 'red',
|
|
2118
|
-
borderWidth: 2,
|
|
2119
|
-
},
|
|
2120
|
-
});
|
|
15
|
+
const VirtualizedList: VirtualizedListType =
|
|
16
|
+
require('@react-native/virtualized-lists').VirtualizedList;
|
|
2121
17
|
|
|
18
|
+
export type {
|
|
19
|
+
RenderItemProps,
|
|
20
|
+
RenderItemType,
|
|
21
|
+
Separators,
|
|
22
|
+
} from '@react-native/virtualized-lists';
|
|
2122
23
|
module.exports = VirtualizedList;
|