@bsky.app/react-native-uitextview 2.4.1 → 2.5.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.
Files changed (34) hide show
  1. package/README.md +6 -0
  2. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/Props.cpp +31 -1
  3. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/Props.h +6 -0
  4. package/ios/RNUITextView.mm +503 -41
  5. package/ios/RNUITextViewShadowNode.cpp +17 -2
  6. package/ios/RNUITextViewShadowNode.h +17 -1
  7. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/Props.cpp +31 -1
  8. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/Props.h +6 -0
  9. package/lib/commonjs/RNUITextViewChildNativeComponent.ts +9 -0
  10. package/lib/commonjs/Text.js +81 -23
  11. package/lib/commonjs/Text.js.map +1 -1
  12. package/lib/commonjs/press.js +23 -0
  13. package/lib/commonjs/press.js.map +1 -0
  14. package/lib/module/RNUITextViewChildNativeComponent.ts +9 -0
  15. package/lib/module/Text.js +82 -24
  16. package/lib/module/Text.js.map +1 -1
  17. package/lib/module/press.js +19 -0
  18. package/lib/module/press.js.map +1 -0
  19. package/lib/typescript/commonjs/example/src/App.d.ts.map +1 -1
  20. package/lib/typescript/commonjs/src/RNUITextViewChildNativeComponent.d.ts +9 -0
  21. package/lib/typescript/commonjs/src/RNUITextViewChildNativeComponent.d.ts.map +1 -1
  22. package/lib/typescript/commonjs/src/Text.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/src/press.d.ts +10 -0
  24. package/lib/typescript/commonjs/src/press.d.ts.map +1 -0
  25. package/lib/typescript/module/example/src/App.d.ts.map +1 -1
  26. package/lib/typescript/module/src/RNUITextViewChildNativeComponent.d.ts +9 -0
  27. package/lib/typescript/module/src/RNUITextViewChildNativeComponent.d.ts.map +1 -1
  28. package/lib/typescript/module/src/Text.d.ts.map +1 -1
  29. package/lib/typescript/module/src/press.d.ts +10 -0
  30. package/lib/typescript/module/src/press.d.ts.map +1 -0
  31. package/package.json +1 -1
  32. package/src/RNUITextViewChildNativeComponent.ts +9 -0
  33. package/src/Text.tsx +80 -11
  34. package/src/press.ts +36 -0
@@ -7,13 +7,27 @@
7
7
  #include <react/renderer/core/LayoutContext.h>
8
8
  #include <react/renderer/core/ShadowNode.h>
9
9
 
10
+ #include <string>
11
+ #include <vector>
12
+
10
13
  namespace facebook::react {
11
14
 
12
15
  extern const char RNUITextViewComponentName[];
13
16
 
17
+ struct RNUITextViewHighlightMetadata {
18
+ Tag tag;
19
+ std::string group;
20
+ bool suppressHighlighting;
21
+ Float pressRetentionOffsetTop;
22
+ Float pressRetentionOffsetRight;
23
+ Float pressRetentionOffsetBottom;
24
+ Float pressRetentionOffsetLeft;
25
+ };
26
+
14
27
  class RNUITextViewStateReal final {
15
28
  public:
16
29
  AttributedString attributedString;
30
+ std::vector<RNUITextViewHighlightMetadata> highlightMetadata;
17
31
  };
18
32
 
19
33
  class RNUITextViewShadowNode final : public ConcreteViewShadowNode<
@@ -43,6 +57,8 @@ public:
43
57
  const LayoutConstraints& layoutConstraints) const override;
44
58
 
45
59
  private:
46
- AttributedString getAttributedString(const LayoutContext& layoutContext) const;
60
+ AttributedString getAttributedString(
61
+ const LayoutContext& layoutContext,
62
+ std::vector<RNUITextViewHighlightMetadata> *highlightMetadata = nullptr) const;
47
63
  };
48
64
  } // namespace facebook::React
