@symbiote-native/navigation 2.0.0 → 2.0.1

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 (155) hide show
  1. package/package.json +11 -10
  2. package/build/angular/drawer/index.d.ts +0 -76
  3. package/build/angular/drawer/index.js +0 -508
  4. package/build/angular/drawer-screen.directive.d.ts +0 -14
  5. package/build/angular/drawer-screen.directive.js +0 -87
  6. package/build/angular/index.d.ts +0 -23
  7. package/build/angular/index.js +0 -22
  8. package/build/angular/injectors/index.d.ts +0 -13
  9. package/build/angular/injectors/index.js +0 -8
  10. package/build/angular/injectors/inject-drawer-navigation.d.ts +0 -4
  11. package/build/angular/injectors/inject-drawer-navigation.js +0 -12
  12. package/build/angular/injectors/inject-focus-effect.d.ts +0 -2
  13. package/build/angular/injectors/inject-focus-effect.js +0 -29
  14. package/build/angular/injectors/inject-is-focused.d.ts +0 -2
  15. package/build/angular/injectors/inject-is-focused.js +0 -20
  16. package/build/angular/injectors/inject-navigation-state.d.ts +0 -3
  17. package/build/angular/injectors/inject-navigation-state.js +0 -35
  18. package/build/angular/injectors/inject-navigation.d.ts +0 -7
  19. package/build/angular/injectors/inject-navigation.js +0 -16
  20. package/build/angular/injectors/inject-route.d.ts +0 -3
  21. package/build/angular/injectors/inject-route.js +0 -20
  22. package/build/angular/injectors/inject-stack-navigation.d.ts +0 -4
  23. package/build/angular/injectors/inject-stack-navigation.js +0 -15
  24. package/build/angular/injectors/inject-tab-navigation.d.ts +0 -4
  25. package/build/angular/injectors/inject-tab-navigation.js +0 -11
  26. package/build/angular/linking.d.ts +0 -3
  27. package/build/angular/linking.js +0 -43
  28. package/build/angular/navigation-context.service.d.ts +0 -13
  29. package/build/angular/navigation-context.service.js +0 -105
  30. package/build/angular/navigation-scope.directive.d.ts +0 -10
  31. package/build/angular/navigation-scope.directive.js +0 -90
  32. package/build/angular/screen.directive.d.ts +0 -22
  33. package/build/angular/screen.directive.js +0 -90
  34. package/build/angular/search-bar-ref.directive.d.ts +0 -10
  35. package/build/angular/search-bar-ref.directive.js +0 -88
  36. package/build/angular/stack/index.d.ts +0 -55
  37. package/build/angular/stack/index.js +0 -386
  38. package/build/angular/tab-screen.directive.d.ts +0 -14
  39. package/build/angular/tab-screen.directive.js +0 -87
  40. package/build/angular/tabs/index.d.ts +0 -42
  41. package/build/angular/tabs/index.js +0 -263
  42. package/build/core/constants.d.ts +0 -27
  43. package/build/core/constants.js +0 -61
  44. package/build/core/drawer-options/index.d.ts +0 -64
  45. package/build/core/drawer-options/index.js +0 -200
  46. package/build/core/drawer-router-state/index.d.ts +0 -21
  47. package/build/core/drawer-router-state/index.js +0 -40
  48. package/build/core/guards.d.ts +0 -2
  49. package/build/core/guards.js +0 -22
  50. package/build/core/header-bar-buttons.d.ts +0 -9
  51. package/build/core/header-bar-buttons.js +0 -163
  52. package/build/core/index.d.ts +0 -29
  53. package/build/core/index.js +0 -32
  54. package/build/core/linking-config/index.d.ts +0 -13
  55. package/build/core/linking-config/index.js +0 -171
  56. package/build/core/navigation-events/index.d.ts +0 -16
  57. package/build/core/navigation-events/index.js +0 -57
  58. package/build/core/navigator-handles/index.d.ts +0 -30
  59. package/build/core/navigator-handles/index.js +0 -15
  60. package/build/core/navigator-props.d.ts +0 -216
  61. package/build/core/navigator-props.js +0 -7
  62. package/build/core/navigator-state/index.d.ts +0 -36
  63. package/build/core/navigator-state/index.js +0 -81
  64. package/build/core/render-drawer.d.ts +0 -13
  65. package/build/core/render-drawer.js +0 -88
  66. package/build/core/render-stack.d.ts +0 -35
  67. package/build/core/render-stack.js +0 -294
  68. package/build/core/render-tabs.d.ts +0 -20
  69. package/build/core/render-tabs.js +0 -97
  70. package/build/core/screen-options.d.ts +0 -4
  71. package/build/core/screen-options.js +0 -133
  72. package/build/core/search-bar-commands.d.ts +0 -10
  73. package/build/core/search-bar-commands.js +0 -42
  74. package/build/core/state-persistence/index.d.ts +0 -3
  75. package/build/core/state-persistence/index.js +0 -23
  76. package/build/core/tab-options.d.ts +0 -13
  77. package/build/core/tab-options.js +0 -10
  78. package/build/core/tab-router-state/index.d.ts +0 -19
  79. package/build/core/tab-router-state/index.js +0 -51
  80. package/build/react/collect-registry.d.ts +0 -4
  81. package/build/react/collect-registry.js +0 -15
  82. package/build/react/drawer/index.d.ts +0 -29
  83. package/build/react/drawer/index.js +0 -277
  84. package/build/react/drawer-screen.d.ts +0 -14
  85. package/build/react/drawer-screen.js +0 -8
  86. package/build/react/hooks/index.d.ts +0 -12
  87. package/build/react/hooks/index.js +0 -8
  88. package/build/react/hooks/use-drawer-navigation.d.ts +0 -4
  89. package/build/react/hooks/use-drawer-navigation.js +0 -12
  90. package/build/react/hooks/use-focus-effect.d.ts +0 -2
  91. package/build/react/hooks/use-focus-effect.js +0 -29
  92. package/build/react/hooks/use-is-focused.d.ts +0 -1
  93. package/build/react/hooks/use-is-focused.js +0 -22
  94. package/build/react/hooks/use-navigation-state/index.d.ts +0 -2
  95. package/build/react/hooks/use-navigation-state/index.js +0 -39
  96. package/build/react/hooks/use-navigation.d.ts +0 -7
  97. package/build/react/hooks/use-navigation.js +0 -16
  98. package/build/react/hooks/use-route.d.ts +0 -2
  99. package/build/react/hooks/use-route.js +0 -8
  100. package/build/react/hooks/use-stack-navigation.d.ts +0 -4
  101. package/build/react/hooks/use-stack-navigation.js +0 -14
  102. package/build/react/hooks/use-tab-navigation.d.ts +0 -4
  103. package/build/react/hooks/use-tab-navigation.js +0 -12
  104. package/build/react/index.d.ts +0 -24
  105. package/build/react/index.js +0 -21
  106. package/build/react/linking.d.ts +0 -3
  107. package/build/react/linking.js +0 -47
  108. package/build/react/navigation-context.d.ts +0 -10
  109. package/build/react/navigation-context.js +0 -22
  110. package/build/react/screen.d.ts +0 -22
  111. package/build/react/screen.js +0 -7
  112. package/build/react/stack/index.d.ts +0 -13
  113. package/build/react/stack/index.js +0 -202
  114. package/build/react/tab-screen.d.ts +0 -15
  115. package/build/react/tab-screen.js +0 -8
  116. package/build/react/tabs/index.d.ts +0 -12
  117. package/build/react/tabs/index.js +0 -116
  118. package/build/register.d.ts +0 -7
  119. package/build/register.js +0 -58
  120. package/build/vue/composables/index.d.ts +0 -12
  121. package/build/vue/composables/index.js +0 -8
  122. package/build/vue/composables/use-drawer-navigation.d.ts +0 -5
  123. package/build/vue/composables/use-drawer-navigation.js +0 -15
  124. package/build/vue/composables/use-focus-effect.d.ts +0 -1
  125. package/build/vue/composables/use-focus-effect.js +0 -31
  126. package/build/vue/composables/use-is-focused.d.ts +0 -2
  127. package/build/vue/composables/use-is-focused.js +0 -28
  128. package/build/vue/composables/use-navigation-state.d.ts +0 -3
  129. package/build/vue/composables/use-navigation-state.js +0 -29
  130. package/build/vue/composables/use-navigation.d.ts +0 -8
  131. package/build/vue/composables/use-navigation.js +0 -13
  132. package/build/vue/composables/use-route.d.ts +0 -3
  133. package/build/vue/composables/use-route.js +0 -9
  134. package/build/vue/composables/use-stack-navigation.d.ts +0 -5
  135. package/build/vue/composables/use-stack-navigation.js +0 -18
  136. package/build/vue/composables/use-tab-navigation.d.ts +0 -5
  137. package/build/vue/composables/use-tab-navigation.js +0 -15
  138. package/build/vue/drawer/index.d.ts +0 -19
  139. package/build/vue/drawer/index.js +0 -390
  140. package/build/vue/drawer-screen.d.ts +0 -14
  141. package/build/vue/drawer-screen.js +0 -12
  142. package/build/vue/index.d.ts +0 -21
  143. package/build/vue/index.js +0 -19
  144. package/build/vue/linking.d.ts +0 -3
  145. package/build/vue/linking.js +0 -57
  146. package/build/vue/navigation-context.d.ts +0 -16
  147. package/build/vue/navigation-context.js +0 -65
  148. package/build/vue/screen.d.ts +0 -21
  149. package/build/vue/screen.js +0 -12
  150. package/build/vue/stack/index.d.ts +0 -9
  151. package/build/vue/stack/index.js +0 -279
  152. package/build/vue/tab-screen.d.ts +0 -14
  153. package/build/vue/tab-screen.js +0 -11
  154. package/build/vue/tabs/index.d.ts +0 -10
  155. package/build/vue/tabs/index.js +0 -209
