<commit_before>/**
 * Copyright (c) 2015-present, Viro Media, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import "ViroViewManager.h"

#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTLog.h>
#import <React/RCTShadowView.h>
#import <React/RCTUIManager.h>
#import <React/RCTUIManagerUtils.h>
#import <React/RCTUtils.h>
#import <React/RCTView.h>
#import <React/UIView+React.h>

#import "VRTView.h"
#import "VRTShadowView.h"
#import "VRTNode.h"


@implementation RCTConvert(UIAccessibilityTraits)

RCT_MULTI_ENUM_CONVERTER(UIAccessibilityTraits, (@{
                                                   @"none": @(UIAccessibilityTraitNone),
                                                   @"button": @(UIAccessibilityTraitButton),
                                                   @"link": @(UIAccessibilityTraitLink),
                                                   @"header": @(UIAccessibilityTraitHeader),
                                                   @"search": @(UIAccessibilityTraitSearchField),
                                                   @"image": @(UIAccessibilityTraitImage),
                                                   @"selected": @(UIAccessibilityTraitSelected),
                                                   @"plays": @(UIAccessibilityTraitPlaysSound),
                                                   @"key": @(UIAccessibilityTraitKeyboardKey),
                                                   @"text": @(UIAccessibilityTraitStaticText),
                                                   @"summary": @(UIAccessibilityTraitSummaryElement),
                                                   @"disabled": @(UIAccessibilityTraitNotEnabled),
                                                   @"frequentUpdates": @(UIAccessibilityTraitUpdatesFrequently),
                                                   @"startsMedia": @(UIAccessibilityTraitStartsMediaSession),
                                                   @"adjustable": @(UIAccessibilityTraitAdjustable),
                                                   @"allowsDirectInteraction": @(UIAccessibilityTraitAllowsDirectInteraction),
                                                   @"pageTurn": @(UIAccessibilityTraitCausesPageTurn),
                                                   }), UIAccessibilityTraitNone, unsignedLongLongValue)

@end

@implementation ViroViewManager


RCT_EXPORT_MODULE()

- (dispatch_queue_t)methodQueue
{
    
    return RCTGetUIManagerQueue();
}

- (VRTView *)viewWithProps:(NSDictionary *)props
{
    return [self view];
}

- (VRTView *)view
{
    return [VRTView new];
}

- (VRTShadowView *)shadowView
{
    return [VRTShadowView new];
}

- (NSArray *)customBubblingEventTypes
{
    return @[
             
             // Generic events
             @"press",
             @"change",
             @"change",
             @"focus",
             @"blur",
             @"submitEditing",
             @"endEditing",
             
             // Touch events
             @"touchStart",
             @"touchMove",
             @"touchCancel",
             @"touchEnd",
             ];
}

- (NSArray *)customDirectEventTypes
{
    return @[
             @"layout",
             @"accessibilityTap",
             @"magicTap",
             ];
}

- (NSDictionary *)constantsToExport
{
    return nil;
}

-(BOOL)isRootFlexBoxPanel {
    return NO;
}

#pragma mark - ViroView properties

RCT_EXPORT_VIEW_PROPERTY(transformBehaviors, NSArray<NSString *>)

#pragma mark - View properties


#pragma mark - ShadowView properties

RCT_EXPORT_SHADOW_PROPERTY(top, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(right, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(bottom, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(left, YGValue);
<commit_msg>VIRO-3495 Fix warning "requires main queue... overrides 'constantsToExport'"<commit_after>/**
 * Copyright (c) 2015-present, Viro Media, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import "ViroViewManager.h"

#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTLog.h>
#import <React/RCTShadowView.h>
#import <React/RCTUIManager.h>
#import <React/RCTUIManagerUtils.h>
#import <React/RCTUtils.h>
#import <React/RCTView.h>
#import <React/UIView+React.h>

#import "VRTView.h"
#import "VRTShadowView.h"
#import "VRTNode.h"


@implementation RCTConvert(UIAccessibilityTraits)

RCT_MULTI_ENUM_CONVERTER(UIAccessibilityTraits, (@{
                                                   @"none": @(UIAccessibilityTraitNone),
                                                   @"button": @(UIAccessibilityTraitButton),
                                                   @"link": @(UIAccessibilityTraitLink),
                                                   @"header": @(UIAccessibilityTraitHeader),
                                                   @"search": @(UIAccessibilityTraitSearchField),
                                                   @"image": @(UIAccessibilityTraitImage),
                                                   @"selected": @(UIAccessibilityTraitSelected),
                                                   @"plays": @(UIAccessibilityTraitPlaysSound),
                                                   @"key": @(UIAccessibilityTraitKeyboardKey),
                                                   @"text": @(UIAccessibilityTraitStaticText),
                                                   @"summary": @(UIAccessibilityTraitSummaryElement),
                                                   @"disabled": @(UIAccessibilityTraitNotEnabled),
                                                   @"frequentUpdates": @(UIAccessibilityTraitUpdatesFrequently),
                                                   @"startsMedia": @(UIAccessibilityTraitStartsMediaSession),
                                                   @"adjustable": @(UIAccessibilityTraitAdjustable),
                                                   @"allowsDirectInteraction": @(UIAccessibilityTraitAllowsDirectInteraction),
                                                   @"pageTurn": @(UIAccessibilityTraitCausesPageTurn),
                                                   }), UIAccessibilityTraitNone, unsignedLongLongValue)

@end

@implementation ViroViewManager


RCT_EXPORT_MODULE()

- (dispatch_queue_t)methodQueue
{
    
    return RCTGetUIManagerQueue();
}

- (VRTView *)viewWithProps:(NSDictionary *)props
{
    return [self view];
}

- (VRTView *)view
{
    return [VRTView new];
}

- (VRTShadowView *)shadowView
{
    return [VRTShadowView new];
}

- (NSArray *)customBubblingEventTypes
{
    return @[
             
             // Generic events
             @"press",
             @"change",
             @"change",
             @"focus",
             @"blur",
             @"submitEditing",
             @"endEditing",
             
             // Touch events
             @"touchStart",
             @"touchMove",
             @"touchCancel",
             @"touchEnd",
             ];
}

- (NSArray *)customDirectEventTypes
{
    return @[
             @"layout",
             @"accessibilityTap",
             @"magicTap",
             ];
}

-(BOOL)isRootFlexBoxPanel {
    return NO;
}

#pragma mark - ViroView properties

RCT_EXPORT_VIEW_PROPERTY(transformBehaviors, NSArray<NSString *>)

#pragma mark - View properties


#pragma mark - ShadowView properties

RCT_EXPORT_SHADOW_PROPERTY(top, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(right, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(bottom, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(left, YGValue);

{'fraction_non_alphanumeric': 0.09982595723520636, 'fraction_numerical': 0.0014917951268025858, 'mean_word_length': 1.6316650310762184, 'pattern_counts': {'":': 34, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 72, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4764302', 'n_tokens_mistral': 2104, 'n_tokens_neox': 2063, 'n_words': 387}