expo-router 58.0.28 → 58.0.30
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/android/build.gradle +2 -2
- package/build/exports.d.ts +1 -1
- package/build/exports.js +4 -0
- package/build/exports.js.map +1 -1
- package/build/global-state/router.js +2 -13
- package/build/global-state/router.js.map +1 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +5 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useCanDismiss.d.ts +16 -0
- package/build/hooks/useCanDismiss.js +28 -0
- package/build/hooks/useCanDismiss.js.map +1 -0
- package/build/hooks/useLocalSearchParams.js +17 -1
- package/build/hooks/useLocalSearchParams.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.android.js +2 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.android.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.d.ts +7 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.js +7 -4
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.android.js +4 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.android.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/context.d.ts +1 -0
- package/build/layouts/stack-utils/toolbar/context.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/getIconButtonContainerColors.d.ts +9 -0
- package/build/layouts/stack-utils/toolbar/getIconButtonContainerColors.js +18 -0
- package/build/layouts/stack-utils/toolbar/getIconButtonContainerColors.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/processHeaderItemsForPlatform.android.js +3 -1
- package/build/layouts/stack-utils/toolbar/processHeaderItemsForPlatform.android.js.map +1 -1
- package/build/link/useLinkToPathProps.js +2 -6
- package/build/link/useLinkToPathProps.js.map +1 -1
- package/build/matchers.js +13 -0
- package/build/matchers.js.map +1 -1
- package/build/react-navigation/bottom-tabs/utils/useAnimatedHashMap.js +6 -6
- package/build/react-navigation/bottom-tabs/utils/useAnimatedHashMap.js.map +1 -1
- package/build/react-navigation/bottom-tabs/views/BottomTabView.js +2 -2
- package/build/react-navigation/bottom-tabs/views/BottomTabView.js.map +1 -1
- package/build/react-navigation/core/BaseNavigationContainer.js +13 -8
- package/build/react-navigation/core/BaseNavigationContainer.js.map +1 -1
- package/build/react-navigation/core/CanDismissContext.d.ts +3 -0
- package/build/react-navigation/core/CanDismissContext.js +47 -0
- package/build/react-navigation/core/CanDismissContext.js.map +1 -0
- package/build/react-navigation/native-stack/views/NativeStackView.native.js +6 -1
- package/build/react-navigation/native-stack/views/NativeStackView.native.js.map +1 -1
- package/build/rsc/exports.d.ts +1 -0
- package/build/rsc/exports.js +7 -0
- package/build/rsc/exports.js.map +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.module → 58.0.30/expo.modules.router-58.0.30.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.pom → 58.0.30/expo.modules.router-58.0.30.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.30/expo.modules.router-58.0.30.pom.sha512 +1 -0
- package/package.json +12 -12
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/58.0.28/expo.modules.router-58.0.28.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28-sources.jar → 58.0.30/expo.modules.router-58.0.30-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28-sources.jar.md5 → 58.0.30/expo.modules.router-58.0.30-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28-sources.jar.sha1 → 58.0.30/expo.modules.router-58.0.30-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28-sources.jar.sha256 → 58.0.30/expo.modules.router-58.0.30-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28-sources.jar.sha512 → 58.0.30/expo.modules.router-58.0.30-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.aar → 58.0.30/expo.modules.router-58.0.30.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.aar.md5 → 58.0.30/expo.modules.router-58.0.30.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.aar.sha1 → 58.0.30/expo.modules.router-58.0.30.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.aar.sha256 → 58.0.30/expo.modules.router-58.0.30.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{58.0.28/expo.modules.router-58.0.28.aar.sha512 → 58.0.30/expo.modules.router-58.0.30.aar.sha512} +0 -0
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'expo.modules.router'
|
|
7
|
-
version = '58.0.
|
|
7
|
+
version = '58.0.30'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "58.0.
|
|
13
|
+
versionName "58.0.30"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
package/build/exports.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Navigator, Slot } from './views/Navigator';
|
|
2
|
-
export { useRouter, useUnstableGlobalHref, usePathname, useNavigationContainerRef, useGlobalSearchParams, useLocalSearchParams, useSegments, useRootNavigation, useRootNavigationState, useCanGoBack, useLoaderData, useCurrentRouteInfo, } from './hooks';
|
|
2
|
+
export { useRouter, useUnstableGlobalHref, usePathname, useNavigationContainerRef, useGlobalSearchParams, useLocalSearchParams, useSegments, useRootNavigation, useRootNavigationState, useCanGoBack, useCanDismiss, useLoaderData, useCurrentRouteInfo, } from './hooks';
|
|
3
3
|
export { router, type ImperativeRouter, type NavigationTransitionMode } from './imperative-api';
|
|
4
4
|
export { useIsNavigating as unstable_useIsNavigating } from './global-state/useIsNavigating';
|
|
5
5
|
export { withLayoutContext } from './layouts/withLayoutContext';
|
package/build/exports.js
CHANGED
|
@@ -46,6 +46,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
46
46
|
unstable_performance: null,
|
|
47
47
|
unstable_useIsNavigating: null,
|
|
48
48
|
unstable_useReconcileTabHistory: null,
|
|
49
|
+
useCanDismiss: null,
|
|
49
50
|
useCanGoBack: null,
|
|
50
51
|
useCurrentRouteInfo: null,
|
|
51
52
|
useFocusEffect: null,
|
|
@@ -202,6 +203,9 @@ _export(exports, {
|
|
|
202
203
|
get unstable_useReconcileTabHistory () {
|
|
203
204
|
return _useReconcileTabHistory.useReconcileTabHistory;
|
|
204
205
|
},
|
|
206
|
+
get useCanDismiss () {
|
|
207
|
+
return _hooks.useCanDismiss;
|
|
208
|
+
},
|
|
205
209
|
get useCanGoBack () {
|
|
206
210
|
return _hooks.useCanGoBack;
|
|
207
211
|
},
|
package/build/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["exports.ts"],"sourcesContent":[null],"names":["Badge","DarkTheme","DefaultTheme","ErrorBoundary","ExperimentalStack","ExpoRoot","Icon","IsWithinNativeNavigator","Label","LocaleProvider","NativeStackView","NavigationAwareActivity","Navigator","RouterActionHandling","Sitemap","Slot","SplashScreen","StackRouter","SuspenseFallback","TabRouter","Tabs","ThemeProvider","Unmatched","VectorIcon","attachRouteState","createBaseStackProps","createBaseTabProps","createNativeStackProps","createStandardRouterNavigator","enableLegacyHeaderAppearance","extendRouter","extendRouterActions","integrateWithRouter","isActionHandled","router","unstable_PerformanceObserver","unstable_createStandardRouterNavigator","unstable_enablePerformanceIntegration","unstable_integrateWithRouter","unstable_performance","unstable_useIsNavigating","useIsNavigating","unstable_useReconcileTabHistory","useReconcileTabHistory","useCanGoBack","useCurrentRouteInfo","useFocusEffect","useGlobalSearchParams","useIsFocused","useLoaderData","useLocalSearchParams","useNavigation","useNavigationContainerRef","usePathname","usePreventRemove","useRootNavigation","useRootNavigationState","useRoute","useRoutePath","useRouter","useScrollToTop","useSegments","useSitemap","useTheme","useUnstableGlobalHref","withLayoutContext"],"mappings":"AAAA,kBAAkB
|
|
1
|
+
{"version":3,"sources":["exports.ts"],"sourcesContent":[null],"names":["Badge","DarkTheme","DefaultTheme","ErrorBoundary","ExperimentalStack","ExpoRoot","Icon","IsWithinNativeNavigator","Label","LocaleProvider","NativeStackView","NavigationAwareActivity","Navigator","RouterActionHandling","Sitemap","Slot","SplashScreen","StackRouter","SuspenseFallback","TabRouter","Tabs","ThemeProvider","Unmatched","VectorIcon","attachRouteState","createBaseStackProps","createBaseTabProps","createNativeStackProps","createStandardRouterNavigator","enableLegacyHeaderAppearance","extendRouter","extendRouterActions","integrateWithRouter","isActionHandled","router","unstable_PerformanceObserver","unstable_createStandardRouterNavigator","unstable_enablePerformanceIntegration","unstable_integrateWithRouter","unstable_performance","unstable_useIsNavigating","useIsNavigating","unstable_useReconcileTabHistory","useReconcileTabHistory","useCanDismiss","useCanGoBack","useCurrentRouteInfo","useFocusEffect","useGlobalSearchParams","useIsFocused","useLoaderData","useLocalSearchParams","useNavigation","useNavigationContainerRef","usePathname","usePreventRemove","useRootNavigation","useRootNavigationState","useRoute","useRoutePath","useRouter","useScrollToTop","useSegments","useSitemap","useTheme","useUnstableGlobalHref","withLayoutContext"],"mappings":"AAAA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoEhBA;eAAAA,iBAAK;;QApBEC;eAAAA,oBAAS;;QACTC;eAAAA,0BAAY;;QAlBZC;eAAAA,4BAAa;;QAuIbC;eAAAA,oCAAiB;;QA5IjBC;eAAAA,kBAAQ;;QA4CfC;eAAAA,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AAAA,0BAAY;;QAlDnBC;eAAAA,gBAAS;;QAmDFC;eAAAA,8BAAc;;QA7CrBC;eAAAA,kBAAW;;QAmBJC;eAAAA,sBAAU;;QAsBVC;eAAAA,kBAAQ;;QA9CfC;eAAAA,4BAAqB;;QAiBdC;eAAAA,oCAAiB;;;2BArBM;uBAgBzB;+BAEsE;iCACjB;mCAE1B;0BAIT;2BACC;yBACF;4BACqB;+BAEf;kCAC+B;yCACrB;gEAOV;+BAGA;gCACsB;8BACvB;2BAGH;8BACG;+BACC;0BACL;gCACgC;8BAE5B;gCACE;0BACN;kCAIlB;4BAgBA;oCAQA;wCACmE;sCASrC;oCACF;wCACI;yBAchC;6BACyB;kCACa;6BAkCtC;sBAkBc;mCAEa"}
|
|
@@ -103,7 +103,7 @@ function _reactnative() {
|
|
|
103
103
|
}
|
|
104
104
|
const _emitDomEvent = require("../domComponents/emitDomEvent");
|
|
105
105
|
const _href = require("../link/href");
|
|
106
|
-
const
|
|
106
|
+
const _CanDismissContext = require("../react-navigation/core/CanDismissContext");
|
|
107
107
|
const _url = require("../utils/url");
|
|
108
108
|
const _navigationRef = require("./navigationRef");
|
|
109
109
|
function _getRequireWildcardCache(nodeInterop) {
|
|
@@ -246,18 +246,7 @@ function canDismiss() {
|
|
|
246
246
|
return false;
|
|
247
247
|
}
|
|
248
248
|
// TODO(@ubax): check whether this is still needed
|
|
249
|
-
|
|
250
|
-
// Keep traversing down the state tree until we find a stack navigator that we can pop
|
|
251
|
-
while(state){
|
|
252
|
-
// TODO(ENG-22019): Detect typeless stacks, including anchor/initialRouteName states that start
|
|
253
|
-
// with multiple routes.
|
|
254
|
-
if (state.type === 'stack' && (0, _stack.getHistoryLength)(state) > 1) {
|
|
255
|
-
return true;
|
|
256
|
-
}
|
|
257
|
-
if (state.index === undefined) return false;
|
|
258
|
-
state = state.routes?.[state.index]?.state;
|
|
259
|
-
}
|
|
260
|
-
return false;
|
|
249
|
+
return (0, _CanDismissContext.getCanDismiss)(_navigationRef.navigationRef.getRootState());
|
|
261
250
|
}
|
|
262
251
|
function setParams(params = {}) {
|
|
263
252
|
if ((0, _emitDomEvent.emitDomSetParams)(params)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["global-state/router.ts"],"sourcesContent":[null],"names":["canDismiss","canGoBack","createImperativeRouter","dismiss","dismissAll","dismissTo","getDefaultTransitionMode","goBack","linkTo","navigate","prefetch","push","reload","replace","router","setParams","unboundRouter","assertIsMounted","navigationRef","current","Error","navigateImpl","enqueue","url","options","linkToImpl","resolveHref","event","prefetchImpl","href","pushImpl","enqueueAction","action","inTransition","type","payload","dismissImpl","count","emitDomDismiss","dismissToImpl","replaceImpl","dismissAllImpl","emitDomDismissAll","goBackImpl","emitDomGoBack","IS_DOM","
|
|
1
|
+
{"version":3,"sources":["global-state/router.ts"],"sourcesContent":[null],"names":["canDismiss","canGoBack","createImperativeRouter","dismiss","dismissAll","dismissTo","getDefaultTransitionMode","goBack","linkTo","navigate","prefetch","push","reload","replace","router","setParams","unboundRouter","assertIsMounted","navigationRef","current","Error","navigateImpl","enqueue","url","options","linkToImpl","resolveHref","event","prefetchImpl","href","pushImpl","enqueueAction","action","inTransition","type","payload","dismissImpl","count","emitDomDismiss","dismissToImpl","replaceImpl","dismissAllImpl","emitDomDismissAll","goBackImpl","emitDomGoBack","IS_DOM","getCanDismiss","getRootState","params","emitDomSetParams","originalHref","navigationOptions","emitDomLinkEvent","shouldLinkExternally","startsWith","Platform","OS","Linking","openURL","linkAction","setTransitionMode","back","mode","setDefaultTransitionMode","throwBeforeFirstRender","defaultTransitionMode","args"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkIgBA;eAAAA;;QAjBAC;eAAAA;;QA2KAC;eAAAA;;QA+DHC;eAAAA;;QACAC;eAAAA;;QAEAC;eAAAA;;QAlCGC;eAAAA;;QAqCHC;eAAAA;;QAGAC;eAAAA;;QAZAC;eAAAA;;QAUAC;eAAAA;;QARAC;eAAAA;;QAl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RouteInfo';
|
|
2
2
|
export { useRootNavigationState } from './useRootNavigationState';
|
|
3
3
|
export { useCanGoBack } from './useCanGoBack';
|
|
4
|
+
export { useCanDismiss } from './useCanDismiss';
|
|
4
5
|
export { useRootNavigation } from './useRootNavigation';
|
|
5
6
|
export { useNavigationContainerRef } from './useNavigationContainerRef';
|
|
6
7
|
export { useRouter } from './useRouter';
|
package/build/hooks/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
0 && (module.exports = {
|
|
6
|
+
useCanDismiss: null,
|
|
6
7
|
useCanGoBack: null,
|
|
7
8
|
useCurrentRouteInfo: null,
|
|
8
9
|
useGlobalSearchParams: null,
|
|
@@ -25,6 +26,9 @@ function _export(target, all) {
|
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
_export(exports, {
|
|
29
|
+
get useCanDismiss () {
|
|
30
|
+
return _useCanDismiss.useCanDismiss;
|
|
31
|
+
},
|
|
28
32
|
get useCanGoBack () {
|
|
29
33
|
return _useCanGoBack.useCanGoBack;
|
|
30
34
|
},
|
|
@@ -71,6 +75,7 @@ _export(exports, {
|
|
|
71
75
|
const _useRouteInfo = require("../global-state/useRouteInfo");
|
|
72
76
|
const _useRootNavigationState = require("./useRootNavigationState");
|
|
73
77
|
const _useCanGoBack = require("./useCanGoBack");
|
|
78
|
+
const _useCanDismiss = require("./useCanDismiss");
|
|
74
79
|
const _useRootNavigation = require("./useRootNavigation");
|
|
75
80
|
const _useNavigationContainerRef = require("./useNavigationContainerRef");
|
|
76
81
|
const _useRouter = require("./useRouter");
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hooks/index.ts"],"sourcesContent":[null],"names":["useCanGoBack","useCurrentRouteInfo","useGlobalSearchParams","useLoaderData","useLocalSearchParams","useNavigationContainerRef","usePathname","useRootNavigation","useRootNavigationState","useRouteInfo","useRouter","useSearchParams","useSegments","useUnstableGlobalHref"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["hooks/index.ts"],"sourcesContent":[null],"names":["useCanDismiss","useCanGoBack","useCurrentRouteInfo","useGlobalSearchParams","useLoaderData","useLocalSearchParams","useNavigationContainerRef","usePathname","useRootNavigation","useRootNavigationState","useRouteInfo","useRouter","useSearchParams","useSegments","useUnstableGlobalHref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGSA;eAAAA,4BAAa;;QADbC;eAAAA,0BAAY;;QAYZC;eAAAA,wCAAmB;;QAJnBC;eAAAA,4CAAqB;;QAGrBC;eAAAA,4BAAa;;QAFbC;eAAAA,0CAAoB;;QANpBC;eAAAA,oDAAyB;;QAIzBC;eAAAA,wBAAW;;QALXC;eAAAA,oCAAiB;;QAHjBC;eAAAA,8CAAsB;;QADtBC;eAAAA,0BAAY;;QAMZC;eAAAA,oBAAS;;QAMTC;eAAAA,gCAAe;;QAJfC;eAAAA,wBAAW;;QADXC;eAAAA,4CAAqB;;;8BAPD;wCACU;8BACV;+BACC;mCACI;2CACQ;2BAChB;uCACY;6BACV;6BACA;uCACU;sCACD;iCACL;+BACF;qCACM"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the same value as `router.canDismiss()` and re-renders when it changes. Unlike
|
|
3
|
+
* `router.canDismiss()`, it is correct during render.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import { router, useCanDismiss } from 'expo-router';
|
|
8
|
+
* import { Button } from 'react-native';
|
|
9
|
+
*
|
|
10
|
+
* export default function CloseButton() {
|
|
11
|
+
* const canDismiss = useCanDismiss();
|
|
12
|
+
* return canDismiss ? <Button title="Close" onPress={() => router.dismiss()} /> : null;
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useCanDismiss(): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useCanDismiss", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return useCanDismiss;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function _react() {
|
|
13
|
+
const data = require("react");
|
|
14
|
+
_react = function() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
const _CanDismissContext = require("../react-navigation/core/CanDismissContext");
|
|
20
|
+
function useCanDismiss() {
|
|
21
|
+
const canDismiss = (0, _react().use)(_CanDismissContext.CanDismissContext);
|
|
22
|
+
if (canDismiss === undefined) {
|
|
23
|
+
throw new Error('`useCanDismiss` was called from a component rendered outside the Expo Router root. Render the component inside `ExpoRoot`.');
|
|
24
|
+
}
|
|
25
|
+
return canDismiss;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=useCanDismiss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["hooks/useCanDismiss.ts"],"sourcesContent":[null],"names":["useCanDismiss","canDismiss","use","CanDismissContext","undefined","Error"],"mappings":"AAAA;;;;;+BAqBgBA;;;eAAAA;;;;yBAnBI;;;;;;mCAEc;AAiB3B,SAASA;IACd,MAAMC,aAAaC,IAAAA,YAAG,EAACC,oCAAiB;IACxC,IAAIF,eAAeG,WAAW;QAC5B,MAAM,IAAIC,MACR;IAEJ;IACA,OAAOJ;AACT"}
|
|
@@ -18,14 +18,30 @@ function _react() {
|
|
|
18
18
|
}
|
|
19
19
|
const _Route = require("../Route");
|
|
20
20
|
const _PreviewRouteContext = require("../link/preview/PreviewRouteContext");
|
|
21
|
+
const _NavigationStateContext = require("../react-navigation/core/NavigationStateContext");
|
|
21
22
|
function _interop_require_default(obj) {
|
|
22
23
|
return obj && obj.__esModule ? obj : {
|
|
23
24
|
default: obj
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
function useLocalSearchParams() {
|
|
27
|
-
|
|
28
|
+
let params = _react().default.use(_Route.LocalRouteParamsContext) ?? {};
|
|
29
|
+
const node = (0, _Route.useRouteNode)();
|
|
28
30
|
const { params: previewParams } = (0, _PreviewRouteContext.usePreviewInfo)();
|
|
31
|
+
if (node?.type === 'layout' && !previewParams) {
|
|
32
|
+
// TODO(@ubax): Reading this context re-renders the layout on any navigation, even when params do not
|
|
33
|
+
// change; outside it via https://github.com/react/react/issues/35397. Investigate a selector subscription.
|
|
34
|
+
let { state } = _react().default.use(_NavigationStateContext.NavigationStateContext);
|
|
35
|
+
while(state){
|
|
36
|
+
const child = state.routes[state.index ?? 0];
|
|
37
|
+
if (!child) break;
|
|
38
|
+
params = {
|
|
39
|
+
...params,
|
|
40
|
+
...child.params
|
|
41
|
+
};
|
|
42
|
+
state = child.state;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
29
45
|
return Object.fromEntries(Object.entries(previewParams ?? params).map(([key, value])=>{
|
|
30
46
|
// React Navigation doesn't remove `undefined` values from the params object, and you cannot remove them via
|
|
31
47
|
// `navigation.setParams()` as it shallow merges. Hence, we hide them here. We also pass `null` through unchanged
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hooks/useLocalSearchParams.ts"],"sourcesContent":[null],"names":["useLocalSearchParams","params","React","use","LocalRouteParamsContext","previewParams","usePreviewInfo","Object","fromEntries","entries","map","key","value","Array","isArray","v","decodeURIComponent"],"mappings":"AAAA;;;;;+
|
|
1
|
+
{"version":3,"sources":["hooks/useLocalSearchParams.ts"],"sourcesContent":[null],"names":["useLocalSearchParams","params","React","use","LocalRouteParamsContext","node","useRouteNode","previewParams","usePreviewInfo","type","state","NavigationStateContext","child","routes","index","Object","fromEntries","entries","map","key","value","Array","isArray","v","decodeURIComponent"],"mappings":"AAAA;;;;;+BAgDgBA;;;eAAAA;;;;gEA9CE;;;;;;uBAEoC;qCACvB;wCACQ;;;;;;AA0ChC,SAASA;IACd,IAAIC,SAASC,gBAAK,CAACC,GAAG,CAACC,8BAAuB,KAAK,CAAC;IACpD,MAAMC,OAAOC,IAAAA,mBAAY;IACzB,MAAM,EAAEL,QAAQM,aAAa,EAAE,GAAGC,IAAAA,mCAAc;IAEhD,IAAIH,MAAMI,SAAS,YAAY,CAACF,eAAe;QAC7C,qGAAqG;QACrG,2GAA2G;QAC3G,IAAI,EAAEG,KAAK,EAAE,GAAGR,gBAAK,CAACC,GAAG,CAACQ,8CAAsB;QAChD,MAAOD,MAAO;YACZ,MAAME,QAAQF,MAAMG,MAAM,CAACH,MAAMI,KAAK,IAAI,EAAE;YAC5C,IAAI,CAACF,OAAO;YACZX,SAAS;gBAAE,GAAGA,MAAM;gBAAE,GAAGW,MAAMX,MAAM;YAAC;YACtCS,QAAQE,MAAMF,KAAK;QACrB;IACF;IAEA,OAAOK,OAAOC,WAAW,CACvBD,OAAOE,OAAO,CAACV,iBAAiBN,QAAQiB,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM;QACvD,4GAA4G;QAC5G,iHAAiH;QACjH,yGAAyG;QACzG,IAAIA,SAAS,MAAM;YACjB,OAAO;gBAACD;gBAAKC;aAAM;QACrB;QAEA,IAAIC,MAAMC,OAAO,CAACF,QAAQ;YACxB,OAAO;gBACLD;gBACAC,MAAMF,GAAG,CAAC,CAACK;oBACT,IAAI;wBACF,OAAOC,mBAAmBD;oBAC5B,EAAE,OAAM;wBACN,OAAOA;oBACT;gBACF;aACD;QACH,OAAO;YACL,IAAI;gBACF,OAAO;oBAACJ;oBAAKK,mBAAmBJ;iBAAiB;YACnD,EAAE,OAAM;gBACN,OAAO;oBAACD;oBAAKC;iBAAM;YACrB;QACF;IACF;AAEJ"}
|
|
@@ -21,6 +21,7 @@ const _AnimatedItemContainer = require("../../../../toolbar/AnimatedItemContaine
|
|
|
21
21
|
const _ToolbarItemBadge = require("../ToolbarItemBadge");
|
|
22
22
|
const _context = require("../context");
|
|
23
23
|
const _defaults = require("../defaults");
|
|
24
|
+
const _getIconButtonContainerColors = require("../getIconButtonContainerColors");
|
|
24
25
|
const NativeToolbarButton = (props)=>{
|
|
25
26
|
const toolbarColors = (0, _context.useToolbarColors)();
|
|
26
27
|
if (!props.source) {
|
|
@@ -37,6 +38,7 @@ const NativeToolbarButton = (props)=>{
|
|
|
37
38
|
const button = /*#__PURE__*/ (0, _jsxruntime().jsx)(IconButton, {
|
|
38
39
|
onClick: props.onPress,
|
|
39
40
|
enabled: !props.disabled,
|
|
41
|
+
colors: (0, _getIconButtonContainerColors.getIconButtonContainerColors)(toolbarColors.buttonContainerColor),
|
|
40
42
|
children: /*#__PURE__*/ (0, _jsxruntime().jsx)(Icon, {
|
|
41
43
|
source: props.source,
|
|
42
44
|
tint: tintColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["layouts/stack-utils/toolbar/StackToolbarButton/native.android.tsx"],"sourcesContent":[null],"names":["NativeToolbarButton","props","toolbarColors","useToolbarColors","source","process","env","NODE_ENV","console","warn","expoUI","Icon","IconButton","requireExpoUI","tintColor","imageRenderingMode","DEFAULT_TOOLBAR_TINT_COLOR","button","onClick","onPress","enabled","disabled","tint","size","contentDescription","getBadgeContentDescription","accessibilityLabel","badge","AnimatedItemContainer","visible","hidden","ToolbarItemBadge"],"mappings":"AAAA;;;;;+
|
|
1
|
+
{"version":3,"sources":["layouts/stack-utils/toolbar/StackToolbarButton/native.android.tsx"],"sourcesContent":[null],"names":["NativeToolbarButton","props","toolbarColors","useToolbarColors","source","process","env","NODE_ENV","console","warn","expoUI","Icon","IconButton","requireExpoUI","tintColor","imageRenderingMode","DEFAULT_TOOLBAR_TINT_COLOR","button","onClick","onPress","enabled","disabled","colors","getIconButtonContainerColors","buttonContainerColor","tint","size","contentDescription","getBadgeContentDescription","accessibilityLabel","badge","AnimatedItemContainer","visible","hidden","ToolbarItemBadge"],"mappings":"AAAA;;;;;+BAcaA;;;eAAAA;;;;;;;;;;wBAZiB;uCACQ;kCACuB;yBAC5B;0BACU;8CACE;AAOtC,MAAMA,sBAA0D,CAACC;IACtE,MAAMC,gBAAgBC,IAAAA,yBAAgB;IAEtC,IAAI,CAACF,MAAMG,MAAM,EAAE;QACjB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzCC,QAAQC,IAAI,CACV;QAEJ;QACA,OAAO;IACT;IACA,MAAM,EACJC,QAAQ,EAAEC,IAAI,EAAEC,UAAU,EAAE,EAC7B,GAAGC,IAAAA,qBAAa,EACf;IAGF,0EAA0E;IAC1E,4EAA4E;IAC5E,wCAAwC;IACxC,MAAMC,YACJb,MAAMc,kBAAkB,KAAK,aACzB,OACCd,MAAMa,SAAS,IAAIZ,cAAcY,SAAS,IAAIE,IAAAA,oCAA0B;IAE/E,MAAMC,uBACJ,uBAACL;QACCM,SAASjB,MAAMkB,OAAO;QACtBC,SAAS,CAACnB,MAAMoB,QAAQ;QACxBC,QAAQC,IAAAA,0DAA4B,EAACrB,cAAcsB,oBAAoB;kBACvE,cAAA,uBAACb;YACCP,QAAQH,MAAMG,MAAM;YACpBqB,MAAMX;YACNY,MAAM;YACNC,oBAAoBC,IAAAA,4CAA0B,EAAC3B,MAAM4B,kBAAkB,EAAE5B,MAAM6B,KAAK;;;IAK1F,qBACE,uBAACC,4CAAqB;QAACC,SAAS,CAAC/B,MAAMgC,MAAM;kBAC3C,cAAA,uBAACC,kCAAgB;YAACJ,OAAO7B,MAAM6B,KAAK;YAAET,UAAUpB,MAAMoB,QAAQ;sBAC3DJ;;;AAIT"}
|
|
@@ -59,6 +59,13 @@ export interface StackToolbarProps {
|
|
|
59
59
|
* @platform android
|
|
60
60
|
*/
|
|
61
61
|
backgroundColor?: ColorValue;
|
|
62
|
+
/**
|
|
63
|
+
* Color of the round container behind each header button and menu button.
|
|
64
|
+
* Use it to keep buttons visible over content, like a photo or a map.
|
|
65
|
+
*
|
|
66
|
+
* @platform android
|
|
67
|
+
*/
|
|
68
|
+
buttonContainerColor?: ColorValue;
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
64
71
|
* The component used to configure the stack toolbar.
|
|
@@ -88,7 +88,7 @@ const StackToolbarBottom = ({ children, disableImePadding, tintColor, background
|
|
|
88
88
|
})
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
|
-
const StackToolbarHeader = ({ children, placement, asChild, disableImePadding, tintColor, backgroundColor })=>{
|
|
91
|
+
const StackToolbarHeader = ({ children, placement, asChild, disableImePadding, tintColor, backgroundColor, buttonContainerColor })=>{
|
|
92
92
|
if (placement !== 'left' && placement !== 'right') {
|
|
93
93
|
throw new Error(`Invalid placement "${placement}" for Stack.Toolbar. Expected "left" or "right".`);
|
|
94
94
|
}
|
|
@@ -99,14 +99,16 @@ const StackToolbarHeader = ({ children, placement, asChild, disableImePadding, t
|
|
|
99
99
|
asChild,
|
|
100
100
|
disableImePadding,
|
|
101
101
|
tintColor,
|
|
102
|
-
backgroundColor
|
|
102
|
+
backgroundColor,
|
|
103
|
+
buttonContainerColor
|
|
103
104
|
}), [
|
|
104
105
|
children,
|
|
105
106
|
placement,
|
|
106
107
|
asChild,
|
|
107
108
|
disableImePadding,
|
|
108
109
|
tintColor,
|
|
109
|
-
backgroundColor
|
|
110
|
+
backgroundColor,
|
|
111
|
+
buttonContainerColor
|
|
110
112
|
]);
|
|
111
113
|
(0, _compositionoptions.useCompositionOption)(options);
|
|
112
114
|
return null;
|
|
@@ -119,7 +121,8 @@ function appendStackToolbarPropsToOptions(options, props) {
|
|
|
119
121
|
}
|
|
120
122
|
const colors = {
|
|
121
123
|
tintColor: props.tintColor,
|
|
122
|
-
backgroundColor: props.backgroundColor
|
|
124
|
+
backgroundColor: props.backgroundColor,
|
|
125
|
+
buttonContainerColor: props.buttonContainerColor
|
|
123
126
|
};
|
|
124
127
|
if (asChild) {
|
|
125
128
|
const wrappedChildren = /*#__PURE__*/ (0, _jsxruntime().jsx)(_context.ToolbarColorContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["layouts/stack-utils/toolbar/StackToolbarClient.tsx"],"sourcesContent":[null],"names":["StackToolbar","appendStackToolbarPropsToOptions","props","parentPlacement","useToolbarPlacement","Error","placement","StackToolbarBottom","StackToolbarHeader","key","children","disableImePadding","tintColor","backgroundColor","colors","useMemo","ToolbarPlacementContext","Provider","value","ToolbarColorContext","NativeMenuContext","RouterToolbarHost","withImePadding","asChild","options","useCompositionOption","wrappedChildren","headerShown","headerLeft","headerRight","processHeaderItemsForPlatform","Button","StackToolbarButton","Menu","StackToolbarMenu","MenuAction","StackToolbarMenuAction","SearchBarSlot","StackToolbarSearchBarSlot","Spacer","StackToolbarSpacer","View","StackToolbarView","Label","StackToolbarLabel","Icon","StackToolbarIcon","Badge","StackToolbarBadge"],"mappings":"AAAA;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["layouts/stack-utils/toolbar/StackToolbarClient.tsx"],"sourcesContent":[null],"names":["StackToolbar","appendStackToolbarPropsToOptions","props","parentPlacement","useToolbarPlacement","Error","placement","StackToolbarBottom","StackToolbarHeader","key","children","disableImePadding","tintColor","backgroundColor","colors","useMemo","ToolbarPlacementContext","Provider","value","ToolbarColorContext","NativeMenuContext","RouterToolbarHost","withImePadding","asChild","buttonContainerColor","options","useCompositionOption","wrappedChildren","headerShown","headerLeft","headerRight","processHeaderItemsForPlatform","Button","StackToolbarButton","Menu","StackToolbarMenu","MenuAction","StackToolbarMenuAction","SearchBarSlot","StackToolbarSearchBarSlot","Spacer","StackToolbarSpacer","View","StackToolbarView","Label","StackToolbarLabel","Icon","StackToolbarIcon","Badge","StackToolbarBadge"],"mappings":"AAAA;;;;;;;;;;;;;;;;;QAuJaA;eAAAA;;QAiFGC;eAAAA;;QAiDhB;eAAA;;;;;;;;;;;yBAxRwC;;;;;;oCAGH;mCACH;wBAEA;oCACC;kCACsB;2CACf;oCACP;kCACF;yBA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AoB,EAACD;IAErB,OAAO;AACT;AAEO,SAASxB,iCACdwB,OAAqC,EACrCvB,KAAwB;IAExB,MAAM,EAAEQ,QAAQ,EAAEJ,YAAY,QAAQ,EAAEiB,OAAO,EAAE,GAAGrB;IAEpD,IAAII,cAAc,UAAU;QAC1B,mDAAmD;QACnD,OAAOmB;IACT;IAEA,MAAMX,SAAwB;QAC5BF,WAAWV,MAAMU,SAAS;QAC1BC,iBAAiBX,MAAMW,eAAe;QACtCW,sBAAsBtB,MAAMsB,oBAAoB;IAClD;IAEA,IAAID,SAAS;QACX,MAAMI,gCACJ,uBAACR,4BAAmB,CAACF,QAAQ;YAACC,OAAOJ;sBAASJ;;QAEhD,IAAIJ,cAAc,QAAQ;YACxB,OAAO;gBACL,GAAGmB,OAAO;gBACVG,aAAa;gBACbC,YAAY,IAAMF;YACpB;QACF,OAAO;YACL,OAAO;gBACL,GAAGF,OAAO;gBACVG,aAAa;gBACbE,aAAa,IAAMH;YACrB;QACF;IACF;IAEA,OAAO;QAAE,GAAGF,OAAO;QAAE,GAAIM,IAAAA,4DAA6B,EAACrB,UAAUJ,WAAWQ,WAAW,CAAC,CAAC;IAAE;AAC7F;AAEAd,aAAagC,MAAM,GAAGC,sCAAkB;AACxCjC,aAAakC,IAAI,GAAGC,kCAAgB;AACpCnC,aAAaoC,UAAU,GAAGC,wCAAsB;AAChDrC,aAAasC,aAAa,GAAGC,oDAAyB;AACtDvC,aAAawC,MAAM,GAAGC,sCAAkB;AACxCzC,aAAa0C,IAAI,GAAGC,kCAAgB;AACpC3C,aAAa4C,KAAK,GAAGC,oCAAiB;AACtC7C,aAAa8C,IAAI,GAAGC,mCAAgB;AACpC/C,aAAagD,KAAK,GAAGC,oCAAiB;MAEtC,WAAejD"}
|
|
@@ -42,6 +42,7 @@ const _children = require("../../../../utils/children");
|
|
|
42
42
|
const _ToolbarItemBadge = require("../ToolbarItemBadge");
|
|
43
43
|
const _context = require("../context");
|
|
44
44
|
const _defaults = require("../defaults");
|
|
45
|
+
const _getIconButtonContainerColors = require("../getIconButtonContainerColors");
|
|
45
46
|
const arrowRightIcon = require('../../../../../assets/arrow_right.xml');
|
|
46
47
|
const checkmarkIcon = require('../../../../../assets/checkmark.xml');
|
|
47
48
|
/**
|
|
@@ -143,7 +144,9 @@ const NativeToolbarMenu = (props)=>{
|
|
|
143
144
|
const iconButton = /*#__PURE__*/ (0, _jsxruntime().jsx)(IconButton, {
|
|
144
145
|
onClick: ()=>setExpanded(true),
|
|
145
146
|
enabled: !props.disabled,
|
|
146
|
-
|
|
147
|
+
colors: (0, _getIconButtonContainerColors.getIconButtonContainerColors)(toolbarColors.buttonContainerColor),
|
|
148
|
+
// The background modifier would paint a square behind the round container
|
|
149
|
+
modifiers: toolbarColors.buttonContainerColor ? [] : [
|
|
147
150
|
background(backgroundColor)
|
|
148
151
|
],
|
|
149
152
|
children: /*#__PURE__*/ (0, _jsxruntime().jsx)(Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["layouts/stack-utils/toolbar/StackToolbarMenu/native.android.tsx"],"sourcesContent":[null],"names":["NativeToolbarMenu","NativeToolbarMenuAction","arrowRightIcon","require","checkmarkIcon","ToolbarMenuCloseContext","createContext","props","expoUI","DropdownMenu","DropdownMenuItem","HorizontalDivider","Icon","IconButton","Text","ComposeText","modifiers","background","requireExpoUI","expanded","setExpanded","useState","parentClose","use","isNested","toolbarColors","useToolbarColors","tintColor","DEFAULT_TOOLBAR_TINT_COLOR","sourceTint","imageRenderingMode","backgroundColor","DEFAULT_TOOLBAR_BACKGROUND_COLOR","closeMenu","useCallback","process","env","NODE_ENV","badge","console","warn","inline","children","trailingIcon","TrailingIcon","source","tint","size","leadingIcon","LeadingIcon","onDismissRequest","color","cornerRadius","Trigger","onClick","disabled","enabled","label","Items","value","iconButton","contentDescription","getBadgeContentDescription","accessibilityLabel","AnimatedItemContainer","visible","hidden","ToolbarItemBadge","destructive","DEFAULT_DESTRUCTIVE_COLOR","handleClick","onPress","unstable_keepPresented","areChildrenString","getFirstChildOfType","Label","isOn"],"mappings":"AAAA;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["layouts/stack-utils/toolbar/StackToolbarMenu/native.android.tsx"],"sourcesContent":[null],"names":["NativeToolbarMenu","NativeToolbarMenuAction","arrowRightIcon","require","checkmarkIcon","ToolbarMenuCloseContext","createContext","props","expoUI","DropdownMenu","DropdownMenuItem","HorizontalDivider","Icon","IconButton","Text","ComposeText","modifiers","background","requireExpoUI","expanded","setExpanded","useState","parentClose","use","isNested","toolbarColors","useToolbarColors","tintColor","DEFAULT_TOOLBAR_TINT_COLOR","sourceTint","imageRenderingMode","backgroundColor","DEFAULT_TOOLBAR_BACKGROUND_COLOR","closeMenu","useCallback","process","env","NODE_ENV","badge","console","warn","inline","children","trailingIcon","TrailingIcon","source","tint","size","leadingIcon","LeadingIcon","onDismissRequest","color","cornerRadius","Trigger","onClick","disabled","enabled","label","Items","value","iconButton","colors","getIconButtonContainerColors","buttonContainerColor","contentDescription","getBadgeContentDescription","accessibilityLabel","AnimatedItemContainer","visible","hidden","ToolbarItemBadge","destructive","DEFAULT_DESTRUCTIVE_COLOR","handleClick","onPress","unstable_keepPresented","areChildrenString","getFirstChildOfType","Label","isOn"],"mappings":"AAAA;;;;;;;;;;;;;;;;QA+BaA;eAAAA;;QAkJAC;eAAAA;;;;;;;;;;;yBAhL6C;;;;;;wBAE5B;4BACR;uCACgB;0BACF;kCACyB;yBAC5B;0BAK1B;8CACsC;AAG7C,MAAMC,iBAAiBC,QAAQ;AAC/B,MAAMC,gBAAgBD,QAAQ;AAE9B;;;;CAIC,GACD,MAAME,wCAA0BC,IAAAA,sBAAa,EAAsB;AAM5D,MAAMN,oBAAsD,CAACO;IAClE,MAAM,EACJC,QAAQ,EACNC,YAAY,EACZC,gBAAgB,EAChBC,iBAAiB,EACjBC,IAAI,EACJC,UAAU,EACVC,MAAMC,WAAW,EAClB,EACDC,WAAW,EAAEC,UAAU,EAAE,E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uBAAC7C,iBAAiBI,IAAI;0BACpB,cAAA,uBAACC;oBAAYoC,OAAOxB;8BAAY8B;;;YAEjClD,MAAMsC,MAAM,kBACX,uBAACnC,iBAAiBuC,WAAW;0BAC3B,cAAA,uBAACrC;oBAAKiC,QAAQtC,MAAMsC,MAAM;oBAAEC,MAAMnB;oBAAWoB,MAAM;;;YAGtDxC,MAAMwE,IAAI,kBACT,uBAACrE,iBAAiBkC,YAAY;0BAC5B,cAAA,uBAAChC;oBAAKiC,QAAQzC;oBAAe0C,MAAMnB;oBAAWoB,MAAM;;;;;AAK9D"}
|
|
@@ -10,6 +10,7 @@ export declare function useToolbarPlacement(): ToolbarPlacement | null;
|
|
|
10
10
|
export interface ToolbarColors {
|
|
11
11
|
tintColor?: ColorValue;
|
|
12
12
|
backgroundColor?: ColorValue;
|
|
13
|
+
buttonContainerColor?: ColorValue;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Context for toolbar-level colors that cascade to child components (Button, Menu, etc.).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["layouts/stack-utils/toolbar/context.tsx"],"sourcesContent":[null],"names":["ToolbarColorContext","ToolbarPlacementContext","useToolbarColors","useToolbarPlacement","createContext","useContext"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["layouts/stack-utils/toolbar/context.tsx"],"sourcesContent":[null],"names":["ToolbarColorContext","ToolbarPlacementContext","useToolbarColors","useToolbarPlacement","createContext","useContext"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;QA2BaA;eAAAA;;QAhBAC;eAAAA;;QAkBGC;eAAAA;;QAhBAC;eAAAA;;;;yBAZ0B;;;;;;AAUnC,MAAMF,wCAA0BG,IAAAA,sBAAa,EAA0B;AAEvE,SAASD;IACd,OAAOE,IAAAA,mBAAU,EAACJ;AACpB;AAYO,MAAMD,oCAAsBI,IAAAA,sBAAa,EAAgB,CAAC;AAE1D,SAASF;IACd,OAAOG,IAAAA,mBAAU,EAACL;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColorValue } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Colors for an `IconButton`'s container. Returns `{}` when unset, since Expo UI
|
|
4
|
+
* doesn't reset a prop that becomes `undefined`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getIconButtonContainerColors(buttonContainerColor: ColorValue | undefined): {
|
|
7
|
+
containerColor?: ColorValue;
|
|
8
|
+
disabledContainerColor?: ColorValue;
|
|
9
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getIconButtonContainerColors", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getIconButtonContainerColors;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function getIconButtonContainerColors(buttonContainerColor) {
|
|
12
|
+
return buttonContainerColor ? {
|
|
13
|
+
containerColor: buttonContainerColor,
|
|
14
|
+
disabledContainerColor: buttonContainerColor
|
|
15
|
+
} : {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=getIconButtonContainerColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["layouts/stack-utils/toolbar/getIconButtonContainerColors.ts"],"sourcesContent":[null],"names":["getIconButtonContainerColors","buttonContainerColor","containerColor","disabledContainerColor"],"mappings":";;;;+BAMgBA;;;eAAAA;;;AAAT,SAASA,6BAA6BC,oBAA4C;IAIvF,OAAOA,uBACH;QAAEC,gBAAgBD;QAAsBE,wBAAwBF;IAAqB,IACrF,CAAC;AACP"}
|
|
@@ -52,9 +52,11 @@ function HeaderToolbarHostBase({ children, placement, colors, headerProps }) {
|
|
|
52
52
|
const { expoUI: { Host, Row } } = (0, _expoui.requireExpoUI)("Stack.Toolbar on Android requires '@expo/ui'. Install it with `npx expo install @expo/ui` and rebuild your app.");
|
|
53
53
|
const stableColors = (0, _react().useMemo)(()=>({
|
|
54
54
|
tintColor: colors?.tintColor ?? headerProps?.tintColor,
|
|
55
|
-
backgroundColor: colors?.backgroundColor ?? headerProps?.backgroundColor
|
|
55
|
+
backgroundColor: colors?.backgroundColor ?? headerProps?.backgroundColor,
|
|
56
|
+
buttonContainerColor: colors?.buttonContainerColor
|
|
56
57
|
}), [
|
|
57
58
|
colors?.backgroundColor,
|
|
59
|
+
colors?.buttonContainerColor,
|
|
58
60
|
colors?.tintColor,
|
|
59
61
|
headerProps?.tintColor,
|
|
60
62
|
headerProps?.backgroundColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["layouts/stack-utils/toolbar/processHeaderItemsForPlatform.android.tsx"],"sourcesContent":[null],"names":["processHeaderItemsForPlatform","children","placement","colors","requireExpoUI","headerContent","props","HeaderToolbarHostBase","headerProps","headerShown","headerLeft","headerRight","expoUI","Host","Row","stableColors","useMemo","tintColor","backgroundColor","ToolbarPlacementContext","Provider","value","ToolbarColorContext","NativeMenuContext","matchContents","verticalAlignment"],"mappings":"AAAA;;;;;+BAqBgBA;;;eAAAA;;;;;;;;;;;yBApBwB;;;;;;mCAEN;wBACJ;yBAUvB;AAOA,SAASA,8BACdC,QAAmB,EACnBC,SAA2B,EAC3BC,MAAsB;IAEtB,IAAID,cAAc,UAAUA,cAAc,SAAS;QACjD,OAAO;IACT;IACAE,IAAAA,qBAAa,EACX;IAGF,MAAMC,gBAAgB,CAACC,sBACrB,uBAACC;YAAsBL,WAAWA;YAAWC,QAAQA;YAAQK,aAAaF;sBACvEL;;IAIL,IAAIC,cAAc,QAAQ;QACxB,OAAO;YACLO,aAAa;YACbC,YAAYL;QACd;IACF;IAEA,OAAO;QACLI,aAAa;QACbE,aAAaN;IACf;AACF;AAEA,SAASE,sBAAsB,EAC7BN,QAAQ,EACRC,SAAS,EACTC,MAAM,EACNK,WAAW,EAMZ;IACC,MAAM,EACJI,QAAQ,EAAEC,IAAI,EAAEC,GAAG,EAAE,EACtB,GAAGV,IAAAA,qBAAa,EACf;IAEF,MAAMW,eAAeC,IAAAA,gBAAO,EAC1B,IAAO,CAAA;YACLC,WAAWd,QAAQc,aAAaT,aAAaS;YAC7CC,iBAAiBf,QAAQe,mBAAmBV,aAAaU;
|
|
1
|
+
{"version":3,"sources":["layouts/stack-utils/toolbar/processHeaderItemsForPlatform.android.tsx"],"sourcesContent":[null],"names":["processHeaderItemsForPlatform","children","placement","colors","requireExpoUI","headerContent","props","HeaderToolbarHostBase","headerProps","headerShown","headerLeft","headerRight","expoUI","Host","Row","stableColors","useMemo","tintColor","backgroundColor","buttonContainerColor","ToolbarPlacementContext","Provider","value","ToolbarColorContext","NativeMenuContext","matchContents","verticalAlignment"],"mappings":"AAAA;;;;;+BAqBgBA;;;eAAAA;;;;;;;;;;;yBApBwB;;;;;;mCAEN;wBACJ;yBAUvB;AAOA,SAASA,8BACdC,QAAmB,EACnBC,SAA2B,EAC3BC,MAAsB;IAEtB,IAAID,cAAc,UAAUA,cAAc,SAAS;QACjD,OAAO;IACT;IACAE,IAAAA,qBAAa,EACX;IAGF,MAAMC,gBAAgB,CAACC,sBACrB,uBAACC;YAAsBL,WAAWA;YAAWC,QAAQA;YAAQK,aAAaF;sBACvEL;;IAIL,IAAIC,cAAc,QAAQ;QACxB,OAAO;YACLO,aAAa;YACbC,YAAYL;QACd;IACF;IAEA,OAAO;QACLI,aAAa;QACbE,aAAaN;IACf;AACF;AAEA,SAASE,sBAAsB,EAC7BN,QAAQ,EACRC,SAAS,EACTC,MAAM,EACNK,WAAW,EAMZ;IACC,MAAM,EACJI,QAAQ,EAAEC,IAAI,EAAEC,GAAG,EAAE,EACtB,GAAGV,IAAAA,qBAAa,EACf;IAEF,MAAMW,eAAeC,IAAAA,gBAAO,EAC1B,IAAO,CAAA;YACLC,WAAWd,QAAQc,aAAaT,aAAaS;YAC7CC,iBAAiBf,QAAQe,mBAAmBV,aAAaU;YACzDC,sBAAsBhB,QAAQgB;QAChC,CAAA,GACA;QACEhB,QAAQe;QACRf,QAAQgB;QACRhB,QAAQc;QACRT,aAAaS;QACbT,aAAaU;KACd;IAGH,qBACE,uBAACE,gCAAuB,CAACC,QAAQ;QAACC,OAAOpB;kBACvC,cAAA,uBAACqB,4BAAmB,CAACF,QAAQ;YAACC,OAAOP;sBACnC,cAAA,uBAACS,oCAAiB;gBAACF,KAAK;0BACtB,cAAA,uBAACT;oBAAKY,aAAa;8BACjB,cAAA,uBAACX;wBAAIY,mBAAkB;kCAAUzB;;;;;;AAM7C"}
|
|
@@ -62,13 +62,9 @@ function useLinkToPathProps({ href, ...options }) {
|
|
|
62
62
|
router.linkTo(href, options);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
// Append base url only if needed.
|
|
67
|
-
if (!(0, _url.shouldLinkExternally)(strippedHref)) {
|
|
68
|
-
strippedHref = (0, _getPathFromStateforks.appendBaseUrl)(strippedHref);
|
|
69
|
-
}
|
|
65
|
+
const resolvedHref = (0, _url.shouldLinkExternally)(href) ? href : (0, _getPathFromStateforks.appendBaseUrl)((0, _matchers.stripGroupSegmentsFromPath)(href) || '/');
|
|
70
66
|
return {
|
|
71
|
-
href:
|
|
67
|
+
href: resolvedHref,
|
|
72
68
|
role: 'link',
|
|
73
69
|
onPress
|
|
74
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["link/useLinkToPathProps.tsx"],"sourcesContent":[null],"names":["useLinkToPathProps","shouldHandleMouseEvent","eventShouldPreventDefault","e","defaultPrevented","metaKey","altKey","ctrlKey","shiftKey","button","undefined","includes","currentTarget","target","href","options","router","useRouterActions","onPress","event","emitDomLinkEvent","linkTo","
|
|
1
|
+
{"version":3,"sources":["link/useLinkToPathProps.tsx"],"sourcesContent":[null],"names":["useLinkToPathProps","shouldHandleMouseEvent","eventShouldPreventDefault","e","defaultPrevented","metaKey","altKey","ctrlKey","shiftKey","button","undefined","includes","currentTarget","target","href","options","router","useRouterActions","onPress","event","emitDomLinkEvent","linkTo","resolvedHref","shouldLinkExternally","appendBaseUrl","stripGroupSegmentsFromPath","role","Platform","OS","preventDefault"],"mappings":";;;;;;;;;;;;;;;QAuCA;eAAwBA;;QAwBRC;eAAAA;;;;yBA7DS;;;;;;8BAEQ;uCACH;kCAEG;0BACU;qBACN;AAErC,SAASC,0BACPC,CAAwD;IAExD,IAAIA,GAAGC,kBAAkB;QACvB,OAAO;IACT;IAEA,IACE,yBAAyB;IACzB,YAAYD,KACZ,mCAAmC;IACnC,CAACA,EAAEE,OAAO,IACV,CAACF,EAAEG,MAAM,IACT,CAACH,EAAEI,OAAO,IACV,CAACJ,EAAEK,QAAQ,IACVL,CAAAA,EAAEM,MAAM,IAAI,QAAQN,EAAEM,MAAM,KAAK,CAAA,KAAM,0BAA0B;IAClE;QAACC;QAAW;QAAM;QAAI;KAAO,CAACC,QAAQ,CAACR,EAAES,aAAa,CAACC,MAAM,EAAE,0CAA0C;MACzG;QACA,OAAO;IACT;IAEA,OAAO;AACT;AAMe,SAASb,mBAAmB,EAAEc,IAAI,EAAE,GAAGC,SAAoC;IACxF,MAAMC,SAASC,IAAAA,kCAAgB;IAC/B,MAAMC,UAAU,CAACC;QACf,yFAAyF;QACzF,uEAAuE;QACvE,IAAIlB,uBAAuBkB,QAAQ;YACjC,IAAIC,IAAAA,8BAAgB,EAACN,MAAMC,UAAU;gBACnC;YACF;YACAC,OAAOK,MAAM,CAACP,MAAMC;QACtB;IACF;IAEA,MAAMO,eAAeC,IAAAA,yBAAoB,EAACT,QACtCA,OACAU,IAAAA,oCAAa,EAACC,IAAAA,oCAA0B,EAACX,SAAS;IAEtD,OAAO;QACLA,MAAMQ;QACNI,MAAM;QACNR;IACF;AACF;AAEO,SAASjB,uBACdkB,KAA6D;IAE7D,IAAIQ,uBAAQ,CAACC,EAAE,KAAK,OAAO;QACzB,OAAO,CAACT,OAAOf;IACjB;IAEA,IAAIe,SAASjB,0BAA0BiB,QAAQ;QAC7CA,MAAMU,cAAc;QACpB,OAAO;IACT;IAEA,OAAO;AACT"}
|
package/build/matchers.js
CHANGED
|
@@ -141,6 +141,19 @@ function removeFileSystemDots(filePath) {
|
|
|
141
141
|
return filePath.replace(/^(?:\.\.?\/)+/g, '');
|
|
142
142
|
}
|
|
143
143
|
function stripGroupSegmentsFromPath(path) {
|
|
144
|
+
// Only the pathname can contain groups. The search and hash may contain parentheses, e.g. `?a=(a)`
|
|
145
|
+
const suffixIndex = path.search(/[?#]/);
|
|
146
|
+
if (suffixIndex !== -1) {
|
|
147
|
+
const pathname = stripGroupSegmentsFromPath(path.slice(0, suffixIndex));
|
|
148
|
+
const queryAndHash = path.slice(suffixIndex);
|
|
149
|
+
if (pathname) {
|
|
150
|
+
return pathname + queryAndHash;
|
|
151
|
+
}
|
|
152
|
+
if (path.startsWith('/')) {
|
|
153
|
+
return '/' + queryAndHash;
|
|
154
|
+
}
|
|
155
|
+
return queryAndHash;
|
|
156
|
+
}
|
|
144
157
|
return path.split('/').reduce((acc, v)=>{
|
|
145
158
|
if (matchGroupName(v) == null) {
|
|
146
159
|
acc.push(v);
|
package/build/matchers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["matchers.tsx"],"sourcesContent":[null],"names":["VALID_PLATFORMS","getContextKey","getNameFromFilePath","getPlatformFromFilePath","isTypedRoute","matchArrayGroupName","matchDynamicName","matchGroupName","matchLastGroupName","removeFileSystemDots","removeFileSystemExtensions","removeSupportedExtensions","stripGroupSegmentsFromPath","stripInvisibleSegmentsFromPath","testNotFound","dynamicNameRe","Set","name","paramName","match","undefined","startsWith","slice","deep","test","filePath","filename","split","pop","extensionIndex","lastIndexOf","platform","has","contextKey","contextKeyWithoutPlatform","length","normal","endsWith","replace","path","reduce","acc","v","push","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;QASaA;eAAAA;;QAkDGC;eAAAA;;QAhBAC;eAAAA;;QAIAC;eAAAA;;
|
|
1
|
+
{"version":3,"sources":["matchers.tsx"],"sourcesContent":[null],"names":["VALID_PLATFORMS","getContextKey","getNameFromFilePath","getPlatformFromFilePath","isTypedRoute","matchArrayGroupName","matchDynamicName","matchGroupName","matchLastGroupName","removeFileSystemDots","removeFileSystemExtensions","removeSupportedExtensions","stripGroupSegmentsFromPath","stripInvisibleSegmentsFromPath","testNotFound","dynamicNameRe","Set","name","paramName","match","undefined","startsWith","slice","deep","test","filePath","filename","split","pop","extensionIndex","lastIndexOf","platform","has","contextKey","contextKeyWithoutPlatform","length","normal","endsWith","replace","path","suffixIndex","search","pathname","queryAndHash","reduce","acc","v","push","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;QASaA;eAAAA;;QAkDGC;eAAAA;;QAhBAC;eAAAA;;QAIAC;eAAAA;;QA6EAC;eAAAA;;QArFAC;eAAAA;;QA3BAC;eAAAA;;QAiBAC;eAAAA;;QAKAC;eAAAA;;QAmDAC;eAAAA;;QALAC;eAAAA;;QALAC;eAAAA;;QAcAC;eAAAA;;QA0BAC;eAAAA;;QA3FAC;eAAAA;;;AAxBhB,2DAA2D,GAC3D,MAAMC,gBAAgB;AAQf,MAAMf,kBAAkB,IAAIgB,IAAI;IAAC;IAAW;IAAO;IAAU;CAAM;AAGnE,SAASV,iBAAiBW,IAAY;IAC3C,MAAMC,YAAYD,KAAKE,KAAK,CAACJ,gBAAgB,CAAC,EAAE;IAChD,IAAIG,aAAa,MAAM;QACrB,OAAOE;IACT,OAAO,IAAIF,UAAUG,UAAU,CAAC,QAAQ;QACtC,OAAO;YAAEJ,MAAMC,UAAUI,KAAK,CAAC;YAAIC,MAAM;QAAK;IAChD,OAAO;QACL,OAAO;YAAEN,MAAMC;YAAWK,MAAM;QAAM;IACxC;AACF;AAGO,SAAST,aAAaG,IAAY;IACvC,OAAO,eAAeO,IAAI,CAACP;AAC7B;AAGO,SAASV,eAAeU,IAAY;IACzC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MAAMC,cAAcD,KAAKE,MAAM,CAAC;IAChC,IAAID,gBAAgB,CAAC,GAAG;QACtB,MAAME,WAAW9B,2BAA2B2B,KAAKjB,KAAK,CAAC,GAAGkB;QAC1D,MAAMG,eAAeJ,KAAKjB,KAAK,CAACkB;QAChC,IAAIE,UAAU;YACZ,OAAOA,WAAWC;QACpB;QACA,IAAIJ,KAAKlB,UAAU,CAAC,MAAM;YACxB,OAAO,MAAMsB;QACf;QACA,OAAOA;IACT;IAEA,OAAOJ,KACJZ,KAAK,CAAC,KACNiB,MAAM,CAAC,CAACC,KAAKC;QACZ,IAAIvC,eAAeuC,MAAM,MAAM;YAC7BD,IAAIE,IAAI,CAACD;QACX;QACA,OAAOD;IACT,GAAG,EAAE,EACJG,IAAI,CAAC;AACV;AAEO,SAASnC,+BAA+B0B,IAAY;IACzD,OAAO3B,2BAA2B2B,MAAMD,OAAO,CAAC,gBAAgB;AAClE;AAOO,SAASlC,aAAaa,IAAY;IACvC,OAAO,CAACA,KAAKI,UAAU,CAAC,QAAQJ,KAAKE,KAAK,CAAC,0CAA0C;AACvF"}
|
|
@@ -65,15 +65,15 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
65
65
|
return newObj;
|
|
66
66
|
}
|
|
67
67
|
function useAnimatedHashMap({ routes, index }) {
|
|
68
|
-
const refs = _react().useRef(
|
|
68
|
+
const refs = _react().useRef(Object.create(null));
|
|
69
69
|
const previous = refs.current;
|
|
70
|
-
const
|
|
71
|
-
if (routes.length ===
|
|
70
|
+
const routeNames = Object.keys(previous);
|
|
71
|
+
if (routes.length === routeNames.length && routes.every((route)=>routeNames.includes(route.name))) {
|
|
72
72
|
return previous;
|
|
73
73
|
}
|
|
74
|
-
refs.current =
|
|
75
|
-
routes.forEach(({
|
|
76
|
-
refs.current[
|
|
74
|
+
refs.current = Object.create(null);
|
|
75
|
+
routes.forEach(({ name }, i)=>{
|
|
76
|
+
refs.current[name] = previous[name] ?? new (_reactnative()).Animated.Value(i === index ? 0 : i >= index ? 1 : -1);
|
|
77
77
|
});
|
|
78
78
|
return refs.current;
|
|
79
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["react-navigation/bottom-tabs/utils/useAnimatedHashMap.tsx"],"sourcesContent":[null],"names":["useAnimatedHashMap","routes","index","refs","React","useRef","
|
|
1
|
+
{"version":3,"sources":["react-navigation/bottom-tabs/utils/useAnimatedHashMap.tsx"],"sourcesContent":[null],"names":["useAnimatedHashMap","routes","index","refs","React","useRef","Object","create","previous","current","routeNames","keys","length","every","route","includes","name","forEach","i","Animated","Value"],"mappings":"AAAA;;;;;+BAMgBA;;;eAAAA;;;;iEALO;;;;;;;yBACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIlB,SAASA,mBAAmB,EAAEC,MAAM,EAAEC,KAAK,EAAsB;IACtE,MAAMC,OAAOC,SAAMC,MAAM,CAAiCC,OAAOC,MAAM,CAAC;IACxE,MAAMC,WAAWL,KAAKM,OAAO;IAC7B,MAAMC,aAAaJ,OAAOK,IAAI,CAACH;IAE/B,IACEP,OAAOW,MAAM,KAAKF,WAAWE,MAAM,IACnCX,OAAOY,KAAK,CAAC,CAACC,QAAUJ,WAAWK,QAAQ,CAACD,MAAME,IAAI,IACtD;QACA,OAAOR;IACT;IACAL,KAAKM,OAAO,GAAGH,OAAOC,MAAM,CAAC;IAE7BN,OAAOgB,OAAO,CAAC,CAAC,EAAED,IAAI,EAAE,EAAEE;QACxBf,KAAKM,OAAO,CAACO,KAAK,GAChBR,QAAQ,CAACQ,KAAK,IAAI,IAAIG,CAAAA,cAAO,UAAC,CAACC,KAAK,CAACF,MAAMhB,QAAQ,IAAIgB,KAAKhB,QAAQ,IAAI,CAAC;IAC7E;IAEA,OAAOC,KAAKM,OAAO;AACrB"}
|