react-native-windows 0.69.6 → 0.70.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +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 +2 -2
- 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/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 +23 -4
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
- 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/NodeApiJsiRuntime.cpp +14 -2
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +7 -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/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/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 +14 -6
- 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 +27 -28
- 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
|
@@ -12,6 +12,7 @@ namespace Mso {
|
|
|
12
12
|
struct JSCallInvokerScheduler
|
|
13
13
|
: Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDispatchQueueScheduler, IJSCallInvokerQueueScheduler> {
|
|
14
14
|
JSCallInvokerScheduler(
|
|
15
|
+
const Mso::DispatchQueueSettings &settings,
|
|
15
16
|
std::shared_ptr<facebook::react::CallInvoker> &&callInvoker,
|
|
16
17
|
Mso::Functor<void(const Mso::ErrorCode &)> &&errorHandler,
|
|
17
18
|
Mso::Promise<void> &&whenQuit) noexcept;
|
|
@@ -45,12 +46,13 @@ std::shared_ptr<facebook::react::MessageQueueThread> JSCallInvokerScheduler::Get
|
|
|
45
46
|
//=============================================================================
|
|
46
47
|
|
|
47
48
|
JSCallInvokerScheduler::JSCallInvokerScheduler(
|
|
49
|
+
const Mso::DispatchQueueSettings &settings,
|
|
48
50
|
std::shared_ptr<facebook::react::CallInvoker> &&callInvoker,
|
|
49
51
|
Mso::Functor<void(const Mso::ErrorCode &)> &&errorHandler,
|
|
50
52
|
Mso::Promise<void> &&whenQuit) noexcept
|
|
51
53
|
: m_callInvoker(callInvoker) {
|
|
52
54
|
m_jsMessageThread = std::make_shared<Mso::React::MessageDispatchQueue>(
|
|
53
|
-
Mso::DispatchQueue::MakeLooperQueue(), std::move(errorHandler), std::move(whenQuit));
|
|
55
|
+
Mso::DispatchQueue::MakeLooperQueue(settings), std::move(errorHandler), std::move(whenQuit));
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
JSCallInvokerScheduler::~JSCallInvokerScheduler() noexcept {
|
|
@@ -91,11 +93,12 @@ void JSCallInvokerScheduler::AwaitTermination() noexcept {
|
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
Mso::CntPtr<IDispatchQueueScheduler> MakeJSCallInvokerScheduler(
|
|
96
|
+
const Mso::DispatchQueueSettings &settings,
|
|
94
97
|
std::shared_ptr<facebook::react::CallInvoker> &&callInvoker,
|
|
95
98
|
Mso::Functor<void(const Mso::ErrorCode &)> &&errorHandler,
|
|
96
99
|
Mso::Promise<void> &&whenQuit) noexcept {
|
|
97
100
|
return Mso::Make<JSCallInvokerScheduler, IDispatchQueueScheduler>(
|
|
98
|
-
std::move(callInvoker), std::move(errorHandler), std::move(whenQuit));
|
|
101
|
+
settings, std::move(callInvoker), std::move(errorHandler), std::move(whenQuit));
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
} // namespace Mso
|
|
@@ -19,6 +19,7 @@ struct IJSCallInvokerQueueScheduler : IUnknown {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
Mso::CntPtr<IDispatchQueueScheduler> MakeJSCallInvokerScheduler(
|
|
22
|
+
Mso::DispatchQueueSettings const &settings,
|
|
22
23
|
std::shared_ptr<facebook::react::CallInvoker> &&callInvoker,
|
|
23
24
|
Mso::Functor<void(const Mso::ErrorCode &)> &&errorHandler,
|
|
24
25
|
Mso::Promise<void> &&whenQuit = nullptr) noexcept;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
#include "MoveOnCopy.h"
|
|
6
6
|
#include "MsoUtils.h"
|
|
7
7
|
|
|
8
|
+
#include <AppModelHelpers.h>
|
|
8
9
|
#include <Base/CoreNativeModules.h>
|
|
9
10
|
#include <Threading/MessageDispatchQueue.h>
|
|
10
11
|
#include <Threading/MessageQueueThreadFactory.h>
|
|
11
12
|
#include <appModel.h>
|
|
12
13
|
#include <comUtil/qiCast.h>
|
|
13
|
-
|
|
14
14
|
#ifndef CORE_ABI
|
|
15
15
|
#include <XamlUIService.h>
|
|
16
16
|
#endif
|
|
@@ -132,7 +132,8 @@ struct BridgeUIBatchInstanceCallback final : public facebook::react::InstanceCal
|
|
|
132
132
|
virtual ~BridgeUIBatchInstanceCallback() = default;
|
|
133
133
|
void onBatchComplete() override {
|
|
134
134
|
if (auto instance = m_wkInstance.GetStrongPtr()) {
|
|
135
|
-
|
|
135
|
+
auto state = instance->State();
|
|
136
|
+
if (state != ReactInstanceState::HasError && state != ReactInstanceState::Unloaded) {
|
|
136
137
|
if (instance->UseWebDebugger()) {
|
|
137
138
|
// While using a CxxModule for UIManager (which we do when running under webdebugger)
|
|
138
139
|
// We need to post the batch complete to the NativeQueue to ensure that the UIManager
|
|
@@ -469,8 +470,7 @@ void ReactInstanceWin::Initialize() noexcept {
|
|
|
469
470
|
case JSIEngine::V8:
|
|
470
471
|
#if defined(USE_V8)
|
|
471
472
|
{
|
|
472
|
-
|
|
473
|
-
if (GetCurrentPackageFullName(&length, nullptr) != APPMODEL_ERROR_NO_PACKAGE) {
|
|
473
|
+
if (Microsoft::ReactNative::HasPackageIdentity()) {
|
|
474
474
|
preparedScriptStore =
|
|
475
475
|
std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationTempFolder());
|
|
476
476
|
} else {
|
|
@@ -679,7 +679,26 @@ ReactInstanceState ReactInstanceWin::State() const noexcept {
|
|
|
679
679
|
void ReactInstanceWin::InitJSMessageThread() noexcept {
|
|
680
680
|
m_instance.Exchange(std::make_shared<facebook::react::Instance>());
|
|
681
681
|
|
|
682
|
+
winrt::Microsoft::ReactNative::IReactNotificationService service = m_reactContext->Notifications();
|
|
683
|
+
Mso::DispatchQueueSettings queueSettings{};
|
|
684
|
+
queueSettings.TaskStarting = [service](Mso::DispatchQueue const &) noexcept {
|
|
685
|
+
service.SendNotification(
|
|
686
|
+
winrt::Microsoft::ReactNative::ReactDispatcherHelper::JSDispatcherTaskStartingEventName(), nullptr, nullptr);
|
|
687
|
+
};
|
|
688
|
+
queueSettings.IdleWaitStarting = [service](Mso::DispatchQueue const &) noexcept {
|
|
689
|
+
service.SendNotification(
|
|
690
|
+
winrt::Microsoft::ReactNative::ReactDispatcherHelper::JSDispatcherIdleWaitStartingEventName(),
|
|
691
|
+
nullptr,
|
|
692
|
+
nullptr);
|
|
693
|
+
};
|
|
694
|
+
queueSettings.IdleWaitCompleted = [service](Mso::DispatchQueue const &) noexcept {
|
|
695
|
+
service.SendNotification(
|
|
696
|
+
winrt::Microsoft::ReactNative::ReactDispatcherHelper::JSDispatcherIdleWaitCompletedEventName(),
|
|
697
|
+
nullptr,
|
|
698
|
+
nullptr);
|
|
699
|
+
};
|
|
682
700
|
auto scheduler = Mso::MakeJSCallInvokerScheduler(
|
|
701
|
+
queueSettings,
|
|
683
702
|
m_instance.Load()->getJSCallInvoker(),
|
|
684
703
|
Mso::MakeWeakMemberFunctor(this, &ReactInstanceWin::OnError),
|
|
685
704
|
Mso::Copy(m_whenDestroyed));
|
|
@@ -153,7 +153,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
153
153
|
const bool m_useDirectDebugger : 1;
|
|
154
154
|
const bool m_useWebDebugger : 1;
|
|
155
155
|
|
|
156
|
-
const Mso::CntPtr
|
|
156
|
+
const Mso::CntPtr<::Mso::React::ReactContext> m_reactContext;
|
|
157
157
|
|
|
158
158
|
std::atomic<bool> m_isLoaded{false};
|
|
159
159
|
std::atomic<bool> m_isDestroyed{false};
|
|
@@ -16,8 +16,18 @@ PointerEventKind ReactPointerEventArgs::Kind() const noexcept {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
void ReactPointerEventArgs::Kind(PointerEventKind kind) noexcept {
|
|
19
|
-
// The only event type
|
|
20
|
-
|
|
19
|
+
// The only event type transitions that are supported are:
|
|
20
|
+
// 1. PointerEventKind::CaptureLost to PointerEventKind::End to support cases
|
|
21
|
+
// where XAML firing the CaptureLost event should be treated as a gesture
|
|
22
|
+
// completion event, e.g., for pointer events in selectable text that do
|
|
23
|
+
// not result in text selection.
|
|
24
|
+
// 2. PointerEventKind::End to PointerEventKind::Cancel to support cases
|
|
25
|
+
// where a custom view manager implementing `IViewManagerWithPointerEvents`
|
|
26
|
+
// wants to cancel a gesture, e.g., for a custom drag handle where the end
|
|
27
|
+
// of the gesture should not be treated as a completed press event.
|
|
28
|
+
assert(
|
|
29
|
+
(kind == PointerEventKind::End && m_kind == PointerEventKind::CaptureLost) ||
|
|
30
|
+
(kind == PointerEventKind::Cancel && m_kind == PointerEventKind::End));
|
|
21
31
|
m_kind = kind;
|
|
22
32
|
}
|
|
23
33
|
|
|
@@ -31,7 +31,7 @@ namespace Microsoft::ReactNative {
|
|
|
31
31
|
// Instead of deduce view id directly from FrameworkElement.Tag, this do
|
|
32
32
|
// additional check by uimanager.
|
|
33
33
|
ReactId getViewId(const Mso::React::IReactContext &context, xaml::FrameworkElement const &fe) {
|
|
34
|
-
ReactId reactId;
|
|
34
|
+
ReactId reactId{};
|
|
35
35
|
if (auto uiManager = Microsoft::ReactNative::GetNativeUIManager(context).lock()) {
|
|
36
36
|
if (auto peer = uiManager->reactPeerOrContainerFrom(fe)) {
|
|
37
37
|
reactId.isValid = true;
|
|
@@ -149,10 +149,10 @@ bool TryUpdateForeground(
|
|
|
149
149
|
}
|
|
150
150
|
} else if (propertyValue.IsNull()) {
|
|
151
151
|
element.ClearValue(T::ForegroundProperty());
|
|
152
|
-
UpdateControlForegroundResourceBrushes(element, nullptr);
|
|
153
152
|
if (uielement) {
|
|
154
153
|
uielement.HighContrastAdjustment(xaml::ElementHighContrastAdjustment::Application);
|
|
155
154
|
}
|
|
155
|
+
UpdateControlForegroundResourceBrushes(element, nullptr);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
return true;
|
|
@@ -133,7 +133,6 @@ struct BrushCache {
|
|
|
133
133
|
|
|
134
134
|
assert(false && "Resource is not a Color or Brush");
|
|
135
135
|
return xaml::Media::SolidColorBrush(winrt::Colors::Transparent());
|
|
136
|
-
;
|
|
137
136
|
}
|
|
138
137
|
|
|
139
138
|
xaml::Media::Brush RegisterBrush(winrt::hstring resourceName, const xaml::Media::Brush &brush) {
|
|
@@ -312,13 +312,15 @@ winrt::hstring DynamicAutomationPeer::GetContentName() const {
|
|
|
312
312
|
|
|
313
313
|
try {
|
|
314
314
|
if (auto const &viewControl = Owner().try_as<winrt::Microsoft::ReactNative::ViewControl>()) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
315
|
+
// It's possible that the ViewPanel is null, perhaps when this is invoked around the same time
|
|
316
|
+
// that a View is being unmounted, causing a fast fail for EXCEPTION_ACCESS_VIOLATION_READ.
|
|
317
|
+
if (auto viewPanel = viewControl.GetPanel()) {
|
|
318
|
+
for (auto const &child : viewPanel.Children()) {
|
|
319
|
+
if (auto const &textBlock = child.try_as<winrt::TextBlock>()) {
|
|
320
|
+
name = name.empty() ? textBlock.Text() : (L" " + name + textBlock.Text());
|
|
321
|
+
} else if (auto const &stringableName = child.try_as<winrt::IStringable>()) {
|
|
322
|
+
name = (name.empty() ? L"" : L" ") + name + stringableName.ToString();
|
|
323
|
+
}
|
|
322
324
|
}
|
|
323
325
|
}
|
|
324
326
|
}
|
|
@@ -179,7 +179,7 @@ xaml::DependencyProperty DynamicAutomationProperties::AccessibilityValueMinPrope
|
|
|
179
179
|
L"AccessibilityValueMin",
|
|
180
180
|
winrt::xaml_typename<double>(),
|
|
181
181
|
dynamicAutomationTypeName,
|
|
182
|
-
winrt::PropertyMetadata(winrt::box_value(0)));
|
|
182
|
+
winrt::PropertyMetadata(winrt::box_value(0.0)));
|
|
183
183
|
|
|
184
184
|
return s_AccessibilityValueMinProperty;
|
|
185
185
|
}
|
|
@@ -197,7 +197,7 @@ xaml::DependencyProperty DynamicAutomationProperties::AccessibilityValueMaxPrope
|
|
|
197
197
|
L"AccessibilityValueMax",
|
|
198
198
|
winrt::xaml_typename<double>(),
|
|
199
199
|
dynamicAutomationTypeName,
|
|
200
|
-
winrt::PropertyMetadata(winrt::box_value(0)));
|
|
200
|
+
winrt::PropertyMetadata(winrt::box_value(0.0)));
|
|
201
201
|
|
|
202
202
|
return s_AccessibilityValueMaxProperty;
|
|
203
203
|
}
|
|
@@ -215,7 +215,7 @@ xaml::DependencyProperty DynamicAutomationProperties::AccessibilityValueNowPrope
|
|
|
215
215
|
L"AccessibilityValueNow",
|
|
216
216
|
winrt::xaml_typename<double>(),
|
|
217
217
|
dynamicAutomationTypeName,
|
|
218
|
-
winrt::PropertyMetadata(winrt::box_value(0)));
|
|
218
|
+
winrt::PropertyMetadata(winrt::box_value(0.0)));
|
|
219
219
|
|
|
220
220
|
return s_AccessibilityValueNowProperty;
|
|
221
221
|
}
|
|
@@ -122,6 +122,7 @@ class FlyoutShadowNode : public ShadowNodeBase {
|
|
|
122
122
|
winrt::Popup GetFlyoutParentPopup() const;
|
|
123
123
|
winrt::FlyoutPresenter GetFlyoutPresenter() const;
|
|
124
124
|
void OnShowFlyout();
|
|
125
|
+
void LogErrorAndClose(const string &error);
|
|
125
126
|
xaml::FrameworkElement m_targetElement = nullptr;
|
|
126
127
|
winrt::Flyout m_flyout = nullptr;
|
|
127
128
|
bool m_isLightDismissEnabled = true;
|
|
@@ -404,7 +405,13 @@ winrt::Flyout FlyoutShadowNode::GetFlyout() {
|
|
|
404
405
|
void FlyoutShadowNode::OnShowFlyout() {
|
|
405
406
|
AdjustDefaultFlyoutStyle(50000, 50000);
|
|
406
407
|
if (m_isFlyoutShowOptionsSupported) {
|
|
407
|
-
|
|
408
|
+
if (!m_targetElement && m_targetTag > 0) {
|
|
409
|
+
LogErrorAndClose("The target view unmounted before flyout could be shown.");
|
|
410
|
+
} else if (m_targetElement && m_flyout.XamlRoot() != m_targetElement.XamlRoot()) {
|
|
411
|
+
LogErrorAndClose("The target view window lost focus before flyout could be shown.");
|
|
412
|
+
} else {
|
|
413
|
+
m_flyout.ShowAt(m_targetElement, m_showOptions);
|
|
414
|
+
}
|
|
408
415
|
} else {
|
|
409
416
|
winrt::FlyoutBase::ShowAttachedFlyout(m_targetElement);
|
|
410
417
|
}
|
|
@@ -414,6 +421,11 @@ void FlyoutShadowNode::OnShowFlyout() {
|
|
|
414
421
|
}
|
|
415
422
|
}
|
|
416
423
|
|
|
424
|
+
void FlyoutShadowNode::LogErrorAndClose(const std::string &error) {
|
|
425
|
+
GetViewManager()->GetReactContext().CallJSFunction("RCTLog", "logToConsole", folly::dynamic::array("error", error));
|
|
426
|
+
OnFlyoutClosed(GetViewManager()->GetReactContext(), m_tag, false);
|
|
427
|
+
}
|
|
428
|
+
|
|
417
429
|
void FlyoutShadowNode::SetTargetFrameworkElement() {
|
|
418
430
|
if (m_targetTag > 0) {
|
|
419
431
|
if (auto uiManager = GetNativeUIManager(GetViewManager()->GetReactContext()).lock()) {
|
|
@@ -17,7 +17,7 @@ void TransferProperty(
|
|
|
17
17
|
xaml::DependencyProperty oldViewDP,
|
|
18
18
|
xaml::DependencyProperty newViewDP) {
|
|
19
19
|
auto oldValue = oldView.ReadLocalValue(oldViewDP);
|
|
20
|
-
if (oldValue !=
|
|
20
|
+
if (oldValue != xaml::DependencyProperty::UnsetValue()) {
|
|
21
21
|
oldView.ClearValue(oldViewDP);
|
|
22
22
|
newView.SetValue(newViewDP, oldValue);
|
|
23
23
|
}
|
|
@@ -93,8 +93,8 @@ static void GetAccessibilityStateProps(const winrt::Microsoft::ReactNative::IJSV
|
|
|
93
93
|
|
|
94
94
|
static void GetAccessibilityValueProps(const winrt::Microsoft::ReactNative::IJSValueWriter &writer) {
|
|
95
95
|
writer.WriteObjectBegin();
|
|
96
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"min", L"
|
|
97
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"max", L"
|
|
96
|
+
winrt::Microsoft::ReactNative::WriteProperty(writer, L"min", L"number");
|
|
97
|
+
winrt::Microsoft::ReactNative::WriteProperty(writer, L"max", L"number");
|
|
98
98
|
winrt::Microsoft::ReactNative::WriteProperty(writer, L"now", L"number");
|
|
99
99
|
winrt::Microsoft::ReactNative::WriteProperty(writer, L"text", L"string");
|
|
100
100
|
writer.WriteObjectEnd();
|
|
@@ -235,12 +235,12 @@ bool FrameworkElementViewManager::UpdateProperty(
|
|
|
235
235
|
MultiplyInto(
|
|
236
236
|
transformMatrix,
|
|
237
237
|
winrt::Windows::Foundation::Numerics::float4x4(
|
|
238
|
-
winrt::Windows::Foundation::Numerics::make_float3x2_skew(innerValue
|
|
238
|
+
winrt::Windows::Foundation::Numerics::make_float3x2_skew(ToRadians(innerValue), 0.f)));
|
|
239
239
|
} else if (transformType == "skewY") {
|
|
240
240
|
MultiplyInto(
|
|
241
241
|
transformMatrix,
|
|
242
242
|
winrt::Windows::Foundation::Numerics::float4x4(
|
|
243
|
-
winrt::Windows::Foundation::Numerics::make_float3x2_skew(0.f, innerValue
|
|
243
|
+
winrt::Windows::Foundation::Numerics::make_float3x2_skew(0.f, ToRadians(innerValue))));
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
@@ -526,29 +526,79 @@ bool FrameworkElementViewManager::UpdateProperty(
|
|
|
526
526
|
DynamicAutomationProperties::SetAccessibilityStateCollapsed(
|
|
527
527
|
element, states[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityStates::Collapsed)]);
|
|
528
528
|
} else if (propertyName == "accessibilityValue") {
|
|
529
|
+
winrt::hstring textValue;
|
|
530
|
+
const int numericValuesCount = 3;
|
|
531
|
+
double numericValues[numericValuesCount] = {};
|
|
532
|
+
|
|
529
533
|
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Object) {
|
|
530
534
|
for (const auto &pair : propertyValue.AsObject()) {
|
|
531
535
|
const std::string &innerName = pair.first;
|
|
532
536
|
const auto &innerValue = pair.second;
|
|
533
537
|
|
|
538
|
+
auto peer = xaml::Automation::Peers::FrameworkElementAutomationPeer::FromElement(element);
|
|
539
|
+
|
|
534
540
|
if (innerName == "min" &&
|
|
535
541
|
(innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
536
542
|
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64)) {
|
|
537
|
-
|
|
543
|
+
numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Min)] =
|
|
544
|
+
innerValue.AsDouble();
|
|
545
|
+
|
|
546
|
+
const auto prevMinValue = DynamicAutomationProperties::GetAccessibilityValueMin(element);
|
|
547
|
+
if (peer != nullptr && prevMinValue != innerValue.AsDouble()) {
|
|
548
|
+
peer.RaisePropertyChangedEvent(
|
|
549
|
+
winrt::RangeValuePatternIdentifiers::MinimumProperty(),
|
|
550
|
+
winrt::box_value(prevMinValue),
|
|
551
|
+
winrt::box_value(innerValue.AsDouble()));
|
|
552
|
+
}
|
|
538
553
|
} else if (
|
|
539
|
-
innerName == "max" &&
|
|
540
|
-
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::
|
|
541
|
-
|
|
554
|
+
innerName == "max" &&
|
|
555
|
+
(innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
556
|
+
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64)) {
|
|
557
|
+
numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Max)] =
|
|
558
|
+
innerValue.AsDouble();
|
|
559
|
+
|
|
560
|
+
const auto prevMaxValue = DynamicAutomationProperties::GetAccessibilityValueMax(element);
|
|
561
|
+
if (peer != nullptr && prevMaxValue != innerValue.AsDouble()) {
|
|
562
|
+
peer.RaisePropertyChangedEvent(
|
|
563
|
+
winrt::RangeValuePatternIdentifiers::MaximumProperty(),
|
|
564
|
+
winrt::box_value(prevMaxValue),
|
|
565
|
+
winrt::box_value(innerValue.AsDouble()));
|
|
566
|
+
}
|
|
542
567
|
} else if (
|
|
543
|
-
innerName == "now" &&
|
|
544
|
-
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::
|
|
545
|
-
|
|
568
|
+
innerName == "now" &&
|
|
569
|
+
(innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
570
|
+
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64)) {
|
|
571
|
+
numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Now)] =
|
|
572
|
+
innerValue.AsDouble();
|
|
573
|
+
|
|
574
|
+
const auto prevNowValue = DynamicAutomationProperties::GetAccessibilityValueNow(element);
|
|
575
|
+
if (peer != nullptr && prevNowValue != innerValue.AsDouble()) {
|
|
576
|
+
peer.RaisePropertyChangedEvent(
|
|
577
|
+
winrt::RangeValuePatternIdentifiers::ValueProperty(),
|
|
578
|
+
winrt::box_value(prevNowValue),
|
|
579
|
+
winrt::box_value(innerValue.AsDouble()));
|
|
580
|
+
}
|
|
546
581
|
} else if (innerName == "text" && innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
547
|
-
|
|
548
|
-
|
|
582
|
+
textValue = asHstring(innerValue);
|
|
583
|
+
|
|
584
|
+
const auto prevTextValue = DynamicAutomationProperties::GetAccessibilityValueText(element);
|
|
585
|
+
if (peer != nullptr && prevTextValue != textValue) {
|
|
586
|
+
peer.RaisePropertyChangedEvent(
|
|
587
|
+
winrt::ValuePatternIdentifiers::ValueProperty(),
|
|
588
|
+
winrt::box_value(prevTextValue),
|
|
589
|
+
winrt::box_value(textValue));
|
|
590
|
+
}
|
|
549
591
|
}
|
|
550
592
|
}
|
|
551
593
|
}
|
|
594
|
+
|
|
595
|
+
DynamicAutomationProperties::SetAccessibilityValueMin(
|
|
596
|
+
element, numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Min)]);
|
|
597
|
+
DynamicAutomationProperties::SetAccessibilityValueMax(
|
|
598
|
+
element, numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Max)]);
|
|
599
|
+
DynamicAutomationProperties::SetAccessibilityValueNow(
|
|
600
|
+
element, numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Now)]);
|
|
601
|
+
DynamicAutomationProperties::SetAccessibilityValueText(element, textValue);
|
|
552
602
|
} else if (propertyName == "testID") {
|
|
553
603
|
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
554
604
|
auto value = asHstring(propertyValue);
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
#include <IReactInstance.h>
|
|
15
15
|
#include <Utils/PropertyHandlerUtils.h>
|
|
16
16
|
#include <Utils/PropertyUtils.h>
|
|
17
|
+
#include <Views/DynamicAutomationProperties.h>
|
|
17
18
|
#include <Views/ShadowNodeBase.h>
|
|
18
|
-
#include "DynamicAutomationProperties.h"
|
|
19
19
|
#include "ReactImage.h"
|
|
20
20
|
|
|
21
21
|
namespace winrt {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#include <winrt/Windows.Web.Http.h>
|
|
14
14
|
|
|
15
15
|
#include <Utils/ValueUtils.h>
|
|
16
|
-
#include
|
|
16
|
+
#include <Views/DynamicAutomationPeer.h>
|
|
17
17
|
#include "Unicode.h"
|
|
18
18
|
#include "XamlView.h"
|
|
19
19
|
#include "cdebug.h"
|
|
@@ -171,8 +171,7 @@ void ReactImage::Source(ReactImageSource source) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
winrt::IAsyncOperation<winrt::
|
|
175
|
-
ReactImageSource source) {
|
|
174
|
+
winrt::IAsyncOperation<winrt::IRandomAccessStream> ReactImage::GetImageMemoryStreamAsync(ReactImageSource source) {
|
|
176
175
|
switch (source.sourceType) {
|
|
177
176
|
case ImageSourceType::Download:
|
|
178
177
|
co_return co_await GetImageStreamAsync(source);
|
|
@@ -223,7 +222,7 @@ winrt::fire_and_forget ReactImage::SetBackground(bool fireLoadEndEvent) {
|
|
|
223
222
|
const bool fromStream{
|
|
224
223
|
source.sourceType == ImageSourceType::Download || source.sourceType == ImageSourceType::InlineData};
|
|
225
224
|
|
|
226
|
-
winrt::
|
|
225
|
+
winrt::IRandomAccessStream memoryStream{nullptr};
|
|
227
226
|
|
|
228
227
|
// get weak reference before any co_await calls
|
|
229
228
|
auto weak_this{get_weak()};
|
|
@@ -443,7 +442,7 @@ winrt::fire_and_forget ReactImage::SetBackground(bool fireLoadEndEvent) {
|
|
|
443
442
|
}
|
|
444
443
|
}
|
|
445
444
|
|
|
446
|
-
winrt::IAsyncOperation<winrt::
|
|
445
|
+
winrt::IAsyncOperation<winrt::IRandomAccessStream> GetImageStreamAsync(ReactImageSource source) {
|
|
447
446
|
try {
|
|
448
447
|
co_await winrt::resume_background();
|
|
449
448
|
|
|
@@ -480,7 +479,7 @@ winrt::IAsyncOperation<winrt::InMemoryRandomAccessStream> GetImageStreamAsync(Re
|
|
|
480
479
|
co_return nullptr;
|
|
481
480
|
}
|
|
482
481
|
|
|
483
|
-
winrt::IAsyncOperation<winrt::
|
|
482
|
+
winrt::IAsyncOperation<winrt::IRandomAccessStream> GetImageInlineDataAsync(ReactImageSource source) {
|
|
484
483
|
size_t start = source.uri.find(',');
|
|
485
484
|
if (start == std::string::npos || start + 1 > source.uri.length())
|
|
486
485
|
co_return nullptr;
|
|
@@ -69,7 +69,7 @@ struct ReactImage : xaml::Controls::GridT<ReactImage> {
|
|
|
69
69
|
private:
|
|
70
70
|
xaml::Media::Stretch ResizeModeToStretch();
|
|
71
71
|
xaml::Media::Stretch ResizeModeToStretch(winrt::Windows::Foundation::Size size);
|
|
72
|
-
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::
|
|
72
|
+
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IRandomAccessStream>
|
|
73
73
|
GetImageMemoryStreamAsync(ReactImageSource source);
|
|
74
74
|
winrt::fire_and_forget SetBackground(bool fireLoadEndEvent);
|
|
75
75
|
|
|
@@ -91,8 +91,8 @@ struct ReactImage : xaml::Controls::GridT<ReactImage> {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
// Helper functions
|
|
94
|
-
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::
|
|
95
|
-
|
|
96
|
-
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::
|
|
94
|
+
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IRandomAccessStream> GetImageStreamAsync(
|
|
95
|
+
ReactImageSource source);
|
|
96
|
+
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IRandomAccessStream>
|
|
97
97
|
GetImageInlineDataAsync(ReactImageSource source);
|
|
98
98
|
} // namespace Microsoft::ReactNative
|
|
@@ -12,7 +12,7 @@ class TextTransformParentVisitor : public TextParentVisitor {
|
|
|
12
12
|
using Super = TextParentVisitor;
|
|
13
13
|
|
|
14
14
|
public:
|
|
15
|
-
TextTransform textTransform;
|
|
15
|
+
TextTransform textTransform{TextTransform::Undefined};
|
|
16
16
|
|
|
17
17
|
protected:
|
|
18
18
|
void VisitText(ShadowNodeBase *node) override;
|
|
@@ -513,6 +513,13 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
|
|
|
513
513
|
m_hideCaret = propertyValue.AsBoolean();
|
|
514
514
|
HideCaretIfNeeded();
|
|
515
515
|
}
|
|
516
|
+
} else if (propertyName == "focusable") {
|
|
517
|
+
// parent class also sets isTabStop
|
|
518
|
+
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
|
|
519
|
+
control.IsEnabled(propertyValue.AsBoolean());
|
|
520
|
+
} else if (propertyValue.IsNull()) {
|
|
521
|
+
control.ClearValue(xaml::Controls::Control::IsEnabledProperty());
|
|
522
|
+
}
|
|
516
523
|
} else if (propertyName == "secureTextEntry") {
|
|
517
524
|
markDirty = true;
|
|
518
525
|
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
|
|
@@ -887,7 +894,13 @@ void TextInputViewManager::TransferProperties(const XamlView &oldView, const Xam
|
|
|
887
894
|
xaml::Controls::TextBox::SelectionHighlightColorProperty(),
|
|
888
895
|
xaml::Controls::PasswordBox::SelectionHighlightColorProperty());
|
|
889
896
|
newView.as<xaml::Controls::PasswordBox>().Password(oldView.as<xaml::Controls::TextBox>().Text());
|
|
890
|
-
|
|
897
|
+
// Since both focasable/editable affect isEnabled for PasswordBox, if the oldView is enabled we still need to
|
|
898
|
+
// check isReadOnly
|
|
899
|
+
if (oldView.as<xaml::Controls::TextBox>().IsEnabled()) {
|
|
900
|
+
newView.as<xaml::Controls::PasswordBox>().IsEnabled(!oldView.as<xaml::Controls::TextBox>().IsReadOnly());
|
|
901
|
+
} else {
|
|
902
|
+
newView.as<xaml::Controls::PasswordBox>().IsEnabled(oldView.as<xaml::Controls::TextBox>().IsEnabled());
|
|
903
|
+
}
|
|
891
904
|
} else {
|
|
892
905
|
TransferProperty(
|
|
893
906
|
oldView,
|
|
@@ -905,7 +918,13 @@ void TextInputViewManager::TransferProperties(const XamlView &oldView, const Xam
|
|
|
905
918
|
xaml::Controls::PasswordBox::SelectionHighlightColorProperty(),
|
|
906
919
|
xaml::Controls::TextBox::SelectionHighlightColorProperty());
|
|
907
920
|
newView.as<xaml::Controls::TextBox>().Text(oldView.as<xaml::Controls::PasswordBox>().Password());
|
|
908
|
-
|
|
921
|
+
// Since both focasable/editable affect isEnabled for PasswordBox, if the oldView is enabled we still need to
|
|
922
|
+
// check isReadOnly
|
|
923
|
+
if (oldView.as<xaml::Controls::PasswordBox>().IsEnabled()) {
|
|
924
|
+
newView.as<xaml::Controls::TextBox>().IsReadOnly(!oldView.as<xaml::Controls::PasswordBox>().IsEnabled());
|
|
925
|
+
} else {
|
|
926
|
+
newView.as<xaml::Controls::TextBox>().IsEnabled(oldView.as<xaml::Controls::PasswordBox>().IsEnabled());
|
|
927
|
+
}
|
|
909
928
|
}
|
|
910
929
|
|
|
911
930
|
TransferInputScope(oldView, newView, copyToPasswordBox);
|
|
@@ -67,7 +67,8 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
auto addInline = true;
|
|
70
|
-
|
|
70
|
+
// Only convert to fast text when exactly one child is attached to the root Text node
|
|
71
|
+
if (index == 0 && m_children.size() == 1) {
|
|
71
72
|
auto run = childNode.GetView().try_as<winrt::Run>();
|
|
72
73
|
if (run != nullptr) {
|
|
73
74
|
m_firstChildNode = &child;
|
|
@@ -75,7 +76,8 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
75
76
|
textBlock.Text(run.Text());
|
|
76
77
|
addInline = false;
|
|
77
78
|
}
|
|
78
|
-
} else if (
|
|
79
|
+
} else if (m_firstChildNode != nullptr) {
|
|
80
|
+
assert(m_children.size() == 2);
|
|
79
81
|
auto textBlock = this->GetView().as<xaml::Controls::TextBlock>();
|
|
80
82
|
textBlock.ClearValue(xaml::Controls::TextBlock::TextProperty());
|
|
81
83
|
Super::AddView(*m_firstChildNode, 0);
|
|
@@ -101,7 +103,8 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
void RemoveChildAt(int64_t indexToRemove) override {
|
|
104
|
-
if (
|
|
106
|
+
if (m_firstChildNode) {
|
|
107
|
+
assert(indexToRemove == 0);
|
|
105
108
|
auto textBlock = this->GetView().as<xaml::Controls::TextBlock>();
|
|
106
109
|
textBlock.ClearValue(xaml::Controls::TextBlock::TextProperty());
|
|
107
110
|
m_firstChildNode = nullptr;
|
|
@@ -240,7 +240,7 @@ TouchEventHandler::ReactPointer TouchEventHandler::CreateReactPointer(
|
|
|
240
240
|
auto point = args.GetCurrentPoint(sourceElement);
|
|
241
241
|
auto props = point.Properties();
|
|
242
242
|
|
|
243
|
-
ReactPointer pointer;
|
|
243
|
+
ReactPointer pointer{};
|
|
244
244
|
pointer.target = tag;
|
|
245
245
|
pointer.identifier = m_touchId++;
|
|
246
246
|
pointer.pointerId = point.PointerId();
|
|
@@ -19,11 +19,14 @@
|
|
|
19
19
|
#include <Utils/PropertyUtils.h>
|
|
20
20
|
#include <Views/ExpressionAnimationStore.h>
|
|
21
21
|
#include <Views/ShadowNodeBase.h>
|
|
22
|
+
#include <cxxreact/SystraceSection.h>
|
|
22
23
|
|
|
23
24
|
namespace winrt {
|
|
24
25
|
using namespace xaml;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
using namespace facebook::react;
|
|
29
|
+
|
|
27
30
|
namespace Microsoft::ReactNative {
|
|
28
31
|
|
|
29
32
|
static const std::unordered_map<std::string, PointerEventsKind> pointerEventsMap = {
|
|
@@ -248,7 +251,10 @@ void ViewManagerBase::UpdateProperties(
|
|
|
248
251
|
}
|
|
249
252
|
}
|
|
250
253
|
|
|
251
|
-
|
|
254
|
+
{
|
|
255
|
+
SystraceSection s("ViewManagerBase::OnPropertiesUpdated");
|
|
256
|
+
OnPropertiesUpdated(nodeToUpdate);
|
|
257
|
+
}
|
|
252
258
|
}
|
|
253
259
|
|
|
254
260
|
bool ViewManagerBase::UpdateProperty(
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#include <UI.Xaml.Media.h>
|
|
10
10
|
#include <Utils/PropertyUtils.h>
|
|
11
11
|
#include <Utils/ResourceBrushUtils.h>
|
|
12
|
+
#include <cxxreact/SystraceSection.h>
|
|
12
13
|
#include <winrt/Windows.Foundation.h>
|
|
13
14
|
#include <winrt/Windows.UI.Xaml.Interop.h>
|
|
14
15
|
|
|
@@ -28,6 +29,8 @@ using namespace xaml::Media;
|
|
|
28
29
|
using namespace Windows::Foundation;
|
|
29
30
|
} // namespace winrt
|
|
30
31
|
|
|
32
|
+
using namespace facebook::react;
|
|
33
|
+
|
|
31
34
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
32
35
|
|
|
33
36
|
const winrt::TypeName viewPanelTypeName{winrt::hstring{L"ViewPanel"}, winrt::TypeKind::Metadata};
|
|
@@ -227,6 +230,7 @@ void ViewPanel::ClipChildren(bool value) {
|
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
void ViewPanel::FinalizeProperties() {
|
|
233
|
+
SystraceSection s("ViewPanel::FinalizeProperties");
|
|
230
234
|
if (!m_propertiesChanged)
|
|
231
235
|
return;
|
|
232
236
|
|