react-native-macos 0.72.14 → 0.72.16
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/AppDelegate/RCTAppDelegate.h +2 -1
- package/Libraries/AppDelegate/RCTAppDelegate.mm +17 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTUIImageViewAnimated.m +0 -5
- package/Libraries/Network/React-RCTNetwork.podspec +4 -1
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.h +2 -2
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +9 -111
- package/Libraries/Text/React-RCTText.podspec +1 -0
- package/Libraries/Text/Text/RCTTextView.m +7 -15
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +2 -6
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +3 -0
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +2 -0
- package/React/Base/RCTConstants.h +2 -0
- package/React/Base/RCTConstants.m +2 -0
- package/React/Base/RCTConvert.m +2 -0
- package/React/Base/RCTKeyCommands.m +5 -1
- package/React/Base/RCTRootContentView.m +2 -6
- package/React/Base/RCTUIKit.h +4 -2
- package/React/Base/RCTUtils.h +8 -3
- package/React/Base/RCTUtils.m +19 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/macOS/RCTUIKit.m +8 -4
- package/React/CoreModules/RCTDeviceInfo.h +0 -7
- package/React/CoreModules/RCTDeviceInfo.mm +41 -47
- package/React/CoreModules/RCTPerfMonitor.mm +7 -1
- package/React/CoreModules/RCTRedBox.mm +6 -0
- package/React/CoreModules/RCTStatusBarManager.mm +50 -15
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +8 -0
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +4 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +8 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +6 -4
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +7 -15
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +3 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
- package/React/Fabric/RCTSurfacePointerHandler.mm +8 -1
- package/React/Fabric/RCTSurfaceTouchHandler.mm +4 -0
- package/React/Modules/RCTUIManager.m +4 -2
- package/React/UIUtils/RCTUIUtils.h +0 -4
- package/React/UIUtils/RCTUIUtils.m +39 -45
- package/React/Views/RCTActivityIndicatorView.m +8 -4
- package/React/Views/RCTActivityIndicatorViewManager.m +11 -1
- package/React/Views/RCTModalHostView.m +2 -0
- package/React/Views/RCTModalHostViewController.m +8 -0
- package/React/Views/RCTWrapperViewController.m +2 -0
- package/React/Views/ScrollView/RCTScrollView.m +4 -0
- package/React/Views/ScrollView/RCTScrollViewManager.h +2 -0
- package/React/Views/ScrollView/RCTScrollViewManager.m +4 -2
- package/React-Core.podspec +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt +1 -1
- package/ReactCommon/React-Fabric.podspec +1 -0
- package/ReactCommon/ReactCommon.podspec +1 -0
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/React-hermes.podspec +1 -0
- package/ReactCommon/jsi/React-jsi.podspec +1 -0
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -0
- package/ReactCommon/react/bridging/Base.h +2 -3
- package/ReactCommon/react/bridging/Function.h +7 -10
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +0 -1
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +4 -0
- package/package.json +1 -1
- package/scripts/cocoapods/helpers.rb +5 -0
- package/scripts/cocoapods/utils.rb +1 -0
- package/scripts/react_native_pods.rb +9 -1
- package/template/package.json +1 -1
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/SocketRocket.podspec +30 -0
- package/third-party-podspecs/fmt.podspec +25 -0
- package/ReactCommon/butter/function.h +0 -51
|
@@ -195,10 +195,12 @@ RCT_EXPORT_MODULE()
|
|
|
195
195
|
object:[self->_bridge moduleForName:@"AccessibilityManager"
|
|
196
196
|
lazilyLoadIfNecessary:YES]];
|
|
197
197
|
});
|
|
198
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
198
199
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
199
200
|
selector:@selector(namedOrientationDidChange)
|
|
200
201
|
name:UIDeviceOrientationDidChangeNotification
|
|
201
202
|
object:nil];
|
|
203
|
+
#endif // [visionOS]
|
|
202
204
|
[RCTLayoutAnimation initializeStatics];
|
|
203
205
|
#endif // [macOS]
|
|
204
206
|
}
|
|
@@ -228,7 +230,7 @@ RCT_EXPORT_MODULE()
|
|
|
228
230
|
}
|
|
229
231
|
#endif // [macOS]
|
|
230
232
|
|
|
231
|
-
#if
|
|
233
|
+
#if TARGET_OS_IOS // [macOS] [visionOS]
|
|
232
234
|
// Names and coordinate system from html5 spec:
|
|
233
235
|
// https://developer.mozilla.org/en-US/docs/Web/API/Screen.orientation
|
|
234
236
|
// https://developer.mozilla.org/en-US/docs/Web/API/Screen.lockOrientation
|
|
@@ -281,7 +283,7 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
|
|
|
281
283
|
body:orientationEvent];
|
|
282
284
|
#pragma clang diagnostic pop
|
|
283
285
|
}
|
|
284
|
-
#endif // macOS]
|
|
286
|
+
#endif // [macOS] [visionOS]
|
|
285
287
|
|
|
286
288
|
- (dispatch_queue_t)methodQueue
|
|
287
289
|
{
|
|
@@ -22,11 +22,7 @@ typedef struct {
|
|
|
22
22
|
} window, screen;
|
|
23
23
|
} RCTDimensions;
|
|
24
24
|
extern __attribute__((visibility("default")))
|
|
25
|
-
#if !TARGET_OS_OSX // [macOS]
|
|
26
25
|
RCTDimensions RCTGetDimensions(CGFloat fontScale);
|
|
27
|
-
#else // [macOS
|
|
28
|
-
RCTDimensions RCTGetDimensions(RCTPlatformView *rootView);
|
|
29
|
-
#endif // macOS]
|
|
30
26
|
|
|
31
27
|
#if !TARGET_OS_OSX // [macOS]
|
|
32
28
|
// Get font size multiplier for font base size (Large) by content size category
|
|
@@ -9,27 +9,63 @@
|
|
|
9
9
|
|
|
10
10
|
#import "RCTUtils.h"
|
|
11
11
|
|
|
12
|
-
#if !TARGET_OS_OSX // [macOS]
|
|
13
12
|
RCTDimensions RCTGetDimensions(CGFloat fontScale)
|
|
14
13
|
{
|
|
14
|
+
#if !TARGET_OS_OSX // [macOS]
|
|
15
|
+
#if !TARGET_OS_VISION // [visionOS]
|
|
15
16
|
UIScreen *mainScreen = UIScreen.mainScreen;
|
|
16
17
|
CGSize screenSize = mainScreen.bounds.size;
|
|
18
|
+
#else
|
|
19
|
+
CGSize screenSize = CGSizeZero;
|
|
20
|
+
#endif
|
|
21
|
+
#else // [macOS
|
|
22
|
+
NSScreen *mainScreen = NSScreen.mainScreen;
|
|
23
|
+
CGSize screenSize = mainScreen.frame.size;
|
|
24
|
+
#endif // macOS]
|
|
17
25
|
|
|
26
|
+
#if !TARGET_OS_OSX // [macOS]
|
|
18
27
|
UIView *mainWindow = RCTKeyWindow();
|
|
19
28
|
// We fallback to screen size if a key window is not found.
|
|
20
29
|
CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize;
|
|
21
|
-
|
|
30
|
+
#else // [macOS
|
|
31
|
+
NSWindow *window = RCTKeyWindow();
|
|
32
|
+
NSSize windowSize = window ? [window frame].size : CGSizeZero;
|
|
33
|
+
screenSize = window ? [[window screen] frame].size : screenSize;
|
|
34
|
+
CGFloat scale = window ? [[window screen] backingScaleFactor] : 1.0; // Default scale to 1.0 if window is nil
|
|
35
|
+
#endif // macOS]
|
|
36
|
+
|
|
22
37
|
RCTDimensions result;
|
|
38
|
+
#if !TARGET_OS_OSX // [macOS]
|
|
39
|
+
#if !TARGET_OS_VISION // [visionOS]
|
|
23
40
|
typeof(result.screen) dimsScreen = {
|
|
24
41
|
.width = screenSize.width, .height = screenSize.height, .scale = mainScreen.scale, .fontScale = fontScale};
|
|
25
42
|
typeof(result.window) dimsWindow = {
|
|
26
43
|
.width = windowSize.width, .height = windowSize.height, .scale = mainScreen.scale, .fontScale = fontScale};
|
|
44
|
+
#else // [visionOS hardcode the scale to a dummy value of 2
|
|
45
|
+
typeof(result.screen) dimsScreen = {
|
|
46
|
+
.width = screenSize.width, .height = screenSize.height, .scale = 2, .fontScale = fontScale};
|
|
47
|
+
typeof(result.window) dimsWindow = {
|
|
48
|
+
.width = windowSize.width, .height = windowSize.height, .scale = 2, .fontScale = fontScale};
|
|
49
|
+
#endif // visionOS]
|
|
50
|
+
#else // [macOS
|
|
51
|
+
typeof(result.screen) dimsScreen = {
|
|
52
|
+
.width = screenSize.width,
|
|
53
|
+
.height = screenSize.height,
|
|
54
|
+
.scale = scale,
|
|
55
|
+
.fontScale = fontScale};
|
|
56
|
+
typeof(result.window) dimsWindow = {
|
|
57
|
+
.width = windowSize.width,
|
|
58
|
+
.height = windowSize.height,
|
|
59
|
+
.scale = scale,
|
|
60
|
+
.fontScale = fontScale};
|
|
61
|
+
#endif // macOS]
|
|
27
62
|
result.screen = dimsScreen;
|
|
28
63
|
result.window = dimsWindow;
|
|
29
64
|
|
|
30
65
|
return result;
|
|
31
66
|
}
|
|
32
67
|
|
|
68
|
+
#if !TARGET_OS_OSX // [macOS]
|
|
33
69
|
CGFloat RCTGetMultiplierForContentSizeCategory(UIContentSizeCategory category)
|
|
34
70
|
{
|
|
35
71
|
static NSDictionary<NSString *, NSNumber *> *multipliers = nil;
|
|
@@ -54,46 +90,4 @@ CGFloat RCTGetMultiplierForContentSizeCategory(UIContentSizeCategory category)
|
|
|
54
90
|
double value = multipliers[category].doubleValue;
|
|
55
91
|
return value > 0.0 ? value : 1.0;
|
|
56
92
|
}
|
|
57
|
-
|
|
58
|
-
#else // [macOS
|
|
59
|
-
|
|
60
|
-
RCTDimensions RCTGetDimensions(RCTPlatformView *rootView) {
|
|
61
|
-
RCTDimensions dimensions = {
|
|
62
|
-
{ 0, 0, 0, /*fontScale*/ 1 },
|
|
63
|
-
{ 0, 0, 0, /*fontScale*/ 1 }
|
|
64
|
-
};
|
|
65
|
-
NSScreen *screen = nil;
|
|
66
|
-
NSWindow *window = nil;
|
|
67
|
-
NSSize size;
|
|
68
|
-
if (rootView != nil) {
|
|
69
|
-
window = [rootView window];
|
|
70
|
-
size = [rootView frame].size;
|
|
71
|
-
} else {
|
|
72
|
-
// We don't have a root view so fall back to the app's key window
|
|
73
|
-
window = [NSApp keyWindow];
|
|
74
|
-
size = [window frame].size;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (window != nil) {
|
|
78
|
-
screen = [window screen];
|
|
79
|
-
dimensions.window.width = size.width;
|
|
80
|
-
dimensions.window.height = size.height;
|
|
81
|
-
dimensions.window.scale = [window backingScaleFactor];
|
|
82
|
-
} else {
|
|
83
|
-
// We don't have a window yet so make something up
|
|
84
|
-
screen = [NSScreen mainScreen];
|
|
85
|
-
NSSize screenSize = [screen frame].size;
|
|
86
|
-
dimensions.window.width = screenSize.width;
|
|
87
|
-
dimensions.window.height = screenSize.height;
|
|
88
|
-
dimensions.window.scale = [screen backingScaleFactor];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
NSSize screenSize = [screen frame].size;
|
|
92
|
-
dimensions.screen.width = screenSize.width;
|
|
93
|
-
dimensions.screen.height = screenSize.height;
|
|
94
|
-
dimensions.screen.scale = [screen backingScaleFactor];
|
|
95
|
-
|
|
96
|
-
return dimensions;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
#endif // macOS]
|
|
93
|
+
#endif // [macOS]
|
|
@@ -59,11 +59,15 @@
|
|
|
59
59
|
_activityIndicatorViewStyle = activityIndicatorViewStyle;
|
|
60
60
|
|
|
61
61
|
switch (activityIndicatorViewStyle) {
|
|
62
|
-
case
|
|
63
|
-
|
|
62
|
+
case UIActivityIndicatorViewStyleLarge:
|
|
63
|
+
if (@available(macOS 11.0, *)) {
|
|
64
|
+
self.controlSize = NSControlSizeLarge;
|
|
65
|
+
} else {
|
|
66
|
+
self.controlSize = NSControlSizeRegular;
|
|
67
|
+
}
|
|
64
68
|
break;
|
|
65
|
-
case
|
|
66
|
-
self.controlSize =
|
|
69
|
+
case UIActivityIndicatorViewStyleMedium:
|
|
70
|
+
self.controlSize = NSControlSizeRegular;
|
|
67
71
|
break;
|
|
68
72
|
default:
|
|
69
73
|
break;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
// NOTE: It's pointless to support UIActivityIndicatorViewStyleGray
|
|
16
16
|
// as we can set the color to any arbitrary value that we want to
|
|
17
17
|
|
|
18
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
18
19
|
RCT_ENUM_CONVERTER(
|
|
19
20
|
UIActivityIndicatorViewStyle,
|
|
20
21
|
(@{
|
|
@@ -23,7 +24,16 @@ RCT_ENUM_CONVERTER(
|
|
|
23
24
|
}),
|
|
24
25
|
UIActivityIndicatorViewStyleWhiteLarge,
|
|
25
26
|
integerValue)
|
|
26
|
-
|
|
27
|
+
#else // [visionOS
|
|
28
|
+
RCT_ENUM_CONVERTER(
|
|
29
|
+
UIActivityIndicatorViewStyle,
|
|
30
|
+
(@{
|
|
31
|
+
@"large" : @(UIActivityIndicatorViewStyleLarge),
|
|
32
|
+
@"small" : @(UIActivityIndicatorViewStyleMedium),
|
|
33
|
+
}),
|
|
34
|
+
UIActivityIndicatorViewStyleLarge,
|
|
35
|
+
integerValue)
|
|
36
|
+
#endif // visionOS]
|
|
27
37
|
@end
|
|
28
38
|
|
|
29
39
|
@implementation RCTActivityIndicatorViewManager
|
|
@@ -73,6 +73,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : coder)
|
|
|
73
73
|
|
|
74
74
|
- (void)notifyForOrientationChange
|
|
75
75
|
{
|
|
76
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
76
77
|
if (!_onOrientationChange) {
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
@@ -89,6 +90,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : coder)
|
|
|
89
90
|
@"orientation" : isPortrait ? @"portrait" : @"landscape",
|
|
90
91
|
};
|
|
91
92
|
_onOrientationChange(eventPayload);
|
|
93
|
+
#endif // [visionOS]
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
|
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
}
|
|
31
31
|
#endif
|
|
32
32
|
|
|
33
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
33
34
|
_preferredStatusBarStyle = [RCTSharedApplication() statusBarStyle];
|
|
34
35
|
_preferredStatusBarHidden = [RCTSharedApplication() isStatusBarHidden];
|
|
36
|
+
#endif // [visionOS]
|
|
35
37
|
|
|
36
38
|
return self;
|
|
37
39
|
}
|
|
@@ -46,6 +48,7 @@
|
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
49
52
|
- (UIStatusBarStyle)preferredStatusBarStyle
|
|
50
53
|
{
|
|
51
54
|
return _preferredStatusBarStyle;
|
|
@@ -55,12 +58,17 @@
|
|
|
55
58
|
{
|
|
56
59
|
return _preferredStatusBarHidden;
|
|
57
60
|
}
|
|
61
|
+
#endif // [visionOS]
|
|
58
62
|
|
|
59
63
|
#if RCT_DEV
|
|
60
64
|
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
|
|
61
65
|
{
|
|
66
|
+
#if !TARGET_OS_VISION // [visionOS]
|
|
62
67
|
UIInterfaceOrientationMask appSupportedOrientationsMask =
|
|
63
68
|
[RCTSharedApplication() supportedInterfaceOrientationsForWindow:[RCTSharedApplication() keyWindow]];
|
|
69
|
+
#else // [visionOS
|
|
70
|
+
UIInterfaceOrientationMask appSupportedOrientationsMask = UIInterfaceOrientationMaskAll;
|
|
71
|
+
#endif // visionOS]
|
|
64
72
|
if (!(_supportedInterfaceOrientations & appSupportedOrientationsMask)) {
|
|
65
73
|
RCTLogError(
|
|
66
74
|
@"Modal was presented with 0x%x orientations mask but the application only supports 0x%x."
|
|
@@ -1385,7 +1385,9 @@ RCT_SET_AND_PRESERVE_OFFSET(setCanCancelContentTouches, canCancelContentTouches,
|
|
|
1385
1385
|
RCT_SET_AND_PRESERVE_OFFSET(setDecelerationRate, decelerationRate, CGFloat)
|
|
1386
1386
|
RCT_SET_AND_PRESERVE_OFFSET(setDirectionalLockEnabled, isDirectionalLockEnabled, BOOL)
|
|
1387
1387
|
RCT_SET_AND_PRESERVE_OFFSET(setIndicatorStyle, indicatorStyle, UIScrollViewIndicatorStyle)
|
|
1388
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
1388
1389
|
RCT_SET_AND_PRESERVE_OFFSET(setKeyboardDismissMode, keyboardDismissMode, UIScrollViewKeyboardDismissMode)
|
|
1390
|
+
#endif // visionOS]
|
|
1389
1391
|
RCT_SET_AND_PRESERVE_OFFSET(setMaximumZoomScale, maximumZoomScale, CGFloat)
|
|
1390
1392
|
RCT_SET_AND_PRESERVE_OFFSET(setMinimumZoomScale, minimumZoomScale, CGFloat)
|
|
1391
1393
|
#endif // [macOS]
|
|
@@ -1397,7 +1399,9 @@ RCT_SET_AND_PRESERVE_OFFSET(setScrollsToTop, scrollsToTop, BOOL)
|
|
|
1397
1399
|
RCT_SET_AND_PRESERVE_OFFSET(setShowsHorizontalScrollIndicator, showsHorizontalScrollIndicator, BOOL)
|
|
1398
1400
|
RCT_SET_AND_PRESERVE_OFFSET(setShowsVerticalScrollIndicator, showsVerticalScrollIndicator, BOOL)
|
|
1399
1401
|
RCT_SET_AND_PRESERVE_OFFSET(setZoomScale, zoomScale, CGFloat);
|
|
1402
|
+
#if !TARGET_OS_VISION // [visionOS]
|
|
1400
1403
|
RCT_SET_AND_PRESERVE_OFFSET(setScrollIndicatorInsets, scrollIndicatorInsets, UIEdgeInsets);
|
|
1404
|
+
#endif // [visionOS]
|
|
1401
1405
|
|
|
1402
1406
|
#pragma clang diagnostic push // [macOS]
|
|
1403
1407
|
#pragma clang diagnostic ignored "-Wunguarded-availability" // [macOS]
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
#import "RCTShadowView.h"
|
|
13
13
|
#import "RCTUIManager.h"
|
|
14
14
|
|
|
15
|
-
#if
|
|
15
|
+
#if TARGET_OS_IOS // [macOS] [visionOS]
|
|
16
16
|
@implementation RCTConvert (UIScrollView)
|
|
17
17
|
|
|
18
18
|
RCT_ENUM_CONVERTER(
|
|
@@ -49,7 +49,7 @@ RCT_ENUM_CONVERTER(
|
|
|
49
49
|
integerValue)
|
|
50
50
|
|
|
51
51
|
@end
|
|
52
|
-
#endif // [macOS]
|
|
52
|
+
#endif // [macOS] [visionOS]
|
|
53
53
|
|
|
54
54
|
@implementation RCTScrollViewManager
|
|
55
55
|
|
|
@@ -72,7 +72,9 @@ RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(automaticallyAdjustKeyboardInsets, BOOL) // [ma
|
|
|
72
72
|
RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(decelerationRate, CGFloat) // [macOS]
|
|
73
73
|
RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(directionalLockEnabled, BOOL) // [macOS]
|
|
74
74
|
RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(indicatorStyle, UIScrollViewIndicatorStyle) // [macOS]
|
|
75
|
+
#if TARGET_OS_IOS // [visionOS]
|
|
75
76
|
RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(keyboardDismissMode, UIScrollViewKeyboardDismissMode) // [macOS]
|
|
77
|
+
#endif // [visionOS]
|
|
76
78
|
RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(maximumZoomScale, CGFloat) // [macOS]
|
|
77
79
|
RCT_EXPORT_NOT_OSX_VIEW_PROPERTY(minimumZoomScale, CGFloat) // [macOS]
|
|
78
80
|
RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)
|
package/React-Core.podspec
CHANGED
|
@@ -18,7 +18,7 @@ end
|
|
|
18
18
|
|
|
19
19
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
20
20
|
folly_version = '2021.07.22.00'
|
|
21
|
-
socket_rocket_version = '0.7.0' # [macOS]
|
|
21
|
+
socket_rocket_version = '0.7.0' # [macOS] [visionOS]
|
|
22
22
|
boost_compiler_flags = '-Wno-documentation'
|
|
23
23
|
|
|
24
24
|
use_hermes = ENV['USE_HERMES'] == '1'
|
|
@@ -50,6 +50,7 @@ Pod::Spec.new do |s|
|
|
|
50
50
|
s.dependency "React-perflogger", version
|
|
51
51
|
s.dependency "RCT-Folly", folly_version
|
|
52
52
|
s.dependency "DoubleConversion"
|
|
53
|
+
s.dependency "fmt", "9.1.0"
|
|
53
54
|
s.dependency "glog"
|
|
54
55
|
s.dependency "RCT-Folly/Futures", folly_version
|
|
55
56
|
s.dependency "hermes-engine"
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
#include <react/bridging/Convert.h>
|
|
11
11
|
|
|
12
12
|
#include <ReactCommon/CallInvoker.h>
|
|
13
|
-
#include <butter/function.h>
|
|
14
13
|
#include <jsi/jsi.h>
|
|
15
14
|
|
|
16
15
|
#include <cstdint>
|
|
@@ -36,12 +35,12 @@ struct function_wrapper;
|
|
|
36
35
|
|
|
37
36
|
template <typename C, typename R, typename... Args>
|
|
38
37
|
struct function_wrapper<R (C::*)(Args...)> {
|
|
39
|
-
using type =
|
|
38
|
+
using type = std::function<R(Args...)>;
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
template <typename C, typename R, typename... Args>
|
|
43
42
|
struct function_wrapper<R (C::*)(Args...) const> {
|
|
44
|
-
using type =
|
|
43
|
+
using type = std::function<R(Args...)>;
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
template <typename T, typename = void>
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
#include <ReactCommon/SchedulerPriority.h>
|
|
14
14
|
|
|
15
|
-
#include <butter/function.h>
|
|
16
|
-
|
|
17
15
|
namespace facebook::react {
|
|
18
16
|
|
|
19
17
|
template <typename F>
|
|
@@ -169,8 +167,8 @@ struct Bridging<SyncCallback<R(Args...)>> {
|
|
|
169
167
|
};
|
|
170
168
|
|
|
171
169
|
template <typename R, typename... Args>
|
|
172
|
-
struct Bridging<
|
|
173
|
-
using Func =
|
|
170
|
+
struct Bridging<std::function<R(Args...)>> {
|
|
171
|
+
using Func = std::function<R(Args...)>;
|
|
174
172
|
using IndexSequence = std::index_sequence_for<Args...>;
|
|
175
173
|
|
|
176
174
|
static constexpr size_t kArgumentCount = sizeof...(Args);
|
|
@@ -219,15 +217,14 @@ struct Bridging<butter::function<R(Args...)>> {
|
|
|
219
217
|
template <typename R, typename... Args>
|
|
220
218
|
struct Bridging<
|
|
221
219
|
std::function<R(Args...)>,
|
|
222
|
-
std::enable_if_t
|
|
223
|
-
std::function<R(Args...)>,
|
|
224
|
-
|
|
225
|
-
: Bridging<butter::function<R(Args...)>> {};
|
|
220
|
+
std::enable_if_t<
|
|
221
|
+
!std::is_same_v<std::function<R(Args...)>, std::function<R(Args...)>>>>
|
|
222
|
+
: Bridging<std::function<R(Args...)>> {};
|
|
226
223
|
|
|
227
224
|
template <typename R, typename... Args>
|
|
228
|
-
struct Bridging<R(Args...)> : Bridging<
|
|
225
|
+
struct Bridging<R(Args...)> : Bridging<std::function<R(Args...)>> {};
|
|
229
226
|
|
|
230
227
|
template <typename R, typename... Args>
|
|
231
|
-
struct Bridging<R (*)(Args...)> : Bridging<
|
|
228
|
+
struct Bridging<R (*)(Args...)> : Bridging<std::function<R(Args...)>> {};
|
|
232
229
|
|
|
233
230
|
} // namespace facebook::react
|
package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
#include <ReactCommon/TurboModule.h>
|
|
16
16
|
#include <ReactCommon/TurboModulePerfLogger.h>
|
|
17
17
|
#include <ReactCommon/TurboModuleUtils.h>
|
|
18
|
-
#include <butter/function.h>
|
|
19
18
|
#include <jsi/JSIDynamic.h>
|
|
20
19
|
#include <react/debug/react_native_assert.h>
|
|
21
20
|
#include <react/jni/NativeMap.h>
|
package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm
CHANGED
|
@@ -46,8 +46,12 @@ RCT_EXPORT_MODULE()
|
|
|
46
46
|
__block NSDictionary *constants;
|
|
47
47
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
48
48
|
#if !TARGET_OS_OSX // [macOS]
|
|
49
|
+
#if !TARGET_OS_VISION // [visionOS]
|
|
49
50
|
UIScreen *mainScreen = UIScreen.mainScreen;
|
|
50
51
|
CGSize screenSize = mainScreen.bounds.size;
|
|
52
|
+
#else // [visionOS
|
|
53
|
+
CGSize screenSize = CGSizeZero;
|
|
54
|
+
#endif // visionOS]
|
|
51
55
|
#else // [macOS
|
|
52
56
|
NSScreen *mainScreen = NSScreen.mainScreen;
|
|
53
57
|
CGSize screenSize = mainScreen.frame.size;
|
package/package.json
CHANGED
|
@@ -275,6 +275,7 @@ class ReactNativePodsUtils
|
|
|
275
275
|
target_installation_result.native_target.build_configurations.each do |config|
|
|
276
276
|
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
|
|
277
277
|
config.build_settings["MACOSX_DEPLOYMENT_TARGET"] = Helpers::Constants.min_macos_version_supported # [macOS]
|
|
278
|
+
config.build_settings["XROS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_visionos_version_supported # [visionOS]
|
|
278
279
|
end
|
|
279
280
|
end
|
|
280
281
|
end
|
|
@@ -45,11 +45,17 @@ def min_macos_version_supported
|
|
|
45
45
|
end
|
|
46
46
|
# macOS]
|
|
47
47
|
|
|
48
|
+
# [visionOS
|
|
49
|
+
def min_visionos_version_supported
|
|
50
|
+
return Helpers::Constants.min_visionos_version_supported
|
|
51
|
+
end
|
|
52
|
+
# visionOS]
|
|
53
|
+
|
|
48
54
|
# This function returns the min supported OS versions supported by React Native
|
|
49
55
|
# By using this function, you won't have to manually change your Podfile
|
|
50
56
|
# when we change the minimum version supported by the framework.
|
|
51
57
|
def min_supported_versions
|
|
52
|
-
return { :ios => min_ios_version_supported, :osx => min_macos_version_supported } # [macOS]
|
|
58
|
+
return { :ios => min_ios_version_supported, :osx => min_macos_version_supported, :visionos => min_visionos_version_supported } # [macOS] [visionOS]
|
|
53
59
|
end
|
|
54
60
|
|
|
55
61
|
# This function prepares the project for React Native, before processing
|
|
@@ -152,7 +158,9 @@ def use_react_native! (
|
|
|
152
158
|
pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
|
|
153
159
|
pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"
|
|
154
160
|
pod 'boost', :podspec => "#{prefix}/third-party-podspecs/boost.podspec"
|
|
161
|
+
pod 'fmt', :podspec => "#{prefix}/third-party-podspecs/fmt.podspec"
|
|
155
162
|
pod 'RCT-Folly', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec", :modular_headers => true
|
|
163
|
+
pod 'SocketRocket', :podspec => "#{prefix}/third-party-podspecs/SocketRocket.podspec", :modular_headers => true # [visionOS]
|
|
156
164
|
|
|
157
165
|
run_codegen!(
|
|
158
166
|
app_path,
|
package/template/package.json
CHANGED
|
@@ -20,7 +20,7 @@ Pod::Spec.new do |spec|
|
|
|
20
20
|
spec.dependency 'boost'
|
|
21
21
|
spec.dependency 'DoubleConversion'
|
|
22
22
|
spec.dependency 'glog'
|
|
23
|
-
spec.dependency
|
|
23
|
+
spec.dependency "fmt", "9.1.0"
|
|
24
24
|
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_PTHREAD=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -faligned-new'
|
|
25
25
|
spec.source_files = 'folly/String.cpp',
|
|
26
26
|
'folly/Conv.cpp',
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
# [visionOS] Local copy of SocketRocket.podspec with visionOS added as a platform
|
|
7
|
+
|
|
8
|
+
socket_rocket_version = '0.7.0'
|
|
9
|
+
|
|
10
|
+
Pod::Spec.new do |s|
|
|
11
|
+
s.name = 'SocketRocket'
|
|
12
|
+
s.version = socket_rocket_version
|
|
13
|
+
s.summary = 'A conforming WebSocket (RFC 6455) client library for iOS, macOS and tvOS.'
|
|
14
|
+
s.homepage = 'https://github.com/facebook/SocketRocket'
|
|
15
|
+
s.authors = { 'Nikita Lutsenko' => 'nlutsenko@me.com', 'Dan Federman' => 'federman@squareup.com', 'Mike Lewis' => 'mikelikespie@gmail.com' }
|
|
16
|
+
s.license = 'BSD'
|
|
17
|
+
s.source = { :git => 'https://github.com/facebook/SocketRocket.git', :tag => socket_rocket_version }
|
|
18
|
+
s.requires_arc = true
|
|
19
|
+
|
|
20
|
+
s.source_files = 'SocketRocket/**/*.{h,m}'
|
|
21
|
+
s.public_header_files = 'SocketRocket/*.h'
|
|
22
|
+
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
|
|
25
|
+
s.ios.frameworks = 'CFNetwork', 'Security'
|
|
26
|
+
s.osx.frameworks = 'CoreServices', 'Security'
|
|
27
|
+
s.tvos.frameworks = 'CFNetwork', 'Security'
|
|
28
|
+
s.visionos.frameworks = 'CFNetwork', 'Security'
|
|
29
|
+
s.libraries = 'icucore'
|
|
30
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |spec|
|
|
7
|
+
spec.name = "fmt"
|
|
8
|
+
spec.version = "9.1.0"
|
|
9
|
+
spec.license = { :type => "MIT" }
|
|
10
|
+
spec.homepage = "https://github.com/fmtlib/fmt"
|
|
11
|
+
spec.summary = "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams."
|
|
12
|
+
spec.authors = "The fmt contributors"
|
|
13
|
+
spec.source = {
|
|
14
|
+
:git => "https://github.com/fmtlib/fmt.git",
|
|
15
|
+
:tag => "9.1.0"
|
|
16
|
+
}
|
|
17
|
+
spec.pod_target_xcconfig = {
|
|
18
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
19
|
+
}
|
|
20
|
+
spec.platforms = min_supported_versions
|
|
21
|
+
spec.libraries = "c++"
|
|
22
|
+
spec.public_header_files = "include/fmt/*.h"
|
|
23
|
+
spec.header_mappings_dir = "include"
|
|
24
|
+
spec.source_files = ["include/fmt/*.h", "src/format.cc"]
|
|
25
|
+
end
|