@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,222 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The SAVED screen — the network tool's favorites list.
|
|
5
|
-
*
|
|
6
|
-
* Everything here is read from the persisted saved store, never from the live
|
|
7
|
-
* event store. That is the whole point of the screen: these requests survive a
|
|
8
|
-
* Clear, the 500-event cap, and an app restart, so a failure you kept is still
|
|
9
|
-
* here tomorrow.
|
|
10
|
-
*
|
|
11
|
-
* Rows are the same two row components the live list uses, so a saved request
|
|
12
|
-
* looks exactly like the request it was. Long-press here UNSAVES rather than
|
|
13
|
-
* pins — in this list "get rid of it" is the action the row affords, and
|
|
14
|
-
* pinning is still available from the detail header.
|
|
15
|
-
*
|
|
16
|
-
* Stable-tree contract (rule4): hooks run unconditionally, then the component
|
|
17
|
-
* returns null when not visible.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { useState } from "react";
|
|
21
|
-
import { FlatList, StyleSheet, Text, TextInput, View, TouchableOpacity } from "react-native";
|
|
22
|
-
import { Bookmark, CopyButton, Search, macOSColors, useLimit, ToolEmptyState, resolveListEmptyState, EVENT_LIST_PRESET, monoFont } from "@buoy-gg/shared-ui";
|
|
23
|
-
import { NetworkEventItemCompact } from "./NetworkEventItemCompact";
|
|
24
|
-
import { NetworkUpgradeBanner } from "./NetworkUpgradeBanner";
|
|
25
|
-
import { generateNetworkCopyText } from "../utils/generateNetworkCopyText";
|
|
26
|
-
import { selectSavedEvents } from "../utils/selectSavedEvents";
|
|
27
|
-
import { useNetworkSaved } from "../hooks/useNetworkSaved";
|
|
28
|
-
import { MAX_SAVED } from "../utils/networkSavedStore";
|
|
29
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
-
const keyExtractor = item => item.id;
|
|
31
|
-
export function NetworkSavedScreen({
|
|
32
|
-
visible,
|
|
33
|
-
isPro,
|
|
34
|
-
copySettings,
|
|
35
|
-
search: searchProp,
|
|
36
|
-
onSearchChange,
|
|
37
|
-
onEventPress,
|
|
38
|
-
onUpgradePress
|
|
39
|
-
}) {
|
|
40
|
-
const {
|
|
41
|
-
savedRecords,
|
|
42
|
-
pinnedLiveIds,
|
|
43
|
-
toggleSave,
|
|
44
|
-
clearSaved
|
|
45
|
-
} = useNetworkSaved();
|
|
46
|
-
// Declared with the other hooks: the `!visible` early return below would
|
|
47
|
-
// otherwise make this conditional.
|
|
48
|
-
const savedLimit = useLimit("network.saved");
|
|
49
|
-
const [searchState, setSearchState] = useState("");
|
|
50
|
-
const controlled = searchProp != null && onSearchChange != null;
|
|
51
|
-
const search = controlled ? searchProp : searchState;
|
|
52
|
-
const setSearch = controlled ? onSearchChange : setSearchState;
|
|
53
|
-
if (!visible) return null;
|
|
54
|
-
|
|
55
|
-
// Shared with the detail footer, so "Next" can't disagree with the row below.
|
|
56
|
-
const {
|
|
57
|
-
events: filtered,
|
|
58
|
-
lockedCount
|
|
59
|
-
} = selectSavedEvents(savedRecords, savedLimit, search);
|
|
60
|
-
const handleLongPress = event => {
|
|
61
|
-
toggleSave(event);
|
|
62
|
-
};
|
|
63
|
-
const renderItem = ({
|
|
64
|
-
item
|
|
65
|
-
}) => /*#__PURE__*/_jsx(NetworkEventItemCompact, {
|
|
66
|
-
event: item,
|
|
67
|
-
onPress: onEventPress,
|
|
68
|
-
onLongPress: handleLongPress,
|
|
69
|
-
saved: true,
|
|
70
|
-
pinned: pinnedLiveIds.has(item.id)
|
|
71
|
-
});
|
|
72
|
-
const renderListFooter = () => {
|
|
73
|
-
if (lockedCount === 0) return null;
|
|
74
|
-
return /*#__PURE__*/_jsx(NetworkUpgradeBanner, {
|
|
75
|
-
title: `${lockedCount} saved ${lockedCount === 1 ? "request" : "requests"} locked`,
|
|
76
|
-
subtitle: `Your plan keeps ${savedLimit}. Upgrade to Pro to unlock the rest.`,
|
|
77
|
-
onPress: onUpgradePress
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
81
|
-
style: styles.root,
|
|
82
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
83
|
-
style: styles.toolbar,
|
|
84
|
-
children: [/*#__PURE__*/_jsx(Bookmark, {
|
|
85
|
-
size: 11,
|
|
86
|
-
color: macOSColors.semantic.debug
|
|
87
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
88
|
-
style: styles.toolbarTitle,
|
|
89
|
-
children: ["SAVED \xB7 ", savedRecords.length, savedLimit >= MAX_SAVED ? "" : `/${savedLimit}`]
|
|
90
|
-
}), isPro ? /*#__PURE__*/_jsx(CopyButton
|
|
91
|
-
// Lazy value, resolved at press time — no string is built per
|
|
92
|
-
// render, and it always reflects the current list.
|
|
93
|
-
, {
|
|
94
|
-
value: () => generateNetworkCopyText(filtered, copySettings),
|
|
95
|
-
size: 13,
|
|
96
|
-
buttonStyle: styles.toolbarButton,
|
|
97
|
-
colors: {
|
|
98
|
-
idle: macOSColors.text.secondary,
|
|
99
|
-
success: macOSColors.semantic.success,
|
|
100
|
-
error: macOSColors.semantic.error
|
|
101
|
-
},
|
|
102
|
-
disabled: filtered.length === 0
|
|
103
|
-
}) : null, /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
104
|
-
onPress: clearSaved,
|
|
105
|
-
"sentry-label": "ignore clear saved",
|
|
106
|
-
style: styles.toolbarClear,
|
|
107
|
-
disabled: savedRecords.length === 0,
|
|
108
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
109
|
-
style: [styles.toolbarClearText, savedRecords.length === 0 && styles.toolbarClearTextDisabled],
|
|
110
|
-
children: "Clear all"
|
|
111
|
-
})
|
|
112
|
-
})]
|
|
113
|
-
}), savedRecords.length > 0 ? /*#__PURE__*/_jsxs(View, {
|
|
114
|
-
style: styles.searchRow,
|
|
115
|
-
children: [/*#__PURE__*/_jsx(Search, {
|
|
116
|
-
size: 13,
|
|
117
|
-
color: macOSColors.text.secondary
|
|
118
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
119
|
-
style: styles.searchInput,
|
|
120
|
-
placeholder: "Search saved requests\u2026",
|
|
121
|
-
placeholderTextColor: macOSColors.text.muted,
|
|
122
|
-
value: search,
|
|
123
|
-
onChangeText: setSearch,
|
|
124
|
-
"sentry-label": "ignore saved search",
|
|
125
|
-
accessibilityLabel: "Search saved requests",
|
|
126
|
-
autoCapitalize: "none",
|
|
127
|
-
autoCorrect: false,
|
|
128
|
-
returnKeyType: "search"
|
|
129
|
-
})]
|
|
130
|
-
}) : null, savedRecords.length === 0 ||
|
|
131
|
-
// lockedCount > 0 falls through to the list so the upgrade banner (its
|
|
132
|
-
// ListFooterComponent) still renders — "0 shown, N locked" is an
|
|
133
|
-
// answer, not an empty screen.
|
|
134
|
-
search.trim().length > 0 && filtered.length === 0 && lockedCount === 0 ? /*#__PURE__*/_jsx(ToolEmptyState, {
|
|
135
|
-
testID: "buoy-network-saved-empty",
|
|
136
|
-
...resolveListEmptyState({
|
|
137
|
-
subject: "saved requests",
|
|
138
|
-
verb: "kept",
|
|
139
|
-
search: savedRecords.length === 0 ? "" : search,
|
|
140
|
-
total: savedRecords.length,
|
|
141
|
-
waiting: {
|
|
142
|
-
otto: "empty",
|
|
143
|
-
title: "No saved requests",
|
|
144
|
-
message: "Open a request and tap the bookmark to keep it here — saved requests survive Clear and app restarts."
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
}) : /*#__PURE__*/_jsx(FlatList, {
|
|
148
|
-
data: filtered,
|
|
149
|
-
renderItem: renderItem,
|
|
150
|
-
keyExtractor: keyExtractor,
|
|
151
|
-
contentContainerStyle: styles.listContent,
|
|
152
|
-
showsVerticalScrollIndicator: true,
|
|
153
|
-
scrollEnabled: true,
|
|
154
|
-
...EVENT_LIST_PRESET,
|
|
155
|
-
extraData: pinnedLiveIds,
|
|
156
|
-
"sentry-label": "ignore saved requests list",
|
|
157
|
-
ListFooterComponent: renderListFooter
|
|
158
|
-
})]
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
const styles = StyleSheet.create({
|
|
162
|
-
root: {
|
|
163
|
-
flex: 1,
|
|
164
|
-
minHeight: 0
|
|
165
|
-
},
|
|
166
|
-
toolbar: {
|
|
167
|
-
flexDirection: "row",
|
|
168
|
-
alignItems: "center",
|
|
169
|
-
gap: 6,
|
|
170
|
-
paddingHorizontal: 20,
|
|
171
|
-
paddingTop: 10,
|
|
172
|
-
paddingBottom: 6
|
|
173
|
-
},
|
|
174
|
-
toolbarTitle: {
|
|
175
|
-
flex: 1,
|
|
176
|
-
color: macOSColors.semantic.debug,
|
|
177
|
-
fontSize: 10,
|
|
178
|
-
fontWeight: "700",
|
|
179
|
-
letterSpacing: 0.6,
|
|
180
|
-
fontFamily: monoFont
|
|
181
|
-
},
|
|
182
|
-
toolbarButton: {
|
|
183
|
-
width: 26,
|
|
184
|
-
height: 26,
|
|
185
|
-
borderRadius: 6,
|
|
186
|
-
alignItems: "center",
|
|
187
|
-
justifyContent: "center"
|
|
188
|
-
},
|
|
189
|
-
toolbarClear: {
|
|
190
|
-
paddingHorizontal: 6,
|
|
191
|
-
paddingVertical: 2
|
|
192
|
-
},
|
|
193
|
-
toolbarClearText: {
|
|
194
|
-
color: macOSColors.text.muted,
|
|
195
|
-
fontSize: 10
|
|
196
|
-
},
|
|
197
|
-
toolbarClearTextDisabled: {
|
|
198
|
-
color: macOSColors.text.disabled
|
|
199
|
-
},
|
|
200
|
-
searchRow: {
|
|
201
|
-
flexDirection: "row",
|
|
202
|
-
alignItems: "center",
|
|
203
|
-
gap: 6,
|
|
204
|
-
marginHorizontal: 12,
|
|
205
|
-
marginBottom: 8,
|
|
206
|
-
paddingHorizontal: 10,
|
|
207
|
-
paddingVertical: 5,
|
|
208
|
-
backgroundColor: macOSColors.background.input,
|
|
209
|
-
borderRadius: 10,
|
|
210
|
-
borderWidth: 1,
|
|
211
|
-
borderColor: macOSColors.border.default
|
|
212
|
-
},
|
|
213
|
-
searchInput: {
|
|
214
|
-
flex: 1,
|
|
215
|
-
color: macOSColors.text.primary,
|
|
216
|
-
fontSize: 13,
|
|
217
|
-
paddingVertical: 2
|
|
218
|
-
},
|
|
219
|
-
listContent: {
|
|
220
|
-
paddingTop: 4
|
|
221
|
-
}
|
|
222
|
-
});
|
|
1
|
+
"use strict";import{useState as L}from"react";import{FlatList as q,StyleSheet as B,Text as b,TextInput as D,View as u,TouchableOpacity as V}from"react-native";import{Bookmark as N,CopyButton as j,Search as P,macOSColors as e,useLimit as R,ToolEmptyState as F,resolveListEmptyState as H,EVENT_LIST_PRESET as _,monoFont as $}from"@buoy-gg/shared-ui";import{NetworkEventItemCompact as A}from"./NetworkEventItemCompact";import{NetworkUpgradeBanner as O}from"./NetworkUpgradeBanner";import{generateNetworkCopyText as U}from"../utils/generateNetworkCopyText";import{selectSavedEvents as W}from"../utils/selectSavedEvents";import{useNetworkSaved as K}from"../hooks/useNetworkSaved";import{MAX_SAVED as M}from"../utils/networkSavedStore";import{jsx as t,jsxs as d}from"react/jsx-runtime";const X=c=>c.id;export function NetworkSavedScreen({visible:c,isPro:y,copySettings:v,search:p,onSearchChange:m,onEventPress:x,onUpgradePress:S}){const{savedRecords:o,pinnedLiveIds:g,toggleSave:f,clearSaved:C}=K();const a=R("network.saved");const[k,T]=L("");const h=p!=null&&m!=null;const s=h?p:k;const w=h?m:T;if(!c)return null;const{events:n,lockedCount:l}=W(o,a,s);const E=i=>{f(i)};const I=({item:i})=>t(A,{event:i,onPress:x,onLongPress:E,saved:true,pinned:g.has(i.id)});const z=()=>{if(l===0)return null;return t(O,{title:`${l} saved ${l===1?"request":"requests"} locked`,subtitle:`Your plan keeps ${a}. Upgrade to Pro to unlock the rest.`,onPress:S})};return d(u,{style:r.root,children:[d(u,{style:r.toolbar,children:[t(N,{size:11,color:e.semantic.debug}),d(b,{style:r.toolbarTitle,children:["SAVED \xB7 ",o.length,a>=M?"":`/${a}`]}),y?t(j,{value:()=>U(n,v),size:13,buttonStyle:r.toolbarButton,colors:{idle:e.text.secondary,success:e.semantic.success,error:e.semantic.error},disabled:n.length===0}):null,t(V,{onPress:C,"sentry-label":"ignore clear saved",style:r.toolbarClear,disabled:o.length===0,children:t(b,{style:[r.toolbarClearText,o.length===0&&r.toolbarClearTextDisabled],children:"Clear all"})})]}),o.length>0?d(u,{style:r.searchRow,children:[t(P,{size:13,color:e.text.secondary}),t(D,{style:r.searchInput,placeholder:"Search saved requests\u2026",placeholderTextColor:e.text.muted,value:s,onChangeText:w,"sentry-label":"ignore saved search",accessibilityLabel:"Search saved requests",autoCapitalize:"none",autoCorrect:false,returnKeyType:"search"})]}):null,o.length===0||s.trim().length>0&&n.length===0&&l===0?t(F,{testID:"buoy-network-saved-empty",...H({subject:"saved requests",verb:"kept",search:o.length===0?"":s,total:o.length,waiting:{otto:"empty",title:"No saved requests",message:"Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."}})}):t(q,{data:n,renderItem:I,keyExtractor:X,contentContainerStyle:r.listContent,showsVerticalScrollIndicator:true,scrollEnabled:true,..._,extraData:g,"sentry-label":"ignore saved requests list",ListFooterComponent:z})]})}const r=B.create({root:{flex:1,minHeight:0},toolbar:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},toolbarTitle:{flex:1,color:e.semantic.debug,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:$},toolbarButton:{width:26,height:26,borderRadius:6,alignItems:"center",justifyContent:"center"},toolbarClear:{paddingHorizontal:6,paddingVertical:2},toolbarClearText:{color:e.text.muted,fontSize:10},toolbarClearTextDisabled:{color:e.text.disabled},searchRow:{flexDirection:"row",alignItems:"center",gap:6,marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5,backgroundColor:e.background.input,borderRadius:10,borderWidth:1,borderColor:e.border.default},searchInput:{flex:1,color:e.text.primary,fontSize:13,paddingVertical:2},listContent:{paddingTop:4}});
|
|
@@ -1,461 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* NetworkSavedScreen.web — DOM twin of NetworkSavedScreen.tsx.
|
|
5
|
-
*
|
|
6
|
-
* The SAVED screen — the network tool's favorites list. Everything here is
|
|
7
|
-
* read from the persisted saved store, never from the live event store: these
|
|
8
|
-
* requests survive a Clear, the 500-event cap, and an app restart. Identical
|
|
9
|
-
* prop contract, hook usage and derivation order as the native file — the
|
|
10
|
-
* data layer is REUSED, not forked (`useNetworkSaved`, `selectSavedEvents`,
|
|
11
|
-
* `generateNetworkCopyText` are all platform-free).
|
|
12
|
-
*
|
|
13
|
-
* Rows are the same row component the live list uses
|
|
14
|
-
* (`NetworkEventItemCompact.web`), so a saved request looks exactly like the
|
|
15
|
-
* request it was. Long-press here UNSAVES rather than pins — in this list
|
|
16
|
-
* "get rid of it" is the action the row affords (pinning stays on the detail
|
|
17
|
-
* header). Row tap opens the detail view via `onEventPress` — hosts wire it
|
|
18
|
-
* to `networkSelectionStore.select` and pass `fromSaved` to the detail
|
|
19
|
-
* screen, so the prev/next footer steps through THIS list (native behavior;
|
|
20
|
-
* `NetworkDetailStepper.web` already derives it from `selectSavedEvents`).
|
|
21
|
-
*
|
|
22
|
-
* Stable-tree contract (rule4): hooks run unconditionally, then the
|
|
23
|
-
* component returns null when not visible.
|
|
24
|
-
*
|
|
25
|
-
* shared-ui RN chrome is replicated as DOM with provenance (web consumers
|
|
26
|
-
* resolve `@buoy-gg/shared-ui` to a minimal shim):
|
|
27
|
-
* - `macOSColors` / `buoyColors` — inlined verbatim subsets from
|
|
28
|
-
* shared/src/ui/gameUI/constants/.
|
|
29
|
-
* - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
|
|
30
|
-
* - `CopyButton` — the DOM twin exported by DataViewer.web (same lazy
|
|
31
|
-
* function-value contract, colors and 1500ms feedback as native).
|
|
32
|
-
* - `NetworkUpgradeBanner` — inlined DOM twin, values from
|
|
33
|
-
* NetworkUpgradeBanner.tsx + license/FeatureGate.tsx `proBadge` styles
|
|
34
|
-
* (static gold-less "PRO" — the Weekend Pass variant reads
|
|
35
|
-
* `useProAccess` from @buoy-gg/license, not part of the web port).
|
|
36
|
-
*
|
|
37
|
-
* Intentional deviations (all logged):
|
|
38
|
-
* - FlatList virtualization → a plain scrolled div (same deal as
|
|
39
|
-
* NetworkListScreen.web: MAX_SAVED caps the list at 50 rows, and the
|
|
40
|
-
* window/batch tuning + `extraData` are FlatList-only concerns).
|
|
41
|
-
* - `CopySettings` is imported from the platform-free
|
|
42
|
-
* `generateNetworkCopyText` module (the native screen imports it from
|
|
43
|
-
* NetworkCopySettingsView.tsx, which would drag react-native in).
|
|
44
|
-
*
|
|
45
|
-
* @platform React DOM Web
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
import { useState } from "react";
|
|
49
|
-
import { useLimit } from "@buoy-gg/shared-ui";
|
|
50
|
-
import { NetworkEventItemCompact } from "./NetworkEventItemCompact.web";
|
|
51
|
-
import { CopyButton } from "./DataViewer.web";
|
|
52
|
-
import { generateNetworkCopyText } from "../utils/generateNetworkCopyText";
|
|
53
|
-
import { selectSavedEvents } from "../utils/selectSavedEvents";
|
|
54
|
-
import { useNetworkSaved } from "../hooks/useNetworkSaved";
|
|
55
|
-
import { MAX_SAVED } from "../utils/networkSavedStore";
|
|
56
|
-
|
|
57
|
-
// =============================
|
|
58
|
-
// Native palettes (provenance)
|
|
59
|
-
// =============================
|
|
60
|
-
|
|
61
|
-
/** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
|
|
62
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
63
|
-
const macOSColors = {
|
|
64
|
-
background: {
|
|
65
|
-
input: "#26262A"
|
|
66
|
-
},
|
|
67
|
-
border: {
|
|
68
|
-
default: "#2D2D2F"
|
|
69
|
-
},
|
|
70
|
-
text: {
|
|
71
|
-
primary: "#F5F5F7",
|
|
72
|
-
secondary: "#A1A1A6",
|
|
73
|
-
muted: "#8E8E93",
|
|
74
|
-
disabled: "#9E9EA0"
|
|
75
|
-
},
|
|
76
|
-
semantic: {
|
|
77
|
-
success: "#34C759",
|
|
78
|
-
error: "#FF453A",
|
|
79
|
-
debug: "#BF5AF2"
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts (macOS theme), verbatim. */
|
|
84
|
-
const buoy = {
|
|
85
|
-
card: "#1A1A1A",
|
|
86
|
-
text: "#E0E0E0",
|
|
87
|
-
textMuted: "#888888",
|
|
88
|
-
primary: "#20C997"
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// =============================
|
|
92
|
-
// Inline lucide icons (shared-ui icons are lucide re-exports)
|
|
93
|
-
// =============================
|
|
94
|
-
|
|
95
|
-
function Svg({
|
|
96
|
-
size = 14,
|
|
97
|
-
color = "currentColor",
|
|
98
|
-
children
|
|
99
|
-
}) {
|
|
100
|
-
return /*#__PURE__*/_jsx("svg", {
|
|
101
|
-
width: size,
|
|
102
|
-
height: size,
|
|
103
|
-
viewBox: "0 0 24 24",
|
|
104
|
-
fill: "none",
|
|
105
|
-
stroke: color,
|
|
106
|
-
strokeWidth: 2,
|
|
107
|
-
strokeLinecap: "round",
|
|
108
|
-
strokeLinejoin: "round",
|
|
109
|
-
style: {
|
|
110
|
-
flexShrink: 0,
|
|
111
|
-
display: "block"
|
|
112
|
-
},
|
|
113
|
-
children: children
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
const Bookmark = p => /*#__PURE__*/_jsx(Svg, {
|
|
117
|
-
...p,
|
|
118
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
119
|
-
d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"
|
|
120
|
-
})
|
|
121
|
-
});
|
|
122
|
-
const Search = p => /*#__PURE__*/_jsxs(Svg, {
|
|
123
|
-
...p,
|
|
124
|
-
children: [/*#__PURE__*/_jsx("circle", {
|
|
125
|
-
cx: "11",
|
|
126
|
-
cy: "11",
|
|
127
|
-
r: "8"
|
|
128
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
129
|
-
d: "m21 21-4.3-4.3"
|
|
130
|
-
})]
|
|
131
|
-
});
|
|
132
|
-
const Zap = p => /*#__PURE__*/_jsx(Svg, {
|
|
133
|
-
...p,
|
|
134
|
-
children: /*#__PURE__*/_jsx("polygon", {
|
|
135
|
-
points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2"
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// =============================
|
|
140
|
-
// NetworkUpgradeBanner DOM twin (provenance: NetworkUpgradeBanner.tsx +
|
|
141
|
-
// license/FeatureGate.tsx proBadge styles — see the deviations log)
|
|
142
|
-
// =============================
|
|
143
|
-
|
|
144
|
-
function NetworkUpgradeBannerWeb({
|
|
145
|
-
title,
|
|
146
|
-
subtitle,
|
|
147
|
-
onPress
|
|
148
|
-
}) {
|
|
149
|
-
return /*#__PURE__*/_jsxs("button", {
|
|
150
|
-
type: "button",
|
|
151
|
-
style: styles.upgradeBanner,
|
|
152
|
-
onClick: onPress,
|
|
153
|
-
children: [/*#__PURE__*/_jsxs("span", {
|
|
154
|
-
style: styles.upgradeContent,
|
|
155
|
-
children: [/*#__PURE__*/_jsxs("span", {
|
|
156
|
-
style: styles.upgradeLeft,
|
|
157
|
-
children: [/*#__PURE__*/_jsx(Zap, {
|
|
158
|
-
size: 16,
|
|
159
|
-
color: buoy.primary
|
|
160
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
161
|
-
style: styles.upgradeTitle,
|
|
162
|
-
children: title
|
|
163
|
-
})]
|
|
164
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
165
|
-
style: styles.proBadge,
|
|
166
|
-
children: "PRO"
|
|
167
|
-
})]
|
|
168
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
169
|
-
style: styles.upgradeSubtitle,
|
|
170
|
-
children: subtitle
|
|
171
|
-
})]
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// =============================
|
|
176
|
-
// Screen (structure mirrors the native file 1:1)
|
|
177
|
-
// =============================
|
|
178
|
-
|
|
179
|
-
function EmptyState() {
|
|
180
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
181
|
-
style: styles.emptyState,
|
|
182
|
-
children: [/*#__PURE__*/_jsx(Bookmark, {
|
|
183
|
-
size: 32,
|
|
184
|
-
color: macOSColors.text.muted
|
|
185
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
186
|
-
style: styles.emptyTitle,
|
|
187
|
-
children: "No saved requests"
|
|
188
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
189
|
-
style: styles.emptyText,
|
|
190
|
-
children: "Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."
|
|
191
|
-
})]
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
export function NetworkSavedScreen({
|
|
195
|
-
visible,
|
|
196
|
-
isPro,
|
|
197
|
-
copySettings,
|
|
198
|
-
search: searchProp,
|
|
199
|
-
onSearchChange,
|
|
200
|
-
onEventPress,
|
|
201
|
-
onUpgradePress
|
|
202
|
-
}) {
|
|
203
|
-
const {
|
|
204
|
-
savedRecords,
|
|
205
|
-
pinnedLiveIds,
|
|
206
|
-
toggleSave,
|
|
207
|
-
clearSaved
|
|
208
|
-
} = useNetworkSaved();
|
|
209
|
-
// Declared with the other hooks: the `!visible` early return below would
|
|
210
|
-
// otherwise make this conditional.
|
|
211
|
-
const savedLimit = useLimit("network.saved");
|
|
212
|
-
const [searchState, setSearchState] = useState("");
|
|
213
|
-
const controlled = searchProp != null && onSearchChange != null;
|
|
214
|
-
const search = controlled ? searchProp : searchState;
|
|
215
|
-
const setSearch = controlled ? onSearchChange : setSearchState;
|
|
216
|
-
if (!visible) return null;
|
|
217
|
-
|
|
218
|
-
// Shared with the detail footer, so "Next" can't disagree with the row below.
|
|
219
|
-
const {
|
|
220
|
-
events: filtered,
|
|
221
|
-
lockedCount
|
|
222
|
-
} = selectSavedEvents(savedRecords, savedLimit, search);
|
|
223
|
-
const handleLongPress = event => {
|
|
224
|
-
toggleSave(event);
|
|
225
|
-
};
|
|
226
|
-
const renderListFooter = () => {
|
|
227
|
-
if (lockedCount === 0) return null;
|
|
228
|
-
return /*#__PURE__*/_jsx(NetworkUpgradeBannerWeb, {
|
|
229
|
-
title: `${lockedCount} saved ${lockedCount === 1 ? "request" : "requests"} locked`,
|
|
230
|
-
subtitle: `Your plan keeps ${savedLimit}. Upgrade to Pro to unlock the rest.`,
|
|
231
|
-
onPress: onUpgradePress
|
|
232
|
-
});
|
|
233
|
-
};
|
|
234
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
235
|
-
style: styles.root,
|
|
236
|
-
children: [/*#__PURE__*/_jsxs("div", {
|
|
237
|
-
style: styles.toolbar,
|
|
238
|
-
children: [/*#__PURE__*/_jsx(Bookmark, {
|
|
239
|
-
size: 11,
|
|
240
|
-
color: macOSColors.semantic.debug
|
|
241
|
-
}), /*#__PURE__*/_jsxs("span", {
|
|
242
|
-
style: styles.toolbarTitle,
|
|
243
|
-
children: ["SAVED \xB7 ", savedRecords.length, savedLimit >= MAX_SAVED ? "" : `/${savedLimit}`]
|
|
244
|
-
}), isPro ? /*#__PURE__*/_jsx(CopyButton
|
|
245
|
-
// Lazy value, resolved at press time — no string is built per
|
|
246
|
-
// render, and it always reflects the current list.
|
|
247
|
-
, {
|
|
248
|
-
value: () => generateNetworkCopyText(filtered, copySettings),
|
|
249
|
-
size: 13,
|
|
250
|
-
buttonStyle: {
|
|
251
|
-
...styles.toolbarButton,
|
|
252
|
-
...(filtered.length === 0 ? styles.toolbarButtonDisabled : null)
|
|
253
|
-
},
|
|
254
|
-
colors: {
|
|
255
|
-
idle: macOSColors.text.secondary,
|
|
256
|
-
success: macOSColors.semantic.success,
|
|
257
|
-
error: macOSColors.semantic.error
|
|
258
|
-
},
|
|
259
|
-
"aria-label": "Copy saved requests"
|
|
260
|
-
}) : null, /*#__PURE__*/_jsx("button", {
|
|
261
|
-
type: "button",
|
|
262
|
-
onClick: clearSaved,
|
|
263
|
-
style: styles.toolbarClear,
|
|
264
|
-
disabled: savedRecords.length === 0,
|
|
265
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
266
|
-
style: {
|
|
267
|
-
...styles.toolbarClearText,
|
|
268
|
-
...(savedRecords.length === 0 ? styles.toolbarClearTextDisabled : null)
|
|
269
|
-
},
|
|
270
|
-
children: "Clear all"
|
|
271
|
-
})
|
|
272
|
-
})]
|
|
273
|
-
}), savedRecords.length > 0 ? /*#__PURE__*/_jsxs("div", {
|
|
274
|
-
style: styles.searchRow,
|
|
275
|
-
children: [/*#__PURE__*/_jsx(Search, {
|
|
276
|
-
size: 13,
|
|
277
|
-
color: macOSColors.text.secondary
|
|
278
|
-
}), /*#__PURE__*/_jsx("input", {
|
|
279
|
-
style: styles.searchInput,
|
|
280
|
-
placeholder: "Search saved requests\u2026",
|
|
281
|
-
value: search,
|
|
282
|
-
onChange: e => setSearch(e.target.value),
|
|
283
|
-
"aria-label": "Search saved requests",
|
|
284
|
-
autoCapitalize: "none",
|
|
285
|
-
autoCorrect: "off",
|
|
286
|
-
autoComplete: "off",
|
|
287
|
-
spellCheck: false
|
|
288
|
-
})]
|
|
289
|
-
}) : null, savedRecords.length === 0 ? /*#__PURE__*/_jsx(EmptyState, {}) :
|
|
290
|
-
/*#__PURE__*/
|
|
291
|
-
// DEVIATION: FlatList → plain scrolled div (see file header). The
|
|
292
|
-
// list still OWNS scrolling — hosts render this screen without a
|
|
293
|
-
// scroll wrapper, same as native.
|
|
294
|
-
_jsx("div", {
|
|
295
|
-
style: styles.list,
|
|
296
|
-
"aria-label": "Saved requests list",
|
|
297
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
298
|
-
style: styles.listContent,
|
|
299
|
-
children: [filtered.map(item => /*#__PURE__*/_jsx(NetworkEventItemCompact, {
|
|
300
|
-
event: item,
|
|
301
|
-
onPress: onEventPress,
|
|
302
|
-
onLongPress: handleLongPress,
|
|
303
|
-
saved: true,
|
|
304
|
-
pinned: pinnedLiveIds.has(item.id)
|
|
305
|
-
}, item.id)), renderListFooter()]
|
|
306
|
-
})
|
|
307
|
-
})]
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// Values mirror the native StyleSheet block 1:1.
|
|
312
|
-
const styles = {
|
|
313
|
-
root: {
|
|
314
|
-
display: "flex",
|
|
315
|
-
flexDirection: "column",
|
|
316
|
-
flex: 1,
|
|
317
|
-
minHeight: 0
|
|
318
|
-
},
|
|
319
|
-
toolbar: {
|
|
320
|
-
display: "flex",
|
|
321
|
-
flexDirection: "row",
|
|
322
|
-
alignItems: "center",
|
|
323
|
-
gap: 6,
|
|
324
|
-
padding: "10px 20px 6px"
|
|
325
|
-
},
|
|
326
|
-
toolbarTitle: {
|
|
327
|
-
flex: 1,
|
|
328
|
-
color: macOSColors.semantic.debug,
|
|
329
|
-
fontSize: 10,
|
|
330
|
-
fontWeight: 700,
|
|
331
|
-
letterSpacing: 0.6,
|
|
332
|
-
fontFamily: "ui-monospace, Menlo, monospace",
|
|
333
|
-
textAlign: "left"
|
|
334
|
-
},
|
|
335
|
-
toolbarButton: {
|
|
336
|
-
width: 26,
|
|
337
|
-
height: 26,
|
|
338
|
-
boxSizing: "border-box",
|
|
339
|
-
borderRadius: 6,
|
|
340
|
-
alignItems: "center",
|
|
341
|
-
justifyContent: "center"
|
|
342
|
-
},
|
|
343
|
-
/** Native passes `disabled` to CopyButton; the DOM twin has no disabled
|
|
344
|
-
* prop, so the toolbar dims + inerts it the same way native renders it. */
|
|
345
|
-
toolbarButtonDisabled: {
|
|
346
|
-
opacity: 0.55,
|
|
347
|
-
pointerEvents: "none"
|
|
348
|
-
},
|
|
349
|
-
toolbarClear: {
|
|
350
|
-
padding: "2px 6px",
|
|
351
|
-
background: "none",
|
|
352
|
-
border: "none",
|
|
353
|
-
cursor: "pointer",
|
|
354
|
-
margin: 0
|
|
355
|
-
},
|
|
356
|
-
toolbarClearText: {
|
|
357
|
-
color: macOSColors.text.muted,
|
|
358
|
-
fontSize: 10
|
|
359
|
-
},
|
|
360
|
-
toolbarClearTextDisabled: {
|
|
361
|
-
color: macOSColors.text.disabled
|
|
362
|
-
},
|
|
363
|
-
searchRow: {
|
|
364
|
-
display: "flex",
|
|
365
|
-
flexDirection: "row",
|
|
366
|
-
alignItems: "center",
|
|
367
|
-
gap: 6,
|
|
368
|
-
margin: "0 12px 8px",
|
|
369
|
-
padding: "5px 10px",
|
|
370
|
-
backgroundColor: macOSColors.background.input,
|
|
371
|
-
borderRadius: 10,
|
|
372
|
-
border: `1px solid ${macOSColors.border.default}`
|
|
373
|
-
},
|
|
374
|
-
searchInput: {
|
|
375
|
-
flex: 1,
|
|
376
|
-
minWidth: 0,
|
|
377
|
-
color: macOSColors.text.primary,
|
|
378
|
-
fontSize: 13,
|
|
379
|
-
padding: "2px 0",
|
|
380
|
-
border: "none",
|
|
381
|
-
outline: "none",
|
|
382
|
-
background: "transparent",
|
|
383
|
-
fontFamily: "inherit"
|
|
384
|
-
},
|
|
385
|
-
list: {
|
|
386
|
-
flex: 1,
|
|
387
|
-
minHeight: 0,
|
|
388
|
-
overflowY: "auto"
|
|
389
|
-
},
|
|
390
|
-
listContent: {
|
|
391
|
-
paddingTop: 4
|
|
392
|
-
},
|
|
393
|
-
emptyState: {
|
|
394
|
-
display: "flex",
|
|
395
|
-
flexDirection: "column",
|
|
396
|
-
alignItems: "center",
|
|
397
|
-
padding: "40px 24px"
|
|
398
|
-
},
|
|
399
|
-
emptyTitle: {
|
|
400
|
-
color: macOSColors.text.primary,
|
|
401
|
-
fontSize: 14,
|
|
402
|
-
fontWeight: 600,
|
|
403
|
-
marginTop: 12,
|
|
404
|
-
marginBottom: 6
|
|
405
|
-
},
|
|
406
|
-
emptyText: {
|
|
407
|
-
color: macOSColors.text.muted,
|
|
408
|
-
fontSize: 12,
|
|
409
|
-
textAlign: "center",
|
|
410
|
-
lineHeight: "17px"
|
|
411
|
-
},
|
|
412
|
-
// NetworkUpgradeBanner.tsx values (buoyColors), verbatim.
|
|
413
|
-
upgradeBanner: {
|
|
414
|
-
display: "block",
|
|
415
|
-
width: "calc(100% - 24px)",
|
|
416
|
-
boxSizing: "border-box",
|
|
417
|
-
backgroundColor: buoy.card,
|
|
418
|
-
borderRadius: 10,
|
|
419
|
-
border: `1px solid ${buoy.primary}40`,
|
|
420
|
-
padding: 12,
|
|
421
|
-
margin: "12px 12px 34px",
|
|
422
|
-
textAlign: "left",
|
|
423
|
-
cursor: "pointer",
|
|
424
|
-
fontFamily: "inherit"
|
|
425
|
-
},
|
|
426
|
-
upgradeContent: {
|
|
427
|
-
display: "flex",
|
|
428
|
-
flexDirection: "row",
|
|
429
|
-
alignItems: "center",
|
|
430
|
-
justifyContent: "space-between",
|
|
431
|
-
marginBottom: 4
|
|
432
|
-
},
|
|
433
|
-
upgradeLeft: {
|
|
434
|
-
display: "inline-flex",
|
|
435
|
-
flexDirection: "row",
|
|
436
|
-
alignItems: "center",
|
|
437
|
-
gap: 8
|
|
438
|
-
},
|
|
439
|
-
upgradeTitle: {
|
|
440
|
-
color: buoy.text,
|
|
441
|
-
fontSize: 13,
|
|
442
|
-
fontWeight: 600
|
|
443
|
-
},
|
|
444
|
-
upgradeSubtitle: {
|
|
445
|
-
display: "block",
|
|
446
|
-
color: buoy.textMuted,
|
|
447
|
-
fontSize: 11
|
|
448
|
-
},
|
|
449
|
-
// license/FeatureGate.tsx `proBadge`/`proBadgeText`, verbatim.
|
|
450
|
-
proBadge: {
|
|
451
|
-
display: "inline-flex",
|
|
452
|
-
backgroundColor: `${buoy.primary}15`,
|
|
453
|
-
borderRadius: 4,
|
|
454
|
-
border: `1px solid ${buoy.primary}40`,
|
|
455
|
-
padding: "2px 6px",
|
|
456
|
-
fontSize: 10,
|
|
457
|
-
fontWeight: 700,
|
|
458
|
-
color: buoy.primary,
|
|
459
|
-
letterSpacing: 0.5
|
|
460
|
-
}
|
|
461
|
-
};
|
|
1
|
+
"use strict";import{useState as D}from"react";import{useLimit as E}from"@buoy-gg/shared-ui";import{NetworkEventItemCompact as F}from"./NetworkEventItemCompact.web";import{CopyButton as I}from"./DataViewer.web";import{generateNetworkCopyText as L}from"../utils/generateNetworkCopyText";import{selectSavedEvents as q}from"../utils/selectSavedEvents";import{useNetworkSaved as R}from"../hooks/useNetworkSaved";import{MAX_SAVED as $}from"../utils/networkSavedStore";import{jsx as e,jsxs as n}from"react/jsx-runtime";const r={background:{input:"#26262A"},border:{default:"#2D2D2F"},text:{primary:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93",disabled:"#9E9EA0"},semantic:{success:"#34C759",error:"#FF453A",debug:"#BF5AF2"}};const l={card:"#1A1A1A",text:"#E0E0E0",textMuted:"#888888",primary:"#20C997"};function g({size:o=14,color:s="currentColor",children:d}){return e("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:d})}const f=o=>e(g,{...o,children:e("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})});const j=o=>n(g,{...o,children:[e("circle",{cx:"11",cy:"11",r:"8"}),e("path",{d:"m21 21-4.3-4.3"})]});const W=o=>e(g,{...o,children:e("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})});function N({title:o,subtitle:s,onPress:d}){return n("button",{type:"button",style:t.upgradeBanner,onClick:d,children:[n("span",{style:t.upgradeContent,children:[n("span",{style:t.upgradeLeft,children:[e(W,{size:16,color:l.primary}),e("span",{style:t.upgradeTitle,children:o})]}),e("span",{style:t.proBadge,children:"PRO"})]}),e("span",{style:t.upgradeSubtitle,children:s})]})}function P(){return n("div",{style:t.emptyState,children:[e(f,{size:32,color:r.text.muted}),e("div",{style:t.emptyTitle,children:"No saved requests"}),e("div",{style:t.emptyText,children:"Open a request and tap the bookmark to keep it here \u2014 saved requests survive Clear and app restarts."})]})}export function NetworkSavedScreen({visible:o,isPro:s,copySettings:d,search:m,onSearchChange:x,onEventPress:y,onUpgradePress:v}){const{savedRecords:a,pinnedLiveIds:S,toggleSave:k,clearSaved:C}=R();const c=E("network.saved");const[w,z]=D("");const b=m!=null&&x!=null;const h=b?m:w;const A=b?x:z;if(!o)return null;const{events:p,lockedCount:u}=q(a,c,h);const B=i=>{k(i)};const T=()=>{if(u===0)return null;return e(N,{title:`${u} saved ${u===1?"request":"requests"} locked`,subtitle:`Your plan keeps ${c}. Upgrade to Pro to unlock the rest.`,onPress:v})};return n("div",{style:t.root,children:[n("div",{style:t.toolbar,children:[e(f,{size:11,color:r.semantic.debug}),n("span",{style:t.toolbarTitle,children:["SAVED \xB7 ",a.length,c>=$?"":`/${c}`]}),s?e(I,{value:()=>L(p,d),size:13,buttonStyle:{...t.toolbarButton,...p.length===0?t.toolbarButtonDisabled:null},colors:{idle:r.text.secondary,success:r.semantic.success,error:r.semantic.error},"aria-label":"Copy saved requests"}):null,e("button",{type:"button",onClick:C,style:t.toolbarClear,disabled:a.length===0,children:e("span",{style:{...t.toolbarClearText,...a.length===0?t.toolbarClearTextDisabled:null},children:"Clear all"})})]}),a.length>0?n("div",{style:t.searchRow,children:[e(j,{size:13,color:r.text.secondary}),e("input",{style:t.searchInput,placeholder:"Search saved requests\u2026",value:h,onChange:i=>A(i.target.value),"aria-label":"Search saved requests",autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",spellCheck:false})]}):null,a.length===0?e(P,{}):e("div",{style:t.list,"aria-label":"Saved requests list",children:n("div",{style:t.listContent,children:[p.map(i=>e(F,{event:i,onPress:y,onLongPress:B,saved:true,pinned:S.has(i.id)},i.id)),T()]})})]})}const t={root:{display:"flex",flexDirection:"column",flex:1,minHeight:0},toolbar:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,padding:"10px 20px 6px"},toolbarTitle:{flex:1,color:r.semantic.debug,fontSize:10,fontWeight:700,letterSpacing:.6,fontFamily:"ui-monospace, Menlo, monospace",textAlign:"left"},toolbarButton:{width:26,height:26,boxSizing:"border-box",borderRadius:6,alignItems:"center",justifyContent:"center"},toolbarButtonDisabled:{opacity:.55,pointerEvents:"none"},toolbarClear:{padding:"2px 6px",background:"none",border:"none",cursor:"pointer",margin:0},toolbarClearText:{color:r.text.muted,fontSize:10},toolbarClearTextDisabled:{color:r.text.disabled},searchRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,margin:"0 12px 8px",padding:"5px 10px",backgroundColor:r.background.input,borderRadius:10,border:`1px solid ${r.border.default}`},searchInput:{flex:1,minWidth:0,color:r.text.primary,fontSize:13,padding:"2px 0",border:"none",outline:"none",background:"transparent",fontFamily:"inherit"},list:{flex:1,minHeight:0,overflowY:"auto"},listContent:{paddingTop:4},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",padding:"40px 24px"},emptyTitle:{color:r.text.primary,fontSize:14,fontWeight:600,marginTop:12,marginBottom:6},emptyText:{color:r.text.muted,fontSize:12,textAlign:"center",lineHeight:"17px"},upgradeBanner:{display:"block",width:"calc(100% - 24px)",boxSizing:"border-box",backgroundColor:l.card,borderRadius:10,border:`1px solid ${l.primary}40`,padding:12,margin:"12px 12px 34px",textAlign:"left",cursor:"pointer",fontFamily:"inherit"},upgradeContent:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4},upgradeLeft:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:8},upgradeTitle:{color:l.text,fontSize:13,fontWeight:600},upgradeSubtitle:{display:"block",color:l.textMuted,fontSize:11},proBadge:{display:"inline-flex",backgroundColor:`${l.primary}15`,borderRadius:4,border:`1px solid ${l.primary}40`,padding:"2px 6px",fontSize:10,fontWeight:700,color:l.primary,letterSpacing:.5}};
|