Use "FRN" prefix over "RCT" for macOS Callout native code (#1120)

* remap some colors

* use FRN for macOS

* Change files

* fix typo

* fix typo
This commit is contained in:
Saad Najmi 2021-11-03 22:39:04 -05:00 коммит произвёл GitHub
Родитель ae20d8c84b
Коммит 10d9d09b2a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 21 добавлений и 11 удалений

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use \"FRN\" prefix over \"RCT\" for macOS Callout native code",
"packageName": "@fluentui-react-native/callout",
"email": "sanajmi@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -19,7 +19,7 @@
<!-- macOS ship -->
<file src="DerivedData\Build\Products\Release\FRNAvatar\libFRNAvatar.a" target="Ship-macosx"/>
<file src="DerivedData\Build\Products\Release\FRNMenuButton\libFRNCallout.a" target="Ship-macosx"/>
<file src="DerivedData\Build\Products\Release\FRNCallout\libFRNCallout.a" target="Ship-macosx"/>
<file src="DerivedData\Build\Products\Release\FRNCheckbox\libFRNCheckbox.a" target="Ship-macosx"/>
<file src="DerivedData\Build\Products\Release\FRNMenuButton\libFRNMenuButton.a" target="Ship-macosx"/>
<file src="DerivedData\Build\Products\Release\FRNRadioButton\libFRNRadioButton.a" target="Ship-macosx"/>

Просмотреть файл

@ -1,7 +1,7 @@
import Foundation
import AppKit
@objc(RCTCalloutView)
@objc(FRNCalloutView)
class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
@objc public var target: NSNumber? {

Просмотреть файл

@ -1,6 +1,6 @@
import Foundation
@objc(RCTCalloutManager)
@objc(FRNCalloutManager)
class CalloutManager: RCTViewManager {
override func view()->NSView! {
return CalloutView(bridge: bridge)

Просмотреть файл

@ -1,6 +1,6 @@
#import <RCTCalloutManager.h>
#import <FRNCalloutManager.h>
@implementation RCTConvert (RCTCalloutAdditions)
@implementation RCTConvert (FRNCalloutAdditions)
// RCTConvert does not properly convert a JS screenRect into a native CGRect/NSRect,
// due to the mismatch of x/y and screenX/screenY. Let's do it manually.
@ -34,7 +34,7 @@ RCT_ENUM_CONVERTER(NSRectEdge, (@{
@end
@interface RCT_EXTERN_MODULE(RCTCalloutManager, RCTViewManager)
@interface RCT_EXTERN_MODULE(FRNCalloutManager, RCTViewManager)
RCT_EXPORT_VIEW_PROPERTY(target, NSNumber)

Просмотреть файл

@ -3,12 +3,15 @@ import { backgroundColorTokens, borderTokens } from '@fluentui-react-native/toke
import { compose, IUseComposeStyling } from '@uifabricshared/foundation-compose';
import { mergeSettings } from '@uifabricshared/foundation-settings';
import * as React from 'react';
import { findNodeHandle } from 'react-native';
import { findNodeHandle, Platform } from 'react-native';
import { settings } from './Callout.settings';
import { calloutName, ICalloutProps, ICalloutSlotProps, ICalloutType } from './Callout.types';
import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
const RCTCallout = ensureNativeComponent('RCTCallout');
const NativeCalloutView = Platform.select({
macos: ensureNativeComponent('FRNCallout'),
default: ensureNativeComponent('RCTCallout'), // win32
});
export const Callout = compose<ICalloutType>({
displayName: calloutName,
@ -39,7 +42,7 @@ export const Callout = compose<ICalloutType>({
},
settings: settings,
slots: {
root: RCTCallout,
root: NativeCalloutView,
},
styles: {
root: [backgroundColorTokens, borderTokens],