[mac/ios] Ensure explicit module imports and fix a few warnings (#3382)
* Add includes * Change files * Fix incorrect module include * Conditionalize import
This commit is contained in:
Родитель
d17060baf0
Коммит
84a30d1594
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/callout",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/experimental-avatar",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/experimental-checkbox",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/experimental-native-font-metrics",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module ",
|
||||
"packageName": "@fluentui-react-native/focus-zone",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/menu-button",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/radio-group",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "none",
|
||||
"comment": "Add explicit module imports",
|
||||
"packageName": "@fluentui-react-native/vibrancy-view",
|
||||
"email": "araje@microsoft.com",
|
||||
"dependentChangeType": "none"
|
||||
}
|
|
@ -1,4 +1,8 @@
|
|||
import AppKit
|
||||
import Foundation
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNCalloutManager)
|
||||
class CalloutManager: RCTViewManager {
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNCalloutView)
|
||||
class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#import <FRNCalloutManager.h>
|
||||
#import "FRNCalloutManager.h"
|
||||
|
||||
@implementation RCTConvert (FRNCalloutAdditions)
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import AppKit
|
||||
|
||||
/// React Native macOS uses a flipped coordinate space by default. Let's stay consistent and
|
||||
/// ensure any views hosting React Native views are also flipped. This helps RCTTouchHandler
|
||||
/// register clicks in the right location.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
import AppKit
|
||||
|
||||
/// NSEvent localMonitors are an _old_ API that requires you to do some memory management yourself.
|
||||
/// You _must_ call `removeMonitor`exactly once per monitor created from. This helper class enforces
|
||||
|
|
|
@ -421,7 +421,7 @@ static BOOL ShouldSkipFocusZone(NSView *view)
|
|||
|
||||
// If the previous view is in a FocusZone, focus on its defaultKeyView
|
||||
// (For FocusZoneActionTab, this is handled by becomeFirstResponder).
|
||||
RCTFocusZone *focusZoneAncestor = GetFocusZoneAncestor(nextViewToFocus);
|
||||
focusZoneAncestor = GetFocusZoneAncestor(nextViewToFocus);
|
||||
NSView *ancestorKeyView = [focusZoneAncestor defaultResponder];
|
||||
if (ancestorKeyView != nil) {
|
||||
nextViewToFocus = [focusZoneAncestor defaultResponder];
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
//
|
||||
|
||||
import AppKit
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNMenuButton)
|
||||
class MenuButton: NSPopUpButton {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
import AppKit
|
||||
import Foundation
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNMenuButtonManager)
|
||||
class MenuButtonManager: RCTViewManager {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
import AppKit
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
class RadioButton: NSButton {
|
||||
|
||||
@objc public var onPress: RCTBubblingEventBlock?
|
||||
|
@ -5,11 +10,11 @@ class RadioButton: NSButton {
|
|||
public override init(frame:NSRect) {
|
||||
super.init(frame: frame)
|
||||
}
|
||||
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
|
||||
@objc public func sendCallback() {
|
||||
self.window?.makeFirstResponder(self)
|
||||
if (onPress != nil) {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
import AppKit
|
||||
import Foundation
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNRadioButtonViewManager)
|
||||
class RadioButtonViewManager: RCTViewManager {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import Foundation
|
||||
import FluentUI
|
||||
import React
|
||||
import UIKit
|
||||
|
||||
@objc(FRNAvatarViewManager)
|
||||
class AvatarViewManager: RCTViewManager {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
import AppKit
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
class Checkbox: NSButton {
|
||||
|
||||
@objc public var onPress: RCTBubblingEventBlock?
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
import AppKit
|
||||
import Foundation
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNCheckboxViewManager)
|
||||
class CheckboxViewManager: RCTViewManager {
|
||||
|
|
|
@ -105,7 +105,7 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(scaleFactorForStyle:(NSString *)styleStri
|
|||
|
||||
#pragma mark - RCTEventEmitter
|
||||
|
||||
- (NSArray<NSString *> *)supportedEvents
|
||||
- (NSArray<NSString *> *_Nullable)supportedEvents
|
||||
{
|
||||
return @[ @"onFontMetricsChanged" ];
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
import AppKit
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
/// React Native macOS inherits some assumptions from React Native on iOS / UIKit.
|
||||
/// This serves as an issue when we want to write our own native components derived from NSView, as we don't
|
||||
/// inherit the "fixes" we need from RCTView to get views working properly.. This subclass "fixes" the minimal amount
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
import AppKit
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNVibrancyView)
|
||||
open class VibrancyView: RCTView {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
import AppKit
|
||||
import Foundation
|
||||
#if USE_REACT_AS_MODULE
|
||||
import React
|
||||
#endif // USE_REACT_AS_MODULE
|
||||
|
||||
@objc(FRNVibrancyViewManager)
|
||||
class VibrancyViewManager: RCTViewManager {
|
||||
|
|
Загрузка…
Ссылка в новой задаче