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.
- package/.flowconfig +1 -3
- package/Chakra/ChakraHelpers.cpp +0 -1
- package/Directory.Build.props +3 -0
- package/Directory.Build.targets +1 -1
- package/Folly/TEMP_UntilFollyUpdate/dynamic-inl.h +1411 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +336 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +182 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
- package/Libraries/Alert/Alert.windows.js +2 -2
- package/Libraries/Animated/AnimatedImplementation.js +1 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
- package/Libraries/Animated/NativeAnimatedModule.js +1 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +6 -11
- package/Libraries/Animated/createAnimatedComponent.js +2 -2
- package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
- package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/Blob/URL.js +7 -1
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/Button.windows.js +4 -0
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
- package/Libraries/Components/Pressable/Pressable.js +3 -3
- package/Libraries/Components/Pressable/Pressable.windows.js +3 -3
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
- package/Libraries/Components/ScrollView/ScrollView.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
- package/Libraries/Components/Slider/Slider.js +0 -2
- package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
- package/Libraries/Components/StatusBar/StatusBar.js +6 -1
- package/Libraries/Components/Switch/Switch.js +11 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
- package/Libraries/Components/TextInput/TextInput.js +1 -8
- package/Libraries/Components/TextInput/TextInput.windows.js +4 -9
- package/Libraries/Components/TextInput/TextInputState.js +10 -2
- package/Libraries/Components/TextInput/TextInputState.windows.js +10 -3
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +6 -5
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +11 -5
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +1 -0
- package/Libraries/Components/View/View.windows.js +33 -1
- package/Libraries/Components/View/ViewNativeComponent.js +68 -8
- package/Libraries/Components/View/ViewPropTypes.js +36 -4
- package/Libraries/Components/View/ViewPropTypes.windows.js +36 -4
- package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +1 -1
- package/Libraries/Core/RawEventEmitter.js +38 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/polyfillPromise.js +32 -0
- package/Libraries/Core/setUpReactDevTools.js +3 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
- package/Libraries/Events/CustomEvent.js +32 -0
- package/Libraries/Events/EventPolyfill.js +239 -0
- package/Libraries/Image/Image.android.js +0 -6
- package/Libraries/Image/Image.ios.js +0 -6
- package/Libraries/Image/Image.windows.js +2 -8
- package/Libraries/Image/ImageViewNativeComponent.js +18 -3
- package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
- package/Libraries/Inspector/Inspector.js +2 -4
- package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
- package/Libraries/Interaction/InteractionManager.js +1 -12
- package/Libraries/Interaction/TaskQueue.js +5 -4
- package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +27 -6
- package/Libraries/Lists/VirtualizedList.js +71 -55
- package/Libraries/Lists/VirtualizedListContext.js +7 -3
- package/Libraries/Lists/VirtualizedSectionList.js +2 -2
- package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
- package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
- package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
- package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
- package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +91 -42
- package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +13 -13
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +2 -21
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +334 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
- package/Libraries/NativeComponent/ViewConfig.js +4 -4
- package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
- package/Libraries/Network/FormData.js +7 -1
- package/Libraries/Pressability/Pressability.js +115 -46
- package/Libraries/Pressability/Pressability.windows.js +190 -74
- package/Libraries/Pressability/PressabilityDebug.js +5 -9
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
- package/Libraries/ReactNative/PaperUIManager.windows.js +5 -5
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
- package/Libraries/ReactNative/UIManager.js +2 -3
- package/Libraries/ReactNative/renderApplication.js +4 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
- package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
- package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
- package/Libraries/StyleSheet/processTransform.windows.js +272 -0
- package/Libraries/Text/Text.js +13 -7
- package/Libraries/Text/Text.windows.js +16 -7
- package/Libraries/Text/TextNativeComponent.js +2 -0
- package/Libraries/Text/TextProps.js +10 -0
- package/Libraries/Types/CoreEventTypes.js +13 -1
- package/Libraries/Types/CoreEventTypes.windows.js +26 -1
- package/Libraries/Utilities/Appearance.js +0 -8
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
- package/Libraries/Utilities/codegenNativeComponent.js +17 -6
- package/Libraries/Utilities/stringifySafe.js +4 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
- package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
- package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +1 -4
- package/Microsoft.ReactNative/DynamicReader.cpp +3 -3
- package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -0
- package/Microsoft.ReactNative/Fabric/ComponentViewRegistry.cpp +36 -2
- package/Microsoft.ReactNative/Fabric/ComponentViewRegistry.h +1 -0
- package/Microsoft.ReactNative/Fabric/DWriteHelpers.cpp +19 -0
- package/Microsoft.ReactNative/Fabric/DWriteHelpers.h +13 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +65 -19
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +36 -10
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +2 -0
- package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +107 -0
- package/Microsoft.ReactNative/Fabric/SliderComponentView.h +51 -0
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +109 -0
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentDescriptor.h +197 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +308 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputEventEmitter.cpp +31 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputEventEmitter.h +33 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputProps.cpp +81 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputProps.h +132 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputShadowNode.cpp +193 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputShadowNode.h +85 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputState.cpp +76 -0
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputState.h +99 -0
- package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +35 -3
- package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/EventEmitters.h +5 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/rncore/Props.h +5 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/slider/SliderMeasurementsManager.cpp +46 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/slider/SliderMeasurementsManager.h +30 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Color.cpp +2 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/conversions.h +1 -9
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.h +3 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +119 -57
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +18 -1
- package/Microsoft.ReactNative/IViewManager.idl +3 -3
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +13 -107
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +2 -2
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +2 -0
- package/Microsoft.ReactNative/Modules/AppStateModule.h +2 -0
- package/Microsoft.ReactNative/Modules/CreateModules.cpp +3 -3
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +7 -5
- package/Microsoft.ReactNative/Modules/TimingModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/TimingModule.h +2 -2
- package/Microsoft.ReactNative/ReactHost/{ReactContext.cpp → MsoReactContext.cpp} +1 -1
- package/Microsoft.ReactNative/ReactHost/{ReactContext.h → MsoReactContext.h} +0 -0
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +15 -2
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +1 -1
- package/Microsoft.ReactNative/ReactInstanceSettings.idl +12 -2
- package/Microsoft.ReactNative/ReactPackageBuilder.cpp +1 -1
- package/Microsoft.ReactNative/ReactRootView.cpp +2 -1
- package/Microsoft.ReactNative/RedBox.cpp +3 -2
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +3 -2
- package/Microsoft.ReactNative/TurboModulesProvider.h +4 -1
- package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +41 -0
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +3 -2
- package/Microsoft.ReactNative/Views/ControlViewManager.cpp +32 -0
- package/Microsoft.ReactNative/Views/ControlViewManager.h +11 -0
- package/Microsoft.ReactNative/Views/DevMenu.cpp +2 -2
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +13 -2
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +149 -22
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
- package/Microsoft.ReactNative/Views/Image/Microsoft.UI.Composition.Effects_Impl.h +5 -11
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +2 -1
- package/Microsoft.ReactNative/Views/SliderViewManager.cpp +12 -4
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +1 -1
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +2 -2
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +163 -37
- package/Microsoft.ReactNative/Views/TouchEventHandler.h +11 -4
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +3 -23
- package/Microsoft.ReactNative/Views/ViewPanel.h +2 -3
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +21 -0
- package/Microsoft.ReactNative/XamlUIService.cpp +1 -1
- package/Microsoft.ReactNative/XamlView.h +8 -3
- package/Microsoft.ReactNative.Cxx/CppWinRTIncludes.h +3 -5
- package/Microsoft.ReactNative.Cxx/DesktopWindowBridge.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +11 -2
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +1 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +19 -14
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.h +4 -0
- package/Microsoft.ReactNative.Cxx/JSValueReader.h +2 -2
- package/Microsoft.ReactNative.Cxx/JSValueWriter.h +5 -5
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +5 -1
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +2 -3
- package/Microsoft.ReactNative.Cxx/NativeModules.h +3 -3
- package/Microsoft.ReactNative.Cxx/ReactContext.h +3 -3
- package/Microsoft.ReactNative.Cxx/ReactNonAbiValue.h +3 -3
- package/Microsoft.ReactNative.Cxx/XamlUtils.h +44 -5
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +0 -6
- package/Mso/activeObject/activeObject.h +2 -2
- package/Mso/compilerAdapters/cppMacros.h +3 -5
- package/Mso/errorCode/errorProvider.h +2 -2
- package/Mso/errorCode/maybe.h +4 -4
- package/Mso/functional/functor.h +6 -6
- package/Mso/functional/functorRef.h +2 -2
- package/Mso/future/details/executor.h +2 -2
- package/Mso/future/details/futureFuncInl.h +4 -4
- package/Mso/future/details/ifuture.h +3 -3
- package/Mso/future/details/maybeInvoker.h +6 -6
- package/Mso/future/details/promiseGroupInl.h +4 -4
- package/Mso/future/details/promiseInl.h +4 -4
- package/Mso/future/details/resultTraits.h +4 -4
- package/Mso/future/details/whenAllInl.h +1 -1
- package/Mso/future/future.h +13 -13
- package/Mso/guid/msoGuidDetails.h +1 -1
- package/Mso/memoryApi/memoryApi.h +13 -7
- package/Mso/motifCpp/gTestAdapter.h +1 -1
- package/Mso/motifCpp/testInfo.h +7 -9
- package/Mso/object/make.h +8 -8
- package/Mso/object/objectRefCount.h +3 -5
- package/Mso/object/objectWithWeakRef.h +10 -14
- package/Mso/object/queryCast.h +4 -4
- package/Mso/object/refCountedObject.h +4 -4
- package/Mso/object/unknownObject.h +7 -7
- package/Mso/platformAdapters/windowsFirst.h +1 -1
- package/Mso/smartPtr/cntPtr.h +8 -8
- package/Mso/src/dispatchQueue/threadPoolScheduler_win.cpp +96 -4
- package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +2 -2
- package/Mso/src/future/futureImpl.h +1 -1
- package/Mso/src/memoryApi/memoryApi.cpp +4 -4
- package/PropertySheets/CppAppConsumeCSharpModule.props +3 -0
- package/PropertySheets/External/Microsoft.ReactNative.WinAppSDK.CSharpApp.props +26 -0
- package/PropertySheets/External/Microsoft.ReactNative.WinAppSDK.Common.props +12 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/React.Cpp.props +13 -0
- package/PropertySheets/WinUI.props +3 -6
- package/ReactCommon/ReactCommon.vcxproj +2 -4
- package/ReactCommon/ReactCommon.vcxproj.filters +4 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/JSCRuntime.cpp +1480 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/decorator.h +753 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/jsi.h +1331 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +1431 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +103 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +87 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +61 -0
- package/ReactCommon/Yoga.cpp +1 -1
- package/Scripts/{Microsoft.ReactNative.ProjectReunion.nuspec → Microsoft.ReactNative.WindowsAppSDK.nuspec} +7 -9
- package/Scripts/OfficeReact.Win32.nuspec +1 -3
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -1
- package/Scripts/copyRNLibraries.js +8 -8
- package/Scripts/just.js +1 -1
- package/Scripts/rnw-dependencies.ps1 +41 -10
- package/Scripts/run-desktop-integration-tests.js +6 -6
- package/Shared/AbiSafe.h +3 -3
- package/Shared/BaseScriptStoreImpl.cpp +1 -1
- package/Shared/CppRuntimeOptions.h +50 -0
- package/Shared/CreateModules.h +4 -0
- package/Shared/DevSupportManager.cpp +34 -33
- package/Shared/DevSupportManager.h +1 -2
- package/Shared/HermesRuntimeHolder.cpp +23 -14
- package/Shared/HermesRuntimeHolder.h +8 -2
- package/Shared/IDevSupportManager.h +1 -2
- package/Shared/InspectorPackagerConnection.cpp +7 -5
- package/Shared/InspectorPackagerConnection.h +2 -2
- package/Shared/JSI/ChakraApi.cpp +0 -1
- package/Shared/JSI/ChakraRuntime.cpp +1 -2
- package/Shared/JSI/NapiJsiV8RuntimeHolder.h +1 -1
- package/Shared/JSI/RuntimeHolder.h +2 -0
- package/Shared/Modules/HttpModule.cpp +198 -0
- package/Shared/Modules/HttpModule.h +53 -0
- package/Shared/Modules/WebSocketModule.cpp +5 -1
- package/Shared/Modules/WebSocketModule.h +8 -5
- package/Shared/Networking/IHttpResource.h +53 -0
- package/Shared/{IWebSocketResource.h → Networking/IWebSocketResource.h} +3 -3
- package/Shared/Networking/OriginPolicy.h +15 -0
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +746 -0
- package/Shared/Networking/OriginPolicyHttpFilter.h +112 -0
- package/Shared/Networking/WinRTHttpResource.cpp +347 -0
- package/Shared/Networking/WinRTHttpResource.h +67 -0
- package/Shared/Networking/WinRTTypes.h +30 -0
- package/Shared/{WinRTWebSocketResource.cpp → Networking/WinRTWebSocketResource.cpp} +31 -22
- package/Shared/{WinRTWebSocketResource.h → Networking/WinRTWebSocketResource.h} +3 -3
- package/Shared/OInstance.cpp +37 -11
- package/Shared/RuntimeOptions.cpp +93 -15
- package/Shared/RuntimeOptions.h +22 -9
- package/Shared/Shared.vcxitems +126 -5
- package/Shared/Shared.vcxitems.filters +55 -15
- package/Shared/Threading/BatchingQueueThread.cpp +1 -1
- package/Shared/Utils/WinRTConversions.cpp +22 -0
- package/Shared/Utils/WinRTConversions.h +15 -0
- package/Shared/tracing/fbsystrace.h +2 -2
- package/codegen/NativeActionSheetManagerSpec.g.h +6 -0
- package/codegen/NativeAnimatedModuleSpec.g.h +43 -37
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +43 -37
- package/codegen/NativePushNotificationManagerIOSSpec.g.h +2 -0
- package/codegen/react/components/rnwcore/ComponentDescriptors.h +0 -1
- package/codegen/react/components/rnwcore/EventEmitters.cpp +133 -0
- package/codegen/react/components/rnwcore/EventEmitters.h +0 -18
- package/codegen/react/components/rnwcore/Props.cpp +0 -13
- package/codegen/react/components/rnwcore/Props.h +0 -16
- package/codegen/react/components/rnwcore/ShadowNodes.cpp +0 -1
- package/codegen/react/components/rnwcore/ShadowNodes.h +0 -10
- package/include/Shared/cdebug.h +9 -9
- package/index.js +30 -25
- package/index.windows.js +30 -25
- package/jest/preprocessor.js +24 -107
- package/jest/preprocessor_DO_NOT_USE.js +122 -0
- package/metro.config.js +3 -70
- package/package.json +29 -28
- package/react-native.config.js +40 -6
- package/rntypes/index.d.ts +19 -7
- package/stubs/glog/logging.h +1 -1
- package/template/cpp-app/src/App.h +0 -4
- package/template/cs-app/src/App.xaml.cs +0 -5
- package/template/cs-app/src/MainPage.xaml.cs +1 -10
- package/template/cs-app-WinAppSDK/MyApp/App.xaml +16 -0
- package/template/cs-app-WinAppSDK/MyApp/App.xaml.cs +70 -0
- package/template/cs-app-WinAppSDK/MyApp/MainWindow.xaml +14 -0
- package/template/cs-app-WinAppSDK/MyApp/MainWindow.xaml.cs +38 -0
- package/template/cs-app-WinAppSDK/MyApp/Package.appxmanifest +48 -0
- package/template/cs-app-WinAppSDK/MyApp/Properties/PublishProfiles/win10-arm64.pubxml +19 -0
- package/template/cs-app-WinAppSDK/MyApp/Properties/PublishProfiles/win10-x64.pubxml +19 -0
- package/template/cs-app-WinAppSDK/MyApp/Properties/PublishProfiles/win10-x86.pubxml +19 -0
- package/template/cs-app-WinAppSDK/MyApp/Properties/launchSettings.json +10 -0
- package/template/cs-app-WinAppSDK/MyApp/app.manifest +15 -0
- package/template/cs-app-WinAppSDK/proj/ExperimentalFeatures.props +23 -0
- package/template/cs-app-WinAppSDK/proj/MyApp.csproj +49 -0
- package/template/cs-app-WinAppSDK/proj/MyApp.sln +43 -0
- package/template/cs-app-WinAppSDK/proj/NuGet.Config +17 -0
- package/template/metro.devMode.config.js +2 -51
- package/typings-index.js +5 -1
- package/typings-index.js.map +1 -1
- package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.windows.js +0 -45
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
- package/Libraries/Components/View/ReactNativeViewViewConfig.windows.js +0 -390
- package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
- package/Libraries/ReactNative/UIManagerInjection.js +0 -15
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
- package/PropertySheets/CppEnablePackageReferences.props +0 -13
- package/Shared/IHttpResource.h +0 -34
- package/Shared/cdebug.cpp +0 -6
- 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(
|
|
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 =
|
|
104
|
+
const onError = errorMessage => console.warn(errorMessage);
|
|
105
105
|
NativeDialogManagerWindows.showAlert(config, onError, onAction);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -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
|
|
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
|
-
|
|
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 (!
|
|
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 (!
|
|
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 (!
|
|
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,
|