@buoy-gg/network 7.0.40 → 7.0.42
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 -79
- package/lib/commonjs/index.js +1 -325
- 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 -404
- package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -625
- 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 -110
- 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 -453
- package/lib/commonjs/network/overrides/engine.js +1 -93
- package/lib/commonjs/network/overrides/matchRule.js +1 -81
- package/lib/commonjs/network/overrides/overriddenRows.js +1 -0
- 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 -393
- package/lib/commonjs/network/utils/networkListener.js +4 -1259
- 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 -0
- package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -0
- package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
- package/lib/commonjs/network/utils/startNetworkCapture.js +1 -0
- package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
- package/lib/commonjs/preset.js +1 -102
- package/lib/module/index.js +1 -103
- 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 -400
- package/lib/module/network/components/NetworkListScreen.web.js +1 -623
- 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 -106
- 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 -446
- package/lib/module/network/overrides/engine.js +1 -85
- package/lib/module/network/overrides/matchRule.js +1 -75
- package/lib/module/network/overrides/overriddenRows.js +1 -0
- 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 -391
- package/lib/module/network/utils/networkListener.js +4 -1249
- 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 -0
- package/lib/module/network/utils/resolveRequestUrl.js +1 -0
- package/lib/module/network/utils/selectSavedEvents.js +1 -35
- package/lib/module/network/utils/startNetworkCapture.js +1 -0
- package/lib/module/network/utils/withPinnedFirst.js +1 -28
- package/lib/module/preset.js +1 -100
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/network/overrides/applyToXhr.d.ts +1 -0
- 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/overriddenRows.d.ts +16 -0
- 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 +14 -4
- package/lib/typescript/network/utils/networkSavedStore.d.ts +4 -4
- package/lib/typescript/network/utils/realNow.d.ts +18 -0
- package/lib/typescript/network/utils/requestId.d.ts +2 -0
- package/lib/typescript/network/utils/resolveRequestUrl.d.ts +3 -0
- package/lib/typescript/network/utils/startNetworkCapture.d.ts +6 -0
- package/lib/web/index.mjs +145 -0
- package/package.json +32 -10
- 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/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/selectSavedEvents.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,375 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NetworkClearButton = NetworkClearButton;
|
|
7
|
-
exports.NetworkDetailPinActions = NetworkDetailPinActions;
|
|
8
|
-
exports.NetworkHeaderBadges = NetworkHeaderBadges;
|
|
9
|
-
exports.NetworkHeaderBadgesView = NetworkHeaderBadgesView;
|
|
10
|
-
exports.NetworkHeaderCopyButton = NetworkHeaderCopyButton;
|
|
11
|
-
exports.NetworkSavedButton = NetworkSavedButton;
|
|
12
|
-
var _reactNative = require("react-native");
|
|
13
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
14
|
-
var _networkEventStore = require("../utils/networkEventStore");
|
|
15
|
-
var _networkSavedStore = require("../utils/networkSavedStore");
|
|
16
|
-
var _useNetworkSaved = require("../hooks/useNetworkSaved");
|
|
17
|
-
var _useNetworkSelection = require("../hooks/useNetworkSelection");
|
|
18
|
-
var _useNetworkBadgeCounts = require("../hooks/useNetworkBadgeCounts");
|
|
19
|
-
var _useNetworkHasMatches = require("../hooks/useNetworkHasMatches");
|
|
20
|
-
var _generateNetworkCopyText = require("../utils/generateNetworkCopyText");
|
|
21
|
-
var _filterNetworkEvents = require("../utils/filterNetworkEvents");
|
|
22
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
/**
|
|
24
|
-
* The header pieces that consume LIVE event data, decomposed out of
|
|
25
|
-
* NetworkModal per rule3 (decompose by responsibility) so each one is its
|
|
26
|
-
* own narrow store subscriber and the modal root/header never re-render
|
|
27
|
-
* per network event:
|
|
28
|
-
*
|
|
29
|
-
* - `NetworkHeaderBadges` — success/error/pending count chips
|
|
30
|
-
* - `NetworkClearButton` — trash button (enabled = store has events;
|
|
31
|
-
* clear handler co-located here per rule2)
|
|
32
|
-
* - `NetworkHeaderCopyButton` — copy-all button; the copy TEXT is
|
|
33
|
-
* resolved lazily at press time (CopyButton accepts a function value —
|
|
34
|
-
* rule2's latest-ref pattern), so no string is built per event
|
|
35
|
-
*
|
|
36
|
-
* Profiling evidence for this decomposition: tool-bench 2026-07-06 —
|
|
37
|
-
* Trash2/CopyButton re-rendered 15× for 15 network events when the
|
|
38
|
-
* subscription lived at the modal root.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/** Success / error / pending chips — tap to toggle the status filter. */
|
|
42
|
-
function NetworkHeaderBadges({
|
|
43
|
-
activeStatus,
|
|
44
|
-
onToggleStatus,
|
|
45
|
-
ignoredPatterns,
|
|
46
|
-
paused
|
|
47
|
-
}) {
|
|
48
|
-
const counts = (0, _useNetworkBadgeCounts.useNetworkBadgeCounts)({
|
|
49
|
-
ignoredPatterns,
|
|
50
|
-
paused
|
|
51
|
-
});
|
|
52
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(NetworkHeaderBadgesView, {
|
|
53
|
-
counts: counts,
|
|
54
|
-
activeStatus: activeStatus,
|
|
55
|
-
onToggleStatus: onToggleStatus
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* The chips themselves, fed by props — what the parity sheet renders with
|
|
60
|
-
* fixture counts (`NetworkHeaderBadges` reads the live store).
|
|
61
|
-
*/
|
|
62
|
-
function NetworkHeaderBadgesView({
|
|
63
|
-
counts,
|
|
64
|
-
activeStatus,
|
|
65
|
-
onToggleStatus
|
|
66
|
-
}) {
|
|
67
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
68
|
-
style: styles.headerChipRow,
|
|
69
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
70
|
-
style: [styles.headerChip, activeStatus === "success" && styles.headerChipActive],
|
|
71
|
-
onPress: () => onToggleStatus("success"),
|
|
72
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.CheckCircle, {
|
|
73
|
-
size: 12,
|
|
74
|
-
color: _sharedUi.macOSColors.semantic.success
|
|
75
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
76
|
-
style: [styles.headerChipValue, {
|
|
77
|
-
color: _sharedUi.macOSColors.semantic.success
|
|
78
|
-
}],
|
|
79
|
-
children: counts.successful
|
|
80
|
-
})]
|
|
81
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
82
|
-
style: [styles.headerChip, activeStatus === "error" && styles.headerChipActive],
|
|
83
|
-
onPress: () => onToggleStatus("error"),
|
|
84
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.XCircle, {
|
|
85
|
-
size: 12,
|
|
86
|
-
color: _sharedUi.macOSColors.semantic.error
|
|
87
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
88
|
-
style: [styles.headerChipValue, {
|
|
89
|
-
color: _sharedUi.macOSColors.semantic.error
|
|
90
|
-
}],
|
|
91
|
-
children: counts.failed
|
|
92
|
-
})]
|
|
93
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
94
|
-
style: [styles.headerChip, activeStatus === "pending" && styles.headerChipActive],
|
|
95
|
-
onPress: () => onToggleStatus("pending"),
|
|
96
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Clock, {
|
|
97
|
-
size: 12,
|
|
98
|
-
color: _sharedUi.macOSColors.semantic.warning
|
|
99
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
100
|
-
style: [styles.headerChipValue, {
|
|
101
|
-
color: _sharedUi.macOSColors.semantic.warning
|
|
102
|
-
}],
|
|
103
|
-
children: counts.pending
|
|
104
|
-
})]
|
|
105
|
-
})]
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/** Trash button — handler co-located; enabled while the store has events.
|
|
109
|
-
* Subscribes to a flip-guarded boolean, so it renders when the store goes
|
|
110
|
-
* empty↔non-empty, not on every count change. */
|
|
111
|
-
function NetworkClearButton({
|
|
112
|
-
paused
|
|
113
|
-
}) {
|
|
114
|
-
const hasEvents = (0, _useNetworkHasMatches.useNetworkHasEvents)({
|
|
115
|
-
paused
|
|
116
|
-
});
|
|
117
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
118
|
-
"sentry-label": "ignore clear events",
|
|
119
|
-
testID: "buoy-network-clear",
|
|
120
|
-
accessibilityLabel: "Clear network requests",
|
|
121
|
-
accessibilityRole: "button",
|
|
122
|
-
onPress: () => _networkEventStore.networkEventStore.clearEvents(),
|
|
123
|
-
style: [styles.headerActionButton, !hasEvents && styles.headerActionButtonDisabled],
|
|
124
|
-
disabled: !hasEvents,
|
|
125
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
|
|
126
|
-
size: 14,
|
|
127
|
-
color: hasEvents ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
|
|
128
|
-
})
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Entry point to the Saved screen, with its count. A self-subscribing leaf so
|
|
133
|
-
* the badge tracks the store without the modal header re-rendering.
|
|
134
|
-
*/
|
|
135
|
-
function NetworkSavedButton({
|
|
136
|
-
onPress
|
|
137
|
-
}) {
|
|
138
|
-
const {
|
|
139
|
-
savedRecords
|
|
140
|
-
} = (0, _useNetworkSaved.useNetworkSaved)();
|
|
141
|
-
const count = savedRecords.length;
|
|
142
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
143
|
-
"sentry-label": "ignore open saved",
|
|
144
|
-
onPress: onPress,
|
|
145
|
-
accessibilityLabel: "Saved requests",
|
|
146
|
-
style: styles.headerActionButton,
|
|
147
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Bookmark, {
|
|
148
|
-
size: 14,
|
|
149
|
-
color: count > 0 ? _sharedUi.night.color.accent : _sharedUi.night.color.textSecondary
|
|
150
|
-
}), count > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
151
|
-
style: styles.savedBadge,
|
|
152
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
153
|
-
style: styles.savedBadgeText,
|
|
154
|
-
children: count > 99 ? "99+" : count
|
|
155
|
-
})
|
|
156
|
-
}) : null]
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Pin + Save toggles for the request-detail header.
|
|
161
|
-
*
|
|
162
|
-
* Lives here, as a self-subscribing leaf, for two reasons. First the usual
|
|
163
|
-
* one: the modal root stays free of subscriptions. Second, and the real
|
|
164
|
-
* constraint — these buttons deliberately do NOT go inside
|
|
165
|
-
* `NetworkEventDetailView`, because the Events tool renders that same detail
|
|
166
|
-
* view (UnifiedEventDetail) and has no saved store behind it. The header is
|
|
167
|
-
* the Network tool's own surface, so the feature stays where it belongs.
|
|
168
|
-
*
|
|
169
|
-
* The event object is resolved at PRESS time rather than held as a prop: the
|
|
170
|
-
* live store has the fresh copy while the request is in flight, and the saved
|
|
171
|
-
* store is the only copy once it has been cleared or aged out.
|
|
172
|
-
*
|
|
173
|
-
* The selected id is SUBSCRIBED here rather than passed down, so stepping
|
|
174
|
-
* through requests doesn't have to re-render the modal root just to rebuild
|
|
175
|
-
* the header around a new prop.
|
|
176
|
-
*/
|
|
177
|
-
function NetworkDetailPinActions({
|
|
178
|
-
isPro,
|
|
179
|
-
onUpgradePress
|
|
180
|
-
}) {
|
|
181
|
-
const eventId = (0, _useNetworkSelection.useSelectedNetworkEventId)();
|
|
182
|
-
const state = (0, _useNetworkSaved.useNetworkSaved)();
|
|
183
|
-
const {
|
|
184
|
-
pinned,
|
|
185
|
-
saved
|
|
186
|
-
} = (0, _networkSavedStore.flagsForEventId)(state, eventId);
|
|
187
|
-
const savedLimit = (0, _sharedUi.useLimit)("network.saved");
|
|
188
|
-
const atPinCap = !pinned && state.pinnedEvents.length >= _networkSavedStore.MAX_PINNED;
|
|
189
|
-
const atSavedCap = !saved && state.savedRecords.length >= savedLimit;
|
|
190
|
-
const resolveEvent = () => {
|
|
191
|
-
if (!eventId) return null;
|
|
192
|
-
return _networkEventStore.networkEventStore.getEvents().find(event => event.id === eventId) ?? _networkSavedStore.networkSavedStore.getEventById(eventId);
|
|
193
|
-
};
|
|
194
|
-
const handlePin = () => {
|
|
195
|
-
const event = resolveEvent();
|
|
196
|
-
if (event) state.togglePin(event);
|
|
197
|
-
};
|
|
198
|
-
const handleSave = () => {
|
|
199
|
-
// Hitting the free ceiling is an upgrade moment, not a dead button.
|
|
200
|
-
if (atSavedCap && !isPro) {
|
|
201
|
-
onUpgradePress();
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
const event = resolveEvent();
|
|
205
|
-
if (event) state.toggleSave(event);
|
|
206
|
-
};
|
|
207
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
208
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
209
|
-
"sentry-label": "ignore pin request",
|
|
210
|
-
onPress: handlePin,
|
|
211
|
-
disabled: atPinCap,
|
|
212
|
-
testID: "buoy-network-pin",
|
|
213
|
-
accessibilityRole: "button",
|
|
214
|
-
accessibilityLabel: pinned ? "Unpin request" : "Pin request",
|
|
215
|
-
accessibilityHint: atPinCap ? `Pin limit reached (${_networkSavedStore.MAX_PINNED})` : undefined,
|
|
216
|
-
style: [styles.headerActionButton, pinned && styles.headerActionButtonActive, atPinCap && styles.headerActionButtonDisabled],
|
|
217
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Pin, {
|
|
218
|
-
size: 14,
|
|
219
|
-
active: pinned,
|
|
220
|
-
color: pinned ? _sharedUi.night.color.accent : atPinCap ? _sharedUi.night.color.textTertiary : _sharedUi.night.color.textSecondary
|
|
221
|
-
})
|
|
222
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
223
|
-
"sentry-label": "ignore save request",
|
|
224
|
-
onPress: handleSave,
|
|
225
|
-
disabled: atSavedCap && isPro,
|
|
226
|
-
testID: "buoy-network-save",
|
|
227
|
-
accessibilityRole: "button",
|
|
228
|
-
accessibilityLabel: saved ? "Remove from saved" : "Save request",
|
|
229
|
-
accessibilityHint: atSavedCap && isPro ? `Saved limit reached (${_networkSavedStore.MAX_SAVED})` : undefined,
|
|
230
|
-
style: [styles.headerActionButton, saved && styles.headerActionButtonSaved, atSavedCap && isPro && styles.headerActionButtonDisabled],
|
|
231
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Bookmark, {
|
|
232
|
-
size: 14,
|
|
233
|
-
color: saved ? _sharedUi.night.color.accent : atSavedCap && isPro ? _sharedUi.night.color.textTertiary : _sharedUi.night.color.textSecondary
|
|
234
|
-
})
|
|
235
|
-
})]
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Copy-all-requests button. Subscribes to a flip-guarded boolean (its
|
|
240
|
-
* enabled state); the copy text is generated at PRESS time from a live
|
|
241
|
-
* store read, so there's no per-event work and no stale closure.
|
|
242
|
-
*/
|
|
243
|
-
function NetworkHeaderCopyButton({
|
|
244
|
-
isPro,
|
|
245
|
-
filter,
|
|
246
|
-
ignoredPatterns,
|
|
247
|
-
copySettings,
|
|
248
|
-
paused,
|
|
249
|
-
onUpgradePress,
|
|
250
|
-
label
|
|
251
|
-
}) {
|
|
252
|
-
const hasEvents = (0, _useNetworkHasMatches.useNetworkHasMatches)({
|
|
253
|
-
filter,
|
|
254
|
-
ignoredPatterns,
|
|
255
|
-
paused
|
|
256
|
-
});
|
|
257
|
-
if (!isPro) {
|
|
258
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
259
|
-
"sentry-label": "ignore copy pro",
|
|
260
|
-
onPress: onUpgradePress,
|
|
261
|
-
style: [label ? styles.copyMenuRow : styles.headerActionButton, !hasEvents && styles.headerActionButtonDisabled],
|
|
262
|
-
disabled: !hasEvents,
|
|
263
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Copy, {
|
|
264
|
-
size: 14,
|
|
265
|
-
color: hasEvents ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
|
|
266
|
-
}), label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
267
|
-
style: styles.copyMenuLabel,
|
|
268
|
-
children: label
|
|
269
|
-
}) : null]
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.CopyButton
|
|
273
|
-
// Lazy value: resolved at copy time by CopyButton's latest-ref
|
|
274
|
-
// pattern, reading the LIVE store — no per-event work, no staleness.
|
|
275
|
-
, {
|
|
276
|
-
value: () => (0, _generateNetworkCopyText.generateNetworkCopyText)((0, _filterNetworkEvents.filterNetworkEvents)((0, _filterNetworkEvents.applyIgnoredPatterns)(_networkEventStore.networkEventStore.getEvents(), ignoredPatterns), filter), copySettings),
|
|
277
|
-
size: 14,
|
|
278
|
-
label: label,
|
|
279
|
-
buttonStyle: label ? styles.copyMenuRow : styles.headerActionButton,
|
|
280
|
-
labelStyle: styles.copyMenuLabel,
|
|
281
|
-
colors: {
|
|
282
|
-
idle: hasEvents ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary,
|
|
283
|
-
success: _sharedUi.macOSColors.semantic.success,
|
|
284
|
-
error: _sharedUi.macOSColors.semantic.error
|
|
285
|
-
},
|
|
286
|
-
disabled: !hasEvents
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
const styles = _reactNative.StyleSheet.create({
|
|
290
|
-
/** The overflow-menu variant: a full-width row, matching the other items. */
|
|
291
|
-
copyMenuRow: {
|
|
292
|
-
flexDirection: "row",
|
|
293
|
-
alignItems: "center",
|
|
294
|
-
gap: 10,
|
|
295
|
-
paddingHorizontal: 6,
|
|
296
|
-
paddingVertical: 11,
|
|
297
|
-
justifyContent: "flex-start"
|
|
298
|
-
},
|
|
299
|
-
copyMenuLabel: {
|
|
300
|
-
fontSize: 13,
|
|
301
|
-
fontWeight: "600",
|
|
302
|
-
color: _sharedUi.night.color.text
|
|
303
|
-
},
|
|
304
|
-
headerChipRow: {
|
|
305
|
-
flexDirection: "row",
|
|
306
|
-
alignItems: "center",
|
|
307
|
-
gap: 8
|
|
308
|
-
},
|
|
309
|
-
/**
|
|
310
|
-
* Counter chips and toolbar buttons on the night dark-glass fill — the
|
|
311
|
-
* hairline outline barely registers on the star field, and the fill marks
|
|
312
|
-
* the active filter in the brand accent (the night selection language).
|
|
313
|
-
* Status glyph/count colors stay on the classic semantic palette on
|
|
314
|
-
* purpose — see getStatusColor in NetworkEventItemCompact.
|
|
315
|
-
*/
|
|
316
|
-
headerChip: {
|
|
317
|
-
flexDirection: "row",
|
|
318
|
-
alignItems: "center",
|
|
319
|
-
gap: 4,
|
|
320
|
-
backgroundColor: _sharedUi.night.color.buttonSurface,
|
|
321
|
-
paddingHorizontal: 10,
|
|
322
|
-
paddingVertical: 5,
|
|
323
|
-
borderRadius: 12,
|
|
324
|
-
borderWidth: 1,
|
|
325
|
-
borderColor: _sharedUi.night.color.border
|
|
326
|
-
},
|
|
327
|
-
headerChipActive: {
|
|
328
|
-
backgroundColor: _sharedUi.night.color.accentSoft,
|
|
329
|
-
borderColor: _sharedUi.night.color.accentBorderStrong
|
|
330
|
-
},
|
|
331
|
-
headerChipValue: {
|
|
332
|
-
fontSize: 12,
|
|
333
|
-
fontWeight: "600",
|
|
334
|
-
fontFamily: _sharedUi.monoFont
|
|
335
|
-
},
|
|
336
|
-
headerActionButton: {
|
|
337
|
-
width: 32,
|
|
338
|
-
height: 32,
|
|
339
|
-
borderRadius: 8,
|
|
340
|
-
backgroundColor: _sharedUi.night.color.buttonSurface,
|
|
341
|
-
borderWidth: 1,
|
|
342
|
-
borderColor: _sharedUi.night.color.border,
|
|
343
|
-
alignItems: "center",
|
|
344
|
-
justifyContent: "center"
|
|
345
|
-
},
|
|
346
|
-
headerActionButtonDisabled: {
|
|
347
|
-
opacity: 0.55
|
|
348
|
-
},
|
|
349
|
-
headerActionButtonActive: {
|
|
350
|
-
backgroundColor: _sharedUi.night.color.accentSoft,
|
|
351
|
-
borderColor: _sharedUi.night.color.accentBorderStrong
|
|
352
|
-
},
|
|
353
|
-
headerActionButtonSaved: {
|
|
354
|
-
backgroundColor: _sharedUi.night.color.accentSoft,
|
|
355
|
-
borderColor: _sharedUi.night.color.accentBorderStrong
|
|
356
|
-
},
|
|
357
|
-
savedBadge: {
|
|
358
|
-
position: "absolute",
|
|
359
|
-
top: -3,
|
|
360
|
-
right: -3,
|
|
361
|
-
minWidth: 14,
|
|
362
|
-
height: 14,
|
|
363
|
-
paddingHorizontal: 3,
|
|
364
|
-
borderRadius: 7,
|
|
365
|
-
backgroundColor: _sharedUi.night.color.accent,
|
|
366
|
-
alignItems: "center",
|
|
367
|
-
justifyContent: "center"
|
|
368
|
-
},
|
|
369
|
-
savedBadgeText: {
|
|
370
|
-
color: _sharedUi.night.color.onAccent,
|
|
371
|
-
fontSize: 9,
|
|
372
|
-
fontWeight: "700",
|
|
373
|
-
fontFamily: _sharedUi.monoFont
|
|
374
|
-
}
|
|
375
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkClearButton=NetworkClearButton;exports.NetworkDetailPinActions=NetworkDetailPinActions;exports.NetworkHeaderBadges=NetworkHeaderBadges;exports.NetworkHeaderBadgesView=NetworkHeaderBadgesView;exports.NetworkHeaderCopyButton=NetworkHeaderCopyButton;exports.NetworkSavedButton=NetworkSavedButton;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _networkEventStore=require("../utils/networkEventStore");var _networkSavedStore=require("../utils/networkSavedStore");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useNetworkSelection=require("../hooks/useNetworkSelection");var _useNetworkBadgeCounts=require("../hooks/useNetworkBadgeCounts");var _useNetworkHasMatches=require("../hooks/useNetworkHasMatches");var _generateNetworkCopyText=require("../utils/generateNetworkCopyText");var _filterNetworkEvents=require("../utils/filterNetworkEvents");var _jsxRuntime=require("react/jsx-runtime");function NetworkHeaderBadges({activeStatus:t,onToggleStatus:o,ignoredPatterns:e,paused:n}){const i=(0,_useNetworkBadgeCounts.useNetworkBadgeCounts)({ignoredPatterns:e,paused:n});return(0,_jsxRuntime.jsx)(NetworkHeaderBadgesView,{counts:i,activeStatus:t,onToggleStatus:o})}function NetworkHeaderBadgesView({counts:t,activeStatus:o,onToggleStatus:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChipRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,o==="success"&&styles.headerChipActive],onPress:()=>e("success"),children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle,{size:12,color:_sharedUi.macOSColors.semantic.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.success}],children:t.successful})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,o==="error"&&styles.headerChipActive],onPress:()=>e("error"),children:[(0,_jsxRuntime.jsx)(_sharedUi.XCircle,{size:12,color:_sharedUi.macOSColors.semantic.error}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.error}],children:t.failed})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,o==="pending"&&styles.headerChipActive],onPress:()=>e("pending"),children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.warning}],children:t.pending})]})]})}function NetworkClearButton({paused:t}){const o=(0,_useNetworkHasMatches.useNetworkHasEvents)({paused:t});return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{"sentry-label":"ignore clear events",testID:"buoy-network-clear",accessibilityLabel:"Clear network requests",accessibilityRole:"button",onPress:()=>_networkEventStore.networkEventStore.clearEvents(),style:[styles.headerActionButton,!o&&styles.headerActionButtonDisabled],disabled:!o,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:o?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})})}function NetworkSavedButton({onPress:t}){const{savedRecords:o}=(0,_useNetworkSaved.useNetworkSaved)();const e=o.length;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{"sentry-label":"ignore open saved",onPress:t,accessibilityLabel:"Saved requests",style:styles.headerActionButton,children:[(0,_jsxRuntime.jsx)(_sharedUi.Bookmark,{size:14,color:e>0?_sharedUi.night.color.accent:_sharedUi.night.color.textSecondary}),e>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.savedBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.savedBadgeText,children:e>99?"99+":e})}):null]})}function NetworkDetailPinActions({isPro:t,onUpgradePress:o}){const e=(0,_useNetworkSelection.useSelectedNetworkEventId)();const n=(0,_useNetworkSaved.useNetworkSaved)();const{pinned:i,saved:c}=(0,_networkSavedStore.flagsForEventId)(n,e);const s=(0,_sharedUi.useLimit)("network.saved");const r=!i&&n.pinnedEvents.length>=_networkSavedStore.MAX_PINNED;const l=!c&&n.savedRecords.length>=s;const d=()=>{if(!e)return null;return _networkEventStore.networkEventStore.getEvents().find(a=>a.id===e)??_networkSavedStore.networkSavedStore.getEventById(e)};const u=()=>{const a=d();if(a)n.togglePin(a)};const h=()=>{if(l&&!t){o();return}const a=d();if(a)n.toggleSave(a)};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{"sentry-label":"ignore pin request",onPress:u,disabled:r,testID:"buoy-network-pin",accessibilityRole:"button",accessibilityLabel:i?"Unpin request":"Pin request",accessibilityHint:r?`Pin limit reached (${_networkSavedStore.MAX_PINNED})`:void 0,style:[styles.headerActionButton,i&&styles.headerActionButtonActive,r&&styles.headerActionButtonDisabled],children:(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:14,active:i,color:i?_sharedUi.night.color.accent:r?_sharedUi.night.color.textTertiary:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{"sentry-label":"ignore save request",onPress:h,disabled:l&&t,testID:"buoy-network-save",accessibilityRole:"button",accessibilityLabel:c?"Remove from saved":"Save request",accessibilityHint:l&&t?`Saved limit reached (${_networkSavedStore.MAX_SAVED})`:void 0,style:[styles.headerActionButton,c&&styles.headerActionButtonSaved,l&&t&&styles.headerActionButtonDisabled],children:(0,_jsxRuntime.jsx)(_sharedUi.Bookmark,{size:14,color:c?_sharedUi.night.color.accent:l&&t?_sharedUi.night.color.textTertiary:_sharedUi.night.color.textSecondary})})]})}function NetworkHeaderCopyButton({isPro:t,filter:o,ignoredPatterns:e,copySettings:n,paused:i,onUpgradePress:c,label:s}){const r=(0,_useNetworkHasMatches.useNetworkHasMatches)({filter:o,ignoredPatterns:e,paused:i});if(!t){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{"sentry-label":"ignore copy pro",onPress:c,style:[s?styles.copyMenuRow:styles.headerActionButton,!r&&styles.headerActionButtonDisabled],disabled:!r,children:[(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:r?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary}),s?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.copyMenuLabel,children:s}):null]})}return(0,_jsxRuntime.jsx)(_sharedUi.CopyButton,{value:()=>(0,_generateNetworkCopyText.generateNetworkCopyText)((0,_filterNetworkEvents.filterNetworkEvents)((0,_filterNetworkEvents.applyIgnoredPatterns)(_networkEventStore.networkEventStore.getEvents(),e),o),n),size:14,label:s,buttonStyle:s?styles.copyMenuRow:styles.headerActionButton,labelStyle:styles.copyMenuLabel,colors:{idle:r?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary,success:_sharedUi.macOSColors.semantic.success,error:_sharedUi.macOSColors.semantic.error},disabled:!r})}const styles=_reactNative.StyleSheet.create({copyMenuRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:6,paddingVertical:11,justifyContent:"flex-start"},copyMenuLabel:{fontSize:13,fontWeight:"600",color:_sharedUi.night.color.text},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.buttonSurface,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:_sharedUi.night.color.border},headerChipActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:_sharedUi.monoFont},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.night.color.buttonSurface,borderWidth:1,borderColor:_sharedUi.night.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},headerActionButtonSaved:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},savedBadge:{position:"absolute",top:-3,right:-3,minWidth:14,height:14,paddingHorizontal:3,borderRadius:7,backgroundColor:_sharedUi.night.color.accent,alignItems:"center",justifyContent:"center"},savedBadgeText:{color:_sharedUi.night.color.onAccent,fontSize:9,fontWeight:"700",fontFamily:_sharedUi.monoFont}});
|