react-native-highlight-text-view 0.1.14 → 0.1.16

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/README.md CHANGED
@@ -4,12 +4,10 @@ A native text input for React Native that supports inline text highlighting
4
4
 
5
5
  ## Installation
6
6
 
7
-
8
7
  ```sh
9
8
  npm install react-native-highlight-text
10
9
  ```
11
10
 
12
-
13
11
  ## Usage
14
12
 
15
13
  ```js
@@ -42,28 +40,29 @@ export default function App() {
42
40
 
43
41
  ## Props
44
42
 
45
- | Prop | Type | Default | Description |
46
- |------|------|---------|-------------|
47
- | `color` | `string` | `#FFFF00` | Background highlight color (hex format) |
48
- | `textColor` | `string` | - | Text color (hex format) |
49
- | `textAlign` | `string` | `left` | Text alignment. Supports: `'left'`, `'center'`, `'right'`, `'justify'`, `'flex-start'`, `'flex-end'`, `'top'`, `'bottom'`, `'top-left'`, `'top-center'`, `'top-right'`, `'bottom-left'`, `'bottom-center'`, `'bottom-right'` |
50
- | `verticalAlign` | `'top' \| 'center' \| 'middle' \| 'bottom'` | - | Vertical alignment (iOS only). Alternative to using combined `textAlign` values. **Note:** Android does not support vertical alignment and will use default vertical positioning. |
51
- | `fontFamily` | `string` | - | Font family name |
52
- | `fontSize` | `string` | `32` | Font size in points |
53
- | `lineHeight` | `string` | `0` | Line height override (0 means use default line height) |
54
- | `highlightBorderRadius` | `string` | `0` | Border radius for the highlight background |
55
- | `padding` | `string` | `4` | Padding around each character highlight (expands background outward) |
56
- | `paddingLeft` | `string` | - | Left padding for character highlight |
57
- | `paddingRight` | `string` | - | Right padding for character highlight |
58
- | `paddingTop` | `string` | - | Top padding for character highlight |
59
- | `paddingBottom` | `string` | - | Bottom padding for character highlight |
60
- | `backgroundInsetTop` | `string` | `0` | Shrinks background from top (useful for fonts with large vertical metrics) |
61
- | `backgroundInsetBottom` | `string` | `0` | Shrinks background from bottom (useful for fonts with large vertical metrics) |
62
- | `backgroundInsetLeft` | `string` | `0` | Shrinks background from left |
63
- | `backgroundInsetRight` | `string` | `0` | Shrinks background from right |
64
- | `text` | `string` | - | Controlled text value |
65
- | `isEditable` | `boolean` | `true` | Whether the text is editable |
66
- | `onChange` | `(event: { nativeEvent: { text: string } }) => void` | - | Callback fired when text changes |
43
+ | Prop | Type | Default | Description |
44
+ | ----------------------- | ---------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45
+ | `color` | `string` | `#FFFF00` | Background highlight color (hex format) |
46
+ | `textColor` | `string` | - | Text color (hex format) |
47
+ | `textAlign` | `string` | `left` | Text alignment. Supports: `'left'`, `'center'`, `'right'`, `'justify'`, `'flex-start'`, `'flex-end'`, `'top'`, `'bottom'`, `'top-left'`, `'top-center'`, `'top-right'`, `'bottom-left'`, `'bottom-center'`, `'bottom-right'` |
48
+ | `verticalAlign` | `'top' \| 'center' \| 'middle' \| 'bottom'` | - | Vertical alignment (iOS only). Alternative to using combined `textAlign` values. **Note:** Android does not support vertical alignment and will use default vertical positioning. |
49
+ | `fontFamily` | `string` | - | Font family name |
50
+ | `fontSize` | `string` | `32` | Font size in points |
51
+ | `lineHeight` | `string` | `0` | Line height override (0 means use default line height) |
52
+ | `highlightBorderRadius` | `string` | `0` | Border radius for the highlight background |
53
+ | `padding` | `string` | `4` | Padding around each character highlight (expands background outward) |
54
+ | `paddingLeft` | `string` | - | Left padding for character highlight |
55
+ | `paddingRight` | `string` | - | Right padding for character highlight |
56
+ | `paddingTop` | `string` | - | Top padding for character highlight |
57
+ | `paddingBottom` | `string` | - | Bottom padding for character highlight |
58
+ | `backgroundInsetTop` | `string` | `0` | Shrinks background from top (useful for fonts with large vertical metrics) |
59
+ | `backgroundInsetBottom` | `string` | `0` | Shrinks background from bottom (useful for fonts with large vertical metrics) |
60
+ | `backgroundInsetLeft` | `string` | `0` | Shrinks background from left |
61
+ | `backgroundInsetRight` | `string` | `0` | Shrinks background from right |
62
+ | `text` | `string` | - | Controlled text value |
63
+ | `isEditable` | `boolean` | `true` | Whether the text is editable |
64
+ | `autoFocus` | `boolean` | `false` | If true, automatically focuses the text input and opens the keyboard when component mounts (only works when `isEditable` is `true`) |
65
+ | `onChange` | `(event: { nativeEvent: { text: string } }) => void` | - | Callback fired when text changes |
67
66
 
