react-native-windows 0.68.1 → 0.69.0-preview.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/.flowconfig +1 -3
  2. package/Chakra/ChakraHelpers.cpp +0 -1
  3. package/Directory.Build.props +3 -0
  4. package/Directory.Build.targets +1 -1
  5. package/Folly/TEMP_UntilFollyUpdate/dynamic-inl.h +1411 -0
  6. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +336 -0
  7. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +182 -0
  8. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
  9. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
  10. package/Libraries/Alert/Alert.windows.js +2 -2
  11. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  12. package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
  13. package/Libraries/Animated/NativeAnimatedModule.js +1 -0
  14. package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
  15. package/Libraries/Animated/animations/TimingAnimation.js +6 -11
  16. package/Libraries/Animated/createAnimatedComponent.js +2 -2
  17. package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
  18. package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
  19. package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
  20. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  21. package/Libraries/AppState/AppState.js +1 -1
  22. package/Libraries/Blob/URL.js +7 -1
  23. package/Libraries/Components/Button.js +3 -0
  24. package/Libraries/Components/Button.windows.js +4 -0
  25. package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
  26. package/Libraries/Components/Pressable/Pressable.js +3 -3
  27. package/Libraries/Components/Pressable/Pressable.windows.js +3 -3
  28. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
  29. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
  30. package/Libraries/Components/ScrollView/ScrollView.js +1 -1
  31. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
  32. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
  33. package/Libraries/Components/Slider/Slider.js +0 -2
  34. package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
  35. package/Libraries/Components/StatusBar/StatusBar.js +6 -1
  36. package/Libraries/Components/Switch/Switch.js +11 -1
  37. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
  38. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
  39. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
  40. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
  41. package/Libraries/Components/TextInput/TextInput.js +1 -8
  42. package/Libraries/Components/TextInput/TextInput.windows.js +4 -9
  43. package/Libraries/Components/TextInput/TextInputState.js +10 -2
  44. package/Libraries/Components/TextInput/TextInputState.windows.js +10 -3
  45. package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -1
  46. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  47. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
  48. package/Libraries/Components/Touchable/TouchableHighlight.windows.js +6 -5
  49. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
  50. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
  51. package/Libraries/Components/Touchable/TouchableOpacity.windows.js +11 -5
  52. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
  53. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
  54. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  55. package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +1 -0
  56. package/Libraries/Components/View/View.windows.js +33 -1
  57. package/Libraries/Components/View/ViewNativeComponent.js +68 -8
  58. package/Libraries/Components/View/ViewPropTypes.js +36 -4
  59. package/Libraries/Components/View/ViewPropTypes.windows.js +36 -4
  60. package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
  61. package/Libraries/Core/ExceptionsManager.js +1 -1
  62. package/Libraries/Core/RawEventEmitter.js +38 -0
  63. package/Libraries/Core/ReactNativeVersion.js +2 -2
  64. package/Libraries/Core/polyfillPromise.js +32 -0
  65. package/Libraries/Core/setUpReactDevTools.js +3 -2
  66. package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
  67. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
  68. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
  69. package/Libraries/Events/CustomEvent.js +32 -0
  70. package/Libraries/Events/EventPolyfill.js +239 -0
  71. package/Libraries/Image/Image.android.js +0 -6
  72. package/Libraries/Image/Image.ios.js +0 -6
  73. package/Libraries/Image/Image.windows.js +2 -8
  74. package/Libraries/Image/ImageViewNativeComponent.js +18 -3
  75. package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
  76. package/Libraries/Inspector/Inspector.js +2 -4
  77. package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
  78. package/Libraries/Interaction/InteractionManager.js +1 -12
  79. package/Libraries/Interaction/TaskQueue.js +5 -4
  80. package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
  81. package/Libraries/Linking/Linking.js +1 -1
  82. package/Libraries/Lists/FlatList.js +27 -6
  83. package/Libraries/Lists/VirtualizedList.js +71 -55
  84. package/Libraries/Lists/VirtualizedListContext.js +7 -3
  85. package/Libraries/Lists/VirtualizedSectionList.js +2 -2
  86. package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
  87. package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
  88. package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
  89. package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
  90. package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +91 -42
  91. package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +13 -13
  92. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  93. package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
  94. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  95. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  96. package/Libraries/LogBox/LogBox.js +2 -21
  97. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
  98. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
  99. package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
  100. package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
  101. package/Libraries/NativeComponent/BaseViewConfig.windows.js +334 -0
  102. package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
  103. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
  104. package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
  105. package/Libraries/NativeComponent/ViewConfig.js +4 -4
  106. package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
  107. package/Libraries/Network/FormData.js +7 -1
  108. package/Libraries/Pressability/Pressability.js +115 -46
  109. package/Libraries/Pressability/Pressability.windows.js +190 -74
  110. package/Libraries/Pressability/PressabilityDebug.js +5 -9
  111. package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
  112. package/Libraries/ReactNative/AppContainer.js +1 -1
  113. package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
  114. package/Libraries/ReactNative/PaperUIManager.windows.js +5 -5
  115. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
  116. package/Libraries/ReactNative/UIManager.js +2 -3
  117. package/Libraries/ReactNative/renderApplication.js +4 -0
  118. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
  119. package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
  120. package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
  121. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
  122. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
  123. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
  124. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
  125. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  126. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
  127. package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
  128. package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
  129. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  130. package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
  131. package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
  132. package/Libraries/StyleSheet/processTransform.windows.js +272 -0
  133. package/Libraries/Text/Text.js +13 -7
  134. package/Libraries/Text/Text.windows.js +16 -7
  135. package/Libraries/Text/TextNativeComponent.js +2 -0
  136. package/Libraries/Text/TextProps.js +10 -0
  137. package/Libraries/Types/CoreEventTypes.js +13 -1
  138. package/Libraries/Types/CoreEventTypes.windows.js +26 -1
  139. package/Libraries/Utilities/Appearance.js +0 -8
  140. package/Libraries/Utilities/HMRClient.js +1 -1
  141. package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
  142. package/Libraries/Utilities/codegenNativeComponent.js +17 -6
  143. package/Libraries/Utilities/stringifySafe.js +4 -1
  144. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
  145. package/Libraries/WebSocket/WebSocket.js +1 -1
  146. package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
  147. package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
  148. package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
  149. package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +1 -4
  150. package/Microsoft.ReactNative/DynamicReader.cpp +3 -3
  151. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -0
  152. package/Microsoft.ReactNative/Fabric/ComponentViewRegistry.cpp +36 -2
  153. package/Microsoft.ReactNative/Fabric/ComponentViewRegistry.h +1 -0
  154. package/Microsoft.ReactNative/Fabric/DWriteHelpers.cpp +19 -0
  155. package/Microsoft.ReactNative/Fabric/DWriteHelpers.h +13 -0
  156. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +65 -19
  157. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
  158. package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +36 -10
  159. package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +2 -0
  160. package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +107 -0
  161. package/Microsoft.ReactNative/Fabric/SliderComponentView.h +51 -0
  162. package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +109 -0
  163. package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +52 -0
  164. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentDescriptor.h +197 -0
  165. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +308 -0
  166. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +52 -0
  167. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputEventEmitter.cpp +31 -0
  168. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputEventEmitter.h +33 -0
  169. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputProps.cpp +81 -0
  170. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputProps.h +132 -0
  171. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputShadowNode.cpp +193 -0
  172. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputShadowNode.h +85 -0
  173. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputState.cpp +76 -0
  174. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputState.h +99 -0
  175. package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +35 -3
  176. package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -0
  177. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/EventEmitters.h +5 -0
  178. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/Props.h +5 -0
  179. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/slider/SliderMeasurementsManager.cpp +46 -0
  180. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/slider/SliderMeasurementsManager.h +30 -0
  181. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Color.cpp +2 -0
  182. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/conversions.h +1 -9
  183. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.h +3 -1
  184. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +119 -57
  185. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +18 -1
  186. package/Microsoft.ReactNative/IViewManager.idl +3 -3
  187. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +13 -107
  188. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +2 -2
  189. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +2 -0
  190. package/Microsoft.ReactNative/Modules/AppStateModule.h +2 -0
  191. package/Microsoft.ReactNative/Modules/CreateModules.cpp +3 -3
  192. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +7 -5
  193. package/Microsoft.ReactNative/Modules/TimingModule.cpp +2 -2
  194. package/Microsoft.ReactNative/Modules/TimingModule.h +2 -2
  195. package/Microsoft.ReactNative/ReactHost/{ReactContext.cpp → MsoReactContext.cpp} +1 -1
  196. package/Microsoft.ReactNative/ReactHost/{ReactContext.h → MsoReactContext.h} +0 -0
  197. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +15 -2
  198. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
  199. package/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +1 -1
  200. package/Microsoft.ReactNative/ReactInstanceSettings.idl +12 -2
  201. package/Microsoft.ReactNative/ReactPackageBuilder.cpp +1 -1
  202. package/Microsoft.ReactNative/ReactRootView.cpp +2 -1
  203. package/Microsoft.ReactNative/RedBox.cpp +3 -2
  204. package/Microsoft.ReactNative/TurboModulesProvider.cpp +3 -2
  205. package/Microsoft.ReactNative/TurboModulesProvider.h +4 -1
  206. package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +41 -0
  207. package/Microsoft.ReactNative/Utils/ValueUtils.cpp +3 -2
  208. package/Microsoft.ReactNative/Views/ControlViewManager.cpp +32 -0
  209. package/Microsoft.ReactNative/Views/ControlViewManager.h +11 -0
  210. package/Microsoft.ReactNative/Views/DevMenu.cpp +2 -2
  211. package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +13 -2
  212. package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +149 -22
  213. package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
  214. package/Microsoft.ReactNative/Views/Image/Microsoft.UI.Composition.Effects_Impl.h +5 -11
  215. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +2 -1
  216. package/Microsoft.ReactNative/Views/SliderViewManager.cpp +12 -4
  217. package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +1 -1
  218. package/Microsoft.ReactNative/Views/TextViewManager.cpp +2 -2
  219. package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +163 -37
  220. package/Microsoft.ReactNative/Views/TouchEventHandler.h +11 -4
  221. package/Microsoft.ReactNative/Views/ViewPanel.cpp +3 -23
  222. package/Microsoft.ReactNative/Views/ViewPanel.h +2 -3
  223. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +21 -0
  224. package/Microsoft.ReactNative/XamlUIService.cpp +1 -1
  225. package/Microsoft.ReactNative/XamlView.h +8 -3
  226. package/Microsoft.ReactNative.Cxx/CppWinRTIncludes.h +3 -5
  227. package/Microsoft.ReactNative.Cxx/DesktopWindowBridge.h +1 -1
  228. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +11 -2
  229. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +1 -0
  230. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +19 -14
  231. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.h +4 -0
  232. package/Microsoft.ReactNative.Cxx/JSValueReader.h +2 -2
  233. package/Microsoft.ReactNative.Cxx/JSValueWriter.h +5 -5
  234. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +5 -1
  235. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +2 -3
  236. package/Microsoft.ReactNative.Cxx/NativeModules.h +3 -3
  237. package/Microsoft.ReactNative.Cxx/ReactContext.h +3 -3
  238. package/Microsoft.ReactNative.Cxx/ReactNonAbiValue.h +3 -3
  239. package/Microsoft.ReactNative.Cxx/XamlUtils.h +44 -5
  240. package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +0 -6
  241. package/Mso/activeObject/activeObject.h +2 -2
  242. package/Mso/compilerAdapters/cppMacros.h +3 -5
  243. package/Mso/errorCode/errorProvider.h +2 -2
  244. package/Mso/errorCode/maybe.h +4 -4
  245. package/Mso/functional/functor.h +6 -6
  246. package/Mso/functional/functorRef.h +2 -2
  247. package/Mso/future/details/executor.h +2 -2
  248. package/Mso/future/details/futureFuncInl.h +4 -4
  249. package/Mso/future/details/ifuture.h +3 -3
  250. package/Mso/future/details/maybeInvoker.h +6 -6
  251. package/Mso/future/details/promiseGroupInl.h +4 -4
  252. package/Mso/future/details/promiseInl.h +4 -4
  253. package/Mso/future/details/resultTraits.h +4 -4
  254. package/Mso/future/details/whenAllInl.h +1 -1
  255. package/Mso/future/future.h +13 -13
  256. package/Mso/guid/msoGuidDetails.h +1 -1
  257. package/Mso/memoryApi/memoryApi.h +13 -7
  258. package/Mso/motifCpp/gTestAdapter.h +1 -1
  259. package/Mso/motifCpp/testInfo.h +7 -9
  260. package/Mso/object/make.h +8 -8
  261. package/Mso/object/objectRefCount.h +3 -5
  262. package/Mso/object/objectWithWeakRef.h +10 -14
  263. package/Mso/object/queryCast.h +4 -4
  264. package/Mso/object/refCountedObject.h +4 -4
  265. package/Mso/object/unknownObject.h +7 -7
  266. package/Mso/platformAdapters/windowsFirst.h +1 -1
  267. package/Mso/smartPtr/cntPtr.h +8 -8
  268. package/Mso/src/dispatchQueue/threadPoolScheduler_win.cpp +96 -4
  269. package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +2 -2
  270. package/Mso/src/future/futureImpl.h +1 -1
  271. package/Mso/src/memoryApi/memoryApi.cpp +4 -4
  272. package/PropertySheets/CppAppConsumeCSharpModule.props +3 -0
  273. package/PropertySheets/External/Microsoft.ReactNative.WinAppSDK.CSharpApp.props +26 -0
  274. package/PropertySheets/External/Microsoft.ReactNative.WinAppSDK.Common.props +12 -0
  275. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  276. package/PropertySheets/JSEngine.props +1 -1
  277. package/PropertySheets/React.Cpp.props +13 -0
  278. package/PropertySheets/WinUI.props +3 -6
  279. package/ReactCommon/ReactCommon.vcxproj +2 -4
  280. package/ReactCommon/ReactCommon.vcxproj.filters +4 -1
  281. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/JSCRuntime.cpp +1480 -0
  282. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/decorator.h +753 -0
  283. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/jsi.h +1331 -0
  284. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +1431 -0
  285. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +103 -0
  286. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +87 -0
  287. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +61 -0
  288. package/ReactCommon/Yoga.cpp +1 -1
  289. package/Scripts/{Microsoft.ReactNative.ProjectReunion.nuspec → Microsoft.ReactNative.WindowsAppSDK.nuspec} +7 -9
  290. package/Scripts/OfficeReact.Win32.nuspec +1 -3
  291. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -1
  292. package/Scripts/copyRNLibraries.js +8 -8
  293. package/Scripts/just.js +1 -1
  294. package/Scripts/rnw-dependencies.ps1 +41 -10
  295. package/Scripts/run-desktop-integration-tests.js +6 -6
  296. package/Shared/AbiSafe.h +3 -3
  297. package/Shared/BaseScriptStoreImpl.cpp +1 -1
  298. package/Shared/CppRuntimeOptions.h +50 -0
  299. package/Shared/CreateModules.h +4 -0
  300. package/Shared/DevSupportManager.cpp +34 -33
  301. package/Shared/DevSupportManager.h +1 -2
  302. package/Shared/HermesRuntimeHolder.cpp +23 -14
  303. package/Shared/HermesRuntimeHolder.h +8 -2
  304. package/Shared/IDevSupportManager.h +1 -2
  305. package/Shared/InspectorPackagerConnection.cpp +7 -5
  306. package/Shared/InspectorPackagerConnection.h +2 -2
  307. package/Shared/JSI/ChakraApi.cpp +0 -1
  308. package/Shared/JSI/ChakraRuntime.cpp +1 -2
  309. package/Shared/JSI/NapiJsiV8RuntimeHolder.h +1 -1
  310. package/Shared/JSI/RuntimeHolder.h +2 -0
  311. package/Shared/Modules/HttpModule.cpp +198 -0
  312. package/Shared/Modules/HttpModule.h +53 -0
  313. package/Shared/Modules/WebSocketModule.cpp +5 -1
  314. package/Shared/Modules/WebSocketModule.h +8 -5
  315. package/Shared/Networking/IHttpResource.h +53 -0
  316. package/Shared/{IWebSocketResource.h → Networking/IWebSocketResource.h} +3 -3
  317. package/Shared/Networking/OriginPolicy.h +15 -0
  318. package/Shared/Networking/OriginPolicyHttpFilter.cpp +746 -0
  319. package/Shared/Networking/OriginPolicyHttpFilter.h +112 -0
  320. package/Shared/Networking/WinRTHttpResource.cpp +347 -0
  321. package/Shared/Networking/WinRTHttpResource.h +67 -0
  322. package/Shared/Networking/WinRTTypes.h +30 -0
  323. package/Shared/{WinRTWebSocketResource.cpp → Networking/WinRTWebSocketResource.cpp} +31 -22
  324. package/Shared/{WinRTWebSocketResource.h → Networking/WinRTWebSocketResource.h} +3 -3
  325. package/Shared/OInstance.cpp +37 -11
  326. package/Shared/RuntimeOptions.cpp +93 -15
  327. package/Shared/RuntimeOptions.h +22 -9
  328. package/Shared/Shared.vcxitems +126 -5
  329. package/Shared/Shared.vcxitems.filters +55 -15
  330. package/Shared/Threading/BatchingQueueThread.cpp +1 -1
  331. package/Shared/Utils/WinRTConversions.cpp +22 -0
  332. package/Shared/Utils/WinRTConversions.h +15 -0
  333. package/Shared/tracing/fbsystrace.h +2 -2
  334. package/codegen/NativeActionSheetManagerSpec.g.h +6 -0
  335. package/codegen/NativeAnimatedModuleSpec.g.h +43 -37
  336. package/codegen/NativeAnimatedTurboModuleSpec.g.h +43 -37
  337. package/codegen/NativePushNotificationManagerIOSSpec.g.h +2 -0
  338. package/codegen/react/components/rnwcore/ComponentDescriptors.h +0 -1
  339. package/codegen/react/components/rnwcore/EventEmitters.cpp +133 -0
  340. package/codegen/react/components/rnwcore/EventEmitters.h +0 -18
  341. package/codegen/react/components/rnwcore/Props.cpp +0 -13
  342. package/codegen/react/components/rnwcore/Props.h +0 -16
  343. package/codegen/react/components/rnwcore/ShadowNodes.cpp +0 -1
  344. package/codegen/react/components/rnwcore/ShadowNodes.h +0 -10
  345. package/include/Shared/cdebug.h +9 -9
  346. package/index.js +30 -25
  347. package/index.windows.js +30 -25
  348. package/jest/preprocessor.js +24 -107
  349. package/jest/preprocessor_DO_NOT_USE.js +122 -0
  350. package/metro.config.js +3 -70
  351. package/package.json +29 -28
  352. package/react-native.config.js +40 -6
  353. package/rntypes/index.d.ts +19 -7
  354. package/stubs/glog/logging.h +1 -1
  355. package/template/cpp-app/src/App.h +0 -4
  356. package/template/cs-app/src/App.xaml.cs +0 -5
  357. package/template/cs-app/src/MainPage.xaml.cs +1 -10
  358. package/template/cs-app-WinAppSDK/MyApp/App.xaml +16 -0
  359. package/template/cs-app-WinAppSDK/MyApp/App.xaml.cs +70 -0
  360. package/template/cs-app-WinAppSDK/MyApp/MainWindow.xaml +14 -0
  361. package/template/cs-app-WinAppSDK/MyApp/MainWindow.xaml.cs +38 -0
  362. package/template/cs-app-WinAppSDK/MyApp/Package.appxmanifest +48 -0
  363. package/template/cs-app-WinAppSDK/MyApp/Properties/PublishProfiles/win10-arm64.pubxml +19 -0
  364. package/template/cs-app-WinAppSDK/MyApp/Properties/PublishProfiles/win10-x64.pubxml +19 -0
  365. package/template/cs-app-WinAppSDK/MyApp/Properties/PublishProfiles/win10-x86.pubxml +19 -0
  366. package/template/cs-app-WinAppSDK/MyApp/Properties/launchSettings.json +10 -0
  367. package/template/cs-app-WinAppSDK/MyApp/app.manifest +15 -0
  368. package/template/cs-app-WinAppSDK/proj/ExperimentalFeatures.props +23 -0
  369. package/template/cs-app-WinAppSDK/proj/MyApp.csproj +49 -0
  370. package/template/cs-app-WinAppSDK/proj/MyApp.sln +43 -0
  371. package/template/cs-app-WinAppSDK/proj/NuGet.Config +17 -0
  372. package/template/metro.devMode.config.js +2 -51
  373. package/typings-index.js +5 -1
  374. package/typings-index.js.map +1 -1
  375. package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
  376. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
  377. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
  378. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.windows.js +0 -45
  379. package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
  380. package/Libraries/Components/View/ReactNativeViewViewConfig.windows.js +0 -390
  381. package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
  382. package/Libraries/ReactNative/UIManagerInjection.js +0 -15
  383. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
  384. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
  385. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
  386. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
  387. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
  388. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
  389. package/PropertySheets/CppEnablePackageReferences.props +0 -13
  390. package/Shared/IHttpResource.h +0 -34
  391. package/Shared/cdebug.cpp +0 -6
  392. package/include/Shared/ViewManager.h +0 -34
