react-native-nitro-input 0.3.0 → 0.3.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +90 -2
  3. package/android/src/main/cpp/JReflowEngine.cpp +32 -0
  4. package/android/src/main/cpp/JReflowEngine.hpp +13 -0
  5. package/android/src/main/cpp/JRollingEngine.cpp +42 -2
  6. package/android/src/main/cpp/JRollingEngine.hpp +9 -1
  7. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
  8. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
  9. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
  10. package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
  11. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
  12. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
  13. package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
  14. package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
  15. package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
  16. package/cpp/RollingEngine.cpp +92 -8
  17. package/cpp/RollingEngine.hpp +36 -2
  18. package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
  19. package/ios/HybridNitroNumberView.swift +82 -1
  20. package/ios/HybridNitroTextView.swift +134 -0
  21. package/ios/NitroNumberView.swift +368 -135
  22. package/ios/NitroTextView.swift +583 -0
  23. package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
  24. package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
  25. package/lib/commonjs/src/NitroNumber.js +52 -3
  26. package/lib/commonjs/src/NitroText.js +138 -0
  27. package/lib/commonjs/src/NitroTime.js +65 -0
  28. package/lib/commonjs/src/formatProps.js +76 -16
  29. package/lib/commonjs/src/index.js +6 -1
  30. package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
  31. package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
  32. package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
  33. package/lib/module/src/NitroNumber.js +53 -4
  34. package/lib/module/src/NitroText.js +98 -0
  35. package/lib/module/src/NitroTime.js +29 -0
  36. package/lib/module/src/formatProps.js +76 -17
  37. package/lib/module/src/index.js +2 -0
  38. package/lib/module/src/specs/NitroText.nitro.js +1 -0
  39. package/lib/typescript/src/NitroNumber.d.ts +79 -1
  40. package/lib/typescript/src/NitroText.d.ts +67 -0
  41. package/lib/typescript/src/NitroTime.d.ts +19 -0
  42. package/lib/typescript/src/formatProps.d.ts +30 -4
  43. package/lib/typescript/src/index.d.ts +4 -1
  44. package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
  45. package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
  46. package/nitro.json +20 -0
  47. package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
  48. package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
  49. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
  50. package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
  51. package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
  52. package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
  53. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
  54. package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
  55. package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
  56. package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
  57. package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
  58. package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
  59. package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
  67. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
  68. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +132 -11
  69. package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +16 -0
  70. package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
  71. package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
  72. package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
  73. package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
  74. package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
  75. package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
  76. package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
  77. package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
  78. package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
  79. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
  80. package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
  81. package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
  82. package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
  83. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
  84. package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
  85. package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
  86. package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
  87. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
  88. package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
  89. package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
  90. package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
  91. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
  92. package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
  93. package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
  94. package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
  95. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
  96. package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
  97. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
  98. package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
  99. package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
  100. package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
  101. package/package.json +1 -1
  102. package/src/NitroNumber.tsx +183 -9
  103. package/src/NitroText.tsx +166 -0
  104. package/src/NitroTime.tsx +68 -0
  105. package/src/formatProps.ts +108 -18
  106. package/src/index.ts +5 -0
  107. package/src/specs/NitroNumber.nitro.ts +69 -0
  108. package/src/specs/NitroText.nitro.ts +65 -0
@@ -48,6 +48,11 @@ namespace margelo::nitro::nitroinput::views {
48
48
  loading(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "loading", rawProps, sourceProps.loading)),
49
49
  shimmerColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerColor", rawProps, sourceProps.shimmerColor)),
50
50
  shimmerDuration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerDuration", rawProps, sourceProps.shimmerDuration)),
51
+ shimmerAngle(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerAngle", rawProps, sourceProps.shimmerAngle)),
52
+ shimmerWidth(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerWidth", rawProps, sourceProps.shimmerWidth)),
53
+ shimmerBaseColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerBaseColor", rawProps, sourceProps.shimmerBaseColor)),
54
+ shimmerDirection(nitro::ReactProp<std::optional<NitroNumberShimmerDirection>>::fromRawValue("NitroNumberView", "shimmerDirection", rawProps, sourceProps.shimmerDirection)),
55
+ shimmerDelay(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "shimmerDelay", rawProps, sourceProps.shimmerDelay)),
51
56
  fontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "fontSize", rawProps, sourceProps.fontSize)),
52
57
  prefixFontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "prefixFontSize", rawProps, sourceProps.prefixFontSize)),
