@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,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NetworkNumberPrompt = NetworkNumberPrompt;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
/**
|
|
10
|
+
* NetworkNumberPrompt.web — DOM twin of NetworkNumberPrompt.tsx.
|
|
11
|
+
*
|
|
12
|
+
* Entering one number, pinned to the TOP of the tool so the (mobile) keyboard
|
|
13
|
+
* can't cover it — the panel keeps the same placement so the two surfaces
|
|
14
|
+
* read identically. Same clamp-on-submit semantics: a field that takes 999
|
|
15
|
+
* and stores 599 is a field that lies, so min/max clamp BEFORE `onSubmit`.
|
|
16
|
+
*
|
|
17
|
+
* shared-ui RN chrome is replicated as DOM with provenance (web consumers
|
|
18
|
+
* resolve `@buoy-gg/shared-ui` to a minimal shim):
|
|
19
|
+
* - `macOSColors` — inlined verbatim subset from
|
|
20
|
+
* shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
|
|
21
|
+
* - `absoluteFill` — inset: 0.
|
|
22
|
+
*
|
|
23
|
+
* Intentional deviations (all logged):
|
|
24
|
+
* - `selectTextOnFocus` → an explicit `select()` in the autoFocus ref
|
|
25
|
+
* callback (DOM inputs don't select-all on focus by default).
|
|
26
|
+
* - `keyboardType="number-pad"` → `inputMode="numeric"`; Enter submits
|
|
27
|
+
* (native `onSubmitEditing`/`returnKeyType="done"`), Escape cancels (the
|
|
28
|
+
* keyboard affordance the backdrop tap covers on touch).
|
|
29
|
+
*
|
|
30
|
+
* @platform React DOM Web
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */const macOSColors = {
|
|
34
|
+
background: {
|
|
35
|
+
base: "#0A0A0C",
|
|
36
|
+
card: "#1A1A1C",
|
|
37
|
+
input: "#26262A"
|
|
38
|
+
},
|
|
39
|
+
border: {
|
|
40
|
+
default: "#2D2D2F",
|
|
41
|
+
input: "#3D3D42",
|
|
42
|
+
hover: "#4D4D4F"
|
|
43
|
+
},
|
|
44
|
+
text: {
|
|
45
|
+
primary: "#F5F5F7",
|
|
46
|
+
secondary: "#A1A1A6",
|
|
47
|
+
muted: "#8E8E93"
|
|
48
|
+
},
|
|
49
|
+
semantic: {
|
|
50
|
+
info: "#00B8E6"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function NetworkNumberPrompt({
|
|
54
|
+
title,
|
|
55
|
+
hint,
|
|
56
|
+
value,
|
|
57
|
+
placeholder = "Number",
|
|
58
|
+
min,
|
|
59
|
+
max,
|
|
60
|
+
onSubmit,
|
|
61
|
+
onCancel
|
|
62
|
+
}) {
|
|
63
|
+
const [text, setText] = (0, _react.useState)(value != null ? String(value) : "");
|
|
64
|
+
const submit = () => {
|
|
65
|
+
const trimmed = text.trim();
|
|
66
|
+
if (!trimmed) {
|
|
67
|
+
onSubmit(null);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const parsed = Number(trimmed);
|
|
71
|
+
if (!Number.isFinite(parsed)) {
|
|
72
|
+
onSubmit(null);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Clamped here rather than accepted-then-silently-changed: a field that
|
|
76
|
+
// takes 999 and stores 599 is a field that lies. (Native comment.)
|
|
77
|
+
let next = parsed;
|
|
78
|
+
if (min != null) next = Math.max(min, next);
|
|
79
|
+
if (max != null) next = Math.min(max, next);
|
|
80
|
+
onSubmit(next);
|
|
81
|
+
};
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
83
|
+
style: styles.overlay,
|
|
84
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
85
|
+
type: "button",
|
|
86
|
+
"aria-label": "Dismiss",
|
|
87
|
+
onClick: onCancel,
|
|
88
|
+
style: styles.backdrop
|
|
89
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
90
|
+
style: styles.panel,
|
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
92
|
+
style: styles.title,
|
|
93
|
+
children: title
|
|
94
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
95
|
+
style: styles.input,
|
|
96
|
+
value: text,
|
|
97
|
+
onChange: e => setText(e.target.value),
|
|
98
|
+
placeholder: placeholder,
|
|
99
|
+
inputMode: "numeric"
|
|
100
|
+
// DEVIATION (logged in the file header): autoFocus + select() stands
|
|
101
|
+
// in for native `selectTextOnFocus`.
|
|
102
|
+
,
|
|
103
|
+
ref: node => {
|
|
104
|
+
if (node) {
|
|
105
|
+
node.focus();
|
|
106
|
+
node.select();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
onKeyDown: e => {
|
|
110
|
+
if (e.key === "Enter") submit();
|
|
111
|
+
if (e.key === "Escape") onCancel();
|
|
112
|
+
},
|
|
113
|
+
"aria-label": title
|
|
114
|
+
}), hint ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
115
|
+
style: styles.hint,
|
|
116
|
+
children: hint
|
|
117
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
118
|
+
style: styles.actions,
|
|
119
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
120
|
+
type: "button",
|
|
121
|
+
onClick: onCancel,
|
|
122
|
+
style: {
|
|
123
|
+
...styles.button,
|
|
124
|
+
...styles.cancelButton
|
|
125
|
+
},
|
|
126
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
127
|
+
style: styles.cancelText,
|
|
128
|
+
children: "Cancel"
|
|
129
|
+
})
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
onClick: submit,
|
|
133
|
+
style: {
|
|
134
|
+
...styles.button,
|
|
135
|
+
...styles.saveButton
|
|
136
|
+
},
|
|
137
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
138
|
+
style: styles.saveText,
|
|
139
|
+
children: "Set"
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Values mirror the native StyleSheet block 1:1.
|
|
148
|
+
const styles = {
|
|
149
|
+
overlay: {
|
|
150
|
+
position: "absolute",
|
|
151
|
+
inset: 0,
|
|
152
|
+
zIndex: 40
|
|
153
|
+
},
|
|
154
|
+
backdrop: {
|
|
155
|
+
position: "absolute",
|
|
156
|
+
inset: 0,
|
|
157
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
158
|
+
border: "none",
|
|
159
|
+
padding: 0,
|
|
160
|
+
margin: 0,
|
|
161
|
+
cursor: "default",
|
|
162
|
+
width: "100%",
|
|
163
|
+
height: "100%"
|
|
164
|
+
},
|
|
165
|
+
panel: {
|
|
166
|
+
position: "relative",
|
|
167
|
+
margin: "12px 12px 0",
|
|
168
|
+
padding: 14,
|
|
169
|
+
borderRadius: 10,
|
|
170
|
+
border: `1px solid ${macOSColors.border.hover}`,
|
|
171
|
+
backgroundColor: macOSColors.background.card,
|
|
172
|
+
display: "flex",
|
|
173
|
+
flexDirection: "column",
|
|
174
|
+
gap: 10
|
|
175
|
+
},
|
|
176
|
+
title: {
|
|
177
|
+
fontSize: 13,
|
|
178
|
+
fontWeight: 700,
|
|
179
|
+
color: macOSColors.text.primary
|
|
180
|
+
},
|
|
181
|
+
input: {
|
|
182
|
+
backgroundColor: macOSColors.background.input,
|
|
183
|
+
border: `1px solid ${macOSColors.border.input}`,
|
|
184
|
+
borderRadius: 6,
|
|
185
|
+
padding: "10px 12px",
|
|
186
|
+
fontSize: 16,
|
|
187
|
+
fontWeight: 700,
|
|
188
|
+
color: macOSColors.text.primary,
|
|
189
|
+
outline: "none",
|
|
190
|
+
fontFamily: "inherit",
|
|
191
|
+
boxSizing: "border-box",
|
|
192
|
+
width: "100%"
|
|
193
|
+
},
|
|
194
|
+
hint: {
|
|
195
|
+
fontSize: 10,
|
|
196
|
+
color: macOSColors.text.muted
|
|
197
|
+
},
|
|
198
|
+
actions: {
|
|
199
|
+
display: "flex",
|
|
200
|
+
flexDirection: "row",
|
|
201
|
+
gap: 8
|
|
202
|
+
},
|
|
203
|
+
button: {
|
|
204
|
+
flex: 1,
|
|
205
|
+
padding: "10px 0",
|
|
206
|
+
borderRadius: 6,
|
|
207
|
+
display: "inline-flex",
|
|
208
|
+
alignItems: "center",
|
|
209
|
+
justifyContent: "center",
|
|
210
|
+
cursor: "pointer",
|
|
211
|
+
margin: 0,
|
|
212
|
+
boxSizing: "border-box"
|
|
213
|
+
},
|
|
214
|
+
cancelButton: {
|
|
215
|
+
border: `1px solid ${macOSColors.border.default}`,
|
|
216
|
+
backgroundColor: macOSColors.background.base
|
|
217
|
+
},
|
|
218
|
+
cancelText: {
|
|
219
|
+
fontSize: 12,
|
|
220
|
+
fontWeight: 600,
|
|
221
|
+
color: macOSColors.text.secondary
|
|
222
|
+
},
|
|
223
|
+
saveButton: {
|
|
224
|
+
border: `1px solid ${macOSColors.semantic.info}`,
|
|
225
|
+
backgroundColor: `${macOSColors.semantic.info}22`
|
|
226
|
+
},
|
|
227
|
+
saveText: {
|
|
228
|
+
fontSize: 12,
|
|
229
|
+
fontWeight: 700,
|
|
230
|
+
color: macOSColors.semantic.info
|
|
231
|
+
}
|
|
232
|
+
};
|