@buoy-gg/network 7.0.15 → 7.0.16
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/lib/commonjs/index.web.js +395 -0
- package/lib/commonjs/network/components/DataViewer.web.js +879 -0
- package/lib/commonjs/network/components/NetworkCopyScreen.web.js +48 -0
- package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +1242 -0
- package/lib/commonjs/network/components/NetworkDetailScreen.web.js +101 -0
- package/lib/commonjs/network/components/NetworkDetailStepper.web.js +296 -0
- package/lib/commonjs/network/components/NetworkEventDetailView.web.js +1498 -0
- package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +802 -0
- package/lib/commonjs/network/components/NetworkFilterScreen.web.js +55 -0
- package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1310 -0
- package/lib/commonjs/network/components/NetworkHeaderLive.web.js +604 -0
- package/lib/commonjs/network/components/NetworkListScreen.js +2 -1
- package/lib/commonjs/network/components/NetworkListScreen.web.js +607 -0
- package/lib/commonjs/network/components/NetworkModal.js +12 -3
- package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +232 -0
- package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +942 -0
- package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +133 -0
- package/lib/commonjs/network/components/NetworkOverridesButton.web.js +143 -0
- package/lib/commonjs/network/components/NetworkOverridesScreen.js +160 -126
- package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +830 -0
- package/lib/commonjs/network/components/NetworkSavedScreen.web.js +459 -0
- package/lib/commonjs/network/components/response-editor/Explorer.web.js +1136 -0
- package/lib/commonjs/network/hooks/useNetworkEventList.js +12 -2
- package/lib/commonjs/network/overrides/applyToXhr.js +276 -15
- package/lib/commonjs/network/utils/generateNetworkCopyText.js +32 -5
- package/lib/commonjs/network/utils/networkEventStore.js +12 -4
- package/lib/commonjs/network/utils/networkListener.js +1 -16
- package/lib/module/index.web.js +81 -0
- package/lib/module/network/components/DataViewer.web.js +875 -0
- package/lib/module/network/components/NetworkCopyScreen.web.js +44 -0
- package/lib/module/network/components/NetworkCopySettingsView.web.js +1237 -0
- package/lib/module/network/components/NetworkDetailScreen.web.js +97 -0
- package/lib/module/network/components/NetworkDetailStepper.web.js +294 -0
- package/lib/module/network/components/NetworkEventDetailView.web.js +1496 -0
- package/lib/module/network/components/NetworkEventItemCompact.web.js +800 -0
- package/lib/module/network/components/NetworkFilterScreen.web.js +51 -0
- package/lib/module/network/components/NetworkFilterViewV3.web.js +1306 -0
- package/lib/module/network/components/NetworkHeaderLive.web.js +598 -0
- package/lib/module/network/components/NetworkListScreen.js +2 -1
- package/lib/module/network/components/NetworkListScreen.web.js +605 -0
- package/lib/module/network/components/NetworkModal.js +12 -3
- package/lib/module/network/components/NetworkNumberPrompt.web.js +230 -0
- package/lib/module/network/components/NetworkOverrideEditor.web.js +939 -0
- package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +131 -0
- package/lib/module/network/components/NetworkOverridesButton.web.js +141 -0
- package/lib/module/network/components/NetworkOverridesScreen.js +161 -127
- package/lib/module/network/components/NetworkOverridesScreen.web.js +826 -0
- package/lib/module/network/components/NetworkSavedScreen.web.js +457 -0
- package/lib/module/network/components/response-editor/Explorer.web.js +1133 -0
- package/lib/module/network/hooks/useNetworkEventList.js +12 -2
- package/lib/module/network/overrides/applyToXhr.js +275 -15
- package/lib/module/network/utils/generateNetworkCopyText.js +28 -1
- package/lib/module/network/utils/networkEventStore.js +12 -4
- package/lib/module/network/utils/networkListener.js +1 -16
- package/lib/typescript/index.web.d.ts +56 -0
- package/lib/typescript/index.web.d.ts.map +1 -0
- package/lib/typescript/network/components/DataViewer.web.d.ts +78 -0
- package/lib/typescript/network/components/DataViewer.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts +27 -0
- package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts +68 -0
- package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts +45 -0
- package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts +40 -0
- package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts +67 -0
- package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts +58 -0
- package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts +28 -0
- package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts +74 -0
- package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts +112 -0
- package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkListScreen.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkListScreen.web.d.ts +63 -0
- package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkModal.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts +38 -0
- package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts +43 -0
- package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts +32 -0
- package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts +26 -0
- package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkOverridesScreen.d.ts +9 -0
- package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts +69 -0
- package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts +67 -0
- package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +1 -0
- package/lib/typescript/network/components/response-editor/Explorer.web.d.ts +56 -0
- package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +1 -0
- package/lib/typescript/network/hooks/useNetworkEventList.d.ts +10 -0
- package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +1 -1
- package/lib/typescript/network/overrides/__tests__/applyToXhr.test.d.ts.map +1 -1
- package/lib/typescript/network/overrides/applyToXhr.d.ts +40 -14
- package/lib/typescript/network/overrides/applyToXhr.d.ts.map +1 -1
- package/lib/typescript/network/utils/generateNetworkCopyText.d.ts +34 -1
- package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +1 -1
- package/lib/typescript/network/utils/networkEventStore.d.ts.map +1 -1
- package/lib/typescript/network/utils/networkListener.d.ts +0 -1
- package/lib/typescript/network/utils/networkListener.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,1242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_COPY_SETTINGS = void 0;
|
|
7
|
+
exports.NetworkCopySettingsView = NetworkCopySettingsView;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _DataViewer = require("./DataViewer.web");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* NetworkCopySettingsView.web — DOM twin of NetworkCopySettingsView.tsx.
|
|
13
|
+
*
|
|
14
|
+
* The COPY tab's configurator: quick presets (URLs / LLM / JSON / Full /
|
|
15
|
+
* Custom), the Include toggles, the output-format pick, and the collapsible
|
|
16
|
+
* live preview with its size warnings and copy action. Same preset configs,
|
|
17
|
+
* preset detection, option-change routing (`group::key` ids), mock-request
|
|
18
|
+
* fallback, size estimation and preview/copy text generation as the native
|
|
19
|
+
* file — all copied verbatim.
|
|
20
|
+
*
|
|
21
|
+
* Natively the chrome is shared-ui's `DynamicFilterView`; the web shim
|
|
22
|
+
* doesn't ship it, so this twin renders the exact subtree DynamicFilterView
|
|
23
|
+
* produces FOR THIS CONFIG (no tabs, no filter-summary, no pattern sections —
|
|
24
|
+
* those config branches are unused here), same precedent as
|
|
25
|
+
* NetworkFilterViewV3.web:
|
|
26
|
+
* 1. Facet-card sections — Presets (icon + label), Include (label-only
|
|
27
|
+
* toggles), Format (icon + label); single active-card treatment
|
|
28
|
+
* (primary fill + 2px ring + glow).
|
|
29
|
+
* 2. PREVIEW section — SectionHeader (Eye icon, title, header actions =
|
|
30
|
+
* status label + toolbar copy button) over the recessed content box;
|
|
31
|
+
* collapsed by default behind the Show Preview summary (request count +
|
|
32
|
+
* estimated size + large-payload warnings), exactly like native.
|
|
33
|
+
*
|
|
34
|
+
* shared-ui RN chrome replicated as DOM with provenance:
|
|
35
|
+
* - `buoyColors` / `macOSColors` — inlined verbatim subsets from
|
|
36
|
+
* shared/src/ui/gameUI/constants/ (DynamicFilterView + SectionHeader use
|
|
37
|
+
* buoyColors; the preview widgets use macOSColors directly).
|
|
38
|
+
* - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
|
|
39
|
+
* - `ToolbarCopyButton` — the DataViewer.web `CopyButton` twin at size 14
|
|
40
|
+
* (the native preset is exactly `CopyButton size={14}` with default
|
|
41
|
+
* colors); copies via navigator.clipboard with the same 1500ms feedback.
|
|
42
|
+
* - `DataViewer` (JSON-format preview) — the DataViewer.web twin.
|
|
43
|
+
* - `formatRelativeTime` — copied verbatim from
|
|
44
|
+
* shared/src/utils/time/formatRelativeTime.ts.
|
|
45
|
+
* - Native card glow (`shadowColor` primary, opacity 0.3, radius 8) → an
|
|
46
|
+
* equivalent CSS box-shadow.
|
|
47
|
+
*
|
|
48
|
+
* Intentional deviations (all logged):
|
|
49
|
+
* - License gating isn't part of the web port: native reads
|
|
50
|
+
* `useFeatureGate()` and wraps the view in a `ProFeatureBanner` for free
|
|
51
|
+
* users; here `isPro` is a constant true, so that branch never renders and
|
|
52
|
+
* is not ported. Copy is likewise ungated (native's CopyButton shows a
|
|
53
|
+
* Pro modal via @buoy-gg/license).
|
|
54
|
+
* - `useTickEveryMinute` (shared TickProvider context, 5s cadence as mounted
|
|
55
|
+
* by NetworkModal) → the same module-level shared 5s interval hook the
|
|
56
|
+
* compact row twin uses.
|
|
57
|
+
* - Native's `previewData` memo is dead code (computed, never read) and is
|
|
58
|
+
* dropped here — the host tsconfig runs `noUnusedLocals`.
|
|
59
|
+
* - `selectable={isPro}` on the preview text → `userSelect: "text"` (isPro
|
|
60
|
+
* is constant-true on web).
|
|
61
|
+
* - `CopySettings` / `DEFAULT_COPY_SETTINGS` are re-declared against the
|
|
62
|
+
* platform-free type in `generateNetworkCopyText` (the native module would
|
|
63
|
+
* drag react-native in); the shape is byte-identical.
|
|
64
|
+
*
|
|
65
|
+
* @platform React DOM Web
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/** NetworkCopySettingsView.tsx `DEFAULT_COPY_SETTINGS`, verbatim. */
|
|
69
|
+
const DEFAULT_COPY_SETTINGS = exports.DEFAULT_COPY_SETTINGS = {
|
|
70
|
+
includeMethod: true,
|
|
71
|
+
includeStatus: true,
|
|
72
|
+
includeDuration: true,
|
|
73
|
+
includeTimestamp: true,
|
|
74
|
+
includeClient: true,
|
|
75
|
+
includeSizes: true,
|
|
76
|
+
includeErrors: true,
|
|
77
|
+
includeRequestHeaders: true,
|
|
78
|
+
includeResponseHeaders: true,
|
|
79
|
+
includeRequestBody: true,
|
|
80
|
+
includeResponseBody: true,
|
|
81
|
+
bodySizeThreshold: 10,
|
|
82
|
+
format: "markdown",
|
|
83
|
+
filterMode: "all"
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// =============================
|
|
87
|
+
// Native palettes (provenance)
|
|
88
|
+
// =============================
|
|
89
|
+
|
|
90
|
+
/** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts, verbatim. */
|
|
91
|
+
const buoyColors = {
|
|
92
|
+
base: "#121212",
|
|
93
|
+
card: "#1A1A1A",
|
|
94
|
+
hover: "#242424",
|
|
95
|
+
border: "#333333",
|
|
96
|
+
borderStrong: "#444444",
|
|
97
|
+
text: "#E0E0E0",
|
|
98
|
+
primary: "#20C997"
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
|
|
102
|
+
const macOSColors = {
|
|
103
|
+
background: {
|
|
104
|
+
input: "#26262A",
|
|
105
|
+
hover: "#1D1D1F"
|
|
106
|
+
},
|
|
107
|
+
border: {
|
|
108
|
+
default: "#2D2D2F"
|
|
109
|
+
},
|
|
110
|
+
text: {
|
|
111
|
+
primary: "#F5F5F7",
|
|
112
|
+
secondary: "#A1A1A6",
|
|
113
|
+
muted: "#8E8E93"
|
|
114
|
+
},
|
|
115
|
+
semantic: {
|
|
116
|
+
success: "#34C759",
|
|
117
|
+
error: "#FF453A",
|
|
118
|
+
errorBackground: "rgba(255, 69, 58, 0.15)",
|
|
119
|
+
warning: "#FFEB3B",
|
|
120
|
+
warningBackground: "rgba(255, 235, 59, 0.15)",
|
|
121
|
+
info: "#00B8E6"
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// =============================
|
|
126
|
+
// Inline lucide icons (shared-ui icons are lucide re-exports)
|
|
127
|
+
// =============================
|
|
128
|
+
|
|
129
|
+
function Svg({
|
|
130
|
+
size = 14,
|
|
131
|
+
color = "currentColor",
|
|
132
|
+
children
|
|
133
|
+
}) {
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
135
|
+
width: size,
|
|
136
|
+
height: size,
|
|
137
|
+
viewBox: "0 0 24 24",
|
|
138
|
+
fill: "none",
|
|
139
|
+
stroke: color,
|
|
140
|
+
strokeWidth: 2,
|
|
141
|
+
strokeLinecap: "round",
|
|
142
|
+
strokeLinejoin: "round",
|
|
143
|
+
style: {
|
|
144
|
+
flexShrink: 0,
|
|
145
|
+
display: "block"
|
|
146
|
+
},
|
|
147
|
+
children: children
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const FileText = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
151
|
+
...p,
|
|
152
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
153
|
+
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"
|
|
154
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
155
|
+
d: "M14 2v4a2 2 0 0 0 2 2h4"
|
|
156
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
157
|
+
d: "M10 9H8"
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
159
|
+
d: "M16 13H8"
|
|
160
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
161
|
+
d: "M16 17H8"
|
|
162
|
+
})]
|
|
163
|
+
});
|
|
164
|
+
const FileCode = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
165
|
+
...p,
|
|
166
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
167
|
+
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"
|
|
168
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
169
|
+
d: "M14 2v4a2 2 0 0 0 2 2h4"
|
|
170
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
171
|
+
d: "M10 12.5 8 15l2 2.5"
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
173
|
+
d: "m14 12.5 2 2.5-2 2.5"
|
|
174
|
+
})]
|
|
175
|
+
});
|
|
176
|
+
const Link = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
177
|
+
...p,
|
|
178
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
179
|
+
d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"
|
|
180
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
181
|
+
d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
182
|
+
})]
|
|
183
|
+
});
|
|
184
|
+
const Zap = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
|
|
185
|
+
...p,
|
|
186
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("polygon", {
|
|
187
|
+
points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2"
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
const Settings = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
191
|
+
...p,
|
|
192
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
193
|
+
d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
|
|
194
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
|
|
195
|
+
cx: "12",
|
|
196
|
+
cy: "12",
|
|
197
|
+
r: "3"
|
|
198
|
+
})]
|
|
199
|
+
});
|
|
200
|
+
const Hash = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
201
|
+
...p,
|
|
202
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
|
|
203
|
+
x1: "4",
|
|
204
|
+
x2: "20",
|
|
205
|
+
y1: "9",
|
|
206
|
+
y2: "9"
|
|
207
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
|
|
208
|
+
x1: "4",
|
|
209
|
+
x2: "20",
|
|
210
|
+
y1: "15",
|
|
211
|
+
y2: "15"
|
|
212
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
|
|
213
|
+
x1: "10",
|
|
214
|
+
x2: "8",
|
|
215
|
+
y1: "3",
|
|
216
|
+
y2: "21"
|
|
217
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
|
|
218
|
+
x1: "16",
|
|
219
|
+
x2: "14",
|
|
220
|
+
y1: "3",
|
|
221
|
+
y2: "21"
|
|
222
|
+
})]
|
|
223
|
+
});
|
|
224
|
+
const Eye = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
225
|
+
...p,
|
|
226
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
227
|
+
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
|
|
228
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
|
|
229
|
+
cx: "12",
|
|
230
|
+
cy: "12",
|
|
231
|
+
r: "3"
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
const ChevronDown = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
|
|
235
|
+
...p,
|
|
236
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
237
|
+
d: "m6 9 6 6 6-6"
|
|
238
|
+
})
|
|
239
|
+
});
|
|
240
|
+
const ChevronUp = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
|
|
241
|
+
...p,
|
|
242
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
243
|
+
d: "m18 15-6-6-6 6"
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
const AlertTriangle = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
|
|
247
|
+
...p,
|
|
248
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
249
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
|
|
250
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
251
|
+
d: "M12 9v4"
|
|
252
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
253
|
+
d: "M12 17h.01"
|
|
254
|
+
})]
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// =============================
|
|
258
|
+
// Shared tick (DEVIATION: replaces shared-ui TickProvider/useTickEveryMinute)
|
|
259
|
+
// =============================
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* One module-level 5s clock — the cadence NetworkModal's `TickProvider` gives
|
|
263
|
+
* the native view (default `intervalMs` 5_000). Runs only while a consumer is
|
|
264
|
+
* mounted. Same pattern as NetworkEventItemCompact.web.
|
|
265
|
+
*/
|
|
266
|
+
const tickListeners = new Set();
|
|
267
|
+
let tickInterval = null;
|
|
268
|
+
function subscribeTick(listener) {
|
|
269
|
+
tickListeners.add(listener);
|
|
270
|
+
if (tickInterval == null) {
|
|
271
|
+
tickInterval = setInterval(() => {
|
|
272
|
+
const now = Date.now();
|
|
273
|
+
tickListeners.forEach(l => l(now));
|
|
274
|
+
}, 5_000);
|
|
275
|
+
}
|
|
276
|
+
return () => {
|
|
277
|
+
tickListeners.delete(listener);
|
|
278
|
+
if (tickListeners.size === 0 && tickInterval != null) {
|
|
279
|
+
clearInterval(tickInterval);
|
|
280
|
+
tickInterval = null;
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function useSharedTick() {
|
|
285
|
+
const [tick, setTick] = (0, _react.useState)(() => Date.now());
|
|
286
|
+
(0, _react.useEffect)(() => subscribeTick(setTick), []);
|
|
287
|
+
return tick;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** shared/src/utils/time/formatRelativeTime.ts — verbatim. */
|
|
291
|
+
function formatRelativeTime(timestamp, currentTime = Date.now()) {
|
|
292
|
+
const timestampMs = timestamp instanceof Date ? timestamp.getTime() : timestamp;
|
|
293
|
+
const seconds = Math.floor((currentTime - timestampMs) / 1000);
|
|
294
|
+
if (seconds < 0) {
|
|
295
|
+
return "just now";
|
|
296
|
+
}
|
|
297
|
+
if (seconds < 60) {
|
|
298
|
+
return seconds === 0 ? "just now" : `${seconds}s ago`;
|
|
299
|
+
}
|
|
300
|
+
const minutes = Math.floor(seconds / 60);
|
|
301
|
+
if (minutes < 60) {
|
|
302
|
+
return `${minutes}m ago`;
|
|
303
|
+
}
|
|
304
|
+
const hours = Math.floor(minutes / 60);
|
|
305
|
+
if (hours < 24) {
|
|
306
|
+
return `${hours}h ago`;
|
|
307
|
+
}
|
|
308
|
+
const days = Math.floor(hours / 24);
|
|
309
|
+
return `${days}d ago`;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// =============================
|
|
313
|
+
// Config + pure helpers (copied verbatim from the native file)
|
|
314
|
+
// =============================
|
|
315
|
+
|
|
316
|
+
// Preset configurations for comparison
|
|
317
|
+
const PRESET_CONFIGS = {
|
|
318
|
+
urls: {
|
|
319
|
+
includeMethod: true,
|
|
320
|
+
includeStatus: false,
|
|
321
|
+
includeDuration: false,
|
|
322
|
+
includeTimestamp: false,
|
|
323
|
+
includeClient: false,
|
|
324
|
+
includeSizes: false,
|
|
325
|
+
includeErrors: false,
|
|
326
|
+
includeRequestHeaders: false,
|
|
327
|
+
includeResponseHeaders: false,
|
|
328
|
+
includeRequestBody: false,
|
|
329
|
+
includeResponseBody: false,
|
|
330
|
+
bodySizeThreshold: 10,
|
|
331
|
+
format: "plaintext",
|
|
332
|
+
filterMode: "all"
|
|
333
|
+
},
|
|
334
|
+
llm: {
|
|
335
|
+
includeMethod: true,
|
|
336
|
+
includeStatus: true,
|
|
337
|
+
includeDuration: true,
|
|
338
|
+
includeTimestamp: true,
|
|
339
|
+
includeClient: true,
|
|
340
|
+
includeSizes: true,
|
|
341
|
+
includeErrors: true,
|
|
342
|
+
includeRequestHeaders: true,
|
|
343
|
+
includeResponseHeaders: true,
|
|
344
|
+
includeRequestBody: true,
|
|
345
|
+
includeResponseBody: true,
|
|
346
|
+
bodySizeThreshold: 10,
|
|
347
|
+
format: "markdown",
|
|
348
|
+
filterMode: "all"
|
|
349
|
+
},
|
|
350
|
+
json: {
|
|
351
|
+
includeMethod: true,
|
|
352
|
+
includeStatus: true,
|
|
353
|
+
includeDuration: true,
|
|
354
|
+
includeTimestamp: true,
|
|
355
|
+
includeClient: true,
|
|
356
|
+
includeSizes: true,
|
|
357
|
+
includeErrors: true,
|
|
358
|
+
includeRequestHeaders: true,
|
|
359
|
+
includeResponseHeaders: true,
|
|
360
|
+
includeRequestBody: true,
|
|
361
|
+
includeResponseBody: true,
|
|
362
|
+
bodySizeThreshold: -1,
|
|
363
|
+
format: "json",
|
|
364
|
+
filterMode: "all"
|
|
365
|
+
},
|
|
366
|
+
full: {
|
|
367
|
+
includeMethod: true,
|
|
368
|
+
includeStatus: true,
|
|
369
|
+
includeDuration: true,
|
|
370
|
+
includeTimestamp: true,
|
|
371
|
+
includeClient: true,
|
|
372
|
+
includeSizes: true,
|
|
373
|
+
includeErrors: true,
|
|
374
|
+
includeRequestHeaders: true,
|
|
375
|
+
includeResponseHeaders: true,
|
|
376
|
+
includeRequestBody: true,
|
|
377
|
+
includeResponseBody: true,
|
|
378
|
+
bodySizeThreshold: -1,
|
|
379
|
+
format: "markdown",
|
|
380
|
+
filterMode: "all"
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
// Detect which preset matches current settings
|
|
384
|
+
function detectActivePreset(settings) {
|
|
385
|
+
for (const [presetName, presetConfig] of Object.entries(PRESET_CONFIGS)) {
|
|
386
|
+
const matches = Object.keys(presetConfig).every(key => presetConfig[key] === settings[key]);
|
|
387
|
+
if (matches) return presetName;
|
|
388
|
+
}
|
|
389
|
+
return null; // No preset matches = Custom
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Size thresholds for warnings
|
|
393
|
+
const SIZE_WARNING_THRESHOLD = 100 * 1024; // 100KB - show warning
|
|
394
|
+
const SIZE_DANGER_THRESHOLD = 500 * 1024; // 500KB - show danger warning
|
|
395
|
+
|
|
396
|
+
// Helper to format bytes for display
|
|
397
|
+
function formatBytes(bytes) {
|
|
398
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
399
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
400
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// =============================
|
|
404
|
+
// DynamicFilterView chrome twins for this config (provenance:
|
|
405
|
+
// shared/src/ui/components/DynamicFilterView.tsx + SectionHeader.tsx)
|
|
406
|
+
// =============================
|
|
407
|
+
|
|
408
|
+
/** SectionHeader DOM twin — container row, 16/8 padding, minHeight 40. */
|
|
409
|
+
function SectionHeaderRow({
|
|
410
|
+
icon: Icon,
|
|
411
|
+
iconColor,
|
|
412
|
+
title,
|
|
413
|
+
actions
|
|
414
|
+
}) {
|
|
415
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
416
|
+
style: styles.sectionHeader,
|
|
417
|
+
children: [Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
418
|
+
style: styles.sectionHeaderIcon,
|
|
419
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
420
|
+
size: 12,
|
|
421
|
+
color: iconColor ?? buoyColors.primary
|
|
422
|
+
})
|
|
423
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
424
|
+
style: styles.sectionHeaderTitle,
|
|
425
|
+
children: title
|
|
426
|
+
}), actions ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
427
|
+
style: styles.sectionHeaderActions,
|
|
428
|
+
children: actions
|
|
429
|
+
}) : null]
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/** DynamicFilterView's facet-card grid section for a `custom` section. */
|
|
434
|
+
function FilterCardSection({
|
|
435
|
+
title,
|
|
436
|
+
options,
|
|
437
|
+
onOptionPress
|
|
438
|
+
}) {
|
|
439
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
440
|
+
style: styles.section,
|
|
441
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeaderRow, {
|
|
442
|
+
title: title
|
|
443
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
444
|
+
style: styles.filterGrid,
|
|
445
|
+
children: options.map(option => {
|
|
446
|
+
const Icon = option.icon;
|
|
447
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
448
|
+
type: "button",
|
|
449
|
+
onClick: () => onOptionPress(option.id, option.value),
|
|
450
|
+
style: {
|
|
451
|
+
...styles.filterCard,
|
|
452
|
+
...(option.isActive ? styles.activeFilterCard : null)
|
|
453
|
+
},
|
|
454
|
+
children: [Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
455
|
+
size: 24,
|
|
456
|
+
color: option.color
|
|
457
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
458
|
+
style: styles.filterLabelCompact,
|
|
459
|
+
children: option.label
|
|
460
|
+
})]
|
|
461
|
+
}, option.id);
|
|
462
|
+
})
|
|
463
|
+
})]
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// =============================
|
|
468
|
+
// View (structure + logic mirror the native file 1:1)
|
|
469
|
+
// =============================
|
|
470
|
+
|
|
471
|
+
function NetworkCopySettingsView({
|
|
472
|
+
settings,
|
|
473
|
+
onSettingsChange,
|
|
474
|
+
events = []
|
|
475
|
+
}) {
|
|
476
|
+
// DEVIATION: native reads `useFeatureGate()`; license gating isn't part of
|
|
477
|
+
// the web port, so the free-user ProFeatureBanner branch never renders.
|
|
478
|
+
const isPro = true;
|
|
479
|
+
|
|
480
|
+
// Use tick for updating relative time
|
|
481
|
+
const tick = useSharedTick();
|
|
482
|
+
|
|
483
|
+
// State for preview expansion - collapsed by default to prevent crashes
|
|
484
|
+
const [isPreviewExpanded, setIsPreviewExpanded] = (0, _react.useState)(false);
|
|
485
|
+
|
|
486
|
+
// Auto-detect if we have live data
|
|
487
|
+
const hasLiveData = events.length > 0;
|
|
488
|
+
|
|
489
|
+
// Get the most recent event timestamp for "last updated" display
|
|
490
|
+
const lastEventTimestamp = (0, _react.useMemo)(() => {
|
|
491
|
+
if (!hasLiveData) return null;
|
|
492
|
+
const timestamps = events.map(e => typeof e.timestamp === "number" ? e.timestamp : new Date(e.timestamp).getTime());
|
|
493
|
+
return Math.max(...timestamps);
|
|
494
|
+
}, [events, hasLiveData]);
|
|
495
|
+
|
|
496
|
+
// Detect active preset
|
|
497
|
+
const activePreset = (0, _react.useMemo)(() => detectActivePreset(settings), [settings]);
|
|
498
|
+
|
|
499
|
+
// Quick preset handlers
|
|
500
|
+
const applyUrlsPreset = (0, _react.useCallback)(() => {
|
|
501
|
+
onSettingsChange(PRESET_CONFIGS.urls);
|
|
502
|
+
}, [onSettingsChange]);
|
|
503
|
+
const applyLLMPreset = (0, _react.useCallback)(() => {
|
|
504
|
+
onSettingsChange(PRESET_CONFIGS.llm);
|
|
505
|
+
}, [onSettingsChange]);
|
|
506
|
+
const applyJSONPreset = (0, _react.useCallback)(() => {
|
|
507
|
+
onSettingsChange(PRESET_CONFIGS.json);
|
|
508
|
+
}, [onSettingsChange]);
|
|
509
|
+
const applyFullPreset = (0, _react.useCallback)(() => {
|
|
510
|
+
onSettingsChange(PRESET_CONFIGS.full);
|
|
511
|
+
}, [onSettingsChange]);
|
|
512
|
+
|
|
513
|
+
// Handle individual option changes
|
|
514
|
+
const handleOptionChange = (0, _react.useCallback)((optionId, value) => {
|
|
515
|
+
const [group, key] = optionId.split("::");
|
|
516
|
+
if (group === "preset") {
|
|
517
|
+
switch (key) {
|
|
518
|
+
case "urls":
|
|
519
|
+
applyUrlsPreset();
|
|
520
|
+
break;
|
|
521
|
+
case "llm":
|
|
522
|
+
applyLLMPreset();
|
|
523
|
+
break;
|
|
524
|
+
case "json":
|
|
525
|
+
applyJSONPreset();
|
|
526
|
+
break;
|
|
527
|
+
case "full":
|
|
528
|
+
applyFullPreset();
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (group === "requestInfo") {
|
|
534
|
+
// Toggle boolean value
|
|
535
|
+
onSettingsChange({
|
|
536
|
+
...settings,
|
|
537
|
+
[key]: !settings[key]
|
|
538
|
+
});
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
if (group === "headers") {
|
|
542
|
+
// Toggle boolean value
|
|
543
|
+
onSettingsChange({
|
|
544
|
+
...settings,
|
|
545
|
+
[key]: !settings[key]
|
|
546
|
+
});
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (group === "body") {
|
|
550
|
+
if (key === "bodySizeThreshold") {
|
|
551
|
+
onSettingsChange({
|
|
552
|
+
...settings,
|
|
553
|
+
bodySizeThreshold: value
|
|
554
|
+
});
|
|
555
|
+
} else {
|
|
556
|
+
// Toggle boolean value
|
|
557
|
+
onSettingsChange({
|
|
558
|
+
...settings,
|
|
559
|
+
[key]: !settings[key]
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (group === "format") {
|
|
565
|
+
onSettingsChange({
|
|
566
|
+
...settings,
|
|
567
|
+
format: value
|
|
568
|
+
});
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
if (group === "filter") {
|
|
572
|
+
onSettingsChange({
|
|
573
|
+
...settings,
|
|
574
|
+
filterMode: value
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}, [settings, onSettingsChange, applyUrlsPreset, applyLLMPreset, applyJSONPreset, applyFullPreset]);
|
|
578
|
+
|
|
579
|
+
// Mock data for preview
|
|
580
|
+
const mockRequestData = (0, _react.useMemo)(() => ({
|
|
581
|
+
method: "POST",
|
|
582
|
+
url: "https://api.example.com/v1/users",
|
|
583
|
+
status: 201,
|
|
584
|
+
duration: 342,
|
|
585
|
+
timestamp: new Date().toISOString(),
|
|
586
|
+
requestHeaders: {
|
|
587
|
+
"Content-Type": "application/json",
|
|
588
|
+
Authorization: "Bearer ***"
|
|
589
|
+
},
|
|
590
|
+
responseHeaders: {
|
|
591
|
+
"Content-Type": "application/json",
|
|
592
|
+
"X-Request-ID": "abc123"
|
|
593
|
+
},
|
|
594
|
+
requestBody: {
|
|
595
|
+
name: "John Doe",
|
|
596
|
+
email: "john@example.com"
|
|
597
|
+
},
|
|
598
|
+
responseBody: {
|
|
599
|
+
id: "user_123",
|
|
600
|
+
name: "John Doe",
|
|
601
|
+
email: "john@example.com",
|
|
602
|
+
createdAt: "2025-01-10T12:00:00Z"
|
|
603
|
+
}
|
|
604
|
+
}), []);
|
|
605
|
+
|
|
606
|
+
// Estimate the size of the preview content to warn users about large payloads
|
|
607
|
+
const estimatedSize = (0, _react.useMemo)(() => {
|
|
608
|
+
const dataSource = hasLiveData ? events : [mockRequestData];
|
|
609
|
+
let totalSize = 0;
|
|
610
|
+
for (const eventData of dataSource) {
|
|
611
|
+
// Estimate based on what's included
|
|
612
|
+
if (settings.includeMethod) {
|
|
613
|
+
totalSize += (eventData.url?.length || 0) + 10;
|
|
614
|
+
}
|
|
615
|
+
if (settings.includeStatus) {
|
|
616
|
+
totalSize += 30;
|
|
617
|
+
}
|
|
618
|
+
if (settings.includeTimestamp) {
|
|
619
|
+
totalSize += 30;
|
|
620
|
+
}
|
|
621
|
+
if (settings.includeRequestHeaders) {
|
|
622
|
+
try {
|
|
623
|
+
totalSize += JSON.stringify(eventData.requestHeaders || {}).length;
|
|
624
|
+
} catch {
|
|
625
|
+
totalSize += 100;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (settings.includeRequestBody) {
|
|
629
|
+
const body = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
|
|
630
|
+
try {
|
|
631
|
+
totalSize += JSON.stringify(body || {}).length;
|
|
632
|
+
} catch {
|
|
633
|
+
totalSize += 100;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (settings.includeResponseBody) {
|
|
637
|
+
const body = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
|
|
638
|
+
try {
|
|
639
|
+
totalSize += JSON.stringify(body || {}).length;
|
|
640
|
+
} catch {
|
|
641
|
+
totalSize += 100;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
return totalSize;
|
|
646
|
+
}, [hasLiveData, events, mockRequestData, settings]);
|
|
647
|
+
|
|
648
|
+
// Determine warning level based on estimated size
|
|
649
|
+
const sizeWarningLevel = (0, _react.useMemo)(() => {
|
|
650
|
+
if (estimatedSize >= SIZE_DANGER_THRESHOLD) return "danger";
|
|
651
|
+
if (estimatedSize >= SIZE_WARNING_THRESHOLD) return "warning";
|
|
652
|
+
return "none";
|
|
653
|
+
}, [estimatedSize]);
|
|
654
|
+
|
|
655
|
+
// Generate copy text - should match preview content exactly
|
|
656
|
+
const generateCopyText = (0, _react.useCallback)(() => {
|
|
657
|
+
const dataSource = hasLiveData ? events : [mockRequestData];
|
|
658
|
+
const {
|
|
659
|
+
format,
|
|
660
|
+
includeMethod,
|
|
661
|
+
includeStatus,
|
|
662
|
+
includeTimestamp,
|
|
663
|
+
includeRequestHeaders,
|
|
664
|
+
includeRequestBody,
|
|
665
|
+
includeResponseBody
|
|
666
|
+
} = settings;
|
|
667
|
+
|
|
668
|
+
// Build filtered data for a single event
|
|
669
|
+
const buildFilteredData = eventData => {
|
|
670
|
+
const data = {};
|
|
671
|
+
if (includeMethod) {
|
|
672
|
+
data.method = eventData.method;
|
|
673
|
+
data.url = eventData.url;
|
|
674
|
+
}
|
|
675
|
+
if (includeStatus) {
|
|
676
|
+
data.status = eventData.status;
|
|
677
|
+
data.duration = eventData.duration;
|
|
678
|
+
}
|
|
679
|
+
if (includeTimestamp) {
|
|
680
|
+
data.timestamp = eventData.timestamp;
|
|
681
|
+
}
|
|
682
|
+
if (includeRequestHeaders) {
|
|
683
|
+
data.requestHeaders = eventData.requestHeaders;
|
|
684
|
+
}
|
|
685
|
+
if (includeRequestBody) {
|
|
686
|
+
data.requestBody = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
|
|
687
|
+
}
|
|
688
|
+
if (includeResponseBody) {
|
|
689
|
+
data.responseBody = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
|
|
690
|
+
}
|
|
691
|
+
return data;
|
|
692
|
+
};
|
|
693
|
+
if (format === "json") {
|
|
694
|
+
const allFilteredData = dataSource.map(buildFilteredData);
|
|
695
|
+
return JSON.stringify(allFilteredData, null, 2);
|
|
696
|
+
}
|
|
697
|
+
if (format === "markdown") {
|
|
698
|
+
const allRequests = dataSource.map((eventData, index) => {
|
|
699
|
+
const sections = [];
|
|
700
|
+
sections.push(`# Request ${index + 1}`);
|
|
701
|
+
if (includeMethod) {
|
|
702
|
+
sections.push(`\n**${eventData.method}** ${eventData.url}`);
|
|
703
|
+
}
|
|
704
|
+
const metaInfo = [];
|
|
705
|
+
if (includeStatus) {
|
|
706
|
+
metaInfo.push(`**Status:** ${eventData.status}`);
|
|
707
|
+
metaInfo.push(`**Duration:** ${eventData.duration}ms`);
|
|
708
|
+
}
|
|
709
|
+
if (includeTimestamp) {
|
|
710
|
+
metaInfo.push(`**Timestamp:** ${eventData.timestamp}`);
|
|
711
|
+
}
|
|
712
|
+
if (metaInfo.length > 0) {
|
|
713
|
+
sections.push("\n" + metaInfo.join("\n"));
|
|
714
|
+
}
|
|
715
|
+
if (includeRequestHeaders) {
|
|
716
|
+
const headers = eventData.requestHeaders || {};
|
|
717
|
+
sections.push(`\n## Request Headers\n\`\`\`json\n${JSON.stringify(headers, null, 2)}\n\`\`\``);
|
|
718
|
+
}
|
|
719
|
+
if (includeRequestBody) {
|
|
720
|
+
const body = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
|
|
721
|
+
sections.push(`\n## Request Body\n\`\`\`json\n${JSON.stringify(body || {}, null, 2)}\n\`\`\``);
|
|
722
|
+
}
|
|
723
|
+
if (includeResponseBody) {
|
|
724
|
+
const body = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
|
|
725
|
+
sections.push(`\n## Response Body\n\`\`\`json\n${JSON.stringify(body || {}, null, 2)}\n\`\`\``);
|
|
726
|
+
}
|
|
727
|
+
return sections.join("\n");
|
|
728
|
+
});
|
|
729
|
+
return allRequests.join("\n\n---\n\n") || "No data included";
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// Plaintext
|
|
733
|
+
const allRequests = dataSource.map((eventData, index) => {
|
|
734
|
+
const lines = [];
|
|
735
|
+
lines.push(`Request ${index + 1}:`);
|
|
736
|
+
if (includeMethod) {
|
|
737
|
+
lines.push(`${eventData.method} ${eventData.url}`);
|
|
738
|
+
}
|
|
739
|
+
if (includeStatus) {
|
|
740
|
+
lines.push(`Status: ${eventData.status}`);
|
|
741
|
+
lines.push(`Duration: ${eventData.duration}ms`);
|
|
742
|
+
}
|
|
743
|
+
if (includeTimestamp) {
|
|
744
|
+
lines.push(`Timestamp: ${eventData.timestamp}`);
|
|
745
|
+
}
|
|
746
|
+
if (includeRequestBody) {
|
|
747
|
+
const body = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
|
|
748
|
+
lines.push("\nRequest:");
|
|
749
|
+
lines.push(JSON.stringify(body || {}, null, 2));
|
|
750
|
+
}
|
|
751
|
+
if (includeResponseBody) {
|
|
752
|
+
const body = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
|
|
753
|
+
lines.push("\nResponse:");
|
|
754
|
+
lines.push(JSON.stringify(body || {}, null, 2));
|
|
755
|
+
}
|
|
756
|
+
return lines.join("\n");
|
|
757
|
+
});
|
|
758
|
+
return allRequests.join("\n\n---\n\n") || "No data included";
|
|
759
|
+
}, [hasLiveData, events, mockRequestData, settings]);
|
|
760
|
+
|
|
761
|
+
// Generate the expanded preview content (only called when expanded)
|
|
762
|
+
const generateExpandedPreviewContent = (0, _react.useCallback)(() => {
|
|
763
|
+
if (settings.format === "json") {
|
|
764
|
+
const dataSource = hasLiveData ? events : [mockRequestData];
|
|
765
|
+
const buildFilteredData = eventData => {
|
|
766
|
+
const data = {};
|
|
767
|
+
if (settings.includeMethod) {
|
|
768
|
+
data.method = eventData.method;
|
|
769
|
+
data.url = eventData.url;
|
|
770
|
+
}
|
|
771
|
+
if (settings.includeStatus) {
|
|
772
|
+
data.status = eventData.status;
|
|
773
|
+
data.duration = eventData.duration;
|
|
774
|
+
}
|
|
775
|
+
if (settings.includeTimestamp) {
|
|
776
|
+
data.timestamp = eventData.timestamp;
|
|
777
|
+
}
|
|
778
|
+
if (settings.includeRequestHeaders) {
|
|
779
|
+
data.requestHeaders = eventData.requestHeaders;
|
|
780
|
+
}
|
|
781
|
+
if (settings.includeRequestBody) {
|
|
782
|
+
data.requestBody = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
|
|
783
|
+
}
|
|
784
|
+
if (settings.includeResponseBody) {
|
|
785
|
+
data.responseBody = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
|
|
786
|
+
}
|
|
787
|
+
return data;
|
|
788
|
+
};
|
|
789
|
+
const allFilteredData = dataSource.map(buildFilteredData);
|
|
790
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
|
|
791
|
+
data: allFilteredData,
|
|
792
|
+
title: "",
|
|
793
|
+
showTypeFilter: false
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// Markdown / plaintext share the same monospace scroll box; the STRING is
|
|
798
|
+
// exactly what `generateCopyText` produces for these formats (native
|
|
799
|
+
// duplicates the builders — the outputs are identical, so the twin feeds
|
|
800
|
+
// the preview from the one builder rather than carrying a second copy).
|
|
801
|
+
const text = generateCopyText();
|
|
802
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
803
|
+
style: styles.previewScroll,
|
|
804
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
805
|
+
style: {
|
|
806
|
+
...(settings.format === "markdown" ? styles.markdownText : styles.plaintextText),
|
|
807
|
+
// Native `selectable={isPro}` — constant-true on web (deviations).
|
|
808
|
+
userSelect: isPro ? "text" : "none"
|
|
809
|
+
},
|
|
810
|
+
children: text || "No data included"
|
|
811
|
+
})
|
|
812
|
+
});
|
|
813
|
+
}, [settings, hasLiveData, events, mockRequestData, generateCopyText, isPro]);
|
|
814
|
+
|
|
815
|
+
// Generate formatted output for copying/preview - with collapsible support
|
|
816
|
+
const renderPreviewContent = () => {
|
|
817
|
+
const dataSource = hasLiveData ? events : [mockRequestData];
|
|
818
|
+
const requestCount = dataSource.length;
|
|
819
|
+
|
|
820
|
+
// Collapsed state - show summary with expand button
|
|
821
|
+
if (!isPreviewExpanded) {
|
|
822
|
+
const warningColor = sizeWarningLevel === "danger" ? macOSColors.semantic.error : sizeWarningLevel === "warning" ? macOSColors.semantic.warning : macOSColors.text.secondary;
|
|
823
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
824
|
+
style: styles.collapsedPreview,
|
|
825
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
826
|
+
type: "button",
|
|
827
|
+
style: styles.expandButton,
|
|
828
|
+
onClick: () => setIsPreviewExpanded(true),
|
|
829
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
830
|
+
style: styles.expandButtonContent,
|
|
831
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Eye, {
|
|
832
|
+
size: 16,
|
|
833
|
+
color: macOSColors.semantic.info
|
|
834
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
835
|
+
style: styles.expandButtonTextContainer,
|
|
836
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
837
|
+
style: styles.expandButtonTitle,
|
|
838
|
+
children: "Show Preview"
|
|
839
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
840
|
+
style: styles.expandButtonSubtitle,
|
|
841
|
+
children: [requestCount, " request", requestCount !== 1 ? "s" : "", " \u2022 ~", formatBytes(estimatedSize)]
|
|
842
|
+
})]
|
|
843
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDown, {
|
|
844
|
+
size: 16,
|
|
845
|
+
color: macOSColors.text.muted
|
|
846
|
+
})]
|
|
847
|
+
})
|
|
848
|
+
}), sizeWarningLevel !== "none" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
849
|
+
style: {
|
|
850
|
+
...styles.sizeWarning,
|
|
851
|
+
...(sizeWarningLevel === "danger" ? styles.sizeWarningDanger : null)
|
|
852
|
+
},
|
|
853
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AlertTriangle, {
|
|
854
|
+
size: 12,
|
|
855
|
+
color: warningColor
|
|
856
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
857
|
+
style: {
|
|
858
|
+
...styles.sizeWarningText,
|
|
859
|
+
color: warningColor
|
|
860
|
+
},
|
|
861
|
+
children: sizeWarningLevel === "danger" ? "Very large payload - may cause performance issues" : "Large payload - preview may be slow"
|
|
862
|
+
})]
|
|
863
|
+
})]
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// Expanded state - show collapse button + actual content
|
|
868
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
869
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
870
|
+
type: "button",
|
|
871
|
+
style: styles.collapseButton,
|
|
872
|
+
onClick: () => setIsPreviewExpanded(false),
|
|
873
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
874
|
+
style: styles.collapseButtonText,
|
|
875
|
+
children: "Hide Preview"
|
|
876
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronUp, {
|
|
877
|
+
size: 14,
|
|
878
|
+
color: macOSColors.text.secondary
|
|
879
|
+
})]
|
|
880
|
+
}), generateExpandedPreviewContent()]
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
// Preview header actions (status label and Copy button)
|
|
885
|
+
const statusLabel = hasLiveData && lastEventTimestamp ? `Live data • Updated ${formatRelativeTime(lastEventTimestamp, tick)}` : "Mock data (no events captured)";
|
|
886
|
+
|
|
887
|
+
// Section configs — ids/labels/icons/colors verbatim from the native
|
|
888
|
+
// `dynamicFilterConfig` memo.
|
|
889
|
+
const presetOptions = [{
|
|
890
|
+
id: "preset::urls",
|
|
891
|
+
label: "URLs",
|
|
892
|
+
icon: Link,
|
|
893
|
+
color: macOSColors.semantic.info,
|
|
894
|
+
value: "urls",
|
|
895
|
+
isActive: activePreset === "urls"
|
|
896
|
+
}, {
|
|
897
|
+
id: "preset::llm",
|
|
898
|
+
label: "LLM",
|
|
899
|
+
icon: Zap,
|
|
900
|
+
color: macOSColors.semantic.success,
|
|
901
|
+
value: "llm",
|
|
902
|
+
isActive: activePreset === "llm"
|
|
903
|
+
}, {
|
|
904
|
+
id: "preset::json",
|
|
905
|
+
label: "JSON",
|
|
906
|
+
icon: FileCode,
|
|
907
|
+
color: macOSColors.semantic.warning,
|
|
908
|
+
value: "json",
|
|
909
|
+
isActive: activePreset === "json"
|
|
910
|
+
}, {
|
|
911
|
+
id: "preset::full",
|
|
912
|
+
label: "Full",
|
|
913
|
+
icon: FileText,
|
|
914
|
+
color: macOSColors.semantic.info,
|
|
915
|
+
value: "full",
|
|
916
|
+
isActive: activePreset === "full"
|
|
917
|
+
}, {
|
|
918
|
+
id: "preset::custom",
|
|
919
|
+
label: "Custom",
|
|
920
|
+
icon: Settings,
|
|
921
|
+
color: macOSColors.text.secondary,
|
|
922
|
+
value: "custom",
|
|
923
|
+
isActive: activePreset === null
|
|
924
|
+
}];
|
|
925
|
+
const includeOptions = [{
|
|
926
|
+
id: "requestInfo::includeMethod",
|
|
927
|
+
label: "URL",
|
|
928
|
+
value: "includeMethod",
|
|
929
|
+
isActive: settings.includeMethod
|
|
930
|
+
}, {
|
|
931
|
+
id: "requestInfo::includeStatus",
|
|
932
|
+
label: "Status",
|
|
933
|
+
value: "includeStatus",
|
|
934
|
+
isActive: settings.includeStatus
|
|
935
|
+
}, {
|
|
936
|
+
id: "requestInfo::includeTimestamp",
|
|
937
|
+
label: "Time",
|
|
938
|
+
value: "includeTimestamp",
|
|
939
|
+
isActive: settings.includeTimestamp
|
|
940
|
+
}, {
|
|
941
|
+
id: "headers::includeRequestHeaders",
|
|
942
|
+
label: "Headers",
|
|
943
|
+
value: "includeRequestHeaders",
|
|
944
|
+
isActive: settings.includeRequestHeaders
|
|
945
|
+
}, {
|
|
946
|
+
id: "body::includeRequestBody",
|
|
947
|
+
label: "Req Body",
|
|
948
|
+
value: "includeRequestBody",
|
|
949
|
+
isActive: settings.includeRequestBody
|
|
950
|
+
}, {
|
|
951
|
+
id: "body::includeResponseBody",
|
|
952
|
+
label: "Res Body",
|
|
953
|
+
value: "includeResponseBody",
|
|
954
|
+
isActive: settings.includeResponseBody
|
|
955
|
+
}, {
|
|
956
|
+
id: "requestInfo::includeErrors",
|
|
957
|
+
label: "Errors",
|
|
958
|
+
value: "includeErrors",
|
|
959
|
+
isActive: settings.includeErrors
|
|
960
|
+
}];
|
|
961
|
+
const formatOptions = [{
|
|
962
|
+
id: "format::markdown",
|
|
963
|
+
label: "Markdown",
|
|
964
|
+
icon: FileText,
|
|
965
|
+
color: macOSColors.semantic.info,
|
|
966
|
+
value: "markdown",
|
|
967
|
+
isActive: settings.format === "markdown"
|
|
968
|
+
}, {
|
|
969
|
+
id: "format::json",
|
|
970
|
+
label: "JSON",
|
|
971
|
+
icon: FileCode,
|
|
972
|
+
color: macOSColors.semantic.warning,
|
|
973
|
+
value: "json",
|
|
974
|
+
isActive: settings.format === "json"
|
|
975
|
+
}, {
|
|
976
|
+
id: "format::plaintext",
|
|
977
|
+
label: "Text",
|
|
978
|
+
icon: Hash,
|
|
979
|
+
color: macOSColors.text.secondary,
|
|
980
|
+
value: "plaintext",
|
|
981
|
+
isActive: settings.format === "plaintext"
|
|
982
|
+
}];
|
|
983
|
+
|
|
984
|
+
// The DynamicFilterView subtree for this config: sections, then PREVIEW.
|
|
985
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
986
|
+
style: styles.container,
|
|
987
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
988
|
+
style: styles.scrollContent,
|
|
989
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FilterCardSection, {
|
|
990
|
+
title: "Presets",
|
|
991
|
+
options: presetOptions,
|
|
992
|
+
onOptionPress: handleOptionChange
|
|
993
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterCardSection, {
|
|
994
|
+
title: "Include",
|
|
995
|
+
options: includeOptions,
|
|
996
|
+
onOptionPress: handleOptionChange
|
|
997
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterCardSection, {
|
|
998
|
+
title: "Format",
|
|
999
|
+
options: formatOptions,
|
|
1000
|
+
onOptionPress: handleOptionChange
|
|
1001
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1002
|
+
style: styles.previewSection,
|
|
1003
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeaderRow, {
|
|
1004
|
+
icon: Eye,
|
|
1005
|
+
title: "PREVIEW",
|
|
1006
|
+
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1007
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1008
|
+
style: styles.statusLabel,
|
|
1009
|
+
children: statusLabel
|
|
1010
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.CopyButton, {
|
|
1011
|
+
value: generateCopyText(),
|
|
1012
|
+
size: 14,
|
|
1013
|
+
"aria-label": "Copy preview"
|
|
1014
|
+
})]
|
|
1015
|
+
})
|
|
1016
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1017
|
+
style: styles.previewContent,
|
|
1018
|
+
children: renderPreviewContent()
|
|
1019
|
+
})]
|
|
1020
|
+
})]
|
|
1021
|
+
})
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
// Values mirror the native StyleSheet blocks (NetworkCopySettingsView.tsx +
|
|
1026
|
+
// DynamicFilterView.tsx + SectionHeader.tsx) 1:1.
|
|
1027
|
+
const styles = {
|
|
1028
|
+
// DynamicFilterView `container` + `scrollContent`.
|
|
1029
|
+
container: {
|
|
1030
|
+
display: "flex",
|
|
1031
|
+
flexDirection: "column",
|
|
1032
|
+
flex: 1,
|
|
1033
|
+
minHeight: 0,
|
|
1034
|
+
backgroundColor: buoyColors.base,
|
|
1035
|
+
overflowY: "auto"
|
|
1036
|
+
},
|
|
1037
|
+
scrollContent: {
|
|
1038
|
+
padding: "16px 16px 24px"
|
|
1039
|
+
},
|
|
1040
|
+
// DynamicFilterView `section` + `filterGrid` + cards.
|
|
1041
|
+
section: {
|
|
1042
|
+
marginBottom: 8
|
|
1043
|
+
},
|
|
1044
|
+
filterGrid: {
|
|
1045
|
+
display: "flex",
|
|
1046
|
+
flexDirection: "row",
|
|
1047
|
+
flexWrap: "wrap",
|
|
1048
|
+
gap: 8,
|
|
1049
|
+
marginTop: 8
|
|
1050
|
+
},
|
|
1051
|
+
filterCard: {
|
|
1052
|
+
display: "flex",
|
|
1053
|
+
backgroundColor: buoyColors.card,
|
|
1054
|
+
borderRadius: 12,
|
|
1055
|
+
padding: "10px 8px",
|
|
1056
|
+
flexDirection: "column",
|
|
1057
|
+
alignItems: "center",
|
|
1058
|
+
justifyContent: "center",
|
|
1059
|
+
border: `1px solid ${buoyColors.border}`,
|
|
1060
|
+
width: 72,
|
|
1061
|
+
minHeight: 68,
|
|
1062
|
+
boxSizing: "border-box",
|
|
1063
|
+
cursor: "pointer",
|
|
1064
|
+
margin: 0,
|
|
1065
|
+
fontFamily: "inherit",
|
|
1066
|
+
gap: 0
|
|
1067
|
+
},
|
|
1068
|
+
activeFilterCard: {
|
|
1069
|
+
backgroundColor: `${buoyColors.primary}33`,
|
|
1070
|
+
border: `2px solid ${buoyColors.primary}`,
|
|
1071
|
+
// Native: shadowColor primary, opacity 0.3, radius 8.
|
|
1072
|
+
boxShadow: `0 0 8px ${buoyColors.primary}4D`
|
|
1073
|
+
},
|
|
1074
|
+
filterLabelCompact: {
|
|
1075
|
+
fontSize: 10,
|
|
1076
|
+
color: buoyColors.text,
|
|
1077
|
+
fontWeight: 600,
|
|
1078
|
+
textAlign: "center",
|
|
1079
|
+
textTransform: "capitalize",
|
|
1080
|
+
// Native textShadow 0/0.5/1 @ 0.3 black.
|
|
1081
|
+
textShadow: "0 0.5px 1px rgba(0, 0, 0, 0.3)",
|
|
1082
|
+
marginTop: 3
|
|
1083
|
+
},
|
|
1084
|
+
// SectionHeader.tsx values.
|
|
1085
|
+
sectionHeader: {
|
|
1086
|
+
display: "flex",
|
|
1087
|
+
flexDirection: "row",
|
|
1088
|
+
alignItems: "center",
|
|
1089
|
+
padding: "8px 16px",
|
|
1090
|
+
backgroundColor: buoyColors.base,
|
|
1091
|
+
minHeight: 40,
|
|
1092
|
+
boxSizing: "border-box"
|
|
1093
|
+
},
|
|
1094
|
+
sectionHeaderIcon: {
|
|
1095
|
+
display: "inline-flex",
|
|
1096
|
+
marginRight: 8
|
|
1097
|
+
},
|
|
1098
|
+
sectionHeaderTitle: {
|
|
1099
|
+
flex: 1,
|
|
1100
|
+
minWidth: 0,
|
|
1101
|
+
fontSize: 14,
|
|
1102
|
+
fontWeight: 600,
|
|
1103
|
+
color: buoyColors.text,
|
|
1104
|
+
whiteSpace: "nowrap",
|
|
1105
|
+
overflow: "hidden",
|
|
1106
|
+
textOverflow: "ellipsis",
|
|
1107
|
+
textAlign: "left"
|
|
1108
|
+
},
|
|
1109
|
+
sectionHeaderActions: {
|
|
1110
|
+
display: "inline-flex",
|
|
1111
|
+
flexDirection: "row",
|
|
1112
|
+
alignItems: "center",
|
|
1113
|
+
gap: 8,
|
|
1114
|
+
marginLeft: "auto"
|
|
1115
|
+
},
|
|
1116
|
+
// DynamicFilterView `previewSection`/`previewContent`.
|
|
1117
|
+
previewSection: {
|
|
1118
|
+
backgroundColor: buoyColors.hover,
|
|
1119
|
+
borderRadius: 16,
|
|
1120
|
+
border: `1px solid ${buoyColors.borderStrong}`,
|
|
1121
|
+
marginTop: 16,
|
|
1122
|
+
overflow: "hidden"
|
|
1123
|
+
},
|
|
1124
|
+
previewContent: {
|
|
1125
|
+
padding: "12px 16px 16px",
|
|
1126
|
+
backgroundColor: buoyColors.base,
|
|
1127
|
+
margin: "0 12px 12px",
|
|
1128
|
+
borderRadius: 8,
|
|
1129
|
+
border: `1px solid ${buoyColors.border}`
|
|
1130
|
+
},
|
|
1131
|
+
// NetworkCopySettingsView.tsx values.
|
|
1132
|
+
previewScroll: {
|
|
1133
|
+
maxHeight: 300,
|
|
1134
|
+
overflowY: "auto"
|
|
1135
|
+
},
|
|
1136
|
+
markdownText: {
|
|
1137
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1138
|
+
fontSize: 11,
|
|
1139
|
+
color: macOSColors.text.primary,
|
|
1140
|
+
lineHeight: "18px",
|
|
1141
|
+
whiteSpace: "pre-wrap",
|
|
1142
|
+
wordBreak: "break-word",
|
|
1143
|
+
userSelect: "text"
|
|
1144
|
+
},
|
|
1145
|
+
plaintextText: {
|
|
1146
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1147
|
+
fontSize: 11,
|
|
1148
|
+
color: macOSColors.text.primary,
|
|
1149
|
+
lineHeight: "18px",
|
|
1150
|
+
whiteSpace: "pre-wrap",
|
|
1151
|
+
wordBreak: "break-word",
|
|
1152
|
+
userSelect: "text"
|
|
1153
|
+
},
|
|
1154
|
+
statusLabel: {
|
|
1155
|
+
fontSize: 11,
|
|
1156
|
+
fontWeight: 600,
|
|
1157
|
+
color: macOSColors.text.muted,
|
|
1158
|
+
marginRight: 8
|
|
1159
|
+
},
|
|
1160
|
+
// Collapsible preview styles
|
|
1161
|
+
collapsedPreview: {
|
|
1162
|
+
display: "flex",
|
|
1163
|
+
flexDirection: "column",
|
|
1164
|
+
gap: 8
|
|
1165
|
+
},
|
|
1166
|
+
expandButton: {
|
|
1167
|
+
display: "block",
|
|
1168
|
+
width: "100%",
|
|
1169
|
+
boxSizing: "border-box",
|
|
1170
|
+
backgroundColor: macOSColors.background.input,
|
|
1171
|
+
borderRadius: 8,
|
|
1172
|
+
border: `1px solid ${macOSColors.border.default}`,
|
|
1173
|
+
padding: 12,
|
|
1174
|
+
cursor: "pointer",
|
|
1175
|
+
margin: 0,
|
|
1176
|
+
fontFamily: "inherit",
|
|
1177
|
+
textAlign: "left"
|
|
1178
|
+
},
|
|
1179
|
+
expandButtonContent: {
|
|
1180
|
+
display: "flex",
|
|
1181
|
+
flexDirection: "row",
|
|
1182
|
+
alignItems: "center",
|
|
1183
|
+
gap: 10
|
|
1184
|
+
},
|
|
1185
|
+
expandButtonTextContainer: {
|
|
1186
|
+
display: "flex",
|
|
1187
|
+
flexDirection: "column",
|
|
1188
|
+
flex: 1,
|
|
1189
|
+
minWidth: 0
|
|
1190
|
+
},
|
|
1191
|
+
expandButtonTitle: {
|
|
1192
|
+
fontSize: 13,
|
|
1193
|
+
fontWeight: 600,
|
|
1194
|
+
color: macOSColors.text.primary
|
|
1195
|
+
},
|
|
1196
|
+
expandButtonSubtitle: {
|
|
1197
|
+
fontSize: 11,
|
|
1198
|
+
color: macOSColors.text.secondary,
|
|
1199
|
+
marginTop: 2
|
|
1200
|
+
},
|
|
1201
|
+
collapseButton: {
|
|
1202
|
+
display: "flex",
|
|
1203
|
+
width: "100%",
|
|
1204
|
+
boxSizing: "border-box",
|
|
1205
|
+
flexDirection: "row",
|
|
1206
|
+
alignItems: "center",
|
|
1207
|
+
justifyContent: "center",
|
|
1208
|
+
gap: 6,
|
|
1209
|
+
padding: "8px 0",
|
|
1210
|
+
margin: "0 0 8px",
|
|
1211
|
+
backgroundColor: macOSColors.background.hover,
|
|
1212
|
+
borderRadius: 6,
|
|
1213
|
+
border: `1px solid ${macOSColors.border.default}`,
|
|
1214
|
+
cursor: "pointer",
|
|
1215
|
+
fontFamily: "inherit"
|
|
1216
|
+
},
|
|
1217
|
+
collapseButtonText: {
|
|
1218
|
+
fontSize: 12,
|
|
1219
|
+
fontWeight: 500,
|
|
1220
|
+
color: macOSColors.text.secondary
|
|
1221
|
+
},
|
|
1222
|
+
sizeWarning: {
|
|
1223
|
+
display: "flex",
|
|
1224
|
+
flexDirection: "row",
|
|
1225
|
+
alignItems: "center",
|
|
1226
|
+
gap: 6,
|
|
1227
|
+
padding: "6px 10px",
|
|
1228
|
+
backgroundColor: macOSColors.semantic.warningBackground,
|
|
1229
|
+
borderRadius: 6,
|
|
1230
|
+
border: `1px solid ${macOSColors.semantic.warning}30`
|
|
1231
|
+
},
|
|
1232
|
+
sizeWarningDanger: {
|
|
1233
|
+
backgroundColor: macOSColors.semantic.errorBackground,
|
|
1234
|
+
border: `1px solid ${macOSColors.semantic.error}30`
|
|
1235
|
+
},
|
|
1236
|
+
sizeWarningText: {
|
|
1237
|
+
fontSize: 11,
|
|
1238
|
+
fontWeight: 500,
|
|
1239
|
+
flex: 1,
|
|
1240
|
+
textAlign: "left"
|
|
1241
|
+
}
|
|
1242
|
+
};
|