expo-router 7.0.0-canary-20251211-7da85ea → 7.0.0-canary-20251216-6e1f9a7

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.
Files changed (147) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/exports.d.ts +1 -0
  3. package/build/exports.d.ts.map +1 -1
  4. package/build/exports.js +1 -0
  5. package/build/exports.js.map +1 -1
  6. package/build/layouts/StackClient.d.ts +9 -1
  7. package/build/layouts/StackClient.d.ts.map +1 -1
  8. package/build/layouts/stack-utils/StackHeaderButton.d.ts +39 -0
  9. package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +1 -0
  10. package/build/layouts/stack-utils/StackHeaderButton.js +46 -0
  11. package/build/layouts/stack-utils/StackHeaderButton.js.map +1 -0
  12. package/build/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -1
  13. package/build/layouts/stack-utils/StackHeaderComponent.js +5 -6
  14. package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
  15. package/build/layouts/stack-utils/StackHeaderItem.d.ts +45 -0
  16. package/build/layouts/stack-utils/StackHeaderItem.d.ts.map +1 -0
  17. package/build/layouts/stack-utils/StackHeaderItem.js +52 -0
  18. package/build/layouts/stack-utils/StackHeaderItem.js.map +1 -0
  19. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts +15 -0
  20. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +1 -0
  21. package/build/layouts/stack-utils/StackHeaderLeftRight.js +111 -0
  22. package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +1 -0
  23. package/build/layouts/stack-utils/StackHeaderMenu.d.ts +191 -0
  24. package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -0
  25. package/build/layouts/stack-utils/StackHeaderMenu.js +203 -0
  26. package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -0
  27. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +40 -0
  28. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +1 -0
  29. package/build/layouts/stack-utils/StackHeaderSpacer.js +41 -0
  30. package/build/layouts/stack-utils/StackHeaderSpacer.js.map +1 -0
  31. package/build/layouts/stack-utils/common-primitives.d.ts +24 -0
  32. package/build/layouts/stack-utils/common-primitives.d.ts.map +1 -0
  33. package/build/layouts/stack-utils/common-primitives.js +8 -0
  34. package/build/layouts/stack-utils/common-primitives.js.map +1 -0
  35. package/build/layouts/stack-utils/index.d.ts +16 -3
  36. package/build/layouts/stack-utils/index.d.ts.map +1 -1
  37. package/build/layouts/stack-utils/index.js +27 -8
  38. package/build/layouts/stack-utils/index.js.map +1 -1
  39. package/build/layouts/stack-utils/shared.d.ts +62 -0
  40. package/build/layouts/stack-utils/shared.d.ts.map +1 -0
  41. package/build/layouts/stack-utils/shared.js +78 -0
  42. package/build/layouts/stack-utils/shared.js.map +1 -0
  43. package/build/link/ExpoLink.d.ts.map +1 -1
  44. package/build/link/ExpoLink.js +10 -9
  45. package/build/link/ExpoLink.js.map +1 -1
  46. package/build/link/preview/native.d.ts +4 -2
  47. package/build/link/preview/native.d.ts.map +1 -1
  48. package/build/link/preview/native.js +3 -1
  49. package/build/link/preview/native.js.map +1 -1
  50. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -1
  51. package/build/link/zoom/ZoomTransitionEnabler.ios.js +4 -2
  52. package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -1
  53. package/build/link/zoom/link-apple-zoom.js +10 -3
  54. package/build/link/zoom/link-apple-zoom.js.map +1 -1
  55. package/build/link/zoom/useZoomHref.d.ts +3 -0
  56. package/build/link/zoom/useZoomHref.d.ts.map +1 -0
  57. package/build/link/zoom/useZoomHref.ios.d.ts +3 -0
  58. package/build/link/zoom/useZoomHref.ios.d.ts.map +1 -0
  59. package/build/link/zoom/useZoomHref.ios.js +38 -0
  60. package/build/link/zoom/useZoomHref.ios.js.map +1 -0
  61. package/build/link/zoom/useZoomHref.js +8 -0
  62. package/build/link/zoom/useZoomHref.js.map +1 -0
  63. package/build/link/zoom/zoom-transition-context-providers.d.ts +4 -0
  64. package/build/link/zoom/zoom-transition-context-providers.d.ts.map +1 -0
  65. package/build/link/zoom/zoom-transition-context-providers.ios.d.ts +4 -0
  66. package/build/link/zoom/zoom-transition-context-providers.ios.d.ts.map +1 -0
  67. package/build/link/zoom/zoom-transition-context-providers.ios.js +71 -0
  68. package/build/link/zoom/zoom-transition-context-providers.ios.js.map +1 -0
  69. package/build/link/zoom/zoom-transition-context-providers.js +11 -0
  70. package/build/link/zoom/zoom-transition-context-providers.js.map +1 -0
  71. package/build/link/zoom/zoom-transition-context-providers.types.d.ts +9 -0
  72. package/build/link/zoom/zoom-transition-context-providers.types.d.ts.map +1 -0
  73. package/build/link/zoom/zoom-transition-context-providers.types.js +3 -0
  74. package/build/link/zoom/zoom-transition-context-providers.types.js.map +1 -0
  75. package/build/link/zoom/zoom-transition-context.d.ts +4 -6
  76. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -1
  77. package/build/link/zoom/zoom-transition-context.js +0 -27
  78. package/build/link/zoom/zoom-transition-context.js.map +1 -1
  79. package/build/primitives/types.d.ts +6 -5
  80. package/build/primitives/types.d.ts.map +1 -1
  81. package/build/primitives/types.js.map +1 -1
  82. package/build/split-view/elements.d.ts +4 -5
  83. package/build/split-view/elements.d.ts.map +1 -1
  84. package/build/split-view/elements.js +3 -0
  85. package/build/split-view/elements.js.map +1 -1
  86. package/build/split-view/index.d.ts +2 -0
  87. package/build/split-view/index.d.ts.map +1 -1
  88. package/build/split-view/index.js +15 -0
  89. package/build/split-view/index.js.map +1 -1
  90. package/build/split-view/split-view.d.ts +3 -0
  91. package/build/split-view/split-view.d.ts.map +1 -1
  92. package/build/split-view/split-view.js.map +1 -1
  93. package/build/useScreens.js +3 -3
  94. package/build/useScreens.js.map +1 -1
  95. package/expo-module.config.json +1 -1
  96. package/ios/LinkPreview/LinkPreviewNativeModule.swift +4 -1
  97. package/ios/LinkPreview/LinkZoomTransition.swift +121 -43
  98. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module} +7 -7
  99. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.md5 +1 -0
  100. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha1 +1 -0
  101. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha256 +1 -0
  102. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha512 +1 -0
  103. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom} +1 -1
  104. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.md5 +1 -0
  105. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha1 +1 -0
  106. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha256 +1 -0
  107. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha512 +1 -0
  108. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  109. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  110. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  111. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  112. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  113. package/package.json +12 -12
  114. package/build/layouts/stack-utils/StackHeaderLeft.d.ts +0 -9
  115. package/build/layouts/stack-utils/StackHeaderLeft.d.ts.map +0 -1
  116. package/build/layouts/stack-utils/StackHeaderLeft.js +0 -17
  117. package/build/layouts/stack-utils/StackHeaderLeft.js.map +0 -1
  118. package/build/layouts/stack-utils/StackHeaderRight.d.ts +0 -9
  119. package/build/layouts/stack-utils/StackHeaderRight.d.ts.map +0 -1
  120. package/build/layouts/stack-utils/StackHeaderRight.js +0 -17
  121. package/build/layouts/stack-utils/StackHeaderRight.js.map +0 -1
  122. package/build/link/zoom/useZoomTransitionPrimitives.d.ts +0 -6
  123. package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +0 -1
  124. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +0 -11
  125. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +0 -1
  126. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +0 -69
  127. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +0 -1
  128. package/build/link/zoom/useZoomTransitionPrimitives.js +0 -9
  129. package/build/link/zoom/useZoomTransitionPrimitives.js.map +0 -1
  130. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.md5 +0 -1
  131. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha1 +0 -1
  132. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha256 +0 -1
  133. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha512 +0 -1
  134. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.md5 +0 -1
  135. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha1 +0 -1
  136. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha256 +0 -1
  137. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha512 +0 -1
  138. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar} +0 -0
  139. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.md5 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.md5} +0 -0
  140. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha1 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha1} +0 -0
  141. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha256 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha256} +0 -0
  142. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha512 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha512} +0 -0
  143. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar} +0 -0
  144. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.md5 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.md5} +0 -0
  145. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha1 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha1} +0 -0
  146. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha256 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha256} +0 -0
  147. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha512 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha512} +0 -0
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ZoomTransitionSourceContextProvider = ZoomTransitionSourceContextProvider;
5
+ exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
6
+ const react_1 = require("react");
7
+ const ZoomTransitionEnabler_ios_1 = require("./ZoomTransitionEnabler.ios");
8
+ const zoom_transition_context_1 = require("./zoom-transition-context");
9
+ const navigationParams_1 = require("../../navigationParams");
10
+ const url_1 = require("../../utils/url");
11
+ const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
12
+ function ZoomTransitionSourceContextProvider({ children, linkProps, }) {
13
+ const { href, asChild } = linkProps;
14
+ const isExternalHref = typeof href === 'string' ? (0, url_1.shouldLinkExternally)(href) : (0, url_1.shouldLinkExternally)(href.pathname);
15
+ const numberOfSources = (0, react_1.useRef)(0);
16
+ const [hasZoomSource, setHasZoomSource] = (0, react_1.useState)(false);
17
+ const zoomTransitionId = (0, react_1.useId)();
18
+ const addSource = (0, react_1.useCallback)(() => {
19
+ if (!(0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)()) {
20
+ throw new Error('[expo-router] Zoom transitions are not enabled.');
21
+ }
22
+ if (numberOfSources.current >= 1) {
23
+ throw new Error('[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.');
24
+ }
25
+ if (!asChild) {
26
+ throw new Error('[expo-router] Link must be used with `asChild` prop to enable zoom transitions.');
27
+ }
28
+ if (isExternalHref) {
29
+ throw new Error('[expo-router] Zoom transitions can only be used with internal links.');
30
+ }
31
+ numberOfSources.current += 1;
32
+ setHasZoomSource(true);
33
+ }, [asChild, isExternalHref]);
34
+ const removeSource = (0, react_1.useCallback)(() => {
35
+ numberOfSources.current -= 1;
36
+ if (numberOfSources.current <= 0) {
37
+ setHasZoomSource(false);
38
+ }
39
+ }, []);
40
+ const value = (0, react_1.useMemo)(() => ({
41
+ identifier: zoomTransitionId,
42
+ hasZoomSource,
43
+ addSource,
44
+ removeSource,
45
+ }), [zoomTransitionId, hasZoomSource, addSource, removeSource]);
46
+ return <zoom_transition_context_1.ZoomTransitionSourceContext value={value}>{children}</zoom_transition_context_1.ZoomTransitionSourceContext>;
47
+ }
48
+ function ZoomTransitionTargetContextProvider({ route, children, }) {
49
+ const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
50
+ if ((0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)() &&
51
+ !isPreview &&
52
+ route &&
53
+ typeof route === 'object' &&
54
+ 'params' in route &&
55
+ typeof route.params === 'object' &&
56
+ 'key' in route &&
57
+ typeof route.key === 'string') {
58
+ const params = route.params ?? {};
59
+ const internalParams = (0, navigationParams_1.getInternalExpoRouterParams)(params);
60
+ const zoomTransitionId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];
61
+ const zoomTransitionScreenId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];
62
+ const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;
63
+ if (hasZoomTransition && typeof zoomTransitionId === 'string') {
64
+ return (<zoom_transition_context_1.ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>
65
+ {children}
66
+ </zoom_transition_context_1.ZoomTransitionTargetContext>);
67
+ }
68
+ }
69
+ return children;
70
+ }
71
+ //# sourceMappingURL=zoom-transition-context-providers.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAsBb,kFAmDC;AAED,kFA+BC;AAxGD,iCAAsE;AAEtE,2EAAsE;AACtE,uEAImC;AAKnC,6DAIgC;AAChC,yCAAuD;AACvD,wEAA8D;AAE9D,SAAgB,mCAAmC,CAAC,EAClD,QAAQ,EACR,SAAS,GACgC;IACzC,MAAM,EAAE,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AC,QAAQ,CACX;QAAA,EAAE,qDAA2B,CAAC,CAC/B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["'use client';\n\nimport { useCallback, useId, useMemo, useRef, useState } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport {\n ZoomTransitionSourceContext,\n ZoomTransitionTargetContext,\n type ZoomTransitionSourceContextValueType,\n} from './zoom-transition-context';\nimport type {\n ZoomTransitionSourceContextProviderProps,\n ZoomTransitionTargetContextProviderProps,\n} from './zoom-transition-context-providers.types';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { shouldLinkExternally } from '../../utils/url';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\n\nexport function ZoomTransitionSourceContextProvider({\n children,\n linkProps,\n}: ZoomTransitionSourceContextProviderProps) {\n const { href, asChild } = linkProps;\n const isExternalHref =\n typeof href === 'string' ? shouldLinkExternally(href) : shouldLinkExternally(href.pathname);\n const numberOfSources = useRef(0);\n const [hasZoomSource, setHasZoomSource] = useState(false);\n\n const zoomTransitionId = useId();\n\n const addSource = useCallback(() => {\n if (!isZoomTransitionEnabled()) {\n throw new Error('[expo-router] Zoom transitions are not enabled.');\n }\n if (numberOfSources.current >= 1) {\n throw new Error(\n '[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.'\n );\n }\n if (!asChild) {\n throw new Error(\n '[expo-router] Link must be used with `asChild` prop to enable zoom transitions.'\n );\n }\n if (isExternalHref) {\n throw new Error('[expo-router] Zoom transitions can only be used with internal links.');\n }\n numberOfSources.current += 1;\n setHasZoomSource(true);\n }, [asChild, isExternalHref]);\n\n const removeSource = useCallback(() => {\n numberOfSources.current -= 1;\n if (numberOfSources.current <= 0) {\n setHasZoomSource(false);\n }\n }, []);\n\n const value = useMemo<ZoomTransitionSourceContextValueType>(\n () => ({\n identifier: zoomTransitionId,\n hasZoomSource,\n addSource,\n removeSource,\n }),\n [zoomTransitionId, hasZoomSource, addSource, removeSource]\n );\n\n return <ZoomTransitionSourceContext value={value}>{children}</ZoomTransitionSourceContext>;\n}\n\nexport function ZoomTransitionTargetContextProvider({\n route,\n children,\n}: ZoomTransitionTargetContextProviderProps) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n return (\n <ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>\n {children}\n </ZoomTransitionTargetContext>\n );\n }\n }\n return children;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZoomTransitionSourceContextProvider = ZoomTransitionSourceContextProvider;
4
+ exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
5
+ function ZoomTransitionSourceContextProvider({ children, }) {
6
+ return children;
7
+ }
8
+ function ZoomTransitionTargetContextProvider({ children, }) {
9
+ return children;
10
+ }
11
+ //# sourceMappingURL=zoom-transition-context-providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.tsx"],"names":[],"mappings":";;AAKA,kFAIC;AAED,kFAIC;AAVD,SAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACiC;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACiC;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type {\n ZoomTransitionSourceContextProviderProps,\n ZoomTransitionTargetContextProviderProps,\n} from './zoom-transition-context-providers.types';\n\nexport function ZoomTransitionSourceContextProvider({\n children,\n}: ZoomTransitionSourceContextProviderProps) {\n return children;\n}\n\nexport function ZoomTransitionTargetContextProvider({\n children,\n}: ZoomTransitionTargetContextProviderProps) {\n return children;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ import type { LinkProps } from '../useLinkHooks';
3
+ export interface ZoomTransitionTargetContextProviderProps extends PropsWithChildren {
4
+ route: unknown;
5
+ }
6
+ export interface ZoomTransitionSourceContextProviderProps extends PropsWithChildren {
7
+ linkProps: LinkProps;
8
+ }
9
+ //# sourceMappingURL=zoom-transition-context-providers.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.types.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,wCAAyC,SAAQ,iBAAiB;IACjF,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,wCAAyC,SAAQ,iBAAiB;IACjF,SAAS,EAAE,SAAS,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=zoom-transition-context-providers.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context-providers.types.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.types.ts"],"names":[],"mappings":"","sourcesContent":["import { type PropsWithChildren } from 'react';\n\nimport type { LinkProps } from '../useLinkHooks';\n\nexport interface ZoomTransitionTargetContextProviderProps extends PropsWithChildren {\n route: unknown;\n}\n\nexport interface ZoomTransitionSourceContextProviderProps extends PropsWithChildren {\n linkProps: LinkProps;\n}\n"]}
@@ -1,14 +1,12 @@
1
- import { type PropsWithChildren } from 'react';
2
1
  export type ZoomTransitionSourceContextValueType = {
3
2
  identifier: string;
3
+ hasZoomSource: boolean;
4
4
  addSource: () => void;
5
5
  removeSource: () => void;
6
6
  } | undefined;