@@ -0,0 +1,336 @@
1
+ /*
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #include <folly/lang/ToAscii.h>
18
+
19
+ namespace folly {
20
+
21
+ namespace detail {
22
+
23
+ template <uint64_t Base, typename Alphabet>
24
+ struct to_ascii_array {
25
+ using data_type_ = c_array<uint8_t, Base>;
26
+ static constexpr data_type_ data_() {
27
+ data_type_ result{};
28
+ Alphabet alpha;
29
+ for (size_t i = 0; i < Base; ++i) {
30
+ result.data[i] = alpha(static_cast<uint8_t>(i));
31
+ }
32
+ return result;
33
+ }
34
+ // @lint-ignore CLANGTIDY
35
+ static data_type_ const data;
36
+ constexpr char operator()(uint8_t index) const { // also an alphabet
37
+ return data.data[index];
38
+ }
39
+ };
40
+
41
+ template <uint64_t Base, typename Alphabet>
42
+ alignas(kIsMobile ? sizeof(size_t) : hardware_constructive_interference_size)
43
+ typename to_ascii_array<Base, Alphabet>::data_type_ const
44
+ to_ascii_array<Base, Alphabet>::data =
45
+ to_ascii_array<Base, Alphabet>::data_();
46
+
47
+ extern template to_ascii_array<8, to_ascii_alphabet_lower>::data_type_ const
48
+ to_ascii_array<8, to_ascii_alphabet_lower>::data;
49
+ extern template to_ascii_array<10, to_ascii_alphabet_lower>::data_type_ const
50
+ to_ascii_array<10, to_ascii_alphabet_lower>::data;
51
+ extern template to_ascii_array<16, to_ascii_alphabet_lower>::data_type_ const
52
+ to_ascii_array<16, to_ascii_alphabet_lower>::data;
53
+ extern template to_ascii_array<8, to_ascii_alphabet_upper>::data_type_ const
54
+ to_ascii_array<8, to_ascii_alphabet_upper>::data;
55
+ extern template to_ascii_array<10, to_ascii_alphabet_upper>::data_type_ const
56
+ to_ascii_array<10, to_ascii_alphabet_upper>::data;
57
+ extern template to_ascii_array<16, to_ascii_alphabet_upper>::data_type_ const
58
+ to_ascii_array<16, to_ascii_alphabet_upper>::data;
59
+
60
+ template <uint64_t Base, typename Alphabet>
61
+ struct to_ascii_table {
62
+ using data_type_ = c_array<uint16_t, Base * Base>;
63
+ static constexpr data_type_ data_() {
64
+ data_type_ result{};
65
+ Alphabet alpha;
66
+ for (size_t i = 0; i < Base * Base; ++i) {
67
+ result.data[i] = //
68
+ (alpha(uint8_t(i / Base)) << (kIsLittleEndian ? 0 : 8)) |
69
+ (alpha(uint8_t(i % Base)) << (kIsLittleEndian ? 8 : 0));
70
+ }
71
+ return result;
72
+ }
73
+ // @lint-ignore CLANGTIDY
74
+ static data_type_ const data;
75
+ };
76
+ template <uint64_t Base, typename Alphabet>
77
+ alignas(hardware_constructive_interference_size)
78
+ typename to_ascii_table<Base, Alphabet>::data_type_ const
79
+ to_ascii_table<Base, Alphabet>::data =
80
+ to_ascii_table<Base, Alphabet>::data_();
81
+
82
+ extern template to_ascii_table<8, to_ascii_alphabet_lower>::data_type_ const
83
+ to_ascii_table<8, to_ascii_alphabet_lower>::data;
84
+ extern template to_ascii_table<10, to_ascii_alphabet_lower>::data_type_ const
85
+ to_ascii_table<10, to_ascii_alphabet_lower>::data;
86
+ extern template to_ascii_table<16, to_ascii_alphabet_lower>::data_type_ const
87
+ to_ascii_table<16, to_ascii_alphabet_lower>::data;
88
+ extern template to_ascii_table<8, to_ascii_alphabet_upper>::data_type_ const
89
+ to_ascii_table<8, to_ascii_alphabet_upper>::data;
90
+ extern template to_ascii_table<10, to_ascii_alphabet_upper>::data_type_ const
91
+ to_ascii_table<10, to_ascii_alphabet_upper>::data;
92
+ extern template to_ascii_table<16, to_ascii_alphabet_upper>::data_type_ const
93
+ to_ascii_table<16, to_ascii_alphabet_upper>::data;
94
+
95
+ template <uint64_t Base, typename I>
96
+ struct to_ascii_powers {
97
+ static constexpr size_t size_(I v) {
98
+ return 1 + (v < Base ? 0 : size_(v / Base));
99
+ }
100
+ static constexpr size_t const size = size_(~I(0));
101
+ using data_type_ = c_array<I, size>;
102
+ static constexpr data_type_ data_() {
103
+ data_type_ result{};
104
+ for (size_t i = 0; i < size; ++i) {
105
+ result.data[i] = constexpr_pow(Base, i);
106
+ }
107
+ return result;
108
+ }
109
+ // @lint-ignore CLANGTIDY
110
+ static data_type_ const data;
111
+ };
112
+ template <uint64_t Base, typename I>
113
+ constexpr size_t const to_ascii_powers<Base, I>::size;
114
+ template <uint64_t Base, typename I>
115
+ alignas(hardware_constructive_interference_size)
116
+ typename to_ascii_powers<Base, I>::data_type_ const
117
+ to_ascii_powers<Base, I>::data = to_ascii_powers<Base, I>::data_();
118
+
119
+ extern template to_ascii_powers<8, uint64_t>::data_type_ const
120
+ to_ascii_powers<8, uint64_t>::data;
121
+ extern template to_ascii_powers<10, uint64_t>::data_type_ const
122
+ to_ascii_powers<10, uint64_t>::data;
123
+ extern template to_ascii_powers<16, uint64_t>::data_type_ const
124
+ to_ascii_powers<16, uint64_t>::data;
125
+
126
+ template <uint64_t Base>
127
+ FOLLY_ALWAYS_INLINE size_t to_ascii_size_imuls(uint64_t v) {
128
+ using powers = to_ascii_powers<Base, uint64_t>;
129
+ uint64_t p = 1;
130
+ for (size_t i = 0u; i < powers::size; ++i, p *= Base) {
131
+ if (FOLLY_UNLIKELY(v < p)) {
132
+ return i + size_t(i == 0);
133
+ }
134
+ }
135
+ return powers::size;
136
+ }
137
+
138
+ template <uint64_t Base>
139
+ FOLLY_ALWAYS_INLINE size_t to_ascii_size_idivs(uint64_t v) {
140
+ size_t i = 1;
141
+ while (v >= Base) {
142
+ i += 1;
143
+ v /= Base;
144
+ }
145
+ return i;
146
+ }
147
+
148
+ template <uint64_t Base>
149
+ FOLLY_ALWAYS_INLINE size_t to_ascii_size_array(uint64_t v) {
150
+ using powers = to_ascii_powers<Base, uint64_t>;
151
+ for (size_t i = 0u; i < powers::size; ++i) {
152
+ if (FOLLY_LIKELY(v < powers::data.data[i])) {
153
+ return i + size_t(i == 0);
154
+ }
155
+ }
156
+ return powers::size;
157
+ }
158
+
159
+ // For some architectures, we can get a little help from clzll, the "count
160
+ // leading zeros" builtin, which is backed by a single performant instruction.
161
+ //
162
+ // Note that the compiler implements __builtin_clzll on all architectures, but
163
+ // only emits a single clzll instruction when the architecture has one.
164
+ //
165
+ // This implementation may be faster than the basic ones in the general case
166
+ // because the time taken to compute this one is constant for non-zero v,
167
+ // whereas the basic ones take time proportional to log<2>(v). Whether this one
168
+ // is actually faster depends on the emitted code for this implementation and
169
+ // on whether the loops in the basic implementations are unrolled.
170
+ template <uint64_t Base>
171
+ FOLLY_ALWAYS_INLINE size_t to_ascii_size_clzll(uint64_t v) {
172
+ using powers = to_ascii_powers<Base, uint64_t>;
173
+
174
+ // clzll is undefined for 0; must special case this
175
+ if (FOLLY_UNLIKELY(!v)) {
176
+ return 1;
177
+ }
178
+
179
+ // log2 is approx log<2>(v)
180
+ size_t const vlog2 = 64 - static_cast<size_t>(__builtin_clzll(v));
181
+
182
+ // work around msvc warning C4127 (conditional expression is constant)
183
+ bool false_ = false;
184
+
185
+ // handle directly when Base is power-of-two
186
+ if (false_ || !(Base & (Base - 1))) {
187
+ constexpr auto const blog2 = constexpr_log2(Base);
188
+ return vlog2 / blog2 + size_t(vlog2 % blog2 != 0);
189
+ }
190
+
191
+ // blog2r is approx 1 / log<2>(Base), used in log change-of-base just below
192
+ constexpr auto const blog2r = 8. / constexpr_log2(constexpr_pow(Base, 8));
193
+
194
+ // vlogb is approx log<Base>(v) = log<2>(v) / log<2>(Base)
195
+ auto const vlogb = vlog2 * size_t(blog2r * 256) / 256;
196
+
197
+ // return vlogb, adjusted if necessary
198
+ return vlogb + size_t(vlogb < powers::size && v >= powers::data.data[vlogb]);
199
+ }
200
+
201
+ template <uint64_t Base>
202
+ FOLLY_ALWAYS_INLINE size_t to_ascii_size_route(uint64_t v) {
203
+ return kIsArchAmd64 && !(Base & (Base - 1)) //
204
+ ? to_ascii_size_clzll<Base>(v)
205
+ : to_ascii_size_array<Base>(v);
206
+ }
207
+
208
+ // The straightforward implementation, assuming the size known in advance.
209
+ //
210
+ // The straightforward implementation without the size known in advance would
211
+ // entail emitting the bytes backward and then reversing them at the end, once
212
+ // the size is known.
213
+ template <uint64_t Base, typename Alphabet>
214
+ FOLLY_ALWAYS_INLINE void to_ascii_with_basic(
215
+ char* out, size_t size, uint64_t v) {
216
+ Alphabet const xlate;
217
+ for (auto pos = size - 1; pos; --pos) {
218
+ // keep /, % together so a peephole optimization computes them together
219
+ auto const q = v / Base;
220
+ auto const r = v % Base;
221
+ out[pos] = xlate(uint8_t(r));
222
+ v = q;
223
+ }
224
+ out[0] = xlate(uint8_t(v));
225
+ }
226
+
227
+ // A variant of the straightforward implementation, but using a lookup table.
228
+ template <uint64_t Base, typename Alphabet>
229
+ FOLLY_ALWAYS_INLINE void to_ascii_with_array(
230
+ char* out, size_t size, uint64_t v) {
231
+ using array = to_ascii_array<Base, Alphabet>; // also an alphabet
232
+ to_ascii_with_basic<Base, array>(out, size, v);
233
+ }
234
+
235
+ // A trickier implementation which performs half as many divides as the other,
236
+ // more straightforward, implementation. On modern hardware, the divides are
237
+ // the bottleneck (even when the compiler emits a complicated sequence of add,
238
+ // sub, and mul instructions with special constants to simulate a divide by a
239
+ // fixed denominator).
240
+ //
241
+ // The downside of this implementation is that the emitted code is larger,
242
+ // especially when the divide is simulated, which affects inlining decisions.
243
+ template <uint64_t Base, typename Alphabet>
244
+ FOLLY_ALWAYS_INLINE void to_ascii_with_table(
245
+ char* out, size_t size, uint64_t v) {
246
+ using table = to_ascii_table<Base, Alphabet>;
247
+ auto pos = size - 2;
248
+ while (FOLLY_UNLIKELY(v >= Base * Base)) {
249
+ // keep /, % together so a peephole optimization computes them together
250
+ auto const q = v / (Base * Base);
251
+ auto const r = v % (Base * Base);
252
+ auto const val = table::data.data[size_t(r)];
253
+ std::memcpy(out + pos, &val, 2);
254
+ pos -= 2;
255
+ v = q;
256
+ }
257
+ auto const val = table::data.data[size_t(v)];
258
+ if (FOLLY_UNLIKELY(size % 2 == 0)) {
259
+ std::memcpy(out, &val, 2);
260
+ } else {
261
+ *out = val >> (kIsLittleEndian ? 8 : 0);
262
+ }
263
+ }
264
+ template <uint64_t Base, typename Alphabet>
265
+ FOLLY_ALWAYS_INLINE size_t to_ascii_with_table(char* out, uint64_t v) {
266
+ auto const size = to_ascii_size_route<Base>(v);
267
+ to_ascii_with_table<Base, Alphabet>(out, size, v);
268
+ return size;
269
+ }
270
+
271
+ template <uint64_t Base, typename Alphabet>
272
+ FOLLY_ALWAYS_INLINE size_t
273
+ to_ascii_with_route(char* outb, char const* oute, uint64_t v) {
274
+ auto const size = to_ascii_size_route<Base>(v);
275
+ if (FOLLY_UNLIKELY(oute < outb || size_t(oute - outb) < size)) {
276
+ return 0;
277
+ }
278
+ kIsMobile //
279
+ ? to_ascii_with_array<Base, Alphabet>(outb, size, v)
280
+ : to_ascii_with_table<Base, Alphabet>(outb, size, v);
281
+ return size;
282
+ }
283
+ template <uint64_t Base, typename Alphabet, size_t N>
284
+ FOLLY_ALWAYS_INLINE size_t to_ascii_with_route(char (&out)[N], uint64_t v) {
285
+ static_assert(N >= to_ascii_powers<Base, decltype(v)>::size, "out too small");
286
+ return to_ascii_with_table<Base, Alphabet>(out, v);
287
+ }
288
+
289
+ size_t to_ascii_size_route<10>(uint64_t v);
290
+
291
+
292
+ template to_ascii_array<8, to_ascii_alphabet_lower>::data_type_ const
293
+ to_ascii_array<8, to_ascii_alphabet_lower>::data;
294
+ template to_ascii_array<10, to_ascii_alphabet_lower>::data_type_ const
295
+ to_ascii_array<10, to_ascii_alphabet_lower>::data;
296
+ template to_ascii_array<16, to_ascii_alphabet_lower>::data_type_ const
297
+ to_ascii_array<16, to_ascii_alphabet_lower>::data;
298
+ template to_ascii_array<8, to_ascii_alphabet_upper>::data_type_ const
299
+ to_ascii_array<8, to_ascii_alphabet_upper>::data;
300
+ template to_ascii_array<10, to_ascii_alphabet_upper>::data_type_ const
301
+ to_ascii_array<10, to_ascii_alphabet_upper>::data;
302
+ template to_ascii_array<16, to_ascii_alphabet_upper>::data_type_ const
303
+ to_ascii_array<16, to_ascii_alphabet_upper>::data;
304
+
305
+ template to_ascii_table<8, to_ascii_alphabet_lower>::data_type_ const
306
+ to_ascii_table<8, to_ascii_alphabet_lower>::data;
307
+ template to_ascii_table<10, to_ascii_alphabet_lower>::data_type_ const
308
+ to_ascii_table<10, to_ascii_alphabet_lower>::data;
309
+ template to_ascii_table<16, to_ascii_alphabet_lower>::data_type_ const
310
+ to_ascii_table<16, to_ascii_alphabet_lower>::data;
311
+ template to_ascii_table<8, to_ascii_alphabet_upper>::data_type_ const
312
+ to_ascii_table<8, to_ascii_alphabet_upper>::data;
313
+ template to_ascii_table<10, to_ascii_alphabet_upper>::data_type_ const
314
+ to_ascii_table<10, to_ascii_alphabet_upper>::data;
315
+ template to_ascii_table<16, to_ascii_alphabet_upper>::data_type_ const
316
+ to_ascii_table<16, to_ascii_alphabet_upper>::data;
317
+
318
+ template to_ascii_powers<8, uint64_t>::data_type_ const
319
+ to_ascii_powers<8, uint64_t>::data;
320
+ template to_ascii_powers<10, uint64_t>::data_type_ const
321
+ to_ascii_powers<10, uint64_t>::data;
322
+ template to_ascii_powers<16, uint64_t>::data_type_ const
323
+ to_ascii_powers<16, uint64_t>::data;
324
+
325
+ // [Windows] Code to ensure functions exist to export
326
+ void forExports() {
327
+ auto b = to_ascii_size_route<10>(0);
328
+ char cc[20];
329
+ auto a = to_ascii_with_route<10, to_ascii_alphabet<false>, 20>(cc, 0);
330
+ char d, e;
331
+ auto r = to_ascii_with_route<10, to_ascii_alphabet<false>>(&d, &e, static_cast<uint64_t>(0));
332
+ }
333
+
334
+ } // namespace detail
335
+
336
+ } // namespace folly
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #pragma once
18
+
19
+ #include <cstring>
20
+
21
+ #include <folly/ConstexprMath.h>
22
+ #include <folly/Likely.h>
23
+ #include <folly/Portability.h>
24
+ #include <folly/Utility.h>
25
+ #include <folly/lang/Align.h>
26
+ #include <folly/lang/CArray.h>
27
+ #include <folly/portability/Builtins.h>
28
+
29
+ namespace folly {
30
+
31
+ // to_ascii_alphabet
32
+ //
33
+ // Used implicity by to_ascii_lower and to_ascii_upper below.
34
+ //
35
+ // This alphabet translates digits to 0-9,a-z or 0-9,A-Z. The largest supported
36
+ // base is 36; operator() presumes an argument less than that.
37
+ //
38
+ // Alternative alphabets may be used with to_ascii_with provided they match
39
+ // the constructibility/destructibility and the interface of this one.
40
+ template <bool Upper>
41
+ struct to_ascii_alphabet {
42
+ // operator()
43
+ //
44
+ // Translates a single digit to 0-9,a-z or 0-9,A-Z.
45
+ //
46
+ // async-signal-safe
47
+ constexpr char operator()(uint8_t b) const {
48
+ return b < 10 ? '0' + b : (Upper ? 'A' : 'a') + (b - 10);
49
+ }
50
+ };
51
+ using to_ascii_alphabet_lower = to_ascii_alphabet<false>;
52
+ using to_ascii_alphabet_upper = to_ascii_alphabet<true>;
53
+
54
+ // to_ascii_size_max
55
+ // [Windows] - Replaced logic that required data with values just for the
56
+ // bases required to compile.
57
+ //
58
+ // The maximum size buffer that might be required to hold the ascii-encoded
59
+ // representation of any value of unsigned type I in base Base.
60
+ //
61
+ // In base 10, u64 requires at most 20 bytes, u32 at most 10, u16 at most 5,
62
+ // and u8 at most 3.
63
+ /*
64
+ template <uint64_t Base, typename I>
65
+ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max =
66
+ detail::to_ascii_powers<Base, I>::size;
67
+ */
68
+ // to_ascii_size_max_decimal
69
+ //
70
+ // An alias to to_ascii_size_max<10>.
71
+ template <typename I>
72
+ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal;
73
+
74
+ template <>
75
+ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal<uint16_t> = 5;
76
+ template <>
77
+ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal<uint32_t> = 10;
78
+ template <>
79
+ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal<uint64_t> = 20;
80
+
81
+
82
+ namespace detail {
83
+
84
+ // [Windows] Moved most of the detail namespace into the cpp file to avoid having data fields on the dll boundary
85
+
86
+ template <uint64_t Base>
87
+ FOLLY_ALWAYS_INLINE size_t to_ascii_size_route(uint64_t v);
88
+
89
+
90
+ template <uint64_t Base, typename Alphabet>
91
+ FOLLY_ALWAYS_INLINE size_t
92
+ to_ascii_with_route(char* outb, char const* oute, uint64_t v);
93
+
94
+ template <uint64_t Base, typename Alphabet, size_t N>
95
+ FOLLY_ALWAYS_INLINE size_t to_ascii_with_route(char (&out)[N], uint64_t v);
96
+
97
+ }
98
+
99
+ // to_ascii_size
100
+ //
101
+ // Returns the number of digits in the base Base representation of a uint64_t.
102
+ // Useful for preallocating buffers, etc.
103
+ //
104
+ // async-signal-safe
105
+ template <uint64_t Base>
106
+ size_t to_ascii_size(uint64_t v) {
107
+ return detail::to_ascii_size_route<Base>(v);
108
+ }
109
+
110
+ // to_ascii_size_decimal
111
+ //
112
+ // An alias to to_ascii_size<10>.
113
+ //
114
+ // async-signal-safe
115
+ inline size_t to_ascii_size_decimal(uint64_t v) {
116
+ return to_ascii_size<10>(v);
117
+ }
118
+
119
+ // to_ascii_with
120
+ //
121
+ // Copies the digits of v, in base Base, translated with Alphabet, into buffer
122
+ // and returns the number of bytes written.
123
+ //
124
+ // Does *not* append a null terminator. It is the caller's responsibility to
125
+ // append a null terminator if one is required.
126
+ //
127
+ // Assumes buffer points to at least to_ascii_size<Base>(v) bytes of writable
128
+ // memory. It is the caller's responsibility to provide a writable buffer with
129
+ // the required min size.
130
+ //
131
+ // async-signal-safe
132
+ template <uint64_t Base, typename Alphabet>
133
+ size_t to_ascii_with(char* outb, char const* oute, uint64_t v) {
134
+ return detail::to_ascii_with_route<Base, Alphabet>(outb, oute, v);
135
+ }
136
+ template <uint64_t Base, typename Alphabet, size_t N>
137
+ size_t to_ascii_with(char (&out)[N], uint64_t v) {
138
+ return detail::to_ascii_with_route<Base, Alphabet>(out, v);
139
+ }
140
+
141
+ // to_ascii_lower
142
+ //
143
+ // Composes to_ascii_with with to_ascii_alphabet_lower.
144
+ //
145
+ // async-signal-safe
146
+ template <uint64_t Base>
147
+ size_t to_ascii_lower(char* outb, char const* oute, uint64_t v) {
148
+ return to_ascii_with<Base, to_ascii_alphabet_lower>(outb, oute, v);
149
+ }
150
+ template <uint64_t Base, size_t N>
151
+ size_t to_ascii_lower(char (&out)[N], uint64_t v) {
152
+ return to_ascii_with<Base, to_ascii_alphabet_lower>(out, v);
153
+ }
154
+
155
+ // to_ascii_upper
156
+ //
157
+ // Composes to_ascii_with with to_ascii_alphabet_upper.
158
+ //
159
+ // async-signal-safe
160
+ template <uint64_t Base>
161
+ size_t to_ascii_upper(char* outb, char const* oute, uint64_t v) {
162
+ return to_ascii_with<Base, to_ascii_alphabet_upper>(outb, oute, v);
163
+ }
164
+ template <uint64_t Base, size_t N>
165
+ size_t to_ascii_upper(char (&out)[N], uint64_t v) {
166
+ return to_ascii_with<Base, to_ascii_alphabet_upper>(out, v);
167
+ }
168
+
169
+ // to_ascii_decimal
170
+ //
171
+ // An alias to to_ascii<10, false>.
172
+ //
173
+ // async-signals-afe
174
+ inline size_t to_ascii_decimal(char* outb, char const* oute, uint64_t v) {
175
+ return to_ascii_lower<10>(outb, oute, v);
176
+ }
177
+ template <size_t N>
178
+ inline size_t to_ascii_decimal(char (&out)[N], uint64_t v) {
179
+ return to_ascii_lower<10>(out, v);
180
+ }
181
+
182
+ } // namespace folly
@@ -143,6 +143,13 @@ const ActionSheetIOS = {
143
143
  successCallback,
144
144
  );
