react-native-windows 0.81.1 → 0.82.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 +11 -10
- package/Directory.Build.props +3 -3
- package/Folly/Folly.vcxproj +1 -3
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -3
- package/Libraries/Alert/RCTAlertManager.android.js +4 -2
- package/Libraries/Animated/Animated.d.ts +2 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedExports.js.flow +1 -0
- package/Libraries/Animated/AnimatedImplementation.js +4 -2
- package/Libraries/Animated/AnimatedMock.js +1 -1
- package/Libraries/Animated/Easing.js +2 -0
- package/Libraries/Animated/NativeAnimatedAllowlist.js +1 -0
- package/Libraries/Animated/animations/Animation.js +19 -20
- package/Libraries/Animated/animations/TimingAnimation.js +2 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +9 -9
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +14 -7
- package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
- package/Libraries/Animated/nodes/AnimatedProps.js +32 -32
- package/Libraries/Animated/nodes/AnimatedStyle.js +23 -21
- package/Libraries/Animated/nodes/AnimatedTransform.js +6 -6
- package/Libraries/Animated/nodes/AnimatedValue.js +18 -18
- package/Libraries/AppState/AppState.js +8 -4
- package/Libraries/BatchedBridge/MessageQueue.js +4 -0
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/BlobManager.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +2 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +2 -2
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.windows.js +1 -1
- package/Libraries/Components/Flyout/FlyoutNativeComponent.js +2 -2
- package/Libraries/Components/Glyph/GlyphNativeComponent.js +1 -1
- package/Libraries/Components/Popup/PopupNativeComponent.js +1 -0
- package/Libraries/Components/Pressable/Pressable.d.ts +8 -0
- package/Libraries/Components/Pressable/Pressable.js +10 -1
- package/Libraries/Components/Pressable/Pressable.windows.js +30 -2
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +13 -4
- package/Libraries/Components/ScrollView/ScrollView.windows.js +14 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +2 -2
- package/Libraries/Components/Switch/Switch.js +2 -2
- package/Libraries/Components/Switch/Switch.windows.js +2 -2
- package/Libraries/Components/TextInput/TextInput.flow.js +12 -5
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +12 -5
- package/Libraries/Components/TextInput/TextInput.js +14 -5
- package/Libraries/Components/TextInput/TextInput.windows.js +23 -11
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.windows.js +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +1 -1
- package/Libraries/Components/View/View.js +81 -167
- package/Libraries/Components/View/View.windows.js +202 -302
- package/Libraries/Core/Devtools/loadBundleFromServer.js +1 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +4 -2
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +37 -10
- package/Libraries/Core/Timers/JSTimers.js +3 -1
- package/Libraries/Core/Timers/immediateShim.js +1 -1
- package/Libraries/Core/Timers/queueMicrotask.js +1 -0
- package/Libraries/Core/setUpPerformance.js +2 -1
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +5 -3
- package/Libraries/Image/AssetSourceResolver.windows.js +2 -2
- package/Libraries/Image/Image.android.js +327 -111
- package/Libraries/Image/Image.ios.js +6 -1
- package/Libraries/Image/Image.windows.js +28 -61
- package/Libraries/Image/ImageSourceUtils.js +8 -2
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Image/resolveAssetSource.windows.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +118 -167
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
- package/Libraries/Lists/FlatList.js +5 -6
- package/Libraries/LogBox/Data/LogBoxData.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -1
- package/Libraries/Modal/Modal.js +3 -3
- package/Libraries/Modal/Modal.windows.js +2 -2
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/NativeComponent/ViewConfig.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +20 -5
- package/Libraries/Network/convertRequestBody.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +10 -9
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.windows.js +5 -5
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +2 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
- package/Libraries/ReactNative/PaperUIManager.windows.js +4 -4
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +3 -3
- package/Libraries/ReactNative/RendererImplementation.js +116 -116
- package/Libraries/ReactNative/UIManager.js +3 -3
- package/Libraries/ReactNative/renderApplication.js +1 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Share/Share.js +4 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.windows.js +2 -0
- package/Libraries/StyleSheet/StyleSheet.d.ts +7 -22
- package/Libraries/StyleSheet/StyleSheetExports.js +2 -8
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +11 -18
- package/Libraries/StyleSheet/flattenStyle.js +2 -2
- package/Libraries/StyleSheet/processAspectRatio.js +2 -0
- package/Libraries/StyleSheet/processFilter.js +5 -5
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -2
- package/Libraries/Text/Text.js +534 -234
- package/Libraries/Text/Text.windows.js +622 -265
- package/Libraries/Text/TextNativeComponent.js +2 -2
- package/Libraries/Utilities/Appearance.d.ts +3 -5
- package/Libraries/Utilities/Appearance.js +5 -17
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/Platform.android.js +3 -3
- package/Libraries/Utilities/Platform.d.ts +1 -0
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.windows.js +3 -3
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +12 -0
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +32 -0
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +2 -0
- package/Libraries/promiseRejectionTrackingOptions.js +17 -31
- package/Libraries/vendor/emitter/EventEmitter.js +1 -1
- package/Microsoft.ReactNative/App.xaml +5 -0
- package/Microsoft.ReactNative/Base/CxxReactIncludes.h +0 -3
- package/Microsoft.ReactNative/CompositionContext.idl +0 -2
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/AbiViewProps.h +0 -2
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +26 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +0 -69
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -15
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.cpp +2 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.h +1 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +0 -31
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.h +0 -10
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper_emptyimpl.cpp +0 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +65 -32
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +9 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +8 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHelpers.h +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +0 -9
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +2 -11
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +0 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp +4 -7
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h +1 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +68 -53
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h +1 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +20 -18
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +10 -3
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +30 -9
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +3 -2
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +550 -4
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +16 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +53 -2
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +8 -1
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +6 -30
- package/Microsoft.ReactNative/Fabric/Composition/Theme.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +36 -14
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +0 -4
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +1 -1
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +8 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.h +3 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +0 -11
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +2 -1
- package/Microsoft.ReactNative/IReactContext.cpp +2 -25
- package/Microsoft.ReactNative/IReactContext.h +0 -7
- package/Microsoft.ReactNative/IReactContext.idl +4 -29
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +24 -140
- package/Microsoft.ReactNative/IReactModuleBuilder.h +0 -11
- package/Microsoft.ReactNative/IReactPackageBuilder.idl +1 -16
- package/Microsoft.ReactNative/IReactPackageProvider.idl +0 -1
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +10 -0
- package/Microsoft.ReactNative/JsiApi.cpp +4 -3
- package/Microsoft.ReactNative/JsiApi.h +2 -3
- package/Microsoft.ReactNative/JsiApi.idl +3 -2
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +6 -214
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +0 -252
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +0 -37
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +2 -140
- package/Microsoft.ReactNative/Modules/AlertModule.h +0 -2
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +5 -10
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.h +0 -1
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +1 -96
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +0 -14
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +0 -53
- package/Microsoft.ReactNative/Modules/AppStateModule.h +0 -5
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.cpp +5 -14
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +0 -2
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -9
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +0 -4
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +0 -2
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +16 -90
- package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +3 -8
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +11 -48
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +0 -3
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +30 -102
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +0 -7
- package/Microsoft.ReactNative/Modules/Timing.cpp +7 -9
- package/Microsoft.ReactNative/Pch/pch.h +0 -28
- package/Microsoft.ReactNative/ReactCoreInjection.h +0 -1
- package/Microsoft.ReactNative/ReactHost/IReactInstance.h +0 -8
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -15
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -2
- package/Microsoft.ReactNative/ReactHost/React.h +0 -44
- package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +10 -47
- package/Microsoft.ReactNative/ReactHost/ReactHost.h +1 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +30 -586
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +2 -37
- package/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +0 -13
- package/Microsoft.ReactNative/ReactHost/React_Win.h +0 -1
- package/Microsoft.ReactNative/ReactInstanceSettings.cpp +0 -8
- package/Microsoft.ReactNative/ReactInstanceSettings.h +0 -13
- package/Microsoft.ReactNative/ReactInstanceSettings.idl +7 -23
- package/Microsoft.ReactNative/ReactNativeHost.cpp +10 -35
- package/Microsoft.ReactNative/ReactNativeHost.h +0 -1
- package/Microsoft.ReactNative/ReactNativeIsland.idl +0 -4
- package/Microsoft.ReactNative/ReactPackageBuilder.cpp +9 -36
- package/Microsoft.ReactNative/ReactPackageBuilder.h +4 -38
- package/Microsoft.ReactNative/RedBox.cpp +9 -362
- package/Microsoft.ReactNative/Theme.idl +0 -2
- package/Microsoft.ReactNative/Timer.cpp +3 -2
- package/Microsoft.ReactNative/Utils/Helpers.cpp +0 -47
- package/Microsoft.ReactNative/Utils/Helpers.h +0 -5
- package/Microsoft.ReactNative/Utils/IcuUtils.cpp +84 -0
- package/Microsoft.ReactNative/Utils/IcuUtils.h +42 -0
- package/Microsoft.ReactNative/Utils/KeyboardUtils.cpp +0 -11
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +0 -4
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +1 -5
- package/Microsoft.ReactNative/Utils/UwpPreparedScriptStore.h +0 -2
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +0 -245
- package/Microsoft.ReactNative/Utils/ValueUtils.h +0 -23
- package/Microsoft.ReactNative/ViewProps.idl +0 -2
- package/Microsoft.ReactNative/Views/DevMenu.cpp +2 -278
- package/Microsoft.ReactNative/Views/DevMenu.h +0 -5
- package/Microsoft.ReactNative/XamlApplication.cpp +71 -0
- package/Microsoft.ReactNative/XamlApplication.h +47 -0
- package/Microsoft.ReactNative/XamlApplication.idl +19 -0
- package/Microsoft.ReactNative/XamlUIService.cpp +0 -54
- package/Microsoft.ReactNative/XamlUIService.h +0 -12
- package/Microsoft.ReactNative/XamlUIService.idl +0 -12
- package/Microsoft.ReactNative.Cxx/CppWinRTIncludes.h +0 -19
- package/Microsoft.ReactNative.Cxx/DesktopWindowBridge.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/decorator.h +191 -114
- package/Microsoft.ReactNative.Cxx/JSI/instrumentation.h +5 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi-inl.h +37 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi.cpp +68 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi.h +77 -11
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +2 -2
- package/Microsoft.ReactNative.Cxx/NamespaceRedirect.h +0 -5
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.cpp +93 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.cpp +4 -3
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +2 -2
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.cpp +2 -55
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +4 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +5 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +32 -4
- package/Microsoft.ReactNative.Cxx/ReactContext.h +0 -13
- package/Microsoft.ReactNative.Cxx/StructInfo.h +8 -1
- package/Microsoft.ReactNative.Cxx/UI.Composition.Effects.h +0 -4
- package/Microsoft.ReactNative.Cxx/UI.Composition.h +0 -4
- package/Microsoft.ReactNative.Cxx/UI.Input.h +0 -4
- package/Microsoft.ReactNative.Cxx/UI.Popups.h +0 -4
- package/Microsoft.ReactNative.Cxx/UI.Text.h +0 -4
- package/Microsoft.ReactNative.Cxx/XamlUtils.h +0 -33
- package/Microsoft.ReactNative.Managed/JSValueReader.cs +0 -4
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +0 -3
- package/Microsoft.ReactNative.Managed/ReactContext.cs +0 -5
- package/Microsoft.ReactNative.Managed/ReactContextGenerator.cs +0 -4
- package/Microsoft.ReactNative.Managed/ReactPackageBuilderExtensions.cs +0 -25
- package/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs +0 -4
- package/Microsoft.ReactNative.Managed/ReflectionReactPackageProvider.cs +1 -2
- package/Microsoft.ReactNative.Managed.CodeGen/CodeAnalyzer.cs +0 -10
- package/Microsoft.ReactNative.Managed.CodeGen/CodeGenerator.ViewManager.cs +0 -36
- package/Microsoft.ReactNative.Managed.CodeGen/CodeGenerator.cs +0 -6
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactAssembly.cs +0 -2
- package/Microsoft.ReactNative.Managed.CodeGen/Model/ReactTypes.cs +0 -2
- package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +0 -2
- package/Mso/src/dispatchQueue/queueService.cpp +3 -1
- package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +2 -10
- package/PropertySheets/Bundle.Common.targets +1 -1
- package/PropertySheets/Bundle.props +3 -4
- package/PropertySheets/External/Microsoft.ReactNative.Common.props +0 -1
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +1 -1
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/NuGet.LockFile.props +0 -8
- package/PropertySheets/OutputMSBuildProperties.targets +0 -1
- package/PropertySheets/React.Cpp.props +3 -5
- package/PropertySheets/WinUI.props +3 -3
- package/README.md +1 -5
- package/ReactCommon/ReactCommon.vcxproj +12 -31
- package/ReactCommon/ReactCommon.vcxproj.filters +0 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +5 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +20 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +113 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +14 -6
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.cpp +351 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp +42 -36
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +15 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +174 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +26 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +189 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +27 -8
- package/ReactCommon/cgmanifest.json +1 -1
- package/Scripts/Microsoft.ReactNative.nuspec +15 -33
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +23 -23
- package/Scripts/OfficeReact.Win32.nuspec +0 -3
- package/Scripts/creaternwapp.cmd +1 -1
- package/Shared/DevServerHelper.h +17 -21
- package/Shared/DevSettings.h +1 -25
- package/Shared/DevSupportManager.cpp +0 -50
- package/Shared/DevSupportManager.h +0 -4
- package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +5 -1
- package/Shared/HermesRuntimeHolder.cpp +0 -31
- package/Shared/HermesRuntimeHolder.h +0 -14
- package/Shared/IDevSupportManager.h +0 -6
- package/Shared/InstanceManager.cpp +0 -97
- package/Shared/InstanceManager.h +0 -53
- package/Shared/JSI/ScriptStore.h +1 -1
- package/Shared/Logging.cpp +1 -12
- package/Shared/Modules/CxxModuleUtilities.cpp +0 -9
- package/Shared/Modules/CxxModuleUtilities.h +0 -8
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +9 -1
- package/Shared/OInstance.cpp +144 -424
- package/Shared/OInstance.h +0 -81
- package/Shared/Shared.vcxitems +83 -203
- package/Shared/Shared.vcxitems.filters +8 -67
- package/Shared/Threading/MessageQueueThreadFactory.cpp +0 -6
- package/Shared/Threading/MessageQueueThreadFactory.h +0 -4
- package/Shared/TurboModuleManager.cpp +0 -4
- package/Shared/Utils.cpp +26 -0
- package/Shared/Utils.h +3 -0
- package/codegen/NativeDOMSpec.g.h +41 -35
- package/codegen/NativeIntersectionObserverSpec.g.h +9 -21
- package/codegen/NativePerformanceSpec.g.h +47 -35
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +177 -129
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +14 -0
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +14 -0
- package/codegen/react/components/rnwcore/EventEmitters.cpp +25 -0
- package/codegen/react/components/rnwcore/EventEmitters.h +25 -0
- package/codegen/react/components/rnwcore/InputAccessory.g.h +14 -0
- package/codegen/react/components/rnwcore/ModalHostView.g.h +14 -0
- package/codegen/react/components/rnwcore/Props.cpp +41 -2
- package/codegen/react/components/rnwcore/Props.h +51 -2
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +14 -0
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +14 -0
- package/codegen/react/components/rnwcore/Switch.g.h +14 -0
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +14 -0
- package/codegen/react/components/rnwcore/VirtualView.g.h +18 -0
- package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +240 -0
- package/codegen/rnwcoreJSI-generated.cpp +106 -51
- package/codegen/rnwcoreJSI.h +148 -67
- package/fmt/cgmanifest.json +1 -1
- package/fmt/fmt.vcxproj +0 -8
- package/index.js +8 -2
- package/index.windows.js +8 -2
- package/jest/local-setup.js +2 -2
- package/jest/mock.js +1 -1
- package/jest/mockComponent.js +9 -9
- package/jest/mockNativeComponent.js +3 -2
- package/jest/mocks/Modal.js +1 -1
- package/jest/mocks/ScrollView.js +1 -1
- package/jest/mocks/ViewNativeComponent.js +1 -1
- package/jest/setup.js +23 -12
- package/just-task.js +14 -0
- package/package.json +31 -32
- package/src/private/animated/NativeAnimatedHelper.js +16 -5
- package/src/private/animated/createAnimatedPropsHook.js +11 -60
- package/src/private/animated/createAnimatedPropsMemoHook.js +8 -54
- package/src/private/components/virtualview/VirtualView.js +43 -12
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +6 -0
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +80 -52
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +14 -6
- package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +0 -1
- package/src/private/types/HostInstance.js +4 -1
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +22 -2
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +5 -3
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +16 -13
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +45 -22
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +26 -192
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +15 -12
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +14 -11
- package/src/private/webapis/geometry/DOMRectList.js +2 -2
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +1 -1
- package/src/private/webapis/performance/EventTiming.js +6 -10
- package/src/private/webapis/performance/Performance.js +309 -164
- package/src/private/webapis/performance/PerformanceEntry.js +20 -16
- package/src/private/webapis/performance/PerformanceObserver.js +8 -29
- package/src/private/webapis/performance/UserTiming.js +71 -18
- package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
- package/src/private/webapis/performance/internals/Utilities.js +9 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +21 -23
- package/src/private/webapis/structuredClone/structuredClone.js +10 -10
- package/stubs/double-conversion/README.md +1 -1
- package/template/cpp-lib/proj/MyLib.sln +0 -5
- package/template/cpp-lib/src/pch.h +0 -5
- package/template/cs-lib/proj/MyLib.sln +0 -5
- package/template/metro.config.js +1 -0
- package/templates/cpp-app/metro.config.js +2 -1
- package/templates/cpp-app/windows/MyApp.sln +0 -5
- package/templates/cpp-lib/example/metro.config.js +3 -4
- package/templates/cpp-lib/windows/MyLib.sln +0 -5
- package/Chakra/Chakra.vcxitems +0 -32
- package/Chakra/Chakra.vcxitems.filters +0 -54
- package/Chakra/ChakraHelpers.cpp +0 -468
- package/Chakra/ChakraHelpers.h +0 -146
- package/Chakra/ChakraInstanceArgs.h +0 -52
- package/Chakra/ChakraPlatform.cpp +0 -42
- package/Chakra/ChakraPlatform.h +0 -51
- package/Chakra/ChakraTracing.cpp +0 -275
- package/Chakra/ChakraTracing.h +0 -11
- package/Chakra/ChakraUtils.cpp +0 -190
- package/Chakra/ChakraUtils.h +0 -72
- package/Chakra/ChakraValue.cpp +0 -257
- package/Chakra/ChakraValue.h +0 -308
- package/Chakra/Utf8DebugExtensions.cpp +0 -62
- package/Chakra/Utf8DebugExtensions.h +0 -29
- package/Libraries/Interaction/InteractionManagerStub.js +0 -184
- package/Libraries/Interaction/TaskQueue.js +0 -183
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
- package/Microsoft.ReactNative/ABICxxModule.cpp +0 -51
- package/Microsoft.ReactNative/ABICxxModule.h +0 -38
- package/Microsoft.ReactNative/ABIViewManager.cpp +0 -263
- package/Microsoft.ReactNative/ABIViewManager.h +0 -100
- package/Microsoft.ReactNative/Base/CoreUIManagers.cpp +0 -55
- package/Microsoft.ReactNative/DevMenuControl.cpp +0 -14
- package/Microsoft.ReactNative/DevMenuControl.h +0 -20
- package/Microsoft.ReactNative/DevMenuControl.idl +0 -28
- package/Microsoft.ReactNative/DevMenuControl.xaml +0 -139
- package/Microsoft.ReactNative/GlyphViewManager.cpp +0 -167
- package/Microsoft.ReactNative/GlyphViewManager.h +0 -24
- package/Microsoft.ReactNative/INativeUIManager.h +0 -75
- package/Microsoft.ReactNative/IViewManager.idl +0 -120
- package/Microsoft.ReactNative/IViewManagerCore.idl +0 -45
- package/Microsoft.ReactNative/LayoutService.cpp +0 -51
- package/Microsoft.ReactNative/LayoutService.h +0 -32
- package/Microsoft.ReactNative/LayoutService.idl +0 -41
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +0 -1187
- package/Microsoft.ReactNative/Modules/NativeUIManager.h +0 -128
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +0 -891
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +0 -185
- package/Microsoft.ReactNative/NativeModulesProvider.cpp +0 -49
- package/Microsoft.ReactNative/NativeModulesProvider.h +0 -25
- package/Microsoft.ReactNative/ReactApplication.cpp +0 -276
- package/Microsoft.ReactNative/ReactApplication.h +0 -156
- package/Microsoft.ReactNative/ReactApplication.idl +0 -48
- package/Microsoft.ReactNative/ReactHost/ViewManagerProvider.h +0 -19
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +0 -55
- package/Microsoft.ReactNative/ReactPointerEventArgs.h +0 -32
- package/Microsoft.ReactNative/ReactPointerEventArgs.idl +0 -79
- package/Microsoft.ReactNative/ReactRootView.cpp +0 -592
- package/Microsoft.ReactNative/ReactRootView.h +0 -127
- package/Microsoft.ReactNative/ReactRootView.idl +0 -40
- package/Microsoft.ReactNative/TestHook.cpp +0 -99
- package/Microsoft.ReactNative/TestHook.h +0 -15
- package/Microsoft.ReactNative/Utils/AccessibilityUtils.cpp +0 -36
- package/Microsoft.ReactNative/Utils/AccessibilityUtils.h +0 -15
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +0 -171
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.h +0 -72
- package/Microsoft.ReactNative/Utils/PropertyHandlerUtils.h +0 -87
- package/Microsoft.ReactNative/Utils/PropertyUtils.h +0 -568
- package/Microsoft.ReactNative/Utils/ResourceBrushUtils.cpp +0 -182
- package/Microsoft.ReactNative/Utils/ResourceBrushUtils.h +0 -58
- package/Microsoft.ReactNative/Utils/ShadowNodeTypeUtils.h +0 -26
- package/Microsoft.ReactNative/Utils/XamlIslandUtils.cpp +0 -93
- package/Microsoft.ReactNative/Utils/XamlIslandUtils.h +0 -48
- package/Microsoft.ReactNative/ViewManagersProvider.cpp +0 -39
- package/Microsoft.ReactNative/ViewManagersProvider.h +0 -27
- package/Microsoft.ReactNative/Views/ActivityIndicatorViewManager.cpp +0 -62
- package/Microsoft.ReactNative/Views/ActivityIndicatorViewManager.h +0 -29
- package/Microsoft.ReactNative/Views/ConfigureBundlerDlg.cpp +0 -186
- package/Microsoft.ReactNative/Views/ConfigureBundlerDlg.h +0 -11
- package/Microsoft.ReactNative/Views/ControlViewManager.cpp +0 -143
- package/Microsoft.ReactNative/Views/ControlViewManager.h +0 -38
- package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.cpp +0 -53
- package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.h +0 -30
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +0 -586
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.h +0 -104
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +0 -330
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.h +0 -111
- package/Microsoft.ReactNative/Views/DynamicValueProvider.cpp +0 -59
- package/Microsoft.ReactNative/Views/DynamicValueProvider.h +0 -32
- package/Microsoft.ReactNative/Views/ExpressionAnimationStore.cpp +0 -61
- package/Microsoft.ReactNative/Views/ExpressionAnimationStore.h +0 -26
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +0 -559
- package/Microsoft.ReactNative/Views/FlyoutViewManager.h +0 -34
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +0 -126
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.h +0 -23
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +0 -957
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.h +0 -41
- package/Microsoft.ReactNative/Views/IXamlRootView.h +0 -17
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +0 -245
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.h +0 -45
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +0 -469
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +0 -80
- package/Microsoft.ReactNative/Views/Image/ReactImageBrush.cpp +0 -247
- package/Microsoft.ReactNative/Views/Image/ReactImageBrush.h +0 -67
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.cpp +0 -261
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.h +0 -132
- package/Microsoft.ReactNative/Views/PaperShadowNode.cpp +0 -18
- package/Microsoft.ReactNative/Views/PaperShadowNode.h +0 -38
- package/Microsoft.ReactNative/Views/PopupViewManager.cpp +0 -349
- package/Microsoft.ReactNative/Views/PopupViewManager.h +0 -36
- package/Microsoft.ReactNative/Views/RawTextViewManager.cpp +0 -69
- package/Microsoft.ReactNative/Views/RawTextViewManager.h +0 -46
- package/Microsoft.ReactNative/Views/ReactViewInstance.cpp +0 -43
- package/Microsoft.ReactNative/Views/ReactViewInstance.h +0 -53
- package/Microsoft.ReactNative/Views/RefreshControlManager.cpp +0 -116
- package/Microsoft.ReactNative/Views/RefreshControlManager.h +0 -28
- package/Microsoft.ReactNative/Views/RootViewManager.cpp +0 -65
- package/Microsoft.ReactNative/Views/RootViewManager.h +0 -36
- package/Microsoft.ReactNative/Views/SIPEventHandler.cpp +0 -117
- package/Microsoft.ReactNative/Views/SIPEventHandler.h +0 -45
- package/Microsoft.ReactNative/Views/ScrollContentViewManager.cpp +0 -16
- package/Microsoft.ReactNative/Views/ScrollContentViewManager.h +0 -19
- package/Microsoft.ReactNative/Views/ScrollViewManager.cpp +0 -540
- package/Microsoft.ReactNative/Views/ScrollViewManager.h +0 -42
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +0 -228
- package/Microsoft.ReactNative/Views/ShadowNodeBase.h +0 -169
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.cpp +0 -68
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.h +0 -40
- package/Microsoft.ReactNative/Views/SliderViewManager.cpp +0 -97
- package/Microsoft.ReactNative/Views/SliderViewManager.h +0 -32
- package/Microsoft.ReactNative/Views/SwitchViewManager.cpp +0 -227
- package/Microsoft.ReactNative/Views/SwitchViewManager.h +0 -31
- package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.cpp +0 -52
- package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.h +0 -37
- package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.cpp +0 -348
- package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.h +0 -13
- package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.cpp +0 -76
- package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.h +0 -32
- package/Microsoft.ReactNative/Views/Text/TextParentVisitor.cpp +0 -12
- package/Microsoft.ReactNative/Views/Text/TextParentVisitor.h +0 -19
- package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.cpp +0 -75
- package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.h +0 -43
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.cpp +0 -21
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +0 -23
- package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.cpp +0 -70
- package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.h +0 -34
- package/Microsoft.ReactNative/Views/Text/TextVisitor.cpp +0 -56
- package/Microsoft.ReactNative/Views/Text/TextVisitor.h +0 -34
- package/Microsoft.ReactNative/Views/Text/TextVisitorScope.h +0 -35
- package/Microsoft.ReactNative/Views/Text/TextVisitors.h +0 -47
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +0 -1003
- package/Microsoft.ReactNative/Views/TextInputViewManager.h +0 -33
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +0 -414
- package/Microsoft.ReactNative/Views/TextViewManager.h +0 -47
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +0 -608
- package/Microsoft.ReactNative/Views/TouchEventHandler.h +0 -116
- package/Microsoft.ReactNative/Views/UnimplementedViewManager.cpp +0 -79
- package/Microsoft.ReactNative/Views/UnimplementedViewManager.h +0 -27
- package/Microsoft.ReactNative/Views/ViewControl.cpp +0 -43
- package/Microsoft.ReactNative/Views/ViewControl.h +0 -32
- package/Microsoft.ReactNative/Views/ViewManager.h +0 -33
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +0 -487
- package/Microsoft.ReactNative/Views/ViewManagerBase.h +0 -121
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +0 -164
- package/Microsoft.ReactNative/Views/ViewPanel.h +0 -82
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +0 -507
- package/Microsoft.ReactNative/Views/ViewViewManager.h +0 -52
- package/Microsoft.ReactNative/Views/VirtualTextViewManager.cpp +0 -143
- package/Microsoft.ReactNative/Views/VirtualTextViewManager.h +0 -57
- package/Microsoft.ReactNative/Views/XamlFeatures.cpp +0 -11
- package/Microsoft.ReactNative/Views/XamlFeatures.h +0 -11
- package/Microsoft.ReactNative/Views/cppwinrt/AccessibilityAction.idl +0 -12
- package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +0 -231
- package/Microsoft.ReactNative/Views/cppwinrt/ViewPanel.idl +0 -48
- package/Microsoft.ReactNative/XamlHelper.cpp +0 -78
- package/Microsoft.ReactNative/XamlHelper.h +0 -54
- package/Microsoft.ReactNative/XamlHelper.idl +0 -30
- package/Microsoft.ReactNative/XamlLoadState.cpp +0 -217
- package/Microsoft.ReactNative/XamlLoadState.h +0 -44
- package/Microsoft.ReactNative/XamlView.cpp +0 -59
- package/Microsoft.ReactNative/XamlView.h +0 -58
- package/Microsoft.ReactNative/getLayoutProps.ps1 +0 -5
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Automation.Peers.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Automation.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Controls.Primitives.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Controls.h +0 -13
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Documents.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Hosting.DesktopWindowXamlSource.h +0 -11
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Hosting.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Input.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Markup.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Media.Imaging.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Media.Media3D.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Media.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Navigation.h +0 -10
- package/Microsoft.ReactNative.Cxx/UI.Xaml.Shapes.h +0 -10
- package/Microsoft.ReactNative.Managed/AttributedViewManager.cs +0 -527
- package/Microsoft.ReactNative.Managed/ViewManagerAttributes.cs +0 -91
- package/Microsoft.ReactNative.Managed/ViewManagerEvent.cs +0 -13
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +0 -344
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/DynamicEventPayload.cpp +0 -42
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/YGEnums.h +0 -146
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2435
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/enums/ExperimentalFeature.h +0 -40
- package/Shared/BatchingMessageQueueThread.h +0 -20
- package/Shared/ChakraRuntimeHolder.cpp +0 -62
- package/Shared/ChakraRuntimeHolder.h +0 -46
- package/Shared/CreateInstance.h +0 -25
- package/Shared/Executors/WebSocketJSExecutor.cpp +0 -294
- package/Shared/Executors/WebSocketJSExecutor.h +0 -123
- package/Shared/Executors/WebSocketJSExecutorFactory.cpp +0 -25
- package/Shared/Hermes/HermesSamplingProfiler.cpp +0 -114
- package/Shared/Hermes/HermesSamplingProfiler.h +0 -26
- package/Shared/JSI/ChakraApi.cpp +0 -436
- package/Shared/JSI/ChakraApi.h +0 -474
- package/Shared/JSI/ChakraJsiRuntime_edgemode.cpp +0 -100
- package/Shared/JSI/ChakraRuntime.cpp +0 -1132
- package/Shared/JSI/ChakraRuntime.h +0 -512
- package/Shared/JSI/ChakraRuntimeArgs.h +0 -45
- package/Shared/JSI/ChakraRuntimeFactory.h +0 -15
- package/Shared/JSI/JSExecutorFactoryDelegate.h +0 -12
- package/Shared/JSI/JSExecutorFactorySettings.cpp +0 -30
- package/Shared/JSI/JSExecutorFactorySettings.h +0 -21
- package/Shared/NativeModuleProvider.h +0 -40
- package/Shared/SystemChakraRuntime.h +0 -38
- package/Shared/Threading/BatchingQueueThread.cpp +0 -128
- package/Shared/Threading/BatchingQueueThread.h +0 -59
- package/Shared/WebSocketJSExecutorFactory.h +0 -27
- package/fmt/TEMP_UntilFmtUpdate/core.h +0 -2925
- package/template/cpp-app/proj/MyApp.sln +0 -166
- package/template/cpp-app/proj/MyApp.vcxproj +0 -176
- package/template/cpp-app/proj/MyApp.vcxproj.filters +0 -62
- package/template/cpp-app/src/App.cpp +0 -93
- package/template/cpp-app/src/App.h +0 -21
- package/template/cpp-app/src/App.idl +0 -3
- package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +0 -13
- package/template/cpp-app/src/AutolinkedNativeModules.g.h +0 -10
- package/template/cpp-app/src/MainPage.cpp +0 -20
- package/template/cpp-app/src/MainPage.h +0 -19
- package/template/cpp-app/src/MainPage.idl +0 -10
- package/template/cpp-app/src/PropertySheet.props +0 -16
- package/template/cpp-app/src/ReactPackageProvider.cpp +0 -15
- package/template/cpp-app/src/ReactPackageProvider.h +0 -13
- package/template/cpp-app/src/pch.cpp +0 -1
- package/template/cpp-app/src/pch.h +0 -24
- package/template/cs-app/proj/MyApp.csproj +0 -162
- package/template/cs-app/proj/MyApp.sln +0 -191
- package/template/cs-app/src/App.xaml.cs +0 -62
- package/template/cs-app/src/AutolinkedNativeModules.g.cs +0 -13
- package/template/cs-app/src/MainPage.xaml.cs +0 -34
- package/template/cs-app/src/Properties/AssemblyInfo.cs +0 -29
- package/template/cs-app/src/Properties/Default.rd.xml +0 -32
- package/template/cs-app/src/ReactPackageProvider.cs +0 -17
- package/template/shared-app/assets/LockScreenLogo.scale-200.png +0 -0
- package/template/shared-app/assets/SplashScreen.scale-200.png +0 -0
- package/template/shared-app/assets/Square150x150Logo.scale-200.png +0 -0
- package/template/shared-app/assets/Square44x44Logo.scale-200.png +0 -0
- package/template/shared-app/assets/Square44x44Logo.targetsize-24_altform-unplated.png +0 -0
- package/template/shared-app/assets/StoreLogo.png +0 -0
- package/template/shared-app/assets/Wide310x150Logo.scale-200.png +0 -0
- package/template/shared-app/proj/ExperimentalFeatures.props +0 -32
- package/template/shared-app/proj/NuGet_Config +0 -19
- package/template/shared-app/src/App.xaml +0 -10
- package/template/shared-app/src/AutolinkedNativeModules.g.props +0 -6
- package/template/shared-app/src/AutolinkedNativeModules.g.targets +0 -6
- package/template/shared-app/src/MainPage.xaml +0 -21
- package/template/shared-app/src/Package.appxmanifest +0 -50
- package/templates/old/uwp-cpp-app/template.config.js +0 -15
- package/templates/old/uwp-cs-app/template.config.js +0 -15
|
@@ -1,957 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
#include "pch.h"
|
|
5
|
-
|
|
6
|
-
#include <IReactInstance.h>
|
|
7
|
-
|
|
8
|
-
#include <Views/ExpressionAnimationStore.h>
|
|
9
|
-
#include <Views/FrameworkElementTransferProperties.h>
|
|
10
|
-
#include <Views/FrameworkElementViewManager.h>
|
|
11
|
-
|
|
12
|
-
#include <JSValueWriter.h>
|
|
13
|
-
#include <Utils/AccessibilityUtils.h>
|
|
14
|
-
#include <Utils/PropertyUtils.h>
|
|
15
|
-
#include <Utils/ValueUtils.h>
|
|
16
|
-
|
|
17
|
-
#include <WindowsNumerics.h>
|
|
18
|
-
#include <winrt/Windows.Foundation.h>
|
|
19
|
-
|
|
20
|
-
#include <UI.Xaml.Automation.Peers.h>
|
|
21
|
-
#include <UI.Xaml.Automation.h>
|
|
22
|
-
#include <UI.Xaml.Controls.h>
|
|
23
|
-
#include "Utils/PropertyHandlerUtils.h"
|
|
24
|
-
|
|
25
|
-
#include "DynamicAutomationProperties.h"
|
|
26
|
-
|
|
27
|
-
#include <Views/ViewPanel.h>
|
|
28
|
-
#include "FrameworkElementViewManager.h"
|
|
29
|
-
#include "Unicode.h"
|
|
30
|
-
#include "cdebug.h"
|
|
31
|
-
|
|
32
|
-
namespace winrt {
|
|
33
|
-
using namespace xaml;
|
|
34
|
-
using namespace xaml::Controls;
|
|
35
|
-
using namespace xaml::Automation;
|
|
36
|
-
using namespace xaml::Automation::Peers;
|
|
37
|
-
using namespace Windows::Foundation::Collections;
|
|
38
|
-
} // namespace winrt
|
|
39
|
-
|
|
40
|
-
template <>
|
|
41
|
-
struct json_type_traits<winrt::Microsoft::ReactNative::AccessibilityAction> {
|
|
42
|
-
static winrt::Microsoft::ReactNative::AccessibilityAction parseJson(
|
|
43
|
-
const winrt::Microsoft::ReactNative::JSValue &json) {
|
|
44
|
-
auto action = winrt::Microsoft::ReactNative::AccessibilityAction();
|
|
45
|
-
|
|
46
|
-
for (auto &item : json.AsObject()) {
|
|
47
|
-
if (item.first == "name") {
|
|
48
|
-
action.Name = Microsoft::ReactNative::asHstring(item.second);
|
|
49
|
-
} else if (item.first == "label") {
|
|
50
|
-
action.Label = Microsoft::ReactNative::asHstring(item.second);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return action;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
template <>
|
|
58
|
-
struct json_type_traits<winrt::IVector<winrt::Microsoft::ReactNative::AccessibilityAction>> {
|
|
59
|
-
static winrt::IVector<winrt::Microsoft::ReactNative::AccessibilityAction> parseJson(
|
|
60
|
-
const winrt::Microsoft::ReactNative::JSValue &json) {
|
|
61
|
-
auto vector = winrt::single_threaded_vector<winrt::Microsoft::ReactNative::AccessibilityAction>();
|
|
62
|
-
|
|
63
|
-
if (json.Type() == winrt::Microsoft::ReactNative::JSValueType::Array) {
|
|
64
|
-
for (const auto &action : json.AsArray()) {
|
|
65
|
-
if (action.Type() != winrt::Microsoft::ReactNative::JSValueType::Object)
|
|
66
|
-
continue;
|
|
67
|
-
|
|
68
|
-
vector.Append(json_type_traits<winrt::Microsoft::ReactNative::AccessibilityAction>::parseJson(action));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return vector;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
namespace Microsoft::ReactNative {
|
|
76
|
-
|
|
77
|
-
using DynamicAutomationProperties = Microsoft::ReactNative::DynamicAutomationProperties;
|
|
78
|
-
|
|
79
|
-
FrameworkElementViewManager::FrameworkElementViewManager(const Mso::React::IReactContext &context) : Super(context) {}
|
|
80
|
-
|
|
81
|
-
void FrameworkElementViewManager::TransferProperties(const XamlView &oldView, const XamlView &newView) {
|
|
82
|
-
TransferFrameworkElementProperties(oldView, newView);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
static void GetAccessibilityStateProps(const winrt::Microsoft::ReactNative::IJSValueWriter &writer) {
|
|
86
|
-
writer.WriteObjectBegin();
|
|
87
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"selected", L"boolean");
|
|
88
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"disabled", L"boolean");
|
|
89
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"checked", L"string");
|
|
90
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"busy", L"boolean");
|
|
91
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"expanded", L"boolean");
|
|
92
|
-
writer.WriteObjectEnd();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
static void GetAccessibilityValueProps(const winrt::Microsoft::ReactNative::IJSValueWriter &writer) {
|
|
96
|
-
writer.WriteObjectBegin();
|
|
97
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"min", L"number");
|
|
98
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"max", L"number");
|
|
99
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"now", L"number");
|
|
100
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"text", L"string");
|
|
101
|
-
writer.WriteObjectEnd();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
inline float ToRadians(const winrt::Microsoft::ReactNative::JSValue &value) {
|
|
105
|
-
if ((value.Type() == winrt::Microsoft::ReactNative::JSValueType::Double)) {
|
|
106
|
-
return value.AsSingle();
|
|
107
|
-
}
|
|
108
|
-
assert(value.Type() == winrt::Microsoft::ReactNative::JSValueType::String);
|
|
109
|
-
|
|
110
|
-
auto stringValue = value.AsString();
|
|
111
|
-
char *suffixStart;
|
|
112
|
-
double num = strtod(stringValue.c_str(), &suffixStart);
|
|
113
|
-
if (0 == strncmp(suffixStart, "deg", 3)) {
|
|
114
|
-
return static_cast<float>(num * M_PI / 180.0f);
|
|
115
|
-
}
|
|
116
|
-
return static_cast<float>(num); // assume suffix is "rad"
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
static void MultiplyInto(
|
|
120
|
-
winrt::Windows::Foundation::Numerics::float4x4 &m,
|
|
121
|
-
winrt::Windows::Foundation::Numerics::float4x4 o) {
|
|
122
|
-
m = o * m;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
void FrameworkElementViewManager::GetNativeProps(const winrt::Microsoft::ReactNative::IJSValueWriter &writer) const {
|
|
126
|
-
Super::GetNativeProps(writer);
|
|
127
|
-
|
|
128
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessible", L"boolean");
|
|
129
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityRole", L"string");
|
|
130
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"role", L"string");
|
|
131
|
-
writer.WritePropertyName(L"accessibilityState");
|
|
132
|
-
GetAccessibilityStateProps(writer);
|
|
133
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityHint", L"string");
|
|
134
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityLabel", L"string");
|
|
135
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityLevel", L"number");
|
|
136
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityPosInSet", L"number");
|
|
137
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilitySetSize", L"number");
|
|
138
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"testID", L"string");
|
|
139
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"tooltip", L"string");
|
|
140
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityActions", L"array");
|
|
141
|
-
winrt::Microsoft::ReactNative::WriteProperty(writer, L"accessibilityLiveRegion", L"string");
|
|
142
|
-
writer.WritePropertyName(L"accessibilityValue");
|
|
143
|
-
GetAccessibilityValueProps(writer);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
bool FrameworkElementViewManager::UpdateProperty(
|
|
147
|
-
ShadowNodeBase *nodeToUpdate,
|
|
148
|
-
const std::string &propertyName,
|
|
149
|
-
const winrt::Microsoft::ReactNative::JSValue &propertyValue) {
|
|
150
|
-
auto element(nodeToUpdate->GetView().as<xaml::FrameworkElement>());
|
|
151
|
-
if (element != nullptr) {
|
|
152
|
-
if (propertyName == "opacity") {
|
|
153
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
154
|
-
propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64) {
|
|
155
|
-
double opacity = propertyValue.AsDouble();
|
|
156
|
-
if (opacity >= 0 && opacity <= 1)
|
|
157
|
-
element.Opacity(opacity);
|
|
158
|
-
// else
|
|
159
|
-
// TODO report error
|
|
160
|
-
} else if (propertyValue.IsNull()) {
|
|
161
|
-
element.ClearValue(xaml::UIElement::OpacityProperty());
|
|
162
|
-
}
|
|
163
|
-
} else if (propertyName == "transform") {
|
|
164
|
-
if (element.try_as<xaml::IUIElement10>()) // Works on 19H1+
|
|
165
|
-
{
|
|
166
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Array) {
|
|
167
|
-
winrt::Windows::Foundation::Numerics::float4x4 transformMatrix{
|
|
168
|
-
winrt::Windows::Foundation::Numerics::float4x4::identity()};
|
|
169
|
-
for (const auto &transform : propertyValue.AsArray()) {
|
|
170
|
-
for (const auto &operation : transform.AsObject()) {
|
|
171
|
-
const std::string &transformType = operation.first;
|
|
172
|
-
const auto &innerValue = operation.second;
|
|
173
|
-
|
|
174
|
-
if (transformType == "matrix") {
|
|
175
|
-
assert(innerValue.AsArray().size() == 16);
|
|
176
|
-
winrt::Windows::Foundation::Numerics::float4x4 innerMatrix;
|
|
177
|
-
innerMatrix.m11 = static_cast<float>(innerValue[0].AsDouble());
|
|
178
|
-
innerMatrix.m12 = static_cast<float>(innerValue[1].AsDouble());
|
|
179
|
-
innerMatrix.m13 = static_cast<float>(innerValue[2].AsDouble());
|
|
180
|
-
innerMatrix.m14 = static_cast<float>(innerValue[3].AsDouble());
|
|
181
|
-
innerMatrix.m21 = static_cast<float>(innerValue[4].AsDouble());
|
|
182
|
-
innerMatrix.m22 = static_cast<float>(innerValue[5].AsDouble());
|
|
183
|
-
innerMatrix.m23 = static_cast<float>(innerValue[6].AsDouble());
|
|
184
|
-
innerMatrix.m24 = static_cast<float>(innerValue[7].AsDouble());
|
|
185
|
-
innerMatrix.m31 = static_cast<float>(innerValue[8].AsDouble());
|
|
186
|
-
innerMatrix.m32 = static_cast<float>(innerValue[9].AsDouble());
|
|
187
|
-
innerMatrix.m33 = static_cast<float>(innerValue[10].AsDouble());
|
|
188
|
-
innerMatrix.m34 = static_cast<float>(innerValue[11].AsDouble());
|
|
189
|
-
innerMatrix.m41 = static_cast<float>(innerValue[12].AsDouble());
|
|
190
|
-
innerMatrix.m42 = static_cast<float>(innerValue[13].AsDouble());
|
|
191
|
-
innerMatrix.m43 = static_cast<float>(innerValue[14].AsDouble());
|
|
192
|
-
innerMatrix.m44 = static_cast<float>(innerValue[15].AsDouble());
|
|
193
|
-
MultiplyInto(transformMatrix, innerMatrix);
|
|
194
|
-
} else if (transformType == "perspective") {
|
|
195
|
-
auto innerMatrix = winrt::Windows::Foundation::Numerics::float4x4::identity();
|
|
196
|
-
innerMatrix.m34 = -1 / innerValue.AsSingle();
|
|
197
|
-
MultiplyInto(transformMatrix, innerMatrix);
|
|
198
|
-
} else if (transformType == "rotateX") {
|
|
199
|
-
MultiplyInto(
|
|
200
|
-
transformMatrix,
|
|
201
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_rotation_x(ToRadians(innerValue)));
|
|
202
|
-
} else if (transformType == "rotateY") {
|
|
203
|
-
MultiplyInto(
|
|
204
|
-
transformMatrix,
|
|
205
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_rotation_y(ToRadians(innerValue)));
|
|
206
|
-
} else if (transformType == "rotate" || transformType == "rotateZ") {
|
|
207
|
-
MultiplyInto(
|
|
208
|
-
transformMatrix,
|
|
209
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_rotation_z(ToRadians(innerValue)));
|
|
210
|
-
} else if (transformType == "scale") {
|
|
211
|
-
MultiplyInto(
|
|
212
|
-
transformMatrix,
|
|
213
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_scale(
|
|
214
|
-
innerValue.AsSingle(), innerValue.AsSingle(), 1));
|
|
215
|
-
} else if (transformType == "scaleX") {
|
|
216
|
-
MultiplyInto(
|
|
217
|
-
transformMatrix,
|
|
218
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_scale(innerValue.AsSingle(), 1, 1));
|
|
219
|
-
} else if (transformType == "scaleY") {
|
|
220
|
-
MultiplyInto(
|
|
221
|
-
transformMatrix,
|
|
222
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_scale(1, innerValue.AsSingle(), 1));
|
|
223
|
-
} else if (transformType == "translate") {
|
|
224
|
-
auto ¶ms = innerValue.AsArray();
|
|
225
|
-
MultiplyInto(
|
|
226
|
-
transformMatrix,
|
|
227
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_translation(
|
|
228
|
-
params[0].AsSingle(), params[1].AsSingle(), params.size() > 2 ? params[2].AsSingle() : 0.f));
|
|
229
|
-
} else if (transformType == "translateX") {
|
|
230
|
-
MultiplyInto(
|
|
231
|
-
transformMatrix,
|
|
232
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_translation(innerValue.AsSingle(), 0.f, 0.f));
|
|
233
|
-
} else if (transformType == "translateY") {
|
|
234
|
-
MultiplyInto(
|
|
235
|
-
transformMatrix,
|
|
236
|
-
winrt::Windows::Foundation::Numerics::make_float4x4_translation(0.f, innerValue.AsSingle(), 0.f));
|
|
237
|
-
} else if (transformType == "skewX") {
|
|
238
|
-
MultiplyInto(
|
|
239
|
-
transformMatrix,
|
|
240
|
-
winrt::Windows::Foundation::Numerics::float4x4(
|
|
241
|
-
winrt::Windows::Foundation::Numerics::make_float3x2_skew(ToRadians(innerValue), 0.f)));
|
|
242
|
-
} else if (transformType == "skewY") {
|
|
243
|
-
MultiplyInto(
|
|
244
|
-
transformMatrix,
|
|
245
|
-
winrt::Windows::Foundation::Numerics::float4x4(
|
|
246
|
-
winrt::Windows::Foundation::Numerics::make_float3x2_skew(0.f, ToRadians(innerValue))));
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
if (!element.IsLoaded()) {
|
|
252
|
-
element.Loaded([=](auto sender, auto &&) -> auto{
|
|
253
|
-
ApplyTransformMatrix(sender.as<xaml::UIElement>(), nodeToUpdate, transformMatrix);
|
|
254
|
-
});
|
|
255
|
-
} else {
|
|
256
|
-
ApplyTransformMatrix(element, nodeToUpdate, transformMatrix);
|
|
257
|
-
}
|
|
258
|
-
} else if (propertyValue.IsNull()) {
|
|
259
|
-
element.TransformMatrix(winrt::Windows::Foundation::Numerics::float4x4::identity());
|
|
260
|
-
}
|
|
261
|
-
} else {
|
|
262
|
-
cdebug << "[Dim down] " << propertyName << "\n";
|
|
263
|
-
}
|
|
264
|
-
} else if (propertyName == "accessibilityHint") {
|
|
265
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
266
|
-
auto value = asHstring(propertyValue);
|
|
267
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateString(value);
|
|
268
|
-
|
|
269
|
-
element.SetValue(xaml::Automation::AutomationProperties::HelpTextProperty(), boxedValue);
|
|
270
|
-
} else if (propertyValue.IsNull()) {
|
|
271
|
-
element.ClearValue(xaml::Automation::AutomationProperties::HelpTextProperty());
|
|
272
|
-
}
|
|
273
|
-
} else if (propertyName == "accessibilityLabel") {
|
|
274
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
275
|
-
auto value = asHstring(propertyValue);
|
|
276
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateString(value);
|
|
277
|
-
|
|
278
|
-
element.SetValue(xaml::Automation::AutomationProperties::NameProperty(), boxedValue);
|
|
279
|
-
} else if (propertyValue.IsNull()) {
|
|
280
|
-
element.ClearValue(xaml::Automation::AutomationProperties::NameProperty());
|
|
281
|
-
}
|
|
282
|
-
AnnounceLiveRegionChangedIfNeeded(element);
|
|
283
|
-
} else if (propertyName == "accessible") {
|
|
284
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
|
|
285
|
-
if (propertyValue.AsBoolean()) {
|
|
286
|
-
xaml::Automation::AutomationProperties::SetAccessibilityView(element, winrt::AccessibilityView::Content);
|
|
287
|
-
} else {
|
|
288
|
-
xaml::Automation::AutomationProperties::SetAccessibilityView(element, winrt::AccessibilityView::Raw);
|
|
289
|
-
}
|
|
290
|
-
} else if (propertyValue.IsNull()) {
|
|
291
|
-
element.ClearValue(xaml::Automation::AutomationProperties::AccessibilityViewProperty());
|
|
292
|
-
}
|
|
293
|
-
} else if (propertyName == "accessibilityLevel") {
|
|
294
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
295
|
-
propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64) {
|
|
296
|
-
auto value = static_cast<int>(propertyValue.AsDouble());
|
|
297
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateInt32(value);
|
|
298
|
-
element.SetValue(xaml::Automation::AutomationProperties::LevelProperty(), boxedValue);
|
|
299
|
-
} else if (propertyValue.IsNull()) {
|
|
300
|
-
element.ClearValue(xaml::Automation::AutomationProperties::LevelProperty());
|
|
301
|
-
}
|
|
302
|
-
} else if (propertyName == "accessibilityLiveRegion") {
|
|
303
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
304
|
-
auto value = propertyValue.AsString();
|
|
305
|
-
|
|
306
|
-
auto liveSetting = winrt::AutomationLiveSetting::Off;
|
|
307
|
-
|
|
308
|
-
if (value == "polite") {
|
|
309
|
-
liveSetting = winrt::AutomationLiveSetting::Polite;
|
|
310
|
-
} else if (value == "assertive") {
|
|
311
|
-
liveSetting = winrt::AutomationLiveSetting::Assertive;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
element.SetValue(xaml::Automation::AutomationProperties::LiveSettingProperty(), winrt::box_value(liveSetting));
|
|
315
|
-
} else if (propertyValue.IsNull()) {
|
|
316
|
-
element.ClearValue(xaml::Automation::AutomationProperties::LiveSettingProperty());
|
|
317
|
-
}
|
|
318
|
-
AnnounceLiveRegionChangedIfNeeded(element);
|
|
319
|
-
} else if (propertyName == "accessibilityPosInSet") {
|
|
320
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
321
|
-
propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64) {
|
|
322
|
-
auto value = static_cast<int>(propertyValue.AsDouble());
|
|
323
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateInt32(value);
|
|
324
|
-
|
|
325
|
-
element.SetValue(xaml::Automation::AutomationProperties::PositionInSetProperty(), boxedValue);
|
|
326
|
-
} else if (propertyValue.IsNull()) {
|
|
327
|
-
element.ClearValue(xaml::Automation::AutomationProperties::PositionInSetProperty());
|
|
328
|
-
}
|
|
329
|
-
} else if (propertyName == "accessibilitySetSize") {
|
|
330
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
331
|
-
propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64) {
|
|
332
|
-
auto value = static_cast<int>(propertyValue.AsDouble());
|
|
333
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateInt32(value);
|
|
334
|
-
|
|
335
|
-
element.SetValue(xaml::Automation::AutomationProperties::SizeOfSetProperty(), boxedValue);
|
|
336
|
-
} else if (propertyValue.IsNull()) {
|
|
337
|
-
element.ClearValue(xaml::Automation::AutomationProperties::SizeOfSetProperty());
|
|
338
|
-
}
|
|
339
|
-
} else if (propertyName == "accessibilityRole") {
|
|
340
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
341
|
-
const std::string &role = propertyValue.AsString();
|
|
342
|
-
if (role == "none")
|
|
343
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
344
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::None);
|
|
345
|
-
else if (role == "button")
|
|
346
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
347
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Button);
|
|
348
|
-
else if (role == "link")
|
|
349
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
350
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Link);
|
|
351
|
-
else if (role == "search")
|
|
352
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
353
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Search);
|
|
354
|
-
else if (role == "image")
|
|
355
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
356
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Image);
|
|
357
|
-
else if (role == "keyboardkey")
|
|
358
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
359
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::KeyboardKey);
|
|
360
|
-
else if (role == "text")
|
|
361
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
362
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Text);
|
|
363
|
-
else if (role == "adjustable")
|
|
364
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
365
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Adjustable);
|
|
366
|
-
else if (role == "imagebutton")
|
|
367
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
368
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ImageButton);
|
|
369
|
-
else if (role == "header")
|
|
370
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
371
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Header);
|
|
372
|
-
else if (role == "summary")
|
|
373
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
374
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Summary);
|
|
375
|
-
else if (role == "alert")
|
|
376
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
377
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Alert);
|
|
378
|
-
else if (role == "checkbox")
|
|
379
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
380
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::CheckBox);
|
|
381
|
-
else if (role == "combobox")
|
|
382
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
383
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ComboBox);
|
|
384
|
-
else if (role == "menu")
|
|
385
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
386
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Menu);
|
|
387
|
-
else if (role == "menubar")
|
|
388
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
389
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::MenuBar);
|
|
390
|
-
else if (role == "menuitem")
|
|
391
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
392
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::MenuItem);
|
|
393
|
-
else if (role == "progressbar")
|
|
394
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
395
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ProgressBar);
|
|
396
|
-
else if (role == "radio")
|
|
397
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
398
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Radio);
|
|
399
|
-
else if (role == "radiogroup")
|
|
400
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
401
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::RadioGroup);
|
|
402
|
-
else if (role == "scrollbar")
|
|
403
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
404
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ScrollBar);
|
|
405
|
-
else if (role == "spinbutton")
|
|
406
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
407
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::SpinButton);
|
|
408
|
-
else if (role == "switch")
|
|
409
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
410
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Switch);
|
|
411
|
-
else if (role == "tab")
|
|
412
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
413
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Tab);
|
|
414
|
-
else if (role == "tablist")
|
|
415
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
416
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::TabList);
|
|
417
|
-
else if (role == "timer")
|
|
418
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
419
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Timer);
|
|
420
|
-
else if (role == "togglebutton")
|
|
421
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
422
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ToggleButton);
|
|
423
|
-
else if (role == "toolbar")
|
|
424
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
425
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ToolBar);
|
|
426
|
-
else if (role == "list") {
|
|
427
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
428
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::List);
|
|
429
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
430
|
-
winrt::hstring controlType = FrameworkElementViewManager::getControlTypeFromAccessibilityRole(
|
|
431
|
-
winrt::Microsoft::ReactNative::AccessibilityRoles::List);
|
|
432
|
-
FrameworkElementViewManager::setLocalizedControlTypeFromAccessibilityRole(element, controlType);
|
|
433
|
-
}
|
|
434
|
-
} else if (role == "listitem") {
|
|
435
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
436
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::ListItem);
|
|
437
|
-
if (propertyValue.Type() ==
|
|
438
|
-
winrt::Microsoft::ReactNative::JSValueType::String) { // Set localized control type
|
|
439
|
-
winrt::hstring controlType = FrameworkElementViewManager::getControlTypeFromAccessibilityRole(
|
|
440
|
-
winrt::Microsoft::ReactNative::AccessibilityRoles::ListItem);
|
|
441
|
-
FrameworkElementViewManager::setLocalizedControlTypeFromAccessibilityRole(element, controlType);
|
|
442
|
-
}
|
|
443
|
-
} else
|
|
444
|
-
DynamicAutomationProperties::SetAccessibilityRole(
|
|
445
|
-
element, winrt::Microsoft::ReactNative::AccessibilityRoles::Unknown);
|
|
446
|
-
} else if (propertyValue.IsNull()) {
|
|
447
|
-
element.ClearValue(DynamicAutomationProperties::AccessibilityRoleProperty());
|
|
448
|
-
}
|
|
449
|
-
} else if (propertyName == "role") {
|
|
450
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
451
|
-
const std::string &role = propertyValue.AsString();
|
|
452
|
-
if (role == "alert")
|
|
453
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Alert);
|
|
454
|
-
else if (role == "alertdialog")
|
|
455
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::AlertDialog);
|
|
456
|
-
else if (role == "application")
|
|
457
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Application);
|
|
458
|
-
else if (role == "article")
|
|
459
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Article);
|
|
460
|
-
else if (role == "banner")
|
|
461
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Banner);
|
|
462
|
-
else if (role == "button")
|
|
463
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Button);
|
|
464
|
-
else if (role == "cell")
|
|
465
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Cell);
|
|
466
|
-
else if (role == "checkbox")
|
|
467
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::CheckBox);
|
|
468
|
-
else if (role == "columnheader")
|
|
469
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ColumnHeader);
|
|
470
|
-
else if (role == "combobox")
|
|
471
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ComboBox);
|
|
472
|
-
else if (role == "complementary")
|
|
473
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Complementary);
|
|
474
|
-
else if (role == "contentinfo")
|
|
475
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ContentInfo);
|
|
476
|
-
else if (role == "definition")
|
|
477
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Definition);
|
|
478
|
-
else if (role == "dialog")
|
|
479
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Dialog);
|
|
480
|
-
else if (role == "directory")
|
|
481
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Directory);
|
|
482
|
-
else if (role == "document")
|
|
483
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Document);
|
|
484
|
-
else if (role == "feed")
|
|
485
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Feed);
|
|
486
|
-
else if (role == "figure")
|
|
487
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Figure);
|
|
488
|
-
else if (role == "form")
|
|
489
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Form);
|
|
490
|
-
else if (role == "grid")
|
|
491
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Grid);
|
|
492
|
-
else if (role == "group")
|
|
493
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Group);
|
|
494
|
-
else if (role == "heading")
|
|
495
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Heading);
|
|
496
|
-
else if (role == "img")
|
|
497
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Img);
|
|
498
|
-
else if (role == "link")
|
|
499
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Link);
|
|
500
|
-
else if (role == "list")
|
|
501
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::List);
|
|
502
|
-
else if (role == "listitem")
|
|
503
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ListItem);
|
|
504
|
-
else if (role == "log")
|
|
505
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Log);
|
|
506
|
-
else if (role == "main")
|
|
507
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Main);
|
|
508
|
-
else if (role == "marquee")
|
|
509
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Marquee);
|
|
510
|
-
else if (role == "math")
|
|
511
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Math);
|
|
512
|
-
else if (role == "menu")
|
|
513
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Menu);
|
|
514
|
-
else if (role == "menubar")
|
|
515
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::MenuBar);
|
|
516
|
-
else if (role == "menuitem")
|
|
517
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::MenuItem);
|
|
518
|
-
else if (role == "meter")
|
|
519
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Meter);
|
|
520
|
-
else if (role == "navigation")
|
|
521
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Navigation);
|
|
522
|
-
else if (role == "none")
|
|
523
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::None);
|
|
524
|
-
else if (role == "note")
|
|
525
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Note);
|
|
526
|
-
else if (role == "option")
|
|
527
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Option);
|
|
528
|
-
else if (role == "presentation")
|
|
529
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Presentation);
|
|
530
|
-
else if (role == "progressbar")
|
|
531
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ProgressBar);
|
|
532
|
-
else if (role == "radio")
|
|
533
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Radio);
|
|
534
|
-
else if (role == "radiogroup")
|
|
535
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::RadioGroup);
|
|
536
|
-
else if (role == "region")
|
|
537
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Region);
|
|
538
|
-
else if (role == "row")
|
|
539
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Row);
|
|
540
|
-
else if (role == "rowgroup")
|
|
541
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::RowGroup);
|
|
542
|
-
else if (role == "rowheader")
|
|
543
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::RowHeader);
|
|
544
|
-
else if (role == "scrollbar")
|
|
545
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ScrollBar);
|
|
546
|
-
else if (role == "searchbox")
|
|
547
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::SearchBox);
|
|
548
|
-
else if (role == "separator")
|
|
549
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Separator);
|
|
550
|
-
else if (role == "slider")
|
|
551
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Slider);
|
|
552
|
-
else if (role == "spinbutton")
|
|
553
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::SpinButton);
|
|
554
|
-
else if (role == "status")
|
|
555
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Status);
|
|
556
|
-
else if (role == "summary")
|
|
557
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Summary);
|
|
558
|
-
else if (role == "switch")
|
|
559
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Switch);
|
|
560
|
-
else if (role == "tab")
|
|
561
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Tab);
|
|
562
|
-
else if (role == "tablist")
|
|
563
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::TabList);
|
|
564
|
-
else if (role == "tabpanel")
|
|
565
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::TabPanel);
|
|
566
|
-
else if (role == "term")
|
|
567
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Term);
|
|
568
|
-
else if (role == "timer")
|
|
569
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Timer);
|
|
570
|
-
else if (role == "toolbar")
|
|
571
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ToolBar);
|
|
572
|
-
else if (role == "tooltip")
|
|
573
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::ToolTip);
|
|
574
|
-
else if (role == "tree")
|
|
575
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Tree);
|
|
576
|
-
else if (role == "treegrid")
|
|
577
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::TreeGrid);
|
|
578
|
-
else if (role == "treeitem")
|
|
579
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::TreeItem);
|
|
580
|
-
else
|
|
581
|
-
DynamicAutomationProperties::SetAriaRole(element, winrt::Microsoft::ReactNative::AriaRole::Unknown);
|
|
582
|
-
} else if (propertyValue.IsNull()) {
|
|
583
|
-
element.ClearValue(DynamicAutomationProperties::AriaRoleProperty());
|
|
584
|
-
}
|
|
585
|
-
} else if (propertyName == "accessibilityState") {
|
|
586
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Object) {
|
|
587
|
-
for (const auto &pair : propertyValue.AsObject()) {
|
|
588
|
-
// States are provided with the name and either a valid value if the state is supported or null if the state
|
|
589
|
-
// isn't
|
|
590
|
-
const std::string &innerName = pair.first;
|
|
591
|
-
const auto &innerValue = pair.second;
|
|
592
|
-
|
|
593
|
-
xaml::DependencyProperty targetDP = nullptr;
|
|
594
|
-
xaml::Automation::AutomationProperty targetAP = nullptr;
|
|
595
|
-
|
|
596
|
-
bool valueChanged = false;
|
|
597
|
-
|
|
598
|
-
winrt::IInspectable oldDPValue = xaml::DependencyProperty::UnsetValue();
|
|
599
|
-
winrt::IInspectable newDPValue = xaml::DependencyProperty::UnsetValue();
|
|
600
|
-
|
|
601
|
-
winrt::IInspectable oldAPValue = nullptr;
|
|
602
|
-
winrt::IInspectable newAPValue = nullptr;
|
|
603
|
-
|
|
604
|
-
// Determine which attached dependency property to update and which automation property to raise a changed
|
|
605
|
-
// event
|
|
606
|
-
if (innerName == "selected") {
|
|
607
|
-
targetDP = DynamicAutomationProperties::AccessibilityStateSelectedProperty();
|
|
608
|
-
targetAP = winrt::SelectionItemPatternIdentifiers::IsSelectedProperty();
|
|
609
|
-
} else if (innerName == "disabled") {
|
|
610
|
-
targetDP = DynamicAutomationProperties::AccessibilityStateDisabledProperty();
|
|
611
|
-
targetAP = winrt::AutomationElementIdentifiers::IsEnabledProperty();
|
|
612
|
-
} else if (innerName == "checked") {
|
|
613
|
-
targetDP = DynamicAutomationProperties::AccessibilityStateCheckedProperty();
|
|
614
|
-
targetAP = winrt::TogglePatternIdentifiers::ToggleStateProperty();
|
|
615
|
-
} else if (innerName == "busy") {
|
|
616
|
-
targetDP = DynamicAutomationProperties::AccessibilityStateBusyProperty();
|
|
617
|
-
targetAP = winrt::AutomationElementIdentifiers::ItemStatusProperty();
|
|
618
|
-
} else if (innerName == "expanded") {
|
|
619
|
-
targetDP = DynamicAutomationProperties::AccessibilityStateExpandedProperty();
|
|
620
|
-
targetAP = winrt::ExpandCollapsePatternIdentifiers::ExpandCollapseStateProperty();
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
if (targetDP != nullptr) {
|
|
624
|
-
// Determine values for DP and AP
|
|
625
|
-
|
|
626
|
-
oldDPValue = element.ReadLocalValue(targetDP);
|
|
627
|
-
|
|
628
|
-
const bool hasOldValue = oldDPValue != xaml::DependencyProperty::UnsetValue();
|
|
629
|
-
|
|
630
|
-
if (innerName == "checked") {
|
|
631
|
-
// Checked is special and can support null, boolean true, boolean false, or the string "mixed"
|
|
632
|
-
|
|
633
|
-
auto oldValue = hasOldValue
|
|
634
|
-
? winrt::unbox_value<winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue>(oldDPValue)
|
|
635
|
-
: winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue::Unchecked;
|
|
636
|
-
|
|
637
|
-
winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue newValue =
|
|
638
|
-
winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue::Unchecked;
|
|
639
|
-
|
|
640
|
-
const auto pRawBooleanNewValue = innerValue.TryGetBoolean();
|
|
641
|
-
const auto pRawStringNewValue = innerValue.TryGetString();
|
|
642
|
-
|
|
643
|
-
if (pRawBooleanNewValue != nullptr) {
|
|
644
|
-
// State value is a valid boolean
|
|
645
|
-
newValue = *pRawBooleanNewValue
|
|
646
|
-
? winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue::Checked
|
|
647
|
-
: winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue::Unchecked;
|
|
648
|
-
newDPValue = winrt::box_value<winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue>(newValue);
|
|
649
|
-
valueChanged = !hasOldValue || (oldValue != newValue); // Value was unset before or set but different
|
|
650
|
-
} else if (pRawStringNewValue != nullptr && *pRawStringNewValue == "mixed") {
|
|
651
|
-
// State value is the valid string "mixed"
|
|
652
|
-
newValue = winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue::Mixed;
|
|
653
|
-
newDPValue = winrt::box_value<winrt::Microsoft::ReactNative::AccessibilityStateCheckedValue>(newValue);
|
|
654
|
-
valueChanged = !hasOldValue || (oldValue != newValue); // Value was unset before or set but different
|
|
655
|
-
} else {
|
|
656
|
-
// State value is null or not valid
|
|
657
|
-
valueChanged = hasOldValue; // Value was set before
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
oldAPValue =
|
|
661
|
-
winrt::box_value(hasOldValue ? static_cast<winrt::ToggleState>(oldValue) : winrt::ToggleState::Off);
|
|
662
|
-
newAPValue = winrt::box_value(static_cast<winrt::ToggleState>(newValue));
|
|
663
|
-
} else {
|
|
664
|
-
// All other accessibility state values support null, boolean true or boolean false
|
|
665
|
-
|
|
666
|
-
auto oldValue = hasOldValue ? winrt::unbox_value<bool>(oldDPValue) : false;
|
|
667
|
-
|
|
668
|
-
const bool *pNewValue = innerValue.TryGetBoolean();
|
|
669
|
-
|
|
670
|
-
if (pNewValue != nullptr) {
|
|
671
|
-
// State value is a valid boolean
|
|
672
|
-
newDPValue = winrt::box_value<bool>(*pNewValue);
|
|
673
|
-
valueChanged = !hasOldValue || (oldValue != *pNewValue); // Value was unset before or set but different
|
|
674
|
-
} else {
|
|
675
|
-
// State value is null or not valid
|
|
676
|
-
valueChanged = hasOldValue; // Value was set before
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
if (innerName == "disabled") {
|
|
680
|
-
// Disabled maps to enabled, flip boolean
|
|
681
|
-
oldAPValue = winrt::box_value(!(hasOldValue ? oldValue : false));
|
|
682
|
-
newAPValue = winrt::box_value(!(pNewValue != nullptr ? *pNewValue : false));
|
|
683
|
-
} else if (innerName == "busy") {
|
|
684
|
-
oldAPValue = winrt::box_value(hasOldValue && oldValue ? L"Busy" : L"");
|
|
685
|
-
newAPValue = winrt::box_value(pNewValue != nullptr && *pNewValue ? L"Busy" : L"");
|
|
686
|
-
} else if (innerName == "expanded") {
|
|
687
|
-
oldAPValue = winrt::box_value(
|
|
688
|
-
hasOldValue && oldValue ? winrt::ExpandCollapseState::Expanded
|
|
689
|
-
: winrt::ExpandCollapseState::Collapsed);
|
|
690
|
-
newAPValue = winrt::box_value(
|
|
691
|
-
pNewValue != nullptr && *pNewValue ? winrt::ExpandCollapseState::Expanded
|
|
692
|
-
: winrt::ExpandCollapseState::Collapsed);
|
|
693
|
-
} else {
|
|
694
|
-
// Direct mapping of boolean
|
|
695
|
-
oldAPValue = winrt::box_value(hasOldValue ? oldValue : false);
|
|
696
|
-
newAPValue = winrt::box_value(pNewValue != nullptr ? *pNewValue : false);
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// Update attached dependency property for element
|
|
701
|
-
if (newDPValue != xaml::DependencyProperty::UnsetValue()) {
|
|
702
|
-
// State value was valid, so set
|
|
703
|
-
element.SetValue(targetDP, newDPValue);
|
|
704
|
-
} else {
|
|
705
|
-
// State value is null or not valid, so clear
|
|
706
|
-
element.ClearValue(targetDP);
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
// Raise automation property changed event if the value changed
|
|
710
|
-
if (valueChanged && targetAP != nullptr && oldAPValue != nullptr && newAPValue != nullptr) {
|
|
711
|
-
if (auto peer = xaml::Automation::Peers::FrameworkElementAutomationPeer::FromElement(element)) {
|
|
712
|
-
peer.RaisePropertyChangedEvent(targetAP, oldAPValue, newAPValue);
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
} else if (propertyName == "accessibilityValue") {
|
|
719
|
-
winrt::hstring textValue;
|
|
720
|
-
const int numericValuesCount = 3;
|
|
721
|
-
double numericValues[numericValuesCount] = {};
|
|
722
|
-
|
|
723
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Object) {
|
|
724
|
-
for (const auto &pair : propertyValue.AsObject()) {
|
|
725
|
-
const std::string &innerName = pair.first;
|
|
726
|
-
const auto &innerValue = pair.second;
|
|
727
|
-
|
|
728
|
-
auto peer = xaml::Automation::Peers::FrameworkElementAutomationPeer::FromElement(element);
|
|
729
|
-
|
|
730
|
-
if (innerName == "min" &&
|
|
731
|
-
(innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
732
|
-
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64)) {
|
|
733
|
-
numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Min)] =
|
|
734
|
-
innerValue.AsDouble();
|
|
735
|
-
|
|
736
|
-
const auto prevMinValue = DynamicAutomationProperties::GetAccessibilityValueMin(element);
|
|
737
|
-
if (peer != nullptr && prevMinValue != innerValue.AsDouble()) {
|
|
738
|
-
peer.RaisePropertyChangedEvent(
|
|
739
|
-
winrt::RangeValuePatternIdentifiers::MinimumProperty(),
|
|
740
|
-
winrt::box_value(prevMinValue),
|
|
741
|
-
winrt::box_value(innerValue.AsDouble()));
|
|
742
|
-
}
|
|
743
|
-
} else if (
|
|
744
|
-
innerName == "max" &&
|
|
745
|
-
(innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
746
|
-
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64)) {
|
|
747
|
-
numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Max)] =
|
|
748
|
-
innerValue.AsDouble();
|
|
749
|
-
|
|
750
|
-
const auto prevMaxValue = DynamicAutomationProperties::GetAccessibilityValueMax(element);
|
|
751
|
-
if (peer != nullptr && prevMaxValue != innerValue.AsDouble()) {
|
|
752
|
-
peer.RaisePropertyChangedEvent(
|
|
753
|
-
winrt::RangeValuePatternIdentifiers::MaximumProperty(),
|
|
754
|
-
winrt::box_value(prevMaxValue),
|
|
755
|
-
winrt::box_value(innerValue.AsDouble()));
|
|
756
|
-
}
|
|
757
|
-
} else if (
|
|
758
|
-
innerName == "now" &&
|
|
759
|
-
(innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
760
|
-
innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64)) {
|
|
761
|
-
numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Now)] =
|
|
762
|
-
innerValue.AsDouble();
|
|
763
|
-
|
|
764
|
-
const auto prevNowValue = DynamicAutomationProperties::GetAccessibilityValueNow(element);
|
|
765
|
-
if (peer != nullptr && prevNowValue != innerValue.AsDouble()) {
|
|
766
|
-
peer.RaisePropertyChangedEvent(
|
|
767
|
-
winrt::RangeValuePatternIdentifiers::ValueProperty(),
|
|
768
|
-
winrt::box_value(prevNowValue),
|
|
769
|
-
winrt::box_value(innerValue.AsDouble()));
|
|
770
|
-
}
|
|
771
|
-
} else if (innerName == "text" && innerValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
772
|
-
textValue = asHstring(innerValue);
|
|
773
|
-
|
|
774
|
-
const auto prevTextValue = DynamicAutomationProperties::GetAccessibilityValueText(element);
|
|
775
|
-
if (peer != nullptr && prevTextValue != textValue) {
|
|
776
|
-
peer.RaisePropertyChangedEvent(
|
|
777
|
-
winrt::ValuePatternIdentifiers::ValueProperty(),
|
|
778
|
-
winrt::box_value(prevTextValue),
|
|
779
|
-
winrt::box_value(textValue));
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
DynamicAutomationProperties::SetAccessibilityValueMin(
|
|
786
|
-
element, numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Min)]);
|
|
787
|
-
DynamicAutomationProperties::SetAccessibilityValueMax(
|
|
788
|
-
element, numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Max)]);
|
|
789
|
-
DynamicAutomationProperties::SetAccessibilityValueNow(
|
|
790
|
-
element, numericValues[static_cast<int32_t>(winrt::Microsoft::ReactNative::AccessibilityValue::Now)]);
|
|
791
|
-
DynamicAutomationProperties::SetAccessibilityValueText(element, textValue);
|
|
792
|
-
} else if (propertyName == "testID") {
|
|
793
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
794
|
-
auto value = asHstring(propertyValue);
|
|
795
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateString(value);
|
|
796
|
-
|
|
797
|
-
element.SetValue(xaml::Automation::AutomationProperties::AutomationIdProperty(), boxedValue);
|
|
798
|
-
} else if (propertyValue.IsNull()) {
|
|
799
|
-
element.ClearValue(xaml::Automation::AutomationProperties::AutomationIdProperty());
|
|
800
|
-
}
|
|
801
|
-
} else if (propertyName == "tooltip") {
|
|
802
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
803
|
-
winrt::ToolTipService::SetToolTip(element, winrt::box_value(asHstring(propertyValue)));
|
|
804
|
-
}
|
|
805
|
-
} else if (propertyName == "zIndex") {
|
|
806
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
|
|
807
|
-
propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64) {
|
|
808
|
-
auto value = static_cast<int>(propertyValue.AsDouble());
|
|
809
|
-
auto boxedValue = winrt::Windows::Foundation::PropertyValue::CreateInt32(value);
|
|
810
|
-
|
|
811
|
-
element.SetValue(winrt::Canvas::ZIndexProperty(), boxedValue);
|
|
812
|
-
} else if (propertyValue.IsNull()) {
|
|
813
|
-
element.ClearValue(winrt::Canvas::ZIndexProperty());
|
|
814
|
-
}
|
|
815
|
-
} else if (TryUpdateFlowDirection(element, propertyName, propertyValue)) {
|
|
816
|
-
} else if (propertyName == "accessibilityActions") {
|
|
817
|
-
auto value = json_type_traits<winrt::IVector<winrt::Microsoft::ReactNative::AccessibilityAction>>::parseJson(
|
|
818
|
-
propertyValue);
|
|
819
|
-
DynamicAutomationProperties::SetAccessibilityActions(element, value);
|
|
820
|
-
} else if (propertyName == "display") {
|
|
821
|
-
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
|
822
|
-
auto value = propertyValue.AsString();
|
|
823
|
-
if (value == "none") {
|
|
824
|
-
element.Visibility(xaml::Visibility::Collapsed);
|
|
825
|
-
} else {
|
|
826
|
-
element.Visibility(xaml::Visibility::Visible);
|
|
827
|
-
}
|
|
828
|
-
} else if (propertyValue.IsNull()) {
|
|
829
|
-
element.ClearValue(xaml::UIElement::VisibilityProperty());
|
|
830
|
-
}
|
|
831
|
-
} else {
|
|
832
|
-
return Super::UpdateProperty(nodeToUpdate, propertyName, propertyValue);
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
return true;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
winrt::hstring FrameworkElementViewManager::getControlTypeFromAccessibilityRole(
|
|
839
|
-
winrt::Microsoft::ReactNative::AccessibilityRoles role) {
|
|
840
|
-
switch (role) {
|
|
841
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Button:
|
|
842
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ImageButton:
|
|
843
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Switch:
|
|
844
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ToggleButton:
|
|
845
|
-
return winrt::to_hstring("button");
|
|
846
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Link:
|
|
847
|
-
return winrt::to_hstring("link");
|
|
848
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Image:
|
|
849
|
-
return winrt::to_hstring("image");
|
|
850
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::KeyboardKey:
|
|
851
|
-
return winrt::to_hstring("custom");
|
|
852
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Text:
|
|
853
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Header:
|
|
854
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Summary:
|
|
855
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Alert:
|
|
856
|
-
return winrt::to_hstring("text");
|
|
857
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Adjustable:
|
|
858
|
-
return winrt::to_hstring("slider");
|
|
859
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::CheckBox:
|
|
860
|
-
return winrt::to_hstring("checkbox");
|
|
861
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ComboBox:
|
|
862
|
-
return winrt::to_hstring("combobox");
|
|
863
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Menu:
|
|
864
|
-
return winrt::to_hstring("menu");
|
|
865
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::MenuBar:
|
|
866
|
-
return winrt::to_hstring("menubar");
|
|
867
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::MenuItem:
|
|
868
|
-
return winrt::to_hstring("menuitem");
|
|
869
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ProgressBar:
|
|
870
|
-
return winrt::to_hstring("progressbar");
|
|
871
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Radio:
|
|
872
|
-
return winrt::to_hstring("radiobutton");
|
|
873
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ScrollBar:
|
|
874
|
-
return winrt::to_hstring("scrollbar");
|
|
875
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::SpinButton:
|
|
876
|
-
return winrt::to_hstring("spinner");
|
|
877
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Tab:
|
|
878
|
-
return winrt::to_hstring("tabitem");
|
|
879
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::TabList:
|
|
880
|
-
return winrt::to_hstring("tab");
|
|
881
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ToolBar:
|
|
882
|
-
return winrt::to_hstring("toolbar");
|
|
883
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::List:
|
|
884
|
-
return winrt::to_hstring("list");
|
|
885
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::ListItem:
|
|
886
|
-
return winrt::to_hstring("listitem");
|
|
887
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::None:
|
|
888
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Search:
|
|
889
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::RadioGroup:
|
|
890
|
-
case winrt::Microsoft::ReactNative::AccessibilityRoles::Timer:
|
|
891
|
-
return winrt::to_hstring("group");
|
|
892
|
-
}
|
|
893
|
-
return winrt::to_hstring("custom");
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
void FrameworkElementViewManager::setLocalizedControlTypeFromAccessibilityRole(
|
|
897
|
-
xaml::UIElement element,
|
|
898
|
-
winrt::hstring value) {
|
|
899
|
-
auto controlTypeBoxedValue = winrt::Windows::Foundation::PropertyValue::CreateString(value);
|
|
900
|
-
element.SetValue(xaml::Automation::AutomationProperties::LocalizedControlTypeProperty(), controlTypeBoxedValue);
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
// Applies a TransformMatrix to the backing UIElement.
|
|
904
|
-
// In react-native, rotates and scales are applied about the center of the
|
|
905
|
-
// component, unlike XAML. Since the javascript layer sends a non-centered
|
|
906
|
-
// TransformMatrix, we need to compute the UIElement center and apply centering
|
|
907
|
-
// manually via this formula: tx = -TranslateCenter * TransformMatrix *
|
|
908
|
-
// TranslateCenter We accomplish this in several steps: 1) Create a PropertySet
|
|
909
|
-
// to hold both the TranslateCenter matrix and TransformMatrix. Stored on the
|
|
910
|
-
// shadow node.
|
|
911
|
-
// This allows us to generalize to the animated scenario as well.
|
|
912
|
-
// 2) To compute the CenterTransform we create an ExpressionAnimation that
|
|
913
|
-
// references the UIElement.ActualSize facade.
|
|
914
|
-
// This way whenever the ActualSize changes, the animation will automatically
|
|
915
|
-
// pick up the new value.
|
|
916
|
-
// 3) Create an ExpressionAnimation to multiply everything together.
|
|
917
|
-
void FrameworkElementViewManager::ApplyTransformMatrix(
|
|
918
|
-
xaml::UIElement uielement,
|
|
919
|
-
ShadowNodeBase *shadowNode,
|
|
920
|
-
winrt::Windows::Foundation::Numerics::float4x4 transformMatrix) {
|
|
921
|
-
// Get our PropertySet from the ShadowNode and insert the TransformMatrix as
|
|
922
|
-
// the "transform" property
|
|
923
|
-
auto transformPS = shadowNode->EnsureTransformPS();
|
|
924
|
-
transformPS.InsertMatrix4x4(L"transform", transformMatrix);
|
|
925
|
-
|
|
926
|
-
// Start the overall animation to multiply everything together
|
|
927
|
-
StartTransformAnimation(uielement, transformPS);
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
// Starts ExpressionAnimation targeting UIElement.TransformMatrix with centered
|
|
931
|
-
// transform
|
|
932
|
-
void FrameworkElementViewManager::StartTransformAnimation(
|
|
933
|
-
xaml::UIElement uielement,
|
|
934
|
-
comp::CompositionPropertySet transformPS) {
|
|
935
|
-
auto expression =
|
|
936
|
-
GetExpressionAnimationStore()->GetTransformCenteringExpression(Microsoft::ReactNative::GetCompositor(uielement));
|
|
937
|
-
expression.SetReferenceParameter(L"PS", transformPS);
|
|
938
|
-
expression.Target(L"TransformMatrix");
|
|
939
|
-
uielement.StartAnimation(expression);
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
// Used in scenario where View changes its backing Xaml element.
|
|
943
|
-
void FrameworkElementViewManager::RefreshTransformMatrix(ShadowNodeBase *shadowNode) {
|
|
944
|
-
if (shadowNode->HasTransformPS()) {
|
|
945
|
-
// First we need to update the reference parameter on the centering
|
|
946
|
-
// expression to point to the new backing UIElement.
|
|
947
|
-
shadowNode->UpdateTransformPS();
|
|
948
|
-
auto uielement = shadowNode->GetView().try_as<xaml::UIElement>();
|
|
949
|
-
assert(uielement != nullptr);
|
|
950
|
-
|
|
951
|
-
// Start a new ExpressionAnimation targeting the new
|
|
952
|
-
// UIElement.TransformMatrix.
|
|
953
|
-
StartTransformAnimation(uielement, shadowNode->EnsureTransformPS());
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
} // namespace Microsoft::ReactNative
|