react-native-windows 0.75.4 → 0.76.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.
Files changed (318) hide show
  1. package/.flowconfig +6 -4
  2. package/Directory.Build.props +4 -0
  3. package/Directory.Build.targets +5 -0
  4. package/Libraries/Alert/Alert.js +3 -0
  5. package/Libraries/Alert/Alert.windows.js +3 -0
  6. package/Libraries/Animated/AnimatedEvent.js +1 -1
  7. package/Libraries/Animated/AnimatedImplementation.js +7 -7
  8. package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
  9. package/Libraries/Animated/animations/Animation.js +11 -1
  10. package/Libraries/Animated/animations/DecayAnimation.js +1 -1
  11. package/Libraries/Animated/animations/SpringAnimation.js +1 -1
  12. package/Libraries/Animated/animations/TimingAnimation.js +2 -1
  13. package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
  14. package/Libraries/Animated/createAnimatedComponent.js +10 -9
  15. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  16. package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
  17. package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
  18. package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
  19. package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
  20. package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
  21. package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
  22. package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
  23. package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
  24. package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
  25. package/Libraries/Animated/useAnimatedProps.js +142 -7
  26. package/Libraries/BatchedBridge/NativeModules.js +2 -0
  27. package/Libraries/Blob/FileReader.js +1 -1
  28. package/Libraries/Blob/URL.js +2 -62
  29. package/Libraries/Blob/URLSearchParams.js +71 -0
  30. package/Libraries/Components/Button.windows.js +0 -1
  31. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  32. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -0
  33. package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
  34. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
  35. package/Libraries/Components/ScrollView/ScrollView.js +131 -169
  36. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
  37. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +3 -0
  38. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  39. package/Libraries/Components/StatusBar/StatusBar.js +3 -1
  40. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
  41. package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
  42. package/Libraries/Components/TextInput/TextInput.js +230 -94
  43. package/Libraries/Components/TextInput/TextInput.windows.js +230 -105
  44. package/Libraries/Components/View/ReactNativeStyleAttributes.js +23 -1
  45. package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
  46. package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +2 -0
  47. package/Libraries/Components/View/View.windows.js +32 -30
  48. package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  49. package/Libraries/Components/View/ViewNativeComponent.js +0 -1
  50. package/Libraries/Components/View/ViewPropTypes.js +14 -0
  51. package/Libraries/Components/View/ViewPropTypes.windows.js +14 -0
  52. package/Libraries/Core/ExceptionsManager.js +2 -0
  53. package/Libraries/Core/InitializeCore.js +3 -1
  54. package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
  55. package/Libraries/Core/ReactNativeVersion.js +4 -4
  56. package/Libraries/Core/setUpDeveloperTools.js +5 -1
  57. package/Libraries/Core/setUpErrorHandling.js +7 -1
  58. package/Libraries/Core/setUpGlobals.js +1 -0
  59. package/Libraries/Core/setUpReactRefresh.js +0 -4
  60. package/Libraries/Image/AssetSourceResolver.js +28 -1
  61. package/Libraries/Image/AssetSourceResolver.windows.js +28 -1
  62. package/Libraries/Image/Image.android.js +9 -14
  63. package/Libraries/Image/Image.ios.js +11 -22
  64. package/Libraries/Image/Image.windows.js +11 -22
  65. package/Libraries/Image/ImageBackground.js +1 -8
  66. package/Libraries/Image/ImageUtils.js +9 -9
  67. package/Libraries/Image/ImageViewNativeComponent.js +1 -0
  68. package/Libraries/Inspector/Inspector.js +3 -2
  69. package/Libraries/Inspector/InspectorPanel.js +16 -10
  70. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  71. package/Libraries/Interaction/TaskQueue.js +1 -0
  72. package/Libraries/Lists/FlatList.js +1 -1
  73. package/Libraries/Lists/SectionList.js +2 -2
  74. package/Libraries/Lists/SectionListModern.js +3 -3
  75. package/Libraries/LogBox/Data/LogBoxData.js +24 -3
  76. package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
  77. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
  78. package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +9 -8
  79. package/Libraries/Modal/Modal.js +0 -1
  80. package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -1
  81. package/Libraries/NativeComponent/BaseViewConfig.ios.js +17 -1
  82. package/Libraries/NativeComponent/BaseViewConfig.windows.js +17 -1
  83. package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
  84. package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
  85. package/Libraries/Network/XMLHttpRequest.js +4 -2
  86. package/Libraries/ReactNative/AppContainer-dev.js +1 -5
  87. package/Libraries/ReactNative/AppContainer-prod.js +1 -5
  88. package/Libraries/ReactNative/AppContainer.js +1 -2
  89. package/Libraries/ReactNative/AppRegistry.d.ts +0 -4
  90. package/Libraries/ReactNative/AppRegistry.js +1 -7
  91. package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
  92. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
  93. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
  94. package/Libraries/ReactNative/RendererImplementation.js +26 -4
  95. package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
  96. package/Libraries/ReactNative/renderApplication.js +1 -3
  97. package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
  98. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  99. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +152 -2
  100. package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
  101. package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
  102. package/Libraries/StyleSheet/processBoxShadow.js +209 -0
  103. package/Libraries/StyleSheet/processFilter.js +231 -42
  104. package/Libraries/Text/Text.js +394 -196
  105. package/Libraries/Text/Text.windows.js +476 -300
  106. package/Libraries/Text/TextNativeComponent.js +2 -1
  107. package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
  108. package/Libraries/Types/CodegenTypes.js +3 -1
  109. package/Libraries/Utilities/Appearance.js +108 -84
  110. package/Libraries/Utilities/DevLoadingView.js +2 -4
  111. package/Libraries/Utilities/HMRClient.js +8 -6
  112. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  113. package/Libraries/Utilities/createPerformanceLogger.js +0 -9
  114. package/Libraries/Utilities/stringifyViewConfig.js +22 -0
  115. package/Libraries/Utilities/useColorScheme.js +3 -3
  116. package/Libraries/WebSocket/WebSocket.js +1 -1
  117. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  118. package/Libraries/vendor/emitter/EventEmitter.js +6 -5
  119. package/Microsoft.ReactNative/ComponentView.idl +11 -0
  120. package/Microsoft.ReactNative/Composition.Input.idl +1 -0
  121. package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
  122. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +9 -9
  123. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +9 -9
  124. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +7 -9
  125. package/Microsoft.ReactNative/Fabric/ComponentView.h +5 -6
  126. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +4 -0
  127. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -0
  128. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
  129. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +42 -5
  130. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
  131. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +81 -63
  132. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -3
  133. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +8 -6
  134. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
  135. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
  136. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
  137. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +2 -3
  138. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
  139. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +72 -54
  140. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +14 -4
  141. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +26 -8
  142. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
  143. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -7
  144. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -2
  145. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +6 -6
  146. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +1 -2
  147. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +97 -140
  148. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -4
  149. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +18 -11
  150. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +5 -4
  151. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
  152. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
  153. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +29 -4
  154. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
  155. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
  156. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
  157. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +28 -12
  158. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +33 -0
  159. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +26 -9
  160. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +10 -4
  161. package/Microsoft.ReactNative/IReactModuleBuilder.cpp +5 -0
  162. package/Microsoft.ReactNative/IReactModuleBuilder.h +1 -0
  163. package/Microsoft.ReactNative/IReactModuleBuilder.idl +9 -0
  164. package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -1
  165. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
  166. package/Microsoft.ReactNative/Modules/AlertModule.cpp +3 -1
  167. package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -1
  168. package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -1
  169. package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +3 -3
  170. package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
  171. package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +2 -2
  172. package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
  173. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
  174. package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
  175. package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +121 -0
  176. package/Microsoft.ReactNative/Modules/SampleTurboModule.h +90 -0
  177. package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
  178. package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
  179. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +5 -1
  180. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
  181. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
  182. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
  183. package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
  184. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
  185. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -0
  186. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
  187. package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
  188. package/Microsoft.ReactNative/TurboModulesProvider.cpp +45 -0
  189. package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -1
  190. package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +25 -16
  191. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -4
  192. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
  193. package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +2 -2
  194. package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +62 -4
  195. package/Microsoft.ReactNative.Cxx/NativeModules.h +131 -14
  196. package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +10 -2
  197. package/PropertySheets/Autolink.props +1 -1
  198. package/PropertySheets/Bundle.props +1 -1
  199. package/PropertySheets/Codegen.props +1 -1
  200. package/PropertySheets/Generated/PackageVersion.g.props +4 -4
  201. package/PropertySheets/NuGet.LockFile.props +18 -0
  202. package/README.md +29 -29
  203. package/ReactCommon/ReactCommon.vcxproj +5 -1
  204. package/ReactCommon/ReactCommon.vcxproj.filters +11 -2
  205. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -7
  206. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +441 -0
  207. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +266 -0
  208. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +56 -0
  209. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +3 -1
  210. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -2
  211. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
  212. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Convert.h +172 -0
  213. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +4 -5
  214. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +2 -2
  215. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +1 -1
  216. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +3 -2
  217. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +9 -0
  218. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +363 -0
  219. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +22 -2
  220. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +118 -51
  221. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +8 -1
  222. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -2
  223. package/Shared/Modules/WebSocketModule.cpp +1 -2
  224. package/Shared/Networking/WinRTWebSocketResource.cpp +4 -1
  225. package/Shared/Shared.vcxitems +38 -2
  226. package/Shared/Shared.vcxitems.filters +6 -1
  227. package/Shared/TurboModuleManager.cpp +0 -3
  228. package/codegen/NativeLinkingManagerSpec.g.h +3 -3
  229. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +198 -54
  230. package/codegen/NativeSampleTurboModuleSpec.g.h +35 -0
  231. package/codegen/rnwcoreJSI-generated.cpp +245 -101
  232. package/codegen/rnwcoreJSI.h +847 -548
  233. package/index.js +3 -1
  234. package/index.windows.js +3 -1
  235. package/jest/mockComponent.js +4 -1
  236. package/jest/mockModal.js +1 -3
  237. package/jest/mockScrollView.js +1 -1
  238. package/jest/renderer.js +2 -2
  239. package/jest/setup.js +16 -13
  240. package/package.json +34 -30
  241. package/src/private/animated/NativeAnimatedHelper.js +438 -0
  242. package/src/private/animated/NativeAnimatedValidation.js +64 -0
  243. package/src/private/components/HScrollViewNativeComponents.js +56 -0
  244. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +29 -0
  245. package/src/private/components/VScrollViewNativeComponents.js +48 -0
  246. package/src/private/components/useSyncOnScroll.js +48 -0
  247. package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
  248. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
  249. package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
  250. package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
  251. package/src/private/setup/setUpDOM.js +28 -0
  252. package/src/private/setup/setUpIntersectionObserver.js +27 -0
  253. package/src/private/setup/setUpMutationObserver.js +26 -0
  254. package/src/private/setup/setUpPerformanceObserver.js +64 -0
  255. package/src/private/specs/modules/NativeAppearance.js +3 -3
  256. package/src/private/specs/modules/NativeLinkingManager.js +1 -1
  257. package/src/private/specs/modules/NativePlatformConstantsWindows.js +7 -0
  258. package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
  259. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
  260. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
  261. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
  262. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
  263. package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
  264. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
  265. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
  266. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
  267. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
  268. package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
  269. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
  270. package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
  271. package/src/private/webapis/performance/LongTasks.js +39 -0
  272. package/src/private/webapis/performance/Performance.js +22 -9
  273. package/src/private/webapis/performance/PerformanceEntry.js +36 -18
  274. package/src/private/webapis/performance/PerformanceObserver.js +29 -43
  275. package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
  276. package/src/private/webapis/performance/UserTiming.js +17 -12
  277. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
  278. package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +1 -1
  279. package/template/cpp-app/src/AutolinkedNativeModules.g.h +1 -1
  280. package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
  281. package/template/index.windows.bundle +1 -1
  282. package/template/metro.config.js +2 -2
  283. package/template/shared-app/src/AutolinkedNativeModules.g.props +1 -1
  284. package/template/shared-app/src/AutolinkedNativeModules.g.targets +1 -1
  285. package/templates/cpp-app/metro.config.js +2 -2
  286. package/templates/cpp-app/template.config.js +5 -5
  287. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +1 -1
  288. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +1 -1
  289. package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -0
  290. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
  291. package/templates/cpp-lib/example/metro.config.js +2 -2
  292. package/templates/cpp-lib/template.config.js +3 -3
  293. package/templates/cpp-lib/windows/MyLib/MyLib.h +3 -3
  294. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
  295. package/types/experimental.d.ts +12 -98
  296. package/Common/packages.lock.json +0 -26
  297. package/Folly/packages.lock.json +0 -23
  298. package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
  299. package/Libraries/Core/setUpIntersectionObserver.js +0 -16
  300. package/Libraries/Core/setUpMutationObserver.js +0 -16
  301. package/Libraries/Core/setUpPerformanceObserver.js +0 -18
  302. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
  303. package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
  304. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
  305. package/Microsoft.ReactNative/packages.lock.json +0 -132
  306. package/Microsoft.ReactNative.Managed/packages.lock.json +0 -373
  307. package/Microsoft.ReactNative.Managed.CodeGen/packages.lock.json +0 -3197
  308. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2396
  309. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -136
  310. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
  311. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +0 -48
  312. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +0 -122
  313. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +0 -388
  314. package/ReactCommon/packages.lock.json +0 -30
  315. package/fmt/packages.lock.json +0 -13
  316. package/src/private/core/setUpDOM.js +0 -18
  317. package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
  318. /package/src/private/{core → styles}/composeStyles.js +0 -0