145
145
  },
146
+
147
+ dismissActionSheet: () => {
148
+ invariant(RCTActionSheetManager, "ActionSheetManager doesn't exist");
149
+ if (typeof RCTActionSheetManager.dismissActionSheet === 'function') {
150
+ RCTActionSheetManager.dismissActionSheet();
151
+ }
152
+ },
146
153
  };
147
154
 
148
155
  module.exports = ActionSheetIOS;
@@ -47,6 +47,7 @@ export interface Spec extends TurboModule {
47
47
  |}) => void,
48
48
  successCallback: (completed: boolean, activityType: ?string) => void,
49
49
  ) => void;
50
+ +dismissActionSheet?: () => void;
50
51
  }
51
52
 
52
53
  export default (TurboModuleRegistry.get<Spec>('ActionSheetManager'): ?Spec);
@@ -70,7 +70,7 @@ class Alert {
70
70
  buttonNeutral,
71
71
  buttonNegative,
72
72
  buttonPositive,
73
- ].findIndex((b) => b != null && b.style === 'default');
73
+ ].findIndex(b => b != null && b.style === 'default');
74
74
 
75
75
  // XAML has an enum to specify the default button, which is:
76
76
  // None = 0, Primary = 1, Secondary = 2, Close = 3
@@ -101,7 +101,7 @@ class Alert {
101
101
  options && options.onDismiss && options.onDismiss();
102
102
  }