68
67
  ### Understanding Padding vs Background Insets
69
68
 
@@ -73,6 +72,7 @@ export default function App() {
73
72
  **Use case for background insets:** Some fonts (like Eczar, Georgia, etc.) have large built-in vertical metrics (ascender/descender), making highlights appear too tall. Use `backgroundInsetTop` and `backgroundInsetBottom` to create a tighter fit around the visible glyphs.
74
73
 
75
74
  **Example with large-metric font:**
75
+
76
76
  ```jsx
77
77
  <HighlightTextView
78
78
  fontFamily="Eczar"
@@ -81,24 +81,25 @@ export default function App() {
81
81
  paddingRight="8"
82
82
  paddingTop="4"
83
83
  paddingBottom="4"
84
- backgroundInsetTop="6"
85
- backgroundInsetBottom="6"
84
+ backgroundInsetTop="6"
85
+ backgroundInsetBottom="6"
86
86
  text="Tight Background"
87
87
  />
88
88
  ```
89
89
 
90
90
  **Example with touching backgrounds (tight line spacing):**
91
91
  To make backgrounds touch vertically across multiple lines, combine `lineHeight` with `backgroundInset`:
92
+
92
93
  ```jsx
93
94
  <HighlightTextView
94
95
  fontSize="32"
95
- lineHeight="36" // Slightly larger than fontSize for tight spacing
96
+ lineHeight="36" // Slightly larger than fontSize for tight spacing
96
97
  paddingLeft="8"
97
98
  paddingRight="8"
98
99
  paddingTop="4"
99
100
  paddingBottom="4"
100
- backgroundInsetTop="14" // Large inset reduces background height
101
- backgroundInsetBottom="14" // Creates room for lines to touch
101
+ backgroundInsetTop="14" // Large inset reduces background height
102
+ backgroundInsetBottom="14" // Creates room for lines to touch
102
103
  highlightBorderRadius="4"
103
104
  text="Multiple lines with touching backgrounds create smooth vertical flow"
104
105
  />
@@ -108,7 +109,24 @@ To make backgrounds touch vertically across multiple lines, combine `lineHeight`
108
109
 
109
110
  **Note:** Vertical alignment is currently supported on iOS only. On Android, text will use default vertical positioning.
110
111
 
112
+ ### Auto-focusing the Input
111
113
 
114
+ To automatically open the keyboard when the component mounts, use the `autoFocus` prop:
115
+
116
+ ```jsx
117
+ <HighlightTextView
118
+ color="#00A4A3"
119
+ textColor="#FFFFFF"
120
+ fontSize="20"
121
+ text={text}
122
+ isEditable={true}
123
+ autoFocus={true} // Keyboard opens automatically
124
+ onChange={(e) => setText(e.nativeEvent.text)}
125
+ style={{ width: '100%', height: 100 }}
126
+ />
127
+ ```
128
+
129
+ This eliminates the need for double-tapping to open the keyboard - it will open on first render.
112
130
 
113
131
  ## Contributing
114
132
 
@@ -116,7 +134,6 @@ To make backgrounds touch vertically across multiple lines, combine `lineHeight`
116
134
  - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
117
135
  - [Code of conduct](CODE_OF_CONDUCT.md)
118
136
 
119
-
120
137
  ## License MIT
121
138
 
122
139
  Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -17,19 +17,21 @@ import android.view.Gravity
17
17
  import androidx.appcompat.widget.AppCompatEditText
18
18
 
19
19
  class RoundedBackgroundSpan(
20
- private val backgroundColor: Int,
21
- private val textColor: Int,
22
- private val paddingLeft: Float,
23
- private val paddingRight: Float,
24
- private val paddingTop: Float,
25
- private val paddingBottom: Float,
26
- private val backgroundInsetTop: Float,
27
- private val backgroundInsetBottom: Float,
28
- private val backgroundInsetLeft: Float,
29
- private val backgroundInsetRight: Float,
30
- private val cornerRadius: Float,
31
- private val isFirstInGroup: Boolean = false,
32
- private val isLastInGroup: Boolean = false
20
+ internal val backgroundColor: Int,
21
+ internal val textColor: Int,
22
+ internal val paddingLeft: Float,
23
+ internal val paddingRight: Float,
24
+ internal val paddingTop: Float,
25
+ internal val paddingBottom: Float,
26
+ internal val backgroundInsetTop: Float,
27
+ internal val backgroundInsetBottom: Float,
28
+ internal val backgroundInsetLeft: Float,
29
+ internal val backgroundInsetRight: Float,
30
+ internal val cornerRadius: Float,
31
+ internal val isFirstInGroup: Boolean = false,
32
+ internal val isLastInGroup: Boolean = false,
33
+ private val isStartOfLine: Boolean = false,
34
+ private val isEndOfLine: Boolean = false
33
35
  ) : ReplacementSpan() {
34
36
 
35
37
  override fun getSize(
@@ -40,9 +42,9 @@ class RoundedBackgroundSpan(
40
42
  fm: Paint.FontMetricsInt?
41
43
  ): Int {
42
44
  val width = paint.measureText(text, start, end)
43
- // Only add padding for first and last characters in a group
44
- val leftPad = if (isFirstInGroup) paddingLeft else 0f
45
- val rightPad = if (isLastInGroup) paddingRight else 0f
45
+ // Add padding for word boundaries AND line boundaries (for consistent alignment)
46
+ val leftPad = if (isFirstInGroup || isStartOfLine) paddingLeft else 0f
47
+ val rightPad = if (isLastInGroup || isEndOfLine) paddingRight else 0f
46
48
  return (width + leftPad + rightPad).toInt()
47
49
  }
48
50
 
@@ -71,35 +73,37 @@ class RoundedBackgroundSpan(
71
73
  val textHeight = fontMetrics.descent - fontMetrics.ascent
72
74
  val textTop = y + fontMetrics.ascent
73
75
 
74
- // Only add padding for first and last characters in a group
75
- val leftPad = if (isFirstInGroup) paddingLeft else 0f
76
- val rightPad = if (isLastInGroup) paddingRight else 0f
76
+ // Add padding for word AND line boundaries (consistent alignment)
77
+ val isReallyFirst = isFirstInGroup || isStartOfLine
78
+ val isReallyLast = isLastInGroup || isEndOfLine
79
+ val leftPad = if (isReallyFirst) paddingLeft else 0f
80
+ val rightPad = if (isReallyLast) paddingRight else 0f
77
81
 
78
- // Extend background to overlap and eliminate gaps between characters
82
+ // Small overlap to eliminate gaps between characters
79
83
  val overlapExtension = 2f
80
- val leftExtension = if (!isFirstInGroup) overlapExtension else 0f
81
- val rightExtension = if (!isLastInGroup) overlapExtension else 0f
84
+ val leftOverlap = if (!isReallyFirst) overlapExtension else 0f
85
+ val rightOverlap = if (!isReallyLast) overlapExtension else 0f
82
86
 
83
87
  // Apply background insets first (shrinks from line box)
84
88
  val insetTop = textTop + backgroundInsetTop
85
89
  val insetHeight = textHeight - (backgroundInsetTop + backgroundInsetBottom)
86
90
 
87
- // Calculate proper bounds with insets then padding
91
+ // Calculate background rect
88
92
  val rect = RectF(
89
- x - leftExtension + backgroundInsetLeft,
93
+ x - leftOverlap + backgroundInsetLeft,
90
94
  insetTop - paddingTop,
91
- x + width + leftPad + rightPad + rightExtension - backgroundInsetRight,
95
+ x + width + leftPad + rightPad + rightOverlap - backgroundInsetRight,
92
96
  insetTop + insetHeight + paddingBottom
93
97
  )
94
98
 
95
- // Draw background with selective corner rounding
99
+ // Draw background with selective corner rounding (respects line wraps)
96
100
  when {
97
- isFirstInGroup && isLastInGroup -> {
101
+ isReallyFirst && isReallyLast -> {
98
102
  // Single character or isolated group - round all corners
99
103
  canvas.drawRoundRect(rect, cornerRadius, cornerRadius, bgPaint)
100
104
  }
101
- isFirstInGroup -> {
102
- // First character - round left corners only
105
+ isReallyFirst -> {
106
+ // First character (word start or line start) - round left corners only
103
107
  val path = android.graphics.Path()
104
108
  path.addRoundRect(
105
109
  rect,
@@ -113,8 +117,8 @@ class RoundedBackgroundSpan(
113
117
  )
114
118
  canvas.drawPath(path, bgPaint)
115
119
  }
116
- isLastInGroup -> {
117
- // Last character - round right corners only
120
+ isReallyLast -> {
121
+ // Last character (word end or line end) - round right corners only
118
122
  val path = android.graphics.Path()
119
123
  path.addRoundRect(
120
124
  rect,
@@ -359,6 +363,16 @@ class HighlightTextView : AppCompatEditText {
359
363
  }
360
364
  }
361
365
 
366
+ fun setAutoFocus(autoFocus: Boolean) {
367
+ if (autoFocus && isFocusable && isFocusableInTouchMode) {
368
+ post {
369
+ requestFocus()
370
+ val imm = context.getSystemService(android.content.Context.INPUT_METHOD_SERVICE) as? android.view.inputmethod.InputMethodManager
371
+ imm?.showSoftInput(this, android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT)
372
+ }
373
+ }
374
+ }
375
+
362
376
  private fun applyCharacterBackgrounds() {
363
377
  val text = text?.toString() ?: return
364
378
  if (text.isEmpty()) return
@@ -418,6 +432,61 @@ class HighlightTextView : AppCompatEditText {
418
432
  setText(spannable)
419
433
  setSelection(text.length) // Keep cursor at end
420
434
  isUpdatingText = false
435
+
436
+ // Detect line wraps after layout is ready
437
+ post { detectLineWraps() }
438
+ }
439
+
440
+ private fun detectLineWraps() {
441
+ val layout = layout ?: return
442
+ val text = text as? Spannable ?: return
443
+ val textStr = text.toString()
444
+ val spans = text.getSpans(0, text.length, RoundedBackgroundSpan::class.java)
445
+
446
+ for (span in spans) {
447
+ val spanStart = text.getSpanStart(span)
448
+ val spanEnd = text.getSpanEnd(span)
449
+
450
+ if (spanStart >= 0 && spanStart < text.length) {
451
+ val line = layout.getLineForOffset(spanStart)
452
+ val lineStart = layout.getLineStart(line)
453
+ val lineEnd = layout.getLineEnd(line)
454
+
455
+ // Check for manual line break (\n) before this character
456
+ val hasNewlineBefore = spanStart > 0 && textStr[spanStart - 1] == '\n'
457
+ // Check for manual line break (\n) after this character
458
+ val hasNewlineAfter = spanEnd < textStr.length && textStr[spanEnd] == '\n'
459
+
460
+ // Check if this char is at start of visual line (wrapped OR after \n)
461
+ val isAtLineStart = (spanStart == lineStart && !span.isFirstInGroup) || hasNewlineBefore
462
+ // Check if this char is at end of visual line (wrapped OR before \n)
463
+ val isAtLineEnd = (spanEnd == lineEnd && !span.isLastInGroup) || hasNewlineAfter
464
+
465
+ if (isAtLineStart || isAtLineEnd) {
466
+ // Create new span with line boundary flags
467
+ val newSpan = RoundedBackgroundSpan(
468
+ span.backgroundColor,
469
+ span.textColor,
470
+ span.paddingLeft,
471
+ span.paddingRight,
472
+ span.paddingTop,
473
+ span.paddingBottom,
474
+ span.backgroundInsetTop,
475
+ span.backgroundInsetBottom,
476
+ span.backgroundInsetLeft,
477
+ span.backgroundInsetRight,
478
+ span.cornerRadius,
479
+ span.isFirstInGroup,
480
+ span.isLastInGroup,
481
+ isAtLineStart,
482
+ isAtLineEnd
483
+ )
484
+ text.removeSpan(span)
485
+ text.setSpan(newSpan, spanStart, spanEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
486
+ }
487
+ }
488
+ }
489
+ invalidate()
421
490
  }
422
491
 
423
492
  private fun shouldHighlightChar(text: String, index: Int): Boolean {
@@ -235,6 +235,11 @@ class HighlightTextViewManager : SimpleViewManager<HighlightTextView>(),
235
235
  }
236
236
  }
237
237
 
238
+ @ReactProp(name = "autoFocus")
239
+ override fun setAutoFocus(view: HighlightTextView?, value: Boolean) {
240
+ view?.setAutoFocus(value)
241
+ }
242
+
238
243
  companion object {
239
244
  const val NAME = "HighlightTextView"
240
245
  }
@@ -426,6 +426,14 @@ using namespace facebook::react;
426
426
  _textView.editable = newViewProps.isEditable;
427
427
  }
428
428
 
429
+ if (oldViewProps.autoFocus != newViewProps.autoFocus) {
430
+ if (newViewProps.autoFocus && _textView.isEditable) {
431
+ dispatch_async(dispatch_get_main_queue(), ^{
432
+ [self->_textView becomeFirstResponder];
433
+ });
434
+ }
435
+ }
436
+
429
437
  if (oldViewProps.verticalAlign != newViewProps.verticalAlign) {
430
438
  NSString *verticalAlign = [[NSString alloc] initWithUTF8String: newViewProps.verticalAlign.c_str()];
431
439
  _currentVerticalAlignment = verticalAlign;
@@ -64,6 +64,7 @@ export interface HighlightTextViewProps extends ViewProps {
64
64
  backgroundInsetRight?: string;
65
65
  text?: string;
66
66
  isEditable?: boolean;
67
+ autoFocus?: boolean;
67
68
  onChange?: BubblingEventHandler<OnChangeEventData>;
68
69
  }
69
70
 
@@ -46,6 +46,7 @@ export interface HighlightTextViewProps extends ViewProps {
46
46
  backgroundInsetRight?: string;
47
47
  text?: string;
48
48
  isEditable?: boolean;
49
+ autoFocus?: boolean;
49
50
  onChange?: BubblingEventHandler<OnChangeEventData>;
50
51
  }
51
52
  declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<HighlightTextViewProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"HighlightTextViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/HighlightTextViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,QAAQ,GACR,OAAO,GACP,SAAS,GACT,YAAY,GACZ,UAAU,GACV,KAAK,GACL,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CACpD;;AAED,wBAEE"}
1
+ {"version":3,"file":"HighlightTextViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/HighlightTextViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,QAAQ,GACR,OAAO,GACP,SAAS,GACT,YAAY,GACZ,UAAU,GACV,KAAK,GACL,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CACpD;;AAED,wBAEE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-highlight-text-view",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "A native text input for React Native that supports inline text highlighting",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -64,6 +64,7 @@ export interface HighlightTextViewProps extends ViewProps {
64
64
  backgroundInsetRight?: string;
65
65
  text?: string;
66
66
  isEditable?: boolean;
67
+ autoFocus?: boolean;
67
68
  onChange?: BubblingEventHandler<OnChangeEventData>;
68
69
  }
69
70