react-native-windows 0.79.5 → 0.80.0-preview.10
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 +12 -3
- package/Directory.Build.props +11 -2
- package/Folly/TEMP_UntilFollyUpdate/json/json.cpp +1 -1
- package/Libraries/Alert/Alert.d.ts +4 -1
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Alert/RCTAlertManager.js +17 -0
- package/Libraries/Animated/Animated.js.flow +1 -3
- package/Libraries/Animated/AnimatedEvent.js +4 -3
- package/Libraries/Animated/AnimatedExports.js +2 -2
- package/Libraries/Animated/AnimatedExports.js.flow +140 -0
- package/Libraries/Animated/AnimatedImplementation.js +2 -123
- package/Libraries/Animated/Easing.js +13 -15
- package/Libraries/Animated/animations/Animation.js +8 -4
- package/Libraries/Animated/components/AnimatedFlatList.js +7 -6
- package/Libraries/Animated/components/AnimatedScrollView.js +48 -42
- package/Libraries/Animated/components/AnimatedSectionList.js +11 -7
- package/Libraries/Animated/createAnimatedComponent.js +105 -57
- package/Libraries/Animated/nodes/AnimatedNode.js +4 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +46 -26
- package/Libraries/Animated/nodes/AnimatedValue.js +16 -7
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/AppState/AppState.js +7 -2
- package/Libraries/BatchedBridge/MessageQueue.js +2 -2
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/BlobManager.js +1 -0
- package/Libraries/Blob/FileReader.js +219 -8
- package/Libraries/Blob/URL.js +37 -12
- package/Libraries/Blob/URLSearchParams.js +106 -31
- package/Libraries/Blob/URLSearchParams.js.flow +12 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
- package/Libraries/Components/Button.d.ts +3 -0
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.windows.js +27 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
- package/Libraries/{NewAppScreen/components/Colors.js → Components/DrawerAndroid/DrawerLayoutAndroid.ios.js} +6 -10
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
- package/Libraries/Components/Flyout/Flyout.js +11 -0
- package/Libraries/Components/Keyboard/Keyboard.js +5 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/Popup/Popup.js +11 -0
- package/Libraries/Components/Pressable/Pressable.js +20 -4
- package/Libraries/Components/Pressable/Pressable.windows.js +20 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +25 -3
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.windows.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
- package/Libraries/Components/ScrollView/ScrollView.js +132 -122
- package/Libraries/Components/ScrollView/ScrollView.windows.js +131 -122
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/Switch/Switch.d.ts +3 -0
- package/Libraries/Components/Switch/Switch.js +8 -4
- package/Libraries/Components/Switch/Switch.windows.js +17 -4
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -4
- package/Libraries/Components/TextInput/TextInput.d.ts +70 -33
- package/Libraries/Components/TextInput/TextInput.flow.js +100 -51
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1246 -0
- package/Libraries/Components/TextInput/TextInput.js +88 -1027
- package/Libraries/Components/TextInput/TextInput.windows.js +104 -1092
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.windows.js +1 -1
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +2 -1
- package/Libraries/{Modal/ModalInjection.js → Components/ToastAndroid/ToastAndroid.ios.js} +3 -5
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
- package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
- package/Libraries/Components/Touchable/Touchable.js +5 -5
- package/Libraries/Components/Touchable/Touchable.windows.js +5 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +14 -7
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +14 -7
- package/Libraries/Components/Touchable/TouchableHighlight.js +10 -7
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +10 -7
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +6 -6
- package/Libraries/Components/Touchable/TouchableOpacity.js +13 -6
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +13 -6
- package/Libraries/Components/View/View.js +18 -21
- package/Libraries/Components/View/View.windows.js +39 -41
- package/Libraries/Components/View/ViewAccessibility.d.ts +8 -0
- package/Libraries/Components/View/ViewAccessibility.js +25 -1
- package/Libraries/Components/View/ViewAccessibility.windows.js +9 -1
- package/Libraries/Components/View/ViewPropTypes.js +49 -3
- package/Libraries/Components/View/ViewPropTypes.windows.js +50 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +5 -5
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
- package/Libraries/EventEmitter/NativeEventEmitter.js +9 -4
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.d.ts +26 -10
- package/Libraries/Image/Image.js +17 -0
- package/Libraries/Image/Image.js.flow +5 -5
- package/Libraries/Image/Image.windows.js +13 -1
- package/Libraries/Image/ImageBackground.js +2 -0
- package/Libraries/Image/ImageInjection.js +1 -1
- package/Libraries/Image/ImageProps.js +22 -17
- package/Libraries/Image/ImageSource.js +3 -1
- package/Libraries/Image/ImageSourceUtils.js +4 -2
- package/Libraries/Image/ImageTypes.flow.js +1 -1
- package/Libraries/Interaction/InteractionManager.d.ts +13 -0
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +3 -3
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +2 -2
- package/Libraries/Lists/FlatList.js +8 -11
- package/Libraries/Lists/SectionList.js +39 -42
- package/Libraries/Lists/SectionListModern.js +25 -34
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +1 -0
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/Modal/Modal.js +33 -7
- package/Libraries/Modal/Modal.windows.js +33 -10
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
- package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js +17 -0
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +781 -10
- package/Libraries/Performance/Systrace.js +7 -7
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.windows.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +5 -4
- package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -322
- package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
- package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
- package/Libraries/ReactNative/FabricUIManager.js +10 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
- package/Libraries/ReactNative/RendererImplementation.js +10 -5
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -0
- package/Libraries/ReactNative/renderApplication.js +9 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +51 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
- package/Libraries/Settings/Settings.ios.js +1 -0
- package/Libraries/Settings/Settings.js +13 -19
- package/Libraries/Settings/SettingsFallback.js +33 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
- package/Libraries/StyleSheet/Rect.js +1 -0
- package/Libraries/StyleSheet/StyleSheet.js +31 -200
- package/Libraries/StyleSheet/StyleSheet.js.flow +188 -0
- package/Libraries/StyleSheet/StyleSheetExports.js +210 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +112 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +130 -52
- package/Libraries/StyleSheet/flattenStyle.js +14 -4
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
- package/Libraries/Text/Text.d.ts +2 -5
- package/Libraries/Text/Text.js +3 -3
- package/Libraries/Text/Text.windows.js +3 -3
- package/Libraries/Text/TextNativeComponent.js +0 -4
- package/Libraries/Text/TextProps.js +5 -33
- package/Libraries/Text/TextProps.windows.js +5 -32
- package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
- package/Libraries/{Blob/__mocks__/BlobModule.js → Types/CodegenTypesNamespace.js} +4 -6
- package/Libraries/Types/CoreEventTypes.d.ts +6 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.windows.js +1 -1
- package/Libraries/Utilities/Appearance.js +2 -0
- package/Libraries/Utilities/BackHandler.js +17 -0
- package/Libraries/Utilities/DeviceInfo.js +2 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/Platform.js +17 -0
- package/Libraries/Utilities/PlatformTypes.js +11 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +2 -2
- package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
- package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
- package/Libraries/WebSocket/WebSocket.js +313 -8
- package/Libraries/vendor/core/ErrorUtils.js +28 -2
- package/Libraries/vendor/emitter/EventEmitter.js +6 -2
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +248 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +55 -160
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +30 -9
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +36 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +36 -33
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +22 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +46 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +11 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +37 -5
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +177 -25
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +29 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +17 -34
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +225 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +23 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +4 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +64 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.h +11 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +36 -96
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +1 -1
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +29 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +3 -0
- package/Microsoft.ReactNative/TurboModulesProvider.h +1 -1
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/React.Cpp.props +4 -0
- package/PropertySheets/Warnings.props +45 -0
- package/README.md +6 -2
- package/ReactCommon/ReactCommon.vcxproj +9 -4
- package/ReactCommon/ReactCommon.vcxproj.filters +6 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +253 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +5 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +184 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +22 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleWithJSIBindings.cpp +27 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +308 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/DynamicEventPayload.cpp +42 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +7 -51
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +10 -5
- package/Scripts/creaternwapp.cmd +9 -3
- package/Scripts/rnw-dependencies.ps1 +16 -3
- package/Shared/Shared.vcxitems +3 -2
- package/Shared/Shared.vcxitems.filters +2 -1
- package/codegen/NativeAnimatedModuleSpec.g.h +2 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +14 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +151 -127
- package/codegen/NativeSampleTurboModuleSpec.g.h +14 -8
- package/codegen/react/components/rnwcore/EventEmitters.cpp +48 -48
- package/codegen/rnwcoreJSI-generated.cpp +159 -129
- package/codegen/rnwcoreJSI.h +534 -408
- package/index.js +51 -331
- package/index.windows.js +70 -352
- package/interface.js +0 -4
- package/jest/resolver.js +31 -0
- package/jest/setup.js +6 -2
- package/package.json +29 -28
- package/src/private/animated/NativeAnimatedHelper.js +21 -8
- package/src/private/animated/createAnimatedPropsHook.js +11 -16
- package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
- package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
- package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
- package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +3 -3
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +6 -5
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +8 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +11 -10
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +14 -12
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +5 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +9 -8
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +10 -9
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +7 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +4 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +6 -5
- package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.windows.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
- package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
- package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +82 -80
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +12 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -13
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/types/HostComponent.js +1 -1
- package/src/private/types/HostInstance.js +67 -1
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -18
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
- package/src/private/webapis/performance/Performance.js +1 -3
- package/src/private/webapis/performance/PerformanceEntry.js +6 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +10 -1
- package/src/types/globals.d.ts +42 -0
- package/stubs/double-conversion/double-conversion.h +3 -1
- package/templates/cpp-app/template.config.js +2 -1
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +4 -0
- package/templates/cpp-lib/example/metro.config.js +1 -1
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +4 -0
- package/templates/old/generateWrapper.js +1 -1
- package/templates/old/uwp-cpp-app/template.config.js +1 -1
- package/types/index.d.ts +6 -3
- package/types/public/ReactNativeTypes.d.ts +2 -2
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
- package/Libraries/Blob/FileReader_new.js +0 -231
- package/Libraries/Blob/FileReader_old.js +0 -186
- package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
- package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
- package/Libraries/Events/CustomEvent.js +0 -32
- package/Libraries/Events/EventPolyfill.js +0 -239
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
- package/Libraries/Network/XMLHttpRequest_new.js +0 -794
- package/Libraries/Network/XMLHttpRequest_old.js +0 -701
- package/Libraries/NewAppScreen/components/DebugInstructions.js +0 -41
- package/Libraries/NewAppScreen/components/DebugInstructions.windows.js +0 -30
- package/Libraries/NewAppScreen/components/Header.js +0 -77
- package/Libraries/NewAppScreen/components/HermesBadge.js +0 -53
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -148
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +0 -39
- package/Libraries/NewAppScreen/components/ReloadInstructions.windows.js +0 -31
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/NewAppScreen/index.js +0 -25
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
- package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
- package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
- package/Libraries/WebSocket/WebSocketEvent.js +0 -30
- package/Libraries/WebSocket/WebSocket_new.js +0 -325
- package/Libraries/WebSocket/WebSocket_old.js +0 -297
- package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
- package/jest/__tests__/setup-test.js +0 -18
- package/src/private/components/VScrollViewNativeComponents.js +0 -25
- package/src/private/utilities/ensureInstance.js +0 -21
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
- package/types/modules/LaunchScreen.d.ts +0 -18
- /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
- /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
|
@@ -23,48 +23,51 @@ import useAnimatedProps from '../useAnimatedProps';
|
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import {useMemo} from 'react';
|
|
25
25
|
|
|
26
|
-
type
|
|
27
|
-
type
|
|
26
|
+
type AnimatedScrollViewProps = React.ElementConfig<typeof ScrollView>;
|
|
27
|
+
type AnimatedScrollViewInstance = React.ElementRef<typeof ScrollView>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @see https://github.com/facebook/react-native/commit/b8c8562
|
|
31
31
|
*/
|
|
32
|
-
const AnimatedScrollView: AnimatedComponentType<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const AnimatedScrollView: AnimatedComponentType<
|
|
33
|
+
AnimatedScrollViewProps,
|
|
34
|
+
AnimatedScrollViewInstance,
|
|
35
|
+
> = React.forwardRef(
|
|
36
|
+
function AnimatedScrollViewWithOrWithoutInvertedRefreshControl(
|
|
37
|
+
props,
|
|
38
|
+
forwardedRef,
|
|
39
|
+
) {
|
|
40
|
+
// (Android only) When a ScrollView has a RefreshControl and
|
|
41
|
+
// any `style` property set with an Animated.Value, the CSS
|
|
42
|
+
// gets incorrectly applied twice. This is because ScrollView
|
|
43
|
+
// swaps the parent/child relationship of itself and the
|
|
44
|
+
// RefreshControl component (see ScrollView.js for more details).
|
|
45
|
+
if (
|
|
46
|
+
Platform.OS === 'android' &&
|
|
47
|
+
props.refreshControl != null &&
|
|
48
|
+
props.style != null
|
|
37
49
|
) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<AnimatedScrollViewWithoutInvertedRefreshControl
|
|
60
|
-
scrollEventThrottle={0.0001}
|
|
61
|
-
{...props}
|
|
62
|
-
ref={forwardedRef}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
);
|
|
50
|
+
return (
|
|
51
|
+
// $FlowFixMe - It should return an Animated ScrollView but it returns a ScrollView with Animated props applied.
|
|
52
|
+
<AnimatedScrollViewWithInvertedRefreshControl
|
|
53
|
+
scrollEventThrottle={0.0001}
|
|
54
|
+
{...props}
|
|
55
|
+
ref={forwardedRef}
|
|
56
|
+
// $FlowFixMe[incompatible-type]
|
|
57
|
+
refreshControl={props.refreshControl}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
} else {
|
|
61
|
+
return (
|
|
62
|
+
<AnimatedScrollViewWithoutInvertedRefreshControl
|
|
63
|
+
scrollEventThrottle={0.0001}
|
|
64
|
+
{...props}
|
|
65
|
+
ref={forwardedRef}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
);
|
|
68
71
|
|
|
69
72
|
const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
70
73
|
// $FlowFixMe[incompatible-call]
|
|
@@ -75,8 +78,8 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
|
75
78
|
refreshControl: ExactReactElement_DEPRECATED<any>,
|
|
76
79
|
},
|
|
77
80
|
forwardedRef:
|
|
78
|
-
| {current:
|
|
79
|
-
| ((
|
|
81
|
+
| {current: AnimatedScrollViewInstance | null, ...}
|
|
82
|
+
| ((AnimatedScrollViewInstance | null) => mixed),
|
|
80
83
|
) {
|
|
81
84
|
// Split `props` into the animate-able props for the parent (RefreshControl)
|
|
82
85
|
// and child (ScrollView).
|
|
@@ -106,10 +109,13 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
|
106
109
|
|
|
107
110
|
// Handle animated props on `NativeDirectionalScrollView`.
|
|
108
111
|
const [scrollViewAnimatedProps, scrollViewRef] = useAnimatedProps<
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
AnimatedScrollViewProps,
|
|
113
|
+
AnimatedScrollViewInstance,
|
|
111
114
|
>(intermediatePropsForScrollView);
|
|
112
|
-
const ref = useMergeRefs<
|
|
115
|
+
const ref = useMergeRefs<AnimatedScrollViewInstance>(
|
|
116
|
+
scrollViewRef,
|
|
117
|
+
forwardedRef,
|
|
118
|
+
);
|
|
113
119
|
|
|
114
120
|
return (
|
|
115
121
|
// $FlowFixMe[incompatible-use] Investigate useAnimatedProps return value
|
|
@@ -8,15 +8,19 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
12
|
-
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
|
11
|
+
import type {AnimatedProps} from '../createAnimatedComponent';
|
|
13
12
|
|
|
14
|
-
import SectionList from '../../Lists/SectionList';
|
|
13
|
+
import SectionList, {type SectionListProps} from '../../Lists/SectionList';
|
|
15
14
|
import createAnimatedComponent from '../createAnimatedComponent';
|
|
16
15
|
import * as React from 'react';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
// $FlowFixMe
|
|
18
|
+
export default (createAnimatedComponent(SectionList): component<
|
|
20
19
|
// $FlowExpectedError[unclear-type]
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
ItemT = any,
|
|
21
|
+
// $FlowExpectedError[unclear-type]
|
|
22
|
+
SectionT = any,
|
|
23
|
+
>(
|
|
24
|
+
ref?: React.RefSetter<SectionList<ItemT, SectionT>>,
|
|
25
|
+
...props: AnimatedProps<SectionListProps<ItemT, SectionT>>
|
|
26
|
+
));
|
|
@@ -8,7 +8,16 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type AnimatedAddition from './nodes/AnimatedAddition';
|
|
12
|
+
import type AnimatedDiffClamp from './nodes/AnimatedDiffClamp';
|
|
13
|
+
import type AnimatedDivision from './nodes/AnimatedDivision';
|
|
14
|
+
import type AnimatedInterpolation from './nodes/AnimatedInterpolation';
|
|
15
|
+
import type AnimatedModulo from './nodes/AnimatedModulo';
|
|
16
|
+
import type AnimatedMultiplication from './nodes/AnimatedMultiplication';
|
|
17
|
+
import type AnimatedNode from './nodes/AnimatedNode';
|
|
11
18
|
import type {AnimatedPropsAllowlist} from './nodes/AnimatedProps';
|
|
19
|
+
import type AnimatedSubtraction from './nodes/AnimatedSubtraction';
|
|
20
|
+
import type AnimatedValue from './nodes/AnimatedValue';
|
|
12
21
|
|
|
13
22
|
import createAnimatedPropsHook from '../../src/private/animated/createAnimatedPropsHook';
|
|
14
23
|
import composeStyles from '../../src/private/styles/composeStyles';
|
|
@@ -17,81 +26,120 @@ import useMergeRefs from '../Utilities/useMergeRefs';
|
|
|
17
26
|
import * as React from 'react';
|
|
18
27
|
import {useMemo} from 'react';
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
type Nullable = void | null;
|
|
30
|
+
type Primitive = string | number | boolean | symbol | void;
|
|
31
|
+
type Builtin = (...$ReadOnlyArray<empty>) => mixed | Date | Error | RegExp;
|
|
32
|
+
|
|
33
|
+
export type WithAnimatedValue<+T> = T extends Builtin | Nullable
|
|
34
|
+
? T
|
|
35
|
+
: T extends Primitive
|
|
36
|
+
?
|
|
37
|
+
| T
|
|
38
|
+
| AnimatedNode
|
|
39
|
+
| AnimatedAddition
|
|
40
|
+
| AnimatedSubtraction
|
|
41
|
+
| AnimatedDivision
|
|
42
|
+
| AnimatedMultiplication
|
|
43
|
+
| AnimatedModulo
|
|
44
|
+
| AnimatedDiffClamp
|
|
45
|
+
| AnimatedValue
|
|
46
|
+
| AnimatedInterpolation<number | string>
|
|
47
|
+
| AnimatedInterpolation<number>
|
|
48
|
+
| AnimatedInterpolation<string>
|
|
49
|
+
: T extends $ReadOnlyArray<infer P>
|
|
50
|
+
? $ReadOnlyArray<WithAnimatedValue<P>>
|
|
51
|
+
: T extends {...}
|
|
52
|
+
? {+[K in keyof T]: WithAnimatedValue<T[K]>}
|
|
53
|
+
: T;
|
|
29
54
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
type NonAnimatedProps =
|
|
56
|
+
| 'ref'
|
|
57
|
+
| 'innerViewRef'
|
|
58
|
+
| 'scrollViewRef'
|
|
59
|
+
| 'testID'
|
|
60
|
+
| 'disabled'
|
|
61
|
+
| 'accessibilityLabel';
|
|
62
|
+
type PassThroughProps = $ReadOnly<{
|
|
63
|
+
passthroughAnimatedPropExplicitValues?: React.ElementConfig<
|
|
64
|
+
typeof View,
|
|
65
|
+
> | null,
|
|
36
66
|
}>;
|
|
37
67
|
|
|
68
|
+
export type AnimatedProps<Props: {...}> = {
|
|
69
|
+
[K in keyof Props]: K extends NonAnimatedProps
|
|
70
|
+
? Props[K]
|
|
71
|
+
: WithAnimatedValue<Props[K]>,
|
|
72
|
+
} & PassThroughProps;
|
|
73
|
+
|
|
74
|
+
export type AnimatedBaseProps<Props: {...}> = {
|
|
75
|
+
[K in keyof Props]: K extends NonAnimatedProps
|
|
76
|
+
? Props[K]
|
|
77
|
+
: WithAnimatedValue<Props[K]>,
|
|
78
|
+
};
|
|
79
|
+
|
|
38
80
|
export type AnimatedComponentType<Props: {...}, +Instance = mixed> = component(
|
|
39
|
-
ref
|
|
81
|
+
ref?: React.RefSetter<Instance>,
|
|
40
82
|
...AnimatedProps<Props>
|
|
41
83
|
);
|
|
42
84
|
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
85
|
+
export default function createAnimatedComponent<
|
|
86
|
+
TInstance: React.ComponentType<any>,
|
|
87
|
+
>(
|
|
88
|
+
Component: TInstance,
|
|
89
|
+
): AnimatedComponentType<
|
|
90
|
+
$ReadOnly<React.ElementProps<TInstance>>,
|
|
91
|
+
React.ElementRef<TInstance>,
|
|
92
|
+
> {
|
|
51
93
|
return unstable_createAnimatedComponentWithAllowlist(Component, null);
|
|
52
94
|
}
|
|
53
95
|
|
|
54
96
|
export function unstable_createAnimatedComponentWithAllowlist<
|
|
55
97
|
TProps: {...},
|
|
56
|
-
TInstance
|
|
98
|
+
TInstance: React.ComponentType<TProps>,
|
|
57
99
|
>(
|
|
58
|
-
Component:
|
|
100
|
+
Component: TInstance,
|
|
59
101
|
allowlist: ?AnimatedPropsAllowlist,
|
|
60
|
-
):
|
|
102
|
+
): AnimatedComponentType<TProps, React.ElementRef<TInstance>> {
|
|
61
103
|
const useAnimatedProps = createAnimatedPropsHook(allowlist);
|
|
62
104
|
|
|
63
|
-
const AnimatedComponent
|
|
64
|
-
|
|
65
|
-
TInstance
|
|
66
|
-
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
105
|
+
const AnimatedComponent: AnimatedComponentType<
|
|
106
|
+
TProps,
|
|
107
|
+
React.ElementRef<TInstance>,
|
|
108
|
+
> = React.forwardRef<AnimatedProps<TProps>, React.ElementRef<TInstance>>(
|
|
109
|
+
(props, forwardedRef) => {
|
|
110
|
+
const [reducedProps, callbackRef] = useAnimatedProps<
|
|
111
|
+
TProps,
|
|
112
|
+
React.ElementRef<TInstance>,
|
|
113
|
+
>(props);
|
|
114
|
+
const ref = useMergeRefs<React.ElementRef<TInstance>>(
|
|
115
|
+
callbackRef,
|
|
116
|
+
forwardedRef,
|
|
117
|
+
);
|
|
71
118
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
119
|
+
// Some components require explicit passthrough values for animation
|
|
120
|
+
// to work properly. For example, if an animated component is
|
|
121
|
+
// transformed and Pressable, onPress will not work after transform
|
|
122
|
+
// without these passthrough values.
|
|
123
|
+
// $FlowFixMe[prop-missing]
|
|
124
|
+
const {passthroughAnimatedPropExplicitValues, style} = reducedProps;
|
|
125
|
+
const passthroughStyle = passthroughAnimatedPropExplicitValues?.style;
|
|
126
|
+
const mergedStyle = useMemo(
|
|
127
|
+
() => composeStyles(style, passthroughStyle),
|
|
128
|
+
[passthroughStyle, style],
|
|
129
|
+
);
|
|
83
130
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
131
|
+
// NOTE: It is important that `passthroughAnimatedPropExplicitValues` is
|
|
132
|
+
// spread after `reducedProps` but before `style`.
|
|
133
|
+
return (
|
|
134
|
+
<Component
|
|
135
|
+
{...reducedProps}
|
|
136
|
+
{...passthroughAnimatedPropExplicitValues}
|
|
137
|
+
style={mergedStyle}
|
|
138
|
+
ref={ref}
|
|
139
|
+
/>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
);
|
|
95
143
|
|
|
96
144
|
AnimatedComponent.displayName = `Animated(${
|
|
97
145
|
Component.displayName || 'Anonymous'
|
|
@@ -28,7 +28,7 @@ let _assertNativeAnimatedModule: ?() => void = () => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export default class AnimatedNode {
|
|
31
|
-
#listeners: Map<string, ValueListenerCallback
|
|
31
|
+
#listeners: Map<string, ValueListenerCallback>;
|
|
32
32
|
|
|
33
33
|
_platformConfig: ?PlatformConfig = undefined;
|
|
34
34
|
|
|
@@ -38,6 +38,7 @@ export default class AnimatedNode {
|
|
|
38
38
|
...
|
|
39
39
|
}>,
|
|
40
40
|
) {
|
|
41
|
+
this.#listeners = new Map();
|
|
41
42
|
if (__DEV__) {
|
|
42
43
|
this.__debugID = config?.debugID;
|
|
43
44
|
}
|
|
@@ -111,8 +112,8 @@ export default class AnimatedNode {
|
|
|
111
112
|
return this.#listeners.size > 0;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
__onAnimatedValueUpdateReceived(value: number): void {
|
|
115
|
-
this.__callListeners(value);
|
|
115
|
+
__onAnimatedValueUpdateReceived(value: number, offset: number): void {
|
|
116
|
+
this.__callListeners(value + offset);
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
__callListeners(value: number): void {
|
|
@@ -22,9 +22,15 @@ import invariant from 'invariant';
|
|
|
22
22
|
|
|
23
23
|
export type AnimatedPropsAllowlist = $ReadOnly<{
|
|
24
24
|
style?: ?AnimatedStyleAllowlist,
|
|
25
|
-
[string]: true,
|
|
25
|
+
[key: string]: true | AnimatedStyleAllowlist,
|
|
26
26
|
}>;
|
|
27
27
|
|
|
28
|
+
type TargetView = {
|
|
29
|
+
+instance: TargetViewInstance,
|
|
30
|
+
connectedViewTag: ?number,
|
|
31
|
+
};
|
|
32
|
+
type TargetViewInstance = React.ElementRef<React.ElementType>;
|
|
33
|
+
|
|
28
34
|
function createAnimatedProps(
|
|
29
35
|
inputProps: {[string]: mixed},
|
|
30
36
|
allowlist: ?AnimatedPropsAllowlist,
|
|
@@ -75,11 +81,11 @@ function createAnimatedProps(
|
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
export default class AnimatedProps extends AnimatedNode {
|
|
78
|
-
#animatedView: any = null;
|
|
79
84
|
#callback: () => void;
|
|
80
85
|
#nodeKeys: $ReadOnlyArray<string>;
|
|
81
86
|
#nodes: $ReadOnlyArray<AnimatedNode>;
|
|
82
87
|
#props: {[string]: mixed};
|
|
88
|
+
#target: ?TargetView = null;
|
|
83
89
|
|
|
84
90
|
constructor(
|
|
85
91
|
inputProps: {[string]: mixed},
|
|
@@ -140,6 +146,22 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
140
146
|
return props;
|
|
141
147
|
}
|
|
142
148
|
|
|
149
|
+
__getNativeAnimatedEventTuples(): $ReadOnlyArray<[string, AnimatedEvent]> {
|
|
150
|
+
const tuples = [];
|
|
151
|
+
|
|
152
|
+
const keys = Object.keys(this.#props);
|
|
153
|
+
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
154
|
+
const key = keys[ii];
|
|
155
|
+
const value = this.#props[key];
|
|
156
|
+
|
|
157
|
+
if (value instanceof AnimatedEvent && value.__isNative) {
|
|
158
|
+
tuples.push([key, value]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return tuples;
|
|
163
|
+
}
|
|
164
|
+
|
|
143
165
|
__getAnimatedValue(): Object {
|
|
144
166
|
const props: {[string]: mixed} = {};
|
|
145
167
|
|
|
@@ -164,10 +186,10 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
164
186
|
}
|
|
165
187
|
|
|
166
188
|
__detach(): void {
|
|
167
|
-
if (this.__isNative && this.#
|
|
168
|
-
this
|
|
189
|
+
if (this.__isNative && this.#target != null) {
|
|
190
|
+
this.#disconnectAnimatedView(this.#target);
|
|
169
191
|
}
|
|
170
|
-
this.#
|
|
192
|
+
this.#target = null;
|
|
171
193
|
|
|
172
194
|
const nodes = this.#nodes;
|
|
173
195
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
@@ -193,56 +215,54 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
193
215
|
this.__isNative = true;
|
|
194
216
|
|
|
195
217
|
// Since this does not call the super.__makeNative, we need to store the
|
|
196
|
-
// supplied platformConfig here, before calling
|
|
218
|
+
// supplied platformConfig here, before calling #connectAnimatedView
|
|
197
219
|
// where it will be needed to traverse the graph of attached values.
|
|
198
220
|
super.__setPlatformConfig(platformConfig);
|
|
199
221
|
|
|
200
|
-
if (this.#
|
|
201
|
-
this
|
|
222
|
+
if (this.#target != null) {
|
|
223
|
+
this.#connectAnimatedView(this.#target);
|
|
202
224
|
}
|
|
203
225
|
}
|
|
204
226
|
}
|
|
205
227
|
|
|
206
|
-
setNativeView(
|
|
207
|
-
if (this.#
|
|
228
|
+
setNativeView(instance: TargetViewInstance): void {
|
|
229
|
+
if (this.#target?.instance === instance) {
|
|
208
230
|
return;
|
|
209
231
|
}
|
|
210
|
-
this.#
|
|
232
|
+
this.#target = {instance, connectedViewTag: null};
|
|
211
233
|
if (this.__isNative) {
|
|
212
|
-
this
|
|
234
|
+
this.#connectAnimatedView(this.#target);
|
|
213
235
|
}
|
|
214
236
|
}
|
|
215
237
|
|
|
216
|
-
|
|
238
|
+
#connectAnimatedView(target: TargetView): void {
|
|
217
239
|
invariant(this.__isNative, 'Expected node to be marked as "native"');
|
|
218
|
-
let
|
|
219
|
-
if (
|
|
240
|
+
let viewTag: ?number = findNodeHandle(target.instance);
|
|
241
|
+
if (viewTag == null) {
|
|
220
242
|
if (process.env.NODE_ENV === 'test') {
|
|
221
|
-
|
|
243
|
+
viewTag = -1;
|
|
222
244
|
} else {
|
|
223
245
|
throw new Error('Unable to locate attached view in the native tree');
|
|
224
246
|
}
|
|
225
247
|
}
|
|
226
248
|
NativeAnimatedHelper.API.connectAnimatedNodeToView(
|
|
227
249
|
this.__getNativeTag(),
|
|
228
|
-
|
|
250
|
+
viewTag,
|
|
229
251
|
);
|
|
252
|
+
target.connectedViewTag = viewTag;
|
|
230
253
|
}
|
|
231
254
|
|
|
232
|
-
|
|
255
|
+
#disconnectAnimatedView(target: TargetView): void {
|
|
233
256
|
invariant(this.__isNative, 'Expected node to be marked as "native"');
|
|
234
|
-
|
|
235
|
-
if (
|
|
236
|
-
|
|
237
|
-
nativeViewTag = -1;
|
|
238
|
-
} else {
|
|
239
|
-
throw new Error('Unable to locate attached view in the native tree');
|
|
240
|
-
}
|
|
257
|
+
const viewTag = target.connectedViewTag;
|
|
258
|
+
if (viewTag == null) {
|
|
259
|
+
return;
|
|
241
260
|
}
|
|
242
261
|
NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(
|
|
243
262
|
this.__getNativeTag(),
|
|
244
|
-
|
|
263
|
+
viewTag,
|
|
245
264
|
);
|
|
265
|
+
target.connectedViewTag = null;
|
|
246
266
|
}
|
|
247
267
|
|
|
248
268
|
__restoreDefaultValues(): void {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
12
12
|
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
13
|
-
import type Animation
|
|
13
|
+
import type Animation from '../animations/Animation';
|
|
14
|
+
import type {EndCallback} from '../animations/Animation';
|
|
14
15
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
15
16
|
import type AnimatedNode from './AnimatedNode';
|
|
16
17
|
import type {AnimatedNodeConfig} from './AnimatedNode';
|
|
@@ -51,7 +52,6 @@ const NativeAnimatedAPI = NativeAnimatedHelper.API;
|
|
|
51
52
|
* transform which can receive values from multiple parents.
|
|
52
53
|
*/
|
|
53
54
|
export function flushValue(rootNode: AnimatedNode): void {
|
|
54
|
-
// eslint-disable-next-line func-call-spacing
|
|
55
55
|
const leaves = new Set<{update: () => void, ...}>();
|
|
56
56
|
function findAnimatedStyles(node: AnimatedNode) {
|
|
57
57
|
// $FlowFixMe[prop-missing]
|
|
@@ -85,8 +85,8 @@ function _executeAsAnimatedBatch(id: string, operation: () => void) {
|
|
|
85
85
|
* See https://reactnative.dev/docs/animatedvalue
|
|
86
86
|
*/
|
|
87
87
|
export default class AnimatedValue extends AnimatedWithChildren {
|
|
88
|
-
#listenerCount: number
|
|
89
|
-
#updateSubscription: ?EventSubscription
|
|
88
|
+
#listenerCount: number;
|
|
89
|
+
#updateSubscription: ?EventSubscription;
|
|
90
90
|
|
|
91
91
|
_value: number;
|
|
92
92
|
_startingValue: number;
|
|
@@ -99,6 +99,10 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
99
99
|
if (typeof value !== 'number') {
|
|
100
100
|
throw new Error('AnimatedValue: Attempting to set value to undefined');
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
this.#listenerCount = 0;
|
|
104
|
+
this.#updateSubscription = null;
|
|
105
|
+
|
|
102
106
|
this._startingValue = this._value = value;
|
|
103
107
|
this._offset = 0;
|
|
104
108
|
this._animation = null;
|
|
@@ -164,7 +168,7 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
164
168
|
'onAnimatedValueUpdate',
|
|
165
169
|
data => {
|
|
166
170
|
if (data.tag === nativeTag) {
|
|
167
|
-
this.__onAnimatedValueUpdateReceived(data.value);
|
|
171
|
+
this.__onAnimatedValueUpdateReceived(data.value, data.offset);
|
|
168
172
|
}
|
|
169
173
|
},
|
|
170
174
|
);
|
|
@@ -242,7 +246,9 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
242
246
|
this._offset += this._value;
|
|
243
247
|
this._value = 0;
|
|
244
248
|
if (this.__isNative) {
|
|
245
|
-
|
|
249
|
+
_executeAsAnimatedBatch(this.__getNativeTag().toString(), () =>
|
|
250
|
+
NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag()),
|
|
251
|
+
);
|
|
246
252
|
}
|
|
247
253
|
}
|
|
248
254
|
|
|
@@ -282,8 +288,11 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
282
288
|
}
|
|
283
289
|
}
|
|
284
290
|
|
|
285
|
-
__onAnimatedValueUpdateReceived(value: number): void {
|
|
291
|
+
__onAnimatedValueUpdateReceived(value: number, offset?: number): void {
|
|
286
292
|
this._updateValue(value, false /*flush*/);
|
|
293
|
+
if (offset != null) {
|
|
294
|
+
this._offset = offset;
|
|
295
|
+
}
|
|
287
296
|
}
|
|
288
297
|
|
|
289
298
|
/**
|
|
@@ -214,7 +214,9 @@ export default class AnimatedValueXY extends AnimatedWithChildren {
|
|
|
214
214
|
*
|
|
215
215
|
* See https://reactnative.dev/docs/animatedvaluexy#gettranslatetransform
|
|
216
216
|
*/
|
|
217
|
-
getTranslateTransform(): Array<
|
|
217
|
+
getTranslateTransform(): Array<
|
|
218
|
+
{translateX: AnimatedValue} | {translateY: AnimatedValue},
|
|
219
|
+
> {
|
|
218
220
|
return [{translateX: this.x}, {translateY: this.y}];
|
|
219
221
|
}
|
|
220
222
|
|
|
@@ -22,7 +22,12 @@ import NativeAppState from './NativeAppState';
|
|
|
22
22
|
* - @platform android - on another Activity (even if it was launched by your app)
|
|
23
23
|
* @platform ios - inactive - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
|
|
24
24
|
*/
|
|
25
|
-
export type AppStateStatus =
|
|
25
|
+
export type AppStateStatus =
|
|
26
|
+
| 'inactive'
|
|
27
|
+
| 'background'
|
|
28
|
+
| 'active'
|
|
29
|
+
| 'extension'
|
|
30
|
+
| 'unknown';
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* change - This even is received when the app state has changed.
|
|
@@ -107,7 +112,7 @@ class AppStateImpl {
|
|
|
107
112
|
*/
|
|
108
113
|
addEventListener<K: AppStateEvent>(
|
|
109
114
|
type: K,
|
|
110
|
-
handler: (
|
|
115
|
+
handler: (...AppStateEventDefinitions[K]) => void,
|
|
111
116
|
): EventSubscription {
|
|
112
117
|
const emitter = this._emitter;
|
|
113
118
|
if (emitter == null) {
|
|
@@ -35,7 +35,7 @@ const PARAMS = 2;
|
|
|
35
35
|
const MIN_TIME_BETWEEN_FLUSHES_MS = 5;
|
|
36
36
|
|
|
37
37
|
// eslint-disable-next-line no-bitwise
|
|
38
|
-
const
|
|
38
|
+
const TRACE_TAG_REACT = 1 << 13;
|
|
39
39
|
|
|
40
40
|
const DEBUG_INFO_LIMIT = 32;
|
|
41
41
|
|
|
@@ -228,7 +228,7 @@ class MessageQueue {
|
|
|
228
228
|
if (__DEV__) {
|
|
229
229
|
global.nativeTraceBeginAsyncFlow &&
|
|
230
230
|
global.nativeTraceBeginAsyncFlow(
|
|
231
|
-
|
|
231
|
+
TRACE_TAG_REACT,
|
|
232
232
|
'native',
|
|
233
233
|
this._callID,
|
|
234
234
|
);
|
|
@@ -65,6 +65,7 @@ function genModule(
|
|
|
65
65
|
module[methodName] = genMethod(moduleID, methodID, methodType);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
+
// $FlowFixMe[unsafe-object-assign]
|
|
68
69
|
Object.assign(module, constants);
|
|
69
70
|
|
|
70
71
|
if (module.getConstants == null) {
|
|
@@ -173,6 +174,7 @@ function updateErrorWithErrorData(
|
|
|
173
174
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
174
175
|
* parameters */
|
|
175
176
|
// $FlowFixMe[incompatible-return]
|
|
177
|
+
// $FlowFixMe[unsafe-object-assign]
|
|
176
178
|
return Object.assign(error, errorData || {});
|
|
177
179
|
}
|
|
178
180
|
|
|
@@ -110,6 +110,7 @@ class BlobManager {
|
|
|
110
110
|
static createFromOptions(options: BlobData): Blob {
|
|
111
111
|
BlobRegistry.register(options.blobId);
|
|
112
112
|
// $FlowFixMe[prop-missing]
|
|
113
|
+
// $FlowFixMe[unsafe-object-assign]
|
|
113
114
|
return Object.assign(Object.create(Blob.prototype), {
|
|
114
115
|
data:
|
|
115
116
|
// Reuse the collector instance when creating from an existing blob.
|