53
58
  suffixFontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "suffixFontSize", rawProps, sourceProps.suffixFontSize)),
@@ -60,6 +65,19 @@ namespace margelo::nitro::nitroinput::views {
60
65
  prefixOffset(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "prefixOffset", rawProps, sourceProps.prefixOffset)),
61
66
  suffixOffset(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "suffixOffset", rawProps, sourceProps.suffixOffset)),
62
67
  tabularNums(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "tabularNums", rawProps, sourceProps.tabularNums)),
68
+ signDisplay(nitro::ReactProp<std::optional<NitroNumberSignDisplay>>::fromRawValue("NitroNumberView", "signDisplay", rawProps, sourceProps.signDisplay)),
69
+ plusSign(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "plusSign", rawProps, sourceProps.plusSign)),
70
+ minusSign(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroNumberView", "minusSign", rawProps, sourceProps.minusSign)),
71
+ digitGlyphs(nitro::ReactProp<std::optional<std::vector<std::string>>>::fromRawValue("NitroNumberView", "digitGlyphs", rawProps, sourceProps.digitGlyphs)),
72
+ groupingSizes(nitro::ReactProp<std::optional<std::vector<double>>>::fromRawValue("NitroNumberView", "groupingSizes", rawProps, sourceProps.groupingSizes)),
73
+ digitMax(nitro::ReactProp<std::optional<std::vector<double>>>::fromRawValue("NitroNumberView", "digitMax", rawProps, sourceProps.digitMax)),
74
+ continuous(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "continuous", rawProps, sourceProps.continuous)),
75
+ prefixColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "prefixColor", rawProps, sourceProps.prefixColor)),
76
+ suffixColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "suffixColor", rawProps, sourceProps.suffixColor)),
77
+ fractionColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "fractionColor", rawProps, sourceProps.fractionColor)),
78
+ fractionFontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "fractionFontSize", rawProps, sourceProps.fractionFontSize)),
79
+ fractionAlign(nitro::ReactProp<std::optional<NitroNumberAffixAlign>>::fromRawValue("NitroNumberView", "fractionAlign", rawProps, sourceProps.fractionAlign)),
80
+ respectReduceMotion(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "respectReduceMotion", rawProps, sourceProps.respectReduceMotion)),
63
81
  adjustsFontSizeToFit(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "adjustsFontSizeToFit", rawProps, sourceProps.adjustsFontSizeToFit)),