103
103
  };
104
- const onError = (errorMessage) => console.warn(errorMessage);
104
+ const onError = errorMessage => console.warn(errorMessage);
105
105
  NativeDialogManagerWindows.showAlert(config, onError, onAction);
106
106
  }
107
107
 
@@ -91,7 +91,7 @@ const diffClamp = function (
91
91
 
92
92
  const _combineCallbacks = function (
93
93
  callback: ?EndCallback,
94
- config: {...AnimationConfig, ...},
94
+ config: $ReadOnly<{...AnimationConfig, ...}>,
95
95
  ) {
96
96
  if (callback && config.onComplete) {
97
97
  return (...args) => {
@@ -90,6 +90,18 @@ const API = {
90
90
  NativeAnimatedModule.createAnimatedNode(tag, config),
91
91
  );
92
92
  },
93
+ updateAnimatedNodeConfig: function (
94
+ tag: number,
95
+ config: AnimatedNodeConfig,
96
+ ): void {
97
+ invariant(NativeAnimatedModule, 'Native animated module is not available');
98
+ if (typeof NativeAnimatedModule.updateAnimatedNodeConfig === 'function') {
99
+ API.queueOperation(() =>
100
+ // $FlowIgnore[not-a-function] - checked above
101
+ NativeAnimatedModule.updateAnimatedNodeConfig(tag, config),
102
+ );
103
+ }
104
+ },
93
105
  startListeningToAnimatedNodeValue: function (tag: number) {
94
106
  invariant(NativeAnimatedModule, 'Native animated module is not available');
95
107
  API.queueOperation(() =>
@@ -222,22 +234,36 @@ const API = {
222
234
  /**
223
235
  * Styles allowed by the native animated implementation.
224
236
  *
225
- * In general native animated implementation should support any numeric property that doesn't need
226
- * to be updated through the shadow view hierarchy (all non-layout properties).
237
+ * In general native animated implementation should support any numeric or color property that
238
+ * doesn't need to be updated through the shadow view hierarchy (all non-layout properties).
227
239
  */
240
+ const SUPPORTED_COLOR_STYLES = {
241
+ backgroundColor: true,
242
+ borderBottomColor: true,
243
+ borderColor: true,
244
+ borderEndColor: true,
245
+ borderLeftColor: true,
246
+ borderRightColor: true,
247
+ borderStartColor: true,
248
+ borderTopColor: true,
249
+ color: true,
250
+ tintColor: true,
251
+ };
252
+
228
253
  const SUPPORTED_STYLES = {
229
- opacity: true,
230
- transform: true,
231
- borderRadius: true,
254
+ ...SUPPORTED_COLOR_STYLES,
232
255
  borderBottomEndRadius: true,
233
256
  borderBottomLeftRadius: true,
234
257
  borderBottomRightRadius: true,
235
258
  borderBottomStartRadius: true,
259
+ borderRadius: true,
236
260
  borderTopEndRadius: true,
237
261
  borderTopLeftRadius: true,
238
262
  borderTopRightRadius: true,
239
263
  borderTopStartRadius: true,
240
264
  elevation: true,
265
+ opacity: true,
266
+ transform: true,
241
267
  zIndex: true,
242
268
  /* ios styles */
243
269
  shadowOpacity: true,
@@ -282,6 +308,22 @@ function addWhitelistedInterpolationParam(param: string): void {
282
308
  SUPPORTED_INTERPOLATION_PARAMS[param] = true;
283
309
  }
284
310
 
311
+ function isSupportedColorStyleProp(prop: string): boolean {
312
+ return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);
313
+ }
314
+
315
+ function isSupportedStyleProp(prop: string): boolean {
316
+ return SUPPORTED_STYLES.hasOwnProperty(prop);
317
+ }
318
+
319
+ function isSupportedTransformProp(prop: string): boolean {
320
+ return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);
321
+ }
322
+
323
+ function isSupportedInterpolationParam(param: string): boolean {
324
+ return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);
325
+ }
326
+
285
327
  function validateTransform(
286
328
  configs: Array<
287
329
  | {
@@ -299,7 +341,7 @@ function validateTransform(
299
341
  >,
300
342
  ): void {
301
343
  configs.forEach(config => {
302
- if (!SUPPORTED_TRANSFORMS.hasOwnProperty(config.property)) {
344
+ if (!isSupportedTransformProp(config.property)) {
303
345
  throw new Error(
304
346
  `Property '${config.property}' is not supported by native animated module`,
305
347
  );
@@ -309,7 +351,7 @@ function validateTransform(
309
351
 
310
352
  function validateStyles(styles: {[key: string]: ?number, ...}): void {
311
353
  for (const key in styles) {
312
- if (!SUPPORTED_STYLES.hasOwnProperty(key)) {
354
+ if (!isSupportedStyleProp(key)) {
313
355
  throw new Error(
314
356
  `Style property '${key}' is not supported by native animated module`,
315
357
  );
@@ -319,7 +361,7 @@ function validateStyles(styles: {[key: string]: ?number, ...}): void {
319
361
 
320
362
  function validateInterpolation(config: InterpolationConfigType): void {
321
363
  for (const key in config) {
322
- if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(key)) {
364
+ if (!isSupportedInterpolationParam(key)) {
323
365
  throw new Error(
324
366
  `Interpolation property '${key}' is not supported by native animated module`,
325
367
  );
@@ -342,7 +384,7 @@ function assertNativeAnimatedModule(): void {
342
384
  let _warnedMissingNativeAnimated = false;
343
385
 
344
386
  function shouldUseNativeDriver(
345
- config: {...AnimationConfig, ...} | EventConfig,
387
+ config: $ReadOnly<{...AnimationConfig, ...}> | EventConfig,
346
388
  ): boolean {
347
389
  if (config.useNativeDriver == null) {
348
390
  console.warn(
@@ -385,6 +427,10 @@ function transformDataType(value: number | string): number | string {
385
427
 
386
428
  module.exports = {
387
429
  API,
430
+ isSupportedColorStyleProp,
431
+ isSupportedStyleProp,
432
+ isSupportedTransformProp,
433
+ isSupportedInterpolationParam,
388
434
  addWhitelistedStyleProp,
389
435
  addWhitelistedTransformProp,
390
436
  addWhitelistedInterpolationParam,