@buoy-gg/network 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.
- package/README.md +11 -85
- package/lib/commonjs/index.js +1 -332
- package/lib/commonjs/index.web.js +1 -420
- package/lib/commonjs/network/components/DataViewer.web.js +1 -879
- package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
- package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
- package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
- package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
- package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
- package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
- package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
- package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
- package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
- package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
- package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
- package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
- package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
- package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
- package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
- package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
- package/lib/commonjs/network/components/NetworkListScreen.js +1 -403
- package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -624
- package/lib/commonjs/network/components/NetworkModal.js +1 -786
- package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
- package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
- package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
- package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
- package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
- package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
- package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
- package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
- package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
- package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
- package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
- package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
- package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
- package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
- package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
- package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
- package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
- package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
- package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
- package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
- package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
- package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
- package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
- package/lib/commonjs/network/conditions/store.js +1 -75
- package/lib/commonjs/network/conditions/wait.js +1 -43
- package/lib/commonjs/network/conditions/xhr.js +1 -135
- package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
- package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
- package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
- package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
- package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
- package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
- package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
- package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
- package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
- package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
- package/lib/commonjs/network/overrides/applyToXhr.js +2 -510
- package/lib/commonjs/network/overrides/engine.js +1 -93
- package/lib/commonjs/network/overrides/matchRule.js +1 -87
- package/lib/commonjs/network/overrides/overriddenRows.js +1 -37
- package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
- package/lib/commonjs/network/overrides/presets.js +1 -70
- package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
- package/lib/commonjs/network/overrides/types.js +1 -90
- package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
- package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
- package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
- package/lib/commonjs/network/types/index.js +1 -5
- package/lib/commonjs/network/utils/extractOperationName.js +1 -80
- package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
- package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
- package/lib/commonjs/network/utils/formatting.js +1 -30
- package/lib/commonjs/network/utils/generateCurl.js +2 -71
- package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
- package/lib/commonjs/network/utils/httpCompletion.js +1 -37
- package/lib/commonjs/network/utils/networkEventStore.js +1 -411
- package/lib/commonjs/network/utils/networkListener.js +4 -1352
- package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
- package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
- package/lib/commonjs/network/utils/realNow.js +1 -0
- package/lib/commonjs/network/utils/requestId.js +1 -16
- package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -15
- package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
- package/lib/commonjs/network/utils/startNetworkCapture.js +1 -24
- package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
- package/lib/commonjs/preset.js +1 -93
- package/lib/module/index.js +1 -104
- package/lib/module/index.web.js +1 -82
- package/lib/module/network/components/DataViewer.web.js +1 -875
- package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
- package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
- package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
- package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
- package/lib/module/network/components/NetworkDetailStepper.js +1 -104
- package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
- package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
- package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
- package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
- package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
- package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
- package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
- package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
- package/lib/module/network/components/NetworkHeaderLive.js +1 -366
- package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
- package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
- package/lib/module/network/components/NetworkListScreen.js +1 -399
- package/lib/module/network/components/NetworkListScreen.web.js +1 -622
- package/lib/module/network/components/NetworkModal.js +1 -781
- package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
- package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
- package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
- package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
- package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
- package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
- package/lib/module/network/components/NetworkOverridesButton.js +1 -87
- package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
- package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
- package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
- package/lib/module/network/components/NetworkSavedScreen.js +1 -222
- package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
- package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
- package/lib/module/network/components/response-editor/Explorer.js +1 -972
- package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
- package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
- package/lib/module/network/components/response-editor/editorContext.js +1 -29
- package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
- package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
- package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
- package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
- package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
- package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
- package/lib/module/network/conditions/store.js +1 -65
- package/lib/module/network/conditions/wait.js +1 -38
- package/lib/module/network/conditions/xhr.js +1 -131
- package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
- package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
- package/lib/module/network/hooks/useNetworkEventList.js +1 -104
- package/lib/module/network/hooks/useNetworkEvents.js +1 -314
- package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
- package/lib/module/network/hooks/useNetworkSaved.js +1 -34
- package/lib/module/network/hooks/useNetworkSelection.js +1 -46
- package/lib/module/network/hooks/useOverrideRules.js +1 -32
- package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
- package/lib/module/network/overrides/applyToFetch.js +1 -72
- package/lib/module/network/overrides/applyToXhr.js +2 -502
- package/lib/module/network/overrides/engine.js +1 -85
- package/lib/module/network/overrides/matchRule.js +1 -81
- package/lib/module/network/overrides/overriddenRows.js +1 -33
- package/lib/module/network/overrides/overrideRulesStore.js +1 -547
- package/lib/module/network/overrides/presets.js +1 -65
- package/lib/module/network/overrides/resolveOverride.js +1 -152
- package/lib/module/network/overrides/types.js +1 -86
- package/lib/module/network/sync/networkBodyResolver.js +1 -34
- package/lib/module/network/sync/networkSyncAdapter.js +1 -880
- package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
- package/lib/module/network/types/index.js +1 -3
- package/lib/module/network/utils/extractOperationName.js +1 -76
- package/lib/module/network/utils/filterNetworkEvents.js +1 -92
- package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
- package/lib/module/network/utils/formatting.js +1 -9
- package/lib/module/network/utils/generateCurl.js +2 -67
- package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
- package/lib/module/network/utils/httpCompletion.js +1 -32
- package/lib/module/network/utils/networkEventStore.js +1 -409
- package/lib/module/network/utils/networkListener.js +4 -1341
- package/lib/module/network/utils/networkSavedStore.js +3 -572
- package/lib/module/network/utils/networkSelectionStore.js +1 -188
- package/lib/module/network/utils/realNow.js +1 -0
- package/lib/module/network/utils/requestId.js +1 -12
- package/lib/module/network/utils/resolveRequestUrl.js +1 -11
- package/lib/module/network/utils/selectSavedEvents.js +1 -35
- package/lib/module/network/utils/startNetworkCapture.js +1 -21
- package/lib/module/network/utils/withPinnedFirst.js +1 -28
- package/lib/module/preset.js +1 -91
- package/lib/typescript/network/overrides/engine.d.ts +1 -1
- package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
- package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
- package/lib/typescript/network/overrides/types.d.ts +9 -0
- package/lib/typescript/network/utils/networkListener.d.ts +11 -0
- package/lib/typescript/network/utils/realNow.d.ts +18 -0
- package/lib/web/index.mjs +73 -74
- package/package.json +3 -6
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/index.web.d.ts.map +0 -1
- package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
- package/lib/typescript/network/conditions/store.d.ts.map +0 -1
- package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
- package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
- package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
- package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
- package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
- package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
- package/lib/typescript/network/overrides/overriddenRows.d.ts.map +0 -1
- package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
- package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
- package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
- package/lib/typescript/network/overrides/types.d.ts.map +0 -1
- package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
- package/lib/typescript/network/types/index.d.ts.map +0 -1
- package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
- package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
- package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
- package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
- package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
- package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
- package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
- package/lib/typescript/network/utils/requestId.d.ts.map +0 -1
- package/lib/typescript/network/utils/resolveRequestUrl.d.ts.map +0 -1
- package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
- package/lib/typescript/network/utils/startNetworkCapture.d.ts.map +0 -1
- package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
|
@@ -1,97 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* NetworkDetailScreen.web — DOM twin of the `NetworkDetailScreen` screen
|
|
5
|
-
* component inside NetworkModal.tsx (the native detail screen is private to
|
|
6
|
-
* the modal; web hosts compose their own shell, so the screen is exported
|
|
7
|
-
* here as the reusable piece).
|
|
8
|
-
*
|
|
9
|
-
* Same rule4 contract and the same two-cursor render strategy as native:
|
|
10
|
-
*
|
|
11
|
-
* - Hooks run unconditionally; the component returns null when not visible.
|
|
12
|
-
* - The detail chrome renders at the IMMEDIATE selection
|
|
13
|
-
* (`useSelectedNetworkEventId`) — every step, no delay — while the
|
|
14
|
-
* expensive JSON body trees wait for the settled cursor
|
|
15
|
-
* (`useNetworkBodyEventId`): `showBodies` is false exactly while the
|
|
16
|
-
* prev/next cursor is still moving, so a burst of taps renders the request
|
|
17
|
-
* you land on and none of the ones you flew past.
|
|
18
|
-
* - The ID resolves through `useLiveNetworkEvent` so a request opened while
|
|
19
|
-
* pending picks up its response/error in place.
|
|
20
|
-
* - `reportRendered` still fires after the trees commit — benchmark
|
|
21
|
-
* instrumentation, same gating as native.
|
|
22
|
-
*
|
|
23
|
-
* All hooks and the selection store are the platform-free modules native
|
|
24
|
-
* uses — REUSED, not forked. Layout: the detail body scrolls, the stepper
|
|
25
|
-
* stays pinned under it (the body owns its scroll — see the native comment);
|
|
26
|
-
* the spacer holds the footer down when the ID resolves to nothing.
|
|
27
|
-
*
|
|
28
|
-
* @platform React DOM Web
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
import { useEffect } from "react";
|
|
32
|
-
import { useLiveNetworkEvent } from "../hooks/useLiveNetworkEvent";
|
|
33
|
-
import { useNetworkBodyEventId, useSelectedNetworkEventId } from "../hooks/useNetworkSelection";
|
|
34
|
-
import { networkSelectionStore } from "../utils/networkSelectionStore";
|
|
35
|
-
import { NetworkEventDetailView } from "./NetworkEventDetailView.web";
|
|
36
|
-
import { NetworkDetailStepper } from "./NetworkDetailStepper.web";
|
|
37
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
|
-
export function NetworkDetailScreen({
|
|
39
|
-
visible,
|
|
40
|
-
paused,
|
|
41
|
-
ignoredPatternValues,
|
|
42
|
-
onTogglePattern,
|
|
43
|
-
isPro,
|
|
44
|
-
filter,
|
|
45
|
-
ignoredPatterns,
|
|
46
|
-
fromSaved,
|
|
47
|
-
savedSearch,
|
|
48
|
-
applySafeAreaInset
|
|
49
|
-
}) {
|
|
50
|
-
const eventId = useSelectedNetworkEventId();
|
|
51
|
-
const settledId = useNetworkBodyEventId();
|
|
52
|
-
const heavyReady = eventId != null && eventId === settledId;
|
|
53
|
-
// Resolve the ID to the live event so a request opened while pending picks
|
|
54
|
-
// up its response/error in place instead of freezing on the tap snapshot.
|
|
55
|
-
const event = useLiveNetworkEvent(eventId, {
|
|
56
|
-
paused: paused || !visible
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// Instrumentation for the benchmark harness — reports when the expensive
|
|
60
|
-
// TREES landed (gated on `heavyReady`, same rationale as native).
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (visible && event && heavyReady) {
|
|
63
|
-
networkSelectionStore.reportRendered(event.id);
|
|
64
|
-
}
|
|
65
|
-
}, [visible, event, heavyReady]);
|
|
66
|
-
if (!visible) return null;
|
|
67
|
-
// Column: the detail body scrolls, the stepper stays pinned under it.
|
|
68
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
69
|
-
style: {
|
|
70
|
-
display: "flex",
|
|
71
|
-
flexDirection: "column",
|
|
72
|
-
flex: 1,
|
|
73
|
-
minHeight: 0
|
|
74
|
-
},
|
|
75
|
-
children: [event ? /*#__PURE__*/_jsx(NetworkEventDetailView, {
|
|
76
|
-
event: event,
|
|
77
|
-
ignoredPatterns: ignoredPatternValues,
|
|
78
|
-
onTogglePattern: onTogglePattern,
|
|
79
|
-
showBodies: heavyReady
|
|
80
|
-
}) :
|
|
81
|
-
/*#__PURE__*/
|
|
82
|
-
/* Holds the footer down when the selected ID resolves to no event. */
|
|
83
|
-
_jsx("div", {
|
|
84
|
-
style: {
|
|
85
|
-
flex: 1
|
|
86
|
-
}
|
|
87
|
-
}), /*#__PURE__*/_jsx(NetworkDetailStepper, {
|
|
88
|
-
paused: paused,
|
|
89
|
-
filter: filter,
|
|
90
|
-
ignoredPatterns: ignoredPatterns,
|
|
91
|
-
isPro: isPro,
|
|
92
|
-
fromSaved: fromSaved,
|
|
93
|
-
savedSearch: savedSearch,
|
|
94
|
-
applySafeAreaInset: applySafeAreaInset
|
|
95
|
-
})]
|
|
96
|
-
});
|
|
97
|
-
}
|
|
1
|
+
"use strict";import{useEffect as v}from"react";import{useLiveNetworkEvent as w}from"../hooks/useLiveNetworkEvent";import{useNetworkBodyEventId as x,useSelectedNetworkEventId as S}from"../hooks/useNetworkSelection";import{networkSelectionStore as k}from"../utils/networkSelectionStore";import{NetworkEventDetailView as y}from"./NetworkEventDetailView.web";import{NetworkDetailStepper as N}from"./NetworkDetailStepper.web";import{jsx as n,jsxs as g}from"react/jsx-runtime";export function NetworkDetailScreen({visible:t,paused:s,ignoredPatternValues:i,onTogglePattern:d,isPro:f,filter:l,ignoredPatterns:a,fromSaved:m,savedSearch:p,applySafeAreaInset:c}){const r=S();const u=x();const o=r!=null&&r===u;const e=w(r,{paused:s||!t});v(()=>{if(t&&e&&o){k.reportRendered(e.id)}},[t,e,o]);if(!t)return null;return g("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[e?n(y,{event:e,ignoredPatterns:i,onTogglePattern:d,showBodies:o}):n("div",{style:{flex:1}}),n(N,{paused:s,filter:l,ignoredPatterns:a,isPro:f,fromSaved:m,savedSearch:p,applySafeAreaInset:c})]})}
|
|
@@ -1,104 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Previous/Next footer for the request DETAIL screen — step through requests
|
|
5
|
-
* without bouncing back to the list.
|
|
6
|
-
*
|
|
7
|
-
* It is its OWN leaf (rule3) because it is the only part of the detail screen
|
|
8
|
-
* that needs the event LIST. Subscribing here keeps the request stream out of
|
|
9
|
-
* the detail body's render path, which is the expensive subtree (headers,
|
|
10
|
-
* bodies, JSON viewers): a request arriving re-renders this ~30-node footer
|
|
11
|
-
* and nothing else.
|
|
12
|
-
*
|
|
13
|
-
* The order it steps through is EXACTLY what the list screen renders —
|
|
14
|
-
* `[...pinned, ...rest]` off the same `useNetworkEventList` + `splitPinned`
|
|
15
|
-
* derivation — so "Next" always lands on the row below the one the user
|
|
16
|
-
* tapped. Because the live filter is an input, typing in the search box or
|
|
17
|
-
* flipping a status chip re-scopes the stepper in place; the counter is
|
|
18
|
-
* "request N of <what the list is showing>", never "N of everything ever
|
|
19
|
-
* captured". Detail opened from the Saved screen steps through the SAVED
|
|
20
|
-
* list instead (with its own search applied), for the same reason.
|
|
21
|
-
*
|
|
22
|
-
* This component OWNS the navigable order but not the cursor: it publishes
|
|
23
|
-
* the ordered ids into `networkSelectionStore` and reads the cursor back.
|
|
24
|
-
* That split is what makes stepping O(1) (the store keeps the index, so
|
|
25
|
-
* there is no `findIndex` per render) and what lets the benchmark harness
|
|
26
|
-
* drive `step(+1)` directly without going through the UI.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
import { memo, useEffect, useMemo } from "react";
|
|
30
|
-
import { EventStepperFooter, useLimit } from "@buoy-gg/shared-ui";
|
|
31
|
-
import { useNetworkEventList } from "../hooks/useNetworkEventList";
|
|
32
|
-
import { useNetworkSaved } from "../hooks/useNetworkSaved";
|
|
33
|
-
import { useNetworkCursor } from "../hooks/useNetworkSelection";
|
|
34
|
-
import { networkSelectionStore, toSelectionIds } from "../utils/networkSelectionStore";
|
|
35
|
-
import { splitPinned } from "../utils/withPinnedFirst";
|
|
36
|
-
import { selectSavedEvents } from "../utils/selectSavedEvents";
|
|
37
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
-
/** Stable identities — the store is a singleton, so these never need to change. */
|
|
39
|
-
const stepPrevious = () => networkSelectionStore.step(-1);
|
|
40
|
-
const stepNext = () => networkSelectionStore.step(1);
|
|
41
|
-
export const NetworkDetailStepper = /*#__PURE__*/memo(function NetworkDetailStepper({
|
|
42
|
-
paused,
|
|
43
|
-
filter,
|
|
44
|
-
ignoredPatterns,
|
|
45
|
-
isPro,
|
|
46
|
-
fromSaved,
|
|
47
|
-
savedSearch,
|
|
48
|
-
applySafeAreaInset
|
|
49
|
-
}) {
|
|
50
|
-
const {
|
|
51
|
-
visibleEvents
|
|
52
|
-
} = useNetworkEventList({
|
|
53
|
-
filter,
|
|
54
|
-
ignoredPatterns,
|
|
55
|
-
paused,
|
|
56
|
-
isPro
|
|
57
|
-
});
|
|
58
|
-
const {
|
|
59
|
-
pinnedEvents,
|
|
60
|
-
pinnedLiveIds,
|
|
61
|
-
savedRecords
|
|
62
|
-
} = useNetworkSaved();
|
|
63
|
-
const savedLimit = useLimit("network.saved");
|
|
64
|
-
const ordered = useMemo(() => {
|
|
65
|
-
if (fromSaved) {
|
|
66
|
-
return selectSavedEvents(savedRecords, savedLimit, savedSearch).events;
|
|
67
|
-
}
|
|
68
|
-
// Same split the list screen does — pins render above the FlatList, so
|
|
69
|
-
// they come first here too.
|
|
70
|
-
const {
|
|
71
|
-
pinned,
|
|
72
|
-
rest
|
|
73
|
-
} = splitPinned(visibleEvents, pinnedEvents, pinnedLiveIds);
|
|
74
|
-
return pinned.length === 0 ? rest : [...pinned, ...rest];
|
|
75
|
-
}, [fromSaved, savedRecords, savedSearch, isPro, visibleEvents, pinnedEvents, pinnedLiveIds]);
|
|
76
|
-
|
|
77
|
-
// Publish the navigable order. `setIds` re-anchors the cursor BY ID and
|
|
78
|
-
// no-ops when the ids are unchanged, so this is safe to run every render.
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
networkSelectionStore.setIds(toSelectionIds(ordered));
|
|
81
|
-
}, [ordered]);
|
|
82
|
-
const {
|
|
83
|
-
index,
|
|
84
|
-
total
|
|
85
|
-
} = useNetworkCursor();
|
|
86
|
-
|
|
87
|
-
// Not in the list at all: the filter changed under it while it was open, it
|
|
88
|
-
// aged past the 500-request cap, or it is a saved snapshot with no live twin.
|
|
89
|
-
// There is no coherent "next" in that state, so show no footer rather than a
|
|
90
|
-
// counter that lies.
|
|
91
|
-
if (index < 0) return null;
|
|
92
|
-
|
|
93
|
-
// Both lists are newest-first, so "Previous" walks toward the NEWER request —
|
|
94
|
-
// the same direction as scrolling up, which is what the arrow means here.
|
|
95
|
-
return /*#__PURE__*/_jsx(EventStepperFooter, {
|
|
96
|
-
currentIndex: index,
|
|
97
|
-
totalItems: total,
|
|
98
|
-
itemLabel: "Request",
|
|
99
|
-
applySafeAreaInset: applySafeAreaInset,
|
|
100
|
-
onPrevious: stepPrevious,
|
|
101
|
-
onNext: stepNext,
|
|
102
|
-
variant: "night"
|
|
103
|
-
});
|
|
104
|
-
});
|
|
1
|
+
"use strict";import{memo as x,useEffect as N,useMemo as S}from"react";import{EventStepperFooter as E,useLimit as I}from"@buoy-gg/shared-ui";import{useNetworkEventList as L}from"../hooks/useNetworkEventList";import{useNetworkSaved as b}from"../hooks/useNetworkSaved";import{useNetworkCursor as g}from"../hooks/useNetworkSelection";import{networkSelectionStore as e,toSelectionIds as j}from"../utils/networkSelectionStore";import{splitPinned as D}from"../utils/withPinnedFirst";import{selectSavedEvents as P}from"../utils/selectSavedEvents";import{jsx as R}from"react/jsx-runtime";const h=()=>e.step(-1);const q=()=>e.step(1);export const NetworkDetailStepper=x(function y({paused:f,filter:l,ignoredPatterns:v,isPro:t,fromSaved:o,savedSearch:r,applySafeAreaInset:a}){const{visibleEvents:s}=L({filter:l,ignoredPatterns:v,paused:f,isPro:t});const{pinnedEvents:n,pinnedLiveIds:i,savedRecords:p}=b();const k=I("network.saved");const m=S(()=>{if(o){return P(p,k,r).events}const{pinned:c,rest:d}=D(s,n,i);return c.length===0?d:[...c,...d]},[o,p,r,t,s,n,i]);N(()=>{e.setIds(j(m))},[m]);const{index:u,total:w}=g();if(u<0)return null;return R(E,{currentIndex:u,totalItems:w,itemLabel:"Request",applySafeAreaInset:a,onPrevious:h,onNext:q,variant:"night"})});
|
|
@@ -1,296 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* NetworkDetailStepper.web — DOM twin of NetworkDetailStepper.tsx.
|
|
5
|
-
*
|
|
6
|
-
* Previous/Next footer for the request DETAIL screen. The data layer is
|
|
7
|
-
* REUSED, not forked — `useNetworkEventList`, `useNetworkSaved`,
|
|
8
|
-
* `useNetworkCursor`, `networkSelectionStore`, `splitPinned` and
|
|
9
|
-
* `selectSavedEvents` are all platform-free — so the navigable order is
|
|
10
|
-
* EXACTLY what the list screen renders (`[...pinned, ...rest]`), re-scoped in
|
|
11
|
-
* place by the live filter, and detail opened from the Saved screen steps
|
|
12
|
-
* through the saved list instead. It is its own leaf for the same reason as
|
|
13
|
-
* native: it is the only part of the detail screen that needs the event LIST,
|
|
14
|
-
* so a request arriving re-renders this footer and nothing else.
|
|
15
|
-
*
|
|
16
|
-
* shared-ui RN chrome is replicated as DOM with provenance:
|
|
17
|
-
* - `EventStepperFooter` — inlined DOM twin below, values from
|
|
18
|
-
* shared/src/ui/components/EventStepperFooter.tsx (macOSColors verbatim;
|
|
19
|
-
* the native -2px shadow → an equivalent CSS box-shadow).
|
|
20
|
-
* - `applySafeAreaInset` maps `useSafeAreaInsets().bottom` →
|
|
21
|
-
* `env(safe-area-inset-bottom)` (0 on desktop webviews, the real inset on
|
|
22
|
-
* phone webviews).
|
|
23
|
-
*
|
|
24
|
-
* @platform React DOM Web
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import { memo, useEffect, useMemo } from "react";
|
|
28
|
-
import { useLimit } from "@buoy-gg/shared-ui";
|
|
29
|
-
import { useNetworkEventList } from "../hooks/useNetworkEventList";
|
|
30
|
-
import { useNetworkSaved } from "../hooks/useNetworkSaved";
|
|
31
|
-
import { useNetworkCursor } from "../hooks/useNetworkSelection";
|
|
32
|
-
import { networkSelectionStore, toSelectionIds } from "../utils/networkSelectionStore";
|
|
33
|
-
import { splitPinned } from "../utils/withPinnedFirst";
|
|
34
|
-
import { selectSavedEvents } from "../utils/selectSavedEvents";
|
|
35
|
-
|
|
36
|
-
// =============================
|
|
37
|
-
// Native palette (provenance)
|
|
38
|
-
// =============================
|
|
39
|
-
|
|
40
|
-
/** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
|
|
41
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
|
-
const macOSColors = {
|
|
43
|
-
background: {
|
|
44
|
-
base: "#0A0A0C",
|
|
45
|
-
card: "#1A1A1C"
|
|
46
|
-
},
|
|
47
|
-
border: {
|
|
48
|
-
default: "#2D2D2F"
|
|
49
|
-
},
|
|
50
|
-
text: {
|
|
51
|
-
primary: "#F5F5F7",
|
|
52
|
-
secondary: "#A1A1A6",
|
|
53
|
-
muted: "#8E8E93"
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// =============================
|
|
58
|
-
// Inline lucide icons (shared-ui icons are lucide re-exports)
|
|
59
|
-
// =============================
|
|
60
|
-
|
|
61
|
-
function Svg({
|
|
62
|
-
size = 14,
|
|
63
|
-
color = "currentColor",
|
|
64
|
-
children
|
|
65
|
-
}) {
|
|
66
|
-
return /*#__PURE__*/_jsx("svg", {
|
|
67
|
-
width: size,
|
|
68
|
-
height: size,
|
|
69
|
-
viewBox: "0 0 24 24",
|
|
70
|
-
fill: "none",
|
|
71
|
-
stroke: color,
|
|
72
|
-
strokeWidth: 2,
|
|
73
|
-
strokeLinecap: "round",
|
|
74
|
-
strokeLinejoin: "round",
|
|
75
|
-
style: {
|
|
76
|
-
flexShrink: 0,
|
|
77
|
-
display: "block"
|
|
78
|
-
},
|
|
79
|
-
children: children
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
const ChevronLeft = p => /*#__PURE__*/_jsx(Svg, {
|
|
83
|
-
...p,
|
|
84
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
85
|
-
d: "m15 18-6-6 6-6"
|
|
86
|
-
})
|
|
87
|
-
});
|
|
88
|
-
const ChevronRight = p => /*#__PURE__*/_jsx(Svg, {
|
|
89
|
-
...p,
|
|
90
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
91
|
-
d: "m9 18 6-6-6-6"
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// =============================
|
|
96
|
-
// EventStepperFooter DOM twin (shared/src/ui/components/EventStepperFooter.tsx)
|
|
97
|
-
// =============================
|
|
98
|
-
|
|
99
|
-
const EventStepperFooter = /*#__PURE__*/memo(function EventStepperFooter({
|
|
100
|
-
currentIndex,
|
|
101
|
-
totalItems,
|
|
102
|
-
onPrevious,
|
|
103
|
-
onNext,
|
|
104
|
-
itemLabel = "Event",
|
|
105
|
-
subtitle,
|
|
106
|
-
applySafeAreaInset = true
|
|
107
|
-
}) {
|
|
108
|
-
// Don't render if there's only one or no items (native).
|
|
109
|
-
if (totalItems <= 1) return null;
|
|
110
|
-
const isFirstItem = currentIndex === 0;
|
|
111
|
-
const isLastItem = currentIndex === totalItems - 1;
|
|
112
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
113
|
-
style: {
|
|
114
|
-
...footerStyles.footer,
|
|
115
|
-
paddingBottom: applySafeAreaInset ? "calc(12px + env(safe-area-inset-bottom, 0px))" : 12
|
|
116
|
-
},
|
|
117
|
-
children: [/*#__PURE__*/_jsxs("button", {
|
|
118
|
-
type: "button",
|
|
119
|
-
onClick: onPrevious,
|
|
120
|
-
disabled: isFirstItem,
|
|
121
|
-
style: {
|
|
122
|
-
...footerStyles.navButton,
|
|
123
|
-
...(isFirstItem ? footerStyles.navButtonDisabled : null)
|
|
124
|
-
},
|
|
125
|
-
children: [/*#__PURE__*/_jsx(ChevronLeft, {
|
|
126
|
-
size: 20,
|
|
127
|
-
color: isFirstItem ? macOSColors.text.muted : macOSColors.text.primary
|
|
128
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
129
|
-
style: {
|
|
130
|
-
...footerStyles.navButtonText,
|
|
131
|
-
...(isFirstItem ? footerStyles.navButtonTextDisabled : null)
|
|
132
|
-
},
|
|
133
|
-
children: "Previous"
|
|
134
|
-
})]
|
|
135
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
136
|
-
style: footerStyles.counterContainer,
|
|
137
|
-
children: [/*#__PURE__*/_jsxs("span", {
|
|
138
|
-
style: footerStyles.counterText,
|
|
139
|
-
children: [itemLabel, " ", currentIndex + 1, " of ", totalItems]
|
|
140
|
-
}), subtitle ? /*#__PURE__*/_jsx("span", {
|
|
141
|
-
style: footerStyles.subtitleText,
|
|
142
|
-
children: subtitle
|
|
143
|
-
}) : null]
|
|
144
|
-
}), /*#__PURE__*/_jsxs("button", {
|
|
145
|
-
type: "button",
|
|
146
|
-
onClick: onNext,
|
|
147
|
-
disabled: isLastItem,
|
|
148
|
-
style: {
|
|
149
|
-
...footerStyles.navButton,
|
|
150
|
-
...(isLastItem ? footerStyles.navButtonDisabled : null)
|
|
151
|
-
},
|
|
152
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
153
|
-
style: {
|
|
154
|
-
...footerStyles.navButtonText,
|
|
155
|
-
...(isLastItem ? footerStyles.navButtonTextDisabled : null)
|
|
156
|
-
},
|
|
157
|
-
children: "Next"
|
|
158
|
-
}), /*#__PURE__*/_jsx(ChevronRight, {
|
|
159
|
-
size: 20,
|
|
160
|
-
color: isLastItem ? macOSColors.text.muted : macOSColors.text.primary
|
|
161
|
-
})]
|
|
162
|
-
})]
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
// Values mirror the native StyleSheet block 1:1.
|
|
167
|
-
const footerStyles = {
|
|
168
|
-
footer: {
|
|
169
|
-
display: "flex",
|
|
170
|
-
flexDirection: "row",
|
|
171
|
-
alignItems: "center",
|
|
172
|
-
justifyContent: "space-between",
|
|
173
|
-
padding: "12px 16px 12px",
|
|
174
|
-
backgroundColor: macOSColors.background.base,
|
|
175
|
-
borderTop: `1px solid ${macOSColors.border.default}`,
|
|
176
|
-
// Native: shadowOffset 0/-2, opacity 0.1, radius 4.
|
|
177
|
-
boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)",
|
|
178
|
-
flexShrink: 0
|
|
179
|
-
},
|
|
180
|
-
navButton: {
|
|
181
|
-
display: "inline-flex",
|
|
182
|
-
flexDirection: "row",
|
|
183
|
-
alignItems: "center",
|
|
184
|
-
gap: 6,
|
|
185
|
-
padding: "8px 12px",
|
|
186
|
-
borderRadius: 6,
|
|
187
|
-
backgroundColor: macOSColors.background.card,
|
|
188
|
-
minWidth: 100,
|
|
189
|
-
boxSizing: "border-box",
|
|
190
|
-
justifyContent: "center",
|
|
191
|
-
border: "none",
|
|
192
|
-
cursor: "pointer",
|
|
193
|
-
margin: 0
|
|
194
|
-
},
|
|
195
|
-
navButtonDisabled: {
|
|
196
|
-
opacity: 0.3,
|
|
197
|
-
cursor: "default"
|
|
198
|
-
},
|
|
199
|
-
navButtonText: {
|
|
200
|
-
fontSize: 12,
|
|
201
|
-
fontWeight: 600,
|
|
202
|
-
color: macOSColors.text.primary,
|
|
203
|
-
fontFamily: "ui-monospace, Menlo, monospace",
|
|
204
|
-
textTransform: "uppercase"
|
|
205
|
-
},
|
|
206
|
-
navButtonTextDisabled: {
|
|
207
|
-
color: macOSColors.text.muted
|
|
208
|
-
},
|
|
209
|
-
counterContainer: {
|
|
210
|
-
display: "flex",
|
|
211
|
-
flexDirection: "column",
|
|
212
|
-
alignItems: "center"
|
|
213
|
-
},
|
|
214
|
-
counterText: {
|
|
215
|
-
fontSize: 14,
|
|
216
|
-
fontWeight: 700,
|
|
217
|
-
color: macOSColors.text.primary,
|
|
218
|
-
fontFamily: "ui-monospace, Menlo, monospace",
|
|
219
|
-
textTransform: "uppercase"
|
|
220
|
-
},
|
|
221
|
-
subtitleText: {
|
|
222
|
-
fontSize: 11,
|
|
223
|
-
color: macOSColors.text.secondary,
|
|
224
|
-
fontFamily: "ui-monospace, Menlo, monospace",
|
|
225
|
-
marginTop: 2
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// =============================
|
|
230
|
-
// Stepper (logic mirrors the native file 1:1)
|
|
231
|
-
// =============================
|
|
232
|
-
|
|
233
|
-
/** Stable identities — the store is a singleton, so these never need to change. */
|
|
234
|
-
const stepPrevious = () => networkSelectionStore.step(-1);
|
|
235
|
-
const stepNext = () => networkSelectionStore.step(1);
|
|
236
|
-
export const NetworkDetailStepper = /*#__PURE__*/memo(function NetworkDetailStepper({
|
|
237
|
-
paused,
|
|
238
|
-
filter,
|
|
239
|
-
ignoredPatterns,
|
|
240
|
-
isPro,
|
|
241
|
-
fromSaved,
|
|
242
|
-
savedSearch,
|
|
243
|
-
applySafeAreaInset
|
|
244
|
-
}) {
|
|
245
|
-
const {
|
|
246
|
-
visibleEvents
|
|
247
|
-
} = useNetworkEventList({
|
|
248
|
-
filter,
|
|
249
|
-
ignoredPatterns,
|
|
250
|
-
paused,
|
|
251
|
-
isPro
|
|
252
|
-
});
|
|
253
|
-
const {
|
|
254
|
-
pinnedEvents,
|
|
255
|
-
pinnedLiveIds,
|
|
256
|
-
savedRecords
|
|
257
|
-
} = useNetworkSaved();
|
|
258
|
-
const savedLimit = useLimit("network.saved");
|
|
259
|
-
const ordered = useMemo(() => {
|
|
260
|
-
if (fromSaved) {
|
|
261
|
-
return selectSavedEvents(savedRecords, savedLimit, savedSearch).events;
|
|
262
|
-
}
|
|
263
|
-
// Same split the list screen does — pins render above the list, so they
|
|
264
|
-
// come first here too.
|
|
265
|
-
const {
|
|
266
|
-
pinned,
|
|
267
|
-
rest
|
|
268
|
-
} = splitPinned(visibleEvents, pinnedEvents, pinnedLiveIds);
|
|
269
|
-
return pinned.length === 0 ? rest : [...pinned, ...rest];
|
|
270
|
-
}, [fromSaved, savedRecords, savedSearch, isPro, visibleEvents, pinnedEvents, pinnedLiveIds]);
|
|
271
|
-
|
|
272
|
-
// Publish the navigable order. `setIds` re-anchors the cursor BY ID and
|
|
273
|
-
// no-ops when the ids are unchanged, so this is safe to run every render.
|
|
274
|
-
useEffect(() => {
|
|
275
|
-
networkSelectionStore.setIds(toSelectionIds(ordered));
|
|
276
|
-
}, [ordered]);
|
|
277
|
-
const {
|
|
278
|
-
index,
|
|
279
|
-
total
|
|
280
|
-
} = useNetworkCursor();
|
|
281
|
-
|
|
282
|
-
// Not in the list at all (filter changed under it, aged past the cap, or a
|
|
283
|
-
// saved snapshot with no live twin) — no footer rather than a counter that
|
|
284
|
-
// lies.
|
|
285
|
-
if (index < 0) return null;
|
|
286
|
-
|
|
287
|
-
// Both lists are newest-first, so "Previous" walks toward the NEWER request.
|
|
288
|
-
return /*#__PURE__*/_jsx(EventStepperFooter, {
|
|
289
|
-
currentIndex: index,
|
|
290
|
-
totalItems: total,
|
|
291
|
-
itemLabel: "Request",
|
|
292
|
-
applySafeAreaInset: applySafeAreaInset,
|
|
293
|
-
onPrevious: stepPrevious,
|
|
294
|
-
onNext: stepNext
|
|
295
|
-
});
|
|
296
|
-
});
|
|
1
|
+
"use strict";import{memo as k,useEffect as T,useMemo as w}from"react";import{useLimit as D}from"@buoy-gg/shared-ui";import{useNetworkEventList as E}from"../hooks/useNetworkEventList";import{useNetworkSaved as F}from"../hooks/useNetworkSaved";import{useNetworkCursor as L}from"../hooks/useNetworkSelection";import{networkSelectionStore as x,toSelectionIds as A}from"../utils/networkSelectionStore";import{splitPinned as N}from"../utils/withPinnedFirst";import{selectSavedEvents as j}from"../utils/selectSavedEvents";import{jsx as t,jsxs as c}from"react/jsx-runtime";const o={background:{base:"#0A0A0C",card:"#1A1A1C"},border:{default:"#2D2D2F"},text:{primary:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93"}};function S({size:n=14,color:r="currentColor",children:i}){return t("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:i})}const I=n=>t(S,{...n,children:t("path",{d:"m15 18-6-6 6-6"})});const z=n=>t(S,{...n,children:t("path",{d:"m9 18 6-6-6-6"})});const M=k(function n({currentIndex:r,totalItems:i,onPrevious:p,onNext:d,itemLabel:u="Event",subtitle:a,applySafeAreaInset:m=true}){if(i<=1)return null;const s=r===0;const l=r===i-1;return c("div",{style:{...e.footer,paddingBottom:m?"calc(12px + env(safe-area-inset-bottom, 0px))":12},children:[c("button",{type:"button",onClick:p,disabled:s,style:{...e.navButton,...s?e.navButtonDisabled:null},children:[t(I,{size:20,color:s?o.text.muted:o.text.primary}),t("span",{style:{...e.navButtonText,...s?e.navButtonTextDisabled:null},children:"Previous"})]}),c("div",{style:e.counterContainer,children:[c("span",{style:e.counterText,children:[u," ",r+1," of ",i]}),a?t("span",{style:e.subtitleText,children:a}):null]}),c("button",{type:"button",onClick:d,disabled:l,style:{...e.navButton,...l?e.navButtonDisabled:null},children:[t("span",{style:{...e.navButtonText,...l?e.navButtonTextDisabled:null},children:"Next"}),t(z,{size:20,color:l?o.text.muted:o.text.primary})]})]})});const e={footer:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"12px 16px 12px",backgroundColor:o.background.base,borderTop:`1px solid ${o.border.default}`,boxShadow:"0 -2px 4px rgba(0, 0, 0, 0.1)",flexShrink:0},navButton:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:6,padding:"8px 12px",borderRadius:6,backgroundColor:o.background.card,minWidth:100,boxSizing:"border-box",justifyContent:"center",border:"none",cursor:"pointer",margin:0},navButtonDisabled:{opacity:.3,cursor:"default"},navButtonText:{fontSize:12,fontWeight:600,color:o.text.primary,fontFamily:"ui-monospace, Menlo, monospace",textTransform:"uppercase"},navButtonTextDisabled:{color:o.text.muted},counterContainer:{display:"flex",flexDirection:"column",alignItems:"center"},counterText:{fontSize:14,fontWeight:700,color:o.text.primary,fontFamily:"ui-monospace, Menlo, monospace",textTransform:"uppercase"},subtitleText:{fontSize:11,color:o.text.secondary,fontFamily:"ui-monospace, Menlo, monospace",marginTop:2}};const R=()=>x.step(-1);const W=()=>x.step(1);export const NetworkDetailStepper=k(function n({paused:r,filter:i,ignoredPatterns:p,isPro:d,fromSaved:u,savedSearch:a,applySafeAreaInset:m}){const{visibleEvents:s}=E({filter:i,ignoredPatterns:p,paused:r,isPro:d});const{pinnedEvents:l,pinnedLiveIds:f,savedRecords:v}=F();const C=D("network.saved");const b=w(()=>{if(u){return j(v,C,a).events}const{pinned:h,rest:g}=N(s,l,f);return h.length===0?g:[...h,...g]},[u,v,a,d,s,l,f]);T(()=>{x.setIds(A(b))},[b]);const{index:y,total:B}=L();if(y<0)return null;return t(M,{currentIndex:y,totalItems:B,itemLabel:"Request",applySafeAreaInset:m,onPrevious:R,onNext:W})});
|