react-native-nitro-input 0.3.0 → 0.3.2
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/CHANGELOG.md +80 -0
- package/README.md +120 -5
- package/android/src/main/cpp/JMaskEngine.cpp +45 -0
- package/android/src/main/cpp/JMaskEngine.hpp +9 -0
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +42 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/MaskEngine.kt +16 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +96 -6
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
- package/cpp/MaskEngine.cpp +294 -33
- package/cpp/MaskEngine.hpp +68 -0
- package/cpp/RollingEngine.cpp +92 -8
- package/cpp/RollingEngine.hpp +36 -2
- package/ios/HybridNitroInputView.swift +18 -0
- package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
- package/ios/HybridNitroNumberView.swift +82 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroInputView.swift +125 -7
- package/ios/NitroNumberView.swift +368 -135
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroInput.js +15 -2
- package/lib/commonjs/src/NitroNumber.js +52 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/formatProps.js +76 -16
- package/lib/commonjs/src/index.js +6 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroInput.js +15 -2
- package/lib/module/src/NitroNumber.js +53 -4
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/formatProps.js +76 -17
- package/lib/module/src/index.js +2 -0
- package/lib/module/src/specs/NitroText.nitro.js +1 -0
- package/lib/typescript/src/NitroInput.d.ts +39 -1
- package/lib/typescript/src/NitroNumber.d.ts +79 -1
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/formatProps.d.ts +30 -4
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +43 -0
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +102 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +12 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroInputCharacterMapping.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroInputMaskAffinity.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroInputTextCase.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +30 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputCharacterMapping.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputMaskAffinity.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputTextCase.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +146 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +25 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +50 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +36 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +6 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroInputCharacterMapping.swift +34 -0
- package/nitrogen/generated/ios/swift/NitroInputMaskAffinity.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroInputTextCase.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroInputCharacterMapping.hpp +87 -0
- package/nitrogen/generated/shared/c++/NitroInputMaskAffinity.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroInputTextCase.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +21 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +73 -0
- package/src/NitroNumber.tsx +183 -9
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/formatProps.ts +108 -18
- package/src/index.ts +8 -0
- package/src/specs/NitroInput.nitro.ts +46 -0
- package/src/specs/NitroNumber.nitro.ts +69 -0
- package/src/specs/NitroText.nitro.ts +65 -0
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextMeasureSpec.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the NitroTextMeasure HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of NitroTextMeasure.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridNitroTextMeasureSpec: HybridObject() {
|
|
28
|
+
// Properties
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Methods
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
abstract fun measure(text: String, fontSize: Double, fontWeight: Double, fontFamily: String, letterSpacing: Double): Double
|
|
35
|
+
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
abstract fun lineHeight(fontSize: Double, fontWeight: Double, fontFamily: String): Double
|
|
39
|
+
|
|
40
|
+
// Default implementation of `HybridObject.toString()`
|
|
41
|
+
override fun toString(): String {
|
|
42
|
+
return "[HybridObject NitroTextMeasure]"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// C++ backing class
|
|
46
|
+
@DoNotStrip
|
|
47
|
+
@Keep
|
|
48
|
+
protected open class CxxPart(javaPart: HybridNitroTextMeasureSpec): HybridObject.CxxPart(javaPart) {
|
|
49
|
+
// C++ JHybridNitroTextMeasureSpec::CxxPart::initHybrid(...)
|
|
50
|
+
@FastNative
|
|
51
|
+
external override fun initHybrid(): HybridData
|
|
52
|
+
}
|
|
53
|
+
override fun createCxxPart(): CxxPart {
|
|
54
|
+
return CxxPart(this)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
companion object {
|
|
58
|
+
protected const val TAG = "HybridNitroTextMeasureSpec"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewSpec.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
import com.margelo.nitro.views.HybridView
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A Kotlin class representing the NitroTextView HybridObject.
|
|
19
|
+
* Implement this abstract class to create Kotlin-based instances of NitroTextView.
|
|
20
|
+
*/
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
@Suppress(
|
|
24
|
+
"KotlinJniMissingFunction", "unused",
|
|
25
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
26
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
27
|
+
)
|
|
28
|
+
abstract class HybridNitroTextViewSpec: HybridView() {
|
|
29
|
+
// Properties
|
|
30
|
+
@get:DoNotStrip
|
|
31
|
+
@get:Keep
|
|
32
|
+
@set:DoNotStrip
|
|
33
|
+
@set:Keep
|
|
34
|
+
abstract var text: String
|
|
35
|
+
|
|
36
|
+
@get:DoNotStrip
|
|
37
|
+
@get:Keep
|
|
38
|
+
@set:DoNotStrip
|
|
39
|
+
@set:Keep
|
|
40
|
+
abstract var fontSize: Double?
|
|
41
|
+
|
|
42
|
+
@get:DoNotStrip
|
|
43
|
+
@get:Keep
|
|
44
|
+
@set:DoNotStrip
|
|
45
|
+
@set:Keep
|
|
46
|
+
abstract var fontWeight: Double?
|
|
47
|
+
|
|
48
|
+
@get:DoNotStrip
|
|
49
|
+
@get:Keep
|
|
50
|
+
@set:DoNotStrip
|
|
51
|
+
@set:Keep
|
|
52
|
+
abstract var fontFamily: String?
|
|
53
|
+
|
|
54
|
+
@get:DoNotStrip
|
|
55
|
+
@get:Keep
|
|
56
|
+
@set:DoNotStrip
|
|
57
|
+
@set:Keep
|
|
58
|
+
abstract var color: Double?
|
|
59
|
+
|
|
60
|
+
@get:DoNotStrip
|
|
61
|
+
@get:Keep
|
|
62
|
+
@set:DoNotStrip
|
|
63
|
+
@set:Keep
|
|
64
|
+
abstract var letterSpacing: Double?
|
|
65
|
+
|
|
66
|
+
@get:DoNotStrip
|
|
67
|
+
@get:Keep
|
|
68
|
+
@set:DoNotStrip
|
|
69
|
+
@set:Keep
|
|
70
|
+
abstract var textAlign: NitroNumberTextAlign?
|
|
71
|
+
|
|
72
|
+
@get:DoNotStrip
|
|
73
|
+
@get:Keep
|
|
74
|
+
@set:DoNotStrip
|
|
75
|
+
@set:Keep
|
|
76
|
+
abstract var rightToLeft: Boolean?
|
|
77
|
+
|
|
78
|
+
@get:DoNotStrip
|
|
79
|
+
@get:Keep
|
|
80
|
+
@set:DoNotStrip
|
|
81
|
+
@set:Keep
|
|
82
|
+
abstract var duration: Double?
|
|
83
|
+
|
|
84
|
+
@get:DoNotStrip
|
|
85
|
+
@get:Keep
|
|
86
|
+
@set:DoNotStrip
|
|
87
|
+
@set:Keep
|
|
88
|
+
abstract var easing: NitroInputEasing?
|
|
89
|
+
|
|
90
|
+
@get:DoNotStrip
|
|
91
|
+
@get:Keep
|
|
92
|
+
@set:DoNotStrip
|
|
93
|
+
@set:Keep
|
|
94
|
+
abstract var bounce: Double?
|
|
95
|
+
|
|
96
|
+
@get:DoNotStrip
|
|
97
|
+
@get:Keep
|
|
98
|
+
@set:DoNotStrip
|
|
99
|
+
@set:Keep
|
|
100
|
+
abstract var effect: NitroInputEffect?
|
|
101
|
+
|
|
102
|
+
@get:DoNotStrip
|
|
103
|
+
@get:Keep
|
|
104
|
+
@set:DoNotStrip
|
|
105
|
+
@set:Keep
|
|
106
|
+
abstract var respectReduceMotion: Boolean?
|
|
107
|
+
|
|
108
|
+
@get:DoNotStrip
|
|
109
|
+
@get:Keep
|
|
110
|
+
@set:DoNotStrip
|
|
111
|
+
@set:Keep
|
|
112
|
+
abstract var loading: Boolean?
|
|
113
|
+
|
|
114
|
+
@get:DoNotStrip
|
|
115
|
+
@get:Keep
|
|
116
|
+
@set:DoNotStrip
|
|
117
|
+
@set:Keep
|
|
118
|
+
abstract var shimmerColor: Double?
|
|
119
|
+
|
|
120
|
+
@get:DoNotStrip
|
|
121
|
+
@get:Keep
|
|
122
|
+
@set:DoNotStrip
|
|
123
|
+
@set:Keep
|
|
124
|
+
abstract var shimmerDuration: Double?
|
|
125
|
+
|
|
126
|
+
@get:DoNotStrip
|
|
127
|
+
@get:Keep
|
|
128
|
+
@set:DoNotStrip
|
|
129
|
+
@set:Keep
|
|
130
|
+
abstract var shimmerAngle: Double?
|
|
131
|
+
|
|
132
|
+
@get:DoNotStrip
|
|
133
|
+
@get:Keep
|
|
134
|
+
@set:DoNotStrip
|
|
135
|
+
@set:Keep
|
|
136
|
+
abstract var shimmerWidth: Double?
|
|
137
|
+
|
|
138
|
+
@get:DoNotStrip
|
|
139
|
+
@get:Keep
|
|
140
|
+
@set:DoNotStrip
|
|
141
|
+
@set:Keep
|
|
142
|
+
abstract var shimmerBaseColor: Double?
|
|
143
|
+
|
|
144
|
+
@get:DoNotStrip
|
|
145
|
+
@get:Keep
|
|
146
|
+
@set:DoNotStrip
|
|
147
|
+
@set:Keep
|
|
148
|
+
abstract var shimmerDirection: NitroNumberShimmerDirection?
|
|
149
|
+
|
|
150
|
+
@get:DoNotStrip
|
|
151
|
+
@get:Keep
|
|
152
|
+
@set:DoNotStrip
|
|
153
|
+
@set:Keep
|
|
154
|
+
abstract var shimmerDelay: Double?
|
|
155
|
+
|
|
156
|
+
// Methods
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
// Default implementation of `HybridObject.toString()`
|
|
160
|
+
override fun toString(): String {
|
|
161
|
+
return "[HybridObject NitroTextView]"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// C++ backing class
|
|
165
|
+
@DoNotStrip
|
|
166
|
+
@Keep
|
|
167
|
+
protected open class CxxPart(javaPart: HybridNitroTextViewSpec): HybridObject.CxxPart(javaPart) {
|
|
168
|
+
// C++ JHybridNitroTextViewSpec::CxxPart::initHybrid(...)
|
|
169
|
+
@FastNative
|
|
170
|
+
external override fun initHybrid(): HybridData
|
|
171
|
+
}
|
|
172
|
+
override fun createCxxPart(): CxxPart {
|
|
173
|
+
return CxxPart(this)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
companion object {
|
|
177
|
+
protected const val TAG = "HybridNitroTextViewSpec"
|
|
178
|
+
}
|
|
179
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputCharacterMapping.kt
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputCharacterMapping.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "NitroInputCharacterMapping".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class NitroInputCharacterMapping(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val from: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val to: String
|
|
27
|
+
) {
|
|
28
|
+
/* primary constructor */
|
|
29
|
+
|
|
30
|
+
override fun equals(other: Any?): Boolean {
|
|
31
|
+
if (this === other) return true
|
|
32
|
+
if (other !is NitroInputCharacterMapping) return false
|
|
33
|
+
return Objects.deepEquals(this.from, other.from)
|
|
34
|
+
&& Objects.deepEquals(this.to, other.to)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun hashCode(): Int {
|
|
38
|
+
return arrayOf<Any?>(
|
|
39
|
+
from,
|
|
40
|
+
to
|
|
41
|
+
).contentDeepHashCode()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
companion object {
|
|
45
|
+
/**
|
|
46
|
+
* Constructor called from C++
|
|
47
|
+
*/
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
@Suppress("unused")
|
|
51
|
+
@JvmStatic
|
|
52
|
+
private fun fromCpp(from: String, to: String): NitroInputCharacterMapping {
|
|
53
|
+
return NitroInputCharacterMapping(from, to)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputMaskAffinity.kt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskAffinity.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NitroInputMaskAffinity".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NitroInputMaskAffinity(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
WHOLESTRING(0),
|
|
20
|
+
PREFIX(1),
|
|
21
|
+
CAPACITY(2),
|
|
22
|
+
EXTRACTEDVALUECAPACITY(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputTextCase.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NitroInputTextCase".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NitroInputTextCase(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NONE(0),
|
|
20
|
+
UPPER(1),
|
|
21
|
+
LOWER(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroNumberShimmerDirection.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NitroNumberShimmerDirection".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NitroNumberShimmerDirection(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
AUTO(0),
|
|
20
|
+
LTR(1),
|
|
21
|
+
RTL(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroNumberSignDisplay.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NitroNumberSignDisplay".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NitroNumberSignDisplay(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
AUTO(0),
|
|
20
|
+
ALWAYS(1),
|
|
21
|
+
NEVER(2),
|
|
22
|
+
EXCEPTZERO(3),
|
|
23
|
+
NEGATIVE(4);
|
|
24
|
+
|
|
25
|
+
companion object
|
|
26
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewManager.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput.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.R.id.associated_hybrid_view_tag
|
|
16
|
+
import com.margelo.nitro.views.RecyclableView
|
|
17
|
+
import com.margelo.nitro.nitroinput.*
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Represents the React Native `ViewManager` for the "NitroTextView" Nitro HybridView.
|
|
21
|
+
*/
|
|
22
|
+
public class HybridNitroTextViewManager: SimpleViewManager<View>() {
|
|
23
|
+
/**
|
|
24
|
+
* Represents the View and its last state snapshot (mutable)
|
|
25
|
+
*/
|
|
26
|
+
private class HybridViewHolder(
|
|
27
|
+
val hybridView: HybridNitroTextView,
|
|
28
|
+
var lastState: StateWrapper? = null,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
init {
|
|
32
|
+
if (RecyclableView::class.java.isAssignableFrom(HybridNitroTextView::class.java)) {
|
|
33
|
+
// Enable view recycling
|
|
34
|
+
super.setupViewRecycling()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
override fun getName(): String {
|
|
39
|
+
return "NitroTextView"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
43
|
+
val hybridView = HybridNitroTextView(reactContext)
|
|
44
|
+
val view = hybridView.view
|
|
45
|
+
view.setTag(associated_hybrid_view_tag, HybridViewHolder(hybridView))
|
|
46
|
+
return view
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
|
|
50
|
+
val holder = getHybridViewHolder(view)
|
|
51
|
+
?: throw Error("Couldn't find view $view in local views table!")
|
|
52
|
+
val hybridView = holder.hybridView
|
|
53
|
+
val oldState = holder.lastState
|
|
54
|
+
val newState = stateWrapper
|
|
55
|
+
|
|
56
|
+
// 1. Update each prop individually
|
|
57
|
+
hybridView.beforeUpdate()
|
|
58
|
+
HybridNitroTextViewStateUpdater.updateViewProps(hybridView, newState, oldState)
|
|
59
|
+
hybridView.afterUpdate()
|
|
60
|
+
holder.lastState = newState
|
|
61
|
+
|
|
62
|
+
// 2. Continue in base View props
|
|
63
|
+
return super.updateState(view, props, newState)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
override fun onDropViewInstance(view: View) {
|
|
67
|
+
val holder = getHybridViewHolder(view)
|
|
68
|
+
holder?.lastState = null
|
|
69
|
+
holder?.hybridView?.onDropView()
|
|
70
|
+
return super.onDropViewInstance(view)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected override fun prepareToRecycleView(reactContext: ThemedReactContext, view: View): View? {
|
|
74
|
+
val preparedView = super.prepareToRecycleView(reactContext, view)
|
|
75
|
+
?: return null
|
|
76
|
+
val holder = getHybridViewHolder(preparedView)
|
|
77
|
+
?: return null
|
|
78
|
+
val hybridView = holder.hybridView
|
|
79
|
+
holder.lastState = null
|
|
80
|
+
|
|
81
|
+
@Suppress("USELESS_IS_CHECK")
|
|
82
|
+
if (hybridView is RecyclableView) {
|
|
83
|
+
// Recycle in it's implementation
|
|
84
|
+
hybridView.prepareForRecycle()
|
|
85
|
+
|
|
86
|
+
// Maybe update the view if it changed
|
|
87
|
+
return hybridView.view
|
|
88
|
+
} else {
|
|
89
|
+
return null
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private fun getHybridViewHolder(view: View): HybridViewHolder? {
|
|
94
|
+
return view.getTag(associated_hybrid_view_tag) as? HybridViewHolder
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroTextViewStateUpdater.kt
|
|
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
|
+
package com.margelo.nitro.nitroinput.views
|
|
9
|
+
|
|
10
|
+
import com.facebook.react.uimanager.StateWrapper
|
|
11
|
+
import com.margelo.nitro.nitroinput.*
|
|
12
|
+
|
|
13
|
+
internal class HybridNitroTextViewStateUpdater {
|
|
14
|
+
companion object {
|
|
15
|
+
/**
|
|
16
|
+
* Updates the props for [view] through C++.
|
|
17
|
+
* The [newState] prop is expected to contain [view]'s props as wrapped Fabric state.
|
|
18
|
+
*/
|
|
19
|
+
@Suppress("KotlinJniMissingFunction")
|
|
20
|
+
@JvmStatic
|
|
21
|
+
external fun updateViewProps(view: HybridNitroTextViewSpec, newState: StateWrapper, oldState: StateWrapper?)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
#include "HybridNitroNumberFormatPlatformSpecSwift.hpp"
|
|
13
13
|
#include "HybridNitroNumberViewSpecSwift.hpp"
|
|
14
14
|
#include "HybridNitroPlatformNumberFormatterSpecSwift.hpp"
|
|
15
|
+
#include "HybridNitroTextMeasureSpecSwift.hpp"
|
|
16
|
+
#include "HybridNitroTextViewSpecSwift.hpp"
|
|
15
17
|
#include "NitroInput-Swift-Cxx-Umbrella.hpp"
|
|
16
18
|
#include <NitroModules/NitroDefines.hpp>
|
|
17
19
|
|
|
@@ -105,6 +107,38 @@ namespace margelo::nitro::nitroinput::bridge::swift {
|
|
|
105
107
|
return swiftPart.toUnsafe();
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
// pragma MARK: std::shared_ptr<HybridNitroTextMeasureSpec>
|
|
111
|
+
std::shared_ptr<HybridNitroTextMeasureSpec> create_std__shared_ptr_HybridNitroTextMeasureSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
112
|
+
NitroInput::HybridNitroTextMeasureSpec_cxx swiftPart = NitroInput::HybridNitroTextMeasureSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
113
|
+
return std::make_shared<margelo::nitro::nitroinput::HybridNitroTextMeasureSpecSwift>(swiftPart);
|
|
114
|
+
}
|
|
115
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroTextMeasureSpec_(std__shared_ptr_HybridNitroTextMeasureSpec_ cppType) {
|
|
116
|
+
std::shared_ptr<margelo::nitro::nitroinput::HybridNitroTextMeasureSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitroinput::HybridNitroTextMeasureSpecSwift>(cppType);
|
|
117
|
+
#ifdef NITRO_DEBUG
|
|
118
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
119
|
+
throw std::runtime_error("Class \"HybridNitroTextMeasureSpec\" is not implemented in Swift!");
|
|
120
|
+
}
|
|
121
|
+
#endif
|
|
122
|
+
NitroInput::HybridNitroTextMeasureSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
123
|
+
return swiftPart.toUnsafe();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// pragma MARK: std::shared_ptr<HybridNitroTextViewSpec>
|
|
127
|
+
std::shared_ptr<HybridNitroTextViewSpec> create_std__shared_ptr_HybridNitroTextViewSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
128
|
+
NitroInput::HybridNitroTextViewSpec_cxx swiftPart = NitroInput::HybridNitroTextViewSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
129
|
+
return std::make_shared<margelo::nitro::nitroinput::HybridNitroTextViewSpecSwift>(swiftPart);
|
|
130
|
+
}
|
|
131
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroTextViewSpec_(std__shared_ptr_HybridNitroTextViewSpec_ cppType) {
|
|
132
|
+
std::shared_ptr<margelo::nitro::nitroinput::HybridNitroTextViewSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitroinput::HybridNitroTextViewSpecSwift>(cppType);
|
|
133
|
+
#ifdef NITRO_DEBUG
|
|
134
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
135
|
+
throw std::runtime_error("Class \"HybridNitroTextViewSpec\" is not implemented in Swift!");
|
|
136
|
+
}
|
|
137
|
+
#endif
|
|
138
|
+
NitroInput::HybridNitroTextViewSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
139
|
+
return swiftPart.toUnsafe();
|
|
140
|
+
}
|
|
141
|
+
|
|
108
142
|
// pragma MARK: std::shared_ptr<HybridNitroPlatformNumberFormatterSpec>
|
|
109
143
|
std::shared_ptr<HybridNitroPlatformNumberFormatterSpec> create_std__shared_ptr_HybridNitroPlatformNumberFormatterSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
110
144
|
NitroInput::HybridNitroPlatformNumberFormatterSpec_cxx swiftPart = NitroInput::HybridNitroPlatformNumberFormatterSpec_cxx::fromUnsafe(swiftUnsafePointer);
|