@@ -31,7 +31,13 @@ RNUITextViewChildProps::RNUITextViewChildProps(
31
31
  textDecorationStyle(convertRawProp(context, rawProps, "textDecorationStyle", sourceProps.textDecorationStyle, {RNUITextViewChildTextDecorationStyle::Solid})),
32
32
  textDecorationColor(convertRawProp(context, rawProps, "textDecorationColor", sourceProps.textDecorationColor, {})),
33
33
  textAlign(convertRawProp(context, rawProps, "textAlign", sourceProps.textAlign, {RNUITextViewChildTextAlign::Auto})),
34
- shadowRadius(convertRawProp(context, rawProps, "shadowRadius", sourceProps.shadowRadius, {0.0})) {}
34
+ shadowRadius(convertRawProp(context, rawProps, "shadowRadius", sourceProps.shadowRadius, {0.0})),
35
+ highlightGroup(convertRawProp(context, rawProps, "highlightGroup", sourceProps.highlightGroup, {})),
36
+ suppressHighlighting(convertRawProp(context, rawProps, "suppressHighlighting", sourceProps.suppressHighlighting, {false})),
37
+ pressRetentionOffsetTop(convertRawProp(context, rawProps, "pressRetentionOffsetTop", sourceProps.pressRetentionOffsetTop, {20.0})),
38
+ pressRetentionOffsetRight(convertRawProp(context, rawProps, "pressRetentionOffsetRight", sourceProps.pressRetentionOffsetRight, {20.0})),
39
+ pressRetentionOffsetBottom(convertRawProp(context, rawProps, "pressRetentionOffsetBottom", sourceProps.pressRetentionOffsetBottom, {30.0})),
40
+ pressRetentionOffsetLeft(convertRawProp(context, rawProps, "pressRetentionOffsetLeft", sourceProps.pressRetentionOffsetLeft, {20.0})) {}
35
41
 
36
42
  #ifdef RN_SERIALIZABLE_STATE
37
43
  ComponentName RNUITextViewChildProps::getDiffPropsImplementationTarget() const {
@@ -100,6 +106,30 @@ folly::dynamic RNUITextViewChildProps::getDiffProps(
100
106
  if ((shadowRadius != oldProps->shadowRadius) && !(std::isnan(shadowRadius) && std::isnan(oldProps->shadowRadius))) {
101
107
  result["shadowRadius"] = shadowRadius;
102
108
  }
109
+
110
+ if (highlightGroup != oldProps->highlightGroup) {
111
+ result["highlightGroup"] = highlightGroup;
112
+ }
113
+
114
+ if (suppressHighlighting != oldProps->suppressHighlighting) {
115
+ result["suppressHighlighting"] = suppressHighlighting;
116
+ }
117
+
118
+ if ((pressRetentionOffsetTop != oldProps->pressRetentionOffsetTop) && !(std::isnan(pressRetentionOffsetTop) && std::isnan(oldProps->pressRetentionOffsetTop))) {
119
+ result["pressRetentionOffsetTop"] = pressRetentionOffsetTop;
120
+ }
121
+
122
+ if ((pressRetentionOffsetRight != oldProps->pressRetentionOffsetRight) && !(std::isnan(pressRetentionOffsetRight) && std::isnan(oldProps->pressRetentionOffsetRight))) {
123
+ result["pressRetentionOffsetRight"] = pressRetentionOffsetRight;
124
+ }
125
+
126
+ if ((pressRetentionOffsetBottom != oldProps->pressRetentionOffsetBottom) && !(std::isnan(pressRetentionOffsetBottom) && std::isnan(oldProps->pressRetentionOffsetBottom))) {
127
+ result["pressRetentionOffsetBottom"] = pressRetentionOffsetBottom;
128
+ }
129
+
130
+ if ((pressRetentionOffsetLeft != oldProps->pressRetentionOffsetLeft) && !(std::isnan(pressRetentionOffsetLeft) && std::isnan(oldProps->pressRetentionOffsetLeft))) {
131
+ result["pressRetentionOffsetLeft"] = pressRetentionOffsetLeft;
132
+ }
103
133
  return result;
104
134
  }
105
135
  #endif
@@ -174,6 +174,12 @@ class RNUITextViewChildProps final : public ViewProps {
174
174
  SharedColor textDecorationColor{};
175
175
  RNUITextViewChildTextAlign textAlign{RNUITextViewChildTextAlign::Auto};
176
176
  Float shadowRadius{0.0};
177
+ std::string highlightGroup{};
178
+ bool suppressHighlighting{false};
179
+ Float pressRetentionOffsetTop{20.0};
180
+ Float pressRetentionOffsetRight{20.0};
181
+ Float pressRetentionOffsetBottom{30.0};
182
+ Float pressRetentionOffsetLeft{20.0};
177
183
 
178
184
  #ifdef RN_SERIALIZABLE_STATE
179
185
  ComponentName getDiffPropsImplementationTarget() const override;
@@ -40,6 +40,15 @@ interface NativeProps extends ViewProps {
40
40
  textDecorationColor?: ColorValue
41
41
  textAlign?: CodegenTypes.WithDefault<TextAlign, 'auto'>
42
42
  shadowRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>
43
+ /** Internal identifier used to highlight all fragments in a pressable Text. */
44
+ highlightGroup?: string
45
+ /** Internal copy of Text's suppressHighlighting prop. */
46
+ suppressHighlighting?: boolean
47
+ /** Internal expansion of the owning Text's press-retention rectangle. */
48
+ pressRetentionOffsetTop?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>
49
+ pressRetentionOffsetRight?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>
50
+ pressRetentionOffsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Float, 30>
51
+ pressRetentionOffsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>
43
52
  onPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>
44
53
  onLongPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>
45
54
  }
@@ -8,10 +8,14 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _RNUITextViewChildNativeComponent = _interopRequireDefault(require("./RNUITextViewChildNativeComponent"));
10
10
  var _RNUITextViewNativeComponent = _interopRequireDefault(require("./RNUITextViewNativeComponent"));
11
+ var _press = require("./press.js");
11
12
  var _util = require("./util.js");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- const TextAncestorContext = /*#__PURE__*/_react.default.createContext([false, _reactNative.StyleSheet.create({})]);
15
+ const TextAncestorContext = /*#__PURE__*/_react.default.createContext({
16
+ isAncestor: false,
17
+ rootStyle: _reactNative.StyleSheet.create({})
18
+ });
15
19
  const textDefaults = {
16
20
  allowFontScaling: true,
17
21
  selectable: true
@@ -28,13 +32,48 @@ function UITextViewChild({
28
32
  children,
29
33
  ...rest
30
34
  }) {
31
- const [isAncestor, rootStyle] = useTextAncestorContext();
35
+ const {
36
+ isAncestor,
37
+ rootStyle,
38
+ highlightGroup: ancestorHighlightGroup,
39
+ suppressHighlighting: ancestorSuppressHighlighting,
40
+ pressRetentionOffset: ancestorPressRetentionOffset,
41
+ onPress: ancestorOnPress,
42
+ onLongPress: ancestorOnLongPress
43
+ } = useTextAncestorContext();
44
+ const ownHighlightGroup = _react.default.useId();
45
+ const {
46
+ highlightGroup,
47
+ suppressHighlighting,
48
+ pressRetentionOffset,
49
+ onPress,
50
+ onLongPress
51
+ } = (0, _press.resolvePressContext)(ownHighlightGroup, rest, {
52
+ highlightGroup: ancestorHighlightGroup,
53
+ suppressHighlighting: ancestorSuppressHighlighting,
54
+ pressRetentionOffset: ancestorPressRetentionOffset,
55
+ onPress: ancestorOnPress,
56
+ onLongPress: ancestorOnLongPress
57
+ });
58
+ // The native event currently contains only `target`, while TextProps types
59
+ // these callbacks as full gesture events. Preserve the existing public type
60
+ // and adapt it only at the private Codegen boundary.
61
+ const nativeOnPress = onPress;
62
+ const nativeOnLongPress = onLongPress;
32
63
 
33
64
  // Flatten the styles, and apply the root styles when needed
34
65
  const flattenedStyle = _react.default.useMemo(() => (0, _util.flattenStyles)(rootStyle, style), [rootStyle, style]);
35
66
  if (!isAncestor) {
36
67
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(TextAncestorContext.Provider, {
37
- value: [true, flattenedStyle],
68
+ value: {
69
+ isAncestor: true,
70
+ rootStyle: flattenedStyle,
71
+ highlightGroup,
72
+ suppressHighlighting,
73
+ pressRetentionOffset,
74
+ onPress,
75
+ onLongPress
76
+ },
38
77
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RNUITextViewNativeComponent.default, {
39
78
  ...textDefaults,
40
79
  ...rest,
@@ -48,35 +87,52 @@ function UITextViewChild({
48
87
  if (/*#__PURE__*/_react.default.isValidElement(c)) {
49
88
  return c;
50
89
  } else if (typeof c === 'string' || typeof c === 'number') {
51
- return (
52
- /*#__PURE__*/
53
- // @ts-expect-error @TODO fix this type
54
- (0, _jsxRuntime.jsx)(_RNUITextViewChildNativeComponent.default, {
55
- style: flattenedStyle,
56
- text: c.toString(),
57
- ...rest
58
- }, index)
59
- );
90
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RNUITextViewChildNativeComponent.default, {
91
+ style: flattenedStyle,
92
+ text: c.toString(),
93
+ ...rest,
94
+ highlightGroup: highlightGroup,
95
+ suppressHighlighting: suppressHighlighting,
96
+ pressRetentionOffsetTop: pressRetentionOffset?.top,
97
+ pressRetentionOffsetRight: pressRetentionOffset?.right,
98
+ pressRetentionOffsetBottom: pressRetentionOffset?.bottom,
99
+ pressRetentionOffsetLeft: pressRetentionOffset?.left,
100
+ onPress: nativeOnPress,
101
+ onLongPress: nativeOnLongPress
102
+ }, index);
60
103
  }
61
104
  return null;
62
105
  })
63
106
  })
64
107
  });
65
108
  } else {
66
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
109
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(TextAncestorContext.Provider, {
110
+ value: {
111
+ isAncestor: true,
112
+ rootStyle: flattenedStyle,
113
+ highlightGroup,
114
+ suppressHighlighting,
115
+ pressRetentionOffset,
116
+ onPress,
117
+ onLongPress
118
+ },
67
119
  children: _react.default.Children.toArray(children).map((c, index) => {
68
120
  if (/*#__PURE__*/_react.default.isValidElement(c)) {
69
121
  return c;
70
122
  } else if (typeof c === 'string' || typeof c === 'number') {
71
- return (
72
- /*#__PURE__*/
73
- // @ts-expect-error @TODO fix this type
74
- (0, _jsxRuntime.jsx)(_RNUITextViewChildNativeComponent.default, {
75
- style: flattenedStyle,
76
- text: c.toString(),
77
- ...rest
78
- }, index)
79
- );
123
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RNUITextViewChildNativeComponent.default, {
124
+ style: flattenedStyle,
125
+ text: c.toString(),
126
+ ...rest,
127
+ highlightGroup: highlightGroup,
128
+ suppressHighlighting: suppressHighlighting,
129
+ pressRetentionOffsetTop: pressRetentionOffset?.top,
130
+ pressRetentionOffsetRight: pressRetentionOffset?.right,
131
+ pressRetentionOffsetBottom: pressRetentionOffset?.bottom,
132
+ pressRetentionOffsetLeft: pressRetentionOffset?.left,
133
+ onPress: nativeOnPress,
134
+ onLongPress: nativeOnLongPress
135
+ }, index);
80
136
  }
81
137
  return null;
82
138
  })
@@ -84,7 +140,9 @@ function UITextViewChild({
84
140
  }
85
141
  }
86
142
  function UITextViewInner(props) {
87
- const [isAncestor] = useTextAncestorContext();
143
+ const {
144
+ isAncestor
145
+ } = useTextAncestorContext();
88
146
 
89
147
  // Even if the uiTextView prop is set, we can still default to using
90
148
  // normal selection (i.e. base RN text) if the text doesn't need to be
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_RNUITextViewChildNativeComponent","_RNUITextViewNativeComponent","_util","_jsxRuntime","e","__esModule","default","TextAncestorContext","React","createContext","StyleSheet","create","textDefaults","allowFontScaling","selectable","useTextAncestorContext","useContext","UITextViewChild","style","children","rest","isAncestor","rootStyle","flattenedStyle","useMemo","flattenStyles","jsx","Provider","value","onPress","undefined","onLongPress","Children","toArray","map","c","index","isValidElement","text","toString","Fragment","UITextViewInner","props","uiTextView","Text","UITextView","Platform","OS"],"sourceRoot":"../../src","sources":["Text.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,iCAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,4BAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAAoC,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,mBAAmB,gBAAGC,cAAK,CAACC,aAAa,CAAuB,CACpE,KAAK,EACLC,uBAAU,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,CACtB,CAAC;AAEF,MAAMC,YAAuB,GAAG;EAC9BC,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE;AACd,CAAC;AAED,MAAMC,sBAAsB,GAAGA,CAAA,KAAMP,cAAK,CAACQ,UAAU,CAACT,mBAAmB,CAAC;;AAE1E;AACA;AACA;AACA;;AAgBA,SAASU,eAAeA,CAAC;EAACC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAqB,CAAC,EAAE;EACpE,MAAM,C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,CAAG,CAAC;AACvC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_RNUITextViewChildNativeComponent","_RNUITextViewNativeComponent","_press","_util","_jsxRuntime","e","__esModule","default","TextAncestorContext","React","createContext","isAncestor","rootStyle","StyleSheet","create","textDefaults","allowFontScaling","selectable","useTextAncestorContext","useContext","UITextViewChild","style","children","rest","highlightGroup","ancestorHighlightGroup","suppressHighlighting","ancestorSuppressHighlighting","pressRetentionOffset","ancestorPressRetentionOffset","onPress","ancestorOnPress","onLongPress","ancestorOnLongPress","ownHighlightGroup","useId","resolvePressContext","nativeOnPress","nativeOnLongPress","flattenedStyle","useMemo","flattenStyles","jsx","Provider","value","undefined","Children","toArray","map","c","index","isValidElement","text","toString","pressRetentionOffsetTop","top","pressRetentionOffsetRight","right","pressRetentionOffsetBottom","bottom","pressRetentionOffsetLeft","left","UITextViewInner","props","uiTextView","Text","UITextView","Platform","OS"],"sourceRoot":"../../src","sources":["Text.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,iCAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,4BAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAoC,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAOpC,MAAMG,mBAAmB,gBAAGC,cAAK,CAACC,aAAa,CAA2B;EACxEC,UAAU,EAAE,KAAK;EACjBC,SAAS,EAAEC,uBAAU,CAACC,MAAM,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAMC,YAAuB,GAAG;EAC9BC,gBAAgB,EAAE,IAAI;EACtBC,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,YAAA,CAAAkE,IAAM;MAAA,GAAKF;IAAK,CAAG,CAAC;EAC9B;EACA,oBAAO,IAAA3D,WAAA,CAAAsC,GAAA,EAACtB,eAAe;IAAA,GAAK2C;EAAK,CAAG,CAAC;AACvC;AAEO,SAASG,UAAUA,CAACH,KAAsB,EAAE;EACjD,IAAII,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,oBAAO,IAAAhE,WAAA,CAAAsC,GAAA,EAAC3C,YAAA,CAAAkE,IAAM;MAAA,GAAKF;IAAK,CAAG,CAAC;EAC9B;EACA,oBAAO,IAAA3D,WAAA,CAAAsC,GAAA,EAACoB,eAAe;IAAA,GAAKC;EAAK,CAAG,CAAC;AACvC","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.resolvePressContext = resolvePressContext;
7
+ function resolvePressContext(ownHighlightGroup, props, ancestor) {
8
+ const isPressable = props.onPress != null || props.onLongPress != null;
9
+ if (!isPressable) {
10
+ return ancestor;
11
+ }
12
+ return {
13
+ // Keep handler capabilities in the identifier that native already uses to
14
+ // group highlighted fragments. This avoids a separate prop/state channel
15
+ // getting out of sync with the group and its event emitter.
16
+ highlightGroup: `${ownHighlightGroup}|${props.onPress ? 'p' : ''}${props.onLongPress ? 'l' : ''}`,
17
+ suppressHighlighting: props.suppressHighlighting === true,
18
+ pressRetentionOffset: props.pressRetentionOffset,
19
+ onPress: props.onPress,
20
+ onLongPress: props.onLongPress
21
+ };
22
+ }
23
+ //# sourceMappingURL=press.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["resolvePressContext","ownHighlightGroup","props","ancestor","isPressable","onPress","onLongPress","highlightGroup","suppressHighlighting","pressRetentionOffset"],"sourceRoot":"../../src","sources":["press.ts"],"mappings":";;;;;;AAUO,SAASA,mBAAmBA,CACjCC,iBAAyB,EACzBC,KAGC,EACDC,QAAsB,EACR;EACd,MAAMC,WAAW,GAAGF,KAAK,CAACG,OAAO,IAAI,IAAI,IAAIH,KAAK,CAACI,WAAW,IAAI,IAAI;EACtE,IAAI,CAACF,WAAW,EAAE;IAChB,OAAOD,QAAQ;EACjB;EAEA,OAAO;IACL;IACA;IACA;IACAI,cAAc,EAAE,GAAGN,iBAAiB,IAAIC,KAAK,CAACG,OAAO,GAAG,GAAG,GAAG,EAAE,GAC9DH,KAAK,CAACI,WAAW,GAAG,GAAG,GAAG,EAAE,EAC5B;IACFE,oBAAoB,EAAEN,KAAK,CAACM,oBAAoB,KAAK,IAAI;IACzDC,oBAAoB,EAAEP,KAAK,CAACO,oBAAoB;IAChDJ,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,WAAW,EAAEJ,KAAK,CAACI;EACrB,CAAC;AACH","ignoreList":[]}
@@ -40,6 +40,15 @@ interface NativeProps extends ViewProps {
40
40
  textDecorationColor?: ColorValue
41
41
  textAlign?: CodegenTypes.WithDefault<TextAlign, 'auto'>
42
42
  shadowRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>
43
+ /** Internal identifier used to highlight all fragments in a pressable Text. */
44
+ highlightGroup?: string
45
+ /** Internal copy of Text's suppressHighlighting prop. */
46
+ suppressHighlighting?: boolean
47
+ /** Internal expansion of the owning Text's press-retention rectangle. */
48
+ pressRetentionOffsetTop?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>
49
+ pressRetentionOffsetRight?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>
50
+ pressRetentionOffsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Float, 30>
51
+ pressRetentionOffsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>
43
52
  onPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>
44
53
  onLongPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>
45
54
  }
@@ -4,9 +4,13 @@ import React from 'react';
4
4
  import { Platform, StyleSheet, Text as RNText } from 'react-native';
5
5
  import RNUITextViewChildNativeComponent from './RNUITextViewChildNativeComponent';
6
6
  import RNUITextViewNativeComponent from './RNUITextViewNativeComponent';
7
+ import { resolvePressContext } from "./press.js";
7
8
  import { flattenStyles } from "./util.js";
8
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
9
- const TextAncestorContext = /*#__PURE__*/React.createContext([false, StyleSheet.create({})]);
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const TextAncestorContext = /*#__PURE__*/React.createContext({
11
+ isAncestor: false,
12
+ rootStyle: StyleSheet.create({})
13
+ });
10
14
  const textDefaults = {
11
15
  allowFontScaling: true,
12
16
  selectable: true
@@ -23,13 +27,48 @@ function UITextViewChild({
23
27
  children,
24
28
  ...rest
25
29
  }) {
26
- const [isAncestor, rootStyle] = useTextAncestorContext();
30
+ const {
31
+ isAncestor,
32
+ rootStyle,
33
+ highlightGroup: ancestorHighlightGroup,
34
+ suppressHighlighting: ancestorSuppressHighlighting,
35
+ pressRetentionOffset: ancestorPressRetentionOffset,
36
+ onPress: ancestorOnPress,
37
+ onLongPress: ancestorOnLongPress
38
+ } = useTextAncestorContext();
39
+ const ownHighlightGroup = React.useId();
40
+ const {
41
+ highlightGroup,
42
+ suppressHighlighting,
43
+ pressRetentionOffset,
44
+ onPress,
45
+ onLongPress
46
+ } = resolvePressContext(ownHighlightGroup, rest, {
47
+ highlightGroup: ancestorHighlightGroup,
48
+ suppressHighlighting: ancestorSuppressHighlighting,
49
+ pressRetentionOffset: ancestorPressRetentionOffset,
50
+ onPress: ancestorOnPress,
51
+ onLongPress: ancestorOnLongPress
52
+ });
53
+ // The native event currently contains only `target`, while TextProps types
54
+ // these callbacks as full gesture events. Preserve the existing public type
55
+ // and adapt it only at the private Codegen boundary.
56
+ const nativeOnPress = onPress;
57
+ const nativeOnLongPress = onLongPress;
27
58
 
28
59
  // Flatten the styles, and apply the root styles when needed
29
60
  const flattenedStyle = React.useMemo(() => flattenStyles(rootStyle, style), [rootStyle, style]);
30
61
  if (!isAncestor) {
31
62
  return /*#__PURE__*/_jsx(TextAncestorContext.Provider, {
32
- value: [true, flattenedStyle],
63
+ value: {
64
+ isAncestor: true,
65
+ rootStyle: flattenedStyle,
66
+ highlightGroup,
67
+ suppressHighlighting,
68
+ pressRetentionOffset,
69
+ onPress,
70
+ onLongPress
71
+ },
33
72
  children: /*#__PURE__*/_jsx(RNUITextViewNativeComponent, {
34
73
  ...textDefaults,
35
74
  ...rest,
@@ -43,35 +82,52 @@ function UITextViewChild({
43
82
  if (/*#__PURE__*/React.isValidElement(c)) {
44
83
  return c;
45
84
  } else if (typeof c === 'string' || typeof c === 'number') {
46
- return (
47
- /*#__PURE__*/
48
- // @ts-expect-error @TODO fix this type
49
- _jsx(RNUITextViewChildNativeComponent, {
50
- style: flattenedStyle,
51
- text: c.toString(),
52
- ...rest
53
- }, index)
54
- );
85
+ return /*#__PURE__*/_jsx(RNUITextViewChildNativeComponent, {
86
+ style: flattenedStyle,
87
+ text: c.toString(),
88
+ ...rest,
89
+ highlightGroup: highlightGroup,
90
+ suppressHighlighting: suppressHighlighting,
91
+ pressRetentionOffsetTop: pressRetentionOffset?.top,
92
+ pressRetentionOffsetRight: pressRetentionOffset?.right,
93
+ pressRetentionOffsetBottom: pressRetentionOffset?.bottom,
94
+ pressRetentionOffsetLeft: pressRetentionOffset?.left,
95
+ onPress: nativeOnPress,
96
+ onLongPress: nativeOnLongPress
97
+ }, index);
55
98
  }
56
99
  return null;
57
100
  })
58
101
  })
59
102
  });
60
103
  } else {
61
- return /*#__PURE__*/_jsx(_Fragment, {
104
+ return /*#__PURE__*/_jsx(TextAncestorContext.Provider, {
105
+ value: {
106
+ isAncestor: true,
107
+ rootStyle: flattenedStyle,
108
+ highlightGroup,
109
+ suppressHighlighting,
110
+ pressRetentionOffset,
111
+ onPress,
112
+ onLongPress
113
+ },
62
114
  children: React.Children.toArray(children).map((c, index) => {
63
115
  if (/*#__PURE__*/React.isValidElement(c)) {
64
116
  return c;
65
117
  } else if (typeof c === 'string' || typeof c === 'number') {
66
- return (
67
- /*#__PURE__*/
68
- // @ts-expect-error @TODO fix this type
69
- _jsx(RNUITextViewChildNativeComponent, {
70
- style: flattenedStyle,
71
- text: c.toString(),
72
- ...rest
73
- }, index)
74
- );
118
+ return /*#__PURE__*/_jsx(RNUITextViewChildNativeComponent, {
119
+ style: flattenedStyle,
120
+ text: c.toString(),
121
+ ...rest,
122
+ highlightGroup: highlightGroup,
123
+ suppressHighlighting: suppressHighlighting,
124
+ pressRetentionOffsetTop: pressRetentionOffset?.top,
125
+ pressRetentionOffsetRight: pressRetentionOffset?.right,
126
+ pressRetentionOffsetBottom: pressRetentionOffset?.bottom,
127
+ pressRetentionOffsetLeft: pressRetentionOffset?.left,
128
+ onPress: nativeOnPress,
129
+ onLongPress: nativeOnLongPress
130
+ }, index);
75
131
  }
76
132
  return null;
77
133
  })
@@ -79,7 +135,9 @@ function UITextViewChild({
79
135
  }
80
136
  }
81
137
  function UITextViewInner(props) {
82
- const [isAncestor] = useTextAncestorContext();
138
+ const {
139
+ isAncestor
140
+ } = useTextAncestorContext();
83
141
 
84
142
  // Even if the uiTextView prop is set, we can still default to using
85
143
  // normal selection (i.e. base RN text) if the text doesn't need to be
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","StyleSheet","Text","RNText","RNUITextViewChildNativeComponent","RNUITextViewNativeComponent","flattenStyles","jsx","_jsx","Fragment","_Fragment","TextAncestorContext","createContext","create","textDefaults","allowFontScaling","selectable","useTextAncestorContext","useContext","UITextViewChild","style","children","rest","isAncestor","rootStyle","flattenedStyle","useMemo","Provider","value","onPress","undefined","onLongPress","Children","toArray","map","c","index","isValidElement","text","toString","UITextViewInner","props","uiTextView","UITextView","OS"],"sourceRoot":"../../src","sources":["Text.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,QAAQ,EACRC,UAAU,EACVC,IAAI,IAAIC,MAAM,QAGT,cAAc;AACrB,OAAOC,gCAAgC,MAAM,oCAAoC;AACjF,OAAO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Ae;IAAA,GAAKsB;EAAK,CAAG,CAAC;AACvC;AAEA,OAAO,SAASE,UAAUA,CAACF,KAAsB,EAAE;EACjD,IAAIzC,QAAQ,CAAC4C,EAAE,KAAK,KAAK,EAAE;IACzB,oBAAOpC,IAAA,CAACL,MAAM;MAAA,GAAKsC;IAAK,CAAG,CAAC;EAC9B;EACA,oBAAOjC,IAAA,CAACgC,eAAe;IAAA,GAAKC;EAAK,CAAG,CAAC;AACvC","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","StyleSheet","Text","RNText","RNUITextViewChildNativeComponent","RNUITextViewNativeComponent","resolvePressContext","flattenStyles","jsx","_jsx","TextAncestorContext","createContext","isAncestor","rootStyle","create","textDefaults","allowFontScaling","selectable","useTextAncestorContext","useContext","UITextViewChild","style","children","rest","highlightGroup","ancestorHighlightGroup","suppressHighlighting","ancestorSuppressHighlighting","pressRetentionOffset","ancestorPressRetentionOffset","onPress","ancestorOnPress","onLongPress","ancestorOnLongPress","ownHighlightGroup","useId","nativeOnPress","nativeOnLongPress","flattenedStyle","useMemo","Provider","value","undefined","Children","toArray","map","c","index","isValidElement","text","toString","pressRetentionOffsetTop","top","pressRetentionOffsetRight","right","pressRetentionOffsetBottom","bottom","pressRetentionOffsetLeft","left","UITextViewInner","props","uiTextView","UITextView","OS"],"sourceRoot":"../../src","sources":["Text.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,QAAQ,EACRC,UAAU,EACVC,IAAI,IAAIC,MAAM,QAGT,cAAc;AACrB,OAAOC,gCAAgC,MAAM,oCAAoC;AACjF,OAAOC,2BAA2B,MAAM,+BAA+B;AACvE,SAAQC,mBAAmB,QAA0B,YAAS;AAC9D,SAAQC,aAAa,QAAO,WAAQ;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOpC,MAAMC,mBAAmB,gBAAGX,KAAK,CAACY,aAAa,CAA2B;EACxEC,UAAU,EAAE,KAAK;EACjBC,SAAS,EAAEZ,UAAU,CA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eAAe;IAAA,GAAKwC;EAAK,CAAG,CAAC;AACvC;AAEA,OAAO,SAASE,UAAUA,CAACF,KAAsB,EAAE;EACjD,IAAI5D,QAAQ,CAAC+D,EAAE,KAAK,KAAK,EAAE;IACzB,oBAAOtD,IAAA,CAACN,MAAM;MAAA,GAAKyD;IAAK,CAAG,CAAC;EAC9B;EACA,oBAAOnD,IAAA,CAACkD,eAAe;IAAA,GAAKC;EAAK,CAAG,CAAC;AACvC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ export function resolvePressContext(ownHighlightGroup, props, ancestor) {
4
+ const isPressable = props.onPress != null || props.onLongPress != null;
5
+ if (!isPressable) {
6
+ return ancestor;
7
+ }
8
+ return {
9
+ // Keep handler capabilities in the identifier that native already uses to
10
+ // group highlighted fragments. This avoids a separate prop/state channel
11
+ // getting out of sync with the group and its event emitter.
12
+ highlightGroup: `${ownHighlightGroup}|${props.onPress ? 'p' : ''}${props.onLongPress ? 'l' : ''}`,
13
+ suppressHighlighting: props.suppressHighlighting === true,
14
+ pressRetentionOffset: props.pressRetentionOffset,
15
+ onPress: props.onPress,
16
+ onLongPress: props.onLongPress
17
+ };
18
+ }
19
+ //# sourceMappingURL=press.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["resolvePressContext","ownHighlightGroup","props","ancestor","isPressable","onPress","onLongPress","highlightGroup","suppressHighlighting","pressRetentionOffset"],"sourceRoot":"../../src","sources":["press.ts"],"mappings":";;AAUA,OAAO,SAASA,mBAAmBA,CACjCC,iBAAyB,EACzBC,KAGC,EACDC,QAAsB,EACR;EACd,MAAMC,WAAW,GAAGF,KAAK,CAACG,OAAO,IAAI,IAAI,IAAIH,KAAK,CAACI,WAAW,IAAI,IAAI;EACtE,IAAI,CAACF,WAAW,EAAE;IAChB,OAAOD,QAAQ;EACjB;EAEA,OAAO;IACL;IACA;IACA;IACAI,cAAc,EAAE,GAAGN,iBAAiB,IAAIC,KAAK,CAACG,OAAO,GAAG,GAAG,GAAG,EAAE,GAC9DH,KAAK,CAACI,WAAW,GAAG,GAAG,GAAG,EAAE,EAC5B;IACFE,oBAAoB,EAAEN,KAAK,CAACM,oBAAoB,KAAK,IAAI;IACzDC,oBAAoB,EAAEP,KAAK,CAACO,oBAAoB;IAChDJ,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,WAAW,EAAEJ,KAAK,CAACI;EACrB,CAAC;AACH","ignoreList":[]}
@@ -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,sBAkwB1B"}
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,sBA4wB1B"}
@@ -21,6 +21,15 @@ interface NativeProps extends ViewProps {
21
21
  textDecorationColor?: ColorValue;
22
22
  textAlign?: CodegenTypes.WithDefault<TextAlign, 'auto'>;
23
23
  shadowRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
24
+ /** Internal identifier used to highlight all fragments in a pressable Text. */
25
+ highlightGroup?: string;
26
+ /** Internal copy of Text's suppressHighlighting prop. */
27
+ suppressHighlighting?: boolean;
28
+ /** Internal expansion of the owning Text's press-retention rectangle. */
29
+ pressRetentionOffsetTop?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>;
30
+ pressRetentionOffsetRight?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>;
31
+ pressRetentionOffsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Float, 30>;
32
+ pressRetentionOffsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>;
24
33
  onPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
25
34
  onLongPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
26
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RNUITextViewChildNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/RNUITextViewChildNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAErB,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,CAAC,KAAK,CAAA;CAC3B;AAED,KAAK,kBAAkB,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,CAAA;AAE/D,KAAK,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,UAAU,GACV,OAAO,CAAA;AAEX,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEpC,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;AAEjE,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAC7B,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACzD,UAAU,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAClC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAC/B,kBAAkB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;IACzE,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AAa,CAAC,CAAA;IAC1D,WAAW,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;CAC/D;;AAED,wBAEE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAiBrB;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAA;CAC1D,CAAA;AAED,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAC1D,CAAA;AA8ED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAKhD"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAuBrB;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAA;CAC1D,CAAA;AAED,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAC1D,CAAA;AA6ID,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAKhD"}
@@ -0,0 +1,10 @@
1
+ import type { TextProps } from 'react-native';
2
+ export type PressContext = {
3
+ highlightGroup?: string;
4
+ suppressHighlighting?: boolean;
5
+ pressRetentionOffset?: TextProps['pressRetentionOffset'];
6
+ onPress?: TextProps['onPress'];
7
+ onLongPress?: TextProps['onLongPress'];
8
+ };
9
+ export declare function resolvePressContext(ownHighlightGroup: string, props: Pick<TextProps, 'onPress' | 'onLongPress' | 'pressRetentionOffset' | 'suppressHighlighting'>, ancestor: PressContext): PressContext;
10
+ //# sourceMappingURL=press.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"press.d.ts","sourceRoot":"","sources":["../../../../src/press.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,oBAAoB,CAAC,EAAE,SAAS,CAAC,sBAAsB,CAAC,CAAA;IACxD,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAA;CACvC,CAAA;AAED,wBAAgB,mBAAmB,CACjC,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,IAAI,CACT,SAAS,EACT,SAAS,GAAG,aAAa,GAAG,sBAAsB,GAAG,sBAAsB,CAC5E,EACD,QAAQ,EAAE,YAAY,GACrB,YAAY,CAkBd"}
@@ -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,sBAkwB1B"}
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,sBA4wB1B"}
@@ -21,6 +21,15 @@ interface NativeProps extends ViewProps {
21
21
  textDecorationColor?: ColorValue;
22
22
  textAlign?: CodegenTypes.WithDefault<TextAlign, 'auto'>;
23
23
  shadowRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
24
+ /** Internal identifier used to highlight all fragments in a pressable Text. */
25
+ highlightGroup?: string;
26
+ /** Internal copy of Text's suppressHighlighting prop. */
27
+ suppressHighlighting?: boolean;
28
+ /** Internal expansion of the owning Text's press-retention rectangle. */
29
+ pressRetentionOffsetTop?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>;
30
+ pressRetentionOffsetRight?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>;
31
+ pressRetentionOffsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Float, 30>;
32
+ pressRetentionOffsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Float, 20>;
24
33
  onPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
25
34
  onLongPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
26
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RNUITextViewChildNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/RNUITextViewChildNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAErB,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,CAAC,KAAK,CAAA;CAC3B;AAED,KAAK,kBAAkB,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,CAAA;AAE/D,KAAK,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,UAAU,GACV,OAAO,CAAA;AAEX,KAAK,SAAS,GAAG,QA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