@whetware/react-native-stroke-text 0.0.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 +7 -0
- package/LICENSE.md +21 -0
- package/NitroStrokeText.podspec +31 -0
- package/README.md +45 -0
- package/android/CMakeLists.txt +29 -0
- package/android/build.gradle +142 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -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/stroketext/HybridStrokeTextView.kt +107 -0
- package/android/src/main/java/com/margelo/nitro/stroketext/NitroStrokeTextPackage.kt +39 -0
- package/android/src/main/java/com/margelo/nitro/stroketext/StrokeTextView.kt +429 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridStrokeTextView.swift +114 -0
- package/ios/StrokeTextColor.swift +120 -0
- package/ios/StrokeTextView.swift +326 -0
- package/ios/StrokedTextLabel.swift +72 -0
- package/lib/StrokeText.d.ts +3 -0
- package/lib/StrokeText.js +109 -0
- package/lib/StrokeText.web.d.ts +3 -0
- package/lib/StrokeText.web.js +106 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.web.d.ts +2 -0
- package/lib/index.web.js +1 -0
- package/lib/specs/StrokeTextView.nitro.d.ts +37 -0
- package/lib/specs/StrokeTextView.nitro.js +1 -0
- package/lib/types.d.ts +17 -0
- package/lib/types.js +1 -0
- package/nitro.json +24 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroStrokeText+autolinking.cmake +83 -0
- package/nitrogen/generated/android/NitroStrokeText+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroStrokeTextOnLoad.cpp +46 -0
- package/nitrogen/generated/android/NitroStrokeTextOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JHybridStrokeTextViewSpec.cpp +308 -0
- package/nitrogen/generated/android/c++/JHybridStrokeTextViewSpec.hpp +117 -0
- package/nitrogen/generated/android/c++/JStrokeTextAlign.hpp +67 -0
- package/nitrogen/generated/android/c++/JStrokeTextDecorationLine.hpp +64 -0
- package/nitrogen/generated/android/c++/JStrokeTextEllipsizeMode.hpp +64 -0
- package/nitrogen/generated/android/c++/JStrokeTextFontStyle.hpp +58 -0
- package/nitrogen/generated/android/c++/JStrokeTextTransform.hpp +64 -0
- package/nitrogen/generated/android/c++/views/JHybridStrokeTextViewStateUpdater.cpp +156 -0
- package/nitrogen/generated/android/c++/views/JHybridStrokeTextViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/HybridStrokeTextViewSpec.kt +209 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/NitroStrokeTextOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextAlign.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextDecorationLine.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextEllipsizeMode.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextFontStyle.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextTransform.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/views/HybridStrokeTextViewManager.kt +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/views/HybridStrokeTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroStrokeText+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroStrokeText-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/NitroStrokeText-Swift-Cxx-Bridge.hpp +177 -0
- package/nitrogen/generated/ios/NitroStrokeText-Swift-Cxx-Umbrella.hpp +58 -0
- package/nitrogen/generated/ios/NitroStrokeTextAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroStrokeTextAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridStrokeTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridStrokeTextViewSpecSwift.hpp +271 -0
- package/nitrogen/generated/ios/c++/views/HybridStrokeTextViewComponent.mm +232 -0
- package/nitrogen/generated/ios/swift/HybridStrokeTextViewSpec.swift +81 -0
- package/nitrogen/generated/ios/swift/HybridStrokeTextViewSpec_cxx.swift +620 -0
- package/nitrogen/generated/ios/swift/StrokeTextAlign.swift +52 -0
- package/nitrogen/generated/ios/swift/StrokeTextDecorationLine.swift +48 -0
- package/nitrogen/generated/ios/swift/StrokeTextEllipsizeMode.swift +48 -0
- package/nitrogen/generated/ios/swift/StrokeTextFontStyle.swift +40 -0
- package/nitrogen/generated/ios/swift/StrokeTextTransform.swift +48 -0
- package/nitrogen/generated/shared/c++/HybridStrokeTextViewSpec.cpp +72 -0
- package/nitrogen/generated/shared/c++/HybridStrokeTextViewSpec.hpp +128 -0
- package/nitrogen/generated/shared/c++/StrokeTextAlign.hpp +88 -0
- package/nitrogen/generated/shared/c++/StrokeTextDecorationLine.hpp +84 -0
- package/nitrogen/generated/shared/c++/StrokeTextEllipsizeMode.hpp +84 -0
- package/nitrogen/generated/shared/c++/StrokeTextFontStyle.hpp +76 -0
- package/nitrogen/generated/shared/c++/StrokeTextTransform.hpp +84 -0
- package/nitrogen/generated/shared/c++/views/HybridStrokeTextViewComponent.cpp +388 -0
- package/nitrogen/generated/shared/c++/views/HybridStrokeTextViewComponent.hpp +138 -0
- package/nitrogen/generated/shared/json/StrokeTextViewConfig.json +35 -0
- package/package.json +124 -0
- package/react-native.config.js +16 -0
package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/HybridStrokeTextViewSpec.kt
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridStrokeTextViewSpec.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.stroketext
|
|
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 StrokeTextView HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of StrokeTextView.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridStrokeTextViewSpec: 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 StrokeTextView]"
|
|
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 color: String?
|
|
56
|
+
|
|
57
|
+
@get:DoNotStrip
|
|
58
|
+
@get:Keep
|
|
59
|
+
@set:DoNotStrip
|
|
60
|
+
@set:Keep
|
|
61
|
+
abstract var strokeColor: String?
|
|
62
|
+
|
|
63
|
+
@get:DoNotStrip
|
|
64
|
+
@get:Keep
|
|
65
|
+
@set:DoNotStrip
|
|
66
|
+
@set:Keep
|
|
67
|
+
abstract var strokeWidth: Double?
|
|
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 fontWeight: String?
|
|
80
|
+
|
|
81
|
+
@get:DoNotStrip
|
|
82
|
+
@get:Keep
|
|
83
|
+
@set:DoNotStrip
|
|
84
|
+
@set:Keep
|
|
85
|
+
abstract var fontFamily: String?
|
|
86
|
+
|
|
87
|
+
@get:DoNotStrip
|
|
88
|
+
@get:Keep
|
|
89
|
+
@set:DoNotStrip
|
|
90
|
+
@set:Keep
|
|
91
|
+
abstract var fontStyle: StrokeTextFontStyle?
|
|
92
|
+
|
|
93
|
+
@get:DoNotStrip
|
|
94
|
+
@get:Keep
|
|
95
|
+
@set:DoNotStrip
|
|
96
|
+
@set:Keep
|
|
97
|
+
abstract var lineHeight: Double?
|
|
98
|
+
|
|
99
|
+
@get:DoNotStrip
|
|
100
|
+
@get:Keep
|
|
101
|
+
@set:DoNotStrip
|
|
102
|
+
@set:Keep
|
|
103
|
+
abstract var letterSpacing: Double?
|
|
104
|
+
|
|
105
|
+
@get:DoNotStrip
|
|
106
|
+
@get:Keep
|
|
107
|
+
@set:DoNotStrip
|
|
108
|
+
@set:Keep
|
|
109
|
+
abstract var textAlign: StrokeTextAlign?
|
|
110
|
+
|
|
111
|
+
@get:DoNotStrip
|
|
112
|
+
@get:Keep
|
|
113
|
+
@set:DoNotStrip
|
|
114
|
+
@set:Keep
|
|
115
|
+
abstract var textDecorationLine: StrokeTextDecorationLine?
|
|
116
|
+
|
|
117
|
+
@get:DoNotStrip
|
|
118
|
+
@get:Keep
|
|
119
|
+
@set:DoNotStrip
|
|
120
|
+
@set:Keep
|
|
121
|
+
abstract var textTransform: StrokeTextTransform?
|
|
122
|
+
|
|
123
|
+
@get:DoNotStrip
|
|
124
|
+
@get:Keep
|
|
125
|
+
@set:DoNotStrip
|
|
126
|
+
@set:Keep
|
|
127
|
+
abstract var opacity: Double?
|
|
128
|
+
|
|
129
|
+
@get:DoNotStrip
|
|
130
|
+
@get:Keep
|
|
131
|
+
@set:DoNotStrip
|
|
132
|
+
@set:Keep
|
|
133
|
+
abstract var allowFontScaling: Boolean?
|
|
134
|
+
|
|
135
|
+
@get:DoNotStrip
|
|
136
|
+
@get:Keep
|
|
137
|
+
@set:DoNotStrip
|
|
138
|
+
@set:Keep
|
|
139
|
+
abstract var maxFontSizeMultiplier: Double?
|
|
140
|
+
|
|
141
|
+
@get:DoNotStrip
|
|
142
|
+
@get:Keep
|
|
143
|
+
@set:DoNotStrip
|
|
144
|
+
@set:Keep
|
|
145
|
+
abstract var includeFontPadding: Boolean?
|
|
146
|
+
|
|
147
|
+
@get:DoNotStrip
|
|
148
|
+
@get:Keep
|
|
149
|
+
@set:DoNotStrip
|
|
150
|
+
@set:Keep
|
|
151
|
+
abstract var numberOfLines: Double?
|
|
152
|
+
|
|
153
|
+
@get:DoNotStrip
|
|
154
|
+
@get:Keep
|
|
155
|
+
@set:DoNotStrip
|
|
156
|
+
@set:Keep
|
|
157
|
+
abstract var ellipsizeMode: StrokeTextEllipsizeMode?
|
|
158
|
+
|
|
159
|
+
@get:DoNotStrip
|
|
160
|
+
@get:Keep
|
|
161
|
+
@set:DoNotStrip
|
|
162
|
+
@set:Keep
|
|
163
|
+
abstract var padding: Double?
|
|
164
|
+
|
|
165
|
+
@get:DoNotStrip
|
|
166
|
+
@get:Keep
|
|
167
|
+
@set:DoNotStrip
|
|
168
|
+
@set:Keep
|
|
169
|
+
abstract var paddingVertical: Double?
|
|
170
|
+
|
|
171
|
+
@get:DoNotStrip
|
|
172
|
+
@get:Keep
|
|
173
|
+
@set:DoNotStrip
|
|
174
|
+
@set:Keep
|
|
175
|
+
abstract var paddingHorizontal: Double?
|
|
176
|
+
|
|
177
|
+
@get:DoNotStrip
|
|
178
|
+
@get:Keep
|
|
179
|
+
@set:DoNotStrip
|
|
180
|
+
@set:Keep
|
|
181
|
+
abstract var paddingTop: Double?
|
|
182
|
+
|
|
183
|
+
@get:DoNotStrip
|
|
184
|
+
@get:Keep
|
|
185
|
+
@set:DoNotStrip
|
|
186
|
+
@set:Keep
|
|
187
|
+
abstract var paddingRight: Double?
|
|
188
|
+
|
|
189
|
+
@get:DoNotStrip
|
|
190
|
+
@get:Keep
|
|
191
|
+
@set:DoNotStrip
|
|
192
|
+
@set:Keep
|
|
193
|
+
abstract var paddingBottom: Double?
|
|
194
|
+
|
|
195
|
+
@get:DoNotStrip
|
|
196
|
+
@get:Keep
|
|
197
|
+
@set:DoNotStrip
|
|
198
|
+
@set:Keep
|
|
199
|
+
abstract var paddingLeft: Double?
|
|
200
|
+
|
|
201
|
+
// Methods
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
private external fun initHybrid(): HybridData
|
|
205
|
+
|
|
206
|
+
companion object {
|
|
207
|
+
protected const val TAG = "HybridStrokeTextViewSpec"
|
|
208
|
+
}
|
|
209
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/NitroStrokeTextOnLoad.kt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroStrokeTextOnLoad.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.stroketext
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class NitroStrokeTextOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "NitroStrokeTextOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "NitroStrokeText".
|
|
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 NitroStrokeText C++ library...")
|
|
25
|
+
System.loadLibrary("NitroStrokeText")
|
|
26
|
+
Log.i(TAG, "Successfully loaded NitroStrokeText C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load NitroStrokeText 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,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextAlign.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.stroketext
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "StrokeTextAlign".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class StrokeTextAlign(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
AUTO(0),
|
|
20
|
+
LEFT(1),
|
|
21
|
+
RIGHT(2),
|
|
22
|
+
CENTER(3),
|
|
23
|
+
JUSTIFY(4);
|
|
24
|
+
|
|
25
|
+
companion object
|
|
26
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextDecorationLine.kt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextDecorationLine.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.stroketext
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "StrokeTextDecorationLine".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class StrokeTextDecorationLine(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NONE(0),
|
|
20
|
+
UNDERLINE(1),
|
|
21
|
+
LINE_THROUGH(2),
|
|
22
|
+
UNDERLINE_LINE_THROUGH(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextEllipsizeMode.kt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextEllipsizeMode.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.stroketext
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "StrokeTextEllipsizeMode".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class StrokeTextEllipsizeMode(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
HEAD(0),
|
|
20
|
+
MIDDLE(1),
|
|
21
|
+
TAIL(2),
|
|
22
|
+
CLIP(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextFontStyle.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.stroketext
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "StrokeTextFontStyle".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class StrokeTextFontStyle(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NORMAL(0),
|
|
20
|
+
ITALIC(1);
|
|
21
|
+
|
|
22
|
+
companion object
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextTransform.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.stroketext
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "StrokeTextTransform".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class StrokeTextTransform(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NONE(0),
|
|
20
|
+
UPPERCASE(1),
|
|
21
|
+
LOWERCASE(2),
|
|
22
|
+
CAPITALIZE(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridStrokeTextViewManager.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.stroketext.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.stroketext.*
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Represents the React Native `ViewManager` for the "StrokeTextView" Nitro HybridView.
|
|
21
|
+
*/
|
|
22
|
+
open class HybridStrokeTextViewManager: SimpleViewManager<View>() {
|
|
23
|
+
init {
|
|
24
|
+
if (RecyclableView::class.java.isAssignableFrom(HybridStrokeTextView::class.java)) {
|
|
25
|
+
// Enable view recycling
|
|
26
|
+
super.setupViewRecycling()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun getName(): String {
|
|
31
|
+
return "StrokeTextView"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
35
|
+
val hybridView = HybridStrokeTextView(reactContext)
|
|
36
|
+
val view = hybridView.view
|
|
37
|
+
view.setTag(associated_hybrid_view_tag, hybridView)
|
|
38
|
+
return view
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
|
|
42
|
+
val hybridView = view.getTag(associated_hybrid_view_tag) as? HybridStrokeTextView
|
|
43
|
+
?: throw Error("Couldn't find view $view in local views table!")
|
|
44
|
+
|
|
45
|
+
// 1. Update each prop individually
|
|
46
|
+
hybridView.beforeUpdate()
|
|
47
|
+
HybridStrokeTextViewStateUpdater.updateViewProps(hybridView, stateWrapper)
|
|
48
|
+
hybridView.afterUpdate()
|
|
49
|
+
|
|
50
|
+
// 2. Continue in base View props
|
|
51
|
+
return super.updateState(view, props, stateWrapper)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
protected override fun prepareToRecycleView(reactContext: ThemedReactContext, view: View): View? {
|
|
55
|
+
super.prepareToRecycleView(reactContext, view)
|
|
56
|
+
val hybridView = view.getTag(associated_hybrid_view_tag) as? HybridStrokeTextView
|
|
57
|
+
?: return null
|
|
58
|
+
|
|
59
|
+
@Suppress("USELESS_IS_CHECK")
|
|
60
|
+
if (hybridView is RecyclableView) {
|
|
61
|
+
// Recycle in it's implementation
|
|
62
|
+
hybridView.prepareForRecycle()
|
|
63
|
+
|
|
64
|
+
// Maybe update the view if it changed
|
|
65
|
+
return hybridView.view
|
|
66
|
+
} else {
|
|
67
|
+
return null
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridStrokeTextViewStateUpdater.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.stroketext.views
|
|
9
|
+
|
|
10
|
+
import com.facebook.react.uimanager.StateWrapper
|
|
11
|
+
import com.margelo.nitro.stroketext.*
|
|
12
|
+
|
|
13
|
+
internal class HybridStrokeTextViewStateUpdater {
|
|
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: HybridStrokeTextViewSpec, state: StateWrapper)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroStrokeText+autolinking.rb
|
|
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
|
+
# 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/NitroStrokeText+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 NitroStrokeText 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/NitroStrokeText-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 ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroStrokeText-Swift-Cxx-Bridge.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 "NitroStrokeText-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridStrokeTextViewSpecSwift.hpp"
|
|
12
|
+
#include "NitroStrokeText-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::stroketext::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::shared_ptr<HybridStrokeTextViewSpec>
|
|
18
|
+
std::shared_ptr<HybridStrokeTextViewSpec> create_std__shared_ptr_HybridStrokeTextViewSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
19
|
+
NitroStrokeText::HybridStrokeTextViewSpec_cxx swiftPart = NitroStrokeText::HybridStrokeTextViewSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
20
|
+
return std::make_shared<margelo::nitro::stroketext::HybridStrokeTextViewSpecSwift>(swiftPart);
|
|
21
|
+
}
|
|
22
|
+
void* NON_NULL get_std__shared_ptr_HybridStrokeTextViewSpec_(std__shared_ptr_HybridStrokeTextViewSpec_ cppType) {
|
|
23
|
+
std::shared_ptr<margelo::nitro::stroketext::HybridStrokeTextViewSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::stroketext::HybridStrokeTextViewSpecSwift>(cppType);
|
|
24
|
+
#ifdef NITRO_DEBUG
|
|
25
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
26
|
+
throw std::runtime_error("Class \"HybridStrokeTextViewSpec\" is not implemented in Swift!");
|
|
27
|
+
}
|
|
28
|
+
#endif
|
|
29
|
+
NitroStrokeText::HybridStrokeTextViewSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
30
|
+
return swiftPart.toUnsafe();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
} // namespace margelo::nitro::stroketext::bridge::swift
|