@sigx/lynx-navigation 0.1.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +189 -7
- package/dist/components/EntryScope.d.ts +1 -1
- package/dist/components/EntryScope.d.ts.map +1 -1
- package/dist/components/Layer.d.ts +34 -0
- package/dist/components/Layer.d.ts.map +1 -0
- package/dist/components/Link.d.ts +2 -2
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/NavigationRoot.d.ts +2 -2
- package/dist/components/NavigationRoot.d.ts.map +1 -1
- package/dist/components/Screen.d.ts +6 -6
- package/dist/components/Screen.d.ts.map +1 -1
- package/dist/components/Stack.d.ts +83 -13
- package/dist/components/Stack.d.ts.map +1 -1
- package/dist/components/TabBar.d.ts +19 -20
- package/dist/components/TabBar.d.ts.map +1 -1
- package/dist/components/Tabs.d.ts +30 -21
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/define-routes.d.ts +1 -1
- package/dist/define-routes.d.ts.map +1 -1
- package/dist/hooks/use-focus.d.ts.map +1 -1
- package/dist/hooks/use-hardware-back.d.ts +9 -2
- package/dist/hooks/use-hardware-back.d.ts.map +1 -1
- package/dist/hooks/use-linking-nav.d.ts +3 -3
- package/dist/hooks/use-linking-nav.d.ts.map +1 -1
- package/dist/hooks/use-nav-internal.d.ts +21 -3
- package/dist/hooks/use-nav-internal.d.ts.map +1 -1
- package/dist/hooks/use-nav-serializer.d.ts +1 -1
- package/dist/hooks/use-nav-serializer.d.ts.map +1 -1
- package/dist/hooks/use-nav.d.ts +38 -3
- package/dist/hooks/use-nav.d.ts.map +1 -1
- package/dist/hooks/use-params.d.ts +1 -1
- package/dist/hooks/use-params.d.ts.map +1 -1
- package/dist/hooks/use-screen-chrome.d.ts +19 -0
- package/dist/hooks/use-screen-chrome.d.ts.map +1 -0
- package/dist/hooks/use-screen-options.d.ts +1 -1
- package/dist/hooks/use-screen-options.d.ts.map +1 -1
- package/dist/hooks/use-search.d.ts +1 -1
- package/dist/hooks/use-search.d.ts.map +1 -1
- package/dist/href.d.ts +2 -2
- package/dist/href.d.ts.map +1 -1
- package/dist/index.d.ts +33 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1160 -29
- package/dist/index.js.map +1 -1
- package/dist/internal/layer-plan.d.ts +69 -0
- package/dist/internal/layer-plan.d.ts.map +1 -0
- package/dist/internal/screen-registry.d.ts +1 -1
- package/dist/internal/screen-registry.d.ts.map +1 -1
- package/dist/internal/screen-width.d.ts +9 -7
- package/dist/internal/screen-width.d.ts.map +1 -1
- package/dist/navigator/core.d.ts +31 -4
- package/dist/navigator/core.d.ts.map +1 -1
- package/dist/register.d.ts +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/url/index.d.ts +6 -6
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/parse.d.ts +1 -1
- package/dist/url/parse.d.ts.map +1 -1
- package/dist/url/registry.d.ts +2 -2
- package/dist/url/registry.d.ts.map +1 -1
- package/dist/url/validate.d.ts +1 -1
- package/dist/url/validate.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/components/Drawer.d.ts +55 -0
- package/src/components/EdgeBackHandle.d.ts +1 -0
- package/src/components/EdgeBackHandle.tsx +2 -2
- package/{dist/components/EntryScope.js → src/components/EntryScope.d.ts} +7 -15
- package/src/components/EntryScope.tsx +15 -4
- package/src/components/Header.d.ts +6 -0
- package/src/components/Header.tsx +3 -3
- package/src/components/Layer.d.ts +33 -0
- package/src/components/Layer.tsx +96 -0
- package/src/components/Link.d.ts +60 -0
- package/src/components/Link.tsx +4 -4
- package/src/components/NavigationRoot.d.ts +36 -0
- package/src/components/NavigationRoot.tsx +6 -6
- package/src/components/Screen.d.ts +97 -0
- package/src/components/Screen.tsx +13 -11
- package/src/components/Stack.d.ts +90 -0
- package/src/components/Stack.tsx +333 -92
- package/src/components/TabBar.d.ts +38 -0
- package/src/components/TabBar.tsx +22 -22
- package/src/components/Tabs.d.ts +109 -0
- package/src/components/Tabs.tsx +54 -22
- package/{dist/define-routes.js → src/define-routes.d.ts} +2 -4
- package/src/define-routes.ts +1 -1
- package/{dist/hooks/use-focus.js → src/hooks/use-focus.d.ts} +3 -39
- package/src/hooks/use-focus.ts +9 -3
- package/src/hooks/use-hardware-back.d.ts +37 -0
- package/src/hooks/use-hardware-back.ts +43 -9
- package/src/hooks/use-linking-nav.d.ts +91 -0
- package/src/hooks/use-linking-nav.ts +4 -4
- package/src/hooks/use-nav-internal.d.ts +91 -0
- package/src/hooks/use-nav-internal.ts +24 -3
- package/src/hooks/use-nav-serializer.d.ts +82 -0
- package/src/hooks/use-nav-serializer.ts +3 -3
- package/src/hooks/use-nav.d.ts +111 -0
- package/src/hooks/use-nav.ts +40 -3
- package/{dist/hooks/use-params.js → src/hooks/use-params.d.ts} +2 -6
- package/src/hooks/use-params.ts +2 -2
- package/src/hooks/use-screen-chrome.d.ts +18 -0
- package/src/hooks/use-screen-chrome.ts +122 -0
- package/src/hooks/use-screen-options.d.ts +2 -0
- package/src/hooks/use-screen-options.ts +3 -3
- package/{dist/hooks/use-search.js → src/hooks/use-search.d.ts} +2 -6
- package/src/hooks/use-search.ts +2 -2
- package/src/href.d.ts +54 -0
- package/src/href.ts +6 -6
- package/src/index.d.ts +39 -0
- package/src/index.ts +33 -31
- package/src/internal/layer-plan.d.ts +68 -0
- package/src/internal/layer-plan.ts +187 -0
- package/{dist/internal/screen-registry.js → src/internal/screen-registry.d.ts} +21 -32
- package/src/internal/screen-registry.ts +1 -1
- package/src/internal/screen-width.d.ts +17 -0
- package/src/internal/screen-width.ts +22 -14
- package/src/navigator/core.d.ts +96 -0
- package/src/navigator/core.ts +90 -10
- package/src/register.d.ts +37 -0
- package/src/register.ts +1 -1
- package/src/types.d.ts +217 -0
- package/src/url/build.d.ts +15 -0
- package/src/url/build.ts +2 -2
- package/src/url/compile.d.ts +34 -0
- package/src/url/format.d.ts +28 -0
- package/src/url/index.ts +6 -6
- package/src/url/parse.d.ts +20 -0
- package/src/url/parse.ts +6 -6
- package/{dist/url/registry.js → src/url/registry.d.ts} +12 -28
- package/src/url/registry.ts +3 -3
- package/src/url/validate.d.ts +23 -0
- package/src/url/validate.ts +1 -1
- package/dist/components/Drawer.js +0 -74
- package/dist/components/Drawer.js.map +0 -1
- package/dist/components/EdgeBackHandle.js +0 -144
- package/dist/components/EdgeBackHandle.js.map +0 -1
- package/dist/components/EntryScope.js.map +0 -1
- package/dist/components/Header.js +0 -103
- package/dist/components/Header.js.map +0 -1
- package/dist/components/Link.js +0 -51
- package/dist/components/Link.js.map +0 -1
- package/dist/components/NavigationRoot.js +0 -67
- package/dist/components/NavigationRoot.js.map +0 -1
- package/dist/components/Screen.js +0 -94
- package/dist/components/Screen.js.map +0 -1
- package/dist/components/ScreenContainer.d.ts +0 -18
- package/dist/components/ScreenContainer.d.ts.map +0 -1
- package/dist/components/ScreenContainer.js +0 -77
- package/dist/components/ScreenContainer.js.map +0 -1
- package/dist/components/Stack.js +0 -75
- package/dist/components/Stack.js.map +0 -1
- package/dist/components/TabBar.js +0 -63
- package/dist/components/TabBar.js.map +0 -1
- package/dist/components/Tabs.js +0 -140
- package/dist/components/Tabs.js.map +0 -1
- package/dist/define-routes.js.map +0 -1
- package/dist/hooks/use-focus.js.map +0 -1
- package/dist/hooks/use-hardware-back.js +0 -50
- package/dist/hooks/use-hardware-back.js.map +0 -1
- package/dist/hooks/use-linking-nav.js +0 -109
- package/dist/hooks/use-linking-nav.js.map +0 -1
- package/dist/hooks/use-nav-internal.js +0 -44
- package/dist/hooks/use-nav-internal.js.map +0 -1
- package/dist/hooks/use-nav-serializer.js +0 -181
- package/dist/hooks/use-nav-serializer.js.map +0 -1
- package/dist/hooks/use-nav.js +0 -11
- package/dist/hooks/use-nav.js.map +0 -1
- package/dist/hooks/use-params.js.map +0 -1
- package/dist/hooks/use-screen-options.js +0 -43
- package/dist/hooks/use-screen-options.js.map +0 -1
- package/dist/hooks/use-search.js.map +0 -1
- package/dist/href.js +0 -57
- package/dist/href.js.map +0 -1
- package/dist/internal/screen-registry.js.map +0 -1
- package/dist/internal/screen-width.js +0 -30
- package/dist/internal/screen-width.js.map +0 -1
- package/dist/navigator/core.js +0 -344
- package/dist/navigator/core.js.map +0 -1
- package/dist/register.js +0 -2
- package/dist/register.js.map +0 -1
- package/dist/types.js +0 -9
- package/dist/types.js.map +0 -1
- package/dist/url/build.js +0 -30
- package/dist/url/build.js.map +0 -1
- package/dist/url/compile.js +0 -83
- package/dist/url/compile.js.map +0 -1
- package/dist/url/format.js +0 -102
- package/dist/url/format.js.map +0 -1
- package/dist/url/index.js +0 -13
- package/dist/url/index.js.map +0 -1
- package/dist/url/parse.js +0 -94
- package/dist/url/parse.js.map +0 -1
- package/dist/url/registry.js.map +0 -1
- package/dist/url/validate.js +0 -37
- package/dist/url/validate.js.map +0 -1
- package/src/components/ScreenContainer.tsx +0 -114
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { component, defineProvide, useSharedValue, type Define } from '@sigx/lynx';
|
|
2
|
-
import { createNavigatorState } from '../navigator/core
|
|
3
|
-
import { useNav } from '../hooks/use-nav
|
|
4
|
-
import { useNavInternals, useNavRoutes } from '../hooks/use-nav-internal
|
|
5
|
-
import type { RouteId } from '../register
|
|
6
|
-
import type { Presentation, RouteMap, StackEntry } from '../types
|
|
7
|
-
import { _setRouteRegistry } from '../url/registry
|
|
2
|
+
import { createNavigatorState } from '../navigator/core';
|
|
3
|
+
import { useNav } from '../hooks/use-nav';
|
|
4
|
+
import { useNavInternals, useNavRoutes } from '../hooks/use-nav-internal';
|
|
5
|
+
import type { RouteId } from '../register';
|
|
6
|
+
import type { Presentation, RouteMap, StackEntry } from '../types';
|
|
7
|
+
import { _setRouteRegistry } from '../url/registry';
|
|
8
8
|
|
|
9
9
|
type NavigationRootProps =
|
|
10
10
|
& Define.Prop<'routes', RouteMap, true>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<Screen>` — declarative per-screen options + slot fills.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const ProfileScreen = component(() => () => (
|
|
8
|
+
* <Screen title="Profile" headerShown gestureEnabled>
|
|
9
|
+
* <Screen.HeaderRight>
|
|
10
|
+
* <text bindtap={onEdit}>Edit</text>
|
|
11
|
+
* </Screen.HeaderRight>
|
|
12
|
+
* <view>body…</view>
|
|
13
|
+
* </Screen>
|
|
14
|
+
* ));
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* `<Screen>` itself renders its `default` slot inline — so the body lives
|
|
18
|
+
* where you'd expect with no extra layout wrapper. The sub-components
|
|
19
|
+
* (`Screen.Header`, `Screen.HeaderLeft`, `Screen.HeaderRight`,
|
|
20
|
+
* `Screen.TabBarItem`) render `null` and write into the entry's
|
|
21
|
+
* `ScreenRegistry`. The navigator's persistent chrome reads from there.
|
|
22
|
+
*
|
|
23
|
+
* Note: `<Screen.TabBarItem>` registers a scoped slot fill on the entry's
|
|
24
|
+
* `ScreenRegistry`, but the built-in `<TabBar>` doesn't read it yet — the
|
|
25
|
+
* fill is exposed for custom tab-bar renderers (pass `renderTab` and look
|
|
26
|
+
* up the active entry's registry yourself).
|
|
27
|
+
*
|
|
28
|
+
* Sub-component placement inside `<Screen>` is conventional — sigx scopes
|
|
29
|
+
* are by component tree, so they work anywhere under the same EntryScope.
|
|
30
|
+
* Placing them as direct children of `<Screen>` keeps the call site
|
|
31
|
+
* declarative and grep-friendly.
|
|
32
|
+
*/
|
|
33
|
+
import { type Define } from '@sigx/lynx';
|
|
34
|
+
type ScreenProps = Define.Prop<'title', string | (() => string)> & Define.Prop<'headerShown', boolean> & Define.Prop<'gestureEnabled', boolean> & Define.Slot<'default'>;
|
|
35
|
+
type SimpleSlotProps = Define.Slot<'default'>;
|
|
36
|
+
/**
|
|
37
|
+
* `<Screen.TabBarItem>` — scoped slot. The default slot is a function that
|
|
38
|
+
* receives `{ active }`; whatever it returns is the tab-bar item content.
|
|
39
|
+
*
|
|
40
|
+
* Sigx's `Define.Slot<'default', { active: boolean }>` would express this
|
|
41
|
+
* directly on the component, but since `<Screen.TabBarItem>`'s parent
|
|
42
|
+
* (the user's tree, not the navigator) doesn't actually pass `active`, we
|
|
43
|
+
* accept a plain default slot whose body is itself a function. The
|
|
44
|
+
* navigator's TabBar invokes that function with the active flag.
|
|
45
|
+
*/
|
|
46
|
+
type TabBarItemProps = Define.Slot<'default'>;
|
|
47
|
+
/**
|
|
48
|
+
* Compound export. `Screen` is callable as a JSX element and exposes the
|
|
49
|
+
* sub-components as properties (`Screen.Header`, etc.) for the declarative
|
|
50
|
+
* call site shown in the file header.
|
|
51
|
+
*/
|
|
52
|
+
export declare const Screen: ((props: {
|
|
53
|
+
gestureEnabled?: boolean | undefined;
|
|
54
|
+
headerShown?: boolean | undefined;
|
|
55
|
+
title?: string | (() => string) | undefined;
|
|
56
|
+
} & {} & {
|
|
57
|
+
slots?: Partial<{
|
|
58
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
59
|
+
}> | undefined;
|
|
60
|
+
} & {} & JSX.IntrinsicAttributes & import("@sigx/runtime-core").ComponentAttributeExtensions & {
|
|
61
|
+
ref?: import("@sigx/runtime-core").Ref<void> | undefined;
|
|
62
|
+
children?: any;
|
|
63
|
+
}) => import("@sigx/runtime-core").JSXElement) & {
|
|
64
|
+
__setup: import("@sigx/runtime-core").SetupFn<{
|
|
65
|
+
gestureEnabled?: boolean | undefined;
|
|
66
|
+
headerShown?: boolean | undefined;
|
|
67
|
+
title?: string | (() => string) | undefined;
|
|
68
|
+
}, ScreenProps, void, {
|
|
69
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
70
|
+
}>;
|
|
71
|
+
__name?: string;
|
|
72
|
+
__islandId?: string;
|
|
73
|
+
__props: {
|
|
74
|
+
gestureEnabled?: boolean | undefined;
|
|
75
|
+
headerShown?: boolean | undefined;
|
|
76
|
+
title?: string | (() => string) | undefined;
|
|
77
|
+
};
|
|
78
|
+
__events: ScreenProps;
|
|
79
|
+
__ref: void;
|
|
80
|
+
__slots: {
|
|
81
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
82
|
+
};
|
|
83
|
+
} & {
|
|
84
|
+
Header: import("@sigx/runtime-core").ComponentFactory<SimpleSlotProps, void, {
|
|
85
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
86
|
+
}>;
|
|
87
|
+
HeaderLeft: import("@sigx/runtime-core").ComponentFactory<SimpleSlotProps, void, {
|
|
88
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
89
|
+
}>;
|
|
90
|
+
HeaderRight: import("@sigx/runtime-core").ComponentFactory<SimpleSlotProps, void, {
|
|
91
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
92
|
+
}>;
|
|
93
|
+
TabBarItem: import("@sigx/runtime-core").ComponentFactory<TabBarItemProps, void, {
|
|
94
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
* declarative and grep-friendly.
|
|
32
32
|
*/
|
|
33
33
|
import { component, onUnmounted, type Define } from '@sigx/lynx';
|
|
34
|
-
import { useScreenRegistry } from '../hooks/use-nav-internal
|
|
35
|
-
import { mergeOptions, setSlot } from '../internal/screen-registry
|
|
34
|
+
import { useScreenRegistry } from '../hooks/use-nav-internal';
|
|
35
|
+
import { mergeOptions, setSlot } from '../internal/screen-registry';
|
|
36
|
+
import type { ScreenOptions } from '../types';
|
|
36
37
|
|
|
37
38
|
type ScreenProps =
|
|
38
39
|
& Define.Prop<'title', string | (() => string)>
|
|
@@ -42,15 +43,16 @@ type ScreenProps =
|
|
|
42
43
|
|
|
43
44
|
const ScreenRoot = component<ScreenProps>(({ props, slots }) => {
|
|
44
45
|
const registry = useScreenRegistry();
|
|
45
|
-
// Apply options whenever the component sets up.
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
// Apply options whenever the component sets up. Only set keys that
|
|
47
|
+
// were actually passed — `mergeOptions` treats `undefined` as "clear
|
|
48
|
+
// this key", so building the patch from raw `props.X` would wipe
|
|
49
|
+
// every option a previous `useScreenOptions(...)` (or another `<Screen>`)
|
|
50
|
+
// had set on this same entry.
|
|
51
|
+
const patch: ScreenOptions = {};
|
|
52
|
+
if (props.title !== undefined) patch.title = props.title;
|
|
53
|
+
if (props.headerShown !== undefined) patch.headerShown = props.headerShown;
|
|
54
|
+
if (props.gestureEnabled !== undefined) patch.gestureEnabled = props.gestureEnabled;
|
|
55
|
+
mergeOptions(registry, patch);
|
|
54
56
|
return () => slots.default?.();
|
|
55
57
|
});
|
|
56
58
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type Define } from '@sigx/lynx';
|
|
2
|
+
type StackProps =
|
|
3
|
+
/**
|
|
4
|
+
* Mint a nested navigator with this route at its base. When set, the
|
|
5
|
+
* `<Stack>` becomes the owner of a new `NavigatorState` and provides
|
|
6
|
+
* `useNav` / `useNavInternals` / `useNavRoutes` to its subtree, so
|
|
7
|
+
* `nav.push('card-route', …)` from inside the stack stays *inside* it
|
|
8
|
+
* (e.g. for per-tab stacks). Routes presented as `modal` / `fullScreen` /
|
|
9
|
+
* `transparent-modal` automatically escalate to the parent navigator
|
|
10
|
+
* via `nav.parent`, walking up until they reach the root — so modals
|
|
11
|
+
* still overlay the whole app.
|
|
12
|
+
*
|
|
13
|
+
* Omit to render the *enclosing* navigator's stack (the default — this
|
|
14
|
+
* is how `<NavigationRoot> → <Stack />` works).
|
|
15
|
+
*/
|
|
16
|
+
Define.Prop<'initialRoute', string>
|
|
17
|
+
/** Initial params for the nested-stack base entry. */
|
|
18
|
+
& Define.Prop<'initialParams', Record<string, unknown>>
|
|
19
|
+
/** Initial search for the nested-stack base entry. */
|
|
20
|
+
& Define.Prop<'initialSearch', Record<string, unknown>>
|
|
21
|
+
/**
|
|
22
|
+
* Optional chrome rendered *above* the active screen, **inside this
|
|
23
|
+
* Stack's nav scope**. The intended use is `<Header />`, which needs
|
|
24
|
+
* to resolve `useNav()` to the per-stack nav (not the enclosing one)
|
|
25
|
+
* so it can react to pushes inside this stack — e.g. show a back
|
|
26
|
+
* button when a card is pushed onto a per-tab stack.
|
|
27
|
+
*
|
|
28
|
+
* Without this, a `<Header />` placed as a sibling of `<Stack>`
|
|
29
|
+
* would see the enclosing nav and never update when pushes happen
|
|
30
|
+
* inside the nested stack.
|
|
31
|
+
*/
|
|
32
|
+
& Define.Slot<'default'>;
|
|
33
|
+
/**
|
|
34
|
+
* Stack navigator — renders the topmost stack entry's component at rest, or
|
|
35
|
+
* the top + underneath entries during a transition.
|
|
36
|
+
*
|
|
37
|
+
* Two modes:
|
|
38
|
+
*
|
|
39
|
+
* **Bound** (no `initialRoute`): renders the enclosing navigator's stack.
|
|
40
|
+
* This is the shape used directly under `<NavigationRoot>` and is what
|
|
41
|
+
* single-stack apps want.
|
|
42
|
+
*
|
|
43
|
+
* **Nested-owner** (`initialRoute="…"`): mints a fresh `NavigatorState` with
|
|
44
|
+
* its own progress `SharedValue` and edge-back gesture, and provides
|
|
45
|
+
* `useNav` / `useNavInternals` / `useNavRoutes` to its subtree. `useNav()`
|
|
46
|
+
* inside this stack returns the nested nav; `nav.parent` points to the
|
|
47
|
+
* enclosing one. Per-tab stacks are the canonical use case:
|
|
48
|
+
*
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Tabs initialTab="trips">
|
|
51
|
+
* <Tabs.Screen name="trips"><Stack initialRoute="tripsHome" /></Tabs.Screen>
|
|
52
|
+
* <Tabs.Screen name="map"><Stack initialRoute="mapHome" /></Tabs.Screen>
|
|
53
|
+
* </Tabs>
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* Modal/fullScreen pushes escalate up the parent chain automatically — so
|
|
57
|
+
* `nav.push('newTrip')` from inside Trips (where `newTrip` is `modal`)
|
|
58
|
+
* walks to root and overlays the whole UI. `replace` stays strictly local
|
|
59
|
+
* (asymmetric with `push`) so a modal `replace` never wipes the root stack.
|
|
60
|
+
*
|
|
61
|
+
* **Render strategy.** Stack always emits the same JSX shape — a
|
|
62
|
+
* relative wrapper containing one `<Layer>` per entry returned by
|
|
63
|
+
* `computeLayers(stack, transition, progress)`. Each Layer is an
|
|
64
|
+
* absolutely-positioned host view with optional MT-bound translate
|
|
65
|
+
* animation. The pure layer-plan function decides:
|
|
66
|
+
*
|
|
67
|
+
* - **Idle.** Topmost non-overlay base + any overlays above it. All
|
|
68
|
+
* static (no transform). Overlays (`modal` / `fullScreen` /
|
|
69
|
+
* `transparent-modal`) keep their underneath mounted; cards
|
|
70
|
+
* replace their underneath in the base layer.
|
|
71
|
+
* - **Card transition.** Both top and underneath animate (slide-in
|
|
72
|
+
* + parallax). After settle, idle rules apply — the underneath
|
|
73
|
+
* unmounts because the new top is the sole base.
|
|
74
|
+
* - **Overlay transition.** The full idle layer stack up through
|
|
75
|
+
* the underneath stays static; only the animated top has a
|
|
76
|
+
* transform. After settle, the overlay either joins the static
|
|
77
|
+
* idle stack (push) or unmounts (pop).
|
|
78
|
+
*
|
|
79
|
+
* Layer keys are `layer-${entry.key}-${animationVariant}`. The variant
|
|
80
|
+
* suffix forces a remount when an entry transitions from animated to
|
|
81
|
+
* static (or vice versa) — `useAnimatedStyle` binds once at setup and
|
|
82
|
+
* can't switch its mapper at runtime. Modal underneath layers never
|
|
83
|
+
* animate, so their key is stable across the modal lifecycle and the
|
|
84
|
+
* subtree's state (per-tab Stack navigators, scroll positions,
|
|
85
|
+
* in-flight inputs) survives.
|
|
86
|
+
*/
|
|
87
|
+
export declare const Stack: import("@sigx/runtime-core").ComponentFactory<StackProps, void, {
|
|
88
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
89
|
+
}>;
|
|
90
|
+
export {};
|