@onekeyfe/react-native-auto-size-input 1.0.1
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/AutoSizeInput.podspec +29 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +128 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInput.kt +565 -0
- package/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInputPackage.kt +29 -0
- package/ios/AutoSizeInput.swift +620 -0
- package/lib/module/AutoSizeInput.nitro.js +4 -0
- package/lib/module/AutoSizeInput.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/nitrogen/generated/android/autosizeinput+autolinking.cmake +83 -0
- package/lib/nitrogen/generated/android/autosizeinput+autolinking.gradle +27 -0
- package/lib/nitrogen/generated/android/autosizeinputOnLoad.cpp +50 -0
- package/lib/nitrogen/generated/android/autosizeinputOnLoad.hpp +25 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +317 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +117 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +156 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +49 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +80 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +80 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +239 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +35 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +50 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +23 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +60 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +49 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +173 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +46 -0
- package/lib/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +33 -0
- package/lib/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +25 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +11 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +263 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +221 -0
- package/lib/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +82 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +764 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +74 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +116 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +387 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +133 -0
- package/lib/nitrogen/generated/shared/json/AutoSizeInputConfig.json +35 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts +35 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/autosizeinput+autolinking.cmake +83 -0
- package/nitrogen/generated/android/autosizeinput+autolinking.gradle +27 -0
- package/nitrogen/generated/android/autosizeinputOnLoad.cpp +50 -0
- package/nitrogen/generated/android/autosizeinputOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +317 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +117 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +156 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +239 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +60 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +173 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +46 -0
- package/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +33 -0
- package/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +263 -0
- package/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +221 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +82 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +764 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +74 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +387 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +133 -0
- package/nitrogen/generated/shared/json/AutoSizeInputConfig.json +35 -0
- package/package.json +170 -0
- package/src/AutoSizeInput.nitro.ts +56 -0
- package/src/index.tsx +13 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AutoSizeInputAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "AutoSizeInput-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridAutoSizeInputSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface AutoSizeInputAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation AutoSizeInputAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::autosizeinput;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"AutoSizeInput",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridAutoSizeInputSpec> hybridObject = AutoSizeInput::AutoSizeInputAutolinking::createAutoSizeInput();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AutoSizeInputAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
public final class AutoSizeInputAutolinking {
|
|
9
|
+
public typealias bridge = margelo.nitro.autosizeinput.bridge.swift
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of a Swift class that implements `HybridAutoSizeInputSpec`,
|
|
13
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridAutoSizeInputSpec_cxx`)
|
|
14
|
+
*
|
|
15
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `HybridAutoSizeInput`).
|
|
17
|
+
*/
|
|
18
|
+
public static func createAutoSizeInput() -> bridge.std__shared_ptr_HybridAutoSizeInputSpec_ {
|
|
19
|
+
let hybridObject = HybridAutoSizeInput()
|
|
20
|
+
return { () -> bridge.std__shared_ptr_HybridAutoSizeInputSpec_ in
|
|
21
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
22
|
+
return __cxxWrapped.getCxxPart()
|
|
23
|
+
}()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAutoSizeInputSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::autosizeinput {
|
|
11
|
+
} // namespace margelo::nitro::autosizeinput
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridAutoSizeInputSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridAutoSizeInputSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace AutoSizeInput { class HybridAutoSizeInputSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <optional>
|
|
19
|
+
#include <functional>
|
|
20
|
+
|
|
21
|
+
#include "AutoSizeInput-Swift-Cxx-Umbrella.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::autosizeinput {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ part of HybridAutoSizeInputSpec_cxx.swift.
|
|
27
|
+
*
|
|
28
|
+
* HybridAutoSizeInputSpecSwift (C++) accesses HybridAutoSizeInputSpec_cxx (Swift), and might
|
|
29
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
30
|
+
*
|
|
31
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
32
|
+
* the future, HybridAutoSizeInputSpec_cxx can directly inherit from the C++ class HybridAutoSizeInputSpec
|
|
33
|
+
* to simplify the whole structure and memory management.
|
|
34
|
+
*/
|
|
35
|
+
class HybridAutoSizeInputSpecSwift: public virtual HybridAutoSizeInputSpec {
|
|
36
|
+
public:
|
|
37
|
+
// Constructor from a Swift instance
|
|
38
|
+
explicit HybridAutoSizeInputSpecSwift(const AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart):
|
|
39
|
+
HybridObject(HybridAutoSizeInputSpec::TAG),
|
|
40
|
+
_swiftPart(swiftPart) { }
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
// Get the Swift part
|
|
44
|
+
inline AutoSizeInput::HybridAutoSizeInputSpec_cxx& getSwiftPart() noexcept {
|
|
45
|
+
return _swiftPart;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
50
|
+
return _swiftPart.getMemorySize();
|
|
51
|
+
}
|
|
52
|
+
void dispose() noexcept override {
|
|
53
|
+
_swiftPart.dispose();
|
|
54
|
+
}
|
|
55
|
+
std::string toString() override {
|
|
56
|
+
return _swiftPart.toString();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
// Properties
|
|
61
|
+
inline std::optional<std::string> getText() noexcept override {
|
|
62
|
+
auto __result = _swiftPart.getText();
|
|
63
|
+
return __result;
|
|
64
|
+
}
|
|
65
|
+
inline void setText(const std::optional<std::string>& text) noexcept override {
|
|
66
|
+
_swiftPart.setText(text);
|
|
67
|
+
}
|
|
68
|
+
inline std::optional<std::string> getPrefix() noexcept override {
|
|
69
|
+
auto __result = _swiftPart.getPrefix();
|
|
70
|
+
return __result;
|
|
71
|
+
}
|
|
72
|
+
inline void setPrefix(const std::optional<std::string>& prefix) noexcept override {
|
|
73
|
+
_swiftPart.setPrefix(prefix);
|
|
74
|
+
}
|
|
75
|
+
inline std::optional<std::string> getSuffix() noexcept override {
|
|
76
|
+
auto __result = _swiftPart.getSuffix();
|
|
77
|
+
return __result;
|
|
78
|
+
}
|
|
79
|
+
inline void setSuffix(const std::optional<std::string>& suffix) noexcept override {
|
|
80
|
+
_swiftPart.setSuffix(suffix);
|
|
81
|
+
}
|
|
82
|
+
inline std::optional<std::string> getPlaceholder() noexcept override {
|
|
83
|
+
auto __result = _swiftPart.getPlaceholder();
|
|
84
|
+
return __result;
|
|
85
|
+
}
|
|
86
|
+
inline void setPlaceholder(const std::optional<std::string>& placeholder) noexcept override {
|
|
87
|
+
_swiftPart.setPlaceholder(placeholder);
|
|
88
|
+
}
|
|
89
|
+
inline std::optional<double> getFontSize() noexcept override {
|
|
90
|
+
auto __result = _swiftPart.getFontSize();
|
|
91
|
+
return __result;
|
|
92
|
+
}
|
|
93
|
+
inline void setFontSize(std::optional<double> fontSize) noexcept override {
|
|
94
|
+
_swiftPart.setFontSize(fontSize);
|
|
95
|
+
}
|
|
96
|
+
inline std::optional<double> getMinFontSize() noexcept override {
|
|
97
|
+
auto __result = _swiftPart.getMinFontSize();
|
|
98
|
+
return __result;
|
|
99
|
+
}
|
|
100
|
+
inline void setMinFontSize(std::optional<double> minFontSize) noexcept override {
|
|
101
|
+
_swiftPart.setMinFontSize(minFontSize);
|
|
102
|
+
}
|
|
103
|
+
inline std::optional<bool> getMultiline() noexcept override {
|
|
104
|
+
auto __result = _swiftPart.getMultiline();
|
|
105
|
+
return __result;
|
|
106
|
+
}
|
|
107
|
+
inline void setMultiline(std::optional<bool> multiline) noexcept override {
|
|
108
|
+
_swiftPart.setMultiline(multiline);
|
|
109
|
+
}
|
|
110
|
+
inline std::optional<double> getMaxNumberOfLines() noexcept override {
|
|
111
|
+
auto __result = _swiftPart.getMaxNumberOfLines();
|
|
112
|
+
return __result;
|
|
113
|
+
}
|
|
114
|
+
inline void setMaxNumberOfLines(std::optional<double> maxNumberOfLines) noexcept override {
|
|
115
|
+
_swiftPart.setMaxNumberOfLines(maxNumberOfLines);
|
|
116
|
+
}
|
|
117
|
+
inline std::optional<std::string> getTextColor() noexcept override {
|
|
118
|
+
auto __result = _swiftPart.getTextColor();
|
|
119
|
+
return __result;
|
|
120
|
+
}
|
|
121
|
+
inline void setTextColor(const std::optional<std::string>& textColor) noexcept override {
|
|
122
|
+
_swiftPart.setTextColor(textColor);
|
|
123
|
+
}
|
|
124
|
+
inline std::optional<std::string> getPrefixColor() noexcept override {
|
|
125
|
+
auto __result = _swiftPart.getPrefixColor();
|
|
126
|
+
return __result;
|
|
127
|
+
}
|
|
128
|
+
inline void setPrefixColor(const std::optional<std::string>& prefixColor) noexcept override {
|
|
129
|
+
_swiftPart.setPrefixColor(prefixColor);
|
|
130
|
+
}
|
|
131
|
+
inline std::optional<std::string> getSuffixColor() noexcept override {
|
|
132
|
+
auto __result = _swiftPart.getSuffixColor();
|
|
133
|
+
return __result;
|
|
134
|
+
}
|
|
135
|
+
inline void setSuffixColor(const std::optional<std::string>& suffixColor) noexcept override {
|
|
136
|
+
_swiftPart.setSuffixColor(suffixColor);
|
|
137
|
+
}
|
|
138
|
+
inline std::optional<std::string> getPlaceholderColor() noexcept override {
|
|
139
|
+
auto __result = _swiftPart.getPlaceholderColor();
|
|
140
|
+
return __result;
|
|
141
|
+
}
|
|
142
|
+
inline void setPlaceholderColor(const std::optional<std::string>& placeholderColor) noexcept override {
|
|
143
|
+
_swiftPart.setPlaceholderColor(placeholderColor);
|
|
144
|
+
}
|
|
145
|
+
inline std::optional<std::string> getTextAlign() noexcept override {
|
|
146
|
+
auto __result = _swiftPart.getTextAlign();
|
|
147
|
+
return __result;
|
|
148
|
+
}
|
|
149
|
+
inline void setTextAlign(const std::optional<std::string>& textAlign) noexcept override {
|
|
150
|
+
_swiftPart.setTextAlign(textAlign);
|
|
151
|
+
}
|
|
152
|
+
inline std::optional<std::string> getFontFamily() noexcept override {
|
|
153
|
+
auto __result = _swiftPart.getFontFamily();
|
|
154
|
+
return __result;
|
|
155
|
+
}
|
|
156
|
+
inline void setFontFamily(const std::optional<std::string>& fontFamily) noexcept override {
|
|
157
|
+
_swiftPart.setFontFamily(fontFamily);
|
|
158
|
+
}
|
|
159
|
+
inline std::optional<std::string> getFontWeight() noexcept override {
|
|
160
|
+
auto __result = _swiftPart.getFontWeight();
|
|
161
|
+
return __result;
|
|
162
|
+
}
|
|
163
|
+
inline void setFontWeight(const std::optional<std::string>& fontWeight) noexcept override {
|
|
164
|
+
_swiftPart.setFontWeight(fontWeight);
|
|
165
|
+
}
|
|
166
|
+
inline std::optional<bool> getEditable() noexcept override {
|
|
167
|
+
auto __result = _swiftPart.getEditable();
|
|
168
|
+
return __result;
|
|
169
|
+
}
|
|
170
|
+
inline void setEditable(std::optional<bool> editable) noexcept override {
|
|
171
|
+
_swiftPart.setEditable(editable);
|
|
172
|
+
}
|
|
173
|
+
inline std::optional<std::string> getKeyboardType() noexcept override {
|
|
174
|
+
auto __result = _swiftPart.getKeyboardType();
|
|
175
|
+
return __result;
|
|
176
|
+
}
|
|
177
|
+
inline void setKeyboardType(const std::optional<std::string>& keyboardType) noexcept override {
|
|
178
|
+
_swiftPart.setKeyboardType(keyboardType);
|
|
179
|
+
}
|
|
180
|
+
inline std::optional<std::string> getReturnKeyType() noexcept override {
|
|
181
|
+
auto __result = _swiftPart.getReturnKeyType();
|
|
182
|
+
return __result;
|
|
183
|
+
}
|
|
184
|
+
inline void setReturnKeyType(const std::optional<std::string>& returnKeyType) noexcept override {
|
|
185
|
+
_swiftPart.setReturnKeyType(returnKeyType);
|
|
186
|
+
}
|
|
187
|
+
inline std::optional<bool> getAutoCorrect() noexcept override {
|
|
188
|
+
auto __result = _swiftPart.getAutoCorrect();
|
|
189
|
+
return __result;
|
|
190
|
+
}
|
|
191
|
+
inline void setAutoCorrect(std::optional<bool> autoCorrect) noexcept override {
|
|
192
|
+
_swiftPart.setAutoCorrect(autoCorrect);
|
|
193
|
+
}
|
|
194
|
+
inline std::optional<std::string> getAutoCapitalize() noexcept override {
|
|
195
|
+
auto __result = _swiftPart.getAutoCapitalize();
|
|
196
|
+
return __result;
|
|
197
|
+
}
|
|
198
|
+
inline void setAutoCapitalize(const std::optional<std::string>& autoCapitalize) noexcept override {
|
|
199
|
+
_swiftPart.setAutoCapitalize(autoCapitalize);
|
|
200
|
+
}
|
|
201
|
+
inline std::optional<std::string> getSelectionColor() noexcept override {
|
|
202
|
+
auto __result = _swiftPart.getSelectionColor();
|
|
203
|
+
return __result;
|
|
204
|
+
}
|
|
205
|
+
inline void setSelectionColor(const std::optional<std::string>& selectionColor) noexcept override {
|
|
206
|
+
_swiftPart.setSelectionColor(selectionColor);
|
|
207
|
+
}
|
|
208
|
+
inline std::optional<double> getPrefixMarginRight() noexcept override {
|
|
209
|
+
auto __result = _swiftPart.getPrefixMarginRight();
|
|
210
|
+
return __result;
|
|
211
|
+
}
|
|
212
|
+
inline void setPrefixMarginRight(std::optional<double> prefixMarginRight) noexcept override {
|
|
213
|
+
_swiftPart.setPrefixMarginRight(prefixMarginRight);
|
|
214
|
+
}
|
|
215
|
+
inline std::optional<double> getSuffixMarginLeft() noexcept override {
|
|
216
|
+
auto __result = _swiftPart.getSuffixMarginLeft();
|
|
217
|
+
return __result;
|
|
218
|
+
}
|
|
219
|
+
inline void setSuffixMarginLeft(std::optional<double> suffixMarginLeft) noexcept override {
|
|
220
|
+
_swiftPart.setSuffixMarginLeft(suffixMarginLeft);
|
|
221
|
+
}
|
|
222
|
+
inline std::optional<std::function<void(const std::string& /* text */)>> getOnChangeText() noexcept override {
|
|
223
|
+
auto __result = _swiftPart.getOnChangeText();
|
|
224
|
+
return __result;
|
|
225
|
+
}
|
|
226
|
+
inline void setOnChangeText(const std::optional<std::function<void(const std::string& /* text */)>>& onChangeText) noexcept override {
|
|
227
|
+
_swiftPart.setOnChangeText(onChangeText);
|
|
228
|
+
}
|
|
229
|
+
inline std::optional<std::function<void()>> getOnFocus() noexcept override {
|
|
230
|
+
auto __result = _swiftPart.getOnFocus();
|
|
231
|
+
return __result;
|
|
232
|
+
}
|
|
233
|
+
inline void setOnFocus(const std::optional<std::function<void()>>& onFocus) noexcept override {
|
|
234
|
+
_swiftPart.setOnFocus(onFocus);
|
|
235
|
+
}
|
|
236
|
+
inline std::optional<std::function<void()>> getOnBlur() noexcept override {
|
|
237
|
+
auto __result = _swiftPart.getOnBlur();
|
|
238
|
+
return __result;
|
|
239
|
+
}
|
|
240
|
+
inline void setOnBlur(const std::optional<std::function<void()>>& onBlur) noexcept override {
|
|
241
|
+
_swiftPart.setOnBlur(onBlur);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
public:
|
|
245
|
+
// Methods
|
|
246
|
+
inline void focus() override {
|
|
247
|
+
auto __result = _swiftPart.focus();
|
|
248
|
+
if (__result.hasError()) [[unlikely]] {
|
|
249
|
+
std::rethrow_exception(__result.error());
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
inline void blur() override {
|
|
253
|
+
auto __result = _swiftPart.blur();
|
|
254
|
+
if (__result.hasError()) [[unlikely]] {
|
|
255
|
+
std::rethrow_exception(__result.error());
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
private:
|
|
260
|
+
AutoSizeInput::HybridAutoSizeInputSpec_cxx _swiftPart;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
} // namespace margelo::nitro::autosizeinput
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputComponent.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import "HybridAutoSizeInputComponent.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 "HybridAutoSizeInputSpecSwift.hpp"
|
|
18
|
+
#import "AutoSizeInput-Swift-Cxx-Umbrella.hpp"
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
using namespace margelo::nitro::autosizeinput;
|
|
22
|
+
using namespace margelo::nitro::autosizeinput::views;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents the React Native View holder for the Nitro "AutoSizeInput" HybridView.
|
|
26
|
+
*/
|
|
27
|
+
@interface HybridAutoSizeInputComponent: RCTViewComponentView
|
|
28
|
+
@end
|
|
29
|
+
|
|
30
|
+
@implementation HybridAutoSizeInputComponent {
|
|
31
|
+
std::shared_ptr<HybridAutoSizeInputSpecSwift> _hybridView;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
+ (void) load {
|
|
35
|
+
[super load];
|
|
36
|
+
[RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:[HybridAutoSizeInputComponent class]];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
+ (react::ComponentDescriptorProvider) componentDescriptorProvider {
|
|
40
|
+
return react::concreteComponentDescriptorProvider<HybridAutoSizeInputComponentDescriptor>();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (instancetype) init {
|
|
44
|
+
if (self = [super init]) {
|
|
45
|
+
std::shared_ptr<HybridAutoSizeInputSpec> hybridView = AutoSizeInput::AutoSizeInputAutolinking::createAutoSizeInput();
|
|
46
|
+
_hybridView = std::dynamic_pointer_cast<HybridAutoSizeInputSpecSwift>(hybridView);
|
|
47
|
+
[self updateView];
|
|
48
|
+
}
|
|
49
|
+
return self;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
- (void) updateView {
|
|
53
|
+
// 1. Get Swift part
|
|
54
|
+
AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
55
|
+
|
|
56
|
+
// 2. Get UIView*
|
|
57
|
+
void* viewUnsafe = swiftPart.getView();
|
|
58
|
+
UIView* view = (__bridge_transfer UIView*) viewUnsafe;
|
|
59
|
+
|
|
60
|
+
// 3. Update RCTViewComponentView's [contentView]
|
|
61
|
+
[self setContentView:view];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void) updateProps:(const std::shared_ptr<const react::Props>&)props
|
|
65
|
+
oldProps:(const std::shared_ptr<const react::Props>&)oldProps {
|
|
66
|
+
// 1. Downcast props
|
|
67
|
+
const auto& newViewPropsConst = *std::static_pointer_cast<HybridAutoSizeInputProps const>(props);
|
|
68
|
+
auto& newViewProps = const_cast<HybridAutoSizeInputProps&>(newViewPropsConst);
|
|
69
|
+
AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
70
|
+
|
|
71
|
+
// 2. Update each prop individually
|
|
72
|
+
swiftPart.beforeUpdate();
|
|
73
|
+
|
|
74
|
+
// text: optional
|
|
75
|
+
if (newViewProps.text.isDirty) {
|
|
76
|
+
swiftPart.setText(newViewProps.text.value);
|
|
77
|
+
newViewProps.text.isDirty = false;
|
|
78
|
+
}
|
|
79
|
+
// prefix: optional
|
|
80
|
+
if (newViewProps.prefix.isDirty) {
|
|
81
|
+
swiftPart.setPrefix(newViewProps.prefix.value);
|
|
82
|
+
newViewProps.prefix.isDirty = false;
|
|
83
|
+
}
|
|
84
|
+
// suffix: optional
|
|
85
|
+
if (newViewProps.suffix.isDirty) {
|
|
86
|
+
swiftPart.setSuffix(newViewProps.suffix.value);
|
|
87
|
+
newViewProps.suffix.isDirty = false;
|
|
88
|
+
}
|
|
89
|
+
// placeholder: optional
|
|
90
|
+
if (newViewProps.placeholder.isDirty) {
|
|
91
|
+
swiftPart.setPlaceholder(newViewProps.placeholder.value);
|
|
92
|
+
newViewProps.placeholder.isDirty = false;
|
|
93
|
+
}
|
|
94
|
+
// fontSize: optional
|
|
95
|
+
if (newViewProps.fontSize.isDirty) {
|
|
96
|
+
swiftPart.setFontSize(newViewProps.fontSize.value);
|
|
97
|
+
newViewProps.fontSize.isDirty = false;
|
|
98
|
+
}
|
|
99
|
+
// minFontSize: optional
|
|
100
|
+
if (newViewProps.minFontSize.isDirty) {
|
|
101
|
+
swiftPart.setMinFontSize(newViewProps.minFontSize.value);
|
|
102
|
+
newViewProps.minFontSize.isDirty = false;
|
|
103
|
+
}
|
|
104
|
+
// multiline: optional
|
|
105
|
+
if (newViewProps.multiline.isDirty) {
|
|
106
|
+
swiftPart.setMultiline(newViewProps.multiline.value);
|
|
107
|
+
newViewProps.multiline.isDirty = false;
|
|
108
|
+
}
|
|
109
|
+
// maxNumberOfLines: optional
|
|
110
|
+
if (newViewProps.maxNumberOfLines.isDirty) {
|
|
111
|
+
swiftPart.setMaxNumberOfLines(newViewProps.maxNumberOfLines.value);
|
|
112
|
+
newViewProps.maxNumberOfLines.isDirty = false;
|
|
113
|
+
}
|
|
114
|
+
// textColor: optional
|
|
115
|
+
if (newViewProps.textColor.isDirty) {
|
|
116
|
+
swiftPart.setTextColor(newViewProps.textColor.value);
|
|
117
|
+
newViewProps.textColor.isDirty = false;
|
|
118
|
+
}
|
|
119
|
+
// prefixColor: optional
|
|
120
|
+
if (newViewProps.prefixColor.isDirty) {
|
|
121
|
+
swiftPart.setPrefixColor(newViewProps.prefixColor.value);
|
|
122
|
+
newViewProps.prefixColor.isDirty = false;
|
|
123
|
+
}
|
|
124
|
+
// suffixColor: optional
|
|
125
|
+
if (newViewProps.suffixColor.isDirty) {
|
|
126
|
+
swiftPart.setSuffixColor(newViewProps.suffixColor.value);
|
|
127
|
+
newViewProps.suffixColor.isDirty = false;
|
|
128
|
+
}
|
|
129
|
+
// placeholderColor: optional
|
|
130
|
+
if (newViewProps.placeholderColor.isDirty) {
|
|
131
|
+
swiftPart.setPlaceholderColor(newViewProps.placeholderColor.value);
|
|
132
|
+
newViewProps.placeholderColor.isDirty = false;
|
|
133
|
+
}
|
|
134
|
+
// textAlign: optional
|
|
135
|
+
if (newViewProps.textAlign.isDirty) {
|
|
136
|
+
swiftPart.setTextAlign(newViewProps.textAlign.value);
|
|
137
|
+
newViewProps.textAlign.isDirty = false;
|
|
138
|
+
}
|
|
139
|
+
// fontFamily: optional
|
|
140
|
+
if (newViewProps.fontFamily.isDirty) {
|
|
141
|
+
swiftPart.setFontFamily(newViewProps.fontFamily.value);
|
|
142
|
+
newViewProps.fontFamily.isDirty = false;
|
|
143
|
+
}
|
|
144
|
+
// fontWeight: optional
|
|
145
|
+
if (newViewProps.fontWeight.isDirty) {
|
|
146
|
+
swiftPart.setFontWeight(newViewProps.fontWeight.value);
|
|
147
|
+
newViewProps.fontWeight.isDirty = false;
|
|
148
|
+
}
|
|
149
|
+
// editable: optional
|
|
150
|
+
if (newViewProps.editable.isDirty) {
|
|
151
|
+
swiftPart.setEditable(newViewProps.editable.value);
|
|
152
|
+
newViewProps.editable.isDirty = false;
|
|
153
|
+
}
|
|
154
|
+
// keyboardType: optional
|
|
155
|
+
if (newViewProps.keyboardType.isDirty) {
|
|
156
|
+
swiftPart.setKeyboardType(newViewProps.keyboardType.value);
|
|
157
|
+
newViewProps.keyboardType.isDirty = false;
|
|
158
|
+
}
|
|
159
|
+
// returnKeyType: optional
|
|
160
|
+
if (newViewProps.returnKeyType.isDirty) {
|
|
161
|
+
swiftPart.setReturnKeyType(newViewProps.returnKeyType.value);
|
|
162
|
+
newViewProps.returnKeyType.isDirty = false;
|
|
163
|
+
}
|
|
164
|
+
// autoCorrect: optional
|
|
165
|
+
if (newViewProps.autoCorrect.isDirty) {
|
|
166
|
+
swiftPart.setAutoCorrect(newViewProps.autoCorrect.value);
|
|
167
|
+
newViewProps.autoCorrect.isDirty = false;
|
|
168
|
+
}
|
|
169
|
+
// autoCapitalize: optional
|
|
170
|
+
if (newViewProps.autoCapitalize.isDirty) {
|
|
171
|
+
swiftPart.setAutoCapitalize(newViewProps.autoCapitalize.value);
|
|
172
|
+
newViewProps.autoCapitalize.isDirty = false;
|
|
173
|
+
}
|
|
174
|
+
// selectionColor: optional
|
|
175
|
+
if (newViewProps.selectionColor.isDirty) {
|
|
176
|
+
swiftPart.setSelectionColor(newViewProps.selectionColor.value);
|
|
177
|
+
newViewProps.selectionColor.isDirty = false;
|
|
178
|
+
}
|
|
179
|
+
// prefixMarginRight: optional
|
|
180
|
+
if (newViewProps.prefixMarginRight.isDirty) {
|
|
181
|
+
swiftPart.setPrefixMarginRight(newViewProps.prefixMarginRight.value);
|
|
182
|
+
newViewProps.prefixMarginRight.isDirty = false;
|
|
183
|
+
}
|
|
184
|
+
// suffixMarginLeft: optional
|
|
185
|
+
if (newViewProps.suffixMarginLeft.isDirty) {
|
|
186
|
+
swiftPart.setSuffixMarginLeft(newViewProps.suffixMarginLeft.value);
|
|
187
|
+
newViewProps.suffixMarginLeft.isDirty = false;
|
|
188
|
+
}
|
|
189
|
+
// onChangeText: optional
|
|
190
|
+
if (newViewProps.onChangeText.isDirty) {
|
|
191
|
+
swiftPart.setOnChangeText(newViewProps.onChangeText.value);
|
|
192
|
+
newViewProps.onChangeText.isDirty = false;
|
|
193
|
+
}
|
|
194
|
+
// onFocus: optional
|
|
195
|
+
if (newViewProps.onFocus.isDirty) {
|
|
196
|
+
swiftPart.setOnFocus(newViewProps.onFocus.value);
|
|
197
|
+
newViewProps.onFocus.isDirty = false;
|
|
198
|
+
}
|
|
199
|
+
// onBlur: optional
|
|
200
|
+
if (newViewProps.onBlur.isDirty) {
|
|
201
|
+
swiftPart.setOnBlur(newViewProps.onBlur.value);
|
|
202
|
+
newViewProps.onBlur.isDirty = false;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
swiftPart.afterUpdate();
|
|
206
|
+
|
|
207
|
+
// 3. Update hybridRef if it changed
|
|
208
|
+
if (newViewProps.hybridRef.isDirty) {
|
|
209
|
+
// hybridRef changed - call it with new this
|
|
210
|
+
const auto& maybeFunc = newViewProps.hybridRef.value;
|
|
211
|
+
if (maybeFunc.has_value()) {
|
|
212
|
+
maybeFunc.value()(_hybridView);
|
|
213
|
+
}
|
|
214
|
+
newViewProps.hybridRef.isDirty = false;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// 4. Continue in base class
|
|
218
|
+
[super updateProps:props oldProps:oldProps];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `() -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void {
|
|
16
|
+
public typealias bridge = margelo.nitro.autosizeinput.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: () -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping () -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call() -> Void {
|
|
26
|
+
self.closure()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
45
|
+
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__string.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ text: String) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_std__string {
|
|
16
|
+
public typealias bridge = margelo.nitro.autosizeinput.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ text: String) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ text: String) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(text: std.string) -> Void {
|
|
26
|
+
self.closure(String(text))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_std__string`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__string>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string {
|
|
45
|
+
return Unmanaged<Func_void_std__string>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|