@buoy-gg/route-events 7.0.30 → 7.0.32
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/RouteEventsModalWithTabs.js +1 -0
- package/lib/commonjs/sync/routeEventsSyncAdapter.js +43 -0
- package/lib/module/components/RouteEventsModalWithTabs.js +2 -1
- package/lib/module/sync/routeEventsSyncAdapter.js +43 -0
- package/lib/typescript/components/RouteEventsModalWithTabs.d.ts.map +1 -1
- package/lib/typescript/sync/routeEventsSyncAdapter.d.ts +25 -0
- package/lib/typescript/sync/routeEventsSyncAdapter.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -645,6 +645,7 @@ function RouteEventsModalWithTabs({
|
|
|
645
645
|
style: styles.inlineRoot,
|
|
646
646
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
647
647
|
style: styles.inlineHeader,
|
|
648
|
+
..._sharedUi.windowDragProps,
|
|
648
649
|
children: headerContent
|
|
649
650
|
}), renderContent(), footerNode]
|
|
650
651
|
}), upgradeModal]
|
|
@@ -118,6 +118,49 @@ const routeEventsSyncAdapter = exports.routeEventsSyncAdapter = {
|
|
|
118
118
|
clearEvents: () => {
|
|
119
119
|
_routeEventStore.routeEventStore.clearEvents();
|
|
120
120
|
},
|
|
121
|
+
/**
|
|
122
|
+
* Just where the app is right now — no sitemap, no history.
|
|
123
|
+
*
|
|
124
|
+
* The full snapshot carries the parsed route tree, which is the wrong
|
|
125
|
+
* thing to hand a caller that polls (the macro recorder reads this several
|
|
126
|
+
* times a second to notice a screen change). Reading the last route event
|
|
127
|
+
* is also what makes this honest about apps with no <RouteTracker />: they
|
|
128
|
+
* get `{ path: null }` rather than a plausible-looking guess.
|
|
129
|
+
*/
|
|
130
|
+
getCurrentRoute: () => {
|
|
131
|
+
// BaseEventStore is newest-FIRST, and the store only captures while
|
|
132
|
+
// something is subscribed.
|
|
133
|
+
const latest = _routeEventStore.routeEventStore.getEvents()[0];
|
|
134
|
+
if (latest) {
|
|
135
|
+
return {
|
|
136
|
+
path: latest.pathname,
|
|
137
|
+
params: toWireParams(latest.params),
|
|
138
|
+
at: latest.timestamp,
|
|
139
|
+
source: "event"
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// Nothing has navigated yet — which is exactly the state a freshly
|
|
143
|
+
// launched app is in, and exactly when a macro recorder needs to know
|
|
144
|
+
// where it is starting from. The live stack knows even when the history
|
|
145
|
+
// is empty, so falling back to it is the difference between a macro that
|
|
146
|
+
// can run from anywhere and one that only works if you happen to be on
|
|
147
|
+
// the screen it was recorded from.
|
|
148
|
+
const focused = _navigationStackStore.navigationStackStore.getStack().find(item => item.isFocused) ?? _navigationStackStore.navigationStackStore.getStack().slice(-1)[0];
|
|
149
|
+
if (focused?.pathname) {
|
|
150
|
+
return {
|
|
151
|
+
path: focused.pathname,
|
|
152
|
+
params: toWireParams(focused.params ?? {}),
|
|
153
|
+
at: null,
|
|
154
|
+
source: "stack"
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
path: null,
|
|
159
|
+
params: {},
|
|
160
|
+
at: null,
|
|
161
|
+
source: null
|
|
162
|
+
};
|
|
163
|
+
},
|
|
121
164
|
/**
|
|
122
165
|
* Navigate the device to a concrete path. The dashboard resolves any
|
|
123
166
|
* dynamic params into a concrete path before invoking this.
|
|
@@ -8,7 +8,7 @@ import { getCommonActions, useSafeNavigationContainerRef } from "../utils/safeRe
|
|
|
8
8
|
// (useSafeNavigationContainerRef then yields undefined, so the dispatch
|
|
9
9
|
// paths below never execute).
|
|
10
10
|
const CommonActions = getCommonActions();
|
|
11
|
-
import { useSafeRouter, isExpoRouterAvailable } from "@buoy-gg/shared-ui";
|
|
11
|
+
import { useSafeRouter, isExpoRouterAvailable, windowDragProps } from "@buoy-gg/shared-ui";
|
|
12
12
|
import { JsModal, ModalHeader, TabSelector, formatRelativeTime, devToolsStorageKeys, Navigation, Trash2, Filter, SearchBar, persistentStorage, ToolbarCopyButton, Lock, ProUpgradeModal, PowerToggleButton, buoyColors, night, TickProvider, useLimit } from "@buoy-gg/shared-ui";
|
|
13
13
|
import { useIsPro } from "@buoy-gg/license";
|
|
14
14
|
|
|
@@ -642,6 +642,7 @@ export function RouteEventsModalWithTabs({
|
|
|
642
642
|
style: styles.inlineRoot,
|
|
643
643
|
children: [/*#__PURE__*/_jsx(View, {
|
|
644
644
|
style: styles.inlineHeader,
|
|
645
|
+
...windowDragProps,
|
|
645
646
|
children: headerContent
|
|
646
647
|
}), renderContent(), footerNode]
|
|
647
648
|
}), upgradeModal]
|
|
@@ -116,6 +116,49 @@ export const routeEventsSyncAdapter = {
|
|
|
116
116
|
clearEvents: () => {
|
|
117
117
|
routeEventStore.clearEvents();
|
|
118
118
|
},
|
|
119
|
+
/**
|
|
120
|
+
* Just where the app is right now — no sitemap, no history.
|
|
121
|
+
*
|
|
122
|
+
* The full snapshot carries the parsed route tree, which is the wrong
|
|
123
|
+
* thing to hand a caller that polls (the macro recorder reads this several
|
|
124
|
+
* times a second to notice a screen change). Reading the last route event
|
|
125
|
+
* is also what makes this honest about apps with no <RouteTracker />: they
|
|
126
|
+
* get `{ path: null }` rather than a plausible-looking guess.
|
|
127
|
+
*/
|
|
128
|
+
getCurrentRoute: () => {
|
|
129
|
+
// BaseEventStore is newest-FIRST, and the store only captures while
|
|
130
|
+
// something is subscribed.
|
|
131
|
+
const latest = routeEventStore.getEvents()[0];
|
|
132
|
+
if (latest) {
|
|
133
|
+
return {
|
|
134
|
+
path: latest.pathname,
|
|
135
|
+
params: toWireParams(latest.params),
|
|
136
|
+
at: latest.timestamp,
|
|
137
|
+
source: "event"
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// Nothing has navigated yet — which is exactly the state a freshly
|
|
141
|
+
// launched app is in, and exactly when a macro recorder needs to know
|
|
142
|
+
// where it is starting from. The live stack knows even when the history
|
|
143
|
+
// is empty, so falling back to it is the difference between a macro that
|
|
144
|
+
// can run from anywhere and one that only works if you happen to be on
|
|
145
|
+
// the screen it was recorded from.
|
|
146
|
+
const focused = navigationStackStore.getStack().find(item => item.isFocused) ?? navigationStackStore.getStack().slice(-1)[0];
|
|
147
|
+
if (focused?.pathname) {
|
|
148
|
+
return {
|
|
149
|
+
path: focused.pathname,
|
|
150
|
+
params: toWireParams(focused.params ?? {}),
|
|
151
|
+
at: null,
|
|
152
|
+
source: "stack"
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
path: null,
|
|
157
|
+
params: {},
|
|
158
|
+
at: null,
|
|
159
|
+
source: null
|
|
160
|
+
};
|
|
161
|
+
},
|
|
119
162
|
/**
|
|
120
163
|
* Navigate the device to a concrete path. The dashboard resolves any
|
|
121
164
|
* dynamic params into a concrete path before invoking this.
|
|
@@ -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":"AAuDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGnE,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;IACtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE;YACR,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;YACrB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;YAChC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SAC/B,CAAC;QACF,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;QAC3B;;;;WAIG;QACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;QAC7C;;;;;WAKG;QACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QAC5C,2EAA2E;QAC3E,aAAa,CAAC,EAAE,CACd,MAAM,EAAE,yBAAyB,EACjC,OAAO,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,KACzB,IAAI,CAAC;KACX,CAAC;CACH;AA8CD,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,MAAc,EACd,MAAM,GACP,EAAE,6BAA6B,sCAguB/B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,GAAE,IAAI,CAAC,6BAA6B,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAKlF"}
|
|
@@ -52,6 +52,31 @@ export declare const routeEventsSyncAdapter: {
|
|
|
52
52
|
subscribe: (onChange: () => void) => () => void;
|
|
53
53
|
actions: {
|
|
54
54
|
clearEvents: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Just where the app is right now — no sitemap, no history.
|
|
57
|
+
*
|
|
58
|
+
* The full snapshot carries the parsed route tree, which is the wrong
|
|
59
|
+
* thing to hand a caller that polls (the macro recorder reads this several
|
|
60
|
+
* times a second to notice a screen change). Reading the last route event
|
|
61
|
+
* is also what makes this honest about apps with no <RouteTracker />: they
|
|
62
|
+
* get `{ path: null }` rather than a plausible-looking guess.
|
|
63
|
+
*/
|
|
64
|
+
getCurrentRoute: () => {
|
|
65
|
+
path: string;
|
|
66
|
+
params: Record<string, string | string[]>;
|
|
67
|
+
at: number;
|
|
68
|
+
source: "event";
|
|
69
|
+
} | {
|
|
70
|
+
path: string;
|
|
71
|
+
params: Record<string, any>;
|
|
72
|
+
at: null;
|
|
73
|
+
source: "stack";
|
|
74
|
+
} | {
|
|
75
|
+
path: null;
|
|
76
|
+
params: {};
|
|
77
|
+
at: null;
|
|
78
|
+
source: null;
|
|
79
|
+
};
|
|
55
80
|
/**
|
|
56
81
|
* Navigate the device to a concrete path. The dashboard resolves any
|
|
57
82
|
* dynamic params into a concrete path before invoking this.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeEventsSyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/routeEventsSyncAdapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAY,CAAC;AA4BrD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAWD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;uBAEhB,sBAAsB;0BAKjB,MAAM,IAAI;;;QAkC9B;;;WAGG;4BACiB,OAAO;;;;wCAsBK,OAAO;;;mCAUZ,OAAO;;;;;;;;;;CAuBrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"routeEventsSyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/routeEventsSyncAdapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAY,CAAC;AA4BrD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAWD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;uBAEhB,sBAAsB;0BAKjB,MAAM,IAAI;;;QAkC9B;;;;;;;;WAQG;;;;;;;;;;;;;;;;;QAgCH;;;WAGG;4BACiB,OAAO;;;;wCAsBK,OAAO;;;mCAUZ,OAAO;;;;;;;;;;CAuBrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/route-events",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.32",
|
|
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/
|
|
30
|
-
"@buoy-gg/
|
|
29
|
+
"@buoy-gg/shared-ui": "^7.0.32",
|
|
30
|
+
"@buoy-gg/floating-tools-core": "^7.0.32"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@buoy-gg/license": "7.0.
|
|
33
|
+
"@buoy-gg/license": "7.0.32",
|
|
34
34
|
"@react-native-async-storage/async-storage": "^2.0.0 || ^3.1.0",
|
|
35
35
|
"@react-navigation/native": "*",
|
|
36
36
|
"expo-router": "*",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/react-native": "^0.73.0",
|
|
53
53
|
"expo-router": "~5.0.7",
|
|
54
54
|
"typescript": "~5.8.3",
|
|
55
|
-
"@buoy-gg/license": "^7.0.
|
|
55
|
+
"@buoy-gg/license": "^7.0.32"
|
|
56
56
|
},
|
|
57
57
|
"react-native-builder-bob": {
|
|
58
58
|
"source": "src",
|