1/* 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 */ 7 8#import "ABI49_0_0RCTRootShadowView.h" 9 10#import "ABI49_0_0RCTI18nUtil.h" 11#import "ABI49_0_0RCTShadowView+Layout.h" 12 13@implementation ABI49_0_0RCTRootShadowView 14 15- (instancetype)init 16{ 17 if (self = [super init]) { 18 _baseDirection = [[ABI49_0_0RCTI18nUtil sharedInstance] isRTL] ? ABI49_0_0YGDirectionRTL : ABI49_0_0YGDirectionLTR; 19 _minimumSize = CGSizeZero; 20 _availableSize = CGSizeMake(INFINITY, INFINITY); 21 } 22 23 return self; 24} 25 26- (void)layoutWithAffectedShadowViews:(NSHashTable<ABI49_0_0RCTShadowView *> *)affectedShadowViews 27{ 28 NSHashTable<NSString *> *other = [NSHashTable new]; 29 30 ABI49_0_0RCTLayoutContext layoutContext = {}; 31 layoutContext.absolutePosition = CGPointZero; 32 layoutContext.affectedShadowViews = affectedShadowViews; 33 layoutContext.other = other; 34 35 [self layoutWithMinimumSize:_minimumSize 36 maximumSize:_availableSize 37 layoutDirection:ABI49_0_0RCTUIKitLayoutDirectionFromYogaLayoutDirection(_baseDirection) 38 layoutContext:layoutContext]; 39} 40 41@end 42