7
7
  export declare const ZoomTransitionSourceContext: import("react").Context<ZoomTransitionSourceContextValueType>;
8
- export declare const ZoomTransitionTargetContext: import("react").Context<{
8
+ export interface ZoomTransitionTargetContextValueType {
9
9
  identifier: string | null;
10
- }>;
11
- export declare function ZoomTransitionTargetContextProvider({ route, children, }: PropsWithChildren<{
12
- route: unknown;
13
- }>): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
10
+ }
11
+ export declare const ZoomTransitionTargetContext: import("react").Context<ZoomTransitionTargetContextValueType>;
14
12
  //# sourceMappingURL=zoom-transition-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-transition-context.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAU9D,MAAM,MAAM,oCAAoC,GAC5C;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,GACD,SAAS,CAAC;AAEd,eAAO,MAAM,2BAA2B,+DACwB,CAAC;AAEjE,eAAO,MAAM,2BAA2B;gBAA+B,MAAM,GAAG,IAAI;EAElF,CAAC;AAEH,wBAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,+VA4BvC"}
1
+ {"version":3,"file":"zoom-transition-context.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,oCAAoC,GAC5C;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,GACD,SAAS,CAAC;AAEd,eAAO,MAAM,2BAA2B,+DACwB,CAAC;AAEjE,MAAM,WAAW,oCAAoC;IACnD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B,+DAEtC,CAAC"}
@@ -2,36 +2,9 @@
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ZoomTransitionTargetContext = exports.ZoomTransitionSourceContext = void 0;
5
- exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
6
5
  const react_1 = require("react");
