@onekeyfe/react-native-text 3.0.110 → 3.0.112
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/lib/module/Text.android.js +44 -37
- package/package.json +1 -1
- package/src/Text.android.tsx +10 -5
- package/src/codegen-types.d.ts +1 -0
|
@@ -90,43 +90,44 @@ const PressableText = /*#__PURE__*/forwardRef(function PressableText({
|
|
|
90
90
|
ref: ref
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
-
function TextImpl({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
93
|
+
function TextImpl(props, forwardedRef) {
|
|
94
|
+
const {
|
|
95
|
+
accessible,
|
|
96
|
+
accessibilityLabel,
|
|
97
|
+
accessibilityRole,
|
|
98
|
+
accessibilityState,
|
|
99
|
+
allowFontScaling,
|
|
100
|
+
'aria-busy': ariaBusy,
|
|
101
|
+
'aria-checked': ariaChecked,
|
|
102
|
+
'aria-disabled': ariaDisabled,
|
|
103
|
+
'aria-expanded': ariaExpanded,
|
|
104
|
+
'aria-hidden': ariaHidden,
|
|
105
|
+
'aria-label': ariaLabel,
|
|
106
|
+
'aria-selected': ariaSelected,
|
|
107
|
+
children,
|
|
108
|
+
ellipsizeMode,
|
|
109
|
+
disabled,
|
|
110
|
+
id,
|
|
111
|
+
nativeID,
|
|
112
|
+
numberOfLines,
|
|
113
|
+
onLongPress,
|
|
114
|
+
onPress,
|
|
115
|
+
onPressIn,
|
|
116
|
+
onPressOut,
|
|
117
|
+
onResponderGrant,
|
|
118
|
+
onResponderMove,
|
|
119
|
+
onResponderRelease,
|
|
120
|
+
onResponderTerminate,
|
|
121
|
+
onResponderTerminationRequest,
|
|
122
|
+
onStartShouldSetResponder,
|
|
123
|
+
pressRetentionOffset,
|
|
124
|
+
role,
|
|
125
|
+
selectable,
|
|
126
|
+
selectionColor,
|
|
127
|
+
suppressHighlighting,
|
|
128
|
+
style,
|
|
129
|
+
...restProps
|
|
130
|
+
} = props;
|
|
130
131
|
const hasTextAncestor = useContext(TextAncestorContext);
|
|
131
132
|
if (hasTextAncestor) {
|
|
132
133
|
return /*#__PURE__*/_jsx(ReactNativeText, {
|
|
@@ -243,6 +244,12 @@ function TextImpl({
|
|
|
243
244
|
processedStyle = [processedStyle, overrides];
|
|
244
245
|
}
|
|
245
246
|
}
|
|
247
|
+
if (processedSelectable === true && ReactNativeFeatureFlags.enablePreparedTextLayout()) {
|
|
248
|
+
return /*#__PURE__*/_jsx(ReactNativeText, {
|
|
249
|
+
...props,
|
|
250
|
+
ref: forwardedRef
|
|
251
|
+
});
|
|
252
|
+
}
|
|
246
253
|
if (ReactNativeFeatureFlags.defaultTextToOverflowHidden()) {
|
|
247
254
|
processedStyle = [styles.default, processedStyle];
|
|
248
255
|
}
|
package/package.json
CHANGED
package/src/Text.android.tsx
CHANGED
|
@@ -178,8 +178,8 @@ const PressableText = forwardRef<TextForwardRef, PressableTextProps>(
|
|
|
178
178
|
}
|
|
179
179
|
);
|
|
180
180
|
|
|
181
|
-
function TextImpl(
|
|
182
|
-
{
|
|
181
|
+
function TextImpl(props: TextProps, forwardedRef: Ref<TextForwardRef>) {
|
|
182
|
+
const {
|
|
183
183
|
accessible,
|
|
184
184
|
accessibilityLabel,
|
|
185
185
|
accessibilityRole,
|
|
@@ -215,9 +215,7 @@ function TextImpl(
|
|
|
215
215
|
suppressHighlighting,
|
|
216
216
|
style,
|
|
217
217
|
...restProps
|
|
218
|
-
}
|
|
219
|
-
forwardedRef: Ref<TextForwardRef>
|
|
220
|
-
) {
|
|
218
|
+
} = props;
|
|
221
219
|
const hasTextAncestor = useContext(TextAncestorContext);
|
|
222
220
|
if (hasTextAncestor) {
|
|
223
221
|
return (
|
|
@@ -369,6 +367,13 @@ function TextImpl(
|
|
|
369
367
|
}
|
|
370
368
|
}
|
|
371
369
|
|
|
370
|
+
if (
|
|
371
|
+
processedSelectable === true &&
|
|
372
|
+
ReactNativeFeatureFlags.enablePreparedTextLayout()
|
|
373
|
+
) {
|
|
374
|
+
return <ReactNativeText {...props} ref={forwardedRef} />;
|
|
375
|
+
}
|
|
376
|
+
|
|
372
377
|
if (ReactNativeFeatureFlags.defaultTextToOverflowHidden()) {
|
|
373
378
|
processedStyle = [styles.default, processedStyle];
|
|
374
379
|
}
|
package/src/codegen-types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare module 'react-native/Libraries/Pressability/PressabilityDebug' {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
declare module 'react-native/src/private/featureflags/ReactNativeFeatureFlags' {
|
|
17
|
+
export function enablePreparedTextLayout(): boolean;
|
|
17
18
|
export function defaultTextToOverflowHidden(): boolean;
|
|
18
19
|
}
|
|
19
20
|
|