@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,193 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.networkSelectionStore = exports.DEFAULT_SETTLE_MS = void 0;
|
|
7
|
-
exports.toSelectionIds = toSelectionIds;
|
|
8
|
-
/**
|
|
9
|
-
* Which request the detail view is showing, and where it sits in the list —
|
|
10
|
-
* the prev/next CURSOR.
|
|
11
|
-
*
|
|
12
|
-
* ## Why this is a store and not `useState` in the modal
|
|
13
|
-
*
|
|
14
|
-
* It used to be `useState` in `NetworkModalInner`. Every tap on Previous/Next
|
|
15
|
-
* therefore dirtied the modal ROOT, which re-rendered `JsModal` (1833 lines,
|
|
16
|
-
* nine useStates, animations/gestures/persistence — and it can never bail out,
|
|
17
|
-
* because its `header` prop is a fresh object literal every render), the whole
|
|
18
|
-
* header, and all five screens. None of them care which request is selected;
|
|
19
|
-
* they only care THAT one is.
|
|
20
|
-
*
|
|
21
|
-
* This is the same argument `NetworkModal`'s own header comment already makes
|
|
22
|
-
* about network events ("with the subscription here, 15 events re-rendered
|
|
23
|
-
* JsModal + every header button 15×"). Stepping is that same class of
|
|
24
|
-
* high-frequency churn, and it was sitting in the same wrong place. Now the
|
|
25
|
-
* root subscribes to `hasSelection` — a boolean that flips twice a session —
|
|
26
|
-
* while the footer, the body and the header's pin actions subscribe to the
|
|
27
|
-
* parts they actually render.
|
|
28
|
-
*
|
|
29
|
-
* ## The three cursors
|
|
30
|
-
*
|
|
31
|
-
* `selectedId` is where the USER is. It moves on the tap, synchronously.
|
|
32
|
-
*
|
|
33
|
-
* `bodyId` is what the detail body is allowed to render, and it deliberately
|
|
34
|
-
* LAGS: drawing a request means handing its payload to the virtualized data
|
|
35
|
-
* viewer to flatten, and that has no business blocking the next tap. It
|
|
36
|
-
* catches up only once the selection has held still for `settleMs`, so a
|
|
37
|
-
* burst of taps renders the request you land on and none of the ones you flew
|
|
38
|
-
* past. (`useDeferredValue` was tried here first and is the wrong tool — it
|
|
39
|
-
* lowers the priority of that work without preventing it, so every settled
|
|
40
|
-
* step still queued a flatten and each one delayed the touch behind it.)
|
|
41
|
-
*
|
|
42
|
-
* `renderedId` is what actually made it to the screen, reported by the detail
|
|
43
|
-
* screen after commit. Nothing in the product reads it; it exists so the
|
|
44
|
-
* benchmark harness can measure "time until request N was really painted"
|
|
45
|
-
* separately from "time until the cursor reached N".
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* How long the selection must hold still before the body renders it. Short
|
|
50
|
-
* enough that a single step reads as immediate (the footer and header have
|
|
51
|
-
* already moved), long enough that a burst collapses to one render.
|
|
52
|
-
*/
|
|
53
|
-
const DEFAULT_SETTLE_MS = exports.DEFAULT_SETTLE_MS = 120;
|
|
54
|
-
class NetworkSelectionStore {
|
|
55
|
-
ids = [];
|
|
56
|
-
index = -1;
|
|
57
|
-
selectedId = null;
|
|
58
|
-
bodyId = null;
|
|
59
|
-
renderedId = null;
|
|
60
|
-
settleMs = DEFAULT_SETTLE_MS;
|
|
61
|
-
settleTimer = null;
|
|
62
|
-
subscribers = new Set();
|
|
63
|
-
snapshot = this.buildSnapshot();
|
|
64
|
-
buildSnapshot() {
|
|
65
|
-
return {
|
|
66
|
-
ids: this.ids,
|
|
67
|
-
index: this.index,
|
|
68
|
-
selectedId: this.selectedId,
|
|
69
|
-
bodyId: this.bodyId,
|
|
70
|
-
renderedId: this.renderedId
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* One immutable snapshot per mutation, so subscribers can identity-compare
|
|
76
|
-
* and `useSyncExternalStore` stays happy.
|
|
77
|
-
*/
|
|
78
|
-
emit() {
|
|
79
|
-
this.snapshot = this.buildSnapshot();
|
|
80
|
-
for (const subscriber of this.subscribers) subscriber(this.snapshot);
|
|
81
|
-
}
|
|
82
|
-
getState() {
|
|
83
|
-
return this.snapshot;
|
|
84
|
-
}
|
|
85
|
-
subscribe(subscriber) {
|
|
86
|
-
this.subscribers.add(subscriber);
|
|
87
|
-
return () => {
|
|
88
|
-
this.subscribers.delete(subscriber);
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Publish the navigable order. Called by the stepper whenever its derived
|
|
94
|
-
* list changes (filter, search, pins, new requests arriving).
|
|
95
|
-
*
|
|
96
|
-
* The cursor is re-anchored BY ID, not by position: the live list is
|
|
97
|
-
* newest-first and new requests are prepended, so holding an index would
|
|
98
|
-
* silently slide the selection onto a different request every time one
|
|
99
|
-
* landed.
|
|
100
|
-
*/
|
|
101
|
-
setIds(ids) {
|
|
102
|
-
const sameIds = ids.length === this.ids.length && ids.every((id, i) => id === this.ids[i]);
|
|
103
|
-
if (sameIds) return;
|
|
104
|
-
this.ids = ids;
|
|
105
|
-
this.index = this.selectedId == null ? -1 : ids.indexOf(this.selectedId);
|
|
106
|
-
this.emit();
|
|
107
|
-
}
|
|
108
|
-
select(id) {
|
|
109
|
-
if (id === this.selectedId) return;
|
|
110
|
-
this.selectedId = id;
|
|
111
|
-
this.index = id == null ? -1 : this.ids.indexOf(id);
|
|
112
|
-
this.scheduleBody(id);
|
|
113
|
-
this.emit();
|
|
114
|
-
}
|
|
115
|
-
clear() {
|
|
116
|
-
this.select(null);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Move the cursor. O(1) — the whole reason `index` is stored rather than
|
|
121
|
-
* re-derived with a `findIndex` on every render.
|
|
122
|
-
*
|
|
123
|
-
* Returns the id it landed on, or null if the move was out of bounds (the
|
|
124
|
-
* footer disables its arrows at the ends, but the benchmark driver calls
|
|
125
|
-
* this directly and needs to know when it has run off the end).
|
|
126
|
-
*/
|
|
127
|
-
step(delta) {
|
|
128
|
-
if (this.index < 0) return null;
|
|
129
|
-
const next = this.index + delta;
|
|
130
|
-
if (next < 0 || next >= this.ids.length) return null;
|
|
131
|
-
const id = this.ids[next];
|
|
132
|
-
this.selectedId = id;
|
|
133
|
-
this.index = next;
|
|
134
|
-
this.scheduleBody(id);
|
|
135
|
-
this.emit();
|
|
136
|
-
return id;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Opening and closing skip the settle delay: there is no in-flight render to
|
|
141
|
-
* protect on a null↔id transition, and waiting there just reads as a hang.
|
|
142
|
-
* Only id → id steps debounce.
|
|
143
|
-
*/
|
|
144
|
-
scheduleBody(id) {
|
|
145
|
-
if (this.settleTimer != null) {
|
|
146
|
-
clearTimeout(this.settleTimer);
|
|
147
|
-
this.settleTimer = null;
|
|
148
|
-
}
|
|
149
|
-
if (id == null || this.bodyId == null || this.settleMs <= 0) {
|
|
150
|
-
this.bodyId = id;
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
this.settleTimer = setTimeout(() => {
|
|
154
|
-
this.settleTimer = null;
|
|
155
|
-
if (this.bodyId === this.selectedId) return;
|
|
156
|
-
this.bodyId = this.selectedId;
|
|
157
|
-
this.emit();
|
|
158
|
-
}, this.settleMs);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/** Benchmark toggle — `?settle=0` measures the gate's contribution. */
|
|
162
|
-
setSettleMs(ms) {
|
|
163
|
-
this.settleMs = Math.max(0, ms);
|
|
164
|
-
}
|
|
165
|
-
getSettleMs() {
|
|
166
|
-
return this.settleMs;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/** Reported by the detail screen after commit. Instrumentation only. */
|
|
170
|
-
reportRendered(id) {
|
|
171
|
-
if (id === this.renderedId) return;
|
|
172
|
-
this.renderedId = id;
|
|
173
|
-
this.emit();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/** Test/bench helper — drop all cursor state without touching the events. */
|
|
177
|
-
reset() {
|
|
178
|
-
if (this.settleTimer != null) clearTimeout(this.settleTimer);
|
|
179
|
-
this.settleTimer = null;
|
|
180
|
-
this.ids = [];
|
|
181
|
-
this.index = -1;
|
|
182
|
-
this.selectedId = null;
|
|
183
|
-
this.bodyId = null;
|
|
184
|
-
this.renderedId = null;
|
|
185
|
-
this.emit();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
const networkSelectionStore = exports.networkSelectionStore = new NetworkSelectionStore();
|
|
189
|
-
|
|
190
|
-
/** Convenience for publishing an event list as the navigable order. */
|
|
191
|
-
function toSelectionIds(events) {
|
|
192
|
-
return events.map(event => event.id);
|
|
193
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.networkSelectionStore=exports.DEFAULT_SETTLE_MS=void 0;exports.toSelectionIds=toSelectionIds;const DEFAULT_SETTLE_MS=exports.DEFAULT_SETTLE_MS=120;class NetworkSelectionStore{ids=[];index=-1;selectedId=null;bodyId=null;renderedId=null;settleMs=DEFAULT_SETTLE_MS;settleTimer=null;subscribers=new Set;snapshot=this.buildSnapshot();buildSnapshot(){return{ids:this.ids,index:this.index,selectedId:this.selectedId,bodyId:this.bodyId,renderedId:this.renderedId}}emit(){this.snapshot=this.buildSnapshot();for(const e of this.subscribers)e(this.snapshot)}getState(){return this.snapshot}subscribe(e){this.subscribers.add(e);return()=>{this.subscribers.delete(e)}}setIds(e){const t=e.length===this.ids.length&&e.every((s,d)=>s===this.ids[d]);if(t)return;this.ids=e;this.index=this.selectedId==null?-1:e.indexOf(this.selectedId);this.emit()}select(e){if(e===this.selectedId)return;this.selectedId=e;this.index=e==null?-1:this.ids.indexOf(e);this.scheduleBody(e);this.emit()}clear(){this.select(null)}step(e){if(this.index<0)return null;const t=this.index+e;if(t<0||t>=this.ids.length)return null;const s=this.ids[t];this.selectedId=s;this.index=t;this.scheduleBody(s);this.emit();return s}scheduleBody(e){if(this.settleTimer!=null){clearTimeout(this.settleTimer);this.settleTimer=null}if(e==null||this.bodyId==null||this.settleMs<=0){this.bodyId=e;return}this.settleTimer=setTimeout(()=>{this.settleTimer=null;if(this.bodyId===this.selectedId)return;this.bodyId=this.selectedId;this.emit()},this.settleMs)}setSettleMs(e){this.settleMs=Math.max(0,e)}getSettleMs(){return this.settleMs}reportRendered(e){if(e===this.renderedId)return;this.renderedId=e;this.emit()}reset(){if(this.settleTimer!=null)clearTimeout(this.settleTimer);this.settleTimer=null;this.ids=[];this.index=-1;this.selectedId=null;this.bodyId=null;this.renderedId=null;this.emit()}}const networkSelectionStore=exports.networkSelectionStore=new NetworkSelectionStore;function toSelectionIds(i){return i.map(e=>e.id)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.realClearTimeout=realClearTimeout;exports.realNow=realNow;exports.realSetTimeout=realSetTimeout;function realNow(){const e=globalThis.__buoyRealNow;return typeof e==="function"?e():Date.now()}function timers(){const e=globalThis.__buoyRealTimers;return e??globalThis}function realSetTimeout(e,t){return timers().setTimeout(e,t)}function realClearTimeout(e){timers().clearTimeout(e)}
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.nextRequestId = nextRequestId;
|
|
7
|
-
const runtime = globalThis;
|
|
8
|
-
|
|
9
|
-
// Keep identity across Fast Refresh; distinguish requests from earlier app runs.
|
|
10
|
-
function nextRequestId(client) {
|
|
11
|
-
const sequence = runtime.__BUOY_NETWORK_REQUEST_SEQUENCE__ ??= {
|
|
12
|
-
session: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,
|
|
13
|
-
next: 0
|
|
14
|
-
};
|
|
15
|
-
return `${client}_${sequence.session}_${++sequence.next}`;
|
|
16
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.nextRequestId=nextRequestId;const runtime=globalThis;function nextRequestId(t){const e=runtime.__BUOY_NETWORK_REQUEST_SEQUENCE__??={session:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,next:0};return`${t}_${e.session}_${++e.next}`}
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.resolveRequestUrl = resolveRequestUrl;
|
|
7
|
-
/** Resolve browser-relative URLs for capture without changing the request arguments. */
|
|
8
|
-
function resolveRequestUrl(url) {
|
|
9
|
-
if (typeof document === "undefined") return url;
|
|
10
|
-
try {
|
|
11
|
-
return new URL(url, document.baseURI).href;
|
|
12
|
-
} catch {
|
|
13
|
-
return url;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveRequestUrl=resolveRequestUrl;function resolveRequestUrl(e){if(typeof document==="undefined")return e;try{return new URL(e,document.baseURI).href}catch{return e}}
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.selectSavedEvents = selectSavedEvents;
|
|
7
|
-
var _filterNetworkEvents = require("./filterNetworkEvents");
|
|
8
|
-
var _networkSavedStore = require("./networkSavedStore");
|
|
9
|
-
/**
|
|
10
|
-
* The SAVED screen's visible list, as a pure function.
|
|
11
|
-
*
|
|
12
|
-
* Two places need the exact same list: the screen that renders it
|
|
13
|
-
* (`NetworkSavedScreen`) and the detail footer that steps through it
|
|
14
|
-
* (`NetworkDetailStepper`). If they derived it independently, "Next" would
|
|
15
|
-
* eventually disagree with the row below — the same drift `withPinnedFirst`
|
|
16
|
-
* exists to prevent for the live list.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function selectSavedEvents(savedRecords,
|
|
20
|
-
/**
|
|
21
|
-
* How many saves this tier may see — `useLimit("network.saved")`. Takes a
|
|
22
|
-
* number rather than `isPro` because Pro's cap is 50, not unlimited, and a
|
|
23
|
-
* boolean cannot express that.
|
|
24
|
-
*/
|
|
25
|
-
limit, search) {
|
|
26
|
-
/**
|
|
27
|
-
* A downgrade (or a limit change) can leave a user holding more saves than
|
|
28
|
-
* their tier allows. Rather than deleting their data, the overflow is
|
|
29
|
-
* LOCKED — oldest first, so the newest saves stay reachable.
|
|
30
|
-
*/
|
|
31
|
-
const unlocked = savedRecords.slice(0, Math.min(limit, _networkSavedStore.MAX_SAVED));
|
|
32
|
-
const events = unlocked.map(record => record.event);
|
|
33
|
-
return {
|
|
34
|
-
events: search ? (0, _filterNetworkEvents.filterNetworkEvents)(events, {
|
|
35
|
-
searchText: search
|
|
36
|
-
}) : events,
|
|
37
|
-
lockedCount: savedRecords.length - unlocked.length
|
|
38
|
-
};
|
|
39
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.selectSavedEvents=selectSavedEvents;var _filterNetworkEvents=require("./filterNetworkEvents");var _networkSavedStore=require("./networkSavedStore");function selectSavedEvents(e,o,t){const r=e.slice(0,Math.min(o,_networkSavedStore.MAX_SAVED));const n=r.map(s=>s.event);return{events:t?(0,_filterNetworkEvents.filterNetworkEvents)(n,{searchText:t}):n,lockedCount:e.length-r.length}}
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.startNetworkCapture = startNetworkCapture;
|
|
7
|
-
var _networkEventStore = require("./networkEventStore");
|
|
8
|
-
var _overrideRulesStore = require("../overrides/overrideRulesStore");
|
|
9
|
-
/**
|
|
10
|
-
* Keep local capture active while the Network panel is closed.
|
|
11
|
-
* Call in the app being inspected and dispose during unmount or HMR cleanup.
|
|
12
|
-
*/
|
|
13
|
-
function startNetworkCapture() {
|
|
14
|
-
const native = typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
15
|
-
if (!native && (typeof window === "undefined" || typeof document === "undefined")) return () => {};
|
|
16
|
-
void _overrideRulesStore.overrideRulesStore.ensureLoaded();
|
|
17
|
-
const unsubscribe = _networkEventStore.networkEventStore.subscribeToEvents(() => {});
|
|
18
|
-
let stopped = false;
|
|
19
|
-
return () => {
|
|
20
|
-
if (stopped) return;
|
|
21
|
-
stopped = true;
|
|
22
|
-
unsubscribe();
|
|
23
|
-
};
|
|
24
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.startNetworkCapture=startNetworkCapture;var _networkEventStore=require("./networkEventStore");var _overrideRulesStore=require("../overrides/overrideRulesStore");function startNetworkCapture(){const r=typeof navigator!=="undefined"&&navigator.product==="ReactNative";if(!r&&(typeof window==="undefined"||typeof document==="undefined"))return()=>{};void _overrideRulesStore.overrideRulesStore.ensureLoaded();const t=_networkEventStore.networkEventStore.subscribeToEvents(()=>{});let e=false;return()=>{if(e)return;e=true;t()}}
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.splitPinned = splitPinned;
|
|
7
|
-
/**
|
|
8
|
-
* Split a filtered event list into its PINNED section and the rest.
|
|
9
|
-
*
|
|
10
|
-
* Lives as a pure function because there are TWO list implementations — the
|
|
11
|
-
* mobile modal's `NetworkListScreen` and the desktop dashboard's hand-mirrored
|
|
12
|
-
* `NetworkInline` — and pin ordering silently diverging between them is
|
|
13
|
-
* exactly the drift `buoy.tools.json` exists to prevent.
|
|
14
|
-
*
|
|
15
|
-
* Pins are deliberately NOT filtered: they come straight from the saved store,
|
|
16
|
-
* so a pinned request stays visible no matter what the search box or the
|
|
17
|
-
* status chips say. The only thing the filtered list contributes is the
|
|
18
|
-
* dedupe — a pinned request that is still live must not render twice.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const EMPTY = [];
|
|
22
|
-
function splitPinned(filtered, pinnedEvents, /** Live IDs pinned in THIS session — from `networkSavedStore.getState()`. */
|
|
23
|
-
pinnedLiveIds) {
|
|
24
|
-
if (pinnedEvents.length === 0) return {
|
|
25
|
-
pinned: EMPTY,
|
|
26
|
-
rest: filtered
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
pinned: pinnedEvents,
|
|
30
|
-
rest: pinnedLiveIds.size === 0 ? filtered : filtered.filter(event => !pinnedLiveIds.has(event.id))
|
|
31
|
-
};
|
|
32
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.splitPinned=splitPinned;const EMPTY=[];function splitPinned(e,t,r){if(t.length===0)return{pinned:EMPTY,rest:e};return{pinned:t,rest:r.size===0?e:e.filter(n=>!r.has(n.id))}}
|
package/lib/commonjs/preset.js
CHANGED
|
@@ -1,93 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.networkToolPreset = exports.createNetworkTool = void 0;
|
|
7
|
-
var _NetworkConditionsIcon = require("./network/conditions/NetworkConditionsIcon");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _NetworkModal = require("./network/components/NetworkModal");
|
|
10
|
-
var _overrideRulesStore = require("./network/overrides/overrideRulesStore");
|
|
11
|
-
var _networkEventStore = require("./network/utils/networkEventStore");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
/**
|
|
14
|
-
* Pre-configured network monitoring tool for FloatingDevTools
|
|
15
|
-
*
|
|
16
|
-
* This preset provides a zero-config way to add network request monitoring to your dev tools.
|
|
17
|
-
* Just import and add it to your apps array!
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* import { networkToolPreset } from '@buoy-gg/network';
|
|
22
|
-
*
|
|
23
|
-
* const installedApps = [
|
|
24
|
-
* networkToolPreset, // That's it!
|
|
25
|
-
* // ...other tools
|
|
26
|
-
* ];
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Install interception at IMPORT time and buffer boot traffic.
|
|
32
|
-
*
|
|
33
|
-
* Capture used to start with the first subscriber (Network modal open,
|
|
34
|
-
* dashboard/MCP watch) — long after the app's startup requests (module-scope
|
|
35
|
-
* fetches, session bootstrap, the first query) had fired, so boot traffic was
|
|
36
|
-
* permanently invisible. The boot buffer holds those raw events until the
|
|
37
|
-
* first consumer subscribes, then flushes them into the store; if nothing
|
|
38
|
-
* ever subscribes, nothing is flushed (see startBootCapture).
|
|
39
|
-
*
|
|
40
|
-
* Guards:
|
|
41
|
-
* - `navigator.product === "ReactNative"` — a real RN runtime only. The
|
|
42
|
-
* desktop dashboard and web mirrors also evaluate this module and must
|
|
43
|
-
* never intercept their OWN process's traffic.
|
|
44
|
-
* - Dev-only, like the rest of the automatic capture behavior.
|
|
45
|
-
*/const isReactNativeRuntime = typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
46
|
-
// Browser capture initializes persisted rules explicitly through startNetworkCapture.
|
|
47
|
-
if (isReactNativeRuntime) void _overrideRulesStore.overrideRulesStore.ensureLoaded();
|
|
48
|
-
if (isReactNativeRuntime && typeof __DEV__ !== "undefined" && __DEV__) {
|
|
49
|
-
_networkEventStore.networkEventStore.startBootCapture();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Pre-configured network monitoring tool for FloatingDevTools.
|
|
54
|
-
* Includes:
|
|
55
|
-
* - Live network request monitoring
|
|
56
|
-
* - Request/response inspection
|
|
57
|
-
* - Filter by status, method, URL
|
|
58
|
-
* - Timing information
|
|
59
|
-
*/
|
|
60
|
-
const networkToolPreset = exports.networkToolPreset = (0, _sharedUi.defineToolPreset)({
|
|
61
|
-
id: "network",
|
|
62
|
-
name: "NET",
|
|
63
|
-
description: "Network request logger",
|
|
64
|
-
slot: "both",
|
|
65
|
-
icon: ({
|
|
66
|
-
size
|
|
67
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkConditionsIcon.NetworkConditionsIcon, {
|
|
68
|
-
size: size
|
|
69
|
-
}),
|
|
70
|
-
component: _NetworkModal.NetworkModal,
|
|
71
|
-
props: {
|
|
72
|
-
enableSharedModalDimensions: false
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Create a custom network monitoring tool configuration.
|
|
78
|
-
* Use this if you want to override default settings.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```tsx
|
|
82
|
-
* import { createNetworkTool } from '@buoy-gg/network';
|
|
83
|
-
*
|
|
84
|
-
* const myNetworkTool = createNetworkTool({
|
|
85
|
-
* name: "REQUESTS",
|
|
86
|
-
* iconColor: "#9945FF", // Purple color
|
|
87
|
-
* enableSharedModalDimensions: true,
|
|
88
|
-
* });
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
const createNetworkTool = exports.createNetworkTool = (0, _sharedUi.createToolFactory)(networkToolPreset, options => ({
|
|
92
|
-
enableSharedModalDimensions: options.enableSharedModalDimensions ?? false
|
|
93
|
-
}));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.networkToolPreset=exports.createNetworkTool=void 0;var _NetworkConditionsIcon=require("./network/conditions/NetworkConditionsIcon");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkModal=require("./network/components/NetworkModal");var _overrideRulesStore=require("./network/overrides/overrideRulesStore");var _networkEventStore=require("./network/utils/networkEventStore");var _jsxRuntime=require("react/jsx-runtime");const isReactNativeRuntime=typeof navigator!=="undefined"&&navigator.product==="ReactNative";if(isReactNativeRuntime)void _overrideRulesStore.overrideRulesStore.ensureLoaded();if(isReactNativeRuntime&&typeof __DEV__!=="undefined"&&__DEV__){_networkEventStore.networkEventStore.startBootCapture()}const networkToolPreset=exports.networkToolPreset=(0,_sharedUi.defineToolPreset)({id:"network",name:"NET",description:"Network request logger",slot:"both",icon:({size:e})=>(0,_jsxRuntime.jsx)(_NetworkConditionsIcon.NetworkConditionsIcon,{size:e}),component:_NetworkModal.NetworkModal,props:{enableSharedModalDimensions:false}});const createNetworkTool=exports.createNetworkTool=(0,_sharedUi.createToolFactory)(networkToolPreset,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}));
|
package/lib/module/index.js
CHANGED
|
@@ -1,104 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @buoy-gg/network
|
|
5
|
-
*
|
|
6
|
-
* Network monitoring tool for React Native DevTools.
|
|
7
|
-
*
|
|
8
|
-
* PUBLIC API - Only these exports are supported for external use.
|
|
9
|
-
* Internal utilities (listeners, stores) are not exported to prevent
|
|
10
|
-
* bypassing the tool's intended usage patterns.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// =============================================================================
|
|
14
|
-
// PRESET (Primary entry point for users)
|
|
15
|
-
// =============================================================================
|
|
16
|
-
export { networkToolPreset, createNetworkTool } from "./preset";
|
|
17
|
-
export { startNetworkCapture } from "./network/utils/startNetworkCapture";
|
|
18
|
-
|
|
19
|
-
// =============================================================================
|
|
20
|
-
// COMPONENTS (For custom UI implementations)
|
|
21
|
-
// =============================================================================
|
|
22
|
-
// `NetworkToolView` is the same tool rendered inline (header bar + body)
|
|
23
|
-
// instead of inside a JsModal — for hosts that show tools in a panel.
|
|
24
|
-
export { NetworkModal, NetworkToolView } from "./network/components/NetworkModal";
|
|
25
|
-
export { NetworkEventDetailView } from "./network/components/NetworkEventDetailView";
|
|
26
|
-
export { NetworkEventItemCompact } from "./network/components/NetworkEventItemCompact";
|
|
27
|
-
export { NetworkSavedScreen } from "./network/components/NetworkSavedScreen";
|
|
28
|
-
export { NetworkSavedButton, NetworkDetailPinActions, NetworkHeaderBadgesView } from "./network/components/NetworkHeaderLive";
|
|
29
|
-
|
|
30
|
-
// =============================================================================
|
|
31
|
-
// HOOKS (For consuming network data in custom components)
|
|
32
|
-
// =============================================================================
|
|
33
|
-
export { useNetworkEvents } from "./network/hooks/useNetworkEvents";
|
|
34
|
-
// Narrow per-consumer subscriptions (what NetworkModal itself uses) — the
|
|
35
|
-
// list and the header counters subscribe independently so a host UI never
|
|
36
|
-
// re-renders wholesale per network event.
|
|
37
|
-
export { useNetworkEventList } from "./network/hooks/useNetworkEventList";
|
|
38
|
-
export { useLiveNetworkEvent } from "./network/hooks/useLiveNetworkEvent";
|
|
39
|
-
export { useNetworkBadgeCounts } from "./network/hooks/useNetworkBadgeCounts";
|
|
40
|
-
// Pinned/saved requests. `splitPinned` is the shared pin-ordering util — the
|
|
41
|
-
// desktop dashboard's hand-mirrored list calls it too, so the two list
|
|
42
|
-
// implementations can't disagree about where a pin goes.
|
|
43
|
-
export { useNetworkSaved } from "./network/hooks/useNetworkSaved";
|
|
44
|
-
export { splitPinned } from "./network/utils/withPinnedFirst";
|
|
45
|
-
// The prev/next CURSOR. Exported because the tool-bench harness drives
|
|
46
|
-
// `step(+1)` directly to time stepping without going through the UI, and
|
|
47
|
-
// because `setSettleMs` is the toggle its benchmark cases flip.
|
|
48
|
-
export { networkSelectionStore, DEFAULT_SETTLE_MS } from "./network/utils/networkSelectionStore";
|
|
49
|
-
export { TickProvider, useTickEveryMinute } from "./network/hooks/useTickEveryMinute";
|
|
50
|
-
|
|
51
|
-
// =============================================================================
|
|
52
|
-
// UTILITIES (Formatting helpers)
|
|
53
|
-
// =============================================================================
|
|
54
|
-
export { formatBytes, formatDuration, formatHttpStatus } from "./network/utils/formatting";
|
|
55
|
-
|
|
56
|
-
// =============================================================================
|
|
57
|
-
// TYPES (For TypeScript users)
|
|
58
|
-
// =============================================================================
|
|
59
|
-
|
|
60
|
-
// =============================================================================
|
|
61
|
-
// RESPONSE OVERRIDES
|
|
62
|
-
// Force a status, body, failure or delay on matching requests — Buoy's answer
|
|
63
|
-
// to Chrome DevTools' Local Overrides, plus the status/latency/failure control
|
|
64
|
-
// Chrome doesn't have.
|
|
65
|
-
// =============================================================================
|
|
66
|
-
export { overrideRulesStore
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @internal — the desktop dashboard puts the rule store in remote-mirror mode
|
|
70
|
-
* so edits made there are forwarded to the device instead of stored locally.
|
|
71
|
-
*/ } from "./network/overrides/overrideRulesStore";
|
|
72
|
-
export { draftFromEvent } from "./network/overrides/presets";
|
|
73
|
-
export { MAX_RULES as MAX_OVERRIDE_RULES, FREE_TIER_RULE_LIMIT as FREE_TIER_OVERRIDE_LIMIT, STATUS_MIN as OVERRIDE_STATUS_MIN, STATUS_MAX as OVERRIDE_STATUS_MAX } from "./network/overrides/types";
|
|
74
|
-
|
|
75
|
-
// =============================================================================
|
|
76
|
-
// SHARED IGNORED-PATTERN FILTERING
|
|
77
|
-
// Re-exported from @buoy-gg/shared-ui so consumers wiring the Network detail
|
|
78
|
-
// page into other tools (e.g. the Events tool) can share the exact same
|
|
79
|
-
// ignored-domains/URL filter store + matching logic.
|
|
80
|
-
// =============================================================================
|
|
81
|
-
export { useIgnoredPatterns, ignoredPatternsStore, urlMatchesIgnoredPattern, isUrlIgnored } from "@buoy-gg/shared-ui";
|
|
82
|
-
|
|
83
|
-
// =============================================================================
|
|
84
|
-
// EXTERNAL SYNC (Adapter for @buoy-gg/external-sync's useExternalSync)
|
|
85
|
-
// =============================================================================
|
|
86
|
-
export { networkSyncAdapter } from "./network/sync/networkSyncAdapter";
|
|
87
|
-
export { NetworkBodyResolverProvider } from "./network/sync/networkBodyResolver";
|
|
88
|
-
|
|
89
|
-
// =============================================================================
|
|
90
|
-
// INTERNAL EXPORTS (For @buoy-gg/* packages only - not part of public API)
|
|
91
|
-
// These are re-exported for cross-package communication within the monorepo.
|
|
92
|
-
// External users should NOT rely on these - they may change without notice.
|
|
93
|
-
// =============================================================================
|
|
94
|
-
/** @internal */
|
|
95
|
-
export { networkEventStore } from "./network/utils/networkEventStore";
|
|
96
|
-
/**
|
|
97
|
-
* @internal — the desktop dashboard puts this in remote-mirror mode so pins
|
|
98
|
-
* made there are forwarded to the device instead of stored locally.
|
|
99
|
-
*/
|
|
100
|
-
export { networkSavedStore, flagsForEventId, FREE_TIER_SAVED_LIMIT, MAX_PINNED, MAX_SAVED } from "./network/utils/networkSavedStore";
|
|
101
|
-
export { generateCurl } from "./network/utils/generateCurl";
|
|
102
|
-
/** @internal */
|
|
103
|
-
export { networkListener, addNetworkListener, removeAllNetworkListeners } from "./network/utils/networkListener";
|
|
104
|
-
export { NETWORK_CONDITIONS, getNetworkCondition, setNetworkCondition, subscribeNetworkConditions } from "./network/conditions/store";
|
|
1
|
+
"use strict";export{networkToolPreset,createNetworkTool}from"./preset";export{startNetworkCapture}from"./network/utils/startNetworkCapture";export{NetworkModal,NetworkToolView}from"./network/components/NetworkModal";export{NetworkEventDetailView}from"./network/components/NetworkEventDetailView";export{NetworkEventItemCompact}from"./network/components/NetworkEventItemCompact";export{NetworkSavedScreen}from"./network/components/NetworkSavedScreen";export{NetworkSavedButton,NetworkDetailPinActions,NetworkHeaderBadgesView}from"./network/components/NetworkHeaderLive";export{useNetworkEvents}from"./network/hooks/useNetworkEvents";export{useNetworkEventList}from"./network/hooks/useNetworkEventList";export{useLiveNetworkEvent}from"./network/hooks/useLiveNetworkEvent";export{useNetworkBadgeCounts}from"./network/hooks/useNetworkBadgeCounts";export{useNetworkSaved}from"./network/hooks/useNetworkSaved";export{splitPinned}from"./network/utils/withPinnedFirst";export{networkSelectionStore,DEFAULT_SETTLE_MS}from"./network/utils/networkSelectionStore";export{TickProvider,useTickEveryMinute}from"./network/hooks/useTickEveryMinute";export{formatBytes,formatDuration,formatHttpStatus}from"./network/utils/formatting";export{overrideRulesStore}from"./network/overrides/overrideRulesStore";export{draftFromEvent}from"./network/overrides/presets";export{MAX_RULES as MAX_OVERRIDE_RULES,FREE_TIER_RULE_LIMIT as FREE_TIER_OVERRIDE_LIMIT,STATUS_MIN as OVERRIDE_STATUS_MIN,STATUS_MAX as OVERRIDE_STATUS_MAX}from"./network/overrides/types";export{useIgnoredPatterns,ignoredPatternsStore,urlMatchesIgnoredPattern,isUrlIgnored}from"@buoy-gg/shared-ui";export{networkSyncAdapter}from"./network/sync/networkSyncAdapter";export{NetworkBodyResolverProvider}from"./network/sync/networkBodyResolver";export{networkEventStore}from"./network/utils/networkEventStore";export{networkSavedStore,flagsForEventId,FREE_TIER_SAVED_LIMIT,MAX_PINNED,MAX_SAVED}from"./network/utils/networkSavedStore";export{generateCurl}from"./network/utils/generateCurl";export{networkListener,addNetworkListener,removeAllNetworkListeners}from"./network/utils/networkListener";export{NETWORK_CONDITIONS,getNetworkCondition,setNetworkCondition,subscribeNetworkConditions}from"./network/conditions/store";
|
package/lib/module/index.web.js
CHANGED
|
@@ -1,82 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @buoy-gg/network — Web Entry Point (webview ports: Tauri / Capacitor / web).
|
|
5
|
-
*
|
|
6
|
-
* Exposes the platform-free capture + data layer only. The capture core
|
|
7
|
-
* (networkListener) patches `globalThis.fetch` and `XMLHttpRequest.prototype`
|
|
8
|
-
* — standard web APIs — so it runs in a webview unchanged; the RN UI
|
|
9
|
-
* components (NetworkModal etc.) are NOT exported here. Their DOM twins are
|
|
10
|
-
* added feature-by-feature as the web tools port progresses.
|
|
11
|
-
*
|
|
12
|
-
* Consumers resolve `@buoy-gg/shared-ui` to a web shim (see
|
|
13
|
-
* example-tauri/src/shims/shared-ui.web.ts) providing localStorage-backed
|
|
14
|
-
* persistentStorage, devToolsStorageKeys, BaseEventStore, and the pure
|
|
15
|
-
* ignored-patterns helpers.
|
|
16
|
-
*
|
|
17
|
-
* @platform React DOM Web
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
// Capture core — fetch/XHR interception
|
|
21
|
-
export { networkListener, startNetworkListener, stopNetworkListener, addNetworkListener, removeAllNetworkListeners, isNetworkListening } from "./network/utils/networkListener";
|
|
22
|
-
// Event store + saved/pinned store
|
|
23
|
-
export { networkEventStore } from "./network/utils/networkEventStore";
|
|
24
|
-
export { networkSavedStore, flagsForEventId } from "./network/utils/networkSavedStore";
|
|
25
|
-
|
|
26
|
-
// Types
|
|
27
|
-
|
|
28
|
-
// Hooks (all platform-free: react + stores only)
|
|
29
|
-
export { useNetworkEvents, FREE_TIER_REQUEST_LIMIT } from "./network/hooks/useNetworkEvents";
|
|
30
|
-
export { useNetworkEventList } from "./network/hooks/useNetworkEventList";
|
|
31
|
-
export { useLiveNetworkEvent } from "./network/hooks/useLiveNetworkEvent";
|
|
32
|
-
export { useNetworkBadgeCounts } from "./network/hooks/useNetworkBadgeCounts";
|
|
33
|
-
|
|
34
|
-
// Selection cursor (detail view navigation) — platform-free store + hooks
|
|
35
|
-
export { useHasNetworkSelection, useSelectedNetworkEventId, useNetworkBodyEventId, useNetworkCursor } from "./network/hooks/useNetworkSelection";
|
|
36
|
-
export { networkSelectionStore, toSelectionIds } from "./network/utils/networkSelectionStore";
|
|
37
|
-
|
|
38
|
-
// DOM twins of the RN UI (added feature-by-feature; F2 = the LIST screen,
|
|
39
|
-
// F3 = the DETAIL view)
|
|
40
|
-
export { NetworkListScreen } from "./network/components/NetworkListScreen.web";
|
|
41
|
-
export { NetworkEventItemCompact } from "./network/components/NetworkEventItemCompact.web";
|
|
42
|
-
export { NetworkHeaderBadges, NetworkClearButton, NetworkSavedButton, NetworkDetailPinActions, NetworkHeaderCopyButton } from "./network/components/NetworkHeaderLive.web";
|
|
43
|
-
export { NetworkEventDetailView } from "./network/components/NetworkEventDetailView.web";
|
|
44
|
-
export { NetworkDetailStepper } from "./network/components/NetworkDetailStepper.web";
|
|
45
|
-
export { NetworkDetailScreen } from "./network/components/NetworkDetailScreen.web";
|
|
46
|
-
|
|
47
|
-
// F4 = FILTERS + SEARCH + IGNORED PATTERNS
|
|
48
|
-
export { NetworkFilterViewV3 } from "./network/components/NetworkFilterViewV3.web";
|
|
49
|
-
export { NetworkFilterScreen } from "./network/components/NetworkFilterScreen.web";
|
|
50
|
-
|
|
51
|
-
// F5 = SAVED/PINNED screen + COPY settings
|
|
52
|
-
export { NetworkSavedScreen } from "./network/components/NetworkSavedScreen.web";
|
|
53
|
-
export { NetworkCopySettingsView, DEFAULT_COPY_SETTINGS } from "./network/components/NetworkCopySettingsView.web";
|
|
54
|
-
export { NetworkCopyScreen } from "./network/components/NetworkCopyScreen.web";
|
|
55
|
-
export { generateNetworkCopyText } from "./network/utils/generateNetworkCopyText";
|
|
56
|
-
export { selectSavedEvents } from "./network/utils/selectSavedEvents";
|
|
57
|
-
export { FREE_TIER_SAVED_LIMIT, MAX_SAVED } from "./network/utils/networkSavedStore";
|
|
58
|
-
|
|
59
|
-
// F6 = RESPONSE OVERRIDES (screen + editor DOM twins on top of the
|
|
60
|
-
// platform-free rule store/engine the F1 capture core already applies)
|
|
61
|
-
export { NetworkOverridesScreen } from "./network/components/NetworkOverridesScreen.web";
|
|
62
|
-
export { NetworkOverrideEditor } from "./network/components/NetworkOverrideEditor.web";
|
|
63
|
-
export { NetworkNumberPrompt } from "./network/components/NetworkNumberPrompt.web";
|
|
64
|
-
export { NetworkOverridesButton } from "./network/components/NetworkOverridesButton.web";
|
|
65
|
-
export { NetworkOverrideHeaderButton } from "./network/components/NetworkOverrideHeaderButton.web";
|
|
66
|
-
export { useOverrideRules } from "./network/hooks/useOverrideRules";
|
|
67
|
-
// The persisted rule store — same `@react_buoy_network_overrides` storage key
|
|
68
|
-
// + JSON shape as native (persists through the shared-ui barrel, which web
|
|
69
|
-
// consumers resolve to their localStorage shim). Hosts call `ensureLoaded()`
|
|
70
|
-
// at boot, the way native preset.tsx does at import, so persisted rules fire
|
|
71
|
-
// from launch with the tool closed.
|
|
72
|
-
export { overrideRulesStore } from "./network/overrides/overrideRulesStore";
|
|
73
|
-
export { draftFromEvent, patternForUrl } from "./network/overrides/presets";
|
|
74
|
-
export { FREE_TIER_RULE_LIMIT, MAX_RULES, STATUS_MAX, STATUS_MIN } from "./network/overrides/types";
|
|
75
|
-
export { ruleMatches } from "./network/overrides/matchRule";
|
|
76
|
-
|
|
77
|
-
// Pure utils shared with the RN UI
|
|
78
|
-
export { filterNetworkEvents, applyIgnoredPatterns } from "./network/utils/filterNetworkEvents";
|
|
79
|
-
export { splitPinned } from "./network/utils/withPinnedFirst";
|
|
80
|
-
export { extractOperationName } from "./network/utils/extractOperationName";
|
|
81
|
-
export { generateCurl } from "./network/utils/generateCurl";
|
|
82
|
-
export { NETWORK_CONDITIONS, getNetworkCondition, setNetworkCondition, subscribeNetworkConditions } from "./network/conditions/store";
|
|
1
|
+
"use strict";export{networkListener,startNetworkListener,stopNetworkListener,addNetworkListener,removeAllNetworkListeners,isNetworkListening}from"./network/utils/networkListener";export{networkEventStore}from"./network/utils/networkEventStore";export{networkSavedStore,flagsForEventId}from"./network/utils/networkSavedStore";export{useNetworkEvents,FREE_TIER_REQUEST_LIMIT}from"./network/hooks/useNetworkEvents";export{useNetworkEventList}from"./network/hooks/useNetworkEventList";export{useLiveNetworkEvent}from"./network/hooks/useLiveNetworkEvent";export{useNetworkBadgeCounts}from"./network/hooks/useNetworkBadgeCounts";export{useHasNetworkSelection,useSelectedNetworkEventId,useNetworkBodyEventId,useNetworkCursor}from"./network/hooks/useNetworkSelection";export{networkSelectionStore,toSelectionIds}from"./network/utils/networkSelectionStore";export{NetworkListScreen}from"./network/components/NetworkListScreen.web";export{NetworkEventItemCompact}from"./network/components/NetworkEventItemCompact.web";export{NetworkHeaderBadges,NetworkClearButton,NetworkSavedButton,NetworkDetailPinActions,NetworkHeaderCopyButton}from"./network/components/NetworkHeaderLive.web";export{NetworkEventDetailView}from"./network/components/NetworkEventDetailView.web";export{NetworkDetailStepper}from"./network/components/NetworkDetailStepper.web";export{NetworkDetailScreen}from"./network/components/NetworkDetailScreen.web";export{NetworkFilterViewV3}from"./network/components/NetworkFilterViewV3.web";export{NetworkFilterScreen}from"./network/components/NetworkFilterScreen.web";export{NetworkSavedScreen}from"./network/components/NetworkSavedScreen.web";export{NetworkCopySettingsView,DEFAULT_COPY_SETTINGS}from"./network/components/NetworkCopySettingsView.web";export{NetworkCopyScreen}from"./network/components/NetworkCopyScreen.web";export{generateNetworkCopyText}from"./network/utils/generateNetworkCopyText";export{selectSavedEvents}from"./network/utils/selectSavedEvents";export{FREE_TIER_SAVED_LIMIT,MAX_SAVED}from"./network/utils/networkSavedStore";export{NetworkOverridesScreen}from"./network/components/NetworkOverridesScreen.web";export{NetworkOverrideEditor}from"./network/components/NetworkOverrideEditor.web";export{NetworkNumberPrompt}from"./network/components/NetworkNumberPrompt.web";export{NetworkOverridesButton}from"./network/components/NetworkOverridesButton.web";export{NetworkOverrideHeaderButton}from"./network/components/NetworkOverrideHeaderButton.web";export{useOverrideRules}from"./network/hooks/useOverrideRules";export{overrideRulesStore}from"./network/overrides/overrideRulesStore";export{draftFromEvent,patternForUrl}from"./network/overrides/presets";export{FREE_TIER_RULE_LIMIT,MAX_RULES,STATUS_MAX,STATUS_MIN}from"./network/overrides/types";export{ruleMatches}from"./network/overrides/matchRule";export{filterNetworkEvents,applyIgnoredPatterns}from"./network/utils/filterNetworkEvents";export{splitPinned}from"./network/utils/withPinnedFirst";export{extractOperationName}from"./network/utils/extractOperationName";export{generateCurl}from"./network/utils/generateCurl";export{NETWORK_CONDITIONS,getNetworkCondition,setNetworkCondition,subscribeNetworkConditions}from"./network/conditions/store";
|