7
- const ZoomTransitionEnabler_ios_1 = require("./ZoomTransitionEnabler.ios");
8
- const navigationParams_1 = require("../../navigationParams");
9
- const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
10
6
  exports.ZoomTransitionSourceContext = (0, react_1.createContext)(undefined);
11
7
  exports.ZoomTransitionTargetContext = (0, react_1.createContext)({
12
8
  identifier: null,
13
9
  });
14
- function ZoomTransitionTargetContextProvider({ route, children, }) {
15
- const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
16
- if ((0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)() &&
17
- !isPreview &&
18
- route &&
19
- typeof route === 'object' &&
20
- 'params' in route &&
21
- typeof route.params === 'object' &&
22
- 'key' in route &&
23
- typeof route.key === 'string') {
24
- const params = route.params ?? {};
25
- const internalParams = (0, navigationParams_1.getInternalExpoRouterParams)(params);
26
- const zoomTransitionId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];
27
- const zoomTransitionScreenId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];
28
- const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;
29
- if (hasZoomTransition && typeof zoomTransitionId === 'string') {
30
- return (<exports.ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>
31
- {children}
32
- </exports.ZoomTransitionTargetContext>);
33
- }
34
- }
35
- return children;
36
- }
37
10
  //# sourceMappingURL=zoom-transition-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA2Bb,kFA+BC;AAxDD,iCAA8D;AAE9D,2EAAsE;AACtE,6DAIgC;AAChC,wEAA8D;AAUjD,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC;AAEpD,QAAA,2BAA2B,GAAG,IAAA,qBAAa,EAAgC;IACtF,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC;AAEH,SAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GAC8B;IACtC,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,IACE,IAAA,mDAAuB,GAAE;QACzB,CAAC,SAAS;QACV,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,EAC7B,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAClC,MAAM,cAAc,GAAG,IAAA,8CAA2B,EAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GACpB,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAC1B,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,CAAC;QACrF,IAAI,iBAAiB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC9D,OAAO,CACL,CAAC,mCAA2B,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CACnE;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,mCAA2B,CAAC,CAC/B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["'use client';\n\nimport { createContext, type PropsWithChildren } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n\nexport const ZoomTransitionTargetContext = createContext<{ identifier: string | null }>({\n identifier: null,\n});\n\nexport function ZoomTransitionTargetContextProvider({\n route,\n children,\n}: PropsWithChildren<{ route: unknown }>) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n return (\n <ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>\n {children}\n </ZoomTransitionTargetContext>\n );\n }\n }\n return children;\n}\n"]}
