react-native-windows 0.74.12 → 0.75.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +8 -2
- package/Common/Utilities.cpp +2 -2
- package/Folly/TEMP_UntilFollyUpdate/ConstexprMath.h +970 -0
- package/Folly/TEMP_UntilFollyUpdate/json.cpp +1110 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +4 -2
- package/Libraries/Animated/AnimatedImplementation.js +2 -0
- package/Libraries/Animated/NativeAnimatedHelper.js +4 -0
- package/Libraries/Animated/createAnimatedComponent.js +10 -4
- package/Libraries/Animated/useAnimatedProps.js +56 -28
- package/Libraries/BatchedBridge/MessageQueue.js +1 -0
- package/Libraries/Components/Button.js +10 -5
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +11 -2
- package/Libraries/Components/Flyout/Flyout.js +10 -10
- package/Libraries/Components/Flyout/FlyoutNativeComponent.js +8 -7
- package/Libraries/Components/Pressable/Pressable.js +13 -6
- package/Libraries/Components/Pressable/Pressable.windows.js +13 -6
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +4 -0
- package/Libraries/Components/ScrollView/ScrollView.js +109 -29
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +6 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +6 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +13 -1
- package/Libraries/Components/StatusBar/StatusBar.js +1 -21
- package/Libraries/Components/Switch/Switch.windows.js +2 -0
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +0 -15
- package/Libraries/Components/TextInput/InputAccessoryView.js +10 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +0 -12
- package/Libraries/Components/TextInput/TextInput.d.ts +0 -19
- package/Libraries/Components/TextInput/TextInput.js +14 -70
- package/Libraries/Components/TextInput/TextInput.windows.js +15 -72
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +27 -12
- package/Libraries/Components/Touchable/Touchable.js +2 -2
- package/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -10
- package/Libraries/Components/Touchable/TouchableHighlight.js +3 -1
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +3 -1
- package/Libraries/Components/Touchable/TouchableOpacity.d.ts +4 -32
- package/Libraries/Components/Touchable/TouchableOpacity.js +3 -1
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +3 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +8 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +117 -111
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +129 -110
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +1 -0
- package/Libraries/Components/View/View.js +0 -11
- package/Libraries/Components/View/View.windows.js +0 -11
- package/Libraries/Components/View/ViewAccessibility.js +4 -4
- package/Libraries/Components/View/ViewAccessibility.windows.js +4 -4
- package/Libraries/Components/View/ViewPropTypes.d.ts +21 -59
- package/Libraries/Components/View/ViewPropTypes.js +7 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +7 -0
- package/Libraries/Core/Devtools/loadBundleFromServer.js +3 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +153 -0
- package/Libraries/Core/Devtools/parseErrorStack.js +5 -5
- package/Libraries/Core/Devtools/parseHermesStack.js +22 -16
- package/Libraries/Core/ErrorHandlers.js +116 -0
- package/Libraries/Core/ExceptionsManager.js +2 -2
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/setUpDeveloperTools.js +3 -1
- package/Libraries/Core/setUpPerformance.js +6 -4
- package/Libraries/Core/setUpReactDevTools.js +70 -10
- package/Libraries/Core/setUpTimers.js +50 -31
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
- package/Libraries/Image/Image.android.js +23 -13
- package/Libraries/Image/Image.d.ts +14 -15
- package/Libraries/Image/Image.ios.js +21 -11
- package/Libraries/Image/Image.windows.js +21 -11
- package/Libraries/Image/ImageProps.js +16 -5
- package/Libraries/Image/ImageTypes.flow.js +7 -2
- package/Libraries/Image/ImageUtils.js +1 -0
- package/Libraries/Image/ImageViewNativeComponent.js +2 -1
- package/Libraries/Inspector/ElementBox.js +6 -3
- package/Libraries/Inspector/ElementProperties.js +1 -1
- package/Libraries/Interaction/TouchHistoryMath.js +4 -4
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +6 -26
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +39 -29
- package/Libraries/LogBox/Data/LogBoxLog.js +114 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +168 -53
- package/Libraries/LogBox/LogBox.js +29 -12
- package/Libraries/LogBox/LogBoxNotificationContainer.js +4 -0
- package/Libraries/LogBox/UI/LogBoxInspector.js +8 -70
- package/Libraries/LogBox/UI/LogBoxInspectorBody.js +87 -0
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -42
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +58 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +5 -66
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +5 -66
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +76 -0
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +8 -5
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +8 -5
- package/Libraries/LogBox/UI/LogBoxNotification.js +13 -152
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +63 -0
- package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +67 -0
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +57 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +5 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +5 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +5 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +12 -5
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +3 -0
- package/Libraries/Network/XMLHttpRequest.js +5 -1
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +3 -3
- package/Libraries/Pressability/Pressability.js +3 -51
- package/Libraries/Pressability/Pressability.windows.js +3 -51
- package/Libraries/ReactNative/AppRegistry.d.ts +4 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -4
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -21
- package/Libraries/ReactNative/FabricUIManager.js +0 -51
- package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +1 -0
- package/Libraries/ReactNative/RendererImplementation.js +20 -2
- package/Libraries/ReactNative/UIManager.d.ts +0 -21
- package/Libraries/ReactNative/UIManagerProperties.js +0 -3
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +5 -341
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -8
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +15682 -27088
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +5082 -4381
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3480 -2571
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +15943 -27543
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5303 -4606
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3450 -2572
- package/Libraries/Renderer/shims/ReactFabric.js +2 -2
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +2 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +24 -3
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -2
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/Share/Share.d.ts +16 -10
- package/Libraries/Share/Share.js +14 -15
- package/Libraries/StyleSheet/StyleSheet.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +3 -10
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +21 -21
- package/Libraries/StyleSheet/StyleSheetTypes.js +24 -18
- package/Libraries/StyleSheet/flattenStyle.js +1 -0
- package/Libraries/StyleSheet/processFilter.js +132 -0
- package/Libraries/StyleSheet/processTransform.js +18 -3
- package/Libraries/Text/Text.js +151 -128
- package/Libraries/Text/Text.windows.js +144 -128
- package/Libraries/Text/TextNativeComponent.js +5 -4
- package/Libraries/Text/TextProps.js +6 -6
- package/Libraries/Text/TextProps.windows.js +6 -6
- package/Libraries/TurboModule/TurboModuleRegistry.js +2 -1
- package/Libraries/Types/CodegenTypes.js +3 -0
- package/Libraries/Utilities/{LoadingView.android.js → DevLoadingView.js} +33 -11
- package/Libraries/Utilities/Dimensions.js +1 -0
- package/Libraries/Utilities/HMRClient.js +36 -8
- package/Libraries/Utilities/HMRClientProdShim.js +1 -0
- package/Libraries/Utilities/NativePlatformConstantsWin.js +2 -2
- package/Libraries/Utilities/Platform.android.js +4 -4
- package/Libraries/Utilities/RCTLog.js +1 -0
- package/Libraries/Utilities/ReactNativeTestTools.js +12 -24
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +11 -6
- package/Libraries/__tests__/ViewWindows-test.js +6 -6
- package/Libraries/promiseRejectionTrackingOptions.js +1 -0
- package/Microsoft.ReactNative/Base/FollyIncludes.h +1 -1
- package/Microsoft.ReactNative/ComponentView.idl +0 -17
- package/Microsoft.ReactNative/Composition.Input.idl +3 -3
- package/Microsoft.ReactNative/CompositionSwitcher.idl +0 -1
- package/Microsoft.ReactNative/Fabric/AbiState.cpp +3 -45
- package/Microsoft.ReactNative/Fabric/AbiState.h +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +0 -10
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +27 -16
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +48 -85
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +0 -4
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +24 -24
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +6 -8
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +0 -10
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +29 -45
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +6 -43
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +23 -34
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.h +1 -1
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +17 -48
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +3 -7
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +23 -16
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +5 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +2 -10
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +107 -36
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +18 -12
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -0
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -2
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +7 -4
- package/Microsoft.ReactNative/Modules/NativeUIManager.h +1 -1
- package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.h +3 -3
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +13 -20
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/Timer.idl +1 -3
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -1
- package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +2 -3
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +1 -1
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -2
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +1 -1
- package/Microsoft.ReactNative/packages.lock.json +41 -78
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +5 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +1 -0
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.cpp +14 -6
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.h +2 -2
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +1 -1
- package/Microsoft.ReactNative.Managed/packages.lock.json +3 -3
- package/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props +4 -4
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/README.md +21 -21
- package/ReactCommon/ReactCommon.vcxproj +2 -0
- package/ReactCommon/ReactCommon.vcxproj.filters +3 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +67 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +180 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +351 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +6 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +152 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +13 -15
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +137 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +283 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.cpp +7 -10
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +162 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +33 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.cpp +45 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +67 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +104 -74
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +4 -0
- package/Scripts/rnw-dependencies.ps1 +36 -23
- package/Shared/HermesRuntimeHolder.cpp +19 -1
- package/Shared/HermesRuntimeHolder.h +8 -1
- package/Shared/HermesSamplingProfiler.cpp +1 -2
- package/Shared/Networking/WinRTWebSocketResource.cpp +3 -3
- package/Shared/OInstance.cpp +1 -2
- package/Shared/Shared.vcxitems +21 -15
- package/Shared/Shared.vcxitems.filters +8 -3
- package/Shared/Threading/BatchingQueueThread.cpp +6 -2
- package/Shared/Threading/BatchingQueueThread.h +2 -2
- package/Shared/Utils/CppWinrtLessExceptions.h +2 -2
- package/codegen/NativeAppStateSpec.g.h +8 -8
- package/codegen/NativeBlobModuleSpec.g.h +0 -10
- package/codegen/NativeDOMSpec.g.h +136 -0
- package/codegen/NativeDevSettingsSpec.g.h +11 -5
- package/codegen/NativeIdleCallbacksSpec.g.h +64 -0
- package/codegen/NativeIntersectionObserverSpec.g.h +14 -14
- package/codegen/NativeMicrotasksSpec.g.h +34 -0
- package/codegen/NativePerformanceSpec.g.h +35 -7
- package/codegen/NativePlatformConstantsWindowsSpec.g.h +81 -0
- package/codegen/NativePushNotificationManagerIOSSpec.g.h +15 -19
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +111 -39
- package/codegen/NativeUIManagerSpec.g.h +5 -17
- package/codegen/react/components/rnwcore/Props.cpp +1 -1
- package/codegen/react/components/rnwcore/Props.h +16 -12
- package/codegen/react/components/rnwcore/States.h +0 -26
- package/codegen/rnwcoreJSI-generated.cpp +688 -463
- package/codegen/rnwcoreJSI.h +1374 -2867
- package/fmt/TEMP_UntilFmtUpdate/core.h +2925 -0
- package/fmt/fmt.vcxproj +1 -1
- package/jest/mockComponent.js +7 -0
- package/jest/renderer.js +25 -14
- package/jest/setup.js +19 -13
- package/package.json +29 -27
- package/rn-get-polyfills.js +1 -0
- package/src/private/core/composeStyles.js +27 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +93 -33
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +56 -0
- package/src/private/fusebox/setUpFuseboxReactDevToolsDispatcher.js +108 -0
- package/src/private/specs/modules/NativeBlobModule.js +4 -2
- package/src/private/specs/modules/NativeDevSettings.js +1 -0
- package/src/private/specs/modules/NativePushNotificationManagerIOS.js +0 -4
- package/src/private/specs/modules/NativeUIManager.js +0 -7
- package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +24 -24
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +11 -14
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +2 -3
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +24 -54
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -13
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +468 -0
- package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +413 -0
- package/src/private/webapis/dom/oldstylecollections/DOMRectList.js +4 -4
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +4 -4
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +5 -5
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +34 -0
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +21 -0
- package/src/private/webapis/performance/EventCounts.js +1 -1
- package/src/private/webapis/performance/MemoryInfo.js +9 -9
- package/src/private/webapis/performance/Performance.js +10 -56
- package/src/private/webapis/performance/PerformanceObserver.js +30 -22
- package/src/private/webapis/performance/RawPerformanceEntry.js +2 -7
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +18 -18
- package/src/private/webapis/performance/UserTiming.js +63 -0
- package/src/private/webapis/performance/{NativePerformance.js → specs/NativePerformance.js} +3 -2
- package/src/private/webapis/performance/{NativePerformanceObserver.js → specs/NativePerformanceObserver.js} +2 -2
- package/src/private/webapis/performance/{__mocks__ → specs/__mocks__}/NativePerformance.js +1 -1
- package/src/private/webapis/performance/{__mocks__ → specs/__mocks__}/NativePerformanceObserver.js +3 -4
- package/stubs/glog/logging.h +1 -0
- package/template/cpp-lib/proj/MyLib.vcxproj +1 -1
- package/template/cs-lib/proj/MyLib.csproj +1 -1
- package/template/metro.config.js +13 -2
- package/templates/cpp-app/template.config.js +1 -1
- package/templates/cpp-lib/example/metro.config.js +2 -2
- package/templates/cpp-lib/template.config.js +1 -1
- package/templates/old/generateWrapper.js +4 -1
- package/types/modules/globals.d.ts +4 -0
- package/Libraries/Lists/FlatList.windows.js +0 -717
- package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +0 -13
- package/Libraries/Utilities/LoadingView.ios.js +0 -50
- package/Libraries/Utilities/LoadingView.js +0 -16
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp +0 -178
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.cpp +0 -39
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.h +0 -31
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/YGEnums.h +0 -137
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2377
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -140
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/enums/ExperimentalFeature.h +0 -40
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +0 -48
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +0 -122
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +0 -366
- package/codegen/NativeAnimationsDebugModuleSpec.g.h +0 -40
- package/codegen/NativePlatformConstantsWinSpec.g.h +0 -81
- package/jest/ReactNativeInternalFeatureFlagsMock.js +0 -13
- package/src/private/featureflags/NativeReactNativeFeatureFlags.js +0 -44
- package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js +0 -92
- package/src/private/specs/modules/NativeAnimationsDebugModule.js +0 -20
- package/src/private/webapis/dom/oldstylecollections/__tests__/DOMRectList-test.js +0 -85
- package/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-test.js +0 -80
- package/src/private/webapis/dom/oldstylecollections/__tests__/NodeList-test.js +0 -161
- package/src/private/webapis/performance/__tests__/EventCounts-test.js +0 -116
- package/src/private/webapis/performance/__tests__/NativePerformanceMock-test.js +0 -82
- package/src/private/webapis/performance/__tests__/NativePerformanceObserverMock-test.js +0 -108
- package/src/private/webapis/performance/__tests__/Performance-test.js +0 -117
- package/src/private/webapis/performance/__tests__/PerformanceObserver-test.js +0 -208
- package/template/metro.devMode.config.js +0 -56
- /package/src/private/specs/modules/{NativePlatformConstantsWin.js → NativePlatformConstantsWindows.js} +0 -0
|
@@ -148,33 +148,6 @@ export type PressabilityConfig = $ReadOnly<{|
|
|
|
148
148
|
*/
|
|
149
149
|
blockNativeResponder?: ?boolean,
|
|
150
150
|
|
|
151
|
-
/**
|
|
152
|
-
* Returns whether a long press gesture should cancel the press gesture.
|
|
153
|
-
* Defaults to true.
|
|
154
|
-
*
|
|
155
|
-
* @deprecated
|
|
156
|
-
*/
|
|
157
|
-
onLongPressShouldCancelPress_DEPRECATED?: ?() => boolean,
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* If `cancelable` is set, this will be ignored.
|
|
161
|
-
*
|
|
162
|
-
* Returns whether to yield to a lock termination request (e.g. if a native
|
|
163
|
-
* scroll gesture attempts to steal the responder lock).
|
|
164
|
-
*
|
|
165
|
-
* @deprecated
|
|
166
|
-
*/
|
|
167
|
-
onResponderTerminationRequest_DEPRECATED?: ?() => boolean,
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* If `disabled` is set, this will be ignored.
|
|
171
|
-
*
|
|
172
|
-
* Returns whether to start a press gesture.
|
|
173
|
-
*
|
|
174
|
-
* @deprecated
|
|
175
|
-
*/
|
|
176
|
-
onStartShouldSetResponder_DEPRECATED?: ?() => boolean,
|
|
177
|
-
|
|
178
151
|
// [Windows
|
|
179
152
|
/**
|
|
180
153
|
* Raw handler for onMouseEnter that will be preferred if set over hover
|
|
@@ -508,13 +481,7 @@ export default class Pressability {
|
|
|
508
481
|
const responderEventHandlers = {
|
|
509
482
|
onStartShouldSetResponder: (): boolean => {
|
|
510
483
|
const {disabled} = this._config;
|
|
511
|
-
|
|
512
|
-
const {onStartShouldSetResponder_DEPRECATED} = this._config;
|
|
513
|
-
return onStartShouldSetResponder_DEPRECATED == null
|
|
514
|
-
? true
|
|
515
|
-
: onStartShouldSetResponder_DEPRECATED();
|
|
516
|
-
}
|
|
517
|
-
return !disabled;
|
|
484
|
+
return !disabled ?? true;
|
|
518
485
|
},
|
|
519
486
|
|
|
520
487
|
onResponderGrant: (event: PressEvent): void | boolean => {
|
|
@@ -592,13 +559,7 @@ export default class Pressability {
|
|
|
592
559
|
|
|
593
560
|
onResponderTerminationRequest: (): boolean => {
|
|
594
561
|
const {cancelable} = this._config;
|
|
595
|
-
|
|
596
|
-
const {onResponderTerminationRequest_DEPRECATED} = this._config;
|
|
597
|
-
return onResponderTerminationRequest_DEPRECATED == null
|
|
598
|
-
? true
|
|
599
|
-
: onResponderTerminationRequest_DEPRECATED();
|
|
600
|
-
}
|
|
601
|
-
return cancelable;
|
|
562
|
+
return cancelable ?? true;
|
|
602
563
|
},
|
|
603
564
|
|
|
604
565
|
onClick: (event: PressEvent): void => {
|
|
@@ -892,9 +853,7 @@ export default class Pressability {
|
|
|
892
853
|
this._isDefaultPressButton(getTouchFromPressEvent(event).button)
|
|
893
854
|
) {
|
|
894
855
|
const isPressCanceledByLongPress =
|
|
895
|
-
onLongPress != null &&
|
|
896
|
-
prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' &&
|
|
897
|
-
this._shouldLongPressCancelPress();
|
|
856
|
+
onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN';
|
|
898
857
|
if (!isPressCanceledByLongPress) {
|
|
899
858
|
if (Platform.OS === 'android' && android_disableSound !== true) {
|
|
900
859
|
SoundManager.playTouchSound();
|
|
@@ -1031,13 +990,6 @@ export default class Pressability {
|
|
|
1031
990
|
}
|
|
1032
991
|
}
|
|
1033
992
|
|
|
1034
|
-
_shouldLongPressCancelPress(): boolean {
|
|
1035
|
-
return (
|
|
1036
|
-
this._config.onLongPressShouldCancelPress_DEPRECATED == null ||
|
|
1037
|
-
this._config.onLongPressShouldCancelPress_DEPRECATED()
|
|
1038
|
-
);
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
993
|
_cancelHoverInDelayTimeout(): void {
|
|
1042
994
|
if (this._hoverInDelayTimeout != null) {
|
|
1043
995
|
clearTimeout(this._hoverInDelayTimeout);
|
|
@@ -57,6 +57,10 @@ export namespace AppRegistry {
|
|
|
57
57
|
provider: WrapperComponentProvider,
|
|
58
58
|
): void;
|
|
59
59
|
|
|
60
|
+
export function setRootViewStyleProvider(
|
|
61
|
+
provider: RootViewStyleProvider,
|
|
62
|
+
): void;
|
|
63
|
+
|
|
60
64
|
export function registerConfig(config: AppConfig[]): void;
|
|
61
65
|
|
|
62
66
|
export function setRootViewStyleProvider(
|
|
@@ -204,10 +204,8 @@ const AppRegistry = {
|
|
|
204
204
|
displayMode?: number,
|
|
205
205
|
): void {
|
|
206
206
|
if (appKey !== 'LogBox') {
|
|
207
|
-
const logParams = __DEV__
|
|
208
|
-
|
|
209
|
-
: '';
|
|
210
|
-
const msg = 'Running "' + appKey + logParams;
|
|
207
|
+
const logParams = __DEV__ ? ` with ${JSON.stringify(appParameters)}` : '';
|
|
208
|
+
const msg = `Running "${appKey}"${logParams}`;
|
|
211
209
|
infoLog(msg);
|
|
212
210
|
BugReporting.addSource(
|
|
213
211
|
'AppRegistry.runApplication' + runCount++,
|
|
@@ -160,27 +160,7 @@ const UIManagerJSUnusedInNewArchAPIs = {
|
|
|
160
160
|
* them from React Native.
|
|
161
161
|
*/
|
|
162
162
|
const UIManagerJSDeprecatedPlatformAPIs = Platform.select({
|
|
163
|
-
android: {
|
|
164
|
-
// TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
|
|
165
|
-
showPopupMenu: (
|
|
166
|
-
reactTag: number,
|
|
167
|
-
items: Array<string>,
|
|
168
|
-
error: (error: Object) => void,
|
|
169
|
-
success: (event: string, selected?: number) => void,
|
|
170
|
-
): void => {
|
|
171
|
-
raiseSoftError(
|
|
172
|
-
'showPopupMenu',
|
|
173
|
-
'Please use the <PopupMenuAndroid /> component instead.',
|
|
174
|
-
);
|
|
175
|
-
},
|
|
176
|
-
// TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
|
|
177
|
-
dismissPopupMenu: (): void => {
|
|
178
|
-
raiseSoftError(
|
|
179
|
-
'dismissPopupMenu',
|
|
180
|
-
'Please use the <PopupMenuAndroid /> component instead.',
|
|
181
|
-
);
|
|
182
|
-
},
|
|
183
|
-
},
|
|
163
|
+
android: {},
|
|
184
164
|
});
|
|
185
165
|
|
|
186
166
|
const UIManagerJSPlatformAPIs = Platform.select({
|
|
@@ -70,15 +70,7 @@ export interface Spec {
|
|
|
70
70
|
locationY: number,
|
|
71
71
|
callback: (instanceHandle: ?InternalInstanceHandle) => void,
|
|
72
72
|
) => void;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Support methods for the DOM-compatible APIs.
|
|
76
|
-
*/
|
|
77
|
-
+getParentNode: (node: Node) => ?InternalInstanceHandle;
|
|
78
|
-
+getChildNodes: (node: Node) => $ReadOnlyArray<InternalInstanceHandle>;
|
|
79
|
-
+isConnected: (node: Node) => boolean;
|
|
80
73
|
+compareDocumentPosition: (node: Node, otherNode: Node) => number;
|
|
81
|
-
+getTextContent: (node: Node) => string;
|
|
82
74
|
+getBoundingClientRect: (
|
|
83
75
|
node: Node,
|
|
84
76
|
includeTransform: boolean,
|
|
@@ -88,36 +80,6 @@ export interface Spec {
|
|
|
88
80
|
/* width: */ number,
|
|
89
81
|
/* height: */ number,
|
|
90
82
|
];
|
|
91
|
-
+getOffset: (
|
|
92
|
-
node: Node,
|
|
93
|
-
) => ?[
|
|
94
|
-
/* offsetParent: */ InternalInstanceHandle,
|
|
95
|
-
/* offsetTop: */ number,
|
|
96
|
-
/* offsetLeft: */ number,
|
|
97
|
-
];
|
|
98
|
-
+getScrollPosition: (
|
|
99
|
-
node: Node,
|
|
100
|
-
) => ?[/* scrollLeft: */ number, /* scrollTop: */ number];
|
|
101
|
-
+getScrollSize: (
|
|
102
|
-
node: Node,
|
|
103
|
-
) => ?[/* scrollWidth: */ number, /* scrollHeight: */ number];
|
|
104
|
-
+getInnerSize: (node: Node) => ?[/* width: */ number, /* height: */ number];
|
|
105
|
-
+getBorderSize: (
|
|
106
|
-
node: Node,
|
|
107
|
-
) => ?[
|
|
108
|
-
/* topWidth: */ number,
|
|
109
|
-
/* rightWidth: */ number,
|
|
110
|
-
/* bottomWidth: */ number,
|
|
111
|
-
/* leftWidth: */ number,
|
|
112
|
-
];
|
|
113
|
-
+getTagName: (node: Node) => string;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Support methods for the Pointer Capture APIs.
|
|
117
|
-
*/
|
|
118
|
-
+hasPointerCapture: (node: Node, pointerId: number) => boolean;
|
|
119
|
-
+setPointerCapture: (node: Node, pointerId: number) => void;
|
|
120
|
-
+releasePointerCapture: (node: Node, pointerId: number) => void;
|
|
121
83
|
}
|
|
122
84
|
|
|
123
85
|
let nativeFabricUIManagerProxy: ?Spec;
|
|
@@ -143,21 +105,8 @@ const CACHED_PROPERTIES = [
|
|
|
143
105
|
'findShadowNodeByTag_DEPRECATED',
|
|
144
106
|
'setNativeProps',
|
|
145
107
|
'dispatchCommand',
|
|
146
|
-
'getParentNode',
|
|
147
|
-
'getChildNodes',
|
|
148
|
-
'isConnected',
|
|
149
108
|
'compareDocumentPosition',
|
|
150
|
-
'getTextContent',
|
|
151
109
|
'getBoundingClientRect',
|
|
152
|
-
'getOffset',
|
|
153
|
-
'getScrollPosition',
|
|
154
|
-
'getScrollSize',
|
|
155
|
-
'getInnerSize',
|
|
156
|
-
'getBorderSize',
|
|
157
|
-
'getTagName',
|
|
158
|
-
'hasPointerCapture',
|
|
159
|
-
'setPointerCapture',
|
|
160
|
-
'releasePointerCapture',
|
|
161
110
|
];
|
|
162
111
|
|
|
163
112
|
// This is exposed as a getter because apps using the legacy renderer AND
|
|
@@ -16,6 +16,7 @@ export default function warnForStyleProps(
|
|
|
16
16
|
): void {
|
|
17
17
|
if (__DEV__) {
|
|
18
18
|
for (const key in validAttributes.style) {
|
|
19
|
+
// $FlowFixMe[invalid-computed-prop]
|
|
19
20
|
if (!(validAttributes[key] || props[key] === undefined)) {
|
|
20
21
|
console.error(
|
|
21
22
|
'You are setting the style `{ %s' +
|
|
@@ -12,8 +12,12 @@ import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
|
|
|
12
12
|
import type ReactFabricHostComponent from './ReactFabricPublicInstance/ReactFabricHostComponent';
|
|
13
13
|
import type {Element, ElementRef, ElementType} from 'react';
|
|
14
14
|
|
|
15
|
+
import {
|
|
16
|
+
onCaughtError,
|
|
17
|
+
onRecoverableError,
|
|
18
|
+
onUncaughtError,
|
|
19
|
+
} from '../Core/ErrorHandlers';
|
|
15
20
|
import {type RootTag} from './RootTag';
|
|
16
|
-
|
|
17
21
|
export function renderElement({
|
|
18
22
|
element,
|
|
19
23
|
rootTag,
|
|
@@ -31,9 +35,23 @@ export function renderElement({
|
|
|
31
35
|
rootTag,
|
|
32
36
|
null,
|
|
33
37
|
useConcurrentRoot,
|
|
38
|
+
{
|
|
39
|
+
onCaughtError,
|
|
40
|
+
onUncaughtError,
|
|
41
|
+
onRecoverableError,
|
|
42
|
+
},
|
|
34
43
|
);
|
|
35
44
|
} else {
|
|
36
|
-
require('../Renderer/shims/ReactNative').render(
|
|
45
|
+
require('../Renderer/shims/ReactNative').render(
|
|
46
|
+
element,
|
|
47
|
+
rootTag,
|
|
48
|
+
undefined,
|
|
49
|
+
{
|
|
50
|
+
onCaughtError,
|
|
51
|
+
onUncaughtError,
|
|
52
|
+
onRecoverableError,
|
|
53
|
+
},
|
|
54
|
+
);
|
|
37
55
|
}
|
|
38
56
|
}
|
|
39
57
|
|
|
@@ -89,27 +89,6 @@ export interface UIManagerStatic {
|
|
|
89
89
|
| ((value: boolean) => void)
|
|
90
90
|
| undefined;
|
|
91
91
|
|
|
92
|
-
/**
|
|
93
|
-
* Used to display an Android PopupMenu. If a menu item is pressed, the success callback will
|
|
94
|
-
* be called with the following arguments:
|
|
95
|
-
*
|
|
96
|
-
* - item - the menu item.
|
|
97
|
-
* - index - index of the pressed item in array. Returns `undefined` if cancelled.
|
|
98
|
-
*
|
|
99
|
-
* To obtain a native node handle for a component, you can use
|
|
100
|
-
* `React.findNodeHandle(component)`.
|
|
101
|
-
*
|
|
102
|
-
* Note that this works only on Android
|
|
103
|
-
*/
|
|
104
|
-
showPopupMenu?:
|
|
105
|
-
| ((
|
|
106
|
-
node: number,
|
|
107
|
-
items: string[],
|
|
108
|
-
error: () => void /* currently unused */,
|
|
109
|
-
success: (item: string, index: number | undefined) => void,
|
|
110
|
-
) => void)
|
|
111
|
-
| undefined;
|
|
112
|
-
|
|
113
92
|
getViewManagerConfig: (name: string) => {
|
|
114
93
|
Commands: {[key: string]: number};
|
|
115
94
|
};
|
|
@@ -30,7 +30,6 @@ module.exports = [
|
|
|
30
30
|
'clearJSResponder',
|
|
31
31
|
'configureNextLayoutAnimation',
|
|
32
32
|
'createView',
|
|
33
|
-
'dismissPopupMenu',
|
|
34
33
|
'dispatchViewManagerCommand',
|
|
35
34
|
'findSubviewIn',
|
|
36
35
|
'getConstantsForViewManager',
|
|
@@ -45,10 +44,8 @@ module.exports = [
|
|
|
45
44
|
'setChildren',
|
|
46
45
|
'setJSResponder',
|
|
47
46
|
'setLayoutAnimationEnabledExperimental',
|
|
48
|
-
'showPopupMenu',
|
|
49
47
|
'updateView',
|
|
50
48
|
'viewIsDescendantOf',
|
|
51
|
-
'PopupMenu',
|
|
52
49
|
'LazyViewManagersEnabled',
|
|
53
50
|
'ViewManagerNames',
|
|
54
51
|
'StyleConstants',
|
|
@@ -50,7 +50,7 @@ export function toNode(node: NodeMock): Node {
|
|
|
50
50
|
const roots: Map<RootTag, NodeSet> = new Map();
|
|
51
51
|
const allocatedTags: Set<number> = new Set();
|
|
52
52
|
|
|
53
|
-
function ensureHostNode(node: Node): void {
|
|
53
|
+
export function ensureHostNode(node: Node): void {
|
|
54
54
|
if (node == null || typeof node !== 'object') {
|
|
55
55
|
throw new Error(
|
|
56
56
|
`Expected node to be an object. Got ${
|
|
@@ -94,7 +94,7 @@ function getAncestorsInChildSet(
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function getAncestorsInCurrentTree(
|
|
97
|
+
export function getAncestorsInCurrentTree(
|
|
98
98
|
node: Node,
|
|
99
99
|
): ?$ReadOnlyArray<[Node, number]> {
|
|
100
100
|
const childSet = roots.get(fromNode(node).rootTag);
|
|
@@ -133,7 +133,7 @@ export function getNodeInChildSet(node: Node, childSet: NodeSet): ?Node {
|
|
|
133
133
|
return nodeInCurrentTree;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
function getNodeInCurrentTree(node: Node): ?Node {
|
|
136
|
+
export function getNodeInCurrentTree(node: Node): ?Node {
|
|
137
137
|
const childSet = roots.get(fromNode(node).rootTag);
|
|
138
138
|
if (childSet == null) {
|
|
139
139
|
return null;
|
|
@@ -142,25 +142,6 @@ function getNodeInCurrentTree(node: Node): ?Node {
|
|
|
142
142
|
return getNodeInChildSet(node, childSet);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
function* dfs(node: ?Node): Iterator<Node> {
|
|
146
|
-
if (node == null) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
yield node;
|
|
151
|
-
|
|
152
|
-
for (const child of fromNode(node).children) {
|
|
153
|
-
yield* dfs(child);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function hasDisplayNone(node: Node): boolean {
|
|
158
|
-
const props = fromNode(node).props;
|
|
159
|
-
// Style is flattened when passed to native, so there's no style object.
|
|
160
|
-
// $FlowFixMe[prop-missing]
|
|
161
|
-
return props != null && props.display === 'none';
|
|
162
|
-
}
|
|
163
|
-
|
|
164
145
|
interface IFabricUIManagerMock extends FabricUIManager {
|
|
165
146
|
getRoot(rootTag: RootTag | number): NodeSet;
|
|
166
147
|
__getInstanceHandleFromNode(node: Node): InternalInstanceHandle;
|
|
@@ -313,333 +294,16 @@ const FabricUIManagerMock: IFabricUIManagerMock = {
|
|
|
313
294
|
/* y:*/ number,
|
|
314
295
|
/* width:*/ number,
|
|
315
296
|
/* height:*/ number,
|
|
316
|
-
] => {
|
|
317
|
-
ensureHostNode(node);
|
|
318
|
-
|
|
319
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
320
|
-
const currentProps =
|
|
321
|
-
nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null;
|
|
322
|
-
if (currentProps == null) {
|
|
323
|
-
return null;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
const boundingClientRectForTests: ?{
|
|
327
|
-
x: number,
|
|
328
|
-
y: number,
|
|
329
|
-
width: number,
|
|
330
|
-
height: number,
|
|
331
|
-
} =
|
|
332
|
-
// $FlowExpectedError[prop-missing]
|
|
333
|
-
currentProps.__boundingClientRectForTests;
|
|
334
|
-
|
|
335
|
-
if (boundingClientRectForTests == null) {
|
|
336
|
-
return null;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
const {x, y, width, height} = boundingClientRectForTests;
|
|
340
|
-
return [x, y, width, height];
|
|
341
|
-
},
|
|
297
|
+
] => {},
|
|
342
298
|
),
|
|
343
299
|
|
|
344
|
-
hasPointerCapture: jest.fn((node: Node, pointerId: number): boolean => false),
|
|
345
|
-
|
|
346
|
-
setPointerCapture: jest.fn((node: Node, pointerId: number): void => {}),
|
|
347
|
-
|
|
348
|
-
releasePointerCapture: jest.fn((node: Node, pointerId: number): void => {}),
|
|
349
|
-
|
|
350
300
|
setNativeProps: jest.fn((node: Node, newProps: NodeProps): void => {}),
|
|
351
301
|
|
|
352
302
|
dispatchCommand: jest.fn(
|
|
353
303
|
(node: Node, commandName: string, args: Array<mixed>): void => {},
|
|
354
304
|
),
|
|
355
305
|
|
|
356
|
-
|
|
357
|
-
const ancestors = getAncestorsInCurrentTree(node);
|
|
358
|
-
if (ancestors == null || ancestors.length - 2 < 0) {
|
|
359
|
-
return null;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
const [parentOfParent, position] = ancestors[ancestors.length - 2];
|
|
363
|
-
const parentInCurrentTree = fromNode(parentOfParent).children[position];
|
|
364
|
-
return fromNode(parentInCurrentTree).instanceHandle;
|
|
365
|
-
}),
|
|
366
|
-
|
|
367
|
-
getChildNodes: jest.fn(
|
|
368
|
-
(node: Node): $ReadOnlyArray<InternalInstanceHandle> => {
|
|
369
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
370
|
-
|
|
371
|
-
if (nodeInCurrentTree == null) {
|
|
372
|
-
return [];
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
return fromNode(nodeInCurrentTree).children.map(
|
|
376
|
-
child => fromNode(child).instanceHandle,
|
|
377
|
-
);
|
|
378
|
-
},
|
|
379
|
-
),
|
|
380
|
-
|
|
381
|
-
isConnected: jest.fn((node: Node): boolean => {
|
|
382
|
-
return getNodeInCurrentTree(node) != null;
|
|
383
|
-
}),
|
|
384
|
-
|
|
385
|
-
getTextContent: jest.fn((node: Node): string => {
|
|
386
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
387
|
-
|
|
388
|
-
let result = '';
|
|
389
|
-
|
|
390
|
-
if (nodeInCurrentTree == null) {
|
|
391
|
-
return result;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
for (const childNode of dfs(nodeInCurrentTree)) {
|
|
395
|
-
if (fromNode(childNode).viewName === 'RCTRawText') {
|
|
396
|
-
const props = fromNode(childNode).props;
|
|
397
|
-
// $FlowExpectedError[prop-missing]
|
|
398
|
-
const maybeString: ?string = props.text;
|
|
399
|
-
if (typeof maybeString === 'string') {
|
|
400
|
-
result += maybeString;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
return result;
|
|
405
|
-
}),
|
|
406
|
-
|
|
407
|
-
compareDocumentPosition: jest.fn((node: Node, otherNode: Node): number => {
|
|
408
|
-
/* eslint-disable no-bitwise */
|
|
409
|
-
const ReadOnlyNode =
|
|
410
|
-
require('../../../src/private/webapis/dom/nodes/ReadOnlyNode').default;
|
|
411
|
-
|
|
412
|
-
// Quick check for node vs. itself
|
|
413
|
-
if (fromNode(node).reactTag === fromNode(otherNode).reactTag) {
|
|
414
|
-
return 0;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (fromNode(node).rootTag !== fromNode(otherNode).rootTag) {
|
|
418
|
-
return ReadOnlyNode.DOCUMENT_POSITION_DISCONNECTED;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
const ancestors = getAncestorsInCurrentTree(node);
|
|
422
|
-
if (ancestors == null) {
|
|
423
|
-
return ReadOnlyNode.DOCUMENT_POSITION_DISCONNECTED;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
const otherAncestors = getAncestorsInCurrentTree(otherNode);
|
|
427
|
-
if (otherAncestors == null) {
|
|
428
|
-
return ReadOnlyNode.DOCUMENT_POSITION_DISCONNECTED;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// Consume all common ancestors
|
|
432
|
-
let i = 0;
|
|
433
|
-
while (
|
|
434
|
-
i < ancestors.length &&
|
|
435
|
-
i < otherAncestors.length &&
|
|
436
|
-
ancestors[i][1] === otherAncestors[i][1]
|
|
437
|
-
) {
|
|
438
|
-
i++;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
if (i === ancestors.length) {
|
|
442
|
-
return (
|
|
443
|
-
ReadOnlyNode.DOCUMENT_POSITION_CONTAINED_BY |
|
|
444
|
-
ReadOnlyNode.DOCUMENT_POSITION_FOLLOWING
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
if (i === otherAncestors.length) {
|
|
449
|
-
return (
|
|
450
|
-
ReadOnlyNode.DOCUMENT_POSITION_CONTAINS |
|
|
451
|
-
ReadOnlyNode.DOCUMENT_POSITION_PRECEDING
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
if (ancestors[i][1] > otherAncestors[i][1]) {
|
|
456
|
-
return ReadOnlyNode.DOCUMENT_POSITION_PRECEDING;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
return ReadOnlyNode.DOCUMENT_POSITION_FOLLOWING;
|
|
460
|
-
}),
|
|
461
|
-
|
|
462
|
-
getOffset: jest.fn(
|
|
463
|
-
(
|
|
464
|
-
node: Node,
|
|
465
|
-
): ?[
|
|
466
|
-
/* offsetParent: */ InternalInstanceHandle,
|
|
467
|
-
/* offsetTop: */ number,
|
|
468
|
-
/* offsetLeft: */ number,
|
|
469
|
-
] => {
|
|
470
|
-
const ancestors = getAncestorsInCurrentTree(node);
|
|
471
|
-
if (ancestors == null) {
|
|
472
|
-
return null;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const [parent, position] = ancestors[ancestors.length - 1];
|
|
476
|
-
const nodeInCurrentTree = fromNode(parent).children[position];
|
|
477
|
-
|
|
478
|
-
const currentProps =
|
|
479
|
-
nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null;
|
|
480
|
-
if (currentProps == null || hasDisplayNone(nodeInCurrentTree)) {
|
|
481
|
-
return null;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
const offsetForTests: ?{
|
|
485
|
-
top: number,
|
|
486
|
-
left: number,
|
|
487
|
-
} =
|
|
488
|
-
// $FlowExpectedError[prop-missing]
|
|
489
|
-
currentProps.__offsetForTests;
|
|
490
|
-
|
|
491
|
-
if (offsetForTests == null) {
|
|
492
|
-
return null;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
let currentIndex = ancestors.length - 1;
|
|
496
|
-
while (currentIndex >= 0 && !hasDisplayNone(ancestors[currentIndex][0])) {
|
|
497
|
-
currentIndex--;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (currentIndex >= 0) {
|
|
501
|
-
// The node or one of its ancestors have display: none
|
|
502
|
-
return null;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
return [
|
|
506
|
-
fromNode(parent).instanceHandle,
|
|
507
|
-
offsetForTests.top,
|
|
508
|
-
offsetForTests.left,
|
|
509
|
-
];
|
|
510
|
-
},
|
|
511
|
-
),
|
|
512
|
-
|
|
513
|
-
getScrollPosition: jest.fn(
|
|
514
|
-
(node: Node): ?[/* scrollLeft: */ number, /* scrollTop: */ number] => {
|
|
515
|
-
ensureHostNode(node);
|
|
516
|
-
|
|
517
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
518
|
-
const currentProps =
|
|
519
|
-
nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null;
|
|
520
|
-
if (currentProps == null) {
|
|
521
|
-
return null;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
const scrollForTests: ?{
|
|
525
|
-
scrollLeft: number,
|
|
526
|
-
scrollTop: number,
|
|
527
|
-
...
|
|
528
|
-
} =
|
|
529
|
-
// $FlowExpectedError[prop-missing]
|
|
530
|
-
currentProps.__scrollForTests;
|
|
531
|
-
|
|
532
|
-
if (scrollForTests == null) {
|
|
533
|
-
return null;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
const {scrollLeft, scrollTop} = scrollForTests;
|
|
537
|
-
return [scrollLeft, scrollTop];
|
|
538
|
-
},
|
|
539
|
-
),
|
|
540
|
-
|
|
541
|
-
getScrollSize: jest.fn(
|
|
542
|
-
(node: Node): ?[/* scrollLeft: */ number, /* scrollTop: */ number] => {
|
|
543
|
-
ensureHostNode(node);
|
|
544
|
-
|
|
545
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
546
|
-
const currentProps =
|
|
547
|
-
nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null;
|
|
548
|
-
if (currentProps == null) {
|
|
549
|
-
return null;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
const scrollForTests: ?{
|
|
553
|
-
scrollWidth: number,
|
|
554
|
-
scrollHeight: number,
|
|
555
|
-
...
|
|
556
|
-
} =
|
|
557
|
-
// $FlowExpectedError[prop-missing]
|
|
558
|
-
currentProps.__scrollForTests;
|
|
559
|
-
|
|
560
|
-
if (scrollForTests == null) {
|
|
561
|
-
return null;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
const {scrollWidth, scrollHeight} = scrollForTests;
|
|
565
|
-
return [scrollWidth, scrollHeight];
|
|
566
|
-
},
|
|
567
|
-
),
|
|
568
|
-
|
|
569
|
-
getInnerSize: jest.fn(
|
|
570
|
-
(node: Node): ?[/* width: */ number, /* height: */ number] => {
|
|
571
|
-
ensureHostNode(node);
|
|
572
|
-
|
|
573
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
574
|
-
const currentProps =
|
|
575
|
-
nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null;
|
|
576
|
-
if (currentProps == null) {
|
|
577
|
-
return null;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
const innerSizeForTests: ?{
|
|
581
|
-
width: number,
|
|
582
|
-
height: number,
|
|
583
|
-
...
|
|
584
|
-
} =
|
|
585
|
-
// $FlowExpectedError[prop-missing]
|
|
586
|
-
currentProps.__innerSizeForTests;
|
|
587
|
-
|
|
588
|
-
if (innerSizeForTests == null) {
|
|
589
|
-
return null;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
const {width, height} = innerSizeForTests;
|
|
593
|
-
return [width, height];
|
|
594
|
-
},
|
|
595
|
-
),
|
|
596
|
-
|
|
597
|
-
getBorderSize: jest.fn(
|
|
598
|
-
(
|
|
599
|
-
node: Node,
|
|
600
|
-
): ?[
|
|
601
|
-
/* topWidth: */ number,
|
|
602
|
-
/* rightWidth: */ number,
|
|
603
|
-
/* bottomWidth: */ number,
|
|
604
|
-
/* leftWidth: */ number,
|
|
605
|
-
] => {
|
|
606
|
-
ensureHostNode(node);
|
|
607
|
-
|
|
608
|
-
const nodeInCurrentTree = getNodeInCurrentTree(node);
|
|
609
|
-
const currentProps =
|
|
610
|
-
nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null;
|
|
611
|
-
if (currentProps == null) {
|
|
612
|
-
return null;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
const borderSizeForTests: ?{
|
|
616
|
-
topWidth?: number,
|
|
617
|
-
rightWidth?: number,
|
|
618
|
-
bottomWidth?: number,
|
|
619
|
-
leftWidth?: number,
|
|
620
|
-
...
|
|
621
|
-
} =
|
|
622
|
-
// $FlowExpectedError[prop-missing]
|
|
623
|
-
currentProps.__borderSizeForTests;
|
|
624
|
-
|
|
625
|
-
if (borderSizeForTests == null) {
|
|
626
|
-
return null;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
const {
|
|
630
|
-
topWidth = 0,
|
|
631
|
-
rightWidth = 0,
|
|
632
|
-
bottomWidth = 0,
|
|
633
|
-
leftWidth = 0,
|
|
634
|
-
} = borderSizeForTests;
|
|
635
|
-
return [topWidth, rightWidth, bottomWidth, leftWidth];
|
|
636
|
-
},
|
|
637
|
-
),
|
|
638
|
-
|
|
639
|
-
getTagName: jest.fn((node: Node): string => {
|
|
640
|
-
ensureHostNode(node);
|
|
641
|
-
return 'RN:' + fromNode(node).viewName;
|
|
642
|
-
}),
|
|
306
|
+
compareDocumentPosition: jest.fn((node: Node, otherNode: Node): number => 0),
|
|
643
307
|
|
|
644
308
|
getRoot(containerTag: RootTag | number): NodeSet {
|
|
645
309
|
const tag = createRootTag(containerTag);
|