Make macOS build
This commit is contained in:
Родитель
055fbdf3ee
Коммит
8ed4bc1e33
|
@ -202,6 +202,11 @@ namespace JS {
|
|||
NSString *cancelButtonKey() const;
|
||||
NSString *destructiveButtonKey() const;
|
||||
NSString *keyboardType() const;
|
||||
#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
|
||||
bool critical() const;
|
||||
bool modal() const;
|
||||
folly::Optional<facebook::react::LazyVector<id<NSObject>>> defaultInputs() const;
|
||||
#endif // ]TODO(macOS ISS#2323203)b
|
||||
|
||||
Args(NSDictionary *const v) : _v(v) {}
|
||||
private:
|
||||
|
@ -3040,6 +3045,23 @@ inline NSString *JS::NativeAlertManager::Args::keyboardType() const
|
|||
id const p = _v[@"keyboardType"];
|
||||
return RCTBridgingToString(p);
|
||||
}
|
||||
#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
|
||||
inline bool JS::NativeAlertManager::Args::critical() const
|
||||
{
|
||||
id const p = _v[@"critical"];
|
||||
return RCTBridgingToBool(p);
|
||||
}
|
||||
inline bool JS::NativeAlertManager::Args::modal() const
|
||||
{
|
||||
id const p = _v[@"modal"];
|
||||
return RCTBridgingToBool(p);
|
||||
}
|
||||
inline folly::Optional<facebook::react::LazyVector<id<NSObject>>> JS::NativeAlertManager::Args::defaultInputs() const
|
||||
{
|
||||
id const p = _v[@"defaultInputs"];
|
||||
return RCTBridgingToOptionalVec(p, ^id<NSObject>(id itemValue_0) { return itemValue_0; });
|
||||
}
|
||||
#endif // ]TODO(macOS ISS#2323203)b
|
||||
inline bool JS::NativeAnimatedModule::EndResult::finished() const
|
||||
{
|
||||
id const p = _v[@"finished"];
|
||||
|
|
|
@ -187,8 +187,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
|||
image = [image imageWithRenderingMode:_renderingMode];
|
||||
}
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
if ((_renderingMode == UIImageRenderingModeAlwaysTemplate) != image.template) {
|
||||
image.template = (_renderingMode == UIImageRenderingModeAlwaysTemplate);
|
||||
if ((_renderingMode == UIImageRenderingModeAlwaysTemplate) != [image isTemplate]) {
|
||||
[image setTemplate:(_renderingMode == UIImageRenderingModeAlwaysTemplate)];
|
||||
}
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
|
||||
|
|
|
@ -31,6 +31,10 @@ Pod::Spec.new do |s|
|
|||
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
|
||||
s.source = source
|
||||
s.source_files = "*.{m,mm}"
|
||||
# [TODO(macOS ISS#2323203)
|
||||
s.osx.exclude_files = "RCTLinkingManager.mm"
|
||||
s.osx.source_files = "macos/RCTLinkingManager.m"
|
||||
# ]TODO(macOS ISS#2323203)
|
||||
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
|
||||
s.header_dir = "RCTLinking"
|
||||
s.pod_target_xcconfig = {
|
||||
|
|
|
@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Folly\""
|
||||
}
|
||||
s.frameworks = "MobileCoreServices"
|
||||
s.ios.frameworks = "MobileCoreServices" # TODO(macOS GH#214) - Restrict to iOS
|
||||
|
||||
s.dependency "Folly", folly_version
|
||||
s.dependency "FBReactNativeSpec", version
|
||||
|
|
|
@ -45,11 +45,9 @@ RCT_ENUM_CONVERTER(NSCalendarUnit,
|
|||
|
||||
@end
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
@interface RCTPushNotificationManager () <NativePushNotificationManagerIOSSpec>
|
||||
@property (nonatomic, strong) NSMutableDictionary *remoteNotificationCallbacks;
|
||||
@end
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
|
||||
@implementation RCTConvert (UILocalNotification)
|
||||
|
||||
|
@ -466,18 +464,14 @@ RCT_EXPORT_METHOD(requestPermissions:(JS::NativePushNotificationManagerIOS::Spec
|
|||
[RCTSharedApplication() registerUserNotificationSettings:notificationSettings];
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
NSRemoteNotificationType types = NSRemoteNotificationTypeNone;
|
||||
if (permissions) {
|
||||
if ([RCTConvert BOOL:permissions[@"alert"]]) {
|
||||
types |= NSRemoteNotificationTypeAlert;
|
||||
}
|
||||
if ([RCTConvert BOOL:permissions[@"badge"]]) {
|
||||
types |= NSRemoteNotificationTypeBadge;
|
||||
}
|
||||
if ([RCTConvert BOOL:permissions[@"sound"]]) {
|
||||
types |= NSRemoteNotificationTypeSound;
|
||||
}
|
||||
} else {
|
||||
types = NSRemoteNotificationTypeAlert | NSRemoteNotificationTypeBadge | NSRemoteNotificationTypeSound;
|
||||
if (permissions.alert()) {
|
||||
types |= NSRemoteNotificationTypeAlert;
|
||||
}
|
||||
if (permissions.badge()) {
|
||||
types |= NSRemoteNotificationTypeBadge;
|
||||
}
|
||||
if (permissions.badge()) {
|
||||
types |= NSRemoteNotificationTypeSound;
|
||||
}
|
||||
[RCTSharedApplication() registerForRemoteNotificationTypes:types];
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
|
|
|
@ -103,6 +103,7 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
|
|||
[attributedString replaceCharactersInRange:range withString:newText];
|
||||
[_backedTextInputView setAttributedText:[attributedString copy]];
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
// Setting selection to the end of the replaced text.
|
||||
UITextPosition *position =
|
||||
[_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
|
||||
|
@ -110,6 +111,7 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
|
|||
[_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
|
||||
notifyDelegate:YES];
|
||||
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
[self textFieldDidChange];
|
||||
|
||||
return NO;
|
||||
|
@ -325,12 +327,14 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
|
|||
[attributedString replaceCharactersInRange:range withString:newText];
|
||||
[_backedTextInputView setAttributedText:[attributedString copy]];
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
// Setting selection to the end of the replaced text.
|
||||
UITextPosition *position =
|
||||
[_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
|
||||
offset:(range.location + newText.length)];
|
||||
[_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
|
||||
notifyDelegate:YES];
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
|
||||
[self textViewDidChange:_backedTextInputView];
|
||||
|
||||
|
|
|
@ -230,7 +230,9 @@ static RCTUIColor *defaultPlaceholderTextColor()
|
|||
- (void)setDefaultTextAttributes:(NSDictionary<NSAttributedStringKey, id> *)defaultTextAttributes
|
||||
{
|
||||
_defaultTextAttributes = defaultTextAttributes;
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
[super setDefaultTextAttributes:defaultTextAttributes];
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
[self _updatePlaceholder];
|
||||
}
|
||||
|
||||
|
@ -241,8 +243,13 @@ static RCTUIColor *defaultPlaceholderTextColor()
|
|||
|
||||
- (void)_updatePlaceholder
|
||||
{
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeholder ?: @""
|
||||
attributes:[self _placeholderTextAttributes]];
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
self.placeholderAttributedString = [[NSAttributedString alloc] initWithString:self.placeholder ?: @""
|
||||
attributes:[self _placeholderTextAttributes]];
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
}
|
||||
|
||||
- (BOOL)isEditable
|
||||
|
@ -287,6 +294,9 @@ static RCTUIColor *defaultPlaceholderTextColor()
|
|||
self.attributedText = originalText;
|
||||
}
|
||||
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
|
||||
|
||||
#pragma mark - Placeholder
|
||||
|
||||
- (NSDictionary<NSAttributedStringKey, id> *)_placeholderTextAttributes
|
||||
|
@ -309,6 +319,8 @@ static RCTUIColor *defaultPlaceholderTextColor()
|
|||
|
||||
#pragma mark - Context Menu
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS ISS#2323203)
|
||||
|
||||
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
|
||||
{
|
||||
if (_contextMenuHidden) {
|
||||
|
|
|
@ -466,8 +466,8 @@ SPEC CHECKSUMS:
|
|||
RCTTypeSafety: ede90b8a90e0dd629d19984788d434ae23828a64
|
||||
React: b8f3da30d525b068a54ac964abe933c8ca617dce
|
||||
React-ART: d45ff8a3eb41b11513259371573fe77100d64b79
|
||||
React-Core: bd1d31a06447d4fad4e657c6c2d99e006e6ae92e
|
||||
React-CoreModules: 23c507e49f1c010f776e7e2b7f258b73835bde41
|
||||
React-Core: 33a4fc04428a5b8cb2dd73bd9ffed77e09f9fad2
|
||||
React-CoreModules: 03d31048f14293cca7076cfa5bc4ca474c128a5d
|
||||
React-cxxreact: c190cf3bfc4cf67f5578bd7d1875b1e027d218c7
|
||||
React-jsi: 1e2cdb8a09f8dac172b58882e11229af86d4f708
|
||||
React-jsiexecutor: 3d3137d20b4b1df8d2f23fc51315922fd46d13d3
|
||||
|
@ -476,8 +476,8 @@ SPEC CHECKSUMS:
|
|||
React-RCTAnimation: b65edfef9cfd54789b7ab5aab9974425dc67a983
|
||||
React-RCTBlob: 01d56c23e12074993ef274a55d2c7f9d0e39dc2a
|
||||
React-RCTImage: 4515f301f1812f7bda3a7e0b5473be237c8cec60
|
||||
React-RCTLinking: dad12f504ec7f0539384514ecb8b83ab837acda4
|
||||
React-RCTNetwork: c5e806d73a29181a210d92f3772b255474404aa3
|
||||
React-RCTLinking: 0b6246bfbc4e6e01ebe5cca631ea2917e2ad66d2
|
||||
React-RCTNetwork: 14c6996d9c4695bd03ff94bf1aee8d2dd4eb9000
|
||||
React-RCTPushNotification: 8006d2b1b0d3e1972cae2c97e6708f17ff8479d8
|
||||
React-RCTSettings: 0bc4c586dd2841e6764092ff67081d1047bef8ce
|
||||
React-RCTTest: 537fa13cbf082a64b29fa815dde8a1e03b0e9b9b
|
||||
|
|
|
@ -1813,6 +1813,27 @@
|
|||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/FBLazyVector\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/FBReactNativeSpec\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/RCTRequired\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/RCTTypeSafety\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-Core\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-RCTTest\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-RCTText\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-cxxreact\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-jsi\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-jsiexecutor\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-jsinspector\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/ReactCommon\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/Yoga\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/glog\"",
|
||||
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
||||
"\"$(PODS_ROOT)/Folly\"",
|
||||
);
|
||||
INFOPLIST_FILE = "RNTester-macOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -1847,6 +1868,27 @@
|
|||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/FBLazyVector\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/FBReactNativeSpec\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/RCTRequired\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/RCTTypeSafety\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-Core\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-RCTTest\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-RCTText\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-cxxreact\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-jsi\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-jsiexecutor\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-jsinspector\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/ReactCommon\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/Yoga\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/glog\"",
|
||||
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
||||
"\"$(PODS_ROOT)/Folly\"",
|
||||
);
|
||||
INFOPLIST_FILE = "RNTester-macOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
|
|
@ -63,12 +63,11 @@ Pod::Spec.new do |s|
|
|||
# [TODO(macOS ISS#2323203)
|
||||
"**/MacOS/*"
|
||||
ss.osx.exclude_files = "React/Modules/RCTRedBoxExtraDataViewController.{h,m}",
|
||||
"React/Profiler/{RCTFPSGraph,RCTPerfMonitor}.*",
|
||||
"React/Profiler/RCTProfileTrampoline-{arm,arm64,i386}.S",
|
||||
"React/Base/RCTKeyCommands.*",
|
||||
"React/Base/RCTTV*.*",
|
||||
"React/Base/RCTReloadCommand.*",
|
||||
"React/Views/{RCTModal*,RCTMasked*,RCTTV*,RCTRefreshControl*,RCTWrapperViewController}.*",
|
||||
"React/Views/{RCTModal*,RCTMasked*,RCTTV*,RCTWrapperViewController}.*",
|
||||
"React/Views/RefreshControl/*",
|
||||
"React/Views/SafeAreaView/*"
|
||||
# ]TODO(macOS ISS#2323203)
|
||||
|
||||
|
|
|
@ -366,10 +366,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
|||
// Sanitize the bundle URL
|
||||
_bundleURL = [RCTConvert NSURL:_bundleURL.absoluteString];
|
||||
|
||||
#if !TARGET_OS_OSX
|
||||
RCTExecuteOnMainQueue(^{
|
||||
RCTRegisterReloadCommandListener(self);
|
||||
RCTReloadCommandSetBundleURL(self->_bundleURL);
|
||||
});
|
||||
#endif // !TARGET_OS_OSX
|
||||
|
||||
self.batchedBridge = [[bridgeClass alloc] initWithParentBridge:self];
|
||||
[self.batchedBridge start];
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
#import "RCTReloadCommand.h"
|
||||
|
||||
#import "RCTAssert.h"
|
||||
#if !TARGET_OS_OSX
|
||||
#import "RCTKeyCommands.h"
|
||||
#endif
|
||||
#import "RCTUtils.h"
|
||||
|
||||
static NSHashTable<id<RCTReloadListener>> *listeners;
|
||||
|
@ -28,7 +30,7 @@ void RCTRegisterReloadCommandListener(id<RCTReloadListener> listener)
|
|||
if (!listeners) {
|
||||
listeners = [NSHashTable weakObjectsHashTable];
|
||||
}
|
||||
#if RCT_DEV
|
||||
#if RCT_DEV && !TARGET_OS_OSX
|
||||
RCTAssertMainQueue(); // because registerKeyCommandWithInput: must be called on the main thread
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
|
|
@ -322,6 +322,9 @@ NS_INLINE NSEdgeInsets UIEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat botto
|
|||
// UIImage
|
||||
@compatibility_alias UIImage NSImage;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
CGFloat UIImageGetScale(NSImage *image);
|
||||
|
||||
CGImageRef UIImageGetCGImageRef(NSImage *image);
|
||||
|
|
|
@ -211,6 +211,7 @@ RCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)
|
|||
|
||||
#pragma mark - UITraitCollection updates
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
|
||||
{
|
||||
[super traitCollectionDidChange:previousTraitCollection];
|
||||
|
@ -220,6 +221,7 @@ RCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)
|
|||
RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey: self.traitCollection,
|
||||
}];
|
||||
}
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
|
||||
#pragma mark - Private stuff
|
||||
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
|
||||
Class RCTCoreModulesClassProvider(const char *name) {
|
||||
static std::unordered_map<std::string, Class (*)(void)> sCoreModuleClassMap = {
|
||||
#if !TARGET_OS_OSX // TODO(macOS) = Do we need these?
|
||||
{"AccessibilityManager", RCTAccessibilityManagerCls},
|
||||
{"Appearance", RCTAppearanceCls},
|
||||
#endif // TODO(macOS)
|
||||
{"DeviceInfo", RCTDeviceInfoCls},
|
||||
{"ExceptionsManager", RCTExceptionsManagerCls},
|
||||
{"PlatformConstants", RCTPlatformCls},
|
||||
|
@ -33,11 +35,15 @@ Class RCTCoreModulesClassProvider(const char *name) {
|
|||
{"StatusBarManager", RCTStatusBarManagerCls},
|
||||
{"KeyboardObserver", RCTKeyboardObserverCls},
|
||||
{"AppState", RCTAppStateCls},
|
||||
#if !TARGET_OS_OSX // TODO(macOS) = Do we need these?
|
||||
{"PerfMonitor", RCTPerfMonitorCls},
|
||||
#endif // TODO(macOS)
|
||||
{"DevMenu", RCTDevMenuCls},
|
||||
{"DevSettings", RCTDevSettingsCls},
|
||||
{"RedBox", RCTRedBoxCls},
|
||||
#if !TARGET_OS_OSX // TODO(macOS) = Do we need these?
|
||||
{"LogBox", RCTLogBoxCls},
|
||||
#endif // TODO(macOS)
|
||||
{"TVNavigationEventEmitter", RCTTVNavigationEventEmitterCls},
|
||||
{"WebSocketExecutor", RCTWebSocketExecutorCls},
|
||||
{"WebSocketModule", RCTWebSocketModuleCls},
|
||||
|
|
|
@ -37,7 +37,7 @@ NSSharingServicePickerDelegate
|
|||
#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
|
||||
NSArray<NSSharingService*> *_excludedActivities;
|
||||
NSString *_sharingSubject;
|
||||
RCTResponseErrorBlock _failureCallback;
|
||||
RCTResponseSenderBlock _failureCallback;
|
||||
RCTResponseSenderBlock _successCallback;
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
}
|
||||
|
@ -99,9 +99,11 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions:(JS::NativeActionSheetManager::Spec
|
|||
destructiveButtonIndices = @[destructiveButtonIndex];
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
}
|
||||
|
||||
NSNumber *anchor = [RCTConvert NSNumber:options.anchor() ? @(*options.anchor()) : nil];
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
UIViewController *controller = RCTPresentedViewController();
|
||||
NSNumber *anchor = [RCTConvert NSNumber:options.anchor() ? @(*options.anchor()) : nil];
|
||||
UIColor *tintColor = [RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];
|
||||
|
||||
if (controller == nil) {
|
||||
|
@ -261,26 +263,27 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(JS::NativeActionSheetManager:
|
|||
|
||||
[self presentViewController:shareController onParentViewController:controller anchorViewTag:anchorViewTag];
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
NSArray *excludedActivityTypes = RCTConvertOptionalVecToArray(options.excludedActivityTypes(), ^id(NSString *element) { return element; });
|
||||
NSMutableArray<NSSharingService*> *excludedTypes = [NSMutableArray array];
|
||||
for (NSString *excludeActivityType in [RCTConvert NSStringArray:options[@"excludedActivityTypes"]]) {
|
||||
for (NSString *excludeActivityType in excludedActivityTypes) {
|
||||
NSSharingService *sharingService = [NSSharingService sharingServiceNamed:excludeActivityType];
|
||||
if (sharingService) {
|
||||
[excludedTypes addObject:sharingService];
|
||||
}
|
||||
}
|
||||
_excludedActivities = excludedTypes.copy;
|
||||
_sharingSubject = [RCTConvert NSString:options[@"subject"]];
|
||||
_sharingSubject = options.subject();
|
||||
_failureCallback = failureCallback;
|
||||
_successCallback = successCallback;
|
||||
RCTPlatformView *view = nil;
|
||||
NSNumber *anchorViewTag = [RCTConvert NSNumber:options[@"anchor"]];
|
||||
NSNumber *anchorViewTag = [RCTConvert NSNumber:options.anchor() ? @(*options.anchor()) : nil];
|
||||
if (anchorViewTag) {
|
||||
view = [self.bridge.uiManager viewForReactTag:anchorViewTag];
|
||||
}
|
||||
NSView *contentView = view ?: NSApp.keyWindow.contentView;
|
||||
NSSharingServicePicker *picker = [[NSSharingServicePicker alloc] initWithItems:items];
|
||||
picker.delegate = self;
|
||||
[picker showRelativeToRect:contentView.bounds ofView:contentView preferredEdge:0];
|
||||
[picker showRelativeToRect:contentView.bounds ofView:contentView preferredEdge:NSRectEdgeMinX];
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
}
|
||||
|
||||
|
@ -310,7 +313,7 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(JS::NativeActionSheetManager:
|
|||
|
||||
- (void)sharingService:(NSSharingService *)sharingService didFailToShareItems:(NSArray *)items error:(NSError *)error
|
||||
{
|
||||
_failureCallback(error);
|
||||
_failureCallback(@[RCTJSErrorFromNSError(error)]);
|
||||
}
|
||||
|
||||
- (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items
|
||||
|
|
|
@ -87,9 +87,9 @@ RCT_EXPORT_METHOD(alertWithArgs:(JS::NativeAlertManager::Args &)args
|
|||
NSString *destructiveButtonKey = [RCTConvert NSString:args.destructiveButtonKey()];
|
||||
UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()];
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
BOOL critical = [RCTConvert BOOL:args[@"critical"]];
|
||||
BOOL modal = [RCTConvert BOOL:args[@"modal"]];
|
||||
NSArray<NSDictionary *> *defaultInputs = [RCTConvert NSDictionaryArray:args[@"defaultInputs"]];
|
||||
BOOL critical = args.critical();
|
||||
BOOL modal = args.modal();
|
||||
NSArray<NSDictionary *> *defaultInputs = [RCTConvert NSDictionaryArray:RCTConvertOptionalVecToArray(args.defaultInputs(), ^id(id<NSObject> element) { return element; })];
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
|
||||
if (!title && !message) {
|
||||
|
|
|
@ -267,7 +267,6 @@ RCT_EXPORT_MODULE()
|
|||
[RCTPresentedViewController() presentViewController:alertController
|
||||
animated:YES
|
||||
completion:NULL];
|
||||
}]];
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setMessageText:@"Remote JS Debugger Unavailable"];
|
||||
|
@ -276,6 +275,7 @@ RCT_EXPORT_MODULE()
|
|||
[alert setAlertStyle:NSWarningAlertStyle];
|
||||
[alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:nil];
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
}]];
|
||||
} else {
|
||||
[items addObject:[RCTDevMenuItem
|
||||
buttonItemWithTitleBlock:^NSString * {
|
||||
|
@ -293,7 +293,7 @@ RCT_EXPORT_MODULE()
|
|||
if (devSettings.isNuclideDebuggingAvailable && !devSettings.isDebuggingRemotely) {
|
||||
[items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Debug with Nuclide"
|
||||
handler:^{
|
||||
#if RCT_ENABLE_INSPECTOR
|
||||
#if RCT_ENABLE_INSPECTOR && !TARGET_OS_OSX // TODO(macOS ISS#2323203) - No RCTPresentedViewController on macOS
|
||||
[RCTInspectorDevServerHelper
|
||||
attachDebugger:@"ReactNative"
|
||||
withBundleURL:bridge.bundleURL
|
||||
|
|
|
@ -7,6 +7,15 @@
|
|||
|
||||
#import <React/RCTBridge.h>
|
||||
|
||||
#if !TARGET_OS_OSX // [TODO(macOS ISS#2323203) - RCTExportedDimensions is needed in RCTRootContentView
|
||||
NSDictionary *RCTExportedDimensions(RCTBridge *bridge);
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
NSDictionary *RCTExportedDimensions(RCTPlatformView *rootView);
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
|
||||
@interface RCTDeviceInfo : NSObject <RCTBridgeModule>
|
||||
|
||||
@end
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
@class RCTRedBoxWindow;
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
@interface UIButton (RCTRedBox)
|
||||
|
||||
@property (nonatomic) RCTRedBoxButtonPressHandler rct_handler;
|
||||
|
@ -61,6 +62,7 @@
|
|||
}
|
||||
|
||||
@end
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
|
||||
@protocol RCTRedBoxWindowActionDelegate <NSObject>
|
||||
|
||||
|
@ -571,7 +573,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
|||
});
|
||||
}
|
||||
|
||||
- (void)showErrorMessage:(NSString *)message withStack:(NSArray<RCTJSStackFrame *> *)stack isUpdate:(BOOL)isUpdate
|
||||
- (void)showErrorMessage:(NSString *)message withStack:(NSArray<RCTJSStackFrame *> *)stack isUpdate:(BOOL)isUpdate errorCookie:(int)errorCookie
|
||||
{
|
||||
// Show if this is a new message, or if we're updating the previous message
|
||||
if ((!_visible && !isUpdate) || (_visible && isUpdate && [_lastErrorMessage isEqualToString:message])) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#import <React/RCTLog.h>
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
#if !TARGET_OS_TV && !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
#import <FBReactNativeSpec/FBReactNativeSpec.h>
|
||||
|
||||
@implementation RCTConvert (UIStatusBar)
|
||||
|
@ -59,7 +59,7 @@ RCT_ENUM_CONVERTER(
|
|||
@end
|
||||
#endif
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
#if !TARGET_OS_TV && !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
|
||||
@interface RCTStatusBarManager() <NativeStatusBarManagerIOSSpec>
|
||||
@end
|
||||
|
@ -93,7 +93,7 @@ RCT_EXPORT_MODULE()
|
|||
return @[ @"statusBarFrameDidChange", @"statusBarFrameWillChange" ];
|
||||
}
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
#if !TARGET_OS_TV && !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
|
||||
- (void)startObserving
|
||||
{
|
||||
|
|
|
@ -30,6 +30,10 @@ Pod::Spec.new do |s|
|
|||
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
|
||||
s.source = source
|
||||
s.source_files = "**/*.{c,m,mm,cpp}"
|
||||
# [TODO(macOS ISS#2323203)
|
||||
"**/MacOS/*"
|
||||
s.osx.exclude_files = "{RCTAppearance,RCTLogBox,RCTFPSGraph,RCTPerfMonitor,RCTPlatform}.*"
|
||||
# ]TODO(macOS ISS#2323203)
|
||||
s.header_dir = "CoreModules"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
self.selectedSegmentIndex = selectedIndex; // TODO(macOS ISS#2323203)
|
||||
}
|
||||
|
||||
- (void)setTintColor:(RCTUIColor *)tintColor // TODO(macOS ISS#2323203)
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203) - no concept of tintColor on macOS
|
||||
- (void)setTintColor:(UIColor *)tintColor // TODO(macOS ISS#2323203)
|
||||
{
|
||||
[super setTintColor:tintColor];
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
||||
|
@ -66,6 +67,7 @@
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
|
||||
- (void)didChange
|
||||
{
|
||||
|
|
|
@ -327,6 +327,7 @@
|
|||
#endif // ]TODO(macOS ISS#2323203)
|
||||
}
|
||||
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203) - accessibility on macOS is on the NSCell rather than the NSControl
|
||||
- (void)accessibilityIncrement
|
||||
{
|
||||
[super accessibilityIncrement];
|
||||
|
@ -346,5 +347,6 @@
|
|||
});
|
||||
}
|
||||
}
|
||||
#endif // TODO(macOS ISS#2323203)
|
||||
|
||||
@end
|
||||
|
|
|
@ -45,8 +45,13 @@ RCT_EXPORT_MODULE()
|
|||
|
||||
- (NSDictionary *)getConstants
|
||||
{
|
||||
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
|
||||
UIScreen *mainScreen = UIScreen.mainScreen;
|
||||
CGSize screenSize = mainScreen.bounds.size;
|
||||
#else // [TODO(macOS ISS#2323203)
|
||||
NSScreen *mainScreen = NSScreen.mainScreen;
|
||||
CGSize screenSize = mainScreen.frame.size;
|
||||
#endif // ]TODO(macOS ISS#2323203)
|
||||
|
||||
return @{
|
||||
@"const1" : @YES,
|
||||
|
|
Загрузка…
Ссылка в новой задаче