@buoy-gg/route-events 7.0.41 → 7.0.43

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 (102) hide show
  1. package/README.md +11 -64
  2. package/lib/commonjs/RouteObserver.js +1 -54
  3. package/lib/commonjs/RouteParser.js +1 -314
  4. package/lib/commonjs/RouteTracker.js +1 -112
  5. package/lib/commonjs/RouteTracker.web.js +1 -12
  6. package/lib/commonjs/browserRouteRegistry.js +1 -30
  7. package/lib/commonjs/browserRoutes.js +1 -96
  8. package/lib/commonjs/components/NavigationStack.js +2 -572
  9. package/lib/commonjs/components/ReactNavigationRoutes.js +1 -836
  10. package/lib/commonjs/components/ReactNavigationRoutes.web.js +1 -12
  11. package/lib/commonjs/components/RouteEventDetail.js +1 -97
  12. package/lib/commonjs/components/RouteEventExpandedContent.js +1 -204
  13. package/lib/commonjs/components/RouteEventItemCompact.js +1 -191
  14. package/lib/commonjs/components/RouteEventsModalWithTabs.js +1 -734
  15. package/lib/commonjs/components/RouteEventsTimeline.js +1 -107
  16. package/lib/commonjs/components/RouteFilterViewV2.js +1 -42
  17. package/lib/commonjs/components/RoutesSitemap.js +2 -1035
  18. package/lib/commonjs/expoRouterStore.js +1 -121
  19. package/lib/commonjs/expoRouterStore.web.js +1 -44
  20. package/lib/commonjs/hooks/useRouteEvents.js +1 -57
  21. package/lib/commonjs/index.js +1 -168
  22. package/lib/commonjs/preset.js +1 -69
  23. package/lib/commonjs/stores/navigationStackStore.js +1 -45
  24. package/lib/commonjs/stores/routeEventStore.js +1 -136
  25. package/lib/commonjs/sync/routeEventsSyncAdapter.js +1 -275
  26. package/lib/commonjs/useNavigationStack.js +1 -408
  27. package/lib/commonjs/useNavigationStack.web.js +1 -32
  28. package/lib/commonjs/useRouteObserver.js +1 -73
  29. package/lib/commonjs/useRouteObserverReactNavigation.js +1 -109
  30. package/lib/commonjs/useRouteSitemap.js +1 -255
  31. package/lib/commonjs/utils/routeTemplate.js +1 -79
  32. package/lib/commonjs/utils/safeReactNavigation.js +1 -194
  33. package/lib/commonjs/utils/safeReactNavigation.web.js +1 -36
  34. package/lib/commonjs/utils/testIDs.js +1 -63
  35. package/lib/module/RouteObserver.js +1 -49
  36. package/lib/module/RouteParser.js +1 -309
  37. package/lib/module/RouteTracker.js +1 -109
  38. package/lib/module/RouteTracker.web.js +1 -8
  39. package/lib/module/browserRouteRegistry.js +1 -24
  40. package/lib/module/browserRoutes.js +1 -92
  41. package/lib/module/components/NavigationStack.js +2 -568
  42. package/lib/module/components/ReactNavigationRoutes.js +1 -832
  43. package/lib/module/components/ReactNavigationRoutes.web.js +1 -3
  44. package/lib/module/components/RouteEventDetail.js +1 -93
  45. package/lib/module/components/RouteEventExpandedContent.js +1 -200
  46. package/lib/module/components/RouteEventItemCompact.js +1 -187
  47. package/lib/module/components/RouteEventsModalWithTabs.js +1 -731
  48. package/lib/module/components/RouteEventsTimeline.js +1 -103
  49. package/lib/module/components/RouteFilterViewV2.js +1 -38
  50. package/lib/module/components/RoutesSitemap.js +2 -1033
  51. package/lib/module/expoRouterStore.js +1 -114
  52. package/lib/module/expoRouterStore.web.js +1 -37
  53. package/lib/module/hooks/useRouteEvents.js +1 -54
  54. package/lib/module/index.js +1 -70
  55. package/lib/module/preset.js +1 -66
  56. package/lib/module/stores/navigationStackStore.js +1 -41
  57. package/lib/module/stores/routeEventStore.js +1 -128
  58. package/lib/module/sync/routeEventsSyncAdapter.js +1 -273
  59. package/lib/module/useNavigationStack.js +1 -404
  60. package/lib/module/useNavigationStack.web.js +1 -28
  61. package/lib/module/useRouteObserver.js +1 -70
  62. package/lib/module/useRouteObserverReactNavigation.js +1 -106
  63. package/lib/module/useRouteSitemap.js +1 -250
  64. package/lib/module/utils/routeTemplate.js +1 -73
  65. package/lib/module/utils/safeReactNavigation.js +1 -185
  66. package/lib/module/utils/safeReactNavigation.web.js +1 -27
  67. package/lib/module/utils/testIDs.js +1 -55
  68. package/lib/web/index.mjs +4 -5
  69. package/package.json +6 -11
  70. package/lib/typescript/RouteObserver.d.ts.map +0 -1
  71. package/lib/typescript/RouteParser.d.ts.map +0 -1
  72. package/lib/typescript/RouteTracker.d.ts.map +0 -1
  73. package/lib/typescript/RouteTracker.web.d.ts.map +0 -1
  74. package/lib/typescript/browserRouteRegistry.d.ts.map +0 -1
  75. package/lib/typescript/browserRoutes.d.ts.map +0 -1
  76. package/lib/typescript/components/NavigationStack.d.ts.map +0 -1
  77. package/lib/typescript/components/ReactNavigationRoutes.d.ts.map +0 -1
  78. package/lib/typescript/components/ReactNavigationRoutes.web.d.ts.map +0 -1
  79. package/lib/typescript/components/RouteEventDetail.d.ts.map +0 -1
  80. package/lib/typescript/components/RouteEventExpandedContent.d.ts.map +0 -1
  81. package/lib/typescript/components/RouteEventItemCompact.d.ts.map +0 -1
  82. package/lib/typescript/components/RouteEventsModalWithTabs.d.ts.map +0 -1
  83. package/lib/typescript/components/RouteEventsTimeline.d.ts.map +0 -1
  84. package/lib/typescript/components/RouteFilterViewV2.d.ts.map +0 -1
  85. package/lib/typescript/components/RoutesSitemap.d.ts.map +0 -1
  86. package/lib/typescript/expoRouterStore.d.ts.map +0 -1
  87. package/lib/typescript/expoRouterStore.web.d.ts.map +0 -1
  88. package/lib/typescript/hooks/useRouteEvents.d.ts.map +0 -1
  89. package/lib/typescript/index.d.ts.map +0 -1
  90. package/lib/typescript/preset.d.ts.map +0 -1
  91. package/lib/typescript/stores/navigationStackStore.d.ts.map +0 -1
  92. package/lib/typescript/stores/routeEventStore.d.ts.map +0 -1
  93. package/lib/typescript/sync/routeEventsSyncAdapter.d.ts.map +0 -1
  94. package/lib/typescript/useNavigationStack.d.ts.map +0 -1
  95. package/lib/typescript/useNavigationStack.web.d.ts.map +0 -1
  96. package/lib/typescript/useRouteObserver.d.ts.map +0 -1
  97. package/lib/typescript/useRouteObserverReactNavigation.d.ts.map +0 -1
  98. package/lib/typescript/useRouteSitemap.d.ts.map +0 -1
  99. package/lib/typescript/utils/routeTemplate.d.ts.map +0 -1
  100. package/lib/typescript/utils/safeReactNavigation.d.ts.map +0 -1
  101. package/lib/typescript/utils/safeReactNavigation.web.d.ts.map +0 -1
  102. package/lib/typescript/utils/testIDs.d.ts.map +0 -1
