diff --git a/Libraries/Image/RCTStaticImageManager.m b/Libraries/Image/RCTStaticImageManager.m index ef60247f2..e292c2064 100644 --- a/Libraries/Image/RCTStaticImageManager.m +++ b/Libraries/Image/RCTStaticImageManager.m @@ -18,7 +18,7 @@ RCT_EXPORT_VIEW_PROPERTY(capInsets) RCT_REMAP_VIEW_PROPERTY(resizeMode, contentMode) -RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage *) +RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage) { if (json) { if ([[[json description] pathExtension] caseInsensitiveCompare:@"gif"] == NSOrderedSame) { @@ -30,7 +30,7 @@ RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage *) view.image = defaultView.image; } } -RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) +RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage) { if (json) { view.renderingMode = UIImageRenderingModeAlwaysTemplate; @@ -40,7 +40,7 @@ RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) view.tintColor = defaultView.tintColor; } } -RCT_CUSTOM_VIEW_PROPERTY(imageTag, RCTStaticImage *) +RCT_CUSTOM_VIEW_PROPERTY(imageTag, RCTStaticImage) { if (json) { [RCTImageLoader loadImageWithTag:[RCTConvert NSString:json] callback:^(NSError *error, UIImage *image) { diff --git a/Libraries/Interaction/InteractionManager.js b/Libraries/Interaction/InteractionManager.js index 3e895f3b0..fbdd0cc9f 100644 --- a/Libraries/Interaction/InteractionManager.js +++ b/Libraries/Interaction/InteractionManager.js @@ -13,6 +13,14 @@ var invariant = require('invariant'); var keyMirror = require('keyMirror'); var setImmediate = require('setImmediate'); +var _emitter = new EventEmitter(); +var _interactionSet = new Set(); +var _addInteractionSet = new Set(); +var _deleteInteractionSet = new Set(); +var _nextUpdateHandle = null; +var _queue = []; +var _inc = 0; + /** * InteractionManager allows long-running work to be scheduled after any * interactions/animations have completed. In particular, this allows JavaScript @@ -20,11 +28,14 @@ var setImmediate = require('setImmediate'); * * Applications can schedule tasks to run after interactions with the following: * - * InteractionManager.runAfterInteractions(() => { - * // ...long-running synchronous task... - * }); + * ``` + * InteractionManager.runAfterInteractions(() => { + * // ...long-running synchronous task... + * }); + * ``` * * Compare this to other scheduling alternatives: + * * - requestAnimationFrame(): for code that animates a view over time. * - setImmediate/setTimeout(): run code later, note this may delay animations. * - runAfterInteractions(): run code later, without delaying active animations. @@ -37,27 +48,32 @@ var setImmediate = require('setImmediate'); * creating an interaction 'handle' on animation start, and clearing it upon * completion: * - * var handle = InteractionManager.createInteractionHandle(); - * // run animation... (`runAfterInteractions` tasks are queued) - * // later, on animation completion: - * InteractionManager.clearInteractionHandle(handle); - * // queued tasks run if all handles were cleared + * ``` + * var handle = InteractionManager.createInteractionHandle(); + * // run animation... (`runAfterInteractions` tasks are queued) + * // later, on animation completion: + * InteractionManager.clearInteractionHandle(handle); + * // queued tasks run if all handles were cleared + * ``` */ - -var _emitter = new EventEmitter(); -var _interactionSet = new Set(); -var _addInteractionSet = new Set(); -var _deleteInteractionSet = new Set(); -var _nextUpdateHandle = null; -var _queue = []; -var _inc = 0; - var InteractionManager = { Events: keyMirror({ interactionStart: true, interactionComplete: true, }), + /** + * Schedule a function to run after all interactions have completed. + */ + runAfterInteractions(callback) { + invariant( + typeof callback === 'function', + 'Must specify a function to schedule.' + ); + scheduleUpdate(); + _queue.push(callback); + }, + /** * Notify manager that an interaction has started. */ @@ -81,20 +97,6 @@ var InteractionManager = { _deleteInteractionSet.add(handle); }, - /** - * Schedule a function to run after all interactions have completed. - * - * @param {function} callback - */ - runAfterInteractions(callback) { - invariant( - typeof callback === 'function', - 'Must specify a function to schedule.' - ); - scheduleUpdate(); - _queue.push(callback); - }, - addListener: _emitter.addListener.bind(_emitter), }; diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index ffe0d8b1e..80f350fea 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -24,7 +24,7 @@ } RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor) -RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText *) +RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText) { NSLineBreakMode truncationMode = NSLineBreakByClipping; view.numberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.numberOfLines; @@ -34,16 +34,16 @@ RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText *) view.lineBreakMode = truncationMode; } -RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText) { view.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor; } -RCT_CUSTOM_SHADOW_PROPERTY(containerBackgroundColor, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(containerBackgroundColor, RCTShadowText) { view.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; view.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; } -RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText) { NSLineBreakMode truncationMode = NSLineBreakByClipping; view.maxNumberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.maxNumberOfLines; @@ -52,7 +52,7 @@ RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText *) } view.truncationMode = truncationMode; } -RCT_CUSTOM_SHADOW_PROPERTY(textAlign, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(textAlign, RCTShadowText) { view.textAlign = json ? [RCTConvert NSTextAlignment:json] : defaultView.textAlign; } diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 6f0b22df5..00be3f65a 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -7,9 +7,9 @@ var ReactNative = { ...require('React'), - Animation: require('Animation'), ActivityIndicatorIOS: require('ActivityIndicatorIOS'), AlertIOS: require('AlertIOS'), + Animation: require('Animation'), AppRegistry: require('AppRegistry'), AppState: require('AppState'), AppStateIOS: require('AppStateIOS'), @@ -18,6 +18,7 @@ var ReactNative = { DatePickerIOS: require('DatePickerIOS'), ExpandingText: require('ExpandingText'), Image: require('Image'), + InteractionManager: require('InteractionManager'), LayoutAnimation: require('LayoutAnimation'), ListView: require('ListView'), ListViewDataSource: require('ListViewDataSource'), diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index 47c1cc2ed..d4baaf19a 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -44,6 +44,9 @@ + (CGRect)CGRect:(id)json; + (UIEdgeInsets)UIEdgeInsets:(id)json; ++ (CGLineCap)CGLineCap:(id)json; ++ (CGLineJoin)CGLineJoin:(id)json; + + (CATransform3D)CATransform3D:(id)json; + (CGAffineTransform)CGAffineTransform:(id)json; @@ -103,3 +106,117 @@ id RCTConvertValue(id target, NSString *keypath, id json); #ifdef __cplusplus } #endif + +/** + * This macro is used for creating converter functions with arbitrary logic. + */ +#define RCT_CONVERTER_CUSTOM(type, name, code) \ ++ (type)name:(id)json \ +{ \ + if (json == [NSNull null]) { \ + json = nil; \ + } \ + @try { \ + return code; \ + } \ + @catch (__unused NSException *e) { \ + RCTLogError(@"JSON value '%@' of type '%@' cannot be converted to '%s'", \ + json, [json class], #type); \ + json = nil; \ + return code; \ + } \ +} + +/** + * This macro is used for creating simple converter functions that just call + * the specified getter method on the json value. + */ +#define RCT_CONVERTER(type, name, getter) \ +RCT_CONVERTER_CUSTOM(type, name, [json getter]) + +/** + * This macro is used for creating converters for enum types. + */ +#define RCT_ENUM_CONVERTER(type, values, default, getter) \ ++ (type)type:(id)json \ +{ \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ + if (!json || json == [NSNull null]) { \ + return default; \ + } \ + if ([json isKindOfClass:[NSNumber class]]) { \ + if ([[mapping allValues] containsObject:json] || [json getter] == default) { \ + return [json getter]; \ + } \ + RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allValues]); \ + return default; \ + } \ + if (![json isKindOfClass:[NSString class]]) { \ + RCTLogError(@"Expected NSNumber or NSString for %s, received %@: %@", #type, [json class], json); \ + } \ + id value = mapping[json]; \ + if(!value && [json description].length > 0) { \ + RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allKeys]); \ + } \ + return value ? [value getter] : default; \ +} + +/** + * This macro is used for creating converter functions for structs that consist + * of a number of CGFloat properties, such as CGPoint, CGRect, etc. + */ +#define RCT_CGSTRUCT_CONVERTER(type, values) \ ++ (type)type:(id)json \ +{ \ + @try { \ + static NSArray *fields; \ + static NSUInteger count; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + fields = values; \ + count = [fields count]; \ + }); \ + type result; \ + if ([json isKindOfClass:[NSArray class]]) { \ + if ([json count] != count) { \ + RCTLogError(@"Expected array with count %zd, but count is %zd: %@", count, [json count], json); \ + } else { \ + for (NSUInteger i = 0; i < count; i++) { \ + ((CGFloat *)&result)[i] = [json[i] doubleValue]; \ + } \ + } \ + } else if ([json isKindOfClass:[NSDictionary class]]) { \ + for (NSUInteger i = 0; i < count; i++) { \ + ((CGFloat *)&result)[i] = [json[fields[i]] doubleValue]; \ + } \ + } else if (json && json != [NSNull null]) { \ + RCTLogError(@"Expected NSArray or NSDictionary for %s, received %@: %@", #type, [json class], json); \ + } \ + return result; \ + } \ + @catch (__unused NSException *e) { \ + RCTLogError(@"JSON value '%@' cannot be converted to '%s'", json, #type); \ + type result; \ + return result; \ + } \ +} + +/** + * This macro is used for creating converter functions for typed arrays. + */ +#define RCT_ARRAY_CONVERTER(type) \ ++ (NSArray *)type##Array:(id)json \ +{ \ + NSMutableArray *values = [[NSMutableArray alloc] init]; \ + for (id jsonValue in [self NSArray:json]) { \ + id value = [self type:jsonValue]; \ + if (value) { \ + [values addObject:value]; \ + } \ + } \ + return values; \ +} diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index 7a47b1fe0..e972ea26b 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -11,100 +11,6 @@ NSString *const RCTDefaultFontName = @"HelveticaNeue"; NSString *const RCTDefaultFontWeight = @"normal"; NSString *const RCTBoldFontWeight = @"bold"; -#define RCT_CONVERTER_CUSTOM(type, name, code) \ -+ (type)name:(id)json \ -{ \ - @try { \ - return code; \ - } \ - @catch (__unused NSException *e) { \ - RCTLogError(@"JSON value '%@' of type '%@' cannot be converted to '%s'", \ - json, [json class], #type); \ - json = nil; \ - return code; \ - } \ -} - -#define RCT_CONVERTER(type, name, getter) \ -RCT_CONVERTER_CUSTOM(type, name, [json getter]) - -#define RCT_ENUM_CONVERTER(type, values, default, getter) \ -+ (type)type:(id)json \ -{ \ - static NSDictionary *mapping; \ - static dispatch_once_t onceToken; \ - dispatch_once(&onceToken, ^{ \ - mapping = values; \ - }); \ - if (!json) { \ - return default; \ - } \ - if ([json isKindOfClass:[NSNumber class]]) { \ - if ([[mapping allValues] containsObject:json] || [json getter] == default) { \ - return [json getter]; \ - } \ - RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allValues]); \ - return default; \ - } \ - if (![json isKindOfClass:[NSString class]]) { \ - RCTLogError(@"Expected NSNumber or NSString for %s, received %@: %@", #type, [json class], json); \ - } \ - id value = mapping[json]; \ - if(!value && [json description].length > 0) { \ - RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allKeys]); \ - } \ - return value ? [value getter] : default; \ -} - -#define RCT_STRUCT_CONVERTER(type, values) \ -+ (type)type:(id)json \ -{ \ - @try { \ - static NSArray *fields; \ - static NSUInteger count; \ - static dispatch_once_t onceToken; \ - dispatch_once(&onceToken, ^{ \ - fields = values; \ - count = [fields count]; \ - }); \ - type result; \ - if ([json isKindOfClass:[NSArray class]]) { \ - if ([json count] != count) { \ - RCTLogError(@"Expected array with count %zd, but count is %zd: %@", count, [json count], json); \ - } else { \ - for (NSUInteger i = 0; i < count; i++) { \ - ((CGFloat *)&result)[i] = [json[i] doubleValue]; \ - } \ - } \ - } else if ([json isKindOfClass:[NSDictionary class]]) { \ - for (NSUInteger i = 0; i < count; i++) { \ - ((CGFloat *)&result)[i] = [json[fields[i]] doubleValue]; \ - } \ - } else if (json) { \ - RCTLogError(@"Expected NSArray or NSDictionary for %s, received %@: %@", #type, [json class], json); \ - } \ - return result; \ - } \ - @catch (__unused NSException *e) { \ - RCTLogError(@"JSON value '%@' cannot be converted to '%s'", json, #type); \ - type result; \ - return result; \ - } \ -} - -#define RCT_ARRAY_CONVERTER(type) \ -+ (NSArray *)type##Array:(id)json \ -{ \ - NSMutableArray *values = [[NSMutableArray alloc] init]; \ - for (id jsonValue in [self NSArray:json]) { \ - id value = [self type:jsonValue]; \ - if (!value) { \ - [values addObject:value]; \ - } \ - } \ - return values; \ -} - @implementation RCTConvert RCT_CONVERTER(BOOL, BOOL, boolValue) @@ -178,19 +84,31 @@ RCT_ENUM_CONVERTER(UIKeyboardType, (@{ }), UIKeyboardTypeDefault, integerValue) RCT_CONVERTER(CGFloat, CGFloat, doubleValue) -RCT_STRUCT_CONVERTER(CGPoint, (@[@"x", @"y"])) -RCT_STRUCT_CONVERTER(CGSize, (@[@"w", @"h"])) -RCT_STRUCT_CONVERTER(CGRect, (@[@"x", @"y", @"w", @"h"])) -RCT_STRUCT_CONVERTER(UIEdgeInsets, (@[@"top", @"left", @"bottom", @"right"])) +RCT_CGSTRUCT_CONVERTER(CGPoint, (@[@"x", @"y"])) +RCT_CGSTRUCT_CONVERTER(CGSize, (@[@"w", @"h"])) +RCT_CGSTRUCT_CONVERTER(CGRect, (@[@"x", @"y", @"w", @"h"])) +RCT_CGSTRUCT_CONVERTER(UIEdgeInsets, (@[@"top", @"left", @"bottom", @"right"])) -RCT_STRUCT_CONVERTER(CATransform3D, (@[ +RCT_ENUM_CONVERTER(CGLineJoin, (@{ + @"miter": @(kCGLineJoinMiter), + @"round": @(kCGLineJoinRound), + @"bevel": @(kCGLineJoinBevel), +}), kCGLineJoinMiter, intValue) + +RCT_ENUM_CONVERTER(CGLineCap, (@{ + @"butt": @(kCGLineCapButt), + @"round": @(kCGLineCapRound), + @"square": @(kCGLineCapSquare), +}), kCGLineCapButt, intValue) + +RCT_CGSTRUCT_CONVERTER(CATransform3D, (@[ @"m11", @"m12", @"m13", @"m14", @"m21", @"m22", @"m23", @"m24", @"m31", @"m32", @"m33", @"m34", @"m41", @"m42", @"m43", @"m44" ])) -RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"])) +RCT_CGSTRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"])) + (UIColor *)UIColor:(id)json { @@ -804,6 +722,12 @@ static id RCTConvertValueWithExplicitEncoding(id target, NSString *key, id json, @"extAlignment": ^(id val) { return [RCTConvert NSTextAlignment:val]; }, + @"Cap": ^(id val) { + return [RCTConvert CGLineCap:val]; + }, + @"Join": ^(id val) { + return [RCTConvert CGLineJoin:val]; + }, @"ointerEvents": ^(id val) { return [RCTConvert RCTPointerEvents:val]; }, diff --git a/ReactKit/Views/RCTTabBarItemManager.m b/ReactKit/Views/RCTTabBarItemManager.m index f74bc09ed..a840dd6bf 100644 --- a/ReactKit/Views/RCTTabBarItemManager.m +++ b/ReactKit/Views/RCTTabBarItemManager.m @@ -16,7 +16,7 @@ RCT_EXPORT_VIEW_PROPERTY(selected); RCT_EXPORT_VIEW_PROPERTY(icon); RCT_REMAP_VIEW_PROPERTY(selectedIcon, barItem.selectedImage); RCT_REMAP_VIEW_PROPERTY(badgeValue, barItem.badgeValue); -RCT_CUSTOM_VIEW_PROPERTY(title, RCTTabBarItem *) +RCT_CUSTOM_VIEW_PROPERTY(title, RCTTabBarItem) { view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title; view.barItem.imageInsets = [view.barItem.title length] ? UIEdgeInsetsZero : (UIEdgeInsets){6, 0, -6, 0}; diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 52b29dc36..40a46e100 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -23,15 +23,15 @@ RCT_EXPORT_VIEW_PROPERTY(text) RCT_EXPORT_VIEW_PROPERTY(clearButtonMode) RCT_EXPORT_VIEW_PROPERTY(keyboardType) RCT_REMAP_VIEW_PROPERTY(color, textColor) -RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField *) +RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField) { view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; } -RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField *) +RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField) { view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO } -RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField *) +RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField) { view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName]; } diff --git a/ReactKit/Views/RCTUIActivityIndicatorViewManager.m b/ReactKit/Views/RCTUIActivityIndicatorViewManager.m index e56f01106..2322e0d90 100644 --- a/ReactKit/Views/RCTUIActivityIndicatorViewManager.m +++ b/ReactKit/Views/RCTUIActivityIndicatorViewManager.m @@ -13,7 +13,7 @@ RCT_EXPORT_VIEW_PROPERTY(activityIndicatorViewStyle) RCT_EXPORT_VIEW_PROPERTY(color) -RCT_CUSTOM_VIEW_PROPERTY(animating, UIActivityIndicatorView *) +RCT_CUSTOM_VIEW_PROPERTY(animating, UIActivityIndicatorView) { BOOL animating = json ? [json boolValue] : [defaultView isAnimating]; if (animating != [view isAnimating]) { diff --git a/ReactKit/Views/RCTViewManager.h b/ReactKit/Views/RCTViewManager.h index b98fc34a3..2240228b8 100644 --- a/ReactKit/Views/RCTViewManager.h +++ b/ReactKit/Views/RCTViewManager.h @@ -122,11 +122,11 @@ RCT_REMAP_VIEW_PROPERTY(name, name) * view properties. The macro should be followed by a method body, which can * refer to "json", "view" and "defaultView" to implement the required logic. */ -#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView +#define RCT_CUSTOM_VIEW_PROPERTY(name, viewClass) \ +- (void)set_##name:(id)json forView:(viewClass *)view withDefaultView:(viewClass *)defaultView -#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView +#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewClass) \ +- (void)set_##name:(id)json forShadowView:(viewClass *)view withDefaultView:(viewClass *)defaultView /** * These are useful in cases where the module's superclass handles a diff --git a/ReactKit/Views/RCTViewManager.m b/ReactKit/Views/RCTViewManager.m index 44bac5211..011f66f24 100644 --- a/ReactKit/Views/RCTViewManager.m +++ b/ReactKit/Views/RCTViewManager.m @@ -78,11 +78,11 @@ RCT_REMAP_VIEW_PROPERTY(borderColor, layer.borderColor); RCT_REMAP_VIEW_PROPERTY(borderRadius, layer.cornerRadius) RCT_REMAP_VIEW_PROPERTY(borderWidth, layer.borderWidth) RCT_REMAP_VIEW_PROPERTY(transformMatrix, layer.transform) -RCT_CUSTOM_VIEW_PROPERTY(overflow, UIView *) +RCT_CUSTOM_VIEW_PROPERTY(overflow, UIView) { view.clipsToBounds = json ? ![RCTConvert css_overflow:json] : defaultView.clipsToBounds; } -RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView *) +RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView) { if ([view respondsToSelector:@selector(setPointerEvents:)]) { view.pointerEvents = json ? [RCTConvert RCTPointerEvents:json] : defaultView.pointerEvents; @@ -112,32 +112,32 @@ RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView *) // ShadowView properties -RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView) { view.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; view.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; } -RCT_CUSTOM_SHADOW_PROPERTY(flexDirection, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(flexDirection, RCTShadowView) { view.flexDirection = json? [RCTConvert css_flex_direction_t:json] : defaultView.flexDirection; } -RCT_CUSTOM_SHADOW_PROPERTY(flexWrap, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(flexWrap, RCTShadowView) { view.flexWrap = json ? [RCTConvert css_wrap_type_t:json] : defaultView.flexWrap; } -RCT_CUSTOM_SHADOW_PROPERTY(justifyContent, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(justifyContent, RCTShadowView) { view.justifyContent = json ? [RCTConvert css_justify_t:json] : defaultView.justifyContent; } -RCT_CUSTOM_SHADOW_PROPERTY(alignItems, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(alignItems, RCTShadowView) { view.alignItems = json ? [RCTConvert css_align_t:json] : defaultView.alignItems; } -RCT_CUSTOM_SHADOW_PROPERTY(alignSelf, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(alignSelf, RCTShadowView) { view.alignSelf = json ? [RCTConvert css_align_t:json] : defaultView.alignSelf; } -RCT_CUSTOM_SHADOW_PROPERTY(position, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(position, RCTShadowView) { view.positionType = json ? [RCTConvert css_position_type_t:json] : defaultView.positionType; } diff --git a/packager/blacklist.js b/packager/blacklist.js index 468a60404..850a87244 100644 --- a/packager/blacklist.js +++ b/packager/blacklist.js @@ -7,6 +7,7 @@ // modulePathIgnorePatterns. var sharedBlacklist = [ __dirname, + 'website', 'node_modules/parse/node_modules/xmlhttprequest/lib/XMLHttpRequest.js', 'node_modules/react-tools/src/utils/ImmutableObject.js', 'node_modules/react-tools/src/core/ReactInstanceHandles.js',