Use unique id for both root and hosting views
Summary: Same as D19600721, but supports hosting views too. Reviewed By: cuva Differential Revision: D19949935 fbshipit-source-id: 4490b03aff9f6d00003cf59468081cc3a4fef598
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0b8c2e27aa
commit
127cb604be
@@ -29,7 +29,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (id)childForNode:(CKComponentHostingView*)node atIndex:(NSUInteger)index {
|
- (id)childForNode:(CKComponentHostingView*)node atIndex:(NSUInteger)index {
|
||||||
return [SKComponentLayoutWrapper newFromRoot:node];
|
return [SKComponentLayoutWrapper
|
||||||
|
newFromRoot:node
|
||||||
|
parentKey:[NSString stringWithFormat:@"%@.", node.uniqueIdentifier]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setHighlighted:(BOOL)highlighted forNode:(CKComponentHostingView*)node {
|
- (void)setHighlighted:(BOOL)highlighted forNode:(CKComponentHostingView*)node {
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
@property(nonatomic, readonly) BOOL isFlexboxChild;
|
@property(nonatomic, readonly) BOOL isFlexboxChild;
|
||||||
@property(nonatomic, readonly) CKFlexboxComponentChild flexboxChild;
|
@property(nonatomic, readonly) CKFlexboxComponentChild flexboxChild;
|
||||||
|
|
||||||
+ (instancetype)newFromRoot:(id<CKInspectableView>)root;
|
|
||||||
+ (instancetype)newFromRoot:(id<CKInspectableView>)root
|
+ (instancetype)newFromRoot:(id<CKInspectableView>)root
|
||||||
parentKey:(NSString*)parentKey;
|
parentKey:(NSString*)parentKey;
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ static CKFlexboxComponentChild findFlexboxLayoutParams(
|
|||||||
|
|
||||||
@implementation SKComponentLayoutWrapper
|
@implementation SKComponentLayoutWrapper
|
||||||
|
|
||||||
+ (instancetype)newFromRoot:(id<CKInspectableView>)root {
|
|
||||||
return [self newFromRoot:root parentKey:@""];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (instancetype)newFromRoot:(id<CKInspectableView>)root
|
+ (instancetype)newFromRoot:(id<CKInspectableView>)root
|
||||||
parentKey:(NSString*)parentKey {
|
parentKey:(NSString*)parentKey {
|
||||||
const CKComponentLayout layout = [root mountedLayout];
|
const CKComponentLayout layout = [root mountedLayout];
|
||||||
|
|||||||
@@ -33,11 +33,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (id)childForNode:(CKComponentRootView*)node atIndex:(NSUInteger)index {
|
- (id)childForNode:(CKComponentRootView*)node atIndex:(NSUInteger)index {
|
||||||
auto const attachState = CKGetAttachStateForView(node);
|
|
||||||
return [SKComponentLayoutWrapper
|
return [SKComponentLayoutWrapper
|
||||||
newFromRoot:node
|
newFromRoot:node
|
||||||
parentKey:[NSString
|
parentKey:[NSString stringWithFormat:@"%@.", node.uniqueIdentifier]];
|
||||||
stringWithFormat:@"%d.", attachState.scopeIdentifier]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray<SKNamed<NSDictionary*>*>*)dataForNode:(CKComponentRootView*)node {
|
- (NSArray<SKNamed<NSDictionary*>*>*)dataForNode:(CKComponentRootView*)node {
|
||||||
|
|||||||
Reference in New Issue
Block a user