@gtkx/navigation 2.0.0-beta.10 → 2.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +8 -168
  2. package/dist/drawer/create-drawer-navigator.d.ts.map +1 -1
  3. package/dist/drawer/create-drawer-navigator.js +2 -2
  4. package/dist/drawer/create-drawer-navigator.js.map +1 -1
  5. package/dist/drawer/drawer-item-list.d.ts.map +1 -1
  6. package/dist/drawer/drawer-item-list.js +5 -3
  7. package/dist/drawer/drawer-item-list.js.map +1 -1
  8. package/dist/drawer/drawer-router.d.ts.map +1 -1
  9. package/dist/drawer/drawer-router.js.map +1 -1
  10. package/dist/drawer/drawer-status.d.ts +2 -2
  11. package/dist/drawer/drawer-status.d.ts.map +1 -1
  12. package/dist/drawer/drawer-status.js +1 -9
  13. package/dist/drawer/drawer-status.js.map +1 -1
  14. package/dist/drawer/drawer-view.d.ts.map +1 -1
  15. package/dist/drawer/drawer-view.js +8 -12
  16. package/dist/drawer/drawer-view.js.map +1 -1
  17. package/dist/drawer/types.d.ts +2 -0
  18. package/dist/drawer/types.d.ts.map +1 -1
  19. package/dist/drawer/types.js.map +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/shared/header-bar.d.ts.map +1 -1
  25. package/dist/shared/header-bar.js +2 -2
  26. package/dist/shared/header-bar.js.map +1 -1
  27. package/dist/shared/routes.d.ts.map +1 -1
  28. package/dist/shared/scene-page.d.ts +3 -1
  29. package/dist/shared/scene-page.d.ts.map +1 -1
  30. package/dist/shared/scene-page.js +8 -1
  31. package/dist/shared/scene-page.js.map +1 -1
  32. package/dist/shared/use-pop-to-top-on-blur.d.ts.map +1 -1
  33. package/dist/split-view/create-split-view-navigator.d.ts.map +1 -1
  34. package/dist/split-view/create-split-view-navigator.js +2 -2
  35. package/dist/split-view/create-split-view-navigator.js.map +1 -1
  36. package/dist/split-view/split-view.d.ts.map +1 -1
  37. package/dist/split-view/split-view.js +3 -7
  38. package/dist/split-view/split-view.js.map +1 -1
  39. package/dist/split-view/types.d.ts.map +1 -1
  40. package/dist/split-view/types.js.map +1 -1
  41. package/dist/stack/create-stack-navigator.d.ts.map +1 -1
  42. package/dist/stack/create-stack-navigator.js +2 -2
  43. package/dist/stack/create-stack-navigator.js.map +1 -1
  44. package/dist/stack/stack-pages.d.ts.map +1 -1
  45. package/dist/stack/stack-pages.js +4 -14
  46. package/dist/stack/stack-pages.js.map +1 -1
  47. package/dist/stack/stack-view.d.ts.map +1 -1
  48. package/dist/stack/stack-view.js +5 -22
  49. package/dist/stack/stack-view.js.map +1 -1
  50. package/dist/stack/sync-navigation-stack.d.ts.map +1 -1
  51. package/dist/stack/types.d.ts.map +1 -1
  52. package/dist/stack/types.js.map +1 -1
  53. package/dist/tabs/create-tab-navigator.d.ts.map +1 -1
  54. package/dist/tabs/create-tab-navigator.js +2 -2
  55. package/dist/tabs/create-tab-navigator.js.map +1 -1
  56. package/dist/tabs/tab-view.d.ts.map +1 -1
  57. package/dist/tabs/tab-view.js +5 -9
  58. package/dist/tabs/tab-view.js.map +1 -1
  59. package/dist/tabs/types.d.ts +2 -0
  60. package/dist/tabs/types.d.ts.map +1 -1
  61. package/dist/tabs/types.js.map +1 -1
  62. package/dist/theme.d.ts.map +1 -1
  63. package/dist/theme.js.map +1 -1
  64. package/package.json +13 -21
  65. package/src/drawer/create-drawer-navigator.tsx +14 -16
  66. package/src/drawer/drawer-item-list.tsx +22 -15
  67. package/src/drawer/drawer-router.ts +4 -2
  68. package/src/drawer/drawer-status.ts +3 -16
  69. package/src/drawer/drawer-view.tsx +18 -23
  70. package/src/drawer/types.ts +6 -3
  71. package/src/index.ts +1 -5
  72. package/src/shared/header-bar.tsx +2 -2
  73. package/src/shared/scene-page.tsx +24 -12
  74. package/src/split-view/create-split-view-navigator.tsx +15 -17
  75. package/src/split-view/split-view.tsx +32 -26
  76. package/src/split-view/types.ts +4 -3
  77. package/src/stack/create-stack-navigator.tsx +9 -11
  78. package/src/stack/stack-pages.ts +14 -24
  79. package/src/stack/stack-view.tsx +9 -29
  80. package/src/stack/types.ts +4 -3
  81. package/src/tabs/create-tab-navigator.tsx +3 -5
  82. package/src/tabs/tab-view.tsx +28 -24
  83. package/src/tabs/types.ts +6 -3
  84. package/src/theme.ts +0 -1
  85. package/dist/shared/use-loaded-routes.d.ts +0 -3
  86. package/dist/shared/use-loaded-routes.d.ts.map +0 -1
  87. package/dist/shared/use-loaded-routes.js +0 -11
  88. package/dist/shared/use-loaded-routes.js.map +0 -1
  89. package/src/shared/use-loaded-routes.ts +0 -14
package/README.md CHANGED
@@ -1,177 +1,17 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/gtkx-org/gtkx/main/logo.svg" alt="GTKX" width="100" />
3
- </p>
1
+ # @gtkx/navigation
4
2
 
5
- <h1 align="center">GTKX</h1>
3
+ React Navigation navigators for GTKX.
6
4
 
7
- <p align="center">
8
- The React framework for Linux.<br />
9
- Write native GNOME applications with React and TypeScript.
10
- Real Adwaita and GTK4 widgets with standard web tooling.
11
- </p>
5
+ Build stack, tab, drawer, and split-view navigation with native Adwaita containers. Define typed routes, nest navigators, and adapt sidebar and content layouts to the available space.
12
6
 
