@react-navigation/native-stack 7.20.0 → 7.21.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.
- package/lib/module/views/NativeStackView.js +94 -74
- package/lib/module/views/NativeStackView.js.map +1 -1
- package/lib/module/views/NativeStackView.native.js +93 -93
- package/lib/module/views/NativeStackView.native.js.map +1 -1
- package/lib/module/views/useHeaderConfigProps.js +13 -3
- package/lib/module/views/useHeaderConfigProps.js.map +1 -1
- package/lib/typescript/src/types.d.ts +38 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/src/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/src/views/useHeaderConfigProps.d.ts +1 -1
- package/lib/typescript/src/views/useHeaderConfigProps.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/types.tsx +38 -0
- package/src/views/NativeStackView.native.tsx +106 -100
- package/src/views/NativeStackView.tsx +143 -109
- package/src/views/useHeaderConfigProps.tsx +31 -13
- package/lib/module/views/FontProcessor.js +0 -6
- package/lib/module/views/FontProcessor.js.map +0 -1
- package/lib/module/views/FontProcessor.native.js +0 -12
- package/lib/module/views/FontProcessor.native.js.map +0 -1
- package/lib/typescript/src/views/FontProcessor.d.ts +0 -2
- package/lib/typescript/src/views/FontProcessor.d.ts.map +0 -1
- package/lib/typescript/src/views/FontProcessor.native.d.ts +0 -2
- package/lib/typescript/src/views/FontProcessor.native.d.ts.map +0 -1
- package/src/views/FontProcessor.native.tsx +0 -12
- package/src/views/FontProcessor.tsx +0 -5
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useHeaderHeight,
|
|
9
9
|
} from '@react-navigation/elements';
|
|
10
10
|
import {
|
|
11
|
+
type NavigationRoute,
|
|
11
12
|
type ParamListBase,
|
|
12
13
|
type RouteProp,
|
|
13
14
|
type StackNavigationState,
|
|
@@ -59,37 +60,9 @@ export function NativeStackView({ state, descriptors, describe }: Props) {
|
|
|
59
60
|
? descriptors[previousKey]
|
|
60
61
|
: undefined;
|
|
61
62
|
const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
|
|
62
|
-
const
|
|
63
|
+
const descriptor =
|
|
63
64
|
descriptors[route.key] ?? preloadedDescriptors[route.key];
|
|
64
65
|
|
|
65
|
-
const headerBack = previousDescriptor
|
|
66
|
-
? {
|
|
67
|
-
title: getHeaderTitle(
|
|
68
|
-
previousDescriptor.options,
|
|
69
|
-
previousDescriptor.route.name
|
|
70
|
-
),
|
|
71
|
-
href: buildHref(
|
|
72
|
-
previousDescriptor.route.name,
|
|
73
|
-
previousDescriptor.route.params
|
|
74
|
-
),
|
|
75
|
-
}
|
|
76
|
-
: parentHeaderBack;
|
|
77
|
-
|
|
78
|
-
const canGoBack = headerBack != null;
|
|
79
|
-
|
|
80
|
-
const {
|
|
81
|
-
header,
|
|
82
|
-
headerShown,
|
|
83
|
-
headerBackIcon,
|
|
84
|
-
headerBackImageSource,
|
|
85
|
-
headerLeft,
|
|
86
|
-
headerTransparent,
|
|
87
|
-
headerBackTitle,
|
|
88
|
-
presentation,
|
|
89
|
-
contentStyle,
|
|
90
|
-
...rest
|
|
91
|
-
} = options;
|
|
92
|
-
|
|
93
66
|
const nextPresentation = nextDescriptor?.options.presentation;
|
|
94
67
|
|
|
95
68
|
const isPreloaded =
|
|
@@ -97,95 +70,156 @@ export function NativeStackView({ state, descriptors, describe }: Props) {
|
|
|
97
70
|
descriptors[route.key] === undefined;
|
|
98
71
|
|
|
99
72
|
return (
|
|
100
|
-
<
|
|
73
|
+
<SceneView
|
|
101
74
|
key={route.key}
|
|
102
|
-
focused={isFocused}
|
|
103
75
|
route={route}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
})
|
|
115
|
-
) : (
|
|
116
|
-
<Header
|
|
117
|
-
{...rest}
|
|
118
|
-
back={headerBack}
|
|
119
|
-
title={getHeaderTitle(options, route.name)}
|
|
120
|
-
headerLeft={
|
|
121
|
-
typeof headerLeft === 'function'
|
|
122
|
-
? ({ label, ...rest }) =>
|
|
123
|
-
headerLeft({
|
|
124
|
-
...rest,
|
|
125
|
-
label: headerBackTitle ?? label,
|
|
126
|
-
})
|
|
127
|
-
: headerLeft === undefined && canGoBack
|
|
128
|
-
? ({ tintColor, label, ...rest }) => (
|
|
129
|
-
<HeaderBackButton
|
|
130
|
-
{...rest}
|
|
131
|
-
label={headerBackTitle ?? label}
|
|
132
|
-
tintColor={tintColor}
|
|
133
|
-
backImage={
|
|
134
|
-
headerBackIcon !== undefined ||
|
|
135
|
-
headerBackImageSource !== undefined
|
|
136
|
-
? () => (
|
|
137
|
-
<Image
|
|
138
|
-
source={
|
|
139
|
-
headerBackIcon?.source ??
|
|
140
|
-
headerBackImageSource
|
|
141
|
-
}
|
|
142
|
-
resizeMode="contain"
|
|
143
|
-
tintColor={tintColor}
|
|
144
|
-
style={styles.backImage}
|
|
145
|
-
/>
|
|
146
|
-
)
|
|
147
|
-
: undefined
|
|
148
|
-
}
|
|
149
|
-
onPress={navigation.goBack}
|
|
150
|
-
/>
|
|
151
|
-
)
|
|
152
|
-
: headerLeft
|
|
153
|
-
}
|
|
154
|
-
headerTransparent={headerTransparent}
|
|
155
|
-
/>
|
|
156
|
-
)
|
|
76
|
+
descriptor={descriptor}
|
|
77
|
+
previousDescriptor={previousDescriptor}
|
|
78
|
+
parentHeaderBack={parentHeaderBack}
|
|
79
|
+
buildHref={buildHref}
|
|
80
|
+
focused={isFocused}
|
|
81
|
+
visible={
|
|
82
|
+
(isFocused ||
|
|
83
|
+
(nextPresentation != null &&
|
|
84
|
+
TRANSPARENT_PRESENTATIONS.includes(nextPresentation))) &&
|
|
85
|
+
!isPreloaded
|
|
157
86
|
}
|
|
158
|
-
|
|
159
|
-
StyleSheet.absoluteFill,
|
|
160
|
-
{
|
|
161
|
-
display:
|
|
162
|
-
(isFocused ||
|
|
163
|
-
(nextPresentation != null &&
|
|
164
|
-
TRANSPARENT_PRESENTATIONS.includes(nextPresentation))) &&
|
|
165
|
-
!isPreloaded
|
|
166
|
-
? 'flex'
|
|
167
|
-
: 'none',
|
|
168
|
-
},
|
|
169
|
-
presentation != null &&
|
|
170
|
-
TRANSPARENT_PRESENTATIONS.includes(presentation)
|
|
171
|
-
? { backgroundColor: 'transparent' }
|
|
172
|
-
: null,
|
|
173
|
-
]}
|
|
174
|
-
>
|
|
175
|
-
<HeaderBackContext.Provider value={headerBack}>
|
|
176
|
-
<AnimatedHeaderHeightProvider>
|
|
177
|
-
<View style={[styles.contentContainer, contentStyle]}>
|
|
178
|
-
{render()}
|
|
179
|
-
</View>
|
|
180
|
-
</AnimatedHeaderHeightProvider>
|
|
181
|
-
</HeaderBackContext.Provider>
|
|
182
|
-
</Screen>
|
|
87
|
+
/>
|
|
183
88
|
);
|
|
184
89
|
})}
|
|
185
90
|
</SafeAreaProviderCompat>
|
|
186
91
|
);
|
|
187
92
|
}
|
|
188
93
|
|
|
94
|
+
type SceneViewProps = {
|
|
95
|
+
route: NavigationRoute<ParamListBase, string>;
|
|
96
|
+
descriptor: NativeStackDescriptor;
|
|
97
|
+
previousDescriptor: NativeStackDescriptor | undefined;
|
|
98
|
+
parentHeaderBack: React.ContextType<typeof HeaderBackContext>;
|
|
99
|
+
buildHref: ReturnType<typeof useLinkBuilder>['buildHref'];
|
|
100
|
+
focused: boolean;
|
|
101
|
+
visible: boolean;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const SceneView = React.memo(function SceneView({
|
|
105
|
+
route,
|
|
106
|
+
descriptor,
|
|
107
|
+
previousDescriptor,
|
|
108
|
+
parentHeaderBack,
|
|
109
|
+
buildHref,
|
|
110
|
+
focused,
|
|
111
|
+
visible,
|
|
112
|
+
}: SceneViewProps) {
|
|
113
|
+
const { options, navigation, render } = descriptor;
|
|
114
|
+
|
|
115
|
+
const headerBack = previousDescriptor
|
|
116
|
+
? {
|
|
117
|
+
title: getHeaderTitle(
|
|
118
|
+
previousDescriptor.options,
|
|
119
|
+
previousDescriptor.route.name
|
|
120
|
+
),
|
|
121
|
+
href: buildHref(
|
|
122
|
+
previousDescriptor.route.name,
|
|
123
|
+
previousDescriptor.route.params
|
|
124
|
+
),
|
|
125
|
+
}
|
|
126
|
+
: parentHeaderBack;
|
|
127
|
+
|
|
128
|
+
const canGoBack = headerBack != null;
|
|
129
|
+
|
|
130
|
+
const {
|
|
131
|
+
header,
|
|
132
|
+
headerShown,
|
|
133
|
+
headerBackIcon,
|
|
134
|
+
headerBackImageSource,
|
|
135
|
+
headerLeft,
|
|
136
|
+
headerTransparent,
|
|
137
|
+
headerBackTitle,
|
|
138
|
+
presentation,
|
|
139
|
+
contentStyle,
|
|
140
|
+
...rest
|
|
141
|
+
} = options;
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Screen
|
|
145
|
+
key={route.key}
|
|
146
|
+
focused={focused}
|
|
147
|
+
route={route}
|
|
148
|
+
navigation={navigation}
|
|
149
|
+
headerShown={headerShown}
|
|
150
|
+
headerTransparent={headerTransparent}
|
|
151
|
+
header={
|
|
152
|
+
header !== undefined ? (
|
|
153
|
+
header({
|
|
154
|
+
back: headerBack,
|
|
155
|
+
options,
|
|
156
|
+
route,
|
|
157
|
+
navigation,
|
|
158
|
+
})
|
|
159
|
+
) : (
|
|
160
|
+
<Header
|
|
161
|
+
{...rest}
|
|
162
|
+
back={headerBack}
|
|
163
|
+
title={getHeaderTitle(options, route.name)}
|
|
164
|
+
headerLeft={
|
|
165
|
+
typeof headerLeft === 'function'
|
|
166
|
+
? ({ label, ...rest }) =>
|
|
167
|
+
headerLeft({
|
|
168
|
+
...rest,
|
|
169
|
+
label: headerBackTitle ?? label,
|
|
170
|
+
})
|
|
171
|
+
: headerLeft === undefined && canGoBack
|
|
172
|
+
? ({ tintColor, label, ...rest }) => (
|
|
173
|
+
<HeaderBackButton
|
|
174
|
+
{...rest}
|
|
175
|
+
label={headerBackTitle ?? label}
|
|
176
|
+
tintColor={tintColor}
|
|
177
|
+
backImage={
|
|
178
|
+
headerBackIcon !== undefined ||
|
|
179
|
+
headerBackImageSource !== undefined
|
|
180
|
+
? () => (
|
|
181
|
+
<Image
|
|
182
|
+
source={
|
|
183
|
+
headerBackIcon?.source ??
|
|
184
|
+
headerBackImageSource
|
|
185
|
+
}
|
|
186
|
+
resizeMode="contain"
|
|
187
|
+
tintColor={tintColor}
|
|
188
|
+
style={styles.backImage}
|
|
189
|
+
/>
|
|
190
|
+
)
|
|
191
|
+
: undefined
|
|
192
|
+
}
|
|
193
|
+
onPress={navigation.goBack}
|
|
194
|
+
/>
|
|
195
|
+
)
|
|
196
|
+
: headerLeft
|
|
197
|
+
}
|
|
198
|
+
headerTransparent={headerTransparent}
|
|
199
|
+
/>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
style={[
|
|
203
|
+
StyleSheet.absoluteFill,
|
|
204
|
+
{
|
|
205
|
+
display: visible ? 'flex' : 'none',
|
|
206
|
+
},
|
|
207
|
+
presentation != null && TRANSPARENT_PRESENTATIONS.includes(presentation)
|
|
208
|
+
? { backgroundColor: 'transparent' }
|
|
209
|
+
: null,
|
|
210
|
+
]}
|
|
211
|
+
>
|
|
212
|
+
<HeaderBackContext.Provider value={headerBack}>
|
|
213
|
+
<AnimatedHeaderHeightProvider>
|
|
214
|
+
<View style={[styles.contentContainer, contentStyle]}>
|
|
215
|
+
{render()}
|
|
216
|
+
</View>
|
|
217
|
+
</AnimatedHeaderHeightProvider>
|
|
218
|
+
</HeaderBackContext.Provider>
|
|
219
|
+
</Screen>
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
|
|
189
223
|
const AnimatedHeaderHeightProvider = ({
|
|
190
224
|
children,
|
|
191
225
|
}: {
|
|
@@ -10,6 +10,7 @@ import { Platform, StyleSheet, type TextStyle, View } from 'react-native';
|
|
|
10
10
|
import {
|
|
11
11
|
type HeaderBarButtonItemMenuAction,
|
|
12
12
|
type HeaderBarButtonItemSubmenu,
|
|
13
|
+
type HeaderBarButtonItemVisibilityPriority,
|
|
13
14
|
type HeaderBarButtonItemWithAction,
|
|
14
15
|
type HeaderBarButtonItemWithMenu,
|
|
15
16
|
isSearchBarAvailableForCurrentPlatform,
|
|
@@ -29,7 +30,6 @@ import type {
|
|
|
29
30
|
NativeStackHeaderItemMenuSubmenu,
|
|
30
31
|
NativeStackNavigationOptions,
|
|
31
32
|
} from '../types';
|
|
32
|
-
import { processFonts } from './FontProcessor';
|
|
33
33
|
|
|
34
34
|
type Props = NativeStackNavigationOptions & {
|
|
35
35
|
headerTopInsetEnabled: boolean;
|
|
@@ -71,7 +71,13 @@ const processBarButtonItems = (
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
const { badge, label, labelStyle, icon, ...rest } =
|
|
74
|
+
const { badge, label, labelStyle, icon, visibilityPriority, ...rest } =
|
|
75
|
+
item;
|
|
76
|
+
|
|
77
|
+
const processedVisibilityPriority:
|
|
78
|
+
| HeaderBarButtonItemVisibilityPriority
|
|
79
|
+
| undefined =
|
|
80
|
+
visibilityPriority === 'default' ? 'standard' : visibilityPriority;
|
|
75
81
|
|
|
76
82
|
const processedItemCommon = {
|
|
77
83
|
...rest,
|
|
@@ -82,6 +88,7 @@ const processBarButtonItems = (
|
|
|
82
88
|
...labelStyle,
|
|
83
89
|
},
|
|
84
90
|
icon: transformIcon(icon),
|
|
91
|
+
visibilityPriority: processedVisibilityPriority,
|
|
85
92
|
};
|
|
86
93
|
|
|
87
94
|
let processedItem:
|
|
@@ -164,13 +171,22 @@ const getMenuItem = (
|
|
|
164
171
|
item: NativeStackHeaderItemMenuAction | NativeStackHeaderItemMenuSubmenu
|
|
165
172
|
): HeaderBarButtonItemMenuAction | HeaderBarButtonItemSubmenu => {
|
|
166
173
|
if (item.type === 'submenu') {
|
|
167
|
-
const {
|
|
168
|
-
|
|
174
|
+
const {
|
|
175
|
+
label,
|
|
176
|
+
description,
|
|
177
|
+
icon,
|
|
178
|
+
inline,
|
|
179
|
+
layout,
|
|
180
|
+
items,
|
|
181
|
+
multiselectable,
|
|
182
|
+
...rest
|
|
183
|
+
} = item;
|
|
169
184
|
|
|
170
185
|
return {
|
|
171
186
|
...rest,
|
|
172
187
|
icon: transformIcon(icon),
|
|
173
188
|
title: label,
|
|
189
|
+
subtitle: description,
|
|
174
190
|
displayAsPalette: layout === 'palette',
|
|
175
191
|
displayInline: inline,
|
|
176
192
|
singleSelection:
|
|
@@ -205,7 +221,9 @@ export function useHeaderConfigProps({
|
|
|
205
221
|
headerLargeTitleStyle,
|
|
206
222
|
headerBackground,
|
|
207
223
|
headerLeft,
|
|
224
|
+
headerLeftBackgroundVisible,
|
|
208
225
|
headerRight,
|
|
226
|
+
headerRightBackgroundVisible,
|
|
209
227
|
headerShown,
|
|
210
228
|
headerStyle,
|
|
211
229
|
headerBlurEffect,
|
|
@@ -253,17 +271,11 @@ export function useHeaderConfigProps({
|
|
|
253
271
|
? 'transparent'
|
|
254
272
|
: colors.card);
|
|
255
273
|
|
|
256
|
-
const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] =
|
|
257
|
-
processFonts([
|
|
258
|
-
headerBackTitleStyleFlattened.fontFamily,
|
|
259
|
-
headerLargeTitleStyleFlattened.fontFamily,
|
|
260
|
-
headerTitleStyleFlattened.fontFamily,
|
|
261
|
-
]);
|
|
262
|
-
|
|
263
274
|
const backTitleFontSize =
|
|
264
275
|
'fontSize' in headerBackTitleStyleFlattened
|
|
265
276
|
? headerBackTitleStyleFlattened.fontSize
|
|
266
277
|
: undefined;
|
|
278
|
+
const backTitleFontFamily = headerBackTitleStyleFlattened.fontFamily;
|
|
267
279
|
|
|
268
280
|
const titleText = getHeaderTitle({ title, headerTitle }, route.name);
|
|
269
281
|
const titleColor =
|
|
@@ -281,6 +293,7 @@ export function useHeaderConfigProps({
|
|
|
281
293
|
? headerTitleStyleFlattened.fontSize
|
|
282
294
|
: undefined;
|
|
283
295
|
const titleFontWeight = headerTitleStyleFlattened.fontWeight;
|
|
296
|
+
const titleFontFamily = headerTitleStyleFlattened.fontFamily;
|
|
284
297
|
|
|
285
298
|
const largeTitleBackgroundColor = headerLargeStyleFlattened.backgroundColor;
|
|
286
299
|
const largeTitleColor =
|
|
@@ -292,6 +305,7 @@ export function useHeaderConfigProps({
|
|
|
292
305
|
? headerLargeTitleStyleFlattened.fontSize
|
|
293
306
|
: undefined;
|
|
294
307
|
const largeTitleFontWeight = headerLargeTitleStyleFlattened.fontWeight;
|
|
308
|
+
const largeTitleFontFamily = headerLargeTitleStyleFlattened.fontFamily;
|
|
295
309
|
|
|
296
310
|
const headerTitleStyleSupported: TextStyle = { color: titleColor };
|
|
297
311
|
|
|
@@ -407,7 +421,9 @@ export function useHeaderConfigProps({
|
|
|
407
421
|
return null;
|
|
408
422
|
})
|
|
409
423
|
) : headerLeftElement != null ? (
|
|
410
|
-
<ScreenStackHeaderLeftView
|
|
424
|
+
<ScreenStackHeaderLeftView
|
|
425
|
+
hidesSharedBackground={headerLeftBackgroundVisible === false}
|
|
426
|
+
>
|
|
411
427
|
{headerLeftElement}
|
|
412
428
|
</ScreenStackHeaderLeftView>
|
|
413
429
|
) : null}
|
|
@@ -481,7 +497,9 @@ export function useHeaderConfigProps({
|
|
|
481
497
|
return null;
|
|
482
498
|
})
|
|
483
499
|
) : headerRightElement != null ? (
|
|
484
|
-
<ScreenStackHeaderRightView
|
|
500
|
+
<ScreenStackHeaderRightView
|
|
501
|
+
hidesSharedBackground={headerRightBackgroundVisible === false}
|
|
502
|
+
>
|
|
485
503
|
{headerRightElement}
|
|
486
504
|
</ScreenStackHeaderRightView>
|
|
487
505
|
) : null}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["processFonts","_","Error"],"sourceRoot":"../../../src","sources":["views/FontProcessor.tsx"],"mappings":";;AAAA,OAAO,SAASA,YAAYA,CAC1BC,CAAyB,EACD;EACxB,MAAM,IAAIC,KAAK,CAAC,sBAAsB,CAAC;AACzC","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// @ts-expect-error importing private module
|
|
4
|
-
import ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
|
|
5
|
-
export function processFonts(fontFamilies) {
|
|
6
|
-
const fontFamilyProcessor = ReactNativeStyleAttributes.fontFamily?.process;
|
|
7
|
-
if (typeof fontFamilyProcessor === 'function') {
|
|
8
|
-
return fontFamilies.map(fontFamilyProcessor);
|
|
9
|
-
}
|
|
10
|
-
return fontFamilies;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=FontProcessor.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ReactNativeStyleAttributes","processFonts","fontFamilies","fontFamilyProcessor","fontFamily","process","map"],"sourceRoot":"../../../src","sources":["views/FontProcessor.native.tsx"],"mappings":";;AAAA;AACA,OAAOA,0BAA0B,MAAM,mEAAmE;AAE1G,OAAO,SAASC,YAAYA,CAC1BC,YAAoC,EACZ;EACxB,MAAMC,mBAAmB,GAAGH,0BAA0B,CAACI,UAAU,EAAEC,OAAO;EAC1E,IAAI,OAAOF,mBAAmB,KAAK,UAAU,EAAE;IAC7C,OAAOD,YAAY,CAACI,GAAG,CAACH,mBAAmB,CAAC;EAC9C;EACA,OAAOD,YAAY;AACrB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FontProcessor.d.ts","sourceRoot":"","sources":["../../../../src/views/FontProcessor.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAC1B,CAAC,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GACxB,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAExB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FontProcessor.native.d.ts","sourceRoot":"","sources":["../../../../src/views/FontProcessor.native.tsx"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAC1B,YAAY,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GACnC,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAMxB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @ts-expect-error importing private module
|
|
2
|
-
import ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
|
|
3
|
-
|
|
4
|
-
export function processFonts(
|
|
5
|
-
fontFamilies: (string | undefined)[]
|
|
6
|
-
): (string | undefined)[] {
|
|
7
|
-
const fontFamilyProcessor = ReactNativeStyleAttributes.fontFamily?.process;
|
|
8
|
-
if (typeof fontFamilyProcessor === 'function') {
|
|
9
|
-
return fontFamilies.map(fontFamilyProcessor);
|
|
10
|
-
}
|
|
11
|
-
return fontFamilies;
|
|
12
|
-
}
|