react-native-windows 0.69.6 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +5 -1
- package/Chakra/ChakraHelpers.cpp +1 -1
- package/Chakra/ChakraPlatform.cpp +1 -1
- package/Chakra/ChakraValue.cpp +6 -3
- package/Chakra/ChakraValue.h +1 -1
- package/Directory.Build.props +7 -7
- package/Folly/Folly.vcxproj +20 -13
- package/Folly/cgmanifest.json +14 -0
- package/Libraries/Alert/Alert.js +18 -4
- package/Libraries/Alert/Alert.windows.js +4 -0
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Animated/Animated.js +2 -2
- package/Libraries/Animated/AnimatedEvent.js +7 -4
- package/Libraries/Animated/AnimatedImplementation.js +17 -3
- package/Libraries/Animated/AnimatedMock.js +7 -2
- package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
- package/Libraries/Animated/NativeAnimatedModule.js +3 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
- package/Libraries/Animated/animations/SpringAnimation.js +3 -3
- package/Libraries/Animated/animations/TimingAnimation.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
- package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
- package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -0
- package/Libraries/AppState/AppState.js +0 -32
- package/Libraries/AppTheme/AppTheme.js +14 -8
- package/Libraries/AppTheme/AppThemeTypes.d.ts +0 -3
- package/Libraries/BatchedBridge/MessageQueue.js +21 -15
- package/Libraries/BatchedBridge/NativeModules.js +3 -4
- package/Libraries/Blob/FileReader.js +0 -6
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +0 -20
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
- package/Libraries/Components/Keyboard/Keyboard.js +0 -11
- package/Libraries/Components/Pressable/Pressable.js +2 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +2 -0
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
- package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +4 -30
- package/Libraries/Components/ScrollView/ScrollView.js +13 -11
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
- package/Libraries/Components/StatusBar/StatusBar.js +10 -7
- package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
- package/Libraries/Components/TextInput/TextInput.js +12 -2
- package/Libraries/Components/TextInput/TextInput.windows.js +12 -2
- package/Libraries/Components/Touchable/PooledClass.js +16 -4
- package/Libraries/Components/Touchable/Touchable.js +50 -1
- package/Libraries/Components/Touchable/Touchable.windows.js +972 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +3 -8
- package/Libraries/Components/View/ViewPropTypes.windows.js +3 -8
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +2 -2
- package/Libraries/Core/polyfillPromise.js +0 -32
- package/Libraries/Core/setUpBatchedBridge.js +5 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
- package/Libraries/Image/AssetSourceResolver.js +2 -2
- package/Libraries/Image/Image.android.js +5 -3
- package/Libraries/Image/Image.ios.js +6 -3
- package/Libraries/Image/Image.windows.js +6 -3
- package/Libraries/Image/ImageSource.js +7 -5
- package/Libraries/Inspector/ElementBox.js +2 -2
- package/Libraries/Inspector/NetworkOverlay.js +13 -8
- package/Libraries/Interaction/PanResponder.js +16 -14
- package/Libraries/Linking/Linking.js +0 -11
- package/Libraries/Lists/FlatList.js +3 -2
- package/Libraries/Lists/SectionList.js +2 -0
- package/Libraries/Lists/ViewabilityHelper.js +7 -3
- package/Libraries/Lists/VirtualizeUtils.js +33 -20
- package/Libraries/Lists/VirtualizedList.js +93 -47
- package/Libraries/Lists/VirtualizedListContext.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +14 -9
- package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
- package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +3 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +26 -12
- package/Libraries/Network/XMLHttpRequest.js +9 -11
- package/Libraries/Performance/PureComponentDebug.js +1 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
- package/Libraries/Pressability/Pressability.js +26 -16
- package/Libraries/Pressability/Pressability.windows.js +30 -17
- package/Libraries/Promise.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +16 -13
- package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
- package/Libraries/ReactNative/PaperUIManager.js +9 -9
- package/Libraries/ReactNative/PaperUIManager.windows.js +7 -8
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
- package/Libraries/Storage/AsyncStorage.js +7 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +2 -0
- package/Libraries/StyleSheet/processTransform.windows.js +2 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
- package/Libraries/Text/Text.js +15 -7
- package/Libraries/Text/Text.windows.js +14 -7
- package/Libraries/Types/CoreEventTypes.js +137 -11
- package/Libraries/Types/CoreEventTypes.windows.js +147 -22
- package/Libraries/Utilities/Dimensions.js +0 -13
- package/Libraries/Utilities/HMRClient.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +0 -7
- package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
- package/Libraries/Utilities/codegenNativeCommands.js +11 -2
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/stringifySafe.js +3 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
- package/Libraries/Vibration/Vibration.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -0
- package/Libraries/vendor/emitter/EventEmitter.js +105 -12
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +24 -12
- package/Microsoft.ReactNative/CoreApp.cpp +303 -0
- package/Microsoft.ReactNative/CoreAppPage.cpp +21 -0
- package/Microsoft.ReactNative/CoreAppPage.h +15 -0
- package/Microsoft.ReactNative/CoreAppPage.idl +12 -0
- package/Microsoft.ReactNative/CoreAppPage.xaml +14 -0
- package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ImageComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ImageComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/SliderComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/TextComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/TextComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -1
- package/Microsoft.ReactNative/GlyphViewManager.cpp +1 -0
- package/Microsoft.ReactNative/IReactDispatcher.cpp +18 -0
- package/Microsoft.ReactNative/IReactDispatcher.h +18 -3
- package/Microsoft.ReactNative/IReactDispatcher.idl +15 -0
- package/Microsoft.ReactNative/IReactPropertyBag.cpp +9 -0
- package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
- package/Microsoft.ReactNative/IReactPropertyBag.idl +3 -0
- package/Microsoft.ReactNative/JSDispatcherWriter.cpp +60 -22
- package/Microsoft.ReactNative/JSDispatcherWriter.h +5 -3
- package/Microsoft.ReactNative/JsiApi.cpp +41 -1
- package/Microsoft.ReactNative/JsiApi.h +3 -0
- package/Microsoft.ReactNative/JsiApi.idl +19 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +18 -2
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +7 -7
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +15 -12
- package/Microsoft.ReactNative/Modules/AlertModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +45 -9
- package/Microsoft.ReactNative/Modules/AppStateModule.h +9 -3
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +1 -1
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/I18nManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -1
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +66 -39
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +41 -11
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +1 -1
- package/Microsoft.ReactNative/QuirkSettings.cpp +22 -0
- package/Microsoft.ReactNative/QuirkSettings.h +10 -0
- package/Microsoft.ReactNative/QuirkSettings.idl +7 -0
- package/Microsoft.ReactNative/ReactApplication.cpp +44 -0
- package/Microsoft.ReactNative/ReactApplication.h +40 -5
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.cpp +5 -2
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.h +1 -0
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +24 -4
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +146 -84
- package/Microsoft.ReactNative/TurboModulesProvider.h +5 -0
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -0
- package/Microsoft.ReactNative/Utils/Helpers.cpp +1 -1
- package/Microsoft.ReactNative/Utils/Helpers.h +1 -1
- package/Microsoft.ReactNative/Utils/PropertyUtils.h +1 -1
- package/Microsoft.ReactNative/Utils/TransformableText.h +1 -1
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +0 -1
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +9 -7
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +3 -3
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +13 -1
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +1 -1
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +63 -13
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +5 -6
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -4
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +1 -1
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +21 -2
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +6 -3
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +1 -1
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +7 -1
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +4 -0
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +8 -3
- package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +2 -0
- package/Microsoft.ReactNative/microsoft.reactnative.def +4 -1
- package/Microsoft.ReactNative.Cxx/AppModelHelpers.h +17 -0
- package/Microsoft.ReactNative.Cxx/CoreApp.h +60 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +65 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +13 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.cpp +53 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.h +32 -0
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +84 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +14 -2
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +4 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +10 -0
- package/Microsoft.ReactNative.Managed/packages.lock.json +1 -24
- package/Mso/dispatchQueue/dispatchQueue.h +12 -4
- package/Mso/src/dispatchQueue/looperScheduler.cpp +36 -9
- package/Mso/src/dispatchQueue/queueService.cpp +2 -2
- package/Mso/src/dispatchQueue/queueService.h +2 -2
- package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +6 -1
- package/Mso/src/memoryApi/memoryApi.cpp +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/Release.props +6 -0
- package/ReactCommon/ReactCommon.vcxproj +11 -21
- package/ReactCommon/ReactCommon.vcxproj.filters +64 -46
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +145 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +344 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/BaseTextProps.cpp +313 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.cpp +455 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ConcreteComponentDescriptor.h +216 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/PropsMacros.h +91 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/graphics/RectangleEdges.h +100 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/CompactValue.h +3 -1
- package/Scripts/Microsoft.ReactNative.nuspec +6 -0
- package/Scripts/Microsoft.ReactNative.targets +7 -0
- package/Shared/DevSettings.h +4 -0
- package/Shared/InstanceManager.cpp +29 -0
- package/Shared/InstanceManager.h +14 -0
- package/Shared/JSI/ChakraRuntime.cpp +11 -2
- package/Shared/JSI/ChakraRuntime.h +2 -0
- package/Shared/Modules/BlobModule.cpp +4 -4
- package/Shared/Modules/BlobModule.h +1 -1
- package/Shared/Modules/FileReaderModule.cpp +3 -2
- package/Shared/Modules/IBlobPersistor.h +1 -1
- package/Shared/Networking/IHttpResource.h +1 -0
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +16 -10
- package/Shared/Networking/WinRTHttpResource.cpp +34 -2
- package/Shared/OInstance.cpp +29 -6
- package/Shared/OInstance.h +4 -13
- package/Shared/Threading/BatchingQueueThread.cpp +23 -12
- package/Shared/Utils.cpp +2 -5
- package/codegen/NativeAlertManagerSpec.g.h +2 -0
- package/codegen/NativeAnimatedModuleSpec.g.h +6 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +6 -0
- package/codegen/react/components/rnwcore/Props.cpp +2 -2
- package/codegen/react/components/rnwcore/Props.h +1 -1
- package/fmt/cgmanifest.json +14 -0
- package/fmt/fmt.vcxproj +25 -11
- package/jest/assetFileTransformer.js +3 -2
- package/jest/setup.js +4 -0
- package/package.json +25 -26
- package/rntypes/index.d.ts +0 -1
- package/template/cs-app-WinAppSDK/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/template/metro.devMode.config.js +49 -2
- package/template/shared-app/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/template/shared-lib/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/Libraries/vendor/emitter/EventSubscription.js +0 -19
- package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
- package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
- package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +0 -87
- package/Scripts/copyRNLibraries.js +0 -99
- package/jest/preprocessor.js +0 -40
- package/jest/preprocessor_DO_NOT_USE.js +0 -122
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
#include "pch.h"
|
|
5
5
|
#include "AppStateModule.h"
|
|
6
|
+
#include <QuirkSettings.h>
|
|
6
7
|
#include <Utils/Helpers.h>
|
|
7
8
|
#include <XamlUtils.h>
|
|
8
9
|
#include <winrt/Windows.ApplicationModel.DataTransfer.h>
|
|
9
10
|
#include "Unicode.h"
|
|
10
11
|
|
|
12
|
+
using namespace winrt::Windows::UI::Core;
|
|
13
|
+
|
|
11
14
|
namespace Microsoft::ReactNative {
|
|
12
15
|
|
|
13
16
|
void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept {
|
|
14
17
|
m_context = reactContext;
|
|
15
|
-
|
|
18
|
+
m_deactivated = false;
|
|
19
|
+
m_enteredBackground = false;
|
|
16
20
|
|
|
17
21
|
// We need to register for notifications from the XAML thread.
|
|
18
22
|
if (auto dispatcher = reactContext.UIDispatcher()) {
|
|
@@ -21,13 +25,15 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
|
|
|
21
25
|
|
|
22
26
|
if (!IsWinUI3Island() && currentApp != nullptr) {
|
|
23
27
|
#ifndef USE_WINUI3
|
|
28
|
+
CoreWindow window = CoreWindow::GetForCurrentThread();
|
|
29
|
+
|
|
24
30
|
m_enteredBackgroundRevoker = currentApp.EnteredBackground(
|
|
25
31
|
winrt::auto_revoke,
|
|
26
32
|
[weakThis = weak_from_this()](
|
|
27
33
|
winrt::IInspectable const & /*sender*/,
|
|
28
34
|
winrt::Windows::ApplicationModel::EnteredBackgroundEventArgs const & /*e*/) noexcept {
|
|
29
35
|
if (auto strongThis = weakThis.lock()) {
|
|
30
|
-
strongThis->
|
|
36
|
+
strongThis->SetEnteredBackground(true);
|
|
31
37
|
}
|
|
32
38
|
});
|
|
33
39
|
|
|
@@ -37,9 +43,27 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
|
|
|
37
43
|
winrt::IInspectable const & /*sender*/,
|
|
38
44
|
winrt::Windows::ApplicationModel::LeavingBackgroundEventArgs const & /*e*/) noexcept {
|
|
39
45
|
if (auto strongThis = weakThis.lock()) {
|
|
40
|
-
strongThis->
|
|
46
|
+
strongThis->SetEnteredBackground(false);
|
|
41
47
|
}
|
|
42
48
|
});
|
|
49
|
+
if (window != nullptr &&
|
|
50
|
+
winrt::Microsoft::ReactNative::implementation::QuirkSettings::GetMapWindowDeactivatedToAppStateInactive(
|
|
51
|
+
m_context.Properties())) {
|
|
52
|
+
m_activatedEventRevoker = window.Activated(
|
|
53
|
+
winrt::auto_revoke,
|
|
54
|
+
[weakThis = weak_from_this()](
|
|
55
|
+
winrt::Windows::UI::Core::CoreWindow /*sender*/,
|
|
56
|
+
winrt::Windows::UI::Core::WindowActivatedEventArgs args) {
|
|
57
|
+
if (auto strongThis = weakThis.lock()) {
|
|
58
|
+
if (args.WindowActivationState() ==
|
|
59
|
+
winrt::Windows::UI::Core::CoreWindowActivationState::Deactivated) {
|
|
60
|
+
strongThis->SetDeactivated(true);
|
|
61
|
+
} else {
|
|
62
|
+
strongThis->SetDeactivated(false);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
43
67
|
#endif
|
|
44
68
|
} else {
|
|
45
69
|
assert(IsXamlIsland());
|
|
@@ -52,7 +76,7 @@ void AppState::GetCurrentAppState(
|
|
|
52
76
|
std::function<void(AppStateChangeArgs const &)> const &success,
|
|
53
77
|
std::function<void(React::JSValue const &)> const &error) noexcept {
|
|
54
78
|
AppStateChangeArgs args;
|
|
55
|
-
args.app_state =
|
|
79
|
+
args.app_state = GetAppState();
|
|
56
80
|
success(args);
|
|
57
81
|
}
|
|
58
82
|
|
|
@@ -65,12 +89,24 @@ void AppState::RemoveListeners(double /*count*/) noexcept {
|
|
|
65
89
|
}
|
|
66
90
|
|
|
67
91
|
ReactNativeSpecs::AppStateSpec_Constants AppState::GetConstants() noexcept {
|
|
68
|
-
return {
|
|
92
|
+
return {GetAppState()};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void AppState::SetDeactivated(bool deactivated) noexcept {
|
|
96
|
+
if (winrt::Microsoft::ReactNative::implementation::QuirkSettings::GetMapWindowDeactivatedToAppStateInactive(
|
|
97
|
+
m_context.Properties())) {
|
|
98
|
+
m_deactivated = deactivated;
|
|
99
|
+
m_context.JSDispatcher().Post([this]() { AppStateDidChange({GetAppState()}); });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
void AppState::SetEnteredBackground(bool enteredBackground) noexcept {
|
|
104
|
+
m_enteredBackground = enteredBackground;
|
|
105
|
+
m_context.JSDispatcher().Post([this]() { AppStateDidChange({GetAppState()}); });
|
|
69
106
|
}
|
|
70
107
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
m_context.JSDispatcher().Post([this]() { AppStateDidChange({m_active ? "active" : "background"}); });
|
|
108
|
+
std::string AppState::GetAppState() noexcept {
|
|
109
|
+
return m_enteredBackground ? "background" : (m_deactivated ? "inactive" : "active");
|
|
74
110
|
}
|
|
75
111
|
|
|
76
|
-
} // namespace Microsoft::ReactNative
|
|
112
|
+
} // namespace Microsoft::ReactNative
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
#pragma once
|
|
4
4
|
|
|
5
|
-
#include "
|
|
5
|
+
#include "codegen/NativeAppStateSpec.g.h"
|
|
6
6
|
#include <NativeModules.h>
|
|
7
7
|
#include <winrt/Windows.ApplicationModel.h>
|
|
8
8
|
#include <winrt/Windows.Foundation.h>
|
|
9
9
|
|
|
10
|
+
#include <winrt/Windows.UI.Core.h>
|
|
11
|
+
|
|
10
12
|
namespace Microsoft::ReactNative {
|
|
11
13
|
|
|
12
14
|
REACT_MODULE(AppState)
|
|
@@ -35,15 +37,19 @@ struct AppState : public std::enable_shared_from_this<AppState> {
|
|
|
35
37
|
std::function<void(AppStateChangeArgs const &)> AppStateDidChange;
|
|
36
38
|
|
|
37
39
|
private:
|
|
38
|
-
void
|
|
40
|
+
void SetDeactivated(bool deactivated) noexcept;
|
|
41
|
+
void SetEnteredBackground(bool enteredBackground) noexcept;
|
|
42
|
+
std::string GetAppState() noexcept;
|
|
39
43
|
|
|
40
44
|
std::mutex m_stateMutex;
|
|
41
|
-
std::atomic<bool>
|
|
45
|
+
std::atomic<bool> m_deactivated;
|
|
46
|
+
std::atomic<bool> m_enteredBackground;
|
|
42
47
|
char const *m_lastState{nullptr};
|
|
43
48
|
React::ReactContext m_context;
|
|
44
49
|
#ifndef USE_WINUI3
|
|
45
50
|
xaml::Application::EnteredBackground_revoker m_enteredBackgroundRevoker;
|
|
46
51
|
xaml::Application::LeavingBackground_revoker m_leavingBackgroundRevoker;
|
|
52
|
+
winrt::Windows::UI::Core::CoreWindow::Activated_revoker m_activatedEventRevoker;
|
|
47
53
|
#endif
|
|
48
54
|
};
|
|
49
55
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
#pragma once
|
|
4
4
|
|
|
5
|
-
#include "
|
|
5
|
+
#include "codegen/NativeI18nManagerSpec.g.h"
|
|
6
6
|
#include <NativeModules.h>
|
|
7
7
|
#include <winrt/Windows.ApplicationModel.h>
|
|
8
8
|
#include <winrt/Windows.Foundation.h>
|
|
@@ -45,7 +45,7 @@ winrt::fire_and_forget GetImageSizeAsync(
|
|
|
45
45
|
bool needsDownload = (scheme == L"http") || (scheme == L"https");
|
|
46
46
|
bool inlineData = scheme == L"data";
|
|
47
47
|
|
|
48
|
-
winrt::
|
|
48
|
+
winrt::IRandomAccessStream memoryStream;
|
|
49
49
|
if (needsDownload) {
|
|
50
50
|
memoryStream = co_await GetImageStreamAsync(source);
|
|
51
51
|
} else if (inlineData) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#include <UI.Xaml.Input.h>
|
|
8
8
|
#include <UI.Xaml.Media.h>
|
|
9
9
|
#include <Views/ShadowNodeBase.h>
|
|
10
|
+
#include <cxxreact/SystraceSection.h>
|
|
10
11
|
#include "Modules/I18nManagerModule.h"
|
|
11
12
|
#include "NativeUIManager.h"
|
|
12
13
|
|
|
@@ -24,6 +25,8 @@ using namespace xaml::Controls;
|
|
|
24
25
|
using namespace xaml::Media;
|
|
25
26
|
} // namespace winrt
|
|
26
27
|
|
|
28
|
+
using namespace facebook::react;
|
|
29
|
+
|
|
27
30
|
namespace Microsoft::ReactNative {
|
|
28
31
|
|
|
29
32
|
static YogaNodePtr make_yoga_node(YGConfigRef config) {
|
|
@@ -38,7 +41,7 @@ static int YogaLog(
|
|
|
38
41
|
YGLogLevel /*level*/,
|
|
39
42
|
const char *format,
|
|
40
43
|
va_list args) {
|
|
41
|
-
int len =
|
|
44
|
+
const int len = _vscprintf(format, args);
|
|
42
45
|
std::string buffer(len + 1, '\0');
|
|
43
46
|
vsnprintf_s(&buffer[0], len + 1, _TRUNCATE, format, args);
|
|
44
47
|
buffer.resize(len);
|
|
@@ -222,6 +225,7 @@ int64_t NativeUIManager::AddMeasuredRootView(facebook::react::IReactRootView *ro
|
|
|
222
225
|
}
|
|
223
226
|
|
|
224
227
|
void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReactRootView *pReactRootView) {
|
|
228
|
+
SystraceSection s("NativeUIManager::AddRootView");
|
|
225
229
|
auto xamlRootView = static_cast<IXamlRootView *>(pReactRootView);
|
|
226
230
|
XamlView view = xamlRootView->GetXamlView();
|
|
227
231
|
m_tagsToXamlReactControl.emplace(
|
|
@@ -244,11 +248,13 @@ void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReac
|
|
|
244
248
|
}
|
|
245
249
|
|
|
246
250
|
void NativeUIManager::removeRootView(Microsoft::ReactNative::ShadowNode &shadow) {
|
|
251
|
+
SystraceSection s("NativeUIManager::removeRootView");
|
|
247
252
|
m_tagsToXamlReactControl.erase(shadow.m_tag);
|
|
248
253
|
RemoveView(shadow, true);
|
|
249
254
|
}
|
|
250
255
|
|
|
251
256
|
void NativeUIManager::onBatchComplete() {
|
|
257
|
+
SystraceSection s("NativeUIManager::onBatchComplete");
|
|
252
258
|
if (m_inBatch) {
|
|
253
259
|
DoLayout();
|
|
254
260
|
m_inBatch = false;
|
|
@@ -768,6 +774,7 @@ static void StyleYogaNode(
|
|
|
768
774
|
}
|
|
769
775
|
|
|
770
776
|
void NativeUIManager::CreateView(ShadowNode &shadowNode, React::JSValueObject &props) {
|
|
777
|
+
SystraceSection s("NativeUIManager::CreateView");
|
|
771
778
|
ShadowNodeBase &node = static_cast<ShadowNodeBase &>(shadowNode);
|
|
772
779
|
auto *pViewManager = node.GetViewManager();
|
|
773
780
|
|
|
@@ -859,6 +866,7 @@ void NativeUIManager::ReplaceView(ShadowNode &shadowNode) {
|
|
|
859
866
|
}
|
|
860
867
|
|
|
861
868
|
void NativeUIManager::UpdateView(ShadowNode &shadowNode, winrt::Microsoft::ReactNative::JSValueObject &props) {
|
|
869
|
+
SystraceSection s("NativeUIManager::UpdateView");
|
|
862
870
|
ShadowNodeBase &node = static_cast<ShadowNodeBase &>(shadowNode);
|
|
863
871
|
auto *pViewManager = node.GetViewManager();
|
|
864
872
|
|
|
@@ -889,51 +897,70 @@ void NativeUIManager::UpdateExtraLayout(int64_t tag) {
|
|
|
889
897
|
}
|
|
890
898
|
|
|
891
899
|
void NativeUIManager::DoLayout() {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
900
|
+
SystraceSection s("NativeUIManager::DoLayout");
|
|
901
|
+
|
|
902
|
+
{
|
|
903
|
+
SystraceSection s("NativeUIManager::DoLayout::UpdateLayout");
|
|
904
|
+
// Process vector of RN controls needing extra layout here.
|
|
905
|
+
const auto extraLayoutNodes = m_extraLayoutNodes;
|
|
906
|
+
for (const int64_t tag : extraLayoutNodes) {
|
|
907
|
+
ShadowNodeBase *node = static_cast<ShadowNodeBase *>(m_host->FindShadowNodeForTag(tag));
|
|
908
|
+
if (node) {
|
|
909
|
+
auto element = node->GetView().as<xaml::FrameworkElement>();
|
|
910
|
+
element.UpdateLayout();
|
|
911
|
+
}
|
|
899
912
|
}
|
|
913
|
+
// Values need to be cleared from the vector before next call to DoLayout.
|
|
914
|
+
m_extraLayoutNodes.clear();
|
|
900
915
|
}
|
|
901
|
-
|
|
902
|
-
m_extraLayoutNodes.clear();
|
|
916
|
+
|
|
903
917
|
auto &rootTags = m_host->GetAllRootTags();
|
|
904
918
|
for (int64_t rootTag : rootTags) {
|
|
905
|
-
|
|
919
|
+
{
|
|
920
|
+
SystraceSection s("NativeUIManager::DoLayout::UpdateExtraLayout");
|
|
921
|
+
UpdateExtraLayout(rootTag);
|
|
922
|
+
}
|
|
906
923
|
|
|
907
924
|
ShadowNodeBase &rootShadowNode = static_cast<ShadowNodeBase &>(m_host->GetShadowNodeForTag(rootTag));
|
|
908
|
-
YGNodeRef rootNode = GetYogaNode(rootTag)
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
925
|
+
if (YGNodeRef rootNode = GetYogaNode(rootTag)) {
|
|
926
|
+
auto rootElement = rootShadowNode.GetView().as<xaml::FrameworkElement>();
|
|
927
|
+
|
|
928
|
+
float actualWidth = static_cast<float>(rootElement.ActualWidth());
|
|
929
|
+
float actualHeight = static_cast<float>(rootElement.ActualHeight());
|
|
930
|
+
|
|
931
|
+
{
|
|
932
|
+
SystraceSection s("NativeUIManager::DoLayout::YGNodeCalculateLayout");
|
|
933
|
+
// We must always run layout in LTR mode, which might seem unintuitive.
|
|
934
|
+
// We will flip the root of the tree into RTL by forcing the root XAML node's FlowDirection to RightToLeft
|
|
935
|
+
// which will inherit down the XAML tree, allowing all native controls to pick it up.
|
|
936
|
+
YGNodeCalculateLayout(rootNode, actualWidth, actualHeight, YGDirectionLTR);
|
|
937
|
+
}
|
|
938
|
+
} else {
|
|
939
|
+
assert(false);
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
918
942
|
}
|
|
919
943
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
944
|
+
{
|
|
945
|
+
SystraceSection s("NativeUIManager::DoLayout::SetLayoutProps");
|
|
946
|
+
for (auto &tagToYogaNode : m_tagsToYogaNodes) {
|
|
947
|
+
int64_t tag = tagToYogaNode.first;
|
|
948
|
+
YGNodeRef yogaNode = tagToYogaNode.second.get();
|
|
949
|
+
|
|
950
|
+
if (!YGNodeGetHasNewLayout(yogaNode))
|
|
951
|
+
continue;
|
|
952
|
+
YGNodeSetHasNewLayout(yogaNode, false);
|
|
953
|
+
|
|
954
|
+
float left = YGNodeLayoutGetLeft(yogaNode);
|
|
955
|
+
float top = YGNodeLayoutGetTop(yogaNode);
|
|
956
|
+
float width = YGNodeLayoutGetWidth(yogaNode);
|
|
957
|
+
float height = YGNodeLayoutGetHeight(yogaNode);
|
|
958
|
+
|
|
959
|
+
ShadowNodeBase &shadowNode = static_cast<ShadowNodeBase &>(m_host->GetShadowNodeForTag(tag));
|
|
960
|
+
auto view = shadowNode.GetView();
|
|
961
|
+
auto pViewManager = shadowNode.GetViewManager();
|
|
962
|
+
pViewManager->SetLayoutProps(shadowNode, view, left, top, width, height);
|
|
963
|
+
}
|
|
937
964
|
}
|
|
938
965
|
}
|
|
939
966
|
|
|
@@ -1115,7 +1142,7 @@ void NativeUIManager::findSubviewIn(
|
|
|
1115
1142
|
|
|
1116
1143
|
void NativeUIManager::focus(int64_t reactTag) {
|
|
1117
1144
|
if (auto shadowNode = static_cast<ShadowNodeBase *>(m_host->FindShadowNodeForTag(reactTag))) {
|
|
1118
|
-
xaml::Input::FocusManager::TryFocusAsync(shadowNode->GetView(), winrt::FocusState::
|
|
1145
|
+
xaml::Input::FocusManager::TryFocusAsync(shadowNode->GetView(), winrt::FocusState::Programmatic);
|
|
1119
1146
|
}
|
|
1120
1147
|
}
|
|
1121
1148
|
|
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
#include <DynamicWriter.h>
|
|
7
7
|
#include <IReactContext.h>
|
|
8
8
|
#include <IReactRootView.h>
|
|
9
|
+
#include <Modules/NativeUIManager.h>
|
|
9
10
|
#include <Modules/PaperUIManagerModule.h>
|
|
10
|
-
#include <Modules\NativeUIManager.h>
|
|
11
11
|
#include <Views/ViewManager.h>
|
|
12
12
|
#include <XamlUtils.h>
|
|
13
|
+
#include <cxxreact/SystraceSection.h>
|
|
13
14
|
#include "ShadowNodeBase.h"
|
|
14
15
|
#include "Unicode.h"
|
|
15
16
|
#include "XamlUIService.h"
|
|
16
17
|
|
|
18
|
+
using namespace facebook::react;
|
|
19
|
+
|
|
17
20
|
namespace Microsoft::ReactNative {
|
|
18
21
|
|
|
19
22
|
struct ViewAtIndex final {
|
|
@@ -126,20 +129,24 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
|
|
|
126
129
|
|
|
127
130
|
void createView(int64_t reactTag, std::string viewName, int64_t rootTag, React::JSValueObject &&props) noexcept {
|
|
128
131
|
m_nativeUIManager->ensureInBatch();
|
|
129
|
-
auto viewManager = GetViewManager(viewName)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
if (auto viewManager = GetViewManager(viewName)) {
|
|
133
|
+
auto node = viewManager->createShadow();
|
|
134
|
+
node->m_className = std::move(viewName);
|
|
135
|
+
node->m_tag = reactTag;
|
|
136
|
+
node->m_rootTag = rootTag;
|
|
137
|
+
node->m_viewManager = viewManager;
|
|
135
138
|
|
|
136
|
-
|
|
139
|
+
node->createView(props);
|
|
137
140
|
|
|
138
|
-
|
|
141
|
+
m_nativeUIManager->CreateView(*node, props);
|
|
139
142
|
|
|
140
|
-
|
|
143
|
+
m_nodeRegistry.addNode(shadow_ptr(node), reactTag);
|
|
141
144
|
|
|
142
|
-
|
|
145
|
+
node->updateProperties(props);
|
|
146
|
+
} else {
|
|
147
|
+
assert(false);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
143
150
|
}
|
|
144
151
|
|
|
145
152
|
void updateView(int64_t reactTag, std::string viewName, React::JSValueObject &&props) noexcept {
|
|
@@ -578,6 +585,7 @@ void UIManager::createView(
|
|
|
578
585
|
viewName = std::move(viewName),
|
|
579
586
|
rootTag,
|
|
580
587
|
props = std::move(props)]() mutable {
|
|
588
|
+
SystraceSection s("UIManager::createView");
|
|
581
589
|
if (auto module = m.lock()) {
|
|
582
590
|
module->createView(static_cast<int64_t>(reactTag), viewName, static_cast<int64_t>(rootTag), std::move(props));
|
|
583
591
|
}
|
|
@@ -589,6 +597,7 @@ void UIManager::updateView(double reactTag, std::string viewName, React::JSValue
|
|
|
589
597
|
reactTag,
|
|
590
598
|
viewName = std::move(viewName),
|
|
591
599
|
props = std::move(props)]() mutable {
|
|
600
|
+
SystraceSection s("UIManager::updateView");
|
|
592
601
|
if (auto module = m.lock()) {
|
|
593
602
|
module->updateView(static_cast<int64_t>(reactTag), viewName, std::move(props));
|
|
594
603
|
}
|
|
@@ -597,6 +606,7 @@ void UIManager::updateView(double reactTag, std::string viewName, React::JSValue
|
|
|
597
606
|
|
|
598
607
|
void UIManager::focus(double reactTag) noexcept {
|
|
599
608
|
m_batchingUIMessageQueue->runOnQueue([m = std::weak_ptr<UIManagerModule>(m_module), reactTag]() {
|
|
609
|
+
SystraceSection s("UIManager::focus");
|
|
600
610
|
if (auto module = m.lock()) {
|
|
601
611
|
module->focus(static_cast<int64_t>(reactTag));
|
|
602
612
|
}
|
|
@@ -605,6 +615,7 @@ void UIManager::focus(double reactTag) noexcept {
|
|
|
605
615
|
|
|
606
616
|
void UIManager::blur(double reactTag) noexcept {
|
|
607
617
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag]() {
|
|
618
|
+
SystraceSection s("UIManager::blur");
|
|
608
619
|
if (auto module = m.lock()) {
|
|
609
620
|
module->blur(static_cast<int64_t>(reactTag));
|
|
610
621
|
}
|
|
@@ -620,6 +631,7 @@ void UIManager::findSubviewIn(
|
|
|
620
631
|
reactTag,
|
|
621
632
|
point = std::move(point),
|
|
622
633
|
callback = std::move(callback)]() mutable {
|
|
634
|
+
SystraceSection s("UIManager::findSubviewIn");
|
|
623
635
|
if (auto module = m.lock()) {
|
|
624
636
|
module->findSubviewIn(static_cast<int64_t>(reactTag), std::move(point), std::move(callback));
|
|
625
637
|
}
|
|
@@ -634,6 +646,7 @@ void UIManager::dispatchViewManagerCommand(
|
|
|
634
646
|
reactTag,
|
|
635
647
|
commandID = std::move(commandID),
|
|
636
648
|
commandArgs = std::move(commandArgs)]() mutable {
|
|
649
|
+
SystraceSection s("UIManager::dispatchViewManagerCommand");
|
|
637
650
|
if (auto module = m.lock()) {
|
|
638
651
|
module->dispatchViewManagerCommand(static_cast<int64_t>(reactTag), std::move(commandID), std::move(commandArgs));
|
|
639
652
|
}
|
|
@@ -646,6 +659,7 @@ void UIManager::measure(
|
|
|
646
659
|
&callback) noexcept {
|
|
647
660
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor(
|
|
648
661
|
[m = std::weak_ptr<UIManagerModule>(m_module), reactTag, callback = std::move(callback)]() mutable {
|
|
662
|
+
SystraceSection s("UIManager::measure");
|
|
649
663
|
if (auto module = m.lock()) {
|
|
650
664
|
module->measure(static_cast<int64_t>(reactTag), std::move(callback));
|
|
651
665
|
}
|
|
@@ -657,6 +671,7 @@ void UIManager::measureInWindow(
|
|
|
657
671
|
std::function<void(double x, double y, double width, double height)> const &callback) noexcept {
|
|
658
672
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor(
|
|
659
673
|
[m = std::weak_ptr<UIManagerModule>(m_module), reactTag, callback = std::move(callback)]() mutable {
|
|
674
|
+
SystraceSection s("UIManager::measureInWindow");
|
|
660
675
|
if (auto module = m.lock()) {
|
|
661
676
|
module->measureInWindow(static_cast<int64_t>(reactTag), std::move(callback));
|
|
662
677
|
}
|
|
@@ -671,6 +686,7 @@ void UIManager::viewIsDescendantOf(
|
|
|
671
686
|
reactTag,
|
|
672
687
|
ancestorReactTag,
|
|
673
688
|
callback = std::move(callback)]() mutable {
|
|
689
|
+
SystraceSection s("UIManager::viewIsDescendantOf");
|
|
674
690
|
if (auto module = m.lock()) {
|
|
675
691
|
module->viewIsDescendantOf(
|
|
676
692
|
static_cast<int64_t>(reactTag), static_cast<int64_t>(ancestorReactTag), std::move(callback));
|
|
@@ -688,6 +704,7 @@ void UIManager::measureLayout(
|
|
|
688
704
|
ancestorReactTag,
|
|
689
705
|
errorCallback = std::move(errorCallback),
|
|
690
706
|
callback = std::move(callback)]() mutable {
|
|
707
|
+
SystraceSection s("UIManager::measureLayout");
|
|
691
708
|
if (auto module = m.lock()) {
|
|
692
709
|
module->measureLayout(
|
|
693
710
|
static_cast<int64_t>(reactTag),
|
|
@@ -706,6 +723,7 @@ void UIManager::measureLayoutRelativeToParent(
|
|
|
706
723
|
reactTag,
|
|
707
724
|
errorCallback = std::move(errorCallback),
|
|
708
725
|
callback = std::move(callback)]() mutable {
|
|
726
|
+
SystraceSection s("UIManager::measureLayoutRelativeToParent");
|
|
709
727
|
if (auto module = m.lock()) {
|
|
710
728
|
module->measureLayoutRelativeToParent(
|
|
711
729
|
static_cast<int64_t>(reactTag), std::move(errorCallback), std::move(callback));
|
|
@@ -716,6 +734,7 @@ void UIManager::measureLayoutRelativeToParent(
|
|
|
716
734
|
void UIManager::setJSResponder(double reactTag, bool blockNativeResponder) noexcept {
|
|
717
735
|
m_batchingUIMessageQueue->runOnQueue(
|
|
718
736
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag, blockNativeResponder]() mutable {
|
|
737
|
+
SystraceSection s("UIManager::setJSResponder");
|
|
719
738
|
if (auto module = m.lock()) {
|
|
720
739
|
module->setJSResponder(static_cast<int64_t>(reactTag), blockNativeResponder);
|
|
721
740
|
}
|
|
@@ -724,6 +743,7 @@ void UIManager::setJSResponder(double reactTag, bool blockNativeResponder) noexc
|
|
|
724
743
|
|
|
725
744
|
void UIManager::clearJSResponder() noexcept {
|
|
726
745
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module)]() mutable {
|
|
746
|
+
SystraceSection s("UIManager::clearJSResponder");
|
|
727
747
|
if (auto module = m.lock()) {
|
|
728
748
|
module->clearJSResponder();
|
|
729
749
|
}
|
|
@@ -738,6 +758,7 @@ void UIManager::configureNextLayoutAnimation(
|
|
|
738
758
|
config = std::move(config),
|
|
739
759
|
callback = std::move(callback),
|
|
740
760
|
errorCallback = std::move(errorCallback)]() mutable {
|
|
761
|
+
SystraceSection s("UIManager::configureNextLayoutAnimation");
|
|
741
762
|
if (auto module = m.lock()) {
|
|
742
763
|
module->configureNextLayoutAnimation(std::move(config), std::move(callback), std::move(errorCallback));
|
|
743
764
|
}
|
|
@@ -746,6 +767,7 @@ void UIManager::configureNextLayoutAnimation(
|
|
|
746
767
|
|
|
747
768
|
void UIManager::removeSubviewsFromContainerWithID(double containerID) noexcept {
|
|
748
769
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), containerID]() {
|
|
770
|
+
SystraceSection s("UIManager::removeSubviewsFromContainerWithID");
|
|
749
771
|
if (auto module = m.lock()) {
|
|
750
772
|
module->removeSubviewsFromContainerWithID(static_cast<int64_t>(containerID));
|
|
751
773
|
}
|
|
@@ -755,6 +777,7 @@ void UIManager::removeSubviewsFromContainerWithID(double containerID) noexcept {
|
|
|
755
777
|
void UIManager::replaceExistingNonRootView(double reactTag, double newReactTag) noexcept {
|
|
756
778
|
m_batchingUIMessageQueue->runOnQueue(
|
|
757
779
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag, newReactTag]() {
|
|
780
|
+
SystraceSection s("UIManager::replaceExistingNonRootView");
|
|
758
781
|
if (auto module = m.lock()) {
|
|
759
782
|
module->replaceExistingNonRootView(static_cast<int64_t>(reactTag), static_cast<int64_t>(newReactTag));
|
|
760
783
|
}
|
|
@@ -763,6 +786,7 @@ void UIManager::replaceExistingNonRootView(double reactTag, double newReactTag)
|
|
|
763
786
|
|
|
764
787
|
void UIManager::removeRootView(double reactTag) noexcept {
|
|
765
788
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag]() {
|
|
789
|
+
SystraceSection s("UIManager::removeRootView");
|
|
766
790
|
if (auto module = m.lock()) {
|
|
767
791
|
module->removeRootView(static_cast<int64_t>(reactTag));
|
|
768
792
|
}
|
|
@@ -772,6 +796,7 @@ void UIManager::removeRootView(double reactTag) noexcept {
|
|
|
772
796
|
void UIManager::setChildren(double containerTag, React::JSValueArray &&reactTags) noexcept {
|
|
773
797
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor(
|
|
774
798
|
[m = std::weak_ptr<UIManagerModule>(m_module), containerTag, reactTags = std::move(reactTags)]() mutable {
|
|
799
|
+
SystraceSection s("UIManager::setChildren");
|
|
775
800
|
if (auto module = m.lock()) {
|
|
776
801
|
module->setChildren(static_cast<int64_t>(containerTag), std::move(reactTags));
|
|
777
802
|
}
|
|
@@ -792,6 +817,7 @@ void UIManager::manageChildren(
|
|
|
792
817
|
addChildReactTags = std::move(addChildReactTags),
|
|
793
818
|
addAtIndices = std::move(addAtIndices),
|
|
794
819
|
removeAtIndices = std::move(removeAtIndices)]() mutable {
|
|
820
|
+
SystraceSection s("UIManager::manageChildren");
|
|
795
821
|
if (auto module = m.lock()) {
|
|
796
822
|
module->manageChildren(
|
|
797
823
|
static_cast<int64_t>(containerTag),
|
|
@@ -807,6 +833,7 @@ void UIManager::manageChildren(
|
|
|
807
833
|
void UIManager::setLayoutAnimationEnabledExperimental(bool enabled) noexcept {
|
|
808
834
|
m_batchingUIMessageQueue->runOnQueue(
|
|
809
835
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), enabled]() mutable {
|
|
836
|
+
SystraceSection s("UIManager::setLayoutAnimationEnabledExperimental");
|
|
810
837
|
if (auto module = m.lock()) {
|
|
811
838
|
module->setLayoutAnimationEnabledExperimental(enabled);
|
|
812
839
|
}
|
|
@@ -816,6 +843,7 @@ void UIManager::setLayoutAnimationEnabledExperimental(bool enabled) noexcept {
|
|
|
816
843
|
void UIManager::sendAccessibilityEvent(double reactTag, double eventType) noexcept {
|
|
817
844
|
m_batchingUIMessageQueue->runOnQueue(
|
|
818
845
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag, eventType]() mutable {
|
|
846
|
+
SystraceSection s("UIManager::sendAccessibilityEvent");
|
|
819
847
|
if (auto module = m.lock()) {
|
|
820
848
|
module->sendAccessibilityEvent(static_cast<int64_t>(reactTag), eventType);
|
|
821
849
|
}
|
|
@@ -832,6 +860,7 @@ void UIManager::showPopupMenu(
|
|
|
832
860
|
items = std::move(items),
|
|
833
861
|
error = std::move(error),
|
|
834
862
|
success = std::move(success)]() mutable {
|
|
863
|
+
SystraceSection s("UIManager::showPopupMenu");
|
|
835
864
|
if (auto module = m.lock()) {
|
|
836
865
|
module->showPopupMenu(static_cast<int64_t>(reactTag), std::move(items), std::move(error), std::move(success));
|
|
837
866
|
}
|
|
@@ -840,6 +869,7 @@ void UIManager::showPopupMenu(
|
|
|
840
869
|
|
|
841
870
|
void UIManager::dismissPopupMenu() noexcept {
|
|
842
871
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module)]() mutable {
|
|
872
|
+
SystraceSection s("UIManager::dismissPopupMenu");
|
|
843
873
|
if (auto module = m.lock()) {
|
|
844
874
|
module->dismissPopupMenu();
|
|
845
875
|
}
|