react-native-macos 0.0.0-7ae1439d0 → 0.0.0-7c6fa2fb1
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/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/ScrollView/ScrollView.js +8 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Core/ExceptionsManager.js +3 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -0
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- 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/Pressability/Pressability.js +1 -0
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
- package/Libraries/Renderer/REVISION +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +238 -47
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +238 -47
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +84 -18
- 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 +10 -8
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +1 -1
- 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/React/Base/RCTBridge+Private.h +8 -0
- package/React/Base/RCTBridge.h +4 -0
- package/React/Base/RCTBridge.m +17 -0
- package/React/Base/RCTBridgeModule.h +1 -1
- package/React/Base/RCTBundleURLProvider.h +1 -1
- package/React/Base/RCTBundleURLProvider.mm +2 -2
- package/React/Base/RCTConvert.m +1 -1
- 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/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/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
- package/React/CoreModules/RCTActionSheetManager.mm +4 -0
- 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/RCTPerfMonitor.mm +9 -4
- package/React/CxxBridge/RCTCxxBridge.mm +18 -1
- package/React/CxxModule/RCTCxxMethod.mm +2 -0
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +11 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
- package/React/Fabric/Mounting/RCTMountingManager.mm +15 -1
- package/React/Fabric/RCTScheduler.mm +10 -3
- package/React/Modules/RCTLayoutAnimation.m +2 -0
- package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
- package/React/Modules/RCTUIManager.m +19 -10
- package/React/Views/RCTFont.mm +58 -47
- package/React/Views/RCTShadowView.m +3 -1
- package/React/Views/RCTView.m +4 -8
- package/React/Views/RCTViewManager.m +3 -2
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
- 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 +1 -5
- package/ReactAndroid/build.gradle +12 -6
- 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/react/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +51 -21
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +4 -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/config/ReactFeatureFlags.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +2 -0
- 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 -0
- 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/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/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 +8 -0
- 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/jni/react/jni/Android.mk +3 -2
- package/ReactAndroid/src/main/jni/react/jni/BUCK +2 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +29 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
- package/ReactCommon/React-Fabric.podspec +9 -0
- 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/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +14 -31
- package/ReactCommon/react/renderer/animations/BUCK +1 -0
- 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 +3 -13
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1399 -1622
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +76 -244
- package/ReactCommon/react/renderer/animations/conversions.h +212 -0
- package/ReactCommon/react/renderer/animations/primitives.h +104 -0
- 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/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/components/text/ParagraphComponentDescriptor.h +1 -17
- package/ReactCommon/react/renderer/components/view/Android.mk +1 -1
- 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 +1 -0
- 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/ConcreteComponentDescriptor.h +14 -6
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +1 -0
- package/ReactCommon/react/renderer/core/Props.h +1 -0
- package/ReactCommon/react/renderer/core/PropsParserContext.h +3 -2
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
- package/ReactCommon/react/renderer/core/ReactPrimitives.h +0 -2
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +1 -0
- package/ReactCommon/react/renderer/graphics/Android.mk +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.cpp +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
- package/ReactCommon/react/renderer/mounting/Android.mk +2 -1
- 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/BUCK +0 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +4 -2
- 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/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/scheduler/SurfaceHandler.h +4 -4
- 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 -6
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +1 -1
- package/ReactCommon/react/test_utils/BUCK +3 -0
- package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
- package/ReactCommon/react/utils/ContextContainer.h +0 -27
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/package.json +21 -13
- package/react.gradle +1 -1
- package/scripts/generate-specs-cli.js +18 -0
- package/scripts/ios-configure-glog.sh +4 -0
- package/scripts/react_native_pods.rb +156 -37
- package/template/_flowconfig +1 -1
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/package.json +2 -2
- 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/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/scripts/generate-specs.sh +0 -99
- package/template/_editorconfig +0 -3
- package/template/_gitattributes +0 -3
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <better/map.h>
|
|
11
11
|
|
|
12
12
|
#import <React/RCTAssert.h>
|
|
13
|
+
#import <React/RCTComponent.h>
|
|
13
14
|
#import <React/RCTFollyConvert.h>
|
|
14
15
|
#import <React/RCTLog.h>
|
|
15
16
|
#import <React/RCTUtils.h>
|
|
@@ -26,6 +27,18 @@
|
|
|
26
27
|
|
|
27
28
|
using namespace facebook::react;
|
|
28
29
|
|
|
30
|
+
static SurfaceId RCTSurfaceIdForView(UIView *view)
|
|
31
|
+
{
|
|
32
|
+
do {
|
|
33
|
+
if (RCTIsReactRootView(@(view.tag))) {
|
|
34
|
+
return view.tag;
|
|
35
|
+
}
|
|
36
|
+
view = view.superview;
|
|
37
|
+
} while (view != nil);
|
|
38
|
+
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
|
|
29
42
|
static void RCTPerformMountInstructions(
|
|
30
43
|
ShadowViewMutationList const &mutations,
|
|
31
44
|
RCTComponentViewRegistry *registry,
|
|
@@ -282,9 +295,10 @@ static void RCTPerformMountInstructions(
|
|
|
282
295
|
{
|
|
283
296
|
RCTAssertMainQueue();
|
|
284
297
|
UIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag];
|
|
298
|
+
SurfaceId surfaceId = RCTSurfaceIdForView(componentView);
|
|
285
299
|
SharedProps oldProps = [componentView props];
|
|
286
300
|
SharedProps newProps = componentDescriptor.cloneProps(
|
|
287
|
-
PropsParserContext{
|
|
301
|
+
PropsParserContext{surfaceId, *_contextContainer.get()}, oldProps, RawProps(convertIdToFollyDynamic(props)));
|
|
288
302
|
|
|
289
303
|
NSSet<NSString *> *propKeys = componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN ?: [NSSet new];
|
|
290
304
|
propKeys = [propKeys setByAddingObjectsFromArray:props.allKeys];
|
|
@@ -110,7 +110,6 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
|
|
110
110
|
std::shared_ptr<SchedulerDelegateProxy> _delegateProxy;
|
|
111
111
|
std::shared_ptr<LayoutAnimationDelegateProxy> _layoutAnimationDelegateProxy;
|
|
112
112
|
RunLoopObserver::Unique _uiRunLoopObserver;
|
|
113
|
-
BOOL _layoutAnimationsEnabled;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
- (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
|
|
@@ -118,14 +117,22 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
|
|
118
117
|
if (self = [super init]) {
|
|
119
118
|
auto reactNativeConfig =
|
|
120
119
|
toolbox.contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
|
|
121
|
-
_layoutAnimationsEnabled = reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios");
|
|
122
120
|
|
|
123
121
|
_delegateProxy = std::make_shared<SchedulerDelegateProxy>((__bridge void *)self);
|
|
124
122
|
|
|
125
|
-
if (
|
|
123
|
+
if (reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios")) {
|
|
126
124
|
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
|
|
127
125
|
_animationDriver =
|
|
128
126
|
std::make_shared<LayoutAnimationDriver>(toolbox.runtimeExecutor, _layoutAnimationDelegateProxy.get());
|
|
127
|
+
if (reactNativeConfig->getBool("react_fabric:enabled_skip_invalidated_key_frames_ios")) {
|
|
128
|
+
_animationDriver->enableSkipInvalidatedKeyFrames();
|
|
129
|
+
}
|
|
130
|
+
if (reactNativeConfig->getBool("react_fabric:enable_crash_on_missing_component_descriptor")) {
|
|
131
|
+
_animationDriver->enableCrashOnMissingComponentDescriptor();
|
|
132
|
+
}
|
|
133
|
+
if (reactNativeConfig->getBool("react_fabric:enable_simulate_image_props_memory_access")) {
|
|
134
|
+
_animationDriver->enableSimulateImagePropsMemoryAccess();
|
|
135
|
+
}
|
|
129
136
|
_uiRunLoopObserver =
|
|
130
137
|
toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
|
|
131
138
|
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
|
|
@@ -190,6 +190,7 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
|
|
|
190
190
|
_animationType == animation.animationType;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
193
194
|
- (NSString *)description
|
|
194
195
|
{
|
|
195
196
|
return [NSString
|
|
@@ -204,5 +205,6 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
|
|
|
204
205
|
_initialVelocity,
|
|
205
206
|
(long)_animationType];
|
|
206
207
|
}
|
|
208
|
+
#endif // TODO(macOS GH#774)
|
|
207
209
|
|
|
208
210
|
@end
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
[_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
67
68
|
- (NSString *)description
|
|
68
69
|
{
|
|
69
70
|
return
|
|
@@ -75,5 +76,6 @@
|
|
|
75
76
|
[_updatingLayoutAnimation description],
|
|
76
77
|
[_deletingLayoutAnimation description]];
|
|
77
78
|
}
|
|
79
|
+
#endif // TODO(macOS GH#774)
|
|
78
80
|
|
|
79
81
|
@end
|
|
@@ -1501,6 +1501,7 @@ RCT_EXPORT_METHOD(clearJSResponder)
|
|
|
1501
1501
|
static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
1502
1502
|
NSMutableDictionary<NSString *, NSDictionary *> *directEvents,
|
|
1503
1503
|
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents,
|
|
1504
|
+
NSMutableDictionary<NSString *, NSString *> *registrationCache, // TODO(macOS GH#774)
|
|
1504
1505
|
RCTComponentData *componentData)
|
|
1505
1506
|
{
|
|
1506
1507
|
NSMutableDictionary<NSString *, id> *moduleConstants = [NSMutableDictionary new];
|
|
@@ -1520,6 +1521,8 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1520
1521
|
moduleConstants[@"bubblingEventTypes"] = bubblingEventTypes;
|
|
1521
1522
|
moduleConstants[@"directEventTypes"] = directEventTypes;
|
|
1522
1523
|
|
|
1524
|
+
NSString *componentName = [componentData name]; // TODO(macOS GH#774)
|
|
1525
|
+
|
|
1523
1526
|
// Add direct events
|
|
1524
1527
|
for (NSString *eventName in viewConfig[@"directEvents"]) {
|
|
1525
1528
|
if (!directEvents[eventName]) {
|
|
@@ -1530,11 +1533,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1530
1533
|
directEventTypes[eventName] = directEvents[eventName];
|
|
1531
1534
|
if (RCT_DEBUG && bubblingEvents[eventName]) {
|
|
1532
1535
|
RCTLogError(
|
|
1533
|
-
@"Component '%@' re-registered bubbling event '%@' as a "
|
|
1536
|
+
@"Component '%@' re-registered bubbling event '%@' (originally registered by '%@') as a "
|
|
1534
1537
|
"direct event",
|
|
1535
|
-
|
|
1536
|
-
eventName
|
|
1538
|
+
componentName,
|
|
1539
|
+
eventName,
|
|
1540
|
+
registrationCache[eventName] ?: @"<unknown>"); // TODO(macOS GH#774)
|
|
1537
1541
|
}
|
|
1542
|
+
registrationCache[eventName] = componentName; // TODO(macOS GH#774)
|
|
1538
1543
|
}
|
|
1539
1544
|
|
|
1540
1545
|
// Add bubbling events
|
|
@@ -1551,11 +1556,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1551
1556
|
bubblingEventTypes[eventName] = bubblingEvents[eventName];
|
|
1552
1557
|
if (RCT_DEBUG && directEvents[eventName]) {
|
|
1553
1558
|
RCTLogError(
|
|
1554
|
-
@"Component '%@' re-registered direct event '%@' as a "
|
|
1559
|
+
@"Component '%@' re-registered direct event '%@' (originally registered by '%@') as a "
|
|
1555
1560
|
"bubbling event",
|
|
1556
|
-
|
|
1557
|
-
eventName
|
|
1561
|
+
componentName,
|
|
1562
|
+
eventName,
|
|
1563
|
+
registrationCache[eventName] ?: @"<unknown>"); // TODO(macOS GH#774)
|
|
1558
1564
|
}
|
|
1565
|
+
registrationCache[eventName] = componentName; // TODO(macOS GH#774)
|
|
1559
1566
|
}
|
|
1560
1567
|
|
|
1561
1568
|
return moduleConstants;
|
|
@@ -1571,12 +1578,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1571
1578
|
NSMutableDictionary<NSString *, NSDictionary *> *constants = [NSMutableDictionary new];
|
|
1572
1579
|
NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
|
|
1573
1580
|
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
|
|
1581
|
+
NSMutableDictionary<NSString *, NSString *> *registrationCache = [NSMutableDictionary new]; // TODO(macOS GH#774)
|
|
1574
1582
|
|
|
1575
1583
|
[_componentDataByName
|
|
1576
1584
|
enumerateKeysAndObjectsUsingBlock:^(NSString *name, RCTComponentData *componentData, __unused BOOL *stop) {
|
|
1577
1585
|
RCTAssert(!constants[name], @"UIManager already has constants for %@", componentData.name);
|
|
1578
1586
|
NSMutableDictionary<NSString *, id> *moduleConstants =
|
|
1579
|
-
moduleConstantsForComponent(directEvents, bubblingEvents, componentData);
|
|
1587
|
+
moduleConstantsForComponent(directEvents, bubblingEvents, registrationCache, componentData); // TODO(macOS GH#774)
|
|
1580
1588
|
constants[name] = moduleConstants;
|
|
1581
1589
|
}];
|
|
1582
1590
|
|
|
@@ -1621,10 +1629,11 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(lazilyLoadView : (NSString *)name)
|
|
|
1621
1629
|
bridge:self.bridge
|
|
1622
1630
|
eventDispatcher:self.bridge.eventDispatcher];
|
|
1623
1631
|
_componentDataByName[componentData.name] = componentData;
|
|
1624
|
-
NSMutableDictionary *directEvents = [NSMutableDictionary new];
|
|
1625
|
-
NSMutableDictionary *bubblingEvents = [NSMutableDictionary new];
|
|
1632
|
+
NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
|
|
1633
|
+
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
|
|
1634
|
+
NSMutableDictionary<NSString *, NSString *> *registrationCache = [NSMutableDictionary new]; // TODO(macOS GH#774)
|
|
1626
1635
|
NSMutableDictionary<NSString *, id> *moduleConstants =
|
|
1627
|
-
moduleConstantsForComponent(directEvents, bubblingEvents, componentData);
|
|
1636
|
+
moduleConstantsForComponent(directEvents, bubblingEvents, registrationCache, componentData); // TODO(macOS GH#774)
|
|
1628
1637
|
return @{
|
|
1629
1638
|
@"viewConfig" : moduleConstants,
|
|
1630
1639
|
};
|
package/React/Views/RCTFont.mm
CHANGED
|
@@ -11,18 +11,16 @@
|
|
|
11
11
|
|
|
12
12
|
#import <CoreText/CoreText.h>
|
|
13
13
|
|
|
14
|
-
#import <mutex>
|
|
15
|
-
|
|
16
14
|
typedef CGFloat RCTFontWeight;
|
|
17
15
|
static RCTFontWeight weightOfFont(UIFont *font)
|
|
18
16
|
{
|
|
19
|
-
static NSArray *
|
|
20
|
-
static NSArray *fontWeights;
|
|
17
|
+
static NSArray<NSString *> *weightSuffixes;
|
|
18
|
+
static NSArray<NSNumber *> *fontWeights;
|
|
21
19
|
static dispatch_once_t onceToken;
|
|
22
20
|
dispatch_once(&onceToken, ^{
|
|
23
21
|
// We use two arrays instead of one map because
|
|
24
22
|
// the order is important for suffix matching.
|
|
25
|
-
|
|
23
|
+
weightSuffixes = @[
|
|
26
24
|
@"normal",
|
|
27
25
|
@"ultralight",
|
|
28
26
|
@"thin",
|
|
@@ -54,28 +52,29 @@ static RCTFontWeight weightOfFont(UIFont *font)
|
|
|
54
52
|
];
|
|
55
53
|
});
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
NSString *fontName = font.fontName;
|
|
56
|
+
NSInteger i = 0;
|
|
57
|
+
for (NSString *suffix in weightSuffixes) {
|
|
58
|
+
// CFStringFind is much faster than any variant of rangeOfString: because it does not use a locale.
|
|
59
|
+
auto options = kCFCompareCaseInsensitive | kCFCompareAnchored | kCFCompareBackwards;
|
|
60
|
+
if (CFStringFind((CFStringRef)fontName, (CFStringRef)suffix, options).location != kCFNotFound) {
|
|
61
|
+
return (RCTFontWeight)fontWeights[i].doubleValue;
|
|
60
62
|
}
|
|
63
|
+
i++;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
|
|
66
|
+
auto traits = (__bridge_transfer NSDictionary *)CTFontCopyTraits((CTFontRef)font);
|
|
64
67
|
return (RCTFontWeight)[traits[UIFontWeightTrait] doubleValue];
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
static BOOL isItalicFont(UIFont *font)
|
|
68
71
|
{
|
|
69
|
-
|
|
70
|
-
UIFontDescriptorSymbolicTraits symbolicTraits = [traits[UIFontSymbolicTrait] unsignedIntValue];
|
|
71
|
-
return (symbolicTraits & UIFontDescriptorTraitItalic) != 0;
|
|
72
|
+
return (CTFontGetSymbolicTraits((CTFontRef)font) & kCTFontTraitItalic) != 0;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
static BOOL isCondensedFont(UIFont *font)
|
|
75
76
|
{
|
|
76
|
-
|
|
77
|
-
UIFontDescriptorSymbolicTraits symbolicTraits = [traits[UIFontSymbolicTrait] unsignedIntValue];
|
|
78
|
-
return (symbolicTraits & UIFontDescriptorTraitCondensed) != 0;
|
|
77
|
+
return (CTFontGetSymbolicTraits((CTFontRef)font) & kCTFontTraitCondensed) != 0;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
static RCTFontHandler defaultFontHandler;
|
|
@@ -130,18 +129,16 @@ static NSString *FontWeightDescriptionFromUIFontWeight(UIFontWeight fontWeight)
|
|
|
130
129
|
|
|
131
130
|
static UIFont *cachedSystemFont(CGFloat size, RCTFontWeight weight)
|
|
132
131
|
{
|
|
133
|
-
static NSCache *fontCache;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
font = [fontCache objectForKey:cacheKey];
|
|
144
|
-
}
|
|
132
|
+
static NSCache<NSValue *, UIFont *> *fontCache = [NSCache new];
|
|
133
|
+
|
|
134
|
+
struct __attribute__((__packed__)) CacheKey {
|
|
135
|
+
CGFloat size;
|
|
136
|
+
RCTFontWeight weight;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
CacheKey key{size, weight};
|
|
140
|
+
NSValue *cacheKey = [[NSValue alloc] initWithBytes:&key objCType:@encode(CacheKey)];
|
|
141
|
+
UIFont *font = [fontCache objectForKey:cacheKey];
|
|
145
142
|
|
|
146
143
|
if (!font) {
|
|
147
144
|
if (defaultFontHandler) {
|
|
@@ -157,27 +154,43 @@ static UIFont *cachedSystemFont(CGFloat size, RCTFontWeight weight)
|
|
|
157
154
|
font = [UIFont systemFontOfSize:size weight:weight];
|
|
158
155
|
}
|
|
159
156
|
|
|
160
|
-
|
|
161
|
-
std::lock_guard<std::mutex> lock(*fontCacheMutex);
|
|
162
|
-
[fontCache setObject:font forKey:cacheKey];
|
|
163
|
-
}
|
|
157
|
+
[fontCache setObject:font forKey:cacheKey];
|
|
164
158
|
}
|
|
165
159
|
|
|
166
160
|
return font;
|
|
167
161
|
}
|
|
168
162
|
|
|
169
|
-
|
|
163
|
+
// Caching wrapper around expensive +[UIFont fontNamesForFamilyName:]
|
|
164
|
+
static NSArray<NSString *> *fontNamesForFamilyName(NSString *familyName)
|
|
170
165
|
{
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
static NSCache<NSString *, NSArray<NSString *> *> *cache;
|
|
167
|
+
static dispatch_once_t onceToken;
|
|
168
|
+
dispatch_once(&onceToken, ^{
|
|
169
|
+
cache = [NSCache new];
|
|
170
|
+
[NSNotificationCenter.defaultCenter
|
|
171
|
+
addObserverForName:(NSNotificationName)kCTFontManagerRegisteredFontsChangedNotification
|
|
172
|
+
object:nil
|
|
173
|
+
queue:nil
|
|
174
|
+
usingBlock:^(NSNotification *) {
|
|
175
|
+
[cache removeAllObjects];
|
|
176
|
+
}];
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
auto names = [cache objectForKey:familyName];
|
|
180
|
+
if (!names) {
|
|
181
|
+
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
182
|
+
names = [UIFont fontNamesForFamilyName:familyName] ?: [NSArray new];
|
|
173
183
|
#else
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
NSMutableArray<NSString *> *fontNames = [NSMutableArray array];
|
|
185
|
+
for (NSArray *fontSettings in [[NSFontManager sharedFontManager] availableMembersOfFontFamily:familyName]) {
|
|
186
|
+
[fontNames addObject:fontSettings[0]];
|
|
187
|
+
}
|
|
188
|
+
names = fontNames;
|
|
189
|
+
#endif // ]TODO(macOS GH#774)
|
|
190
|
+
[cache setObject:names forKey:familyName];
|
|
177
191
|
}
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
} // ]TODO(macOS GH#774)
|
|
192
|
+
return names;
|
|
193
|
+
}
|
|
181
194
|
|
|
182
195
|
@implementation RCTConvert (RCTFont)
|
|
183
196
|
|
|
@@ -334,7 +347,7 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
|
|
|
334
347
|
|
|
335
348
|
// Gracefully handle being given a font name rather than font family, for
|
|
336
349
|
// example: "Helvetica Light Oblique" rather than just "Helvetica".
|
|
337
|
-
if (!didFindFont && fontNamesForFamilyName(familyName).count == 0) {
|
|
350
|
+
if (!didFindFont && fontNamesForFamilyName(familyName).count == 0) {
|
|
338
351
|
font = [UIFont fontWithName:familyName size:fontSize];
|
|
339
352
|
if (font) {
|
|
340
353
|
// It's actually a font name, not a font family name,
|
|
@@ -361,7 +374,8 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
|
|
|
361
374
|
|
|
362
375
|
// Get the closest font that matches the given weight for the fontFamily
|
|
363
376
|
CGFloat closestWeight = INFINITY;
|
|
364
|
-
|
|
377
|
+
NSArray<NSString *> *names = fontNamesForFamilyName(familyName);
|
|
378
|
+
for (NSString *name in names) {
|
|
365
379
|
UIFont *match = [UIFont fontWithName:name size:fontSize];
|
|
366
380
|
if (isItalic == isItalicFont(match) && isCondensed == isCondensedFont(match)) {
|
|
367
381
|
CGFloat testWeight = weightOfFont(match);
|
|
@@ -374,11 +388,8 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
|
|
|
374
388
|
|
|
375
389
|
// If we still don't have a match at least return the first font in the fontFamily
|
|
376
390
|
// This is to support built-in font Zapfino and other custom single font families like Impact
|
|
377
|
-
if (!font) {
|
|
378
|
-
|
|
379
|
-
if (names.count > 0) {
|
|
380
|
-
font = [UIFont fontWithName:names[0] size:fontSize];
|
|
381
|
-
}
|
|
391
|
+
if (!font && names.count > 0) {
|
|
392
|
+
font = [UIFont fontWithName:names[0] size:fontSize];
|
|
382
393
|
}
|
|
383
394
|
|
|
384
395
|
// Apply font variants to font object
|
|
@@ -52,7 +52,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
|
|
|
52
52
|
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
53
53
|
float pixelsInPoint = RCTScreenScale();
|
|
54
54
|
#else
|
|
55
|
-
float pixelsInPoint =
|
|
55
|
+
float pixelsInPoint = 1; // TODO(ISS#1656079): Use 1x alignment for macOS until we can use backing resolution
|
|
56
56
|
#endif // ]TODO(macOS GH#774)
|
|
57
57
|
YGConfigSetPointScaleFactor(yogaConfig, pixelsInPoint);
|
|
58
58
|
YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
|
|
@@ -393,6 +393,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
|
|
|
393
393
|
return self.reactTag;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
396
397
|
- (NSString *)description
|
|
397
398
|
{
|
|
398
399
|
NSString *description = super.description;
|
|
@@ -403,6 +404,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
|
|
|
403
404
|
NSStringFromCGRect(self.layoutMetrics.frame)];
|
|
404
405
|
return description;
|
|
405
406
|
}
|
|
407
|
+
#endif // TODO(macOS GH#774)
|
|
406
408
|
|
|
407
409
|
- (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level
|
|
408
410
|
{
|
package/React/Views/RCTView.m
CHANGED
|
@@ -711,17 +711,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
711
711
|
}
|
|
712
712
|
#endif // ]TODO(macOS GH#774)
|
|
713
713
|
|
|
714
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
714
715
|
- (NSString *)description
|
|
715
716
|
{
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
if (semicolonRange.location == NSNotFound) { // [TODO(macOS GH#774)
|
|
719
|
-
return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; reactTag: %@; frame = %@; layer = %@>", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
|
|
720
|
-
} else { // ]TODO(macOS GH#774)
|
|
721
|
-
NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@;", self.reactTag];
|
|
722
|
-
return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
|
|
723
|
-
} // TODO(macOS GH#774)
|
|
717
|
+
// TODO(macOS GH#774): we shouldn't make assumptions on what super's description is. Just append additional content.
|
|
718
|
+
return [[super description] stringByAppendingFormat:@" reactTag: %@; frame = %@; layer = %@", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
|
|
724
719
|
}
|
|
720
|
+
#endif // TODO(macOS GH#774)
|
|
725
721
|
|
|
726
722
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
727
723
|
- (void)viewDidMoveToWindow
|
|
@@ -58,7 +58,7 @@ RCT_MULTI_ENUM_CONVERTER(
|
|
|
58
58
|
@"menu" : @(UIAccessibilityTraitNone),
|
|
59
59
|
@"menubar" : @(UIAccessibilityTraitNone),
|
|
60
60
|
@"menuitem" : @(UIAccessibilityTraitNone),
|
|
61
|
-
@"progressbar" : @(
|
|
61
|
+
@"progressbar" : @(UIAccessibilityTraitUpdatesFrequently),
|
|
62
62
|
@"radio" : @(UIAccessibilityTraitNone),
|
|
63
63
|
@"radiogroup" : @(UIAccessibilityTraitNone),
|
|
64
64
|
@"scrollbar" : @(UIAccessibilityTraitNone),
|
|
@@ -233,7 +233,8 @@ RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView)
|
|
|
233
233
|
const UIAccessibilityTraits AccessibilityRolesMask = UIAccessibilityTraitNone | UIAccessibilityTraitButton |
|
|
234
234
|
UIAccessibilityTraitLink | UIAccessibilityTraitSearchField | UIAccessibilityTraitImage |
|
|
235
235
|
UIAccessibilityTraitKeyboardKey | UIAccessibilityTraitStaticText | UIAccessibilityTraitAdjustable |
|
|
236
|
-
UIAccessibilityTraitHeader | UIAccessibilityTraitSummaryElement |
|
|
236
|
+
UIAccessibilityTraitHeader | UIAccessibilityTraitSummaryElement | UIAccessibilityTraitTabBar |
|
|
237
|
+
UIAccessibilityTraitUpdatesFrequently | SwitchAccessibilityTrait;
|
|
237
238
|
view.reactAccessibilityElement.accessibilityTraits =
|
|
238
239
|
view.reactAccessibilityElement.accessibilityTraits & ~AccessibilityRolesMask;
|
|
239
240
|
UIAccessibilityTraits newTraits = json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
|
|
31
31
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
32
32
|
|
|
33
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
33
34
|
- (NSString *)description
|
|
34
35
|
{
|
|
35
36
|
NSString *superDescription = [super description];
|
|
@@ -44,6 +45,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
|
44
45
|
NSStringFromUIEdgeInsets([self safeAreaInsetsIfSupportedAndEnabled]),
|
|
45
46
|
NSStringFromUIEdgeInsets(_currentSafeAreaInsets)];
|
|
46
47
|
}
|
|
48
|
+
#endif // TODO(macOS GH#774)
|
|
47
49
|
|
|
48
50
|
- (BOOL)isSupportedByOS
|
|
49
51
|
{
|
|
@@ -14,8 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
14
14
|
@property (nonatomic, assign) CGFloat horizontalScrollerHeight;
|
|
15
15
|
@property (nonatomic, assign) CGFloat verticalScrollerWidth;
|
|
16
16
|
|
|
17
|
-
- (instancetype)
|
|
18
|
-
|
|
17
|
+
- (instancetype)initWithVerticalScrollerWidth:(CGFloat)verticalScrollerWidth
|
|
18
|
+
horizontalScrollerHeight:(CGFloat)horizontalScrollerHeight;
|
|
19
19
|
|
|
20
20
|
@end
|
|
21
21
|
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
@implementation RCTScrollContentLocalData
|
|
11
11
|
|
|
12
|
-
- (instancetype)
|
|
13
|
-
|
|
12
|
+
- (instancetype)initWithVerticalScrollerWidth:(CGFloat)verticalScrollerWidth
|
|
13
|
+
horizontalScrollerHeight:(CGFloat)horizontalScrollerHeight;
|
|
14
14
|
{
|
|
15
15
|
if (self = [super init]) {
|
|
16
|
-
_verticalScrollerWidth =
|
|
17
|
-
_horizontalScrollerHeight =
|
|
16
|
+
_verticalScrollerWidth = verticalScrollerWidth;
|
|
17
|
+
_horizontalScrollerHeight = horizontalScrollerHeight;
|
|
18
18
|
}
|
|
19
19
|
return self;
|
|
20
20
|
}
|
|
@@ -18,15 +18,11 @@
|
|
|
18
18
|
#import "RCTScrollView.h"
|
|
19
19
|
|
|
20
20
|
@implementation RCTScrollContentView
|
|
21
|
-
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
22
|
-
{
|
|
23
|
-
BOOL _hasHorizontalScroller;
|
|
24
|
-
BOOL _hasVerticalScroller;
|
|
25
|
-
}
|
|
26
|
-
#endif // ]TODO(macOS GH#774)
|
|
27
21
|
|
|
28
22
|
- (void)reactSetFrame:(CGRect)frame
|
|
29
23
|
{
|
|
24
|
+
[super reactSetFrame:frame];
|
|
25
|
+
|
|
30
26
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
31
27
|
RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview;
|
|
32
28
|
#else // [TODO(macOS GH#774)
|
|
@@ -34,8 +30,6 @@
|
|
|
34
30
|
RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview.superview;
|
|
35
31
|
#endif // ]TODO(macOS GH#774)
|
|
36
32
|
|
|
37
|
-
[super reactSetFrame:frame];
|
|
38
|
-
|
|
39
33
|
if (!scrollView) {
|
|
40
34
|
return;
|
|
41
35
|
}
|
|
@@ -43,7 +37,6 @@
|
|
|
43
37
|
RCTAssert([scrollView isKindOfClass:[RCTScrollView class]], @"Unexpected view hierarchy of RCTScrollView component.");
|
|
44
38
|
|
|
45
39
|
[scrollView updateContentSizeIfNeeded];
|
|
46
|
-
|
|
47
40
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
48
41
|
// On macOS scroll indicators may float over the content view like they do in iOS
|
|
49
42
|
// or depending on system preferences they may be outside of the content view
|
|
@@ -52,21 +45,14 @@
|
|
|
52
45
|
// the contents will overflow causing the scroll indicators to appear unnecessarily.
|
|
53
46
|
NSScrollView *platformScrollView = [scrollView scrollView];
|
|
54
47
|
if ([platformScrollView scrollerStyle] == NSScrollerStyleLegacy) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
RCTScrollContentLocalData *localData =
|
|
65
|
-
[[RCTScrollContentLocalData alloc]
|
|
66
|
-
initWithVerticalScroller:[platformScrollView verticalScroller]
|
|
67
|
-
horizontalScroller:[platformScrollView horizontalScroller]];
|
|
68
|
-
[[[scrollView bridge] uiManager] setLocalData:localData forView:self];
|
|
69
|
-
}
|
|
48
|
+
CGFloat horizontalScrollerHeight = [platformScrollView hasHorizontalScroller] ? NSHeight([[platformScrollView horizontalScroller] frame]) : 0;
|
|
49
|
+
CGFloat verticalScrollerWidth = [platformScrollView hasVerticalScroller] ? NSWidth([[platformScrollView verticalScroller] frame]) : 0;
|
|
50
|
+
|
|
51
|
+
RCTScrollContentLocalData *localData =
|
|
52
|
+
[[RCTScrollContentLocalData alloc]
|
|
53
|
+
initWithVerticalScrollerWidth:horizontalScrollerHeight
|
|
54
|
+
horizontalScrollerHeight:verticalScrollerWidth];
|
|
55
|
+
[[[scrollView bridge] uiManager] setLocalData:localData forView:self];
|
|
70
56
|
}
|
|
71
57
|
#endif // ]TODO(macOS GH#774)
|
|
72
58
|
}
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
self.scrollEnabled = YES;
|
|
57
57
|
self.hasHorizontalScroller = YES;
|
|
58
58
|
self.hasVerticalScroller = YES;
|
|
59
|
+
self.autohidesScrollers = YES;
|
|
59
60
|
self.panGestureRecognizer = [[NSPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleCustomPan:)];
|
|
60
61
|
#else // ]TODO(macOS GH#774)
|
|
61
62
|
[self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];
|
|
@@ -642,11 +643,6 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(
|
|
|
642
643
|
[self react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView];
|
|
643
644
|
_lastClippedToRect = bounds;
|
|
644
645
|
}
|
|
645
|
-
|
|
646
|
-
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
647
|
-
[[self scrollView] setHasHorizontalScroller:[self isHorizontal:_scrollView]];
|
|
648
|
-
[[self scrollView] setHasVerticalScroller:[self isVertical:_scrollView]];
|
|
649
|
-
#endif // ]TODO(macOS GH#774)
|
|
650
646
|
}
|
|
651
647
|
|
|
652
648
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
plugins {
|
|
9
9
|
id("com.android.library")
|
|
10
|
-
id("com.facebook.react
|
|
10
|
+
id("com.facebook.react")
|
|
11
11
|
id("maven-publish")
|
|
12
12
|
id("de.undercouch.download")
|
|
13
13
|
}
|
|
@@ -56,7 +56,6 @@ task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
|
|
|
56
56
|
|
|
57
57
|
task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {
|
|
58
58
|
from(boostPath ?: tarTree(resources.gzip(downloadBoost.dest)))
|
|
59
|
-
from("src/main/jni/third-party/boost/Android.mk")
|
|
60
59
|
from("src/main/jni/third-party/boost")
|
|
61
60
|
include("Android.mk", "boost_${BOOST_VERSION}/boost/**/*.hpp", "boost/boost/**/*.hpp", "asm/**/*.S")
|
|
62
61
|
includeEmptyDirs = false
|
|
@@ -171,6 +170,7 @@ task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) {
|
|
|
171
170
|
// Prepare glog sources to be compiled, this task will perform steps that normally should've been
|
|
172
171
|
// executed by automake. This way we can avoid dependencies on make/automake
|
|
173
172
|
task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) {
|
|
173
|
+
duplicatesStrategy("warn")
|
|
174
174
|
from(dependenciesPath ?: tarTree(downloadGlog.dest))
|
|
175
175
|
from("src/main/jni/third-party/glog/")
|
|
176
176
|
include("glog-${GLOG_VERSION}/src/**/*", "Android.mk", "config.h")
|
|
@@ -362,7 +362,8 @@ def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
|
|
|
362
362
|
inputs.dir("src/main/java/com/facebook/react/turbomodule/core/jni")
|
|
363
363
|
inputs.dir("src/main/java/com/facebook/react/modules/blob")
|
|
364
364
|
outputs.dir("$buildDir/react-ndk/all")
|
|
365
|
-
|
|
365
|
+
def commandLineArgs = [
|
|
366
|
+
getNdkBuildFullPath(),
|
|
366
367
|
"APP_ABI=${reactNativeArchitectures()}",
|
|
367
368
|
"NDK_DEBUG=" + (nativeBuildType.equalsIgnoreCase("debug") ? "1" : "0"),
|
|
368
369
|
"NDK_PROJECT_PATH=null",
|
|
@@ -375,7 +376,12 @@ def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
|
|
|
375
376
|
"REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react",
|
|
376
377
|
"-C", file("src/main/jni/react/jni").absolutePath,
|
|
377
378
|
"--jobs", project.findProperty("jobs") ?: Runtime.runtime.availableProcessors()
|
|
378
|
-
|
|
379
|
+
]
|
|
380
|
+
if (Os.isFamily(Os.FAMILY_MAC)) {
|
|
381
|
+
// This flag will suppress "fcntl(): Bad file descriptor" warnings on local builds.
|
|
382
|
+
commandLineArgs.add("--output-sync=none")
|
|
383
|
+
}
|
|
384
|
+
commandLine(commandLineArgs)
|
|
379
385
|
}
|
|
380
386
|
|
|
381
387
|
def cleanReactNdkLib = tasks.register("cleanReactNdkLib", Exec) {
|
|
@@ -530,12 +536,12 @@ dependencies {
|
|
|
530
536
|
androidTestImplementation("org.mockito:mockito-core:${MOCKITO_CORE_VERSION}")
|
|
531
537
|
}
|
|
532
538
|
|
|
533
|
-
|
|
539
|
+
reactApp {
|
|
534
540
|
// TODO: The library name is chosen for parity with Fabric components & iOS
|
|
535
541
|
// This should be changed to a more generic name, e.g. `ReactCoreSpec`.
|
|
536
542
|
libraryName = "rncore"
|
|
537
543
|
jsRootDir = file("../Libraries")
|
|
538
|
-
|
|
544
|
+
reactRoot = file("$projectDir/..")
|
|
539
545
|
useJavaGenerator = System.getenv("USE_CODEGEN_JAVAPOET") ?: false
|
|
540
546
|
}
|
|
541
547
|
|
|
@@ -25,7 +25,6 @@ rn_android_library(
|
|
|
25
25
|
react_native_target("java/com/facebook/react/module/annotations:annotations"),
|
|
26
26
|
react_native_target("java/com/facebook/react/modules/appstate:appstate"),
|
|
27
27
|
react_native_target("java/com/facebook/react/modules/core:core"),
|
|
28
|
-
react_native_target("java/com/facebook/react/modules/datepicker:datepicker"),
|
|
29
28
|
react_native_target("java/com/facebook/react/modules/deviceinfo:deviceinfo"),
|
|
30
29
|
react_native_target("java/com/facebook/react/modules/share:share"),
|
|
31
30
|
react_native_target("java/com/facebook/react/modules/systeminfo:systeminfo"),
|