diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp new file mode 100644 index 00000000000..23ab8657c5a --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp @@ -0,0 +1,15 @@ + +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +namespace facebook { +namespace react { + +extern const char RCTARTSurfaceViewComponentName[] = "ARTSurfaceView"; + +} // namespace react +} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h new file mode 100644 index 00000000000..9df7b7ba353 --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h @@ -0,0 +1,28 @@ + +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include "RCTARTSurfaceViewProps.h" + +namespace facebook { +namespace react { + +extern const char RCTARTSurfaceViewComponentName[]; + +/* + * `ShadowNode` for component. + */ +using RCTARTSurfaceShadowNode = ConcreteViewShadowNode< + RCTARTSurfaceViewComponentName, + RCTARTSurfaceViewProps, + ViewEventEmitter>; + +} // namespace react +} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h new file mode 100644 index 00000000000..def60e01db9 --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h @@ -0,0 +1,21 @@ + +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include "RCTARTSurfaceShadowNode.h" + +namespace facebook { +namespace react { + +using RCTARTSurfaceComponentDescriptor = + ConcreteComponentDescriptor; + +} // namespace react +} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h new file mode 100644 index 00000000000..80037b40ce8 --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * UIView class for root component. + */ +@interface RCTARTSurfaceViewComponentView : RCTViewComponentView + +@end diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm new file mode 100644 index 00000000000..2a3055f928b --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm @@ -0,0 +1,28 @@ + +#import "RCTARTSurfaceViewComponentView.h" +#import +#import "RCTARTSurfaceViewComponentDescriptor.h" + +using namespace facebook::react; + +@implementation RCTARTSurfaceViewComponentView { +} + +- (instancetype)initWithFrame:(CGRect)frame +{ + if (self = [super initWithFrame:frame]) { + static const auto defaultProps = std::make_shared(); + _props = defaultProps; + } + + return self; +} + +#pragma mark - RCTComponentViewProtocol + ++ (ComponentDescriptorProvider)componentDescriptorProvider +{ + return concreteComponentDescriptorProvider(); +} + +@end diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp new file mode 100644 index 00000000000..0837109bd58 --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp @@ -0,0 +1,16 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#include "RCTARTSurfaceViewProps.h" + +#include + +namespace facebook { +namespace react { + +RCTARTSurfaceViewProps::RCTARTSurfaceViewProps( + const RCTARTSurfaceViewProps &sourceProps, + const RawProps &rawProps) + : ViewProps(sourceProps, rawProps) {} + +} // namespace react +} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h new file mode 100644 index 00000000000..ebe73d755de --- /dev/null +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h @@ -0,0 +1,22 @@ + +// Copyright 2004-present Facebook. All Rights Reserved. + +#pragma once + +#include + +namespace facebook { +namespace react { + +class RCTARTSurfaceViewProps final : public ViewProps { + public: + RCTARTSurfaceViewProps() = default; + RCTARTSurfaceViewProps( + const RCTARTSurfaceViewProps &sourceProps, + const RawProps &rawProps); + +#pragma mark - Props +}; + +} // namespace react +} // namespace facebook diff --git a/React/Fabric/Mounting/RCTComponentViewFactory.mm b/React/Fabric/Mounting/RCTComponentViewFactory.mm index 4a2d9703d31..902775726bb 100644 --- a/React/Fabric/Mounting/RCTComponentViewFactory.mm +++ b/React/Fabric/Mounting/RCTComponentViewFactory.mm @@ -14,6 +14,7 @@ #import #import +#import "RCTARTSurfaceViewComponentView.h" #import "RCTActivityIndicatorViewComponentView.h" #import "RCTImageComponentView.h" #import "RCTModalHostViewComponentView.h" @@ -49,6 +50,7 @@ using namespace facebook::react; [componentViewFactory registerComponentViewClass:[RCTSwitchComponentView class]]; [componentViewFactory registerComponentViewClass:[RCTUnimplementedNativeComponentView class]]; [componentViewFactory registerComponentViewClass:[RCTModalHostViewComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTARTSurfaceViewComponentView class]]; return componentViewFactory; }