@bsky.app/react-native-uitextview 2.6.0 → 2.7.0

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.
@@ -141,7 +141,8 @@ RNUITextViewProps::RNUITextViewProps(
141
141
  numberOfLines(convertRawProp(context, rawProps, "numberOfLines", sourceProps.numberOfLines, {0})),
142
142
  allowFontScaling(convertRawProp(context, rawProps, "allowFontScaling", sourceProps.allowFontScaling, {true})),
143
143
  ellipsizeMode(convertRawProp(context, rawProps, "ellipsizeMode", sourceProps.ellipsizeMode, {RNUITextViewEllipsizeMode::Tail})),
144
- selectable(convertRawProp(context, rawProps, "selectable", sourceProps.selectable, {false})) {}
144
+ selectable(convertRawProp(context, rawProps, "selectable", sourceProps.selectable, {false})),
145
+ selectionColor(convertRawProp(context, rawProps, "selectionColor", sourceProps.selectionColor, {})) {}
145
146
 
146
147
  #ifdef RN_SERIALIZABLE_STATE
147
148
  ComponentName RNUITextViewProps::getDiffPropsImplementationTarget() const {
@@ -174,6 +175,10 @@ folly::dynamic RNUITextViewProps::getDiffProps(
174
175
  if (selectable != oldProps->selectable) {
175
176
  result["selectable"] = selectable;
176
177
  }
178
+
179
+ if (selectionColor != oldProps->selectionColor) {
180
+ result["selectionColor"] = *selectionColor;
181
+ }
177
182
  return result;
178
183
  }
179
184
  #endif
@@ -229,6 +229,7 @@ class RNUITextViewProps final : public ViewProps {
229
229
  bool allowFontScaling{true};
230
230
  RNUITextViewEllipsizeMode ellipsizeMode{RNUITextViewEllipsizeMode::Tail};
231
231
  bool selectable{false};
232
+ SharedColor selectionColor{};
232
233
 
233
234
  #ifdef RN_SERIALIZABLE_STATE
234
235
  ComponentName getDiffPropsImplementationTarget() const override;
@@ -150,7 +150,9 @@ static NSLineBreakMode RCTNSLineBreakModeFromEllipsizeMode(RNUITextViewEllipsize
150
150
 
151
151
  _view = [[UIView alloc] init];
152
152
  self.contentView = _view;
153
- self.clipsToBounds = true;
153
+ // Match React Native's Paragraph component and allow transformed inline
154
+ // attachments to paint outside the measured text bounds. Explicit
155
+ // `overflow: hidden` styles are still handled by RCTViewComponentView.
154
156
 
155
157
  if (@available(iOS 16.0, *)) {
156
158
  // This component relies on NSLayoutManager for measurement, hit-testing,
@@ -308,6 +310,10 @@ static NSLineBreakMode RCTNSLineBreakModeFromEllipsizeMode(RNUITextViewEllipsize
308
310
  _textView.selectable = newViewProps.selectable;
309
311
  }
310
312
 
313
+ if (oldViewProps.selectionColor != newViewProps.selectionColor) {
314
+ _textView.tintColor = RCTUIColorFromSharedColor(newViewProps.selectionColor);
315
+ }
316
+
311
317
  if (oldViewProps.allowFontScaling != newViewProps.allowFontScaling) {
312
318
  if (@available(iOS 11.0, *)) {
313
319
  _textView.adjustsFontForContentSizeCategory = newViewProps.allowFontScaling;
@@ -141,7 +141,8 @@ RNUITextViewProps::RNUITextViewProps(
141
141
  numberOfLines(convertRawProp(context, rawProps, "numberOfLines", sourceProps.numberOfLines, {0})),
142
142
  allowFontScaling(convertRawProp(context, rawProps, "allowFontScaling", sourceProps.allowFontScaling, {true})),
143
143
  ellipsizeMode(convertRawProp(context, rawProps, "ellipsizeMode", sourceProps.ellipsizeMode, {RNUITextViewEllipsizeMode::Tail})),
144
- selectable(convertRawProp(context, rawProps, "selectable", sourceProps.selectable, {false})) {}
144
+ selectable(convertRawProp(context, rawProps, "selectable", sourceProps.selectable, {false})),
145
+ selectionColor(convertRawProp(context, rawProps, "selectionColor", sourceProps.selectionColor, {})) {}
145
146
 
146
147
  #ifdef RN_SERIALIZABLE_STATE
147
148
  ComponentName RNUITextViewProps::getDiffPropsImplementationTarget() const {
@@ -174,6 +175,10 @@ folly::dynamic RNUITextViewProps::getDiffProps(
174
175
  if (selectable != oldProps->selectable) {
175
176
  result["selectable"] = selectable;
176
177
  }
178
+
179
+ if (selectionColor != oldProps->selectionColor) {
180
+ result["selectionColor"] = *selectionColor;
181
+ }
177
182
  return result;
178
183
  }
179
184
  #endif
@@ -229,6 +229,7 @@ class RNUITextViewProps final : public ViewProps {
229
229
  bool allowFontScaling{true};
230
230
  RNUITextViewEllipsizeMode ellipsizeMode{RNUITextViewEllipsizeMode::Tail};
231
231
  bool selectable{false};
232
+ SharedColor selectionColor{};
232
233
 
233
234
  #ifdef RN_SERIALIZABLE_STATE
234
235
  ComponentName getDiffPropsImplementationTarget() const override;
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  type CodegenTypes,
3
+ type ColorValue,
3
4
  type ViewProps,
4
5
  codegenNativeComponent,
5
6
  } from 'react-native'
@@ -30,6 +31,7 @@ interface NativeProps extends ViewProps {
30
31
  allowFontScaling?: CodegenTypes.WithDefault<boolean, true>
31
32
  ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>
32
33
  selectable?: boolean
34
+ selectionColor?: ColorValue
33
35
  onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>
34
36
  /**
35
37
  * Callback fired when the text selection changes.
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  type CodegenTypes,
3
+ type ColorValue,
3
4
  type ViewProps,
4
5
  codegenNativeComponent,
5
6
  } from 'react-native'
@@ -30,6 +31,7 @@ interface NativeProps extends ViewProps {
30
31
  allowFontScaling?: CodegenTypes.WithDefault<boolean, true>
31
32
  ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>
32
33
  selectable?: boolean
34
+ selectionColor?: ColorValue
33
35
  onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>
34
36
  /**
35
37
  * Callback fired when the text selection changes.
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../example/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8E9B,MAAM,CAAC,OAAO,UAAU,GAAG,sBAuxB1B"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../example/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8E9B,MAAM,CAAC,OAAO,UAAU,GAAG,sBAiyB1B"}
@@ -1,4 +1,4 @@
1
- import { type CodegenTypes, type ViewProps } from 'react-native';
1
+ import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
2
2
  interface TargetedEvent {
3
3
  target: CodegenTypes.Int32;
4
4
  }
@@ -21,6 +21,7 @@ interface NativeProps extends ViewProps {
21
21
  allowFontScaling?: CodegenTypes.WithDefault<boolean, true>;
22
22
  ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>;
23
23
  selectable?: boolean;
24
+ selectionColor?: ColorValue;
24
25
  onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>;
25
26
  /**
26
27
  * Callback fired when the text selection changes.
@@ -1 +1 @@
1
- {"version":3,"file":"RNUITextViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/RNUITextViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAErB,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,CAAC,KAAK,CAAA;CAC3B;AAED,UAAU,eAAgB,SAAQ,aAAa;IAC7C,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;;;GAKG;AACH,UAAU,oBAAqB,SAAQ,aAAa;IAClD,KAAK,EAAE,YAAY,CAAC,KAAK,CAAA;IACzB,GAAG,EAAE,YAAY,CAAC,KAAK,CAAA;CACxB;AAED,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AAExD,UAAU,WAAY,SAAQ,SAAS;IACrC,aAAa,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAClC,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC1D,aAAa,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,aA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,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;CAC5E;;AAED,wBAEE"}
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../example/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8E9B,MAAM,CAAC,OAAO,UAAU,GAAG,sBAuxB1B"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../example/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8E9B,MAAM,CAAC,OAAO,UAAU,GAAG,sBAiyB1B"}
@@ -1,4 +1,4 @@
1
- import { type CodegenTypes, type ViewProps } from 'react-native';
1
+ import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
2
2
  interface TargetedEvent {
3
3
  target: CodegenTypes.Int32;
4
4
  }
@@ -21,6 +21,7 @@ interface NativeProps extends ViewProps {
21
21
  allowFontScaling?: CodegenTypes.WithDefault<boolean, true>;
22
22
  ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>;
23
23
  selectable?: boolean;
24
+ selectionColor?: ColorValue;
24
25
  onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>;
25
26
  /**
26
27
  * Callback fired when the text selection changes.
@@ -1 +1 @@
1
- {"version":3,"file":"RNUITextViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/RNUITextViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAErB,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,CAAC,KAAK,CAAA;CAC3B;AAED,UAAU,eAAgB,SAAQ,aAAa;IAC7C,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;;;GAKG;AACH,UAAU,oBAAqB,SAAQ,aAAa;IAClD,KAAK,EAAE,YAAY,CAAC,KAAK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EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC1D,aAAa,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAA;IACjE;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;CAC5E;;AAED,wBAEE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsky.app/react-native-uitextview",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "UITextView for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  type CodegenTypes,
3
+ type ColorValue,
3
4
  type ViewProps,
4
5
  codegenNativeComponent,
5
6
  } from 'react-native'
@@ -30,6 +31,7 @@ interface NativeProps extends ViewProps {
30
31
  allowFontScaling?: CodegenTypes.WithDefault<boolean, true>
31
32
  ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>
32
33
  selectable?: boolean
34
+ selectionColor?: ColorValue
33
35
  onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>
34
36
  /**
35
37
  * Callback fired when the text selection changes.