@buoy-gg/network 7.0.15 → 7.0.17
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,1306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* NetworkFilterViewV3.web — DOM twin of NetworkFilterViewV3.tsx.
|
|
5
|
+
*
|
|
6
|
+
* Same props, same filter semantics, same screen inventory. Natively the
|
|
7
|
+
* screen is a thin config over shared-ui's `DynamicFilterView`; the web shim
|
|
8
|
+
* doesn't ship that component, so this twin renders the exact subtree
|
|
9
|
+
* DynamicFilterView produces FOR THIS CONFIG (no tabs, no filter-summary, no
|
|
10
|
+
* include-only, no preview — those config branches are disabled natively and
|
|
11
|
+
* are not ported):
|
|
12
|
+
*
|
|
13
|
+
* 1. Facet card sections — Status (All/Success/Error/Pending, icon + count),
|
|
14
|
+
* Method (colored method badge + count, no label — native's
|
|
15
|
+
* `showLabel = type !== "method"`), Content Type (icon + count + label).
|
|
16
|
+
* Same single-select method/content-type replace behavior
|
|
17
|
+
* (`handleDynamicFilterChange` is native's handler, verbatim).
|
|
18
|
+
* 2. ACTIVE FILTERS — add-pattern button → input (with the Match:
|
|
19
|
+
* Contains/Exact mode toggle rendered above it, native `renderExtra`),
|
|
20
|
+
* and the pattern list where each row removes on click and carries the
|
|
21
|
+
* CONTAINS/EXACT mode badge (native `renderPatternMeta`) that toggles the
|
|
22
|
+
* pattern's match mode.
|
|
23
|
+
* 3. AVAILABLE DOMAINS & URLS — host + origin+pathname suggestions from the
|
|
24
|
+
* visible events (30 per group), click-to-add with the currently selected
|
|
25
|
+
* mode; suggestions already covered by an active pattern are hidden
|
|
26
|
+
* (native's `item.includes(pattern)` filter).
|
|
27
|
+
* 4. HOW NETWORK FILTERS WORK — description + examples.
|
|
28
|
+
*
|
|
29
|
+
* shared-ui RN chrome replicated as DOM with provenance:
|
|
30
|
+
* - `buoyColors` — inlined verbatim subset from
|
|
31
|
+
* shared/src/ui/gameUI/constants/gameUIColors.ts (DynamicFilterView /
|
|
32
|
+
* SectionHeader / FilterComponents palette).
|
|
33
|
+
* - `macOSColors` — inlined verbatim subset from
|
|
34
|
+
* shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts (the mode
|
|
35
|
+
* toggle/badge palette the native screen uses directly).
|
|
36
|
+
* - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
|
|
37
|
+
* - Native card glow (`shadowColor` primary, opacity 0.3, radius 8) → an
|
|
38
|
+
* equivalent CSS box-shadow; native text shadows → CSS text-shadow.
|
|
39
|
+
*
|
|
40
|
+
* Intentional deviations (all logged):
|
|
41
|
+
* - Pattern rows nest a pressable mode badge inside a pressable row; RN's
|
|
42
|
+
* inner Touchable swallows the press, DOM needs `stopPropagation()` on the
|
|
43
|
+
* badge so toggling a mode doesn't also remove the pattern.
|
|
44
|
+
* - Native's `adjustsFontSizeToFit` on the method badge has no DOM
|
|
45
|
+
* equivalent — long method names ellipsize at the same max width instead.
|
|
46
|
+
* - The add-pattern input autofocuses via the `autoFocus` attribute rather
|
|
47
|
+
* than RN's imperative focus.
|
|
48
|
+
*
|
|
49
|
+
* @platform React DOM Web
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
import { useCallback, useMemo, useState } from "react";
|
|
53
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
54
|
+
// =============================
|
|
55
|
+
// Native palettes (provenance)
|
|
56
|
+
// =============================
|
|
57
|
+
|
|
58
|
+
/** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts, verbatim. */
|
|
59
|
+
const buoyColors = {
|
|
60
|
+
base: "#121212",
|
|
61
|
+
card: "#1A1A1A",
|
|
62
|
+
hover: "#242424",
|
|
63
|
+
input: "#2A2A2A",
|
|
64
|
+
border: "#333333",
|
|
65
|
+
text: "#E0E0E0",
|
|
66
|
+
textSecondary: "#A0A0A0",
|
|
67
|
+
textMuted: "#888888",
|
|
68
|
+
primary: "#20C997"
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
|
|
72
|
+
const macOSColors = {
|
|
73
|
+
background: {
|
|
74
|
+
hover: "#1D1D1F"
|
|
75
|
+
},
|
|
76
|
+
border: {
|
|
77
|
+
default: "#2D2D2F"
|
|
78
|
+
},
|
|
79
|
+
text: {
|
|
80
|
+
secondary: "#A1A1A6",
|
|
81
|
+
muted: "#8E8E93"
|
|
82
|
+
},
|
|
83
|
+
semantic: {
|
|
84
|
+
success: "#34C759",
|
|
85
|
+
error: "#FF453A",
|
|
86
|
+
warning: "#FFEB3B",
|
|
87
|
+
info: "#00B8E6",
|
|
88
|
+
debug: "#BF5AF2"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// =============================
|
|
93
|
+
// Inline lucide icons (shared-ui icons are lucide re-exports)
|
|
94
|
+
// =============================
|
|
95
|
+
|
|
96
|
+
function Svg({
|
|
97
|
+
size = 14,
|
|
98
|
+
color = "currentColor",
|
|
99
|
+
children
|
|
100
|
+
}) {
|
|
101
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
102
|
+
width: size,
|
|
103
|
+
height: size,
|
|
104
|
+
viewBox: "0 0 24 24",
|
|
105
|
+
fill: "none",
|
|
106
|
+
stroke: color,
|
|
107
|
+
strokeWidth: 2,
|
|
108
|
+
strokeLinecap: "round",
|
|
109
|
+
strokeLinejoin: "round",
|
|
110
|
+
style: {
|
|
111
|
+
flexShrink: 0,
|
|
112
|
+
display: "block"
|
|
113
|
+
},
|
|
114
|
+
children: children
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
const CheckCircle = p => /*#__PURE__*/_jsxs(Svg, {
|
|
118
|
+
...p,
|
|
119
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
120
|
+
d: "M21.801 10A10 10 0 1 1 17 3.335"
|
|
121
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
122
|
+
d: "m9 11 3 3L22 4"
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
|
+
const XCircle = p => /*#__PURE__*/_jsxs(Svg, {
|
|
126
|
+
...p,
|
|
127
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
128
|
+
cx: "12",
|
|
129
|
+
cy: "12",
|
|
130
|
+
r: "10"
|
|
131
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
132
|
+
d: "m15 9-6 6"
|
|
133
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
134
|
+
d: "m9 9 6 6"
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
const Clock = p => /*#__PURE__*/_jsxs(Svg, {
|
|
138
|
+
...p,
|
|
139
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
140
|
+
cx: "12",
|
|
141
|
+
cy: "12",
|
|
142
|
+
r: "10"
|
|
143
|
+
}), /*#__PURE__*/_jsx("polyline", {
|
|
144
|
+
points: "12 6 12 12 16 14"
|
|
145
|
+
})]
|
|
146
|
+
});
|
|
147
|
+
const Globe = p => /*#__PURE__*/_jsxs(Svg, {
|
|
148
|
+
...p,
|
|
149
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
150
|
+
cx: "12",
|
|
151
|
+
cy: "12",
|
|
152
|
+
r: "10"
|
|
153
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
154
|
+
d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"
|
|
155
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
156
|
+
d: "M2 12h20"
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
const FileJson = p => /*#__PURE__*/_jsxs(Svg, {
|
|
160
|
+
...p,
|
|
161
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
162
|
+
d: "M14 2v4a2 2 0 0 0 2 2h4"
|
|
163
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
164
|
+
d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"
|
|
165
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
166
|
+
d: "M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"
|
|
167
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
168
|
+
d: "M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"
|
|
169
|
+
})]
|
|
170
|
+
});
|
|
171
|
+
const FileText = p => /*#__PURE__*/_jsxs(Svg, {
|
|
172
|
+
...p,
|
|
173
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
174
|
+
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"
|
|
175
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
176
|
+
d: "M14 2v4a2 2 0 0 0 2 2h4"
|
|
177
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
178
|
+
d: "M10 9H8"
|
|
179
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
180
|
+
d: "M16 13H8"
|
|
181
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
182
|
+
d: "M16 17H8"
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
185
|
+
const ImageIcon = p => /*#__PURE__*/_jsxs(Svg, {
|
|
186
|
+
...p,
|
|
187
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
188
|
+
width: "18",
|
|
189
|
+
height: "18",
|
|
190
|
+
x: "3",
|
|
191
|
+
y: "3",
|
|
192
|
+
rx: "2",
|
|
193
|
+
ry: "2"
|
|
194
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
195
|
+
cx: "9",
|
|
196
|
+
cy: "9",
|
|
197
|
+
r: "2"
|
|
198
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
199
|
+
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"
|
|
200
|
+
})]
|
|
201
|
+
});
|
|
202
|
+
const Film = p => /*#__PURE__*/_jsxs(Svg, {
|
|
203
|
+
...p,
|
|
204
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
205
|
+
width: "18",
|
|
206
|
+
height: "18",
|
|
207
|
+
x: "3",
|
|
208
|
+
y: "3",
|
|
209
|
+
rx: "2"
|
|
210
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
211
|
+
d: "M7 3v18"
|
|
212
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
213
|
+
d: "M3 7.5h4"
|
|
214
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
215
|
+
d: "M3 12h18"
|
|
216
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
217
|
+
d: "M3 16.5h4"
|
|
218
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
219
|
+
d: "M17 3v18"
|
|
220
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
221
|
+
d: "M17 7.5h4"
|
|
222
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
223
|
+
d: "M17 16.5h4"
|
|
224
|
+
})]
|
|
225
|
+
});
|
|
226
|
+
const Music = p => /*#__PURE__*/_jsxs(Svg, {
|
|
227
|
+
...p,
|
|
228
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
229
|
+
d: "M9 18V5l12-2v13"
|
|
230
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
231
|
+
cx: "6",
|
|
232
|
+
cy: "18",
|
|
233
|
+
r: "3"
|
|
234
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
235
|
+
cx: "18",
|
|
236
|
+
cy: "16",
|
|
237
|
+
r: "3"
|
|
238
|
+
})]
|
|
239
|
+
});
|
|
240
|
+
const Filter = p => /*#__PURE__*/_jsx(Svg, {
|
|
241
|
+
...p,
|
|
242
|
+
children: /*#__PURE__*/_jsx("polygon", {
|
|
243
|
+
points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
const Plus = p => /*#__PURE__*/_jsxs(Svg, {
|
|
247
|
+
...p,
|
|
248
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
249
|
+
d: "M5 12h14"
|
|
250
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
251
|
+
d: "M12 5v14"
|
|
252
|
+
})]
|
|
253
|
+
});
|
|
254
|
+
const X = p => /*#__PURE__*/_jsxs(Svg, {
|
|
255
|
+
...p,
|
|
256
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
257
|
+
d: "M18 6 6 18"
|
|
258
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
259
|
+
d: "m6 6 12 12"
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// =============================
|
|
264
|
+
// Native helpers (verbatim from NetworkFilterViewV3.tsx)
|
|
265
|
+
// =============================
|
|
266
|
+
|
|
267
|
+
function getContentType(event) {
|
|
268
|
+
const headers = event.responseHeaders || event.requestHeaders;
|
|
269
|
+
const contentType = headers?.["content-type"] || headers?.["Content-Type"] || "";
|
|
270
|
+
if (contentType.includes("json")) return {
|
|
271
|
+
type: "JSON",
|
|
272
|
+
color: macOSColors.semantic.info
|
|
273
|
+
};
|
|
274
|
+
if (contentType.includes("xml")) return {
|
|
275
|
+
type: "XML",
|
|
276
|
+
color: macOSColors.semantic.success
|
|
277
|
+
};
|
|
278
|
+
if (contentType.includes("html")) return {
|
|
279
|
+
type: "HTML",
|
|
280
|
+
color: macOSColors.semantic.warning
|
|
281
|
+
};
|
|
282
|
+
if (contentType.includes("text")) return {
|
|
283
|
+
type: "TEXT",
|
|
284
|
+
color: macOSColors.semantic.success
|
|
285
|
+
};
|
|
286
|
+
if (contentType.includes("image")) return {
|
|
287
|
+
type: "IMAGE",
|
|
288
|
+
color: macOSColors.semantic.error
|
|
289
|
+
};
|
|
290
|
+
if (contentType.includes("video")) return {
|
|
291
|
+
type: "VIDEO",
|
|
292
|
+
color: macOSColors.semantic.error
|
|
293
|
+
};
|
|
294
|
+
if (contentType.includes("audio")) return {
|
|
295
|
+
type: "AUDIO",
|
|
296
|
+
color: macOSColors.semantic.debug
|
|
297
|
+
};
|
|
298
|
+
if (contentType.includes("form")) return {
|
|
299
|
+
type: "FORM",
|
|
300
|
+
color: macOSColors.semantic.info
|
|
301
|
+
};
|
|
302
|
+
return {
|
|
303
|
+
type: "OTHER",
|
|
304
|
+
color: macOSColors.text.muted
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function getContentTypeIcon(type) {
|
|
308
|
+
switch (type) {
|
|
309
|
+
case "JSON":
|
|
310
|
+
return FileJson;
|
|
311
|
+
case "HTML":
|
|
312
|
+
case "XML":
|
|
313
|
+
case "TEXT":
|
|
314
|
+
return FileText;
|
|
315
|
+
case "IMAGE":
|
|
316
|
+
return ImageIcon;
|
|
317
|
+
case "VIDEO":
|
|
318
|
+
return Film;
|
|
319
|
+
case "AUDIO":
|
|
320
|
+
return Music;
|
|
321
|
+
default:
|
|
322
|
+
return Globe;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function getMethodColor(method) {
|
|
326
|
+
switch (method) {
|
|
327
|
+
case "GET":
|
|
328
|
+
return macOSColors.semantic.success;
|
|
329
|
+
case "POST":
|
|
330
|
+
return macOSColors.semantic.info;
|
|
331
|
+
case "PUT":
|
|
332
|
+
return macOSColors.semantic.warning;
|
|
333
|
+
case "DELETE":
|
|
334
|
+
return macOSColors.semantic.error;
|
|
335
|
+
case "PATCH":
|
|
336
|
+
return macOSColors.semantic.success;
|
|
337
|
+
default:
|
|
338
|
+
return macOSColors.text.muted;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// =============================
|
|
343
|
+
// DOM twins of the shared-ui pieces DynamicFilterView composes
|
|
344
|
+
// =============================
|
|
345
|
+
|
|
346
|
+
/** SectionHeader twin — shared/src/ui/components/SectionHeader.tsx. */
|
|
347
|
+
function SectionHeader({
|
|
348
|
+
icon: Icon,
|
|
349
|
+
iconColor,
|
|
350
|
+
title,
|
|
351
|
+
badgeCount,
|
|
352
|
+
badgeColor
|
|
353
|
+
}) {
|
|
354
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
355
|
+
style: styles.sectionHeader,
|
|
356
|
+
children: [Icon ? /*#__PURE__*/_jsx("span", {
|
|
357
|
+
style: styles.sectionHeaderIcon,
|
|
358
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
359
|
+
size: 12,
|
|
360
|
+
color: iconColor ?? buoyColors.primary
|
|
361
|
+
})
|
|
362
|
+
}) : null, /*#__PURE__*/_jsx("span", {
|
|
363
|
+
style: styles.sectionHeaderTitle,
|
|
364
|
+
children: title
|
|
365
|
+
}), badgeCount !== undefined ? /*#__PURE__*/_jsx("span", {
|
|
366
|
+
style: {
|
|
367
|
+
...styles.sectionHeaderBadge,
|
|
368
|
+
backgroundColor: `${badgeColor ?? buoyColors.primary}15`,
|
|
369
|
+
border: `1px solid ${badgeColor ?? buoyColors.primary}33`
|
|
370
|
+
},
|
|
371
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
372
|
+
style: {
|
|
373
|
+
...styles.sectionHeaderBadgeText,
|
|
374
|
+
color: badgeColor ?? buoyColors.primary
|
|
375
|
+
},
|
|
376
|
+
children: badgeCount
|
|
377
|
+
})
|
|
378
|
+
}) : null]
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/** AddFilterButton twin — shared/src/ui/components/FilterComponents.tsx. */
|
|
383
|
+
function AddFilterButton({
|
|
384
|
+
onPress,
|
|
385
|
+
color,
|
|
386
|
+
label
|
|
387
|
+
}) {
|
|
388
|
+
return /*#__PURE__*/_jsxs("button", {
|
|
389
|
+
type: "button",
|
|
390
|
+
onClick: onPress,
|
|
391
|
+
style: {
|
|
392
|
+
...styles.addButton,
|
|
393
|
+
borderColor: `${color}40`
|
|
394
|
+
},
|
|
395
|
+
children: [/*#__PURE__*/_jsx(Plus, {
|
|
396
|
+
size: 14,
|
|
397
|
+
color: color
|
|
398
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
399
|
+
style: {
|
|
400
|
+
...styles.addButtonText,
|
|
401
|
+
color
|
|
402
|
+
},
|
|
403
|
+
children: label
|
|
404
|
+
})]
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/** AddFilterInput twin — shared/src/ui/components/FilterComponents.tsx. */
|
|
409
|
+
function AddFilterInput({
|
|
410
|
+
value,
|
|
411
|
+
onChange,
|
|
412
|
+
onSubmit,
|
|
413
|
+
onCancel,
|
|
414
|
+
placeholder,
|
|
415
|
+
color
|
|
416
|
+
}) {
|
|
417
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
418
|
+
style: {
|
|
419
|
+
...styles.inputContainer,
|
|
420
|
+
borderColor: `${color}40`
|
|
421
|
+
},
|
|
422
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
423
|
+
value: value,
|
|
424
|
+
onChange: e => onChange(e.target.value),
|
|
425
|
+
onKeyDown: e => {
|
|
426
|
+
if (e.key === "Enter") onSubmit();
|
|
427
|
+
},
|
|
428
|
+
placeholder: placeholder,
|
|
429
|
+
style: {
|
|
430
|
+
...styles.input,
|
|
431
|
+
color
|
|
432
|
+
},
|
|
433
|
+
autoFocus: true,
|
|
434
|
+
autoCorrect: "off",
|
|
435
|
+
autoCapitalize: "none",
|
|
436
|
+
autoComplete: "off",
|
|
437
|
+
spellCheck: false
|
|
438
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
439
|
+
style: styles.inputButtons,
|
|
440
|
+
children: [value.trim() ? /*#__PURE__*/_jsx("button", {
|
|
441
|
+
type: "button",
|
|
442
|
+
onClick: onSubmit,
|
|
443
|
+
style: {
|
|
444
|
+
...styles.inlineAddButton,
|
|
445
|
+
backgroundColor: `${color}15`,
|
|
446
|
+
borderColor: `${color}40`
|
|
447
|
+
},
|
|
448
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
449
|
+
style: {
|
|
450
|
+
...styles.inlineAddButtonText,
|
|
451
|
+
color
|
|
452
|
+
},
|
|
453
|
+
children: "Add"
|
|
454
|
+
})
|
|
455
|
+
}) : null, /*#__PURE__*/_jsx("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
onClick: onCancel,
|
|
458
|
+
style: styles.cancelButton,
|
|
459
|
+
children: /*#__PURE__*/_jsx(X, {
|
|
460
|
+
size: 16,
|
|
461
|
+
color: `${color}60`
|
|
462
|
+
})
|
|
463
|
+
})]
|
|
464
|
+
})]
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Control panel for filtering captured network events by status, method, and
|
|
470
|
+
* content type, plus ignored-pattern management — same surface as native.
|
|
471
|
+
*/
|
|
472
|
+
export function NetworkFilterViewV3({
|
|
473
|
+
events,
|
|
474
|
+
filter,
|
|
475
|
+
onFilterChange,
|
|
476
|
+
ignoredPatterns = [],
|
|
477
|
+
onRemovePattern = () => {},
|
|
478
|
+
onAddPattern = () => {},
|
|
479
|
+
onTogglePatternMode = () => {}
|
|
480
|
+
}) {
|
|
481
|
+
// Mode applied when the user submits the "Add pattern" input. Defaults to
|
|
482
|
+
// `contains` so behavior matches the previous implementation until the user
|
|
483
|
+
// opts into `exact`. (Native state, verbatim.)
|
|
484
|
+
const [nextPatternMode, setNextPatternMode] = useState("contains");
|
|
485
|
+
|
|
486
|
+
// DynamicFilterView's `useFilterManager` input UI state — the subset this
|
|
487
|
+
// config exercises (show/hide the add input + the draft value).
|
|
488
|
+
const [showAddInput, setShowAddInput] = useState(false);
|
|
489
|
+
const [newFilter, setNewFilter] = useState("");
|
|
490
|
+
const patternModes = useMemo(() => {
|
|
491
|
+
const map = new Map();
|
|
492
|
+
for (const p of ignoredPatterns) map.set(p.value, p.mode);
|
|
493
|
+
return map;
|
|
494
|
+
}, [ignoredPatterns]);
|
|
495
|
+
const activePatterns = useMemo(() => ignoredPatterns.map(p => p.value), [ignoredPatterns]);
|
|
496
|
+
const handlePatternAdd = useCallback(pattern => {
|
|
497
|
+
onAddPattern({
|
|
498
|
+
value: pattern,
|
|
499
|
+
mode: nextPatternMode
|
|
500
|
+
});
|
|
501
|
+
}, [onAddPattern, nextPatternMode]);
|
|
502
|
+
|
|
503
|
+
// DynamicFilterView.handleAddPattern: forward the trimmed draft, then reset
|
|
504
|
+
// the input UI (its filterManager.addFilter side effect).
|
|
505
|
+
const submitDraftPattern = useCallback(() => {
|
|
506
|
+
const trimmed = newFilter.trim();
|
|
507
|
+
if (!trimmed) return;
|
|
508
|
+
handlePatternAdd(trimmed);
|
|
509
|
+
setNewFilter("");
|
|
510
|
+
setShowAddInput(false);
|
|
511
|
+
}, [newFilter, handlePatternAdd]);
|
|
512
|
+
const statusCounts = useMemo(() => {
|
|
513
|
+
const counts = {
|
|
514
|
+
all: events.length,
|
|
515
|
+
success: 0,
|
|
516
|
+
error: 0,
|
|
517
|
+
pending: 0
|
|
518
|
+
};
|
|
519
|
+
events.forEach(event => {
|
|
520
|
+
if (event.error || event.status && event.status >= 400) {
|
|
521
|
+
counts.error += 1;
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
if (event.status && event.status >= 200 && event.status < 300) {
|
|
525
|
+
counts.success += 1;
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (!event.status && !event.error) {
|
|
529
|
+
counts.pending += 1;
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
return counts;
|
|
533
|
+
}, [events]);
|
|
534
|
+
const methodCounts = useMemo(() => {
|
|
535
|
+
return events.reduce((acc, event) => {
|
|
536
|
+
if (!event.method) return acc;
|
|
537
|
+
acc[event.method] = (acc[event.method] || 0) + 1;
|
|
538
|
+
return acc;
|
|
539
|
+
}, {});
|
|
540
|
+
}, [events]);
|
|
541
|
+
const contentTypeCounts = useMemo(() => {
|
|
542
|
+
return events.reduce((acc, event) => {
|
|
543
|
+
const {
|
|
544
|
+
type
|
|
545
|
+
} = getContentType(event);
|
|
546
|
+
acc[type] = (acc[type] || 0) + 1;
|
|
547
|
+
return acc;
|
|
548
|
+
}, {});
|
|
549
|
+
}, [events]);
|
|
550
|
+
const availableDomains = useMemo(() => {
|
|
551
|
+
const domains = new Set();
|
|
552
|
+
events.forEach(event => {
|
|
553
|
+
if (event.host) {
|
|
554
|
+
domains.add(event.host);
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
try {
|
|
558
|
+
if (event.url) {
|
|
559
|
+
const parsed = new URL(event.url);
|
|
560
|
+
const host = String(parsed.host || "");
|
|
561
|
+
if (host) domains.add(host);
|
|
562
|
+
}
|
|
563
|
+
} catch {
|
|
564
|
+
// Ignore relative URLs
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
return Array.from(domains).filter(domain => domain && domain !== "").sort((a, b) => a.localeCompare(b));
|
|
568
|
+
}, [events]);
|
|
569
|
+
const availableUrls = useMemo(() => {
|
|
570
|
+
const urls = new Set();
|
|
571
|
+
events.forEach(event => {
|
|
572
|
+
if (!event.url) return;
|
|
573
|
+
try {
|
|
574
|
+
const parsed = new URL(event.url);
|
|
575
|
+
const origin = String(parsed.origin || "");
|
|
576
|
+
const pathname = String(parsed.pathname || "");
|
|
577
|
+
const normalized = `${origin}${pathname}`;
|
|
578
|
+
urls.add(normalized);
|
|
579
|
+
} catch {
|
|
580
|
+
// URL constructor fails for relative paths - fall back to raw value
|
|
581
|
+
urls.add(event.url);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
return Array.from(urls).filter(url => url && url !== "").sort((a, b) => a.localeCompare(b));
|
|
585
|
+
}, [events]);
|
|
586
|
+
const suggestionItems = useMemo(() => {
|
|
587
|
+
const maxItemsPerGroup = 30;
|
|
588
|
+
const domainSuggestions = availableDomains.slice(0, maxItemsPerGroup);
|
|
589
|
+
const urlSuggestions = availableUrls.slice(0, maxItemsPerGroup);
|
|
590
|
+
return [...domainSuggestions, ...urlSuggestions];
|
|
591
|
+
}, [availableDomains, availableUrls]);
|
|
592
|
+
|
|
593
|
+
// DynamicFilterView.suggestedItems: hide suggestions any active pattern
|
|
594
|
+
// already covers (substring test, native verbatim).
|
|
595
|
+
const suggestedItems = useMemo(() => suggestionItems.filter(item => !activePatterns.some(pattern => item.includes(pattern))), [suggestionItems, activePatterns]);
|
|
596
|
+
const handleDynamicFilterChange = useCallback((optionId, value) => {
|
|
597
|
+
const [group] = optionId.split("::");
|
|
598
|
+
if (group === "status") {
|
|
599
|
+
const nextStatus = value === "all" ? undefined : value;
|
|
600
|
+
onFilterChange({
|
|
601
|
+
...filter,
|
|
602
|
+
status: nextStatus
|
|
603
|
+
});
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (group === "method") {
|
|
607
|
+
const methodValue = String(value);
|
|
608
|
+
const currentMethods = filter.method || [];
|
|
609
|
+
const hasMethod = currentMethods.includes(methodValue);
|
|
610
|
+
const updatedMethods = hasMethod ? currentMethods.filter(method => method !== methodValue) : [methodValue];
|
|
611
|
+
onFilterChange({
|
|
612
|
+
...filter,
|
|
613
|
+
method: updatedMethods.length > 0 ? updatedMethods : undefined
|
|
614
|
+
});
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (group === "contentType") {
|
|
618
|
+
const typeValue = String(value);
|
|
619
|
+
const currentTypes = filter.contentType || [];
|
|
620
|
+
const hasType = currentTypes.includes(typeValue);
|
|
621
|
+
const updatedTypes = hasType ? currentTypes.filter(type => type !== typeValue) : [typeValue];
|
|
622
|
+
onFilterChange({
|
|
623
|
+
...filter,
|
|
624
|
+
contentType: updatedTypes.length > 0 ? updatedTypes : undefined
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
}, [filter, onFilterChange]);
|
|
628
|
+
|
|
629
|
+
// =============================
|
|
630
|
+
// Renderers (DynamicFilterView subtree for this config)
|
|
631
|
+
// =============================
|
|
632
|
+
|
|
633
|
+
const renderFilterCard = option => {
|
|
634
|
+
const countIsZero = option.count === 0;
|
|
635
|
+
// Native: showLabel = section.type !== "method" || option.icon
|
|
636
|
+
const showLabel = !option.isMethod || option.icon;
|
|
637
|
+
return /*#__PURE__*/_jsxs("button", {
|
|
638
|
+
type: "button",
|
|
639
|
+
onClick: () => handleDynamicFilterChange(option.id, option.value),
|
|
640
|
+
style: {
|
|
641
|
+
...styles.filterCard,
|
|
642
|
+
...(option.isActive ? styles.activeFilterCard : null)
|
|
643
|
+
},
|
|
644
|
+
children: [option.icon ? /*#__PURE__*/_jsx(option.icon, {
|
|
645
|
+
size: 24,
|
|
646
|
+
color: option.color
|
|
647
|
+
}) : option.isMethod ? /*#__PURE__*/_jsx("span", {
|
|
648
|
+
style: {
|
|
649
|
+
...styles.methodBadgeCompact,
|
|
650
|
+
backgroundColor: `${option.color}20`
|
|
651
|
+
},
|
|
652
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
653
|
+
style: {
|
|
654
|
+
...styles.methodTextCompact,
|
|
655
|
+
color: option.color
|
|
656
|
+
},
|
|
657
|
+
children: option.label
|
|
658
|
+
})
|
|
659
|
+
}) : null, /*#__PURE__*/_jsx("span", {
|
|
660
|
+
style: countIsZero ? styles.filterCountZero : styles.filterCountActive,
|
|
661
|
+
children: option.count
|
|
662
|
+
}), showLabel ? /*#__PURE__*/_jsx("span", {
|
|
663
|
+
style: styles.filterLabelCompact,
|
|
664
|
+
children: option.label
|
|
665
|
+
}) : null]
|
|
666
|
+
}, option.id);
|
|
667
|
+
};
|
|
668
|
+
const statusOptions = ["all", "success", "error", "pending"].map(status => ({
|
|
669
|
+
id: `status::${status}`,
|
|
670
|
+
label: status.charAt(0).toUpperCase() + status.slice(1),
|
|
671
|
+
count: statusCounts[status],
|
|
672
|
+
icon: status === "success" ? CheckCircle : status === "error" ? XCircle : status === "pending" ? Clock : Globe,
|
|
673
|
+
color: status === "success" ? macOSColors.semantic.success : status === "error" ? macOSColors.semantic.error : status === "pending" ? macOSColors.semantic.warning : macOSColors.semantic.info,
|
|
674
|
+
isActive: filter.status === status || !filter.status && status === "all",
|
|
675
|
+
value: status
|
|
676
|
+
}));
|
|
677
|
+
const methodEntries = Object.entries(methodCounts);
|
|
678
|
+
const contentTypeEntries = Object.entries(contentTypeCounts);
|
|
679
|
+
|
|
680
|
+
// Native renderAddFilterExtra — the Match: Contains/Exact toggle shown
|
|
681
|
+
// above the pattern input.
|
|
682
|
+
const renderAddFilterExtra = () => {
|
|
683
|
+
const options = [{
|
|
684
|
+
label: "Contains",
|
|
685
|
+
value: "contains",
|
|
686
|
+
hint: "substring"
|
|
687
|
+
}, {
|
|
688
|
+
label: "Exact",
|
|
689
|
+
value: "exact",
|
|
690
|
+
hint: "whole path/host/url"
|
|
691
|
+
}];
|
|
692
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
693
|
+
style: styles.modeToggleRow,
|
|
694
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
695
|
+
style: styles.modeToggleLabel,
|
|
696
|
+
children: "Match:"
|
|
697
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
698
|
+
style: styles.modeToggleGroup,
|
|
699
|
+
children: options.map(opt => {
|
|
700
|
+
const isActive = nextPatternMode === opt.value;
|
|
701
|
+
return /*#__PURE__*/_jsxs("button", {
|
|
702
|
+
type: "button",
|
|
703
|
+
onClick: () => setNextPatternMode(opt.value),
|
|
704
|
+
"aria-pressed": isActive,
|
|
705
|
+
style: {
|
|
706
|
+
...styles.modeToggleButton,
|
|
707
|
+
...(isActive ? styles.modeToggleButtonActive : null)
|
|
708
|
+
},
|
|
709
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
710
|
+
style: {
|
|
711
|
+
...styles.modeToggleButtonText,
|
|
712
|
+
...(isActive ? styles.modeToggleButtonTextActive : null)
|
|
713
|
+
},
|
|
714
|
+
children: opt.label
|
|
715
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
716
|
+
style: styles.modeToggleButtonHint,
|
|
717
|
+
children: opt.hint
|
|
718
|
+
})]
|
|
719
|
+
}, opt.value);
|
|
720
|
+
})
|
|
721
|
+
})]
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
// Native renderPatternMeta — the CONTAINS/EXACT badge on each pattern row.
|
|
726
|
+
const renderPatternMeta = pattern => {
|
|
727
|
+
const mode = patternModes.get(pattern) ?? "contains";
|
|
728
|
+
const isExact = mode === "exact";
|
|
729
|
+
const color = isExact ? macOSColors.semantic.warning : macOSColors.semantic.info;
|
|
730
|
+
return /*#__PURE__*/_jsx("button", {
|
|
731
|
+
type: "button",
|
|
732
|
+
"aria-label": `Match mode: ${mode}. Tap to toggle.`,
|
|
733
|
+
onClick: e => {
|
|
734
|
+
// DEVIATION (logged): RN's nested Touchable swallows the press; DOM
|
|
735
|
+
// must stop it reaching the row's remove handler.
|
|
736
|
+
e.stopPropagation();
|
|
737
|
+
onTogglePatternMode(pattern);
|
|
738
|
+
},
|
|
739
|
+
style: {
|
|
740
|
+
...styles.modeBadge,
|
|
741
|
+
borderColor: `${color}60`,
|
|
742
|
+
backgroundColor: `${color}15`
|
|
743
|
+
},
|
|
744
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
745
|
+
style: {
|
|
746
|
+
...styles.modeBadgeText,
|
|
747
|
+
color
|
|
748
|
+
},
|
|
749
|
+
children: isExact ? "EXACT" : "CONTAINS"
|
|
750
|
+
})
|
|
751
|
+
});
|
|
752
|
+
};
|
|
753
|
+
return /*#__PURE__*/_jsx("div", {
|
|
754
|
+
style: styles.container,
|
|
755
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
756
|
+
style: styles.content,
|
|
757
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
758
|
+
style: styles.section,
|
|
759
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
760
|
+
title: "Status"
|
|
761
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
762
|
+
style: styles.filterGrid,
|
|
763
|
+
children: statusOptions.map(renderFilterCard)
|
|
764
|
+
})]
|
|
765
|
+
}), methodEntries.length > 0 ? /*#__PURE__*/_jsxs("div", {
|
|
766
|
+
style: styles.section,
|
|
767
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
768
|
+
title: "Method"
|
|
769
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
770
|
+
style: styles.filterGrid,
|
|
771
|
+
children: methodEntries.map(([method, count]) => renderFilterCard({
|
|
772
|
+
id: `method::${method}`,
|
|
773
|
+
label: method,
|
|
774
|
+
count,
|
|
775
|
+
color: getMethodColor(method),
|
|
776
|
+
isActive: filter.method?.includes(method) ?? false,
|
|
777
|
+
value: method,
|
|
778
|
+
isMethod: true
|
|
779
|
+
}))
|
|
780
|
+
})]
|
|
781
|
+
}) : null, contentTypeEntries.length > 0 ? /*#__PURE__*/_jsxs("div", {
|
|
782
|
+
style: styles.section,
|
|
783
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
784
|
+
title: "Content Type"
|
|
785
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
786
|
+
style: styles.filterGrid,
|
|
787
|
+
children: contentTypeEntries.map(([type, count]) => {
|
|
788
|
+
const representativeEvent = events.find(event => getContentType(event).type === type);
|
|
789
|
+
const {
|
|
790
|
+
color
|
|
791
|
+
} = representativeEvent ? getContentType(representativeEvent) : {
|
|
792
|
+
color: macOSColors.text.muted
|
|
793
|
+
};
|
|
794
|
+
return renderFilterCard({
|
|
795
|
+
id: `contentType::${type}`,
|
|
796
|
+
label: type,
|
|
797
|
+
count,
|
|
798
|
+
icon: getContentTypeIcon(type),
|
|
799
|
+
color,
|
|
800
|
+
isActive: filter.contentType?.includes(type) ?? false,
|
|
801
|
+
value: type
|
|
802
|
+
});
|
|
803
|
+
})
|
|
804
|
+
})]
|
|
805
|
+
}) : null, /*#__PURE__*/_jsxs("div", {
|
|
806
|
+
style: styles.excludeFiltersSection,
|
|
807
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
808
|
+
icon: Filter,
|
|
809
|
+
iconColor: buoyColors.primary,
|
|
810
|
+
title: "ACTIVE FILTERS",
|
|
811
|
+
badgeCount: activePatterns.length > 0 ? activePatterns.length : undefined,
|
|
812
|
+
badgeColor: buoyColors.primary
|
|
813
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
814
|
+
style: styles.excludeFiltersDescription,
|
|
815
|
+
children: "Hide queries matching these patterns from the list."
|
|
816
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
817
|
+
style: styles.excludeFiltersInputWrapper,
|
|
818
|
+
children: !showAddInput ? /*#__PURE__*/_jsx(AddFilterButton, {
|
|
819
|
+
onPress: () => setShowAddInput(true),
|
|
820
|
+
color: buoyColors.primary,
|
|
821
|
+
label: "Add exclude pattern"
|
|
822
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
823
|
+
children: [renderAddFilterExtra(), /*#__PURE__*/_jsx(AddFilterInput, {
|
|
824
|
+
value: newFilter,
|
|
825
|
+
onChange: setNewFilter,
|
|
826
|
+
onSubmit: submitDraftPattern,
|
|
827
|
+
onCancel: () => {
|
|
828
|
+
setShowAddInput(false);
|
|
829
|
+
setNewFilter("");
|
|
830
|
+
},
|
|
831
|
+
placeholder: "Enter domain or URL pattern...",
|
|
832
|
+
color: buoyColors.primary
|
|
833
|
+
})]
|
|
834
|
+
})
|
|
835
|
+
}), activePatterns.length > 0 ? /*#__PURE__*/_jsx("div", {
|
|
836
|
+
style: styles.excludeFiltersContent,
|
|
837
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
838
|
+
style: styles.filterListColumn,
|
|
839
|
+
children: activePatterns.map(pattern => /*#__PURE__*/_jsxs("button", {
|
|
840
|
+
type: "button",
|
|
841
|
+
onClick: () => onRemovePattern(pattern),
|
|
842
|
+
style: styles.filterItemRow,
|
|
843
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
844
|
+
style: {
|
|
845
|
+
...styles.filterItemText,
|
|
846
|
+
color: buoyColors.primary
|
|
847
|
+
},
|
|
848
|
+
children: pattern
|
|
849
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
850
|
+
style: styles.filterItemMeta,
|
|
851
|
+
children: renderPatternMeta(pattern)
|
|
852
|
+
}), /*#__PURE__*/_jsx(X, {
|
|
853
|
+
size: 12,
|
|
854
|
+
color: `${buoyColors.primary}80`
|
|
855
|
+
})]
|
|
856
|
+
}, pattern))
|
|
857
|
+
})
|
|
858
|
+
}) : null]
|
|
859
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
860
|
+
style: styles.availableKeysSection,
|
|
861
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
862
|
+
icon: Plus,
|
|
863
|
+
iconColor: buoyColors.primary,
|
|
864
|
+
title: "AVAILABLE DOMAINS & URLS",
|
|
865
|
+
badgeCount: suggestedItems.length,
|
|
866
|
+
badgeColor: buoyColors.primary
|
|
867
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
868
|
+
style: styles.availableKeysScroll,
|
|
869
|
+
children: suggestedItems.length > 0 ? suggestedItems.map(item => /*#__PURE__*/_jsxs("button", {
|
|
870
|
+
type: "button",
|
|
871
|
+
onClick: () => handlePatternAdd(item),
|
|
872
|
+
style: styles.availableKeyItem,
|
|
873
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
874
|
+
style: styles.availableKeyText,
|
|
875
|
+
children: item
|
|
876
|
+
}), /*#__PURE__*/_jsx(Plus, {
|
|
877
|
+
size: 12,
|
|
878
|
+
color: buoyColors.primary
|
|
879
|
+
})]
|
|
880
|
+
}, item)) : /*#__PURE__*/_jsx("div", {
|
|
881
|
+
style: styles.emptyStateText,
|
|
882
|
+
children: "No network events captured yet. Domains and URLs will appear here."
|
|
883
|
+
})
|
|
884
|
+
})]
|
|
885
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
886
|
+
style: styles.howItWorksSection,
|
|
887
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
888
|
+
icon: Filter,
|
|
889
|
+
iconColor: buoyColors.textSecondary,
|
|
890
|
+
title: "HOW NETWORK FILTERS WORK"
|
|
891
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
892
|
+
style: styles.howItWorksText,
|
|
893
|
+
children: "Patterns hide matching requests from the network event list. Each pattern has a match mode you can toggle on its badge: CONTAINS hides any URL containing the text; EXACT hides only an exact path/host/url match."
|
|
894
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
895
|
+
style: styles.examplesContainer,
|
|
896
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
897
|
+
style: styles.examplesTitle,
|
|
898
|
+
children: "EXAMPLES:"
|
|
899
|
+
}), ["• example.com (CONTAINS) → any request whose URL contains example.com", "• example.com (EXACT) → only requests served by that exact host", "• /v1 (CONTAINS) → any URL containing /v1 (e.g. /v1, /v1/users)", "• /v1 (EXACT) → only requests whose pathname is exactly /v1"].map(example => /*#__PURE__*/_jsx("div", {
|
|
900
|
+
style: styles.exampleItem,
|
|
901
|
+
children: example
|
|
902
|
+
}, example))]
|
|
903
|
+
})]
|
|
904
|
+
})]
|
|
905
|
+
})
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// Values mirror the native StyleSheet blocks 1:1 (DynamicFilterView.tsx,
|
|
910
|
+
// SectionHeader.tsx, FilterComponents.tsx, NetworkFilterViewV3.tsx).
|
|
911
|
+
const styles = {
|
|
912
|
+
container: {
|
|
913
|
+
display: "flex",
|
|
914
|
+
flexDirection: "column",
|
|
915
|
+
flex: 1,
|
|
916
|
+
minHeight: 0,
|
|
917
|
+
backgroundColor: buoyColors.base
|
|
918
|
+
},
|
|
919
|
+
content: {
|
|
920
|
+
flex: 1,
|
|
921
|
+
minHeight: 0,
|
|
922
|
+
overflowY: "auto",
|
|
923
|
+
padding: "16px 16px 24px 16px"
|
|
924
|
+
},
|
|
925
|
+
section: {
|
|
926
|
+
marginBottom: 8
|
|
927
|
+
},
|
|
928
|
+
// SectionHeader.tsx container/title/badge
|
|
929
|
+
sectionHeader: {
|
|
930
|
+
display: "flex",
|
|
931
|
+
flexDirection: "row",
|
|
932
|
+
alignItems: "center",
|
|
933
|
+
padding: "8px 16px",
|
|
934
|
+
backgroundColor: buoyColors.base,
|
|
935
|
+
minHeight: 40,
|
|
936
|
+
boxSizing: "border-box"
|
|
937
|
+
},
|
|
938
|
+
sectionHeaderIcon: {
|
|
939
|
+
display: "inline-flex",
|
|
940
|
+
marginRight: 8
|
|
941
|
+
},
|
|
942
|
+
sectionHeaderTitle: {
|
|
943
|
+
flex: 1,
|
|
944
|
+
fontSize: 14,
|
|
945
|
+
fontWeight: 600,
|
|
946
|
+
color: buoyColors.text,
|
|
947
|
+
whiteSpace: "nowrap",
|
|
948
|
+
overflow: "hidden",
|
|
949
|
+
textOverflow: "ellipsis"
|
|
950
|
+
},
|
|
951
|
+
sectionHeaderBadge: {
|
|
952
|
+
display: "inline-flex",
|
|
953
|
+
alignItems: "center",
|
|
954
|
+
padding: "3px 8px",
|
|
955
|
+
borderRadius: 12,
|
|
956
|
+
marginLeft: 8
|
|
957
|
+
},
|
|
958
|
+
sectionHeaderBadgeText: {
|
|
959
|
+
fontSize: 12,
|
|
960
|
+
fontWeight: 600
|
|
961
|
+
},
|
|
962
|
+
filterGrid: {
|
|
963
|
+
display: "flex",
|
|
964
|
+
flexDirection: "row",
|
|
965
|
+
flexWrap: "wrap",
|
|
966
|
+
gap: 8,
|
|
967
|
+
marginTop: 8
|
|
968
|
+
},
|
|
969
|
+
filterCard: {
|
|
970
|
+
display: "flex",
|
|
971
|
+
backgroundColor: buoyColors.card,
|
|
972
|
+
borderRadius: 12,
|
|
973
|
+
padding: "10px 8px",
|
|
974
|
+
flexDirection: "column",
|
|
975
|
+
alignItems: "center",
|
|
976
|
+
justifyContent: "center",
|
|
977
|
+
border: `1px solid ${buoyColors.border}`,
|
|
978
|
+
width: 72,
|
|
979
|
+
minHeight: 68,
|
|
980
|
+
boxSizing: "border-box",
|
|
981
|
+
cursor: "pointer",
|
|
982
|
+
margin: 0
|
|
983
|
+
},
|
|
984
|
+
activeFilterCard: {
|
|
985
|
+
backgroundColor: `${buoyColors.primary}33`,
|
|
986
|
+
border: `2px solid ${buoyColors.primary}`,
|
|
987
|
+
// Native: shadowColor primary, offset 0/0, opacity 0.3, radius 8.
|
|
988
|
+
boxShadow: `0 0 8px ${buoyColors.primary}4D`
|
|
989
|
+
},
|
|
990
|
+
filterCountActive: {
|
|
991
|
+
fontSize: 14,
|
|
992
|
+
fontWeight: 700,
|
|
993
|
+
color: buoyColors.text,
|
|
994
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
995
|
+
marginTop: 3,
|
|
996
|
+
marginBottom: 1,
|
|
997
|
+
textShadow: "0 0.5px 1px rgba(0, 0, 0, 0.2)"
|
|
998
|
+
},
|
|
999
|
+
filterCountZero: {
|
|
1000
|
+
fontSize: 11,
|
|
1001
|
+
fontWeight: 500,
|
|
1002
|
+
color: buoyColors.textMuted,
|
|
1003
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1004
|
+
marginTop: 3,
|
|
1005
|
+
marginBottom: 1
|
|
1006
|
+
},
|
|
1007
|
+
filterLabelCompact: {
|
|
1008
|
+
fontSize: 10,
|
|
1009
|
+
color: buoyColors.text,
|
|
1010
|
+
fontWeight: 600,
|
|
1011
|
+
textAlign: "center",
|
|
1012
|
+
textTransform: "capitalize",
|
|
1013
|
+
textShadow: "0 0.5px 1px rgba(0, 0, 0, 0.3)"
|
|
1014
|
+
},
|
|
1015
|
+
methodBadgeCompact: {
|
|
1016
|
+
display: "inline-flex",
|
|
1017
|
+
padding: "4px 8px",
|
|
1018
|
+
borderRadius: 5,
|
|
1019
|
+
minWidth: 48,
|
|
1020
|
+
maxWidth: 60,
|
|
1021
|
+
boxSizing: "border-box",
|
|
1022
|
+
alignItems: "center",
|
|
1023
|
+
justifyContent: "center"
|
|
1024
|
+
},
|
|
1025
|
+
methodTextCompact: {
|
|
1026
|
+
fontSize: 13,
|
|
1027
|
+
fontWeight: 700,
|
|
1028
|
+
letterSpacing: 0.3,
|
|
1029
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1030
|
+
whiteSpace: "nowrap",
|
|
1031
|
+
overflow: "hidden",
|
|
1032
|
+
textOverflow: "ellipsis"
|
|
1033
|
+
},
|
|
1034
|
+
excludeFiltersSection: {
|
|
1035
|
+
backgroundColor: buoyColors.card,
|
|
1036
|
+
borderRadius: 16,
|
|
1037
|
+
border: `1px solid ${buoyColors.border}`,
|
|
1038
|
+
marginTop: 16,
|
|
1039
|
+
overflow: "hidden"
|
|
1040
|
+
},
|
|
1041
|
+
excludeFiltersDescription: {
|
|
1042
|
+
fontSize: 10,
|
|
1043
|
+
color: buoyColors.textSecondary,
|
|
1044
|
+
padding: "8px 16px 0 16px",
|
|
1045
|
+
lineHeight: "14px"
|
|
1046
|
+
},
|
|
1047
|
+
excludeFiltersInputWrapper: {
|
|
1048
|
+
padding: "8px 16px"
|
|
1049
|
+
},
|
|
1050
|
+
excludeFiltersContent: {
|
|
1051
|
+
padding: "0 16px 16px 16px",
|
|
1052
|
+
maxHeight: 150,
|
|
1053
|
+
overflowY: "auto"
|
|
1054
|
+
},
|
|
1055
|
+
filterListColumn: {
|
|
1056
|
+
display: "flex",
|
|
1057
|
+
flexDirection: "column",
|
|
1058
|
+
gap: 8
|
|
1059
|
+
},
|
|
1060
|
+
filterItemRow: {
|
|
1061
|
+
display: "flex",
|
|
1062
|
+
flexDirection: "row",
|
|
1063
|
+
alignItems: "center",
|
|
1064
|
+
justifyContent: "space-between",
|
|
1065
|
+
padding: "10px 12px",
|
|
1066
|
+
backgroundColor: buoyColors.hover,
|
|
1067
|
+
borderRadius: 8,
|
|
1068
|
+
border: `1px solid ${buoyColors.border}`,
|
|
1069
|
+
cursor: "pointer",
|
|
1070
|
+
margin: 0,
|
|
1071
|
+
width: "100%",
|
|
1072
|
+
boxSizing: "border-box",
|
|
1073
|
+
textAlign: "left"
|
|
1074
|
+
},
|
|
1075
|
+
filterItemText: {
|
|
1076
|
+
flex: 1,
|
|
1077
|
+
fontSize: 12,
|
|
1078
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1079
|
+
marginRight: 8,
|
|
1080
|
+
whiteSpace: "nowrap",
|
|
1081
|
+
overflow: "hidden",
|
|
1082
|
+
textOverflow: "ellipsis",
|
|
1083
|
+
minWidth: 0
|
|
1084
|
+
},
|
|
1085
|
+
filterItemMeta: {
|
|
1086
|
+
display: "inline-flex",
|
|
1087
|
+
marginRight: 8
|
|
1088
|
+
},
|
|
1089
|
+
// NetworkFilterViewV3.tsx modeBadge / modeToggle styles
|
|
1090
|
+
modeBadge: {
|
|
1091
|
+
display: "inline-flex",
|
|
1092
|
+
padding: "3px 8px",
|
|
1093
|
+
borderRadius: 6,
|
|
1094
|
+
borderWidth: 1,
|
|
1095
|
+
borderStyle: "solid",
|
|
1096
|
+
background: "none",
|
|
1097
|
+
cursor: "pointer",
|
|
1098
|
+
margin: 0
|
|
1099
|
+
},
|
|
1100
|
+
modeBadgeText: {
|
|
1101
|
+
fontSize: 9,
|
|
1102
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1103
|
+
fontWeight: 700,
|
|
1104
|
+
letterSpacing: 0.5
|
|
1105
|
+
},
|
|
1106
|
+
modeToggleRow: {
|
|
1107
|
+
display: "flex",
|
|
1108
|
+
flexDirection: "row",
|
|
1109
|
+
alignItems: "center",
|
|
1110
|
+
gap: 8,
|
|
1111
|
+
marginBottom: 8
|
|
1112
|
+
},
|
|
1113
|
+
modeToggleLabel: {
|
|
1114
|
+
fontSize: 11,
|
|
1115
|
+
fontWeight: 600,
|
|
1116
|
+
color: macOSColors.text.secondary,
|
|
1117
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1118
|
+
letterSpacing: 0.3
|
|
1119
|
+
},
|
|
1120
|
+
modeToggleGroup: {
|
|
1121
|
+
display: "flex",
|
|
1122
|
+
flexDirection: "row",
|
|
1123
|
+
gap: 6,
|
|
1124
|
+
flex: 1
|
|
1125
|
+
},
|
|
1126
|
+
modeToggleButton: {
|
|
1127
|
+
flex: 1,
|
|
1128
|
+
display: "flex",
|
|
1129
|
+
flexDirection: "column",
|
|
1130
|
+
padding: "6px 10px",
|
|
1131
|
+
borderRadius: 8,
|
|
1132
|
+
border: `1px solid ${macOSColors.border.default}`,
|
|
1133
|
+
backgroundColor: macOSColors.background.hover,
|
|
1134
|
+
alignItems: "center",
|
|
1135
|
+
cursor: "pointer",
|
|
1136
|
+
margin: 0
|
|
1137
|
+
},
|
|
1138
|
+
modeToggleButtonActive: {
|
|
1139
|
+
border: `1px solid ${macOSColors.semantic.info}`,
|
|
1140
|
+
backgroundColor: `${macOSColors.semantic.info}22`
|
|
1141
|
+
},
|
|
1142
|
+
modeToggleButtonText: {
|
|
1143
|
+
fontSize: 11,
|
|
1144
|
+
fontWeight: 700,
|
|
1145
|
+
color: macOSColors.text.secondary,
|
|
1146
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1147
|
+
letterSpacing: 0.3
|
|
1148
|
+
},
|
|
1149
|
+
modeToggleButtonTextActive: {
|
|
1150
|
+
color: macOSColors.semantic.info
|
|
1151
|
+
},
|
|
1152
|
+
modeToggleButtonHint: {
|
|
1153
|
+
fontSize: 9,
|
|
1154
|
+
color: macOSColors.text.muted,
|
|
1155
|
+
marginTop: 1
|
|
1156
|
+
},
|
|
1157
|
+
// FilterComponents.tsx add button/input
|
|
1158
|
+
addButton: {
|
|
1159
|
+
display: "flex",
|
|
1160
|
+
flexDirection: "row",
|
|
1161
|
+
alignItems: "center",
|
|
1162
|
+
justifyContent: "center",
|
|
1163
|
+
padding: "10px 14px",
|
|
1164
|
+
borderRadius: 10,
|
|
1165
|
+
borderWidth: 1,
|
|
1166
|
+
borderStyle: "dashed",
|
|
1167
|
+
backgroundColor: buoyColors.input,
|
|
1168
|
+
cursor: "pointer",
|
|
1169
|
+
margin: 0,
|
|
1170
|
+
width: "100%",
|
|
1171
|
+
boxSizing: "border-box"
|
|
1172
|
+
},
|
|
1173
|
+
addButtonText: {
|
|
1174
|
+
fontSize: 13,
|
|
1175
|
+
fontWeight: 500,
|
|
1176
|
+
marginLeft: 6
|
|
1177
|
+
},
|
|
1178
|
+
inputContainer: {
|
|
1179
|
+
display: "flex",
|
|
1180
|
+
flexDirection: "row",
|
|
1181
|
+
alignItems: "center",
|
|
1182
|
+
backgroundColor: buoyColors.input,
|
|
1183
|
+
borderRadius: 10,
|
|
1184
|
+
borderWidth: 1,
|
|
1185
|
+
borderStyle: "solid",
|
|
1186
|
+
padding: "10px 14px",
|
|
1187
|
+
marginBottom: 8,
|
|
1188
|
+
boxSizing: "border-box"
|
|
1189
|
+
},
|
|
1190
|
+
input: {
|
|
1191
|
+
flex: 1,
|
|
1192
|
+
fontSize: 13,
|
|
1193
|
+
padding: 0,
|
|
1194
|
+
border: "none",
|
|
1195
|
+
outline: "none",
|
|
1196
|
+
background: "transparent",
|
|
1197
|
+
fontFamily: "inherit",
|
|
1198
|
+
minWidth: 0
|
|
1199
|
+
},
|
|
1200
|
+
inputButtons: {
|
|
1201
|
+
display: "flex",
|
|
1202
|
+
flexDirection: "row",
|
|
1203
|
+
alignItems: "center",
|
|
1204
|
+
gap: 8
|
|
1205
|
+
},
|
|
1206
|
+
cancelButton: {
|
|
1207
|
+
display: "inline-flex",
|
|
1208
|
+
padding: 4,
|
|
1209
|
+
borderRadius: 6,
|
|
1210
|
+
backgroundColor: buoyColors.hover,
|
|
1211
|
+
border: "none",
|
|
1212
|
+
cursor: "pointer",
|
|
1213
|
+
margin: 0
|
|
1214
|
+
},
|
|
1215
|
+
inlineAddButton: {
|
|
1216
|
+
display: "inline-flex",
|
|
1217
|
+
padding: "6px 12px",
|
|
1218
|
+
borderRadius: 6,
|
|
1219
|
+
borderWidth: 1,
|
|
1220
|
+
borderStyle: "solid",
|
|
1221
|
+
cursor: "pointer",
|
|
1222
|
+
margin: 0
|
|
1223
|
+
},
|
|
1224
|
+
inlineAddButtonText: {
|
|
1225
|
+
fontSize: 12,
|
|
1226
|
+
fontWeight: 600
|
|
1227
|
+
},
|
|
1228
|
+
availableKeysSection: {
|
|
1229
|
+
backgroundColor: buoyColors.card,
|
|
1230
|
+
borderRadius: 16,
|
|
1231
|
+
border: `1px solid ${buoyColors.border}`,
|
|
1232
|
+
marginTop: 16,
|
|
1233
|
+
overflow: "hidden"
|
|
1234
|
+
},
|
|
1235
|
+
availableKeysScroll: {
|
|
1236
|
+
maxHeight: 150,
|
|
1237
|
+
overflowY: "auto",
|
|
1238
|
+
padding: "8px 16px 16px 16px"
|
|
1239
|
+
},
|
|
1240
|
+
availableKeyItem: {
|
|
1241
|
+
display: "flex",
|
|
1242
|
+
flexDirection: "row",
|
|
1243
|
+
alignItems: "center",
|
|
1244
|
+
justifyContent: "space-between",
|
|
1245
|
+
padding: "10px 12px",
|
|
1246
|
+
backgroundColor: buoyColors.hover,
|
|
1247
|
+
borderRadius: 8,
|
|
1248
|
+
border: `1px solid ${buoyColors.border}`,
|
|
1249
|
+
marginBottom: 8,
|
|
1250
|
+
cursor: "pointer",
|
|
1251
|
+
width: "100%",
|
|
1252
|
+
boxSizing: "border-box",
|
|
1253
|
+
textAlign: "left"
|
|
1254
|
+
},
|
|
1255
|
+
availableKeyText: {
|
|
1256
|
+
flex: 1,
|
|
1257
|
+
fontSize: 11,
|
|
1258
|
+
color: buoyColors.text,
|
|
1259
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1260
|
+
marginRight: 8,
|
|
1261
|
+
whiteSpace: "nowrap",
|
|
1262
|
+
overflow: "hidden",
|
|
1263
|
+
textOverflow: "ellipsis",
|
|
1264
|
+
minWidth: 0
|
|
1265
|
+
},
|
|
1266
|
+
emptyStateText: {
|
|
1267
|
+
fontSize: 11,
|
|
1268
|
+
color: buoyColors.textMuted,
|
|
1269
|
+
fontStyle: "italic",
|
|
1270
|
+
textAlign: "center",
|
|
1271
|
+
padding: "12px 0"
|
|
1272
|
+
},
|
|
1273
|
+
howItWorksSection: {
|
|
1274
|
+
backgroundColor: buoyColors.card,
|
|
1275
|
+
borderRadius: 16,
|
|
1276
|
+
border: `1px solid ${buoyColors.border}`,
|
|
1277
|
+
marginTop: 16,
|
|
1278
|
+
overflow: "hidden"
|
|
1279
|
+
},
|
|
1280
|
+
howItWorksText: {
|
|
1281
|
+
fontSize: 11,
|
|
1282
|
+
color: buoyColors.textSecondary,
|
|
1283
|
+
lineHeight: "16px",
|
|
1284
|
+
margin: "8px 0 12px 0",
|
|
1285
|
+
padding: "0 16px",
|
|
1286
|
+
fontFamily: "ui-monospace, Menlo, monospace"
|
|
1287
|
+
},
|
|
1288
|
+
examplesContainer: {
|
|
1289
|
+
padding: "8px 16px 16px 16px",
|
|
1290
|
+
borderTop: `1px solid ${buoyColors.border}`
|
|
1291
|
+
},
|
|
1292
|
+
examplesTitle: {
|
|
1293
|
+
fontSize: 10,
|
|
1294
|
+
fontWeight: 600,
|
|
1295
|
+
color: buoyColors.textMuted,
|
|
1296
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1297
|
+
letterSpacing: 0.5,
|
|
1298
|
+
marginBottom: 6
|
|
1299
|
+
},
|
|
1300
|
+
exampleItem: {
|
|
1301
|
+
fontSize: 10,
|
|
1302
|
+
color: buoyColors.textMuted,
|
|
1303
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1304
|
+
lineHeight: "16px"
|
|
1305
|
+
}
|
|
1306
|
+
};
|