@@ -56,14 +56,14 @@ void SwitchComponentView::UnmountChildComponentView(
56
56
  base_type::UnmountChildComponentView(childComponentView, index);
57
57
  }
58
58
 
59
- void SwitchComponentView::HandleCommand(
60
- winrt::hstring commandName,
61
- const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept {
59
+ void SwitchComponentView::HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
60
+ Super::HandleCommand(args);
61
+ if (args.Handled())
62
+ return;
63
+ auto commandName = args.CommandName();
62
64
  if (commandName == L"setValue") {
63
65
  // TODO - Current implementation always aligns with JS value
64
66
  // This will be needed when we move to using WinUI controls
65
- } else {
66
- Super::HandleCommand(commandName, args);
67
67
  }
68
68
  }
69
69
 
@@ -261,7 +261,7 @@ void SwitchComponentView::OnPointerPressed(
261
261
  m_supressAnimationForNextFrame = true;
262
262
 
263
263
  if (auto root = rootComponentView()) {
264
- root->TrySetFocusedComponent(*get_strong());
264
+ root->TrySetFocusedComponent(*get_strong(), winrt::Microsoft::ReactNative::FocusNavigationDirection::None);
265
265
  }
266
266
 
267
267
  updateVisuals();
@@ -27,8 +27,7 @@ struct SwitchComponentView : SwitchComponentViewT<SwitchComponentView, ViewCompo
27
27
  void UnmountChildComponentView(
28
28
  const winrt::Microsoft::ReactNative::ComponentView &childComponentView,
29
29
  uint32_t index) noexcept override;
30
- void HandleCommand(winrt::hstring commandName, const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept
31
- override;
30
+ void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
32
31
  void updateProps(facebook::react::Props::Shared const &props, facebook::react::Props::Shared const &oldProps) noexcept
33
32
  override;
34
33
  void updateState(facebook::react::State::Shared const &state, facebook::react::State::Shared const &oldState) noexcept
@@ -176,9 +176,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
176
176
  return false;
177
177
  }
178
178
 
179
- m_outer->m_caretVisual.Position(
180
- {x - (m_outer->m_layoutMetrics.frame.origin.x * m_outer->m_layoutMetrics.pointScaleFactor),
181
- y - (m_outer->m_layoutMetrics.frame.origin.y * m_outer->m_layoutMetrics.pointScaleFactor)});
179
+ auto pt = m_outer->getClientOffset();
180
+ m_outer->m_caretVisual.Position({x - pt.x, y - pt.y});
182
181
  return true;
183
182
  }
184
183
 
@@ -225,7 +224,8 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
225
224
  winrt::Microsoft::ReactNative::ComponentView view{nullptr};
226
225
  winrt::check_hresult(
227
226
  m_outer->QueryInterface(winrt::guid_of<winrt::Microsoft::ReactNative::ComponentView>(), winrt::put_abi(view)));
228
- m_outer->rootComponentView()->TrySetFocusedComponent(view);
227
+ m_outer->rootComponentView()->TrySetFocusedComponent(
228
+ view, winrt::Microsoft::ReactNative::FocusNavigationDirection::None);
229
229
  // assert(false);
230
230
  // TODO focus
231
231
  }