1
+ {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAAsC;AAWzB,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC;AAMpD,QAAA,2BAA2B,GAAG,IAAA,qBAAa,EAAuC;IAC7F,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC","sourcesContent":["'use client';\n\nimport { createContext } from 'react';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n hasZoomSource: boolean;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n\nexport interface ZoomTransitionTargetContextValueType {\n identifier: string | null;\n}\n\nexport const ZoomTransitionTargetContext = createContext<ZoomTransitionTargetContextValueType>({\n identifier: null,\n});\n"]}
@@ -1,8 +1,9 @@
1
1
  import type { ColorValue, ImageSourcePropType } from 'react-native';
2
+ import type { StackHeaderBadgeProps, StackHeaderIconProps, StackHeaderLabelProps, StackHeaderMenuActionProps, StackHeaderMenuProps } from '../layouts/stack-utils';
2
3
  import type { LinkMenuActionProps, LinkMenuProps } from '../link/elements';
3
4
  import type { NativeTabsTriggerBadgeProps, NativeTabsTriggerIconProps, NativeTabsTriggerLabelProps } from '../native-tabs';
4
- export type BadgeProps = NativeTabsTriggerBadgeProps;
5
- export type IconProps = NativeTabsTriggerIconProps;
5
+ export type BadgeProps = NativeTabsTriggerBadgeProps | StackHeaderBadgeProps;
6
+ export type IconProps = NativeTabsTriggerIconProps | StackHeaderIconProps;
6
7
  export interface VectorIconProps<NameT extends string> {
7
8
  /**
8
9
  * The family of the vector icon.
@@ -20,7 +21,7 @@ export interface VectorIconProps<NameT extends string> {
20
21
  */
21
22
  name: NameT;
22
23
  }
23
- export type LabelProps = NativeTabsTriggerLabelProps;
24
- export type MenuActionProps = LinkMenuActionProps;
25
- export type MenuProps = LinkMenuProps;
24
+ export type LabelProps = NativeTabsTriggerLabelProps | StackHeaderLabelProps;
25
+ export type MenuActionProps = LinkMenuActionProps | StackHeaderMenuActionProps;
26
+ export type MenuProps = LinkMenuProps | StackHeaderMenuProps;
26
27
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/primitives/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,0BAA0B,CAAC;AAEnD,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,MAAM;IACnD;;;;;;;OAOG;IACH,MAAM,EAAE;QACN,cAAc,E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GAAG,0BAA0B,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/primitives/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorValue, ImageSourcePropType } from 'react-native';\n\nimport type { LinkMenuActionProps, LinkMenuProps } from '../link/elements';\nimport type {\n NativeTabsTriggerBadgeProps,\n NativeTabsTriggerIconProps,\n NativeTabsTriggerLabelProps,\n} from '../native-tabs';\n\nexport type BadgeProps = NativeTabsTriggerBadgeProps;\n\nexport type IconProps = NativeTabsTriggerIconProps;\n\nexport interface VectorIconProps<NameT extends string> {\n /**\n * The family of the vector icon.\n *\n * @example\n * ```tsx\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n * ```\n */\n family: {\n getImageSource: (\n name: NameT,\n size: number,\n color: ColorValue\n ) => Promise<ImageSourcePropType | null>;\n };\n /**\n * The name of the vector icon.\n */\n name: NameT;\n}\n\nexport type LabelProps = NativeTabsTriggerLabelProps;\n\nexport type MenuActionProps = LinkMenuActionProps;\n\nexport type MenuProps = LinkMenuProps;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/primitives/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorValue, ImageSourcePropType } from 'react-native';\n\nimport type {\n StackHeaderBadgeProps,\n StackHeaderIconProps,\n StackHeaderLabelProps,\n StackHeaderMenuActionProps,\n StackHeaderMenuProps,\n} from '../layouts/stack-utils';\nimport type { LinkMenuActionProps, LinkMenuProps } from '../link/elements';\nimport type {\n NativeTabsTriggerBadgeProps,\n NativeTabsTriggerIconProps,\n NativeTabsTriggerLabelProps,\n} from '../native-tabs';\n\nexport type BadgeProps = NativeTabsTriggerBadgeProps | StackHeaderBadgeProps;\n\nexport type IconProps = NativeTabsTriggerIconProps | StackHeaderIconProps;\n\nexport interface VectorIconProps<NameT extends string> {\n /**\n * The family of the vector icon.\n *\n * @example\n * ```tsx\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n * ```\n */\n family: {\n getImageSource: (\n name: NameT,\n size: number,\n color: ColorValue\n ) => Promise<ImageSourcePropType | null>;\n };\n /**\n * The name of the vector icon.\n */\n name: NameT;\n}\n\nexport type LabelProps = NativeTabsTriggerLabelProps | StackHeaderLabelProps;\n\nexport type MenuActionProps = LinkMenuActionProps | StackHeaderMenuActionProps;\n\nexport type MenuProps = LinkMenuProps | StackHeaderMenuProps;\n"]}
@@ -1,10 +1,9 @@
1
- interface SplitViewColumnProps {
1
+ export interface SplitViewColumnProps {
2
2
  children?: React.ReactNode;
3
3
  }
4
4
  export declare function SplitViewColumn(props: SplitViewColumnProps): import("react").JSX.Element;
5
- interface SplitViewColumnProps {
6
- children?: React.ReactNode;
7
- }
5
+ /**
6
+ * @platform iOS 26+
7
+ */
8
8
  export declare function SplitViewInspector(props: SplitViewColumnProps): import("react").JSX.Element;
9
- export {};
10
9
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAM1D;AAED,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,+BAE7D"}
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAM1D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,+BAE7D"}
@@ -9,6 +9,9 @@ function SplitViewColumn(props) {
9
9
  <react_native_safe_area_context_1.SafeAreaProvider>{props.children}</react_native_safe_area_context_1.SafeAreaProvider>
10
10
  </experimental_1.SplitViewScreen.Column>);
11
11
  }
12
+ /**
13
+ * @platform iOS 26+
14
+ */
12
15
  function SplitViewInspector(props) {
13
16
  return <experimental_1.SplitViewScreen.Inspector>{props.children}</experimental_1.SplitViewScreen.Inspector>;
14
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":";;AAOA,0CAMC;AAMD,gDAEC;AArBD,mFAAkE;AAClE,oEAAoE;AAMpE,SAAgB,eAAe,CAAC,KAA2B;IACzD,OAAO,CACL,CAAC,8BAAe,CAAC,MAAM,CACrB;MAAA,CAAC,iDAAgB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,iDAAgB,CACtD;IAAA,EAAE,8BAAe,CAAC,MAAM,CAAC,CAC1B,CAAC;AACJ,CAAC;AAMD,SAAgB,kBAAkB,CAAC,KAA2B;IAC5D,OAAO,CAAC,8BAAe,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,8BAAe,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC","sourcesContent":["import { SafeAreaProvider } from 'react-native-safe-area-context';\nimport { SplitViewScreen } from 'react-native-screens/experimental';\n\ninterface SplitViewColumnProps {\n children?: React.ReactNode;\n}\n\nexport function SplitViewColumn(props: SplitViewColumnProps) {\n return (\n <SplitViewScreen.Column>\n <SafeAreaProvider>{props.children}</SafeAreaProvider>\n </SplitViewScreen.Column>\n );\n}\n\ninterface SplitViewColumnProps {\n children?: React.ReactNode;\n}\n\nexport function SplitViewInspector(props: SplitViewColumnProps) {\n return <SplitViewScreen.Inspector>{props.children}</SplitViewScreen.Inspector>;\n}\n"]}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":";;AAOA,0CAMC;AAKD,gDAEC;AApBD,mFAAkE;AAClE,oEAAoE;AAMpE,SAAgB,eAAe,CAAC,KAA2B;IACzD,OAAO,CACL,CAAC,8BAAe,CAAC,MAAM,CACrB;MAAA,CAAC,iDAAgB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,iDAAgB,CACtD;IAAA,EAAE,8BAAe,CAAC,MAAM,CAAC,CAC1B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAA2B;IAC5D,OAAO,CAAC,8BAAe,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,8BAAe,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC","sourcesContent":["import { SafeAreaProvider } from 'react-native-safe-area-context';\nimport { SplitViewScreen } from 'react-native-screens/experimental';\n\nexport interface SplitViewColumnProps {\n children?: React.ReactNode;\n}\n\nexport function SplitViewColumn(props: SplitViewColumnProps) {\n return (\n <SplitViewScreen.Column>\n <SafeAreaProvider>{props.children}</SafeAreaProvider>\n </SplitViewScreen.Column>\n );\n}\n\n/**\n * @platform iOS 26+\n */\nexport function SplitViewInspector(props: SplitViewColumnProps) {\n return <SplitViewScreen.Inspector>{props.children}</SplitViewScreen.Inspector>;\n}\n"]}
@@ -1,2 +1,4 @@
1
1
  export { SplitView, SplitViewProps } from './split-view';
2
+ export * from './elements';
3
+ export { type SplitViewHostProps } from 'react-native-screens/experimental';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/split-view/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/split-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACzD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC"}
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.SplitView = void 0;
4
18
  var split_view_1 = require("./split-view");
5
19
  Object.defineProperty(exports, "SplitView", { enumerable: true, get: function () { return split_view_1.SplitView; } });
20
+ __exportStar(require("./elements"), exports);
6
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-view/index.tsx"],"names":[],"mappings":";;;AAAA,2CAAyD;AAAhD,uGAAA,SAAS,OAAA","sourcesContent":["export { SplitView, SplitViewProps } from './split-view';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-view/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyD;AAAhD,uGAAA,SAAS,OAAA;AAClB,6CAA2B","sourcesContent":["export { SplitView, SplitViewProps } from './split-view';\nexport * from './elements';\nexport { type SplitViewHostProps } from 'react-native-screens/experimental';\n"]}
@@ -1,6 +1,9 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import { type SplitViewHostProps } from 'react-native-screens/experimental';
3
3
  import { SplitViewColumn, SplitViewInspector } from './elements';
