expo-router 6.0.0-beta.4 → 6.0.0-beta.6
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/assets/modal.module.css +15 -14
- package/build/layouts/StackClient.d.ts +5 -0
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/StackClient.js.map +1 -1
- package/build/modal/web/ModalStackRouteDrawer.js +9 -10
- package/build/modal/web/ModalStackRouteDrawer.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts +9 -3
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +125 -51
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts +3 -2
- package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts +24 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts.map +1 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js +28 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js.map +1 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +78 -18
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js +57 -27
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/appearance.d.ts +20 -0
- package/build/native-tabs/NativeBottomTabs/appearance.d.ts.map +1 -0
- package/build/native-tabs/NativeBottomTabs/appearance.js +131 -0
- package/build/native-tabs/NativeBottomTabs/appearance.js.map +1 -0
- package/build/native-tabs/NativeBottomTabs/types.d.ts +262 -97
- package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/types.js +14 -0
- package/build/native-tabs/NativeBottomTabs/types.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/utils.d.ts +2 -1
- package/build/native-tabs/NativeBottomTabs/utils.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/utils.js +7 -0
- package/build/native-tabs/NativeBottomTabs/utils.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +41 -21
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/native-tabs/index.d.ts +2 -1
- package/build/native-tabs/index.d.ts.map +1 -1
- package/build/native-tabs/index.js +3 -1
- package/build/native-tabs/index.js.map +1 -1
- package/build/useFocusEffect.js +1 -1
- package/build/useFocusEffect.js.map +1 -1
- package/ios/ExpoHead.podspec +2 -0
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +1 -1
- package/package.json +5 -5
- package/plugin/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStandardAppearanceFromOptions = createStandardAppearanceFromOptions;
|
|
4
|
+
exports.createScrollEdgeAppearanceFromOptions = createScrollEdgeAppearanceFromOptions;
|
|
5
|
+
exports.appendSelectedStyleToAppearance = appendSelectedStyleToAppearance;
|
|
6
|
+
exports.appendStyleToAppearance = appendStyleToAppearance;
|
|
7
|
+
exports.convertStyleToAppearance = convertStyleToAppearance;
|
|
8
|
+
exports.convertStyleToItemStateAppearance = convertStyleToItemStateAppearance;
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
function createStandardAppearanceFromOptions(options, baseStandardAppearance) {
|
|
11
|
+
const appearance = appendStyleToAppearance({
|
|
12
|
+
...options.labelStyle,
|
|
13
|
+
iconColor: options.iconColor,
|
|
14
|
+
backgroundColor: options.backgroundColor,
|
|
15
|
+
blurEffect: options.blurEffect,
|
|
16
|
+
badgeBackgroundColor: options.badgeBackgroundColor,
|
|
17
|
+
titlePositionAdjustment: options.titlePositionAdjustment,
|
|
18
|
+
}, baseStandardAppearance, ['normal', 'focused', 'selected']);
|
|
19
|
+
return appendSelectedStyleToAppearance({
|
|
20
|
+
...(options.selectedLabelStyle ?? {}),
|
|
21
|
+
iconColor: options.selectedIconColor,
|
|
22
|
+
badgeBackgroundColor: options.selectedBadgeBackgroundColor,
|
|
23
|
+
titlePositionAdjustment: options.selectedTitlePositionAdjustment,
|
|
24
|
+
}, appearance);
|
|
25
|
+
}
|
|
26
|
+
function createScrollEdgeAppearanceFromOptions(options, baseScrollEdgeAppearance) {
|
|
27
|
+
const appearance = appendStyleToAppearance({
|
|
28
|
+
...options.labelStyle,
|
|
29
|
+
iconColor: options.iconColor,
|
|
30
|
+
blurEffect: options.disableTransparentOnScrollEdge ? options.blurEffect : 'none',
|
|
31
|
+
backgroundColor: options.disableTransparentOnScrollEdge ? options.backgroundColor : null,
|
|
32
|
+
badgeBackgroundColor: options.badgeBackgroundColor,
|
|
33
|
+
titlePositionAdjustment: options.titlePositionAdjustment,
|
|
34
|
+
}, baseScrollEdgeAppearance, ['normal', 'focused', 'selected']);
|
|
35
|
+
return appendSelectedStyleToAppearance({
|
|
36
|
+
...(options.selectedLabelStyle ?? {}),
|
|
37
|
+
iconColor: options.selectedIconColor,
|
|
38
|
+
badgeBackgroundColor: options.selectedBadgeBackgroundColor,
|
|
39
|
+
titlePositionAdjustment: options.selectedTitlePositionAdjustment,
|
|
40
|
+
}, appearance);
|
|
41
|
+
}
|
|
42
|
+
function appendSelectedStyleToAppearance(selectedStyle, appearance) {
|
|
43
|
+
return appendStyleToAppearance(selectedStyle, appearance, ['selected', 'focused']);
|
|
44
|
+
}
|
|
45
|
+
const EMPTY_APPEARANCE_ITEM = {
|
|
46
|
+
normal: {},
|
|
47
|
+
selected: {},
|
|
48
|
+
focused: {},
|
|
49
|
+
disabled: {},
|
|
50
|
+
};
|
|
51
|
+
function appendStyleToAppearance(style, appearance, states) {
|
|
52
|
+
let tabBarBlurEffect = style?.blurEffect;
|
|
53
|
+
if (tabBarBlurEffect && !supportedBlurEffectsSet.has(tabBarBlurEffect)) {
|
|
54
|
+
console.warn(`Unsupported blurEffect: ${tabBarBlurEffect}. Supported values are: ${types_1.SUPPORTED_BLUR_EFFECTS.map((effect) => `"${effect}"`).join(', ')}`);
|
|
55
|
+
tabBarBlurEffect = undefined;
|
|
56
|
+
}
|
|
57
|
+
const baseItemAppearance = appearance.stacked || appearance.inline || appearance.compactInline || {};
|
|
58
|
+
const styleAppearance = convertStyleToAppearance(style);
|
|
59
|
+
const newAppearances = states.map((state) => ({
|
|
60
|
+
key: state,
|
|
61
|
+
appearance: {
|
|
62
|
+
...baseItemAppearance.normal,
|
|
63
|
+
...baseItemAppearance[state],
|
|
64
|
+
...styleAppearance.stacked?.normal,
|
|
65
|
+
},
|
|
66
|
+
}));
|
|
67
|
+
const itemAppearance = {
|
|
68
|
+
...EMPTY_APPEARANCE_ITEM,
|
|
69
|
+
...baseItemAppearance,
|
|
70
|
+
...Object.fromEntries(newAppearances.map(({ key, appearance }) => [key, appearance])),
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
stacked: itemAppearance,
|
|
74
|
+
inline: itemAppearance,
|
|
75
|
+
compactInline: itemAppearance,
|
|
76
|
+
tabBarBackgroundColor: style.backgroundColor === null
|
|
77
|
+
? undefined
|
|
78
|
+
: (style.backgroundColor ?? appearance.tabBarBackgroundColor),
|
|
79
|
+
tabBarBlurEffect: tabBarBlurEffect ?? appearance.tabBarBlurEffect,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const supportedBlurEffectsSet = new Set(types_1.SUPPORTED_BLUR_EFFECTS);
|
|
83
|
+
function convertStyleToAppearance(style) {
|
|
84
|
+
if (!style) {
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
let blurEffect = style.blurEffect;
|
|
88
|
+
if (style.blurEffect && !supportedBlurEffectsSet.has(style.blurEffect)) {
|
|
89
|
+
console.warn(`Unsupported blurEffect: ${style.blurEffect}. Supported values are: ${types_1.SUPPORTED_BLUR_EFFECTS.map((effect) => `"${effect}"`).join(', ')}`);
|
|
90
|
+
blurEffect = undefined;
|
|
91
|
+
}
|
|
92
|
+
const stateAppearance = convertStyleToItemStateAppearance(style);
|
|
93
|
+
const itemAppearance = {
|
|
94
|
+
normal: stateAppearance,
|
|
95
|
+
selected: stateAppearance,
|
|
96
|
+
focused: stateAppearance,
|
|
97
|
+
disabled: {},
|
|
98
|
+
};
|
|
99
|
+
return {
|
|
100
|
+
inline: itemAppearance,
|
|
101
|
+
stacked: itemAppearance,
|
|
102
|
+
compactInline: itemAppearance,
|
|
103
|
+
tabBarBackgroundColor: style?.backgroundColor ?? undefined,
|
|
104
|
+
tabBarBlurEffect: blurEffect,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function convertStyleToItemStateAppearance(style) {
|
|
108
|
+
if (!style) {
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
const stateAppearance = {
|
|
112
|
+
tabBarItemBadgeBackgroundColor: style.badgeBackgroundColor,
|
|
113
|
+
tabBarItemTitlePositionAdjustment: style.titlePositionAdjustment,
|
|
114
|
+
tabBarItemIconColor: style.iconColor,
|
|
115
|
+
tabBarItemTitleFontFamily: style.fontFamily,
|
|
116
|
+
tabBarItemTitleFontSize: style.fontSize,
|
|
117
|
+
// Only string values are accepted by rn-screens
|
|
118
|
+
tabBarItemTitleFontWeight: style?.fontWeight
|
|
119
|
+
? String(style.fontWeight)
|
|
120
|
+
: undefined,
|
|
121
|
+
tabBarItemTitleFontStyle: style.fontStyle,
|
|
122
|
+
tabBarItemTitleFontColor: style.color,
|
|
123
|
+
};
|
|
124
|
+
Object.keys(stateAppearance).forEach((key) => {
|
|
125
|
+
if (stateAppearance[key] === undefined) {
|
|
126
|
+
delete stateAppearance[key];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
return stateAppearance;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=appearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/appearance.ts"],"names":[],"mappings":";;AAcA,kFAyBC;AAED,sFAyBC;AAaD,0EAKC;AASD,0DAwCC;AAID,4DA6BC;AAED,8EA2BC;AA5LD,mCAKiB;AAEjB,SAAgB,mCAAmC,CACjD,OAAyB,EACzB,sBAAkD;IAElD,MAAM,UAAU,GAAG,uBAAuB,CACxC;QACE,GAAG,OAAO,CAAC,UAAU;QACrB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;KACzD,EACD,sBAAsB,EACtB,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAClC,CAAC;IACF,OAAO,+BAA+B,CACpC;QACE,GAAG,CAAC,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC;QACrC,SAAS,EAAE,OAAO,CAAC,iBAAiB;QACpC,oBAAoB,EAAE,OAAO,CAAC,4BAA4B;QAC1D,uBAAuB,EAAE,OAAO,CAAC,+BAA+B;KACjE,EACD,UAAU,CACX,CAAC;AACJ,CAAC;AAED,SAAgB,qCAAqC,CACnD,OAAyB,EACzB,wBAAoD;IAEpD,MAAM,UAAU,GAAG,uBAAuB,CACxC;QACE,GAAG,OAAO,CAAC,UAAU;QACrB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC,OAAO,C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KAAK,CAAC,KAAK;KACtC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,eAAe,CAAmD,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC9F,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { ColorValue } from 'react-native';\nimport type {\n BottomTabsScreenAppearance,\n BottomTabsScreenItemAppearance,\n BottomTabsScreenItemStateAppearance,\n} from 'react-native-screens';\n\nimport {\n SUPPORTED_BLUR_EFFECTS,\n type NativeTabOptions,\n type NativeTabsBlurEffect,\n type NativeTabsLabelStyle,\n} from './types';\n\nexport function createStandardAppearanceFromOptions(\n options: NativeTabOptions,\n baseStandardAppearance: BottomTabsScreenAppearance\n): BottomTabsScreenAppearance {\n const appearance = appendStyleToAppearance(\n {\n ...options.labelStyle,\n iconColor: options.iconColor,\n backgroundColor: options.backgroundColor,\n blurEffect: options.blurEffect,\n badgeBackgroundColor: options.badgeBackgroundColor,\n titlePositionAdjustment: options.titlePositionAdjustment,\n },\n baseStandardAppearance,\n ['normal', 'focused', 'selected']\n );\n return appendSelectedStyleToAppearance(\n {\n ...(options.selectedLabelStyle ?? {}),\n iconColor: options.selectedIconColor,\n badgeBackgroundColor: options.selectedBadgeBackgroundColor,\n titlePositionAdjustment: options.selectedTitlePositionAdjustment,\n },\n appearance\n );\n}\n\nexport function createScrollEdgeAppearanceFromOptions(\n options: NativeTabOptions,\n baseScrollEdgeAppearance: BottomTabsScreenAppearance\n): BottomTabsScreenAppearance {\n const appearance = appendStyleToAppearance(\n {\n ...options.labelStyle,\n iconColor: options.iconColor,\n blurEffect: options.disableTransparentOnScrollEdge ? options.blurEffect : 'none',\n backgroundColor: options.disableTransparentOnScrollEdge ? options.backgroundColor : null,\n badgeBackgroundColor: options.badgeBackgroundColor,\n titlePositionAdjustment: options.titlePositionAdjustment,\n },\n baseScrollEdgeAppearance,\n ['normal', 'focused', 'selected']\n );\n return appendSelectedStyleToAppearance(\n {\n ...(options.selectedLabelStyle ?? {}),\n iconColor: options.selectedIconColor,\n badgeBackgroundColor: options.selectedBadgeBackgroundColor,\n titlePositionAdjustment: options.selectedTitlePositionAdjustment,\n },\n appearance\n );\n}\n\nexport interface AppearanceStyle extends NativeTabsLabelStyle {\n iconColor?: ColorValue;\n backgroundColor?: ColorValue | null;\n blurEffect?: NativeTabsBlurEffect;\n badgeBackgroundColor?: ColorValue;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n}\n\nexport function appendSelectedStyleToAppearance(\n selectedStyle: AppearanceStyle,\n appearance: BottomTabsScreenAppearance\n): BottomTabsScreenAppearance {\n return appendStyleToAppearance(selectedStyle, appearance, ['selected', 'focused']);\n}\n\nconst EMPTY_APPEARANCE_ITEM: BottomTabsScreenItemAppearance = {\n normal: {},\n selected: {},\n focused: {},\n disabled: {},\n};\n\nexport function appendStyleToAppearance(\n style: AppearanceStyle,\n appearance: BottomTabsScreenAppearance,\n states: ('selected' | 'focused' | 'disabled' | 'normal')[]\n): BottomTabsScreenAppearance {\n let tabBarBlurEffect = style?.blurEffect;\n if (tabBarBlurEffect && !supportedBlurEffectsSet.has(tabBarBlurEffect)) {\n console.warn(\n `Unsupported blurEffect: ${tabBarBlurEffect}. Supported values are: ${SUPPORTED_BLUR_EFFECTS.map((effect) => `\"${effect}\"`).join(', ')}`\n );\n tabBarBlurEffect = undefined;\n }\n const baseItemAppearance =\n appearance.stacked || appearance.inline || appearance.compactInline || {};\n\n const styleAppearance = convertStyleToAppearance(style);\n const newAppearances = states.map((state) => ({\n key: state,\n appearance: {\n ...baseItemAppearance.normal,\n ...baseItemAppearance[state],\n ...styleAppearance.stacked?.normal,\n },\n }));\n\n const itemAppearance: BottomTabsScreenItemAppearance = {\n ...EMPTY_APPEARANCE_ITEM,\n ...baseItemAppearance,\n ...Object.fromEntries(newAppearances.map(({ key, appearance }) => [key, appearance])),\n };\n return {\n stacked: itemAppearance,\n inline: itemAppearance,\n compactInline: itemAppearance,\n tabBarBackgroundColor:\n style.backgroundColor === null\n ? undefined\n : (style.backgroundColor ?? appearance.tabBarBackgroundColor),\n tabBarBlurEffect: tabBarBlurEffect ?? appearance.tabBarBlurEffect,\n };\n}\n\nconst supportedBlurEffectsSet = new Set<string>(SUPPORTED_BLUR_EFFECTS);\n\nexport function convertStyleToAppearance(\n style: AppearanceStyle | undefined\n): BottomTabsScreenAppearance {\n if (!style) {\n return {};\n }\n let blurEffect = style.blurEffect;\n if (style.blurEffect && !supportedBlurEffectsSet.has(style.blurEffect)) {\n console.warn(\n `Unsupported blurEffect: ${style.blurEffect}. Supported values are: ${SUPPORTED_BLUR_EFFECTS.map(\n (effect) => `\"${effect}\"`\n ).join(', ')}`\n );\n blurEffect = undefined;\n }\n const stateAppearance = convertStyleToItemStateAppearance(style);\n const itemAppearance: BottomTabsScreenItemAppearance = {\n normal: stateAppearance,\n selected: stateAppearance,\n focused: stateAppearance,\n disabled: {},\n };\n return {\n inline: itemAppearance,\n stacked: itemAppearance,\n compactInline: itemAppearance,\n tabBarBackgroundColor: style?.backgroundColor ?? undefined,\n tabBarBlurEffect: blurEffect,\n };\n}\n\nexport function convertStyleToItemStateAppearance(\n style: AppearanceStyle | undefined\n): BottomTabsScreenItemStateAppearance {\n if (!style) {\n return {};\n }\n const stateAppearance: BottomTabsScreenItemStateAppearance = {\n tabBarItemBadgeBackgroundColor: style.badgeBackgroundColor,\n tabBarItemTitlePositionAdjustment: style.titlePositionAdjustment,\n tabBarItemIconColor: style.iconColor,\n tabBarItemTitleFontFamily: style.fontFamily,\n tabBarItemTitleFontSize: style.fontSize,\n // Only string values are accepted by rn-screens\n tabBarItemTitleFontWeight: style?.fontWeight\n ? (String(style.fontWeight) as `${NonNullable<(typeof style)['fontWeight']>}`)\n : undefined,\n tabBarItemTitleFontStyle: style.fontStyle,\n tabBarItemTitleFontColor: style.color,\n };\n\n (Object.keys(stateAppearance) as (keyof BottomTabsScreenItemStateAppearance)[]).forEach((key) => {\n if (stateAppearance[key] === undefined) {\n delete stateAppearance[key];\n }\n });\n\n return stateAppearance;\n}\n"]}
|
|
@@ -9,74 +9,96 @@ export interface NativeTabOptions extends DefaultRouterOptions {
|
|
|
9
9
|
* @platform android
|
|
10
10
|
* @platform iOS
|
|
11
11
|
*/
|
|
12
|
-
icon?:
|
|
13
|
-
/**
|
|
14
|
-
* The name of the drawable resource to use as an icon.
|
|
15
|
-
* @platform android
|
|
16
|
-
*/
|
|
17
|
-
drawable?: string;
|
|
18
|
-
};
|
|
12
|
+
icon?: SymbolOrImageSource;
|
|
19
13
|
/**
|
|
20
14
|
* The icon to display when the tab is selected.
|
|
21
15
|
* @platform iOS
|
|
22
16
|
*/
|
|
23
|
-
selectedIcon?:
|
|
17
|
+
selectedIcon?: SymbolOrImageSource;
|
|
24
18
|
/**
|
|
25
|
-
*
|
|
19
|
+
* Title of the tab screen, displayed in the tab bar item.
|
|
26
20
|
*
|
|
27
|
-
* @platform android
|
|
21
|
+
* @platform android
|
|
22
|
+
* @platform iOS
|
|
28
23
|
*/
|
|
29
24
|
title?: string;
|
|
30
25
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* On iOS, badge is displayed as regular string.
|
|
26
|
+
* Specifies content of tab bar item badge.
|
|
34
27
|
*
|
|
35
28
|
* On Android, the value is interpreted in the following order:
|
|
36
|
-
* -
|
|
37
|
-
* -
|
|
38
|
-
* -
|
|
29
|
+
* - If the string can be parsed to integer, displays the value as a number
|
|
30
|
+
* - Otherwise if the string is empty, displays "small dot" badge
|
|
31
|
+
* - Otherwise, displays the value as a text
|
|
32
|
+
*
|
|
33
|
+
* On iOS, badge is displayed as regular string.
|
|
39
34
|
*
|
|
40
|
-
* @platform android
|
|
35
|
+
* @platform android
|
|
36
|
+
* @platform ios
|
|
41
37
|
*/
|
|
42
38
|
badgeValue?: string;
|
|
43
|
-
}
|
|
44
|
-
export type SfSymbolOrImageSource = {
|
|
45
39
|
/**
|
|
46
|
-
* The
|
|
47
|
-
* @platform iOS
|
|
40
|
+
* The style of the tab label when the tab is selected.
|
|
48
41
|
*/
|
|
49
|
-
|
|
50
|
-
} | {
|
|
42
|
+
selectedLabelStyle?: NativeTabsLabelStyle;
|
|
51
43
|
/**
|
|
52
|
-
* The
|
|
53
|
-
* @platform iOS
|
|
44
|
+
* The style of all the tab labels, when the tab is selected
|
|
54
45
|
*/
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
export interface ExtendedNativeTabOptions extends NativeTabOptions {
|
|
46
|
+
labelStyle?: NativeTabsLabelStyle;
|
|
58
47
|
/**
|
|
59
|
-
*
|
|
48
|
+
* System-provided tab bar item with predefined icon and title
|
|
49
|
+
*
|
|
50
|
+
* Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with
|
|
51
|
+
* standard iOS styling and localized titles. Custom `icon` or `selectedIcon`
|
|
52
|
+
* properties will override the system icon, but the system-defined title cannot
|
|
53
|
+
* be customized.
|
|
54
|
+
*
|
|
55
|
+
* @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}
|
|
56
|
+
* @platform ios
|
|
60
57
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
color?: TextStyle['color'];
|
|
58
|
+
role?: NativeTabsTabBarItemRole;
|
|
59
|
+
/**
|
|
60
|
+
* The color of the icon when the tab is selected.
|
|
61
|
+
*/
|
|
62
|
+
selectedIconColor?: ColorValue;
|
|
63
|
+
/**
|
|
64
|
+
* The color of the badge when the tab is selected.
|
|
65
|
+
*/
|
|
66
|
+
selectedBadgeBackgroundColor?: ColorValue;
|
|
71
67
|
/**
|
|
68
|
+
* The color of all the badges when the tab is selected.
|
|
69
|
+
*/
|
|
70
|
+
badgeBackgroundColor?: ColorValue;
|
|
71
|
+
/**
|
|
72
|
+
* The color of the badge text.
|
|
73
|
+
*
|
|
72
74
|
* @platform android
|
|
75
|
+
* @platform web
|
|
76
|
+
*/
|
|
77
|
+
badgeTextColor?: ColorValue;
|
|
78
|
+
/**
|
|
79
|
+
* The color of the background when the tab is selected.
|
|
80
|
+
*/
|
|
81
|
+
backgroundColor?: ColorValue;
|
|
82
|
+
/**
|
|
83
|
+
* The blur effect to apply when the tab is selected.
|
|
84
|
+
*
|
|
73
85
|
* @platform iOS
|
|
74
|
-
|
|
86
|
+
*/
|
|
87
|
+
blurEffect?: NativeTabsBlurEffect;
|
|
88
|
+
/**
|
|
89
|
+
* The color of the icon when the tab is selected.
|
|
90
|
+
*
|
|
91
|
+
* On iOS 26+ you can change the icon color in the scroll edge state.
|
|
75
92
|
*/
|
|
76
93
|
iconColor?: ColorValue;
|
|
77
|
-
backgroundColor?: ColorValue;
|
|
78
94
|
/**
|
|
79
|
-
*
|
|
95
|
+
* When set to `true`, the tab bar will not become transparent when scrolled to the edge.
|
|
96
|
+
*
|
|
97
|
+
* @platform iOS
|
|
98
|
+
*/
|
|
99
|
+
disableTransparentOnScrollEdge?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The position adjustment for all the labels when the tab is selected.
|
|
80
102
|
*
|
|
81
103
|
* @platform iOS
|
|
82
104
|
*/
|
|
@@ -85,71 +107,78 @@ export interface NativeTabsStyleType {
|
|
|
85
107
|
vertical?: number;
|
|
86
108
|
};
|
|
87
109
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* Works with backgroundColor's alpha < 1.
|
|
91
|
-
*
|
|
92
|
-
* This property does not affect the tab bar starting from iOS 26.
|
|
93
|
-
*
|
|
94
|
-
* The following values are currently supported:
|
|
95
|
-
*
|
|
96
|
-
* - `none` - disables blur effect
|
|
97
|
-
* - `systemDefault` - uses UIKit's default tab bar blur effect
|
|
98
|
-
* - one of styles mapped from UIKit's UIBlurEffectStyle, e.g. `systemUltraThinMaterial`
|
|
99
|
-
*
|
|
100
|
-
* Complete list of possible blur effect styles is available in the official UIKit documentation:
|
|
101
|
-
* @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}
|
|
110
|
+
* The position adjustment for the label when the tab is selected.
|
|
102
111
|
*
|
|
103
|
-
* @
|
|
104
|
-
*
|
|
105
|
-
* @platform iOS ≤ 18
|
|
112
|
+
* @platform iOS
|
|
106
113
|
*/
|
|
107
|
-
|
|
114
|
+
selectedTitlePositionAdjustment?: {
|
|
115
|
+
horizontal?: number;
|
|
116
|
+
vertical?: number;
|
|
117
|
+
};
|
|
108
118
|
/**
|
|
119
|
+
* The color of the tab indicator.
|
|
120
|
+
*
|
|
109
121
|
* @platform android
|
|
110
|
-
* @platform iOS
|
|
111
122
|
* @platform web
|
|
112
123
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
indicatorColor?: ColorValue;
|
|
125
|
+
}
|
|
126
|
+
export type SymbolOrImageSource = {
|
|
115
127
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @platform
|
|
128
|
+
* The name of the SF Symbol to use as an icon.
|
|
129
|
+
* @platform iOS
|
|
118
130
|
*/
|
|
119
|
-
|
|
131
|
+
sf?: SFSymbol;
|
|
120
132
|
/**
|
|
133
|
+
* The name of the drawable resource to use as an icon.
|
|
121
134
|
* @platform android
|
|
122
135
|
*/
|
|
123
|
-
|
|
136
|
+
drawable?: string;
|
|
137
|
+
} | {
|
|
124
138
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* The label visibility mode defines when the labels of each item bar should be displayed.
|
|
128
|
-
*
|
|
129
|
-
* The following values are available:
|
|
130
|
-
* - `auto` - the label behaves as in “labeled” mode when there are 3 items or less, or as in “selected” mode when there are 4 items or more
|
|
131
|
-
* - `selected` - the label is only shown on the selected navigation item
|
|
132
|
-
* - `labeled` - the label is shown on all navigation items
|
|
133
|
-
* - `unlabeled` - the label is hidden for all navigation items
|
|
134
|
-
*
|
|
135
|
-
* The supported values correspond to the official Material Components documentation:
|
|
136
|
-
* @see {@link https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible|Material Components documentation}
|
|
137
|
-
*
|
|
138
|
-
* @default auto
|
|
139
|
-
* @platform android
|
|
139
|
+
* The image source to use as an icon.
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
src?: ImageSourcePropType;
|
|
142
|
+
};
|
|
143
|
+
export interface ExtendedNativeTabOptions extends NativeTabOptions {
|
|
142
144
|
/**
|
|
143
|
-
*
|
|
144
|
-
* @platform web
|
|
145
|
+
* If true, the tab will be hidden from the tab bar.
|
|
145
146
|
*/
|
|
146
|
-
|
|
147
|
+
hidden?: boolean;
|
|
148
|
+
specialEffects?: BottomTabsScreenProps['specialEffects'];
|
|
149
|
+
}
|
|
150
|
+
type NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
151
|
+
export interface NativeTabsLabelStyle {
|
|
152
|
+
/**
|
|
153
|
+
* The font family of the tab label.
|
|
154
|
+
*/
|
|
155
|
+
fontFamily?: TextStyle['fontFamily'];
|
|
156
|
+
/**
|
|
157
|
+
* The font size of the tab label.
|
|
158
|
+
*/
|
|
159
|
+
fontSize?: TextStyle['fontSize'];
|
|
160
|
+
/**
|
|
161
|
+
* The font weight of the tab label.
|
|
162
|
+
*/
|
|
163
|
+
fontWeight?: NumericFontWeight | `${NumericFontWeight}`;
|
|
164
|
+
/**
|
|
165
|
+
* The font style of the tab label.
|
|
166
|
+
*/
|
|
167
|
+
fontStyle?: TextStyle['fontStyle'];
|
|
168
|
+
/**
|
|
169
|
+
* The color of the tab label.
|
|
170
|
+
*/
|
|
171
|
+
color?: TextStyle['color'];
|
|
147
172
|
}
|
|
148
173
|
export declare const SUPPORTED_BLUR_EFFECTS: readonly ["none", "systemDefault", "extraLight", "light", "dark", "regular", "prominent", "systemUltraThinMaterial", "systemThinMaterial", "systemMaterial", "systemThickMaterial", "systemChromeMaterial", "systemUltraThinMaterialLight", "systemThinMaterialLight", "systemMaterialLight", "systemThickMaterialLight", "systemChromeMaterialLight", "systemUltraThinMaterialDark", "systemThinMaterialDark", "systemMaterialDark", "systemThickMaterialDark", "systemChromeMaterialDark"];
|
|
149
174
|
/**
|
|
150
|
-
* @see
|
|
175
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)
|
|
151
176
|
*/
|
|
152
177
|
export type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];
|
|
178
|
+
/**
|
|
179
|
+
* @platform android
|
|
180
|
+
* @platform web
|
|
181
|
+
*/
|
|
153
182
|
export interface NativeTabsActiveStyleType {
|
|
154
183
|
/**
|
|
155
184
|
* @platform android
|
|
@@ -171,10 +200,34 @@ export interface NativeTabsActiveStyleType {
|
|
|
171
200
|
*/
|
|
172
201
|
indicatorColor?: ColorValue;
|
|
173
202
|
}
|
|
203
|
+
export type TypeOrRecord<T, K extends string> = T | {
|
|
204
|
+
[key in K]?: T;
|
|
205
|
+
};
|
|
174
206
|
export interface NativeTabsProps extends PropsWithChildren {
|
|
175
|
-
style?: NativeTabsStyleType;
|
|
176
207
|
/**
|
|
177
|
-
*
|
|
208
|
+
* The style of the every tab label in the tab bar.
|
|
209
|
+
*/
|
|
210
|
+
labelStyle?: NativeTabsLabelStyle;
|
|
211
|
+
/**
|
|
212
|
+
* The color of every tab icon in the tab bar.
|
|
213
|
+
*/
|
|
214
|
+
iconColor?: ColorValue;
|
|
215
|
+
/**
|
|
216
|
+
* The tint color of the tab icon.
|
|
217
|
+
*
|
|
218
|
+
* Can be overridden by icon color and label color for each tab individually.
|
|
219
|
+
*/
|
|
220
|
+
tintColor?: ColorValue;
|
|
221
|
+
/**
|
|
222
|
+
* The background color of the tab bar.
|
|
223
|
+
*/
|
|
224
|
+
backgroundColor?: ColorValue | null;
|
|
225
|
+
/**
|
|
226
|
+
* The background color of every badge in the tab bar.
|
|
227
|
+
*/
|
|
228
|
+
badgeBackgroundColor?: ColorValue;
|
|
229
|
+
/**
|
|
230
|
+
* Specifies the minimize behavior for the tab bar.
|
|
178
231
|
*
|
|
179
232
|
* Available starting from iOS 26.
|
|
180
233
|
*
|
|
@@ -187,14 +240,34 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
187
240
|
* - `onScrollUp` - the tab bar minimizes when scrolling up and expands
|
|
188
241
|
* when scrolling back down
|
|
189
242
|
*
|
|
190
|
-
* The supported values correspond to the official UIKit documentation
|
|
191
|
-
* @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}
|
|
243
|
+
* @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).
|
|
192
244
|
*
|
|
193
|
-
* @default
|
|
245
|
+
* @default automatic
|
|
194
246
|
*
|
|
195
247
|
* @platform iOS 26+
|
|
196
248
|
*/
|
|
197
249
|
minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;
|
|
250
|
+
/**
|
|
251
|
+
* The blur effect applied to the tab bar.
|
|
252
|
+
*
|
|
253
|
+
* @platform iOS
|
|
254
|
+
*/
|
|
255
|
+
blurEffect?: NativeTabsBlurEffect;
|
|
256
|
+
/**
|
|
257
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)
|
|
258
|
+
*
|
|
259
|
+
* @platform iOS
|
|
260
|
+
*/
|
|
261
|
+
titlePositionAdjustment?: {
|
|
262
|
+
horizontal?: number;
|
|
263
|
+
vertical?: number;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* When set to `true`, the tab bar will not become transparent when scrolled to the edge.
|
|
267
|
+
*
|
|
268
|
+
* @platform iOS
|
|
269
|
+
*/
|
|
270
|
+
disableTransparentOnScrollEdge?: boolean;
|
|
198
271
|
/**
|
|
199
272
|
* Disables the active indicator for the tab bar.
|
|
200
273
|
*
|
|
@@ -207,6 +280,34 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
207
280
|
* @platform android
|
|
208
281
|
*/
|
|
209
282
|
backBehavior?: 'none' | 'initialRoute' | 'history';
|
|
283
|
+
/**
|
|
284
|
+
* The visibility mode of the tab item label.
|
|
285
|
+
*
|
|
286
|
+
* @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)
|
|
287
|
+
*
|
|
288
|
+
* @platform android
|
|
289
|
+
*/
|
|
290
|
+
labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;
|
|
291
|
+
/**
|
|
292
|
+
* The color of the ripple effect when the tab is pressed.
|
|
293
|
+
*
|
|
294
|
+
* @platform android
|
|
295
|
+
*/
|
|
296
|
+
rippleColor?: ColorValue;
|
|
297
|
+
/**
|
|
298
|
+
* The color of the tab indicator.
|
|
299
|
+
*
|
|
300
|
+
* @platform android
|
|
301
|
+
* @platform web
|
|
302
|
+
*/
|
|
303
|
+
indicatorColor?: ColorValue;
|
|
304
|
+
/**
|
|
305
|
+
* The color of the badge text.
|
|
306
|
+
*
|
|
307
|
+
* @platform android
|
|
308
|
+
* @platform web
|
|
309
|
+
*/
|
|
310
|
+
badgeTextColor?: ColorValue;
|
|
210
311
|
}
|
|
211
312
|
export interface NativeTabsViewProps extends NativeTabsProps {
|
|
212
313
|
focusedIndex: number;
|
|
@@ -214,14 +315,14 @@ export interface NativeTabsViewProps extends NativeTabsProps {
|
|
|
214
315
|
}
|
|
215
316
|
export declare const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES: readonly ["auto", "selected", "labeled", "unlabeled"];
|
|
216
317
|
/**
|
|
217
|
-
* @see
|
|
318
|
+
* @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)
|
|
218
319
|
*
|
|
219
320
|
* @platform android
|
|
220
321
|
*/
|
|
221
322
|
export type NativeTabsTabBarItemLabelVisibilityMode = (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];
|
|
222
323
|
export declare const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS: readonly ["automatic", "never", "onScrollDown", "onScrollUp"];
|
|
223
324
|
/**
|
|
224
|
-
* @see
|
|
325
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)
|
|
225
326
|
*
|
|
226
327
|
* @platform iOS 26
|
|
227
328
|
*/
|
|
@@ -247,16 +348,16 @@ export interface NativeTabTriggerProps {
|
|
|
247
348
|
options?: NativeTabOptions;
|
|
248
349
|
/**
|
|
249
350
|
* If true, the tab will not pop stack to the root when selected again.
|
|
250
|
-
* @default false
|
|
251
351
|
*
|
|
252
|
-
* @
|
|
352
|
+
* @default false
|
|
353
|
+
* @platform iOS
|
|
253
354
|
*/
|
|
254
355
|
disablePopToTop?: boolean;
|
|
255
356
|
/**
|
|
256
357
|
* If true, the tab will not scroll to the top when selected again.
|
|
257
358
|
* @default false
|
|
258
359
|
*
|
|
259
|
-
* @platform
|
|
360
|
+
* @platform iOS
|
|
260
361
|
*/
|
|
261
362
|
disableScrollToTop?: boolean;
|
|
262
363
|
/**
|
|
@@ -265,6 +366,70 @@ export interface NativeTabTriggerProps {
|
|
|
265
366
|
* Use `Icon`, `Label`, and `Badge` components to customize the tab.
|
|
266
367
|
*/
|
|
267
368
|
children?: React.ReactNode;
|
|
369
|
+
/**
|
|
370
|
+
* System-provided tab bar item with predefined icon and title
|
|
371
|
+
*
|
|
372
|
+
* Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with
|
|
373
|
+
* standard iOS styling and localized titles. Custom `icon` or `selectedIcon`
|
|
374
|
+
* properties will override the system icon, but the system-defined title cannot
|
|
375
|
+
* be customized.
|
|
376
|
+
*
|
|
377
|
+
* @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}
|
|
378
|
+
* @platform ios
|
|
379
|
+
*/
|
|
380
|
+
role?: NativeTabsTabBarItemRole;
|
|
381
|
+
}
|
|
382
|
+
declare const SUPPORTED_TAB_BAR_ITEM_ROLES: readonly ["bookmarks", "contacts", "downloads", "favorites", "featured", "history", "more", "mostRecent", "mostViewed", "recents", "search", "topRated"];
|
|
383
|
+
export type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];
|
|
384
|
+
export interface NativeTabsTriggerTabBarProps {
|
|
385
|
+
/**
|
|
386
|
+
* The style of the every tab label in the tab bar.
|
|
387
|
+
*
|
|
388
|
+
* @platform iOS
|
|
389
|
+
* @platform web
|
|
390
|
+
*/
|
|
391
|
+
labelStyle?: NativeTabsLabelStyle;
|
|
392
|
+
/**
|
|
393
|
+
* The background color of the tab bar, when the tab is selected
|
|
394
|
+
*/
|
|
395
|
+
backgroundColor?: ColorValue;
|
|
396
|
+
/**
|
|
397
|
+
* The color of every tab icon, when the tab is selected
|
|
398
|
+
*
|
|
399
|
+
* @platform iOS
|
|
400
|
+
*/
|
|
401
|
+
iconColor?: ColorValue;
|
|
402
|
+
/**
|
|
403
|
+
* The background color of every badge in the tab bar.
|
|
404
|
+
*
|
|
405
|
+
* @platform iOS
|
|
406
|
+
* @platform web
|
|
407
|
+
*/
|
|
408
|
+
badgeBackgroundColor?: ColorValue;
|
|
409
|
+
/**
|
|
410
|
+
* The blur effect applied to the tab bar, when the tab is selected
|
|
411
|
+
*
|
|
412
|
+
* @platform iOS
|
|
413
|
+
*/
|
|
414
|
+
blurEffect?: NativeTabsBlurEffect;
|
|
415
|
+
/**
|
|
416
|
+
* When set to `true`, the tab bar will not become transparent when scrolled to the edge.
|
|
417
|
+
*
|
|
418
|
+
* @platform iOS
|
|
419
|
+
*/
|
|
420
|
+
disableTransparentOnScrollEdge?: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* The color of the badge text.
|
|
423
|
+
*
|
|
424
|
+
* @platform web
|
|
425
|
+
*/
|
|
426
|
+
badgeTextColor?: ColorValue;
|
|
427
|
+
/**
|
|
428
|
+
* The color of the tab indicator.
|
|
429
|
+
*
|
|
430
|
+
* @platform web
|
|
431
|
+
*/
|
|
432
|
+
indicatorColor?: ColorValue;
|
|
268
433
|
}
|
|
269
434
|
export {};
|
|
270
435
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D;;;;OAIG;IACH,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OA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