64
82
  minimumFontScale(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroNumberView", "minimumFontScale", rawProps, sourceProps.minimumFontScale)),
65
83
  allowFontScaling(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroNumberView", "allowFontScaling", rawProps, sourceProps.allowFontScaling)),
@@ -72,6 +90,8 @@ namespace margelo::nitro::nitroinput::views {
72
90
  onSizeChange(nitro::ReactProp<std::optional<std::function<void(double /* width */, double /* height */)>>>::fromRawValue("NitroNumberView", "onSizeChange", rawProps, sourceProps.onSizeChange)),
73
91
  onRevealEnd(nitro::ReactProp<std::optional<std::function<void()>>>::fromRawValue("NitroNumberView", "onRevealEnd", rawProps, sourceProps.onRevealEnd)),
74
92
  onRevealMilestone(nitro::ReactProp<std::optional<std::function<void(double /* index */, double /* value */)>>>::fromRawValue("NitroNumberView", "onRevealMilestone", rawProps, sourceProps.onRevealMilestone)),
93
+ onAnimationStart(nitro::ReactProp<std::optional<std::function<void()>>>::fromRawValue("NitroNumberView", "onAnimationStart", rawProps, sourceProps.onAnimationStart)),
94
+ onAnimationEnd(nitro::ReactProp<std::optional<std::function<void(double /* value */)>>>::fromRawValue("NitroNumberView", "onAnimationEnd", rawProps, sourceProps.onAnimationEnd)),
75
95
  hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroNumberViewSpec>& /* ref */)>>>::fromRawValue("NitroNumberView", "hybridRef", rawProps, sourceProps.hybridRef)) { }
76
96
 
77
97
  bool HybridNitroNumberViewProps::filterObjectKeys(const std::string& propName) {
@@ -104,6 +124,11 @@ namespace margelo::nitro::nitroinput::views {
104
124
  case hashString("loading"): return true;
105
125
  case hashString("shimmerColor"): return true;
106
126
  case hashString("shimmerDuration"): return true;
127
+ case hashString("shimmerAngle"): return true;
128
+ case hashString("shimmerWidth"): return true;
129
+ case hashString("shimmerBaseColor"): return true;
130
+ case hashString("shimmerDirection"): return true;
131
+ case hashString("shimmerDelay"): return true;
107
132
  case hashString("fontSize"): return true;
108
133
  case hashString("prefixFontSize"): return true;
109
134
  case hashString("suffixFontSize"): return true;
@@ -116,6 +141,19 @@ namespace margelo::nitro::nitroinput::views {
116
141
  case hashString("prefixOffset"): return true;
117
142
  case hashString("suffixOffset"): return true;
118
143
  case hashString("tabularNums"): return true;
144
+ case hashString("signDisplay"): return true;
145
+ case hashString("plusSign"): return true;
146
+ case hashString("minusSign"): return true;
147
+ case hashString("digitGlyphs"): return true;
148
+ case hashString("groupingSizes"): return true;
149
+ case hashString("digitMax"): return true;
150
+ case hashString("continuous"): return true;
151
+ case hashString("prefixColor"): return true;
152
+ case hashString("suffixColor"): return true;
153
+ case hashString("fractionColor"): return true;
154
+ case hashString("fractionFontSize"): return true;
155
+ case hashString("fractionAlign"): return true;
156
+ case hashString("respectReduceMotion"): return true;
119
157
  case hashString("adjustsFontSizeToFit"): return true;
120
158
  case hashString("minimumFontScale"): return true;
121
159
  case hashString("allowFontScaling"): return true;
@@ -128,6 +166,8 @@ namespace margelo::nitro::nitroinput::views {
128
166
  case hashString("onSizeChange"): return true;
129
167
  case hashString("onRevealEnd"): return true;
130
168
  case hashString("onRevealMilestone"): return true;
169
+ case hashString("onAnimationStart"): return true;
170
+ case hashString("onAnimationEnd"): return true;
131
171
  case hashString("hybridRef"): return true;
132
172
  default: return false;
133
173
  }
@@ -24,7 +24,9 @@
24
24
  #include "NitroNumberDirection.hpp"
25
25
  #include "NitroNumberRevealStyle.hpp"
26
26
  #include <vector>
27
+ #include "NitroNumberShimmerDirection.hpp"
27
28
  #include "NitroNumberAffixAlign.hpp"
29
+ #include "NitroNumberSignDisplay.hpp"
28
30
  #include "NitroNumberTextAlign.hpp"
29
31
  #include <functional>
30
32
  #include <memory>
@@ -78,6 +80,11 @@ namespace margelo::nitro::nitroinput::views {
78
80
  nitro::ReactProp<std::optional<bool>> loading;
79
81
  nitro::ReactProp<std::optional<double>> shimmerColor;
80
82
  nitro::ReactProp<std::optional<double>> shimmerDuration;
83
+ nitro::ReactProp<std::optional<double>> shimmerAngle;
84
+ nitro::ReactProp<std::optional<double>> shimmerWidth;
85
+ nitro::ReactProp<std::optional<double>> shimmerBaseColor;
86
+ nitro::ReactProp<std::optional<NitroNumberShimmerDirection>> shimmerDirection;
87
+ nitro::ReactProp<std::optional<double>> shimmerDelay;
81
88
  nitro::ReactProp<std::optional<double>> fontSize;
82
89
  nitro::ReactProp<std::optional<double>> prefixFontSize;
83
90
  nitro::ReactProp<std::optional<double>> suffixFontSize;
@@ -90,6 +97,19 @@ namespace margelo::nitro::nitroinput::views {
90
97
  nitro::ReactProp<std::optional<double>> prefixOffset;
91
98
  nitro::ReactProp<std::optional<double>> suffixOffset;
92
99
  nitro::ReactProp<std::optional<bool>> tabularNums;
100
+ nitro::ReactProp<std::optional<NitroNumberSignDisplay>> signDisplay;
101
+ nitro::ReactProp<std::optional<std::string>> plusSign;
102
+ nitro::ReactProp<std::optional<std::string>> minusSign;
103
+ nitro::ReactProp<std::optional<std::vector<std::string>>> digitGlyphs;
104
+ nitro::ReactProp<std::optional<std::vector<double>>> groupingSizes;
105
+ nitro::ReactProp<std::optional<std::vector<double>>> digitMax;
106
+ nitro::ReactProp<std::optional<bool>> continuous;
107
+ nitro::ReactProp<std::optional<double>> prefixColor;
108
+ nitro::ReactProp<std::optional<double>> suffixColor;
109
+ nitro::ReactProp<std::optional<double>> fractionColor;
110
+ nitro::ReactProp<std::optional<double>> fractionFontSize;
111
+ nitro::ReactProp<std::optional<NitroNumberAffixAlign>> fractionAlign;
112
+ nitro::ReactProp<std::optional<bool>> respectReduceMotion;
93
113
  nitro::ReactProp<std::optional<bool>> adjustsFontSizeToFit;
94
114
  nitro::ReactProp<std::optional<double>> minimumFontScale;
95
115
  nitro::ReactProp<std::optional<bool>> allowFontScaling;
@@ -102,6 +122,8 @@ namespace margelo::nitro::nitroinput::views {
102
122
  nitro::ReactProp<std::optional<std::function<void(double /* width */, double /* height */)>>> onSizeChange;
103
123
  nitro::ReactProp<std::optional<std::function<void()>>> onRevealEnd;
104
124
  nitro::ReactProp<std::optional<std::function<void(double /* index */, double /* value */)>>> onRevealMilestone;
125
+ nitro::ReactProp<std::optional<std::function<void()>>> onAnimationStart;
126
+ nitro::ReactProp<std::optional<std::function<void(double /* value */)>>> onAnimationEnd;
105
127
  nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroNumberViewSpec>& /* ref */)>>> hybridRef;
106
128
 
107
129
  [[nodiscard]]
@@ -134,6 +156,11 @@ namespace margelo::nitro::nitroinput::views {
134
156
  loading.hasSameValue(other.loading) &&
135
157
  shimmerColor.hasSameValue(other.shimmerColor) &&
136
158
  shimmerDuration.hasSameValue(other.shimmerDuration) &&
159
+ shimmerAngle.hasSameValue(other.shimmerAngle) &&
160
+ shimmerWidth.hasSameValue(other.shimmerWidth) &&
161
+ shimmerBaseColor.hasSameValue(other.shimmerBaseColor) &&
162
+ shimmerDirection.hasSameValue(other.shimmerDirection) &&
163
+ shimmerDelay.hasSameValue(other.shimmerDelay) &&
137
164
  fontSize.hasSameValue(other.fontSize) &&
138
165
  prefixFontSize.hasSameValue(other.prefixFontSize) &&
139
166
  suffixFontSize.hasSameValue(other.suffixFontSize) &&
@@ -146,6 +173,19 @@ namespace margelo::nitro::nitroinput::views {
146
173
  prefixOffset.hasSameValue(other.prefixOffset) &&
147
174
  suffixOffset.hasSameValue(other.suffixOffset) &&
148
175
  tabularNums.hasSameValue(other.tabularNums) &&
176
+ signDisplay.hasSameValue(other.signDisplay) &&
177
+ plusSign.hasSameValue(other.plusSign) &&
178
+ minusSign.hasSameValue(other.minusSign) &&
179
+ digitGlyphs.hasSameValue(other.digitGlyphs) &&
180
+ groupingSizes.hasSameValue(other.groupingSizes) &&
181
+ digitMax.hasSameValue(other.digitMax) &&
182
+ continuous.hasSameValue(other.continuous) &&
183
+ prefixColor.hasSameValue(other.prefixColor) &&
184
+ suffixColor.hasSameValue(other.suffixColor) &&
185
+ fractionColor.hasSameValue(other.fractionColor) &&
186
+ fractionFontSize.hasSameValue(other.fractionFontSize) &&
187
+ fractionAlign.hasSameValue(other.fractionAlign) &&
188
+ respectReduceMotion.hasSameValue(other.respectReduceMotion) &&
149
189
  adjustsFontSizeToFit.hasSameValue(other.adjustsFontSizeToFit) &&
150
190
  minimumFontScale.hasSameValue(other.minimumFontScale) &&
151
191
  allowFontScaling.hasSameValue(other.allowFontScaling) &&
@@ -158,6 +198,8 @@ namespace margelo::nitro::nitroinput::views {
158
198
  onSizeChange.hasSameValue(other.onSizeChange) &&
159
199
  onRevealEnd.hasSameValue(other.onRevealEnd) &&
160
200
  onRevealMilestone.hasSameValue(other.onRevealMilestone) &&
201
+ onAnimationStart.hasSameValue(other.onAnimationStart) &&
202
+ onAnimationEnd.hasSameValue(other.onAnimationEnd) &&
161
203
  hybridRef.hasSameValue(other.hybridRef);
162
204
  }
163
205
 
@@ -191,6 +233,11 @@ namespace margelo::nitro::nitroinput::views {
191
233
  loading.isProvided() ||
192
234
  shimmerColor.isProvided() ||
193
235
  shimmerDuration.isProvided() ||
236
+ shimmerAngle.isProvided() ||
237
+ shimmerWidth.isProvided() ||
238
+ shimmerBaseColor.isProvided() ||
239
+ shimmerDirection.isProvided() ||
240
+ shimmerDelay.isProvided() ||
194
241
  fontSize.isProvided() ||
195
242
  prefixFontSize.isProvided() ||
196
243
  suffixFontSize.isProvided() ||
@@ -203,6 +250,19 @@ namespace margelo::nitro::nitroinput::views {
203
250
  prefixOffset.isProvided() ||
204
251
  suffixOffset.isProvided() ||
205
252
  tabularNums.isProvided() ||
253
+ signDisplay.isProvided() ||
254
+ plusSign.isProvided() ||
255
+ minusSign.isProvided() ||
256
+ digitGlyphs.isProvided() ||
257
+ groupingSizes.isProvided() ||
258
+ digitMax.isProvided() ||
259
+ continuous.isProvided() ||
260
+ prefixColor.isProvided() ||
261
+ suffixColor.isProvided() ||
262
+ fractionColor.isProvided() ||
263
+ fractionFontSize.isProvided() ||
264
+ fractionAlign.isProvided() ||
265
+ respectReduceMotion.isProvided() ||
206
266
  adjustsFontSizeToFit.isProvided() ||
207
267
  minimumFontScale.isProvided() ||
208
268
  allowFontScaling.isProvided() ||
@@ -215,6 +275,8 @@ namespace margelo::nitro::nitroinput::views {
215
275
  onSizeChange.isProvided() ||
216
276
  onRevealEnd.isProvided() ||
217
277
  onRevealMilestone.isProvided() ||
278
+ onAnimationStart.isProvided() ||
279
+ onAnimationEnd.isProvided() ||
218
280
  hybridRef.isProvided();
219
281
  }
220
282
 
@@ -0,0 +1,74 @@
1
+ ///
2
+ /// HybridNitroTextViewComponent.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridNitroTextViewComponent.hpp"
9
+
10
+ #include <NitroModules/NitroHash.hpp>
11
+ #include <NitroModules/ReactProp.hpp>
12
+
13
+ namespace margelo::nitro::nitroinput::views {
14
+
15
+ using namespace facebook;
16
+
17
+ extern const char HybridNitroTextViewComponentName[] = "NitroTextView";
18
+
19
+ HybridNitroTextViewProps::HybridNitroTextViewProps(const react::PropsParserContext& context,
20
+ const HybridNitroTextViewProps& sourceProps,
21
+ const react::RawProps& rawProps):
22
+ react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
23
+ text(nitro::ReactProp<std::string>::fromRawValue("NitroTextView", "text", rawProps, sourceProps.text)),
24
+ fontSize(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "fontSize", rawProps, sourceProps.fontSize)),
25
+ fontWeight(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "fontWeight", rawProps, sourceProps.fontWeight)),
26
+ fontFamily(nitro::ReactProp<std::optional<std::string>>::fromRawValue("NitroTextView", "fontFamily", rawProps, sourceProps.fontFamily)),
27
+ color(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "color", rawProps, sourceProps.color)),
28
+ letterSpacing(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "letterSpacing", rawProps, sourceProps.letterSpacing)),
29
+ textAlign(nitro::ReactProp<std::optional<NitroNumberTextAlign>>::fromRawValue("NitroTextView", "textAlign", rawProps, sourceProps.textAlign)),
30
+ rightToLeft(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroTextView", "rightToLeft", rawProps, sourceProps.rightToLeft)),
31
+ duration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "duration", rawProps, sourceProps.duration)),
32
+ easing(nitro::ReactProp<std::optional<NitroInputEasing>>::fromRawValue("NitroTextView", "easing", rawProps, sourceProps.easing)),
33
+ bounce(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "bounce", rawProps, sourceProps.bounce)),
34
+ effect(nitro::ReactProp<std::optional<NitroInputEffect>>::fromRawValue("NitroTextView", "effect", rawProps, sourceProps.effect)),
35
+ respectReduceMotion(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroTextView", "respectReduceMotion", rawProps, sourceProps.respectReduceMotion)),
36
+ loading(nitro::ReactProp<std::optional<bool>>::fromRawValue("NitroTextView", "loading", rawProps, sourceProps.loading)),
37
+ shimmerColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "shimmerColor", rawProps, sourceProps.shimmerColor)),
38
+ shimmerDuration(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "shimmerDuration", rawProps, sourceProps.shimmerDuration)),
39
+ shimmerAngle(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "shimmerAngle", rawProps, sourceProps.shimmerAngle)),
40
+ shimmerWidth(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "shimmerWidth", rawProps, sourceProps.shimmerWidth)),
41
+ shimmerBaseColor(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "shimmerBaseColor", rawProps, sourceProps.shimmerBaseColor)),
42
+ shimmerDirection(nitro::ReactProp<std::optional<NitroNumberShimmerDirection>>::fromRawValue("NitroTextView", "shimmerDirection", rawProps, sourceProps.shimmerDirection)),
43
+ shimmerDelay(nitro::ReactProp<std::optional<double>>::fromRawValue("NitroTextView", "shimmerDelay", rawProps, sourceProps.shimmerDelay)),
44
+ hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroTextViewSpec>& /* ref */)>>>::fromRawValue("NitroTextView", "hybridRef", rawProps, sourceProps.hybridRef)) { }
45
+
46
+ bool HybridNitroTextViewProps::filterObjectKeys(const std::string& propName) {
47
+ switch (hashString(propName)) {
48
+ case hashString("text"): return true;
49
+ case hashString("fontSize"): return true;
50
+ case hashString("fontWeight"): return true;
51
+ case hashString("fontFamily"): return true;
52
+ case hashString("color"): return true;
53
+ case hashString("letterSpacing"): return true;
54
+ case hashString("textAlign"): return true;
55
+ case hashString("rightToLeft"): return true;
56
+ case hashString("duration"): return true;
57
+ case hashString("easing"): return true;
58
+ case hashString("bounce"): return true;
59
+ case hashString("effect"): return true;
60
+ case hashString("respectReduceMotion"): return true;
61
+ case hashString("loading"): return true;
62
+ case hashString("shimmerColor"): return true;
63
+ case hashString("shimmerDuration"): return true;
64
+ case hashString("shimmerAngle"): return true;
65
+ case hashString("shimmerWidth"): return true;
66
+ case hashString("shimmerBaseColor"): return true;
67
+ case hashString("shimmerDirection"): return true;
68
+ case hashString("shimmerDelay"): return true;
69
+ case hashString("hybridRef"): return true;
70
+ default: return false;
71
+ }
72
+ }
73
+
74
+ } // namespace margelo::nitro::nitroinput::views
@@ -0,0 +1,149 @@
1
+ ///
2
+ /// HybridNitroTextViewComponent.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <NitroModules/ReactProp.hpp>
11
+ #include <NitroModules/ViewComponentDescriptor.hpp>
12
+ #include <NitroModules/ViewPropsHolderState.hpp>
13
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
14
+ #include <react/renderer/components/view/ViewProps.h>
15
+ #include <react/renderer/core/PropsParserContext.h>
16
+ #include <react/renderer/core/RawProps.h>
17
+
18
+ #include <string>
19
+
20
+ #include <string>
21
+ #include <optional>
22
+ #include "NitroNumberTextAlign.hpp"
23
+ #include "NitroInputEasing.hpp"
24
+ #include "NitroInputEffect.hpp"
25
+ #include "NitroNumberShimmerDirection.hpp"
26
+ #include <memory>
27
+ #include "HybridNitroTextViewSpec.hpp"
28
+ #include <functional>
29
+
30
+ namespace margelo::nitro::nitroinput::views {
31
+
32
+ using namespace facebook;
33
+
34
+ /**
35
+ * The name of the actual native View.
36
+ */
37
+ extern const char HybridNitroTextViewComponentName[];
38
+
39
+ /**
40
+ * Props for the "NitroTextView" View.
41
+ */
42
+ class HybridNitroTextViewProps final: public react::ViewProps {
43
+ public:
44
+ HybridNitroTextViewProps() = default;
45
+ HybridNitroTextViewProps(const react::PropsParserContext& context,
46
+ const HybridNitroTextViewProps& sourceProps,
47
+ const react::RawProps& rawProps);
48
+
49
+ public:
50
+ nitro::ReactProp<std::string> text;
51
+ nitro::ReactProp<std::optional<double>> fontSize;
52
+ nitro::ReactProp<std::optional<double>> fontWeight;
53
+ nitro::ReactProp<std::optional<std::string>> fontFamily;
54
+ nitro::ReactProp<std::optional<double>> color;
55
+ nitro::ReactProp<std::optional<double>> letterSpacing;
56
+ nitro::ReactProp<std::optional<NitroNumberTextAlign>> textAlign;
57
+ nitro::ReactProp<std::optional<bool>> rightToLeft;
58
+ nitro::ReactProp<std::optional<double>> duration;
59
+ nitro::ReactProp<std::optional<NitroInputEasing>> easing;
60
+ nitro::ReactProp<std::optional<double>> bounce;
61
+ nitro::ReactProp<std::optional<NitroInputEffect>> effect;
62
+ nitro::ReactProp<std::optional<bool>> respectReduceMotion;
63
+ nitro::ReactProp<std::optional<bool>> loading;
64
+ nitro::ReactProp<std::optional<double>> shimmerColor;
65
+ nitro::ReactProp<std::optional<double>> shimmerDuration;
66
+ nitro::ReactProp<std::optional<double>> shimmerAngle;
67
+ nitro::ReactProp<std::optional<double>> shimmerWidth;
68
+ nitro::ReactProp<std::optional<double>> shimmerBaseColor;
69
+ nitro::ReactProp<std::optional<NitroNumberShimmerDirection>> shimmerDirection;
70
+ nitro::ReactProp<std::optional<double>> shimmerDelay;
71
+ nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroTextViewSpec>& /* ref */)>>> hybridRef;
72
+
73
+ [[nodiscard]]
74
+ bool hasSameProps(const HybridNitroTextViewProps& other) const noexcept {
75
+ return text.hasSameValue(other.text) &&
76
+ fontSize.hasSameValue(other.fontSize) &&
77
+ fontWeight.hasSameValue(other.fontWeight) &&
78
+ fontFamily.hasSameValue(other.fontFamily) &&
79
+ color.hasSameValue(other.color) &&
80
+ letterSpacing.hasSameValue(other.letterSpacing) &&
81
+ textAlign.hasSameValue(other.textAlign) &&
82
+ rightToLeft.hasSameValue(other.rightToLeft) &&
83
+ duration.hasSameValue(other.duration) &&
84
+ easing.hasSameValue(other.easing) &&
85
+ bounce.hasSameValue(other.bounce) &&
86
+ effect.hasSameValue(other.effect) &&
87
+ respectReduceMotion.hasSameValue(other.respectReduceMotion) &&
88
+ loading.hasSameValue(other.loading) &&
89
+ shimmerColor.hasSameValue(other.shimmerColor) &&
90
+ shimmerDuration.hasSameValue(other.shimmerDuration) &&
91
+ shimmerAngle.hasSameValue(other.shimmerAngle) &&
92
+ shimmerWidth.hasSameValue(other.shimmerWidth) &&
93
+ shimmerBaseColor.hasSameValue(other.shimmerBaseColor) &&
94
+ shimmerDirection.hasSameValue(other.shimmerDirection) &&
95
+ shimmerDelay.hasSameValue(other.shimmerDelay) &&
96
+ hybridRef.hasSameValue(other.hybridRef);
97
+ }
98
+
99
+ [[nodiscard]]
100
+ bool hasAnyProvidedProps() const noexcept {
101
+ return text.isProvided() ||
102
+ fontSize.isProvided() ||
103
+ fontWeight.isProvided() ||
104
+ fontFamily.isProvided() ||
105
+ color.isProvided() ||
106
+ letterSpacing.isProvided() ||
107
+ textAlign.isProvided() ||
108
+ rightToLeft.isProvided() ||
109
+ duration.isProvided() ||
110
+ easing.isProvided() ||
111
+ bounce.isProvided() ||
112
+ effect.isProvided() ||
113
+ respectReduceMotion.isProvided() ||
114
+ loading.isProvided() ||
115
+ shimmerColor.isProvided() ||
116
+ shimmerDuration.isProvided() ||
117
+ shimmerAngle.isProvided() ||
118
+ shimmerWidth.isProvided() ||
119
+ shimmerBaseColor.isProvided() ||
120
+ shimmerDirection.isProvided() ||
121
+ shimmerDelay.isProvided() ||
122
+ hybridRef.isProvided();
123
+ }
124
+
125
+ private:
126
+ static bool filterObjectKeys(const std::string& propName);
127
+ };
128
+
129
+ /**
130
+ * State for the "NitroTextView" View.
131
+ */
132
+ using HybridNitroTextViewState = nitro::ViewPropsHolderState<HybridNitroTextViewProps>;
133
+
134
+ /**
135
+ * The Shadow Node for the "NitroTextView" View.
136
+ */
137
+ using HybridNitroTextViewShadowNode = react::ConcreteViewShadowNode<HybridNitroTextViewComponentName /* "HybridNitroTextView" */,
138
+ HybridNitroTextViewProps /* custom props */,
139
+ react::ViewEventEmitter /* default */,
140
+ HybridNitroTextViewState /* custom state */>;
141
+
142
+ /**
143
+ * The Component Descriptor for the "NitroTextView" View.
144
+ */
145
+ using HybridNitroTextViewComponentDescriptor = nitro::ViewComponentDescriptor<HybridNitroTextViewShadowNode>;
146
+
147
+ /* The actual view for "NitroTextView" needs to be implemented in platform-specific code. */
148
+
149
+ } // namespace margelo::nitro::nitroinput::views
@@ -32,6 +32,11 @@
32
32
  "loading": true,