4
+ /**
5
+ * For full list of supported props, see [`SplitViewHostProps`](https://github.com/software-mansion/react-native-screens/blob/main/src/components/gamma/split-view/SplitViewHost.types.ts#L124)
6
+ */
4
7
  export interface SplitViewProps extends Omit<SplitViewHostProps, 'children'> {
5
8
  children?: ReactNode;
6
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"split-view.d.ts","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMjE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,EAAE,cAAc,qBAgE9E;AAED,eAAO,MAAM,SAAS;;;CAGpB,CAAC"}
1
+ {"version":3,"file":"split-view.d.ts","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMjE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GA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AA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACzD,MAAM,EAAE,0BAAe;IACvB,SAAS,EAAE,6BAAkB;CAC9B,CAAC,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport React, { createContext, isValidElement, use, type ReactNode } from 'react';\nimport {\n SplitViewHost,\n SplitViewScreen,\n type SplitViewHostProps,\n} from 'react-native-screens/experimental';\n\nimport { SplitViewColumn, SplitViewInspector } from './elements';\nimport { IsWithinLayoutContext } from '../layouts/IsWithinLayoutContext';\nimport { Slot } from '../views/Navigator';\n\nconst IsWithinSplitViewContext = createContext(false);\n\nexport interface SplitViewProps extends Omit<SplitViewHostProps, 'children'> {\n children?: ReactNode;\n}\n\nfunction SplitViewNavigator({ children, ...splitViewHostProps }: SplitViewProps) {\n if (use(IsWithinSplitViewContext)) {\n throw new Error('There can only be one SplitView in the navigation hierarchy.');\n }\n\n // TODO: Add better way of detecting if SplitView is rendered inside Native navigator.\n if (use(IsWithinLayoutContext)) {\n throw new Error('SplitView cannot be used inside another navigator, except for Slot.');\n }\n\n if (!Constants.expoConfig?.extra?.router?.unstable_splitView) {\n throw new Error(\n 'SplitView is not enabled. Make sure to enable it in your expo-router configuration with \"unstable_splitView\": true. After enabling, make sure to prebuild your app.'\n );\n }\n\n if (process.env.EXPO_OS !== 'ios') {\n console.warn(\n 'SplitView is only supported on iOS. The SplitView will behave like a Slot navigator on other platforms.'\n );\n return <Slot />;\n }\n\n const WrappedSlot = () => (\n <IsWithinLayoutContext value>\n <Slot />\n </IsWithinLayoutContext>\n );\n\n const allChildrenArray = React.Children.toArray(children);\n const columnChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewColumn\n );\n const inspectorChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewInspector\n );\n const numberOfSidebars = columnChildren.length;\n const numberOfInspectors = inspectorChildren.length;\n\n if (allChildrenArray.length !== columnChildren.length + inspectorChildren.length) {\n console.warn(\n 'Only SplitView.Column and SplitView.Inspector components are allowed as direct children of SplitView.'\n );\n }\n\n if (numberOfSidebars > 2) {\n throw new Error('There can only be two SplitView.Column in the SplitView.');\n }\n\n if (numberOfSidebars + numberOfInspectors === 0) {\n console.warn('No SplitView.Column and SplitView.Inspector found in SplitView.');\n return <Slot />;\n }\n\n // The key is needed, because number of columns cannot be changed dynamically\n return (\n <SplitViewHost key={numberOfSidebars + numberOfInspectors} {...splitViewHostProps}>\n {columnChildren}\n <SplitViewScreen.Column>\n <WrappedSlot />\n </SplitViewScreen.Column>\n {inspectorChildren}\n </SplitViewHost>\n );\n}\n\nexport const SplitView = Object.assign(SplitViewNavigator, {\n Column: SplitViewColumn,\n Inspector: SplitViewInspector,\n});\n"]}
1
+ {"version":3,"file":"split-view.js","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAuC;AACvC,+CAAkF;AAClF,oEAI2C;AAE3C,yCAAiE;AACjE,4EAAyE;AACzE,kDAA0C;AAE1C,MAAM,wBAAwB,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;AAStD,SAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAkB;IAC7E,IAAI,IAAA,WAAG,EAAC,wBAAwB,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,sFAAsF;IACtF,IAAI,IAAA,WAAG,EAAC,6CAAqB,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;IAED,IAAI,CAAC,wBAAS,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;QAC7D,MAAM,IAAI,KAAK,CACb,qKAAqK,CACtK,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,C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CAAC;IAClB,CAAC;IAED,6EAA6E;IAC7E,OAAO,CACL,CAAC,4BAAa,CAAC,GAAG,CAAC,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAChF;MAAA,CAAC,cAAc,CACf;MAAA,CAAC,8BAAe,CAAC,MAAM,CACrB;QAAA,CAAC,WAAW,CAAC,AAAD,EACd;MAAA,EAAE,8BAAe,CAAC,MAAM,CACxB;MAAA,CAAC,iBAAiB,CACpB;IAAA,EAAE,4BAAa,CAAC,CACjB,CAAC;AACJ,CAAC;AAEY,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACzD,MAAM,EAAE,0BAAe;IACvB,SAAS,EAAE,6BAAkB;CAC9B,CAAC,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport React, { createContext, isValidElement, use, type ReactNode } from 'react';\nimport {\n SplitViewHost,\n SplitViewScreen,\n type SplitViewHostProps,\n} from 'react-native-screens/experimental';\n\nimport { SplitViewColumn, SplitViewInspector } from './elements';\nimport { IsWithinLayoutContext } from '../layouts/IsWithinLayoutContext';\nimport { Slot } from '../views/Navigator';\n\nconst IsWithinSplitViewContext = createContext(false);\n\n/**\n * For full list of supported props, see [`SplitViewHostProps`](https://github.com/software-mansion/react-native-screens/blob/main/src/components/gamma/split-view/SplitViewHost.types.ts#L124)\n */\nexport interface SplitViewProps extends Omit<SplitViewHostProps, 'children'> {\n children?: ReactNode;\n}\n\nfunction SplitViewNavigator({ children, ...splitViewHostProps }: SplitViewProps) {\n if (use(IsWithinSplitViewContext)) {\n throw new Error('There can only be one SplitView in the navigation hierarchy.');\n }\n\n // TODO: Add better way of detecting if SplitView is rendered inside Native navigator.\n if (use(IsWithinLayoutContext)) {\n throw new Error('SplitView cannot be used inside another navigator, except for Slot.');\n }\n\n if (!Constants.expoConfig?.extra?.router?.unstable_splitView) {\n throw new Error(\n 'SplitView is not enabled. Make sure to enable it in your expo-router configuration with \"unstable_splitView\": true. After enabling, make sure to prebuild your app.'\n );\n }\n\n if (process.env.EXPO_OS !== 'ios') {\n console.warn(\n 'SplitView is only supported on iOS. The SplitView will behave like a Slot navigator on other platforms.'\n );\n return <Slot />;\n }\n\n const WrappedSlot = () => (\n <IsWithinLayoutContext value>\n <Slot />\n </IsWithinLayoutContext>\n );\n\n const allChildrenArray = React.Children.toArray(children);\n const columnChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewColumn\n );\n const inspectorChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewInspector\n );\n const numberOfSidebars = columnChildren.length;\n const numberOfInspectors = inspectorChildren.length;\n\n if (allChildrenArray.length !== columnChildren.length + inspectorChildren.length) {\n console.warn(\n 'Only SplitView.Column and SplitView.Inspector components are allowed as direct children of SplitView.'\n );\n }\n\n if (numberOfSidebars > 2) {\n throw new Error('There can only be two SplitView.Column in the SplitView.');\n }\n\n if (numberOfSidebars + numberOfInspectors === 0) {\n console.warn('No SplitView.Column and SplitView.Inspector found in SplitView.');\n return <Slot />;\n }\n\n // The key is needed, because number of columns cannot be changed dynamically\n return (\n <SplitViewHost key={numberOfSidebars + numberOfInspectors} {...splitViewHostProps}>\n {columnChildren}\n <SplitViewScreen.Column>\n <WrappedSlot />\n </SplitViewScreen.Column>\n {inspectorChildren}\n </SplitViewHost>\n );\n}\n\nexport const SplitView = Object.assign(SplitViewNavigator, {\n Column: SplitViewColumn,\n Inspector: SplitViewInspector,\n});\n"]}
@@ -48,7 +48,7 @@ const Route_1 = require("./Route");
48
48
  const storeContext_1 = require("./global-state/storeContext");
49
49
  const import_mode_1 = __importDefault(require("./import-mode"));
50
50
  const ZoomTransitionEnabler_1 = require("./link/zoom/ZoomTransitionEnabler");