@@ -1,836 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ReactNavigationRoutes = ReactNavigationRoutes;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _safeReactNavigation = require("../utils/safeReactNavigation");
10
- var _sharedUi = require("@buoy-gg/shared-ui");
11
- var _license = require("@buoy-gg/license");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- /**
14
- * ReactNavigationRoutes - Visual sitemap of all screens in a React Navigation app
15
- *
16
- * Discovers all registered screens by walking the navigation state tree.
17
- * Each navigator's state includes a `routeNames` array listing ALL screens
18
- * registered with it — even ones not currently mounted in the stack.
19
- *
20
- * Provides navigation to any discovered screen using nested screen/params actions.
21
- */
22
-
23
- // Resolved once at module load; null when React Navigation is absent
24
- // (useSafeNavigationContainerRef then yields undefined, so the dispatch
25
- // paths below never execute).
26
- const CommonActions = (0, _safeReactNavigation.getCommonActions)();
27
-
28
- // ============================================================================
29
- // Types
30
- // ============================================================================
31
-
32
- // ============================================================================
33
- // State Tree Walking
34
- // ============================================================================
35
-
36
- /**
37
- * Walk the navigation state tree and collect all navigators with their registered screens.
38
- */
39
- function collectNavigatorGroups(state, parentPath = "Root") {
40
- if (!state) return [];
41
- const groups = [];
42
-
43
- // routeNames lists ALL screens registered with this navigator
44
- const routeNames = state.routeNames || [];
45
- const mountedRouteNames = new Set((state.routes || []).map(r => r.name));
46
- const focusedIndex = state.index ?? 0;
47
- const focusedRouteName = state.routes?.[focusedIndex]?.name;
48
- if (routeNames.length > 0) {
49
- const screens = routeNames.map(name => ({
50
- name,
51
- isMounted: mountedRouteNames.has(name),
52
- isFocused: name === focusedRouteName
53
- }));
54
- groups.push({
55
- name: parentPath === "Root" ? "Root" : parentPath.split(" > ").pop(),
56
- path: parentPath,
57
- screens,
58
- totalScreens: screens.length
59
- });
60
- }
61
-
62
- // Recurse into mounted routes that have nested navigator state
63
- for (const route of state.routes || []) {
64
- if (route.state) {
65
- const childPath = `${parentPath} > ${route.name}`;
66
- const nestedGroups = collectNavigatorGroups(route.state, childPath);
67
- groups.push(...nestedGroups);
68
- }
69
- }
70
- return groups;
71
- }
72
-
73
- /**
74
- * Find the path from root navigation state to a screen by name.
75
- */
76
- function findScreenPath(state, screenName) {
77
- if (!state || !state.routes) return null;
78
-
79
- // Check routeNames (all registered screens) not just mounted routes
80
- const routeNames = state.routeNames || [];
81
- if (routeNames.includes(screenName)) {
82
- return [screenName];
83
- }
84
- for (const route of state.routes) {
85
- if (route.state) {
86
- const nested = findScreenPath(route.state, screenName);
87
- if (nested) {
88
- return [route.name, ...nested];
89
- }
90
- }
91
- }
92
- return null;
93
- }
94
-
95
- /**
96
- * Build a nested CommonActions.navigate() from a path of screen names.
97
- */
98
- function buildNestedNavigateAction(path) {
99
- if (path.length === 0) return null;
100
- if (path.length === 1) {
101
- return CommonActions.navigate({
102
- name: path[0]
103
- });
104
- }
105
- let params = {
106
- screen: path[path.length - 1]
107
- };
108
- for (let i = path.length - 2; i >= 1; i--) {
109
- params = {
110
- screen: path[i],
111
- params
112
- };
113
- }
114
- return CommonActions.navigate({
115
- name: path[0],
116
- params
117
- });
118
- }
119
-
120
- // ============================================================================
121
- // Main Component
122
- // ============================================================================
123
-
124
- function ReactNavigationRoutes({
125
- style
126
- }) {
127
- const containerRef = (0, _safeReactNavigation.useSafeNavigationContainerRef)();
128
- const [navigationState, setNavigationState] = (0, _react.useState)(() => containerRef?.getRootState?.() ?? null);
129
- const [searchQuery, setSearchQuery] = (0, _react.useState)("");
130
- const [isSearching, setIsSearching] = (0, _react.useState)(false);
131
- const [expandedGroup, setExpandedGroup] = (0, _react.useState)(null);
132
- const [isRefreshing, setIsRefreshing] = (0, _react.useState)(false);
133
- const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
134
- const isPro = (0, _license.useIsPro)();
135
- (0, _react.useEffect)(() => {
136
- if (showUpgradeModal && isPro) {
137
- setShowUpgradeModal(false);
138
- }
139
- }, [showUpgradeModal, isPro]);
140
-
141
- // Subscribe to navigation state changes
142
- (0, _react.useEffect)(() => {
143
- if (!containerRef) return;
144
- const initialState = containerRef.getRootState?.();
145
- if (initialState) {
146
- setNavigationState(initialState);
147
- }
148
- const unsubscribe = containerRef.addListener?.("state", () => {
149
- const state = containerRef.getRootState?.();
150
- if (state) {
151
- setNavigationState(state);
152
- }
153
- });
154
- return () => {
155
- unsubscribe?.();
156
- };
157
- }, [containerRef]);
158
-
159
- // Build navigator groups from state
160
- const groups = (0, _react.useMemo)(() => collectNavigatorGroups(navigationState), [navigationState]);
161
-
162
- // Auto-expand first group on first load
163
- (0, _react.useEffect)(() => {
164
- if (groups.length > 0 && expandedGroup === null) {
165
- setExpandedGroup(groups[0].path);
166
- }
167
- }, [groups.length]);
168
-
169
- // Flatten all screens for stats and search
170
- const allScreens = (0, _react.useMemo)(() => {
171
- const screens = [];
172
- for (const group of groups) {
173
- for (const screen of group.screens) {
174
- screens.push({
175
- name: screen.name,
176
- navigatorPath: group.path,
177
- isMounted: screen.isMounted,
178
- isFocused: screen.isFocused
179
- });
180
- }
181
- }
182
- return screens;
183
- }, [groups]);
184
-
185
- // Filter groups by search
186
- const filteredGroups = (0, _react.useMemo)(() => {
187
- if (!searchQuery.trim()) return groups;
188
- const query = searchQuery.toLowerCase();
189
- return groups.map(group => ({
190
- ...group,
191
- screens: group.screens.filter(s => s.name.toLowerCase().includes(query))
192
- })).filter(group => group.screens.length > 0);
193
- }, [groups, searchQuery]);
194
-
195
- // Stats
196
- const stats = (0, _react.useMemo)(() => {
197
- const total = allScreens.length;
198
- const mounted = allScreens.filter(s => s.isMounted).length;
199
- const available = total - mounted;
200
- const navigators = groups.length;
201
- return {
202
- total,
203
- mounted,
204
- available,
205
- navigators
206
- };
207
- }, [allScreens, groups]);
208
-
209
- // Copy data
210
- const copyAllData = (0, _react.useMemo)(() => {
211
- return {
212
- summary: {
213
- totalScreens: stats.total,
214
- mounted: stats.mounted,
215
- available: stats.available,
216
- navigators: stats.navigators,
217
- timestamp: new Date().toISOString()
218
- },
219
- navigators: groups.map(group => ({
220
- path: group.path,
221
- screens: group.screens.map(s => ({
222
- name: s.name,
223
- isMounted: s.isMounted,
224
- isFocused: s.isFocused
225
- }))
226
- }))
227
- };
228
- }, [groups, stats]);
229
- const handleToggleGroup = (0, _react.useCallback)(groupPath => {
230
- setExpandedGroup(prev => prev === groupPath ? null : groupPath);
231
- }, []);
232
- const handleNavigate = (0, _react.useCallback)(screenName => {
233
- if (!isPro) {
234
- setShowUpgradeModal(true);
235
- return;
236
- }
237
- if (!containerRef || !navigationState) return;
238
- try {
239
- const path = findScreenPath(navigationState, screenName);
240
- if (path) {
241
- const action = buildNestedNavigateAction(path);
242
- if (action) {
243
- containerRef.dispatch(action);
244
- return;
245
- }
246
- }
247
- // Fallback
248
- containerRef.dispatch(CommonActions.navigate({
249
- name: screenName
250
- }));
251
- } catch (error) {
252
- _reactNative.Alert.alert("Navigation Error", String(error));
253
- }
254
- }, [containerRef, navigationState, isPro]);
255
- const handleRefresh = (0, _react.useCallback)(() => {
256
- if (isRefreshing || !containerRef) return;
257
- setIsRefreshing(true);
258
- const state = containerRef.getRootState?.();
259
- if (state) {
260
- setNavigationState(state);
261
- }
262
- setTimeout(() => setIsRefreshing(false), 400);
263
- }, [isRefreshing, containerRef]);
264
- if (!navigationState) {
265
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
266
- style: [styles.container, style],
267
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
268
- style: styles.emptyState,
269
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
270
- style: styles.emptyText,
271
- children: "No navigation state available"
272
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
273
- style: styles.emptySubtext,
274
- children: "Ensure you are inside a NavigationContainer"
275
- })]
276
- })
277
- });
278
- }
279
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
280
- style: [styles.container, style],
281
- children: [isSearching && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
282
- style: styles.searchContainer,
283
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Search, {
284
- size: 16,
285
- color: _sharedUi.night.color.textTertiary
286
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
287
- style: styles.searchInput,
288
- placeholder: "Search screens...",
289
- placeholderTextColor: _sharedUi.night.color.placeholder,
290
- value: searchQuery,
291
- onChangeText: setSearchQuery,
292
- autoCapitalize: "none",
293
- autoCorrect: false,
294
- autoFocus: true
295
- }), searchQuery.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
296
- onPress: () => setSearchQuery(""),
297
- style: styles.clearButton,
298
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
299
- style: styles.clearButtonText,
300
- children: "\u2715"
301
- })
302
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
303
- style: styles.closeSearchButton,
304
- onPress: () => {
305
- setIsSearching(false);
306
- setSearchQuery("");
307
- },
308
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
309
- style: styles.closeSearchText,
310
- children: "Done"
311
- })
312
- })]
313
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
314
- style: styles.scrollView,
315
- contentContainerStyle: styles.scrollContent,
316
- children: [!isSearching && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
317
- style: styles.header,
318
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
319
- style: styles.actionsRow,
320
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
321
- style: styles.actionWrapper,
322
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton, {
323
- value: copyAllData,
324
- buttonStyle: styles.actionButtonHeader
325
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
326
- style: styles.actionLabel,
327
- children: "Copy"
328
- })]
329
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
330
- style: styles.actionWrapper,
331
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
332
- style: [styles.iconButton, isRefreshing && styles.refreshButtonDisabled],
333
- onPress: handleRefresh,
334
- disabled: isRefreshing,
335
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.RefreshCw, {
336
- size: 16,
337
- color: isRefreshing ? _sharedUi.night.color.textTertiary : _sharedUi.night.color.textSecondary
338
- })
339
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
340
- style: styles.actionLabel,
341
- children: "Refresh"
342
- })]
343
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
344
- style: styles.actionWrapper,
345
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
346
- style: styles.iconButton,
347
- onPress: () => setIsSearching(true),
348
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Search, {
349
- size: 16,
350
- color: _sharedUi.night.color.textSecondary
351
- })
352
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
353
- style: styles.actionLabel,
354
- children: "Search"
355
- })]
356
- })]
357
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
358
- style: styles.statsGrid,
359
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StatItem, {
360
- value: stats.total,
361
- label: "Screens"
362
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StatItem, {
363
- value: stats.mounted,
364
- label: "Mounted"
365
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StatItem, {
366
- value: stats.available,
367
- label: "Available"
368
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StatItem, {
369
- value: stats.navigators,
370
- label: "Navigators"
371
- })]
372
- })]
373
- }), filteredGroups.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
374
- style: styles.emptyState,
375
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
376
- style: styles.emptyText,
377
- children: searchQuery ? "No matching screens" : "No screens found"
378
- })
379
- }) : filteredGroups.map(group => /*#__PURE__*/(0, _jsxRuntime.jsx)(NavigatorGroupView, {
380
- group: group,
381
- isExpanded: searchQuery.length > 0 || expandedGroup === group.path,
382
- onToggleExpand: () => handleToggleGroup(group.path),
383
- onNavigate: handleNavigate
384
- }, group.path)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
385
- style: styles.metaFooter,
386
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
387
- style: styles.metaText,
388
- children: "Source: navigation state"
389
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
390
- style: styles.sourceBadge,
391
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
392
- style: styles.sourceText,
393
- children: "React Navigation"
394
- })
395
- })]
396
- })]
397
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ProUpgradeModal, {
398
- visible: showUpgradeModal,
399
- onClose: () => setShowUpgradeModal(false),
400
- featureName: "Route Navigation"
401
- })]
402
- });
403
- }
404
-
405
- // ============================================================================
406
- // Sub-components
407
- // ============================================================================
408
-
409
- function StatItem({
410
- value,
411
- label
412
- }) {
413
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
414
- style: styles.statItem,
415
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
416
- style: styles.statValue,
417
- children: value
418
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
419
- style: styles.statLabel,
420
- children: label
421
- })]
422
- });
423
- }
424
- function NavigatorGroupView({
425
- group,
426
- isExpanded,
427
- onToggleExpand,
428
- onNavigate
429
- }) {
430
- const [expandedScreen, setExpandedScreen] = (0, _react.useState)(null);
431
- const handleToggleScreen = (0, _react.useCallback)(screenName => {
432
- setExpandedScreen(prev => prev === screenName ? null : screenName);
433
- }, []);
434
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
435
- style: styles.groupContainer,
436
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
437
- style: styles.groupHeader,
438
- onPress: onToggleExpand,
439
- activeOpacity: 0.7,
440
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
441
- style: styles.groupHeaderLeft,
442
- children: [isExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
443
- size: 14,
444
- color: _sharedUi.night.color.textSecondary
445
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
446
- size: 14,
447
- color: _sharedUi.night.color.textSecondary
448
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
449
- style: styles.groupTitle,
450
- numberOfLines: 1,
451
- children: group.name
452
- })]
453
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
454
- style: styles.groupBadge,
455
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
456
- style: styles.groupCount,
457
- children: group.screens.length
458
- })
459
- })]
460
- }), isExpanded && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
461
- style: styles.screensList,
462
- children: [group.path !== "Root" && group.path.includes(" > ") && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
463
- style: styles.groupDescription,
464
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
465
- style: styles.groupDescriptionText,
466
- children: group.path
467
- })
468
- }), group.screens.map(screen => /*#__PURE__*/(0, _jsxRuntime.jsx)(ScreenItemView, {
469
- screen: screen,
470
- isExpanded: expandedScreen === screen.name,
471
- onToggleExpand: () => handleToggleScreen(screen.name),
472
- onNavigate: onNavigate
473
- }, screen.name))]
474
- })]
475
- });
476
- }
477
- function ScreenItemView({
478
- screen,
479
- isExpanded,
480
- onToggleExpand,
481
- onNavigate
482
- }) {
483
- const statusColor = screen.isFocused ? _sharedUi.buoyColors.success : screen.isMounted ? "#3B82F6" : _sharedUi.night.color.textTertiary;
484
- const statusLabel = screen.isFocused ? "FOCUSED" : screen.isMounted ? "MOUNTED" : "AVAILABLE";
485
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
486
- style: styles.screenItem,
487
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
488
- style: styles.screenCard,
489
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
490
- style: styles.screenHeaderLeft,
491
- onPress: onToggleExpand,
492
- activeOpacity: 0.7,
493
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
494
- style: styles.expandIndicator,
495
- children: isExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
496
- size: 14,
497
- color: _sharedUi.night.color.textSecondary
498
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
499
- size: 14,
500
- color: _sharedUi.night.color.textSecondary
501
- })
502
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
503
- style: styles.screenName,
504
- numberOfLines: 1,
505
- children: screen.name
506
- })]
507
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
508
- style: styles.screenHeaderActions,
509
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.InlineCopyButton, {
510
- value: screen.name,
511
- buttonStyle: styles.headerActionButton
512
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
513
- style: [styles.headerActionButton, styles.navigateButton],
514
- onPress: () => onNavigate(screen.name),
515
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
516
- style: styles.navigateButtonText,
517
- children: "Go"
518
- })
519
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
520
- style: [styles.statusBadge, {
521
- backgroundColor: `${statusColor}15`,
522
- borderColor: `${statusColor}40`
523
- }],
524
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
525
- style: [styles.statusText, {
526
- color: statusColor
527
- }],
528
- children: statusLabel
529
- })
530
- })]
531
- })]
532
- })
533
- });
534
- }
535
-
536
- // ============================================================================
537
- // Styles
538
- // ============================================================================
539
-
540
- const styles = _reactNative.StyleSheet.create({
541
- container: {
542
- flex: 1,
543
- // Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
544
- backgroundColor: "transparent"
545
- },
546
- emptyState: {
547
- padding: 32,
548
- alignItems: "center"
549
- },
550
- emptyText: {
551
- color: _sharedUi.night.color.textSecondary,
552
- fontSize: 14,
553
- fontFamily: _sharedUi.monoFont
554
- },
555
- emptySubtext: {
556
- color: _sharedUi.night.color.textTertiary,
557
- fontSize: 12,
558
- fontFamily: _sharedUi.monoFont,
559
- marginTop: 8
560
- },
561
- header: {
562
- flexDirection: "column",
563
- padding: 8,
564
- borderBottomWidth: 1,
565
- borderBottomColor: _sharedUi.night.color.border,
566
- gap: 12,
567
- marginBottom: 8
568
- },
569
- actionsRow: {
570
- flexDirection: "row",
571
- alignItems: "center",
572
- justifyContent: "flex-end",
573
- gap: 12,
574
- paddingBottom: 4
575
- },
576
- actionWrapper: {
577
- alignItems: "center",
578
- justifyContent: "center",
579
- gap: 4,
580
- minWidth: 48
581
- },
582
- actionButtonHeader: {
583
- padding: 6,
584
- borderRadius: 4,
585
- backgroundColor: _sharedUi.night.color.surfaceElevated
586
- },
587
- iconButton: {
588
- padding: 6,
589
- borderRadius: 4,
590
- alignItems: "center",
591
- justifyContent: "center"
592
- },
593
- actionLabel: {
594
- fontSize: 8,
595
- color: _sharedUi.night.color.textTertiary,
596
- fontFamily: _sharedUi.monoFont,
597
- textTransform: "uppercase",
598
- letterSpacing: 0.5
599
- },
600
- refreshButtonDisabled: {
601
- opacity: 0.5
602
- },
603
- statsGrid: {
604
- flexDirection: "row",
605
- flexWrap: "wrap",
606
- gap: 8
607
- },
608
- statItem: {
609
- flexGrow: 1,
610
- flexShrink: 1,
611
- flexBasis: "20%",
612
- minWidth: 70,
613
- backgroundColor: _sharedUi.night.color.surface,
614
- borderRadius: 8,
615
- paddingVertical: 10,
616
- paddingHorizontal: 12,
617
- alignItems: "center"
618
- },
619
- statValue: {
620
- fontSize: 18,
621
- fontWeight: "800",
622
- color: _sharedUi.night.color.text,
623
- fontFamily: _sharedUi.monoFont
624
- },
625
- statLabel: {
626
- fontSize: 10,
627
- color: _sharedUi.night.color.textTertiary,
628
- marginTop: 4,
629
- fontFamily: _sharedUi.monoFont,
630
- textTransform: "uppercase",
631
- letterSpacing: 0.5
632
- },
633
- searchContainer: {
634
- flexDirection: "row",
635
- alignItems: "center",
636
- padding: 8,
637
- gap: 8,
638
- borderBottomWidth: 1,
639
- borderBottomColor: _sharedUi.night.color.border
640
- },
641
- searchInput: {
642
- flex: 1,
643
- color: _sharedUi.night.color.text,
644
- fontSize: 14,
645
- fontFamily: _sharedUi.monoFont
646
- },
647
- clearButton: {
648
- padding: 4
649
- },
650
- clearButtonText: {
651
- color: _sharedUi.night.color.textTertiary,
652
- fontSize: 18
653
- },
654
- closeSearchButton: {
655
- paddingHorizontal: 8,
656
- paddingVertical: 4
657
- },
658
- closeSearchText: {
659
- color: _sharedUi.night.color.accent,
660
- fontSize: 14,
661
- fontWeight: "600",
662
- fontFamily: _sharedUi.monoFont
663
- },
664
- scrollView: {
665
- flex: 1
666
- },
667
- scrollContent: {
668
- paddingBottom: 8
669
- },
670
- metaFooter: {
671
- flexDirection: "row",
672
- alignItems: "center",
673
- justifyContent: "space-between",
674
- gap: 8,
675
- paddingHorizontal: 16,
676
- paddingVertical: 16,
677
- marginTop: 16,
678
- borderTopWidth: 1,
679
- borderTopColor: _sharedUi.night.color.border
680
- },
681
- metaText: {
682
- fontSize: 12,
683
- color: _sharedUi.night.color.textSecondary,
684
- fontFamily: _sharedUi.monoFont
685
- },
686
- sourceBadge: {
687
- paddingHorizontal: 8,
688
- paddingVertical: 2,
689
- borderRadius: 999,
690
- borderWidth: 1,
691
- borderColor: _sharedUi.night.color.border,
692
- backgroundColor: _sharedUi.night.color.surface
693
- },
694
- sourceText: {
695
- fontSize: 11,
696
- color: _sharedUi.night.color.textSecondary,
697
- textTransform: "capitalize",
698
- fontFamily: _sharedUi.monoFont
699
- },
700
- groupContainer: {
701
- marginVertical: 4
702
- },
703
- groupHeader: {
704
- flexDirection: "row",
705
- alignItems: "center",
706
- justifyContent: "space-between",
707
- padding: 12,
708
- paddingHorizontal: 16,
709
- backgroundColor: _sharedUi.night.color.surface,
710
- borderLeftWidth: 3,
711
- borderLeftColor: _sharedUi.night.color.fillTertiary
712
- },
713
- groupHeaderLeft: {
714
- flexDirection: "row",
715
- alignItems: "center",
716
- gap: 8,
717
- flex: 1
718
- },
719
- groupTitle: {
720
- fontSize: 12,
721
- fontWeight: "700",
722
- color: _sharedUi.night.color.text,
723
- fontFamily: _sharedUi.monoFont,
724
- textTransform: "uppercase",
725
- letterSpacing: 0.8
726
- },
727
- groupBadge: {
728
- backgroundColor: "#3B82F615",
729
- borderColor: "#3B82F640",
730
- borderWidth: 1,
731
- borderRadius: 12,
732
- paddingHorizontal: 8,
733
- paddingVertical: 3,
734
- minWidth: 24,
735
- alignItems: "center",
736
- justifyContent: "center"
737
- },
738
- groupCount: {
739
- fontSize: 11,
740
- fontWeight: "600",
741
- color: "#3B82F6",
742
- fontFamily: _sharedUi.monoFont
743
- },
744
- screensList: {
745
- // Transparent so the night sheet's star field shows through.
746
- backgroundColor: "transparent"
747
- },
748
- groupDescription: {
749
- paddingHorizontal: 16,
750
- paddingVertical: 8,
751
- marginBottom: 8,
752
- backgroundColor: _sharedUi.night.color.surfaceElevated,
753
- borderLeftWidth: 3,
754
- borderLeftColor: _sharedUi.night.color.fillTertiary
755
- },
756
- groupDescriptionText: {
757
- fontSize: 11,
758
- color: _sharedUi.night.color.textSecondary,
759
- fontFamily: _sharedUi.monoFont,
760
- lineHeight: 16
761
- },
762
- screenItem: {
763
- marginBottom: 6
764
- },
765
- screenCard: {
766
- flexDirection: "row",
767
- alignItems: "center",
768
- justifyContent: "space-between",
769
- paddingVertical: 10,
770
- paddingHorizontal: 12,
771
- backgroundColor: _sharedUi.night.color.surface,
772
- borderRadius: 6,
773
- borderWidth: 1,
774
- borderColor: _sharedUi.night.color.border,
775
- shadowColor: "#000",
776
- shadowOffset: {
777
- width: 0,
778
- height: 1
779
- },
780
- shadowOpacity: 0.05,
781
- shadowRadius: 2,
782
- elevation: 1
783
- },
784
- screenHeaderLeft: {
785
- flexDirection: "row",
786
- alignItems: "center",
787
- gap: 8,
788
- flex: 1
789
- },
790
- expandIndicator: {
791
- width: 20,
792
- alignItems: "center"
793
- },
794
- screenName: {
795
- fontSize: 13,
796
- fontWeight: "600",
797
- color: _sharedUi.night.color.text,
798
- fontFamily: _sharedUi.monoFont,
799
- flex: 1
800
- },
801
- screenHeaderActions: {
802
- flexDirection: "row",
803
- alignItems: "center",
804
- gap: 6
805
- },
806
- statusBadge: {
807
- borderRadius: 4,
808
- paddingHorizontal: 6,
809
- paddingVertical: 2,
810
- borderWidth: 1
811
- },
812
- statusText: {
813
- fontSize: 10,
814
- fontWeight: "600",
815
- fontFamily: _sharedUi.monoFont
816
- },
817
- headerActionButton: {
818
- padding: 6,
819
- borderRadius: 4,
820
- backgroundColor: _sharedUi.night.color.surfaceElevated,
821
- borderWidth: 1,
822
- borderColor: _sharedUi.night.color.border,
823
- alignItems: "center",
824
- justifyContent: "center"
825
- },
826
- navigateButton: {
827
- backgroundColor: _sharedUi.night.color.accentSoft,
828
- borderColor: _sharedUi.night.color.accentBorder
829
- },
830
- navigateButtonText: {
831
- fontSize: 12,
832
- color: _sharedUi.night.color.accent,
833
- fontFamily: _sharedUi.monoFont,
834
- fontWeight: "600"
835
- }
836
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReactNavigationRoutes=ReactNavigationRoutes;var _react=require("react");var _reactNative=require("react-native");var _safeReactNavigation=require("../utils/safeReactNavigation");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _jsxRuntime=require("react/jsx-runtime");const CommonActions=(0,_safeReactNavigation.getCommonActions)();function collectNavigatorGroups(e,t="Root"){if(!e)return[];const r=[];const s=e.routeNames||[];const i=new Set((e.routes||[]).map(a=>a.name));const u=e.index??0;const h=e.routes?.[u]?.name;if(s.length>0){const a=s.map(d=>({name:d,isMounted:i.has(d),isFocused:d===h}));r.push({name:t==="Root"?"Root":t.split(" > ").pop(),path:t,screens:a,totalScreens:a.length})}for(const a of e.routes||[]){if(a.state){const d=`${t} > ${a.name}`;const f=collectNavigatorGroups(a.state,d);r.push(...f)}}return r}function findScreenPath(e,t){if(!e||!e.routes)return null;const r=e.routeNames||[];if(r.includes(t)){return[t]}for(const s of e.routes){if(s.state){const i=findScreenPath(s.state,t);if(i){return[s.name,...i]}}}return null}function buildNestedNavigateAction(e){if(e.length===0)return null;if(e.length===1){return CommonActions.navigate({name:e[0]})}let t={screen:e[e.length-1]};for(let r=e.length-2;r>=1;r--){t={screen:e[r],params:t}}return CommonActions.navigate({name:e[0],params:t})}function ReactNavigationRoutes({style:e}){const t=(0,_safeReactNavigation.useSafeNavigationContainerRef)();const[r,s]=(0,_react.useState)(()=>t?.getRootState?.()??null);const[i,u]=(0,_react.useState)("");const[h,a]=(0,_react.useState)(false);const[d,f]=(0,_react.useState)(null);const[x,S]=(0,_react.useState)(false);const[m,y]=(0,_react.useState)(false);const p=(0,_license.useIsPro)();(0,_react.useEffect)(()=>{if(m&&p){y(false)}},[m,p]);(0,_react.useEffect)(()=>{if(!t)return;const o=t.getRootState?.();if(o){s(o)}const n=t.addListener?.("state",()=>{const l=t.getRootState?.();if(l){s(l)}});return()=>{n?.()}},[t]);const c=(0,_react.useMemo)(()=>collectNavigatorGroups(r),[r]);(0,_react.useEffect)(()=>{if(c.length>0&&d===null){f(c[0].path)}},[c.length]);const b=(0,_react.useMemo)(()=>{const o=[];for(const n of c){for(const l of n.screens){o.push({name:l.name,navigatorPath:n.path,isMounted:l.isMounted,isFocused:l.isFocused})}}return o},[c]);const j=(0,_react.useMemo)(()=>{if(!i.trim())return c;const o=i.toLowerCase();return c.map(n=>({...n,screens:n.screens.filter(l=>l.name.toLowerCase().includes(o))})).filter(n=>n.screens.length>0)},[c,i]);const g=(0,_react.useMemo)(()=>{const o=b.length;const n=b.filter(B=>B.isMounted).length;const l=o-n;const F=c.length;return{total:o,mounted:n,available:l,navigators:F}},[b,c]);const T=(0,_react.useMemo)(()=>{return{summary:{totalScreens:g.total,mounted:g.mounted,available:g.available,navigators:g.navigators,timestamp:new Date().toISOString()},navigators:c.map(o=>({path:o.path,screens:o.screens.map(n=>({name:n.name,isMounted:n.isMounted,isFocused:n.isFocused}))}))}},[c,g]);const C=(0,_react.useCallback)(o=>{f(n=>n===o?null:o)},[]);const v=(0,_react.useCallback)(o=>{if(!p){y(true);return}if(!t||!r)return;try{const n=findScreenPath(r,o);if(n){const l=buildNestedNavigateAction(n);if(l){t.dispatch(l);return}}t.dispatch(CommonActions.navigate({name:o}))}catch(n){_reactNative.Alert.alert("Navigation Error",String(n))}},[t,r,p]);const w=(0,_react.useCallback)(()=>{if(x||!t)return;S(true);const o=t.getRootState?.();if(o){s(o)}setTimeout(()=>S(false),400)},[x,t]);if(!r){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.container,e],children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No navigation state available"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptySubtext,children:"Ensure you are inside a NavigationContainer"})]})})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.container,e],children:[h&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.searchContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:16,color:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.searchInput,placeholder:"Search screens...",placeholderTextColor:_sharedUi.night.color.placeholder,value:i,onChangeText:u,autoCapitalize:"none",autoCorrect:false,autoFocus:true}),i.length>0&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>u(""),style:styles.clearButton,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.clearButtonText,children:"\u2715"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.closeSearchButton,onPress:()=>{a(false);u("")},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.closeSearchText,children:"Done"})})]}),(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.scrollView,contentContainerStyle:styles.scrollContent,children:[!h&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionsRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionWrapper,children:[(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:T,buttonStyle:styles.actionButtonHeader}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionLabel,children:"Copy"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionWrapper,children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.iconButton,x&&styles.refreshButtonDisabled],onPress:w,disabled:x,children:(0,_jsxRuntime.jsx)(_sharedUi.RefreshCw,{size:16,color:x?_sharedUi.night.color.textTertiary:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionLabel,children:"Refresh"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionWrapper,children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.iconButton,onPress:()=>a(true),children:(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:16,color:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionLabel,children:"Search"})]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.statsGrid,children:[(0,_jsxRuntime.jsx)(StatItem,{value:g.total,label:"Screens"}),(0,_jsxRuntime.jsx)(StatItem,{value:g.mounted,label:"Mounted"}),(0,_jsxRuntime.jsx)(StatItem,{value:g.available,label:"Available"}),(0,_jsxRuntime.jsx)(StatItem,{value:g.navigators,label:"Navigators"})]})]}),j.length===0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.emptyState,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:i?"No matching screens":"No screens found"})}):j.map(o=>(0,_jsxRuntime.jsx)(NavigatorGroupView,{group:o,isExpanded:i.length>0||d===o.path,onToggleExpand:()=>C(o.path),onNavigate:v},o.path)),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.metaFooter,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.metaText,children:"Source: navigation state"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sourceBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sourceText,children:"React Navigation"})})]})]}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:m,onClose:()=>y(false),featureName:"Route Navigation"})]})}function StatItem({value:e,label:t}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.statItem,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statValue,children:e}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statLabel,children:t})]})}function NavigatorGroupView({group:e,isExpanded:t,onToggleExpand:r,onNavigate:s}){const[i,u]=(0,_react.useState)(null);const h=(0,_react.useCallback)(a=>{u(d=>d===a?null:a)},[]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.groupContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.groupHeader,onPress:r,activeOpacity:.7,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.groupHeaderLeft,children:[t?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:14,color:_sharedUi.night.color.textSecondary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:14,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.groupTitle,numberOfLines:1,children:e.name})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.groupBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.groupCount,children:e.screens.length})})]}),t&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.screensList,children:[e.path!=="Root"&&e.path.includes(" > ")&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.groupDescription,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.groupDescriptionText,children:e.path})}),e.screens.map(a=>(0,_jsxRuntime.jsx)(ScreenItemView,{screen:a,isExpanded:i===a.name,onToggleExpand:()=>h(a.name),onNavigate:s},a.name))]})]})}function ScreenItemView({screen:e,isExpanded:t,onToggleExpand:r,onNavigate:s}){const i=e.isFocused?_sharedUi.buoyColors.success:e.isMounted?"#3B82F6":_sharedUi.night.color.textTertiary;const u=e.isFocused?"FOCUSED":e.isMounted?"MOUNTED":"AVAILABLE";return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.screenItem,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.screenCard,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.screenHeaderLeft,onPress:r,activeOpacity:.7,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.expandIndicator,children:t?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:14,color:_sharedUi.night.color.textSecondary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:14,color:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.screenName,numberOfLines:1,children:e.name})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.screenHeaderActions,children:[(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:e.name,buttonStyle:styles.headerActionButton}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.headerActionButton,styles.navigateButton],onPress:()=>s(e.name),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.navigateButtonText,children:"Go"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusBadge,{backgroundColor:`${i}15`,borderColor:`${i}40`}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusText,{color:i}],children:u})})]})]})})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},emptyState:{padding:32,alignItems:"center"},emptyText:{color:_sharedUi.night.color.textSecondary,fontSize:14,fontFamily:_sharedUi.monoFont},emptySubtext:{color:_sharedUi.night.color.textTertiary,fontSize:12,fontFamily:_sharedUi.monoFont,marginTop:8},header:{flexDirection:"column",padding:8,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border,gap:12,marginBottom:8},actionsRow:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:12,paddingBottom:4},actionWrapper:{alignItems:"center",justifyContent:"center",gap:4,minWidth:48},actionButtonHeader:{padding:6,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},iconButton:{padding:6,borderRadius:4,alignItems:"center",justifyContent:"center"},actionLabel:{fontSize:8,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont,textTransform:"uppercase",letterSpacing:.5},refreshButtonDisabled:{opacity:.5},statsGrid:{flexDirection:"row",flexWrap:"wrap",gap:8},statItem:{flexGrow:1,flexShrink:1,flexBasis:"20%",minWidth:70,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,paddingVertical:10,paddingHorizontal:12,alignItems:"center"},statValue:{fontSize:18,fontWeight:"800",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},statLabel:{fontSize:10,color:_sharedUi.night.color.textTertiary,marginTop:4,fontFamily:_sharedUi.monoFont,textTransform:"uppercase",letterSpacing:.5},searchContainer:{flexDirection:"row",alignItems:"center",padding:8,gap:8,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},searchInput:{flex:1,color:_sharedUi.night.color.text,fontSize:14,fontFamily:_sharedUi.monoFont},clearButton:{padding:4},clearButtonText:{color:_sharedUi.night.color.textTertiary,fontSize:18},closeSearchButton:{paddingHorizontal:8,paddingVertical:4},closeSearchText:{color:_sharedUi.night.color.accent,fontSize:14,fontWeight:"600",fontFamily:_sharedUi.monoFont},scrollView:{flex:1},scrollContent:{paddingBottom:8},metaFooter:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:16,paddingVertical:16,marginTop:16,borderTopWidth:1,borderTopColor:_sharedUi.night.color.border},metaText:{fontSize:12,color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont},sourceBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface},sourceText:{fontSize:11,color:_sharedUi.night.color.textSecondary,textTransform:"capitalize",fontFamily:_sharedUi.monoFont},groupContainer:{marginVertical:4},groupHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,paddingHorizontal:16,backgroundColor:_sharedUi.night.color.surface,borderLeftWidth:3,borderLeftColor:_sharedUi.night.color.fillTertiary},groupHeaderLeft:{flexDirection:"row",alignItems:"center",gap:8,flex:1},groupTitle:{fontSize:12,fontWeight:"700",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,textTransform:"uppercase",letterSpacing:.8},groupBadge:{backgroundColor:"#3B82F615",borderColor:"#3B82F640",borderWidth:1,borderRadius:12,paddingHorizontal:8,paddingVertical:3,minWidth:24,alignItems:"center",justifyContent:"center"},groupCount:{fontSize:11,fontWeight:"600",color:"#3B82F6",fontFamily:_sharedUi.monoFont},screensList:{backgroundColor:"transparent"},groupDescription:{paddingHorizontal:16,paddingVertical:8,marginBottom:8,backgroundColor:_sharedUi.night.color.surfaceElevated,borderLeftWidth:3,borderLeftColor:_sharedUi.night.color.fillTertiary},groupDescriptionText:{fontSize:11,color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont,lineHeight:16},screenItem:{marginBottom:6},screenCard:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.border,shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:2,elevation:1},screenHeaderLeft:{flexDirection:"row",alignItems:"center",gap:8,flex:1},expandIndicator:{width:20,alignItems:"center"},screenName:{fontSize:13,fontWeight:"600",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,flex:1},screenHeaderActions:{flexDirection:"row",alignItems:"center",gap:6},statusBadge:{borderRadius:4,paddingHorizontal:6,paddingVertical:2,borderWidth:1},statusText:{fontSize:10,fontWeight:"600",fontFamily:_sharedUi.monoFont},headerActionButton:{padding:6,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated,borderWidth:1,borderColor:_sharedUi.night.color.border,alignItems:"center",justifyContent:"center"},navigateButton:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorder},navigateButtonText:{fontSize:12,color:_sharedUi.night.color.accent,fontFamily:_sharedUi.monoFont,fontWeight:"600"}});