@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,239 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputSpec.kt
|
|
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
|
+
package com.margelo.nitro.autosizeinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.views.HybridView
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the AutoSizeInput HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of AutoSizeInput.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridAutoSizeInputSpec: HybridView() {
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
private var mHybridData: HybridData = initHybrid()
|
|
29
|
+
|
|
30
|
+
init {
|
|
31
|
+
super.updateNative(mHybridData)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun updateNative(hybridData: HybridData) {
|
|
35
|
+
mHybridData = hybridData
|
|
36
|
+
super.updateNative(hybridData)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Default implementation of `HybridObject.toString()`
|
|
40
|
+
override fun toString(): String {
|
|
41
|
+
return "[HybridObject AutoSizeInput]"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Properties
|
|
45
|
+
@get:DoNotStrip
|
|
46
|
+
@get:Keep
|
|
47
|
+
@set:DoNotStrip
|
|
48
|
+
@set:Keep
|
|
49
|
+
abstract var text: String?
|
|
50
|
+
|
|
51
|
+
@get:DoNotStrip
|
|
52
|
+
@get:Keep
|
|
53
|
+
@set:DoNotStrip
|
|
54
|
+
@set:Keep
|
|
55
|
+
abstract var prefix: String?
|
|
56
|
+
|
|
57
|
+
@get:DoNotStrip
|
|
58
|
+
@get:Keep
|
|
59
|
+
@set:DoNotStrip
|
|
60
|
+
@set:Keep
|
|
61
|
+
abstract var suffix: String?
|
|
62
|
+
|
|
63
|
+
@get:DoNotStrip
|
|
64
|
+
@get:Keep
|
|
65
|
+
@set:DoNotStrip
|
|
66
|
+
@set:Keep
|
|
67
|
+
abstract var placeholder: String?
|
|
68
|
+
|
|
69
|
+
@get:DoNotStrip
|
|
70
|
+
@get:Keep
|
|
71
|
+
@set:DoNotStrip
|
|
72
|
+
@set:Keep
|
|
73
|
+
abstract var fontSize: Double?
|
|
74
|
+
|
|
75
|
+
@get:DoNotStrip
|
|
76
|
+
@get:Keep
|
|
77
|
+
@set:DoNotStrip
|
|
78
|
+
@set:Keep
|
|
79
|
+
abstract var minFontSize: Double?
|
|
80
|
+
|
|
81
|
+
@get:DoNotStrip
|
|
82
|
+
@get:Keep
|
|
83
|
+
@set:DoNotStrip
|
|
84
|
+
@set:Keep
|
|
85
|
+
abstract var multiline: Boolean?
|
|
86
|
+
|
|
87
|
+
@get:DoNotStrip
|
|
88
|
+
@get:Keep
|
|
89
|
+
@set:DoNotStrip
|
|
90
|
+
@set:Keep
|
|
91
|
+
abstract var maxNumberOfLines: Double?
|
|
92
|
+
|
|
93
|
+
@get:DoNotStrip
|
|
94
|
+
@get:Keep
|
|
95
|
+
@set:DoNotStrip
|
|
96
|
+
@set:Keep
|
|
97
|
+
abstract var textColor: String?
|
|
98
|
+
|
|
99
|
+
@get:DoNotStrip
|
|
100
|
+
@get:Keep
|
|
101
|
+
@set:DoNotStrip
|
|
102
|
+
@set:Keep
|
|
103
|
+
abstract var prefixColor: String?
|
|
104
|
+
|
|
105
|
+
@get:DoNotStrip
|
|
106
|
+
@get:Keep
|
|
107
|
+
@set:DoNotStrip
|
|
108
|
+
@set:Keep
|
|
109
|
+
abstract var suffixColor: String?
|
|
110
|
+
|
|
111
|
+
@get:DoNotStrip
|
|
112
|
+
@get:Keep
|
|
113
|
+
@set:DoNotStrip
|
|
114
|
+
@set:Keep
|
|
115
|
+
abstract var placeholderColor: String?
|
|
116
|
+
|
|
117
|
+
@get:DoNotStrip
|
|
118
|
+
@get:Keep
|
|
119
|
+
@set:DoNotStrip
|
|
120
|
+
@set:Keep
|
|
121
|
+
abstract var textAlign: String?
|
|
122
|
+
|
|
123
|
+
@get:DoNotStrip
|
|
124
|
+
@get:Keep
|
|
125
|
+
@set:DoNotStrip
|
|
126
|
+
@set:Keep
|
|
127
|
+
abstract var fontFamily: String?
|
|
128
|
+
|
|
129
|
+
@get:DoNotStrip
|
|
130
|
+
@get:Keep
|
|
131
|
+
@set:DoNotStrip
|
|
132
|
+
@set:Keep
|
|
133
|
+
abstract var fontWeight: String?
|
|
134
|
+
|
|
135
|
+
@get:DoNotStrip
|
|
136
|
+
@get:Keep
|
|
137
|
+
@set:DoNotStrip
|
|
138
|
+
@set:Keep
|
|
139
|
+
abstract var editable: Boolean?
|
|
140
|
+
|
|
141
|
+
@get:DoNotStrip
|
|
142
|
+
@get:Keep
|
|
143
|
+
@set:DoNotStrip
|
|
144
|
+
@set:Keep
|
|
145
|
+
abstract var keyboardType: String?
|
|
146
|
+
|
|
147
|
+
@get:DoNotStrip
|
|
148
|
+
@get:Keep
|
|
149
|
+
@set:DoNotStrip
|
|
150
|
+
@set:Keep
|
|
151
|
+
abstract var returnKeyType: String?
|
|
152
|
+
|
|
153
|
+
@get:DoNotStrip
|
|
154
|
+
@get:Keep
|
|
155
|
+
@set:DoNotStrip
|
|
156
|
+
@set:Keep
|
|
157
|
+
abstract var autoCorrect: Boolean?
|
|
158
|
+
|
|
159
|
+
@get:DoNotStrip
|
|
160
|
+
@get:Keep
|
|
161
|
+
@set:DoNotStrip
|
|
162
|
+
@set:Keep
|
|
163
|
+
abstract var autoCapitalize: String?
|
|
164
|
+
|
|
165
|
+
@get:DoNotStrip
|
|
166
|
+
@get:Keep
|
|
167
|
+
@set:DoNotStrip
|
|
168
|
+
@set:Keep
|
|
169
|
+
abstract var selectionColor: String?
|
|
170
|
+
|
|
171
|
+
@get:DoNotStrip
|
|
172
|
+
@get:Keep
|
|
173
|
+
@set:DoNotStrip
|
|
174
|
+
@set:Keep
|
|
175
|
+
abstract var prefixMarginRight: Double?
|
|
176
|
+
|
|
177
|
+
@get:DoNotStrip
|
|
178
|
+
@get:Keep
|
|
179
|
+
@set:DoNotStrip
|
|
180
|
+
@set:Keep
|
|
181
|
+
abstract var suffixMarginLeft: Double?
|
|
182
|
+
|
|
183
|
+
abstract var onChangeText: ((text: String) -> Unit)?
|
|
184
|
+
|
|
185
|
+
private var onChangeText_cxx: Func_void_std__string?
|
|
186
|
+
@Keep
|
|
187
|
+
@DoNotStrip
|
|
188
|
+
get() {
|
|
189
|
+
return onChangeText?.let { Func_void_std__string_java(it) }
|
|
190
|
+
}
|
|
191
|
+
@Keep
|
|
192
|
+
@DoNotStrip
|
|
193
|
+
set(value) {
|
|
194
|
+
onChangeText = value?.let { it }
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
abstract var onFocus: (() -> Unit)?
|
|
198
|
+
|
|
199
|
+
private var onFocus_cxx: Func_void?
|
|
200
|
+
@Keep
|
|
201
|
+
@DoNotStrip
|
|
202
|
+
get() {
|
|
203
|
+
return onFocus?.let { Func_void_java(it) }
|
|
204
|
+
}
|
|
205
|
+
@Keep
|
|
206
|
+
@DoNotStrip
|
|
207
|
+
set(value) {
|
|
208
|
+
onFocus = value?.let { it }
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
abstract var onBlur: (() -> Unit)?
|
|
212
|
+
|
|
213
|
+
private var onBlur_cxx: Func_void?
|
|
214
|
+
@Keep
|
|
215
|
+
@DoNotStrip
|
|
216
|
+
get() {
|
|
217
|
+
return onBlur?.let { Func_void_java(it) }
|
|
218
|
+
}
|
|
219
|
+
@Keep
|
|
220
|
+
@DoNotStrip
|
|
221
|
+
set(value) {
|
|
222
|
+
onBlur = value?.let { it }
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Methods
|
|
226
|
+
@DoNotStrip
|
|
227
|
+
@Keep
|
|
228
|
+
abstract fun focus(): Unit
|
|
229
|
+
|
|
230
|
+
@DoNotStrip
|
|
231
|
+
@Keep
|
|
232
|
+
abstract fun blur(): Unit
|
|
233
|
+
|
|
234
|
+
private external fun initHybrid(): HybridData
|
|
235
|
+
|
|
236
|
+
companion object {
|
|
237
|
+
protected const val TAG = "HybridAutoSizeInputSpec"
|
|
238
|
+
}
|
|
239
|
+
}
|
package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// autosizeinputOnLoad.kt
|
|
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
|
+
package com.margelo.nitro.autosizeinput
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class autosizeinputOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "autosizeinputOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "autosizeinput".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading autosizeinput C++ library...")
|
|
25
|
+
System.loadLibrary("autosizeinput")
|
|
26
|
+
Log.i(TAG, "Successfully loaded autosizeinput C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load autosizeinput C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputManager.kt
|
|
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
|
+
package com.margelo.nitro.autosizeinput.views
|
|
9
|
+
|
|
10
|
+
import android.view.View
|
|
11
|
+
import com.facebook.react.uimanager.ReactStylesDiffMap
|
|
12
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
13
|
+
import com.facebook.react.uimanager.StateWrapper
|
|
14
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
15
|
+
import com.margelo.nitro.autosizeinput.*
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Represents the React Native `ViewManager` for the "AutoSizeInput" Nitro HybridView.
|
|
19
|
+
*/
|
|
20
|
+
open class HybridAutoSizeInputManager: SimpleViewManager<View>() {
|
|
21
|
+
private val views = hashMapOf<View, HybridAutoSizeInput>()
|
|
22
|
+
|
|
23
|
+
override fun getName(): String {
|
|
24
|
+
return "AutoSizeInput"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
28
|
+
val hybridView = HybridAutoSizeInput(reactContext)
|
|
29
|
+
val view = hybridView.view
|
|
30
|
+
views[view] = hybridView
|
|
31
|
+
return view
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun onDropViewInstance(view: View) {
|
|
35
|
+
super.onDropViewInstance(view)
|
|
36
|
+
views.remove(view)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
|
|
40
|
+
val hybridView = views[view] ?: throw Error("Couldn't find view $view in local views table!")
|
|
41
|
+
|
|
42
|
+
// 1. Update each prop individually
|
|
43
|
+
hybridView.beforeUpdate()
|
|
44
|
+
HybridAutoSizeInputStateUpdater.updateViewProps(hybridView, stateWrapper)
|
|
45
|
+
hybridView.afterUpdate()
|
|
46
|
+
|
|
47
|
+
// 2. Continue in base View props
|
|
48
|
+
return super.updateState(view, props, stateWrapper)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputStateUpdater.kt
|
|
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
|
+
package com.margelo.nitro.autosizeinput.views
|
|
9
|
+
|
|
10
|
+
import com.facebook.react.uimanager.StateWrapper
|
|
11
|
+
import com.margelo.nitro.autosizeinput.*
|
|
12
|
+
|
|
13
|
+
internal class HybridAutoSizeInputStateUpdater {
|
|
14
|
+
companion object {
|
|
15
|
+
/**
|
|
16
|
+
* Updates the props for [view] through C++.
|
|
17
|
+
* The [state] prop is expected to contain [view]'s props as wrapped Fabric state.
|
|
18
|
+
*/
|
|
19
|
+
@Suppress("KotlinJniMissingFunction")
|
|
20
|
+
@JvmStatic
|
|
21
|
+
external fun updateViewProps(view: HybridAutoSizeInputSpec, state: StateWrapper)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# AutoSizeInput+autolinking.rb
|
|
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
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/AutoSizeInput+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 AutoSizeInput is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only C)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AutoSizeInput-Swift-Cxx-Bridge.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 "AutoSizeInput-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "AutoSizeInput-Swift-Cxx-Umbrella.hpp"
|
|
12
|
+
#include "HybridAutoSizeInputSpecSwift.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::autosizeinput::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::function<void(const std::string& /* text */)>
|
|
18
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
+
auto swiftClosure = AutoSizeInput::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
|
|
20
|
+
return [swiftClosure = std::move(swiftClosure)](const std::string& text) mutable -> void {
|
|
21
|
+
swiftClosure.call(text);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// pragma MARK: std::function<void()>
|
|
26
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
+
auto swiftClosure = AutoSizeInput::Func_void::fromUnsafe(swiftClosureWrapper);
|
|
28
|
+
return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
|
|
29
|
+
swiftClosure.call();
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::shared_ptr<HybridAutoSizeInputSpec>
|
|
34
|
+
std::shared_ptr<HybridAutoSizeInputSpec> create_std__shared_ptr_HybridAutoSizeInputSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
+
AutoSizeInput::HybridAutoSizeInputSpec_cxx swiftPart = AutoSizeInput::HybridAutoSizeInputSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
+
return std::make_shared<margelo::nitro::autosizeinput::HybridAutoSizeInputSpecSwift>(swiftPart);
|
|
37
|
+
}
|
|
38
|
+
void* NON_NULL get_std__shared_ptr_HybridAutoSizeInputSpec_(std__shared_ptr_HybridAutoSizeInputSpec_ cppType) {
|
|
39
|
+
std::shared_ptr<margelo::nitro::autosizeinput::HybridAutoSizeInputSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::autosizeinput::HybridAutoSizeInputSpecSwift>(cppType);
|
|
40
|
+
#ifdef NITRO_DEBUG
|
|
41
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
+
throw std::runtime_error("Class \"HybridAutoSizeInputSpec\" is not implemented in Swift!");
|
|
43
|
+
}
|
|
44
|
+
#endif
|
|
45
|
+
AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
+
return swiftPart.toUnsafe();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::autosizeinput::bridge::swift
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AutoSizeInput-Swift-Cxx-Bridge.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
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridAutoSizeInputSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::autosizeinput { class HybridAutoSizeInputSpec; }
|
|
13
|
+
|
|
14
|
+
// Forward declarations of Swift defined types
|
|
15
|
+
// Forward declaration of `HybridAutoSizeInputSpec_cxx` to properly resolve imports.
|
|
16
|
+
namespace AutoSizeInput { class HybridAutoSizeInputSpec_cxx; }
|
|
17
|
+
|
|
18
|
+
// Include C++ defined types
|
|
19
|
+
#include "HybridAutoSizeInputSpec.hpp"
|
|
20
|
+
#include <NitroModules/Result.hpp>
|
|
21
|
+
#include <exception>
|
|
22
|
+
#include <functional>
|
|
23
|
+
#include <memory>
|
|
24
|
+
#include <optional>
|
|
25
|
+
#include <string>
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
29
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
30
|
+
*/
|
|
31
|
+
namespace margelo::nitro::autosizeinput::bridge::swift {
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::optional<std::string>
|
|
34
|
+
/**
|
|
35
|
+
* Specialized version of `std::optional<std::string>`.
|
|
36
|
+
*/
|
|
37
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
38
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
39
|
+
return std::optional<std::string>(value);
|
|
40
|
+
}
|
|
41
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
42
|
+
return optional.has_value();
|
|
43
|
+
}
|
|
44
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
45
|
+
return *optional;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// pragma MARK: std::optional<double>
|
|
49
|
+
/**
|
|
50
|
+
* Specialized version of `std::optional<double>`.
|
|
51
|
+
*/
|
|
52
|
+
using std__optional_double_ = std::optional<double>;
|
|
53
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
54
|
+
return std::optional<double>(value);
|
|
55
|
+
}
|
|
56
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
57
|
+
return optional.has_value();
|
|
58
|
+
}
|
|
59
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
60
|
+
return *optional;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// pragma MARK: std::optional<bool>
|
|
64
|
+
/**
|
|
65
|
+
* Specialized version of `std::optional<bool>`.
|
|
66
|
+
*/
|
|
67
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
68
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
69
|
+
return std::optional<bool>(value);
|
|
70
|
+
}
|
|
71
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
72
|
+
return optional.has_value();
|
|
73
|
+
}
|
|
74
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
75
|
+
return *optional;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// pragma MARK: std::function<void(const std::string& /* text */)>
|
|
79
|
+
/**
|
|
80
|
+
* Specialized version of `std::function<void(const std::string&)>`.
|
|
81
|
+
*/
|
|
82
|
+
using Func_void_std__string = std::function<void(const std::string& /* text */)>;
|
|
83
|
+
/**
|
|
84
|
+
* Wrapper class for a `std::function<void(const std::string& / * text * /)>`, this can be used from Swift.
|
|
85
|
+
*/
|
|
86
|
+
class Func_void_std__string_Wrapper final {
|
|
87
|
+
public:
|
|
88
|
+
explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* text */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* text */)>>(std::move(func))) {}
|
|
89
|
+
inline void call(std::string text) const noexcept {
|
|
90
|
+
_function->operator()(text);
|
|
91
|
+
}
|
|
92
|
+
private:
|
|
93
|
+
std::unique_ptr<std::function<void(const std::string& /* text */)>> _function;
|
|
94
|
+
} SWIFT_NONCOPYABLE;
|
|
95
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
96
|
+
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept {
|
|
97
|
+
return Func_void_std__string_Wrapper(std::move(value));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// pragma MARK: std::optional<std::function<void(const std::string& /* text */)>>
|
|
101
|
+
/**
|
|
102
|
+
* Specialized version of `std::optional<std::function<void(const std::string& / * text * /)>>`.
|
|
103
|
+
*/
|
|
104
|
+
using std__optional_std__function_void_const_std__string_____text______ = std::optional<std::function<void(const std::string& /* text */)>>;
|
|
105
|
+
inline std::optional<std::function<void(const std::string& /* text */)>> create_std__optional_std__function_void_const_std__string_____text______(const std::function<void(const std::string& /* text */)>& value) noexcept {
|
|
106
|
+
return std::optional<std::function<void(const std::string& /* text */)>>(value);
|
|
107
|
+
}
|
|
108
|
+
inline bool has_value_std__optional_std__function_void_const_std__string_____text______(const std::optional<std::function<void(const std::string& /* text */)>>& optional) noexcept {
|
|
109
|
+
return optional.has_value();
|
|
110
|
+
}
|
|
111
|
+
inline std::function<void(const std::string& /* text */)> get_std__optional_std__function_void_const_std__string_____text______(const std::optional<std::function<void(const std::string& /* text */)>>& optional) noexcept {
|
|
112
|
+
return *optional;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// pragma MARK: std::function<void()>
|
|
116
|
+
/**
|
|
117
|
+
* Specialized version of `std::function<void()>`.
|
|
118
|
+
*/
|
|
119
|
+
using Func_void = std::function<void()>;
|
|
120
|
+
/**
|
|
121
|
+
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
|
122
|
+
*/
|
|
123
|
+
class Func_void_Wrapper final {
|
|
124
|
+
public:
|
|
125
|
+
explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
|
|
126
|
+
inline void call() const noexcept {
|
|
127
|
+
_function->operator()();
|
|
128
|
+
}
|
|
129
|
+
private:
|
|
130
|
+
std::unique_ptr<std::function<void()>> _function;
|
|
131
|
+
} SWIFT_NONCOPYABLE;
|
|
132
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
133
|
+
inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
|
|
134
|
+
return Func_void_Wrapper(std::move(value));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// pragma MARK: std::optional<std::function<void()>>
|
|
138
|
+
/**
|
|
139
|
+
* Specialized version of `std::optional<std::function<void()>>`.
|
|
140
|
+
*/
|
|
141
|
+
using std__optional_std__function_void____ = std::optional<std::function<void()>>;
|
|
142
|
+
inline std::optional<std::function<void()>> create_std__optional_std__function_void____(const std::function<void()>& value) noexcept {
|
|
143
|
+
return std::optional<std::function<void()>>(value);
|
|
144
|
+
}
|
|
145
|
+
inline bool has_value_std__optional_std__function_void____(const std::optional<std::function<void()>>& optional) noexcept {
|
|
146
|
+
return optional.has_value();
|
|
147
|
+
}
|
|
148
|
+
inline std::function<void()> get_std__optional_std__function_void____(const std::optional<std::function<void()>>& optional) noexcept {
|
|
149
|
+
return *optional;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// pragma MARK: std::shared_ptr<HybridAutoSizeInputSpec>
|
|
153
|
+
/**
|
|
154
|
+
* Specialized version of `std::shared_ptr<HybridAutoSizeInputSpec>`.
|
|
155
|
+
*/
|
|
156
|
+
using std__shared_ptr_HybridAutoSizeInputSpec_ = std::shared_ptr<HybridAutoSizeInputSpec>;
|
|
157
|
+
std::shared_ptr<HybridAutoSizeInputSpec> create_std__shared_ptr_HybridAutoSizeInputSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
158
|
+
void* NON_NULL get_std__shared_ptr_HybridAutoSizeInputSpec_(std__shared_ptr_HybridAutoSizeInputSpec_ cppType);
|
|
159
|
+
|
|
160
|
+
// pragma MARK: std::weak_ptr<HybridAutoSizeInputSpec>
|
|
161
|
+
using std__weak_ptr_HybridAutoSizeInputSpec_ = std::weak_ptr<HybridAutoSizeInputSpec>;
|
|
162
|
+
inline std__weak_ptr_HybridAutoSizeInputSpec_ weakify_std__shared_ptr_HybridAutoSizeInputSpec_(const std::shared_ptr<HybridAutoSizeInputSpec>& strong) noexcept { return strong; }
|
|
163
|
+
|
|
164
|
+
// pragma MARK: Result<void>
|
|
165
|
+
using Result_void_ = Result<void>;
|
|
166
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
167
|
+
return Result<void>::withValue();
|
|
168
|
+
}
|
|
169
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
170
|
+
return Result<void>::withError(error);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
} // namespace margelo::nitro::autosizeinput::bridge::swift
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AutoSizeInput-Swift-Cxx-Umbrella.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
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridAutoSizeInputSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::autosizeinput { class HybridAutoSizeInputSpec; }
|
|
13
|
+
|
|
14
|
+
// Include C++ defined types
|
|
15
|
+
#include "HybridAutoSizeInputSpec.hpp"
|
|
16
|
+
#include <NitroModules/Result.hpp>
|
|
17
|
+
#include <exception>
|
|
18
|
+
#include <functional>
|
|
19
|
+
#include <memory>
|
|
20
|
+
#include <optional>
|
|
21
|
+
#include <string>
|
|
22
|
+
|
|
23
|
+
// C++ helpers for Swift
|
|
24
|
+
#include "AutoSizeInput-Swift-Cxx-Bridge.hpp"
|
|
25
|
+
|
|
26
|
+
// Common C++ types used in Swift
|
|
27
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
28
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
29
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
30
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
31
|
+
|
|
32
|
+
// Forward declarations of Swift defined types
|
|
33
|
+
// Forward declaration of `HybridAutoSizeInputSpec_cxx` to properly resolve imports.
|
|
34
|
+
namespace AutoSizeInput { class HybridAutoSizeInputSpec_cxx; }
|
|
35
|
+
|
|
36
|
+
// Include Swift defined types
|
|
37
|
+
#if __has_include("AutoSizeInput-Swift.h")
|
|
38
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
39
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "AutoSizeInput".
|
|
40
|
+
#include "AutoSizeInput-Swift.h"
|
|
41
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
42
|
+
#elif __has_include(<AutoSizeInput/AutoSizeInput-Swift.h>)
|
|
43
|
+
#include <AutoSizeInput/AutoSizeInput-Swift.h>
|
|
44
|
+
#else
|
|
45
|
+
#error AutoSizeInput's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "AutoSizeInput", and try building the app first.
|
|
46
|
+
#endif
|