@sigx/lynx-navigation 0.1.1 → 0.1.2
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.d.ts +5 -7
- package/dist/components/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer.js +5 -7
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +1 -1
- package/dist/components/Header.js.map +1 -1
- package/dist/components/Screen.d.ts +5 -5
- package/dist/components/Screen.js +5 -5
- package/dist/components/TabBar.d.ts.map +1 -1
- package/dist/components/TabBar.js +1 -1
- package/dist/components/TabBar.js.map +1 -1
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs.js +5 -0
- package/dist/components/Tabs.js.map +1 -1
- package/dist/hooks/use-focus.d.ts.map +1 -1
- package/dist/hooks/use-focus.js +9 -5
- package/dist/hooks/use-focus.js.map +1 -1
- package/dist/hooks/use-linking-nav.d.ts +1 -1
- package/dist/hooks/use-linking-nav.js +1 -1
- package/dist/url/format.d.ts +4 -1
- package/dist/url/format.d.ts.map +1 -1
- package/dist/url/format.js +4 -1
- package/dist/url/format.js.map +1 -1
- package/dist/url/parse.js +11 -7
- package/dist/url/parse.js.map +1 -1
- package/package.json +5 -5
- package/src/components/Drawer.tsx +5 -7
- package/src/components/Header.tsx +6 -1
- package/src/components/Screen.tsx +5 -5
- package/src/components/TabBar.tsx +1 -0
- package/src/components/Tabs.tsx +4 -0
- package/src/hooks/use-focus.ts +15 -4
- package/src/hooks/use-linking-nav.ts +1 -1
- package/src/url/format.ts +4 -1
- package/src/url/parse.ts +12 -7
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* ```tsx
|
|
7
7
|
* <NavigationRoot routes={routes}>
|
|
8
|
-
* <Drawer
|
|
9
|
-
* sidebar={() => <view><text>Menu</text></view>}
|
|
10
|
-
* >
|
|
8
|
+
* <Drawer slots={{ sidebar: () => <view><text>Menu</text></view> }}>
|
|
11
9
|
* <Stack />
|
|
12
10
|
* </Drawer>
|
|
13
11
|
* </NavigationRoot>
|
|
@@ -21,13 +19,13 @@
|
|
|
21
19
|
* Gesture-driven open (edge swipe from the left) and MTS slide-in are out
|
|
22
20
|
* of scope — the app shell can wrap its sidebar JSX in its own transition.
|
|
23
21
|
*
|
|
24
|
-
* Design note: the sidebar
|
|
25
|
-
*
|
|
22
|
+
* Design note: the sidebar lives in a named slot (`sidebar`) rather than
|
|
23
|
+
* a render-prop or a `<Drawer.Sidebar>` child. Mixing
|
|
26
24
|
* "register-yourself-as-a-fill" children with the parent's own visible
|
|
27
25
|
* layout creates a feedback loop in sigx's reactive scope (the parent's
|
|
28
26
|
* render reads the fill, child's setup writes it, parent re-renders,
|
|
29
|
-
* child re-mounts, …). A scoped slot avoids that entirely and the
|
|
30
|
-
*
|
|
27
|
+
* child re-mounts, …). A scoped slot avoids that entirely and keeps the
|
|
28
|
+
* call site declarative.
|
|
31
29
|
*
|
|
32
30
|
* `default` slot is the main content (almost always a `<Stack>`).
|
|
33
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/components/Drawer.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/components/Drawer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAKH,KAAK,MAAM,EAEd,MAAM,YAAY,CAAC;AAEpB,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACtB,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,wBAAwB;IACxB,IAAI,IAAI,IAAI,CAAC;IACb,yBAAyB;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,uCAAuC;IACvC,MAAM,IAAI,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,4DAIpB,CAAC;AAEH,KAAK,WAAW,GACV,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,GACnC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GACtB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAE7B,eAAO,MAAM,MAAM;;;;EAmDjB,CAAC"}
|
|
@@ -6,9 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@sigx/lynx/jsx-runtime";
|
|
|
6
6
|
*
|
|
7
7
|
* ```tsx
|
|
8
8
|
* <NavigationRoot routes={routes}>
|
|
9
|
-
* <Drawer
|
|
10
|
-
* sidebar={() => <view><text>Menu</text></view>}
|
|
11
|
-
* >
|
|
9
|
+
* <Drawer slots={{ sidebar: () => <view><text>Menu</text></view> }}>
|
|
12
10
|
* <Stack />
|
|
13
11
|
* </Drawer>
|
|
14
12
|
* </NavigationRoot>
|
|
@@ -22,13 +20,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "@sigx/lynx/jsx-runtime";
|
|
|
22
20
|
* Gesture-driven open (edge swipe from the left) and MTS slide-in are out
|
|
23
21
|
* of scope — the app shell can wrap its sidebar JSX in its own transition.
|
|
24
22
|
*
|
|
25
|
-
* Design note: the sidebar
|
|
26
|
-
*
|
|
23
|
+
* Design note: the sidebar lives in a named slot (`sidebar`) rather than
|
|
24
|
+
* a render-prop or a `<Drawer.Sidebar>` child. Mixing
|
|
27
25
|
* "register-yourself-as-a-fill" children with the parent's own visible
|
|
28
26
|
* layout creates a feedback loop in sigx's reactive scope (the parent's
|
|
29
27
|
* render reads the fill, child's setup writes it, parent re-renders,
|
|
30
|
-
* child re-mounts, …). A scoped slot avoids that entirely and the
|
|
31
|
-
*
|
|
28
|
+
* child re-mounts, …). A scoped slot avoids that entirely and keeps the
|
|
29
|
+
* call site declarative.
|
|
32
30
|
*
|
|
33
31
|
* `default` slot is the main content (almost always a `<Stack>`).
|
|
34
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/components/Drawer.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/components/Drawer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,MAAM,GAGT,MAAM,YAAY,CAAC;AAcpB;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAY,GAAG,EAAE;IACtD,MAAM,IAAI,KAAK,CACX,uEAAuE,CAC1E,CAAC;AACN,CAAC,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,wEAAwE;IACxE,wEAAwE;IACxE,qDAAqD;IACrD,MAAM,SAAS,GAA+B,MAAM,CAAC;QACjD,KAAK,EAAE,KAAK,CAAC,WAAW,KAAK,IAAI;KACpC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAc;QACnB,IAAI,MAAM;YACN,OAAO,SAAS,CAAC,KAAK,CAAC;QAC3B,CAAC;QACD,IAAI;YACA,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,KAAK;YACD,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;QAC5B,CAAC;QACD,MAAM;YACF,SAAS,CAAC,KAAK,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC;QACvC,CAAC;KACJ,CAAC;IAEF,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAEpC,OAAO,GAAG,EAAE;QACR,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC;QAC7B,OAAO,CACH,gBAAM,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAE1C,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YACzC,KAAK,CAAC,OAAO,EAAE,EAAE,GACf,EAKP,eACI,KAAK,EAAE;wBACH,QAAQ,EAAE,UAAU;wBACpB,IAAI,EAAE,CAAC;wBACP,GAAG,EAAE,CAAC;wBACN,MAAM,EAAE,CAAC;wBACT,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;qBAClC,YAEA,KAAK,CAAC,OAAO,EAAE,EAAE,GACf,IACJ,CACV,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAkEA;;;;GAIG;AACH,eAAO,MAAM,MAAM,kEAyDjB,CAAC"}
|
|
@@ -44,7 +44,7 @@ function resolveTitle(t, routeName) {
|
|
|
44
44
|
* primitive at the navigation layer.
|
|
45
45
|
*/
|
|
46
46
|
const DefaultBackButton = component(({ props }) => {
|
|
47
|
-
return () => (_jsx("view", { bindtap: () => props.onPress(), children: _jsx("text", { children: "\u2039 Back" }) }));
|
|
47
|
+
return () => (_jsx("view", { bindtap: () => props.onPress(), "accessibility-element": true, "accessibility-label": "Back", "accessibility-trait": "button", children: _jsx("text", { children: "\u2039 Back" }) }));
|
|
48
48
|
});
|
|
49
49
|
const DefaultTitle = component(({ props }) => {
|
|
50
50
|
return () => (_jsx("view", { children: _jsx("text", { children: props.text }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;A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AAC,CAAC,CAAC"}
|
|
@@ -9,11 +9,6 @@
|
|
|
9
9
|
* <Screen.HeaderRight>
|
|
10
10
|
* <text bindtap={onEdit}>Edit</text>
|
|
11
11
|
* </Screen.HeaderRight>
|
|
12
|
-
* <Screen.TabBarItem>
|
|
13
|
-
* {({ active }) => (
|
|
14
|
-
* <text style={{ color: active ? '#007aff' : '#888' }}>Me</text>
|
|
15
|
-
* )}
|
|
16
|
-
* </Screen.TabBarItem>
|
|
17
12
|
* <view>body…</view>
|
|
18
13
|
* </Screen>
|
|
19
14
|
* ));
|
|
@@ -25,6 +20,11 @@
|
|
|
25
20
|
* `Screen.TabBarItem`) render `null` and write into the entry's
|
|
26
21
|
* `ScreenRegistry`. The navigator's persistent chrome reads from there.
|
|
27
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
28
|
* Sub-component placement inside `<Screen>` is conventional — sigx scopes
|
|
29
29
|
* are by component tree, so they work anywhere under the same EntryScope.
|
|
30
30
|
* Placing them as direct children of `<Screen>` keeps the call site
|
|
@@ -9,11 +9,6 @@
|
|
|
9
9
|
* <Screen.HeaderRight>
|
|
10
10
|
* <text bindtap={onEdit}>Edit</text>
|
|
11
11
|
* </Screen.HeaderRight>
|
|
12
|
-
* <Screen.TabBarItem>
|
|
13
|
-
* {({ active }) => (
|
|
14
|
-
* <text style={{ color: active ? '#007aff' : '#888' }}>Me</text>
|
|
15
|
-
* )}
|
|
16
|
-
* </Screen.TabBarItem>
|
|
17
12
|
* <view>body…</view>
|
|
18
13
|
* </Screen>
|
|
19
14
|
* ));
|
|
@@ -25,6 +20,11 @@
|
|
|
25
20
|
* `Screen.TabBarItem`) render `null` and write into the entry's
|
|
26
21
|
* `ScreenRegistry`. The navigator's persistent chrome reads from there.
|
|
27
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
28
|
* Sub-component placement inside `<Screen>` is conventional — sigx scopes
|
|
29
29
|
* are by component tree, so they work anywhere under the same EntryScope.
|
|
30
30
|
* Placing them as direct children of `<Screen>` keeps the call site
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/components/TabBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAGH,KAAK,UAAU,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAElD,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,OAAO,IAAI,IAAI,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/components/TabBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAGH,KAAK,UAAU,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAElD,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,OAAO,IAAI,IAAI,CAAC;CACnB;AAmCD,eAAO,MAAM,MAAM;wBAhCmB,OAAO,OAAO,gBAAgB,KAAK,UAAU;YA4DjF,CAAC"}
|
|
@@ -38,7 +38,7 @@ const DefaultTabButton = component(({ props }) => {
|
|
|
38
38
|
return () => {
|
|
39
39
|
const label = props.info.label ?? props.info.name;
|
|
40
40
|
const a11y = props.info.accessibilityLabel ?? label;
|
|
41
|
-
return (_jsxs("view", { bindtap: () => props.onPress(), "accessibility-element": true, "accessibility-label": a11y, "accessibility-trait": "button", style: { opacity: props.active ? 1 : 0.6 }, children: [props.info.icon ?? null, _jsx("text", { children: label })] }));
|
|
41
|
+
return (_jsxs("view", { bindtap: () => props.onPress(), "accessibility-element": true, "accessibility-label": a11y, "accessibility-trait": "button", "accessibility-status": props.active ? 'selected' : undefined, style: { opacity: props.active ? 1 : 0.6 }, children: [props.info.icon ?? null, _jsx("text", { children: label })] }));
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
44
|
export const TabBar = component(({ props }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../../src/components/TabBar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACH,SAAS,GAGZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AAalD;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,SAAS,CAIhC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACZ,OAAO,GAAG,EAAE;QACR,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,IAAI,KAAK,CAAC;QACpD,OAAO,CACH,gBACI,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,2BACP,IAAI,yBACN,IAAI,yBACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"TabBar.js","sourceRoot":"","s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AM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GACjC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAC5B,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GACzC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAoC7B;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEf,CAAC"}
|
package/dist/components/Tabs.js
CHANGED
|
@@ -87,6 +87,11 @@ const _Tabs = component(({ props, slots }) => {
|
|
|
87
87
|
return activeSignal.value ?? '';
|
|
88
88
|
},
|
|
89
89
|
setActive(name) {
|
|
90
|
+
// Silently ignore unknown names rather than writing them and
|
|
91
|
+
// hiding every tab body. Surfacing as a no-op gives consumers a
|
|
92
|
+
// predictable failure mode for typos / dynamic name sources.
|
|
93
|
+
if (!tabs.some((t) => t.name === name))
|
|
94
|
+
return;
|
|
90
95
|
activeSignal.value = name;
|
|
91
96
|
},
|
|
92
97
|
get tabs() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/components/Tabs.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EACH,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,MAAM,EACN,OAAO,GAIV,MAAM,YAAY,CAAC;AA4BpB;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAU,GAAG,EAAE;IAClD,MAAM,IAAI,KAAK,CACX,mEAAmE,CACtE,CAAC;AACN,CAAC,CAAC,CAAC;AAgBH,MAAM,gBAAgB,GAAG,gBAAgB,CAAgB,GAAG,EAAE;IAC1D,MAAM,IAAI,KAAK,CACX,s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C,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;gBACjC,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;aACjB,YAEA,KAAK,CAAC,OAAO,EAAE,EAAE,GACf,CACV,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE;IAChC,MAAM,EAAE,UAAU;CACrB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-focus.d.ts","sourceRoot":"","sources":["../../src/hooks/use-focus.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-focus.d.ts","sourceRoot":"","sources":["../../src/hooks/use-focus.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,QAAQ,EAChB,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAAC,OAAO,CAAC,CAOhD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CA0BlE"}
|
package/dist/hooks/use-focus.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, effect, onUnmounted } from '@sigx/lynx';
|
|
1
|
+
import { computed, effect, onUnmounted, untrack, } from '@sigx/lynx';
|
|
2
2
|
import { useNav } from './use-nav.js';
|
|
3
3
|
import { useCurrentEntry } from './use-nav-internal.js';
|
|
4
4
|
/**
|
|
@@ -56,14 +56,18 @@ export function useFocusEffect(cb) {
|
|
|
56
56
|
let cleanup;
|
|
57
57
|
const runner = effect(() => {
|
|
58
58
|
const focused = isFocused.value;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
// Always tear down any previous focus session before starting a new
|
|
60
|
+
// one (or before going dormant on blur). Wrap `cb` in `untrack` so
|
|
61
|
+
// signals read inside the user-provided callback can't retrigger the
|
|
62
|
+
// outer effect and stack subscriptions.
|
|
63
|
+
if (typeof cleanup === 'function') {
|
|
63
64
|
const fn = cleanup;
|
|
64
65
|
cleanup = undefined;
|
|
65
66
|
fn();
|
|
66
67
|
}
|
|
68
|
+
if (focused) {
|
|
69
|
+
cleanup = untrack(() => cb());
|
|
70
|
+
}
|
|
67
71
|
});
|
|
68
72
|
onUnmounted(() => {
|
|
69
73
|
if (typeof cleanup === 'function') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-focus.js","sourceRoot":"","sources":["../../src/hooks/use-focus.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-focus.js","sourceRoot":"","sources":["../../src/hooks/use-focus.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,GAEV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY;IACxB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,mEAAmE;IACnE,wEAAwE;IACxE,oEAAoE;IACpE,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC,GAAG,CAAC;IACpC,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,cAAc,CAAC,EAA6B;IACxD,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,IAAI,OAA4B,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE;QACvB,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC;QAChC,oEAAoE;QACpE,mEAAmE;QACnE,qEAAqE;QACrE,wCAAwC;QACxC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAChC,MAAM,EAAE,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,SAAS,CAAC;YACpB,EAAE,EAAE,CAAC;QACT,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAClC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,WAAW,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAChC,MAAM,EAAE,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,SAAS,CAAC;YACpB,EAAE,EAAE,CAAC;QACT,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { useNavRoutes } from './use-nav-internal.js';
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```tsx
|
|
23
|
-
* import { useLinkingNav } from '@sigx/lynx-
|
|
23
|
+
* import { useLinkingNav } from '@sigx/lynx-navigation';
|
|
24
24
|
*
|
|
25
25
|
* const DeepLinks = component(() => {
|
|
26
26
|
* useLinkingNav({
|
package/dist/url/format.d.ts
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Keys are sorted to make the output deterministic (useful for tests and
|
|
10
10
|
* persistence diffs). `undefined`/`null` values are skipped. Non-primitive
|
|
11
|
-
* values are JSON-stringified
|
|
11
|
+
* values are JSON-stringified on the way out — `parseSearch` returns the
|
|
12
|
+
* raw string and leaves any JSON decoding to the route's `search` schema
|
|
13
|
+
* (e.g. a Zod `transform`), so the round-trip is intentionally one-way at
|
|
14
|
+
* this layer.
|
|
12
15
|
*
|
|
13
16
|
* Returns `''` (empty string) when there are no entries — callers join with
|
|
14
17
|
* `?` only when the result is non-empty.
|
package/dist/url/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/url/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/url/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAkBhF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAwB5E"}
|
package/dist/url/format.js
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Keys are sorted to make the output deterministic (useful for tests and
|
|
10
10
|
* persistence diffs). `undefined`/`null` values are skipped. Non-primitive
|
|
11
|
-
* values are JSON-stringified
|
|
11
|
+
* values are JSON-stringified on the way out — `parseSearch` returns the
|
|
12
|
+
* raw string and leaves any JSON decoding to the route's `search` schema
|
|
13
|
+
* (e.g. a Zod `transform`), so the round-trip is intentionally one-way at
|
|
14
|
+
* this layer.
|
|
12
15
|
*
|
|
13
16
|
* Returns `''` (empty string) when there are no entries — callers join with
|
|
14
17
|
* `?` only when the result is non-empty.
|
package/dist/url/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/url/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/url/format.ts"],"names":[],"mappings":"AAAA;;;;GA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,CAAC,CAAC;QACxB,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACT,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB;YACI,kEAAkE;YAClE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,CAAS;IACzB,IAAI,CAAC;QACD,OAAO,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACL,sEAAsE;QACtE,oEAAoE;QACpE,OAAO,CAAC,CAAC;IACb,CAAC;AACL,CAAC"}
|
package/dist/url/parse.js
CHANGED
|
@@ -69,22 +69,26 @@ function extractParams(compiled, match) {
|
|
|
69
69
|
return out;
|
|
70
70
|
}
|
|
71
71
|
function splitPathAndQuery(url) {
|
|
72
|
+
// Drop the fragment before any path/query work — `#…` is a client-side
|
|
73
|
+
// anchor that must not leak into the route pathname or query values.
|
|
74
|
+
const hashIdx = url.indexOf('#');
|
|
75
|
+
const noHash = hashIdx >= 0 ? url.slice(0, hashIdx) : url;
|
|
72
76
|
// If the URL has a scheme, defer to lynx-linking's parser — handles
|
|
73
77
|
// `myapp://host/path?q` correctly. Otherwise treat the whole thing as
|
|
74
78
|
// pathname+query.
|
|
75
|
-
const hasScheme = /^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(
|
|
79
|
+
const hasScheme = /^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(noHash);
|
|
76
80
|
if (hasScheme) {
|
|
77
|
-
const parsed = parseUrl(
|
|
81
|
+
const parsed = parseUrl(noHash);
|
|
78
82
|
// Reconstruct the query string from the already-parsed bag. We have
|
|
79
83
|
// to do this because parseUrl decoded keys/values, but parseSearch
|
|
80
84
|
// expects encoded form. Simpler: split the original ourselves.
|
|
81
|
-
const qIdx =
|
|
82
|
-
const query = qIdx >= 0 ?
|
|
85
|
+
const qIdx = noHash.indexOf('?');
|
|
86
|
+
const query = qIdx >= 0 ? noHash.slice(qIdx + 1) : '';
|
|
83
87
|
return { pathname: parsed.path, query };
|
|
84
88
|
}
|
|
85
|
-
const qIdx =
|
|
89
|
+
const qIdx = noHash.indexOf('?');
|
|
86
90
|
if (qIdx === -1)
|
|
87
|
-
return { pathname:
|
|
88
|
-
return { pathname:
|
|
91
|
+
return { pathname: noHash, query: '' };
|
|
92
|
+
return { pathname: noHash.slice(0, qIdx), query: noHash.slice(qIdx + 1) };
|
|
89
93
|
}
|
|
90
94
|
//# sourceMappingURL=parse.js.map
|
package/dist/url/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/url/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACrC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE7D,yEAAyE;IACzE,wEAAwE;IACxE,mBAAmB;IACnB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,MAAM,QAAQ,GAAG,gBAAgB,EAAE,CAAC;IACpC,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,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-navigation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Type-first native navigator for sigx-lynx — Stack, Tabs, Drawer, modals, lazy routes, deep links",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"peerDependencies": {
|
|
19
|
+
"@sigx/lynx-motion": "^0.1.1",
|
|
19
20
|
"@sigx/lynx": "^0.1.4",
|
|
20
|
-
"@sigx/lynx-linking": "^0.1.2"
|
|
21
|
-
"@sigx/lynx-motion": "^0.1.0"
|
|
21
|
+
"@sigx/lynx-linking": "^0.1.2"
|
|
22
22
|
},
|
|
23
23
|
"peerDependenciesMeta": {
|
|
24
24
|
"@sigx/lynx-linking": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"vitest": "^4.1.6",
|
|
31
31
|
"@sigx/lynx": "^0.1.4",
|
|
32
32
|
"@sigx/lynx-linking": "^0.1.2",
|
|
33
|
-
"@sigx/lynx-
|
|
34
|
-
"@sigx/lynx-
|
|
33
|
+
"@sigx/lynx-testing": "^0.2.6",
|
|
34
|
+
"@sigx/lynx-motion": "^0.1.1"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"sigx",
|
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* ```tsx
|
|
7
7
|
* <NavigationRoot routes={routes}>
|
|
8
|
-
* <Drawer
|
|
9
|
-
* sidebar={() => <view><text>Menu</text></view>}
|
|
10
|
-
* >
|
|
8
|
+
* <Drawer slots={{ sidebar: () => <view><text>Menu</text></view> }}>
|
|
11
9
|
* <Stack />
|
|
12
10
|
* </Drawer>
|
|
13
11
|
* </NavigationRoot>
|
|
@@ -21,13 +19,13 @@
|
|
|
21
19
|
* Gesture-driven open (edge swipe from the left) and MTS slide-in are out
|
|
22
20
|
* of scope — the app shell can wrap its sidebar JSX in its own transition.
|
|
23
21
|
*
|
|
24
|
-
* Design note: the sidebar
|
|
25
|
-
*
|
|
22
|
+
* Design note: the sidebar lives in a named slot (`sidebar`) rather than
|
|
23
|
+
* a render-prop or a `<Drawer.Sidebar>` child. Mixing
|
|
26
24
|
* "register-yourself-as-a-fill" children with the parent's own visible
|
|
27
25
|
* layout creates a feedback loop in sigx's reactive scope (the parent's
|
|
28
26
|
* render reads the fill, child's setup writes it, parent re-renders,
|
|
29
|
-
* child re-mounts, …). A scoped slot avoids that entirely and the
|
|
30
|
-
*
|
|
27
|
+
* child re-mounts, …). A scoped slot avoids that entirely and keeps the
|
|
28
|
+
* call site declarative.
|
|
31
29
|
*
|
|
32
30
|
* `default` slot is the main content (almost always a `<Stack>`).
|
|
33
31
|
*/
|
|
@@ -45,7 +45,12 @@ function resolveTitle(t: ScreenOptions['title'], routeName: string): string {
|
|
|
45
45
|
*/
|
|
46
46
|
const DefaultBackButton = component<{ onPress: () => void } & {}>(({ props }) => {
|
|
47
47
|
return () => (
|
|
48
|
-
<view
|
|
48
|
+
<view
|
|
49
|
+
bindtap={() => props.onPress()}
|
|
50
|
+
accessibility-element={true}
|
|
51
|
+
accessibility-label="Back"
|
|
52
|
+
accessibility-trait="button"
|
|
53
|
+
>
|
|
49
54
|
<text>‹ Back</text>
|
|
50
55
|
</view>
|
|
51
56
|
);
|
|
@@ -9,11 +9,6 @@
|
|
|
9
9
|
* <Screen.HeaderRight>
|
|
10
10
|
* <text bindtap={onEdit}>Edit</text>
|
|
11
11
|
* </Screen.HeaderRight>
|
|
12
|
-
* <Screen.TabBarItem>
|
|
13
|
-
* {({ active }) => (
|
|
14
|
-
* <text style={{ color: active ? '#007aff' : '#888' }}>Me</text>
|
|
15
|
-
* )}
|
|
16
|
-
* </Screen.TabBarItem>
|
|
17
12
|
* <view>body…</view>
|
|
18
13
|
* </Screen>
|
|
19
14
|
* ));
|
|
@@ -25,6 +20,11 @@
|
|
|
25
20
|
* `Screen.TabBarItem`) render `null` and write into the entry's
|
|
26
21
|
* `ScreenRegistry`. The navigator's persistent chrome reads from there.
|
|
27
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
28
|
* Sub-component placement inside `<Screen>` is conventional — sigx scopes
|
|
29
29
|
* are by component tree, so they work anywhere under the same EntryScope.
|
|
30
30
|
* Placing them as direct children of `<Screen>` keeps the call site
|
|
@@ -63,6 +63,7 @@ const DefaultTabButton = component<
|
|
|
63
63
|
accessibility-element={true}
|
|
64
64
|
accessibility-label={a11y}
|
|
65
65
|
accessibility-trait="button"
|
|
66
|
+
accessibility-status={props.active ? 'selected' : undefined}
|
|
66
67
|
style={{ opacity: props.active ? 1 : 0.6 }}
|
|
67
68
|
>
|
|
68
69
|
{props.info.icon ?? null}
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -147,6 +147,10 @@ const _Tabs = component<TabsProps>(({ props, slots }) => {
|
|
|
147
147
|
return activeSignal.value ?? '';
|
|
148
148
|
},
|
|
149
149
|
setActive(name) {
|
|
150
|
+
// Silently ignore unknown names rather than writing them and
|
|
151
|
+
// hiding every tab body. Surfacing as a no-op gives consumers a
|
|
152
|
+
// predictable failure mode for typos / dynamic name sources.
|
|
153
|
+
if (!tabs.some((t) => t.name === name)) return;
|
|
150
154
|
activeSignal.value = name;
|
|
151
155
|
},
|
|
152
156
|
get tabs() {
|
package/src/hooks/use-focus.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
effect,
|
|
4
|
+
onUnmounted,
|
|
5
|
+
untrack,
|
|
6
|
+
type Computed,
|
|
7
|
+
} from '@sigx/lynx';
|
|
2
8
|
import { useNav } from './use-nav.js';
|
|
3
9
|
import { useCurrentEntry } from './use-nav-internal.js';
|
|
4
10
|
|
|
@@ -58,13 +64,18 @@ export function useFocusEffect(cb: () => void | (() => void)): void {
|
|
|
58
64
|
let cleanup: (() => void) | void;
|
|
59
65
|
const runner = effect(() => {
|
|
60
66
|
const focused = isFocused.value;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
// Always tear down any previous focus session before starting a new
|
|
68
|
+
// one (or before going dormant on blur). Wrap `cb` in `untrack` so
|
|
69
|
+
// signals read inside the user-provided callback can't retrigger the
|
|
70
|
+
// outer effect and stack subscriptions.
|
|
71
|
+
if (typeof cleanup === 'function') {
|
|
64
72
|
const fn = cleanup;
|
|
65
73
|
cleanup = undefined;
|
|
66
74
|
fn();
|
|
67
75
|
}
|
|
76
|
+
if (focused) {
|
|
77
|
+
cleanup = untrack(() => cb());
|
|
78
|
+
}
|
|
68
79
|
});
|
|
69
80
|
onUnmounted(() => {
|
|
70
81
|
if (typeof cleanup === 'function') {
|
package/src/url/format.ts
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Keys are sorted to make the output deterministic (useful for tests and
|
|
11
11
|
* persistence diffs). `undefined`/`null` values are skipped. Non-primitive
|
|
12
|
-
* values are JSON-stringified
|
|
12
|
+
* values are JSON-stringified on the way out — `parseSearch` returns the
|
|
13
|
+
* raw string and leaves any JSON decoding to the route's `search` schema
|
|
14
|
+
* (e.g. a Zod `transform`), so the round-trip is intentionally one-way at
|
|
15
|
+
* this layer.
|
|
13
16
|
*
|
|
14
17
|
* Returns `''` (empty string) when there are no entries — callers join with
|
|
15
18
|
* `?` only when the result is non-empty.
|
package/src/url/parse.ts
CHANGED
|
@@ -78,20 +78,25 @@ function extractParams(
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function splitPathAndQuery(url: string): { pathname: string; query: string } {
|
|
81
|
+
// Drop the fragment before any path/query work — `#…` is a client-side
|
|
82
|
+
// anchor that must not leak into the route pathname or query values.
|
|
83
|
+
const hashIdx = url.indexOf('#');
|
|
84
|
+
const noHash = hashIdx >= 0 ? url.slice(0, hashIdx) : url;
|
|
85
|
+
|
|
81
86
|
// If the URL has a scheme, defer to lynx-linking's parser — handles
|
|
82
87
|
// `myapp://host/path?q` correctly. Otherwise treat the whole thing as
|
|
83
88
|
// pathname+query.
|
|
84
|
-
const hasScheme = /^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(
|
|
89
|
+
const hasScheme = /^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(noHash);
|
|
85
90
|
if (hasScheme) {
|
|
86
|
-
const parsed = parseUrl(
|
|
91
|
+
const parsed = parseUrl(noHash);
|
|
87
92
|
// Reconstruct the query string from the already-parsed bag. We have
|
|
88
93
|
// to do this because parseUrl decoded keys/values, but parseSearch
|
|
89
94
|
// expects encoded form. Simpler: split the original ourselves.
|
|
90
|
-
const qIdx =
|
|
91
|
-
const query = qIdx >= 0 ?
|
|
95
|
+
const qIdx = noHash.indexOf('?');
|
|
96
|
+
const query = qIdx >= 0 ? noHash.slice(qIdx + 1) : '';
|
|
92
97
|
return { pathname: parsed.path, query };
|
|
93
98
|
}
|
|
94
|
-
const qIdx =
|
|
95
|
-
if (qIdx === -1) return { pathname:
|
|
96
|
-
return { pathname:
|
|
99
|
+
const qIdx = noHash.indexOf('?');
|
|
100
|
+
if (qIdx === -1) return { pathname: noHash, query: '' };
|
|
101
|
+
return { pathname: noHash.slice(0, qIdx), query: noHash.slice(qIdx + 1) };
|
|
97
102
|
}
|