13
- <p align="center">
14
- <a href="https://www.npmjs.com/package/create-gtkx"><img src="https://img.shields.io/npm/v/create-gtkx?color=cb3837&logo=npm&label=create-gtkx" alt="npm version" /></a>
15
- <a href="https://www.npmjs.com/package/create-gtkx"><img src="https://img.shields.io/npm/dm/create-gtkx?color=cb3837&logo=npm&label=downloads" alt="npm downloads" /></a>
16
- <img src="https://img.shields.io/badge/node-%E2%89%A526.7-339933?logo=node.js&logoColor=white" alt="Node >= 26.7" />
17
- <a href="https://github.com/gtkx-org/gtkx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MPL--2.0-blue.svg" alt="License: MPL-2.0" /></a>
18
- <a href="https://github.com/gtkx-org/gtkx/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/gtkx-org/gtkx/ci.yml?branch=main&logo=github&label=CI" alt="CI status" /></a>
19
- <img src="https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white" alt="TypeScript" />
20
- </p>
21
-
22
- <p align="center">
23
- <a href="https://gtkx.dev">Homepage</a> &middot;
24
- <a href="https://gtkx.dev/guide/getting-started">Documentation</a> &middot;
25
- <a href="https://github.com/gtkx-org/gtkx/tree/main/examples">Examples</a> &middot;
26
- <a href="https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md">Contributing</a>
27
- </p>
28
-
29
- ---
30
-
31
- <p align="center">
32
- <img src="https://raw.githubusercontent.com/gtkx-org/gtkx/main/examples/tutorial/assets/screenshot.png" alt="The Tasks app: an Adwaita window with a sidebar of smart views and colored lists on the left, and a boxed task list on the right." />
33
- </p>
34
-
35
- <p align="center">
36
- <em>The Tasks app you build in the <a href="https://gtkx.dev/tutorial/">tutorial</a>.</em>
37
- </p>
38
-
39
- ## Demo
40
-
41
- This app starts with an Adwaita application shell, renders native GTK4 widgets inside it, and uses ordinary React hooks and events:
42
-
43
- ```tsx
44
- import * as Gtk from "@gtkx/gi/gtk";
45
- import { AdwApplication, AdwApplicationWindow, AdwHeaderBar, AdwToolbarView } from "@gtkx/jsx/adw";
46
- import { GtkBox, GtkButton, GtkLabel } from "@gtkx/jsx/gtk";
47
- import { createRoot, quit } from "@gtkx/react";
48
- import { useState } from "react";
49
-
50
- const Counter = () => {
51
- const [count, setCount] = useState(0);
52
-
53
- return (
54
- <AdwApplicationWindow
55
- title="Hello GTKX"
56
- defaultWidth={400}
57
- defaultHeight={300}
58
- onCloseRequest={quit}
59
- >
60
- <AdwToolbarView topBar={<AdwHeaderBar />}>
61
- <GtkBox
62
- orientation={Gtk.Orientation.VERTICAL}
63
- spacing={20}
64
- marginTop={40}
65
- marginBottom={40}
66
- marginStart={40}
67
- marginEnd={40}
68
- valign={Gtk.Align.CENTER}
69
- halign={Gtk.Align.CENTER}
70
- >
71
- <GtkLabel cssClasses={["title-1"]}>Welcome to GTKX!</GtkLabel>
72
- <GtkLabel cssClasses={["title-2"]}>{`Count: ${String(count)}`}</GtkLabel>
73
- <GtkButton
74
- label="Increment"
75
- onClicked={() => setCount((c) => c + 1)}
76
- cssClasses={["suggested-action", "pill"]}
77
- />
78
- </GtkBox>
79
- </AdwToolbarView>
80
- </AdwApplicationWindow>
81
- );
82
- };
83
-
84
- const App = () => (
85
- <AdwApplication>
86
- <Counter />
87
- </AdwApplication>
88
- );
89
-
90
- createRoot().render(<App />);
91
- ```
92
-
93
- This is the [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world) example, with `app.tsx` and `index.tsx` combined into a single snippet. `@gtkx/gi` and `@gtkx/jsx` are per-project bindings generated by the CLI, not packages you install from npm.
94
-
95
- ## Why GTKX
96
-
97
- ### Adwaita-first application development
98
-
99
- GTKX uses Adwaita as the foundation for applications, windows, navigation, dialogs, and adaptive layouts, with the complete GTK4 toolkit underneath. It adds a declarative React layer and an integrated TypeScript toolchain to the GNOME platform:
100
-
101
- - a React reconciler that exposes every GObject as a JSX element,
102
- - a CLI for scaffolding, development, and production builds,
103
- - a dev server with Fast Refresh that patches your running UI in place,
104
- - CSS-in-JS styling, React Hook Form-powered Adwaita controls, gettext-backed react-i18next localization, React Spring animations, React Navigation stack, tab, drawer, and split view navigators, and high-level list, grid, and dialog components,
105
- - a Testing Library-style API for querying and driving your widgets in tests,
106
- - and a Model Context Protocol (MCP) server that exposes your live app to AI agents.
107
-
108
- ### Native GNOME widgets, without a compatibility layer
109
-
110
- React Native and similar frameworks hide the native toolkit so one API can run everywhere. GTKX renders real Adwaita and GTK4 widgets and exposes any other GObject-Introspection library on your system. It is GNOME-native and Linux-only by design.
111
-
112
- ### Why Node.js, and why generated bindings
113
-
114
- GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [Why GTKX guide](https://gtkx.dev/guide/why-gtkx) covers what running on Node.js means day to day.
115
-
116
- GTKX generates the TypeScript types and native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. `Adw-1` is the sole default GIR root; its GIR include pulls in `Gtk-4.0`, so codegen covers both complete API surfaces. Neither belongs in a GTKX 2 `libraries` list.
117
-
118
- At runtime, the native Rust core calls straight into the system Adwaita, GTK4, and GLib libraries through libffi, without loading libgirepository at all.
119
-
120
- ## Quick start
121
-
122
- GTKX is Linux-only and needs Node.js 26.7 or later. See [Requirements](#requirements).
123
-
124
- Scaffold a new app with the `create-gtkx` initializer:
7
+ In an existing GTKX app:
125
8
 
126
9
  ```sh
127
- npm create gtkx@beta
10
+ npm install @gtkx/navigation@beta
128
11
  ```
129
12
 
130
- The same command works with other package managers: `pnpm create gtkx@beta` or `yarn create gtkx@beta`.
131
-
132
- Then run your new app:
133
-
134
- ```sh
135
- cd my-app
136
- npm run dev
137
- ```
138
-
139
- To go further, follow the [tutorial](https://gtkx.dev/tutorial/).
140
-
141
- ## Documentation
142
-
143
- The documentation at **[gtkx.dev](https://gtkx.dev)** includes a step-by-step tutorial that builds a complete GNOME app, from scaffolding to packaging and shipping, plus guides and a full API reference.
144
-
145
- **[Read the docs &rarr;](https://gtkx.dev/guide/why-gtkx)**
146
-
147
- ## Requirements
148
-
149
- GTKX is Linux-only. You need:
150
-
151
- - Linux with the Adwaita (1.8 or later), GTK4 (4.20 or later), and GLib development libraries
152
- - Node.js 26.7 or later
153
-
154
- The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other targets need to build it from the GTKX repository, which requires a Rust toolchain.
155
-
156
- ## Examples
157
-
158
- Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
159
-
160
- - [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world): the Adwaita counter above.
161
- - [`gtk-demo`](https://github.com/gtkx-org/gtkx/tree/main/examples/gtk-demo): the official GTK4 widget showcase in an Adwaita application shell, covering lists, dialogs, gestures, CSS, and OpenGL.
162
- - [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser): an Adwaita browser built around `WebKitWebView`.
163
- - [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations): an Adwaita showcase for `@gtkx/animated`, with React Spring animations driven by the GTK frame clock.
164
- - [`navigation`](https://github.com/gtkx-org/gtkx/tree/main/examples/navigation): a tour of `@gtkx/navigation`, React Navigation's stack, tab, and drawer navigators rendered with libadwaita.
165
- - [`tutorial`](https://github.com/gtkx-org/gtkx/tree/main/examples/tutorial): the Tasks app the documentation builds.
166
-
167
- ## Status
168
-
169
- GTKX is stable and ready for production use.
170
-
171
- ## Contributing
172
-
173
- Contributions are welcome. See [CONTRIBUTING.md](https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md), the [Code of Conduct](https://github.com/gtkx-org/gtkx/blob/main/CODE_OF_CONDUCT.md), and the [security policy](https://github.com/gtkx-org/gtkx/blob/main/SECURITY.md). Building the repo needs Node.js 26.7 or later, pnpm, and a Rust toolchain.
13
+ [Guide](https://gtkx.dev/v2/guide/navigation) · [API reference](https://gtkx.dev/v2/reference/@gtkx/navigation/) · [GTKX](https://gtkx.dev)
174
14
 
175
- ## License
15
+ GTKX requires Linux, Node.js, and the [native prerequisites](https://gtkx.dev/v2/guide/getting-started).
176
16
 
177
- GTKX is licensed under [MPL-2.0](https://github.com/gtkx-org/gtkx/blob/main/LICENSE).
17
+ [MPL-2.0](https://github.com/gtkx-org/gtkx/blob/main/LICENSE).
@@ -1 +1 @@
1
- {"version":3,"file":"create-drawer-navigator.d.ts","sourceRoot":"","sources":["../../src/drawer/create-drawer-navigator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,qBAAqB,EAErB,oBAAoB,EACpB,aAAa,EACb,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O,SAAS,oBAAoB,GAAG,aAAa,CAAC,SAAS,EAAE,WAAW,CAAC,EAClF,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,SAAS,EACpE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"create-drawer-navigator.d.ts","sourceRoot":"","sources":["../../src/drawer/create-drawer-navigator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,qBAAqB,EAErB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EACR,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,YAAY,CAAC;AAIpB,iFAAiF;AACjF,KAAK,aAAa,CACd,SAAS,SAAS,aAAa,GAAG,aAAa,EAC/C,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3D;IACA,oCAAoC;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,6BAA6B;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,oCAAoC;IACpC,KAAK,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACxC,0BAA0B;IAC1B,aAAa,EAAE,uBAAuB,CAAC;IACvC,kCAAkC;IAClC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,mCAAmC;IACnC,cAAc,EAAE;SACX,SAAS,IAAI,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC;KAC1F,CAAC;IACF,+BAA+B;IAC/B,SAAS,EAAE,OAAO,eAAe,CAAC;CACrC,CAAC;AAEF,sFAAsF;AACtF,QAAA,MAAM,kBAAkB,EAAE,mBAAmB,CAAC,aAAa,CAAwC,CAAC;AAuBpG,2GAA2G;AAC3G,iBAAS,eAAe,CAAC,EACrB,aAAa,EACb,SAAS,EACT,eAAe,EACf,UAAU,EACV,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,GAAG,OAAO,EACb,EAAE,oBAAoB,GAAG,SAAS,CAyBlC;AAED,wHAAwH;AACxH,iBAAS,qBAAqB,CAC1B,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACjE,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG,aAAa,CAAC,SAAS,EAAE,WAAW,CAAC,EAClF,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,SAAS,EACpE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,CAAC"}
@@ -24,8 +24,8 @@ const useDrawerRouter = (isCollapsed) => {
24
24
  /** Renders the screens of a {@link createDrawerNavigator} beside a sidebar in an `AdwOverlaySplitView`. */
25
25
  function DrawerNavigator({ drawerContent, collapsed, sidebarPosition, pinSidebar, minSidebarWidth, maxSidebarWidth, sidebarWidthFraction, defaultStatus, ...options }) {
26
26
  const createRouter = useDrawerRouter(collapsed === true);
27
- const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder(createRouter, { ...options, defaultStatus: defaultStatus ?? (collapsed === true ? "closed" : "open") });
28
- return (_jsx(NavigationContent, { children: _jsx(DrawerView, { state: state, navigation: navigation, descriptors: descriptors, drawerContent: drawerContent, collapsed: collapsed, sidebarPosition: sidebarPosition, pinSidebar: pinSidebar, minSidebarWidth: minSidebarWidth, maxSidebarWidth: maxSidebarWidth, sidebarWidthFraction: sidebarWidthFraction }) }));
27
+ const { state, descriptors, navigation, render } = useNavigationBuilder(createRouter, { ...options, defaultStatus: defaultStatus ?? (collapsed === true ? "closed" : "open") });
28
+ return render(_jsx(DrawerView, { state: state, navigation: navigation, descriptors: descriptors, drawerContent: drawerContent, collapsed: collapsed, sidebarPosition: sidebarPosition, pinSidebar: pinSidebar, minSidebarWidth: minSidebarWidth, maxSidebarWidth: maxSidebarWidth, sidebarWidthFraction: sidebarWidthFraction }));
29
29
  }
30
30
  /** Creates a drawer navigator rendered with `AdwOverlaySplitView`: a sidebar listing the screens beside the content. */
31
31
  function createDrawerNavigator(config) {
@@ -1 +1 @@
1
- {"version":3,"file":"create-drawer-navigator.js","sourceRoot":"","sources":["../../src/drawer/create-drawer-navigator.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQ5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAyB9C,sFAAsF;AACtF,MAAM,kBAAkB,GAAuC,mBAAmB,EAAiB,CAAC;AAEpG,MAAM,eAAe,GAAG,CAAC,WAAoB,EAAuB,EAAE;IAClE,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE;QACzB,IAAI,SAAS,GAAG,WAAW,CAAC;QAE5B,OAAO;YACH,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;YACrB,MAAM,EAAE,CAAC,MAAe,EAAE,EAAE;gBACxB,SAAS,GAAG,MAAM,CAAC;YACvB,CAAC;SACJ,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC,GAA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ourcesContent":["import type {\n DrawerActionHelpers,\n DrawerNavigationState,\n DrawerRouterOptions,\n NavigatorTypeBagBase,\n ParamListBase,\n StaticConfig,\n StaticScreenFactory,\n TypedNavigator,\n} from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport { createNavigatorFactory, createScreenFactory, useNavigationBuilder } from \"@react-navigation/core\";\nimport { useEffect, useState } from \"react\";\nimport type { DrawerRouterFactory } from \"./drawer-router.js\";\nimport type {\n DrawerNavigationEventMap,\n DrawerNavigationOptions,\n DrawerNavigationProp,\n DrawerNavigatorProps,\n} from \"./types.js\";\nimport { createDrawerRouter } from \"./drawer-router.js\";\nimport { DrawerView } from \"./drawer-view.js\";\n\n/** Type bag describing the drawer navigator to React Navigation's typed APIs. */\ntype DrawerTypeBag<\n ParamList extends ParamListBase = ParamListBase,\n NavigatorID extends string | undefined = string | undefined,\n> = {\n /** Route names and their params. */\n ParamList: ParamList;\n /** Optional navigator id. */\n NavigatorID: NavigatorID;\n /** Shape of the navigator state. */\n State: DrawerNavigationState<ParamList>;\n /** Per-screen options. */\n ScreenOptions: DrawerNavigationOptions;\n /** Events the navigator emits. */\n EventMap: DrawerNavigationEventMap;\n /** Navigation object per route. */\n NavigationList: {\n [RouteName in keyof ParamList]: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;\n };\n /** The navigator component. */\n Navigator: typeof DrawerNavigator;\n};\n\n/** Declares a typed screen of a drawer navigator for the static configuration API. */\nconst createDrawerScreen: StaticScreenFactory<DrawerTypeBag> = createScreenFactory<DrawerTypeBag>();\n\nconst useDrawerRouter = (isCollapsed: boolean): DrawerRouterFactory => {\n const [flag] = useState(() => {\n let isCurrent = isCollapsed;\n\n return {\n read: () => isCurrent,\n update: (isNext: boolean) => {\n isCurrent = isNext;\n },\n };\n });\n\n const [createRouter] = useState(() => createDrawerRouter(flag.read));\n\n useEffect(() => {\n flag.update(isCollapsed);\n }, [flag, isCollapsed]);\n\n return createRouter;\n};\n\n/** Renders the screens of a {@link createDrawerNavigator} beside a sidebar in an `AdwOverlaySplitView`. */\nfunction DrawerNavigator({\n drawerContent,\n collapsed,\n sidebarPosition,\n pinSidebar,\n minSidebarWidth,\n maxSidebarWidth,\n sidebarWidthFraction,\n defaultStatus,\n ...options\n}: DrawerNavigatorProps): ReactNode {\n const createRouter = useDrawerRouter(collapsed === true);\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n DrawerNavigationState<ParamListBase>,\n DrawerRouterOptions,\n DrawerActionHelpers<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n >(createRouter, { ...options, defaultStatus: defaultStatus ?? (collapsed === true ? \"closed\" : \"open\") });\n\n return (\n <NavigationContent>\n <DrawerView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n drawerContent={drawerContent}\n collapsed={collapsed}\n sidebarPosition={sidebarPosition}\n pinSidebar={pinSidebar}\n minSidebarWidth={minSidebarWidth}\n maxSidebarWidth={maxSidebarWidth}\n sidebarWidthFraction={sidebarWidthFraction}\n />\n </NavigationContent>\n );\n}\n\n/** Creates a drawer navigator rendered with `AdwOverlaySplitView`: a sidebar listing the screens beside the content. */\nfunction createDrawerNavigator<\n const ParamList extends ParamListBase,\n const NavigatorID extends string | undefined = string | undefined,\n const TypeBag extends NavigatorTypeBagBase = DrawerTypeBag<ParamList, NavigatorID>,\n const Config extends StaticConfig<TypeBag> | undefined = undefined,\n>(config?: Config): TypedNavigator<TypeBag, Config> {\n return createNavigatorFactory(DrawerNavigator)(config) as TypedNavigator<TypeBag, Config>;\n}\n\nexport { createDrawerNavigator, createDrawerScreen, DrawerNavigator, type DrawerTypeBag };\n"]}
1
+ {"version":3,"file":"create-drawer-navigator.js","sourceRoot":"","sources":["../../src/drawer/create-drawer-navigator.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,QAAQ,EA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,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAE1G,OAAO,MAAM,CACT,KAAC,UAAU,IACP,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB,GAC5C,CACL,CAAC;AACN,CAAC;AAED,wHAAwH;AACxH,SAAS,qBAAqB,CAK5B,MAAe;IACb,OAAO,sBAAsB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAoC,CAAC;AAC9F,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,eAAe,EAAsB,CAAC","sourcesContent":["import type {\n DrawerActionHelpers,\n DrawerNavigationState,\n DrawerRouterOptions,\n NavigatorTypeBagBase,\n ParamListBase,\n StaticConfig,\n StaticScreenFactory,\n TypedNavigator,\n} from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport { createNavigatorFactory, createScreenFactory, useNavigationBuilder } from \"@react-navigation/core\";\nimport { useEffect, useState } from \"react\";\nimport type { DrawerRouterFactory } from \"./drawer-router.js\";\nimport type {\n DrawerNavigationEventMap,\n DrawerNavigationOptions,\n DrawerNavigationProp,\n DrawerNavigatorProps,\n} from \"./types.js\";\nimport { createDrawerRouter } from \"./drawer-router.js\";\nimport { DrawerView } from \"./drawer-view.js\";\n\n/** Type bag describing the drawer navigator to React Navigation's typed APIs. */\ntype DrawerTypeBag<\n ParamList extends ParamListBase = ParamListBase,\n NavigatorID extends string | undefined = string | undefined,\n> = {\n /** Route names and their params. */\n ParamList: ParamList;\n /** Optional navigator id. */\n NavigatorID: NavigatorID;\n /** Shape of the navigator state. */\n State: DrawerNavigationState<ParamList>;\n /** Per-screen options. */\n ScreenOptions: DrawerNavigationOptions;\n /** Events the navigator emits. */\n EventMap: DrawerNavigationEventMap;\n /** Navigation object per route. */\n NavigationList: {\n [RouteName in keyof ParamList]: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;\n };\n /** The navigator component. */\n Navigator: typeof DrawerNavigator;\n};\n\n/** Declares a typed screen of a drawer navigator for the static configuration API. */\nconst createDrawerScreen: StaticScreenFactory<DrawerTypeBag> = createScreenFactory<DrawerTypeBag>();\n\nconst useDrawerRouter = (isCollapsed: boolean): DrawerRouterFactory => {\n const [flag] = useState(() => {\n let isCurrent = isCollapsed;\n\n return {\n read: () => isCurrent,\n update: (isNext: boolean) => {\n isCurrent = isNext;\n },\n };\n });\n\n const [createRouter] = useState(() => createDrawerRouter(flag.read));\n\n useEffect(() => {\n flag.update(isCollapsed);\n }, [flag, isCollapsed]);\n\n return createRouter;\n};\n\n/** Renders the screens of a {@link createDrawerNavigator} beside a sidebar in an `AdwOverlaySplitView`. */\nfunction DrawerNavigator({\n drawerContent,\n collapsed,\n sidebarPosition,\n pinSidebar,\n minSidebarWidth,\n maxSidebarWidth,\n sidebarWidthFraction,\n defaultStatus,\n ...options\n}: DrawerNavigatorProps): ReactNode {\n const createRouter = useDrawerRouter(collapsed === true);\n\n const { state, descriptors, navigation, render } = useNavigationBuilder<\n DrawerNavigationState<ParamListBase>,\n DrawerRouterOptions,\n DrawerActionHelpers<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n >(createRouter, { ...options, defaultStatus: defaultStatus ?? (collapsed === true ? \"closed\" : \"open\") });\n\n return render(\n <DrawerView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n drawerContent={drawerContent}\n collapsed={collapsed}\n sidebarPosition={sidebarPosition}\n pinSidebar={pinSidebar}\n minSidebarWidth={minSidebarWidth}\n maxSidebarWidth={maxSidebarWidth}\n sidebarWidthFraction={sidebarWidthFraction}\n />,\n );\n}\n\n/** Creates a drawer navigator rendered with `AdwOverlaySplitView`: a sidebar listing the screens beside the content. */\nfunction createDrawerNavigator<\n const ParamList extends ParamListBase,\n const NavigatorID extends string | undefined = string | undefined,\n const TypeBag extends NavigatorTypeBagBase = DrawerTypeBag<ParamList, NavigatorID>,\n const Config extends StaticConfig<TypeBag> | undefined = undefined,\n>(config?: Config): TypedNavigator<TypeBag, Config> {\n return createNavigatorFactory(DrawerNavigator)(config) as TypedNavigator<TypeBag, Config>;\n}\n\nexport { createDrawerNavigator, createDrawerScreen, DrawerNavigator, type DrawerTypeBag };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-item-list.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-item-list.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,kBAAkB,EAA6C,MAAM,YAAY,CAAC;AAgDhG,kGAAkG;AAClG,QAAA,MAAM,cAAc,GAAI,oCAAoC,kBAAkB,KAAG,SAgBhF,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"drawer-item-list.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-item-list.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,kBAAkB,EAA6C,MAAM,YAAY,CAAC;AAuDhG,kGAAkG;AAClG,QAAA,MAAM,cAAc,uCAAwC,kBAAkB,KAAG,SAgBhF,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as Gtk from "@gtkx/gi/gtk";
3
- import { GtkBox, GtkImage, GtkLabel, GtkListBox } from "@gtkx/jsx/gtk";
3
+ import { GtkBox, GtkImage, GtkLabel, GtkListBox, GtkListBoxRow } from "@gtkx/jsx/gtk";
4
4
  import { CommonActions, DrawerActions } from "@react-navigation/core";
5
- import { useCallback, useContext } from "react";
5
+ import { useCallback, useContext, useState } from "react";
6
6
  import { requireDescriptor } from "../shared/routes.js";
7
7
  import { DrawerCollapsedContext } from "./drawer-collapsed-context.js";
8
8
  const didNavigateToRow = (navigation, state, rowIndex) => {
@@ -28,7 +28,9 @@ const useDrawerItemPress = (navigation, isCollapsed) => useCallback((row) => {
28
28
  }, [navigation, isCollapsed]);
29
29
  const DrawerItem = ({ descriptor }) => {
30
30
  const { route, options } = descriptor;
31
- return (_jsxs(GtkBox, { spacing: 12, children: [options.drawerIcon === undefined ? null : _jsx(GtkImage, { iconName: options.drawerIcon }), _jsx(GtkLabel, { label: options.drawerLabel ?? options.title ?? route.name, xalign: 0 })] }));
31
+ const label = options.drawerLabel ?? options.title ?? route.name;
32
+ const [labelWidget, setLabelWidget] = useState(null);
33
+ return (_jsx(GtkListBoxRow, { accessibleLabelledBy: labelWidget === null ? undefined : [labelWidget], children: _jsxs(GtkBox, { spacing: 12, children: [options.drawerIcon === undefined ? null : _jsx(GtkImage, { iconName: options.drawerIcon }), _jsx(GtkLabel, { ref: setLabelWidget, label: label, useUnderline: options.useUnderline ?? false, xalign: 0 })] }) }));
32
34
  };
33
35
  /** Lists the drawer routes as rows of a `GtkListBox`; activating a row navigates to its route. */
34
36
  const DrawerItemList = ({ state, navigation, descriptors }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-item-list.js","sourceRoot":"","sources":["../../src/drawer/drawer-item-list.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OA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C,MAAM,UAAU,GAAG,CAAC,EAAE,UAAU,EAAoC,EAAa,EAAE;IAC/E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAEtC,OAAO,CACH,MAAC,MAAM,IAAC,OAAO,EAAE,EAAE,aACd,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,GAAI,EACrF,KAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAAI,IAC7E,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,kGAAkG;AAClG,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAsB,EAAa,EAAE;IACzF,MAAM,WAAW,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAEnE,OAAO,CACH,KAAC,UAAU,IACP,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAClC,aAAa,EAAE,KAAK,CAAC,KAAK,EAC1B,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC,MAAM,EACvC,cAAc,EAAE,cAAc,YAE7B,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB,KAAC,UAAU,IAAiB,UAAU,EAAE,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,IAAhE,KAAK,CAAC,GAAG,CAA2D,CACxF,CAAC,GACO,CAChB,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { NavigationState } from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { GtkBox, GtkImage, GtkLabel, GtkListBox } from \"@gtkx/jsx/gtk\";\nimport { CommonActions, DrawerActions } from \"@react-navigation/core\";\nimport { useCallback, useContext } from \"react\";\nimport type { DrawerContentProps, DrawerDescriptor, DrawerNavigationHelpers } from \"./types.js\";\nimport { requireDescriptor } from \"../shared/routes.js\";\nimport { DrawerCollapsedContext } from \"./drawer-collapsed-context.js\";\n\ntype RowActivated = (row: Gtk.ListBoxRow) => void;\n\nconst didNavigateToRow = (navigation: DrawerNavigationHelpers, state: NavigationState, rowIndex: number): boolean => {\n const route = state.routes[rowIndex];\n\n if (route === undefined) {\n return false;\n }\n\n const event = navigation.emit({ type: \"drawerItemPress\", target: route.key, canPreventDefault: true });\n\n if (event.defaultPrevented) {\n return false;\n }\n\n navigation.dispatch({ ...CommonActions.navigate(route.name, route.params), target: state.key });\n\n return true;\n};\n\nconst useDrawerItemPress = (navigation: DrawerNavigationHelpers, isCollapsed: boolean): RowActivated =>\n useCallback((row: Gtk.ListBoxRow) => {\n const state = navigation.getState();\n\n if (!didNavigateToRow(navigation, state, row.getIndex())) {\n return;\n }\n\n if (isCollapsed) {\n navigation.dispatch({ ...DrawerActions.closeDrawer(), target: state.key });\n }\n }, [navigation, isCollapsed]);\n\nconst DrawerItem = ({ descriptor }: { descriptor: DrawerDescriptor }): ReactNode => {\n const { route, options } = descriptor;\n\n return (\n <GtkBox spacing={12}>\n {options.drawerIcon === undefined ? null : <GtkImage iconName={options.drawerIcon} />}\n <GtkLabel label={options.drawerLabel ?? options.title ?? route.name} xalign={0} />\n </GtkBox>\n );\n};\n\n/** Lists the drawer routes as rows of a `GtkListBox`; activating a row navigates to its route. */\nconst DrawerItemList = ({ state, navigation, descriptors }: DrawerContentProps): ReactNode => {\n const isCollapsed = useContext(DrawerCollapsedContext);\n const onRowActivated = useDrawerItemPress(navigation, isCollapsed);\n\n return (\n <GtkListBox\n cssClasses={[\"navigation-sidebar\"]}\n selectedIndex={state.index}\n selectionMode={Gtk.SelectionMode.SINGLE}\n onRowActivated={onRowActivated}\n >\n {state.routes.map((route) => (\n <DrawerItem key={route.key} descriptor={requireDescriptor(descriptors, route.key)} />\n ))}\n </GtkListBox>\n );\n};\n\nexport { DrawerItemList };\n"]}
1
+ {"version":3,"file":"drawer-item-list.js","sourceRoot":"","sources":["../../src/drawer/drawer-item-list.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,MAAM,gBAAgB,GAAG,CAAC,UAAmC,EAAE,KAAsB,EAAE,QAAgB,EAAW,EAAE;IAChH,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAErC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;IAEvG,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,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AE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,KAAK,EAAE,MAAM,EAAE,CAAC,GAAI,IAClG,GACG,CACnB,CAAC;AACN,CAAC,CAAC;AAEF,kGAAkG;AAClG,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAsB,EAAa,EAAE;IACzF,MAAM,WAAW,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAEnE,OAAO,CACH,KAAC,UAAU,IACP,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAClC,aAAa,EAAE,KAAK,CAAC,KAAK,EAC1B,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC,MAAM,EACvC,cAAc,EAAE,cAAc,YAE7B,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB,KAAC,UAAU,IAAiB,UAAU,EAAE,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,IAAhE,KAAK,CAAC,GAAG,CAA2D,CACxF,CAAC,GACO,CAChB,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { NavigationState } from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { GtkBox, GtkImage, GtkLabel, GtkListBox, GtkListBoxRow } from \"@gtkx/jsx/gtk\";\nimport { CommonActions, DrawerActions } from \"@react-navigation/core\";\nimport { useCallback, useContext, useState } from \"react\";\nimport type { DrawerContentProps, DrawerDescriptor, DrawerNavigationHelpers } from \"./types.js\";\nimport { requireDescriptor } from \"../shared/routes.js\";\nimport { DrawerCollapsedContext } from \"./drawer-collapsed-context.js\";\n\ntype RowActivated = (row: Gtk.ListBoxRow) => void;\n\nconst didNavigateToRow = (navigation: DrawerNavigationHelpers, state: NavigationState, rowIndex: number): boolean => {\n const route = state.routes[rowIndex];\n\n if (route === undefined) {\n return false;\n }\n\n const event = navigation.emit({ type: \"drawerItemPress\", target: route.key, canPreventDefault: true });\n\n if (event.defaultPrevented) {\n return false;\n }\n\n navigation.dispatch({ ...CommonActions.navigate(route.name, route.params), target: state.key });\n\n return true;\n};\n\nconst useDrawerItemPress = (navigation: DrawerNavigationHelpers, isCollapsed: boolean): RowActivated =>\n useCallback(\n (row: Gtk.ListBoxRow) => {\n const state = navigation.getState();\n\n if (!didNavigateToRow(navigation, state, row.getIndex())) {\n return;\n }\n\n if (isCollapsed) {\n navigation.dispatch({ ...DrawerActions.closeDrawer(), target: state.key });\n }\n },\n [navigation, isCollapsed],\n );\n\nconst DrawerItem = ({ descriptor }: { descriptor: DrawerDescriptor }): ReactNode => {\n const { route, options } = descriptor;\n const label = options.drawerLabel ?? options.title ?? route.name;\n const [labelWidget, setLabelWidget] = useState<Gtk.Label | null>(null);\n\n return (\n <GtkListBoxRow accessibleLabelledBy={labelWidget === null ? undefined : [labelWidget]}>\n <GtkBox spacing={12}>\n {options.drawerIcon === undefined ? null : <GtkImage iconName={options.drawerIcon} />}\n <GtkLabel ref={setLabelWidget} label={label} useUnderline={options.useUnderline ?? false} xalign={0} />\n </GtkBox>\n </GtkListBoxRow>\n );\n};\n\n/** Lists the drawer routes as rows of a `GtkListBox`; activating a row navigates to its route. */\nconst DrawerItemList = ({ state, navigation, descriptors }: DrawerContentProps): ReactNode => {\n const isCollapsed = useContext(DrawerCollapsedContext);\n const onRowActivated = useDrawerItemPress(navigation, isCollapsed);\n\n return (\n <GtkListBox\n cssClasses={[\"navigation-sidebar\"]}\n selectedIndex={state.index}\n selectionMode={Gtk.SelectionMode.SINGLE}\n onRowActivated={onRowActivated}\n >\n {state.routes.map((route) => (\n <DrawerItem key={route.key} descriptor={requireDescriptor(descriptors, route.key)} />\n ))}\n </GtkListBox>\n );\n};\n\nexport { DrawerItemList };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-router.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,KAAK,mBAAmB,GAAG,OAAO,YAAY,CAAC;AAiF/C,QAAA,MAAM,kBAAkB,GAAI,aAAa,MAAM,OAAO,KAAG,mBACD,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"drawer-router.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,KAAK,mBAAmB,GAAG,OAAO,YAAY,CAAC;AAiF/C,QAAA,MAAM,kBAAkB,gBACN,MAAM,OAAO,KAAG,mBAE0B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-router.js","sourceRoot":"","sources":["../../src/drawer/drawer-router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgBrD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAEnF,MAAM,YAAY,GAAG,CAAC,IAAiB,EAAE,KAAkB,EAAW,EAAE,CACpE,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;IAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM;IAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAA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C,CAAC,CAAC,KAAK,CAAC;IACnG,CAAC;IAED,OAAO,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7G,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,MAA4B,EAAE,WAA0B,EAAwB,EAAE,CAAC,CAAC;IAC1G,GAAG,MAAM;IACT,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CACzC,aAAa,CAAC;QACV,KAAK;QACL,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;QACtD,WAAW,EAAE,WAAW,EAAE;QAC1B,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;KACxE,CAAC;IACN,qBAAqB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAClC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC;CACvF,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC,WAA0B,EAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CACxF,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAA4B,CAAC","sourcesContent":["import type { DrawerNavigationState, NavigationAction, ParamListBase, PartialState } from \"@react-navigation/core\";\nimport { DrawerRouter } from \"@react-navigation/routers\";\nimport { getDrawerStatus } from \"./drawer-status.js\";\n\ntype DrawerState = DrawerNavigationState<ParamListBase>;\ntype DrawerRouterFactory = typeof DrawerRouter;\ntype DrawerRouterInstance = ReturnType<DrawerRouterFactory>;\ntype StateResult = DrawerState | PartialState<DrawerState> | null;\ntype Retry = (state: DrawerState) => StateResult;\n\ntype ResolvedAction = {\n state: DrawerState;\n action: NavigationAction;\n after: StateResult;\n isCollapsed: boolean;\n retry: Retry;\n};\n\nconst NAVIGATING_ACTIONS = new Set([\"JUMP_TO\", \"NAVIGATE\", \"NAVIGATE_DEPRECATED\"]);\n\nconst isSameRoutes = (left: DrawerState, right: DrawerState): boolean =>\n left.index === right.index &&\n left.routes.length === right.routes.length &&\n left.routes.every((route, index) => right.routes[index]?.key === route.key);\n\nconst reopenSidebar = (state: DrawerState): DrawerState => {\n if (state.default === \"open\") {\n return { ...state, history: state.history.filter((entry) => entry.type !== \"drawer\") };\n }\n\n return { ...state, history: [...state.history, { type: \"drawer\", status: \"open\" }] };\n};\n\nconst wasSidebarHidden = (before: DrawerState, after: DrawerState): boolean =>\n getDrawerStatus(before) === \"open\" && getDrawerStatus(after) === \"closed\";\n\nconst wasSidebarShown = (before: DrawerState, after: DrawerState): boolean =>\n getDrawerStatus(before) === \"closed\" && getDrawerStatus(after) === \"open\";\n\nconst keepSidebarShown = (before: DrawerState, after: DrawerState, isCollapsed: boolean): DrawerState =>\n !isCollapsed && wasSidebarHidden(before, after) ? reopenSidebar(after) : after;\n\nconst keepSidebarShownInResult = (before: DrawerState, after: StateResult, isCollapsed: boolean): StateResult =>\n after?.stale === false ? keepSidebarShown(before, after, isCollapsed) : after;\n\nconst shouldPassBackThrough = (state: DrawerState, after: StateResult, isCollapsed: boolean): boolean =>\n !isCollapsed && after?.stale === false && isSameRoutes(state, after) && wasSidebarShown(state, after);\n\nconst withoutDrawerEntry = (state: DrawerState): DrawerState => ({\n ...state,\n history: state.history.filter((entry) => entry.type !== \"drawer\"),\n});\n\nconst closedAgain = (state: DrawerState): DrawerState => ({\n ...state,\n history: [...state.history, { type: \"drawer\", status: \"closed\" }],\n});\n\nconst backPastDrawer = (state: DrawerState, retry: Retry): StateResult => {\n const after = retry(withoutDrawerEntry(state));\n\n return after?.stale === false ? closedAgain(after) : after;\n};\n\nconst resolveAction = ({ state, action, after, isCollapsed, retry }: ResolvedAction): StateResult => {\n if (action.type === \"GO_BACK\") {\n return shouldPassBackThrough(state, after, isCollapsed) ? backPastDrawer(state, retry) : after;\n }\n\n return NAVIGATING_ACTIONS.has(action.type) ? keepSidebarShownInResult(state, after, isCollapsed) : after;\n};\n\nconst withShownSidebar = (router: DrawerRouterInstance, isCollapsed: () => boolean): DrawerRouterInstance => ({\n ...router,\n getStateForAction: (state, action, config) =>\n resolveAction({\n state,\n action,\n after: router.getStateForAction(state, action, config),\n isCollapsed: isCollapsed(),\n retry: (retried) => router.getStateForAction(retried, action, config),\n }),\n getStateForRouteFocus: (state, key) =>\n keepSidebarShown(state, router.getStateForRouteFocus(state, key), isCollapsed()),\n});\n\nconst createDrawerRouter = (isCollapsed: () => boolean): DrawerRouterFactory => (options) =>\n withShownSidebar(DrawerRouter(options), isCollapsed);\n\nexport { createDrawerRouter, type DrawerRouterFactory };\n"]}
1
+ {"version":3,"file":"drawer-router.js","sourceRoot":"","sources":["../../src/drawer/drawer-router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgBrD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAEnF,MAAM,YAAY,GAAG,CAAC,IAAiB,EAAE,KAAkB,EAAW,EAAE,CACpE,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;IAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM;IAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC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,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnG,CAAC;IAED,OAAO,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7G,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,MAA4B,EAAE,WAA0B,EAAwB,EAAE,CAAC,CAAC;IAC1G,GAAG,MAAM;IACT,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CACzC,aAAa,CAAC;QACV,KAAK;QACL,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;QACtD,WAAW,EAAE,WAAW,EAAE;QAC1B,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;KACxE,CAAC;IACN,qBAAqB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAClC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC;CACvF,CAAC,CAAC;AAEH,MAAM,kBAAkB,GACpB,CAAC,WAA0B,EAAuB,EAAE,CACpD,CAAC,OAAO,EAAE,EAAE,CACR,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAA4B,CAAC","sourcesContent":["import type { DrawerNavigationState, NavigationAction, ParamListBase, PartialState } from \"@react-navigation/core\";\nimport { DrawerRouter } from \"@react-navigation/routers\";\nimport { getDrawerStatus } from \"./drawer-status.js\";\n\ntype DrawerState = DrawerNavigationState<ParamListBase>;\ntype DrawerRouterFactory = typeof DrawerRouter;\ntype DrawerRouterInstance = ReturnType<DrawerRouterFactory>;\ntype StateResult = DrawerState | PartialState<DrawerState> | null;\ntype Retry = (state: DrawerState) => StateResult;\n\ntype ResolvedAction = {\n state: DrawerState;\n action: NavigationAction;\n after: StateResult;\n isCollapsed: boolean;\n retry: Retry;\n};\n\nconst NAVIGATING_ACTIONS = new Set([\"JUMP_TO\", \"NAVIGATE\", \"NAVIGATE_DEPRECATED\"]);\n\nconst isSameRoutes = (left: DrawerState, right: DrawerState): boolean =>\n left.index === right.index &&\n left.routes.length === right.routes.length &&\n left.routes.every((route, index) => right.routes[index]?.key === route.key);\n\nconst reopenSidebar = (state: DrawerState): DrawerState => {\n if (state.default === \"open\") {\n return { ...state, history: state.history.filter((entry) => entry.type !== \"drawer\") };\n }\n\n return { ...state, history: [...state.history, { type: \"drawer\", status: \"open\" }] };\n};\n\nconst wasSidebarHidden = (before: DrawerState, after: DrawerState): boolean =>\n getDrawerStatus(before) === \"open\" && getDrawerStatus(after) === \"closed\";\n\nconst wasSidebarShown = (before: DrawerState, after: DrawerState): boolean =>\n getDrawerStatus(before) === \"closed\" && getDrawerStatus(after) === \"open\";\n\nconst keepSidebarShown = (before: DrawerState, after: DrawerState, isCollapsed: boolean): DrawerState =>\n !isCollapsed && wasSidebarHidden(before, after) ? reopenSidebar(after) : after;\n\nconst keepSidebarShownInResult = (before: DrawerState, after: StateResult, isCollapsed: boolean): StateResult =>\n after?.stale === false ? keepSidebarShown(before, after, isCollapsed) : after;\n\nconst shouldPassBackThrough = (state: DrawerState, after: StateResult, isCollapsed: boolean): boolean =>\n !isCollapsed && after?.stale === false && isSameRoutes(state, after) && wasSidebarShown(state, after);\n\nconst withoutDrawerEntry = (state: DrawerState): DrawerState => ({\n ...state,\n history: state.history.filter((entry) => entry.type !== \"drawer\"),\n});\n\nconst closedAgain = (state: DrawerState): DrawerState => ({\n ...state,\n history: [...state.history, { type: \"drawer\", status: \"closed\" }],\n});\n\nconst backPastDrawer = (state: DrawerState, retry: Retry): StateResult => {\n const after = retry(withoutDrawerEntry(state));\n\n return after?.stale === false ? closedAgain(after) : after;\n};\n\nconst resolveAction = ({ state, action, after, isCollapsed, retry }: ResolvedAction): StateResult => {\n if (action.type === \"GO_BACK\") {\n return shouldPassBackThrough(state, after, isCollapsed) ? backPastDrawer(state, retry) : after;\n }\n\n return NAVIGATING_ACTIONS.has(action.type) ? keepSidebarShownInResult(state, after, isCollapsed) : after;\n};\n\nconst withShownSidebar = (router: DrawerRouterInstance, isCollapsed: () => boolean): DrawerRouterInstance => ({\n ...router,\n getStateForAction: (state, action, config) =>\n resolveAction({\n state,\n action,\n after: router.getStateForAction(state, action, config),\n isCollapsed: isCollapsed(),\n retry: (retried) => router.getStateForAction(retried, action, config),\n }),\n getStateForRouteFocus: (state, key) =>\n keepSidebarShown(state, router.getStateForRouteFocus(state, key), isCollapsed()),\n});\n\nconst createDrawerRouter =\n (isCollapsed: () => boolean): DrawerRouterFactory =>\n (options) =>\n withShownSidebar(DrawerRouter(options), isCollapsed);\n\nexport { createDrawerRouter, type DrawerRouterFactory };\n"]}
@@ -1,4 +1,4 @@
1
- import type { DrawerStatus, NavigationState } from "@react-navigation/core";
2
- declare const getDrawerStatus: (state: NavigationState) => DrawerStatus;
1
+ import type { DrawerNavigationState, DrawerStatus, ParamListBase } from "@react-navigation/core";
2
+ declare const getDrawerStatus: (state: DrawerNavigationState<ParamListBase>) => DrawerStatus;
3
3
  export { getDrawerStatus };
4
4
  //# sourceMappingURL=drawer-status.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-status.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAO5E,QAAA,MAAM,eAAe,GAAI,OAAO,eAAe,KAAG,YASjD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"drawer-status.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjG,QAAA,MAAM,eAAe,UAAW,qBAAqB,CAAC,aAAa,CAAC,KAAG,YACgB,CAAC;AAExF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,11 +1,3 @@
1
- const isDrawerEntry = (entry) => typeof entry === "object" && entry !== null && "type" in entry && entry.type === "drawer";
2
- const getDrawerStatus = (state) => {
3
- const history = state.history ?? [];
4
- const entry = history.findLast(isDrawerEntry);
5
- if (entry !== undefined) {
6
- return entry.status;
7
- }
8
- return "default" in state && state.default === "open" ? "open" : "closed";
9
- };
1
+ const getDrawerStatus = (state) => state.history.findLast((entry) => entry.type === "drawer")?.status ?? state.default;
10
2
  export { getDrawerStatus };
11
3
  //# sourceMappingURL=drawer-status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-status.js","sourceRoot":"","sources":["../../src/drawer/drawer-status.ts"],"names":[],"mappings":"AAIA,MAAM,aAAa,GAAG,CAAC,KAAc,EAA+B,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAE9F,MAAM,eAAe,GAAG,CAAC,KAAsB,EAAgB,EAAE;IAC7D,MAAM,OAAO,GAAuB,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAE9C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,MAAM,CAAC;IACxB,CAAC;IAED,OAAO,SAAS,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC9E,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type { DrawerStatus, NavigationState } from \"@react-navigation/core\";\n\ntype DrawerHistoryEntry = { type: \"drawer\"; status: DrawerStatus };\n\nconst isDrawerEntry = (entry: unknown): entry is DrawerHistoryEntry =>\n typeof entry === \"object\" && entry !== null && \"type\" in entry && entry.type === \"drawer\";\n\nconst getDrawerStatus = (state: NavigationState): DrawerStatus => {\n const history: readonly unknown[] = state.history ?? [];\n const entry = history.findLast(isDrawerEntry);\n\n if (entry !== undefined) {\n return entry.status;\n }\n\n return \"default\" in state && state.default === \"open\" ? \"open\" : \"closed\";\n};\n\nexport { getDrawerStatus };\n"]}
1
+ {"version":3,"file":"drawer-status.js","sourceRoot":"","sources":["../../src/drawer/drawer-status.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,CAAC,KAA2C,EAAgB,EAAE,CAClF,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAExF,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type { DrawerNavigationState, DrawerStatus, ParamListBase } from \"@react-navigation/core\";\n\nconst getDrawerStatus = (state: DrawerNavigationState<ParamListBase>): DrawerStatus =>\n state.history.findLast((entry) => entry.type === \"drawer\")?.status ?? state.default;\n\nexport { getDrawerStatus };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-view.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvC,OAAO,KAAK,EAGR,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EAC1B,MAAM,YAAY,CAAC;AAUpB,KAAK,eAAe,GAAG,sBAAsB,GAAG;IAC5C,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CACpC,CAAC;AAiGF,QAAA,MAAM,UAAU,GAAI,8DAA8D,eAAe,KAAG,SAsCnG,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"drawer-view.d.ts","sourceRoot":"","sources":["../../src/drawer/drawer-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAGR,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EAC1B,MAAM,YAAY,CAAC;AASpB,KAAK,eAAe,GAAG,sBAAsB,GAAG;IAC5C,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CACpC,CAAC;AAmGF,QAAA,MAAM,UAAU,iEAAkE,eAAe,KAAG,SAsCnG,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,26 +1,23 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as Gtk from "@gtkx/gi/gtk";
3
- import { AdwHeaderBar, AdwOverlaySplitView, AdwToolbarView, AdwViewStack, AdwWindowTitle, } from "@gtkx/jsx/adw";
3
+ import { AdwHeaderBar, AdwOverlaySplitView, AdwToolbarView, AdwViewStack, AdwWindowTitle } from "@gtkx/jsx/adw";
4
4
  import { GtkButton, GtkScrolledWindow } from "@gtkx/jsx/gtk";
5
5
  import { DrawerActions } from "@react-navigation/core";
6
6
  import { useCallback, useEffect, useRef } from "react";
7
7
  import { HeaderBar } from "../shared/header-bar.js";
8
8
  import { getFocusedRoute, requireDescriptor } from "../shared/routes.js";
9
9
  import { ScenePage } from "../shared/scene-page.js";
10
- import { useLoadedRoutes } from "../shared/use-loaded-routes.js";
11
10
  import { usePopToTopOnBlur } from "../shared/use-pop-to-top-on-blur.js";
12
11
  import { DrawerCollapsedContext } from "./drawer-collapsed-context.js";
13
12
  import { DrawerItemList } from "./drawer-item-list.js";
14
13
  import { getDrawerStatus } from "./drawer-status.js";
15
14
  const PACK_TYPES = { start: Gtk.PackType.START, end: Gtk.PackType.END };
16
15
  const useSidebarSync = (navigation) => useCallback((isShown) => {
17
- const current = navigation.getState();
18
- const isOpen = getDrawerStatus(current) === "open";
19
- if (isShown === null || isShown === isOpen) {
16
+ if (isShown === null) {
20
17
  return;
21
18
  }
22
19
  const action = isShown ? DrawerActions.openDrawer() : DrawerActions.closeDrawer();
23
- navigation.dispatch({ ...action, target: current.key });
20
+ navigation.dispatch({ ...action, target: navigation.getState().key });
24
21
  }, [navigation]);
25
22
  const useCloseOnNavigate = (state, navigation, isCollapsed) => {
26
23
  const focusedKey = getFocusedRoute(state).key;
@@ -28,7 +25,7 @@ const useCloseOnNavigate = (state, navigation, isCollapsed) => {
28
25
  useEffect(() => {
29
26
  const hasChanged = previousKeyRef.current !== focusedKey;
30
27
  previousKeyRef.current = focusedKey;
31
- if (hasChanged && isCollapsed && getDrawerStatus(navigation.getState()) === "open") {
28
+ if (hasChanged && isCollapsed) {
32
29
  navigation.dispatch({ ...DrawerActions.closeDrawer(), target: navigation.getState().key });
33
30
  }
34
31
  }, [focusedKey, isCollapsed, navigation]);
@@ -47,21 +44,20 @@ const DrawerHeader = ({ descriptor, navigation }) => {
47
44
  }
48
45
  return (_jsx(HeaderBar, { options: options, start: _jsx(DrawerToggle, { navigation: navigation }), titleWidget: _jsx(AdwWindowTitle, { title: options.title ?? route.name }) }));
49
46
  };
50
- const DrawerPage = ({ descriptor, isLoaded }) => {
47
+ const DrawerPage = ({ descriptor, isFocused, isLoaded }) => {
51
48
  const { route, options } = descriptor;
52
- return (_jsx(ScenePage, { name: route.key, title: options.title ?? route.name, isLoaded: isLoaded || options.lazy === false, render: () => descriptor.render() }));
49
+ return (_jsx(ScenePage, { name: route.key, title: options.title ?? route.name, isFocused: isFocused, isLoaded: isLoaded || options.lazy === false, render: () => descriptor.render() }));
53
50
  };
54
51
  const DrawerView = ({ state, navigation, descriptors, drawerContent, ...config }) => {
55
52
  const { collapsed = false, sidebarPosition = "start", pinSidebar, minSidebarWidth, maxSidebarWidth } = config;
56
53
  const focused = getFocusedRoute(state);
57
54
  const descriptor = requireDescriptor(descriptors, focused.key);
58
- const loaded = useLoadedRoutes(focused.key, state.preloadedRouteKeys);
59
55
  const onShowSidebarChanged = useSidebarSync(navigation);
60
56
  const contentProps = { state, navigation, descriptors };
61
57
  const sidebar = drawerContent === undefined ? _jsx(DrawerContent, { ...contentProps }) : drawerContent(contentProps);
62
58
  usePopToTopOnBlur(state, descriptors, navigation);
63
59
  useCloseOnNavigate(state, navigation, collapsed);
64
- return (_jsx(DrawerCollapsedContext, { value: collapsed, children: _jsx(AdwOverlaySplitView, { collapsed: collapsed, showSidebar: getDrawerStatus(state) === "open", sidebarPosition: PACK_TYPES[sidebarPosition], pinSidebar: pinSidebar, minSidebarWidth: minSidebarWidth, maxSidebarWidth: maxSidebarWidth, sidebarWidthFraction: config.sidebarWidthFraction, onNotifyShowSidebar: onShowSidebarChanged, sidebar: _jsx(_Fragment, { children: sidebar }), children: _jsx(AdwToolbarView, { topBar: _jsx(DrawerHeader, { descriptor: descriptor, navigation: navigation }), children: _jsx(AdwViewStack, { visibleChildName: focused.key, children: state.routes.map((route) => (_jsx(DrawerPage, { descriptor: requireDescriptor(descriptors, route.key), isLoaded: loaded.has(route.key) }, route.key))) }) }) }) }));
60
+ return (_jsx(DrawerCollapsedContext, { value: collapsed, children: _jsx(AdwOverlaySplitView, { collapsed: collapsed, showSidebar: getDrawerStatus(state) === "open", sidebarPosition: PACK_TYPES[sidebarPosition], pinSidebar: pinSidebar, minSidebarWidth: minSidebarWidth, maxSidebarWidth: maxSidebarWidth, sidebarWidthFraction: config.sidebarWidthFraction, onNotifyShowSidebar: onShowSidebarChanged, sidebar: _jsx(_Fragment, { children: sidebar }), children: _jsx(AdwToolbarView, { topBar: _jsx(DrawerHeader, { descriptor: descriptor, navigation: navigation }), children: _jsx(AdwViewStack, { visibleChildName: focused.key, children: state.routes.map((route) => (_jsx(DrawerPage, { descriptor: requireDescriptor(descriptors, route.key), isFocused: route.key === focused.key, isLoaded: route.key === focused.key || state.preloadedRouteKeys.includes(route.key) }, route.key))) }) }) }) }));
65
61
  };
66
62
  export { DrawerView };
67
63
  //# sourceMappingURL=drawer-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-view.js","sourceRoot":"","sources":["../../src/drawer/drawer-view.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,cAAc,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAQvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE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} from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport {\n AdwHeaderBar,\n AdwOverlaySplitView,\n AdwToolbarView,\n AdwViewStack,\n AdwWindowTitle,\n} from \"@gtkx/jsx/adw\";\nimport { GtkButton, GtkScrolledWindow } from \"@gtkx/jsx/gtk\";\nimport { DrawerActions } from \"@react-navigation/core\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type {\n DrawerContentProps,\n DrawerDescriptor,\n DrawerDescriptorMap,\n DrawerNavigationConfig,\n DrawerNavigationHelpers,\n} from \"./types.js\";\nimport { HeaderBar } from \"../shared/header-bar.js\";\nimport { getFocusedRoute, requireDescriptor } from \"../shared/routes.js\";\nimport { ScenePage } from \"../shared/scene-page.js\";\nimport { useLoadedRoutes } from \"../shared/use-loaded-routes.js\";\nimport { usePopToTopOnBlur } from \"../shared/use-pop-to-top-on-blur.js\";\nimport { DrawerCollapsedContext } from \"./drawer-collapsed-context.js\";\nimport { DrawerItemList } from \"./drawer-item-list.js\";\nimport { getDrawerStatus } from \"./drawer-status.js\";\n\ntype DrawerViewProps = DrawerNavigationConfig & {\n state: DrawerNavigationState<ParamListBase>;\n navigation: DrawerNavigationHelpers;\n descriptors: DrawerDescriptorMap;\n};\n\ntype DrawerHeaderProps = {\n descriptor: DrawerDescriptor;\n navigation: DrawerNavigationHelpers;\n};\n\ntype DrawerPageProps = {\n descriptor: DrawerDescriptor;\n isLoaded: boolean;\n};\n\nconst PACK_TYPES = { start: Gtk.PackType.START, end: Gtk.PackType.END } as const;\n\nconst useSidebarSync = (navigation: DrawerNavigationHelpers): ((isShown: boolean | null) => void) =>\n useCallback((isShown: boolean | null) => {\n const current = navigation.getState();\n const isOpen = getDrawerStatus(current) === \"open\";\n\n if (isShown === null || isShown === isOpen) {\n return;\n }\n\n const action = isShown ? DrawerActions.openDrawer() : DrawerActions.closeDrawer();\n navigation.dispatch({ ...action, target: current.key });\n }, [navigation]);\n\nconst useCloseOnNavigate = (\n state: DrawerNavigationState<ParamListBase>,\n navigation: DrawerNavigationHelpers,\n isCollapsed: boolean,\n): void => {\n const focusedKey = getFocusedRoute(state).key;\n const previousKeyRef = useRef(focusedKey);\n\n useEffect(() => {\n const hasChanged = previousKeyRef.current !== focusedKey;\n previousKeyRef.current = focusedKey;\n\n if (hasChanged && isCollapsed && getDrawerStatus(navigation.getState()) === \"open\") {\n navigation.dispatch({ ...DrawerActions.closeDrawer(), target: navigation.getState().key });\n }\n }, [focusedKey, isCollapsed, navigation]);\n};\n\nconst DrawerContent = (props: DrawerContentProps): ReactNode => (\n <AdwToolbarView topBar={<AdwHeaderBar />}>\n <GtkScrolledWindow hscrollbarPolicy={Gtk.PolicyType.NEVER}>\n <DrawerItemList {...props} />\n </GtkScrolledWindow>\n </AdwToolbarView>\n);\n\nconst DrawerToggle = ({ navigation }: { navigation: DrawerNavigationHelpers }): ReactNode => (\n <GtkButton\n iconName=\"sidebar-show-symbolic\"\n tooltipText=\"Toggle Sidebar\"\n accessibleLabel=\"Toggle Sidebar\"\n onClicked={() => {\n navigation.dispatch(DrawerActions.toggleDrawer());\n }}\n />\n);\n\nconst DrawerHeader = ({ descriptor, navigation }: DrawerHeaderProps): ReactNode => {\n const { route, options } = descriptor;\n\n if (options.headerShown === false) {\n return null;\n }\n\n if (options.header !== undefined) {\n return <>{options.header({ route, navigation: descriptor.navigation, options })}</>;\n }\n\n return (\n <HeaderBar\n options={options}\n start={<DrawerToggle navigation={navigation} />}\n titleWidget={<AdwWindowTitle title={options.title ?? route.name} />}\n />\n );\n};\n\nconst DrawerPage = ({ descriptor, isLoaded }: DrawerPageProps): ReactNode => {\n const { route, options } = descriptor;\n\n return (\n <ScenePage\n name={route.key}\n title={options.title ?? route.name}\n isLoaded={isLoaded || options.lazy === false}\n render={() => descriptor.render()}\n />\n );\n};\n\nconst DrawerView = ({ state, navigation, descriptors, drawerContent, ...config }: DrawerViewProps): ReactNode => {\n const { collapsed = false, sidebarPosition = \"start\", pinSidebar, minSidebarWidth, maxSidebarWidth } = config;\n const focused = getFocusedRoute(state);\n const descriptor = requireDescriptor(descriptors, focused.key);\n const loaded = useLoadedRoutes(focused.key, state.preloadedRouteKeys);\n const onShowSidebarChanged = useSidebarSync(navigation);\n const contentProps = { state, navigation, descriptors };\n const sidebar = drawerContent === undefined ? <DrawerContent {...contentProps} /> : drawerContent(contentProps);\n usePopToTopOnBlur(state, descriptors, navigation);\n useCloseOnNavigate(state, navigation, collapsed);\n\n return (\n <DrawerCollapsedContext value={collapsed}>\n <AdwOverlaySplitView\n collapsed={collapsed}\n showSidebar={getDrawerStatus(state) === \"open\"}\n sidebarPosition={PACK_TYPES[sidebarPosition]}\n pinSidebar={pinSidebar}\n minSidebarWidth={minSidebarWidth}\n maxSidebarWidth={maxSidebarWidth}\n sidebarWidthFraction={config.sidebarWidthFraction}\n onNotifyShowSidebar={onShowSidebarChanged}\n sidebar={<>{sidebar}</>}\n >\n <AdwToolbarView topBar={<DrawerHeader descriptor={descriptor} navigation={navigation} />}>\n <AdwViewStack visibleChildName={focused.key}>\n {state.routes.map((route) => (\n <DrawerPage\n key={route.key}\n descriptor={requireDescriptor(descriptors, route.key)}\n isLoaded={loaded.has(route.key)}\n />\n ))}\n </AdwViewStack>\n </AdwToolbarView>\n </AdwOverlaySplitView>\n </DrawerCollapsedContext>\n );\n};\n\nexport { DrawerView };\n"]}
1
+ {"version":3,"file":"drawer-view.js","sourceRoot":"","sources":["../../src/drawer/drawer-view.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAChH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAA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AK,CAAC,GAAG,CAIhB,CACL,CAAC,GACS,GACF,GACC,GACD,CAC5B,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import type { DrawerNavigationState, ParamListBase } from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { AdwHeaderBar, AdwOverlaySplitView, AdwToolbarView, AdwViewStack, AdwWindowTitle } from \"@gtkx/jsx/adw\";\nimport { GtkButton, GtkScrolledWindow } from \"@gtkx/jsx/gtk\";\nimport { DrawerActions } from \"@react-navigation/core\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type {\n DrawerContentProps,\n DrawerDescriptor,\n DrawerDescriptorMap,\n DrawerNavigationConfig,\n DrawerNavigationHelpers,\n} from \"./types.js\";\nimport { HeaderBar } from \"../shared/header-bar.js\";\nimport { getFocusedRoute, requireDescriptor } from \"../shared/routes.js\";\nimport { ScenePage } from \"../shared/scene-page.js\";\nimport { usePopToTopOnBlur } from \"../shared/use-pop-to-top-on-blur.js\";\nimport { DrawerCollapsedContext } from \"./drawer-collapsed-context.js\";\nimport { DrawerItemList } from \"./drawer-item-list.js\";\nimport { getDrawerStatus } from \"./drawer-status.js\";\n\ntype DrawerViewProps = DrawerNavigationConfig & {\n state: DrawerNavigationState<ParamListBase>;\n navigation: DrawerNavigationHelpers;\n descriptors: DrawerDescriptorMap;\n};\n\ntype DrawerHeaderProps = {\n descriptor: DrawerDescriptor;\n navigation: DrawerNavigationHelpers;\n};\n\ntype DrawerPageProps = {\n descriptor: DrawerDescriptor;\n isFocused: boolean;\n isLoaded: boolean;\n};\n\nconst PACK_TYPES = { start: Gtk.PackType.START, end: Gtk.PackType.END } as const;\n\nconst useSidebarSync = (navigation: DrawerNavigationHelpers): ((isShown: boolean | null) => void) =>\n useCallback(\n (isShown: boolean | null) => {\n if (isShown === null) {\n return;\n }\n\n const action = isShown ? DrawerActions.openDrawer() : DrawerActions.closeDrawer();\n navigation.dispatch({ ...action, target: navigation.getState().key });\n },\n [navigation],\n );\n\nconst useCloseOnNavigate = (\n state: DrawerNavigationState<ParamListBase>,\n navigation: DrawerNavigationHelpers,\n isCollapsed: boolean,\n): void => {\n const focusedKey = getFocusedRoute(state).key;\n const previousKeyRef = useRef(focusedKey);\n\n useEffect(() => {\n const hasChanged = previousKeyRef.current !== focusedKey;\n previousKeyRef.current = focusedKey;\n\n if (hasChanged && isCollapsed) {\n navigation.dispatch({ ...DrawerActions.closeDrawer(), target: navigation.getState().key });\n }\n }, [focusedKey, isCollapsed, navigation]);\n};\n\nconst DrawerContent = (props: DrawerContentProps): ReactNode => (\n <AdwToolbarView topBar={<AdwHeaderBar />}>\n <GtkScrolledWindow hscrollbarPolicy={Gtk.PolicyType.NEVER}>\n <DrawerItemList {...props} />\n </GtkScrolledWindow>\n </AdwToolbarView>\n);\n\nconst DrawerToggle = ({ navigation }: { navigation: DrawerNavigationHelpers }): ReactNode => (\n <GtkButton\n iconName=\"sidebar-show-symbolic\"\n tooltipText=\"Toggle Sidebar\"\n accessibleLabel=\"Toggle Sidebar\"\n onClicked={() => {\n navigation.dispatch(DrawerActions.toggleDrawer());\n }}\n />\n);\n\nconst DrawerHeader = ({ descriptor, navigation }: DrawerHeaderProps): ReactNode => {\n const { route, options } = descriptor;\n\n if (options.headerShown === false) {\n return null;\n }\n\n if (options.header !== undefined) {\n return <>{options.header({ route, navigation: descriptor.navigation, options })}</>;\n }\n\n return (\n <HeaderBar\n options={options}\n start={<DrawerToggle navigation={navigation} />}\n titleWidget={<AdwWindowTitle title={options.title ?? route.name} />}\n />\n );\n};\n\nconst DrawerPage = ({ descriptor, isFocused, isLoaded }: DrawerPageProps): ReactNode => {\n const { route, options } = descriptor;\n\n return (\n <ScenePage\n name={route.key}\n title={options.title ?? route.name}\n isFocused={isFocused}\n isLoaded={isLoaded || options.lazy === false}\n render={() => descriptor.render()}\n />\n );\n};\n\nconst DrawerView = ({ state, navigation, descriptors, drawerContent, ...config }: DrawerViewProps): ReactNode => {\n const { collapsed = false, sidebarPosition = \"start\", pinSidebar, minSidebarWidth, maxSidebarWidth } = config;\n const focused = getFocusedRoute(state);\n const descriptor = requireDescriptor(descriptors, focused.key);\n const onShowSidebarChanged = useSidebarSync(navigation);\n const contentProps = { state, navigation, descriptors };\n const sidebar = drawerContent === undefined ? <DrawerContent {...contentProps} /> : drawerContent(contentProps);\n usePopToTopOnBlur(state, descriptors, navigation);\n useCloseOnNavigate(state, navigation, collapsed);\n\n return (\n <DrawerCollapsedContext value={collapsed}>\n <AdwOverlaySplitView\n collapsed={collapsed}\n showSidebar={getDrawerStatus(state) === \"open\"}\n sidebarPosition={PACK_TYPES[sidebarPosition]}\n pinSidebar={pinSidebar}\n minSidebarWidth={minSidebarWidth}\n maxSidebarWidth={maxSidebarWidth}\n sidebarWidthFraction={config.sidebarWidthFraction}\n onNotifyShowSidebar={onShowSidebarChanged}\n sidebar={<>{sidebar}</>}\n >\n <AdwToolbarView topBar={<DrawerHeader descriptor={descriptor} navigation={navigation} />}>\n <AdwViewStack visibleChildName={focused.key}>\n {state.routes.map((route) => (\n <DrawerPage\n key={route.key}\n descriptor={requireDescriptor(descriptors, route.key)}\n isFocused={route.key === focused.key}\n isLoaded={route.key === focused.key || state.preloadedRouteKeys.includes(route.key)}\n />\n ))}\n </AdwViewStack>\n </AdwToolbarView>\n </AdwOverlaySplitView>\n </DrawerCollapsedContext>\n );\n};\n\nexport { DrawerView };\n"]}
@@ -17,6 +17,8 @@ type DrawerNavigationOptions = HeaderOptions & {
17
17
  header?: (props: DrawerHeaderProps) => ReactNode;
18
18
  /** Label shown in the sidebar; defaults to `title`, then to the route name. */
19
19
  drawerLabel?: string;
20
+ /** Whether underscores in the sidebar label indicate mnemonics; defaults to `false`. */
21
+ useUnderline?: boolean;
20
22
  /** Icon name shown next to the sidebar label. */
21
23
  drawerIcon?: string;
22
24
  /** Whether the screen mounts on first focus instead of at startup; defaults to `true`. */
@@ -1 +1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kG;IAClG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAClC,qGAAqG;IACrG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,iDAAiD;AACjD,KAAK,oBAAoB,GAAG,uBAAuB,CAC/C,aAAa,EACb,MAAM,GAAG,SAAS,EAClB,qBAAqB,CAAC,aAAa,CAAC,EACpC,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,CAAC,aAAa,CAAC,CACtC,GACD,mBAAmB,GACnB,sBAAsB,CAAC;AAEvB,YAAY,EACR,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GACpB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,uBAAuB,EACvB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,SAAS,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,kFAAkF;AAClF,KAAK,wBAAwB,GAAG;IAC5B,iDAAiD;IACjD,eAAe,EAAE;QACb,kBAAkB;QAClB,IAAI,EAAE,SAAS,CAAC;QAChB,yDAAyD;QACzD,iBAAiB,EAAE,IAAI,CAAC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,wBAAwB,EACxB,oBAAoB,CAAC,aAAa,CAAC,CACtC,GACG,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,YAAY,EACR,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/drawer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DefaultNavigatorOptions,\n Descriptor,\n DrawerActionHelpers,\n DrawerNavigationState,\n DrawerRouterOptions,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n RouteProp,\n} from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport type { HeaderOptions } from \"../shared/types.js\";\n\n/** Events the drawer navigator emits on top of React Navigation's core events. */\ntype DrawerNavigationEventMap = {\n /** The user activated an item in the sidebar. */\n drawerItemPress: {\n /** No payload. */\n data: undefined;\n /** Calling `preventDefault` keeps the current screen. */\n canPreventDefault: true;\n };\n};\n\n/** Per-screen options of the drawer navigator. */\ntype DrawerNavigationOptions = HeaderOptions & {\n /** Renders a custom top bar instead of the default `AdwHeaderBar`. */\n header?: (props: DrawerHeaderProps) => ReactNode;\n /** Label shown in the sidebar; defaults to `title`, then to the route name. */\n drawerLabel?: string;\n /** Icon name shown next to the sidebar label. */\n drawerIcon?: string;\n /** Whether the screen mounts on first focus instead of at startup; defaults to `true`. */\n lazy?: boolean;\n /** Whether a nested stack pops to its first screen when this screen loses focus; defaults to `false`. */\n popToTopOnBlur?: boolean;\n};\n\n/** Navigation object of a drawer screen. */\ntype DrawerNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined,\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n DrawerNavigationState<ParamList>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n> & DrawerActionHelpers<ParamList>;\n\n/** Props a drawer screen component receives. */\ntype DrawerScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined,\n> = {\n /** Navigation object of the screen. */\n navigation: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;\n /** The route the screen renders. */\n route: RouteProp<ParamList, RouteName>;\n};\n\n/** Arguments of a custom drawer `header` renderer. */\ntype DrawerHeaderProps = {\n /** The focused route. */\n route: RouteProp<ParamListBase>;\n /** Navigation object of the focused route. */\n navigation: DrawerNavigationProp<ParamListBase>;\n /** Resolved options of the focused route. */\n options: DrawerNavigationOptions;\n};\n\n/** Navigation helpers of the drawer navigator itself. */\ntype DrawerNavigationHelpers = NavigationHelpers<ParamListBase, DrawerNavigationEventMap> &\n DrawerActionHelpers<ParamListBase>;\n\n/** Descriptor of one drawer route. */\ntype DrawerDescriptor = Descriptor<\n DrawerNavigationOptions,\n DrawerNavigationProp<ParamListBase>,\n RouteProp<ParamListBase>\n>;\n\n/** Descriptors of the drawer routes, keyed by route key. */\ntype DrawerDescriptorMap = Record<string, DrawerDescriptor>;\n\n/** Arguments of a custom `drawerContent` renderer and props of {@link DrawerItemList}. */\ntype DrawerContentProps = {\n /** State of the drawer navigator. */\n state: DrawerNavigationState<ParamListBase>;\n /** Navigation helpers of the drawer navigator. */\n navigation: DrawerNavigationHelpers;\n /** Descriptors of the drawer routes. */\n descriptors: DrawerDescriptorMap;\n};\n\n/** Props of the drawer navigator beyond the options every navigator shares. */\ntype DrawerNavigationConfig = {\n /** Renders the sidebar; defaults to a header bar above a {@link DrawerItemList}. */\n drawerContent?: (props: DrawerContentProps) => ReactNode;\n /** Whether the sidebar overlays the content instead of sitting beside it; defaults to `false`. */\n collapsed?: boolean;\n /** Which side the sidebar sits on; defaults to `\"start\"`. */\n sidebarPosition?: \"start\" | \"end\";\n /** Whether collapsing and uncollapsing leave the sidebar's visibility alone; defaults to `false`. */\n pinSidebar?: boolean;\n /** Minimum sidebar width, in the unit libadwaita uses for the split view. */\n minSidebarWidth?: number;\n /** Maximum sidebar width, in the unit libadwaita uses for the split view. */\n maxSidebarWidth?: number;\n /** Preferred sidebar width as a fraction of the total width. */\n sidebarWidthFraction?: number;\n};\n\n/** Props of the drawer `Navigator` component. */\ntype DrawerNavigatorProps = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap,\n DrawerNavigationProp<ParamListBase>\n> &\nDrawerRouterOptions &\nDrawerNavigationConfig;\n\nexport type {\n DrawerContentProps,\n DrawerDescriptor,\n DrawerDescriptorMap,\n DrawerHeaderProps,\n DrawerNavigationConfig,\n DrawerNavigationEventMap,\n DrawerNavigationHelpers,\n DrawerNavigationOptions,\n DrawerNavigationProp,\n DrawerNavigatorProps,\n DrawerScreenProps,\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/drawer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DefaultNavigatorOptions,\n Descriptor,\n DrawerActionHelpers,\n DrawerNavigationState,\n DrawerRouterOptions,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n RouteProp,\n} from \"@react-navigation/core\";\nimport type { ReactNode } from \"react\";\nimport type { HeaderOptions } from \"../shared/types.js\";\n\n/** Events the drawer navigator emits on top of React Navigation's core events. */\ntype DrawerNavigationEventMap = {\n /** The user activated an item in the sidebar. */\n drawerItemPress: {\n /** No payload. */\n data: undefined;\n /** Calling `preventDefault` keeps the current screen. */\n canPreventDefault: true;\n };\n};\n\n/** Per-screen options of the drawer navigator. */\ntype DrawerNavigationOptions = HeaderOptions & {\n /** Renders a custom top bar instead of the default `AdwHeaderBar`. */\n header?: (props: DrawerHeaderProps) => ReactNode;\n /** Label shown in the sidebar; defaults to `title`, then to the route name. */\n drawerLabel?: string;\n /** Whether underscores in the sidebar label indicate mnemonics; defaults to `false`. */\n useUnderline?: boolean;\n /** Icon name shown next to the sidebar label. */\n drawerIcon?: string;\n /** Whether the screen mounts on first focus instead of at startup; defaults to `true`. */\n lazy?: boolean;\n /** Whether a nested stack pops to its first screen when this screen loses focus; defaults to `false`. */\n popToTopOnBlur?: boolean;\n};\n\n/** Navigation object of a drawer screen. */\ntype DrawerNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined,\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n DrawerNavigationState<ParamList>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n> &\n DrawerActionHelpers<ParamList>;\n\n/** Props a drawer screen component receives. */\ntype DrawerScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined,\n> = {\n /** Navigation object of the screen. */\n navigation: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;\n /** The route the screen renders. */\n route: RouteProp<ParamList, RouteName>;\n};\n\n/** Arguments of a custom drawer `header` renderer. */\ntype DrawerHeaderProps = {\n /** The focused route. */\n route: RouteProp<ParamListBase>;\n /** Navigation object of the focused route. */\n navigation: DrawerNavigationProp<ParamListBase>;\n /** Resolved options of the focused route. */\n options: DrawerNavigationOptions;\n};\n\n/** Navigation helpers of the drawer navigator itself. */\ntype DrawerNavigationHelpers = NavigationHelpers<ParamListBase, DrawerNavigationEventMap> &\n DrawerActionHelpers<ParamListBase>;\n\n/** Descriptor of one drawer route. */\ntype DrawerDescriptor = Descriptor<\n DrawerNavigationOptions,\n DrawerNavigationProp<ParamListBase>,\n RouteProp<ParamListBase>\n>;\n\n/** Descriptors of the drawer routes, keyed by route key. */\ntype DrawerDescriptorMap = Record<string, DrawerDescriptor>;\n\n/** Arguments of a custom `drawerContent` renderer and props of {@link DrawerItemList}. */\ntype DrawerContentProps = {\n /** State of the drawer navigator. */\n state: DrawerNavigationState<ParamListBase>;\n /** Navigation helpers of the drawer navigator. */\n navigation: DrawerNavigationHelpers;\n /** Descriptors of the drawer routes. */\n descriptors: DrawerDescriptorMap;\n};\n\n/** Props of the drawer navigator beyond the options every navigator shares. */\ntype DrawerNavigationConfig = {\n /** Renders the sidebar; defaults to a header bar above a {@link DrawerItemList}. */\n drawerContent?: (props: DrawerContentProps) => ReactNode;\n /** Whether the sidebar overlays the content instead of sitting beside it; defaults to `false`. */\n collapsed?: boolean;\n /** Which side the sidebar sits on; defaults to `\"start\"`. */\n sidebarPosition?: \"start\" | \"end\";\n /** Whether collapsing and uncollapsing leave the sidebar's visibility alone; defaults to `false`. */\n pinSidebar?: boolean;\n /** Minimum sidebar width, in the unit libadwaita uses for the split view. */\n minSidebarWidth?: number;\n /** Maximum sidebar width, in the unit libadwaita uses for the split view. */\n maxSidebarWidth?: number;\n /** Preferred sidebar width as a fraction of the total width. */\n sidebarWidthFraction?: number;\n};\n\n/** Props of the drawer `Navigator` component. */\ntype DrawerNavigatorProps = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap,\n DrawerNavigationProp<ParamListBase>\n> &\n DrawerRouterOptions &\n DrawerNavigationConfig;\n\nexport type {\n DrawerContentProps,\n DrawerDescriptor,\n DrawerDescriptorMap,\n DrawerHeaderProps,\n DrawerNavigationConfig,\n DrawerNavigationEventMap,\n DrawerNavigationHelpers,\n DrawerNavigationOptions,\n DrawerNavigationProp,\n DrawerNavigatorProps,\n DrawerScreenProps,\n};\n"]}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { createSplitViewNavigator, createSplitViewScreen, SplitViewNavigator, ty
7
7
  export type { SplitViewDescriptor, SplitViewDescriptorMap, SplitViewNavigationConfig, SplitViewNavigationEventMap, SplitViewNavigationHelpers, SplitViewNavigationOptions, SplitViewNavigationProp, SplitViewNavigatorProps, SplitViewScreenProps, } from "./split-view/types.js";
8
8
  export { createStackNavigator, createStackScreen, StackNavigator, type StackTypeBag, } from "./stack/create-stack-navigator.js";
9
9
  export type { StackDescriptor, StackDescriptorMap, StackHeaderBack, StackHeaderProps, StackNavigationConfig, StackNavigationEventMap, StackNavigationHelpers, StackNavigationOptions, StackNavigationProp, StackNavigatorProps, StackScreenProps, StackTransitionData, } from "./stack/types.js";
10
- export { createStaticNavigation, type StaticNavigationProps, type StaticNavigationTree, } from "./static-navigation.js";
10
+ export { createStaticNavigation, type StaticNavigationProps, type StaticNavigationTree } from "./static-navigation.js";
11
11
  export { createTabNavigator, createTabScreen, TabNavigator, type TabTypeBag } from "./tabs/create-tab-navigator.js";
12
12
  export type { TabDescriptor, TabDescriptorMap, TabHeaderProps, TabNavigationConfig, TabNavigationEventMap, TabNavigationHelpers, TabNavigationOptions, TabNavigationProp, TabNavigatorProps, TabScreenProps, } from "./tabs/types.js";
13
13
  export { DarkTheme, DefaultTheme, type Theme } from "./theme.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,KAAK,aAAa,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,YAAY,EACR,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,mBAAmB,EACnB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAChC,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACH,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,gBAAgB,GACxB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACR,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,KAAK,YAAY,GACpB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACR,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACH,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACpH,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,KAAK,aAAa,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,YAAY,EACR,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACn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