react-native-advanced-text 0.1.4 → 0.1.5
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.
|
@@ -1,226 +1,94 @@
|
|
|
1
1
|
package com.advancedtext
|
|
2
2
|
|
|
3
|
-
import android.content.Context
|
|
4
3
|
import android.graphics.Color
|
|
5
|
-
import android.
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class AdvancedTextView : TextView, View.OnCreateContextMenuListener {
|
|
23
|
-
|
|
24
|
-
private val TAG = "AdvancedTextView"
|
|
25
|
-
|
|
26
|
-
private var highlightedWords: List<HighlightedWord> = emptyList()
|
|
27
|
-
private var menuOptions: List<String> = emptyList()
|
|
28
|
-
private var indicatorWordIndex: Int = -1
|
|
29
|
-
private var lastSelectedText: String = ""
|
|
30
|
-
private var isSelectionEnabled: Boolean = true
|
|
31
|
-
|
|
32
|
-
constructor(context: Context?) : super(context) { init() }
|
|
33
|
-
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) { init() }
|
|
34
|
-
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { init() }
|
|
35
|
-
|
|
36
|
-
private fun init() {
|
|
37
|
-
Log.d(TAG, "AdvancedTextView initialized")
|
|
38
|
-
movementMethod = LinkMovementMethod.getInstance()
|
|
39
|
-
setTextIsSelectable(true)
|
|
40
|
-
setOnCreateContextMenuListener(this)
|
|
4
|
+
import android.view.ViewGroup
|
|
5
|
+
import com.facebook.react.bridge.ReadableArray
|
|
6
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
7
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
8
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
9
|
+
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
10
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
11
|
+
import com.facebook.react.viewmanagers.AdvancedTextViewManagerInterface
|
|
12
|
+
import com.facebook.react.viewmanagers.AdvancedTextViewManagerDelegate
|
|
13
|
+
|
|
14
|
+
@ReactModule(name = AdvancedTextViewManager.NAME)
|
|
15
|
+
class AdvancedTextViewManager : SimpleViewManager<AdvancedTextView>(),
|
|
16
|
+
AdvancedTextViewManagerInterface<AdvancedTextView> {
|
|
17
|
+
private val mDelegate: ViewManagerDelegate<AdvancedTextView>
|
|
18
|
+
|
|
19
|
+
init {
|
|
20
|
+
mDelegate = AdvancedTextViewManagerDelegate(this)
|
|
41
21
|
}
|
|
42
22
|
|
|
43
|
-
fun
|
|
44
|
-
|
|
45
|
-
this.text = text
|
|
46
|
-
updateTextWithHighlights()
|
|
23
|
+
override fun getDelegate(): ViewManagerDelegate<AdvancedTextView>? {
|
|
24
|
+
return mDelegate
|
|
47
25
|
}
|
|
48
26
|
|
|
49
|
-
fun
|
|
50
|
-
|
|
51
|
-
this.menuOptions = menuOptions
|
|
27
|
+
override fun getName(): String {
|
|
28
|
+
return NAME
|
|
52
29
|
}
|
|
53
30
|
|
|
54
|
-
fun
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
31
|
+
public override fun createViewInstance(context: ThemedReactContext): AdvancedTextView {
|
|
32
|
+
val view = AdvancedTextView(context)
|
|
33
|
+
// Set default layout params to ensure the view is visible
|
|
34
|
+
view.layoutParams = ViewGroup.LayoutParams(
|
|
35
|
+
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
36
|
+
ViewGroup.LayoutParams.WRAP_CONTENT
|
|
37
|
+
)
|
|
38
|
+
return view
|
|
58
39
|
}
|
|
59
40
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
updateTextWithHighlights()
|
|
41
|
+
@ReactProp(name = "text")
|
|
42
|
+
override fun setText(view: AdvancedTextView?, text: String?) {
|
|
43
|
+
view?.setAdvancedText(text ?: "")
|
|
64
44
|
}
|
|
65
45
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
val spannableString = SpannableString(textValue)
|
|
79
|
-
val words = textValue.split("\\s+".toRegex())
|
|
80
|
-
|
|
81
|
-
var currentIndex = 0
|
|
82
|
-
words.forEachIndexed { wordIndex, word ->
|
|
83
|
-
|
|
84
|
-
if (word.isNotEmpty()) {
|
|
85
|
-
val wordStart = textValue.indexOf(word, currentIndex)
|
|
86
|
-
if (wordStart >= 0) {
|
|
87
|
-
val wordEnd = wordStart + word.length
|
|
88
|
-
|
|
89
|
-
highlightedWords.find { it.index == wordIndex }?.let { highlightedWord ->
|
|
90
|
-
val color = Color.parseColor(highlightedWord.highlightColor)
|
|
91
|
-
Log.d(TAG, "Applying highlight to word '$word' at index $wordIndex with color ${highlightedWord.highlightColor}")
|
|
92
|
-
|
|
93
|
-
spannableString.setSpan(
|
|
94
|
-
BackgroundColorSpan(color),
|
|
95
|
-
wordStart,
|
|
96
|
-
wordEnd,
|
|
97
|
-
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (wordIndex == indicatorWordIndex) {
|
|
102
|
-
Log.d(TAG, "Applying indicator span to word '$word' at index $wordIndex")
|
|
103
|
-
|
|
104
|
-
spannableString.setSpan(
|
|
105
|
-
IndicatorSpan(),
|
|
106
|
-
wordStart,
|
|
107
|
-
wordEnd,
|
|
108
|
-
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
|
46
|
+
@ReactProp(name = "highlightedWords")
|
|
47
|
+
override fun setHighlightedWords(view: AdvancedTextView?, highlightedWords: ReadableArray?) {
|
|
48
|
+
val words = mutableListOf<HighlightedWord>()
|
|
49
|
+
highlightedWords?.let {
|
|
50
|
+
for (i in 0 until it.size()) {
|
|
51
|
+
val map = it.getMap(i)
|
|
52
|
+
map?.let { wordMap ->
|
|
53
|
+
words.add(
|
|
54
|
+
HighlightedWord(
|
|
55
|
+
index = wordMap.getInt("index"),
|
|
56
|
+
highlightColor = wordMap.getString("highlightColor") ?: "#FFFF00"
|
|
109
57
|
)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// clickable span
|
|
113
|
-
spannableString.setSpan(
|
|
114
|
-
WordClickableSpan(wordIndex, word),
|
|
115
|
-
wordStart,
|
|
116
|
-
wordEnd,
|
|
117
|
-
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
|
118
58
|
)
|
|
119
|
-
|
|
120
|
-
currentIndex = wordEnd
|
|
121
59
|
}
|
|
122
60
|
}
|
|
123
61
|
}
|
|
124
|
-
|
|
125
|
-
this.text = spannableString
|
|
62
|
+
view?.setHighlightedWords(words)
|
|
126
63
|
}
|
|
127
64
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
val
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
lastSelectedText = text.subSequence(selectionStart, selectionEnd).toString()
|
|
136
|
-
|
|
137
|
-
Log.d(TAG, "User selected text: '$lastSelectedText'")
|
|
138
|
-
Log.d(TAG, "Menu options available: $menuOptions")
|
|
139
|
-
|
|
140
|
-
menu?.clear()
|
|
141
|
-
|
|
142
|
-
menuOptions.forEachIndexed { index, option ->
|
|
143
|
-
menu?.add(0, index, index, option)?.setOnMenuItemClickListener {
|
|
144
|
-
Log.d(TAG, "Menu item clicked: $option")
|
|
145
|
-
onMenuItemClick(it, lastSelectedText)
|
|
146
|
-
true
|
|
65
|
+
@ReactProp(name = "menuOptions")
|
|
66
|
+
override fun setMenuOptions(view: AdvancedTextView?, menuOptions: ReadableArray?) {
|
|
67
|
+
val options = mutableListOf<String>()
|
|
68
|
+
menuOptions?.let {
|
|
69
|
+
for (i in 0 until it.size()) {
|
|
70
|
+
it.getString(i)?.let { option ->
|
|
71
|
+
options.add(option)
|
|
147
72
|
}
|
|
148
73
|
}
|
|
149
|
-
|
|
150
|
-
sendSelectionEvent(lastSelectedText, "selection")
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
private fun onMenuItemClick(item: MenuItem, selectedText: String): Boolean {
|
|
155
|
-
val menuItemText = menuOptions[item.itemId]
|
|
156
|
-
Log.d(TAG, "onMenuItemClick: menuOption='$menuItemText', selectedText='$selectedText'")
|
|
157
|
-
sendSelectionEvent(selectedText, menuItemText)
|
|
158
|
-
return true
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
private fun sendSelectionEvent(selectedText: String, eventType: String) {
|
|
162
|
-
Log.d(TAG, "sendSelectionEvent -> eventType='$eventType' selectedText='$selectedText'")
|
|
163
|
-
|
|
164
|
-
val reactContext = context as ReactContext
|
|
165
|
-
val event = Arguments.createMap().apply {
|
|
166
|
-
putString("selectedText", selectedText)
|
|
167
|
-
putString("event", eventType)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
reactContext.getJSModule(RCTEventEmitter::class.java)
|
|
171
|
-
.receiveEvent(id, "onSelection", event)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private inner class WordClickableSpan(
|
|
175
|
-
private val wordIndex: Int,
|
|
176
|
-
private val word: String
|
|
177
|
-
) : ClickableSpan() {
|
|
178
|
-
|
|
179
|
-
override fun onClick(widget: View) {
|
|
180
|
-
Log.d(TAG, "Word clicked: '$word' (index=$wordIndex)")
|
|
181
|
-
sendWordPressEvent(word, wordIndex)
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
override fun updateDrawState(ds: TextPaint) {
|
|
185
|
-
super.updateDrawState(ds)
|
|
186
|
-
ds.color = currentTextColor
|
|
187
|
-
ds.isUnderlineText = false
|
|
188
74
|
}
|
|
75
|
+
view?.setMenuOptions(options)
|
|
189
76
|
}
|
|
190
77
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
override fun updateDrawState(ds: TextPaint) {
|
|
197
|
-
ds.color = Color.RED
|
|
198
|
-
ds.isFakeBoldText = true
|
|
199
|
-
ds.isUnderlineText = false
|
|
200
|
-
}
|
|
78
|
+
@ReactProp(name = "indicatorWordIndex")
|
|
79
|
+
override fun setIndicatorWordIndex(view: AdvancedTextView?, index: Int) {
|
|
80
|
+
view?.setIndicatorWordIndex(index)
|
|
201
81
|
}
|
|
202
82
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
putInt("index", index)
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
reactContext.getJSModule(RCTEventEmitter::class.java)
|
|
213
|
-
.receiveEvent(id, "onWordPress", event)
|
|
83
|
+
// Add this method to register custom events
|
|
84
|
+
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> {
|
|
85
|
+
return mapOf(
|
|
86
|
+
"onWordPress" to mapOf("registrationName" to "onWordPress"),
|
|
87
|
+
"onSelection" to mapOf("registrationName" to "onSelection")
|
|
88
|
+
)
|
|
214
89
|
}
|
|
215
90
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
val spannable = this.text as? android.text.Spannable ?: return
|
|
219
|
-
Selection.removeSelection(spannable)
|
|
91
|
+
companion object {
|
|
92
|
+
const val NAME = "AdvancedTextView"
|
|
220
93
|
}
|
|
221
94
|
}
|
|
222
|
-
|
|
223
|
-
data class HighlightedWord(
|
|
224
|
-
val index: Int,
|
|
225
|
-
val highlightColor: String
|
|
226
|
-
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package com.advancedtext
|
|
2
2
|
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import android.view.ViewGroup
|
|
3
5
|
import com.facebook.react.bridge.ReadableArray
|
|
4
6
|
import com.facebook.react.module.annotations.ReactModule
|
|
5
7
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
@@ -27,7 +29,13 @@ class AdvancedTextViewManager : SimpleViewManager<AdvancedTextView>(),
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
public override fun createViewInstance(context: ThemedReactContext): AdvancedTextView {
|
|
30
|
-
|
|
32
|
+
val view = AdvancedTextView(context)
|
|
33
|
+
// Set default layout params to ensure the view is visible
|
|
34
|
+
view.layoutParams = ViewGroup.LayoutParams(
|
|
35
|
+
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
36
|
+
ViewGroup.LayoutParams.WRAP_CONTENT
|
|
37
|
+
)
|
|
38
|
+
return view
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
@ReactProp(name = "text")
|
|
@@ -72,7 +80,13 @@ class AdvancedTextViewManager : SimpleViewManager<AdvancedTextView>(),
|
|
|
72
80
|
view?.setIndicatorWordIndex(index)
|
|
73
81
|
}
|
|
74
82
|
|
|
75
|
-
|
|
83
|
+
// Add this method to register custom events
|
|
84
|
+
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> {
|
|
85
|
+
return mapOf(
|
|
86
|
+
"onWordPress" to mapOf("registrationName" to "onWordPress"),
|
|
87
|
+
"onSelection" to mapOf("registrationName" to "onSelection")
|
|
88
|
+
)
|
|
89
|
+
}
|
|
76
90
|
|
|
77
91
|
companion object {
|
|
78
92
|
const val NAME = "AdvancedTextView"
|
package/package.json
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-native-advanced-text",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": " Advanced text component for React Native with custom select options.",
|
|
5
|
-
"main": "./lib/module/index.js",
|
|
6
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"source": "./src/index.tsx",
|
|
10
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
-
"default": "./lib/module/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"src",
|
|
17
|
-
"lib",
|
|
18
|
-
"android",
|
|
19
|
-
"ios",
|
|
20
|
-
"cpp",
|
|
21
|
-
"*.podspec",
|
|
22
|
-
"react-native.config.js",
|
|
23
|
-
"!ios/build",
|
|
24
|
-
"!android/build",
|
|
25
|
-
"!android/gradle",
|
|
26
|
-
"!android/gradlew",
|
|
27
|
-
"!android/gradlew.bat",
|
|
28
|
-
"!android/local.properties",
|
|
29
|
-
"!**/__tests__",
|
|
30
|
-
"!**/__fixtures__",
|
|
31
|
-
"!**/__mocks__",
|
|
32
|
-
"!**/.*"
|
|
33
|
-
],
|
|
34
|
-
"scripts": {
|
|
35
|
-
"example": "yarn workspace react-native-advanced-text-example",
|
|
36
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
37
|
-
"prepare": "bob build",
|
|
38
|
-
"typecheck": "tsc",
|
|
39
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
-
"release": "release-it --only-version",
|
|
41
|
-
"test": "jest"
|
|
42
|
-
},
|
|
43
|
-
"keywords": [
|
|
44
|
-
"react-native",
|
|
45
|
-
"ios",
|
|
46
|
-
"android"
|
|
47
|
-
],
|
|
48
|
-
"repository": {
|
|
49
|
-
"type": "git",
|
|
50
|
-
"url": "git+https://github.com/AminAllahham/react-native-advanced-text.git"
|
|
51
|
-
},
|
|
52
|
-
"author": "Amin Al-lahham <amin.allahham9@gmail.com> (https://github.com/AminAllahham)",
|
|
53
|
-
"license": "MIT",
|
|
54
|
-
"bugs": {
|
|
55
|
-
"url": "https://github.com/AminAllahham/react-native-advanced-text/issues"
|
|
56
|
-
},
|
|
57
|
-
"homepage": "https://github.com/AminAllahham/react-native-advanced-text#readme",
|
|
58
|
-
"publishConfig": {
|
|
59
|
-
"registry": "https://registry.npmjs.org/"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@commitlint/config-conventional": "^19.8.1",
|
|
63
|
-
"@eslint/compat": "^1.3.2",
|
|
64
|
-
"@eslint/eslintrc": "^3.3.1",
|
|
65
|
-
"@eslint/js": "^9.35.0",
|
|
66
|
-
"@react-native-community/cli": "20.0.1",
|
|
67
|
-
"@react-native/babel-preset": "0.81.1",
|
|
68
|
-
"@react-native/eslint-config": "^0.81.1",
|
|
69
|
-
"@release-it/conventional-changelog": "^10.0.1",
|
|
70
|
-
"@types/jest": "^29.5.14",
|
|
71
|
-
"@types/react": "^19.1.0",
|
|
72
|
-
"commitlint": "^19.8.1",
|
|
73
|
-
"del-cli": "^6.0.0",
|
|
74
|
-
"eslint": "^9.35.0",
|
|
75
|
-
"eslint-config-prettier": "^10.1.8",
|
|
76
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
77
|
-
"jest": "^29.7.0",
|
|
78
|
-
"lefthook": "^2.0.3",
|
|
79
|
-
"prettier": "^2.8.8",
|
|
80
|
-
"react": "19.1.0",
|
|
81
|
-
"react-native": "0.81.1",
|
|
82
|
-
"react-native-builder-bob": "^0.40.16",
|
|
83
|
-
"release-it": "^19.0.4",
|
|
84
|
-
"turbo": "^2.5.6",
|
|
85
|
-
"typescript": "^5.9.2"
|
|
86
|
-
},
|
|
87
|
-
"peerDependencies": {
|
|
88
|
-
"react": "*",
|
|
89
|
-
"react-native": "*"
|
|
90
|
-
},
|
|
91
|
-
"workspaces": [
|
|
92
|
-
"example"
|
|
93
|
-
],
|
|
94
|
-
"packageManager": "yarn@4.11.0",
|
|
95
|
-
"react-native-builder-bob": {
|
|
96
|
-
"source": "src",
|
|
97
|
-
"output": "lib",
|
|
98
|
-
"targets": [
|
|
99
|
-
[
|
|
100
|
-
"module",
|
|
101
|
-
{
|
|
102
|
-
"esm": true
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
[
|
|
106
|
-
"typescript",
|
|
107
|
-
{
|
|
108
|
-
"project": "tsconfig.build.json"
|
|
109
|
-
}
|
|
110
|
-
]
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
"codegenConfig": {
|
|
114
|
-
"name": "AdvancedTextViewSpec",
|
|
115
|
-
"type": "all",
|
|
116
|
-
"jsSrcsDir": "src",
|
|
117
|
-
"android": {
|
|
118
|
-
"javaPackageName": "com.advancedtext"
|
|
119
|
-
},
|
|
120
|
-
"ios": {
|
|
121
|
-
"componentProvider": {
|
|
122
|
-
"AdvancedTextView": "AdvancedTextView"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"prettier": {
|
|
127
|
-
"quoteProps": "consistent",
|
|
128
|
-
"singleQuote": true,
|
|
129
|
-
"tabWidth": 2,
|
|
130
|
-
"trailingComma": "es5",
|
|
131
|
-
"useTabs": false
|
|
132
|
-
},
|
|
133
|
-
"commitlint": {
|
|
134
|
-
"extends": [
|
|
135
|
-
"@commitlint/config-conventional"
|
|
136
|
-
]
|
|
137
|
-
},
|
|
138
|
-
"release-it": {
|
|
139
|
-
"git": {
|
|
140
|
-
"commitMessage": "chore: release ${version}",
|
|
141
|
-
"tagName": "v${version}"
|
|
142
|
-
},
|
|
143
|
-
"npm": {
|
|
144
|
-
"publish": true
|
|
145
|
-
},
|
|
146
|
-
"github": {
|
|
147
|
-
"release": true
|
|
148
|
-
},
|
|
149
|
-
"plugins": {
|
|
150
|
-
"@release-it/conventional-changelog": {
|
|
151
|
-
"preset": {
|
|
152
|
-
"name": "angular"
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"jest": {
|
|
158
|
-
"preset": "react-native",
|
|
159
|
-
"modulePathIgnorePatterns": [
|
|
160
|
-
"<rootDir>/example/node_modules",
|
|
161
|
-
"<rootDir>/lib/"
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
"create-react-native-library": {
|
|
165
|
-
"languages": "kotlin-objc",
|
|
166
|
-
"type": "fabric-view",
|
|
167
|
-
"tools": [
|
|
168
|
-
"eslint",
|
|
169
|
-
"lefthook",
|
|
170
|
-
"release-it",
|
|
171
|
-
"jest"
|
|
172
|
-
],
|
|
173
|
-
"version": "0.55.1"
|
|
174
|
-
}
|
|
175
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-advanced-text",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": " Advanced text component for React Native with custom select options.",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace react-native-advanced-text-example",
|
|
36
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
37
|
+
"prepare": "bob build",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
+
"release": "release-it --only-version",
|
|
41
|
+
"test": "jest"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"react-native",
|
|
45
|
+
"ios",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/AminAllahham/react-native-advanced-text.git"
|
|
51
|
+
},
|
|
52
|
+
"author": "Amin Al-lahham <amin.allahham9@gmail.com> (https://github.com/AminAllahham)",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/AminAllahham/react-native-advanced-text/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/AminAllahham/react-native-advanced-text#readme",
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
63
|
+
"@eslint/compat": "^1.3.2",
|
|
64
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
65
|
+
"@eslint/js": "^9.35.0",
|
|
66
|
+
"@react-native-community/cli": "20.0.1",
|
|
67
|
+
"@react-native/babel-preset": "0.81.1",
|
|
68
|
+
"@react-native/eslint-config": "^0.81.1",
|
|
69
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
70
|
+
"@types/jest": "^29.5.14",
|
|
71
|
+
"@types/react": "^19.1.0",
|
|
72
|
+
"commitlint": "^19.8.1",
|
|
73
|
+
"del-cli": "^6.0.0",
|
|
74
|
+
"eslint": "^9.35.0",
|
|
75
|
+
"eslint-config-prettier": "^10.1.8",
|
|
76
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
77
|
+
"jest": "^29.7.0",
|
|
78
|
+
"lefthook": "^2.0.3",
|
|
79
|
+
"prettier": "^2.8.8",
|
|
80
|
+
"react": "19.1.0",
|
|
81
|
+
"react-native": "0.81.1",
|
|
82
|
+
"react-native-builder-bob": "^0.40.16",
|
|
83
|
+
"release-it": "^19.0.4",
|
|
84
|
+
"turbo": "^2.5.6",
|
|
85
|
+
"typescript": "^5.9.2"
|
|
86
|
+
},
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"react": "*",
|
|
89
|
+
"react-native": "*"
|
|
90
|
+
},
|
|
91
|
+
"workspaces": [
|
|
92
|
+
"example"
|
|
93
|
+
],
|
|
94
|
+
"packageManager": "yarn@4.11.0",
|
|
95
|
+
"react-native-builder-bob": {
|
|
96
|
+
"source": "src",
|
|
97
|
+
"output": "lib",
|
|
98
|
+
"targets": [
|
|
99
|
+
[
|
|
100
|
+
"module",
|
|
101
|
+
{
|
|
102
|
+
"esm": true
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"typescript",
|
|
107
|
+
{
|
|
108
|
+
"project": "tsconfig.build.json"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"codegenConfig": {
|
|
114
|
+
"name": "AdvancedTextViewSpec",
|
|
115
|
+
"type": "all",
|
|
116
|
+
"jsSrcsDir": "src",
|
|
117
|
+
"android": {
|
|
118
|
+
"javaPackageName": "com.advancedtext"
|
|
119
|
+
},
|
|
120
|
+
"ios": {
|
|
121
|
+
"componentProvider": {
|
|
122
|
+
"AdvancedTextView": "AdvancedTextView"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"prettier": {
|
|
127
|
+
"quoteProps": "consistent",
|
|
128
|
+
"singleQuote": true,
|
|
129
|
+
"tabWidth": 2,
|
|
130
|
+
"trailingComma": "es5",
|
|
131
|
+
"useTabs": false
|
|
132
|
+
},
|
|
133
|
+
"commitlint": {
|
|
134
|
+
"extends": [
|
|
135
|
+
"@commitlint/config-conventional"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"release-it": {
|
|
139
|
+
"git": {
|
|
140
|
+
"commitMessage": "chore: release ${version}",
|
|
141
|
+
"tagName": "v${version}"
|
|
142
|
+
},
|
|
143
|
+
"npm": {
|
|
144
|
+
"publish": true
|
|
145
|
+
},
|
|
146
|
+
"github": {
|
|
147
|
+
"release": true
|
|
148
|
+
},
|
|
149
|
+
"plugins": {
|
|
150
|
+
"@release-it/conventional-changelog": {
|
|
151
|
+
"preset": {
|
|
152
|
+
"name": "angular"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"jest": {
|
|
158
|
+
"preset": "react-native",
|
|
159
|
+
"modulePathIgnorePatterns": [
|
|
160
|
+
"<rootDir>/example/node_modules",
|
|
161
|
+
"<rootDir>/lib/"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"create-react-native-library": {
|
|
165
|
+
"languages": "kotlin-objc",
|
|
166
|
+
"type": "fabric-view",
|
|
167
|
+
"tools": [
|
|
168
|
+
"eslint",
|
|
169
|
+
"lefthook",
|
|
170
|
+
"release-it",
|
|
171
|
+
"jest"
|
|
172
|
+
],
|
|
173
|
+
"version": "0.55.1"
|
|
174
|
+
}
|
|
175
|
+
}
|