@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,190 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NetworkHeaderMenu = NetworkHeaderMenu;
|
|
7
|
-
exports.NetworkHeaderMenuButton = NetworkHeaderMenuButton;
|
|
8
|
-
exports.NetworkHeaderMenuItem = NetworkHeaderMenuItem;
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/**
|
|
13
|
-
* The header's overflow menu.
|
|
14
|
-
*
|
|
15
|
-
* The toolbar had grown to three status badges and six icon buttons, which on a
|
|
16
|
-
* 402pt screen meant the pending badge was being overlapped by the search
|
|
17
|
-
* button. Something had to leave, and the rule for deciding what is:
|
|
18
|
-
*
|
|
19
|
-
* **A control that COMMUNICATES STATE stays visible. A destination or a rare
|
|
20
|
-
* action goes in the menu.**
|
|
21
|
-
*
|
|
22
|
-
* That keeps the power toggle (are we capturing?), the overrides flask (is the
|
|
23
|
-
* app being lied to, and how many rules?), the status badges (what happened)
|
|
24
|
-
* and Clear (the reproduce loop is clear → repro → read, and burying the first
|
|
25
|
-
* step doubles it). Search stays because it's the only way through 500 rows.
|
|
26
|
-
*
|
|
27
|
-
* Filters, Saved and Copy leave. Filters is the interesting one — it does show
|
|
28
|
-
* state, so the ⋯ carries a dot when a filter is applied rather than hiding
|
|
29
|
-
* that fact.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
function NetworkHeaderMenuButton({
|
|
33
|
-
onPress,
|
|
34
|
-
isOpen,
|
|
35
|
-
hasIndicator
|
|
36
|
-
}) {
|
|
37
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
38
|
-
onPress: onPress,
|
|
39
|
-
"sentry-label": "ignore toggle header menu",
|
|
40
|
-
testID: "buoy-network-menu",
|
|
41
|
-
accessibilityRole: "button",
|
|
42
|
-
accessibilityLabel: isOpen ? "Close menu" : "More actions",
|
|
43
|
-
style: [styles.button, isOpen && styles.buttonOpen],
|
|
44
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
45
|
-
style: styles.dots,
|
|
46
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
47
|
-
style: [styles.dot, isOpen && styles.dotOpen]
|
|
48
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
49
|
-
style: [styles.dot, isOpen && styles.dotOpen]
|
|
50
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
51
|
-
style: [styles.dot, isOpen && styles.dotOpen]
|
|
52
|
-
})]
|
|
53
|
-
}), hasIndicator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
54
|
-
style: styles.indicator
|
|
55
|
-
}) : null]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* The dropdown itself, rendered in the modal BODY rather than the header —
|
|
60
|
-
* the header is a fixed-height row and anything overflowing it is clipped, so
|
|
61
|
-
* a panel anchored to the top-right of the body lands exactly where a dropdown
|
|
62
|
-
* from the ⋯ should appear.
|
|
63
|
-
*/
|
|
64
|
-
function NetworkHeaderMenu({
|
|
65
|
-
onClose,
|
|
66
|
-
children
|
|
67
|
-
}) {
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
69
|
-
style: styles.overlay,
|
|
70
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
71
|
-
style: styles.backdrop,
|
|
72
|
-
activeOpacity: 1,
|
|
73
|
-
onPress: onClose,
|
|
74
|
-
"sentry-label": "ignore dismiss header menu"
|
|
75
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
76
|
-
style: styles.panel,
|
|
77
|
-
children: children
|
|
78
|
-
})]
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function NetworkHeaderMenuItem({
|
|
82
|
-
icon,
|
|
83
|
-
label,
|
|
84
|
-
detail,
|
|
85
|
-
testID,
|
|
86
|
-
onPress
|
|
87
|
-
}) {
|
|
88
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
89
|
-
onPress: onPress,
|
|
90
|
-
"sentry-label": "ignore header menu item",
|
|
91
|
-
testID: testID,
|
|
92
|
-
accessibilityRole: "button",
|
|
93
|
-
accessibilityLabel: label,
|
|
94
|
-
style: styles.item,
|
|
95
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
96
|
-
style: styles.itemIcon,
|
|
97
|
-
children: icon
|
|
98
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
99
|
-
style: styles.itemLabel,
|
|
100
|
-
children: label
|
|
101
|
-
}), detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
102
|
-
style: styles.itemDetail,
|
|
103
|
-
children: detail
|
|
104
|
-
}) : null]
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
const styles = _reactNative.StyleSheet.create({
|
|
108
|
-
// The same 32×32 box every other header action uses, minus the fill and
|
|
109
|
-
// border. Padding alone gave a 3pt-wide hit area AND a shorter box than its
|
|
110
|
-
// neighbours, which is why the dots sat high in the row; a fixed square
|
|
111
|
-
// centres the glyph on the same baseline as the search/power/clear icons.
|
|
112
|
-
button: {
|
|
113
|
-
width: 32,
|
|
114
|
-
height: 32,
|
|
115
|
-
borderRadius: 8,
|
|
116
|
-
alignItems: "center",
|
|
117
|
-
justifyContent: "center"
|
|
118
|
-
},
|
|
119
|
-
// Only lit while the menu is down — the button is the one thing not covered
|
|
120
|
-
// by the backdrop, so it has to look like the thing that is currently open.
|
|
121
|
-
buttonOpen: {
|
|
122
|
-
backgroundColor: _sharedUi.night.color.surfaceElevated
|
|
123
|
-
},
|
|
124
|
-
dots: {
|
|
125
|
-
flexDirection: "column",
|
|
126
|
-
gap: 2.5,
|
|
127
|
-
alignItems: "center"
|
|
128
|
-
},
|
|
129
|
-
dot: {
|
|
130
|
-
width: 3,
|
|
131
|
-
height: 3,
|
|
132
|
-
borderRadius: 2,
|
|
133
|
-
backgroundColor: _sharedUi.night.color.textSecondary
|
|
134
|
-
},
|
|
135
|
-
dotOpen: {
|
|
136
|
-
backgroundColor: _sharedUi.night.color.text
|
|
137
|
-
},
|
|
138
|
-
indicator: {
|
|
139
|
-
position: "absolute",
|
|
140
|
-
// Sits just up-and-right of the top dot. Anchored to the 32pt box's corner
|
|
141
|
-
// it would float off on its own, since the dot column is only 3pt wide.
|
|
142
|
-
top: 6,
|
|
143
|
-
right: 8,
|
|
144
|
-
width: 6,
|
|
145
|
-
height: 6,
|
|
146
|
-
borderRadius: 3,
|
|
147
|
-
backgroundColor: _sharedUi.night.color.accent
|
|
148
|
-
},
|
|
149
|
-
overlay: {
|
|
150
|
-
..._sharedUi.absoluteFill,
|
|
151
|
-
zIndex: 50
|
|
152
|
-
},
|
|
153
|
-
backdrop: {
|
|
154
|
-
..._sharedUi.absoluteFill,
|
|
155
|
-
backgroundColor: "rgba(0,0,0,0.5)"
|
|
156
|
-
},
|
|
157
|
-
// The night card: near-black surface, hairline border, row radius.
|
|
158
|
-
panel: {
|
|
159
|
-
position: "absolute",
|
|
160
|
-
top: 6,
|
|
161
|
-
right: 8,
|
|
162
|
-
minWidth: 196,
|
|
163
|
-
paddingVertical: 4,
|
|
164
|
-
borderRadius: 10,
|
|
165
|
-
borderWidth: 1,
|
|
166
|
-
borderColor: _sharedUi.night.color.border,
|
|
167
|
-
backgroundColor: _sharedUi.night.color.surface
|
|
168
|
-
},
|
|
169
|
-
item: {
|
|
170
|
-
flexDirection: "row",
|
|
171
|
-
alignItems: "center",
|
|
172
|
-
gap: 10,
|
|
173
|
-
paddingHorizontal: 12,
|
|
174
|
-
paddingVertical: 11
|
|
175
|
-
},
|
|
176
|
-
itemIcon: {
|
|
177
|
-
width: 16,
|
|
178
|
-
alignItems: "center"
|
|
179
|
-
},
|
|
180
|
-
itemLabel: {
|
|
181
|
-
flex: 1,
|
|
182
|
-
fontSize: 13,
|
|
183
|
-
fontWeight: "600",
|
|
184
|
-
color: _sharedUi.night.color.text
|
|
185
|
-
},
|
|
186
|
-
itemDetail: {
|
|
187
|
-
fontSize: 11,
|
|
188
|
-
color: _sharedUi.night.color.textTertiary
|
|
189
|
-
}
|
|
190
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkHeaderMenu=NetworkHeaderMenu;exports.NetworkHeaderMenuButton=NetworkHeaderMenuButton;exports.NetworkHeaderMenuItem=NetworkHeaderMenuItem;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function NetworkHeaderMenuButton({onPress:t,isOpen:e,hasIndicator:o}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore toggle header menu",testID:"buoy-network-menu",accessibilityRole:"button",accessibilityLabel:e?"Close menu":"More actions",style:[styles.button,e&&styles.buttonOpen],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dots,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,e&&styles.dotOpen]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,e&&styles.dotOpen]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,e&&styles.dotOpen]})]}),o?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.indicator}):null]})}function NetworkHeaderMenu({onClose:t,children:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.backdrop,activeOpacity:1,onPress:t,"sentry-label":"ignore dismiss header menu"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.panel,children:e})]})}function NetworkHeaderMenuItem({icon:t,label:e,detail:o,testID:r,onPress:i}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:i,"sentry-label":"ignore header menu item",testID:r,accessibilityRole:"button",accessibilityLabel:e,style:styles.item,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.itemIcon,children:t}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.itemLabel,children:e}),o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.itemDetail,children:o}):null]})}const styles=_reactNative.StyleSheet.create({button:{width:32,height:32,borderRadius:8,alignItems:"center",justifyContent:"center"},buttonOpen:{backgroundColor:_sharedUi.night.color.surfaceElevated},dots:{flexDirection:"column",gap:2.5,alignItems:"center"},dot:{width:3,height:3,borderRadius:2,backgroundColor:_sharedUi.night.color.textSecondary},dotOpen:{backgroundColor:_sharedUi.night.color.text},indicator:{position:"absolute",top:6,right:8,width:6,height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.accent},overlay:{..._sharedUi.absoluteFill,zIndex:50},backdrop:{..._sharedUi.absoluteFill,backgroundColor:"rgba(0,0,0,0.5)"},panel:{position:"absolute",top:6,right:8,minWidth:196,paddingVertical:4,borderRadius:10,borderWidth:1,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface},item:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:11},itemIcon:{width:16,alignItems:"center"},itemLabel:{flex:1,fontSize:13,fontWeight:"600",color:_sharedUi.night.color.text},itemDetail:{fontSize:11,color:_sharedUi.night.color.textTertiary}});
|
|
@@ -1,403 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NetworkListScreen = NetworkListScreen;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _NetworkEventItemCompact = require("./NetworkEventItemCompact");
|
|
11
|
-
var _NetworkUpgradeBanner = require("./NetworkUpgradeBanner");
|
|
12
|
-
var _useNetworkEventList = require("../hooks/useNetworkEventList");
|
|
13
|
-
var _useNetworkSaved = require("../hooks/useNetworkSaved");
|
|
14
|
-
var _useOverrideRules = require("../hooks/useOverrideRules");
|
|
15
|
-
var _overriddenRows = require("../overrides/overriddenRows");
|
|
16
|
-
var _withPinnedFirst = require("../utils/withPinnedFirst");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
/**
|
|
19
|
-
* The network tool's LIST screen — owns the event-store subscription, the
|
|
20
|
-
* FlatList, empty state, disabled banner, and the free-tier locked-history
|
|
21
|
-
* footer. Decomposed from NetworkModal per rule3 so per-event re-renders
|
|
22
|
-
* are confined to this subtree (plus the header's live leaves) instead of
|
|
23
|
-
* the whole modal.
|
|
24
|
-
*
|
|
25
|
-
* Stable-tree contract (rule4): hooks run unconditionally, then the
|
|
26
|
-
* component returns null when not visible. The subscription is gated with
|
|
27
|
-
* `paused || !visible` so a hidden list doesn't subscribe at all.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
const keyExtractor = item => item.id;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The PINNED strip above the live list.
|
|
34
|
-
*
|
|
35
|
-
* It renders OUTSIDE the FlatList on purpose. The list's window/batch values
|
|
36
|
-
* are a measured configuration (see the FlatList below), and merging pins into
|
|
37
|
-
* `data` would mean sentinel items in `keyExtractor`/`renderItem` and a
|
|
38
|
-
* section boundary that moves as events arrive. Keeping pins in their own
|
|
39
|
-
* bounded strip (capped at MAX_PINNED in the store) leaves that tuning
|
|
40
|
-
* untouched — and makes "pins ignore the filters" fall out for free, because
|
|
41
|
-
* this strip is never handed the filter.
|
|
42
|
-
*/
|
|
43
|
-
function PinnedSection({
|
|
44
|
-
events,
|
|
45
|
-
onEventPress,
|
|
46
|
-
onLongPress,
|
|
47
|
-
savedLiveIds,
|
|
48
|
-
onClearPinned
|
|
49
|
-
}) {
|
|
50
|
-
if (events.length === 0) return null;
|
|
51
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
52
|
-
style: styles.pinnedSection,
|
|
53
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
54
|
-
style: styles.pinnedHeader,
|
|
55
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Pin, {
|
|
56
|
-
size: 11,
|
|
57
|
-
active: true,
|
|
58
|
-
color: _sharedUi.macOSColors.semantic.info
|
|
59
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
60
|
-
style: styles.pinnedTitle,
|
|
61
|
-
children: ["PINNED \xB7 ", events.length]
|
|
62
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
63
|
-
onPress: onClearPinned,
|
|
64
|
-
"sentry-label": "ignore unpin all",
|
|
65
|
-
style: styles.pinnedClear,
|
|
66
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
67
|
-
style: styles.pinnedClearText,
|
|
68
|
-
children: "Unpin all"
|
|
69
|
-
})
|
|
70
|
-
})]
|
|
71
|
-
}), events.map(event => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact, {
|
|
72
|
-
event: event,
|
|
73
|
-
onPress: onEventPress,
|
|
74
|
-
onLongPress: onLongPress,
|
|
75
|
-
pinned: true,
|
|
76
|
-
saved: savedLiveIds.has(event.id)
|
|
77
|
-
}, event.id))]
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The OVERRIDDEN strip, above the pins.
|
|
83
|
-
*
|
|
84
|
-
* An overridden request is the one thing in this list that isn't true — the app
|
|
85
|
-
* got something the server never sent. That has to be impossible to miss, and a
|
|
86
|
-
* glyph on a row twenty scroll-positions down isn't. It sits ABOVE pins because
|
|
87
|
-
* a stale override explains a bug, whereas a pin only marks one.
|
|
88
|
-
*
|
|
89
|
-
* Rows are matched against the RULES rather than filtered on the `override`
|
|
90
|
-
* mark, so the request you built a rule from hoists immediately instead of
|
|
91
|
-
* waiting for the endpoint to be called again.
|
|
92
|
-
*
|
|
93
|
-
* The header button is PAUSE, not "Manage". Flipping overrides off and on is by
|
|
94
|
-
* far the most repeated action in a testing session — force the failure, check
|
|
95
|
-
* the UI, turn it off, check the happy path, turn it back on — and it used to
|
|
96
|
-
* cost a trip to another screen each way. The manager is still one tap away on
|
|
97
|
-
* the toolbar; it just isn't the thing you reach for twenty times an hour.
|
|
98
|
-
*/
|
|
99
|
-
function OverriddenSection({
|
|
100
|
-
events,
|
|
101
|
-
onEventPress,
|
|
102
|
-
onLongPress,
|
|
103
|
-
savedLiveIds,
|
|
104
|
-
paused,
|
|
105
|
-
onTogglePaused
|
|
106
|
-
}) {
|
|
107
|
-
if (events.length === 0) return null;
|
|
108
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
109
|
-
style: [styles.overriddenSection, paused && styles.overriddenSectionOff],
|
|
110
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
111
|
-
style: styles.overriddenHeader,
|
|
112
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.FlaskConical, {
|
|
113
|
-
size: 11,
|
|
114
|
-
color: paused ? _sharedUi.macOSColors.text.muted : _sharedUi.macOSColors.semantic.warning
|
|
115
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
116
|
-
testID: "buoy-network-overridden-strip",
|
|
117
|
-
style: [styles.overriddenTitle, paused && styles.overriddenTitleOff],
|
|
118
|
-
children: paused ? `PAUSED · ${events.length}` : `OVERRIDDEN · ${events.length}`
|
|
119
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
120
|
-
onPress: onTogglePaused,
|
|
121
|
-
"sentry-label": "ignore pause overrides",
|
|
122
|
-
style: styles.overriddenManage,
|
|
123
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
124
|
-
style: [styles.overriddenManageText, paused && styles.overriddenTitleOff],
|
|
125
|
-
children: paused ? "Resume" : "Pause"
|
|
126
|
-
})
|
|
127
|
-
})]
|
|
128
|
-
}), events.map(event => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact, {
|
|
129
|
-
event: event,
|
|
130
|
-
onPress: onEventPress,
|
|
131
|
-
onLongPress: onLongPress,
|
|
132
|
-
overridden: true,
|
|
133
|
-
saved: savedLiveIds.has(event.id)
|
|
134
|
-
}, event.id))]
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
function NetworkListScreen({
|
|
138
|
-
visible,
|
|
139
|
-
paused,
|
|
140
|
-
filter,
|
|
141
|
-
ignoredPatterns,
|
|
142
|
-
isPro,
|
|
143
|
-
searchText,
|
|
144
|
-
onEventPress,
|
|
145
|
-
onUpgradePress
|
|
146
|
-
}) {
|
|
147
|
-
const {
|
|
148
|
-
visibleEvents,
|
|
149
|
-
hasLockedEvents,
|
|
150
|
-
lockedEventCount,
|
|
151
|
-
totalEvents
|
|
152
|
-
} = (0, _useNetworkEventList.useNetworkEventList)({
|
|
153
|
-
filter,
|
|
154
|
-
ignoredPatterns,
|
|
155
|
-
paused,
|
|
156
|
-
visible,
|
|
157
|
-
isPro
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// Pins come from the persisted saved store, NOT from the live list — that is
|
|
161
|
-
// what lets a pinned failure survive Clear, the 500-event cap and a reload.
|
|
162
|
-
const {
|
|
163
|
-
pinnedEvents,
|
|
164
|
-
pinnedLiveIds,
|
|
165
|
-
savedLiveIds,
|
|
166
|
-
togglePin,
|
|
167
|
-
clearPinned
|
|
168
|
-
} = (0, _useNetworkSaved.useNetworkSaved)();
|
|
169
|
-
|
|
170
|
-
// Which rules are live right now — the strip below reflects the rules, not
|
|
171
|
-
// the history, so it's correct the moment a rule is made or removed.
|
|
172
|
-
const {
|
|
173
|
-
rules,
|
|
174
|
-
enabled: overridesEnabled,
|
|
175
|
-
setEnabled,
|
|
176
|
-
isRuleSpent
|
|
177
|
-
} = (0, _useOverrideRules.useOverrideRules)();
|
|
178
|
-
|
|
179
|
-
// Stable identity: handed to memoized rows.
|
|
180
|
-
const handleLongPress = (0, _react.useCallback)(event => {
|
|
181
|
-
togglePin(event);
|
|
182
|
-
}, [togglePin]);
|
|
183
|
-
|
|
184
|
-
// Everything above is a hook and must run unconditionally; everything below
|
|
185
|
-
// is work. `splitPinned` is an O(n) pass over the whole list, and this screen
|
|
186
|
-
// re-renders on every modal-root state change — including every prev/next
|
|
187
|
-
// step, where it is hidden and the result is thrown away.
|
|
188
|
-
if (!visible) return null;
|
|
189
|
-
const {
|
|
190
|
-
pinned,
|
|
191
|
-
rest
|
|
192
|
-
} = (0, _withPinnedFirst.splitPinned)(visibleEvents, pinnedEvents, pinnedLiveIds);
|
|
193
|
-
|
|
194
|
-
// Hoist anything an active rule covers. Done after `splitPinned` so a request
|
|
195
|
-
// that is both pinned and overridden appears once, in the louder section.
|
|
196
|
-
// Paused rules still populate the strip — that's how you find the thing you
|
|
197
|
-
// paused in order to resume it. The header says PAUSED instead.
|
|
198
|
-
const activeRules = rules.filter(rule => rule.enabled && !isRuleSpent(rule));
|
|
199
|
-
const overridden = (0, _overriddenRows.overriddenEvents)([...pinned, ...rest], activeRules);
|
|
200
|
-
const overriddenIds = new Set(overridden.map(event => event.id));
|
|
201
|
-
const pinnedRows = pinned.filter(event => !overriddenIds.has(event.id));
|
|
202
|
-
const restRows = overriddenIds.size ? rest.filter(event => !overriddenIds.has(event.id)) : rest;
|
|
203
|
-
const isEnabled = !paused;
|
|
204
|
-
const renderItem = ({
|
|
205
|
-
item
|
|
206
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact, {
|
|
207
|
-
event: item,
|
|
208
|
-
onPress: onEventPress,
|
|
209
|
-
onLongPress: handleLongPress,
|
|
210
|
-
saved: savedLiveIds.has(item.id)
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// Which flavour of "nothing here" this is. Pins and overrides render
|
|
214
|
-
// outside the list, so a screen showing only those is not empty at all.
|
|
215
|
-
const renderEmpty = () => {
|
|
216
|
-
// Pins and overrides render outside the list, so a screen showing only
|
|
217
|
-
// those is not empty at all.
|
|
218
|
-
if (pinnedRows.length > 0 || overridden.length > 0) return null;
|
|
219
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
|
|
220
|
-
testID: "buoy-network-empty",
|
|
221
|
-
...(0, _sharedUi.resolveListEmptyState)({
|
|
222
|
-
subject: "requests",
|
|
223
|
-
search: searchText,
|
|
224
|
-
total: totalEvents,
|
|
225
|
-
capturing: isEnabled,
|
|
226
|
-
waiting: {
|
|
227
|
-
// fishing = capture is on and nothing has arrived.
|
|
228
|
-
otto: "fishing",
|
|
229
|
-
title: "No network events",
|
|
230
|
-
message: "Network requests will appear here"
|
|
231
|
-
},
|
|
232
|
-
paused: {
|
|
233
|
-
// paused = capture off. Both are literally what the copy says.
|
|
234
|
-
title: "No network events",
|
|
235
|
-
message: "Enable interception to start capturing"
|
|
236
|
-
}
|
|
237
|
-
})
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
const renderListFooter = () => {
|
|
241
|
-
if (!hasLockedEvents) return null;
|
|
242
|
-
const isSearching = searchText.length > 0;
|
|
243
|
-
const bannerText = isSearching ? `${lockedEventCount} matching ${lockedEventCount === 1 ? "request" : "requests"} in locked history` : `${lockedEventCount} requests locked`;
|
|
244
|
-
const subtextMessage = isSearching ? "Upgrade to Pro to search your full request history" : "Upgrade to Pro to unlock full request history";
|
|
245
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner, {
|
|
246
|
-
title: bannerText,
|
|
247
|
-
subtitle: subtextMessage,
|
|
248
|
-
onPress: onUpgradePress
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
252
|
-
style: styles.root,
|
|
253
|
-
children: [!isEnabled ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
254
|
-
style: styles.disabledBanner,
|
|
255
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Power, {
|
|
256
|
-
size: 14,
|
|
257
|
-
color: _sharedUi.macOSColors.semantic.warning
|
|
258
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
259
|
-
style: styles.disabledText,
|
|
260
|
-
children: "Network interception is disabled"
|
|
261
|
-
})]
|
|
262
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(OverriddenSection, {
|
|
263
|
-
events: overridden,
|
|
264
|
-
onEventPress: onEventPress,
|
|
265
|
-
onLongPress: handleLongPress,
|
|
266
|
-
savedLiveIds: savedLiveIds,
|
|
267
|
-
paused: !overridesEnabled,
|
|
268
|
-
onTogglePaused: () => setEnabled(!overridesEnabled)
|
|
269
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PinnedSection, {
|
|
270
|
-
events: pinnedRows,
|
|
271
|
-
onEventPress: onEventPress,
|
|
272
|
-
onLongPress: handleLongPress,
|
|
273
|
-
savedLiveIds: savedLiveIds,
|
|
274
|
-
onClearPinned: clearPinned
|
|
275
|
-
}), restRows.length > 0 || hasLockedEvents ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
|
276
|
-
testID: "buoy-network-list",
|
|
277
|
-
data: restRows,
|
|
278
|
-
renderItem: renderItem,
|
|
279
|
-
keyExtractor: keyExtractor,
|
|
280
|
-
contentContainerStyle: styles.listContent,
|
|
281
|
-
showsVerticalScrollIndicator: true
|
|
282
|
-
// Clipped cells falsely fail Detox's hittability check (known
|
|
283
|
-
// RN+Detox issue), so e2e bundles (Metro started with
|
|
284
|
-
// EXPO_PUBLIC_E2E=1) turn clipping off — see EVENT_LIST_PRESET.
|
|
285
|
-
,
|
|
286
|
-
onEndReachedThreshold: 0.8
|
|
287
|
-
// The list OWNS scrolling (NetworkModal passes
|
|
288
|
-
// disableScrollWrapper while this screen is visible) so FlatList
|
|
289
|
-
// virtualization actually works. The previous shipped config —
|
|
290
|
-
// scrollEnabled=false inside JsModal's ScrollView — mounted ALL
|
|
291
|
-
// rows: at the store's 500-event cap that measured 17 JS FPS /
|
|
292
|
-
// 133% CPU / 1.4GB vs ~53 JS FPS / 52% / 360MB virtualized
|
|
293
|
-
// (buoy-optimize batch 2026-07-06, batch-1783396983529-6l7w).
|
|
294
|
-
// Window/batch values are the batch's "tuned" winner (EVENT_LIST_PRESET).
|
|
295
|
-
,
|
|
296
|
-
scrollEnabled: true,
|
|
297
|
-
..._sharedUi.EVENT_LIST_PRESET,
|
|
298
|
-
// Saving a request from the detail view changes a row's glyph
|
|
299
|
-
// without changing `data`. VirtualizedList is a PureComponent, so
|
|
300
|
-
// the Set has to be declared as a re-render marker rather than
|
|
301
|
-
// relying on `renderItem` getting a fresh identity.
|
|
302
|
-
extraData: savedLiveIds,
|
|
303
|
-
"sentry-label": "ignore network events list",
|
|
304
|
-
ListFooterComponent: renderListFooter
|
|
305
|
-
}) : renderEmpty()]
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
const styles = _reactNative.StyleSheet.create({
|
|
309
|
-
root: {
|
|
310
|
-
flex: 1,
|
|
311
|
-
minHeight: 0
|
|
312
|
-
},
|
|
313
|
-
/**
|
|
314
|
-
* The strip is separated from the live list by a real rule, not just space:
|
|
315
|
-
* these rows do NOT obey the filters, and the boundary is what tells the
|
|
316
|
-
* user why a request they just filtered out is still on screen.
|
|
317
|
-
*/
|
|
318
|
-
overriddenSection: {
|
|
319
|
-
borderBottomWidth: 1,
|
|
320
|
-
borderBottomColor: _sharedUi.macOSColors.semantic.warning + "44",
|
|
321
|
-
backgroundColor: _sharedUi.macOSColors.semantic.warningBackground
|
|
322
|
-
},
|
|
323
|
-
overriddenSectionOff: {
|
|
324
|
-
borderBottomColor: _sharedUi.macOSColors.border.default,
|
|
325
|
-
backgroundColor: _sharedUi.macOSColors.background.card
|
|
326
|
-
},
|
|
327
|
-
overriddenTitleOff: {
|
|
328
|
-
color: _sharedUi.macOSColors.text.muted
|
|
329
|
-
},
|
|
330
|
-
overriddenHeader: {
|
|
331
|
-
flexDirection: "row",
|
|
332
|
-
alignItems: "center",
|
|
333
|
-
gap: 6,
|
|
334
|
-
paddingHorizontal: 12,
|
|
335
|
-
paddingTop: 8,
|
|
336
|
-
paddingBottom: 4
|
|
337
|
-
},
|
|
338
|
-
overriddenTitle: {
|
|
339
|
-
flex: 1,
|
|
340
|
-
fontSize: 10,
|
|
341
|
-
fontWeight: "700",
|
|
342
|
-
letterSpacing: 0.8,
|
|
343
|
-
color: _sharedUi.macOSColors.semantic.warning
|
|
344
|
-
},
|
|
345
|
-
overriddenManage: {
|
|
346
|
-
paddingHorizontal: 6,
|
|
347
|
-
paddingVertical: 2
|
|
348
|
-
},
|
|
349
|
-
overriddenManageText: {
|
|
350
|
-
fontSize: 10,
|
|
351
|
-
fontWeight: "600",
|
|
352
|
-
color: _sharedUi.macOSColors.semantic.warning
|
|
353
|
-
},
|
|
354
|
-
pinnedSection: {
|
|
355
|
-
borderBottomWidth: 1,
|
|
356
|
-
borderBottomColor: _sharedUi.macOSColors.border.default,
|
|
357
|
-
paddingBottom: 4
|
|
358
|
-
},
|
|
359
|
-
pinnedHeader: {
|
|
360
|
-
flexDirection: "row",
|
|
361
|
-
alignItems: "center",
|
|
362
|
-
gap: 6,
|
|
363
|
-
paddingHorizontal: 20,
|
|
364
|
-
paddingTop: 10,
|
|
365
|
-
paddingBottom: 6
|
|
366
|
-
},
|
|
367
|
-
pinnedTitle: {
|
|
368
|
-
flex: 1,
|
|
369
|
-
color: _sharedUi.macOSColors.semantic.info,
|
|
370
|
-
fontSize: 10,
|
|
371
|
-
fontWeight: "700",
|
|
372
|
-
letterSpacing: 0.6,
|
|
373
|
-
fontFamily: _sharedUi.monoFont
|
|
374
|
-
},
|
|
375
|
-
pinnedClear: {
|
|
376
|
-
paddingHorizontal: 6,
|
|
377
|
-
paddingVertical: 2
|
|
378
|
-
},
|
|
379
|
-
pinnedClearText: {
|
|
380
|
-
color: _sharedUi.macOSColors.text.muted,
|
|
381
|
-
fontSize: 10
|
|
382
|
-
},
|
|
383
|
-
disabledBanner: {
|
|
384
|
-
flexDirection: "row",
|
|
385
|
-
alignItems: "center",
|
|
386
|
-
gap: 8,
|
|
387
|
-
padding: 10,
|
|
388
|
-
marginHorizontal: 12,
|
|
389
|
-
marginTop: 8,
|
|
390
|
-
backgroundColor: _sharedUi.macOSColors.semantic.warningBackground,
|
|
391
|
-
borderRadius: 8,
|
|
392
|
-
borderWidth: 1,
|
|
393
|
-
borderColor: _sharedUi.macOSColors.semantic.warning + "20"
|
|
394
|
-
},
|
|
395
|
-
disabledText: {
|
|
396
|
-
color: _sharedUi.macOSColors.semantic.warning,
|
|
397
|
-
fontSize: 11,
|
|
398
|
-
flex: 1
|
|
399
|
-
},
|
|
400
|
-
listContent: {
|
|
401
|
-
paddingTop: 8
|
|
402
|
-
}
|
|
403
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkListScreen=NetworkListScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _useNetworkEventList=require("../hooks/useNetworkEventList");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useOverrideRules=require("../hooks/useOverrideRules");var _overriddenRows=require("../overrides/overriddenRows");var _withPinnedFirst=require("../utils/withPinnedFirst");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=r=>r.id;function PinnedSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,onClearPinned:t}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:11,active:true,color:_sharedUi.macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.pinnedTitle,children:["PINNED \xB7 ",r.length]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore unpin all",style:styles.pinnedClear,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pinnedClearText,children:"Unpin all"})})]}),r.map(n=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:n,onPress:i,onLongPress:s,pinned:true,saved:a.has(n.id)},n.id))]})}function OverriddenSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,paused:t,onTogglePaused:n}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.overriddenSection,t&&styles.overriddenSectionOff],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overriddenHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:11,color:t?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-overridden-strip",style:[styles.overriddenTitle,t&&styles.overriddenTitleOff],children:t?`PAUSED \xB7 ${r.length}`:`OVERRIDDEN \xB7 ${r.length}`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:n,"sentry-label":"ignore pause overrides",style:styles.overriddenManage,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overriddenManageText,t&&styles.overriddenTitleOff],children:t?"Resume":"Pause"})})]}),r.map(o=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:o,onPress:i,onLongPress:s,overridden:true,saved:a.has(o.id)},o.id))]})}function NetworkListScreen({visible:r,paused:i,filter:s,ignoredPatterns:a,isPro:t,searchText:n,onEventPress:o,onUpgradePress:k}){const{visibleEvents:b,hasLockedEvents:v,lockedEventCount:l,totalEvents:C}=(0,_useNetworkEventList.useNetworkEventList)({filter:s,ignoredPatterns:a,paused:i,visible:r,isPro:t});const{pinnedEvents:y,pinnedLiveIds:E,savedLiveIds:d,togglePin:p,clearPinned:O}=(0,_useNetworkSaved.useNetworkSaved)();const{rules:T,enabled:h,setEnabled:P,isRuleSpent:j}=(0,_useOverrideRules.useOverrideRules)();const c=(0,_react.useCallback)(e=>{p(e)},[p]);if(!r)return null;const{pinned:x,rest:u}=(0,_withPinnedFirst.splitPinned)(b,y,E);const N=T.filter(e=>e.enabled&&!j(e));const g=(0,_overriddenRows.overriddenEvents)([...x,...u],N);const m=new Set(g.map(e=>e.id));const w=x.filter(e=>!m.has(e.id));const S=m.size?u.filter(e=>!m.has(e.id)):u;const f=!i;const I=({item:e})=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:e,onPress:o,onLongPress:c,saved:d.has(e.id)});const L=()=>{if(w.length>0||g.length>0)return null;return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-network-empty",...(0,_sharedUi.resolveListEmptyState)({subject:"requests",search:n,total:C,capturing:f,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})})};const q=()=>{if(!v)return null;const e=n.length>0;const B=e?`${l} matching ${l===1?"request":"requests"} in locked history`:`${l} requests locked`;const R=e?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history";return(0,_jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner,{title:B,subtitle:R,onPress:k})};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.root,children:[!f?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Network interception is disabled"})]}):null,(0,_jsxRuntime.jsx)(OverriddenSection,{events:g,onEventPress:o,onLongPress:c,savedLiveIds:d,paused:!h,onTogglePaused:()=>P(!h)}),(0,_jsxRuntime.jsx)(PinnedSection,{events:w,onEventPress:o,onLongPress:c,savedLiveIds:d,onClearPinned:O}),S.length>0||v?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{testID:"buoy-network-list",data:S,renderItem:I,keyExtractor,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,..._sharedUi.EVENT_LIST_PRESET,extraData:d,"sentry-label":"ignore network events list",ListFooterComponent:q}):L()]})}const styles=_reactNative.StyleSheet.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.semantic.warning+"44",backgroundColor:_sharedUi.macOSColors.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:_sharedUi.macOSColors.border.default,backgroundColor:_sharedUi.macOSColors.background.card},overriddenTitleOff:{color:_sharedUi.macOSColors.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:_sharedUi.macOSColors.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:_sharedUi.macOSColors.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:_sharedUi.macOSColors.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_sharedUi.monoFont},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:_sharedUi.macOSColors.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.warning+"20"},disabledText:{color:_sharedUi.macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});
|