react-native-macos 0.0.0-3bcd858a8 → 0.0.0-3df66a8c7
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/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -1
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -0
- package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
- package/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +2 -2
- package/Libraries/Animated/components/AnimatedImage.js +3 -3
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -3
- package/Libraries/Animated/components/AnimatedText.js +3 -3
- package/Libraries/Animated/components/AnimatedView.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +3 -34
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
- package/Libraries/Components/Button.js +3 -6
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.js +17 -16
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/ViewAccessibility.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +45 -80
- package/Libraries/Core/ExtendedError.js +0 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -4
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/Image/ImageBackground.js +10 -8
- package/Libraries/Image/ImageProps.js +28 -0
- package/Libraries/Image/RCTImageView.mm +4 -0
- package/Libraries/LogBox/Data/LogBoxData.js +0 -1
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +6 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h +1 -2
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +2 -1
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +2 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +2 -0
- package/Libraries/Pressability/Pressability.js +13 -13
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +0 -1
- package/Libraries/ReactNative/AppRegistry.js +4 -2
- package/Libraries/Renderer/REVISION +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1569 -875
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +529 -319
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +570 -362
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1592 -891
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +521 -311
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +562 -354
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
- package/Libraries/Text/Text/RCTTextView.m +7 -9
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +17 -13
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +12 -13
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.m +11 -15
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
- package/README.md +4 -3
- package/React/Base/RCTBridge+Private.h +8 -0
- package/React/Base/RCTBridge.h +4 -0
- package/React/Base/RCTBridge.m +19 -7
- package/React/Base/RCTBridgeModule.h +3 -12
- package/React/Base/RCTBundleURLProvider.h +1 -1
- package/React/Base/RCTBundleURLProvider.mm +5 -3
- package/React/Base/RCTConstants.h +0 -6
- package/React/Base/RCTConstants.m +0 -15
- package/React/Base/RCTConvert.h +1 -1
- package/React/Base/RCTConvert.m +23 -6
- package/React/Base/RCTDefines.h +12 -3
- package/React/Base/RCTEventDispatcherProtocol.h +2 -0
- package/React/Base/RCTImageSource.m +2 -0
- package/React/Base/RCTJSStackFrame.m +2 -0
- package/React/Base/RCTJSThread.h +29 -0
- package/React/Base/RCTJSThread.m +19 -0
- package/React/Base/RCTJavaScriptLoader.mm +2 -0
- package/React/Base/RCTKeyCommands.m +2 -0
- package/React/Base/RCTModuleData.mm +2 -0
- package/React/Base/RCTModuleMethod.mm +2 -0
- package/React/Base/RCTRootView.h +15 -0
- package/React/Base/RCTRootView.m +15 -0
- package/React/Base/RCTTouchEvent.m +2 -0
- package/React/Base/RCTTouchHandler.m +1 -8
- package/React/Base/RCTUtils.h +3 -0
- package/React/Base/RCTUtils.m +14 -7
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
- package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
- package/React/CoreModules/RCTAccessibilityManager+Internal.h +24 -0
- package/React/CoreModules/RCTAccessibilityManager.mm +18 -3
- package/React/CoreModules/RCTActionSheetManager.mm +18 -5
- package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
- package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
- package/React/CoreModules/RCTAppearance.mm +8 -2
- package/React/CoreModules/RCTDevLoadingView.mm +19 -19
- package/React/CoreModules/RCTDevMenu.mm +4 -4
- package/React/CoreModules/RCTDevSettings.mm +6 -6
- package/React/CoreModules/RCTDevSplitBundleLoader.mm +1 -1
- package/React/CoreModules/RCTDeviceInfo.mm +4 -4
- package/React/CoreModules/RCTEventDispatcher.mm +5 -0
- package/React/CoreModules/RCTExceptionsManager.mm +11 -24
- package/React/CoreModules/RCTPerfMonitor.mm +9 -4
- package/React/CoreModules/RCTRedBox.mm +1 -5
- package/React/CxxBridge/RCTCxxBridge.mm +18 -1
- package/React/CxxModule/RCTCxxMethod.mm +2 -0
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
- package/React/DevSupport/RCTPackagerConnection.h +3 -0
- package/React/DevSupport/RCTPackagerConnection.mm +9 -5
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +12 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +11 -3
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +0 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +16 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +6 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +3 -5
- package/React/Fabric/Mounting/RCTMountingManager.mm +15 -1
- package/React/Fabric/RCTScheduler.mm +12 -5
- package/React/Fabric/RCTSurfacePresenter.mm +0 -4
- package/React/Fabric/RCTSurfaceTouchHandler.mm +6 -20
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -3
- package/React/Modules/RCTLayoutAnimation.m +2 -0
- package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
- package/React/Modules/RCTUIManager.m +19 -10
- package/React/React-RCTFabric.podspec +0 -1
- package/React/Views/RCTFont.mm +58 -47
- package/React/Views/RCTShadowView.m +3 -1
- package/React/Views/RCTView.h +5 -2
- package/React/Views/RCTView.m +23 -16
- package/React/Views/RCTViewManager.m +12 -10
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +3 -5
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +2 -2
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +4 -4
- package/React/Views/ScrollView/RCTScrollContentView.m +10 -24
- package/React/Views/ScrollView/RCTScrollView.m +10 -20
- package/React/Views/ScrollView/RCTScrollViewManager.m +2 -7
- package/React/Views/UIView+React.m +7 -10
- package/React-Core.podspec +0 -1
- package/ReactAndroid/build.gradle +11 -5
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
- package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
- package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/BUCK +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +63 -26
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +46 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +31 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +17 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +13 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeScheduler.java +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/BUCK +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegate.java +40 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.java +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK +0 -6
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +5 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.java +102 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +35 -11
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.java +5 -72
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LogBoxDialogSurfaceDelegate.java +92 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LogBoxModule.java +28 -42
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +5 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +3 -7
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +41 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.java +8 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.java +43 -9
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.cpp +69 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.h +40 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +2 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +84 -32
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventEmitterWrapper.cpp +20 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventEmitterWrapper.h +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +9 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +19 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/BUCK +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/BUCK +0 -6
- package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.java +9 -8
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java +7 -19
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/{JavaScriptTimerManager.java → JavaScriptTimerExecutor.java} +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +23 -19
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/processing/ReactPropertyProcessor.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/BUCK +0 -6
- package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/BUCK +0 -12
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java +75 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java +19 -22
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventCategoryDef.java +42 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherImpl.java +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/LockFreeEventDispatcherImpl.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTEventEmitter.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java +17 -9
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java +43 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEventType.java +15 -16
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java +108 -19
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/BUCK +0 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +79 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +94 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +9 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/CanvasUtil.java +92 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +19 -0
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +3 -2
- package/ReactAndroid/src/main/jni/react/jni/BUCK +4 -5
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +49 -7
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +15 -2
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
- package/{ReactCommon/react/renderer/core/Constants.cpp → ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp} +6 -8
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
- package/ReactAndroid/src/main/jni/react/perftests/BUCK +0 -4
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
- package/ReactAndroid/src/test/java/com/facebook/react/RootViewTest.java +43 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/clipboard/ClipboardModuleTest.java +3 -1
- package/ReactCommon/React-Fabric.podspec +9 -1
- package/ReactCommon/better/BUCK +0 -6
- package/ReactCommon/callinvoker/BUCK +2 -8
- package/ReactCommon/cxxreact/BUCK +1 -16
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +7 -4
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1238 -1491
- package/ReactCommon/jsi/BUCK +0 -9
- package/ReactCommon/jsinspector/BUCK +0 -5
- package/ReactCommon/logger/BUCK +0 -5
- package/ReactCommon/react/config/BUCK +0 -6
- package/ReactCommon/react/debug/BUCK +0 -6
- package/ReactCommon/react/nativemodule/core/BUCK +0 -5
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +14 -31
- package/ReactCommon/react/nativemodule/samples/BUCK +0 -7
- package/ReactCommon/react/renderer/animations/BUCK +1 -4
- package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +34 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +5 -26
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +8 -14
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +912 -1147
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +80 -245
- package/ReactCommon/react/renderer/animations/conversions.h +212 -0
- package/ReactCommon/react/renderer/animations/primitives.h +104 -0
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +3 -3
- package/ReactCommon/react/renderer/animations/utils.cpp +71 -0
- package/ReactCommon/react/renderer/animations/utils.h +80 -0
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/BUCK +0 -6
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +1 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
- package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
- package/ReactCommon/react/renderer/componentregistry/BUCK +0 -6
- package/ReactCommon/react/renderer/componentregistry/native/BUCK +0 -6
- package/ReactCommon/react/renderer/components/image/BUCK +0 -6
- package/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h +0 -2
- package/ReactCommon/react/renderer/components/inputaccessory/BUCK +0 -6
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h +0 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/BUCK +0 -6
- package/ReactCommon/react/renderer/components/modal/BUCK +0 -6
- package/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h +0 -5
- package/ReactCommon/react/renderer/components/progressbar/BUCK +0 -6
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h +0 -3
- package/ReactCommon/react/renderer/components/root/BUCK +0 -6
- package/ReactCommon/react/renderer/components/safeareaview/BUCK +0 -6
- package/ReactCommon/react/renderer/components/scrollview/BUCK +0 -6
- package/ReactCommon/react/renderer/components/slider/BUCK +0 -6
- package/ReactCommon/react/renderer/components/slider/SliderComponentDescriptor.h +0 -3
- package/ReactCommon/react/renderer/components/switch/BUCK +0 -6
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h +0 -3
- package/ReactCommon/react/renderer/components/text/BUCK +0 -6
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +1 -20
- package/ReactCommon/react/renderer/components/textinput/BUCK +0 -6
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h +0 -3
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.h +2 -0
- package/ReactCommon/react/renderer/components/textinput/iostextinput/BUCK +0 -6
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputComponentDescriptor.h +0 -3
- package/ReactCommon/react/renderer/components/unimplementedview/BUCK +0 -6
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp +0 -4
- package/ReactCommon/react/renderer/components/view/Android.mk +1 -1
- package/ReactCommon/react/renderer/components/view/BUCK +0 -6
- package/ReactCommon/react/renderer/components/view/Touch.h +1 -32
- package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +0 -23
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +2 -3
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +3 -3
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/ReactCommon/react/renderer/core/BUCK +2 -6
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +14 -9
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +1 -10
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +9 -4
- package/ReactCommon/react/renderer/core/EventEmitter.h +2 -1
- package/ReactCommon/react/renderer/core/Props.h +1 -0
- package/ReactCommon/react/renderer/core/PropsParserContext.h +3 -2
- package/ReactCommon/react/renderer/core/RawEvent.h +7 -5
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
- package/ReactCommon/react/renderer/core/ReactPrimitives.h +0 -2
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +7 -10
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +1 -0
- package/ReactCommon/react/renderer/debug/BUCK +0 -6
- package/ReactCommon/react/renderer/element/BUCK +0 -6
- package/ReactCommon/react/renderer/graphics/Android.mk +1 -1
- package/ReactCommon/react/renderer/graphics/BUCK +0 -6
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +0 -1
- package/ReactCommon/react/renderer/graphics/Transform.cpp +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/BUCK +0 -6
- package/ReactCommon/react/renderer/leakchecker/BUCK +0 -6
- package/ReactCommon/react/renderer/mapbuffer/BUCK +0 -6
- package/ReactCommon/react/renderer/mounting/Android.mk +2 -1
- package/ReactCommon/react/renderer/mounting/BUCK +0 -6
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +12 -0
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +10 -1
- package/ReactCommon/react/renderer/runtimescheduler/Android.mk +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/BUCK +1 -7
- package/ReactCommon/react/renderer/runtimescheduler/ErrorUtils.h +36 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +28 -20
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +32 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +36 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriority.h +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/primitives.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +26 -1
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubErrorUtils.h +72 -0
- package/ReactCommon/react/renderer/scheduler/BUCK +0 -6
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +1 -4
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +1 -1
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
- package/ReactCommon/react/renderer/telemetry/BUCK +0 -6
- package/ReactCommon/react/renderer/templateprocessor/BUCK +0 -6
- package/ReactCommon/react/renderer/textlayoutmanager/BUCK +0 -6
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
- package/ReactCommon/react/renderer/timeline/BUCK +6 -12
- package/ReactCommon/react/renderer/uimanager/BUCK +0 -6
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +1 -1
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +2 -2
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +1 -1
- package/ReactCommon/react/test_utils/BUCK +3 -6
- package/ReactCommon/react/{renderer/core/Constants.h → test_utils/MockSurfaceHandler.h} +9 -7
- package/ReactCommon/react/utils/BUCK +0 -6
- package/ReactCommon/react/utils/ContextContainer.h +0 -27
- package/ReactCommon/reactperflogger/BUCK +0 -4
- package/ReactCommon/runtimeexecutor/BUCK +0 -6
- package/ReactCommon/yoga/BUCK +1 -5
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/jest/mockModal.js +31 -0
- package/jest/setup.js +5 -3
- package/package.json +24 -17
- package/react.gradle +53 -18
- package/scripts/find-node.sh +13 -0
- package/scripts/generate-specs-cli.js +18 -0
- package/scripts/ios-configure-glog.sh +4 -0
- package/scripts/react-native-xcode.sh +6 -6
- package/scripts/react_native_pods.rb +202 -43
- package/scripts/update-ruby.sh +66 -0
- package/template/Gemfile +6 -0
- package/template/Gemfile.lock +100 -0
- package/template/_bundle/config +2 -0
- package/template/_flowconfig +1 -1
- package/template/_ruby-version +1 -0
- package/template/android/app/build.gradle +1 -1
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/template/android/app/src/main/res/values/styles.xml +1 -0
- package/template/android/build.gradle +7 -3
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/android/gradle.properties +1 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -2
- package/template/ios/Podfile +2 -0
- package/template/package.json +2 -2
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/glog.podspec +0 -1
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/Libraries/Components/StaticContainer.react.js +0 -51
- package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -25
- package/Libraries/Interaction/InteractionMixin.js +0 -54
- package/Libraries/ReactNative/queryLayoutByID.js +0 -58
- package/React/Base/macOS/RCTDynamicColor.h +0 -28
- package/React/Base/macOS/RCTDynamicColor.m +0 -217
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
- package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java +0 -39
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk +0 -34
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK +0 -35
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp +0 -46
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h +0 -40
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidViewPagerManagerDelegate.java +0 -57
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidViewPagerManagerInterface.java +0 -23
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/BUCK +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerDelegate.java +0 -62
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerInterface.java +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/InputAccessoryViewManagerDelegate.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/InputAccessoryViewManagerInterface.java +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerDelegate.java +0 -51
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerInterface.java +0 -21
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/SwitchManagerDelegate.java +0 -63
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/SwitchManagerInterface.java +0 -24
- package/scripts/generate-specs.sh +0 -99
- package/template/_editorconfig +0 -3
- package/template/_gitattributes +0 -3
|
@@ -25,21 +25,6 @@ void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value)
|
|
|
25
25
|
RCTExperimentPreemptiveViewAllocationDisabled = value;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
/*
|
|
29
|
-
* Initial maximum surface size
|
|
30
|
-
*/
|
|
31
|
-
static BOOL RCTInitialMaxSizeEnabled = NO;
|
|
32
|
-
|
|
33
|
-
BOOL RCTGetInitialMaxSizeEnabled()
|
|
34
|
-
{
|
|
35
|
-
return RCTInitialMaxSizeEnabled;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
void RCTSetInitialMaxSizeEnabled(BOOL value)
|
|
39
|
-
{
|
|
40
|
-
RCTInitialMaxSizeEnabled = value;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
28
|
/*
|
|
44
29
|
* Remove clipped subviews
|
|
45
30
|
*/
|
package/React/Base/RCTConvert.h
CHANGED
|
@@ -76,7 +76,7 @@ typedef NSURL RCTFileURL;
|
|
|
76
76
|
#endif
|
|
77
77
|
|
|
78
78
|
#if TARGET_OS_IPHONE
|
|
79
|
-
+ (WKDataDetectorTypes)WKDataDetectorTypes:(id)json
|
|
79
|
+
+ (WKDataDetectorTypes)WKDataDetectorTypes:(id)json;
|
|
80
80
|
#endif
|
|
81
81
|
|
|
82
82
|
+ (UIViewContentMode)UIViewContentMode:(id)json;
|
package/React/Base/RCTConvert.m
CHANGED
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
#import "RCTParserUtils.h"
|
|
17
17
|
#import "RCTUtils.h"
|
|
18
18
|
|
|
19
|
-
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
20
|
-
#import "RCTDynamicColor.h"
|
|
21
|
-
#endif // ]TODO(macOS GH#774)
|
|
22
|
-
|
|
23
19
|
@implementation RCTConvert
|
|
24
20
|
|
|
25
21
|
RCT_CONVERTER(id, id, self)
|
|
@@ -1043,7 +1039,28 @@ static NSColor *RCTColorWithSystemEffect(NSColor* color, NSString *systemEffectS
|
|
|
1043
1039
|
RCTUIColor *highContrastDarkColor = [RCTConvert UIColor:highContrastDark]; // TODO(macOS GH#750)
|
|
1044
1040
|
if (lightColor != nil && darkColor != nil) {
|
|
1045
1041
|
#if TARGET_OS_OSX
|
|
1046
|
-
|
|
1042
|
+
NSColor *color = [NSColor colorWithName:nil dynamicProvider:^NSColor * _Nonnull(NSAppearance * _Nonnull appearance) {
|
|
1043
|
+
NSMutableArray<NSAppearanceName> *appearances = [NSMutableArray arrayWithArray:@[NSAppearanceNameAqua,NSAppearanceNameDarkAqua]];
|
|
1044
|
+
if (highContrastLightColor != nil) {
|
|
1045
|
+
[appearances addObject:NSAppearanceNameAccessibilityHighContrastAqua];
|
|
1046
|
+
}
|
|
1047
|
+
if (highContrastDarkColor != nil) {
|
|
1048
|
+
[appearances addObject:NSAppearanceNameAccessibilityHighContrastDarkAqua];
|
|
1049
|
+
}
|
|
1050
|
+
NSAppearanceName bestMatchingAppearance = [appearance bestMatchFromAppearancesWithNames:appearances];
|
|
1051
|
+
if (bestMatchingAppearance == NSAppearanceNameAqua) {
|
|
1052
|
+
return lightColor;
|
|
1053
|
+
} else if (bestMatchingAppearance == NSAppearanceNameDarkAqua) {
|
|
1054
|
+
return darkColor;
|
|
1055
|
+
} else if (bestMatchingAppearance == NSAppearanceNameAccessibilityHighContrastAqua) {
|
|
1056
|
+
return highContrastLightColor;
|
|
1057
|
+
} else if (bestMatchingAppearance == NSAppearanceNameAccessibilityHighContrastDarkAqua) {
|
|
1058
|
+
return highContrastDarkColor;
|
|
1059
|
+
} else {
|
|
1060
|
+
RCTLogConvertError(json, @"an NSColorColor. Could not resolve current appearance. Defaulting to light.");
|
|
1061
|
+
return lightColor;
|
|
1062
|
+
}
|
|
1063
|
+
}];
|
|
1047
1064
|
return color;
|
|
1048
1065
|
#else
|
|
1049
1066
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
|
@@ -1406,7 +1423,7 @@ RCT_ENUM_CONVERTER(
|
|
|
1406
1423
|
@"link": NSAccessibilityLinkRole, // also a legacy iOS accessibilityTraits
|
|
1407
1424
|
@"menu": NSAccessibilityMenuRole,
|
|
1408
1425
|
@"menubar": NSAccessibilityMenuBarRole,
|
|
1409
|
-
@"menuitem":
|
|
1426
|
+
@"menuitem": NSAccessibilityMenuItemRole,
|
|
1410
1427
|
@"none": NSAccessibilityUnknownRole,
|
|
1411
1428
|
@"progressbar": NSAccessibilityProgressIndicatorRole,
|
|
1412
1429
|
@"radio": NSAccessibilityRadioButtonRole,
|
package/React/Base/RCTDefines.h
CHANGED
|
@@ -54,6 +54,15 @@
|
|
|
54
54
|
#define RCT_DEV_MENU RCT_DEV
|
|
55
55
|
#endif
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Controls for the core packgaer loading functionality
|
|
59
|
+
* By default, this inherits from RCT_DEV_MENU but it also gives the capability to
|
|
60
|
+
* enable the packager functionality without the rest of the dev tools from RCT_DEV_MENU
|
|
61
|
+
*/
|
|
62
|
+
#ifndef RCT_ENABLE_LOADING_FROM_PACKAGER
|
|
63
|
+
#define RCT_ENABLE_LOADING_FROM_PACKAGER RCT_DEV_MENU
|
|
64
|
+
#endif
|
|
65
|
+
|
|
57
66
|
#ifndef RCT_ENABLE_INSPECTOR
|
|
58
67
|
#if RCT_DEV && __has_include(<React/RCTInspectorDevServerHelper.h>)
|
|
59
68
|
#define RCT_ENABLE_INSPECTOR 1
|
|
@@ -62,11 +71,11 @@
|
|
|
62
71
|
#endif
|
|
63
72
|
#endif
|
|
64
73
|
|
|
65
|
-
#ifndef
|
|
74
|
+
#ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
66
75
|
#if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include(<React/RCTPackagerConnection.h>))
|
|
67
|
-
#define
|
|
76
|
+
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1
|
|
68
77
|
#else
|
|
69
|
-
#define
|
|
78
|
+
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 0
|
|
70
79
|
#endif
|
|
71
80
|
#endif
|
|
72
81
|
|
|
@@ -81,6 +81,8 @@ typedef NS_ENUM(NSInteger, RCTTextEventType) {
|
|
|
81
81
|
*/
|
|
82
82
|
@protocol RCTEventDispatcherProtocol <RCTBridgeModule, RCTJSDispatcherModule>
|
|
83
83
|
|
|
84
|
+
- (void)sendViewEventWithName:(NSString *)name reactTag:(NSNumber *)reactTag;
|
|
85
|
+
|
|
84
86
|
/**
|
|
85
87
|
* Deprecated, do not use.
|
|
86
88
|
*/
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
(CGSizeEqualToSize(_size, object.size) || CGSizeEqualToSize(object.size, CGSizeZero));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
45
46
|
- (NSString *)description
|
|
46
47
|
{
|
|
47
48
|
return [NSString stringWithFormat:@"<RCTImageSource: %p URL=%@, size=%@, scale=%0.f>",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
NSStringFromCGSize(_size),
|
|
51
52
|
_scale];
|
|
52
53
|
}
|
|
54
|
+
#endif // TODO(macOS GH#774)
|
|
53
55
|
|
|
54
56
|
@end
|
|
55
57
|
|
|
@@ -136,6 +136,7 @@ static NSRegularExpression *RCTJSStackFrameRegex()
|
|
|
136
136
|
return stack;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
139
140
|
- (NSString *)description
|
|
140
141
|
{
|
|
141
142
|
return [NSString stringWithFormat:@"<%@: %p method name: %@; file name: %@; line: %ld; column: %ld>",
|
|
@@ -146,5 +147,6 @@ static NSRegularExpression *RCTJSStackFrameRegex()
|
|
|
146
147
|
(long)self.lineNumber,
|
|
147
148
|
(long)self.column];
|
|
148
149
|
}
|
|
150
|
+
#endif // TODO(macOS GH#774)
|
|
149
151
|
|
|
150
152
|
@end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
10
|
+
|
|
11
|
+
#import <React/RCTDefines.h>
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This constant can be returned from +methodQueue to force module
|
|
15
|
+
* methods to be called on the JavaScript thread. This can have serious
|
|
16
|
+
* implications for performance, so only use this if you're sure it's what
|
|
17
|
+
* you need.
|
|
18
|
+
*
|
|
19
|
+
* NOTE: RCTJSThread is not a real libdispatch queue
|
|
20
|
+
*/
|
|
21
|
+
RCT_EXTERN dispatch_queue_t RCTJSThread;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Initializes the RCTJSThread constant.
|
|
25
|
+
* Exported because the bridgeless initialization layer needs to initialize
|
|
26
|
+
* RCTJSThread. In bridgeless mode, RCTBridge isn't accessed, and RCTJSThread
|
|
27
|
+
* therefore isn't initialized.
|
|
28
|
+
*/
|
|
29
|
+
RCT_EXTERN void _RCTInitializeJSThreadConstantInternal(void);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTJSThread.h"
|
|
9
|
+
|
|
10
|
+
dispatch_queue_t RCTJSThread;
|
|
11
|
+
|
|
12
|
+
void _RCTInitializeJSThreadConstantInternal(void)
|
|
13
|
+
{
|
|
14
|
+
static dispatch_once_t onceToken;
|
|
15
|
+
dispatch_once(&onceToken, ^{
|
|
16
|
+
// Set up JS thread
|
|
17
|
+
RCTJSThread = (id)kCFNull;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -62,6 +62,7 @@ static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_R
|
|
|
62
62
|
|
|
63
63
|
@implementation RCTLoadingProgress
|
|
64
64
|
|
|
65
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
65
66
|
- (NSString *)description
|
|
66
67
|
{
|
|
67
68
|
NSMutableString *desc = [NSMutableString new];
|
|
@@ -77,6 +78,7 @@ static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_R
|
|
|
77
78
|
[desc appendString:@"\u2026"];
|
|
78
79
|
return desc;
|
|
79
80
|
}
|
|
81
|
+
#endif // TODO(macOS GH#774)
|
|
80
82
|
|
|
81
83
|
@end
|
|
82
84
|
|
|
@@ -74,6 +74,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
74
74
|
return [_key isEqual:input] && (_flags == flags || flags == 0);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
77
78
|
- (NSString *)description
|
|
78
79
|
{
|
|
79
80
|
return [NSString stringWithFormat:@"<%@:%p input=\"%@\" flags=%lld hasBlock=%@>",
|
|
@@ -83,6 +84,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
83
84
|
(long long)_flags,
|
|
84
85
|
_block ? @"YES" : @"NO"];
|
|
85
86
|
}
|
|
87
|
+
#endif // TODO(macOS GH#774)
|
|
86
88
|
|
|
87
89
|
@end
|
|
88
90
|
|
|
@@ -570,9 +570,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init);
|
|
|
570
570
|
_methodQueue = nil;
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
573
574
|
- (NSString *)description
|
|
574
575
|
{
|
|
575
576
|
return [NSString stringWithFormat:@"<%@: %p; name=\"%@\">", [self class], self, self.name];
|
|
576
577
|
}
|
|
578
|
+
#endif // TODO(macOS GH#774)
|
|
577
579
|
|
|
578
580
|
@end
|
|
@@ -602,6 +602,7 @@ RCT_EXTERN_C_END
|
|
|
602
602
|
return [NSString stringWithFormat:@"-[%@ %s]", _moduleClass, sel_getName(_selector)];
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
605
606
|
- (NSString *)description
|
|
606
607
|
{
|
|
607
608
|
return [NSString stringWithFormat:@"<%@: %p; exports %@ as %s(); type: %s>",
|
|
@@ -611,5 +612,6 @@ RCT_EXTERN_C_END
|
|
|
611
612
|
self.JSMethodName,
|
|
612
613
|
RCTFunctionDescriptorFromType(self.functionType)];
|
|
613
614
|
}
|
|
615
|
+
#endif // TODO(macOS GH#774)
|
|
614
616
|
|
|
615
617
|
@end
|
package/React/Base/RCTRootView.h
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
|
+
#import <React/RCTBridgeModule.h>
|
|
12
|
+
#import <React/RCTEventDispatcherProtocol.h>
|
|
11
13
|
|
|
12
14
|
@protocol RCTRootViewDelegate;
|
|
13
15
|
|
|
@@ -75,6 +77,19 @@ extern
|
|
|
75
77
|
initialProperties:(nullable NSDictionary *)initialProperties
|
|
76
78
|
launchOptions:(nullable NSDictionary *)launchOptions;
|
|
77
79
|
|
|
80
|
+
/**
|
|
81
|
+
* This API allows RCTRootView users to know if the root view is backed by the bridge.
|
|
82
|
+
*/
|
|
83
|
+
@property (nonatomic, readonly) BOOL hasBridge;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* This API allows users of RCTRootView to access other NativeModules, without
|
|
87
|
+
* directly accessing the bridge.
|
|
88
|
+
*/
|
|
89
|
+
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;
|
|
90
|
+
|
|
91
|
+
@property (nonatomic, strong, readonly) id<RCTEventDispatcherProtocol> eventDispatcher;
|
|
92
|
+
|
|
78
93
|
/**
|
|
79
94
|
* The name of the JavaScript module to execute within the
|
|
80
95
|
* specified scriptURL (required). Setting this will not have
|
package/React/Base/RCTRootView.m
CHANGED
|
@@ -136,6 +136,21 @@ NSString *const RCTContentDidAppearNotification = @"RCTContentDidAppearNotificat
|
|
|
136
136
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
137
137
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
138
138
|
|
|
139
|
+
- (BOOL)hasBridge
|
|
140
|
+
{
|
|
141
|
+
return _bridge != nil;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
145
|
+
{
|
|
146
|
+
return _bridge.moduleRegistry;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (id<RCTEventDispatcherProtocol>)eventDispatcher
|
|
150
|
+
{
|
|
151
|
+
return [self.moduleRegistry moduleForName:"EventDispatcher"];
|
|
152
|
+
}
|
|
153
|
+
|
|
139
154
|
#pragma mark - passThroughTouches
|
|
140
155
|
|
|
141
156
|
- (BOOL)passThroughTouches
|
|
@@ -98,10 +98,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
98
98
|
return _coalescingKey;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
101
102
|
- (NSString *)description
|
|
102
103
|
{
|
|
103
104
|
return [NSString
|
|
104
105
|
stringWithFormat:@"<%@: %p; name = %@; coalescing key = %hu>", [self class], self, _eventName, _coalescingKey];
|
|
105
106
|
}
|
|
107
|
+
#endif // TODO(macOS GH#774)
|
|
106
108
|
|
|
107
109
|
@end
|
|
@@ -41,10 +41,6 @@
|
|
|
41
41
|
|
|
42
42
|
__weak RCTUIView *_cachedRootView; // TODO(macOS GH#774)
|
|
43
43
|
|
|
44
|
-
// See Touch.h and usage. This gives us a time-basis for a monotonic
|
|
45
|
-
// clock that acts like a timestamp of milliseconds elapsed since UNIX epoch.
|
|
46
|
-
NSTimeInterval _unixEpochBasisTime;
|
|
47
|
-
|
|
48
44
|
uint16_t _coalescingKey;
|
|
49
45
|
#if TARGET_OS_OSX// [TODO(macOS GH#774)
|
|
50
46
|
BOOL _shouldSendMouseUpOnSystemBehalf;
|
|
@@ -62,9 +58,6 @@
|
|
|
62
58
|
_reactTouches = [NSMutableArray new];
|
|
63
59
|
_touchViews = [NSMutableArray new];
|
|
64
60
|
|
|
65
|
-
// Get a UNIX epoch basis time:
|
|
66
|
-
_unixEpochBasisTime = [[NSDate date] timeIntervalSince1970] - [NSProcessInfo processInfo].systemUptime;
|
|
67
|
-
|
|
68
61
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
69
62
|
// `cancelsTouchesInView` and `delaysTouches*` are needed in order to be used as a top level
|
|
70
63
|
// event delegated recognizer. Otherwise, lower-level components not built
|
|
@@ -236,7 +229,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)
|
|
|
236
229
|
reactTouch[@"pageY"] = @(RCTSanitizeNaNValue(rootViewLocation.y, @"touchEvent.pageY"));
|
|
237
230
|
reactTouch[@"locationX"] = @(RCTSanitizeNaNValue(touchViewLocation.x, @"touchEvent.locationX"));
|
|
238
231
|
reactTouch[@"locationY"] = @(RCTSanitizeNaNValue(touchViewLocation.y, @"touchEvent.locationY"));
|
|
239
|
-
reactTouch[@"timestamp"] = @(
|
|
232
|
+
reactTouch[@"timestamp"] = @(nativeTouch.timestamp * 1000); // in ms, for JS
|
|
240
233
|
|
|
241
234
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
242
235
|
// TODO: force for a 'normal' touch is usually 1.0;
|
package/React/Base/RCTUtils.h
CHANGED
|
@@ -40,6 +40,9 @@ RCT_EXTERN void RCTExecuteOnMainQueue(dispatch_block_t block);
|
|
|
40
40
|
// Please do not use this unless you know what you're doing.
|
|
41
41
|
RCT_EXTERN void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block);
|
|
42
42
|
|
|
43
|
+
// Get screen scale, can be only used on main
|
|
44
|
+
RCT_EXTERN void RCTComputeScreenScale(void);
|
|
45
|
+
|
|
43
46
|
// Get screen metrics in a thread-safe way
|
|
44
47
|
RCT_EXTERN CGFloat RCTScreenScale(void);
|
|
45
48
|
RCT_EXTERN CGFloat RCTFontSizeMultiplier(void);
|
package/React/Base/RCTUtils.m
CHANGED
|
@@ -297,16 +297,23 @@ static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, disp
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
300
|
-
|
|
300
|
+
static dispatch_once_t onceTokenScreenScale;
|
|
301
|
+
static CGFloat screenScale;
|
|
302
|
+
|
|
303
|
+
void RCTComputeScreenScale()
|
|
301
304
|
{
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
dispatch_once(&onceTokenScreenScale, ^{
|
|
306
|
+
screenScale = [UIScreen mainScreen].scale;
|
|
307
|
+
});
|
|
308
|
+
}
|
|
304
309
|
|
|
305
|
-
|
|
306
|
-
|
|
310
|
+
CGFloat RCTScreenScale()
|
|
311
|
+
{
|
|
312
|
+
RCTUnsafeExecuteOnMainQueueOnceSync(&onceTokenScreenScale, ^{
|
|
313
|
+
screenScale = [UIScreen mainScreen].scale;
|
|
307
314
|
});
|
|
308
315
|
|
|
309
|
-
return
|
|
316
|
+
return screenScale;
|
|
310
317
|
}
|
|
311
318
|
|
|
312
319
|
CGFloat RCTFontSizeMultiplier()
|
|
@@ -335,7 +342,7 @@ CGFloat RCTFontSizeMultiplier()
|
|
|
335
342
|
|
|
336
343
|
CGSize RCTScreenSize()
|
|
337
344
|
{
|
|
338
|
-
// FIXME: this caches the bounds
|
|
345
|
+
// FIXME: this caches whatever the bounds were when it was first called, and then
|
|
339
346
|
// doesn't update when the device is rotated. We need to find another thread-
|
|
340
347
|
// safe way to get the screen size.
|
|
341
348
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
|
+
#import <React/RCTBridgeModule.h>
|
|
10
11
|
#import <React/RCTRootView.h>
|
|
11
12
|
|
|
12
13
|
#import "RCTSurfaceHostingView.h"
|
|
@@ -26,6 +27,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
26
27
|
|
|
27
28
|
@property (nonatomic, copy, readonly) NSString *moduleName;
|
|
28
29
|
@property (nonatomic, strong, readonly) RCTBridge *bridge;
|
|
30
|
+
@property (nonatomic, readonly) BOOL hasBridge;
|
|
31
|
+
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;
|
|
32
|
+
@property (nonatomic, strong, readonly) id<RCTEventDispatcherProtocol> eventDispatcher;
|
|
29
33
|
@property (nonatomic, copy, readwrite) NSDictionary *appProperties;
|
|
30
34
|
@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;
|
|
31
35
|
@property (nonatomic, weak) id<RCTRootViewDelegate> delegate;
|
|
@@ -46,6 +50,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
46
50
|
initialProperties:(NSDictionary *)initialProperties
|
|
47
51
|
launchOptions:(NSDictionary *)launchOptions;
|
|
48
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Bridgeless mode initializer
|
|
55
|
+
*/
|
|
56
|
+
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
|
57
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
58
|
+
moduleRegistry:(RCTModuleRegistry *)moduleRegistry;
|
|
59
|
+
|
|
49
60
|
- (void)cancelTouches;
|
|
50
61
|
|
|
51
62
|
@end
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <objc/runtime.h>
|
|
11
11
|
|
|
12
12
|
#import "RCTAssert.h"
|
|
13
|
+
#import "RCTBridge+Private.h"
|
|
13
14
|
#import "RCTBridge.h"
|
|
14
15
|
#import "RCTLog.h"
|
|
15
16
|
#import "RCTPerformanceLogger.h"
|
|
@@ -48,7 +49,9 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
@implementation RCTSurfaceHostingProxyRootView
|
|
52
|
+
@implementation RCTSurfaceHostingProxyRootView {
|
|
53
|
+
RCTModuleRegistry *_moduleRegistry;
|
|
54
|
+
}
|
|
52
55
|
|
|
53
56
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
54
57
|
moduleName:(NSString *)moduleName
|
|
@@ -94,6 +97,37 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
|
|
94
97
|
return [self initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
|
95
98
|
}
|
|
96
99
|
|
|
100
|
+
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
|
101
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
102
|
+
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
|
103
|
+
{
|
|
104
|
+
if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) {
|
|
105
|
+
_moduleRegistry = moduleRegistry;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return self;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
- (BOOL)hasBridge
|
|
112
|
+
{
|
|
113
|
+
return _bridge != nil;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
117
|
+
{
|
|
118
|
+
// In bridgeless mode, RCTSurfaceHostingProxyRootView is created with an RCTModuleRegistry
|
|
119
|
+
if (_moduleRegistry) {
|
|
120
|
+
return _moduleRegistry;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return _bridge.moduleRegistry;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
- (id<RCTEventDispatcherProtocol>)eventDispatcher
|
|
127
|
+
{
|
|
128
|
+
return [self.moduleRegistry moduleForName:"EventDispatcher"];
|
|
129
|
+
}
|
|
130
|
+
|
|
97
131
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
98
132
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
99
133
|
|
|
@@ -50,7 +50,7 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
|
|
|
50
50
|
os_unfair_lock_lock(&rctDisplayLink->_lock);
|
|
51
51
|
if (rctDisplayLink->_runLoop != nil) {
|
|
52
52
|
CFRunLoopRef cfRunLoop = [rctDisplayLink->_runLoop getCFRunLoop];
|
|
53
|
-
CFRunLoopPerformBlock(cfRunLoop,
|
|
53
|
+
CFRunLoopPerformBlock(cfRunLoop, (__bridge CFArrayRef)rctDisplayLink->_modes, ^{
|
|
54
54
|
[rctDisplayLink tick];
|
|
55
55
|
});
|
|
56
56
|
CFRunLoopWakeUp(cfRunLoop);
|
|
@@ -71,14 +71,17 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
|
|
|
71
71
|
|
|
72
72
|
- (void)addToRunLoop:(NSRunLoop *)runloop forMode:(NSRunLoopMode)mode
|
|
73
73
|
{
|
|
74
|
+
os_unfair_lock_lock(&_lock);
|
|
74
75
|
_runLoop = runloop;
|
|
75
76
|
|
|
76
77
|
if (_displayLink != NULL) {
|
|
77
78
|
[_modes addObject:mode];
|
|
79
|
+
os_unfair_lock_unlock(&_lock);
|
|
78
80
|
return;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
_modes = @[mode].mutableCopy;
|
|
84
|
+
os_unfair_lock_unlock(&_lock);
|
|
82
85
|
CVReturn ret = CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
|
|
83
86
|
if (ret != kCVReturnSuccess) {
|
|
84
87
|
ret = CVDisplayLinkCreateWithCGDisplay(CGMainDisplayID(), &_displayLink);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTAccessibilityManager.h"
|
|
9
|
+
|
|
10
|
+
#import <React/RCTDefines.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
RCT_EXTERN_C_BEGIN
|
|
15
|
+
|
|
16
|
+
// Only to be used for testing and internal tooling. Do not use this in
|
|
17
|
+
// production.
|
|
18
|
+
void RCTAccessibilityManagerSetIsVoiceOverEnabled(
|
|
19
|
+
RCTAccessibilityManager *accessibiltyManager,
|
|
20
|
+
BOOL isVoiceOverEnabled);
|
|
21
|
+
|
|
22
|
+
RCT_EXTERN_C_END
|
|
23
|
+
|
|
24
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#import "RCTAccessibilityManager.h"
|
|
9
|
+
#import "RCTAccessibilityManager+Internal.h"
|
|
9
10
|
|
|
10
11
|
#import <FBReactNativeSpec/FBReactNativeSpec.h>
|
|
11
12
|
#import <React/RCTBridge.h>
|
|
@@ -185,9 +186,14 @@ RCT_EXPORT_MODULE()
|
|
|
185
186
|
|
|
186
187
|
- (void)voiceVoiceOverStatusDidChange:(__unused NSNotification *)notification
|
|
187
188
|
{
|
|
188
|
-
BOOL
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
BOOL isVoiceOverEnabled = UIAccessibilityIsVoiceOverRunning();
|
|
190
|
+
[self _setIsVoiceOverEnabled:isVoiceOverEnabled];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
- (void)_setIsVoiceOverEnabled:(BOOL)isVoiceOverEnabled
|
|
194
|
+
{
|
|
195
|
+
if (_isVoiceOverEnabled != isVoiceOverEnabled) {
|
|
196
|
+
_isVoiceOverEnabled = isVoiceOverEnabled;
|
|
191
197
|
#pragma clang diagnostic push
|
|
192
198
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
193
199
|
[[_moduleRegistry moduleForName:"EventDispatcher"] sendDeviceEventWithName:@"screenReaderChanged"
|
|
@@ -352,6 +358,15 @@ RCT_EXPORT_METHOD(getCurrentVoiceOverState
|
|
|
352
358
|
return std::make_shared<facebook::react::NativeAccessibilityManagerSpecJSI>(params);
|
|
353
359
|
}
|
|
354
360
|
|
|
361
|
+
#pragma mark - Internal
|
|
362
|
+
|
|
363
|
+
void RCTAccessibilityManagerSetIsVoiceOverEnabled(
|
|
364
|
+
RCTAccessibilityManager *accessibilityManager,
|
|
365
|
+
BOOL isVoiceOverEnabled)
|
|
366
|
+
{
|
|
367
|
+
[accessibilityManager _setIsVoiceOverEnabled:isVoiceOverEnabled];
|
|
368
|
+
}
|
|
369
|
+
|
|
355
370
|
@end
|
|
356
371
|
|
|
357
372
|
@implementation RCTBridge (RCTAccessibilityManager)
|
|
@@ -43,7 +43,11 @@ NSSharingServicePickerDelegate
|
|
|
43
43
|
|
|
44
44
|
RCT_EXPORT_MODULE()
|
|
45
45
|
|
|
46
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
47
|
+
@synthesize bridge = _bridge;
|
|
48
|
+
#else // TODO(macOS GH#774)
|
|
46
49
|
@synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
|
|
50
|
+
#endif // ]TODO(macOS GH#774)
|
|
47
51
|
|
|
48
52
|
- (dispatch_queue_t)methodQueue
|
|
49
53
|
{
|
|
@@ -116,6 +120,8 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
|
|
116
120
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
117
121
|
UIViewController *controller = RCTPresentedViewController();
|
|
118
122
|
UIColor *tintColor = [RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];
|
|
123
|
+
UIColor *cancelButtonTintColor =
|
|
124
|
+
[RCTConvert UIColor:options.cancelButtonTintColor() ? @(*options.cancelButtonTintColor()) : nil];
|
|
119
125
|
|
|
120
126
|
if (controller == nil) {
|
|
121
127
|
RCTLogError(
|
|
@@ -127,6 +133,7 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
|
|
127
133
|
@"destructiveButtonIndices" : destructiveButtonIndices ?: [NSNull null],
|
|
128
134
|
@"anchor" : anchor ?: [NSNull null],
|
|
129
135
|
@"tintColor" : tintColor ?: [NSNull null],
|
|
136
|
+
@"cancelButtonTintColor" : cancelButtonTintColor ?: [NSNull null],
|
|
130
137
|
@"disabledButtonIndices" : disabledButtonIndices ?: [NSNull null],
|
|
131
138
|
}); /* // TODO(macOS GH#774): nil check our dict values before inserting them or we may crash ] */
|
|
132
139
|
return;
|
|
@@ -145,20 +152,26 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
|
|
145
152
|
preferredStyle:UIAlertControllerStyleActionSheet];
|
|
146
153
|
|
|
147
154
|
NSInteger index = 0;
|
|
155
|
+
bool isCancelButtonIndex = false;
|
|
148
156
|
for (NSString *option in buttons) {
|
|
149
157
|
UIAlertActionStyle style = UIAlertActionStyleDefault;
|
|
150
158
|
if ([destructiveButtonIndices containsObject:@(index)]) {
|
|
151
159
|
style = UIAlertActionStyleDestructive;
|
|
152
160
|
} else if (index == cancelButtonIndex) {
|
|
153
161
|
style = UIAlertActionStyleCancel;
|
|
162
|
+
isCancelButtonIndex = true;
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
NSInteger localIndex = index;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
UIAlertAction *actionButton = [UIAlertAction actionWithTitle:option
|
|
167
|
+
style:style
|
|
168
|
+
handler:^(__unused UIAlertAction *action) {
|
|
169
|
+
callback(@[ @(localIndex) ]);
|
|
170
|
+
}];
|
|
171
|
+
if (isCancelButtonIndex) {
|
|
172
|
+
[actionButton setValue:cancelButtonTintColor forKey:@"titleTextColor"];
|
|
173
|
+
}
|
|
174
|
+
[alertController addAction:actionButton];
|
|
162
175
|
|
|
163
176
|
index++;
|
|
164
177
|
}
|