@@ -261,7 +261,7 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
261
261
 
262
262
  //@cmember Retrieves the coordinates of a window's client area
263
263
  HRESULT TxGetClientRect(LPRECT prc) override {
264
- *prc = m_outer->m_rcClient;
264
+ *prc = m_outer->getClientRect();
265
265
  return S_OK;
266
266
  }
267
267
 
@@ -454,6 +454,7 @@ facebook::react::AttributedString WindowsTextInputComponentView::getAttributedSt
454
454
  // Use BaseTextShadowNode to get attributed string from children
455
455
 
456
456
  auto childTextAttributes = facebook::react::TextAttributes::defaultTextAttributes();
457
+ childTextAttributes.fontSizeMultiplier = m_fontSizeMultiplier;
457
458
 
458
459
  childTextAttributes.apply(windowsTextInputProps().textAttributes);
459
460
 
@@ -463,9 +464,9 @@ facebook::react::AttributedString WindowsTextInputComponentView::getAttributedSt
463
464
  // BaseTextShadowNode only gets children. We must detect and prepend text
464
465
  // value attributes manually.
465
466
  auto text = GetTextFromRichEdit();
466
- // if (!m_props->text.empty()) {
467
467
  if (!text.empty()) {
468
468
  auto textAttributes = facebook::react::TextAttributes::defaultTextAttributes();
469
+ textAttributes.fontSizeMultiplier = m_fontSizeMultiplier;
469
470
  textAttributes.apply(windowsTextInputProps().textAttributes);
470
471
  auto fragment = facebook::react::AttributedString::Fragment{};
471
472
  fragment.string = text;
@@ -491,66 +492,41 @@ WindowsTextInputComponentView::WindowsTextInputComponentView(
491
492
  compContext,
492
493
  tag,
493
494
  reactContext,
494
- ComponentViewFeatures::Default & ~ComponentViewFeatures::Background) {
495
- /*
496
- m_textChangedRevoker =
497
- m_element.TextChanged(winrt::auto_revoke, [this](auto sender, xaml::Controls::TextChangedEventArgs args) {
498
- auto data = m_state->getData();
499
- data.attributedString = getAttributedString();
500
- data.mostRecentEventCount = m_nativeEventCount;
501
- m_state->updateState(std::move(data));
502
-
503
- if (m_eventEmitter && !m_comingFromJS) {
504
- auto emitter = std::static_pointer_cast<const facebook::react::WindowsTextInputEventEmitter>(m_eventEmitter);
505
- facebook::react::WindowsTextInputEventEmitter::OnChange onChangeArgs;
506
- onChangeArgs.text = winrt::to_string(m_element.Text());
507
- onChangeArgs.eventCount = ++m_nativeEventCount;
508
- emitter->onChange(onChangeArgs);
509
- }
510
- });
511
-
512
- m_SelectionChangedRevoker = m_element.SelectionChanged(winrt::auto_revoke, [this](auto sender, auto args) {
513
- if (m_eventEmitter) {
514
- auto emitter = std::static_pointer_cast<const facebook::react::WindowsTextInputEventEmitter>(m_eventEmitter);
515
- facebook::react::WindowsTextInputEventEmitter::OnSelectionChange onSelectionChangeArgs;
516
- onSelectionChangeArgs.selection.start = m_element.SelectionStart();
517
- onSelectionChangeArgs.selection.end = m_element.SelectionStart() + m_element.SelectionLength();
518
- emitter->onSelectionChange(onSelectionChangeArgs);
519
- }
520
- });
521
- */
522
- }
495
+ ComponentViewFeatures::Default & ~ComponentViewFeatures::Background) {}
523
496
 
