@buoy-gg/route-events 6.0.1 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ReactNavigationRoutes.js +11 -6
- package/lib/commonjs/components/RouteEventsModalWithTabs.js +10 -6
- package/lib/commonjs/useNavigationStack.js +14 -8
- package/lib/commonjs/useRouteObserverReactNavigation.js +6 -2
- package/lib/commonjs/utils/safeReactNavigation.js +34 -0
- package/lib/module/components/ReactNavigationRoutes.js +7 -2
- package/lib/module/components/RouteEventsModalWithTabs.js +7 -2
- package/lib/module/useNavigationStack.js +8 -2
- package/lib/module/useRouteObserverReactNavigation.js +5 -1
- package/lib/module/utils/safeReactNavigation.js +32 -1
- package/lib/typescript/components/ReactNavigationRoutes.d.ts.map +1 -1
- package/lib/typescript/components/RouteEventsModalWithTabs.d.ts.map +1 -1
- package/lib/typescript/useNavigationStack.d.ts.map +1 -1
- package/lib/typescript/useRouteObserverReactNavigation.d.ts.map +1 -1
- package/lib/typescript/utils/safeReactNavigation.d.ts +11 -0
- package/lib/typescript/utils/safeReactNavigation.d.ts.map +1 -1
- package/package.json +22 -7
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ReactNavigationRoutes = ReactNavigationRoutes;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
10
|
-
var _core = require("@react-navigation/core");
|
|
9
|
+
var _safeReactNavigation = require("../utils/safeReactNavigation");
|
|
11
10
|
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
12
11
|
var _license = require("@buoy-gg/license");
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -21,6 +20,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
20
|
* Provides navigation to any discovered screen using nested screen/params actions.
|
|
22
21
|
*/
|
|
23
22
|
|
|
23
|
+
// Resolved once at module load; null when @react-navigation/native is absent
|
|
24
|
+
// (the fallback context then yields an undefined containerRef, so the
|
|
25
|
+
// dispatch paths below never execute).
|
|
26
|
+
const CommonActions = (0, _safeReactNavigation.getCommonActions)();
|
|
27
|
+
const NavigationContainerRefContext = (0, _safeReactNavigation.getNavigationContainerRefContext)();
|
|
28
|
+
|
|
24
29
|
// ============================================================================
|
|
25
30
|
// Types
|
|
26
31
|
// ============================================================================
|
|
@@ -94,7 +99,7 @@ function findScreenPath(state, screenName) {
|
|
|
94
99
|
function buildNestedNavigateAction(path) {
|
|
95
100
|
if (path.length === 0) return null;
|
|
96
101
|
if (path.length === 1) {
|
|
97
|
-
return
|
|
102
|
+
return CommonActions.navigate({
|
|
98
103
|
name: path[0]
|
|
99
104
|
});
|
|
100
105
|
}
|
|
@@ -107,7 +112,7 @@ function buildNestedNavigateAction(path) {
|
|
|
107
112
|
params
|
|
108
113
|
};
|
|
109
114
|
}
|
|
110
|
-
return
|
|
115
|
+
return CommonActions.navigate({
|
|
111
116
|
name: path[0],
|
|
112
117
|
params
|
|
113
118
|
});
|
|
@@ -120,7 +125,7 @@ function buildNestedNavigateAction(path) {
|
|
|
120
125
|
function ReactNavigationRoutes({
|
|
121
126
|
style
|
|
122
127
|
}) {
|
|
123
|
-
const containerRef = (0, _react.useContext)(
|
|
128
|
+
const containerRef = (0, _react.useContext)(NavigationContainerRefContext);
|
|
124
129
|
const [navigationState, setNavigationState] = (0, _react.useState)(() => containerRef?.getRootState?.() ?? null);
|
|
125
130
|
const [searchQuery, setSearchQuery] = (0, _react.useState)("");
|
|
126
131
|
const [isSearching, setIsSearching] = (0, _react.useState)(false);
|
|
@@ -241,7 +246,7 @@ function ReactNavigationRoutes({
|
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
// Fallback
|
|
244
|
-
containerRef.dispatch(
|
|
249
|
+
containerRef.dispatch(CommonActions.navigate({
|
|
245
250
|
name: screenName
|
|
246
251
|
}));
|
|
247
252
|
} catch (error) {
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RouteEventsModalWithTabs = RouteEventsModalWithTabs;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
10
|
-
var _core = require("@react-navigation/core");
|
|
9
|
+
var _safeReactNavigation = require("../utils/safeReactNavigation");
|
|
11
10
|
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
12
11
|
var _license = require("@buoy-gg/license");
|
|
13
12
|
var _useRouteEvents = require("../hooks/useRouteEvents");
|
|
@@ -17,6 +16,11 @@ var _ReactNavigationRoutes = require("./ReactNavigationRoutes");
|
|
|
17
16
|
var _NavigationStack = require("./NavigationStack");
|
|
18
17
|
var _RouteEventsTimeline = require("./RouteEventsTimeline");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
// Resolved once at module load; null when @react-navigation/native is absent
|
|
20
|
+
// (the fallback context then yields an undefined containerRef, so the
|
|
21
|
+
// dispatch paths below never execute).
|
|
22
|
+
const CommonActions = (0, _safeReactNavigation.getCommonActions)();
|
|
23
|
+
const NavigationContainerRefContext = (0, _safeReactNavigation.getNavigationContainerRefContext)();
|
|
20
24
|
// Free tier limit for route events
|
|
21
25
|
const FREE_TIER_EVENT_LIMIT = 3;
|
|
22
26
|
/**
|
|
@@ -47,7 +51,7 @@ function findScreenPath(state, screenName) {
|
|
|
47
51
|
function buildNestedNavigateAction(path) {
|
|
48
52
|
if (path.length === 0) return null;
|
|
49
53
|
if (path.length === 1) {
|
|
50
|
-
return
|
|
54
|
+
return CommonActions.navigate({
|
|
51
55
|
name: path[0]
|
|
52
56
|
});
|
|
53
57
|
}
|
|
@@ -62,7 +66,7 @@ function buildNestedNavigateAction(path) {
|
|
|
62
66
|
params
|
|
63
67
|
};
|
|
64
68
|
}
|
|
65
|
-
return
|
|
69
|
+
return CommonActions.navigate({
|
|
66
70
|
name: path[0],
|
|
67
71
|
params
|
|
68
72
|
});
|
|
@@ -75,7 +79,7 @@ function RouteEventsModalWithTabs({
|
|
|
75
79
|
enableSharedModalDimensions = false
|
|
76
80
|
}) {
|
|
77
81
|
const router = (0, _sharedUi.useSafeRouter)();
|
|
78
|
-
const containerRef = (0, _react.useContext)(
|
|
82
|
+
const containerRef = (0, _react.useContext)(NavigationContainerRefContext);
|
|
79
83
|
const hasExpoRouter = (0, _sharedUi.isExpoRouterAvailable)();
|
|
80
84
|
const [activeTab, setActiveTab] = (0, _react.useState)("events");
|
|
81
85
|
const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
|
|
@@ -144,7 +148,7 @@ function RouteEventsModalWithTabs({
|
|
|
144
148
|
}
|
|
145
149
|
|
|
146
150
|
// Fallback: try direct navigation (works for top-level screens)
|
|
147
|
-
containerRef.dispatch(
|
|
151
|
+
containerRef.dispatch(CommonActions.navigate({
|
|
148
152
|
name: screenName
|
|
149
153
|
}));
|
|
150
154
|
}
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useNavigationStack = useNavigationStack;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
9
|
-
var _core = require("@react-navigation/core");
|
|
8
|
+
var _safeReactNavigation = require("./utils/safeReactNavigation");
|
|
10
9
|
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
10
|
/**
|
|
12
11
|
* useNavigationStack - Hook to access current navigation stack state
|
|
@@ -20,6 +19,13 @@ var _sharedUi = require("@buoy-gg/shared-ui");
|
|
|
20
19
|
* - RN CLI: uses NavigationContainerRefContext (works as sibling of navigators)
|
|
21
20
|
*/
|
|
22
21
|
|
|
22
|
+
// Resolved once at module load; null when @react-navigation/native is absent
|
|
23
|
+
// (the fallback context then yields an undefined containerRef, so the
|
|
24
|
+
// dispatch paths below never execute).
|
|
25
|
+
const CommonActions = (0, _safeReactNavigation.getCommonActions)();
|
|
26
|
+
const StackActions = (0, _safeReactNavigation.getStackActions)();
|
|
27
|
+
const NavigationContainerRefContext = (0, _safeReactNavigation.getNavigationContainerRefContext)();
|
|
28
|
+
|
|
23
29
|
// ============================================================================
|
|
24
30
|
// Type Definitions
|
|
25
31
|
// ============================================================================
|
|
@@ -56,7 +62,7 @@ function findScreenPath(state, screenName) {
|
|
|
56
62
|
function buildNestedNavigateAction(path) {
|
|
57
63
|
if (path.length === 0) return null;
|
|
58
64
|
if (path.length === 1) {
|
|
59
|
-
return
|
|
65
|
+
return CommonActions.navigate({
|
|
60
66
|
name: path[0]
|
|
61
67
|
});
|
|
62
68
|
}
|
|
@@ -69,7 +75,7 @@ function buildNestedNavigateAction(path) {
|
|
|
69
75
|
params
|
|
70
76
|
};
|
|
71
77
|
}
|
|
72
|
-
return
|
|
78
|
+
return CommonActions.navigate({
|
|
73
79
|
name: path[0],
|
|
74
80
|
params
|
|
75
81
|
});
|
|
@@ -196,7 +202,7 @@ function buildStack(navigationState, isExpo) {
|
|
|
196
202
|
*/
|
|
197
203
|
function useNavigationStack() {
|
|
198
204
|
const isExpo = (0, _sharedUi.isExpoRouterAvailable)();
|
|
199
|
-
const containerRef = (0, _react.useContext)(
|
|
205
|
+
const containerRef = (0, _react.useContext)(NavigationContainerRefContext);
|
|
200
206
|
const [navigationState, setNavigationState] = (0, _react.useState)(() => containerRef?.getRootState?.() ?? null);
|
|
201
207
|
const [isLoaded, setIsLoaded] = (0, _react.useState)(false);
|
|
202
208
|
const [error, setError] = (0, _react.useState)(null);
|
|
@@ -268,7 +274,7 @@ function useNavigationStack() {
|
|
|
268
274
|
}
|
|
269
275
|
}
|
|
270
276
|
// Fallback: try direct navigation
|
|
271
|
-
containerRef.dispatch(
|
|
277
|
+
containerRef.dispatch(CommonActions.navigate({
|
|
272
278
|
name: targetRoute.name,
|
|
273
279
|
params: targetRoute.params
|
|
274
280
|
}));
|
|
@@ -289,7 +295,7 @@ function useNavigationStack() {
|
|
|
289
295
|
expoRouter.back();
|
|
290
296
|
}
|
|
291
297
|
} else if (containerRef) {
|
|
292
|
-
containerRef.dispatch(
|
|
298
|
+
containerRef.dispatch(StackActions.pop(popCount));
|
|
293
299
|
}
|
|
294
300
|
} catch (err) {
|
|
295
301
|
console.error("Failed to pop:", err);
|
|
@@ -316,7 +322,7 @@ function useNavigationStack() {
|
|
|
316
322
|
// Pop to index 0 via expo-router
|
|
317
323
|
popToIndex(0);
|
|
318
324
|
} else if (containerRef) {
|
|
319
|
-
containerRef.dispatch(
|
|
325
|
+
containerRef.dispatch(StackActions.popToTop());
|
|
320
326
|
}
|
|
321
327
|
} catch (err) {
|
|
322
328
|
console.error("Failed to pop to top:", err);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useRouteObserverReactNavigation = useRouteObserverReactNavigation;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _safeReactNavigation = require("./utils/safeReactNavigation");
|
|
9
9
|
var _RouteObserver = require("./RouteObserver");
|
|
10
10
|
/**
|
|
11
11
|
* useRouteObserverReactNavigation - React hook for observing route changes
|
|
@@ -18,6 +18,10 @@ var _RouteObserver = require("./RouteObserver");
|
|
|
18
18
|
* a NavigationContainer — does NOT need to be inside a navigator.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
// Resolved once at module load; falls back to an always-undefined context
|
|
22
|
+
// when @react-navigation/native is absent, so the effect below no-ops.
|
|
23
|
+
const NavigationContainerRefContext = (0, _safeReactNavigation.getNavigationContainerRefContext)();
|
|
24
|
+
|
|
21
25
|
/**
|
|
22
26
|
* Walk a React Navigation state tree to find the deepest focused route.
|
|
23
27
|
* Returns the route object and the array of route names from root to leaf.
|
|
@@ -81,7 +85,7 @@ function emitRouteEvent(state, previousPathnameRef, previousTimestampRef, callba
|
|
|
81
85
|
* Works anywhere inside a NavigationContainer (does not need to be inside a navigator).
|
|
82
86
|
*/
|
|
83
87
|
function useRouteObserverReactNavigation(callback) {
|
|
84
|
-
const containerRef = (0, _react.useContext)(
|
|
88
|
+
const containerRef = (0, _react.useContext)(NavigationContainerRefContext);
|
|
85
89
|
const callbackRef = (0, _react.useRef)(callback);
|
|
86
90
|
const previousPathnameRef = (0, _react.useRef)(undefined);
|
|
87
91
|
const previousTimestampRef = (0, _react.useRef)(undefined);
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getCommonActions = getCommonActions;
|
|
7
|
+
exports.getNavigationContainerRefContext = getNavigationContainerRefContext;
|
|
8
|
+
exports.getStackActions = getStackActions;
|
|
6
9
|
exports.isReactNavigationAvailable = isReactNavigationAvailable;
|
|
7
10
|
exports.useSafeNavigation = useSafeNavigation;
|
|
8
11
|
exports.useSafeNavigationState = useSafeNavigationState;
|
|
@@ -95,6 +98,37 @@ function useSafeNavigationState(selector) {
|
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
|
|
101
|
+
// ============================================================================
|
|
102
|
+
// Guarded module accessors
|
|
103
|
+
// ============================================================================
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Fallback for useContext when @react-navigation/native is absent: a stable
|
|
107
|
+
* context that always yields undefined, so callers' `if (!containerRef)`
|
|
108
|
+
* guards skip every dispatch path. Module presence is constant for the app
|
|
109
|
+
* lifetime, so hook order stays stable either way.
|
|
110
|
+
*/
|
|
111
|
+
const FallbackNavigationContainerRefContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
112
|
+
|
|
113
|
+
/** CommonActions from @react-navigation/native, or null when absent. */
|
|
114
|
+
function getCommonActions() {
|
|
115
|
+
return checkReactNavigationAvailability() ? reactNavigation.CommonActions : null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** StackActions from @react-navigation/native, or null when absent. */
|
|
119
|
+
function getStackActions() {
|
|
120
|
+
return checkReactNavigationAvailability() ? reactNavigation.StackActions : null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* NavigationContainerRefContext, read via @react-navigation/native's
|
|
125
|
+
* re-export (never from @react-navigation/core directly — core is not a
|
|
126
|
+
* declared dependency). Falls back to an always-undefined context.
|
|
127
|
+
*/
|
|
128
|
+
function getNavigationContainerRefContext() {
|
|
129
|
+
return checkReactNavigationAvailability() && reactNavigation.NavigationContainerRefContext ? reactNavigation.NavigationContainerRefContext : FallbackNavigationContainerRefContext;
|
|
130
|
+
}
|
|
131
|
+
|
|
98
132
|
// ============================================================================
|
|
99
133
|
// Availability check
|
|
100
134
|
// ============================================================================
|
|
@@ -12,8 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
import { useState, useCallback, useMemo, useEffect, useContext } from "react";
|
|
14
14
|
import { View, Text, TextInput, TouchableOpacity, ScrollView, StyleSheet, Alert } from "react-native";
|
|
15
|
-
import {
|
|
16
|
-
|
|
15
|
+
import { getCommonActions, getNavigationContainerRefContext } from "../utils/safeReactNavigation";
|
|
16
|
+
|
|
17
|
+
// Resolved once at module load; null when @react-navigation/native is absent
|
|
18
|
+
// (the fallback context then yields an undefined containerRef, so the
|
|
19
|
+
// dispatch paths below never execute).
|
|
20
|
+
const CommonActions = getCommonActions();
|
|
21
|
+
const NavigationContainerRefContext = getNavigationContainerRefContext();
|
|
17
22
|
import { Search, ChevronDown, ChevronRight, InlineCopyButton, ToolbarCopyButton, RefreshCw, ProUpgradeModal, buoyColors } from "@buoy-gg/shared-ui";
|
|
18
23
|
import { useIsPro } from "@buoy-gg/license";
|
|
19
24
|
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState, useCallback, useContext, useEffect, useRef, useMemo } from "react";
|
|
4
4
|
import { Text, View, TouchableOpacity, StyleSheet, Alert } from "react-native";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { getCommonActions, getNavigationContainerRefContext } from "../utils/safeReactNavigation";
|
|
6
|
+
|
|
7
|
+
// Resolved once at module load; null when @react-navigation/native is absent
|
|
8
|
+
// (the fallback context then yields an undefined containerRef, so the
|
|
9
|
+
// dispatch paths below never execute).
|
|
10
|
+
const CommonActions = getCommonActions();
|
|
11
|
+
const NavigationContainerRefContext = getNavigationContainerRefContext();
|
|
7
12
|
import { useSafeRouter, isExpoRouterAvailable } from "@buoy-gg/shared-ui";
|
|
8
13
|
import { JsModal, ModalHeader, TabSelector, formatRelativeTime, devToolsStorageKeys, Navigation, Trash2, Filter, SearchBar, persistentStorage, ToolbarCopyButton, Lock, ProUpgradeModal, PowerToggleButton, buoyColors, TickProvider } from "@buoy-gg/shared-ui";
|
|
9
14
|
import { useIsPro } from "@buoy-gg/license";
|
|
@@ -13,10 +13,16 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { useState, useContext, useEffect, useMemo, useCallback } from "react";
|
|
16
|
-
import {
|
|
17
|
-
import { NavigationContainerRefContext } from "@react-navigation/core";
|
|
16
|
+
import { getCommonActions, getStackActions, getNavigationContainerRefContext } from "./utils/safeReactNavigation";
|
|
18
17
|
import { getSafeRouter, isExpoRouterAvailable } from "@buoy-gg/shared-ui";
|
|
19
18
|
|
|
19
|
+
// Resolved once at module load; null when @react-navigation/native is absent
|
|
20
|
+
// (the fallback context then yields an undefined containerRef, so the
|
|
21
|
+
// dispatch paths below never execute).
|
|
22
|
+
const CommonActions = getCommonActions();
|
|
23
|
+
const StackActions = getStackActions();
|
|
24
|
+
const NavigationContainerRefContext = getNavigationContainerRefContext();
|
|
25
|
+
|
|
20
26
|
// ============================================================================
|
|
21
27
|
// Type Definitions
|
|
22
28
|
// ============================================================================
|
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { useContext, useEffect, useRef } from "react";
|
|
15
|
-
import {
|
|
15
|
+
import { getNavigationContainerRefContext } from "./utils/safeReactNavigation";
|
|
16
16
|
import { routeObserver } from "./RouteObserver";
|
|
17
17
|
|
|
18
|
+
// Resolved once at module load; falls back to an always-undefined context
|
|
19
|
+
// when @react-navigation/native is absent, so the effect below no-ops.
|
|
20
|
+
const NavigationContainerRefContext = getNavigationContainerRefContext();
|
|
21
|
+
|
|
18
22
|
/**
|
|
19
23
|
* Walk a React Navigation state tree to find the deepest focused route.
|
|
20
24
|
* Returns the route object and the array of route names from root to leaf.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Falls back to no-op implementations when @react-navigation/native is not installed.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { useMemo } from "react";
|
|
10
|
+
import { createContext, useMemo } from "react";
|
|
11
11
|
let reactNavigation = null;
|
|
12
12
|
let isAvailable = false;
|
|
13
13
|
let checkedAvailability = false;
|
|
@@ -89,6 +89,37 @@ export function useSafeNavigationState(selector) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// Guarded module accessors
|
|
94
|
+
// ============================================================================
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Fallback for useContext when @react-navigation/native is absent: a stable
|
|
98
|
+
* context that always yields undefined, so callers' `if (!containerRef)`
|
|
99
|
+
* guards skip every dispatch path. Module presence is constant for the app
|
|
100
|
+
* lifetime, so hook order stays stable either way.
|
|
101
|
+
*/
|
|
102
|
+
const FallbackNavigationContainerRefContext = /*#__PURE__*/createContext(undefined);
|
|
103
|
+
|
|
104
|
+
/** CommonActions from @react-navigation/native, or null when absent. */
|
|
105
|
+
export function getCommonActions() {
|
|
106
|
+
return checkReactNavigationAvailability() ? reactNavigation.CommonActions : null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** StackActions from @react-navigation/native, or null when absent. */
|
|
110
|
+
export function getStackActions() {
|
|
111
|
+
return checkReactNavigationAvailability() ? reactNavigation.StackActions : null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* NavigationContainerRefContext, read via @react-navigation/native's
|
|
116
|
+
* re-export (never from @react-navigation/core directly — core is not a
|
|
117
|
+
* declared dependency). Falls back to an always-undefined context.
|
|
118
|
+
*/
|
|
119
|
+
export function getNavigationContainerRefContext() {
|
|
120
|
+
return checkReactNavigationAvailability() && reactNavigation.NavigationContainerRefContext ? reactNavigation.NavigationContainerRefContext : FallbackNavigationContainerRefContext;
|
|
121
|
+
}
|
|
122
|
+
|
|
92
123
|
// ============================================================================
|
|
93
124
|
// Availability check
|
|
94
125
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNavigationRoutes.d.ts","sourceRoot":"","sources":["../../../src/components/ReactNavigationRoutes.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"ReactNavigationRoutes.d.ts","sourceRoot":"","sources":["../../../src/components/ReactNavigationRoutes.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAsCH,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAkHD,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,+BAmS1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteEventsModalWithTabs.d.ts","sourceRoot":"","sources":["../../../src/components/RouteEventsModalWithTabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RouteEventsModalWithTabs.d.ts","sourceRoot":"","sources":["../../../src/components/RouteEventsModalWithTabs.tsx"],"names":[],"mappings":"AA6DA,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AA8CD,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,GACpC,EAAE,6BAA6B,sCA8iB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationStack.d.ts","sourceRoot":"","sources":["../../src/useNavigationStack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"useNavigationStack.d.ts","sourceRoot":"","sources":["../../src/useNavigationStack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA6BH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IAEvC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAGlB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAGpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAuKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CAqK7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouteObserverReactNavigation.d.ts","sourceRoot":"","sources":["../../src/useRouteObserverReactNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useRouteObserverReactNavigation.d.ts","sourceRoot":"","sources":["../../src/useRouteObserverReactNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA4EvE;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,QAmC7C"}
|
|
@@ -4,7 +4,18 @@
|
|
|
4
4
|
* Provides optional imports for React Navigation hooks.
|
|
5
5
|
* Falls back to no-op implementations when @react-navigation/native is not installed.
|
|
6
6
|
*/
|
|
7
|
+
import { type Context } from "react";
|
|
7
8
|
export declare function useSafeNavigation(): any;
|
|
8
9
|
export declare function useSafeNavigationState(selector: (state: any) => any): any;
|
|
10
|
+
/** CommonActions from @react-navigation/native, or null when absent. */
|
|
11
|
+
export declare function getCommonActions(): any;
|
|
12
|
+
/** StackActions from @react-navigation/native, or null when absent. */
|
|
13
|
+
export declare function getStackActions(): any;
|
|
14
|
+
/**
|
|
15
|
+
* NavigationContainerRefContext, read via @react-navigation/native's
|
|
16
|
+
* re-export (never from @react-navigation/core directly — core is not a
|
|
17
|
+
* declared dependency). Falls back to an always-undefined context.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNavigationContainerRefContext(): Context<any>;
|
|
9
20
|
export declare function isReactNavigationAvailable(): boolean;
|
|
10
21
|
//# sourceMappingURL=safeReactNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeReactNavigation.d.ts","sourceRoot":"","sources":["../../../src/utils/safeReactNavigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"safeReactNavigation.d.ts","sourceRoot":"","sources":["../../../src/utils/safeReactNavigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA0B,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAyE7D,wBAAgB,iBAAiB,QAWhC;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,OAWnE;AAcD,wEAAwE;AACxE,wBAAgB,gBAAgB,IAAI,GAAG,CAItC;AAED,uEAAuE;AACvE,wBAAgB,eAAe,IAAI,GAAG,CAIrC;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAAC,GAAG,CAAC,CAK/D;AAMD,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/route-events",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Navigation devtool for React Native — live stack, full sitemap, jump to any screen. Expo Router & React Navigation. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@buoy-gg/floating-tools-core": "
|
|
30
|
-
"@buoy-gg/shared-ui": "
|
|
29
|
+
"@buoy-gg/floating-tools-core": "7.0.1",
|
|
30
|
+
"@buoy-gg/shared-ui": "7.0.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@buoy-gg/license": "
|
|
33
|
+
"@buoy-gg/license": "7.0.1",
|
|
34
34
|
"@react-native-async-storage/async-storage": "^2.0.0 || ^3.1.0",
|
|
35
35
|
"@react-navigation/native": "*",
|
|
36
36
|
"expo-router": "*",
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"expo-router": {
|
|
42
42
|
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"@react-navigation/native": {
|
|
45
|
+
"optional": true
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
@@ -49,7 +52,7 @@
|
|
|
49
52
|
"@types/react-native": "^0.73.0",
|
|
50
53
|
"expo-router": "~5.0.7",
|
|
51
54
|
"typescript": "~5.8.3",
|
|
52
|
-
"@buoy-gg/license": "
|
|
55
|
+
"@buoy-gg/license": "7.0.1"
|
|
53
56
|
},
|
|
54
57
|
"react-native-builder-bob": {
|
|
55
58
|
"source": "src",
|
|
@@ -72,17 +75,29 @@
|
|
|
72
75
|
},
|
|
73
76
|
"repository": {
|
|
74
77
|
"type": "git",
|
|
75
|
-
"url": "https://github.com/
|
|
78
|
+
"url": "https://github.com/Buoy-gg/buoy.git",
|
|
76
79
|
"directory": "packages/route-events"
|
|
77
80
|
},
|
|
78
81
|
"bugs": {
|
|
79
82
|
"url": "https://github.com/LovesWorking/react-native-buoy/issues"
|
|
80
83
|
},
|
|
81
|
-
"homepage": "https://
|
|
84
|
+
"homepage": "https://buoy.gg/tools/routes",
|
|
82
85
|
"publishConfig": {
|
|
83
86
|
"access": "public",
|
|
84
87
|
"tag": "latest"
|
|
85
88
|
},
|
|
89
|
+
"keywords": [
|
|
90
|
+
"react-native",
|
|
91
|
+
"expo",
|
|
92
|
+
"devtools",
|
|
93
|
+
"debugging",
|
|
94
|
+
"react-native-devtools",
|
|
95
|
+
"flipper-alternative",
|
|
96
|
+
"navigation",
|
|
97
|
+
"expo-router",
|
|
98
|
+
"react-navigation",
|
|
99
|
+
"routes"
|
|
100
|
+
],
|
|
86
101
|
"scripts": {
|
|
87
102
|
"build": "bob build",
|
|
88
103
|
"typecheck": "tsc --noEmit",
|