@onekeyfe/react-native-image 6.7.0-alpha.412 → 6.7.0-alpha.413
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -12
- package/android/build.gradle +1 -3
- package/android/src/main/java/com/margelo/nitro/onekeyimage/OneKeyImageGlideRegistry.kt +1 -1
- package/android/src/main/java/com/margelo/nitro/onekeyimage/OneKeyImagePackage.kt +1 -2
- package/ios/OneKeyImageCoderBridge.h +0 -4
- package/ios/OneKeyImageCoderBridge.m +0 -9
- package/lib/module/package.json +1 -6
- package/lib/nitrogen/generated/android/onekeyimage+autolinking.cmake +0 -4
- package/lib/nitrogen/generated/android/onekeyimageOnLoad.cpp +0 -18
- package/lib/nitrogen/generated/ios/OneKeyImage-Swift-Cxx-Bridge.cpp +0 -17
- package/lib/nitrogen/generated/ios/OneKeyImage-Swift-Cxx-Bridge.hpp +15 -32
- package/lib/nitrogen/generated/ios/OneKeyImage-Swift-Cxx-Umbrella.hpp +0 -5
- package/lib/nitrogen/generated/ios/OneKeyImageAutolinking.mm +0 -8
- package/lib/nitrogen/generated/ios/OneKeyImageAutolinking.swift +0 -12
- package/nitro.json +0 -10
- package/nitrogen/generated/android/onekeyimage+autolinking.cmake +0 -4
- package/nitrogen/generated/android/onekeyimageOnLoad.cpp +0 -18
- package/nitrogen/generated/ios/OneKeyImage-Swift-Cxx-Bridge.cpp +0 -17
- package/nitrogen/generated/ios/OneKeyImage-Swift-Cxx-Bridge.hpp +15 -32
- package/nitrogen/generated/ios/OneKeyImage-Swift-Cxx-Umbrella.hpp +0 -5
- package/nitrogen/generated/ios/OneKeyImageAutolinking.mm +0 -8
- package/nitrogen/generated/ios/OneKeyImageAutolinking.swift +0 -12
- package/package.json +7 -40
- package/android/src/main/java/com/margelo/nitro/onekeyimage/OneKeyIcon.kt +0 -93
- package/android/src/main/java/com/margelo/nitro/onekeyimage/OneKeyNamedSVG.kt +0 -217
- package/android/src/main/java/com/margelo/nitro/onekeyimage/OneKeySVG.kt +0 -31
- package/ios/OneKeyIcon.swift +0 -90
- package/ios/OneKeyNamedSVG.swift +0 -282
- package/ios/tests/OneKeyIconTests.swift +0 -484
- package/lib/module/OneKeyIcon.nitro.js +0 -4
- package/lib/module/icon/assetUrls.js +0 -7
- package/lib/module/icon/dom.js +0 -21
- package/lib/module/icon/index.js +0 -29
- package/lib/module/icon/index.web.js +0 -32
- package/lib/module/icon/props.js +0 -22
- package/lib/nitrogen/generated/android/c++/JHybridOneKeyIconSpec.cpp +0 -67
- package/lib/nitrogen/generated/android/c++/JHybridOneKeyIconSpec.hpp +0 -66
- package/lib/nitrogen/generated/android/c++/views/JHybridOneKeyIconStateUpdater.cpp +0 -79
- package/lib/nitrogen/generated/android/c++/views/JHybridOneKeyIconStateUpdater.hpp +0 -54
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyimage/HybridOneKeyIconSpec.kt +0 -65
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyimage/views/HybridOneKeyIconManager.kt +0 -96
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyimage/views/HybridOneKeyIconStateUpdater.kt +0 -23
- package/lib/nitrogen/generated/ios/c++/HybridOneKeyIconSpecSwift.cpp +0 -11
- package/lib/nitrogen/generated/ios/c++/HybridOneKeyIconSpecSwift.hpp +0 -89
- package/lib/nitrogen/generated/ios/c++/views/HybridOneKeyIconComponent.mm +0 -150
- package/lib/nitrogen/generated/ios/swift/HybridOneKeyIconSpec.swift +0 -56
- package/lib/nitrogen/generated/ios/swift/HybridOneKeyIconSpec_cxx.swift +0 -193
- package/lib/nitrogen/generated/shared/c++/HybridOneKeyIconSpec.cpp +0 -24
- package/lib/nitrogen/generated/shared/c++/HybridOneKeyIconSpec.hpp +0 -66
- package/lib/nitrogen/generated/shared/c++/views/HybridOneKeyIconComponent.cpp +0 -36
- package/lib/nitrogen/generated/shared/c++/views/HybridOneKeyIconComponent.hpp +0 -88
- package/lib/nitrogen/generated/shared/json/OneKeyIconConfig.json +0 -11
- package/lib/typescript/src/OneKeyIcon.nitro.d.ts +0 -7
- package/lib/typescript/src/icon/assetUrls.d.ts +0 -2
- package/lib/typescript/src/icon/dom.d.ts +0 -3
- package/lib/typescript/src/icon/index.d.ts +0 -140
- package/lib/typescript/src/icon/index.web.d.ts +0 -134
- package/lib/typescript/src/icon/props.d.ts +0 -8
- package/nitrogen/generated/android/c++/JHybridOneKeyIconSpec.cpp +0 -67
- package/nitrogen/generated/android/c++/JHybridOneKeyIconSpec.hpp +0 -66
- package/nitrogen/generated/android/c++/views/JHybridOneKeyIconStateUpdater.cpp +0 -79
- package/nitrogen/generated/android/c++/views/JHybridOneKeyIconStateUpdater.hpp +0 -54
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyimage/HybridOneKeyIconSpec.kt +0 -65
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyimage/views/HybridOneKeyIconManager.kt +0 -96
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyimage/views/HybridOneKeyIconStateUpdater.kt +0 -23
- package/nitrogen/generated/ios/c++/HybridOneKeyIconSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridOneKeyIconSpecSwift.hpp +0 -89
- package/nitrogen/generated/ios/c++/views/HybridOneKeyIconComponent.mm +0 -150
- package/nitrogen/generated/ios/swift/HybridOneKeyIconSpec.swift +0 -56
- package/nitrogen/generated/ios/swift/HybridOneKeyIconSpec_cxx.swift +0 -193
- package/nitrogen/generated/shared/c++/HybridOneKeyIconSpec.cpp +0 -24
- package/nitrogen/generated/shared/c++/HybridOneKeyIconSpec.hpp +0 -66
- package/nitrogen/generated/shared/c++/views/HybridOneKeyIconComponent.cpp +0 -36
- package/nitrogen/generated/shared/c++/views/HybridOneKeyIconComponent.hpp +0 -88
- package/nitrogen/generated/shared/json/OneKeyIconConfig.json +0 -11
- package/scripts/configure-icon-imports.mjs +0 -7
- package/scripts/icon-fixtures.test.mjs +0 -398
- package/src/OneKeyIcon.nitro.ts +0 -8
- package/src/icon/assetUrls.ts +0 -4
- package/src/icon/dom.ts +0 -21
- package/src/icon/index.tsx +0 -38
- package/src/icon/index.web.tsx +0 -36
- package/src/icon/props.ts +0 -38
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconComponent.mm
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#import "HybridOneKeyIconComponent.hpp"
|
|
9
|
-
#import <memory>
|
|
10
|
-
#import <react/renderer/componentregistry/ComponentDescriptorProvider.h>
|
|
11
|
-
#import <React/RCTViewComponentView.h>
|
|
12
|
-
#import <React/RCTComponentViewFactory.h>
|
|
13
|
-
#import <React/UIView+ComponentViewProtocol.h>
|
|
14
|
-
#import <NitroModules/NitroDefines.hpp>
|
|
15
|
-
#import <UIKit/UIKit.h>
|
|
16
|
-
|
|
17
|
-
#import "HybridOneKeyIconSpecSwift.hpp"
|
|
18
|
-
#import "OneKeyImage-Swift-Cxx-Umbrella.hpp"
|
|
19
|
-
|
|
20
|
-
#if __has_include(<cxxreact/ReactNativeVersion.h>)
|
|
21
|
-
#include <cxxreact/ReactNativeVersion.h>
|
|
22
|
-
#if REACT_NATIVE_VERSION_MINOR >= 82
|
|
23
|
-
#define ENABLE_RCT_COMPONENT_VIEW_INVALIDATE
|
|
24
|
-
#endif
|
|
25
|
-
#endif
|
|
26
|
-
|
|
27
|
-
using namespace facebook;
|
|
28
|
-
using namespace margelo::nitro::onekeyimage;
|
|
29
|
-
using namespace margelo::nitro::onekeyimage::views;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Represents the React Native View holder for the Nitro "OneKeyIcon" HybridView.
|
|
33
|
-
*/
|
|
34
|
-
@interface HybridOneKeyIconComponent: RCTViewComponentView
|
|
35
|
-
+ (BOOL)shouldBeRecycled;
|
|
36
|
-
@end
|
|
37
|
-
|
|
38
|
-
@implementation HybridOneKeyIconComponent {
|
|
39
|
-
std::shared_ptr<HybridOneKeyIconSpecSwift> _hybridView;
|
|
40
|
-
BOOL _didDropView;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
+ (void) load {
|
|
44
|
-
[super load];
|
|
45
|
-
[RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:[HybridOneKeyIconComponent class]];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
+ (react::ComponentDescriptorProvider) componentDescriptorProvider {
|
|
49
|
-
return react::concreteComponentDescriptorProvider<HybridOneKeyIconComponentDescriptor>();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
- (instancetype) init {
|
|
53
|
-
if (self = [super init]) {
|
|
54
|
-
_props = HybridOneKeyIconShadowNode::defaultSharedProps();
|
|
55
|
-
std::shared_ptr<HybridOneKeyIconSpec> hybridView = OneKeyImage::OneKeyImageAutolinking::createOneKeyIcon();
|
|
56
|
-
_hybridView = std::dynamic_pointer_cast<HybridOneKeyIconSpecSwift>(hybridView);
|
|
57
|
-
[self updateView];
|
|
58
|
-
}
|
|
59
|
-
return self;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
- (void) updateView {
|
|
63
|
-
// 1. Get Swift part
|
|
64
|
-
OneKeyImage::HybridOneKeyIconSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
65
|
-
|
|
66
|
-
// 2. Get UIView*
|
|
67
|
-
void* viewUnsafe = swiftPart.getView();
|
|
68
|
-
UIView* view = (__bridge_transfer UIView*) viewUnsafe;
|
|
69
|
-
|
|
70
|
-
// 3. Update RCTViewComponentView's [contentView]
|
|
71
|
-
[self setContentView:view];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
- (void) notifyOnDropView {
|
|
75
|
-
// A recycled component can later be invalidated. Notify only once per mount.
|
|
76
|
-
if (_didDropView) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
OneKeyImage::HybridOneKeyIconSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
80
|
-
swiftPart.onDropView();
|
|
81
|
-
_didDropView = YES;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
- (void) updateProps:(const std::shared_ptr<const react::Props>&)props
|
|
85
|
-
oldProps:(const std::shared_ptr<const react::Props>&)oldProps {
|
|
86
|
-
// A props update marks a newly mounted or still-active component.
|
|
87
|
-
_didDropView = NO;
|
|
88
|
-
|
|
89
|
-
// 1. Downcast props
|
|
90
|
-
const auto& newViewProps = *std::static_pointer_cast<const HybridOneKeyIconProps>(props);
|
|
91
|
-
const auto* oldViewProps = static_cast<const HybridOneKeyIconProps*>(oldProps.get());
|
|
92
|
-
OneKeyImage::HybridOneKeyIconSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
93
|
-
|
|
94
|
-
// 2. Update only props that differ from the previous Props snapshot.
|
|
95
|
-
const bool hasTransactionPropChanges = oldViewProps == nullptr
|
|
96
|
-
? newViewProps.hasAnyProvidedProps()
|
|
97
|
-
: !newViewProps.hasSameProps(*oldViewProps);
|
|
98
|
-
if (hasTransactionPropChanges) {
|
|
99
|
-
swiftPart.beforeUpdate();
|
|
100
|
-
|
|
101
|
-
// iconName: optional
|
|
102
|
-
if (oldViewProps == nullptr
|
|
103
|
-
? newViewProps.iconName.isProvided()
|
|
104
|
-
: !newViewProps.iconName.hasSameValue(oldViewProps->iconName)) {
|
|
105
|
-
swiftPart.setIconName(newViewProps.iconName.get());
|
|
106
|
-
}
|
|
107
|
-
// resolvedColor: optional
|
|
108
|
-
if (oldViewProps == nullptr
|
|
109
|
-
? newViewProps.resolvedColor.isProvided()
|
|
110
|
-
: !newViewProps.resolvedColor.hasSameValue(oldViewProps->resolvedColor)) {
|
|
111
|
-
swiftPart.setResolvedColor(newViewProps.resolvedColor.get());
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Update hybridRef if it changed
|
|
115
|
-
if (oldViewProps == nullptr
|
|
116
|
-
? newViewProps.hybridRef.isProvided()
|
|
117
|
-
: !newViewProps.hybridRef.hasSameValue(oldViewProps->hybridRef)) {
|
|
118
|
-
// hybridRef changed - call it with new this
|
|
119
|
-
const auto& maybeFunc = newViewProps.hybridRef.get();
|
|
120
|
-
if (maybeFunc.has_value()) {
|
|
121
|
-
maybeFunc.value()(_hybridView);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
swiftPart.afterUpdate();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// 3. Continue in base class
|
|
129
|
-
[super updateProps:props oldProps:oldProps];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
+ (BOOL)shouldBeRecycled {
|
|
133
|
-
return OneKeyImage::OneKeyImageAutolinking::isOneKeyIconRecyclable();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
- (void)prepareForRecycle {
|
|
137
|
-
[self notifyOnDropView];
|
|
138
|
-
[super prepareForRecycle];
|
|
139
|
-
OneKeyImage::HybridOneKeyIconSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
140
|
-
swiftPart.maybePrepareForRecycle();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
#ifdef ENABLE_RCT_COMPONENT_VIEW_INVALIDATE
|
|
144
|
-
- (void)invalidate {
|
|
145
|
-
[self notifyOnDropView];
|
|
146
|
-
[super invalidate];
|
|
147
|
-
}
|
|
148
|
-
#endif
|
|
149
|
-
|
|
150
|
-
@end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconSpec.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/// See ``HybridOneKeyIconSpec``
|
|
11
|
-
public protocol HybridOneKeyIconSpec_protocol: HybridObject, HybridView {
|
|
12
|
-
// Properties
|
|
13
|
-
var iconName: String? { get set }
|
|
14
|
-
var resolvedColor: String? { get set }
|
|
15
|
-
|
|
16
|
-
// Methods
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public extension HybridOneKeyIconSpec_protocol {
|
|
21
|
-
/// Default implementation of ``HybridObject.toString``
|
|
22
|
-
func toString() -> String {
|
|
23
|
-
return "[HybridObject OneKeyIcon]"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/// See ``HybridOneKeyIconSpec``
|
|
28
|
-
open class HybridOneKeyIconSpec_base {
|
|
29
|
-
private weak var cxxWrapper: HybridOneKeyIconSpec_cxx? = nil
|
|
30
|
-
public init() { }
|
|
31
|
-
public func getCxxWrapper() -> HybridOneKeyIconSpec_cxx {
|
|
32
|
-
#if DEBUG
|
|
33
|
-
guard self is any HybridOneKeyIconSpec else {
|
|
34
|
-
fatalError("`self` is not a `HybridOneKeyIconSpec`! Did you accidentally inherit from `HybridOneKeyIconSpec_base` instead of `HybridOneKeyIconSpec`?")
|
|
35
|
-
}
|
|
36
|
-
#endif
|
|
37
|
-
if let cxxWrapper = self.cxxWrapper {
|
|
38
|
-
return cxxWrapper
|
|
39
|
-
} else {
|
|
40
|
-
let cxxWrapper = HybridOneKeyIconSpec_cxx(self as! any HybridOneKeyIconSpec)
|
|
41
|
-
self.cxxWrapper = cxxWrapper
|
|
42
|
-
return cxxWrapper
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* A Swift base-protocol representing the OneKeyIcon HybridObject.
|
|
49
|
-
* Implement this protocol to create Swift-based instances of OneKeyIcon.
|
|
50
|
-
* ```swift
|
|
51
|
-
* class HybridOneKeyIcon : HybridOneKeyIconSpec {
|
|
52
|
-
* // ...
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
public typealias HybridOneKeyIconSpec = HybridOneKeyIconSpec_protocol & HybridOneKeyIconSpec_base
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconSpec_cxx.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A class implementation that bridges HybridOneKeyIconSpec over to C++.
|
|
12
|
-
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
-
*
|
|
14
|
-
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
-
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
-
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
-
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
-
*/
|
|
19
|
-
open class HybridOneKeyIconSpec_cxx {
|
|
20
|
-
/**
|
|
21
|
-
* The Swift <> C++ bridge's namespace (`margelo::nitro::onekeyimage::bridge::swift`)
|
|
22
|
-
* from `OneKeyImage-Swift-Cxx-Bridge.hpp`.
|
|
23
|
-
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
-
*/
|
|
25
|
-
public typealias bridge = margelo.nitro.onekeyimage.bridge.swift
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Holds an instance of the `HybridOneKeyIconSpec` Swift protocol.
|
|
29
|
-
*/
|
|
30
|
-
private var __implementation: any HybridOneKeyIconSpec
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
-
*/
|
|
35
|
-
private var __cxxPart: bridge.std__weak_ptr_HybridOneKeyIconSpec_
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Create a new `HybridOneKeyIconSpec_cxx` that wraps the given `HybridOneKeyIconSpec`.
|
|
39
|
-
* All properties and methods bridge to C++ types.
|
|
40
|
-
*/
|
|
41
|
-
public init(_ implementation: any HybridOneKeyIconSpec) {
|
|
42
|
-
self.__implementation = implementation
|
|
43
|
-
self.__cxxPart = .init()
|
|
44
|
-
/* no base class */
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get the actual `HybridOneKeyIconSpec` instance this class wraps.
|
|
49
|
-
*/
|
|
50
|
-
@inline(__always)
|
|
51
|
-
public func getHybridOneKeyIconSpec() -> any HybridOneKeyIconSpec {
|
|
52
|
-
return __implementation
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
-
* This acquires one additional strong reference on the object!
|
|
58
|
-
*/
|
|
59
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Casts an unsafe pointer to a `HybridOneKeyIconSpec_cxx`.
|
|
65
|
-
* The pointer has to be a retained opaque `Unmanaged<HybridOneKeyIconSpec_cxx>`.
|
|
66
|
-
* This removes one strong reference from the object!
|
|
67
|
-
*/
|
|
68
|
-
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridOneKeyIconSpec_cxx {
|
|
69
|
-
return Unmanaged<HybridOneKeyIconSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
-
* The C++ part is a `std::shared_ptr<HybridOneKeyIconSpec>`.
|
|
75
|
-
*/
|
|
76
|
-
public func getCxxPart() -> bridge.std__shared_ptr_HybridOneKeyIconSpec_ {
|
|
77
|
-
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
-
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
-
return cachedCxxPart
|
|
80
|
-
} else {
|
|
81
|
-
let newCxxPart = bridge.create_std__shared_ptr_HybridOneKeyIconSpec_(self.toUnsafe())
|
|
82
|
-
__cxxPart = bridge.weakify_std__shared_ptr_HybridOneKeyIconSpec_(newCxxPart)
|
|
83
|
-
return newCxxPart
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
-
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
-
*/
|
|
93
|
-
@inline(__always)
|
|
94
|
-
public var memorySize: Int {
|
|
95
|
-
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Compares this object with the given [other] object for reference equality.
|
|
100
|
-
*/
|
|
101
|
-
@inline(__always)
|
|
102
|
-
public func equals(other: HybridOneKeyIconSpec_cxx) -> Bool {
|
|
103
|
-
return self.__implementation === other.__implementation
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Call dispose() on the Swift class.
|
|
108
|
-
* This _may_ be called manually from JS.
|
|
109
|
-
*/
|
|
110
|
-
@inline(__always)
|
|
111
|
-
public func dispose() {
|
|
112
|
-
self.__implementation.dispose()
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Call toString() on the Swift class.
|
|
117
|
-
*/
|
|
118
|
-
@inline(__always)
|
|
119
|
-
public func toString() -> String {
|
|
120
|
-
return self.__implementation.toString()
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Properties
|
|
124
|
-
public final var iconName: bridge.std__optional_std__string_ {
|
|
125
|
-
@inline(__always)
|
|
126
|
-
get {
|
|
127
|
-
return { () -> bridge.std__optional_std__string_ in
|
|
128
|
-
if let __unwrappedValue = self.__implementation.iconName {
|
|
129
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
130
|
-
} else {
|
|
131
|
-
return .init()
|
|
132
|
-
}
|
|
133
|
-
}()
|
|
134
|
-
}
|
|
135
|
-
@inline(__always)
|
|
136
|
-
set {
|
|
137
|
-
self.__implementation.iconName = { () -> String? in
|
|
138
|
-
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
139
|
-
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
140
|
-
return String(__unwrapped)
|
|
141
|
-
} else {
|
|
142
|
-
return nil
|
|
143
|
-
}
|
|
144
|
-
}()
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
public final var resolvedColor: bridge.std__optional_std__string_ {
|
|
149
|
-
@inline(__always)
|
|
150
|
-
get {
|
|
151
|
-
return { () -> bridge.std__optional_std__string_ in
|
|
152
|
-
if let __unwrappedValue = self.__implementation.resolvedColor {
|
|
153
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
154
|
-
} else {
|
|
155
|
-
return .init()
|
|
156
|
-
}
|
|
157
|
-
}()
|
|
158
|
-
}
|
|
159
|
-
@inline(__always)
|
|
160
|
-
set {
|
|
161
|
-
self.__implementation.resolvedColor = { () -> String? in
|
|
162
|
-
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
163
|
-
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
164
|
-
return String(__unwrapped)
|
|
165
|
-
} else {
|
|
166
|
-
return nil
|
|
167
|
-
}
|
|
168
|
-
}()
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Methods
|
|
173
|
-
public final func getView() -> UnsafeMutableRawPointer {
|
|
174
|
-
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
public final func beforeUpdate() {
|
|
178
|
-
__implementation.beforeUpdate()
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
public final func afterUpdate() {
|
|
182
|
-
__implementation.afterUpdate()
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
public final func maybePrepareForRecycle() {
|
|
186
|
-
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
187
|
-
recyclable.prepareForRecycle()
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
public final func onDropView() {
|
|
191
|
-
__implementation.onDropView()
|
|
192
|
-
}
|
|
193
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconSpec.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "HybridOneKeyIconSpec.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::onekeyimage {
|
|
11
|
-
|
|
12
|
-
void HybridOneKeyIconSpec::loadHybridMethods() {
|
|
13
|
-
// load base methods/properties
|
|
14
|
-
HybridObject::loadHybridMethods();
|
|
15
|
-
// load custom methods/properties
|
|
16
|
-
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridGetter("iconName", &HybridOneKeyIconSpec::getIconName);
|
|
18
|
-
prototype.registerHybridSetter("iconName", &HybridOneKeyIconSpec::setIconName);
|
|
19
|
-
prototype.registerHybridGetter("resolvedColor", &HybridOneKeyIconSpec::getResolvedColor);
|
|
20
|
-
prototype.registerHybridSetter("resolvedColor", &HybridOneKeyIconSpec::setResolvedColor);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
} // namespace margelo::nitro::onekeyimage
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconSpec.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
-
#include <NitroModules/HybridObject.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#include <string>
|
|
19
|
-
#include <optional>
|
|
20
|
-
|
|
21
|
-
namespace margelo::nitro::onekeyimage {
|
|
22
|
-
|
|
23
|
-
using namespace margelo::nitro;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* An abstract base class for `OneKeyIcon`
|
|
27
|
-
* Inherit this class to create instances of `HybridOneKeyIconSpec` in C++.
|
|
28
|
-
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
29
|
-
* @example
|
|
30
|
-
* ```cpp
|
|
31
|
-
* class HybridOneKeyIcon: public HybridOneKeyIconSpec {
|
|
32
|
-
* public:
|
|
33
|
-
* HybridOneKeyIcon(...): HybridObject(TAG) { ... }
|
|
34
|
-
* // ...
|
|
35
|
-
* };
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
class HybridOneKeyIconSpec: public virtual HybridObject {
|
|
39
|
-
public:
|
|
40
|
-
// Constructor
|
|
41
|
-
explicit HybridOneKeyIconSpec(): HybridObject(TAG) { }
|
|
42
|
-
|
|
43
|
-
// Destructor
|
|
44
|
-
~HybridOneKeyIconSpec() override = default;
|
|
45
|
-
|
|
46
|
-
public:
|
|
47
|
-
// Properties
|
|
48
|
-
virtual std::optional<std::string> getIconName() = 0;
|
|
49
|
-
virtual void setIconName(const std::optional<std::string>& iconName) = 0;
|
|
50
|
-
virtual std::optional<std::string> getResolvedColor() = 0;
|
|
51
|
-
virtual void setResolvedColor(const std::optional<std::string>& resolvedColor) = 0;
|
|
52
|
-
|
|
53
|
-
public:
|
|
54
|
-
// Methods
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
protected:
|
|
58
|
-
// Hybrid Setup
|
|
59
|
-
void loadHybridMethods() override;
|
|
60
|
-
|
|
61
|
-
protected:
|
|
62
|
-
// Tag for logging
|
|
63
|
-
static constexpr auto TAG = "OneKeyIcon";
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
} // namespace margelo::nitro::onekeyimage
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconComponent.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "HybridOneKeyIconComponent.hpp"
|
|
9
|
-
|
|
10
|
-
#include <NitroModules/NitroHash.hpp>
|
|
11
|
-
#include <NitroModules/ReactProp.hpp>
|
|
12
|
-
|
|
13
|
-
namespace margelo::nitro::onekeyimage::views {
|
|
14
|
-
|
|
15
|
-
using namespace facebook;
|
|
16
|
-
|
|
17
|
-
extern const char HybridOneKeyIconComponentName[] = "OneKeyIcon";
|
|
18
|
-
|
|
19
|
-
HybridOneKeyIconProps::HybridOneKeyIconProps(const react::PropsParserContext& context,
|
|
20
|
-
const HybridOneKeyIconProps& sourceProps,
|
|
21
|
-
const react::RawProps& rawProps):
|
|
22
|
-
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
23
|
-
iconName(nitro::ReactProp<std::optional<std::string>>::fromRawValue("OneKeyIcon", "iconName", rawProps, sourceProps.iconName)),
|
|
24
|
-
resolvedColor(nitro::ReactProp<std::optional<std::string>>::fromRawValue("OneKeyIcon", "resolvedColor", rawProps, sourceProps.resolvedColor)),
|
|
25
|
-
hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridOneKeyIconSpec>& /* ref */)>>>::fromRawValue("OneKeyIcon", "hybridRef", rawProps, sourceProps.hybridRef)) { }
|
|
26
|
-
|
|
27
|
-
bool HybridOneKeyIconProps::filterObjectKeys(const std::string& propName) {
|
|
28
|
-
switch (hashString(propName)) {
|
|
29
|
-
case hashString("iconName"): return true;
|
|
30
|
-
case hashString("resolvedColor"): return true;
|
|
31
|
-
case hashString("hybridRef"): return true;
|
|
32
|
-
default: return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
} // namespace margelo::nitro::onekeyimage::views
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridOneKeyIconComponent.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <NitroModules/ReactProp.hpp>
|
|
11
|
-
#include <NitroModules/ViewComponentDescriptor.hpp>
|
|
12
|
-
#include <NitroModules/ViewPropsHolderState.hpp>
|
|
13
|
-
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
14
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
15
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
-
#include <react/renderer/core/RawProps.h>
|
|
17
|
-
|
|
18
|
-
#include <string>
|
|
19
|
-
|
|
20
|
-
#include <string>
|
|
21
|
-
#include <optional>
|
|
22
|
-
#include <memory>
|
|
23
|
-
#include "HybridOneKeyIconSpec.hpp"
|
|
24
|
-
#include <functional>
|
|
25
|
-
|
|
26
|
-
namespace margelo::nitro::onekeyimage::views {
|
|
27
|
-
|
|
28
|
-
using namespace facebook;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The name of the actual native View.
|
|
32
|
-
*/
|
|
33
|
-
extern const char HybridOneKeyIconComponentName[];
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Props for the "OneKeyIcon" View.
|
|
37
|
-
*/
|
|
38
|
-
class HybridOneKeyIconProps final: public react::ViewProps {
|
|
39
|
-
public:
|
|
40
|
-
HybridOneKeyIconProps() = default;
|
|
41
|
-
HybridOneKeyIconProps(const react::PropsParserContext& context,
|
|
42
|
-
const HybridOneKeyIconProps& sourceProps,
|
|
43
|
-
const react::RawProps& rawProps);
|
|
44
|
-
|
|
45
|
-
public:
|
|
46
|
-
nitro::ReactProp<std::optional<std::string>> iconName;
|
|
47
|
-
nitro::ReactProp<std::optional<std::string>> resolvedColor;
|
|
48
|
-
nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridOneKeyIconSpec>& /* ref */)>>> hybridRef;
|
|
49
|
-
|
|
50
|
-
[[nodiscard]]
|
|
51
|
-
bool hasSameProps(const HybridOneKeyIconProps& other) const noexcept {
|
|
52
|
-
return iconName.hasSameValue(other.iconName) &&
|
|
53
|
-
resolvedColor.hasSameValue(other.resolvedColor) &&
|
|
54
|
-
hybridRef.hasSameValue(other.hybridRef);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
[[nodiscard]]
|
|
58
|
-
bool hasAnyProvidedProps() const noexcept {
|
|
59
|
-
return iconName.isProvided() ||
|
|
60
|
-
resolvedColor.isProvided() ||
|
|
61
|
-
hybridRef.isProvided();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private:
|
|
65
|
-
static bool filterObjectKeys(const std::string& propName);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* State for the "OneKeyIcon" View.
|
|
70
|
-
*/
|
|
71
|
-
using HybridOneKeyIconState = nitro::ViewPropsHolderState<HybridOneKeyIconProps>;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* The Shadow Node for the "OneKeyIcon" View.
|
|
75
|
-
*/
|
|
76
|
-
using HybridOneKeyIconShadowNode = react::ConcreteViewShadowNode<HybridOneKeyIconComponentName /* "HybridOneKeyIcon" */,
|
|
77
|
-
HybridOneKeyIconProps /* custom props */,
|
|
78
|
-
react::ViewEventEmitter /* default */,
|
|
79
|
-
HybridOneKeyIconState /* custom state */>;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The Component Descriptor for the "OneKeyIcon" View.
|
|
83
|
-
*/
|
|
84
|
-
using HybridOneKeyIconComponentDescriptor = nitro::ViewComponentDescriptor<HybridOneKeyIconShadowNode>;
|
|
85
|
-
|
|
86
|
-
/* The actual view for "OneKeyIcon" needs to be implemented in platform-specific code. */
|
|
87
|
-
|
|
88
|
-
} // namespace margelo::nitro::onekeyimage::views
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HybridView, HybridViewProps } from 'react-native-nitro-modules';
|
|
2
|
-
export interface OneKeyIconNativeProps extends HybridViewProps {
|
|
3
|
-
iconName?: string;
|
|
4
|
-
resolvedColor?: string;
|
|
5
|
-
}
|
|
6
|
-
export type OneKeyIcon = HybridView<OneKeyIconNativeProps>;
|
|
7
|
-
//# sourceMappingURL=OneKeyIcon.nitro.d.ts.map
|