524
497
  void WindowsTextInputComponentView::HandleCommand(
525
- winrt::hstring commandName,
526
- const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept {
498
+ const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
499
+ Super::HandleCommand(args);
500
+ if (args.Handled())
501
+ return;
502
+
503
+ auto commandName = args.CommandName();
527
504
  if (commandName == L"setTextAndSelection") {
528
505
  int eventCount, begin, end;
529
- winrt::hstring text;
506
+ std::optional<winrt::hstring> text;
530
507
 
531
- winrt::Microsoft::ReactNative::ReadArgs(args, eventCount, text, begin, end);
508
+ winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), eventCount, text, begin, end);
532
509
  if (eventCount >= m_nativeEventCount) {
533
510
  m_comingFromJS = true;
534
- UpdateText(winrt::to_string(text));
535
-
536
- SELCHANGE sc;
537
- memset(&sc, 0, sizeof(sc));
538
- sc.chrg.cpMin = static_cast<LONG>(begin);
539
- sc.chrg.cpMax = static_cast<LONG>(end);
540
- sc.seltyp = (begin == end) ? SEL_EMPTY : SEL_TEXT;
541
-
542
- LRESULT res;
543
- /*
544
- winrt::check_hresult(m_textServices->TxSendMessage(
545
- EM_SELCHANGE, 0 , reinterpret_cast<WPARAM>(&sc), &res));
546
- */
547
- winrt::check_hresult(
548
- m_textServices->TxSendMessage(EM_SETSEL, static_cast<WPARAM>(begin), static_cast<LPARAM>(end), &res));
511
+ {
512
+ if (text.has_value()) {
513
+ DrawBlock db(*this);
514
+ UpdateText(winrt::to_string(text.value()));
515
+ }
516
+
517
+ SELCHANGE sc;
518
+ memset(&sc, 0, sizeof(sc));
519
+ sc.chrg.cpMin = static_cast<LONG>(begin);
520
+ sc.chrg.cpMax = static_cast<LONG>(end);
521
+ sc.seltyp = (begin == end) ? SEL_EMPTY : SEL_TEXT;
522
+
523
+ LRESULT res;
524
+ winrt::check_hresult(
525
+ m_textServices->TxSendMessage(EM_SETSEL, static_cast<WPARAM>(begin), static_cast<LPARAM>(end), &res));
526
+ }
549
527
 
550
528
  m_comingFromJS = false;
551
529
  }
552
- } else {
553
- Super::HandleCommand(commandName, args);
554
530
  }
555
531
  }
556
532
 
