expo-router 6.0.0-beta.1 → 6.0.0-beta.10
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/assets/native-tabs.module.css +1 -1
- package/build/fork/extractPathFromURL.d.ts.map +1 -1
- package/build/fork/extractPathFromURL.js +4 -0
- package/build/fork/extractPathFromURL.js.map +1 -1
- package/build/fork/getPathFromState.d.ts.map +1 -1
- package/build/fork/getPathFromState.js +2 -0
- package/build/fork/getPathFromState.js.map +1 -1
- package/build/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +12 -3
- package/build/global-state/routing.js.map +1 -1
- package/build/layouts/StackClient.d.ts +12 -7
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/StackClient.js +27 -25
- package/build/layouts/StackClient.js.map +1 -1
- package/build/link/ExpoLink.d.ts.map +1 -1
- package/build/link/ExpoLink.js +4 -1
- package/build/link/ExpoLink.js.map +1 -1
- package/build/link/LinkWithPreview.d.ts.map +1 -1
- package/build/link/LinkWithPreview.js +18 -23
- package/build/link/LinkWithPreview.js.map +1 -1
- package/build/link/elements.d.ts +1 -1
- package/build/link/elements.js +1 -1
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +0 -2
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js +0 -10
- package/build/link/preview/native.js.map +1 -1
- package/build/link/preview/utils.d.ts.map +1 -1
- package/build/link/preview/utils.js +5 -2
- package/build/link/preview/utils.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/NativeBottomTabsNavigator.d.ts +1 -0
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js +45 -6
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js +6 -27
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts +11 -3
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +154 -62
- 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 +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +115 -30
- 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 +119 -0
- package/build/native-tabs/NativeBottomTabs/appearance.js.map +1 -0
- package/build/native-tabs/NativeBottomTabs/types.d.ts +298 -59
- package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/types.js +51 -0
- package/build/native-tabs/NativeBottomTabs/types.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +84 -21
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js +23 -0
- 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/navigationParams.d.ts +9 -0
- package/build/navigationParams.d.ts.map +1 -0
- package/build/navigationParams.js +67 -0
- package/build/navigationParams.js.map +1 -0
- package/build/testing-library/index.d.ts +15 -4
- package/build/testing-library/index.d.ts.map +1 -1
- package/build/testing-library/index.js +31 -28
- package/build/testing-library/index.js.map +1 -1
- package/build/typed-routes/generate.d.ts +2 -1
- package/build/typed-routes/generate.d.ts.map +1 -1
- package/build/typed-routes/generate.js +3 -1
- package/build/typed-routes/generate.js.map +1 -1
- package/build/ui/Slot.d.ts +5 -1
- package/build/ui/Slot.d.ts.map +1 -1
- package/build/ui/Slot.js.map +1 -1
- package/build/ui/Tabs.d.ts.map +1 -1
- package/build/ui/Tabs.js +1 -1
- package/build/ui/Tabs.js.map +1 -1
- package/build/ui/common.d.ts +2 -3
- package/build/ui/common.d.ts.map +1 -1
- package/build/ui/common.js +1 -3
- package/build/ui/common.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 +7 -9
- package/ios/LinkPreview/LinkPreviewNativeView.swift +13 -28
- package/package.json +10 -11
- package/ios/LinkPreview/LinkPreviewNativeTriggerView.swift +0 -9
- package/plugin/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../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|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
function createStandardAppearanceFromOptions(options, baseStandardAppearance) {
|
|
10
|
+
const appearance = appendStyleToAppearance({
|
|
11
|
+
...options.labelStyle,
|
|
12
|
+
iconColor: options.iconColor,
|
|
13
|
+
backgroundColor: options.backgroundColor,
|
|
14
|
+
blurEffect: options.blurEffect,
|
|
15
|
+
badgeBackgroundColor: options.badgeBackgroundColor,
|
|
16
|
+
titlePositionAdjustment: options.titlePositionAdjustment,
|
|
17
|
+
}, baseStandardAppearance, ['normal', 'focused', 'selected']);
|
|
18
|
+
return appendSelectedStyleToAppearance({
|
|
19
|
+
...(options.selectedLabelStyle ?? {}),
|
|
20
|
+
iconColor: options.selectedIconColor,
|
|
21
|
+
badgeBackgroundColor: options.selectedBadgeBackgroundColor,
|
|
22
|
+
titlePositionAdjustment: options.selectedTitlePositionAdjustment,
|
|
23
|
+
}, appearance);
|
|
24
|
+
}
|
|
25
|
+
function createScrollEdgeAppearanceFromOptions(options, baseScrollEdgeAppearance) {
|
|
26
|
+
const appearance = appendStyleToAppearance({
|
|
27
|
+
...options.labelStyle,
|
|
28
|
+
iconColor: options.iconColor,
|
|
29
|
+
blurEffect: options.disableTransparentOnScrollEdge ? options.blurEffect : 'none',
|
|
30
|
+
backgroundColor: options.disableTransparentOnScrollEdge ? options.backgroundColor : null,
|
|
31
|
+
badgeBackgroundColor: options.badgeBackgroundColor,
|
|
32
|
+
titlePositionAdjustment: options.titlePositionAdjustment,
|
|
33
|
+
}, baseScrollEdgeAppearance, ['normal', 'focused', 'selected']);
|
|
34
|
+
return appendSelectedStyleToAppearance({
|
|
35
|
+
...(options.selectedLabelStyle ?? {}),
|
|
36
|
+
iconColor: options.selectedIconColor,
|
|
37
|
+
badgeBackgroundColor: options.selectedBadgeBackgroundColor,
|
|
38
|
+
titlePositionAdjustment: options.selectedTitlePositionAdjustment,
|
|
39
|
+
}, appearance);
|
|
40
|
+
}
|
|
41
|
+
function appendSelectedStyleToAppearance(selectedStyle, appearance) {
|
|
42
|
+
return appendStyleToAppearance(selectedStyle, appearance, ['selected', 'focused']);
|
|
43
|
+
}
|
|
44
|
+
const EMPTY_APPEARANCE_ITEM = {
|
|
45
|
+
normal: {},
|
|
46
|
+
selected: {},
|
|
47
|
+
focused: {},
|
|
48
|
+
disabled: {},
|
|
49
|
+
};
|
|
50
|
+
function appendStyleToAppearance(style, appearance, states) {
|
|
51
|
+
const baseItemAppearance = appearance.stacked || appearance.inline || appearance.compactInline || {};
|
|
52
|
+
const styleAppearance = convertStyleToAppearance(style);
|
|
53
|
+
const newAppearances = states.map((state) => ({
|
|
54
|
+
key: state,
|
|
55
|
+
appearance: {
|
|
56
|
+
...baseItemAppearance.normal,
|
|
57
|
+
...baseItemAppearance[state],
|
|
58
|
+
...styleAppearance.stacked?.normal,
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
const itemAppearance = {
|
|
62
|
+
...EMPTY_APPEARANCE_ITEM,
|
|
63
|
+
...baseItemAppearance,
|
|
64
|
+
...Object.fromEntries(newAppearances.map(({ key, appearance }) => [key, appearance])),
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
stacked: itemAppearance,
|
|
68
|
+
inline: itemAppearance,
|
|
69
|
+
compactInline: itemAppearance,
|
|
70
|
+
tabBarBackgroundColor: style.backgroundColor === null
|
|
71
|
+
? undefined
|
|
72
|
+
: (style.backgroundColor ?? appearance.tabBarBackgroundColor),
|
|
73
|
+
tabBarBlurEffect: styleAppearance.tabBarBlurEffect ?? appearance.tabBarBlurEffect,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function convertStyleToAppearance(style) {
|
|
77
|
+
if (!style) {
|
|
78
|
+
return {};
|
|
79
|
+
}
|
|
80
|
+
const stateAppearance = convertStyleToItemStateAppearance(style);
|
|
81
|
+
const itemAppearance = {
|
|
82
|
+
normal: stateAppearance,
|
|
83
|
+
selected: stateAppearance,
|
|
84
|
+
focused: stateAppearance,
|
|
85
|
+
disabled: {},
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
inline: itemAppearance,
|
|
89
|
+
stacked: itemAppearance,
|
|
90
|
+
compactInline: itemAppearance,
|
|
91
|
+
tabBarBackgroundColor: style?.backgroundColor ?? undefined,
|
|
92
|
+
tabBarBlurEffect: style?.blurEffect,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function convertStyleToItemStateAppearance(style) {
|
|
96
|
+
if (!style) {
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
const stateAppearance = {
|
|
100
|
+
tabBarItemBadgeBackgroundColor: style.badgeBackgroundColor,
|
|
101
|
+
tabBarItemTitlePositionAdjustment: style.titlePositionAdjustment,
|
|
102
|
+
tabBarItemIconColor: style.iconColor,
|
|
103
|
+
tabBarItemTitleFontFamily: style.fontFamily,
|
|
104
|
+
tabBarItemTitleFontSize: style.fontSize,
|
|
105
|
+
// Only string values are accepted by rn-screens
|
|
106
|
+
tabBarItemTitleFontWeight: style?.fontWeight
|
|
107
|
+
? String(style.fontWeight)
|
|
108
|
+
: undefined,
|
|
109
|
+
tabBarItemTitleFontStyle: style.fontStyle,
|
|
110
|
+
tabBarItemTitleFontColor: style.color,
|
|
111
|
+
};
|
|
112
|
+
Object.keys(stateAppearance).forEach((key) => {
|
|
113
|
+
if (stateAppearance[key] === undefined) {
|
|
114
|
+
delete stateAppearance[key];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return stateAppearance;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=appearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/appearance.ts"],"names":[],"mappings":";;AAaA,kFAyBC;AAED,sFAyBC;AAaD,0EAKC;AASD,0DAiCC;AAED,4DAoBC;AAED,8EA2BC;AAnKD,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,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM;QAChF,eAAe,EAAE,OAAO,CAAC,8BAA8B,CAAC,C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oBAAoB;QAC1D,iCAAiC,EAAE,KAAK,CAAC,uBAAuB;QAChE,mBAAmB,EAAE,KAAK,CAAC,SAAS;QACpC,yBAAyB,EAAE,KAAK,CAAC,UAAU;QAC3C,uBAAuB,EAAE,KAAK,CAAC,QAAQ;QACvC,gDAAgD;QAChD,yBAAyB,EAAE,KAAK,EAAE,UAAU;YAC1C,CAAC,CAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAoD;YAC9E,CAAC,CAAC,SAAS;QACb,wBAAwB,EAAE,KAAK,CAAC,SAAS;QACzC,wBAAwB,EAAE,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 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 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: styleAppearance.tabBarBlurEffect ?? appearance.tabBarBlurEffect,\n };\n}\n\nexport function convertStyleToAppearance(\n style: AppearanceStyle | undefined\n): BottomTabsScreenAppearance {\n if (!style) {\n return {};\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: style?.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"]}
|
|
@@ -1,63 +1,104 @@
|
|
|
1
1
|
import type { DefaultRouterOptions, ParamListBase, TabNavigationState, TabRouterOptions, useNavigationBuilder } from '@react-navigation/native';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
import type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';
|
|
4
|
-
import type {
|
|
4
|
+
import type { BottomTabsScreenProps } from 'react-native-screens';
|
|
5
5
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
6
|
-
export
|
|
6
|
+
export interface NativeTabOptions extends DefaultRouterOptions {
|
|
7
7
|
/**
|
|
8
8
|
* The icon to display in the tab bar.
|
|
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?:
|
|
24
|
-
};
|
|
25
|
-
export type SfSymbolOrImageSource = {
|
|
17
|
+
selectedIcon?: SymbolOrImageSource;
|
|
26
18
|
/**
|
|
27
|
-
*
|
|
19
|
+
* Title of the tab screen, displayed in the tab bar item.
|
|
20
|
+
*
|
|
21
|
+
* @platform android
|
|
28
22
|
* @platform iOS
|
|
29
23
|
*/
|
|
30
|
-
|
|
31
|
-
} | {
|
|
24
|
+
title?: string;
|
|
32
25
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
26
|
+
* Specifies content of tab bar item badge.
|
|
27
|
+
*
|
|
28
|
+
* On Android, the value is interpreted in the following order:
|
|
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.
|
|
34
|
+
*
|
|
35
|
+
* @platform android
|
|
36
|
+
* @platform ios
|
|
35
37
|
*/
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
export interface ExtendedNativeTabOptions extends NativeTabOptions {
|
|
38
|
+
badgeValue?: string;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* The style of the tab label when the tab is selected.
|
|
41
41
|
*/
|
|
42
|
-
|
|
43
|
-
specialEffects?: BottomTabsScreenProps['specialEffects'];
|
|
44
|
-
}
|
|
45
|
-
type NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
46
|
-
export interface NativeTabsStyleType {
|
|
47
|
-
fontFamily?: TextStyle['fontFamily'];
|
|
48
|
-
fontSize?: TextStyle['fontSize'];
|
|
49
|
-
fontWeight?: NumericFontWeight | `${NumericFontWeight}`;
|
|
50
|
-
fontStyle?: TextStyle['fontStyle'];
|
|
51
|
-
color?: TextStyle['color'];
|
|
42
|
+
selectedLabelStyle?: NativeTabsLabelStyle;
|
|
52
43
|
/**
|
|
44
|
+
* The style of all the tab labels, when the tab is selected
|
|
45
|
+
*/
|
|
46
|
+
labelStyle?: NativeTabsLabelStyle;
|
|
47
|
+
/**
|
|
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
|
|
57
|
+
*/
|
|
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;
|
|
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
|
+
*
|
|
53
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
|
+
*
|
|
54
85
|
* @platform iOS
|
|
55
|
-
|
|
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.
|
|
56
92
|
*/
|
|
57
93
|
iconColor?: ColorValue;
|
|
58
|
-
backgroundColor?: ColorValue;
|
|
59
94
|
/**
|
|
60
|
-
*
|
|
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.
|
|
61
102
|
*
|
|
62
103
|
* @platform iOS
|
|
63
104
|
*/
|
|
@@ -66,35 +107,78 @@ export interface NativeTabsStyleType {
|
|
|
66
107
|
vertical?: number;
|
|
67
108
|
};
|
|
68
109
|
/**
|
|
110
|
+
* The position adjustment for the label when the tab is selected.
|
|
111
|
+
*
|
|
69
112
|
* @platform iOS
|
|
70
113
|
*/
|
|
71
|
-
|
|
114
|
+
selectedTitlePositionAdjustment?: {
|
|
115
|
+
horizontal?: number;
|
|
116
|
+
vertical?: number;
|
|
117
|
+
};
|
|
72
118
|
/**
|
|
119
|
+
* The color of the tab indicator.
|
|
120
|
+
*
|
|
73
121
|
* @platform android
|
|
74
|
-
* @platform iOS
|
|
75
122
|
* @platform web
|
|
76
123
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
124
|
+
indicatorColor?: ColorValue;
|
|
125
|
+
}
|
|
126
|
+
export type SymbolOrImageSource = {
|
|
79
127
|
/**
|
|
80
|
-
*
|
|
81
|
-
* @platform
|
|
128
|
+
* The name of the SF Symbol to use as an icon.
|
|
129
|
+
* @platform iOS
|
|
82
130
|
*/
|
|
83
|
-
|
|
131
|
+
sf?: SFSymbol;
|
|
84
132
|
/**
|
|
133
|
+
* The name of the drawable resource to use as an icon.
|
|
85
134
|
* @platform android
|
|
86
135
|
*/
|
|
87
|
-
|
|
136
|
+
drawable?: string;
|
|
137
|
+
} | {
|
|
88
138
|
/**
|
|
89
|
-
*
|
|
139
|
+
* The image source to use as an icon.
|
|
90
140
|
*/
|
|
91
|
-
|
|
141
|
+
src?: ImageSourcePropType | Promise<ImageSourcePropType>;
|
|
142
|
+
};
|
|
143
|
+
export interface ExtendedNativeTabOptions extends NativeTabOptions {
|
|
92
144
|
/**
|
|
93
|
-
*
|
|
94
|
-
|
|
145
|
+
* If true, the tab will be hidden from the tab bar.
|
|
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.
|
|
95
166
|
*/
|
|
96
|
-
'
|
|
167
|
+
fontStyle?: TextStyle['fontStyle'];
|
|
168
|
+
/**
|
|
169
|
+
* The color of the tab label.
|
|
170
|
+
*/
|
|
171
|
+
color?: TextStyle['color'];
|
|
97
172
|
}
|
|
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"];
|
|
174
|
+
/**
|
|
175
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)
|
|
176
|
+
*/
|
|
177
|
+
export type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];
|
|
178
|
+
/**
|
|
179
|
+
* @platform android
|
|
180
|
+
* @platform web
|
|
181
|
+
*/
|
|
98
182
|
export interface NativeTabsActiveStyleType {
|
|
99
183
|
/**
|
|
100
184
|
* @platform android
|
|
@@ -117,21 +201,70 @@ export interface NativeTabsActiveStyleType {
|
|
|
117
201
|
indicatorColor?: ColorValue;
|
|
118
202
|
}
|
|
119
203
|
export interface NativeTabsProps extends PropsWithChildren {
|
|
120
|
-
style?: NativeTabsStyleType;
|
|
121
204
|
/**
|
|
122
|
-
*
|
|
205
|
+
* The style of the every tab label in the tab bar.
|
|
206
|
+
*/
|
|
207
|
+
labelStyle?: NativeTabsLabelStyle;
|
|
208
|
+
/**
|
|
209
|
+
* The color of every tab icon in the tab bar.
|
|
210
|
+
*/
|
|
211
|
+
iconColor?: ColorValue;
|
|
212
|
+
/**
|
|
213
|
+
* The tint color of the tab icon.
|
|
214
|
+
*
|
|
215
|
+
* Can be overridden by icon color and label color for each tab individually.
|
|
216
|
+
*/
|
|
217
|
+
tintColor?: ColorValue;
|
|
218
|
+
/**
|
|
219
|
+
* The background color of the tab bar.
|
|
220
|
+
*/
|
|
221
|
+
backgroundColor?: ColorValue | null;
|
|
222
|
+
/**
|
|
223
|
+
* The background color of every badge in the tab bar.
|
|
224
|
+
*/
|
|
225
|
+
badgeBackgroundColor?: ColorValue;
|
|
226
|
+
/**
|
|
227
|
+
* Specifies the minimize behavior for the tab bar.
|
|
228
|
+
*
|
|
229
|
+
* Available starting from iOS 26.
|
|
123
230
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* - `
|
|
127
|
-
* - `
|
|
128
|
-
* - `
|
|
231
|
+
* The following values are currently supported:
|
|
232
|
+
*
|
|
233
|
+
* - `automatic` - resolves to the system default minimize behavior
|
|
234
|
+
* - `never` - the tab bar does not minimize
|
|
235
|
+
* - `onScrollDown` - the tab bar minimizes when scrolling down and
|
|
236
|
+
* expands when scrolling back up
|
|
237
|
+
* - `onScrollUp` - the tab bar minimizes when scrolling up and expands
|
|
238
|
+
* when scrolling back down
|
|
239
|
+
*
|
|
240
|
+
* @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).
|
|
129
241
|
*
|
|
130
242
|
* @default automatic
|
|
131
243
|
*
|
|
132
|
-
* @platform iOS 26
|
|
244
|
+
* @platform iOS 26+
|
|
245
|
+
*/
|
|
246
|
+
minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;
|
|
247
|
+
/**
|
|
248
|
+
* The blur effect applied to the tab bar.
|
|
249
|
+
*
|
|
250
|
+
* @platform iOS
|
|
251
|
+
*/
|
|
252
|
+
blurEffect?: NativeTabsBlurEffect;
|
|
253
|
+
/**
|
|
254
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)
|
|
255
|
+
*
|
|
256
|
+
* @platform iOS
|
|
257
|
+
*/
|
|
258
|
+
titlePositionAdjustment?: {
|
|
259
|
+
horizontal?: number;
|
|
260
|
+
vertical?: number;
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* When set to `true`, the tab bar will not become transparent when scrolled to the edge.
|
|
264
|
+
*
|
|
265
|
+
* @platform iOS
|
|
133
266
|
*/
|
|
134
|
-
|
|
267
|
+
disableTransparentOnScrollEdge?: boolean;
|
|
135
268
|
/**
|
|
136
269
|
* Disables the active indicator for the tab bar.
|
|
137
270
|
*
|
|
@@ -144,11 +277,53 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
144
277
|
* @platform android
|
|
145
278
|
*/
|
|
146
279
|
backBehavior?: 'none' | 'initialRoute' | 'history';
|
|
280
|
+
/**
|
|
281
|
+
* The visibility mode of the tab item label.
|
|
282
|
+
*
|
|
283
|
+
* @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)
|
|
284
|
+
*
|
|
285
|
+
* @platform android
|
|
286
|
+
*/
|
|
287
|
+
labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;
|
|
288
|
+
/**
|
|
289
|
+
* The color of the ripple effect when the tab is pressed.
|
|
290
|
+
*
|
|
291
|
+
* @platform android
|
|
292
|
+
*/
|
|
293
|
+
rippleColor?: ColorValue;
|
|
294
|
+
/**
|
|
295
|
+
* The color of the tab indicator.
|
|
296
|
+
*
|
|
297
|
+
* @platform android
|
|
298
|
+
* @platform web
|
|
299
|
+
*/
|
|
300
|
+
indicatorColor?: ColorValue;
|
|
301
|
+
/**
|
|
302
|
+
* The color of the badge text.
|
|
303
|
+
*
|
|
304
|
+
* @platform android
|
|
305
|
+
* @platform web
|
|
306
|
+
*/
|
|
307
|
+
badgeTextColor?: ColorValue;
|
|
147
308
|
}
|
|
148
309
|
export interface NativeTabsViewProps extends NativeTabsProps {
|
|
149
310
|
focusedIndex: number;
|
|
150
311
|
builder: ReturnType<typeof useNavigationBuilder<TabNavigationState<ParamListBase>, TabRouterOptions, Record<string, (...args: any) => void>, NativeTabOptions, Record<string, any>>>;
|
|
151
312
|
}
|
|
313
|
+
export declare const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES: readonly ["auto", "selected", "labeled", "unlabeled"];
|
|
314
|
+
/**
|
|
315
|
+
* @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)
|
|
316
|
+
*
|
|
317
|
+
* @platform android
|
|
318
|
+
*/
|
|
319
|
+
export type NativeTabsTabBarItemLabelVisibilityMode = (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];
|
|
320
|
+
export declare const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS: readonly ["automatic", "never", "onScrollDown", "onScrollUp"];
|
|
321
|
+
/**
|
|
322
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)
|
|
323
|
+
*
|
|
324
|
+
* @platform iOS 26
|
|
325
|
+
*/
|
|
326
|
+
export type NativeTabsTabBarMinimizeBehavior = (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];
|
|
152
327
|
export interface NativeTabTriggerProps {
|
|
153
328
|
/**
|
|
154
329
|
* The name of the route.
|
|
@@ -170,16 +345,16 @@ export interface NativeTabTriggerProps {
|
|
|
170
345
|
options?: NativeTabOptions;
|
|
171
346
|
/**
|
|
172
347
|
* If true, the tab will not pop stack to the root when selected again.
|
|
173
|
-
* @default false
|
|
174
348
|
*
|
|
175
|
-
* @
|
|
349
|
+
* @default false
|
|
350
|
+
* @platform iOS
|
|
176
351
|
*/
|
|
177
352
|
disablePopToTop?: boolean;
|
|
178
353
|
/**
|
|
179
354
|
* If true, the tab will not scroll to the top when selected again.
|
|
180
355
|
* @default false
|
|
181
356
|
*
|
|
182
|
-
* @platform
|
|
357
|
+
* @platform iOS
|
|
183
358
|
*/
|
|
184
359
|
disableScrollToTop?: boolean;
|
|
185
360
|
/**
|
|
@@ -188,6 +363,70 @@ export interface NativeTabTriggerProps {
|
|
|
188
363
|
* Use `Icon`, `Label`, and `Badge` components to customize the tab.
|
|
189
364
|
*/
|
|
190
365
|
children?: React.ReactNode;
|
|
366
|
+
/**
|
|
367
|
+
* System-provided tab bar item with predefined icon and title
|
|
368
|
+
*
|
|
369
|
+
* Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with
|
|
370
|
+
* standard iOS styling and localized titles. Custom `icon` or `selectedIcon`
|
|
371
|
+
* properties will override the system icon, but the system-defined title cannot
|
|
372
|
+
* be customized.
|
|
373
|
+
*
|
|
374
|
+
* @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}
|
|
375
|
+
* @platform ios
|
|
376
|
+
*/
|
|
377
|
+
role?: NativeTabsTabBarItemRole;
|
|
378
|
+
}
|
|
379
|
+
declare const SUPPORTED_TAB_BAR_ITEM_ROLES: readonly ["bookmarks", "contacts", "downloads", "favorites", "featured", "history", "more", "mostRecent", "mostViewed", "recents", "search", "topRated"];
|
|
380
|
+
export type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];
|
|
381
|
+
export interface NativeTabsTriggerTabBarProps {
|
|
382
|
+
/**
|
|
383
|
+
* The style of the every tab label in the tab bar.
|
|
384
|
+
*
|
|
385
|
+
* @platform iOS
|
|
386
|
+
* @platform web
|
|
387
|
+
*/
|
|
388
|
+
labelStyle?: NativeTabsLabelStyle;
|
|
389
|
+
/**
|
|
390
|
+
* The background color of the tab bar, when the tab is selected
|
|
391
|
+
*/
|
|
392
|
+
backgroundColor?: ColorValue;
|
|
393
|
+
/**
|
|
394
|
+
* The color of every tab icon, when the tab is selected
|
|
395
|
+
*
|
|
396
|
+
* @platform iOS
|
|
397
|
+
*/
|
|
398
|
+
iconColor?: ColorValue;
|
|
399
|
+
/**
|
|
400
|
+
* The background color of every badge in the tab bar.
|
|
401
|
+
*
|
|
402
|
+
* @platform iOS
|
|
403
|
+
* @platform web
|
|
404
|
+
*/
|
|
405
|
+
badgeBackgroundColor?: ColorValue;
|
|
406
|
+
/**
|
|
407
|
+
* The blur effect applied to the tab bar, when the tab is selected
|
|
408
|
+
*
|
|
409
|
+
* @platform iOS
|
|
410
|
+
*/
|
|
411
|
+
blurEffect?: NativeTabsBlurEffect;
|
|
412
|
+
/**
|
|
413
|
+
* When set to `true`, the tab bar will not become transparent when scrolled to the edge.
|
|
414
|
+
*
|
|
415
|
+
* @platform iOS
|
|
416
|
+
*/
|
|
417
|
+
disableTransparentOnScrollEdge?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* The color of the badge text.
|
|
420
|
+
*
|
|
421
|
+
* @platform web
|
|
422
|
+
*/
|
|
423
|
+
badgeTextColor?: ColorValue;
|
|
424
|
+
/**
|
|
425
|
+
* The color of the tab indicator.
|
|
426
|
+
*
|
|
427
|
+
* @platform web
|
|
428
|
+
*/
|
|
429
|
+
indicatorColor?: ColorValue;
|
|
191
430
|
}
|
|
192
431
|
export {};
|
|
193
432
|
//# 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,CAA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