@sigx/lynx-navigation 0.4.0 → 0.4.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.
- package/dist/components/Drawer.js +74 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/EdgeBackHandle.js +144 -0
- package/dist/components/EdgeBackHandle.js.map +1 -0
- package/dist/components/EntryScope.d.ts +1 -1
- package/dist/components/EntryScope.d.ts.map +1 -1
- package/dist/components/EntryScope.js +39 -0
- package/dist/components/EntryScope.js.map +1 -0
- package/dist/components/Header.js +103 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/Layer.d.ts +2 -2
- package/dist/components/Layer.d.ts.map +1 -1
- package/dist/components/Layer.js +66 -0
- package/dist/components/Layer.js.map +1 -0
- package/dist/components/Link.d.ts +2 -2
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +51 -0
- package/dist/components/Link.js.map +1 -0
- package/dist/components/NavigationRoot.d.ts +2 -2
- package/dist/components/NavigationRoot.d.ts.map +1 -1
- package/dist/components/NavigationRoot.js +67 -0
- package/dist/components/NavigationRoot.js.map +1 -0
- package/dist/components/Screen.js +98 -0
- package/dist/components/Screen.js.map +1 -0
- package/dist/components/Stack.js +257 -0
- package/dist/components/Stack.js.map +1 -0
- package/dist/components/TabBar.d.ts +1 -1
- package/dist/components/TabBar.d.ts.map +1 -1
- package/dist/components/TabBar.js +63 -0
- package/dist/components/TabBar.js.map +1 -0
- package/dist/components/Tabs.js +168 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/define-routes.d.ts +1 -1
- package/dist/define-routes.d.ts.map +1 -1
- package/{src/define-routes.d.ts → dist/define-routes.js} +4 -2
- package/dist/define-routes.js.map +1 -0
- package/dist/hooks/use-focus.js +87 -0
- package/dist/hooks/use-focus.js.map +1 -0
- package/dist/hooks/use-hardware-back.js +84 -0
- package/dist/hooks/use-hardware-back.js.map +1 -0
- 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-linking-nav.js +109 -0
- package/dist/hooks/use-linking-nav.js.map +1 -0
- package/dist/hooks/use-nav-internal.d.ts +2 -2
- package/dist/hooks/use-nav-internal.d.ts.map +1 -1
- package/dist/hooks/use-nav-internal.js +55 -0
- package/dist/hooks/use-nav-internal.js.map +1 -0
- 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-serializer.js +181 -0
- package/dist/hooks/use-nav-serializer.js.map +1 -0
- package/dist/hooks/use-nav.d.ts +2 -2
- package/dist/hooks/use-nav.d.ts.map +1 -1
- package/dist/hooks/use-nav.js +11 -0
- package/dist/hooks/use-nav.js.map +1 -0
- package/dist/hooks/use-params.d.ts +1 -1
- package/dist/hooks/use-params.d.ts.map +1 -1
- package/{src/hooks/use-params.d.ts → dist/hooks/use-params.js} +6 -2
- package/dist/hooks/use-params.js.map +1 -0
- package/dist/hooks/use-screen-chrome.d.ts +1 -1
- package/dist/hooks/use-screen-chrome.d.ts.map +1 -1
- package/dist/hooks/use-screen-chrome.js +102 -0
- package/dist/hooks/use-screen-chrome.js.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-screen-options.js +43 -0
- package/dist/hooks/use-screen-options.js.map +1 -0
- package/dist/hooks/use-search.d.ts +1 -1
- package/dist/hooks/use-search.d.ts.map +1 -1
- package/{src/hooks/use-search.d.ts → dist/hooks/use-search.js} +6 -2
- package/dist/hooks/use-search.js.map +1 -0
- package/dist/href.d.ts +2 -2
- package/dist/href.d.ts.map +1 -1
- package/dist/href.js +57 -0
- package/dist/href.js.map +1 -0
- package/dist/index.d.ts +33 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -1160
- package/dist/index.js.map +1 -1
- package/dist/internal/layer-plan.d.ts +1 -1
- package/dist/internal/layer-plan.d.ts.map +1 -1
- package/dist/internal/layer-plan.js +102 -0
- package/dist/internal/layer-plan.js.map +1 -0
- package/dist/internal/screen-registry.d.ts +1 -1
- package/dist/internal/screen-registry.d.ts.map +1 -1
- package/{src/internal/screen-registry.d.ts → dist/internal/screen-registry.js} +32 -21
- package/dist/internal/screen-registry.js.map +1 -0
- package/{src/internal/screen-width.d.ts → dist/internal/screen-width.js} +17 -2
- package/dist/internal/screen-width.js.map +1 -0
- package/dist/navigator/core.d.ts +3 -3
- package/dist/navigator/core.d.ts.map +1 -1
- package/dist/navigator/core.js +394 -0
- package/dist/navigator/core.js.map +1 -0
- package/dist/register.d.ts +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +2 -0
- package/dist/register.js.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/url/build.js +30 -0
- package/dist/url/build.js.map +1 -0
- package/dist/url/compile.js +83 -0
- package/dist/url/compile.js.map +1 -0
- package/dist/url/format.js +102 -0
- package/dist/url/format.js.map +1 -0
- package/dist/url/index.d.ts +6 -6
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/index.js +13 -0
- package/dist/url/index.js.map +1 -0
- package/dist/url/parse.d.ts +1 -1
- package/dist/url/parse.d.ts.map +1 -1
- package/dist/url/parse.js +94 -0
- package/dist/url/parse.js.map +1 -0
- package/dist/url/registry.d.ts +2 -2
- package/dist/url/registry.d.ts.map +1 -1
- package/{src/url/registry.d.ts → dist/url/registry.js} +28 -12
- package/dist/url/registry.js.map +1 -0
- package/dist/url/validate.d.ts +1 -1
- package/dist/url/validate.d.ts.map +1 -1
- package/dist/url/validate.js +37 -0
- package/dist/url/validate.js.map +1 -0
- package/package.json +13 -12
- package/src/components/EdgeBackHandle.tsx +2 -2
- package/src/components/EntryScope.tsx +3 -3
- package/src/components/Header.tsx +3 -3
- package/src/components/Layer.tsx +3 -3
- package/src/components/Link.tsx +4 -4
- package/src/components/NavigationRoot.tsx +6 -6
- package/src/components/Screen.tsx +3 -3
- package/src/components/Stack.tsx +8 -8
- package/src/components/TabBar.tsx +1 -1
- package/src/define-routes.ts +1 -1
- package/src/hooks/use-focus.ts +2 -2
- package/src/hooks/use-hardware-back.ts +1 -1
- package/src/hooks/use-linking-nav.ts +4 -4
- package/src/hooks/use-nav-internal.ts +2 -2
- package/src/hooks/use-nav-serializer.ts +3 -3
- package/src/hooks/use-nav.ts +2 -2
- package/src/hooks/use-params.ts +2 -2
- package/src/hooks/use-screen-chrome.ts +3 -3
- package/src/hooks/use-screen-options.ts +3 -3
- package/src/hooks/use-search.ts +2 -2
- package/src/href.ts +6 -6
- package/src/index.ts +33 -33
- package/src/internal/layer-plan.ts +2 -2
- package/src/internal/screen-registry.ts +1 -1
- package/src/navigator/core.ts +3 -3
- package/src/register.ts +1 -1
- package/src/url/build.ts +2 -2
- package/src/url/index.ts +6 -6
- package/src/url/parse.ts +6 -6
- package/src/url/registry.ts +3 -3
- package/src/url/validate.ts +1 -1
- package/src/components/Drawer.d.ts +0 -55
- package/src/components/EdgeBackHandle.d.ts +0 -1
- package/src/components/EntryScope.d.ts +0 -25
- package/src/components/Header.d.ts +0 -6
- package/src/components/Layer.d.ts +0 -33
- package/src/components/Link.d.ts +0 -60
- package/src/components/NavigationRoot.d.ts +0 -36
- package/src/components/Screen.d.ts +0 -97
- package/src/components/Stack.d.ts +0 -90
- package/src/components/TabBar.d.ts +0 -38
- package/src/components/Tabs.d.ts +0 -109
- package/src/hooks/use-focus.d.ts +0 -45
- package/src/hooks/use-hardware-back.d.ts +0 -37
- package/src/hooks/use-linking-nav.d.ts +0 -91
- package/src/hooks/use-nav-internal.d.ts +0 -91
- package/src/hooks/use-nav-serializer.d.ts +0 -82
- package/src/hooks/use-nav.d.ts +0 -111
- package/src/hooks/use-screen-chrome.d.ts +0 -18
- package/src/hooks/use-screen-options.d.ts +0 -2
- package/src/href.d.ts +0 -54
- package/src/index.d.ts +0 -39
- package/src/internal/layer-plan.d.ts +0 -68
- package/src/navigator/core.d.ts +0 -96
- package/src/register.d.ts +0 -37
- package/src/types.d.ts +0 -217
- package/src/url/build.d.ts +0 -15
- package/src/url/compile.d.ts +0 -34
- package/src/url/format.d.ts +0 -28
- package/src/url/parse.d.ts +0 -20
- package/src/url/validate.d.ts +0 -23
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { SCREEN_HEIGHT, SCREEN_WIDTH } from './screen-width.js';
|
|
2
|
+
const PARALLAX_FACTOR = 0.3;
|
|
3
|
+
export function isOverlayPresentation(p) {
|
|
4
|
+
return p === 'modal' || p === 'fullScreen' || p === 'transparent-modal';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Suffix used in a layer's render key. Stable for the layer's
|
|
8
|
+
* lifetime (same entry, same animation kind) and changes when the
|
|
9
|
+
* animation transitions on/off so the Layer remounts and rebinds.
|
|
10
|
+
*/
|
|
11
|
+
export function animationVariant(animation) {
|
|
12
|
+
if (!animation)
|
|
13
|
+
return 'static';
|
|
14
|
+
// Output range alone identifies the transition shape — different
|
|
15
|
+
// animations (card-top vs card-underneath vs overlay-top, push vs
|
|
16
|
+
// pop) all land on different range tuples.
|
|
17
|
+
return `${animation.axis}:${animation.outputRange[0]}->${animation.outputRange[1]}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Card-presentation transition transforms. `role='top'` is the entry
|
|
21
|
+
* being pushed/popped; `role='underneath'` is the one parallaxing.
|
|
22
|
+
*/
|
|
23
|
+
function cardAnimation(role, kind, progress) {
|
|
24
|
+
if (kind === 'push') {
|
|
25
|
+
if (role === 'top') {
|
|
26
|
+
return { axis: 'translateX', inputRange: [0, 1], outputRange: [SCREEN_WIDTH, 0], progress };
|
|
27
|
+
}
|
|
28
|
+
return { axis: 'translateX', inputRange: [0, 1], outputRange: [0, -PARALLAX_FACTOR * SCREEN_WIDTH], progress };
|
|
29
|
+
}
|
|
30
|
+
// pop
|
|
31
|
+
if (role === 'top') {
|
|
32
|
+
return { axis: 'translateX', inputRange: [0, 1], outputRange: [0, SCREEN_WIDTH], progress };
|
|
33
|
+
}
|
|
34
|
+
return { axis: 'translateX', inputRange: [0, 1], outputRange: [-PARALLAX_FACTOR * SCREEN_WIDTH, 0], progress };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Overlay-presentation transition transform for the animated top.
|
|
38
|
+
* The underneath of an overlay transition does not animate (modal
|
|
39
|
+
* doesn't reposition its background); we render it as a static layer
|
|
40
|
+
* instead, so this function only produces the top's transform.
|
|
41
|
+
*/
|
|
42
|
+
function overlayTopAnimation(kind, progress) {
|
|
43
|
+
if (kind === 'push') {
|
|
44
|
+
return { axis: 'translateY', inputRange: [0, 1], outputRange: [SCREEN_HEIGHT, 0], progress };
|
|
45
|
+
}
|
|
46
|
+
return { axis: 'translateY', inputRange: [0, 1], outputRange: [0, SCREEN_HEIGHT], progress };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Compute the visible-layer list for one render of `<Stack>`. Pure —
|
|
50
|
+
* unit-testable independently of the renderer.
|
|
51
|
+
*/
|
|
52
|
+
export function computeLayers(stack, transition, progress) {
|
|
53
|
+
if (!transition) {
|
|
54
|
+
// Idle: topmost non-overlay base + any overlays above it.
|
|
55
|
+
let baseIdx = stack.length - 1;
|
|
56
|
+
while (baseIdx > 0 && isOverlayPresentation(stack[baseIdx].presentation)) {
|
|
57
|
+
baseIdx -= 1;
|
|
58
|
+
}
|
|
59
|
+
return stack.slice(baseIdx).map((entry) => ({ entry, animation: null }));
|
|
60
|
+
}
|
|
61
|
+
// A transition is in flight. `progress` may still be null when
|
|
62
|
+
// animations are disabled — produce static layers in that case
|
|
63
|
+
// (the animation never plays; the transition timer just ticks).
|
|
64
|
+
const isOverlay = isOverlayPresentation(transition.topEntry.presentation);
|
|
65
|
+
if (!isOverlay) {
|
|
66
|
+
// Card transition: just the two participating entries, both
|
|
67
|
+
// animated (parallax underneath + slide top).
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
entry: transition.underneathEntry,
|
|
71
|
+
animation: progress ? cardAnimation('underneath', transition.kind, progress) : null,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
entry: transition.topEntry,
|
|
75
|
+
animation: progress ? cardAnimation('top', transition.kind, progress) : null,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
// Overlay transition: render the full idle layer stack up through
|
|
80
|
+
// the underneath entry (all static — they don't animate) plus the
|
|
81
|
+
// animated top.
|
|
82
|
+
const underneathIdx = stack.findIndex((e) => e.key === transition.underneathEntry.key);
|
|
83
|
+
// If the underneath isn't in the stack (e.g. mid-pop where the
|
|
84
|
+
// stack mutation already removed an entry), fall back to the
|
|
85
|
+
// current top of the stack.
|
|
86
|
+
const lastStaticIdx = underneathIdx >= 0 ? underneathIdx : stack.length - 1;
|
|
87
|
+
let baseIdx = lastStaticIdx;
|
|
88
|
+
while (baseIdx > 0 && isOverlayPresentation(stack[baseIdx].presentation)) {
|
|
89
|
+
baseIdx -= 1;
|
|
90
|
+
}
|
|
91
|
+
const staticLayers = stack
|
|
92
|
+
.slice(baseIdx, lastStaticIdx + 1)
|
|
93
|
+
.map((entry) => ({ entry, animation: null }));
|
|
94
|
+
return [
|
|
95
|
+
...staticLayers,
|
|
96
|
+
{
|
|
97
|
+
entry: transition.topEntry,
|
|
98
|
+
animation: progress ? overlayTopAnimation(transition.kind, progress) : null,
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=layer-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-plan.js","sourceRoot":"","sources":["../../src/internal/layer-plan.ts"],"names":[],"mappings":"AA2CA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQhE,MAAM,eAAe,GAAG,GAAG,CAAC;AAgB5B,MAAM,UAAU,qBAAqB,CAAC,CAAe;IACjD,OAAO,CAAC,KAAK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AAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;SAC9E;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* without needing to be itself remounted on each navigation.
|
|
17
17
|
*/
|
|
18
18
|
import { type Signal } from '@sigx/lynx';
|
|
19
|
-
import type { ScreenOptions, ScreenSlotFills, StackEntry } from '../types';
|
|
19
|
+
import type { ScreenOptions, ScreenSlotFills, StackEntry } from '../types.js';
|
|
20
20
|
/**
|
|
21
21
|
* Reactive container for one screen's options and slot fills.
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-registry.d.ts","sourceRoot":"","sources":["../../src/internal/screen-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,UAAU,EACb,MAAM,
|
|
1
|
+
{"version":3,"file":"screen-registry.d.ts","sourceRoot":"","sources":["../../src/internal/screen-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,UAAU,EACb,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACxC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;CAC3C;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAMtE;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,eAAe,EACnD,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,GACrC,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,YAAY,CACxB,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,aAAa,GACrB,IAAI,CAYN"}
|
|
@@ -15,34 +15,45 @@
|
|
|
15
15
|
* so a persistent HeaderBar can read slots from the currently-focused entry
|
|
16
16
|
* without needing to be itself remounted on each navigation.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import type { ScreenOptions, ScreenSlotFills, StackEntry } from '../types';
|
|
20
|
-
/**
|
|
21
|
-
* Reactive container for one screen's options and slot fills.
|
|
22
|
-
*
|
|
23
|
-
* `options` and `slots` are deeply-reactive object signals (sigx's `signal()`
|
|
24
|
-
* of an object returns a Proxy that tracks per-key reads and notifies
|
|
25
|
-
* per-key writes). Writers assign individual keys; readers subscribe to the
|
|
26
|
-
* keys they actually use — no whole-object reads, no read/write cycles in
|
|
27
|
-
* setup.
|
|
28
|
-
*/
|
|
29
|
-
export interface ScreenRegistry {
|
|
30
|
-
readonly entry: StackEntry;
|
|
31
|
-
/** Reactive ScreenOptions — written per-key by `<Screen>`. */
|
|
32
|
-
readonly options: Signal<ScreenOptions>;
|
|
33
|
-
/** Reactive ScreenSlotFills — written per-key by `<Screen.Header>` et al. */
|
|
34
|
-
readonly slots: Signal<ScreenSlotFills>;
|
|
35
|
-
}
|
|
18
|
+
import { signal } from '@sigx/lynx';
|
|
36
19
|
/** Create a fresh registry for an entry. Options and slots start empty. */
|
|
37
|
-
export
|
|
20
|
+
export function createScreenRegistry(entry) {
|
|
21
|
+
return {
|
|
22
|
+
entry,
|
|
23
|
+
options: signal({}),
|
|
24
|
+
slots: signal({}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
38
27
|
/**
|
|
39
28
|
* Set a single slot fill on a registry. Pass `undefined` to clear.
|
|
40
29
|
* Per-key write on the proxy — does not read other keys, so it can't loop
|
|
41
30
|
* with effects that read different slot keys.
|
|
42
31
|
*/
|
|
43
|
-
export
|
|
32
|
+
export function setSlot(registry, name, fill) {
|
|
33
|
+
if (fill === undefined) {
|
|
34
|
+
// Assigning undefined keeps the key around in the proxy; explicit
|
|
35
|
+
// delete is what consumers checking `name in slots` expect.
|
|
36
|
+
delete registry.slots[name];
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
registry.slots[name] = fill;
|
|
40
|
+
}
|
|
44
41
|
/**
|
|
45
42
|
* Merge partial options into a registry. Each option key is written
|
|
46
43
|
* independently on the proxy — `undefined` keys clear that option.
|
|
47
44
|
*/
|
|
48
|
-
export
|
|
45
|
+
export function mergeOptions(registry, patch) {
|
|
46
|
+
for (const key of Object.keys(patch)) {
|
|
47
|
+
const v = patch[key];
|
|
48
|
+
if (v === undefined) {
|
|
49
|
+
delete registry.options[key];
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// Property-level assignment on a deeply-reactive proxy: notifies
|
|
53
|
+
// only subscribers of this specific key, never reads the whole
|
|
54
|
+
// options object, so it can't trigger the setup that wrote it.
|
|
55
|
+
registry.options[key] = v;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=screen-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-registry.js","sourceRoot":"","sources":["../../src/internal/screen-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAe,MAAM,YAAY,CAAC;AAwBjD,2EAA2E;AAC3E,MAAM,UAAU,oBAAoB,CAAC,KAAiB;IAClD,OAAO;QACH,KAAK;QACL,OAAO,EAAE,MAAM,CAAgB,EAAE,CAAC;QAClC,KAAK,EAAE,MAAM,CAAkB,EAAE,CAAC;KACrC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CACnB,QAAwB,EACxB,IAAO,EACP,IAAoC;IAEpC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,kEAAkE;QAClE,4DAA4D;QAC5D,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO;IACX,CAAC;IACA,QAAQ,CAAC,KAAyB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CACxB,QAAwB,EACxB,KAAoB;IAEpB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAA4B,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAClB,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACJ,iEAAiE;YACjE,+DAA+D;YAC/D,+DAA+D;YAC9D,QAAQ,CAAC,OAA8C,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtE,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -13,5 +13,20 @@
|
|
|
13
13
|
* Both must agree, otherwise the commit threshold and the animation
|
|
14
14
|
* geometry won't line up. Single shared module avoids drift.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
function readDp(prop, fallback) {
|
|
17
|
+
try {
|
|
18
|
+
const info = typeof lynx !== 'undefined' ? lynx?.SystemInfo : undefined;
|
|
19
|
+
const px = info?.[prop];
|
|
20
|
+
const pr = info?.pixelRatio || 1;
|
|
21
|
+
if (typeof px === 'number' && px > 0) {
|
|
22
|
+
return Math.round(px / pr);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// Lynx globals not present (test env / SSR) — use fallback.
|
|
27
|
+
}
|
|
28
|
+
return fallback;
|
|
29
|
+
}
|
|
30
|
+
export const SCREEN_WIDTH = readDp('pixelWidth', 400);
|
|
31
|
+
export const SCREEN_HEIGHT = readDp('pixelHeight', 800);
|
|
32
|
+
//# sourceMappingURL=screen-width.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-width.js","sourceRoot":"","sources":["../../src/internal/screen-width.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,SAAS,MAAM,CAAC,IAAkC,EAAE,QAAgB;IAChE,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QACxE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;QACxB,MAAM,EAAE,GAAG,IAAI,EAAE,UAAU,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,4DAA4D;IAChE,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC"}
|
package/dist/navigator/core.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SharedValue } from '@sigx/lynx';
|
|
2
|
-
import type { Nav } from '../hooks/use-nav';
|
|
3
|
-
import type { ScreenRegistry } from '../internal/screen-registry';
|
|
4
|
-
import type { RouteMap, StackEntry } from '../types';
|
|
2
|
+
import type { Nav } from '../hooks/use-nav.js';
|
|
3
|
+
import type { ScreenRegistry } from '../internal/screen-registry.js';
|
|
4
|
+
import type { RouteMap, StackEntry } from '../types.js';
|
|
5
5
|
/**
|
|
6
6
|
* The reactive backing state for one navigator instance.
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/navigator/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,WAAW,EACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/navigator/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,WAAW,EACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAIR,QAAQ,EACR,UAAU,EAEb,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACf,gBAAgB,IAAI,IAAI,CAAC;QACzB,iBAAiB,IAAI,IAAI,CAAC;QAC1B,iBAAiB,IAAI,IAAI,CAAC;KAC7B,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACf,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;QACzC,wEAAwE;QACxE,UAAU,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;QAC3C,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;KACrD,CAAC;IACF;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAuED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACpB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,sBAAsB,GAAG,cAAc,CA0TjF"}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { runOnMainThread, signal, untrack, } from '@sigx/lynx';
|
|
2
|
+
import { isLazyComponent } from '@sigx/lynx';
|
|
3
|
+
import { withTiming } from '@sigx/lynx-motion';
|
|
4
|
+
/**
|
|
5
|
+
* Slide-from-right transition timing. Kept as constants so screen options
|
|
6
|
+
* can override per-screen later (Phase 0.5). Duration is in seconds — that's
|
|
7
|
+
* what `@sigx/lynx-motion`'s `withTiming` expects (per `with-timing.ts`).
|
|
8
|
+
*/
|
|
9
|
+
const TRANSITION_DURATION_SEC = 0.28;
|
|
10
|
+
/**
|
|
11
|
+
* Kick off a lazy component's chunk fetch when its route is navigated to.
|
|
12
|
+
*
|
|
13
|
+
* Lazy routes (`component: lazy(() => import('./Heavy.js'))`) start loading
|
|
14
|
+
* the moment `push`/`replace` is called rather than waiting until render
|
|
15
|
+
* tries to instantiate them — by the time `<Stack>` swaps screens the chunk
|
|
16
|
+
* is usually already resolved, so the user sees the screen instead of the
|
|
17
|
+
* `<Suspense fallback>`. Fire-and-forget: errors here surface through
|
|
18
|
+
* `<Suspense>` at render time.
|
|
19
|
+
*/
|
|
20
|
+
function preloadRouteComponent(component) {
|
|
21
|
+
if (isLazyComponent(component)) {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
23
|
+
component.preload().catch(() => { });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
let entryKeyCounter = 0;
|
|
27
|
+
function nextEntryKey() {
|
|
28
|
+
entryKeyCounter += 1;
|
|
29
|
+
return `entry-${entryKeyCounter}-${Math.random().toString(36).slice(2, 8)}`;
|
|
30
|
+
}
|
|
31
|
+
function makeEntry(name, params, search, options, routes) {
|
|
32
|
+
const route = routes[name];
|
|
33
|
+
const presentation = options?.presentation ?? route?.presentation ?? 'card';
|
|
34
|
+
return {
|
|
35
|
+
key: nextEntryKey(),
|
|
36
|
+
route: name,
|
|
37
|
+
params: (params ?? {}),
|
|
38
|
+
search: (search ?? {}),
|
|
39
|
+
state: options?.state,
|
|
40
|
+
presentation,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function unpackArgs(name, args, routes) {
|
|
44
|
+
const route = routes[name];
|
|
45
|
+
const requiresParams = !!route?.params;
|
|
46
|
+
if (requiresParams) {
|
|
47
|
+
const [params, search, options] = args;
|
|
48
|
+
return { params, search, options };
|
|
49
|
+
}
|
|
50
|
+
const [search, options] = args;
|
|
51
|
+
return { params: undefined, search, options };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Create a navigator. Returns the public `nav` handle plus the routes map.
|
|
55
|
+
* The transition signal lives on `nav` (via `nav.transition`) so `<Stack>`
|
|
56
|
+
* can subscribe to it.
|
|
57
|
+
*/
|
|
58
|
+
export function createNavigatorState(opts) {
|
|
59
|
+
const { routes, initial, progress, parent = null } = opts;
|
|
60
|
+
const stackSignal = signal([initial]);
|
|
61
|
+
const focusedBox = signal({
|
|
62
|
+
value: opts.initialLocallyFocused ?? true,
|
|
63
|
+
});
|
|
64
|
+
const children = new Set();
|
|
65
|
+
// `signal(null)` would wrap as a primitive (no `$set`), so wrap in an
|
|
66
|
+
// object to get the standard `{ value }`-style API. Reading `.value`
|
|
67
|
+
// tracks; writing triggers re-render of `<Stack>`.
|
|
68
|
+
const transitionBox = signal({ value: null });
|
|
69
|
+
function getStack() {
|
|
70
|
+
return stackSignal;
|
|
71
|
+
}
|
|
72
|
+
function setStack(next) {
|
|
73
|
+
stackSignal.$set(next);
|
|
74
|
+
}
|
|
75
|
+
function setTransition(next) {
|
|
76
|
+
transitionBox.value = next;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Whether a transition is currently in flight. Used to no-op concurrent
|
|
80
|
+
* navigation calls — keeps the state machine simple. A queued/aborted
|
|
81
|
+
* model is a v0.3 polish item.
|
|
82
|
+
*/
|
|
83
|
+
function isTransitioning() {
|
|
84
|
+
return transitionBox.value !== null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Run the slide animation by hopping a worklet onto the main thread that
|
|
88
|
+
* resets `progress` to 0 and starts a `withTiming` to the target. Then
|
|
89
|
+
* wait the animation duration on BG so we can fire the completion
|
|
90
|
+
* callback (clear transition / commit the popped entry) when the visual
|
|
91
|
+
* animation is done.
|
|
92
|
+
*
|
|
93
|
+
* Why the SV reset lives *inside* the worklet (not on BG before the call):
|
|
94
|
+
* the BG-side render ops (Stack re-render mounting the two
|
|
95
|
+
* `ScreenContainer`s with their `useAnimatedStyle` bindings) and a BG-side
|
|
96
|
+
* SV write (`progress.value = 0`) travel different bridge channels. On
|
|
97
|
+
* subsequent navigations, MT can register the new bindings before the
|
|
98
|
+
* BG-side reset arrives — the bindings snapshot sv at its previous
|
|
99
|
+
* end-state (`1`), and `withTiming(sv, 1, ...)` then animates from 1→1
|
|
100
|
+
* (no visible motion). Resetting inside the worklet guarantees the order
|
|
101
|
+
* `bindings register → sv resets → withTiming starts` happens atomically
|
|
102
|
+
* on MT.
|
|
103
|
+
*
|
|
104
|
+
* Why we don't `await` the worklet's Promise: `withTiming` returns a
|
|
105
|
+
* Promise on MT, but Promises don't serialize across the BG/MT bridge —
|
|
106
|
+
* `runOnMainThread`'s callback fires the moment the worklet *returns*
|
|
107
|
+
* (synchronously, with `undefined` since the Promise can't cross), not
|
|
108
|
+
* when the underlying animation finishes. We time the BG-side wait
|
|
109
|
+
* against the duration we passed to MT instead.
|
|
110
|
+
*/
|
|
111
|
+
async function animateProgress(target, durationSec) {
|
|
112
|
+
if (!progress)
|
|
113
|
+
return;
|
|
114
|
+
const sv = progress;
|
|
115
|
+
const runner = runOnMainThread((t, d) => {
|
|
116
|
+
'main thread';
|
|
117
|
+
// MT-side direct write — `sv.value` is a BG-side getter/setter
|
|
118
|
+
// that emits a "read-only on BG" warning when set; the actual
|
|
119
|
+
// MT field (which `withTiming`'s animate() reads as the start
|
|
120
|
+
// value) is `sv.current.value`. See `packages/lynx-runtime/src/
|
|
121
|
+
// animated/shared-value.ts:14-44`.
|
|
122
|
+
sv.current.value = 0;
|
|
123
|
+
withTiming(sv, t, { duration: d });
|
|
124
|
+
});
|
|
125
|
+
runner(target, durationSec);
|
|
126
|
+
await new Promise((resolve) => {
|
|
127
|
+
setTimeout(resolve, Math.round(durationSec * 1000));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
const push = ((name, ...args) => {
|
|
131
|
+
if (!routes[name]) {
|
|
132
|
+
throw new Error(`[lynx-navigation] push('${name}'): route is not registered. ` +
|
|
133
|
+
`Known routes: ${Object.keys(routes).join(', ') || '(none)'}`);
|
|
134
|
+
}
|
|
135
|
+
const { params, search, options } = unpackArgs(name, args, routes);
|
|
136
|
+
// Escalate non-card presentations up the parent chain. Modals,
|
|
137
|
+
// fullScreen, and transparent-modal routes belong on the root
|
|
138
|
+
// navigator so they overlay tab UI and persistent chrome. We resolve
|
|
139
|
+
// the presentation the same way `makeEntry` does so the escalation
|
|
140
|
+
// decision matches what would actually be shown.
|
|
141
|
+
const resolvedPresentation = (options?.presentation ?? routes[name].presentation ?? 'card');
|
|
142
|
+
if (resolvedPresentation !== 'card' && parent) {
|
|
143
|
+
// Walk straight to the root — every navigator with a parent
|
|
144
|
+
// delegates non-card pushes upward, so a chain of any depth
|
|
145
|
+
// collapses to a single push on the topmost nav.
|
|
146
|
+
// Forward original args verbatim so overloads (`push(name)`,
|
|
147
|
+
// `push(name, params)`, `push(name, params, search)`,
|
|
148
|
+
// `push(name, params, search, options)`) keep their meaning.
|
|
149
|
+
parent.push(name, ...args);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (isTransitioning())
|
|
153
|
+
return;
|
|
154
|
+
preloadRouteComponent(routes[name].component);
|
|
155
|
+
const newEntry = makeEntry(name, params, search, options, routes);
|
|
156
|
+
const cur = getStack();
|
|
157
|
+
const prevTop = cur[cur.length - 1];
|
|
158
|
+
// Append eagerly — UX-wise the user just initiated a forward nav, so
|
|
159
|
+
// the new entry should be queryable immediately (`nav.current` =
|
|
160
|
+
// newEntry). The slide animation overlays the visual transition.
|
|
161
|
+
setStack([...cur, newEntry]);
|
|
162
|
+
const animated = options?.animated !== false && !!progress;
|
|
163
|
+
if (!animated)
|
|
164
|
+
return;
|
|
165
|
+
setTransition({
|
|
166
|
+
kind: 'push',
|
|
167
|
+
topEntry: newEntry,
|
|
168
|
+
underneathEntry: prevTop,
|
|
169
|
+
progress,
|
|
170
|
+
});
|
|
171
|
+
animateProgress(1, TRANSITION_DURATION_SEC).then(() => setTransition(null), () => setTransition(null));
|
|
172
|
+
});
|
|
173
|
+
const replace = ((name, ...args) => {
|
|
174
|
+
if (isTransitioning())
|
|
175
|
+
return;
|
|
176
|
+
const { params, search, options } = unpackArgs(name, args, routes);
|
|
177
|
+
if (!routes[name]) {
|
|
178
|
+
throw new Error(`[lynx-navigation] replace('${name}'): route is not registered.`);
|
|
179
|
+
}
|
|
180
|
+
preloadRouteComponent(routes[name].component);
|
|
181
|
+
const entry = makeEntry(name, params, search, options, routes);
|
|
182
|
+
const cur = getStack();
|
|
183
|
+
// Replace doesn't animate in v1 — it's a swap, not a forward/back nav.
|
|
184
|
+
// Adding a fade-or-slide variant is a screen-option in Phase 0.5.
|
|
185
|
+
setStack([...cur.slice(0, cur.length - 1), entry]);
|
|
186
|
+
});
|
|
187
|
+
function pop(count = 1, options) {
|
|
188
|
+
if (isTransitioning())
|
|
189
|
+
return;
|
|
190
|
+
const cur = getStack();
|
|
191
|
+
const target = Math.max(1, cur.length - Math.max(1, count));
|
|
192
|
+
if (target === cur.length)
|
|
193
|
+
return;
|
|
194
|
+
const animated = options?.animated !== false && !!progress && count === 1 && cur.length >= 2;
|
|
195
|
+
if (!animated) {
|
|
196
|
+
setStack(cur.slice(0, target));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
// Single-step animated pop: keep the popped entry on the stack until
|
|
200
|
+
// the slide finishes, so `<Stack>` can render both screens during the
|
|
201
|
+
// animation. The stack mutation happens on completion.
|
|
202
|
+
const popping = cur[cur.length - 1];
|
|
203
|
+
const next = cur[cur.length - 2];
|
|
204
|
+
setTransition({
|
|
205
|
+
kind: 'pop',
|
|
206
|
+
topEntry: popping,
|
|
207
|
+
underneathEntry: next,
|
|
208
|
+
progress,
|
|
209
|
+
});
|
|
210
|
+
animateProgress(1, TRANSITION_DURATION_SEC).then(() => {
|
|
211
|
+
setStack(cur.slice(0, cur.length - 1));
|
|
212
|
+
setTransition(null);
|
|
213
|
+
}, () => {
|
|
214
|
+
// On animation failure, snap to the destination state anyway —
|
|
215
|
+
// leaving the popped entry rendered would be more confusing
|
|
216
|
+
// than skipping the animation.
|
|
217
|
+
setStack(cur.slice(0, cur.length - 1));
|
|
218
|
+
setTransition(null);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function popTo(name) {
|
|
222
|
+
if (isTransitioning())
|
|
223
|
+
return;
|
|
224
|
+
const cur = getStack();
|
|
225
|
+
for (let i = cur.length - 1; i >= 0; i--) {
|
|
226
|
+
if (cur[i].route === name) {
|
|
227
|
+
if (i === cur.length - 1)
|
|
228
|
+
return;
|
|
229
|
+
setStack(cur.slice(0, i + 1));
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function popToRoot() {
|
|
235
|
+
if (isTransitioning())
|
|
236
|
+
return;
|
|
237
|
+
const cur = getStack();
|
|
238
|
+
if (cur.length <= 1)
|
|
239
|
+
return;
|
|
240
|
+
setStack([cur[0]]);
|
|
241
|
+
}
|
|
242
|
+
function reset(state) {
|
|
243
|
+
if (state.stack.length === 0) {
|
|
244
|
+
throw new Error('[lynx-navigation] reset() called with empty stack.');
|
|
245
|
+
}
|
|
246
|
+
setStack([...state.stack]);
|
|
247
|
+
setTransition(null);
|
|
248
|
+
}
|
|
249
|
+
function dismiss() {
|
|
250
|
+
if (isTransitioning())
|
|
251
|
+
return;
|
|
252
|
+
const cur = getStack();
|
|
253
|
+
let i = cur.length - 1;
|
|
254
|
+
while (i > 0 && cur[i].presentation !== 'card') {
|
|
255
|
+
i--;
|
|
256
|
+
}
|
|
257
|
+
if (i < cur.length - 1) {
|
|
258
|
+
setStack(cur.slice(0, i + 1));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Set up a gesture-driven pop transition. Same shape as `pop()` sets but
|
|
263
|
+
* does NOT call `animateProgress` — the gesture worklet writes the
|
|
264
|
+
* progress SV directly per frame, then animates to commit/cancel
|
|
265
|
+
* endpoints on release before invoking `commitBackGesture` or
|
|
266
|
+
* `cancelBackGesture` via `runOnBackground`.
|
|
267
|
+
*/
|
|
268
|
+
function beginBackGesture() {
|
|
269
|
+
if (isTransitioning())
|
|
270
|
+
return;
|
|
271
|
+
const cur = getStack();
|
|
272
|
+
if (cur.length < 2)
|
|
273
|
+
return;
|
|
274
|
+
const popping = cur[cur.length - 1];
|
|
275
|
+
const next = cur[cur.length - 2];
|
|
276
|
+
setTransition({
|
|
277
|
+
kind: 'pop',
|
|
278
|
+
topEntry: popping,
|
|
279
|
+
underneathEntry: next,
|
|
280
|
+
progress: progress,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function commitBackGesture() {
|
|
284
|
+
const cur = getStack();
|
|
285
|
+
if (cur.length >= 2) {
|
|
286
|
+
setStack(cur.slice(0, cur.length - 1));
|
|
287
|
+
}
|
|
288
|
+
setTransition(null);
|
|
289
|
+
}
|
|
290
|
+
function cancelBackGesture() {
|
|
291
|
+
setTransition(null);
|
|
292
|
+
}
|
|
293
|
+
const nav = {
|
|
294
|
+
push,
|
|
295
|
+
replace,
|
|
296
|
+
pop,
|
|
297
|
+
popTo,
|
|
298
|
+
popToRoot,
|
|
299
|
+
reset,
|
|
300
|
+
dismiss,
|
|
301
|
+
get current() {
|
|
302
|
+
return stackSignal[stackSignal.length - 1];
|
|
303
|
+
},
|
|
304
|
+
get stack() {
|
|
305
|
+
return stackSignal;
|
|
306
|
+
},
|
|
307
|
+
get canGoBack() {
|
|
308
|
+
return stackSignal.length > 1;
|
|
309
|
+
},
|
|
310
|
+
get parent() {
|
|
311
|
+
return parent;
|
|
312
|
+
},
|
|
313
|
+
get isLocallyFocused() {
|
|
314
|
+
return focusedBox.value;
|
|
315
|
+
},
|
|
316
|
+
get _children() {
|
|
317
|
+
return children;
|
|
318
|
+
},
|
|
319
|
+
get transition() {
|
|
320
|
+
return transitionBox.value;
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
if (parent) {
|
|
324
|
+
// Register with parent so root-level traversals (hardware back,
|
|
325
|
+
// future deepest-focused queries) can reach this nav. The matching
|
|
326
|
+
// `_children.delete(nav)` happens when the owning `<Stack>` unmounts;
|
|
327
|
+
// see Stack.tsx.
|
|
328
|
+
parent._children.add(nav);
|
|
329
|
+
}
|
|
330
|
+
function setLocallyFocused(focused) {
|
|
331
|
+
if (focusedBox.value === focused)
|
|
332
|
+
return;
|
|
333
|
+
focusedBox.value = focused;
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
nav,
|
|
337
|
+
routes,
|
|
338
|
+
_gesture: { beginBackGesture, commitBackGesture, cancelBackGesture },
|
|
339
|
+
_screens: createScreenRegistries(),
|
|
340
|
+
_setLocallyFocused: setLocallyFocused,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Map-backed `_screens` controller. Pulled out as a tiny factory so test
|
|
345
|
+
* tooling can call it directly when asserting registry behaviour without
|
|
346
|
+
* standing up an entire navigator.
|
|
347
|
+
*
|
|
348
|
+
* Not reactive — `<EntryScope>` registers once at setup and unregisters at
|
|
349
|
+
* unmount, so reads from the navigator's chrome are point-in-time lookups,
|
|
350
|
+
* and the registry's own internal signals carry the reactive payload.
|
|
351
|
+
*/
|
|
352
|
+
function createScreenRegistries() {
|
|
353
|
+
const byKey = new Map();
|
|
354
|
+
// Reactive version tick — bumped on every register/unregister so consumers
|
|
355
|
+
// (HeaderBar's computeds) re-evaluate their lookups when entries come and
|
|
356
|
+
// go. `Map.get` itself isn't tracked, so without this a chrome component
|
|
357
|
+
// that renders before its target entry mounts would never see the late
|
|
358
|
+
// arrival of the registry.
|
|
359
|
+
const version = signal({ v: 0 });
|
|
360
|
+
return {
|
|
361
|
+
register(reg) {
|
|
362
|
+
byKey.set(reg.entry.key, reg);
|
|
363
|
+
// `register` is called from `<EntryScope>` setup, which itself
|
|
364
|
+
// runs inside a tracked scope. Read-then-write on `version`
|
|
365
|
+
// would self-loop, so we untrack the bump.
|
|
366
|
+
untrack(() => { version.v = version.v + 1; });
|
|
367
|
+
},
|
|
368
|
+
// Identity-checked unregister: deletes the entry only if the
|
|
369
|
+
// currently-registered registry is the *same instance* the caller
|
|
370
|
+
// holds. Without this, the transition→idle handoff (which can
|
|
371
|
+
// mount a new `<EntryScope>` for the same entry-key before the
|
|
372
|
+
// old one unmounts) would let the old scope's `onUnmounted` wipe
|
|
373
|
+
// out the fresh registry — leaving `screens.get(key)` returning
|
|
374
|
+
// undefined and chrome consumers (NavHeader) falling back to the
|
|
375
|
+
// route-name as title with all slot fills gone.
|
|
376
|
+
unregister(reg) {
|
|
377
|
+
const cur = byKey.get(reg.entry.key);
|
|
378
|
+
if (cur !== reg)
|
|
379
|
+
return;
|
|
380
|
+
byKey.delete(reg.entry.key);
|
|
381
|
+
untrack(() => { version.v = version.v + 1; });
|
|
382
|
+
},
|
|
383
|
+
get(key) {
|
|
384
|
+
// Touch the version signal so the caller's reactive scope
|
|
385
|
+
// re-runs on the next register/unregister. The actual returned
|
|
386
|
+
// value still comes from the plain Map — registries themselves
|
|
387
|
+
// are signal-backed, so once a caller has one in hand they
|
|
388
|
+
// track the bits they care about (options/slots) directly.
|
|
389
|
+
void version.v;
|
|
390
|
+
return byKey.get(key);
|
|
391
|
+
},
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/navigator/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,MAAM,EACN,OAAO,GAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAqE/C;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;;;;;;GASG;AACH,SAAS,qBAAqB,CAAC,SAAkB;IAC7C,IAAI,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,gEAAgE;QAChE,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACxC,CAAC;AACL,CAAC;AAED,IAAI,eAAe,GAAG,CAAC,CAAC;AACxB,SAAS,YAAY;IACjB,eAAe,IAAI,CAAC,CAAC;IACrB,OAAO,SAAS,eAAe,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAChF,CAAC;AAED,SAAS,SAAS,CACd,IAAY,EACZ,MAAe,EACf,MAAe,EACf,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