@@ -986,37 +962,35 @@ void WindowsTextInputComponentView::updateProps(
986
962
  *std::static_pointer_cast<const facebook::react::WindowsTextInputProps>(oldProps ? oldProps : viewProps());
987
963
  const auto &newTextInputProps = *std::static_pointer_cast<const facebook::react::WindowsTextInputProps>(props);
988
964
 
989
- DWORD propBitsMask = 0;
990
- DWORD propBits = 0;
991
-
992
965
  Super::updateProps(props, oldProps);
993
966
 
994
967
  if (!facebook::react::floatEquality(
995
968
  oldTextInputProps.textAttributes.fontSize, newTextInputProps.textAttributes.fontSize) ||
969
+ (oldTextInputProps.textAttributes.allowFontScaling != newTextInputProps.textAttributes.allowFontScaling) ||
996
970
  oldTextInputProps.textAttributes.fontWeight != newTextInputProps.textAttributes.fontWeight) {
997
- propBitsMask |= TXTBIT_CHARFORMATCHANGE;
998
- propBits |= TXTBIT_CHARFORMATCHANGE;
971
+ m_propBitsMask |= TXTBIT_CHARFORMATCHANGE;
972
+ m_propBits |= TXTBIT_CHARFORMATCHANGE;
999
973
  }
1000
974
 
1001
975
  if (oldTextInputProps.secureTextEntry != newTextInputProps.secureTextEntry) {
1002
- propBitsMask |= TXTBIT_USEPASSWORD;
976
+ m_propBitsMask |= TXTBIT_USEPASSWORD;
1003
977
  if (newTextInputProps.secureTextEntry) {
1004
- propBits |= TXTBIT_USEPASSWORD;
978
+ m_propBits |= TXTBIT_USEPASSWORD;
1005
979
  }
1006
980
  }
1007
981
 
1008
982
  if (oldTextInputProps.multiline != newTextInputProps.multiline) {
1009
983
  m_multiline = newTextInputProps.multiline;
1010
- propBitsMask |= TXTBIT_MULTILINE | TXTBIT_WORDWRAP;
984
+ m_propBitsMask |= TXTBIT_MULTILINE | TXTBIT_WORDWRAP;
1011
985
  if (newTextInputProps.multiline) {
1012
- propBits |= TXTBIT_MULTILINE | TXTBIT_WORDWRAP;
986
+ m_propBits |= TXTBIT_MULTILINE | TXTBIT_WORDWRAP;
1013
987
  }
1014
988
  }
1015
989
 
1016
990
  if (oldTextInputProps.editable != newTextInputProps.editable) {
1017
- propBitsMask |= TXTBIT_READONLY;
991
+ m_propBitsMask |= TXTBIT_READONLY;
1018
992
  if (!newTextInputProps.editable) {
1019
- propBits |= TXTBIT_READONLY;
993
+ m_propBits |= TXTBIT_READONLY;
1020
994
  }
1021
995
  }
1022
996
 
@@ -1048,62 +1022,7 @@ void WindowsTextInputComponentView::updateProps(
1048
1022
  m_submitKeyEvents.clear();
1049
1023
  }
1050
1024
 
1051
- /*
1052
- if (oldTextInputProps.textAttributes.foregroundColor != newTextInputProps.textAttributes.foregroundColor) {
1053
- if (newTextInputProps.textAttributes.foregroundColor)
1054
- m_element.Foreground(newTextInputProps.textAttributes.foregroundColor.AsWindowsBrush());
1055
- else
1056
- m_element.ClearValue(::xaml::Controls::TextBlock::ForegroundProperty());
1057
- }
1058
-
1059
- if (oldTextInputProps.textAttributes.fontStyle != newTextInputProps.textAttributes.fontStyle) {
1060
- switch (newTextInputProps.textAttributes.fontStyle.value_or(facebook::react::FontStyle::Normal)) {
1061
- case facebook::react::FontStyle::Italic:
1062
- m_element.FontStyle(winrt::Windows::UI::Text::FontStyle::Italic);
1063
- break;
1064
- case facebook::react::FontStyle::Normal:
1065
- m_element.FontStyle(winrt::Windows::UI::Text::FontStyle::Normal);
1066
- break;
1067
- case facebook::react::FontStyle::Oblique:
1068
- m_element.FontStyle(winrt::Windows::UI::Text::FontStyle::Oblique);
1069
- break;
1070
- default:
1071
- assert(false);
1072
- }
1073
- }
1074
-
1075
- if (oldTextInputProps.textAttributes.fontFamily != newTextInputProps.textAttributes.fontFamily) {
1076
- if (newTextInputProps.textAttributes.fontFamily.empty())
1077
- m_element.FontFamily(xaml::Media::FontFamily(L"Segoe UI"));
1078
- else
1079
- m_element.FontFamily(xaml::Media::FontFamily(
1080
- Microsoft::Common::Unicode::Utf8ToUtf16(newTextInputProps.textAttributes.fontFamily)));
1081
- }
1082
-
1083
- if (oldTextInputProps.allowFontScaling != newTextInputProps.allowFontScaling) {
1084
- m_element.IsTextScaleFactorEnabled(newTextInputProps.allowFontScaling);
1085
- }
1086
-
1087
- if (oldTextInputProps.selection.start != newTextInputProps.selection.start ||
1088
- oldTextInputProps.selection.end != newTextInputProps.selection.end) {
1089
- m_element.Select(
1090
- newTextInputProps.selection.start, newTextInputProps.selection.end - newTextInputProps.selection.start);
1091
- }
1092
-
1093
- if (oldTextInputProps.autoCapitalize != newTextInputProps.autoCapitalize) {
1094
- if (newTextInputProps.autoCapitalize == "characters") {
1095
- m_element.CharacterCasing(xaml::Controls::CharacterCasing::Upper);
1096
- } else { // anything else turns off autoCap (should be "None" but
1097
- // we don't support "words"/"sentences" yet)
1098
- m_element.CharacterCasing(xaml::Controls::CharacterCasing::Normal);
1099
- }
1100
- }
1101
- */
1102
-
1103
- if (propBitsMask != 0) {
1104
- DrawBlock db(*this);
1105
- winrt::check_hresult(m_textServices->OnTxPropertyBitsChange(propBitsMask, propBits));
1106
- }
1025
+ UpdatePropertyBits();
1107
1026
  }
1108
1027
 
