react-native-windows 0.76.3 → 0.77.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +5 -1
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +2 -2
- package/Libraries/Animated/NativeAnimatedAllowlist.js +20 -9
- package/Libraries/Animated/animations/Animation.js +60 -25
- package/Libraries/Animated/animations/DecayAnimation.js +26 -38
- package/Libraries/Animated/animations/SpringAnimation.js +33 -39
- package/Libraries/Animated/animations/TimingAnimation.js +34 -42
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
- package/Libraries/Animated/createAnimatedComponent.js +60 -33
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
- package/Libraries/Animated/nodes/AnimatedNode.js +39 -45
- package/Libraries/Animated/nodes/AnimatedObject.js +13 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +104 -46
- package/Libraries/Animated/nodes/AnimatedStyle.js +116 -39
- package/Libraries/Animated/nodes/AnimatedTransform.js +56 -23
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -3
- package/Libraries/Animated/useAnimatedProps.js +41 -35
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +77 -5
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +82 -5
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
- package/Libraries/Components/Button.js +9 -4
- package/Libraries/Components/Button.windows.js +19 -5
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
- package/Libraries/Components/Glyph/Glyph.js +2 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -0
- package/Libraries/Components/Popup/PopupNativeComponent.js +0 -1
- package/Libraries/Components/Pressable/Pressable.js +4 -4
- package/Libraries/Components/Pressable/Pressable.windows.js +10 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +13 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
- package/Libraries/Components/ScrollView/ScrollView.js +49 -88
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +0 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +8 -9
- package/Libraries/Components/Switch/Switch.js +8 -6
- package/Libraries/Components/Switch/Switch.windows.js +8 -6
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +27 -4
- package/Libraries/Components/TextInput/TextInput.flow.js +36 -19
- package/Libraries/Components/TextInput/TextInput.js +37 -13
- package/Libraries/Components/TextInput/TextInput.windows.js +47 -16
- package/Libraries/Components/TextInput/TextInputState.js +11 -13
- package/Libraries/Components/TextInput/TextInputState.windows.js +11 -13
- package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
- package/Libraries/Components/Touchable/Position.js +7 -2
- package/Libraries/Components/Touchable/Touchable.js +4 -0
- package/Libraries/Components/Touchable/Touchable.windows.js +4 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +6 -2
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +227 -0
- package/Libraries/Components/Touchable/TouchableHighlight.js +5 -5
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +5 -5
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +371 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +6 -5
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +11 -5
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +9 -3
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -1
- package/Libraries/Components/View/View.js +4 -4
- package/Libraries/Components/View/View.windows.js +12 -5
- package/Libraries/Components/View/ViewAccessibility.d.ts +10 -0
- package/Libraries/Components/View/ViewAccessibility.windows.js +2 -0
- package/Libraries/Components/View/ViewNativeComponent.js +6 -98
- package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/Components/View/ViewPropTypes.js +0 -3
- package/Libraries/Components/View/ViewPropTypes.windows.js +2 -3
- package/Libraries/Core/ExceptionsManager.js +50 -29
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -10
- package/Libraries/Core/setUpDeveloperTools.js +1 -5
- package/Libraries/Core/setUpErrorHandling.js +20 -18
- package/Libraries/Core/setUpReactDevTools.js +107 -8
- package/Libraries/Core/setUpSegmentFetcher.js +1 -0
- package/Libraries/Core/setUpTimers.js +21 -18
- package/Libraries/Debugging/DebuggingOverlay.js +4 -5
- package/Libraries/Image/AssetSourceResolver.js +12 -1
- package/Libraries/Image/AssetSourceResolver.windows.js +12 -1
- package/Libraries/Image/Image.android.js +1 -5
- package/Libraries/Image/Image.d.ts +20 -29
- package/Libraries/Image/Image.ios.js +0 -2
- package/Libraries/Image/Image.windows.js +5 -1
- package/Libraries/Image/ImageBackground.js +2 -5
- package/Libraries/Image/ImageProps.js +7 -6
- package/Libraries/Image/ImageResizeMode.d.ts +8 -1
- package/Libraries/Image/ImageResizeMode.js +4 -1
- package/Libraries/Image/ImageSource.d.ts +0 -2
- package/Libraries/Image/ImageSource.js +0 -2
- package/Libraries/Image/ImageTypes.flow.js +11 -9
- package/Libraries/Image/ImageUtils.js +6 -3
- package/Libraries/Image/ImageViewNativeComponent.js +5 -3
- package/Libraries/Inspector/Inspector.js +1 -0
- package/Libraries/Inspector/NetworkOverlay.js +4 -0
- package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -14
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/InteractionManagerStub.js +176 -0
- package/Libraries/Interaction/TouchHistoryMath.js +22 -19
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +1 -2
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +7 -7
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +3 -3
- package/Libraries/LogBox/LogBox.js +18 -5
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
- package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.windows.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
- package/Libraries/Modal/Modal.d.ts +12 -0
- package/Libraries/Modal/Modal.js +31 -4
- package/Libraries/Modal/Modal.windows.js +18 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +72 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -11
- package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -1
- package/Libraries/Network/FormData.js +11 -3
- package/Libraries/Network/XHRInterceptor.js +63 -14
- package/Libraries/Network/XMLHttpRequest.js +26 -1
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/Pressability.js +2 -3
- package/Libraries/Pressability/Pressability.windows.js +2 -3
- package/Libraries/Pressability/usePressability.js +4 -1
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +1 -11
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
- package/Libraries/ReactNative/RendererImplementation.js +18 -17
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
- package/Libraries/ReactNative/renderApplication.js +9 -8
- package/Libraries/ReactNative/requireNativeComponent.js +5 -2
- package/Libraries/Renderer/shims/ReactFabric.js +3 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +3 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +22 -35
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +5 -6
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/StyleSheet/StyleSheet.js +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +13 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +24 -6
- package/Libraries/StyleSheet/processBackgroundImage.js +87 -110
- package/Libraries/StyleSheet/processTransform.js +3 -34
- package/Libraries/Text/Text.js +248 -249
- package/Libraries/Text/Text.windows.js +298 -292
- package/Libraries/Text/TextNativeComponent.js +0 -1
- package/Libraries/Text/TextProps.windows.js +2 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +5 -5
- package/Libraries/Types/CoreEventTypes.d.ts +3 -10
- package/Libraries/Types/CoreEventTypes.js +4 -6
- package/Libraries/Types/CoreEventTypes.windows.js +4 -6
- package/Libraries/Utilities/Appearance.js +3 -1
- package/Libraries/Utilities/BackHandler.android.js +6 -18
- package/Libraries/Utilities/BackHandler.d.ts +0 -4
- package/Libraries/Utilities/BackHandler.ios.js +0 -7
- package/Libraries/Utilities/BackHandler.windows.js +6 -18
- package/Libraries/Utilities/HMRClient.js +3 -4
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.windows.js +3 -2
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +26 -7
- package/Libraries/WebSocket/WebSocketEvent.js +4 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +6 -5
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +9 -8
- package/Microsoft.ReactNative/AsynchronousEventBeat.h +5 -5
- package/Microsoft.ReactNative/FBReactNativeSpec/FBReactNativeSpecJSI.h +5 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +197 -18
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +19 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +13 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +6 -8
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +3 -2
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +24 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +5 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +12 -12
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +4 -4
- package/Microsoft.ReactNative/Fabric/ImageRequest.cpp +4 -8
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +16 -15
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +15 -0
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +9 -0
- package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +20 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +11 -6
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/SynchronousEventBeat.cpp +14 -4
- package/Microsoft.ReactNative/SynchronousEventBeat.h +4 -2
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.cpp +78 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.h +51 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.inc +48 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi.cpp +41 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi.h +127 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi.inc +125 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_posix.cpp +16 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_win.cpp +23 -0
- package/Microsoft.ReactNative.Cxx/JSI/decorator.h +834 -0
- package/Microsoft.ReactNative.Cxx/JSI/instrumentation.h +117 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi-inl.h +366 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi.cpp +560 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi.h +1611 -0
- package/Microsoft.ReactNative.Cxx/JSI/threadsafe.h +79 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +7 -11
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +1 -1
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.cpp +2878 -0
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.h +36 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +64 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/SchedulerPriority.h +22 -0
- package/{ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core → Microsoft.ReactNative.Cxx}/ReactCommon/TurboModule.cpp +63 -63
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +165 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.cpp +105 -0
- package/{ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core → Microsoft.ReactNative.Cxx}/ReactCommon/TurboModuleUtils.h +57 -58
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +42 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +151 -0
- package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/Base.h +177 -154
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +25 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bridging.h +21 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +67 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +90 -0
- package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/Convert.h +170 -172
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +51 -0
- package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/EventEmitter.h +134 -136
- package/{ReactCommon/TEMP_UntilReactCommonUpdate → Microsoft.ReactNative.Cxx/ReactCommon}/react/bridging/Function.h +283 -283
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.cpp +63 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +61 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +93 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +104 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +107 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/flags.h +22 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +72 -0
- package/Microsoft.ReactNative.Cxx/node-api/js_native_api.h +553 -0
- package/Microsoft.ReactNative.Cxx/node-api/js_native_api_types.h +167 -0
- package/Microsoft.ReactNative.Cxx/node-api/js_runtime_api.h +186 -0
- package/Microsoft.ReactNative.Cxx/stubs/glog/logging.h +82 -0
- package/PropertySheets/Bundle.Common.targets +1 -1
- package/PropertySheets/Bundle.props +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/ManagedCodeGen/Microsoft.ReactNative.Managed.CodeGen.targets +1 -1
- package/PropertySheets/OutputMSBuildProperties.targets +3 -1
- package/PropertySheets/React.Cpp.props +6 -0
- package/ReactCommon/ReactCommon.vcxproj +5 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +61 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +26 -23
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +150 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +252 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +795 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +59 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +227 -74
- package/Scripts/Microsoft.ReactNative.Managed.CodeGen.targets +1 -1
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +97 -62
- package/Shared/InspectorPackagerConnection.cpp +3 -6
- package/Shared/InspectorPackagerConnection.h +2 -2
- package/Shared/InstanceManager.h +1 -1
- package/Shared/OInstance.h +1 -1
- package/Shared/Shared.vcxitems +17 -2
- package/Shared/Shared.vcxitems.filters +3 -1
- package/Shared/TurboModuleManager.cpp +29 -4
- package/codegen/NativeAccessibilityInfoSpec.g.h +27 -9
- package/codegen/NativeAccessibilityManagerSpec.g.h +19 -13
- package/codegen/NativeActionSheetManagerSpec.g.h +4 -0
- package/codegen/NativeExceptionsManagerSpec.g.h +1 -7
- package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +127 -3
- package/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h +67 -0
- package/codegen/NativeReactDevToolsSettingsManagerSpec.g.h +41 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +125 -137
- package/codegen/react/components/rnwcore/ComponentDescriptors.h +0 -1
- package/codegen/react/components/rnwcore/Props.cpp +1 -0
- package/codegen/react/components/rnwcore/Props.h +1 -0
- package/codegen/react/components/rnwcore/ShadowNodes.cpp +0 -1
- package/codegen/react/components/rnwcore/ShadowNodes.h +0 -11
- package/codegen/react/components/rnwcore/States.h +0 -12
- package/codegen/rnwcoreJSI-generated.cpp +219 -186
- package/codegen/rnwcoreJSI.h +942 -511
- package/index.js +10 -3
- package/index.windows.js +10 -3
- package/jest/setup.js +36 -1
- package/just-task.js +15 -0
- package/package.json +22 -22
- package/src/private/animated/NativeAnimatedHelper.js +18 -16
- package/src/private/animated/useAnimatedPropsMemo.js +356 -0
- package/src/private/components/HScrollViewNativeComponents.js +1 -27
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +11 -8
- package/src/private/components/VScrollViewNativeComponents.js +2 -25
- package/src/private/debugging/ReactDevToolsSettingsManager.android.js +20 -0
- package/src/private/debugging/ReactDevToolsSettingsManager.ios.js +30 -0
- package/src/private/debugging/ReactDevToolsSettingsManager.windows.js +20 -0
- package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
- package/src/private/devmenu/DevMenu.d.ts +20 -0
- package/src/private/devmenu/DevMenu.js +31 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +95 -86
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +8 -2
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -19
- package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
- package/src/private/setup/setUpDOM.js +14 -6
- package/src/private/setup/setUpMutationObserver.js +5 -0
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +9 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
- package/src/private/specs/modules/NativeAppearance.js +4 -10
- package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
- package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
- package/src/private/webapis/dom/geometry/DOMRect.js +2 -2
- package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +2 -2
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +102 -11
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +26 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +9 -0
- package/src/private/webapis/performance/EventTiming.js +13 -8
- package/src/private/webapis/performance/Performance.js +66 -73
- package/src/private/webapis/performance/PerformanceEntry.js +2 -5
- package/src/private/webapis/performance/PerformanceObserver.js +65 -164
- package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +11 -7
- package/src/private/webapis/performance/Utilities.js +18 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +71 -2
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +267 -0
- package/templates/cpp-lib/template.config.js +13 -7
- package/templates/templateUtils.js +10 -0
- package/types/index.d.ts +1 -1
- package/types/public/ReactNativeTypes.d.ts +4 -8
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.windows.js +0 -35
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
- package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +0 -101
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +0 -569
- package/codegen/NativeDevToolsSettingsManagerSpec.g.h +0 -53
- package/codegen/NativePerformanceObserverSpec.g.h +0 -131
- package/src/private/components/useSyncOnScroll.js +0 -48
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -61
- package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -67
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -127
- package/types/experimental.d.ts +0 -59
- /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <folly/dynamic.h>
|
|
11
|
+
#include <glog/logging.h>
|
|
12
|
+
#include <react/debug/react_native_assert.h>
|
|
13
|
+
#include <react/debug/react_native_expect.h>
|
|
14
|
+
#include <react/renderer/components/view/AccessibilityPrimitives.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/core/propsConversions.h>
|
|
17
|
+
|
|
18
|
+
#include <unordered_map>
|
|
19
|
+
|
|
20
|
+
namespace facebook::react {
|
|
21
|
+
|
|
22
|
+
inline void fromString(const std::string& string, AccessibilityTraits& result) {
|
|
23
|
+
if (string == "none") {
|
|
24
|
+
result = AccessibilityTraits::None;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (string == "button" || string == "togglebutton") {
|
|
28
|
+
result = AccessibilityTraits::Button;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (string == "link") {
|
|
32
|
+
result = AccessibilityTraits::Link;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (string == "image" || string == "img") {
|
|
36
|
+
result = AccessibilityTraits::Image;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (string == "selected") {
|
|
40
|
+
result = AccessibilityTraits::Selected;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (string == "plays") {
|
|
44
|
+
result = AccessibilityTraits::PlaysSound;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (string == "keyboardkey" || string == "key") {
|
|
48
|
+
result = AccessibilityTraits::KeyboardKey;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (string == "text") {
|
|
52
|
+
result = AccessibilityTraits::StaticText;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (string == "disabled") {
|
|
56
|
+
result = AccessibilityTraits::NotEnabled;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (string == "frequentUpdates") {
|
|
60
|
+
result = AccessibilityTraits::UpdatesFrequently;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (string == "search") {
|
|
64
|
+
result = AccessibilityTraits::SearchField;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (string == "startsMedia") {
|
|
68
|
+
result = AccessibilityTraits::StartsMediaSession;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (string == "adjustable") {
|
|
72
|
+
result = AccessibilityTraits::Adjustable;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (string == "allowsDirectInteraction") {
|
|
76
|
+
result = AccessibilityTraits::AllowsDirectInteraction;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (string == "pageTurn") {
|
|
80
|
+
result = AccessibilityTraits::CausesPageTurn;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (string == "header" || string == "heading") {
|
|
84
|
+
result = AccessibilityTraits::Header;
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (string == "imagebutton") {
|
|
88
|
+
result = AccessibilityTraits::Image | AccessibilityTraits::Button;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (string == "summary") {
|
|
92
|
+
result = AccessibilityTraits::SummaryElement;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (string == "switch") {
|
|
96
|
+
result = AccessibilityTraits::Switch;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (string == "tabbar") {
|
|
100
|
+
result = AccessibilityTraits::TabBar;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (string == "progressbar") {
|
|
104
|
+
result = AccessibilityTraits::UpdatesFrequently;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
result = AccessibilityTraits::None;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
inline void fromRawValue(
|
|
111
|
+
const PropsParserContext& context,
|
|
112
|
+
const RawValue& value,
|
|
113
|
+
AccessibilityTraits& result) {
|
|
114
|
+
if (value.hasType<std::string>()) {
|
|
115
|
+
fromString((std::string)value, result);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
result = {};
|
|
120
|
+
|
|
121
|
+
react_native_expect(value.hasType<std::vector<std::string>>());
|
|
122
|
+
if (value.hasType<std::vector<std::string>>()) {
|
|
123
|
+
auto items = (std::vector<std::string>)value;
|
|
124
|
+
for (auto& item : items) {
|
|
125
|
+
AccessibilityTraits itemAccessibilityTraits;
|
|
126
|
+
fromString(item, itemAccessibilityTraits);
|
|
127
|
+
result = result | itemAccessibilityTraits;
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
LOG(ERROR) << "AccessibilityTraits parsing: unsupported type";
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
inline void fromRawValue(
|
|
135
|
+
const PropsParserContext& context,
|
|
136
|
+
const RawValue& value,
|
|
137
|
+
AccessibilityState& result) {
|
|
138
|
+
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
139
|
+
auto selected = map.find("selected");
|
|
140
|
+
if (selected != map.end()) {
|
|
141
|
+
fromRawValue(context, selected->second, result.selected);
|
|
142
|
+
}
|
|
143
|
+
auto disabled = map.find("disabled");
|
|
144
|
+
if (disabled != map.end()) {
|
|
145
|
+
fromRawValue(context, disabled->second, result.disabled);
|
|
146
|
+
}
|
|
147
|
+
auto checked = map.find("checked");
|
|
148
|
+
if (checked != map.end()) {
|
|
149
|
+
if (checked->second.hasType<std::string>()) {
|
|
150
|
+
if ((std::string)checked->second == "mixed") {
|
|
151
|
+
result.checked = AccessibilityState::Mixed;
|
|
152
|
+
} else {
|
|
153
|
+
result.checked = AccessibilityState::None;
|
|
154
|
+
}
|
|
155
|
+
} else if (checked->second.hasType<bool>()) {
|
|
156
|
+
if ((bool)checked->second == true) {
|
|
157
|
+
result.checked = AccessibilityState::Checked;
|
|
158
|
+
} else {
|
|
159
|
+
result.checked = AccessibilityState::Unchecked;
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
result.checked = AccessibilityState::None;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
auto busy = map.find("busy");
|
|
166
|
+
if (busy != map.end()) {
|
|
167
|
+
fromRawValue(context, busy->second, result.busy);
|
|
168
|
+
}
|
|
169
|
+
auto expanded = map.find("expanded");
|
|
170
|
+
if (expanded != map.end()) {
|
|
171
|
+
fromRawValue(context, expanded->second, result.expanded);
|
|
172
|
+
}
|
|
173
|
+
// [Windows] - DO NOT REMOVE - required for Windows ISelectionProvider Implementation
|
|
174
|
+
auto multiselectable = map.find("multiselectable");
|
|
175
|
+
if (multiselectable != map.end()) {
|
|
176
|
+
fromRawValue(context, multiselectable->second, result.multiselectable);
|
|
177
|
+
}
|
|
178
|
+
auto required = map.find("required");
|
|
179
|
+
if (required != map.end()) {
|
|
180
|
+
fromRawValue(context, required->second, result.required);
|
|
181
|
+
}
|
|
182
|
+
// [Windows] - DO NOT REMOVE
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
inline std::string toString(
|
|
186
|
+
const ImportantForAccessibility& importantForAccessibility) {
|
|
187
|
+
switch (importantForAccessibility) {
|
|
188
|
+
case ImportantForAccessibility::Auto:
|
|
189
|
+
return "auto";
|
|
190
|
+
case ImportantForAccessibility::Yes:
|
|
191
|
+
return "yes";
|
|
192
|
+
case ImportantForAccessibility::No:
|
|
193
|
+
return "no";
|
|
194
|
+
case ImportantForAccessibility::NoHideDescendants:
|
|
195
|
+
return "no-hide-descendants";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
inline void fromRawValue(
|
|
200
|
+
const PropsParserContext& context,
|
|
201
|
+
const RawValue& value,
|
|
202
|
+
ImportantForAccessibility& result) {
|
|
203
|
+
result = ImportantForAccessibility::Auto;
|
|
204
|
+
react_native_expect(value.hasType<std::string>());
|
|
205
|
+
if (value.hasType<std::string>()) {
|
|
206
|
+
auto string = (std::string)value;
|
|
207
|
+
if (string == "auto") {
|
|
208
|
+
result = ImportantForAccessibility::Auto;
|
|
209
|
+
} else if (string == "yes") {
|
|
210
|
+
result = ImportantForAccessibility::Yes;
|
|
211
|
+
} else if (string == "no") {
|
|
212
|
+
result = ImportantForAccessibility::No;
|
|
213
|
+
} else if (string == "no-hide-descendants") {
|
|
214
|
+
result = ImportantForAccessibility::NoHideDescendants;
|
|
215
|
+
} else {
|
|
216
|
+
LOG(ERROR) << "Unsupported ImportantForAccessibility value: " << string;
|
|
217
|
+
react_native_expect(false);
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
LOG(ERROR) << "Unsupported ImportantForAccessibility type";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
inline void fromRawValue(
|
|
225
|
+
const PropsParserContext& context,
|
|
226
|
+
const RawValue& value,
|
|
227
|
+
AccessibilityAction& result) {
|
|
228
|
+
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
229
|
+
|
|
230
|
+
auto name = map.find("name");
|
|
231
|
+
react_native_assert(name != map.end() && name->second.hasType<std::string>());
|
|
232
|
+
if (name != map.end()) {
|
|
233
|
+
fromRawValue(context, name->second, result.name);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
auto label = map.find("label");
|
|
237
|
+
if (label != map.end()) {
|
|
238
|
+
if (label->second.hasType<std::string>()) {
|
|
239
|
+
result.label = (std::string)label->second;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
inline void fromRawValue(
|
|
245
|
+
const PropsParserContext&,
|
|
246
|
+
const RawValue& value,
|
|
247
|
+
AccessibilityValue& result) {
|
|
248
|
+
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
249
|
+
|
|
250
|
+
auto min = map.find("min");
|
|
251
|
+
if (min != map.end()) {
|
|
252
|
+
if (min->second.hasType<int>()) {
|
|
253
|
+
result.min = (int)min->second;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
auto max = map.find("max");
|
|
258
|
+
if (max != map.end()) {
|
|
259
|
+
if (max->second.hasType<int>()) {
|
|
260
|
+
result.max = (int)max->second;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
auto now = map.find("now");
|
|
265
|
+
if (now != map.end()) {
|
|
266
|
+
if (now->second.hasType<int>()) {
|
|
267
|
+
result.now = (int)now->second;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
auto text = map.find("text");
|
|
272
|
+
if (text != map.end()) {
|
|
273
|
+
if (text->second.hasType<std::string>()) {
|
|
274
|
+
result.text = (std::string)text->second;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
inline void fromRawValue(
|
|
280
|
+
const PropsParserContext& context,
|
|
281
|
+
const RawValue& value,
|
|
282
|
+
AccessibilityLabelledBy& result) {
|
|
283
|
+
if (value.hasType<std::string>()) {
|
|
284
|
+
result.value.push_back((std::string)value);
|
|
285
|
+
} else if (value.hasType<std::vector<std::string>>()) {
|
|
286
|
+
result.value = (std::vector<std::string>)value;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
inline void fromRawValue(
|
|
291
|
+
const PropsParserContext& context,
|
|
292
|
+
const RawValue& value,
|
|
293
|
+
AccessibilityLiveRegion& result) {
|
|
294
|
+
result = AccessibilityLiveRegion::None;
|
|
295
|
+
react_native_expect(value.hasType<std::string>());
|
|
296
|
+
if (value.hasType<std::string>()) {
|
|
297
|
+
auto string = (std::string)value;
|
|
298
|
+
if (string == "none") {
|
|
299
|
+
result = AccessibilityLiveRegion::None;
|
|
300
|
+
} else if (string == "polite") {
|
|
301
|
+
result = AccessibilityLiveRegion::Polite;
|
|
302
|
+
} else if (string == "assertive") {
|
|
303
|
+
result = AccessibilityLiveRegion::Assertive;
|
|
304
|
+
} else {
|
|
305
|
+
LOG(ERROR) << "Unsupported AccessibilityLiveRegion value: " << string;
|
|
306
|
+
react_native_expect(false);
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
LOG(ERROR) << "Unsupported AccessibilityLiveRegion type";
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
inline std::string toString(const AccessibilityRole& accessibilityRole) {
|
|
314
|
+
switch (accessibilityRole) {
|
|
315
|
+
case AccessibilityRole::None:
|
|
316
|
+
return "none";
|
|
317
|
+
case AccessibilityRole::Button:
|
|
318
|
+
return "button";
|
|
319
|
+
case AccessibilityRole::Dropdownlist:
|
|
320
|
+
return "dropdownlist";
|
|
321
|
+
case AccessibilityRole::Togglebutton:
|
|
322
|
+
return "togglebutton";
|
|
323
|
+
case AccessibilityRole::Link:
|
|
324
|
+
return "link";
|
|
325
|
+
case AccessibilityRole::Search:
|
|
326
|
+
return "search";
|
|
327
|
+
case AccessibilityRole::Image:
|
|
328
|
+
return "image";
|
|
329
|
+
case AccessibilityRole::Keyboardkey:
|
|
330
|
+
return "keyboardkey";
|
|
331
|
+
case AccessibilityRole::Text:
|
|
332
|
+
return "text";
|
|
333
|
+
case AccessibilityRole::Adjustable:
|
|
334
|
+
return "adjustable";
|
|
335
|
+
case AccessibilityRole::Imagebutton:
|
|
336
|
+
return "imagebutton";
|
|
337
|
+
case AccessibilityRole::Header:
|
|
338
|
+
return "header";
|
|
339
|
+
case AccessibilityRole::Summary:
|
|
340
|
+
return "summary";
|
|
341
|
+
case AccessibilityRole::Alert:
|
|
342
|
+
return "alert";
|
|
343
|
+
case AccessibilityRole::Checkbox:
|
|
344
|
+
return "checkbox";
|
|
345
|
+
case AccessibilityRole::Combobox:
|
|
346
|
+
return "combobox";
|
|
347
|
+
case AccessibilityRole::Menu:
|
|
348
|
+
return "menu";
|
|
349
|
+
case AccessibilityRole::Menubar:
|
|
350
|
+
return "menubar";
|
|
351
|
+
case AccessibilityRole::Menuitem:
|
|
352
|
+
return "menuitem";
|
|
353
|
+
case AccessibilityRole::Progressbar:
|
|
354
|
+
return "progressbar";
|
|
355
|
+
case AccessibilityRole::Radio:
|
|
356
|
+
return "radio";
|
|
357
|
+
case AccessibilityRole::Radiogroup:
|
|
358
|
+
return "radiogroup";
|
|
359
|
+
case AccessibilityRole::Scrollbar:
|
|
360
|
+
return "scrollbar";
|
|
361
|
+
case AccessibilityRole::Spinbutton:
|
|
362
|
+
return "spinbutton";
|
|
363
|
+
case AccessibilityRole::Switch:
|
|
364
|
+
return "switch";
|
|
365
|
+
case AccessibilityRole::Tab:
|
|
366
|
+
return "tab";
|
|
367
|
+
case AccessibilityRole::Tabbar:
|
|
368
|
+
return "tabbar";
|
|
369
|
+
case AccessibilityRole::Tablist:
|
|
370
|
+
return "tablist";
|
|
371
|
+
case AccessibilityRole::Timer:
|
|
372
|
+
return "timer";
|
|
373
|
+
case AccessibilityRole::List:
|
|
374
|
+
return "timer";
|
|
375
|
+
case AccessibilityRole::Toolbar:
|
|
376
|
+
return "toolbar";
|
|
377
|
+
case AccessibilityRole::Grid:
|
|
378
|
+
return "grid";
|
|
379
|
+
case AccessibilityRole::Pager:
|
|
380
|
+
return "pager";
|
|
381
|
+
case AccessibilityRole::Scrollview:
|
|
382
|
+
return "scrollview";
|
|
383
|
+
case AccessibilityRole::Horizontalscrollview:
|
|
384
|
+
return "horizontalscrollview";
|
|
385
|
+
case AccessibilityRole::Viewgroup:
|
|
386
|
+
return "viewgroup";
|
|
387
|
+
case AccessibilityRole::Webview:
|
|
388
|
+
return "webview";
|
|
389
|
+
case AccessibilityRole::Drawerlayout:
|
|
390
|
+
return "drawerlayout";
|
|
391
|
+
case AccessibilityRole::Slidingdrawer:
|
|
392
|
+
return "slidingdrawer";
|
|
393
|
+
case AccessibilityRole::Iconmenu:
|
|
394
|
+
return "iconmenu";
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
LOG(ERROR) << "Unsupported AccessibilityRole value";
|
|
398
|
+
react_native_expect(false);
|
|
399
|
+
// sane default for prod
|
|
400
|
+
return "none";
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
inline void fromRawValue(
|
|
404
|
+
const PropsParserContext& context,
|
|
405
|
+
const RawValue& value,
|
|
406
|
+
AccessibilityRole& result) {
|
|
407
|
+
react_native_expect(value.hasType<std::string>());
|
|
408
|
+
if (value.hasType<std::string>()) {
|
|
409
|
+
auto string = (std::string)value;
|
|
410
|
+
if (string == "none") {
|
|
411
|
+
result = AccessibilityRole::None;
|
|
412
|
+
} else if (string == "button") {
|
|
413
|
+
result = AccessibilityRole::Button;
|
|
414
|
+
} else if (string == "dropdownlist") {
|
|
415
|
+
result = AccessibilityRole::Dropdownlist;
|
|
416
|
+
} else if (string == "togglebutton") {
|
|
417
|
+
result = AccessibilityRole::Togglebutton;
|
|
418
|
+
} else if (string == "link") {
|
|
419
|
+
result = AccessibilityRole::Link;
|
|
420
|
+
} else if (string == "search") {
|
|
421
|
+
result = AccessibilityRole::Search;
|
|
422
|
+
} else if (string == "image") {
|
|
423
|
+
result = AccessibilityRole::Image;
|
|
424
|
+
} else if (string == "keyboardkey") {
|
|
425
|
+
result = AccessibilityRole::Keyboardkey;
|
|
426
|
+
} else if (string == "text") {
|
|
427
|
+
result = AccessibilityRole::Text;
|
|
428
|
+
} else if (string == "adjustable") {
|
|
429
|
+
result = AccessibilityRole::Adjustable;
|
|
430
|
+
} else if (string == "imagebutton") {
|
|
431
|
+
result = AccessibilityRole::Imagebutton;
|
|
432
|
+
} else if (string == "header") {
|
|
433
|
+
result = AccessibilityRole::Header;
|
|
434
|
+
} else if (string == "summary") {
|
|
435
|
+
result = AccessibilityRole::Summary;
|
|
436
|
+
} else if (string == "alert") {
|
|
437
|
+
result = AccessibilityRole::Alert;
|
|
438
|
+
} else if (string == "checkbox") {
|
|
439
|
+
result = AccessibilityRole::Checkbox;
|
|
440
|
+
} else if (string == "combobox") {
|
|
441
|
+
result = AccessibilityRole::Combobox;
|
|
442
|
+
} else if (string == "menu") {
|
|
443
|
+
result = AccessibilityRole::Menu;
|
|
444
|
+
} else if (string == "menubar") {
|
|
445
|
+
result = AccessibilityRole::Menubar;
|
|
446
|
+
} else if (string == "menuitem") {
|
|
447
|
+
result = AccessibilityRole::Menuitem;
|
|
448
|
+
} else if (string == "progressbar") {
|
|
449
|
+
result = AccessibilityRole::Progressbar;
|
|
450
|
+
} else if (string == "radio") {
|
|
451
|
+
result = AccessibilityRole::Radio;
|
|
452
|
+
} else if (string == "radiogroup") {
|
|
453
|
+
result = AccessibilityRole::Radiogroup;
|
|
454
|
+
} else if (string == "scrollbar") {
|
|
455
|
+
result = AccessibilityRole::Scrollbar;
|
|
456
|
+
} else if (string == "spinbutton") {
|
|
457
|
+
result = AccessibilityRole::Spinbutton;
|
|
458
|
+
} else if (string == "switch") {
|
|
459
|
+
result = AccessibilityRole::Switch;
|
|
460
|
+
} else if (string == "tab") {
|
|
461
|
+
result = AccessibilityRole::Tab;
|
|
462
|
+
} else if (string == "tabbar") {
|
|
463
|
+
result = AccessibilityRole::Tabbar;
|
|
464
|
+
} else if (string == "tablist") {
|
|
465
|
+
result = AccessibilityRole::Tablist;
|
|
466
|
+
} else if (string == "timer") {
|
|
467
|
+
result = AccessibilityRole::Timer;
|
|
468
|
+
} else if (string == "toolbar") {
|
|
469
|
+
result = AccessibilityRole::Toolbar;
|
|
470
|
+
} else if (string == "grid") {
|
|
471
|
+
result = AccessibilityRole::Grid;
|
|
472
|
+
} else if (string == "pager") {
|
|
473
|
+
result = AccessibilityRole::Pager;
|
|
474
|
+
} else if (string == "scrollview") {
|
|
475
|
+
result = AccessibilityRole::Scrollview;
|
|
476
|
+
} else if (string == "horizontalscrollview") {
|
|
477
|
+
result = AccessibilityRole::Horizontalscrollview;
|
|
478
|
+
} else if (string == "viewgroup") {
|
|
479
|
+
result = AccessibilityRole::Viewgroup;
|
|
480
|
+
} else if (string == "webview") {
|
|
481
|
+
result = AccessibilityRole::Webview;
|
|
482
|
+
} else if (string == "drawerlayout") {
|
|
483
|
+
result = AccessibilityRole::Drawerlayout;
|
|
484
|
+
} else if (string == "slidingdrawer") {
|
|
485
|
+
result = AccessibilityRole::Slidingdrawer;
|
|
486
|
+
} else if (string == "iconmenu") {
|
|
487
|
+
result = AccessibilityRole::Iconmenu;
|
|
488
|
+
} else {
|
|
489
|
+
LOG(ERROR) << "Unsupported AccessibilityRole value: " << string;
|
|
490
|
+
react_native_expect(false);
|
|
491
|
+
// sane default for prod
|
|
492
|
+
result = AccessibilityRole::None;
|
|
493
|
+
}
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
LOG(ERROR) << "Unsupported AccessibilityRole type";
|
|
498
|
+
react_native_expect(false);
|
|
499
|
+
// sane default for prod
|
|
500
|
+
result = AccessibilityRole::None;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
inline std::string toString(const Role& role) {
|
|
504
|
+
switch (role) {
|
|
505
|
+
case Role::Alert:
|
|
506
|
+
return "alert";
|
|
507
|
+
case Role::Alertdialog:
|
|
508
|
+
return "alertdialog";
|
|
509
|
+
case Role::Application:
|
|
510
|
+
return "application";
|
|
511
|
+
case Role::Article:
|
|
512
|
+
return "article";
|
|
513
|
+
case Role::Banner:
|
|
514
|
+
return "banner";
|
|
515
|
+
case Role::Button:
|
|
516
|
+
return "button";
|
|
517
|
+
case Role::Cell:
|
|
518
|
+
return "cell";
|
|
519
|
+
case Role::Checkbox:
|
|
520
|
+
return "checkbox";
|
|
521
|
+
case Role::Columnheader:
|
|
522
|
+
return "columnheader";
|
|
523
|
+
case Role::Combobox:
|
|
524
|
+
return "combobox";
|
|
525
|
+
case Role::Complementary:
|
|
526
|
+
return "complementary";
|
|
527
|
+
case Role::Contentinfo:
|
|
528
|
+
return "contentinfo";
|
|
529
|
+
case Role::Definition:
|
|
530
|
+
return "definition";
|
|
531
|
+
case Role::Dialog:
|
|
532
|
+
return "dialog";
|
|
533
|
+
case Role::Directory:
|
|
534
|
+
return "directory";
|
|
535
|
+
case Role::Document:
|
|
536
|
+
return "document";
|
|
537
|
+
case Role::Feed:
|
|
538
|
+
return "feed";
|
|
539
|
+
case Role::Figure:
|
|
540
|
+
return "figure";
|
|
541
|
+
case Role::Form:
|
|
542
|
+
return "form";
|
|
543
|
+
case Role::Grid:
|
|
544
|
+
return "grid";
|
|
545
|
+
case Role::Group:
|
|
546
|
+
return "group";
|
|
547
|
+
case Role::Heading:
|
|
548
|
+
return "heading";
|
|
549
|
+
case Role::Img:
|
|
550
|
+
return "img";
|
|
551
|
+
case Role::Link:
|
|
552
|
+
return "link";
|
|
553
|
+
case Role::List:
|
|
554
|
+
return "list";
|
|
555
|
+
case Role::Listitem:
|
|
556
|
+
return "listitem";
|
|
557
|
+
case Role::Log:
|
|
558
|
+
return "log";
|
|
559
|
+
case Role::Main:
|
|
560
|
+
return "main";
|
|
561
|
+
case Role::Marquee:
|
|
562
|
+
return "marquee";
|
|
563
|
+
case Role::Math:
|
|
564
|
+
return "math";
|
|
565
|
+
case Role::Menu:
|
|
566
|
+
return "menu";
|
|
567
|
+
case Role::Menubar:
|
|
568
|
+
return "menubar";
|
|
569
|
+
case Role::Menuitem:
|
|
570
|
+
return "menuitem";
|
|
571
|
+
case Role::Meter:
|
|
572
|
+
return "meter";
|
|
573
|
+
case Role::Navigation:
|
|
574
|
+
return "navigation";
|
|
575
|
+
case Role::None:
|
|
576
|
+
return "none";
|
|
577
|
+
case Role::Note:
|
|
578
|
+
return "note";
|
|
579
|
+
case Role::Option:
|
|
580
|
+
return "option";
|
|
581
|
+
case Role::Presentation:
|
|
582
|
+
return "presentation";
|
|
583
|
+
case Role::Progressbar:
|
|
584
|
+
return "progressbar";
|
|
585
|
+
case Role::Radio:
|
|
586
|
+
return "radio";
|
|
587
|
+
case Role::Radiogroup:
|
|
588
|
+
return "radiogroup";
|
|
589
|
+
case Role::Region:
|
|
590
|
+
return "region";
|
|
591
|
+
case Role::Row:
|
|
592
|
+
return "row";
|
|
593
|
+
case Role::Rowgroup:
|
|
594
|
+
return "rowgroup";
|
|
595
|
+
case Role::Rowheader:
|
|
596
|
+
return "rowheader";
|
|
597
|
+
case Role::Scrollbar:
|
|
598
|
+
return "scrollbar";
|
|
599
|
+
case Role::Searchbox:
|
|
600
|
+
return "searchbox";
|
|
601
|
+
case Role::Separator:
|
|
602
|
+
return "separator";
|
|
603
|
+
case Role::Slider:
|
|
604
|
+
return "slider";
|
|
605
|
+
case Role::Spinbutton:
|
|
606
|
+
return "spinbutton";
|
|
607
|
+
case Role::Status:
|
|
608
|
+
return "status";
|
|
609
|
+
case Role::Summary:
|
|
610
|
+
return "summary";
|
|
611
|
+
case Role::Switch:
|
|
612
|
+
return "switch";
|
|
613
|
+
case Role::Tab:
|
|
614
|
+
return "tab";
|
|
615
|
+
case Role::Table:
|
|
616
|
+
return "table";
|
|
617
|
+
case Role::Tablist:
|
|
618
|
+
return "tablist";
|
|
619
|
+
case Role::Tabpanel:
|
|
620
|
+
return "tabpanel";
|
|
621
|
+
case Role::Term:
|
|
622
|
+
return "term";
|
|
623
|
+
case Role::Timer:
|
|
624
|
+
return "timer";
|
|
625
|
+
case Role::Toolbar:
|
|
626
|
+
return "toolbar";
|
|
627
|
+
case Role::Tooltip:
|
|
628
|
+
return "tooltip";
|
|
629
|
+
case Role::Tree:
|
|
630
|
+
return "tree";
|
|
631
|
+
case Role::Treegrid:
|
|
632
|
+
return "treegrid";
|
|
633
|
+
case Role::Treeitem:
|
|
634
|
+
return "treeitem";
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
LOG(ERROR) << "Unsupported Role value";
|
|
638
|
+
react_native_expect(false);
|
|
639
|
+
// sane default for prod
|
|
640
|
+
return "none";
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
inline void fromRawValue(
|
|
644
|
+
const PropsParserContext& context,
|
|
645
|
+
const RawValue& value,
|
|
646
|
+
Role& result) {
|
|
647
|
+
react_native_expect(value.hasType<std::string>());
|
|
648
|
+
if (value.hasType<std::string>()) {
|
|
649
|
+
auto string = (std::string)value;
|
|
650
|
+
if (string == "alert") {
|
|
651
|
+
result = Role::Alert;
|
|
652
|
+
} else if (string == "alertdialog") {
|
|
653
|
+
result = Role::Alertdialog;
|
|
654
|
+
} else if (string == "application") {
|
|
655
|
+
result = Role::Application;
|
|
656
|
+
} else if (string == "article") {
|
|
657
|
+
result = Role::Article;
|
|
658
|
+
} else if (string == "banner") {
|
|
659
|
+
result = Role::Banner;
|
|
660
|
+
} else if (string == "button") {
|
|
661
|
+
result = Role::Button;
|
|
662
|
+
} else if (string == "cell") {
|
|
663
|
+
result = Role::Cell;
|
|
664
|
+
} else if (string == "checkbox") {
|
|
665
|
+
result = Role::Checkbox;
|
|
666
|
+
} else if (string == "columnheader") {
|
|
667
|
+
result = Role::Columnheader;
|
|
668
|
+
} else if (string == "combobox") {
|
|
669
|
+
result = Role::Combobox;
|
|
670
|
+
} else if (string == "complementary") {
|
|
671
|
+
result = Role::Complementary;
|
|
672
|
+
} else if (string == "contentinfo") {
|
|
673
|
+
result = Role::Contentinfo;
|
|
674
|
+
} else if (string == "definition") {
|
|
675
|
+
result = Role::Definition;
|
|
676
|
+
} else if (string == "dialog") {
|
|
677
|
+
result = Role::Dialog;
|
|
678
|
+
} else if (string == "directory") {
|
|
679
|
+
result = Role::Directory;
|
|
680
|
+
} else if (string == "document") {
|
|
681
|
+
result = Role::Document;
|
|
682
|
+
} else if (string == "feed") {
|
|
683
|
+
result = Role::Feed;
|
|
684
|
+
} else if (string == "figure") {
|
|
685
|
+
result = Role::Figure;
|
|
686
|
+
} else if (string == "form") {
|
|
687
|
+
result = Role::Form;
|
|
688
|
+
} else if (string == "grid") {
|
|
689
|
+
result = Role::Grid;
|
|
690
|
+
} else if (string == "group") {
|
|
691
|
+
result = Role::Group;
|
|
692
|
+
} else if (string == "heading") {
|
|
693
|
+
result = Role::Heading;
|
|
694
|
+
} else if (string == "img") {
|
|
695
|
+
result = Role::Img;
|
|
696
|
+
} else if (string == "link") {
|
|
697
|
+
result = Role::Link;
|
|
698
|
+
} else if (string == "list") {
|
|
699
|
+
result = Role::List;
|
|
700
|
+
} else if (string == "listitem") {
|
|
701
|
+
result = Role::Listitem;
|
|
702
|
+
} else if (string == "log") {
|
|
703
|
+
result = Role::Log;
|
|
704
|
+
} else if (string == "main") {
|
|
705
|
+
result = Role::Main;
|
|
706
|
+
} else if (string == "marquee") {
|
|
707
|
+
result = Role::Marquee;
|
|
708
|
+
} else if (string == "math") {
|
|
709
|
+
result = Role::Math;
|
|
710
|
+
} else if (string == "menu") {
|
|
711
|
+
result = Role::Menu;
|
|
712
|
+
} else if (string == "menubar") {
|
|
713
|
+
result = Role::Menubar;
|
|
714
|
+
} else if (string == "menuitem") {
|
|
715
|
+
result = Role::Menuitem;
|
|
716
|
+
} else if (string == "meter") {
|
|
717
|
+
result = Role::Meter;
|
|
718
|
+
} else if (string == "navigation") {
|
|
719
|
+
result = Role::Navigation;
|
|
720
|
+
} else if (string == "none") {
|
|
721
|
+
result = Role::None;
|
|
722
|
+
} else if (string == "note") {
|
|
723
|
+
result = Role::Note;
|
|
724
|
+
} else if (string == "option") {
|
|
725
|
+
result = Role::Option;
|
|
726
|
+
} else if (string == "presentation") {
|
|
727
|
+
result = Role::Presentation;
|
|
728
|
+
} else if (string == "progressbar") {
|
|
729
|
+
result = Role::Progressbar;
|
|
730
|
+
} else if (string == "radio") {
|
|
731
|
+
result = Role::Radio;
|
|
732
|
+
} else if (string == "radiogroup") {
|
|
733
|
+
result = Role::Radiogroup;
|
|
734
|
+
} else if (string == "region") {
|
|
735
|
+
result = Role::Region;
|
|
736
|
+
} else if (string == "row") {
|
|
737
|
+
result = Role::Row;
|
|
738
|
+
} else if (string == "rowgroup") {
|
|
739
|
+
result = Role::Rowgroup;
|
|
740
|
+
} else if (string == "rowheader") {
|
|
741
|
+
result = Role::Rowheader;
|
|
742
|
+
} else if (string == "scrollbar") {
|
|
743
|
+
result = Role::Scrollbar;
|
|
744
|
+
} else if (string == "searchbox") {
|
|
745
|
+
result = Role::Searchbox;
|
|
746
|
+
} else if (string == "separator") {
|
|
747
|
+
result = Role::Separator;
|
|
748
|
+
} else if (string == "slider") {
|
|
749
|
+
result = Role::Slider;
|
|
750
|
+
} else if (string == "spinbutton") {
|
|
751
|
+
result = Role::Spinbutton;
|
|
752
|
+
} else if (string == "status") {
|
|
753
|
+
result = Role::Status;
|
|
754
|
+
} else if (string == "summary") {
|
|
755
|
+
result = Role::Summary;
|
|
756
|
+
} else if (string == "switch") {
|
|
757
|
+
result = Role::Switch;
|
|
758
|
+
} else if (string == "tab") {
|
|
759
|
+
result = Role::Tab;
|
|
760
|
+
} else if (string == "table") {
|
|
761
|
+
result = Role::Table;
|
|
762
|
+
} else if (string == "tablist") {
|
|
763
|
+
result = Role::Tablist;
|
|
764
|
+
} else if (string == "tabpanel") {
|
|
765
|
+
result = Role::Tabpanel;
|
|
766
|
+
} else if (string == "term") {
|
|
767
|
+
result = Role::Term;
|
|
768
|
+
} else if (string == "timer") {
|
|
769
|
+
result = Role::Timer;
|
|
770
|
+
} else if (string == "toolbar") {
|
|
771
|
+
result = Role::Toolbar;
|
|
772
|
+
} else if (string == "tooltip") {
|
|
773
|
+
result = Role::Tooltip;
|
|
774
|
+
} else if (string == "tree") {
|
|
775
|
+
result = Role::Tree;
|
|
776
|
+
} else if (string == "treegrid") {
|
|
777
|
+
result = Role::Treegrid;
|
|
778
|
+
} else if (string == "treeitem") {
|
|
779
|
+
result = Role::Treeitem;
|
|
780
|
+
} else {
|
|
781
|
+
LOG(ERROR) << "Unsupported Role value: " << string;
|
|
782
|
+
react_native_expect(false);
|
|
783
|
+
// sane default for prod
|
|
784
|
+
result = Role::None;
|
|
785
|
+
}
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
LOG(ERROR) << "Unsupported Role type";
|
|
790
|
+
react_native_expect(false);
|
|
791
|
+
// sane default for prod
|
|
792
|
+
result = Role::None;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
} // namespace facebook::react
|