package/build/register.js DELETED
@@ -1,58 +0,0 @@
1
- // Side-effect: register RNSScreen/RNSScreenStack/RNSScreenStackHeaderConfig/
2
- // RNSScreenStackHeaderSubview/RNSSearchBar/RNSScreenContentWrapper's ViewConfigs in RN's
3
- // ReactNativeViewConfigRegistry. Evaluating each codegen native-component spec
4
- // (codegenNativeComponent('RNSScreen', ...) etc.) registers the getter the engine reads via
5
- // setNativeViewConfigSource, so events + color processors derive on first commit. We import the
6
- // codegen SPECS, never react-native-screens' React components (ScreenStack.tsx et al - hooks,
7
- // crashes a non-React adapter) - these modules have no hooks, so they are framework-agnostic and
8
- // shared by every adapter entry. Each adapter barrel imports this; the component modules and
9
- // their headless tests stay free of it. See CLAUDE.md <third_party_rn_packages_are_react_only>.
10
- //
11
- // RNSSearchBar (headerSearchBarOptions' native leaf, nested by render-stack.ts's
12
- // renderHeaderConfig) was missing from this list - its ViewConfig was never registered, so Fabric
13
- // had no component descriptor for 'RNSSearchBar' and crashed on mount the moment a screen set
14
- // headerSearchBarOptions. That is the root cause of the search-bar crash, not a deeper
15
- // Fabric-interop gap.
16
- //
17
- // RNSScreenStackHeaderSubview (the wrapper renderHeaderConfig nests the search bar leaf inside,
18
- // per RNSScreenStackHeaderConfig.mm's mountChildComponentView requiring every header child to be
19
- // one) needs the same registration, or the same class of mount crash follows.
20
- //
21
- // RNSScreenContentWrapper (the RNS_SCREEN_CONTENT_WRAPPER_VIEW_NAME wrapper stack.ts wraps every
22
- // screen's content in - see its comment in core/constants.ts) additionally needs a NATIVE-side
23
- // registration: this file alone is not enough. The native iOS registry
24
- // (RCTThirdPartyComponentsProvider.mm, generated by codegen from THIS package's own
25
- // package.json#codegenConfig.ios.componentProvider map, NOT from react-native-screens') has no
26
- // entry for 'RNSScreenContentWrapper' by default, so without it Fabric falls back to its
27
- // "Unimplemented component" placeholder view regardless of this file's import. Both registries
28
- // are independently required for a never-before-used react-native-screens view: this file (JS
29
- // ViewConfig, read by @symbiote-native/engine's registry.ts) and package.json's componentProvider
30
- // map (native ComponentDescriptor, read by codegen at `pod install` time).
31
- //
32
- // RNSModalScreen's gap on both registries isn't a mount crash but a silent mispositioning bug.
33
- // react-native-screens' own Screen.tsx picks
34
- // ModalScreenNativeComponent ('RNSModalScreen') instead of ScreenNativeComponent ('RNSScreen')
35
- // whenever stackPresentation isn't push/containedModal/containedTransparentModal, because
36
- // RNSScreen.mm's updateLayoutMetrics: checks `[self isKindOfClass:RNSModalScreen.class]` and, for
37
- // that class, DELIBERATELY skips applying Yoga's computed frame (its own comment: "the available
38
- // space is most likely restricted & differs from what Yoga resolves during first layout - we want
39
- // to rely on native layout here"). Emitting a plain 'RNSScreen' for a formSheet/modal presentation
40
- // (as resolveScreenViewName below used to do unconditionally) means that check never matches, so
41
- // Yoga's frame - computed as if the screen were still a normal flexed sibling in its outer
42
- // RNSScreenStack's push-oriented column layout - gets applied verbatim and never corrected,
43
- // visually shifting the whole modal down by one full screen's height. Fixed in
44
- // core/render-stack.ts's resolveScreenViewName, which now mirrors Screen.tsx's own
45
- // shouldUseModalScreenComponent condition exactly.
46
- //
47
- // Unlike @symbiote-native/slider (which deep-imports @react-native-community/slider's compiled
48
- // `dist/`), react-native-screens declares `"react-native": "src/index"` in its package.json -
49
- // Metro's resolverMainFields prioritizes that field, so it resolves the library straight to raw
50
- // TypeScript source and transforms it like first-party code. The deep import below targets that
51
- // same `src/fabric/` tree rather than a compiled output.
52
- import 'react-native-screens/src/fabric/ScreenNativeComponent';
53
- import 'react-native-screens/src/fabric/ModalScreenNativeComponent';
54
- import 'react-native-screens/src/fabric/ScreenStackNativeComponent';
55
- import 'react-native-screens/src/fabric/ScreenStackHeaderConfigNativeComponent';
56
- import 'react-native-screens/src/fabric/ScreenStackHeaderSubviewNativeComponent';
57
- import 'react-native-screens/src/fabric/SearchBarNativeComponent';
58
- import 'react-native-screens/src/fabric/ScreenContentWrapperNativeComponent';
@@ -1,12 +0,0 @@
1
- export { useNavigation } from './use-navigation';
2
- export type { INavigationHandle } from './use-navigation';
3
- export { useStackNavigation } from './use-stack-navigation';
4
- export type { IStackNavigationHandle } from './use-stack-navigation';
5
- export { useTabNavigation } from './use-tab-navigation';
6
- export type { ITabNavigationHandle } from './use-tab-navigation';
7
- export { useDrawerNavigation } from './use-drawer-navigation';
8
- export type { IDrawerNavigationHandle } from './use-drawer-navigation';
9
- export { useRoute } from './use-route';
10
- export { useIsFocused } from './use-is-focused';
11
- export { useFocusEffect } from './use-focus-effect';
12
- export { useNavigationState } from './use-navigation-state';
@@ -1,8 +0,0 @@
1
- export { useNavigation } from './use-navigation.js';
2
- export { useStackNavigation } from './use-stack-navigation.js';
3
- export { useTabNavigation } from './use-tab-navigation.js';
4
- export { useDrawerNavigation } from './use-drawer-navigation.js';
5
- export { useRoute } from './use-route.js';
6
- export { useIsFocused } from './use-is-focused.js';
7
- export { useFocusEffect } from './use-focus-effect.js';
8
- export { useNavigationState } from './use-navigation-state.js';
@@ -1,5 +0,0 @@
1
- import type { ComputedRef } from '@vue/runtime-core';
2
- import type { IDrawerNavigatorHandle } from '../../core';
3
- import type { INavigationHandle } from './use-navigation';
4
- export type IDrawerNavigationHandle = IDrawerNavigatorHandle & Pick<INavigationHandle, 'addListener' | 'getParent'>;
5
- export declare function useDrawerNavigation(): ComputedRef<IDrawerNavigationHandle>;
@@ -1,15 +0,0 @@
1
- // Twin of use-stack-navigation.ts, narrowing to a Drawer handle instead.
2
- import { computed } from '@vue/runtime-core';
3
- import { isDrawerNavigatorHandle } from '../../core/index.js';
4
- import { useNavigation } from './use-navigation.js';
5
- export function useDrawerNavigation() {
6
- const navigation = useNavigation();
7
- return computed(() => {
8
- const value = navigation.value;
9
- if (!isDrawerNavigatorHandle(value)) {
10
- throw new Error('useDrawerNavigation() was called from a component whose nearest navigator is not a Drawer. ' +
11
- 'Use useNavigation() instead if this component can render under more than one navigator kind.');
12
- }
13
- return value;
14
- });
15
- }
@@ -1 +0,0 @@
1
- export declare function useFocusEffect(effect: () => (() => void) | void): void;
@@ -1,31 +0,0 @@
1
- // Mirrors @react-navigation's useFocusEffect; Vue twin of react/hooks/use-focus-effect.ts.
2
- // React's version requires memoizing `effect` (useCallback) since a new identity re-subscribes
3
- // it like any other useEffect dependency. That doesn't apply here: Vue's setup() runs once, so
4
- // `effect` is read once at composable-call time and closed over directly by onMounted/onUnmounted -
5
- // there's no dependency array to go stale.
6
- import { onMounted, onUnmounted } from '@vue/runtime-core';
7
- import { NAVIGATION_EVENT_BLUR, NAVIGATION_EVENT_FOCUS } from '../../core/index.js';
8
- import { requireNavigationScope } from '../navigation-context.js';
9
- export function useFocusEffect(effect) {
10
- const scope = requireNavigationScope('useFocusEffect');
11
- let cleanup;
12
- let unsubscribeFocus;
13
- let unsubscribeBlur;
14
- const runEffect = () => {
15
- cleanup = effect();
16
- };
17
- const runCleanup = () => {
18
- cleanup?.();
19
- cleanup = undefined;
20
- };
21
- onMounted(() => {
22
- const { emitter } = scope.value;
23
- unsubscribeFocus = emitter.addListener(NAVIGATION_EVENT_FOCUS, runEffect);
24
- unsubscribeBlur = emitter.addListener(NAVIGATION_EVENT_BLUR, runCleanup);
25
- });
26
- onUnmounted(() => {
27
- unsubscribeFocus?.();
28
- unsubscribeBlur?.();
29
- runCleanup();
30
- });
31
- }
@@ -1,2 +0,0 @@
1
- import type { Ref } from '@vue/runtime-core';
2
- export declare function useIsFocused(): Ref<boolean>;
@@ -1,28 +0,0 @@
1
- // Mirrors @react-navigation's useIsFocused; Vue twin of react/hooks/use-is-focused.ts.
2
- // Starts `false` rather than guessing from stack position: the route's emitter only fires 'focus'
3
- // once RNSScreen's native onAppear lands (stack.ts) or the screen mounts focused (tabs.ts/drawer.ts) -
4
- // a screen genuinely isn't focused at the instant it mounts, the same async gap real native
5
- // transitions have.
6
- import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
7
- import { NAVIGATION_EVENT_BLUR, NAVIGATION_EVENT_FOCUS } from '../../core/index.js';
8
- import { requireNavigationScope } from '../navigation-context.js';
9
- export function useIsFocused() {
10
- const scope = requireNavigationScope('useIsFocused');
11
- const isFocused = ref(false);
12
- let unsubscribeFocus;
13
- let unsubscribeBlur;
14
- onMounted(() => {
15
- const { emitter } = scope.value;
16
- unsubscribeFocus = emitter.addListener(NAVIGATION_EVENT_FOCUS, () => {
17
- isFocused.value = true;
18
- });
19
- unsubscribeBlur = emitter.addListener(NAVIGATION_EVENT_BLUR, () => {
20
- isFocused.value = false;
21
- });
22
- });
23
- onUnmounted(() => {
24
- unsubscribeFocus?.();
25
- unsubscribeBlur?.();
26
- });
27
- return isFocused;
28
- }
@@ -1,3 +0,0 @@
1
- import type { ShallowRef } from '@vue/runtime-core';
2
- import type { INavigatorState } from '../../core';
3
- export declare function useNavigationState<TResult>(selector: (state: INavigatorState) => TResult): ShallowRef<TResult>;
@@ -1,29 +0,0 @@
1
- // Mirrors @react-navigation's useNavigationState; Vue twin of react/hooks/use-navigation-state.ts.
2
- // The reducer/dispatch machinery lives in core/navigator-state.ts (tab-router-state.ts /
3
- // drawer-router-state.ts for the other two navigators) - this composable only wires the
4
- // subscription to the `state` broadcast each render loop re-emits after commit.
5
- //
6
- // Seeded from a single-route snapshot ({ routes: [route] }) rather than left undefined: the real
7
- // broadcast lands after mount (Stack's render loop; tabs.ts/drawer.ts emit on focus), so a
8
- // selector reading e.g. `state.routes.at(-1)?.name` still resolves correctly on first paint for
9
- // the common single-route case - the same async gap useIsFocused documents.
10
- import { onMounted, onUnmounted, shallowRef } from '@vue/runtime-core';
11
- import { NAVIGATION_EVENT_STATE, isRecord } from '../../core/index.js';
12
- import { requireNavigationScope } from '../navigation-context.js';
13
- function isNavigatorState(value) {
14
- return isRecord(value) && Array.isArray(value.routes);
15
- }
16
- export function useNavigationState(selector) {
17
- const scope = requireNavigationScope('useNavigationState');
18
- const result = shallowRef(selector({ routes: [scope.value.route] }));
19
- let unsubscribe;
20
- onMounted(() => {
21
- unsubscribe = scope.value.emitter.addListener(NAVIGATION_EVENT_STATE, (state) => {
22
- if (!isNavigatorState(state))
23
- return;
24
- result.value = selector(state);
25
- });
26
- });
27
- onUnmounted(() => unsubscribe?.());
28
- return result;
29
- }
@@ -1,8 +0,0 @@
1
- import type { ComputedRef } from '@vue/runtime-core';
2
- import type { INavigationEventListener, INavigationEventName } from '../../core';
3
- import type { IAnyNavigatorHandle } from '../navigation-context';
4
- export type INavigationHandle = IAnyNavigatorHandle & {
5
- addListener: (event: INavigationEventName, listener: INavigationEventListener) => () => void;
6
- getParent: () => IAnyNavigatorHandle | undefined;
7
- };
8
- export declare function useNavigation(): ComputedRef<INavigationHandle>;
@@ -1,13 +0,0 @@
1
- // Mirrors @react-navigation's `navigation.addListener('focus', cb)` surface; Vue twin of
2
- // react/hooks/use-navigation.ts (returns a ComputedRef, Vue's reactive-primitive convention,
3
- // instead of a plain value). All pub/sub logic lives in ../../core/navigation-events - this
4
- // composable only reads the injected navigation scope and binds identity.
5
- import { computed } from '@vue/runtime-core';
6
- import { requireNavigationScope } from '../navigation-context.js';
7
- export function useNavigation() {
8
- const scope = requireNavigationScope('useNavigation');
9
- return computed(() => {
10
- const { navigation, emitter, parent } = scope.value;
11
- return { ...navigation, addListener: emitter.addListener, getParent: () => parent?.navigation };
12
- });
13
- }
@@ -1,3 +0,0 @@
1
- import type { ComputedRef } from '@vue/runtime-core';
2
- import type { IRoute } from '../../core';
3
- export declare function useRoute(): ComputedRef<IRoute<unknown>>;
@@ -1,9 +0,0 @@
1
- // Mirrors @react-navigation's useRoute; Vue twin of react/hooks/use-route.ts (returns a
2
- // ComputedRef instead of a plain value). Zero logic of its own - the route object itself is built
3
- // by stack.ts's/tabs.ts's/drawer.ts's render loop from the shared core reducer's state.
4
- import { computed } from '@vue/runtime-core';
5
- import { requireNavigationScope } from '../navigation-context.js';
6
- export function useRoute() {
7
- const scope = requireNavigationScope('useRoute');
8
- return computed(() => scope.value.route);
9
- }
@@ -1,5 +0,0 @@
1
- import type { ComputedRef } from '@vue/runtime-core';
2
- import type { INavigatorHandle } from '../../core';
3
- import type { INavigationHandle } from './use-navigation';
4
- export type IStackNavigationHandle = INavigatorHandle & Pick<INavigationHandle, 'addListener' | 'getParent'>;
5
- export declare function useStackNavigation(): ComputedRef<IStackNavigationHandle>;
@@ -1,18 +0,0 @@
1
- // useNavigation() returns a union (IAnyNavigatorHandle) since it doesn't know which navigator
2
- // mounted the calling component. When a component genuinely knows it only ever renders under a
3
- // Stack, this composable narrows that union ONCE, here, so call sites never write their own
4
- // 'push' in navigation check. Vue twin of react/hooks/use-stack-navigation.ts.
5
- import { computed } from '@vue/runtime-core';
6
- import { isStackNavigatorHandle } from '../../core/index.js';
7
- import { useNavigation } from './use-navigation.js';
8
- export function useStackNavigation() {
9
- const navigation = useNavigation();
10
- return computed(() => {
11
- const value = navigation.value;
12
- if (!isStackNavigatorHandle(value)) {
13
- throw new Error('useStackNavigation() was called from a component whose nearest navigator is not a Stack. ' +
14
- 'Use useNavigation() instead if this component can render under more than one navigator kind.');
15
- }
16
- return value;
17
- });
18
- }
@@ -1,5 +0,0 @@
1
- import type { ComputedRef } from '@vue/runtime-core';
2
- import type { ITabNavigatorHandle } from '../../core';
3
- import type { INavigationHandle } from './use-navigation';
4
- export type ITabNavigationHandle = ITabNavigatorHandle & Pick<INavigationHandle, 'addListener' | 'getParent'>;
5
- export declare function useTabNavigation(): ComputedRef<ITabNavigationHandle>;
@@ -1,15 +0,0 @@
1
- // Twin of use-stack-navigation.ts, narrowing to a Tab handle instead.
2
- import { computed } from '@vue/runtime-core';
3
- import { isTabNavigatorHandle } from '../../core/index.js';
4
- import { useNavigation } from './use-navigation.js';
5
- export function useTabNavigation() {
6
- const navigation = useNavigation();
7
- return computed(() => {
8
- const value = navigation.value;
9
- if (!isTabNavigatorHandle(value)) {
10
- throw new Error('useTabNavigation() was called from a component whose nearest navigator is not a Tab. ' +
11
- 'Use useNavigation() instead if this component can render under more than one navigator kind.');
12
- }
13
- return value;
14
- });
15
- }
@@ -1,19 +0,0 @@
1
- import type { IStyleProp, IViewStyle } from '@symbiote-native/engine';
2
- import type { IDrawerDescriptorMap, IDrawerNavigatorHandle, IDrawerOptions, IDrawerRouterState } from '../../core';
3
- import type { IDrawerScreenProps } from '../drawer-screen';
4
- export type { IDrawerNavigatorHandle, IDrawerDescriptorMap } from '../../core';
5
- export type IDrawerContentSlotProps = {
6
- state: IDrawerRouterState;
7
- descriptors: IDrawerDescriptorMap;
8
- navigation: IDrawerNavigatorHandle;
9
- };
10
- export type IDrawerProps = IDrawerOptions & {
11
- initialRouteName?: string;
12
- drawerStyle?: IStyleProp<IViewStyle>;
13
- };
14
- export declare const Drawer: import("vue").DefineSetupFnComponent<IDrawerProps, {}, {}, IDrawerOptions & {
15
- initialRouteName?: string;
16
- drawerStyle?: IStyleProp<IViewStyle>;
17
- } & {}, import("vue").PublicProps> & {
18
- Screen: import("vue").DefineSetupFnComponent<IDrawerScreenProps, {}, {}, IDrawerScreenProps & {}, import("vue").PublicProps>;
19
- };