51
- const zoom_transition_context_1 = require("./link/zoom/zoom-transition-context");
51
+ const zoom_transition_context_providers_1 = require("./link/zoom/zoom-transition-context-providers");
52
52
  const navigationParams_1 = require("./navigationParams");
53
53
  const primitives_1 = require("./primitives");
54
54
  const EmptyRoute_1 = require("./views/EmptyRoute");
@@ -224,14 +224,14 @@ function getQualifiedRouteComponent(value) {
224
224
  }, [navigation]);
225
225
  return (<Route_1.Route node={value} route={route}>
226
226
  <ZoomTransitionEnabler_1.ZoomTransitionEnabler route={route}/>
227
- <zoom_transition_context_1.ZoomTransitionTargetContextProvider route={route}>
227
+ <zoom_transition_context_providers_1.ZoomTransitionTargetContextProvider route={route}>
228
228
  <react_1.default.Suspense fallback={<SuspenseFallback_1.SuspenseFallback route={value}/>}>
229
229
  <ScreenComponent {...props}
230
230
  // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`
231
231
  // the intention is to make it possible to deduce shared routes.
232
232
  segment={value.route}/>
233
233
  </react_1.default.Suspense>
234
- </zoom_transition_context_1.ZoomTransitionTargetContextProvider>
234
+ </zoom_transition_context_providers_1.ZoomTransitionTargetContextProvider>
235
235
  </Route_1.Route>);
236
236
  }