1109
1028
  void WindowsTextInputComponentView::updateState(
@@ -1113,7 +1032,6 @@ void WindowsTextInputComponentView::updateState(
1113
1032
 
1114
1033
  if (!m_state) {
1115
1034
  assert(false && "State is `null` for <TextInput> component.");
1116
- // m_element.Text(L"");
1117
1035
  return;
1118
1036
  }
1119
1037
 
@@ -1121,14 +1039,19 @@ void WindowsTextInputComponentView::updateState(
1121
1039
  m_mostRecentEventCount = m_state->getData().mostRecentEventCount;
1122
1040
  }
1123
1041
 
1042
+ if (auto root = rootComponentView()) {
1043
+ auto fontSizeMultiplier = root->FontSizeMultiplier();
1044
+ if (fontSizeMultiplier != m_fontSizeMultiplier) {
1045
+ fontSizeMultiplier = m_fontSizeMultiplier;
1046
+ m_propBitsMask |= TXTBIT_CHARFORMATCHANGE;
1047
+ m_propBits |= TXTBIT_CHARFORMATCHANGE;
1048
+ }
1049
+ }
1050
+
1124
1051
  if (m_mostRecentEventCount == m_state->getData().mostRecentEventCount) {
1125
1052
  m_comingFromState = true;
1126
- // Only handle single/empty fragments right now -- ignore the other fragments
1127
-
1128
- UpdateText(
1129
- m_state->getData().attributedString.getFragments().size()
1130
- ? m_state->getData().attributedString.getFragments()[0].string
1131
- : "");
1053
+ auto &fragments = m_state->getData().attributedString.getFragments();
1054
+ UpdateText(fragments.size() ? fragments[0].string : "");
1132
1055
 
1133
1056
  m_comingFromState = false;
1134
1057
  }
@@ -1243,13 +1166,42 @@ std::string WindowsTextInputComponentView::GetTextFromRichEdit() const noexcept
1243
1166
  void WindowsTextInputComponentView::FinalizeUpdates(
1244
1167
  winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept {
1245
1168
  Super::FinalizeUpdates(updateMask);
1246
- ensureDrawingSurface();
1247
- if (m_needsRedraw) {
1248
- DrawText();
1169
+ InternalFinalize();
1170
+ }
1171
+
1172
+ void WindowsTextInputComponentView::UpdatePropertyBits() noexcept {
1173
+ if (m_propBitsMask != 0) {
1174
+ DrawBlock db(*this);
1175
+ winrt::check_hresult(m_textServices->OnTxPropertyBitsChange(m_propBitsMask, m_propBits));
1176
+ m_propBitsMask = 0;
1177
+ m_propBits = 0;
1249
1178
  }
1250
1179
  }
1251
1180
 
1252
- std::optional<std::string> WindowsTextInputComponentView::getAcccessiblityValue() noexcept {
1181
+ void WindowsTextInputComponentView::InternalFinalize() noexcept {
1182
+ if (m_mounted) {
1183
+ UpdatePropertyBits();
1184
+
1185
+ ensureDrawingSurface();
1186
+ if (m_needsRedraw) {
1187
+ DrawText();
1188
+ }
1189
+ }
1190
+ }
1191
+
1192
+ void WindowsTextInputComponentView::onMounted() noexcept {
1193
+ Super::onMounted();
1194
+
1195
+ auto fontSizeMultiplier = rootComponentView()->FontSizeMultiplier();
1196
+ if (m_fontSizeMultiplier != fontSizeMultiplier) {
1197
+ m_fontSizeMultiplier = fontSizeMultiplier;
1198
+ m_propBitsMask |= TXTBIT_CHARFORMATCHANGE;
1199
+ m_propBits |= TXTBIT_CHARFORMATCHANGE;
1200
+ }
1201
+ InternalFinalize();
1202
+ }
1203
+
1204
+ std::optional<std::string> WindowsTextInputComponentView::getAccessiblityValue() noexcept {
1253
1205
  return GetTextFromRichEdit();
1254
1206
  }
1255
1207
 
@@ -1291,9 +1243,9 @@ void WindowsTextInputComponentView::UpdateCharFormat() noexcept {
1291
1243
 
1292
1244
  // set font size -- 15 to convert twips to pt
1293
1245
  const auto &props = windowsTextInputProps();
1294
- float fontSize = props.textAttributes.fontSize;
1295
- if (std::isnan(fontSize))
1296
- fontSize = facebook::react::TextAttributes::defaultTextAttributes().fontSize;
1246
+ float fontSize = m_fontSizeMultiplier *
1247
+ (std::isnan(props.textAttributes.fontSize) ? facebook::react::TextAttributes::defaultTextAttributes().fontSize
1248
+ : props.textAttributes.fontSize);
1297
1249
  // TODO get fontSize from props.textAttributes, or defaultTextAttributes, or fragment?
1298
1250
  cfNew.dwMask |= CFM_SIZE;
1299
1251
  cfNew.yHeight = static_cast<LONG>(fontSize * 15);
@@ -1360,8 +1312,8 @@ void WindowsTextInputComponentView::ensureDrawingSurface() noexcept {
1360
1312
  winrt::Windows::Graphics::DirectX::DirectXPixelFormat::B8G8R8A8UIntNormalized,
1361
1313
  winrt::Windows::Graphics::DirectX::DirectXAlphaMode::Premultiplied);
1362
1314
 
1363
- m_rcClient = getClientRect();
1364
- winrt::check_hresult(m_textServices->OnTxInPlaceActivate(&m_rcClient));
1315
+ auto rc = getClientRect();
1316
+ winrt::check_hresult(m_textServices->OnTxInPlaceActivate(&rc));
1365
1317
 
1366
1318
  LRESULT lresult;
1367
1319
  winrt::check_hresult(
@@ -1391,6 +1343,7 @@ winrt::com_ptr<::IDWriteTextLayout> WindowsTextInputComponentView::CreatePlaceho
1391
1343
  if (std::isnan(props.textAttributes.fontSize)) {
1392
1344
  textAttributes.fontSize = 12.0f;
1393
1345
  }
1346
+ textAttributes.fontSizeMultiplier = m_fontSizeMultiplier;
1394
1347
  fragment1.string = props.placeholder;
1395
1348
  fragment1.textAttributes = textAttributes;
1396
1349
  attributedString.appendFragment(fragment1);
@@ -1440,7 +1393,11 @@ void WindowsTextInputComponentView::DrawText() noexcept {
1440
1393
  static_cast<LONG>(offset.x) + static_cast<LONG>(m_imgWidth),
1441
1394
  static_cast<LONG>(offset.y) + static_cast<LONG>(m_imgHeight)};
1442
1395
 
1443
- winrt::check_hresult(m_textServices->OnTxInPlaceActivate(&rcClient));
1396
+ {
1397
+ m_cDrawBlock++; // Dont use AutoDrawBlock as we are already in draw, and dont need to draw again.
1398
+ winrt::check_hresult(m_textServices->OnTxInPlaceActivate(&rcClient));
1399
+ m_cDrawBlock--;
1400
+ }
1444
1401
 
1445
1402
  const auto &props = windowsTextInputProps();
1446
1403
  if (facebook::react::isColorMeaningful(props.backgroundColor)) {
@@ -46,8 +46,7 @@ struct WindowsTextInputComponentView
46
46
  void FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept override;
47
47
  static facebook::react::SharedViewProps defaultProps() noexcept;
48
48
  const facebook::react::WindowsTextInputProps &windowsTextInputProps() const noexcept;
49
- void HandleCommand(winrt::hstring commandName, const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept
50
- override;
49
+ void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
51
50
  void OnRenderingDeviceLost() noexcept override;
52
51
  void onLostFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override;
53
52
  void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override;
@@ -66,8 +65,9 @@ struct WindowsTextInputComponentView
66
65
  void OnKeyUp(const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
67
66
  void OnCharacterReceived(const winrt::Microsoft::ReactNative::Composition::Input::CharacterReceivedRoutedEventArgs
68
67
  &args) noexcept override;
68
+ void onMounted() noexcept override;
69
69
 
70
- std::optional<std::string> getAcccessiblityValue() noexcept override;
70
+ std::optional<std::string> getAccessiblityValue() noexcept override;
71
71
  void setAcccessiblityValue(std::string &&value) noexcept override;
72
72
  bool getAcccessiblityIsReadOnly() noexcept override;
73
73
 
@@ -101,6 +101,8 @@ struct WindowsTextInputComponentView
101
101
  const facebook::react::SharedColor &foregroundColor) noexcept;
102
102
  bool ShouldSubmit(
103
103
  const winrt::Microsoft::ReactNative::Composition::Input::CharacterReceivedRoutedEventArgs &args) noexcept;
104
+ void InternalFinalize() noexcept;
105
+ void UpdatePropertyBits() noexcept;
104
106
 
105
107
  winrt::Windows::UI::Composition::CompositionSurfaceBrush m_brush{nullptr};
106
108
  winrt::Microsoft::ReactNative::Composition::Experimental::ICaretVisual m_caretVisual{nullptr};
@@ -114,7 +116,7 @@ struct WindowsTextInputComponentView
114
116
  winrt::com_ptr<ITextServices2> m_textServices;
115
117
  unsigned int m_imgWidth{0}, m_imgHeight{0};
116
118
  std::shared_ptr<facebook::react::WindowsTextInputShadowNode::ConcreteState const> m_state;
117
- RECT m_rcClient;
119
+ float m_fontSizeMultiplier{1.0};
118
120
  int64_t m_mostRecentEventCount{0};
119
121
  int m_nativeEventCount{0};
120
122
  bool m_comingFromJS{false};
@@ -124,6 +126,8 @@ struct WindowsTextInputComponentView
124
126
  bool m_drawing{false};
125
127
  bool m_clearTextOnSubmit{false};
126
128
  bool m_multiline{false};
129
+ DWORD m_propBitsMask{0};
130
+ DWORD m_propBits{0};
127
131
  std::vector<facebook::react::CompWindowsTextInputSubmitKeyEventsStruct> m_submitKeyEvents;
128
132
  };
129
133
 
@@ -23,12 +23,17 @@ void WindowsTextInputShadowNode::setContextContainer(ContextContainer *contextCo
23
23
  m_contextContainer = contextContainer;
24
24
  }
25
25
 
26
- AttributedString WindowsTextInputShadowNode::getAttributedString() const {
26
+ AttributedString WindowsTextInputShadowNode::getAttributedString(const LayoutContext &layoutContext) const {
27
27
  // Use BaseTextShadowNode to get attributed string from children
28
28
 
29
29
  auto childTextAttributes = TextAttributes::defaultTextAttributes();
30
+ childTextAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
30
31
 
31
32
  childTextAttributes.apply(getConcreteProps().textAttributes);
33
+ // Don't propagate the background color of the TextInput onto the attributed
34
+ // string. Android tries to render shadow of the background alongside the
35
+ // shadow of the text which results in weird artifacts.
36
+ childTextAttributes.backgroundColor = HostPlatformColor::UndefinedColor;
32
37
 
33
38
  auto attributedString = AttributedString{};
34
39
  auto attachments = BaseTextShadowNode::Attachments{};
@@ -38,6 +43,7 @@ AttributedString WindowsTextInputShadowNode::getAttributedString() const {
38
43
  // value attributes manually.
39
44
  if (!getConcreteProps().text.empty()) {
40
45
  auto textAttributes = TextAttributes::defaultTextAttributes();
46
+ textAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
41
47
  textAttributes.apply(getConcreteProps().textAttributes);
42
48
  auto fragment = AttributedString::Fragment{};
43
49
  fragment.string = getConcreteProps().text;
@@ -59,7 +65,7 @@ AttributedString WindowsTextInputShadowNode::getAttributedString() const {
59
65
  // display at all.
60
66
  // TODO T67606511: We will redefine the measurement of empty strings as part
61
67
  // of T67606511
62
- AttributedString WindowsTextInputShadowNode::getPlaceholderAttributedString() const {
68
+ AttributedString WindowsTextInputShadowNode::getPlaceholderAttributedString(const LayoutContext &layoutContext) const {
63
69
  // Return placeholder text, since text and children are empty.
64
70
  auto textAttributedString = AttributedString{};
65
71
  auto fragment = AttributedString::Fragment{};
@@ -70,6 +76,7 @@ AttributedString WindowsTextInputShadowNode::getPlaceholderAttributedString() co
70
76
  }
71
77
 
72
78
  auto textAttributes = TextAttributes::defaultTextAttributes();
79
+ textAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
73
80
  textAttributes.apply(getConcreteProps().textAttributes);
74
81
 
75
82
  // If there's no text, it's possible that this Fragment isn't actually
@@ -86,10 +93,10 @@ void WindowsTextInputShadowNode::setTextLayoutManager(SharedTextLayoutManager te
86
93
  m_textLayoutManager = std::move(textLayoutManager);
87
94
  }
88
95
 
89
- AttributedString WindowsTextInputShadowNode::getMostRecentAttributedString() const {
96
+ AttributedString WindowsTextInputShadowNode::getMostRecentAttributedString(const LayoutContext &layoutContext) const {
90
97
  const auto &state = getStateData();
91
98
 
92
- auto reactTreeAttributedString = getAttributedString();
99
+ auto reactTreeAttributedString = getAttributedString(layoutContext);
93
100
 
94
101
  // Sometimes the treeAttributedString will only differ from the state
95
102
  // not by inherent properties (string or prop attributes), but by the frame of
@@ -101,10 +108,10 @@ AttributedString WindowsTextInputShadowNode::getMostRecentAttributedString() con
101
108
  return (!treeAttributedStringChanged ? state.attributedString : reactTreeAttributedString);
102
109
  }
103
110
 
104
- void WindowsTextInputShadowNode::updateStateIfNeeded() {
111
+ void WindowsTextInputShadowNode::updateStateIfNeeded(const LayoutContext &layoutContext) {
105
112
  ensureUnsealed();
106
113
 
107
- auto reactTreeAttributedString = getAttributedString();
114
+ auto reactTreeAttributedString = getAttributedString(layoutContext);
108
115
  const auto &state = getStateData();
109
116
 
110
117
  // Tree is often out of sync with the value of the TextInput.
@@ -125,13 +132,13 @@ void WindowsTextInputShadowNode::updateStateIfNeeded() {
125
132
  // in the AttributedString, and when State is updated, it needs some way to
126
133
  // reconstruct a Fragment with default TextAttributes.
127
134
  auto defaultTextAttributes = TextAttributes::defaultTextAttributes();
128
-
135
+ defaultTextAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
129
136
  defaultTextAttributes.apply(getConcreteProps().textAttributes);
130
137
 
131
138
  auto newEventCount = state.reactTreeAttributedString.isContentEqual(reactTreeAttributedString)
132
139
  ? 0
133
140
  : getConcreteProps().mostRecentEventCount;
134
- auto newAttributedString = getMostRecentAttributedString();
141
+ auto newAttributedString = getMostRecentAttributedString(layoutContext);
135
142
 
136
143
  // Even if we're here and updating state, it may be only to update the layout
137
144
  // manager If that is the case, make sure we don't update text: pass in the
@@ -168,10 +175,10 @@ Size WindowsTextInputShadowNode::measureContent(
168
175
  // during layout, but not during `measure`. If State is out-of-date in layout,
169
176
  // it's too late: measure will have already operated on old State. Thus, we
170
177
  // use the same value here that we *will* use in layout to update the state.
171
- AttributedString attributedString = getMostRecentAttributedString();
178
+ AttributedString attributedString = getMostRecentAttributedString(layoutContext);
172
179
 
173
180
  if (attributedString.isEmpty()) {
174
- attributedString = getPlaceholderAttributedString();
181
+ attributedString = getPlaceholderAttributedString(layoutContext);
175
182
  }
176
183
 
177
184
  if (attributedString.isEmpty() && getStateData().mostRecentEventCount != 0) {
@@ -190,7 +197,7 @@ Size WindowsTextInputShadowNode::measureContent(
190
197
  }
191
198
 
192
199
  void WindowsTextInputShadowNode::layout(LayoutContext layoutContext) {
193
- updateStateIfNeeded();
200
+ updateStateIfNeeded(layoutContext);
194
201
  ConcreteViewShadowNode::layout(layoutContext);
195
202
  }
196
203
 
@@ -31,6 +31,7 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode<
31
31
  static ShadowNodeTraits BaseTraits() {
32
32
  auto traits = ConcreteViewShadowNode::BaseTraits();
33
33
  traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
34
+ traits.set(ShadowNodeTraits::Trait::BaselineYogaNode);
34
35
  return traits;
35
36
  }
36
37
 
@@ -41,8 +42,8 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode<
41
42
  /*
42
43
  * Returns a `AttributedString` which represents text content of the node.
43
44
  */
44
- AttributedString getAttributedString() const;
45
- AttributedString getPlaceholderAttributedString() const;
45
+ AttributedString getAttributedString(const LayoutContext &layoutContext) const;
46
+ AttributedString getPlaceholderAttributedString(const LayoutContext &layoutContext) const;
46
47
 
47
48
  /*
48
49
  * Associates a shared TextLayoutManager with the node.
@@ -62,13 +63,13 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode<
62
63
  /**
63
64
  * Get the most up-to-date attributed string for measurement and State.
64
65
  */
65
- AttributedString getMostRecentAttributedString() const;
66
+ AttributedString getMostRecentAttributedString(const LayoutContext &layoutContext) const;
66
67
 
67
68
  /*
68
69
  * Creates a `State` object (with `AttributedText` and
69
70
  * `TextLayoutManager`) if needed.
70
71
  */
71
- void updateStateIfNeeded();
72
+ void updateStateIfNeeded(const LayoutContext &layoutContext);
72
73
 
73
74
  SharedTextLayoutManager m_textLayoutManager;
74
75
 
@@ -31,17 +31,4 @@ WindowsTextInputState::WindowsTextInputState(
31
31
  defaultThemePaddingTop(defaultThemePaddingTop),
32
32
  defaultThemePaddingBottom(defaultThemePaddingBottom) {}
33
33
 
34
- WindowsTextInputState::WindowsTextInputState(const WindowsTextInputState &previousState, const folly::dynamic &data)
35
- : mostRecentEventCount(data.getDefault("mostRecentEventCount", previousState.mostRecentEventCount).getInt()),
36
- cachedAttributedStringId(data.getDefault("opaqueCacheId", previousState.cachedAttributedStringId).getInt()),
37
- attributedString(previousState.attributedString),
38
- reactTreeAttributedString(previousState.reactTreeAttributedString),
39
- paragraphAttributes(previousState.paragraphAttributes),
40
- defaultThemePaddingStart(
41
- data.getDefault("themePaddingStart", previousState.defaultThemePaddingStart).getDouble()),
42
- defaultThemePaddingEnd(data.getDefault("themePaddingEnd", previousState.defaultThemePaddingEnd).getDouble()),
43
- defaultThemePaddingTop(data.getDefault("themePaddingTop", previousState.defaultThemePaddingTop).getDouble()),
44
- defaultThemePaddingBottom(
45
- data.getDefault("themePaddingBottom", previousState.defaultThemePaddingBottom).getDouble()){};
46
-
47
34
  } // namespace facebook::react
@@ -66,9 +66,6 @@ class WindowsTextInputState final {
66
66
  double defaultThemePaddingBottom);
67
67
 
68
68
  WindowsTextInputState() = default;
69
- WindowsTextInputState(const WindowsTextInputState &previousState, const folly::dynamic &data);
70
- folly::dynamic getDynamic() const;
71
- MapBuffer getMapBuffer() const;
72
69
  };
73
70
 
74
71
  } // namespace facebook::react