react-native-windows 0.75.4 → 0.76.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 +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/KeyboardAvoidingView.js +17 -0
- 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/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
- 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 +23 -1
- 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/setUpDeveloperTools.js +5 -1
- 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 +9 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +17 -1
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +17 -1
- 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 +12 -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 +152 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
- package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
- package/Libraries/StyleSheet/processBoxShadow.js +209 -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 +8 -6
- 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.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.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/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 +34 -30
- 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 +29 -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 +12 -98
- package/Common/packages.lock.json +0 -26
- package/Folly/packages.lock.json +0 -23
- 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/Microsoft.ReactNative/packages.lock.json +0 -132
- package/Microsoft.ReactNative.Managed/packages.lock.json +0 -373
- package/Microsoft.ReactNative.Managed.CodeGen/packages.lock.json +0 -3197
- 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/ReactCommon/packages.lock.json +0 -30
- package/fmt/packages.lock.json +0 -13
- 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
|
@@ -72,9 +72,10 @@ HRESULT UiaNavigateHelper(
|
|
|
72
72
|
auto parentCV = view.Parent().as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>();
|
|
73
73
|
if (parentCV != nullptr) {
|
|
74
74
|
auto children = parentCV->Children();
|
|
75
|
-
for (auto
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
for (auto i = children.Size() - 1; i > 0; i--) {
|
|
76
|
+
auto child = children.GetAt(i);
|
|
77
|
+
if (child == view) {
|
|
78
|
+
uiaProvider = children.GetAt(i - 1)
|
|
78
79
|
.as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>()
|
|
79
80
|
->EnsureUiaProvider();
|
|
80
81
|
break;
|
|
@@ -121,7 +122,9 @@ HRESULT UiaSetFocusHelper(::Microsoft::ReactNative::ReactTaggedView &view) noexc
|
|
|
121
122
|
if (rootCV == nullptr)
|
|
122
123
|
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
123
124
|
|
|
124
|
-
return rootCV->TrySetFocusedComponent(strongView)
|
|
125
|
+
return rootCV->TrySetFocusedComponent(strongView, winrt::Microsoft::ReactNative::FocusNavigationDirection::None)
|
|
126
|
+
? S_OK
|
|
127
|
+
: E_FAIL;
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
bool WasUiaPropertyAdvised(winrt::com_ptr<IRawElementProviderSimple> &providerSimple, PROPERTYID propId) noexcept {
|
|
@@ -181,4 +184,26 @@ std::string extractAccessibilityValue(const facebook::react::AccessibilityValue
|
|
|
181
184
|
}
|
|
182
185
|
}
|
|
183
186
|
|
|
187
|
+
void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept {
|
|
188
|
+
auto strongView = view.view();
|
|
189
|
+
|
|
190
|
+
if (!strongView)
|
|
191
|
+
return;
|
|
192
|
+
|
|
193
|
+
auto baseView = strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>();
|
|
194
|
+
if (baseView == nullptr)
|
|
195
|
+
return;
|
|
196
|
+
|
|
197
|
+
auto props = std::static_pointer_cast<const facebook::react::ViewProps>(baseView->props());
|
|
198
|
+
if (props == nullptr)
|
|
199
|
+
return;
|
|
200
|
+
|
|
201
|
+
auto accessibilityActions = props->accessibilityActions;
|
|
202
|
+
for (size_t i = 0; i < accessibilityActions.size(); i++) {
|
|
203
|
+
if (accessibilityActions[i].name == action) {
|
|
204
|
+
baseView->GetEventEmitter()->onAccessibilityAction(action);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
184
209
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -33,4 +33,6 @@ long GetLiveSetting(const std::string &liveRegion) noexcept;
|
|
|
33
33
|
|
|
34
34
|
std::string extractAccessibilityValue(const facebook::react::AccessibilityValue &value) noexcept;
|
|
35
35
|
|
|
36
|
+
void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept;
|
|
37
|
+
|
|
36
38
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -37,8 +37,7 @@ winrt::Microsoft::ReactNative::ComponentView UnimplementedNativeViewComponentVie
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
void UnimplementedNativeViewComponentView::HandleCommand(
|
|
40
|
-
winrt::
|
|
41
|
-
const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept {
|
|
40
|
+
const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
|
|
42
41
|
// Do not call base to avoid unknown command asserts
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -25,8 +25,7 @@ struct UnimplementedNativeViewComponentView
|
|
|
25
25
|
facebook::react::LayoutMetrics const &layoutMetrics,
|
|
26
26
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
27
27
|
|
|
28
|
-
void HandleCommand(
|
|
29
|
-
override;
|
|
28
|
+
void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
|
|
30
29
|
|
|
31
30
|
UnimplementedNativeViewComponentView(
|
|
32
31
|
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
#include "pch.h"
|
|
5
|
+
#include "HandleCommandArgs.g.cpp"
|
|
6
|
+
#include "HandleCommandArgs.g.h"
|
|
5
7
|
#include <AsynchronousEventBeat.h>
|
|
6
8
|
#include <DynamicReader.h>
|
|
7
9
|
#include <DynamicWriter.h>
|
|
8
10
|
#include <Fabric/ComponentView.h>
|
|
9
11
|
#include <Fabric/Composition/CompositionUIService.h>
|
|
10
12
|
#include <Fabric/Composition/CompositionViewComponentView.h>
|
|
13
|
+
#include <Fabric/Composition/ReactNativeIsland.h>
|
|
11
14
|
#include <Fabric/Composition/RootComponentView.h>
|
|
12
15
|
#include <Fabric/FabricUIManagerModule.h>
|
|
13
16
|
#include <Fabric/ReactNativeConfigProperties.h>
|
|
@@ -109,15 +112,6 @@ void FabricUIManager::installFabricUIManager() noexcept {
|
|
|
109
112
|
};
|
|
110
113
|
toolbox.runtimeExecutor = runtimeExecutor;
|
|
111
114
|
toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
|
|
112
|
-
toolbox.backgroundExecutor = [context = m_context,
|
|
113
|
-
dispatcher = Mso::DispatchQueue::MakeLooperQueue()](std::function<void()> &&callback) {
|
|
114
|
-
if (context.UIDispatcher().HasThreadAccess()) {
|
|
115
|
-
callback();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
dispatcher.Post(std::move(callback));
|
|
120
|
-
};
|
|
121
115
|
|
|
122
116
|
m_scheduler = std::make_shared<facebook::react::Scheduler>(
|
|
123
117
|
toolbox, (/*animationDriver_ ? animationDriver_.get() :*/ nullptr), this);
|
|
@@ -148,7 +142,7 @@ void FabricUIManager::startSurface(
|
|
|
148
142
|
|
|
149
143
|
facebook::react::LayoutContext layoutContext;
|
|
150
144
|
layoutContext.pointScaleFactor = rootView.ScaleFactor();
|
|
151
|
-
layoutContext.fontSizeMultiplier = rootView.
|
|
145
|
+
layoutContext.fontSizeMultiplier = rootView.FontSizeMultiplier();
|
|
152
146
|
|
|
153
147
|
m_surfaceManager->startSurface(
|
|
154
148
|
surfaceId,
|
|
@@ -377,6 +371,28 @@ void FabricUIManager::schedulerDidRequestPreliminaryViewAllocation(const faceboo
|
|
|
377
371
|
*/
|
|
378
372
|
}
|
|
379
373
|
|
|
374
|
+
struct HandleCommandArgs : public winrt::Microsoft::ReactNative::implementation::HandleCommandArgsT<HandleCommandArgs> {
|
|
375
|
+
HandleCommandArgs(winrt::hstring commandName, folly::dynamic const &arg) : m_commandName(commandName), m_args(arg) {}
|
|
376
|
+
|
|
377
|
+
winrt::hstring CommandName() const noexcept {
|
|
378
|
+
return m_commandName;
|
|
379
|
+
}
|
|
380
|
+
winrt::Microsoft::ReactNative::IJSValueReader CommandArgs() const noexcept {
|
|
381
|
+
return winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(m_args);
|
|
382
|
+
}
|
|
383
|
+
bool Handled() const noexcept {
|
|
384
|
+
return m_handled;
|
|
385
|
+
}
|
|
386
|
+
void Handled(bool value) noexcept {
|
|
387
|
+
m_handled = value;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
private:
|
|
391
|
+
folly::dynamic const &m_args;
|
|
392
|
+
const winrt::hstring m_commandName;
|
|
393
|
+
bool m_handled{false};
|
|
394
|
+
};
|
|
395
|
+
|
|
380
396
|
void FabricUIManager::schedulerDidDispatchCommand(
|
|
381
397
|
facebook::react::ShadowView const &shadowView,
|
|
382
398
|
std::string const &commandName,
|
|
@@ -384,7 +400,7 @@ void FabricUIManager::schedulerDidDispatchCommand(
|
|
|
384
400
|
if (m_context.UIDispatcher().HasThreadAccess()) {
|
|
385
401
|
auto descriptor = m_registry.componentViewDescriptorWithTag(shadowView.tag);
|
|
386
402
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(descriptor.view)
|
|
387
|
-
->HandleCommand(winrt::to_hstring(commandName),
|
|
403
|
+
->HandleCommand(winrt::make<HandleCommandArgs>(winrt::to_hstring(commandName), arg));
|
|
388
404
|
} else {
|
|
389
405
|
m_context.UIDispatcher().Post(
|
|
390
406
|
[wkThis = weak_from_this(), commandName, tag = shadowView.tag, args = folly::dynamic(arg)]() {
|
|
@@ -392,7 +408,7 @@ void FabricUIManager::schedulerDidDispatchCommand(
|
|
|
392
408
|
auto view = pThis->m_registry.findComponentViewWithTag(tag);
|
|
393
409
|
if (view) {
|
|
394
410
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(view)->HandleCommand(
|
|
395
|
-
winrt::to_hstring(commandName),
|
|
411
|
+
winrt::make<HandleCommandArgs>(winrt::to_hstring(commandName), args));
|
|
396
412
|
}
|
|
397
413
|
}
|
|
398
414
|
});
|
|
@@ -58,6 +58,39 @@ inline Color hostPlatformColorFromComponents(ColorComponents components) {
|
|
|
58
58
|
/* .m_platformColor = */ {}};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
inline Color hostPlatformColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
|
|
62
|
+
// Create ColorComponents from RGBA values normalized to the range [0.0f, 1.0f]
|
|
63
|
+
float ratio = 255.0f;
|
|
64
|
+
const auto colorComponents = ColorComponents{
|
|
65
|
+
.red = static_cast<float>(r) / ratio,
|
|
66
|
+
.green = static_cast<float>(g) / ratio,
|
|
67
|
+
.blue = static_cast<float>(b) / ratio,
|
|
68
|
+
.alpha = static_cast<float>(a) / ratio,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return hostPlatformColorFromComponents(colorComponents);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
inline float alphaFromHostPlatformColor(Color color) {
|
|
75
|
+
float ratio = 255.0f;
|
|
76
|
+
return static_cast<float>(color.m_color.A) / ratio;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
inline float redFromHostPlatformColor(Color color) {
|
|
80
|
+
float ratio = 255.0f;
|
|
81
|
+
return static_cast<float>(color.m_color.R) / ratio;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
inline float greenFromHostPlatformColor(Color color) {
|
|
85
|
+
float ratio = 255.0f;
|
|
86
|
+
return static_cast<float>(color.m_color.G) / ratio;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
inline float blueFromHostPlatformColor(Color color) {
|
|
90
|
+
float ratio = 255.0f;
|
|
91
|
+
return static_cast<float>(color.m_color.B) / ratio;
|
|
92
|
+
}
|
|
93
|
+
|
|
61
94
|
inline ColorComponents colorComponentsFromHostPlatformColor(Color color) {
|
|
62
95
|
float ratio = 255;
|
|
63
96
|
const auto windowsColor = color.AsWindowsColor();
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp
CHANGED
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
namespace facebook::react {
|
|
18
18
|
|
|
19
19
|
void TextLayoutManager::GetTextLayout(
|
|
20
|
-
const
|
|
20
|
+
const AttributedStringBox &attributedStringBox,
|
|
21
21
|
const ParagraphAttributes ¶graphAttributes,
|
|
22
22
|
Size size,
|
|
23
23
|
winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept {
|
|
24
|
+
const auto &attributedString = attributedStringBox.getValue();
|
|
24
25
|
auto fragments = attributedString.getFragments();
|
|
25
26
|
auto outerFragment = fragments[0];
|
|
26
27
|
|
|
@@ -40,7 +41,10 @@ void TextLayoutManager::GetTextLayout(
|
|
|
40
41
|
static_cast<facebook::react::FontWeight>(DWRITE_FONT_WEIGHT_REGULAR))),
|
|
41
42
|
style,
|
|
42
43
|
DWRITE_FONT_STRETCH_NORMAL,
|
|
43
|
-
outerFragment.textAttributes.
|
|
44
|
+
(outerFragment.textAttributes.allowFontScaling.value_or(true) &&
|
|
45
|
+
!std::isnan(outerFragment.textAttributes.fontSizeMultiplier))
|
|
46
|
+
? (outerFragment.textAttributes.fontSizeMultiplier * outerFragment.textAttributes.fontSize)
|
|
47
|
+
: outerFragment.textAttributes.fontSize,
|
|
44
48
|
L"",
|
|
45
49
|
spTextFormat.put()));
|
|
46
50
|
|
|
@@ -83,7 +87,7 @@ void TextLayoutManager::GetTextLayout(
|
|
|
83
87
|
}
|
|
84
88
|
winrt::check_hresult(spTextFormat->SetTextAlignment(alignment));
|
|
85
89
|
|
|
86
|
-
auto str = GetTransformedText(
|
|
90
|
+
auto str = GetTransformedText(attributedStringBox);
|
|
87
91
|
|
|
88
92
|
winrt::check_hresult(Microsoft::ReactNative::DWriteFactory()->CreateTextLayout(
|
|
89
93
|
str.c_str(), // The string to be laid out and formatted.
|
|
@@ -115,7 +119,11 @@ void TextLayoutManager::GetTextLayout(
|
|
|
115
119
|
attributes.fontWeight.value_or(static_cast<facebook::react::FontWeight>(DWRITE_FONT_WEIGHT_REGULAR))),
|
|
116
120
|
range));
|
|
117
121
|
winrt::check_hresult(spTextLayout->SetFontStyle(fragmentStyle, range));
|
|
118
|
-
winrt::check_hresult(spTextLayout->SetFontSize(
|
|
122
|
+
winrt::check_hresult(spTextLayout->SetFontSize(
|
|
123
|
+
(attributes.allowFontScaling.value_or(true) && !std::isnan(attributes.fontSizeMultiplier))
|
|
124
|
+
? (attributes.fontSizeMultiplier * attributes.fontSize)
|
|
125
|
+
: attributes.fontSize,
|
|
126
|
+
range));
|
|
119
127
|
|
|
120
128
|
if (!isnan(attributes.letterSpacing)) {
|
|
121
129
|
winrt::check_hresult(
|
|
@@ -134,7 +142,7 @@ void TextLayoutManager::GetTextLayout(
|
|
|
134
142
|
if (attributedStringBox.getValue().isEmpty())
|
|
135
143
|
return;
|
|
136
144
|
|
|
137
|
-
GetTextLayout(attributedStringBox
|
|
145
|
+
GetTextLayout(attributedStringBox, paragraphAttributes, layoutConstraints.maximumSize, spTextLayout);
|
|
138
146
|
}
|
|
139
147
|
|
|
140
148
|
TextMeasurement TextLayoutManager::measure(
|
|
@@ -218,14 +226,14 @@ Microsoft::ReactNative::TextTransform ConvertTextTransform(std::optional<TextTra
|
|
|
218
226
|
}
|
|
219
227
|
|
|
220
228
|
LinesMeasurements TextLayoutManager::measureLines(
|
|
221
|
-
const
|
|
229
|
+
const AttributedStringBox &attributedStringBox,
|
|
222
230
|
const ParagraphAttributes ¶graphAttributes,
|
|
223
231
|
Size size) const {
|
|
224
232
|
LinesMeasurements lineMeasurements{};
|
|
225
233
|
|
|
226
234
|
winrt::com_ptr<IDWriteTextLayout> spTextLayout;
|
|
227
235
|
|
|
228
|
-
GetTextLayout(
|
|
236
|
+
GetTextLayout(attributedStringBox, paragraphAttributes, size, spTextLayout);
|
|
229
237
|
|
|
230
238
|
if (spTextLayout) {
|
|
231
239
|
std::vector<DWRITE_LINE_METRICS> lineMetrics;
|
|
@@ -265,6 +273,7 @@ LinesMeasurements TextLayoutManager::measureLines(
|
|
|
265
273
|
}
|
|
266
274
|
|
|
267
275
|
std::string str;
|
|
276
|
+
const auto &attributedString = attributedStringBox.getValue();
|
|
268
277
|
for (const auto &fragment : attributedString.getFragments()) {
|
|
269
278
|
str = str +
|
|
270
279
|
winrt::to_string(Microsoft::ReactNative::TransformableText::TransformText(
|
|
@@ -290,7 +299,7 @@ LinesMeasurements TextLayoutManager::measureLines(
|
|
|
290
299
|
}
|
|
291
300
|
|
|
292
301
|
std::shared_ptr<void> TextLayoutManager::getHostTextStorage(
|
|
293
|
-
const
|
|
302
|
+
const AttributedStringBox &attributedStringBox,
|
|
294
303
|
const ParagraphAttributes ¶graphAttributes,
|
|
295
304
|
LayoutConstraints layoutConstraints) const {
|
|
296
305
|
return nullptr;
|
|
@@ -300,8 +309,16 @@ void *TextLayoutManager::getNativeTextLayoutManager() const {
|
|
|
300
309
|
return (void *)this;
|
|
301
310
|
}
|
|
302
311
|
|
|
303
|
-
|
|
312
|
+
Float TextLayoutManager::baseline(
|
|
313
|
+
AttributedStringBox attributedStringBox,
|
|
314
|
+
ParagraphAttributes paragraphAttributes,
|
|
315
|
+
Size size) const {
|
|
316
|
+
return 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
winrt::hstring TextLayoutManager::GetTransformedText(const AttributedStringBox &attributedStringBox) {
|
|
304
320
|
winrt::hstring result{};
|
|
321
|
+
const auto &attributedString = attributedStringBox.getValue();
|
|
305
322
|
for (const auto &fragment : attributedString.getFragments()) {
|
|
306
323
|
result = result +
|
|
307
324
|
Microsoft::ReactNative::TransformableText::TransformText(
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h
CHANGED
|
@@ -45,12 +45,12 @@ class TextLayoutManager {
|
|
|
45
45
|
* infrastructure.
|
|
46
46
|
*/
|
|
47
47
|
LinesMeasurements measureLines(
|
|
48
|
-
const
|
|
48
|
+
const AttributedStringBox &attributedStringBox,
|
|
49
49
|
const ParagraphAttributes ¶graphAttributes,
|
|
50
50
|
Size size) const;
|
|
51
51
|
|
|
52
52
|
std::shared_ptr<void> getHostTextStorage(
|
|
53
|
-
const
|
|
53
|
+
const AttributedStringBox &attributedStringBox,
|
|
54
54
|
const ParagraphAttributes ¶graphAttributes,
|
|
55
55
|
LayoutConstraints layoutConstraints) const;
|
|
56
56
|
|
|
@@ -63,6 +63,12 @@ class TextLayoutManager {
|
|
|
63
63
|
const ParagraphAttributes ¶graphAttributes,
|
|
64
64
|
LayoutConstraints layoutConstraints) const;
|
|
65
65
|
|
|
66
|
+
/*
|
|
67
|
+
* Calculates baseline of `attributedString` using native text rendering
|
|
68
|
+
* infrastructure.
|
|
69
|
+
*/
|
|
70
|
+
Float baseline(AttributedStringBox attributedStringBox, ParagraphAttributes paragraphAttributes, Size size) const;
|
|
71
|
+
|
|
66
72
|
/*
|
|
67
73
|
* Returns an opaque pointer to platform-specific TextLayoutManager.
|
|
68
74
|
* Is used on a native views layer to delegate text rendering to the manager.
|
|
@@ -78,9 +84,9 @@ class TextLayoutManager {
|
|
|
78
84
|
#pragma endregion
|
|
79
85
|
|
|
80
86
|
private:
|
|
81
|
-
static winrt::hstring GetTransformedText(const
|
|
87
|
+
static winrt::hstring GetTransformedText(const AttributedStringBox &attributedStringBox);
|
|
82
88
|
static void GetTextLayout(
|
|
83
|
-
const
|
|
89
|
+
const AttributedStringBox &attributedStringBox,
|
|
84
90
|
const ParagraphAttributes ¶graphAttributes,
|
|
85
91
|
Size size,
|
|
86
92
|
winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept;
|
|
@@ -129,6 +129,11 @@ void ReactModuleBuilder::AddSyncMethod(hstring const &name, SyncMethodDelegate c
|
|
|
129
129
|
m_methods.push_back(std::move(cxxMethod));
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
void ReactModuleBuilder::AddEventEmitter(hstring const &, EventEmitterInitializerDelegate const &) {
|
|
133
|
+
throw std::runtime_error(
|
|
134
|
+
"This module requires that it is registered as a TurboModule. If the module is being manually registered ensure you are using packageBuilder.AddTurboModule instead of packageBuilder.AddModule.");
|
|
135
|
+
}
|
|
136
|
+
|
|
132
137
|
/*static*/ MethodResultCallback ReactModuleBuilder::MakeMethodResultCallback(CxxModule::Callback &&callback) noexcept {
|
|
133
138
|
if (callback) {
|
|
134
139
|
return [callback = std::move(callback)](const IJSValueWriter &outputWriter) noexcept {
|
|
@@ -15,6 +15,7 @@ struct ReactModuleBuilder : winrt::implements<ReactModuleBuilder, IReactModuleBu
|
|
|
15
15
|
void AddConstantProvider(ConstantProviderDelegate const &constantProvider) noexcept;
|
|
16
16
|
void AddMethod(hstring const &name, MethodReturnType returnType, MethodDelegate const &method) noexcept;
|
|
17
17
|
void AddSyncMethod(hstring const &name, SyncMethodDelegate const &method) noexcept;
|
|
18
|
+
void AddEventEmitter(hstring const &name, EventEmitterInitializerDelegate const &emitter);
|
|
18
19
|
|
|
19
20
|
public:
|
|
20
21
|
std::unique_ptr<facebook::xplat::module::CxxModule> MakeCxxModule(
|
|
@@ -34,6 +34,12 @@ namespace Microsoft.ReactNative
|
|
|
34
34
|
MethodResultCallback resolve,
|
|
35
35
|
MethodResultCallback reject);
|
|
36
36
|
|
|
37
|
+
DOC_STRING("A delegate gets the arguments for an event emit on a EventEmitter.")
|
|
38
|
+
delegate void EmitEventSetterDelegate(JSValueArgWriter argWriter);
|
|
39
|
+
|
|
40
|
+
DOC_STRING("A delegate to call a turbo module EventEmitter.")
|
|
41
|
+
delegate void EventEmitterInitializerDelegate(EmitEventSetterDelegate emitter);
|
|
42
|
+
|
|
37
43
|
DOC_STRING("A delegate to call native synchronous method.")
|
|
38
44
|
delegate void SyncMethodDelegate(IJSValueReader inputReader, IJSValueWriter outputWriter);
|
|
39
45
|
|
|
@@ -62,5 +68,8 @@ namespace Microsoft.ReactNative
|
|
|
62
68
|
|
|
63
69
|
DOC_STRING("Adds a synchronous method to the native module. See @SyncMethodDelegate.")
|
|
64
70
|
void AddSyncMethod(String name, SyncMethodDelegate method);
|
|
71
|
+
|
|
72
|
+
DOC_STRING("Adds an EventEmitter to the turbo module. See @EventEmitterInitializerDelegate.")
|
|
73
|
+
void AddEventEmitter(String name, EventEmitterInitializerDelegate emitter);
|
|
65
74
|
};
|
|
66
75
|
} // namespace Microsoft.ReactNative
|
|
@@ -47,6 +47,13 @@ namespace Microsoft.ReactNative
|
|
|
47
47
|
UInt32 Index { get; };
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
[experimental]
|
|
51
|
+
runtimeclass HandleCommandArgs {
|
|
52
|
+
String CommandName { get; };
|
|
53
|
+
IJSValueReader CommandArgs { get; };
|
|
54
|
+
Boolean Handled;
|
|
55
|
+
};
|
|
56
|
+
|
|
50
57
|
[experimental]
|
|
51
58
|
DOC_STRING("A delegate that creates a @IComponentProps object for an instance of @ViewProps. See @IReactViewComponentBuilder.SetCreateProps")
|
|
52
59
|
delegate IComponentProps ViewPropsFactory(ViewProps props);
|
|
@@ -71,7 +78,7 @@ namespace Microsoft.ReactNative
|
|
|
71
78
|
delegate void ComponentViewInitializer(ComponentView view);
|
|
72
79
|
|
|
73
80
|
[experimental]
|
|
74
|
-
delegate void HandleCommandDelegate(ComponentView source,
|
|
81
|
+
delegate void HandleCommandDelegate(ComponentView source, HandleCommandArgs args);
|
|
75
82
|
|
|
76
83
|
[experimental]
|
|
77
84
|
delegate void UpdateFinalizerDelegate(ComponentView source, ComponentViewUpdateMask updateMask);
|
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
<ImportGroup Label="PropertySheets">
|
|
79
79
|
<Import Project="PropertySheet.props" />
|
|
80
80
|
<Import Project="..\PropertySheets\WinUI.props" />
|
|
81
|
+
<!-- Added since we build this project with Paper/Fabric. -->
|
|
82
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.LockFile.props" />
|
|
81
83
|
</ImportGroup>
|
|
82
84
|
<PropertyGroup Label="UserMacros" />
|
|
83
85
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
@@ -117,7 +117,9 @@ void Alert::ProcessPendingAlertRequestsXaml() noexcept {
|
|
|
117
117
|
// https://github.com/microsoft/microsoft-ui-xaml/issues/2331
|
|
118
118
|
dialog.Opened([useXamlRootForThemeBugWorkaround](winrt::IInspectable const &sender, auto &&) {
|
|
119
119
|
auto contentDialog = sender.as<xaml::Controls::ContentDialog>();
|
|
120
|
-
auto popups =
|
|
120
|
+
auto popups = useXamlRootForThemeBugWorkaround
|
|
121
|
+
? xaml::Media::VisualTreeHelper::GetOpenPopupsForXamlRoot(contentDialog.XamlRoot())
|
|
122
|
+
: xaml::Media::VisualTreeHelper::GetOpenPopups(xaml::Window::Current());
|
|
121
123
|
|
|
122
124
|
auto contentAsFrameworkElement = useXamlRootForThemeBugWorkaround
|
|
123
125
|
? contentDialog.XamlRoot().Content().try_as<xaml::FrameworkElement>()
|
|
@@ -68,7 +68,7 @@ void Appearance::RequeryTheme() noexcept {
|
|
|
68
68
|
auto oldTheme = winrt::unbox_value_or<ApplicationTheme>(oldThemeBoxed, ApplicationTheme::Light);
|
|
69
69
|
|
|
70
70
|
if (oldTheme != theme) {
|
|
71
|
-
appearanceChanged(ToString(theme));
|
|
71
|
+
appearanceChanged({ToString(theme)});
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
namespace Microsoft::ReactNative {
|
|
11
11
|
|
|
12
|
+
REACT_STRUCT(AppearanceChangeArgs)
|
|
13
|
+
struct AppearanceChangeArgs {
|
|
14
|
+
REACT_FIELD(colorScheme)
|
|
15
|
+
std::string colorScheme;
|
|
16
|
+
};
|
|
17
|
+
|
|
12
18
|
REACT_MODULE(Appearance)
|
|
13
19
|
struct Appearance : std::enable_shared_from_this<Appearance> {
|
|
14
20
|
using ApplicationTheme = xaml::ApplicationTheme;
|
|
@@ -31,7 +37,7 @@ struct Appearance : std::enable_shared_from_this<Appearance> {
|
|
|
31
37
|
void removeListeners(double count) noexcept;
|
|
32
38
|
|
|
33
39
|
REACT_EVENT(appearanceChanged);
|
|
34
|
-
std::function<void(
|
|
40
|
+
std::function<void(AppearanceChangeArgs const &)> appearanceChanged;
|
|
35
41
|
|
|
36
42
|
// This function allows the module to get the current theme on the UI thread before it is requested by any JS thread
|
|
37
43
|
static void InitOnUIThread(const Mso::React::IReactContext &context) noexcept;
|
|
@@ -50,12 +50,12 @@ void DevSettings::toggleElementInspector() noexcept {
|
|
|
50
50
|
"RCTDeviceEventEmitter", "emit", folly::dynamic::array("toggleElementInspector", nullptr));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
void DevSettings::
|
|
53
|
+
void DevSettings::addMenuItem(std::string title) noexcept {
|
|
54
54
|
assert(false);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
void DevSettings::
|
|
58
|
-
|
|
57
|
+
void DevSettings::openDebugger() noexcept {
|
|
58
|
+
// TODO: implement openDebugger() #13437
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
void DevSettings::setIsShakeToShowDevMenuEnabled(bool enabled) noexcept {
|
|
@@ -24,8 +24,8 @@ struct DevSettings {
|
|
|
24
24
|
REACT_METHOD(setIsDebuggingRemotely) void setIsDebuggingRemotely(bool isDebuggingRemotelyEnabled) noexcept;
|
|
25
25
|
REACT_METHOD(setProfilingEnabled) void setProfilingEnabled(bool isProfilingEnabled) noexcept;
|
|
26
26
|
REACT_METHOD(toggleElementInspector) void toggleElementInspector() noexcept;
|
|
27
|
-
REACT_METHOD(openDebugger) void openDebugger() noexcept;
|
|
28
27
|
REACT_METHOD(addMenuItem) void addMenuItem(std::string title) noexcept;
|
|
28
|
+
REACT_METHOD(openDebugger) void openDebugger() noexcept;
|
|
29
29
|
REACT_METHOD(setIsShakeToShowDevMenuEnabled) void setIsShakeToShowDevMenuEnabled(bool enabled) noexcept;
|
|
30
30
|
|
|
31
31
|
REACT_METHOD(addListener)
|
|
@@ -109,11 +109,11 @@ void LinkingManager::HandleOpenUri(winrt::hstring const &uri) noexcept {
|
|
|
109
109
|
// no-op
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
/*static*/ void LinkingManager::getInitialURL(::React::ReactPromise<std::string
|
|
112
|
+
/*static*/ void LinkingManager::getInitialURL(::React::ReactPromise<std::optional<std::string>> &&result) noexcept {
|
|
113
113
|
if (s_initialUri) {
|
|
114
114
|
result.Resolve(to_string(s_initialUri.AbsoluteUri()));
|
|
115
115
|
} else {
|
|
116
|
-
result.Resolve(
|
|
116
|
+
result.Resolve(std::nullopt);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -39,7 +39,7 @@ struct LinkingManager {
|
|
|
39
39
|
static void removeListeners(double count) noexcept;
|
|
40
40
|
|
|
41
41
|
REACT_METHOD(getInitialURL)
|
|
42
|
-
static void getInitialURL(winrt::Microsoft::ReactNative::ReactPromise<std::string
|
|
42
|
+
static void getInitialURL(winrt::Microsoft::ReactNative::ReactPromise<std::optional<std::string>> &&result) noexcept;
|
|
43
43
|
|
|
44
44
|
static void OpenUri(winrt::Windows::Foundation::Uri const &uri) noexcept;
|
|
45
45
|
|
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
|
|
20
20
|
namespace Microsoft::ReactNative {
|
|
21
21
|
|
|
22
|
+
LogBox::~LogBox() {
|
|
23
|
+
#ifdef USE_FABRIC
|
|
24
|
+
if (m_hwnd) {
|
|
25
|
+
m_context.UIDispatcher().Post([hwnd = m_hwnd]() { DestroyWindow(hwnd); });
|
|
26
|
+
m_hwnd = nullptr;
|
|
27
|
+
}
|
|
28
|
+
#endif
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
#ifdef USE_FABRIC
|
|
23
32
|
constexpr PCWSTR c_logBoxWindowClassName = L"MS_REACTNATIVE_LOGBOX";
|
|
24
33
|
constexpr auto CompHostProperty = L"CompHost";
|
|
@@ -14,6 +14,8 @@ REACT_MODULE(LogBox)
|
|
|
14
14
|
struct LogBox : public std::enable_shared_from_this<LogBox> {
|
|
15
15
|
using ModuleSpec = ReactNativeSpecs::LogBoxSpec;
|
|
16
16
|
|
|
17
|
+
~LogBox();
|
|
18
|
+
|
|
17
19
|
REACT_INIT(Initialize)
|
|
18
20
|
void Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept;
|
|
19
21
|
|