iOS: fix up RNTesterPods
Summary: A few fixes: * missing include: folly/Optional.h * switch folly::Optional's `has_value()` to `hasValue()` for now until folly is upgraded to newer version * fix up import for RCTTextAttributes.h * fix up includes for "conversions.h" to use namespaced includes Reviewed By: mmmulani Differential Revision: D8021149 fbshipit-source-id: d3955986d3ab6b1d9b61ac1e385767893ce57e5e
This commit is contained in:
parent
8c74864d7b
commit
128c9343c4
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
#import <React/RCTConvert.h>
|
||||
#import <RCTText/RCTTextTransform.h>
|
||||
|
||||
#import "RCTTextTransform.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <React/RCTTextDecorationLineType.h>
|
||||
#import <RCTText/RCTTextTransform.h>
|
||||
|
||||
#import "RCTTextTransform.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ DEPENDENCIES:
|
|||
- yoga (from `../ReactCommon/yoga`)
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/CocoaPods/Specs.git:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- boost-for-react-native
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
|
@ -135,9 +135,9 @@ SPEC CHECKSUMS:
|
|||
DoubleConversion: e22e0762848812a87afd67ffda3998d9ef29170c
|
||||
Folly: 9a8eea4725a0b6ba3256ebf206c21e352c23abf8
|
||||
glog: 1de0bb937dccdc981596d3b5825ebfb765017ded
|
||||
React: 512b17e881b5d04d703cd292caa6f4fe12984688
|
||||
React: 3d56cdd885ecc0f2f3534b2f54a11cf9707229fb
|
||||
yoga: bdd268c5812f00bdb52cc2b58f129797e97935eb
|
||||
|
||||
PODFILE CHECKSUM: 1a96172007b66aa74825c234f17139dd9c3d3cd7
|
||||
|
||||
COCOAPODS: 1.5.0
|
||||
COCOAPODS: 1.5.2
|
||||
|
|
|
@ -183,7 +183,7 @@ Pod::Spec.new do |s|
|
|||
ss.subspec "textlayoutmanager" do |sss|
|
||||
sss.dependency "Folly", folly_version
|
||||
sss.compiler_flags = folly_compiler_flags
|
||||
sss.source_files = "ReactCommon/fabric/textlayoutmanager/**/*.{cpp,h}"
|
||||
sss.source_files = "ReactCommon/fabric/textlayoutmanager/**/*.{cpp,h,mm}"
|
||||
sss.exclude_files = "**/tests/*"
|
||||
sss.header_dir = "fabric/textlayoutmanager"
|
||||
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
|
||||
|
|
|
@ -26,31 +26,31 @@ void TextAttributes::apply(TextAttributes textAttributes) {
|
|||
fontFamily = !textAttributes.fontFamily.empty() ? textAttributes.fontFamily : fontFamily;
|
||||
fontSize = !isnan(textAttributes.fontSize) ? textAttributes.fontSize : fontSize;
|
||||
fontSizeMultiplier = !isnan(textAttributes.fontSizeMultiplier) ? textAttributes.fontSizeMultiplier : fontSizeMultiplier;
|
||||
fontWeight = textAttributes.fontWeight.has_value() ? textAttributes.fontWeight : fontWeight;
|
||||
fontStyle = textAttributes.fontStyle.has_value() ? textAttributes.fontStyle : fontStyle;
|
||||
fontVariant = textAttributes.fontVariant.has_value() ? textAttributes.fontVariant : fontVariant;
|
||||
allowFontScaling = textAttributes.allowFontScaling.has_value() ? textAttributes.allowFontScaling : allowFontScaling;
|
||||
fontWeight = textAttributes.fontWeight.hasValue() ? textAttributes.fontWeight : fontWeight;
|
||||
fontStyle = textAttributes.fontStyle.hasValue() ? textAttributes.fontStyle : fontStyle;
|
||||
fontVariant = textAttributes.fontVariant.hasValue() ? textAttributes.fontVariant : fontVariant;
|
||||
allowFontScaling = textAttributes.allowFontScaling.hasValue() ? textAttributes.allowFontScaling : allowFontScaling;
|
||||
letterSpacing = !isnan(textAttributes.letterSpacing) ? textAttributes.letterSpacing : letterSpacing;
|
||||
|
||||
// Paragraph Styles
|
||||
lineHeight = !isnan(textAttributes.lineHeight) ? textAttributes.lineHeight : lineHeight;
|
||||
alignment = textAttributes.alignment.has_value() ? textAttributes.alignment : alignment;
|
||||
baseWritingDirection = textAttributes.baseWritingDirection.has_value() ? textAttributes.baseWritingDirection : baseWritingDirection;
|
||||
alignment = textAttributes.alignment.hasValue() ? textAttributes.alignment : alignment;
|
||||
baseWritingDirection = textAttributes.baseWritingDirection.hasValue() ? textAttributes.baseWritingDirection : baseWritingDirection;
|
||||
|
||||
// Decoration
|
||||
textDecorationColor = textAttributes.textDecorationColor ? textAttributes.textDecorationColor : textDecorationColor;
|
||||
textDecorationLineType = textAttributes.textDecorationLineType.has_value() ? textAttributes.textDecorationLineType : textDecorationLineType;
|
||||
textDecorationLineStyle = textAttributes.textDecorationLineStyle.has_value() ? textAttributes.textDecorationLineStyle : textDecorationLineStyle;
|
||||
textDecorationLinePattern = textAttributes.textDecorationLinePattern.has_value() ? textAttributes.textDecorationLinePattern : textDecorationLinePattern;
|
||||
textDecorationLineType = textAttributes.textDecorationLineType.hasValue() ? textAttributes.textDecorationLineType : textDecorationLineType;
|
||||
textDecorationLineStyle = textAttributes.textDecorationLineStyle.hasValue() ? textAttributes.textDecorationLineStyle : textDecorationLineStyle;
|
||||
textDecorationLinePattern = textAttributes.textDecorationLinePattern.hasValue() ? textAttributes.textDecorationLinePattern : textDecorationLinePattern;
|
||||
|
||||
// Shadow
|
||||
textShadowOffset = textAttributes.textShadowOffset.has_value() ? textAttributes.textShadowOffset.value() : textShadowOffset;
|
||||
textShadowOffset = textAttributes.textShadowOffset.hasValue() ? textAttributes.textShadowOffset.value() : textShadowOffset;
|
||||
textShadowRadius = !isnan(textAttributes.textShadowRadius) ? textAttributes.textShadowRadius : textShadowRadius;
|
||||
textShadowColor = textAttributes.textShadowColor ? textAttributes.textShadowColor : textShadowColor;
|
||||
|
||||
// Special
|
||||
isHighlighted = textAttributes.isHighlighted.has_value() ? textAttributes.isHighlighted : isHighlighted;
|
||||
layoutDirection = textAttributes.layoutDirection.has_value() ? textAttributes.layoutDirection : layoutDirection;
|
||||
isHighlighted = textAttributes.isHighlighted.hasValue() ? textAttributes.isHighlighted : isHighlighted;
|
||||
layoutDirection = textAttributes.layoutDirection.hasValue() ? textAttributes.layoutDirection : layoutDirection;
|
||||
}
|
||||
|
||||
#pragma mark - DebugStringConvertible
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <folly/Optional.h>
|
||||
#include <folly/dynamic.h>
|
||||
#include <fabric/graphics/Color.h>
|
||||
#include <fabric/graphics/Geometry.h>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <fabric/debug/DebugStringConvertible.h>
|
||||
#include <fabric/debug/DebugStringConvertibleItem.h>
|
||||
#include <folly/Conv.h>
|
||||
#include <folly/Optional.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
@ -36,7 +37,7 @@ inline SharedDebugStringConvertible debugStringConvertibleItem(std::string name,
|
|||
|
||||
template <typename T>
|
||||
inline SharedDebugStringConvertible debugStringConvertibleItem(std::string name, folly::Optional<T> value, T defaultValue = {}) {
|
||||
if (!value.has_value()) {
|
||||
if (!value.hasValue()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ inline static UIFont *RCTEffectiveFontFromTextAttributes(const TextAttributes &t
|
|||
RCTFontProperties fontProperties;
|
||||
fontProperties.family = fontFamily;
|
||||
fontProperties.size = textAttributes.fontSize;
|
||||
fontProperties.style = textAttributes.fontStyle.has_value() ? RCTFontStyleFromFontStyle(textAttributes.fontStyle.value()) : RCTFontStyleUndefined;
|
||||
fontProperties.variant = textAttributes.fontVariant.has_value() ? RCTFontVariantFromFontVariant(textAttributes.fontVariant.value()) : RCTFontVariantDefault;
|
||||
fontProperties.weight = textAttributes.fontWeight.has_value() ? CGFloat(textAttributes.fontWeight.value()) : NAN;
|
||||
fontProperties.style = textAttributes.fontStyle.hasValue() ? RCTFontStyleFromFontStyle(textAttributes.fontStyle.value()) : RCTFontStyleUndefined;
|
||||
fontProperties.variant = textAttributes.fontVariant.hasValue() ? RCTFontVariantFromFontVariant(textAttributes.fontVariant.value()) : RCTFontVariantDefault;
|
||||
fontProperties.weight = textAttributes.fontWeight.hasValue() ? CGFloat(textAttributes.fontWeight.value()) : NAN;
|
||||
fontProperties.sizeMultiplier = textAttributes.fontSizeMultiplier;
|
||||
|
||||
return RCTFontWithFontProperties(fontProperties);
|
||||
|
@ -82,7 +82,7 @@ static NSDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttri
|
|||
// Paragraph Style
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
BOOL isParagraphStyleUsed = NO;
|
||||
if (textAttributes.alignment.has_value()) {
|
||||
if (textAttributes.alignment.hasValue()) {
|
||||
TextAlignment textAlignment = textAttributes.alignment.value_or(TextAlignment::Natural);
|
||||
if (textAttributes.layoutDirection.value_or(LayoutDirection::LeftToRight) == LayoutDirection::RightToLeft) {
|
||||
if (textAlignment == TextAlignment::Right) {
|
||||
|
@ -97,7 +97,7 @@ static NSDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttri
|
|||
isParagraphStyleUsed = YES;
|
||||
}
|
||||
|
||||
if (textAttributes.baseWritingDirection.has_value()) {
|
||||
if (textAttributes.baseWritingDirection.hasValue()) {
|
||||
paragraphStyle.baseWritingDirection =
|
||||
RCTNSWritingDirectionFromWritingDirection(textAttributes.baseWritingDirection.value());
|
||||
isParagraphStyleUsed = YES;
|
||||
|
@ -151,7 +151,7 @@ static NSDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttri
|
|||
}
|
||||
|
||||
// Shadow
|
||||
if (textAttributes.textShadowOffset.has_value()) {
|
||||
if (textAttributes.textShadowOffset.hasValue()) {
|
||||
auto textShadowOffset = textAttributes.textShadowOffset.value();
|
||||
NSShadow *shadow = [NSShadow new];
|
||||
shadow.shadowOffset = CGSize {textShadowOffset.x, textShadowOffset.y};
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
#include "RootProps.h"
|
||||
|
||||
#include <fabric/view/conversions.h>
|
||||
|
||||
#include "YogaLayoutableShadowNode.h"
|
||||
#include "conversions.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
#include "RootShadowNode.h"
|
||||
#include "conversions.h"
|
||||
|
||||
#include <fabric/view/conversions.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
|
|
@ -13,10 +13,9 @@
|
|||
#include <fabric/core/LayoutContext.h>
|
||||
#include <fabric/core/LayoutConstraints.h>
|
||||
#include <fabric/debug/DebugStringConvertibleItem.h>
|
||||
#include <fabric/view/conversions.h>
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
#include "conversions.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
|
Loading…
Reference in New Issue