33
33
  "shimmerColor": true,
34
34
  "shimmerDuration": true,
35
+ "shimmerAngle": true,
36
+ "shimmerWidth": true,
37
+ "shimmerBaseColor": true,
38
+ "shimmerDirection": true,
39
+ "shimmerDelay": true,
35
40
  "fontSize": true,
36
41
  "prefixFontSize": true,
37
42
  "suffixFontSize": true,
@@ -44,6 +49,19 @@
44
49
  "prefixOffset": true,
45
50
  "suffixOffset": true,
46
51
  "tabularNums": true,
52
+ "signDisplay": true,
53
+ "plusSign": true,
54
+ "minusSign": true,
55
+ "digitGlyphs": true,
56
+ "groupingSizes": true,
57
+ "digitMax": true,
58
+ "continuous": true,
59
+ "prefixColor": true,
60
+ "suffixColor": true,
61
+ "fractionColor": true,
62
+ "fractionFontSize": true,
63
+ "fractionAlign": true,
64
+ "respectReduceMotion": true,
47
65
  "adjustsFontSizeToFit": true,
48
66
  "minimumFontScale": true,
49
67
  "allowFontScaling": true,
@@ -56,6 +74,8 @@
56
74
  "onSizeChange": true,
57
75
  "onRevealEnd": true,
