react-native-windows 0.71.10 → 0.72.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 +13 -3
- package/Directory.Build.props +19 -19
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +1 -1
- package/Libraries/Alert/Alert.d.ts +4 -4
- package/Libraries/Alert/Alert.windows.js +2 -0
- package/Libraries/Alert/NativeDialogManagerWindows.js +1 -0
- package/Libraries/Animated/Animated.d.ts +17 -6
- package/Libraries/Animated/NativeAnimatedHelper.js +18 -6
- package/Libraries/Animated/bezier.js +1 -1
- package/Libraries/Animated/components/AnimatedFlatList.js +8 -3
- package/Libraries/Animated/components/AnimatedScrollView.js +4 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +12 -3
- package/Libraries/Animated/createAnimatedComponent.js +26 -239
- package/Libraries/Animated/nodes/AnimatedColor.js +47 -80
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +167 -121
- package/Libraries/Animated/nodes/AnimatedNode.js +3 -5
- package/Libraries/Animated/nodes/AnimatedProps.js +7 -6
- package/Libraries/Animated/nodes/AnimatedStyle.js +42 -8
- package/Libraries/Animated/nodes/AnimatedTransform.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +8 -12
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -1
- package/Libraries/Animated/useAnimatedProps.js +7 -10
- package/Libraries/AppTheme/AppTheme.js +1 -0
- package/Libraries/AppTheme/AppThemeTypes.d.ts +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +2 -1
- package/Libraries/BatchedBridge/NativeModules.d.ts +1 -1
- package/Libraries/BatchedBridge/NativeModules.js +1 -0
- package/Libraries/Blob/Blob.js +4 -0
- package/Libraries/Blob/FileReader.js +30 -2
- package/Libraries/Blob/URL.js +3 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +2 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +2 -3
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +6 -4
- package/Libraries/Components/Button.js +3 -2
- package/Libraries/Components/Button.windows.js +3 -2
- package/Libraries/Components/Clipboard/Clipboard.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
- package/Libraries/Components/Flyout/Flyout.d.ts +55 -19
- package/Libraries/Components/Flyout/Flyout.js +110 -51
- package/Libraries/Components/Flyout/FlyoutNativeComponent.js +45 -0
- package/Libraries/Components/Glyph/Glyph.d.ts +29 -12
- package/Libraries/Components/Glyph/Glyph.js +43 -30
- package/Libraries/Components/Glyph/GlyphNativeComponent.js +31 -0
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +1 -0
- package/Libraries/Components/Keyboard/KeyboardExtProps.d.ts +2 -2
- package/Libraries/Components/Keyboard/KeyboardExtProps.js.map +1 -1
- package/Libraries/Components/Popup/Popup.d.ts +41 -19
- package/Libraries/Components/Popup/Popup.js +86 -52
- package/Libraries/Components/Popup/PopupNativeComponent.js +49 -0
- package/Libraries/Components/Pressable/Pressable.d.ts +1 -1
- package/Libraries/Components/Pressable/Pressable.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -0
- package/Libraries/Components/RefreshControl/RefreshControl.windows.js +1 -0
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +1 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +1 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +12 -6
- package/Libraries/Components/ScrollView/ScrollView.d.ts +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +149 -91
- package/Libraries/Components/ScrollView/ScrollView.windows.js +1939 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -6
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +175 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -7
- package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -0
- package/Libraries/Components/Switch/Switch.js +3 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +21 -11
- package/Libraries/Components/TextInput/InputAccessoryView.d.ts +1 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +11 -5
- package/Libraries/Components/TextInput/TextInput.d.ts +15 -5
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -1
- package/Libraries/Components/TextInput/TextInput.js +130 -103
- package/Libraries/Components/TextInput/TextInput.windows.js +152 -115
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -1
- package/Libraries/Components/Touchable/Touchable.d.ts +1 -1
- package/Libraries/Components/Touchable/Touchable.flow.js +30 -4
- package/Libraries/Components/Touchable/Touchable.js +6 -3
- package/Libraries/Components/Touchable/Touchable.windows.js +6 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +2 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableOpacity.js +3 -0
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +4 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -2
- package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +179 -0
- package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlayNativeComponent.js +43 -0
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +26 -0
- package/Libraries/Components/View/View.js +35 -16
- package/Libraries/Components/View/View.windows.js +40 -16
- package/Libraries/Components/View/ViewAccessibility.d.ts +6 -6
- package/Libraries/Components/View/ViewAccessibility.js +10 -1
- package/Libraries/Components/View/ViewAccessibility.windows.js +9 -0
- package/Libraries/Components/View/ViewNativeComponent.js +32 -8
- package/Libraries/Components/View/ViewPropTypes.d.ts +1 -1
- package/Libraries/Components/View/ViewPropTypes.js +1 -1
- package/Libraries/Components/View/ViewPropTypes.windows.js +3 -1
- package/Libraries/Core/Devtools/openFileInEditor.js +1 -0
- package/Libraries/Core/Devtools/openURLInBrowser.js +1 -0
- package/Libraries/Core/Devtools/parseErrorStack.js +2 -2
- package/Libraries/Core/Devtools/parseHermesStack.js +54 -34
- package/Libraries/Core/ExceptionsManager.js +2 -2
- package/Libraries/Core/InitializeCore.js +2 -1
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.js +4 -8
- package/Libraries/Core/Timers/JSTimers.js +1 -1
- package/Libraries/Core/Timers/immediateShim.js +1 -0
- package/Libraries/Core/Timers/queueMicrotask.js +1 -1
- package/Libraries/Core/setUpAlert.js +1 -1
- package/Libraries/Core/setUpDOM.js +18 -0
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpGlobals.js +5 -2
- package/Libraries/Core/setUpNavigator.js +6 -5
- package/Libraries/Core/setUpPerformance.js +23 -13
- package/Libraries/Core/setUpReactDevTools.js +2 -0
- package/Libraries/Core/setUpSegmentFetcher.js +0 -41
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/DOM/Geometry/DOMRect.js +82 -0
- package/Libraries/DOM/Geometry/DOMRectReadOnly.js +188 -0
- package/Libraries/DOM/Nodes/ReactNativeElement.js +75 -0
- package/Libraries/DOM/Nodes/ReadOnlyElement.js +89 -0
- package/Libraries/DOM/Nodes/ReadOnlyNode.js +167 -0
- package/Libraries/DOM/OldStyleCollections/ArrayLikeUtils.js +46 -0
- package/Libraries/DOM/OldStyleCollections/DOMRectList.js +76 -0
- package/Libraries/DOM/OldStyleCollections/HTMLCollection.js +82 -0
- package/Libraries/DOM/OldStyleCollections/NodeList.js +104 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +35 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +20 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +49 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.windows.js +35 -0
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +24 -0
- package/Libraries/EventEmitter/NativeEventEmitter.d.ts +1 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +1 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +9 -1
- package/Libraries/Events/EventPolyfill.js +1 -1
- package/Libraries/Image/AssetRegistry.js +1 -1
- package/Libraries/Image/AssetSourceResolver.js +3 -3
- package/Libraries/Image/Image.android.js +4 -1
- package/Libraries/Image/Image.d.ts +63 -2
- package/Libraries/Image/Image.ios.js +3 -0
- package/Libraries/Image/Image.windows.js +3 -0
- package/Libraries/Image/ImageBackground.js +1 -0
- package/Libraries/Image/ImageProps.js +1 -1
- package/Libraries/Image/ImageViewNativeComponent.js +4 -4
- package/Libraries/Image/RelativeImageStub.js +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +1 -1
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Inspector/DevtoolsOverlay.js +26 -19
- package/Libraries/Inspector/ElementBox.js +4 -1
- package/Libraries/Inspector/Inspector.js +5 -6
- package/Libraries/Inspector/InspectorOverlay.js +3 -3
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -1
- package/Libraries/Interaction/PanResponder.js +5 -6
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -1
- package/Libraries/Linking/Linking.js +1 -4
- package/Libraries/Lists/FillRateHelper.js +4 -238
- package/Libraries/Lists/FlatList.d.ts +15 -22
- package/Libraries/Lists/FlatList.js +9 -6
- package/Libraries/Lists/SectionList.d.ts +10 -6
- package/Libraries/Lists/SectionList.js +5 -3
- package/Libraries/Lists/SectionListModern.js +3 -3
- package/Libraries/Lists/ViewabilityHelper.js +8 -344
- package/Libraries/Lists/VirtualizeUtils.js +4 -244
- package/Libraries/Lists/VirtualizedList.js +10 -1867
- package/Libraries/Lists/VirtualizedListContext.js +6 -104
- package/Libraries/Lists/VirtualizedSectionList.js +9 -602
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +1 -0
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspector.js +1 -3
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.windows.js +167 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +172 -0
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +193 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -0
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.windows.js +118 -0
- package/Libraries/LogBox/UI/LogBoxMessage.js +87 -5
- package/Libraries/LogBox/UI/LogBoxNotification.js +5 -7
- package/Libraries/Modal/Modal.js +2 -2
- package/Libraries/NativeComponent/BaseViewConfig.android.js +32 -12
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +43 -19
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +77 -19
- package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +4 -1
- package/Libraries/NativeComponent/ViewConfig.js +1 -0
- package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -4
- package/Libraries/Network/RCTNetworking.android.js +2 -2
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +1 -1
- package/Libraries/Pressability/Pressability.js +10 -4
- package/Libraries/Pressability/Pressability.windows.js +11 -4
- package/Libraries/ReactNative/AppContainer.js +7 -1
- package/Libraries/ReactNative/AppRegistry.d.ts +1 -1
- package/Libraries/ReactNative/AppRegistry.js +10 -13
- package/Libraries/ReactNative/FabricUIManager.js +24 -8
- package/Libraries/ReactNative/NativeUIManager.js +5 -5
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +10 -10
- package/Libraries/ReactNative/UIManager.js +168 -1
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +5 -5
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
- package/Libraries/ReactNative/requireNativeComponent.d.ts +1 -1
- package/Libraries/ReactNative/requireNativeComponent.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +26 -3
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +13 -1
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +13 -1
- package/Libraries/Renderer/public/ReactFabricPublicInstanceUtils.js +38 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +6 -6
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +7 -7
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +115 -76
- package/Libraries/StyleSheet/StyleSheetTypes.js +188 -33
- package/Libraries/StyleSheet/flattenStyle.js +2 -0
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/processColor.js +1 -1
- package/Libraries/Text/Text.d.ts +12 -2
- package/Libraries/Text/Text.js +50 -41
- package/Libraries/Text/Text.windows.js +48 -38
- package/Libraries/Text/TextProps.js +3 -4
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
- package/Libraries/Types/CodegenTypes.js +1 -0
- package/Libraries/UTFSequence.js +3 -1
- package/Libraries/Utilities/Appearance.d.ts +10 -0
- package/Libraries/Utilities/Appearance.js +13 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/GlobalPerformanceLogger.js +12 -1
- package/Libraries/Utilities/HMRClient.js +16 -10
- package/Libraries/Utilities/{createPerformanceLogger.d.ts → IPerformanceLogger.d.ts} +4 -4
- package/Libraries/Utilities/IPerformanceLogger.js +49 -0
- package/Libraries/Utilities/LoadingView.android.js +28 -11
- package/Libraries/Utilities/NativeAppearance.js +1 -0
- package/Libraries/Utilities/NativePlatformConstantsWin.js +1 -1
- package/Libraries/Utilities/PixelRatio.js +2 -2
- package/Libraries/Utilities/Platform.windows.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/__mocks__/PixelRatio.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +2 -0
- package/Libraries/Utilities/createPerformanceLogger.js +55 -43
- package/Libraries/Utilities/stringifySafe.js +2 -7
- package/Libraries/Utilities/useColorScheme.windows.js +26 -0
- package/Libraries/Utilities/useWindowDimensions.js +3 -3
- package/Libraries/WebPerformance/EventCounts.js +78 -0
- package/Libraries/WebPerformance/MemoryInfo.js +54 -0
- package/Libraries/WebPerformance/NativePerformance.js +38 -0
- package/Libraries/WebPerformance/NativePerformanceObserver.js +22 -7
- package/Libraries/WebPerformance/Performance.js +312 -0
- package/Libraries/WebPerformance/PerformanceEntry.js +45 -0
- package/Libraries/WebPerformance/PerformanceEventTiming.js +38 -0
- package/Libraries/WebPerformance/PerformanceObserver.js +196 -101
- package/Libraries/WebPerformance/RawPerformanceEntry.js +87 -0
- package/Libraries/WebPerformance/ReactNativeStartupTiming.js +65 -0
- package/Libraries/WebPerformance/__mocks__/NativePerformance.js +65 -0
- package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +101 -0
- package/Libraries/YellowBox/YellowBoxDeprecated.js +1 -1
- package/Libraries/platform-types.d.ts +3 -5
- package/Libraries/vendor/core/ErrorUtils.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.d.ts +2 -2
- package/Libraries/vendor/emitter/EventEmitter.js +9 -1
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +0 -15
- package/Microsoft.ReactNative/CompositionHwndHost.idl +6 -0
- package/Microsoft.ReactNative/CompositionRootView.idl +35 -0
- package/Microsoft.ReactNative/CompositionSwitcher.idl +19 -0
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +174 -0
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +91 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +48 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.h +48 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.h +19 -2
- package/Microsoft.ReactNative/Fabric/Composition/AbiCompositionViewComponentView.cpp +144 -0
- package/Microsoft.ReactNative/Fabric/Composition/AbiCompositionViewComponentView.h +63 -0
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +27 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +97 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +227 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +38 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +112 -95
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +12 -8
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHelpers.h +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +27 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.h +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +147 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +46 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.cpp +31 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.h +37 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +255 -50
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +34 -15
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +127 -47
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +11 -7
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +109 -39
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +10 -7
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +106 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +63 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +116 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +43 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +53 -38
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +12 -8
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +262 -0
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +62 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +35 -30
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +11 -9
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +72 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +16 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +168 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +49 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +19 -53
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -3
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +8 -9
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +100 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.h +43 -0
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/WindowsViewProps.cpp +61 -0
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/WindowsViewProps.h +34 -0
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/primitives.h +42 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +10 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/core/graphicsConversions.h +248 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Color.cpp +5 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Color.h +135 -4
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/conversions.h +18 -240
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +107 -17
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +13 -2
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +87 -0
- package/Microsoft.ReactNative/IReactContext.cpp +4 -0
- package/Microsoft.ReactNative/IReactContext.h +1 -0
- package/Microsoft.ReactNative/IReactContext.idl +5 -0
- package/Microsoft.ReactNative/IReactDispatcher.cpp +4 -0
- package/Microsoft.ReactNative/IReactDispatcher.h +1 -0
- package/Microsoft.ReactNative/IReactPackageBuilderFabric.idl +23 -0
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +23 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +4 -118
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +1 -7
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +100 -4
- package/Microsoft.ReactNative/Modules/AlertModule.h +4 -0
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.cpp +9 -0
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.h +2 -0
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +7 -5
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +17 -3
- package/Microsoft.ReactNative/Modules/Animated/ValueAnimatedNode.h +1 -0
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +3 -0
- package/Microsoft.ReactNative/Modules/ClipboardModule.cpp +4 -4
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +2 -2
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +27 -7
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +9 -5
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +10 -12
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +4 -4
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +21 -1
- package/Microsoft.ReactNative/QuirkSettings.cpp +17 -0
- package/Microsoft.ReactNative/QuirkSettings.h +5 -0
- package/Microsoft.ReactNative/QuirkSettings.idl +6 -0
- package/Microsoft.ReactNative/ReactApplication.cpp +8 -0
- package/Microsoft.ReactNative/ReactApplication.h +3 -0
- package/Microsoft.ReactNative/ReactApplication.idl +3 -0
- package/Microsoft.ReactNative/ReactCoreInjection.cpp +29 -0
- package/Microsoft.ReactNative/ReactCoreInjection.h +6 -0
- package/Microsoft.ReactNative/ReactCoreInjection.idl +13 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +7 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +1 -0
- package/Microsoft.ReactNative/ReactHost/React.h +2 -0
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +57 -16
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -0
- package/Microsoft.ReactNative/ReactInstanceSettings.h +12 -0
- package/Microsoft.ReactNative/ReactInstanceSettings.idl +6 -0
- package/Microsoft.ReactNative/ReactNativeHost.cpp +17 -0
- package/Microsoft.ReactNative/ReactPackageBuilder.cpp +18 -0
- package/Microsoft.ReactNative/ReactPackageBuilder.h +24 -1
- package/Microsoft.ReactNative/ReactRootView.cpp +2 -2
- package/Microsoft.ReactNative/RedBox.cpp +2 -1
- package/Microsoft.ReactNative/Utils/Helpers.cpp +0 -32
- package/Microsoft.ReactNative/Utils/Helpers.h +0 -8
- package/Microsoft.ReactNative/Utils/ImageUtils.cpp +69 -6
- package/Microsoft.ReactNative/Utils/ImageUtils.h +3 -1
- package/Microsoft.ReactNative/Utils/KeyboardUtils.cpp +416 -0
- package/Microsoft.ReactNative/Utils/KeyboardUtils.h +15 -0
- package/Microsoft.ReactNative/Utils/TransformableText.h +1 -0
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +1 -9
- package/Microsoft.ReactNative/Utils/ValueUtils.h +0 -2
- package/Microsoft.ReactNative/ViewProps.idl +30 -0
- package/Microsoft.ReactNative/Views/ControlViewManager.cpp +6 -2
- package/Microsoft.ReactNative/Views/DevMenu.cpp +369 -230
- package/Microsoft.ReactNative/Views/DevMenu.h +3 -15
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +6 -3
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +11 -3
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.h +5 -1
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +29 -22
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +2 -2
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.cpp +10 -405
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.h +0 -3
- package/Microsoft.ReactNative/Views/PopupViewManager.cpp +1 -0
- package/Microsoft.ReactNative/Views/ScrollViewManager.cpp +2 -2
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +7 -0
- package/Microsoft.ReactNative/Views/ShadowNodeBase.h +3 -0
- package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.cpp +6 -1
- package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.cpp +1 -0
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +38 -2
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +3 -0
- package/Microsoft.ReactNative/Views/TouchEventHandler.h +0 -4
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +0 -8
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +1 -1
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +12 -3
- package/Microsoft.ReactNative/XamlHelper.cpp +36 -0
- package/Microsoft.ReactNative/XamlHelper.h +27 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +4 -4
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +4 -4
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +10 -8
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.h +3 -3
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +4 -1
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
- package/Microsoft.ReactNative.Cxx/NativeModules.h +16 -1
- package/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs +2 -0
- package/Microsoft.ReactNative.Managed/packages.lock.json +5 -5
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.ProjectReferences.props +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/JSEngine.props +1 -2
- package/PropertySheets/Warnings.props +1 -1
- package/ReactCommon/ReactCommon.vcxproj +2 -4
- package/ReactCommon/ReactCommon.vcxproj.filters +3 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/LongLivedObject.cpp +60 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/LongLivedObject.h +60 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp +116 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleBinding.h +63 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/TouchEventEmitter.cpp +237 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/TouchEventEmitter.h +59 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewEventEmitter.cpp +159 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewEventEmitter.h +94 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.cpp +465 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.h +116 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewShadowNode.cpp +98 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/YogaStylableProps.cpp +362 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/primitives.h +326 -0
- package/ReactCommon/Yoga.cpp +60 -127
- package/Scripts/OfficeReact.Win32.nuspec +1 -0
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +1 -0
- package/Scripts/rnw-dependencies.ps1 +14 -6
- package/Shared/Composition/CompositionSwitcher.interop.h +1 -0
- package/Shared/DevServerHelper.h +11 -2
- package/Shared/DevSettings.h +1 -0
- package/Shared/DevSupportManager.cpp +11 -1
- package/Shared/DevSupportManager.h +1 -0
- package/Shared/HermesRuntimeHolder.cpp +53 -30
- package/Shared/HermesRuntimeHolder.h +26 -11
- package/Shared/HermesSamplingProfiler.cpp +61 -8
- package/Shared/HermesSamplingProfiler.h +6 -3
- package/Shared/HermesShim.cpp +86 -82
- package/Shared/HermesShim.h +28 -8
- package/Shared/JSI/ChakraRuntime.cpp +7 -4
- package/Shared/JSI/ChakraRuntime.h +4 -4
- package/Shared/JSI/NapiJsiV8RuntimeHolder.h +2 -0
- package/Shared/JSI/RuntimeHolder.h +2 -2
- package/Shared/Logging.cpp +1 -1
- package/Shared/Modules/BlobModule.cpp +3 -4
- package/Shared/Modules/BlobModule.h +0 -4
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +13 -17
- package/Shared/Networking/OriginPolicyHttpFilter.h +11 -12
- package/Shared/Networking/WinRTWebSocketResource.cpp +59 -45
- package/Shared/OInstance.cpp +9 -2
- package/Shared/Shared.vcxitems +265 -58
- package/Shared/Shared.vcxitems.filters +312 -42
- package/Shared/V8JSIRuntimeHolder.cpp +1 -0
- package/Shared/V8JSIRuntimeHolder.h +7 -2
- package/codegen/NativeAppearanceSpec.g.h +9 -3
- package/codegen/NativeClipboardSpec.g.h +3 -3
- package/codegen/NativeDevSplitBundleLoaderSpec.g.h +3 -3
- package/codegen/NativeDevToolsSettingsManagerSpec.g.h +51 -0
- package/codegen/NativeDialogManagerWindowsSpec.g.h +2 -0
- package/codegen/NativeFileReaderModuleSpec.g.h +6 -6
- package/codegen/NativeHeadlessJsTaskSupportSpec.g.h +3 -3
- package/codegen/NativeImageLoaderAndroidSpec.g.h +25 -9
- package/codegen/NativeImageLoaderIOSSpec.g.h +20 -12
- package/codegen/NativeIntentAndroidSpec.g.h +15 -15
- package/codegen/NativeLinkingManagerSpec.g.h +12 -12
- package/codegen/NativePerformanceObserverSpec.g.h +48 -10
- package/codegen/NativePerformanceSpec.g.h +63 -0
- package/codegen/NativePermissionsAndroidSpec.g.h +9 -9
- package/codegen/NativePlatformConstantsWinSpec.g.h +1 -1
- package/codegen/NativePushNotificationManagerIOSSpec.g.h +6 -6
- package/codegen/NativeSampleTurboModuleSpec.g.h +25 -19
- package/codegen/NativeShareModuleSpec.g.h +9 -3
- package/codegen/NativeUIManagerSpec.g.h +12 -12
- package/codegen/react/components/rnwcore/ComponentDescriptors.h +1 -2
- package/codegen/react/components/rnwcore/EventEmitters.cpp +21 -29
- package/codegen/react/components/rnwcore/EventEmitters.h +30 -30
- package/codegen/react/components/rnwcore/Props.cpp +47 -48
- package/codegen/react/components/rnwcore/Props.h +59 -166
- package/codegen/react/components/rnwcore/ShadowNodes.cpp +1 -2
- package/codegen/react/components/rnwcore/ShadowNodes.h +11 -22
- package/codegen/react/components/rnwcore/States.h +15 -30
- package/codegen/rnwcoreJSI-generated.cpp +87 -17
- package/codegen/rnwcoreJSI.h +1080 -376
- package/generate.js +6 -1
- package/include/Include.vcxitems +0 -1
- package/include/Include.vcxitems.filters +0 -3
- package/index.js +56 -42
- package/index.windows.js +56 -42
- package/interface.js +1 -1
- package/jest/local-setup.js +33 -0
- package/jest/mockComponent.js +4 -2
- package/jest/mockNativeComponent.js +1 -1
- package/jest/mockScrollView.js +2 -1
- package/jest/react-native-env.js +1 -3
- package/jest/setup.js +11 -8
- package/just-task.js +12 -5
- package/package.json +34 -31
- package/rn-get-polyfills.js +1 -1
- package/template/metro.config.js +2 -0
- package/Libraries/Animated/createAnimatedComponentInjection.js +0 -48
- package/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js +0 -48
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.flow.js +0 -208
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js +0 -58
- package/Libraries/Components/DatePicker/DatePickerIOS.android.js +0 -47
- package/Libraries/Components/DatePicker/DatePickerIOS.d.ts +0 -92
- package/Libraries/Components/DatePicker/DatePickerIOS.flow.android.js +0 -14
- package/Libraries/Components/DatePicker/DatePickerIOS.flow.ios.js +0 -113
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +0 -242
- package/Libraries/Components/DatePicker/DatePickerIOS.windows.js +0 -47
- package/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +0 -60
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +0 -26
- package/Libraries/Components/Flyout/Flyout.js.map +0 -1
- package/Libraries/Components/Flyout/FlyoutProps.d.ts +0 -25
- package/Libraries/Components/Flyout/FlyoutProps.js +0 -3
- package/Libraries/Components/Flyout/FlyoutProps.js.map +0 -1
- package/Libraries/Components/Glyph/Glyph.js.map +0 -1
- package/Libraries/Components/Glyph/GlyphProps.d.ts +0 -16
- package/Libraries/Components/Glyph/GlyphProps.js +0 -8
- package/Libraries/Components/Glyph/GlyphProps.js.map +0 -1
- package/Libraries/Components/Popup/Popup.js.map +0 -1
- package/Libraries/Components/Popup/PopupProps.d.ts +0 -27
- package/Libraries/Components/Popup/PopupProps.js +0 -8
- package/Libraries/Components/Popup/PopupProps.js.map +0 -1
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +0 -45
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.d.ts +0 -62
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +0 -75
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.windows.js +0 -45
- package/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +0 -33
- package/Libraries/Components/SafeAreaView/SafeAreaView.flow.js +0 -19
- package/Libraries/Components/Slider/Slider.d.ts +0 -132
- package/Libraries/Components/Slider/Slider.js +0 -282
- package/Libraries/Components/Slider/SliderNativeComponent.js +0 -56
- package/Libraries/Interaction/Batchinator.js +0 -76
- package/Libraries/Interaction/BridgeSpyStallHandler.js +0 -63
- package/Libraries/Interaction/InteractionStallDebugger.js +0 -23
- package/Libraries/Interaction/PanResponder.flow.js +0 -257
- package/Libraries/Lists/CellRenderMask.js +0 -155
- package/Libraries/Lists/ChildListCollection.js +0 -72
- package/Libraries/Lists/StateSafePureComponent.js +0 -85
- package/Libraries/Lists/VirtualizedList.d.ts +0 -347
- package/Libraries/Lists/VirtualizedListCellRenderer.js +0 -259
- package/Libraries/Lists/VirtualizedListProps.js +0 -279
- package/Libraries/Performance/PureComponentDebug.js +0 -74
- package/Libraries/Reliability/UserFlow.js +0 -158
- package/Libraries/Renderer/implementations/ReactNativeRenderer.d.ts +0 -149
- package/Libraries/Renderer/shims/ReactNativeTypes.d.ts +0 -141
- package/Libraries/Utilities/MatrixMath.js +0 -748
- package/Libraries/Utilities/buildStyleInterpolator.js +0 -209
- package/Libraries/Utilities/clamp.js +0 -23
- package/Libraries/Utilities/deprecatedPropType.js +0 -36
- package/Libraries/Utilities/groupByEveryN.js +0 -51
- package/Libraries/Utilities/mergeIntoFast.js +0 -26
- package/Libraries/Utilities/setAndForwardRef.js +0 -71
- package/Libraries/Utilities/truncate.js +0 -51
- package/Microsoft.ReactNative/Fabric/platform/react/components/image/conversions.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/ConcreteViewShadowNode.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/ViewEventEmitter.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/ViewProps.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/core/ConcreteComponentDescriptor.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/core/PropsParserContext.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/core/propsConversions.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/graphics/Color.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/imagemanager/primitives.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/TextInputEventEmitter.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/TextInputProps.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/TextInputShadowNode.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/TextInputState.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/conversions.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/primitives.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/iostextinput/propsConversions.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/EventEmitters.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/Props.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/States.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Float.h +0 -5
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.h +0 -135
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ConcreteComponentDescriptor.h +0 -217
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/graphics/RectangleEdges.h +0 -100
- package/Shared/AsyncStorage/AsyncStorageManager.cpp +0 -149
- package/Shared/AsyncStorage/AsyncStorageManager.h +0 -71
- package/Shared/AsyncStorage/FollyDynamicConverter.cpp +0 -51
- package/Shared/AsyncStorage/FollyDynamicConverter.h +0 -24
- package/Shared/AsyncStorage/KeyValueStorage.cpp +0 -248
- package/Shared/AsyncStorage/KeyValueStorage.h +0 -50
- package/Shared/AsyncStorage/StorageFileIO.cpp +0 -160
- package/Shared/AsyncStorage/StorageFileIO.h +0 -40
- package/Shared/AsyncStorageModule.h +0 -25
- package/Shared/Modules/AsyncStorageModule.cpp +0 -87
- package/Shared/Modules/AsyncStorageModuleWin32.cpp +0 -496
- package/Shared/Modules/AsyncStorageModuleWin32.h +0 -75
- package/codegen/NativeDatePickerAndroidSpec.g.h +0 -33
- package/include/Shared/AsyncStorageModuleWin32Config.h +0 -15
- package/types/index.d.ts +0 -216
- package/types/modules/BatchedBridge.d.ts +0 -32
- package/types/modules/Codegen.d.ts +0 -74
- package/types/modules/Devtools.d.ts +0 -31
- package/types/modules/LaunchScreen.d.ts +0 -18
- package/types/modules/globals.d.ts +0 -577
- package/types/private/TimerMixin.d.ts +0 -19
- package/types/private/Utilities.d.ts +0 -10
- package/types/public/DeprecatedPropertiesAlias.d.ts +0 -205
- package/types/public/Insets.d.ts +0 -15
- package/types/public/ReactNativeRenderer.d.ts +0 -149
- package/types/public/ReactNativeTypes.d.ts +0 -143
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
#include <Fabric/FabricUIManagerModule.h>
|
|
17
17
|
#include <Utils/ImageUtils.h>
|
|
18
18
|
#include <shcore.h>
|
|
19
|
+
#include <winrt/Windows.Graphics.Effects.h>
|
|
19
20
|
#include <winrt/Windows.UI.Composition.h>
|
|
20
21
|
#include <winrt/Windows.Web.Http.Headers.h>
|
|
21
22
|
#include <winrt/Windows.Web.Http.h>
|
|
23
|
+
#include "CompositionDynamicAutomationProvider.h"
|
|
22
24
|
#include "CompositionHelpers.h"
|
|
23
25
|
|
|
24
26
|
extern "C" HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT SDKVersion, IWICImagingFactory **ppIWICImagingFactory);
|
|
@@ -54,16 +56,11 @@ ImageComponentView::ImageComponentView(
|
|
|
54
56
|
m_props = defaultProps;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
ImageComponentView::supplementalComponentDescriptorProviders() noexcept {
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
void ImageComponentView::mountChildComponentView(const IComponentView &childComponentView, uint32_t index) noexcept {
|
|
59
|
+
void ImageComponentView::mountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept {
|
|
63
60
|
assert(false);
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
void ImageComponentView::unmountChildComponentView(
|
|
63
|
+
void ImageComponentView::unmountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept {
|
|
67
64
|
assert(false);
|
|
68
65
|
}
|
|
69
66
|
|
|
@@ -83,7 +80,7 @@ void ImageComponentView::didReceiveImage(const winrt::com_ptr<IWICBitmap> &wicbm
|
|
|
83
80
|
imageEventEmitter->onLoadEnd();
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
// TODO - handle
|
|
83
|
+
// TODO - handle imageProps.capInsets
|
|
87
84
|
|
|
88
85
|
#ifdef DEBUG
|
|
89
86
|
auto uiDispatcher = m_context.UIDispatcher();
|
|
@@ -112,7 +109,9 @@ void ImageComponentView::updateProps(
|
|
|
112
109
|
|
|
113
110
|
updateBorderProps(oldImageProps, newImageProps);
|
|
114
111
|
|
|
115
|
-
if (oldImageProps.backgroundColor != newImageProps.backgroundColor
|
|
112
|
+
if (oldImageProps.backgroundColor != newImageProps.backgroundColor ||
|
|
113
|
+
oldImageProps.blurRadius != newImageProps.blurRadius || oldImageProps.tintColor != newImageProps.tintColor ||
|
|
114
|
+
oldImageProps.resizeMode != newImageProps.resizeMode) {
|
|
116
115
|
m_drawingSurface = nullptr; // TODO dont need to recreate the surface just to redraw...
|
|
117
116
|
}
|
|
118
117
|
|
|
@@ -171,7 +170,7 @@ void ImageComponentView::updateLayoutMetrics(
|
|
|
171
170
|
// Set Position & Size Properties
|
|
172
171
|
|
|
173
172
|
if ((layoutMetrics.displayType != m_layoutMetrics.displayType)) {
|
|
174
|
-
|
|
173
|
+
OuterVisual().IsVisible(layoutMetrics.displayType != facebook::react::DisplayType::None);
|
|
175
174
|
}
|
|
176
175
|
|
|
177
176
|
updateBorderLayoutMetrics(layoutMetrics, *m_props);
|
|
@@ -182,11 +181,6 @@ void ImageComponentView::updateLayoutMetrics(
|
|
|
182
181
|
m_visual.Size(
|
|
183
182
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
184
183
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
185
|
-
m_visual.Offset({
|
|
186
|
-
layoutMetrics.frame.origin.x * layoutMetrics.pointScaleFactor,
|
|
187
|
-
layoutMetrics.frame.origin.y * layoutMetrics.pointScaleFactor,
|
|
188
|
-
0.0f,
|
|
189
|
-
});
|
|
190
184
|
}
|
|
191
185
|
|
|
192
186
|
void ImageComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept {}
|
|
@@ -203,8 +197,24 @@ void ImageComponentView::ensureDrawingSurface() noexcept {
|
|
|
203
197
|
winrt::check_hresult(m_wicbmp->GetSize(&width, &height));
|
|
204
198
|
|
|
205
199
|
if (!m_drawingSurface && m_wicbmp) {
|
|
200
|
+
winrt::Windows::Foundation::Size drawingSurfaceSize{static_cast<float>(width), static_cast<float>(height)};
|
|
201
|
+
|
|
202
|
+
const auto imageProps = std::static_pointer_cast<const facebook::react::ImageProps>(m_props);
|
|
203
|
+
const auto frame{m_layoutMetrics.getContentFrame().size};
|
|
204
|
+
|
|
205
|
+
if (imageProps->resizeMode == facebook::react::ImageResizeMode::Repeat) {
|
|
206
|
+
drawingSurfaceSize = {frame.width, frame.height};
|
|
207
|
+
} else if (imageProps->blurRadius > 0) {
|
|
208
|
+
// https://learn.microsoft.com/en-us/windows/win32/direct2d/gaussian-blur#output-bitmap
|
|
209
|
+
// The following equation that can be used to compute the output bitmap:
|
|
210
|
+
// Output bitmap growth (X and Y) = (StandardDeviation(DIPs)*3 + StandardDeviation(DIPs)*3)*((User DPI)/96)
|
|
211
|
+
// Where StandardDeviation(DIPs)*3 is equivalent to the blur radius.
|
|
212
|
+
const auto bmpGrowth{imageProps->blurRadius * 2 * m_layoutMetrics.pointScaleFactor};
|
|
213
|
+
drawingSurfaceSize = {drawingSurfaceSize.Width + bmpGrowth, drawingSurfaceSize.Height + bmpGrowth};
|
|
214
|
+
}
|
|
215
|
+
|
|
206
216
|
m_drawingSurface = m_compContext.CreateDrawingSurface(
|
|
207
|
-
|
|
217
|
+
drawingSurfaceSize,
|
|
208
218
|
winrt::Windows::Graphics::DirectX::DirectXPixelFormat::B8G8R8A8UIntNormalized,
|
|
209
219
|
winrt::Windows::Graphics::DirectX::DirectXAlphaMode::Premultiplied);
|
|
210
220
|
|
|
@@ -212,8 +222,7 @@ void ImageComponentView::ensureDrawingSurface() noexcept {
|
|
|
212
222
|
|
|
213
223
|
auto surfaceBrush = m_compContext.CreateSurfaceBrush(m_drawingSurface);
|
|
214
224
|
|
|
215
|
-
|
|
216
|
-
switch (imageProps.resizeMode) {
|
|
225
|
+
switch (imageProps->resizeMode) {
|
|
217
226
|
case facebook::react::ImageResizeMode::Stretch:
|
|
218
227
|
surfaceBrush.Stretch(winrt::Microsoft::ReactNative::Composition::CompositionStretch::Fill);
|
|
219
228
|
break;
|
|
@@ -223,16 +232,24 @@ void ImageComponentView::ensureDrawingSurface() noexcept {
|
|
|
223
232
|
case facebook::react::ImageResizeMode::Contain:
|
|
224
233
|
surfaceBrush.Stretch(winrt::Microsoft::ReactNative::Composition::CompositionStretch::Uniform);
|
|
225
234
|
break;
|
|
226
|
-
case facebook::react::ImageResizeMode::Center:
|
|
227
|
-
surfaceBrush.Stretch(winrt::Microsoft::ReactNative::Composition::CompositionStretch::None);
|
|
228
|
-
break;
|
|
229
235
|
case facebook::react::ImageResizeMode::Repeat:
|
|
230
|
-
|
|
231
|
-
//
|
|
236
|
+
// TODO - set AlignmentRatio back to 0.5f when switching between resizeModes once we no longer recreate the
|
|
237
|
+
// drawing surface on prop changes.
|
|
238
|
+
surfaceBrush.HorizontalAlignmentRatio(0.0f);
|
|
239
|
+
surfaceBrush.VerticalAlignmentRatio(0.0f);
|
|
240
|
+
// Repeat and Center use the same Stretch logic, so we can fallthrough here.
|
|
241
|
+
[[fallthrough]];
|
|
242
|
+
case facebook::react::ImageResizeMode::Center: {
|
|
243
|
+
surfaceBrush.Stretch(
|
|
244
|
+
(height < frame.height && width < frame.width)
|
|
245
|
+
? winrt::Microsoft::ReactNative::Composition::CompositionStretch::None
|
|
246
|
+
: winrt::Microsoft::ReactNative::Composition::CompositionStretch::Uniform);
|
|
232
247
|
break;
|
|
248
|
+
}
|
|
233
249
|
default:
|
|
234
250
|
assert(false);
|
|
235
251
|
}
|
|
252
|
+
|
|
236
253
|
m_visual.Brush(surfaceBrush);
|
|
237
254
|
}
|
|
238
255
|
}
|
|
@@ -250,8 +267,6 @@ void ImageComponentView::DrawImage() noexcept {
|
|
|
250
267
|
m_drawingSurface.as(drawingSurfaceInterop);
|
|
251
268
|
|
|
252
269
|
if (CheckForDeviceRemoved(drawingSurfaceInterop->BeginDraw(d2dDeviceContext.put(), &offset))) {
|
|
253
|
-
const auto ¶graphProps = *std::static_pointer_cast<const facebook::react::ImageProps>(m_props);
|
|
254
|
-
|
|
255
270
|
winrt::com_ptr<ID2D1Bitmap1> bitmap;
|
|
256
271
|
winrt::check_hresult(d2dDeviceContext->CreateBitmapFromWicBitmap(m_wicbmp.get(), nullptr, bitmap.put()));
|
|
257
272
|
|
|
@@ -260,24 +275,81 @@ void ImageComponentView::DrawImage() noexcept {
|
|
|
260
275
|
d2dDeviceContext->Clear(m_props->backgroundColor.AsD2DColor());
|
|
261
276
|
}
|
|
262
277
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
const auto imageProps = std::static_pointer_cast<const facebook::react::ImageProps>(m_props);
|
|
279
|
+
|
|
280
|
+
bool useEffects{
|
|
281
|
+
imageProps->blurRadius > 0 || isColorMeaningful(imageProps->tintColor) ||
|
|
282
|
+
imageProps->resizeMode == facebook::react::ImageResizeMode::Repeat};
|
|
283
|
+
|
|
284
|
+
if (useEffects) {
|
|
285
|
+
winrt::com_ptr<ID2D1Effect> bitmapEffects;
|
|
286
|
+
winrt::check_hresult(d2dDeviceContext->CreateEffect(CLSID_D2D1BitmapSource, bitmapEffects.put()));
|
|
287
|
+
winrt::check_hresult(bitmapEffects->SetValue(D2D1_BITMAPSOURCE_PROP_WIC_BITMAP_SOURCE, m_wicbmp.get()));
|
|
288
|
+
|
|
289
|
+
if (imageProps->blurRadius > 0) {
|
|
290
|
+
winrt::com_ptr<ID2D1Effect> gaussianBlurEffect;
|
|
291
|
+
winrt::check_hresult(d2dDeviceContext->CreateEffect(CLSID_D2D1GaussianBlur, gaussianBlurEffect.put()));
|
|
292
|
+
// https://learn.microsoft.com/en-us/windows/win32/direct2d/gaussian-blur#effect-properties
|
|
293
|
+
// You can compute the blur radius of the kernel by multiplying the standard deviation by 3 (radius multiplier).
|
|
294
|
+
constexpr float radiusMultiplier = 3;
|
|
295
|
+
winrt::check_hresult(gaussianBlurEffect->SetValue(
|
|
296
|
+
D2D1_GAUSSIANBLUR_PROP_STANDARD_DEVIATION, (imageProps->blurRadius) / radiusMultiplier));
|
|
297
|
+
gaussianBlurEffect->SetInputEffect(0, bitmapEffects.get());
|
|
298
|
+
bitmapEffects.copy_from(gaussianBlurEffect.get());
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (isColorMeaningful(imageProps->tintColor)) {
|
|
302
|
+
winrt::com_ptr<ID2D1Effect> tintColorEffect;
|
|
303
|
+
winrt::check_hresult(d2dDeviceContext->CreateEffect(CLSID_D2D1Flood, tintColorEffect.put()));
|
|
304
|
+
winrt::check_hresult(tintColorEffect->SetValue(D2D1_FLOOD_PROP_COLOR, imageProps->tintColor.AsD2DColor()));
|
|
305
|
+
|
|
306
|
+
winrt::com_ptr<ID2D1Effect> compositeEffect;
|
|
307
|
+
winrt::check_hresult(d2dDeviceContext->CreateEffect(CLSID_D2D1Composite, compositeEffect.put()));
|
|
308
|
+
winrt::check_hresult(compositeEffect->SetValue(D2D1_COMPOSITE_PROP_MODE, D2D1_COMPOSITE_MODE_SOURCE_IN));
|
|
309
|
+
compositeEffect->SetInputEffect(0, bitmapEffects.get());
|
|
310
|
+
compositeEffect->SetInputEffect(1, tintColorEffect.get());
|
|
311
|
+
|
|
312
|
+
bitmapEffects.copy_from(compositeEffect.get());
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (imageProps->resizeMode == facebook::react::ImageResizeMode::Repeat) {
|
|
316
|
+
winrt::com_ptr<ID2D1Effect> borderEffect;
|
|
317
|
+
winrt::check_hresult(d2dDeviceContext->CreateEffect(CLSID_D2D1Border, borderEffect.put()));
|
|
318
|
+
winrt::check_hresult(borderEffect->SetValue(D2D1_BORDER_PROP_EDGE_MODE_X, D2D1_BORDER_EDGE_MODE_WRAP));
|
|
319
|
+
winrt::check_hresult(borderEffect->SetValue(D2D1_BORDER_PROP_EDGE_MODE_Y, D2D1_BORDER_EDGE_MODE_WRAP));
|
|
320
|
+
borderEffect->SetInputEffect(0, bitmapEffects.get());
|
|
321
|
+
|
|
322
|
+
d2dDeviceContext->DrawImage(borderEffect.get());
|
|
323
|
+
} else {
|
|
324
|
+
winrt::com_ptr<ID2D1Image> image;
|
|
325
|
+
bitmapEffects->GetOutput(image.put());
|
|
326
|
+
|
|
327
|
+
D2D1_RECT_F imageBounds;
|
|
328
|
+
winrt::check_hresult(d2dDeviceContext->GetImageLocalBounds(image.get(), &imageBounds));
|
|
329
|
+
|
|
330
|
+
d2dDeviceContext->DrawImage(
|
|
331
|
+
bitmapEffects.get(), {static_cast<float>(offset.x), static_cast<float>(offset.y)}, imageBounds);
|
|
332
|
+
}
|
|
333
|
+
} else {
|
|
334
|
+
UINT width, height;
|
|
335
|
+
winrt::check_hresult(m_wicbmp->GetSize(&width, &height));
|
|
336
|
+
|
|
337
|
+
D2D1_RECT_F rect = D2D1::RectF(
|
|
338
|
+
static_cast<float>(offset.x / m_layoutMetrics.pointScaleFactor),
|
|
339
|
+
static_cast<float>(offset.y / m_layoutMetrics.pointScaleFactor),
|
|
340
|
+
static_cast<float>((offset.x + width) / m_layoutMetrics.pointScaleFactor),
|
|
341
|
+
static_cast<float>((offset.y + height) / m_layoutMetrics.pointScaleFactor));
|
|
342
|
+
|
|
343
|
+
const auto dpi = m_layoutMetrics.pointScaleFactor * 96.0f;
|
|
344
|
+
float oldDpiX, oldDpiY;
|
|
345
|
+
d2dDeviceContext->GetDpi(&oldDpiX, &oldDpiY);
|
|
346
|
+
d2dDeviceContext->SetDpi(dpi, dpi);
|
|
347
|
+
|
|
348
|
+
d2dDeviceContext->DrawBitmap(bitmap.get(), rect);
|
|
349
|
+
|
|
350
|
+
// Restore old dpi setting
|
|
351
|
+
d2dDeviceContext->SetDpi(oldDpiX, oldDpiY);
|
|
352
|
+
}
|
|
281
353
|
|
|
282
354
|
// Our update is done. EndDraw never indicates rendering device removed, so any
|
|
283
355
|
// failure here is unexpected and, therefore, fatal.
|
|
@@ -315,13 +387,10 @@ facebook::react::Tag ImageComponentView::hitTest(facebook::react::Point pt, face
|
|
|
315
387
|
return -1;
|
|
316
388
|
}
|
|
317
389
|
|
|
318
|
-
facebook::react::SharedTouchEventEmitter ImageComponentView::touchEventEmitter() noexcept {
|
|
319
|
-
return m_eventEmitter;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
390
|
void ImageComponentView::ensureVisual() noexcept {
|
|
323
391
|
if (!m_visual) {
|
|
324
392
|
m_visual = m_compContext.CreateSpriteVisual();
|
|
393
|
+
OuterVisual().InsertAt(m_visual, 0);
|
|
325
394
|
}
|
|
326
395
|
}
|
|
327
396
|
|
|
@@ -329,4 +398,15 @@ winrt::Microsoft::ReactNative::Composition::IVisual ImageComponentView::Visual()
|
|
|
329
398
|
return m_visual;
|
|
330
399
|
}
|
|
331
400
|
|
|
401
|
+
bool ImageComponentView::focusable() const noexcept {
|
|
402
|
+
return m_props->focusable;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
std::shared_ptr<ImageComponentView> ImageComponentView::Create(
|
|
406
|
+
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
407
|
+
facebook::react::Tag tag,
|
|
408
|
+
winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept {
|
|
409
|
+
return std::shared_ptr<ImageComponentView>(new ImageComponentView(compContext, tag, reactContext));
|
|
410
|
+
}
|
|
411
|
+
|
|
332
412
|
} // namespace Microsoft::ReactNative
|
|
@@ -29,15 +29,14 @@ struct WindowsImageResponseObserver;
|
|
|
29
29
|
|
|
30
30
|
struct ImageComponentView : CompositionBaseComponentView {
|
|
31
31
|
using Super = CompositionBaseComponentView;
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
[[nodiscard]] static std::shared_ptr<ImageComponentView> Create(
|
|
33
34
|
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
34
35
|
facebook::react::Tag tag,
|
|
35
|
-
winrt::Microsoft::ReactNative::ReactContext const &reactContext);
|
|
36
|
+
winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept;
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
void mountChildComponentView(const IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
40
|
-
void unmountChildComponentView(const IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
38
|
+
void mountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
39
|
+
void unmountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
41
40
|
void updateProps(facebook::react::Props::Shared const &props, facebook::react::Props::Shared const &oldProps) noexcept
|
|
42
41
|
override;
|
|
43
42
|
void updateState(facebook::react::State::Shared const &state, facebook::react::State::Shared const &oldState) noexcept
|
|
@@ -49,12 +48,17 @@ struct ImageComponentView : CompositionBaseComponentView {
|
|
|
49
48
|
void prepareForRecycle() noexcept override;
|
|
50
49
|
facebook::react::Props::Shared props() noexcept override;
|
|
51
50
|
void OnRenderingDeviceLost() noexcept override;
|
|
52
|
-
facebook::react::SharedTouchEventEmitter touchEventEmitter() noexcept override;
|
|
53
51
|
|
|
54
52
|
facebook::react::Tag hitTest(facebook::react::Point pt, facebook::react::Point &localPt) const noexcept override;
|
|
55
53
|
winrt::Microsoft::ReactNative::Composition::IVisual Visual() const noexcept override;
|
|
54
|
+
bool focusable() const noexcept override;
|
|
56
55
|
|
|
57
56
|
private:
|
|
57
|
+
ImageComponentView(
|
|
58
|
+
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
59
|
+
facebook::react::Tag tag,
|
|
60
|
+
winrt::Microsoft::ReactNative::ReactContext const &reactContext);
|
|
61
|
+
|
|
58
62
|
struct WindowsImageResponseObserver : facebook::react::ImageResponseObserver {
|
|
59
63
|
public:
|
|
60
64
|
WindowsImageResponseObserver(std::shared_ptr<ImageComponentView> image);
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include <react/renderer/components/text/ParagraphState.h>
|
|
12
12
|
#include <unicode.h>
|
|
13
13
|
#include <winrt/Microsoft.ReactNative.Composition.h>
|
|
14
|
+
#include "CompositionDynamicAutomationProvider.h"
|
|
14
15
|
#include "CompositionHelpers.h"
|
|
15
16
|
|
|
16
17
|
namespace Microsoft::ReactNative {
|
|
@@ -23,22 +24,13 @@ ParagraphComponentView::ParagraphComponentView(
|
|
|
23
24
|
m_props = defaultProps;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
ParagraphComponentView
|
|
28
|
-
return {};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
void ParagraphComponentView::mountChildComponentView(
|
|
32
|
-
const IComponentView &childComponentView,
|
|
33
|
-
uint32_t index) noexcept {
|
|
34
|
-
auto v = static_cast<const ParagraphComponentView &>(childComponentView);
|
|
27
|
+
void ParagraphComponentView::mountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept {
|
|
28
|
+
// auto v = static_cast<ParagraphComponentView &>(childComponentView);
|
|
35
29
|
assert(false);
|
|
36
30
|
// m_element.Children().InsertAt(index, v.Element());
|
|
37
31
|
}
|
|
38
32
|
|
|
39
|
-
void ParagraphComponentView::unmountChildComponentView(
|
|
40
|
-
const IComponentView &childComponentView,
|
|
41
|
-
uint32_t index) noexcept {
|
|
33
|
+
void ParagraphComponentView::unmountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept {
|
|
42
34
|
assert(false);
|
|
43
35
|
// m_element.Children().RemoveAt(index);
|
|
44
36
|
}
|
|
@@ -49,6 +41,8 @@ void ParagraphComponentView::updateProps(
|
|
|
49
41
|
const auto &oldViewProps = *std::static_pointer_cast<const facebook::react::ParagraphProps>(m_props);
|
|
50
42
|
const auto &newViewProps = *std::static_pointer_cast<const facebook::react::ParagraphProps>(props);
|
|
51
43
|
|
|
44
|
+
ensureVisual();
|
|
45
|
+
|
|
52
46
|
if (oldViewProps.textAttributes.foregroundColor != newViewProps.textAttributes.foregroundColor) {
|
|
53
47
|
m_requireRedraw = true;
|
|
54
48
|
}
|
|
@@ -60,10 +54,14 @@ void ParagraphComponentView::updateProps(
|
|
|
60
54
|
updateTextAlignment(newViewProps.textAttributes.alignment);
|
|
61
55
|
}
|
|
62
56
|
|
|
57
|
+
updateBorderProps(oldViewProps, newViewProps);
|
|
58
|
+
|
|
63
59
|
m_props = std::static_pointer_cast<facebook::react::ParagraphProps const>(props);
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
void ParagraphComponentView::updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept {
|
|
62
|
+
void ParagraphComponentView::updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept {
|
|
63
|
+
Super::updateEventEmitter(eventEmitter);
|
|
64
|
+
}
|
|
67
65
|
|
|
68
66
|
void ParagraphComponentView::updateState(
|
|
69
67
|
facebook::react::State::Shared const &state,
|
|
@@ -80,23 +78,17 @@ void ParagraphComponentView::updateLayoutMetrics(
|
|
|
80
78
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept {
|
|
81
79
|
// Set Position & Size Properties
|
|
82
80
|
|
|
83
|
-
ensureVisual();
|
|
84
|
-
|
|
85
81
|
if ((layoutMetrics.displayType != m_layoutMetrics.displayType)) {
|
|
86
|
-
|
|
82
|
+
OuterVisual().IsVisible(layoutMetrics.displayType != facebook::react::DisplayType::None);
|
|
87
83
|
}
|
|
88
84
|
|
|
85
|
+
updateBorderLayoutMetrics(layoutMetrics, *m_props);
|
|
89
86
|
m_layoutMetrics = layoutMetrics;
|
|
90
87
|
|
|
91
88
|
UpdateCenterPropertySet();
|
|
92
89
|
m_visual.Size(
|
|
93
90
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
94
91
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
95
|
-
m_visual.Offset({
|
|
96
|
-
layoutMetrics.frame.origin.x * layoutMetrics.pointScaleFactor,
|
|
97
|
-
layoutMetrics.frame.origin.y * layoutMetrics.pointScaleFactor,
|
|
98
|
-
0.0f,
|
|
99
|
-
});
|
|
100
92
|
}
|
|
101
93
|
void ParagraphComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept {
|
|
102
94
|
ensureVisual();
|
|
@@ -104,8 +96,7 @@ void ParagraphComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMas
|
|
|
104
96
|
}
|
|
105
97
|
void ParagraphComponentView::prepareForRecycle() noexcept {}
|
|
106
98
|
facebook::react::Props::Shared ParagraphComponentView::props() noexcept {
|
|
107
|
-
|
|
108
|
-
return {};
|
|
99
|
+
return m_props;
|
|
109
100
|
}
|
|
110
101
|
|
|
111
102
|
facebook::react::Tag ParagraphComponentView::hitTest(facebook::react::Point pt, facebook::react::Point &localPt)
|
|
@@ -135,13 +126,33 @@ facebook::react::Tag ParagraphComponentView::hitTest(facebook::react::Point pt,
|
|
|
135
126
|
return -1;
|
|
136
127
|
}
|
|
137
128
|
|
|
138
|
-
facebook::react::SharedTouchEventEmitter ParagraphComponentView::
|
|
129
|
+
facebook::react::SharedTouchEventEmitter ParagraphComponentView::touchEventEmitterAtPoint(
|
|
130
|
+
facebook::react::Point pt) noexcept {
|
|
131
|
+
if (m_attributedStringBox.getValue().getFragments().size()) {
|
|
132
|
+
BOOL isTrailingHit = false;
|
|
133
|
+
BOOL isInside = false;
|
|
134
|
+
DWRITE_HIT_TEST_METRICS metrics;
|
|
135
|
+
winrt::check_hresult(m_textLayout->HitTestPoint(pt.x, pt.y, &isTrailingHit, &isInside, &metrics));
|
|
136
|
+
if (isInside) {
|
|
137
|
+
uint32_t textPosition = metrics.textPosition;
|
|
138
|
+
|
|
139
|
+
for (auto fragment : m_attributedStringBox.getValue().getFragments()) {
|
|
140
|
+
if (textPosition < fragment.string.length()) {
|
|
141
|
+
return std::static_pointer_cast<const facebook::react::TouchEventEmitter>(
|
|
142
|
+
fragment.parentShadowView.eventEmitter);
|
|
143
|
+
}
|
|
144
|
+
textPosition -= static_cast<uint32_t>(fragment.string.length());
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
139
149
|
return m_eventEmitter;
|
|
140
150
|
}
|
|
141
151
|
|
|
142
152
|
void ParagraphComponentView::ensureVisual() noexcept {
|
|
143
153
|
if (!m_visual) {
|
|
144
154
|
m_visual = m_compContext.CreateSpriteVisual();
|
|
155
|
+
OuterVisual().InsertAt(m_visual, 0);
|
|
145
156
|
}
|
|
146
157
|
}
|
|
147
158
|
|
|
@@ -195,13 +206,7 @@ void ParagraphComponentView::updateVisualBrush() noexcept {
|
|
|
195
206
|
contraints.maximumSize.height =
|
|
196
207
|
m_layoutMetrics.frame.size.height - m_layoutMetrics.contentInsets.top - m_layoutMetrics.contentInsets.bottom;
|
|
197
208
|
|
|
198
|
-
|
|
199
|
-
// instead
|
|
200
|
-
const auto ¶graphProps = *std::static_pointer_cast<const facebook::react::ParagraphProps>(m_props);
|
|
201
|
-
const std::optional<facebook::react::TextAlignment> &textAlignment = m_props->textAttributes.alignment;
|
|
202
|
-
|
|
203
|
-
facebook::react::TextLayoutManager::GetTextLayout(
|
|
204
|
-
m_attributedStringBox, {} /*TODO*/, contraints, textAlignment, m_textLayout);
|
|
209
|
+
facebook::react::TextLayoutManager::GetTextLayout(m_attributedStringBox, {} /*TODO*/, contraints, m_textLayout);
|
|
205
210
|
requireNewBrush = true;
|
|
206
211
|
}
|
|
207
212
|
|
|
@@ -291,6 +296,17 @@ void ParagraphComponentView::DrawText() noexcept {
|
|
|
291
296
|
m_drawingSurface.as(drawingSurfaceInterop);
|
|
292
297
|
|
|
293
298
|
if (CheckForDeviceRemoved(drawingSurfaceInterop->BeginDraw(d2dDeviceContext.put(), &offset))) {
|
|
299
|
+
d2dDeviceContext->Clear(
|
|
300
|
+
m_props->backgroundColor ? m_props->backgroundColor.AsD2DColor() : D2D1::ColorF(D2D1::ColorF::Black, 0.0f));
|
|
301
|
+
assert(d2dDeviceContext->GetUnitMode() == D2D1_UNIT_MODE_DIPS);
|
|
302
|
+
const auto dpi = m_layoutMetrics.pointScaleFactor * 96.0f;
|
|
303
|
+
float oldDpiX, oldDpiY;
|
|
304
|
+
d2dDeviceContext->GetDpi(&oldDpiX, &oldDpiY);
|
|
305
|
+
d2dDeviceContext->SetDpi(dpi, dpi);
|
|
306
|
+
|
|
307
|
+
float offsetX = static_cast<float>(offset.x / m_layoutMetrics.pointScaleFactor);
|
|
308
|
+
float offsetY = static_cast<float>(offset.y / m_layoutMetrics.pointScaleFactor);
|
|
309
|
+
|
|
294
310
|
const auto ¶graphProps = *std::static_pointer_cast<const facebook::react::ParagraphProps>(m_props);
|
|
295
311
|
|
|
296
312
|
// Create a solid color brush for the text. A more sophisticated application might want
|
|
@@ -330,7 +346,7 @@ void ParagraphComponentView::DrawText() noexcept {
|
|
|
330
346
|
}
|
|
331
347
|
|
|
332
348
|
if (!isnan(paragraphProps.opacity)) {
|
|
333
|
-
|
|
349
|
+
m_visual.Opacity(paragraphProps.opacity);
|
|
334
350
|
}
|
|
335
351
|
|
|
336
352
|
// Create color effects for individual text fragments.
|
|
@@ -376,18 +392,66 @@ void ParagraphComponentView::DrawText() noexcept {
|
|
|
376
392
|
fragmentBrush->SetOpacity(fragment.textAttributes.opacity);
|
|
377
393
|
}
|
|
378
394
|
m_textLayout->SetDrawingEffect(fragmentBrush.get(), range);
|
|
395
|
+
|
|
396
|
+
// DWrite doesn't handle background hightlight colors, so we manually draw the background color for ranges
|
|
397
|
+
if (facebook::react::isColorMeaningful(fragment.textAttributes.backgroundColor)) {
|
|
398
|
+
UINT32 actualHitTestCount = 0;
|
|
399
|
+
if (range.length > 0) {
|
|
400
|
+
m_textLayout->HitTestTextRange(
|
|
401
|
+
range.startPosition,
|
|
402
|
+
range.length,
|
|
403
|
+
0, // x
|
|
404
|
+
0, // y
|
|
405
|
+
NULL,
|
|
406
|
+
0, // metrics count
|
|
407
|
+
&actualHitTestCount);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Allocate enough room to return all hit-test metrics.
|
|
411
|
+
std::vector<DWRITE_HIT_TEST_METRICS> hitTestMetrics(actualHitTestCount);
|
|
412
|
+
if (range.length > 0) {
|
|
413
|
+
m_textLayout->HitTestTextRange(
|
|
414
|
+
range.startPosition,
|
|
415
|
+
range.length,
|
|
416
|
+
0, // x
|
|
417
|
+
0, // y
|
|
418
|
+
&hitTestMetrics[0],
|
|
419
|
+
static_cast<UINT32>(hitTestMetrics.size()),
|
|
420
|
+
&actualHitTestCount);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Draw the selection ranges behind the text.
|
|
424
|
+
if (actualHitTestCount > 0) {
|
|
425
|
+
// Note that an ideal layout will return fractional values,
|
|
426
|
+
// so you may see slivers between the selection ranges due
|
|
427
|
+
// to the per-primitive antialiasing of the edges unless
|
|
428
|
+
// it is disabled (better for performance anyway).
|
|
429
|
+
auto oldAliasMode = d2dDeviceContext->GetAntialiasMode();
|
|
430
|
+
d2dDeviceContext->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED);
|
|
431
|
+
|
|
432
|
+
winrt::com_ptr<ID2D1SolidColorBrush> textHighlightBrush;
|
|
433
|
+
winrt::check_hresult(d2dDeviceContext->CreateSolidColorBrush(
|
|
434
|
+
fragment.textAttributes.backgroundColor.AsD2DColor(), textHighlightBrush.put()));
|
|
435
|
+
|
|
436
|
+
for (size_t i = 0; i < actualHitTestCount; ++i) {
|
|
437
|
+
const DWRITE_HIT_TEST_METRICS &htm = hitTestMetrics[i];
|
|
438
|
+
|
|
439
|
+
const D2D1_RECT_F rect = {
|
|
440
|
+
std::round(htm.left + offsetX),
|
|
441
|
+
std::round(htm.top + offsetY),
|
|
442
|
+
std::round(htm.left + htm.width + offsetX),
|
|
443
|
+
std::round(htm.top + htm.height + offsetY)};
|
|
444
|
+
|
|
445
|
+
d2dDeviceContext->FillRectangle(rect, textHighlightBrush.get());
|
|
446
|
+
}
|
|
447
|
+
d2dDeviceContext->SetAntialiasMode(oldAliasMode);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
379
450
|
}
|
|
380
451
|
|
|
381
452
|
position += length;
|
|
382
453
|
}
|
|
383
454
|
|
|
384
|
-
d2dDeviceContext->Clear(D2D1::ColorF(D2D1::ColorF::Black, 0.0f));
|
|
385
|
-
assert(d2dDeviceContext->GetUnitMode() == D2D1_UNIT_MODE_DIPS);
|
|
386
|
-
const auto dpi = m_layoutMetrics.pointScaleFactor * 96.0f;
|
|
387
|
-
float oldDpiX, oldDpiY;
|
|
388
|
-
d2dDeviceContext->GetDpi(&oldDpiX, &oldDpiY);
|
|
389
|
-
d2dDeviceContext->SetDpi(dpi, dpi);
|
|
390
|
-
|
|
391
455
|
// Draw the line of text at the specified offset, which corresponds to the top-left
|
|
392
456
|
// corner of our drawing surface. Notice we don't call BeginDraw on the D2D device
|
|
393
457
|
// context; this has already been done for us by the composition API.
|
|
@@ -412,4 +476,10 @@ winrt::Microsoft::ReactNative::Composition::IVisual ParagraphComponentView::Visu
|
|
|
412
476
|
return m_visual;
|
|
413
477
|
}
|
|
414
478
|
|
|
479
|
+
std::shared_ptr<ParagraphComponentView> ParagraphComponentView::Create(
|
|
480
|
+
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
481
|
+
facebook::react::Tag tag) noexcept {
|
|
482
|
+
return std::shared_ptr<ParagraphComponentView>(new ParagraphComponentView(compContext, tag));
|
|
483
|
+
}
|
|
484
|
+
|
|
415
485
|
} // namespace Microsoft::ReactNative
|
|
@@ -18,14 +18,13 @@ namespace Microsoft::ReactNative {
|
|
|
18
18
|
|
|
19
19
|
struct ParagraphComponentView : CompositionBaseComponentView {
|
|
20
20
|
using Super = CompositionBaseComponentView;
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
[[nodiscard]] static std::shared_ptr<ParagraphComponentView> Create(
|
|
22
23
|
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
23
|
-
facebook::react::Tag tag);
|
|
24
|
+
facebook::react::Tag tag) noexcept;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
void mountChildComponentView(const IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
28
|
-
void unmountChildComponentView(const IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
26
|
+
void mountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
27
|
+
void unmountChildComponentView(IComponentView &childComponentView, uint32_t index) noexcept override;
|
|
29
28
|
void updateProps(facebook::react::Props::Shared const &props, facebook::react::Props::Shared const &oldProps) noexcept
|
|
30
29
|
override;
|
|
31
30
|
void updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept override;
|
|
@@ -39,11 +38,15 @@ struct ParagraphComponentView : CompositionBaseComponentView {
|
|
|
39
38
|
facebook::react::Props::Shared props() noexcept override;
|
|
40
39
|
facebook::react::Tag hitTest(facebook::react::Point pt, facebook::react::Point &localPt) const noexcept override;
|
|
41
40
|
void OnRenderingDeviceLost() noexcept override;
|
|
42
|
-
facebook::react::SharedTouchEventEmitter
|
|
41
|
+
facebook::react::SharedTouchEventEmitter touchEventEmitterAtPoint(facebook::react::Point pt) noexcept override;
|
|
43
42
|
|
|
44
43
|
winrt::Microsoft::ReactNative::Composition::IVisual Visual() const noexcept override;
|
|
45
44
|
|
|
46
45
|
private:
|
|
46
|
+
ParagraphComponentView(
|
|
47
|
+
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
48
|
+
facebook::react::Tag tag);
|
|
49
|
+
|
|
47
50
|
void ensureVisual() noexcept;
|
|
48
51
|
void updateVisualBrush() noexcept;
|
|
49
52
|
void DrawText() noexcept;
|