@onekeyfe/react-native-text 3.0.108
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/LICENSE +21 -0
- package/README.md +17 -0
- package/android/build.gradle +109 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/onekey/text/OneKeyTextPackage.kt +21 -0
- package/android/src/main/java/com/onekey/text/OneKeyTextView.kt +6 -0
- package/android/src/main/java/com/onekey/text/OneKeyTextViewManager.kt +34 -0
- package/android/src/main/jni/CMakeLists.txt +31 -0
- package/android/src/main/jni/react/renderer/components/RNOneKeyTextSpec/ComponentDescriptors.h +45 -0
- package/lib/module/OneKeyTextNativeComponent.ts +100 -0
- package/lib/module/OneKeyTextNativeHost.js +35 -0
- package/lib/module/Text.android.js +335 -0
- package/lib/module/Text.js +5 -0
- package/lib/module/codegen-types.d.js +2 -0
- package/lib/module/index.js +5 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +4 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/OneKeyTextNativeComponent.d.ts +47 -0
- package/lib/typescript/src/OneKeyTextNativeHost.d.ts +32 -0
- package/lib/typescript/src/Text.android.d.ts +79 -0
- package/lib/typescript/src/Text.d.ts +6 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/types.d.ts +3 -0
- package/package.json +118 -0
- package/react-native.config.js +13 -0
- package/src/OneKeyTextNativeComponent.ts +100 -0
- package/src/OneKeyTextNativeHost.ts +40 -0
- package/src/Text.android.tsx +475 -0
- package/src/Text.tsx +3 -0
- package/src/codegen-types.d.ts +39 -0
- package/src/index.ts +4 -0
- package/src/types.ts +3 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* Adapted for the OneKey Android native Text component.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* eslint-disable @react-native/no-deep-imports */
|
|
13
|
+
import * as ReactNativeFeatureFlags from 'react-native/src/private/featureflags/ReactNativeFeatureFlags';
|
|
14
|
+
import * as PressabilityDebug from 'react-native/Libraries/Pressability/PressabilityDebug';
|
|
15
|
+
import { Platform, StyleSheet, Text as ReactNativeText, processColor, unstable_TextAncestorContext as TextAncestorContext, usePressability } from 'react-native';
|
|
16
|
+
import { forwardRef, useContext, useMemo, useState } from 'react';
|
|
17
|
+
import OneKeyTextNativeComponent from "./OneKeyTextNativeHost.js";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
function useTextPressability({
|
|
20
|
+
onLongPress,
|
|
21
|
+
onPress,
|
|
22
|
+
onPressIn,
|
|
23
|
+
onPressOut,
|
|
24
|
+
onResponderGrant,
|
|
25
|
+
onResponderMove,
|
|
26
|
+
onResponderRelease,
|
|
27
|
+
onResponderTerminate,
|
|
28
|
+
onResponderTerminationRequest,
|
|
29
|
+
onStartShouldSetResponder,
|
|
30
|
+
pressRetentionOffset,
|
|
31
|
+
suppressHighlighting
|
|
32
|
+
}) {
|
|
33
|
+
const [isHighlighted, setHighlighted] = useState(false);
|
|
34
|
+
const config = useMemo(() => {
|
|
35
|
+
let processedOnPressIn = onPressIn;
|
|
36
|
+
let processedOnPressOut = onPressOut;
|
|
37
|
+
if (Platform.OS === 'ios') {
|
|
38
|
+
processedOnPressIn = event => {
|
|
39
|
+
setHighlighted(suppressHighlighting == null || !suppressHighlighting);
|
|
40
|
+
onPressIn?.(event);
|
|
41
|
+
};
|
|
42
|
+
processedOnPressOut = event => {
|
|
43
|
+
setHighlighted(false);
|
|
44
|
+
onPressOut?.(event);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
disabled: false,
|
|
49
|
+
pressRectOffset: pressRetentionOffset,
|
|
50
|
+
onLongPress,
|
|
51
|
+
onPress,
|
|
52
|
+
onPressIn: processedOnPressIn,
|
|
53
|
+
onPressOut: processedOnPressOut
|
|
54
|
+
};
|
|
55
|
+
}, [onLongPress, onPress, onPressIn, onPressOut, pressRetentionOffset, suppressHighlighting]);
|
|
56
|
+
const eventHandlers = usePressability(config);
|
|
57
|
+
const eventHandlersForText = useMemo(() => eventHandlers == null ? null : {
|
|
58
|
+
onResponderGrant(event) {
|
|
59
|
+
eventHandlers.onResponderGrant(event);
|
|
60
|
+
onResponderGrant?.(event);
|
|
61
|
+
},
|
|
62
|
+
onResponderMove(event) {
|
|
63
|
+
eventHandlers.onResponderMove(event);
|
|
64
|
+
onResponderMove?.(event);
|
|
65
|
+
},
|
|
66
|
+
onResponderRelease(event) {
|
|
67
|
+
eventHandlers.onResponderRelease(event);
|
|
68
|
+
onResponderRelease?.(event);
|
|
69
|
+
},
|
|
70
|
+
onResponderTerminate(event) {
|
|
71
|
+
eventHandlers.onResponderTerminate(event);
|
|
72
|
+
onResponderTerminate?.(event);
|
|
73
|
+
},
|
|
74
|
+
onClick: eventHandlers.onClick,
|
|
75
|
+
onResponderTerminationRequest: onResponderTerminationRequest ?? eventHandlers.onResponderTerminationRequest,
|
|
76
|
+
onStartShouldSetResponder: onStartShouldSetResponder ?? eventHandlers.onStartShouldSetResponder
|
|
77
|
+
}, [eventHandlers, onResponderGrant, onResponderMove, onResponderRelease, onResponderTerminate, onResponderTerminationRequest, onStartShouldSetResponder]);
|
|
78
|
+
return useMemo(() => [isHighlighted, eventHandlersForText], [isHighlighted, eventHandlersForText]);
|
|
79
|
+
}
|
|
80
|
+
const PressableText = /*#__PURE__*/forwardRef(function PressableText({
|
|
81
|
+
textPressabilityProps,
|
|
82
|
+
textProps
|
|
83
|
+
}, ref) {
|
|
84
|
+
const [isHighlighted, eventHandlersForText] = useTextPressability(textPressabilityProps);
|
|
85
|
+
return /*#__PURE__*/_jsx(OneKeyTextNativeComponent, {
|
|
86
|
+
...textProps,
|
|
87
|
+
...eventHandlersForText,
|
|
88
|
+
isHighlighted: isHighlighted,
|
|
89
|
+
isPressable: true,
|
|
90
|
+
ref: ref
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
function TextImpl({
|
|
94
|
+
accessible,
|
|
95
|
+
accessibilityLabel,
|
|
96
|
+
accessibilityRole,
|
|
97
|
+
accessibilityState,
|
|
98
|
+
allowFontScaling,
|
|
99
|
+
'aria-busy': ariaBusy,
|
|
100
|
+
'aria-checked': ariaChecked,
|
|
101
|
+
'aria-disabled': ariaDisabled,
|
|
102
|
+
'aria-expanded': ariaExpanded,
|
|
103
|
+
'aria-hidden': ariaHidden,
|
|
104
|
+
'aria-label': ariaLabel,
|
|
105
|
+
'aria-selected': ariaSelected,
|
|
106
|
+
children,
|
|
107
|
+
ellipsizeMode,
|
|
108
|
+
disabled,
|
|
109
|
+
id,
|
|
110
|
+
nativeID,
|
|
111
|
+
numberOfLines,
|
|
112
|
+
onLongPress,
|
|
113
|
+
onPress,
|
|
114
|
+
onPressIn,
|
|
115
|
+
onPressOut,
|
|
116
|
+
onResponderGrant,
|
|
117
|
+
onResponderMove,
|
|
118
|
+
onResponderRelease,
|
|
119
|
+
onResponderTerminate,
|
|
120
|
+
onResponderTerminationRequest,
|
|
121
|
+
onStartShouldSetResponder,
|
|
122
|
+
pressRetentionOffset,
|
|
123
|
+
role,
|
|
124
|
+
selectable,
|
|
125
|
+
selectionColor,
|
|
126
|
+
suppressHighlighting,
|
|
127
|
+
style,
|
|
128
|
+
...restProps
|
|
129
|
+
}, forwardedRef) {
|
|
130
|
+
const hasTextAncestor = useContext(TextAncestorContext);
|
|
131
|
+
if (hasTextAncestor) {
|
|
132
|
+
return /*#__PURE__*/_jsx(ReactNativeText, {
|
|
133
|
+
accessible,
|
|
134
|
+
accessibilityLabel,
|
|
135
|
+
accessibilityRole,
|
|
136
|
+
accessibilityState,
|
|
137
|
+
allowFontScaling,
|
|
138
|
+
'aria-busy': ariaBusy,
|
|
139
|
+
'aria-checked': ariaChecked,
|
|
140
|
+
'aria-disabled': ariaDisabled,
|
|
141
|
+
'aria-expanded': ariaExpanded,
|
|
142
|
+
'aria-hidden': ariaHidden,
|
|
143
|
+
'aria-label': ariaLabel,
|
|
144
|
+
'aria-selected': ariaSelected,
|
|
145
|
+
children,
|
|
146
|
+
disabled,
|
|
147
|
+
ellipsizeMode,
|
|
148
|
+
id,
|
|
149
|
+
nativeID,
|
|
150
|
+
numberOfLines,
|
|
151
|
+
onLongPress,
|
|
152
|
+
onPress,
|
|
153
|
+
onPressIn,
|
|
154
|
+
onPressOut,
|
|
155
|
+
onResponderGrant,
|
|
156
|
+
onResponderMove,
|
|
157
|
+
onResponderRelease,
|
|
158
|
+
onResponderTerminate,
|
|
159
|
+
onResponderTerminationRequest,
|
|
160
|
+
onStartShouldSetResponder,
|
|
161
|
+
pressRetentionOffset,
|
|
162
|
+
role,
|
|
163
|
+
selectable,
|
|
164
|
+
selectionColor,
|
|
165
|
+
style,
|
|
166
|
+
suppressHighlighting,
|
|
167
|
+
...restProps,
|
|
168
|
+
ref: forwardedRef
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const processedProps = {
|
|
172
|
+
...restProps
|
|
173
|
+
};
|
|
174
|
+
const processedAccessibilityLabel = ariaLabel ?? accessibilityLabel;
|
|
175
|
+
let processedAccessibilityState = accessibilityState;
|
|
176
|
+
if (ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) {
|
|
177
|
+
processedAccessibilityState = {
|
|
178
|
+
busy: ariaBusy ?? accessibilityState?.busy,
|
|
179
|
+
checked: ariaChecked ?? accessibilityState?.checked,
|
|
180
|
+
disabled: ariaDisabled ?? accessibilityState?.disabled,
|
|
181
|
+
expanded: ariaExpanded ?? accessibilityState?.expanded,
|
|
182
|
+
selected: ariaSelected ?? accessibilityState?.selected
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const accessibilityStateDisabled = processedAccessibilityState?.disabled;
|
|
186
|
+
const processedDisabled = disabled ?? accessibilityStateDisabled;
|
|
187
|
+
if (processedDisabled !== accessibilityStateDisabled && (processedDisabled != null && processedDisabled !== false || accessibilityStateDisabled != null && accessibilityStateDisabled !== false)) {
|
|
188
|
+
processedAccessibilityState = {
|
|
189
|
+
...processedAccessibilityState,
|
|
190
|
+
disabled: processedDisabled
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (ariaHidden !== undefined) {
|
|
194
|
+
processedProps.accessibilityElementsHidden = ariaHidden;
|
|
195
|
+
if (ariaHidden) {
|
|
196
|
+
processedProps.importantForAccessibility = 'no-hide-descendants';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const processedAccessible = accessible == null ? onPress != null || onLongPress != null : accessible;
|
|
200
|
+
const isPressable = (onPress != null || onLongPress != null || onStartShouldSetResponder != null) && processedDisabled !== true;
|
|
201
|
+
const shouldUseLinkRole = isPressable && accessibilityRole == null && role == null;
|
|
202
|
+
const processedAccessibilityRole = accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
203
|
+
const processedRole = shouldUseLinkRole ? undefined : role;
|
|
204
|
+
const processedSelectionColor = selectionColor != null ? processColor(selectionColor) : undefined;
|
|
205
|
+
let processedStyle = style;
|
|
206
|
+
if (__DEV__ && PressabilityDebug.isEnabled() && onPress != null) {
|
|
207
|
+
processedStyle = [style, {
|
|
208
|
+
color: 'magenta'
|
|
209
|
+
}];
|
|
210
|
+
}
|
|
211
|
+
let processedNumberOfLines = numberOfLines;
|
|
212
|
+
if (processedNumberOfLines != null && !(processedNumberOfLines >= 0)) {
|
|
213
|
+
if (__DEV__) {
|
|
214
|
+
console.error(`'numberOfLines' in <Text> must be a non-negative number, received: ${processedNumberOfLines}. The value will be set to 0.`);
|
|
215
|
+
}
|
|
216
|
+
processedNumberOfLines = 0;
|
|
217
|
+
}
|
|
218
|
+
let processedSelectable = selectable;
|
|
219
|
+
const flattenedStyle = StyleSheet.flatten(processedStyle);
|
|
220
|
+
if (flattenedStyle != null) {
|
|
221
|
+
let overrides;
|
|
222
|
+
if (typeof flattenedStyle.fontWeight === 'number') {
|
|
223
|
+
overrides = {
|
|
224
|
+
...overrides,
|
|
225
|
+
fontWeight: String(flattenedStyle.fontWeight)
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
if (flattenedStyle.userSelect != null) {
|
|
229
|
+
processedSelectable = userSelectToSelectableMap[flattenedStyle.userSelect];
|
|
230
|
+
overrides = {
|
|
231
|
+
...overrides,
|
|
232
|
+
userSelect: undefined
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (flattenedStyle.verticalAlign != null) {
|
|
236
|
+
overrides = {
|
|
237
|
+
...overrides,
|
|
238
|
+
textAlignVertical: verticalAlignToTextAlignVerticalMap[flattenedStyle.verticalAlign],
|
|
239
|
+
verticalAlign: undefined
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
if (overrides != null) {
|
|
243
|
+
processedStyle = [processedStyle, overrides];
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (ReactNativeFeatureFlags.defaultTextToOverflowHidden()) {
|
|
247
|
+
processedStyle = [styles.default, processedStyle];
|
|
248
|
+
}
|
|
249
|
+
const processedNativeID = id ?? nativeID;
|
|
250
|
+
if (processedAccessibilityLabel !== undefined) {
|
|
251
|
+
processedProps.accessibilityLabel = processedAccessibilityLabel;
|
|
252
|
+
}
|
|
253
|
+
if (processedAccessibilityRole !== undefined) {
|
|
254
|
+
processedProps.accessibilityRole = processedAccessibilityRole;
|
|
255
|
+
}
|
|
256
|
+
if (processedAccessibilityState !== undefined) {
|
|
257
|
+
processedProps.accessibilityState = processedAccessibilityState;
|
|
258
|
+
}
|
|
259
|
+
if (processedNativeID !== undefined) {
|
|
260
|
+
processedProps.nativeID = processedNativeID;
|
|
261
|
+
}
|
|
262
|
+
if (processedNumberOfLines !== undefined) {
|
|
263
|
+
processedProps.numberOfLines = processedNumberOfLines;
|
|
264
|
+
}
|
|
265
|
+
if (processedSelectable !== undefined) {
|
|
266
|
+
processedProps.selectable = processedSelectable;
|
|
267
|
+
}
|
|
268
|
+
if (processedStyle !== undefined) {
|
|
269
|
+
processedProps.style = processedStyle;
|
|
270
|
+
}
|
|
271
|
+
if (processedSelectionColor !== undefined) {
|
|
272
|
+
processedProps.selectionColor = processedSelectionColor;
|
|
273
|
+
}
|
|
274
|
+
if (processedRole !== undefined) {
|
|
275
|
+
processedProps.role = processedRole;
|
|
276
|
+
}
|
|
277
|
+
processedProps.accessible = processedAccessible;
|
|
278
|
+
processedProps.allowFontScaling = allowFontScaling !== false;
|
|
279
|
+
processedProps.disabled = processedDisabled;
|
|
280
|
+
processedProps.ellipsizeMode = ellipsizeMode ?? 'tail';
|
|
281
|
+
processedProps.children = children == null ? children : /*#__PURE__*/_jsx(TextAncestorContext.Provider, {
|
|
282
|
+
value: true,
|
|
283
|
+
children: /*#__PURE__*/_jsx(ReactNativeText, {
|
|
284
|
+
children: children
|
|
285
|
+
})
|
|
286
|
+
});
|
|
287
|
+
let nativeText;
|
|
288
|
+
if (isPressable) {
|
|
289
|
+
nativeText = /*#__PURE__*/_jsx(PressableText, {
|
|
290
|
+
ref: forwardedRef,
|
|
291
|
+
textProps: processedProps,
|
|
292
|
+
textPressabilityProps: {
|
|
293
|
+
onLongPress,
|
|
294
|
+
onPress,
|
|
295
|
+
onPressIn,
|
|
296
|
+
onPressOut,
|
|
297
|
+
onResponderGrant,
|
|
298
|
+
onResponderMove,
|
|
299
|
+
onResponderRelease,
|
|
300
|
+
onResponderTerminate,
|
|
301
|
+
onResponderTerminationRequest,
|
|
302
|
+
onStartShouldSetResponder,
|
|
303
|
+
pressRetentionOffset,
|
|
304
|
+
suppressHighlighting
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
} else {
|
|
308
|
+
nativeText = /*#__PURE__*/_jsx(OneKeyTextNativeComponent, {
|
|
309
|
+
...processedProps,
|
|
310
|
+
ref: forwardedRef
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return nativeText;
|
|
314
|
+
}
|
|
315
|
+
export const Text = /*#__PURE__*/forwardRef(TextImpl);
|
|
316
|
+
Text.displayName = 'Text';
|
|
317
|
+
const userSelectToSelectableMap = {
|
|
318
|
+
all: true,
|
|
319
|
+
auto: true,
|
|
320
|
+
contain: true,
|
|
321
|
+
none: false,
|
|
322
|
+
text: true
|
|
323
|
+
};
|
|
324
|
+
const verticalAlignToTextAlignVerticalMap = {
|
|
325
|
+
auto: 'auto',
|
|
326
|
+
bottom: 'bottom',
|
|
327
|
+
middle: 'center',
|
|
328
|
+
top: 'top'
|
|
329
|
+
};
|
|
330
|
+
const styles = StyleSheet.create({
|
|
331
|
+
default: {
|
|
332
|
+
overflow: 'hidden'
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
//# sourceMappingURL=Text.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ColorValue, type HostComponent, type ViewProps } from 'react-native';
|
|
2
|
+
import type { DirectEventHandler, Float, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface NativeProps extends ViewProps {
|
|
4
|
+
adjustsFontSizeToFit?: WithDefault<boolean, false>;
|
|
5
|
+
allowFontScaling?: WithDefault<boolean, true>;
|
|
6
|
+
android_hyphenationFrequency?: WithDefault<'full' | 'none' | 'normal', 'none'>;
|
|
7
|
+
color?: ColorValue;
|
|
8
|
+
dataDetectorType?: WithDefault<'all' | 'email' | 'link' | 'none' | 'phoneNumber', 'none'>;
|
|
9
|
+
disabled?: WithDefault<boolean, false>;
|
|
10
|
+
dynamicTypeRamp?: WithDefault<'body' | 'callout' | 'caption1' | 'caption2' | 'footnote' | 'headline' | 'largeTitle' | 'subheadline' | 'title1' | 'title2' | 'title3', 'body'>;
|
|
11
|
+
ellipsizeMode?: WithDefault<'clip' | 'head' | 'middle' | 'tail', 'tail'>;
|
|
12
|
+
fontFamily?: string;
|
|
13
|
+
fontSize?: Float;
|
|
14
|
+
fontStyle?: WithDefault<'italic' | 'normal', 'normal'>;
|
|
15
|
+
fontVariant?: ReadonlyArray<string>;
|
|
16
|
+
fontWeight?: string;
|
|
17
|
+
includeFontPadding?: WithDefault<boolean, true>;
|
|
18
|
+
isHighlighted?: WithDefault<boolean, false>;
|
|
19
|
+
isPressable?: WithDefault<boolean, false>;
|
|
20
|
+
letterSpacing?: Float;
|
|
21
|
+
lineBreakModeIOS?: WithDefault<'char' | 'clip' | 'head' | 'middle' | 'tail' | 'word', 'tail'>;
|
|
22
|
+
lineBreakStrategyIOS?: WithDefault<'hangul-word' | 'none' | 'push-out' | 'standard', 'none'>;
|
|
23
|
+
lineHeight?: Float;
|
|
24
|
+
maxFontSizeMultiplier?: Float;
|
|
25
|
+
minimumFontScale?: Float;
|
|
26
|
+
numberOfLines?: WithDefault<Int32, 0>;
|
|
27
|
+
onTextLayout?: DirectEventHandler<Readonly<{}>>;
|
|
28
|
+
selectable?: WithDefault<boolean, false>;
|
|
29
|
+
selectionColor?: ColorValue;
|
|
30
|
+
textAlign?: WithDefault<'auto' | 'center' | 'justify' | 'left' | 'right', 'auto'>;
|
|
31
|
+
textAlignVertical?: WithDefault<'auto' | 'bottom' | 'center' | 'top', 'auto'>;
|
|
32
|
+
textBreakStrategy?: WithDefault<'balanced' | 'highQuality' | 'simple', 'highQuality'>;
|
|
33
|
+
textDecorationColor?: ColorValue;
|
|
34
|
+
textDecorationLine?: WithDefault<'line-through' | 'none' | 'underline' | 'underline line-through', 'none'>;
|
|
35
|
+
textDecorationStyle?: WithDefault<'dashed' | 'dotted' | 'double' | 'solid', 'solid'>;
|
|
36
|
+
textShadowColor?: ColorValue;
|
|
37
|
+
textShadowOffset?: Readonly<{
|
|
38
|
+
height: Float;
|
|
39
|
+
width: Float;
|
|
40
|
+
}>;
|
|
41
|
+
textShadowRadius?: Float;
|
|
42
|
+
textTransform?: WithDefault<'capitalize' | 'lowercase' | 'none' | 'uppercase', 'none'>;
|
|
43
|
+
writingDirection?: WithDefault<'auto' | 'ltr' | 'rtl', 'auto'>;
|
|
44
|
+
}
|
|
45
|
+
declare const _default: HostComponent<NativeProps>;
|
|
46
|
+
export default _default;
|
|
47
|
+
//# sourceMappingURL=OneKeyTextNativeComponent.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { NativeProps } from './OneKeyTextNativeComponent';
|
|
3
|
+
export declare const ONEKEY_TEXT_VIEW_CONFIG: {
|
|
4
|
+
readonly validAttributes: {
|
|
5
|
+
readonly isHighlighted: true;
|
|
6
|
+
readonly isPressable: true;
|
|
7
|
+
readonly numberOfLines: true;
|
|
8
|
+
readonly ellipsizeMode: true;
|
|
9
|
+
readonly allowFontScaling: true;
|
|
10
|
+
readonly dynamicTypeRamp: true;
|
|
11
|
+
readonly maxFontSizeMultiplier: true;
|
|
12
|
+
readonly disabled: true;
|
|
13
|
+
readonly selectable: true;
|
|
14
|
+
readonly selectionColor: true;
|
|
15
|
+
readonly adjustsFontSizeToFit: true;
|
|
16
|
+
readonly minimumFontScale: true;
|
|
17
|
+
readonly textBreakStrategy: true;
|
|
18
|
+
readonly onTextLayout: true;
|
|
19
|
+
readonly dataDetectorType: true;
|
|
20
|
+
readonly android_hyphenationFrequency: true;
|
|
21
|
+
readonly lineBreakStrategyIOS: true;
|
|
22
|
+
};
|
|
23
|
+
readonly directEventTypes: {
|
|
24
|
+
readonly topTextLayout: {
|
|
25
|
+
readonly registrationName: "onTextLayout";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly uiViewClassName: "OneKeyText";
|
|
29
|
+
};
|
|
30
|
+
declare const OneKeyTextNativeHost: HostComponent<NativeProps>;
|
|
31
|
+
export default OneKeyTextNativeHost;
|
|
32
|
+
//# sourceMappingURL=OneKeyTextNativeHost.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* Adapted for the OneKey Android native Text component.
|
|
8
|
+
*/
|
|
9
|
+
import { type GestureResponderEvent } from 'react-native';
|
|
10
|
+
export declare const Text: import("react").ForwardRefExoticComponent<Readonly<Omit<Readonly<{
|
|
11
|
+
onPointerEnter?: (event: import("react-native").PointerEvent) => void;
|
|
12
|
+
onPointerLeave?: (event: import("react-native").PointerEvent) => void;
|
|
13
|
+
onPointerMove?: (event: import("react-native").PointerEvent) => void;
|
|
14
|
+
}>, "onMoveShouldSetResponder" | "onResponderGrant" | "onResponderMove" | "onResponderRelease" | "onResponderTerminate" | "onResponderTerminationRequest" | "onStartShouldSetResponder" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "id" | "testID" | "nativeID" | "onAccessibilityAction" | "onLayout" | "adjustsFontSizeToFit" | "allowFontScaling" | "android_hyphenationFrequency" | "dataDetectorType" | "disabled" | "dynamicTypeRamp" | "ellipsizeMode" | "lineBreakStrategyIOS" | "maxFontSizeMultiplier" | "minimumFontScale" | "numberOfLines" | "onTextLayout" | "selectable" | "selectionColor" | "textBreakStrategy" | "suppressHighlighting" | "onLongPress" | "onPress" | "onPressIn" | "onPressOut" | "pressRetentionOffset"> & Omit<import("react-native/types_generated/Libraries/Text/TextProps").TextPropsIOS, "onMoveShouldSetResponder" | "onResponderGrant" | "onResponderMove" | "onResponderRelease" | "onResponderTerminate" | "onResponderTerminationRequest" | "onStartShouldSetResponder" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "id" | "testID" | "nativeID" | "onAccessibilityAction" | "onLayout" | "allowFontScaling" | "android_hyphenationFrequency" | "ellipsizeMode" | "maxFontSizeMultiplier" | "numberOfLines" | "onTextLayout" | "selectable" | keyof import("react-native/types_generated/Libraries/Text/TextProps").TextPropsAndroid | "onLongPress" | "onPress" | "onPressIn" | "onPressOut" | "pressRetentionOffset"> & Omit<import("react-native/types_generated/Libraries/Text/TextProps").TextPropsAndroid, "onMoveShouldSetResponder" | "onResponderGrant" | "onResponderMove" | "onResponderRelease" | "onResponderTerminate" | "onResponderTerminationRequest" | "onStartShouldSetResponder" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "id" | "testID" | "nativeID" | "onAccessibilityAction" | "onLayout" | "allowFontScaling" | "android_hyphenationFrequency" | "ellipsizeMode" | "maxFontSizeMultiplier" | "numberOfLines" | "onTextLayout" | "selectable" | "onLongPress" | "onPress" | "onPressIn" | "onPressOut" | "pressRetentionOffset"> & Omit<Readonly<{
|
|
15
|
+
onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => unknown) | undefined;
|
|
16
|
+
allowFontScaling?: boolean | undefined;
|
|
17
|
+
android_hyphenationFrequency?: ("normal" | "none" | "full") | undefined;
|
|
18
|
+
children?: React.ReactNode | undefined;
|
|
19
|
+
ellipsizeMode?: ("clip" | "head" | "middle" | "tail") | undefined;
|
|
20
|
+
id?: string;
|
|
21
|
+
maxFontSizeMultiplier?: number | undefined;
|
|
22
|
+
nativeID?: string | undefined;
|
|
23
|
+
numberOfLines?: number | undefined;
|
|
24
|
+
onLayout?: ((event: import("react-native").LayoutChangeEvent) => unknown) | undefined;
|
|
25
|
+
onLongPress?: ((event: GestureResponderEvent) => unknown) | undefined;
|
|
26
|
+
onPress?: ((event: GestureResponderEvent) => unknown) | undefined;
|
|
27
|
+
onPressIn?: ((event: GestureResponderEvent) => unknown) | undefined;
|
|
28
|
+
onPressOut?: ((event: GestureResponderEvent) => unknown) | undefined;
|
|
29
|
+
onResponderGrant?: ((event: GestureResponderEvent) => void) | undefined;
|
|
30
|
+
onResponderMove?: ((event: GestureResponderEvent) => void) | undefined;
|
|
31
|
+
onResponderRelease?: ((event: GestureResponderEvent) => void) | undefined;
|
|
32
|
+
onResponderTerminate?: ((event: GestureResponderEvent) => void) | undefined;
|
|
33
|
+
onResponderTerminationRequest?: (() => boolean) | undefined;
|
|
34
|
+
onStartShouldSetResponder?: (() => boolean) | undefined;
|
|
35
|
+
onMoveShouldSetResponder?: (() => boolean) | undefined;
|
|
36
|
+
onTextLayout?: ((event: import("react-native").TextLayoutEvent) => unknown) | undefined;
|
|
37
|
+
pressRetentionOffset?: import("react-native/types_generated/Libraries/Text/TextProps").PressRetentionOffset | undefined;
|
|
38
|
+
role?: import("react-native").Role | undefined;
|
|
39
|
+
selectable?: boolean | undefined;
|
|
40
|
+
style?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheet").TextStyleProp | undefined;
|
|
41
|
+
testID?: string | undefined;
|
|
42
|
+
}>, "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable"> & Omit<Readonly<Omit<Readonly<{
|
|
43
|
+
accessibilityLabelledBy?: (string | undefined) | (Array<string> | undefined);
|
|
44
|
+
"aria-labelledby"?: string | undefined;
|
|
45
|
+
accessibilityLiveRegion?: ("none" | "polite" | "assertive") | undefined;
|
|
46
|
+
"aria-live"?: ("polite" | "assertive" | "off") | undefined;
|
|
47
|
+
importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined;
|
|
48
|
+
screenReaderFocusable?: boolean;
|
|
49
|
+
}>, "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden"> & Omit<Readonly<{
|
|
50
|
+
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
51
|
+
accessibilityViewIsModal?: boolean | undefined;
|
|
52
|
+
accessibilityShowsLargeContentViewer?: boolean | undefined;
|
|
53
|
+
accessibilityLargeContentTitle?: string | undefined;
|
|
54
|
+
"aria-modal"?: boolean | undefined;
|
|
55
|
+
accessibilityElementsHidden?: boolean | undefined;
|
|
56
|
+
accessibilityLanguage?: string | undefined;
|
|
57
|
+
accessibilityRespondsToUserInteraction?: boolean | undefined;
|
|
58
|
+
}>, "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden"> & {
|
|
59
|
+
accessible?: boolean | undefined;
|
|
60
|
+
accessibilityLabel?: string | undefined;
|
|
61
|
+
accessibilityHint?: string | undefined;
|
|
62
|
+
"aria-label"?: string | undefined;
|
|
63
|
+
accessibilityRole?: import("react-native").AccessibilityRole | undefined;
|
|
64
|
+
role?: import("react-native").Role | undefined;
|
|
65
|
+
accessibilityState?: import("react-native").AccessibilityState | undefined;
|
|
66
|
+
accessibilityValue?: import("react-native").AccessibilityValue | undefined;
|
|
67
|
+
"aria-valuemax"?: import("react-native").AccessibilityValue["max"] | undefined;
|
|
68
|
+
"aria-valuemin"?: import("react-native").AccessibilityValue["min"] | undefined;
|
|
69
|
+
"aria-valuenow"?: import("react-native").AccessibilityValue["now"] | undefined;
|
|
70
|
+
"aria-valuetext"?: import("react-native").AccessibilityValue["text"] | undefined;
|
|
71
|
+
accessibilityActions?: ReadonlyArray<import("react-native/types_generated/Libraries/Components/View/ViewAccessibility").AccessibilityActionInfo> | undefined;
|
|
72
|
+
"aria-busy"?: boolean | undefined;
|
|
73
|
+
"aria-checked"?: (boolean | undefined) | "mixed";
|
|
74
|
+
"aria-disabled"?: boolean | undefined;
|
|
75
|
+
"aria-expanded"?: boolean | undefined;
|
|
76
|
+
"aria-selected"?: boolean | undefined;
|
|
77
|
+
"aria-hidden"?: boolean | undefined;
|
|
78
|
+
}>, never>> & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
79
|
+
//# sourceMappingURL=Text.android.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const Text: (props: Omit<import("react-native").TextProps, keyof {
|
|
2
|
+
ref?: React.Ref<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>;
|
|
3
|
+
}> & {
|
|
4
|
+
ref?: React.Ref<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>;
|
|
5
|
+
}) => React.ReactNode;
|
|
6
|
+
//# sourceMappingURL=Text.d.ts.map
|