58
76
  "onRevealMilestone": true,
77
+ "onAnimationStart": true,
78
+ "onAnimationEnd": true,
59
79
  "hybridRef": true
60
80
  }
61
81
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "uiViewClassName": "NitroTextView",
3
+ "supportsRawText": false,
4
+ "bubblingEventTypes": {},
5
+ "directEventTypes": {},
6
+ "validAttributes": {
7
+ "text": true,
8
+ "fontSize": true,
9
+ "fontWeight": true,
10
+ "fontFamily": true,
11
+ "color": true,
12
+ "letterSpacing": true,
13
+ "textAlign": true,
14
+ "rightToLeft": true,
15
+ "duration": true,
16
+ "easing": true,
17
+ "bounce": true,
18
+ "effect": true,
19
+ "respectReduceMotion": true,
20
+ "loading": true,
21
+ "shimmerColor": true,
22
+ "shimmerDuration": true,
23
+ "shimmerAngle": true,
24
+ "shimmerWidth": true,
25
+ "shimmerBaseColor": true,
26
+ "shimmerDirection": true,
27
+ "shimmerDelay": true,
28
+ "hybridRef": true
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-input",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Native text for React Native, built with Nitro: a text and amount input with native formatting, masks and a Torph-style reflow, and an animated number (odometer, SwiftUI-style numeric text, ticker) whose digits roll or swap natively, with currency layouts and animated currency switches, shrink-to-fit, a loading shimmer and a jackpot reveal.",
5
5
  "main": "lib/commonjs/src/index.js",
6
6
  "module": "lib/module/src/index.js",