237
237
  if (__DEV__) {
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.js","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Jb,4CAwBC;AAmDD,gEAkGC;AAED,oDAwBC;AAED,sCAcC;AAED,sCAaC;AA9XD,qDAOkC;AAElC,+CAAyC;AAEzC,mCAA6F;AAC7F,8DAAiE;AACjE,gEAAoD;AACpD,6EAA0E;AAC1E,iFAA0F;AAC1F,yDAI4B;AAC5B,6CAAsC;AAEtC,mDAAgD;AAChD,+DAA4D;AAC5D,qCAAkC;AAmClC,SAAS,iBAAiB,CACxB,QAAqB,EACrB,QAAuB,EAAE,EACzB,gBAAyB;IAEzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,QAAQ;aACZ,IAAI,CAAC,IAAA,6BAAqB,EAAC,gBAAgB,CAAC,CAAC;aAC7C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAA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AAC;YACN,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport {\n useStateForPath,\n type EventMapBase,\n type NavigationState,\n type ParamListBase,\n type RouteProp,\n type ScreenListeners,\n} from '@react-navigation/native';\nimport type { NativeStackNavigationEventMap } from '@react-navigation/native-stack';\nimport React, { useEffect } from 'react';\n\nimport { LoadedRoute, Route, RouteNode, sortRoutesWithInitial, useRouteNode } from './Route';\nimport { useExpoRouterStore } from './global-state/storeContext';\nimport EXPO_ROUTER_IMPORT_MODE from './import-mode';\nimport { ZoomTransitionEnabler } from './link/zoom/ZoomTransitionEnabler';\nimport { ZoomTransitionTargetContextProvider } from './link/zoom/zoom-transition-context';\nimport {\n hasParam,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n removeParams,\n} from './navigationParams';\nimport { Screen } from './primitives';\nimport { UnknownOutputParams } from './types';\nimport { EmptyRoute } from './views/EmptyRoute';\nimport { SuspenseFallback } from './views/SuspenseFallback';\nimport { Try } from './views/Try';\n\nexport type ScreenProps<\n TOptions extends Record<string, any> = Record<string, any>,\n TState extends NavigationState = NavigationState,\n TEventMap extends EventMapBase = EventMapBase,\n> = {\n /** Name is required when used inside a Layout component. */\n name?: string;\n /**\n * Redirect to the nearest sibling route.\n * If all children are `redirect={true}`, the layout will render `null` as there are no children to render.\n */\n redirect?: boolean;\n initialParams?: Record<string, any>;\n options?:\n | TOptions\n | ((prop: { route: RouteProp<ParamListBase, string>; navigation: any }) => TOptions);\n\n listeners?:\n | ScreenListeners<TState, TEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n navigation: any;\n }) => ScreenListeners<TState, TEventMap>);\n\n getId?: ({ params }: { params?: Record<string, any> }) => string | undefined;\n\n dangerouslySingular?: SingularOptions;\n};\n\nexport type SingularOptions =\n | boolean\n | ((name: string, params: UnknownOutputParams) => string | undefined);\n\nfunction getSortedChildren(\n children: RouteNode[],\n order: ScreenProps[] = [],\n initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n if (!order?.length) {\n return children\n .sort(sortRoutesWithInitial(initialRouteName))\n .map((route) => ({ route, props: {} }));\n }\n const entries = [...children];\n\n const ordered = order\n .map(\n ({\n name,\n redirect,\n initialParams,\n listeners,\n options,\n getId,\n dangerouslySingular: singular,\n }) => {\n if (!entries.length) {\n console.warn(\n `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n );\n return null;\n }\n const matchIndex = entries.findIndex((child) => child.route === name);\n if (matchIndex === -1) {\n console.warn(\n `[Layout children]: No route named \"${name}\" exists in nested children:`,\n children.map(({ route }) => route)\n );\n return null;\n } else {\n // Get match and remove from entries\n const match = entries[matchIndex];\n entries.splice(matchIndex, 1);\n\n // Ensure to return null after removing from entries.\n if (redirect) {\n if (typeof redirect === 'string') {\n throw new Error(`Redirecting to a specific route is not supported yet.`);\n }\n return null;\n }\n\n if (getId) {\n console.warn(\n `Deprecated: prop 'getId' on screen ${name} is deprecated. Please rename the prop to 'dangerouslySingular'`\n );\n if (singular) {\n console.warn(\n `Screen ${name} cannot use both getId and dangerouslySingular together.`\n );\n }\n } else if (singular) {\n // If singular is set, use it as the getId function.\n if (typeof singular === 'string') {\n getId = () => singular;\n } else if (typeof singular === 'function' && name) {\n getId = (options) => singular(name, options.params || {});\n } else if (singular === true && name) {\n getId = (options) => getSingularId(name, options);\n }\n }\n\n return {\n route: match,\n props: { initialParams, listeners, options, getId },\n };\n }\n }\n )\n .filter(Boolean) as {\n route: RouteNode;\n props: Partial<ScreenProps>;\n }[];\n\n // Add any remaining children\n ordered.push(\n ...entries.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({ route, props: {} }))\n );\n\n return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(\n order: ScreenProps[],\n protectedScreens: Set<string>,\n useOnlyUserDefinedScreens: boolean = false\n): React.ReactNode[] {\n const node = useRouteNode();\n\n const nodeChildren = node?.children ?? [];\n const children = useOnlyUserDefinedScreens\n ? nodeChildren.filter((child) =>\n order.some((userDefinedScreen) => userDefinedScreen.name === child.route)\n )\n : nodeChildren;\n\n const sorted = children.length ? getSortedChildren(children, order, node?.initialRouteName) : [];\n return React.useMemo(\n () =>\n sorted\n .filter((item) => !protectedScreens.has(item.route.route))\n .map((value) => {\n return routeToScreen(value.route, value.props);\n }),\n [sorted, protectedScreens]\n );\n}\n\nfunction fromImport(value: RouteNode, { ErrorBoundary, ...component }: LoadedRoute) {\n // If possible, add a more helpful display name for the component stack to improve debugging of React errors such as `Text strings must be rendered within a <Text> component.`.\n if (component?.default && __DEV__) {\n component.default.displayName ??= `${component.default.name ?? 'Route'}(${value.contextKey})`;\n }\n\n if (ErrorBoundary) {\n const Wrapped = React.forwardRef((props: any, ref: any) => {\n const children = React.createElement(component.default || EmptyRoute, {\n ...props,\n ref,\n });\n return <Try catch={ErrorBoundary}>{children}</Try>;\n });\n\n if (__DEV__) {\n Wrapped.displayName = `ErrorBoundary(${value.contextKey})`;\n }\n\n return {\n default: Wrapped,\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof component.default === 'object' &&\n component.default &&\n Object.keys(component.default).length === 0\n ) {\n return { default: EmptyRoute };\n }\n }\n\n return { default: component.default };\n}\n\nfunction fromLoadedRoute(value: RouteNode, res: LoadedRoute) {\n if (!(res instanceof Promise)) {\n return fromImport(value, res);\n }\n\n return res.then(fromImport.bind(null, value));\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n if (qualifiedStore.has(value)) {\n return qualifiedStore.get(value)!;\n }\n\n let ScreenComponent:\n | React.ForwardRefExoticComponent<React.RefAttributes<unknown>>\n | React.ComponentType<any>;\n\n // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n if (EXPO_ROUTER_IMPORT_MODE === 'lazy') {\n ScreenComponent = React.lazy(async () => {\n const res = value.loadRoute();\n return fromLoadedRoute(value, res) as Promise<{\n default: React.ComponentType<any>;\n }>;\n });\n\n if (__DEV__) {\n ScreenComponent.displayName = `AsyncRoute(${value.route})`;\n }\n } else {\n const res = value.loadRoute();\n ScreenComponent = fromImport(value, res).default!;\n }\n function BaseRoute({\n // Remove these React Navigation props to\n // enforce usage of expo-router hooks (where the query params are correct).\n route,\n navigation,\n\n // Pass all other props to the component\n ...props\n }: any) {\n const stateForPath = useStateForPath();\n const isFocused = navigation.isFocused();\n const store = useExpoRouterStore();\n\n if (isFocused) {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }\n\n useEffect(\n () =>\n navigation.addListener('focus', () => {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n // Because setFocusedState caches the route info, this call will only trigger rerenders\n // if the component itself didn’t rerender and the route info changed.\n // Otherwise, the update from the `if` above will handle it,\n // and this won’t cause a redundant second update.\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }),\n [navigation]\n );\n\n useEffect(() => {\n return navigation.addListener(\n 'transitionEnd',\n (e?: NativeStackNavigationEventMap['transitionEnd']) => {\n if (!e?.data?.closing) {\n // When navigating to a screen, remove the no animation param to re-enable animations\n // Otherwise the navigation back would also have no animation\n if (hasParam(route?.params, INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {\n navigation.replaceParams(\n removeParams(route?.params, [INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME])\n );\n }\n }\n }\n );\n }, [navigation]);\n\n return (\n <Route node={value} route={route}>\n <ZoomTransitionEnabler route={route} />\n <ZoomTransitionTargetContextProvider route={route}>\n <React.Suspense fallback={<SuspenseFallback route={value} />}>\n <ScreenComponent\n {...props}\n // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n // the intention is to make it possible to deduce shared routes.\n segment={value.route}\n />\n </React.Suspense>\n </ZoomTransitionTargetContextProvider>\n </Route>\n );\n }\n\n if (__DEV__) {\n BaseRoute.displayName = `Route(${value.route})`;\n }\n\n qualifiedStore.set(value, BaseRoute);\n return BaseRoute;\n}\n\nexport function screenOptionsFactory(\n route: RouteNode,\n options?: ScreenProps['options']\n): ScreenProps['options'] {\n return (args) => {\n // Only eager load generated components\n const staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n const staticResult = typeof staticOptions === 'function' ? staticOptions(args) : staticOptions;\n const dynamicResult = typeof options === 'function' ? options?.(args) : options;\n const output = {\n ...staticResult,\n ...dynamicResult,\n };\n\n // Prevent generated screens from showing up in the tab bar.\n if (route.internal) {\n output.tabBarItemStyle = { display: 'none' };\n output.tabBarButton = () => null;\n // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n output.drawerItemStyle = { height: 0, display: 'none' };\n }\n\n return output;\n };\n}\n\nexport function routeToScreen(\n route: RouteNode,\n { options, getId, ...props }: Partial<ScreenProps> = {}\n) {\n return (\n <Screen\n {...props}\n name={route.route}\n key={route.route}\n getId={getId}\n options={screenOptionsFactory(route, options)}\n getComponent={() => getQualifiedRouteComponent(route)}\n />\n );\n}\n\nexport function getSingularId(name: string, options: Record<string, any> = {}) {\n return name\n .split('/')\n .map((segment) => {\n if (segment.startsWith('[...')) {\n return options.params?.[segment.slice(4, -1)]?.join('/') || segment;\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n return options.params?.[segment.slice(1, -1)] || segment;\n } else {\n return segment;\n }\n })\n .join('/');\n}\n"]}
1
+ {"version":3,"file":"useScreens.js","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Jb,4CAwBC;AAmDD,gEAkGC;AAED,oDAwBC;AAED,sCA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,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC;QACtE,CAAC;aAAM,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5D,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport {\n useStateForPath,\n type EventMapBase,\n type NavigationState,\n type ParamListBase,\n type RouteProp,\n type ScreenListeners,\n} from '@react-navigation/native';\nimport type { NativeStackNavigationEventMap } from '@react-navigation/native-stack';\nimport React, { useEffect } from 'react';\n\nimport { LoadedRoute, Route, RouteNode, sortRoutesWithInitial, useRouteNode } from './Route';\nimport { useExpoRouterStore } from './global-state/storeContext';\nimport EXPO_ROUTER_IMPORT_MODE from './import-mode';\nimport { ZoomTransitionEnabler } from './link/zoom/ZoomTransitionEnabler';\nimport { ZoomTransitionTargetContextProvider } from './link/zoom/zoom-transition-context-providers';\nimport {\n hasParam,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n removeParams,\n} from './navigationParams';\nimport { Screen } from './primitives';\nimport { UnknownOutputParams } from './types';\nimport { EmptyRoute } from './views/EmptyRoute';\nimport { SuspenseFallback } from './views/SuspenseFallback';\nimport { Try } from './views/Try';\n\nexport type ScreenProps<\n TOptions extends Record<string, any> = Record<string, any>,\n TState extends NavigationState = NavigationState,\n TEventMap extends EventMapBase = EventMapBase,\n> = {\n /** Name is required when used inside a Layout component. */\n name?: string;\n /**\n * Redirect to the nearest sibling route.\n * If all children are `redirect={true}`, the layout will render `null` as there are no children to render.\n */\n redirect?: boolean;\n initialParams?: Record<string, any>;\n options?:\n | TOptions\n | ((prop: { route: RouteProp<ParamListBase, string>; navigation: any }) => TOptions);\n\n listeners?:\n | ScreenListeners<TState, TEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n navigation: any;\n }) => ScreenListeners<TState, TEventMap>);\n\n getId?: ({ params }: { params?: Record<string, any> }) => string | undefined;\n\n dangerouslySingular?: SingularOptions;\n};\n\nexport type SingularOptions =\n | boolean\n | ((name: string, params: UnknownOutputParams) => string | undefined);\n\nfunction getSortedChildren(\n children: RouteNode[],\n order: ScreenProps[] = [],\n initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n if (!order?.length) {\n return children\n .sort(sortRoutesWithInitial(initialRouteName))\n .map((route) => ({ route, props: {} }));\n }\n const entries = [...children];\n\n const ordered = order\n .map(\n ({\n name,\n redirect,\n initialParams,\n listeners,\n options,\n getId,\n dangerouslySingular: singular,\n }) => {\n if (!entries.length) {\n console.warn(\n `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n );\n return null;\n }\n const matchIndex = entries.findIndex((child) => child.route === name);\n if (matchIndex === -1) {\n console.warn(\n `[Layout children]: No route named \"${name}\" exists in nested children:`,\n children.map(({ route }) => route)\n );\n return null;\n } else {\n // Get match and remove from entries\n const match = entries[matchIndex];\n entries.splice(matchIndex, 1);\n\n // Ensure to return null after removing from entries.\n if (redirect) {\n if (typeof redirect === 'string') {\n throw new Error(`Redirecting to a specific route is not supported yet.`);\n }\n return null;\n }\n\n if (getId) {\n console.warn(\n `Deprecated: prop 'getId' on screen ${name} is deprecated. Please rename the prop to 'dangerouslySingular'`\n );\n if (singular) {\n console.warn(\n `Screen ${name} cannot use both getId and dangerouslySingular together.`\n );\n }\n } else if (singular) {\n // If singular is set, use it as the getId function.\n if (typeof singular === 'string') {\n getId = () => singular;\n } else if (typeof singular === 'function' && name) {\n getId = (options) => singular(name, options.params || {});\n } else if (singular === true && name) {\n getId = (options) => getSingularId(name, options);\n }\n }\n\n return {\n route: match,\n props: { initialParams, listeners, options, getId },\n };\n }\n }\n )\n .filter(Boolean) as {\n route: RouteNode;\n props: Partial<ScreenProps>;\n }[];\n\n // Add any remaining children\n ordered.push(\n ...entries.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({ route, props: {} }))\n );\n\n return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(\n order: ScreenProps[],\n protectedScreens: Set<string>,\n useOnlyUserDefinedScreens: boolean = false\n): React.ReactNode[] {\n const node = useRouteNode();\n\n const nodeChildren = node?.children ?? [];\n const children = useOnlyUserDefinedScreens\n ? nodeChildren.filter((child) =>\n order.some((userDefinedScreen) => userDefinedScreen.name === child.route)\n )\n : nodeChildren;\n\n const sorted = children.length ? getSortedChildren(children, order, node?.initialRouteName) : [];\n return React.useMemo(\n () =>\n sorted\n .filter((item) => !protectedScreens.has(item.route.route))\n .map((value) => {\n return routeToScreen(value.route, value.props);\n }),\n [sorted, protectedScreens]\n );\n}\n\nfunction fromImport(value: RouteNode, { ErrorBoundary, ...component }: LoadedRoute) {\n // If possible, add a more helpful display name for the component stack to improve debugging of React errors such as `Text strings must be rendered within a <Text> component.`.\n if (component?.default && __DEV__) {\n component.default.displayName ??= `${component.default.name ?? 'Route'}(${value.contextKey})`;\n }\n\n if (ErrorBoundary) {\n const Wrapped = React.forwardRef((props: any, ref: any) => {\n const children = React.createElement(component.default || EmptyRoute, {\n ...props,\n ref,\n });\n return <Try catch={ErrorBoundary}>{children}</Try>;\n });\n\n if (__DEV__) {\n Wrapped.displayName = `ErrorBoundary(${value.contextKey})`;\n }\n\n return {\n default: Wrapped,\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof component.default === 'object' &&\n component.default &&\n Object.keys(component.default).length === 0\n ) {\n return { default: EmptyRoute };\n }\n }\n\n return { default: component.default };\n}\n\nfunction fromLoadedRoute(value: RouteNode, res: LoadedRoute) {\n if (!(res instanceof Promise)) {\n return fromImport(value, res);\n }\n\n return res.then(fromImport.bind(null, value));\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n if (qualifiedStore.has(value)) {\n return qualifiedStore.get(value)!;\n }\n\n let ScreenComponent:\n | React.ForwardRefExoticComponent<React.RefAttributes<unknown>>\n | React.ComponentType<any>;\n\n // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n if (EXPO_ROUTER_IMPORT_MODE === 'lazy') {\n ScreenComponent = React.lazy(async () => {\n const res = value.loadRoute();\n return fromLoadedRoute(value, res) as Promise<{\n default: React.ComponentType<any>;\n }>;\n });\n\n if (__DEV__) {\n ScreenComponent.displayName = `AsyncRoute(${value.route})`;\n }\n } else {\n const res = value.loadRoute();\n ScreenComponent = fromImport(value, res).default!;\n }\n function BaseRoute({\n // Remove these React Navigation props to\n // enforce usage of expo-router hooks (where the query params are correct).\n route,\n navigation,\n\n // Pass all other props to the component\n ...props\n }: any) {\n const stateForPath = useStateForPath();\n const isFocused = navigation.isFocused();\n const store = useExpoRouterStore();\n\n if (isFocused) {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }\n\n useEffect(\n () =>\n navigation.addListener('focus', () => {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n // Because setFocusedState caches the route info, this call will only trigger rerenders\n // if the component itself didn’t rerender and the route info changed.\n // Otherwise, the update from the `if` above will handle it,\n // and this won’t cause a redundant second update.\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }),\n [navigation]\n );\n\n useEffect(() => {\n return navigation.addListener(\n 'transitionEnd',\n (e?: NativeStackNavigationEventMap['transitionEnd']) => {\n if (!e?.data?.closing) {\n // When navigating to a screen, remove the no animation param to re-enable animations\n // Otherwise the navigation back would also have no animation\n if (hasParam(route?.params, INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {\n navigation.replaceParams(\n removeParams(route?.params, [INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME])\n );\n }\n }\n }\n );\n }, [navigation]);\n\n return (\n <Route node={value} route={route}>\n <ZoomTransitionEnabler route={route} />\n <ZoomTransitionTargetContextProvider route={route}>\n <React.Suspense fallback={<SuspenseFallback route={value} />}>\n <ScreenComponent\n {...props}\n // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n // the intention is to make it possible to deduce shared routes.\n segment={value.route}\n />\n </React.Suspense>\n </ZoomTransitionTargetContextProvider>\n </Route>\n );\n }\n\n if (__DEV__) {\n BaseRoute.displayName = `Route(${value.route})`;\n }\n\n qualifiedStore.set(value, BaseRoute);\n return BaseRoute;\n}\n\nexport function screenOptionsFactory(\n route: RouteNode,\n options?: ScreenProps['options']\n): ScreenProps['options'] {\n return (args) => {\n // Only eager load generated components\n const staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n const staticResult = typeof staticOptions === 'function' ? staticOptions(args) : staticOptions;\n const dynamicResult = typeof options === 'function' ? options?.(args) : options;\n const output = {\n ...staticResult,\n ...dynamicResult,\n };\n\n // Prevent generated screens from showing up in the tab bar.\n if (route.internal) {\n output.tabBarItemStyle = { display: 'none' };\n output.tabBarButton = () => null;\n // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n output.drawerItemStyle = { height: 0, display: 'none' };\n }\n\n return output;\n };\n}\n\nexport function routeToScreen(\n route: RouteNode,\n { options, getId, ...props }: Partial<ScreenProps> = {}\n) {\n return (\n <Screen\n {...props}\n name={route.route}\n key={route.route}\n getId={getId}\n options={screenOptionsFactory(route, options)}\n getComponent={() => getQualifiedRouteComponent(route)}\n />\n );\n}\n\nexport function getSingularId(name: string, options: Record<string, any> = {}) {\n return name\n .split('/')\n .map((segment) => {\n if (segment.startsWith('[...')) {\n return options.params?.[segment.slice(4, -1)]?.join('/') || segment;\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n return options.params?.[segment.slice(1, -1)] || segment;\n } else {\n return segment;\n }\n })\n .join('/');\n}\n"]}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.router",
11
11
  "artifactId": "expo.modules.router",
12
- "version": "7.0.0-canary-20251211-7da85ea",
12
+ "version": "7.0.0-canary-20251216-6e1f9a7",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -2,7 +2,7 @@ import ExpoModulesCore
2
2
 
3
3
  public class LinkPreviewNativeModule: Module {
4
4
  static let moduleName: String = "ExpoRouterNativeLinkPreview"
5
- lazy var zoomSourceRepository = LinkZoomTransitionsSourceRepository()
5
+ lazy var zoomSourceRepository = LinkZoomTransitionsSourceRepository(logger: appContext?.jsLogger)
6
6
  lazy var zoomAlignmentViewRepository = LinkZoomTransitionsAlignmentViewRepository()
7
7
 
8
8
  public func definition() -> ModuleDefinition {
@@ -102,6 +102,9 @@ public class LinkPreviewNativeModule: Module {
102
102
  view.alignment = nil
103
103
  }
104
104
  }
105
+ Prop("animateAspectRatioChange") { (view: LinkZoomTransitionSource, value: Bool?) in
106
+ view.animateAspectRatioChange = value ?? false
107
+ }
105
108
  }
106
109
 
107
110
  View(LinkZoomTransitionEnabler.self) {