react-native-windows 0.75.4 → 0.76.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +6 -4
- package/Directory.Build.props +4 -0
- package/Directory.Build.targets +5 -0
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
- package/Libraries/Animated/animations/Animation.js +11 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -1
- package/Libraries/Animated/animations/SpringAnimation.js +1 -1
- package/Libraries/Animated/animations/TimingAnimation.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +10 -9
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
- package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
- package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
- package/Libraries/Animated/useAnimatedProps.js +142 -7
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/Button.windows.js +0 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +131 -169
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +230 -94
- package/Libraries/Components/TextInput/TextInput.windows.js +230 -105
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +32 -30
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +3 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +4 -4
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/AssetSourceResolver.windows.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.windows.js +11 -22
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Inspector/Inspector.js +3 -2
- package/Libraries/Inspector/InspectorPanel.js +16 -10
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +3 -3
- package/Libraries/LogBox/Data/LogBoxData.js +24 -3
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +9 -8
- package/Libraries/Modal/Modal.js +0 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +8 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +7 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +1 -2
- package/Libraries/ReactNative/AppRegistry.d.ts +0 -4
- package/Libraries/ReactNative/AppRegistry.js +1 -7
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +26 -4
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/ReactNative/renderApplication.js +1 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
- package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +231 -42
- package/Libraries/Text/Text.js +394 -196
- package/Libraries/Text/Text.windows.js +476 -300
- package/Libraries/Text/TextNativeComponent.js +2 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/Appearance.js +108 -84
- package/Libraries/Utilities/DevLoadingView.js +2 -4
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +0 -9
- package/Libraries/Utilities/stringifyViewConfig.js +22 -0
- package/Libraries/Utilities/useColorScheme.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +6 -5
- package/Microsoft.ReactNative/ComponentView.idl +11 -0
- package/Microsoft.ReactNative/Composition.Input.idl +1 -0
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +7 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.h +5 -6
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +42 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +81 -63
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +8 -6
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +72 -54
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +14 -4
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +26 -8
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -7
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +6 -6
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +97 -140
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +18 -11
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +5 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +29 -4
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +28 -12
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +33 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +26 -9
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +10 -4
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +5 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.h +1 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +9 -0
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +3 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +3 -3
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +121 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +90 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +5 -1
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +45 -0
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -1
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +25 -16
- package/Microsoft.ReactNative/packages.fabric.lock.json +159 -0
- package/Microsoft.ReactNative/packages.lock.json +11 -12
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -4
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +2 -2
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +62 -4
- package/Microsoft.ReactNative.Cxx/NativeModules.h +131 -14
- package/Microsoft.ReactNative.Managed/packages.lock.json +9 -9
- package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +10 -2
- package/PropertySheets/Autolink.props +1 -1
- package/PropertySheets/Bundle.props +1 -1
- package/PropertySheets/Codegen.props +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/NuGet.LockFile.props +18 -0
- package/README.md +29 -29
- package/ReactCommon/ReactCommon.vcxproj +5 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +11 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -7
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +441 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +266 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +56 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +3 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Convert.h +172 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +4 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +363 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +22 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +118 -51
- package/ReactCommon/packages.lock.json +2 -2
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +8 -1
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -2
- package/Shared/Modules/WebSocketModule.cpp +1 -2
- package/Shared/Networking/WinRTWebSocketResource.cpp +4 -1
- package/Shared/Shared.vcxitems +38 -2
- package/Shared/Shared.vcxitems.filters +6 -1
- package/Shared/TurboModuleManager.cpp +0 -3
- package/codegen/NativeLinkingManagerSpec.g.h +3 -3
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +198 -54
- package/codegen/NativeSampleTurboModuleSpec.g.h +35 -0
- package/codegen/rnwcoreJSI-generated.cpp +245 -101
- package/codegen/rnwcoreJSI.h +847 -548
- package/index.js +3 -1
- package/index.windows.js +3 -1
- package/jest/mockComponent.js +4 -1
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -13
- package/package.json +29 -29
- package/src/private/animated/NativeAnimatedHelper.js +438 -0
- package/src/private/animated/NativeAnimatedValidation.js +64 -0
- package/src/private/components/HScrollViewNativeComponents.js +56 -0
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +27 -0
- package/src/private/components/VScrollViewNativeComponents.js +48 -0
- package/src/private/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
- package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeAppearance.js +3 -3
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWindows.js +7 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.h +1 -1
- package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
- package/template/index.windows.bundle +1 -1
- package/template/metro.config.js +2 -2
- package/template/shared-app/src/AutolinkedNativeModules.g.props +1 -1
- package/template/shared-app/src/AutolinkedNativeModules.g.targets +1 -1
- package/templates/cpp-app/metro.config.js +2 -2
- package/templates/cpp-app/template.config.js +5 -5
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +1 -1
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -0
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
- package/templates/cpp-lib/example/metro.config.js +2 -2
- package/templates/cpp-lib/template.config.js +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.h +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
- package/types/experimental.d.ts +20 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2396
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -136
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
- 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 -388
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
|
@@ -16,8 +16,9 @@ import type {TextProps} from './TextProps';
|
|
|
16
16
|
import {createViewConfig} from '../NativeComponent/ViewConfig';
|
|
17
17
|
import UIManager from '../ReactNative/UIManager';
|
|
18
18
|
import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
|
|
19
|
+
import Platform from '../Utilities/Platform';
|
|
19
20
|
|
|
20
|
-
type NativeTextProps = $ReadOnly<{
|
|
21
|
+
export type NativeTextProps = $ReadOnly<{
|
|
21
22
|
...TextProps,
|
|
22
23
|
isHighlighted?: ?boolean,
|
|
23
24
|
selectionColor?: ?ProcessedColorValue,
|
|
@@ -16,52 +16,25 @@ const NativeModules = require('../BatchedBridge/NativeModules');
|
|
|
16
16
|
|
|
17
17
|
const turboModuleProxy = global.__turboModuleProxy;
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
TurboModules: ([]: Array<string>),
|
|
22
|
-
NotFound: ([]: Array<string>),
|
|
23
|
-
};
|
|
19
|
+
const useLegacyNativeModuleInterop =
|
|
20
|
+
global.RN$Bridgeless !== true || global.RN$TurboInterop === true;
|
|
24
21
|
|
|
25
|
-
function isBridgeless() {
|
|
26
|
-
return global.RN$Bridgeless === true;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function isTurboModuleInteropEnabled() {
|
|
30
|
-
return global.RN$TurboInterop === true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// TODO(154308585): Remove "module not found" debug info logging
|
|
34
|
-
function shouldReportDebugInfo() {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// TODO(148943970): Consider reversing the lookup here:
|
|
39
|
-
// Lookup on __turboModuleProxy, then lookup on nativeModuleProxy
|
|
40
22
|
function requireModule<T: TurboModule>(name: string): ?T {
|
|
41
|
-
if (!isBridgeless() || isTurboModuleInteropEnabled()) {
|
|
42
|
-
// Backward compatibility layer during migration.
|
|
43
|
-
const legacyModule = NativeModules[name];
|
|
44
|
-
if (legacyModule != null) {
|
|
45
|
-
if (shouldReportDebugInfo()) {
|
|
46
|
-
moduleLoadHistory.NativeModules.push(name);
|
|
47
|
-
}
|
|
48
|
-
return ((legacyModule: $FlowFixMe): T);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
23
|
if (turboModuleProxy != null) {
|
|
53
24
|
const module: ?T = turboModuleProxy(name);
|
|
54
25
|
if (module != null) {
|
|
55
|
-
if (shouldReportDebugInfo()) {
|
|
56
|
-
moduleLoadHistory.TurboModules.push(name);
|
|
57
|
-
}
|
|
58
26
|
return module;
|
|
59
27
|
}
|
|
60
28
|
}
|
|
61
29
|
|
|
62
|
-
if (
|
|
63
|
-
|
|
30
|
+
if (useLegacyNativeModuleInterop) {
|
|
31
|
+
// Backward compatibility layer during migration.
|
|
32
|
+
const legacyModule: ?T = NativeModules[name];
|
|
33
|
+
if (legacyModule != null) {
|
|
34
|
+
return legacyModule;
|
|
35
|
+
}
|
|
64
36
|
}
|
|
37
|
+
|
|
65
38
|
return null;
|
|
66
39
|
}
|
|
67
40
|
|
|
@@ -71,20 +44,10 @@ export function get<T: TurboModule>(name: string): ?T {
|
|
|
71
44
|
|
|
72
45
|
export function getEnforcing<T: TurboModule>(name: string): T {
|
|
73
46
|
const module = requireModule<T>(name);
|
|
74
|
-
|
|
47
|
+
invariant(
|
|
48
|
+
module != null,
|
|
75
49
|
`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (shouldReportDebugInfo()) {
|
|
79
|
-
message +=
|
|
80
|
-
' Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
|
|
81
|
-
message +=
|
|
82
|
-
'TurboModule interop: ' +
|
|
83
|
-
(isTurboModuleInteropEnabled() ? 'true' : 'false') +
|
|
84
|
-
'. ';
|
|
85
|
-
message += 'Modules loaded: ' + JSON.stringify(moduleLoadHistory);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
invariant(module != null, message);
|
|
50
|
+
'Verify that a module by this name is registered in the native binary.',
|
|
51
|
+
);
|
|
89
52
|
return module;
|
|
90
53
|
}
|
|
@@ -42,4 +42,6 @@ type DefaultTypes = number | boolean | string | $ReadOnlyArray<string>;
|
|
|
42
42
|
// eslint-disable-next-line no-unused-vars
|
|
43
43
|
export type WithDefault<Type: DefaultTypes, Value: ?Type | string> = ?Type;
|
|
44
44
|
|
|
45
|
-
export type EventEmitter<T> = (
|
|
45
|
+
export type EventEmitter<T> = (
|
|
46
|
+
handler: (T) => void | Promise<void>,
|
|
47
|
+
) => EventSubscription;
|
|
@@ -8,100 +8,124 @@
|
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
12
|
+
import type {AppearancePreferences, ColorSchemeName} from './NativeAppearance';
|
|
13
|
+
import typeof INativeAppearance from './NativeAppearance';
|
|
14
|
+
|
|
11
15
|
import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
|
|
12
|
-
import
|
|
13
|
-
import EventEmitter, {
|
|
14
|
-
type EventSubscription,
|
|
15
|
-
} from '../vendor/emitter/EventEmitter';
|
|
16
|
+
import EventEmitter from '../vendor/emitter/EventEmitter';
|
|
16
17
|
import {isAsyncDebugging} from './DebugEnvironment';
|
|
17
|
-
import NativeAppearance, {
|
|
18
|
-
type AppearancePreferences,
|
|
19
|
-
type ColorSchemeName,
|
|
20
|
-
} from './NativeAppearance';
|
|
21
18
|
import invariant from 'invariant';
|
|
22
19
|
|
|
23
|
-
type
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}>();
|
|
20
|
+
type Appearance = {
|
|
21
|
+
colorScheme: ?ColorSchemeName,
|
|
22
|
+
};
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
let lazyState: ?{
|
|
25
|
+
+NativeAppearance: INativeAppearance,
|
|
26
|
+
// Cache the color scheme to reduce the cost of reading it between changes.
|
|
27
|
+
// NOTE: If `NativeAppearance` is null, this will always be null.
|
|
28
|
+
appearance: ?Appearance,
|
|
29
|
+
// NOTE: This is non-nullable to make it easier for `onChangedListener` to
|
|
30
|
+
// return a non-nullable `EventSubscription` value. This is not the common
|
|
31
|
+
// path, so we do not have to over-optimize it.
|
|
32
|
+
+eventEmitter: EventEmitter<{change: [Appearance]}>,
|
|
30
33
|
};
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Ensures that all state and listeners are lazily initialized correctly.
|
|
37
|
+
*/
|
|
38
|
+
function getState(): $NonMaybeType<typeof lazyState> {
|
|
39
|
+
if (lazyState != null) {
|
|
40
|
+
return lazyState;
|
|
41
|
+
}
|
|
42
|
+
const eventEmitter = new EventEmitter<{change: [Appearance]}>();
|
|
43
|
+
// NOTE: Avoid initializing `NativeAppearance` until it is actually used.
|
|
44
|
+
const NativeAppearance = require('./NativeAppearance').default;
|
|
45
|
+
if (NativeAppearance == null) {
|
|
46
|
+
// Assign `null` to avoid re-initializing on subsequent invocations.
|
|
47
|
+
lazyState = {
|
|
48
|
+
NativeAppearance: null,
|
|
49
|
+
appearance: null,
|
|
50
|
+
eventEmitter,
|
|
51
|
+
};
|
|
52
|
+
} else {
|
|
53
|
+
const state: $NonMaybeType<typeof lazyState> = {
|
|
54
|
+
NativeAppearance,
|
|
55
|
+
appearance: null,
|
|
56
|
+
eventEmitter,
|
|
57
|
+
};
|
|
58
|
+
new NativeEventEmitter<{
|
|
59
|
+
appearanceChanged: [AppearancePreferences],
|
|
60
|
+
}>(NativeAppearance).addListener('appearanceChanged', newAppearance => {
|
|
61
|
+
state.appearance = {
|
|
62
|
+
colorScheme: toColorScheme(newAppearance.colorScheme),
|
|
63
|
+
};
|
|
64
|
+
eventEmitter.emit('change', state.appearance);
|
|
65
|
+
});
|
|
66
|
+
lazyState = state;
|
|
67
|
+
}
|
|
68
|
+
return lazyState;
|
|
52
69
|
}
|
|
53
70
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
getColorScheme(): ?ColorSchemeName {
|
|
66
|
-
if (__DEV__) {
|
|
67
|
-
if (isAsyncDebugging) {
|
|
68
|
-
// Hard code light theme when using the async debugger as
|
|
69
|
-
// sync calls aren't supported
|
|
70
|
-
return 'light';
|
|
71
|
-
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns the current color scheme preference. This value may change, so the
|
|
73
|
+
* value should not be cached without either listening to changes or using
|
|
74
|
+
* the `useColorScheme` hook.
|
|
75
|
+
*/
|
|
76
|
+
export function getColorScheme(): ?ColorSchemeName {
|
|
77
|
+
if (__DEV__) {
|
|
78
|
+
if (isAsyncDebugging) {
|
|
79
|
+
// Hard code light theme when using the async debugger as
|
|
80
|
+
// sync calls aren't supported
|
|
81
|
+
return 'light';
|
|
72
82
|
}
|
|
83
|
+
}
|
|
84
|
+
let colorScheme = null;
|
|
85
|
+
const state = getState();
|
|
86
|
+
const {NativeAppearance} = state;
|
|
87
|
+
if (NativeAppearance != null) {
|
|
88
|
+
if (state.appearance == null) {
|
|
89
|
+
// Lazily initialize `state.appearance`. This should only
|
|
90
|
+
// happen once because we never reassign a null value to it.
|
|
91
|
+
state.appearance = {
|
|
92
|
+
colorScheme: toColorScheme(NativeAppearance.getColorScheme()),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
colorScheme = state.appearance.colorScheme;
|
|
96
|
+
}
|
|
97
|
+
return colorScheme;
|
|
98
|
+
}
|
|
73
99
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return nativeColorScheme;
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
setColorScheme(colorScheme: ?ColorSchemeName): void {
|
|
89
|
-
const nativeColorScheme = colorScheme == null ? 'unspecified' : colorScheme;
|
|
90
|
-
|
|
91
|
-
invariant(
|
|
92
|
-
colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null,
|
|
93
|
-
"Unrecognized color scheme. Did you mean 'dark', 'light' or null?",
|
|
94
|
-
);
|
|
100
|
+
/**
|
|
101
|
+
* Updates the current color scheme to the supplied value.
|
|
102
|
+
*/
|
|
103
|
+
export function setColorScheme(colorScheme: ?ColorSchemeName): void {
|
|
104
|
+
const state = getState();
|
|
105
|
+
const {NativeAppearance} = state;
|
|
106
|
+
if (NativeAppearance != null) {
|
|
107
|
+
NativeAppearance.setColorScheme(colorScheme ?? 'unspecified');
|
|
108
|
+
state.appearance = {colorScheme};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
95
111
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Add an event handler that is fired when appearance preferences change.
|
|
114
|
+
*/
|
|
115
|
+
export function addChangeListener(
|
|
116
|
+
listener: ({colorScheme: ?ColorSchemeName}) => void,
|
|
117
|
+
): EventSubscription {
|
|
118
|
+
const {eventEmitter} = getState();
|
|
119
|
+
return eventEmitter.addListener('change', listener);
|
|
120
|
+
}
|
|
100
121
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
/**
|
|
123
|
+
* TODO: (hramos) T52919652 Use ?ColorSchemeName once codegen supports union
|
|
124
|
+
*/
|
|
125
|
+
function toColorScheme(colorScheme: ?string): ?ColorSchemeName {
|
|
126
|
+
invariant(
|
|
127
|
+
colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null,
|
|
128
|
+
"Unrecognized color scheme. Did you mean 'dark', 'light' or null?",
|
|
129
|
+
);
|
|
130
|
+
return colorScheme;
|
|
131
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import processColor from '../StyleSheet/processColor';
|
|
12
|
-
import
|
|
12
|
+
import {getColorScheme} from './Appearance';
|
|
13
13
|
import NativeDevLoadingView from './NativeDevLoadingView';
|
|
14
14
|
|
|
15
15
|
const COLOR_SCHEME = {
|
|
@@ -39,9 +39,7 @@ module.exports = {
|
|
|
39
39
|
showMessage(message: string, type: 'load' | 'refresh') {
|
|
40
40
|
if (NativeDevLoadingView) {
|
|
41
41
|
const colorScheme =
|
|
42
|
-
|
|
43
|
-
? COLOR_SCHEME.dark
|
|
44
|
-
: COLOR_SCHEME.default;
|
|
42
|
+
getColorScheme() === 'dark' ? COLOR_SCHEME.dark : COLOR_SCHEME.default;
|
|
45
43
|
|
|
46
44
|
const colorSet = colorScheme[type];
|
|
47
45
|
|
|
@@ -126,7 +126,7 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
126
126
|
data: data.map(item =>
|
|
127
127
|
typeof item === 'string'
|
|
128
128
|
? item
|
|
129
|
-
: prettyFormat(item, {
|
|
129
|
+
: prettyFormat.format(item, {
|
|
130
130
|
escapeString: true,
|
|
131
131
|
highlight: true,
|
|
132
132
|
maxDepth: 3,
|
|
@@ -379,6 +379,7 @@ function showCompileError() {
|
|
|
379
379
|
|
|
380
380
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
381
381
|
* parameters */
|
|
382
|
+
// $FlowFixMe[incompatible-type]
|
|
382
383
|
const error: ExtendedError = new Error(message);
|
|
383
384
|
// Symbolicating compile errors is wasted effort
|
|
384
385
|
// because the stack trace is meaningless:
|
|
@@ -115,7 +115,7 @@ function expectNoConsoleError() {
|
|
|
115
115
|
|
|
116
116
|
async function expectRendersMatchingSnapshot(
|
|
117
117
|
name: string,
|
|
118
|
-
ComponentProvider: () => React.
|
|
118
|
+
ComponentProvider: () => React.MixedElement,
|
|
119
119
|
unmockComponent: () => mixed,
|
|
120
120
|
) {
|
|
121
121
|
let instance;
|
|
@@ -15,11 +15,8 @@ import type {
|
|
|
15
15
|
Timespan,
|
|
16
16
|
} from './IPerformanceLogger';
|
|
17
17
|
|
|
18
|
-
import * as Systrace from '../Performance/Systrace';
|
|
19
18
|
import infoLog from './infoLog';
|
|
20
19
|
|
|
21
|
-
const _cookies: {[key: string]: number, ...} = {};
|
|
22
|
-
|
|
23
20
|
const PRINT_TO_CONSOLE: false = false; // Type as false to prevent accidentally committing `true`;
|
|
24
21
|
|
|
25
22
|
export const getCurrentTimestamp: () => number =
|
|
@@ -233,7 +230,6 @@ class PerformanceLogger implements IPerformanceLogger {
|
|
|
233
230
|
startTime: timestamp,
|
|
234
231
|
startExtras: extras,
|
|
235
232
|
};
|
|
236
|
-
_cookies[key] = Systrace.beginAsyncEvent(key);
|
|
237
233
|
if (PRINT_TO_CONSOLE) {
|
|
238
234
|
infoLog('PerformanceLogger.js', 'start: ' + key);
|
|
239
235
|
}
|
|
@@ -277,11 +273,6 @@ class PerformanceLogger implements IPerformanceLogger {
|
|
|
277
273
|
if (PRINT_TO_CONSOLE) {
|
|
278
274
|
infoLog('PerformanceLogger.js', 'end: ' + key);
|
|
279
275
|
}
|
|
280
|
-
|
|
281
|
-
if (_cookies[key] != null) {
|
|
282
|
-
Systrace.endAsyncEvent(key, _cookies[key]);
|
|
283
|
-
delete _cookies[key];
|
|
284
|
-
}
|
|
285
276
|
}
|
|
286
277
|
}
|
|
287
278
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @flow
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export default function stringifyViewConfig(viewConfig: any): string {
|
|
12
|
+
return JSON.stringify(
|
|
13
|
+
viewConfig,
|
|
14
|
+
(key, val) => {
|
|
15
|
+
if (typeof val === 'function') {
|
|
16
|
+
return `ƒ ${val.name}`;
|
|
17
|
+
}
|
|
18
|
+
return val;
|
|
19
|
+
},
|
|
20
|
+
2,
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
import type {ColorSchemeName} from './NativeAppearance';
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import {addChangeListener, getColorScheme} from './Appearance';
|
|
16
16
|
import {useSyncExternalStore} from 'react';
|
|
17
17
|
|
|
18
18
|
const subscribe = (onStoreChange: () => void) => {
|
|
19
|
-
const appearanceSubscription =
|
|
19
|
+
const appearanceSubscription = addChangeListener(onStoreChange);
|
|
20
20
|
return () => appearanceSubscription.remove();
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export default function useColorScheme(): ?ColorSchemeName {
|
|
24
|
-
return useSyncExternalStore(subscribe,
|
|
24
|
+
return useSyncExternalStore(subscribe, getColorScheme);
|
|
25
25
|
}
|
|
@@ -68,7 +68,7 @@ type WebSocketEventDefinitions = {
|
|
|
68
68
|
* See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
|
|
69
69
|
* See https://github.com/websockets/ws
|
|
70
70
|
*/
|
|
71
|
-
class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS):
|
|
71
|
+
class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): typeof EventTarget) {
|
|
72
72
|
static CONNECTING: number = CONNECTING;
|
|
73
73
|
static OPEN: number = OPEN;
|
|
74
74
|
static CLOSING: number = CLOSING;
|
|
@@ -27,7 +27,7 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
|
|
|
27
27
|
stack = error.stack;
|
|
28
28
|
} else {
|
|
29
29
|
try {
|
|
30
|
-
message = require('pretty-format')(rejection);
|
|
30
|
+
message = require('pretty-format').format(rejection);
|
|
31
31
|
} catch {
|
|
32
32
|
message =
|
|
33
33
|
typeof rejection === 'string'
|
|
@@ -35,11 +35,9 @@ interface Registration<TArgs> {
|
|
|
35
35
|
+remove: () => void;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<TArgs>(TArgs) => Set<Registration<TArgs>>,
|
|
42
|
-
>;
|
|
38
|
+
type Registry<TEventToArgsMap: {...}> = {
|
|
39
|
+
[K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
|
|
40
|
+
};
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* EventEmitter manages listeners and publishes events to them.
|
|
@@ -64,6 +62,7 @@ type Registry<TEventToArgsMap: {...}> = $ObjMap<
|
|
|
64
62
|
export default class EventEmitter<TEventToArgsMap: {...}>
|
|
65
63
|
implements IEventEmitter<TEventToArgsMap>
|
|
66
64
|
{
|
|
65
|
+
// $FlowFixMe[incompatible-type]
|
|
67
66
|
#registry: Registry<TEventToArgsMap> = {};
|
|
68
67
|
|
|
69
68
|
/**
|
|
@@ -113,6 +112,7 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
113
112
|
// Copy `registrations` to take a snapshot when we invoke `emit`, in case
|
|
114
113
|
// registrations are added or removed when listeners are invoked.
|
|
115
114
|
for (const registration of Array.from(registrations)) {
|
|
115
|
+
// $FlowFixMe[incompatible-call]
|
|
116
116
|
registration.listener.apply(registration.context, args);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -125,6 +125,7 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
125
125
|
eventType?: ?TEvent,
|
|
126
126
|
): void {
|
|
127
127
|
if (eventType == null) {
|
|
128
|
+
// $FlowFixMe[incompatible-type]
|
|
128
129
|
this.#registry = {};
|
|
129
130
|
} else {
|
|
130
131
|
delete this.#registry[eventType];
|
|
@@ -34,6 +34,15 @@ namespace Microsoft.ReactNative
|
|
|
34
34
|
All = 0x0000000F,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
enum FocusNavigationDirection
|
|
38
|
+
{
|
|
39
|
+
None,
|
|
40
|
+
Next,
|
|
41
|
+
Previous,
|
|
42
|
+
First,
|
|
43
|
+
Last,
|
|
44
|
+
};
|
|
45
|
+
|
|
37
46
|
[webhosthidden]
|
|
38
47
|
[experimental]
|
|
39
48
|
interface IComponentState
|
|
@@ -46,6 +55,7 @@ namespace Microsoft.ReactNative
|
|
|
46
55
|
[experimental]
|
|
47
56
|
[webhosthidden]
|
|
48
57
|
runtimeclass LosingFocusEventArgs : Microsoft.ReactNative.Composition.Input.RoutedEventArgs {
|
|
58
|
+
FocusNavigationDirection Direction { get; };
|
|
49
59
|
Microsoft.ReactNative.ComponentView NewFocusedComponent { get; };
|
|
50
60
|
Microsoft.ReactNative.ComponentView OldFocusedComponent { get; };
|
|
51
61
|
|
|
@@ -56,6 +66,7 @@ namespace Microsoft.ReactNative
|
|
|
56
66
|
[experimental]
|
|
57
67
|
[webhosthidden]
|
|
58
68
|
runtimeclass GettingFocusEventArgs : Microsoft.ReactNative.Composition.Input.RoutedEventArgs {
|
|
69
|
+
FocusNavigationDirection Direction { get; };
|
|
59
70
|
Microsoft.ReactNative.ComponentView NewFocusedComponent { get; };
|
|
60
71
|
Microsoft.ReactNative.ComponentView OldFocusedComponent { get; };
|
|
61
72
|
|
|
@@ -106,6 +106,7 @@ namespace Microsoft.ReactNative.Composition.Input
|
|
|
106
106
|
UInt64 Timestamp { get; };
|
|
107
107
|
PointerPoint GetOffsetPoint(
|
|
108
108
|
Windows.Foundation.Point offset);
|
|
109
|
+
Microsoft.UI.Input.PointerPoint Inner { get; };
|
|
109
110
|
};
|
|
110
111
|
|
|
111
112
|
runtimeclass PointerRoutedEventArgs : RoutedEventArgs
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#include "NamespaceRedirect.h"
|
|
5
5
|
#include "DocString.h"
|
|
6
|
+
import "Composition.Input.idl";
|
|
6
7
|
|
|
7
8
|
namespace Microsoft.ReactNative.Composition.Experimental
|
|
8
9
|
{
|
|
@@ -112,6 +113,8 @@ namespace Microsoft.ReactNative.Composition.Experimental
|
|
|
112
113
|
Windows.Foundation.Numerics.Vector3 ScrollPosition { get; };
|
|
113
114
|
void ScrollBy(Windows.Foundation.Numerics.Vector3 offset, Boolean animate);
|
|
114
115
|
void TryUpdatePosition(Windows.Foundation.Numerics.Vector3 position, Boolean animate);
|
|
116
|
+
void OnPointerPressed(Microsoft.ReactNative.Composition.Input.PointerRoutedEventArgs args);
|
|
117
|
+
Boolean Horizontal;
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
[webhosthidden]
|
|
@@ -109,14 +109,14 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps(
|
|
|
109
109
|
->CreateProps(nullptr);
|
|
110
110
|
shadowNodeProps->SetUserProps(userProps);
|
|
111
111
|
|
|
112
|
-
rawProps
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
const auto &dynamic = static_cast<folly::dynamic>(rawProps);
|
|
113
|
+
for (const auto &pair : dynamic.items()) {
|
|
114
|
+
const auto &propName = pair.first.getString();
|
|
115
|
+
auto hash = RAW_PROPS_KEY_HASH(propName);
|
|
116
|
+
shadowNodeProps.get()->setProp(context, hash, propName.c_str(), facebook::react::RawValue(pair.second));
|
|
117
|
+
userProps.SetProp(
|
|
118
|
+
hash, winrt::to_hstring(propName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(pair.second));
|
|
119
|
+
}
|
|
120
120
|
|
|
121
121
|
return shadowNodeProps;
|
|
122
122
|
};
|
|
@@ -162,7 +162,7 @@ facebook::react::State::Shared AbiComponentDescriptor::createState(
|
|
|
162
162
|
facebook::react::ShadowNodeFamily::Shared AbiComponentDescriptor::createFamily(
|
|
163
163
|
facebook::react::ShadowNodeFamilyFragment const &fragment) const {
|
|
164
164
|
auto eventEmitter = std::make_shared<const ConcreteEventEmitter>(
|
|
165
|
-
std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle), eventDispatcher_);
|
|
165
|
+
std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle, fragment.surfaceId), eventDispatcher_);
|
|
166
166
|
return std::make_shared<facebook::react::ShadowNodeFamily>(
|
|
167
167
|
fragment, std::move(eventEmitter), eventDispatcher_, *this);
|
|
168
168
|
}
|
|
@@ -106,14 +106,14 @@ facebook::react::Props::Shared AbiViewComponentDescriptor::cloneProps(
|
|
|
106
106
|
->CreateProps(viewProps);
|
|
107
107
|
shadowNodeProps->SetUserProps(userProps, viewProps);
|
|
108
108
|
|
|
109
|
-
rawProps
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
const auto &dynamic = static_cast<folly::dynamic>(rawProps);
|
|
110
|
+
for (const auto &pair : dynamic.items()) {
|
|
111
|
+
const auto &propName = pair.first.getString();
|
|
112
|
+
auto hash = RAW_PROPS_KEY_HASH(propName);
|
|
113
|
+
shadowNodeProps.get()->setProp(context, hash, propName.c_str(), facebook::react::RawValue(pair.second));
|
|
114
|
+
userProps.SetProp(
|
|
115
|
+
hash, winrt::to_hstring(propName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(pair.second));
|
|
116
|
+
}
|
|
117
117
|
|
|
118
118
|
return shadowNodeProps;
|
|
119
119
|
};
|
|
@@ -157,7 +157,7 @@ facebook::react::State::Shared AbiViewComponentDescriptor::createState(
|
|
|
157
157
|
facebook::react::ShadowNodeFamily::Shared AbiViewComponentDescriptor::createFamily(
|
|
158
158
|
facebook::react::ShadowNodeFamilyFragment const &fragment) const {
|
|
159
159
|
auto eventEmitter = std::make_shared<const ConcreteEventEmitter>(
|
|
160
|
-
std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle), eventDispatcher_);
|
|
160
|
+
std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle, fragment.surfaceId), eventDispatcher_);
|
|
161
161
|
return std::make_shared<facebook::react::ShadowNodeFamily>(
|
|
162
162
|
fragment, std::move(eventEmitter), eventDispatcher_, *this);
|
|
163
163
|
}
|