@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,1133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Explorer.web — DOM twin of response-editor/Explorer.tsx (the response-body
|
|
5
|
+
* tree: preview and editor as ONE surface, ported from the React Query tool's
|
|
6
|
+
* Explorer). Same recursion, same chunked pages (CHUNK_SIZE 100), same
|
|
7
|
+
* local-input-state race guard, and the same landing spot for edits: the
|
|
8
|
+
* `onChange` from `ResponseEditorContext`.
|
|
9
|
+
*
|
|
10
|
+
* REUSED, not forked (all platform-free):
|
|
11
|
+
* - `updateNestedDataByPath` / `deleteNestedDataByPath` — the pure tree ops.
|
|
12
|
+
* - `editorContext` (`ResponseEditorContext` / `useResponseEditor`) — the
|
|
13
|
+
* root-document + onChange seam.
|
|
14
|
+
* - `CopyButton` — the DOM twin already ported in DataViewer.web (F3), the
|
|
15
|
+
* same way native Explorer reuses shared-ui's CopyButton.
|
|
16
|
+
*
|
|
17
|
+
* NOTE on DataViewer.web: native Explorer and native VirtualizedDataExplorer
|
|
18
|
+
* are SEPARATE trees (different lineage — this one is the React Query port,
|
|
19
|
+
* the viewer is the flat-row virtualized explorer) sharing only the copy
|
|
20
|
+
* button and `displayValue`. The web twins mirror that exact relationship:
|
|
21
|
+
* this file recurses like native Explorer, and shares DataViewer.web's
|
|
22
|
+
* CopyButton rather than its flatten pipeline.
|
|
23
|
+
*
|
|
24
|
+
* shared-ui RN chrome is replicated as DOM with provenance (web consumers
|
|
25
|
+
* resolve `@buoy-gg/shared-ui` to a minimal shim):
|
|
26
|
+
* - `buoyColors` — inlined verbatim subset from
|
|
27
|
+
* shared/src/ui/gameUI/constants/gameUIColors.ts.
|
|
28
|
+
* - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
|
|
29
|
+
* - `CyberpunkInput` — inlined DOM twin below, values from
|
|
30
|
+
* shared/src/dataViewer/CyberpunkInput.tsx.
|
|
31
|
+
*
|
|
32
|
+
* Intentional deviations (all logged):
|
|
33
|
+
* - CyberpunkInput's RN `Animated` glitch loops (flicker overlay, x/y jitter,
|
|
34
|
+
* scale pulse) are not ported — focus still swaps the border/label/corner
|
|
35
|
+
* accents to the primary color, which is the state the animation decorates.
|
|
36
|
+
* - `displayValue`'s minimal-SuperJSON serialization → JSON.stringify (same
|
|
37
|
+
* deviation DataViewer.web logs; identical output for JSON payloads).
|
|
38
|
+
* - `hitSlop` has no DOM equivalent — buttons keep their natural hit areas.
|
|
39
|
+
*
|
|
40
|
+
* @platform React DOM Web
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import { useState, useMemo, useCallback, useRef, useEffect, memo } from "react";
|
|
44
|
+
import { CopyButton as SharedCopyButton } from "../DataViewer.web";
|
|
45
|
+
import { updateNestedDataByPath } from "./updateNestedDataByPath";
|
|
46
|
+
import { deleteNestedDataByPath } from "./deleteNestedDataByPath";
|
|
47
|
+
import { useResponseEditor } from "./editorContext";
|
|
48
|
+
|
|
49
|
+
// Stable constants to prevent re-renders — native Explorer, verbatim.
|
|
50
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
51
|
+
const CHUNK_SIZE = 100;
|
|
52
|
+
const EXPANDER_SIZE = 12;
|
|
53
|
+
|
|
54
|
+
// =============================
|
|
55
|
+
// Native palette (provenance)
|
|
56
|
+
// =============================
|
|
57
|
+
|
|
58
|
+
/** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts, verbatim. */
|
|
59
|
+
const buoyColors = {
|
|
60
|
+
card: "#1A1A1A",
|
|
61
|
+
text: "#E0E0E0",
|
|
62
|
+
textSecondary: "#A0A0A0",
|
|
63
|
+
textMuted: "#888888",
|
|
64
|
+
primary: "#20C997",
|
|
65
|
+
warning: "#FFA94D",
|
|
66
|
+
error: "#EF4444"
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// =============================
|
|
70
|
+
// Inline lucide icons (shared-ui icons are lucide re-exports)
|
|
71
|
+
// =============================
|
|
72
|
+
|
|
73
|
+
function Svg({
|
|
74
|
+
size = 14,
|
|
75
|
+
color = "currentColor",
|
|
76
|
+
strokeWidth = 2,
|
|
77
|
+
children
|
|
78
|
+
}) {
|
|
79
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
80
|
+
width: size,
|
|
81
|
+
height: size,
|
|
82
|
+
viewBox: "0 0 24 24",
|
|
83
|
+
fill: "none",
|
|
84
|
+
stroke: color,
|
|
85
|
+
strokeWidth: strokeWidth,
|
|
86
|
+
strokeLinecap: "round",
|
|
87
|
+
strokeLinejoin: "round",
|
|
88
|
+
style: {
|
|
89
|
+
flexShrink: 0,
|
|
90
|
+
display: "block"
|
|
91
|
+
},
|
|
92
|
+
children: children
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const ChevronRight = p => /*#__PURE__*/_jsx(Svg, {
|
|
96
|
+
...p,
|
|
97
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
98
|
+
d: "m9 18 6-6-6-6"
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
const ChevronDown = p => /*#__PURE__*/_jsx(Svg, {
|
|
102
|
+
...p,
|
|
103
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
104
|
+
d: "m6 9 6 6 6-6"
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
const ChevronUp = p => /*#__PURE__*/_jsx(Svg, {
|
|
108
|
+
...p,
|
|
109
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
110
|
+
d: "m18 15-6-6-6 6"
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
const Trash = p => /*#__PURE__*/_jsxs(Svg, {
|
|
114
|
+
...p,
|
|
115
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
116
|
+
d: "M3 6h18"
|
|
117
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
118
|
+
d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"
|
|
119
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
120
|
+
d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
/** displayValue twin — JSON.stringify-based, see the deviations log. */
|
|
125
|
+
function displayValue(value) {
|
|
126
|
+
if (value === undefined) return "undefined";
|
|
127
|
+
if (typeof value === "bigint") return `${value}n`;
|
|
128
|
+
if (typeof value === "function") return String(value).slice(0, 50);
|
|
129
|
+
if (typeof value === "symbol") return String(value);
|
|
130
|
+
try {
|
|
131
|
+
return JSON.stringify(value) ?? String(value);
|
|
132
|
+
} catch {
|
|
133
|
+
return String(value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Optimized chunking function moved to module scope — native, verbatim.
|
|
138
|
+
const chunkArray = (array, size = CHUNK_SIZE) => {
|
|
139
|
+
if (size < 1 || array.length === 0) return [];
|
|
140
|
+
const result = [];
|
|
141
|
+
for (let i = 0; i < array.length; i += size) {
|
|
142
|
+
result.push(array.slice(i, i + size));
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// Memoized Expander component — native styles.expanderIcon(+Main).
|
|
148
|
+
const Expander = /*#__PURE__*/memo(({
|
|
149
|
+
expanded,
|
|
150
|
+
isFocused = false,
|
|
151
|
+
isMain = false
|
|
152
|
+
}) => {
|
|
153
|
+
const color = isFocused ? buoyColors.primary : isMain ? buoyColors.text : buoyColors.textSecondary;
|
|
154
|
+
const Chevron = expanded ? ChevronDown : ChevronRight;
|
|
155
|
+
return /*#__PURE__*/_jsx("span", {
|
|
156
|
+
style: {
|
|
157
|
+
...styles.expanderIcon,
|
|
158
|
+
...(isMain ? styles.expanderIconMain : null)
|
|
159
|
+
},
|
|
160
|
+
children: /*#__PURE__*/_jsx(Chevron, {
|
|
161
|
+
size: isMain ? 14 : EXPANDER_SIZE,
|
|
162
|
+
color: color,
|
|
163
|
+
strokeWidth: 2.5
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
Expander.displayName = "Expander";
|
|
168
|
+
|
|
169
|
+
// Local wrapper for the shared CopyButton — same backward-compat shim as
|
|
170
|
+
// native (28×28 card-fill box; focused = primary ring + tint).
|
|
171
|
+
const CopyButton = /*#__PURE__*/memo(({
|
|
172
|
+
value,
|
|
173
|
+
isFocused = false
|
|
174
|
+
}) => {
|
|
175
|
+
return /*#__PURE__*/_jsx(SharedCopyButton, {
|
|
176
|
+
value: value,
|
|
177
|
+
size: 14,
|
|
178
|
+
buttonStyle: isFocused ? {
|
|
179
|
+
...styles.buttonStyle,
|
|
180
|
+
...styles.buttonStyleFocused
|
|
181
|
+
} : styles.buttonStyle
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
CopyButton.displayName = "CopyButton";
|
|
185
|
+
|
|
186
|
+
// Memoized DeleteItemButton component — native, verbatim behavior.
|
|
187
|
+
const DeleteItemButton = /*#__PURE__*/memo(({
|
|
188
|
+
dataPath,
|
|
189
|
+
isFocused = false
|
|
190
|
+
}) => {
|
|
191
|
+
const editor = useResponseEditor();
|
|
192
|
+
const handleDelete = useCallback(() => {
|
|
193
|
+
if (!editor) return;
|
|
194
|
+
editor.onChange(deleteNestedDataByPath(editor.root, dataPath));
|
|
195
|
+
}, [editor, dataPath]);
|
|
196
|
+
if (!editor) return null;
|
|
197
|
+
return /*#__PURE__*/_jsx("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
onClick: handleDelete,
|
|
200
|
+
style: {
|
|
201
|
+
...styles.deleteButton,
|
|
202
|
+
...(isFocused ? styles.deleteButtonFocused : null)
|
|
203
|
+
},
|
|
204
|
+
"aria-label": "Delete item",
|
|
205
|
+
children: /*#__PURE__*/_jsx(Trash, {
|
|
206
|
+
size: 14,
|
|
207
|
+
strokeWidth: 2,
|
|
208
|
+
color: isFocused ? buoyColors.error : buoyColors.error + "CC"
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
DeleteItemButton.displayName = "DeleteItemButton";
|
|
213
|
+
|
|
214
|
+
// Memoized ClearArrayButton component — native, verbatim behavior.
|
|
215
|
+
const ClearArrayButton = /*#__PURE__*/memo(({
|
|
216
|
+
dataPath,
|
|
217
|
+
isFocused = false
|
|
218
|
+
}) => {
|
|
219
|
+
const editor = useResponseEditor();
|
|
220
|
+
const handleClear = useCallback(() => {
|
|
221
|
+
if (!editor) return;
|
|
222
|
+
editor.onChange(updateNestedDataByPath(editor.root, dataPath, []));
|
|
223
|
+
}, [editor, dataPath]);
|
|
224
|
+
if (!editor) return null;
|
|
225
|
+
return /*#__PURE__*/_jsx("button", {
|
|
226
|
+
type: "button",
|
|
227
|
+
style: {
|
|
228
|
+
...styles.clearButton,
|
|
229
|
+
...(isFocused ? styles.clearButtonFocused : null)
|
|
230
|
+
},
|
|
231
|
+
"aria-label": "Remove all items",
|
|
232
|
+
onClick: handleClear,
|
|
233
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
234
|
+
style: {
|
|
235
|
+
...styles.clearButtonText,
|
|
236
|
+
color: isFocused ? buoyColors.warning : buoyColors.warning + "CC"
|
|
237
|
+
},
|
|
238
|
+
children: "[]"
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
ClearArrayButton.displayName = "ClearArrayButton";
|
|
243
|
+
|
|
244
|
+
// ToggleValueButton — not memoized (same reasoning as native: the parent
|
|
245
|
+
// passes a fresh dataPath array each render, which defeats memo anyway).
|
|
246
|
+
function ToggleValueButton({
|
|
247
|
+
dataPath,
|
|
248
|
+
value,
|
|
249
|
+
itemsDeletable
|
|
250
|
+
}) {
|
|
251
|
+
const editor = useResponseEditor();
|
|
252
|
+
const handleClick = useCallback(() => {
|
|
253
|
+
if (!editor) return;
|
|
254
|
+
const currentValue = typeof value === "boolean" ? value : false;
|
|
255
|
+
editor.onChange(updateNestedDataByPath(editor.root, dataPath, !currentValue));
|
|
256
|
+
}, [editor, dataPath, value]);
|
|
257
|
+
const handleDelete = useCallback(() => {
|
|
258
|
+
if (!editor) return;
|
|
259
|
+
editor.onChange(deleteNestedDataByPath(editor.root, dataPath));
|
|
260
|
+
}, [editor, dataPath]);
|
|
261
|
+
if (!editor) return null;
|
|
262
|
+
|
|
263
|
+
// Pre-compute styles based on value state — native, verbatim.
|
|
264
|
+
const badgeStyle = value ? styles.toggleBadgeTrue : styles.toggleBadgeFalse;
|
|
265
|
+
const textStyle = value ? styles.toggleTextTrue : styles.toggleTextFalse;
|
|
266
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
267
|
+
role: "button",
|
|
268
|
+
tabIndex: 0,
|
|
269
|
+
style: styles.modernToggleButton,
|
|
270
|
+
onClick: handleClick,
|
|
271
|
+
onKeyDown: e => {
|
|
272
|
+
if (e.key === "Enter" || e.key === " ") handleClick();
|
|
273
|
+
},
|
|
274
|
+
"aria-label": value ? "Set to false" : "Set to true",
|
|
275
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
276
|
+
style: {
|
|
277
|
+
...styles.toggleBadge,
|
|
278
|
+
...badgeStyle
|
|
279
|
+
},
|
|
280
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
281
|
+
style: {
|
|
282
|
+
...styles.toggleBadgeText,
|
|
283
|
+
...textStyle
|
|
284
|
+
},
|
|
285
|
+
children: value ? "TRUE" : "FALSE"
|
|
286
|
+
})
|
|
287
|
+
}), itemsDeletable && /*#__PURE__*/_jsx("button", {
|
|
288
|
+
type: "button",
|
|
289
|
+
onClick: e => {
|
|
290
|
+
// The delete button nests inside the toggle's press target on
|
|
291
|
+
// native too; stop the toggle from also firing.
|
|
292
|
+
e.stopPropagation();
|
|
293
|
+
handleDelete();
|
|
294
|
+
},
|
|
295
|
+
style: styles.deleteButtonInToggle,
|
|
296
|
+
"aria-label": "Delete item",
|
|
297
|
+
children: /*#__PURE__*/_jsx(Trash, {
|
|
298
|
+
size: 14,
|
|
299
|
+
strokeWidth: 2,
|
|
300
|
+
color: buoyColors.error + "CC"
|
|
301
|
+
})
|
|
302
|
+
})]
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// =============================
|
|
307
|
+
// CyberpunkInput twin (shared/src/dataViewer/CyberpunkInput.tsx)
|
|
308
|
+
// =============================
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The inline value input: uppercase mono label, bordered field, optional
|
|
312
|
+
* number steppers and delete button, corner accents. Focus swaps everything to
|
|
313
|
+
* the primary color — the RN glitch animation is not ported (see the
|
|
314
|
+
* deviations log).
|
|
315
|
+
*/
|
|
316
|
+
function CyberpunkInputWeb({
|
|
317
|
+
label,
|
|
318
|
+
value,
|
|
319
|
+
isNumber,
|
|
320
|
+
onChangeText,
|
|
321
|
+
onFocus,
|
|
322
|
+
onBlur,
|
|
323
|
+
showNumberControls = false,
|
|
324
|
+
onIncrement,
|
|
325
|
+
onDecrement,
|
|
326
|
+
showDeleteButton = false,
|
|
327
|
+
onDelete,
|
|
328
|
+
"aria-label": ariaLabel
|
|
329
|
+
}) {
|
|
330
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
331
|
+
const cornerStyle = corner => ({
|
|
332
|
+
...styles.cornerAccent,
|
|
333
|
+
...corner,
|
|
334
|
+
...(isFocused ? styles.cornerAccentFocused : null)
|
|
335
|
+
});
|
|
336
|
+
return /*#__PURE__*/_jsx("div", {
|
|
337
|
+
style: styles.cyberContainer,
|
|
338
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
339
|
+
style: styles.cyberRow,
|
|
340
|
+
children: [label ? /*#__PURE__*/_jsx("span", {
|
|
341
|
+
style: {
|
|
342
|
+
...styles.cyberLabel,
|
|
343
|
+
...(isFocused ? styles.cyberLabelFocused : null)
|
|
344
|
+
},
|
|
345
|
+
children: label.toUpperCase()
|
|
346
|
+
}) : null, /*#__PURE__*/_jsxs("div", {
|
|
347
|
+
style: {
|
|
348
|
+
...styles.cyberInputContainer,
|
|
349
|
+
opacity: isFocused ? 1 : 0.6,
|
|
350
|
+
borderColor: isFocused ? buoyColors.primary : buoyColors.textMuted + "4D"
|
|
351
|
+
},
|
|
352
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
353
|
+
value: value,
|
|
354
|
+
onChange: e => onChangeText(e.target.value),
|
|
355
|
+
onFocus: () => {
|
|
356
|
+
setIsFocused(true);
|
|
357
|
+
onFocus?.();
|
|
358
|
+
},
|
|
359
|
+
onBlur: () => {
|
|
360
|
+
setIsFocused(false);
|
|
361
|
+
onBlur?.();
|
|
362
|
+
},
|
|
363
|
+
inputMode: isNumber ? "decimal" : undefined,
|
|
364
|
+
autoComplete: "off",
|
|
365
|
+
autoCorrect: "off",
|
|
366
|
+
autoCapitalize: "none",
|
|
367
|
+
spellCheck: false,
|
|
368
|
+
"aria-label": ariaLabel ?? "Data input field for editing values",
|
|
369
|
+
style: {
|
|
370
|
+
...styles.cyberInput,
|
|
371
|
+
...(isNumber ? styles.textNumber : styles.textString)
|
|
372
|
+
}
|
|
373
|
+
}), showNumberControls && /*#__PURE__*/_jsxs("span", {
|
|
374
|
+
style: styles.numberControls,
|
|
375
|
+
children: [/*#__PURE__*/_jsx("button", {
|
|
376
|
+
type: "button",
|
|
377
|
+
style: {
|
|
378
|
+
...styles.controlButton,
|
|
379
|
+
...(isFocused ? styles.controlButtonFocused : null)
|
|
380
|
+
},
|
|
381
|
+
onClick: onIncrement,
|
|
382
|
+
"aria-label": "Increment value",
|
|
383
|
+
children: /*#__PURE__*/_jsx(ChevronUp, {
|
|
384
|
+
size: 14,
|
|
385
|
+
strokeWidth: 2.5,
|
|
386
|
+
color: isFocused ? buoyColors.primary : buoyColors.textMuted
|
|
387
|
+
})
|
|
388
|
+
}), /*#__PURE__*/_jsx("button", {
|
|
389
|
+
type: "button",
|
|
390
|
+
style: {
|
|
391
|
+
...styles.controlButton,
|
|
392
|
+
...(isFocused ? styles.controlButtonFocused : null)
|
|
393
|
+
},
|
|
394
|
+
onClick: onDecrement,
|
|
395
|
+
"aria-label": "Decrement value",
|
|
396
|
+
children: /*#__PURE__*/_jsx(ChevronDown, {
|
|
397
|
+
size: 14,
|
|
398
|
+
strokeWidth: 2.5,
|
|
399
|
+
color: isFocused ? buoyColors.primary : buoyColors.textMuted
|
|
400
|
+
})
|
|
401
|
+
})]
|
|
402
|
+
}), showDeleteButton && /*#__PURE__*/_jsx("button", {
|
|
403
|
+
type: "button",
|
|
404
|
+
style: {
|
|
405
|
+
...styles.cyberDeleteButton,
|
|
406
|
+
...(isFocused ? styles.cyberDeleteButtonFocused : null)
|
|
407
|
+
},
|
|
408
|
+
onClick: onDelete,
|
|
409
|
+
"aria-label": "Delete item",
|
|
410
|
+
children: /*#__PURE__*/_jsx(Trash, {
|
|
411
|
+
size: 14,
|
|
412
|
+
strokeWidth: 2,
|
|
413
|
+
color: isFocused ? buoyColors.error : buoyColors.error + "CC"
|
|
414
|
+
})
|
|
415
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
416
|
+
style: cornerStyle({
|
|
417
|
+
top: -1,
|
|
418
|
+
left: 5
|
|
419
|
+
})
|
|
420
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
421
|
+
style: cornerStyle({
|
|
422
|
+
top: -1,
|
|
423
|
+
right: 5
|
|
424
|
+
})
|
|
425
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
426
|
+
style: cornerStyle({
|
|
427
|
+
bottom: -1,
|
|
428
|
+
left: 5
|
|
429
|
+
})
|
|
430
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
431
|
+
style: cornerStyle({
|
|
432
|
+
bottom: -1,
|
|
433
|
+
right: 5
|
|
434
|
+
})
|
|
435
|
+
})]
|
|
436
|
+
})]
|
|
437
|
+
})
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Recursive data explorer — the editable JSON tree. Same prop contract,
|
|
442
|
+
* derivation order and edit semantics as the native file.
|
|
443
|
+
*/
|
|
444
|
+
export default function Explorer({
|
|
445
|
+
editable,
|
|
446
|
+
label,
|
|
447
|
+
value,
|
|
448
|
+
defaultExpanded,
|
|
449
|
+
dataPath,
|
|
450
|
+
itemsDeletable,
|
|
451
|
+
dataVersion = 0
|
|
452
|
+
}) {
|
|
453
|
+
const editor = useResponseEditor();
|
|
454
|
+
const [isRowFocused, setIsRowFocused] = useState(false);
|
|
455
|
+
|
|
456
|
+
// Local state for input value to handle typing properly
|
|
457
|
+
const [localInputValue, setLocalInputValue] = useState("");
|
|
458
|
+
|
|
459
|
+
// Sync local state with prop value
|
|
460
|
+
// ⚠️ CRITICAL: Do NOT add localInputValue to the dependency array!
|
|
461
|
+
// Adding localInputValue causes a race condition where user edits get
|
|
462
|
+
// reverted (type "5101" → store updates → effect fires while the prop is
|
|
463
|
+
// still 5100 → syncs back to 5100). Only sync when EXTERNAL changes happen
|
|
464
|
+
// (value, label, dataVersion) — carried over from native unchanged.
|
|
465
|
+
useEffect(() => {
|
|
466
|
+
if (value !== null && value !== undefined && (typeof value === "string" || typeof value === "number")) {
|
|
467
|
+
const newValue = value.toString();
|
|
468
|
+
setLocalInputValue(newValue);
|
|
469
|
+
}
|
|
470
|
+
}, [value, label, dataVersion]); // ⚠️ DO NOT add localInputValue here!
|
|
471
|
+
|
|
472
|
+
// Determine if this is a main section — native, verbatim.
|
|
473
|
+
const isMainSection = useMemo(() => {
|
|
474
|
+
const upperLabel = label.toUpperCase();
|
|
475
|
+
return ["DATA", "QUERY", "QUERYKEY", "TYPES", "STATS", "OPTIONS", "OBSERVERS"].includes(upperLabel);
|
|
476
|
+
}, [label]);
|
|
477
|
+
|
|
478
|
+
// Explorer's section is expanded or collapsed
|
|
479
|
+
const [isExpanded, setIsExpanded] = useState((defaultExpanded || []).includes(label));
|
|
480
|
+
const toggleExpanded = () => setIsExpanded(old => !old);
|
|
481
|
+
const [expandedPages, setExpandedPages] = useState([]);
|
|
482
|
+
|
|
483
|
+
// Optimized subEntries computation — native, verbatim (1000-entry cap).
|
|
484
|
+
const subEntries = useMemo(() => {
|
|
485
|
+
if (value === null || value === undefined || typeof value !== "object") {
|
|
486
|
+
return [];
|
|
487
|
+
}
|
|
488
|
+
if (Array.isArray(value)) {
|
|
489
|
+
const limitedValue = value.length > 1000 ? value.slice(0, 1000) : value;
|
|
490
|
+
return limitedValue.map((d, i) => ({
|
|
491
|
+
label: i.toString(),
|
|
492
|
+
value: d
|
|
493
|
+
}));
|
|
494
|
+
}
|
|
495
|
+
if (value instanceof Map) {
|
|
496
|
+
const entries = Array.from(value.entries()).slice(0, 1000);
|
|
497
|
+
return entries.map(([key, val]) => ({
|
|
498
|
+
label: String(key),
|
|
499
|
+
value: val
|
|
500
|
+
}));
|
|
501
|
+
}
|
|
502
|
+
if (value instanceof Set) {
|
|
503
|
+
const entries = Array.from(value).slice(0, 1000);
|
|
504
|
+
return entries.map((val, i) => ({
|
|
505
|
+
label: i.toString(),
|
|
506
|
+
value: val
|
|
507
|
+
}));
|
|
508
|
+
}
|
|
509
|
+
const entries = Object.entries(value).slice(0, 1000);
|
|
510
|
+
return entries.map(([key, val]) => ({
|
|
511
|
+
label: key,
|
|
512
|
+
value: val
|
|
513
|
+
}));
|
|
514
|
+
}, [value]);
|
|
515
|
+
|
|
516
|
+
// Optimized valueType computation — native, verbatim.
|
|
517
|
+
const valueType = useMemo(() => {
|
|
518
|
+
if (Array.isArray(value)) return "array";
|
|
519
|
+
if (value === null || typeof value !== "object") return typeof value;
|
|
520
|
+
if (value instanceof Map || value instanceof Set) return "Iterable";
|
|
521
|
+
return "object";
|
|
522
|
+
}, [value]);
|
|
523
|
+
const subEntryPages = useMemo(() => {
|
|
524
|
+
return chunkArray(subEntries, CHUNK_SIZE);
|
|
525
|
+
}, [subEntries]);
|
|
526
|
+
const currentDataPath = dataPath ?? [];
|
|
527
|
+
|
|
528
|
+
// Optimize handleChange using refs to avoid dependency arrays — native.
|
|
529
|
+
const editorRef = useRef(editor);
|
|
530
|
+
const dataPathRef = useRef(currentDataPath);
|
|
531
|
+
const valueTypeRef = useRef(valueType);
|
|
532
|
+
editorRef.current = editor;
|
|
533
|
+
dataPathRef.current = currentDataPath;
|
|
534
|
+
valueTypeRef.current = valueType;
|
|
535
|
+
const handleChange = useCallback((isNumber, newValue) => {
|
|
536
|
+
// Update local state immediately for responsive typing
|
|
537
|
+
setLocalInputValue(newValue);
|
|
538
|
+
const current = editorRef.current;
|
|
539
|
+
if (!current) return;
|
|
540
|
+
if (isNumber && isNaN(Number(newValue))) return;
|
|
541
|
+
const updatedValue = valueTypeRef.current === "number" ? Number(newValue) : newValue;
|
|
542
|
+
current.onChange(updateNestedDataByPath(current.root, dataPathRef.current, updatedValue));
|
|
543
|
+
}, [setLocalInputValue]);
|
|
544
|
+
return /*#__PURE__*/_jsx("div", {
|
|
545
|
+
style: styles.minWidthWrapper,
|
|
546
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
547
|
+
style: styles.fullWidthMarginRight,
|
|
548
|
+
children: [subEntryPages.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
|
|
549
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
550
|
+
style: {
|
|
551
|
+
...styles.flexRowItemsCenterGap,
|
|
552
|
+
...(isMainSection ? styles.flexRowItemsCenterGapMain : null)
|
|
553
|
+
},
|
|
554
|
+
children: [/*#__PURE__*/_jsxs("button", {
|
|
555
|
+
type: "button",
|
|
556
|
+
style: styles.expanderButton,
|
|
557
|
+
onClick: toggleExpanded,
|
|
558
|
+
"aria-expanded": isExpanded,
|
|
559
|
+
children: [/*#__PURE__*/_jsx(Expander, {
|
|
560
|
+
expanded: isExpanded,
|
|
561
|
+
isFocused: isRowFocused,
|
|
562
|
+
isMain: isMainSection
|
|
563
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
564
|
+
style: {
|
|
565
|
+
...styles.labelText,
|
|
566
|
+
...(isRowFocused ? styles.labelTextFocused : null),
|
|
567
|
+
...(isMainSection ? styles.labelTextMain : null)
|
|
568
|
+
},
|
|
569
|
+
children: label
|
|
570
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
571
|
+
style: styles.textGray500,
|
|
572
|
+
children: `${String(valueType).toLowerCase() === "iterable" ? "(Iterable) " : ""}${subEntries.length} ${subEntries.length > 1 ? `items` : `item`}`
|
|
573
|
+
})]
|
|
574
|
+
}), editable && /*#__PURE__*/_jsxs("span", {
|
|
575
|
+
style: styles.flexRowGapItemsCenter,
|
|
576
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
577
|
+
value: value,
|
|
578
|
+
isFocused: isRowFocused
|
|
579
|
+
}), itemsDeletable && editor !== null && /*#__PURE__*/_jsx(DeleteItemButton, {
|
|
580
|
+
dataPath: currentDataPath,
|
|
581
|
+
isFocused: isRowFocused
|
|
582
|
+
}), valueType === "array" && editor !== null && /*#__PURE__*/_jsx(ClearArrayButton, {
|
|
583
|
+
dataPath: currentDataPath,
|
|
584
|
+
isFocused: isRowFocused
|
|
585
|
+
})]
|
|
586
|
+
})]
|
|
587
|
+
}), isExpanded && /*#__PURE__*/_jsxs(_Fragment, {
|
|
588
|
+
children: [subEntryPages.length === 1 && /*#__PURE__*/_jsx("div", {
|
|
589
|
+
style: {
|
|
590
|
+
...styles.singleEntryContainer,
|
|
591
|
+
...(isMainSection ? styles.singleEntryContainerMain : null)
|
|
592
|
+
},
|
|
593
|
+
children: subEntries.map((entry, index) => /*#__PURE__*/_jsx(Explorer, {
|
|
594
|
+
defaultExpanded: defaultExpanded,
|
|
595
|
+
label: entry.label,
|
|
596
|
+
value: entry.value,
|
|
597
|
+
editable: editable,
|
|
598
|
+
dataPath: [...currentDataPath, entry.label],
|
|
599
|
+
itemsDeletable: valueType === "array" || valueType === "Iterable" || valueType === "object",
|
|
600
|
+
dataVersion: dataVersion
|
|
601
|
+
}, entry.label + index))
|
|
602
|
+
}), subEntryPages.length > 1 && /*#__PURE__*/_jsx("div", {
|
|
603
|
+
style: styles.multiEntryContainer,
|
|
604
|
+
children: subEntryPages.map((entries, index) => /*#__PURE__*/_jsx("div", {
|
|
605
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
606
|
+
style: styles.relativeOutlineNone,
|
|
607
|
+
children: [/*#__PURE__*/_jsxs("button", {
|
|
608
|
+
type: "button",
|
|
609
|
+
onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index]),
|
|
610
|
+
style: styles.pageExpanderButton,
|
|
611
|
+
"aria-expanded": expandedPages.includes(index),
|
|
612
|
+
children: [/*#__PURE__*/_jsx(Expander, {
|
|
613
|
+
expanded: expandedPages.includes(index)
|
|
614
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
615
|
+
style: styles.pageRangeText,
|
|
616
|
+
children: ["[", index * CHUNK_SIZE, "...", index * CHUNK_SIZE + CHUNK_SIZE - 1, "]"]
|
|
617
|
+
})]
|
|
618
|
+
}), expandedPages.includes(index) && /*#__PURE__*/_jsx("div", {
|
|
619
|
+
style: styles.entriesContainer,
|
|
620
|
+
children: entries.map(entry => /*#__PURE__*/_jsx(Explorer, {
|
|
621
|
+
defaultExpanded: defaultExpanded,
|
|
622
|
+
label: entry.label,
|
|
623
|
+
value: entry.value,
|
|
624
|
+
editable: editable,
|
|
625
|
+
dataPath: [...currentDataPath, entry.label],
|
|
626
|
+
dataVersion: dataVersion
|
|
627
|
+
}, entry.label))
|
|
628
|
+
})]
|
|
629
|
+
})
|
|
630
|
+
}, index))
|
|
631
|
+
})]
|
|
632
|
+
})]
|
|
633
|
+
}), subEntryPages.length === 0 && /*#__PURE__*/_jsxs("div", {
|
|
634
|
+
style: styles.flexRowGapFullWidth,
|
|
635
|
+
children: [editable && editor !== null && (valueType === "string" || valueType === "number" || valueType === "boolean") ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
636
|
+
children: [editable && editor && (valueType === "string" || valueType === "number") && /*#__PURE__*/_jsx("div", {
|
|
637
|
+
style: styles.nebulaInputWrapper,
|
|
638
|
+
children: /*#__PURE__*/_jsx(CyberpunkInputWeb, {
|
|
639
|
+
label: label,
|
|
640
|
+
value: localInputValue,
|
|
641
|
+
isNumber: valueType === "number",
|
|
642
|
+
onChangeText: newValue => handleChange(valueType === "number", newValue),
|
|
643
|
+
onFocus: () => setIsRowFocused(true),
|
|
644
|
+
onBlur: () => setIsRowFocused(false),
|
|
645
|
+
showNumberControls: valueType === "number",
|
|
646
|
+
onIncrement: () => {
|
|
647
|
+
const currentNum = Number(localInputValue) || 0;
|
|
648
|
+
handleChange(true, String(currentNum + 1));
|
|
649
|
+
},
|
|
650
|
+
onDecrement: () => {
|
|
651
|
+
const currentNum = Number(localInputValue) || 0;
|
|
652
|
+
handleChange(true, String(currentNum - 1));
|
|
653
|
+
},
|
|
654
|
+
showDeleteButton: itemsDeletable,
|
|
655
|
+
onDelete: () => {
|
|
656
|
+
editor.onChange(deleteNestedDataByPath(editor.root, currentDataPath));
|
|
657
|
+
}
|
|
658
|
+
})
|
|
659
|
+
}), valueType === "boolean" && /*#__PURE__*/_jsxs("div", {
|
|
660
|
+
style: styles.booleanRowContainer,
|
|
661
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
662
|
+
style: styles.booleanLabel,
|
|
663
|
+
children: label
|
|
664
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
665
|
+
style: styles.booleanToggleWrapper,
|
|
666
|
+
children: /*#__PURE__*/_jsx(ToggleValueButton, {
|
|
667
|
+
dataPath: currentDataPath,
|
|
668
|
+
value: value,
|
|
669
|
+
itemsDeletable: itemsDeletable
|
|
670
|
+
})
|
|
671
|
+
})]
|
|
672
|
+
})]
|
|
673
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
674
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
675
|
+
style: styles.text344054,
|
|
676
|
+
children: label
|
|
677
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
678
|
+
style: styles.displayValueText,
|
|
679
|
+
children: displayValue(value)
|
|
680
|
+
})]
|
|
681
|
+
}), editable && itemsDeletable && editor !== null && valueType !== "string" && valueType !== "number" && valueType !== "boolean" && /*#__PURE__*/_jsx(DeleteItemButton, {
|
|
682
|
+
dataPath: currentDataPath,
|
|
683
|
+
isFocused: isRowFocused
|
|
684
|
+
})]
|
|
685
|
+
})]
|
|
686
|
+
})
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// Values mirror the native StyleSheet blocks 1:1 (Explorer.tsx +
|
|
691
|
+
// CyberpunkInput.tsx).
|
|
692
|
+
const styles = {
|
|
693
|
+
buttonStyle: {
|
|
694
|
+
backgroundColor: buoyColors.card + "E6",
|
|
695
|
+
border: `1px solid ${buoyColors.textSecondary}33`,
|
|
696
|
+
borderRadius: 6,
|
|
697
|
+
display: "inline-flex",
|
|
698
|
+
flexDirection: "row",
|
|
699
|
+
alignItems: "center",
|
|
700
|
+
justifyContent: "center",
|
|
701
|
+
width: 28,
|
|
702
|
+
height: 28,
|
|
703
|
+
boxSizing: "border-box",
|
|
704
|
+
position: "relative",
|
|
705
|
+
padding: 0
|
|
706
|
+
},
|
|
707
|
+
buttonStyleFocused: {
|
|
708
|
+
border: `1px solid ${buoyColors.primary}CC`,
|
|
709
|
+
backgroundColor: buoyColors.primary + "26"
|
|
710
|
+
},
|
|
711
|
+
deleteButton: {
|
|
712
|
+
backgroundColor: buoyColors.error + "1A",
|
|
713
|
+
border: `1px solid ${buoyColors.error}4D`,
|
|
714
|
+
borderRadius: 6,
|
|
715
|
+
padding: 0,
|
|
716
|
+
display: "inline-flex",
|
|
717
|
+
alignItems: "center",
|
|
718
|
+
justifyContent: "center",
|
|
719
|
+
width: 28,
|
|
720
|
+
height: 28,
|
|
721
|
+
boxSizing: "border-box",
|
|
722
|
+
position: "relative",
|
|
723
|
+
cursor: "pointer",
|
|
724
|
+
margin: 0,
|
|
725
|
+
flexShrink: 0
|
|
726
|
+
},
|
|
727
|
+
deleteButtonFocused: {
|
|
728
|
+
border: `1px solid ${buoyColors.error}CC`,
|
|
729
|
+
backgroundColor: buoyColors.error + "33"
|
|
730
|
+
},
|
|
731
|
+
deleteButtonInToggle: {
|
|
732
|
+
backgroundColor: buoyColors.error + "1A",
|
|
733
|
+
border: `1px solid ${buoyColors.error}4D`,
|
|
734
|
+
borderRadius: 6,
|
|
735
|
+
padding: 0,
|
|
736
|
+
display: "inline-flex",
|
|
737
|
+
alignItems: "center",
|
|
738
|
+
justifyContent: "center",
|
|
739
|
+
width: 28,
|
|
740
|
+
height: 28,
|
|
741
|
+
boxSizing: "border-box",
|
|
742
|
+
cursor: "pointer",
|
|
743
|
+
margin: 0
|
|
744
|
+
},
|
|
745
|
+
clearButton: {
|
|
746
|
+
backgroundColor: buoyColors.warning + "1A",
|
|
747
|
+
border: `1px solid ${buoyColors.warning}4D`,
|
|
748
|
+
borderRadius: 6,
|
|
749
|
+
display: "inline-flex",
|
|
750
|
+
flexDirection: "row",
|
|
751
|
+
padding: 0,
|
|
752
|
+
alignItems: "center",
|
|
753
|
+
justifyContent: "center",
|
|
754
|
+
width: 28,
|
|
755
|
+
height: 28,
|
|
756
|
+
boxSizing: "border-box",
|
|
757
|
+
position: "relative",
|
|
758
|
+
zIndex: 10,
|
|
759
|
+
cursor: "pointer",
|
|
760
|
+
margin: 0,
|
|
761
|
+
flexShrink: 0
|
|
762
|
+
},
|
|
763
|
+
clearButtonFocused: {
|
|
764
|
+
border: `1px solid ${buoyColors.warning}CC`,
|
|
765
|
+
backgroundColor: buoyColors.warning + "33"
|
|
766
|
+
},
|
|
767
|
+
clearButtonText: {
|
|
768
|
+
fontSize: 12,
|
|
769
|
+
fontWeight: 700,
|
|
770
|
+
fontFamily: "ui-monospace, Menlo, monospace"
|
|
771
|
+
},
|
|
772
|
+
expanderIcon: {
|
|
773
|
+
width: 18,
|
|
774
|
+
height: 18,
|
|
775
|
+
display: "inline-flex",
|
|
776
|
+
alignItems: "center",
|
|
777
|
+
justifyContent: "center",
|
|
778
|
+
marginRight: 1,
|
|
779
|
+
backgroundColor: buoyColors.textSecondary + "14",
|
|
780
|
+
borderRadius: 3,
|
|
781
|
+
boxSizing: "border-box",
|
|
782
|
+
flexShrink: 0
|
|
783
|
+
},
|
|
784
|
+
expanderIconMain: {
|
|
785
|
+
backgroundColor: buoyColors.textSecondary + "1A",
|
|
786
|
+
width: 20,
|
|
787
|
+
height: 20,
|
|
788
|
+
borderRadius: 4,
|
|
789
|
+
border: `0.5px solid ${buoyColors.textSecondary}33`
|
|
790
|
+
},
|
|
791
|
+
minWidthWrapper: {
|
|
792
|
+
minWidth: 180,
|
|
793
|
+
fontSize: 11,
|
|
794
|
+
display: "flex",
|
|
795
|
+
flexDirection: "row",
|
|
796
|
+
flexWrap: "wrap",
|
|
797
|
+
width: "100%",
|
|
798
|
+
margin: "0.5px 0"
|
|
799
|
+
},
|
|
800
|
+
fullWidthMarginRight: {
|
|
801
|
+
position: "relative",
|
|
802
|
+
width: "100%",
|
|
803
|
+
marginRight: 1
|
|
804
|
+
},
|
|
805
|
+
flexRowItemsCenterGap: {
|
|
806
|
+
display: "flex",
|
|
807
|
+
flexDirection: "row",
|
|
808
|
+
alignItems: "center",
|
|
809
|
+
justifyContent: "space-between",
|
|
810
|
+
padding: "3px 6px",
|
|
811
|
+
margin: "1px 0",
|
|
812
|
+
borderRadius: 4,
|
|
813
|
+
backgroundColor: buoyColors.card + "66",
|
|
814
|
+
border: `0.5px solid ${buoyColors.textSecondary}1A`,
|
|
815
|
+
boxSizing: "border-box"
|
|
816
|
+
},
|
|
817
|
+
flexRowItemsCenterGapMain: {
|
|
818
|
+
backgroundColor: buoyColors.card + "E6",
|
|
819
|
+
border: `1px solid ${buoyColors.textSecondary}26`,
|
|
820
|
+
borderLeft: `2.5px solid ${buoyColors.textSecondary}80`,
|
|
821
|
+
padding: "5px 8px",
|
|
822
|
+
marginBottom: 3
|
|
823
|
+
},
|
|
824
|
+
expanderButton: {
|
|
825
|
+
display: "flex",
|
|
826
|
+
flexDirection: "row",
|
|
827
|
+
alignItems: "center",
|
|
828
|
+
backgroundColor: "transparent",
|
|
829
|
+
padding: "1px 2px",
|
|
830
|
+
gap: 6,
|
|
831
|
+
border: "none",
|
|
832
|
+
minHeight: 24,
|
|
833
|
+
flex: 1,
|
|
834
|
+
minWidth: 0,
|
|
835
|
+
cursor: "pointer",
|
|
836
|
+
margin: 0,
|
|
837
|
+
textAlign: "left",
|
|
838
|
+
font: "inherit"
|
|
839
|
+
},
|
|
840
|
+
labelText: {
|
|
841
|
+
color: buoyColors.textSecondary,
|
|
842
|
+
fontSize: 10,
|
|
843
|
+
fontWeight: 600,
|
|
844
|
+
marginRight: 4,
|
|
845
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
846
|
+
letterSpacing: 0.4
|
|
847
|
+
},
|
|
848
|
+
labelTextFocused: {
|
|
849
|
+
color: buoyColors.text
|
|
850
|
+
},
|
|
851
|
+
labelTextMain: {
|
|
852
|
+
color: buoyColors.text,
|
|
853
|
+
fontSize: 11,
|
|
854
|
+
fontWeight: 700,
|
|
855
|
+
letterSpacing: 0.6
|
|
856
|
+
},
|
|
857
|
+
textGray500: {
|
|
858
|
+
color: buoyColors.textMuted,
|
|
859
|
+
fontSize: 10,
|
|
860
|
+
fontWeight: 400,
|
|
861
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
862
|
+
opacity: 0.7
|
|
863
|
+
},
|
|
864
|
+
pageRangeText: {
|
|
865
|
+
color: buoyColors.textSecondary,
|
|
866
|
+
fontSize: 10,
|
|
867
|
+
fontWeight: 600,
|
|
868
|
+
fontFamily: "ui-monospace, Menlo, monospace"
|
|
869
|
+
},
|
|
870
|
+
flexRowGapItemsCenter: {
|
|
871
|
+
display: "flex",
|
|
872
|
+
flexDirection: "row",
|
|
873
|
+
alignItems: "center",
|
|
874
|
+
gap: 4,
|
|
875
|
+
paddingLeft: 2
|
|
876
|
+
},
|
|
877
|
+
singleEntryContainer: {
|
|
878
|
+
marginLeft: 2,
|
|
879
|
+
marginTop: 2,
|
|
880
|
+
paddingLeft: 8,
|
|
881
|
+
borderLeft: `1.5px solid ${buoyColors.textSecondary}40`
|
|
882
|
+
},
|
|
883
|
+
singleEntryContainerMain: {
|
|
884
|
+
borderLeft: `1.5px solid ${buoyColors.textSecondary}4D`,
|
|
885
|
+
marginLeft: 4,
|
|
886
|
+
paddingLeft: 10
|
|
887
|
+
},
|
|
888
|
+
multiEntryContainer: {
|
|
889
|
+
marginLeft: 2,
|
|
890
|
+
marginTop: 2,
|
|
891
|
+
paddingLeft: 8,
|
|
892
|
+
borderLeft: `1.5px solid ${buoyColors.textSecondary}40`
|
|
893
|
+
},
|
|
894
|
+
relativeOutlineNone: {
|
|
895
|
+
position: "relative"
|
|
896
|
+
},
|
|
897
|
+
pageExpanderButton: {
|
|
898
|
+
display: "flex",
|
|
899
|
+
flexDirection: "row",
|
|
900
|
+
alignItems: "center",
|
|
901
|
+
backgroundColor: buoyColors.card + "66",
|
|
902
|
+
padding: "3px 6px",
|
|
903
|
+
gap: 6,
|
|
904
|
+
borderRadius: 4,
|
|
905
|
+
border: `0.5px solid ${buoyColors.textSecondary}1A`,
|
|
906
|
+
marginBottom: 2,
|
|
907
|
+
minHeight: 24,
|
|
908
|
+
cursor: "pointer",
|
|
909
|
+
margin: "0 0 2px 0",
|
|
910
|
+
width: "100%",
|
|
911
|
+
boxSizing: "border-box",
|
|
912
|
+
textAlign: "left",
|
|
913
|
+
font: "inherit"
|
|
914
|
+
},
|
|
915
|
+
entriesContainer: {
|
|
916
|
+
marginLeft: 2,
|
|
917
|
+
paddingLeft: 8,
|
|
918
|
+
marginTop: 2,
|
|
919
|
+
borderLeft: `1.5px solid ${buoyColors.textSecondary}40`
|
|
920
|
+
},
|
|
921
|
+
textNumber: {
|
|
922
|
+
color: buoyColors.text,
|
|
923
|
+
fontWeight: 600,
|
|
924
|
+
fontFamily: "ui-monospace, Menlo, monospace"
|
|
925
|
+
},
|
|
926
|
+
textString: {
|
|
927
|
+
color: buoyColors.text,
|
|
928
|
+
fontFamily: "ui-monospace, Menlo, monospace"
|
|
929
|
+
},
|
|
930
|
+
flexRowGapFullWidth: {
|
|
931
|
+
display: "flex",
|
|
932
|
+
flexDirection: "row",
|
|
933
|
+
width: "100%",
|
|
934
|
+
alignItems: "center",
|
|
935
|
+
margin: "1px 0",
|
|
936
|
+
gap: 6,
|
|
937
|
+
padding: "2px 4px",
|
|
938
|
+
borderRadius: 3,
|
|
939
|
+
boxSizing: "border-box"
|
|
940
|
+
},
|
|
941
|
+
text344054: {
|
|
942
|
+
color: buoyColors.textSecondary,
|
|
943
|
+
fontWeight: 600,
|
|
944
|
+
fontSize: 9,
|
|
945
|
+
minWidth: 50,
|
|
946
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
947
|
+
letterSpacing: 0.4,
|
|
948
|
+
opacity: 0.8,
|
|
949
|
+
flexShrink: 0
|
|
950
|
+
},
|
|
951
|
+
nebulaInputWrapper: {
|
|
952
|
+
flex: 1,
|
|
953
|
+
width: "100%",
|
|
954
|
+
position: "relative",
|
|
955
|
+
minWidth: 0
|
|
956
|
+
},
|
|
957
|
+
displayValueText: {
|
|
958
|
+
flex: 1,
|
|
959
|
+
minWidth: 0,
|
|
960
|
+
color: buoyColors.text,
|
|
961
|
+
fontWeight: 400,
|
|
962
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
963
|
+
fontSize: 12,
|
|
964
|
+
padding: "6px 10px",
|
|
965
|
+
borderRadius: 6,
|
|
966
|
+
border: `1px solid ${buoyColors.textMuted}66`,
|
|
967
|
+
minHeight: 34,
|
|
968
|
+
boxSizing: "border-box",
|
|
969
|
+
overflowWrap: "anywhere"
|
|
970
|
+
},
|
|
971
|
+
modernToggleButton: {
|
|
972
|
+
display: "flex",
|
|
973
|
+
flexDirection: "row",
|
|
974
|
+
alignItems: "center",
|
|
975
|
+
justifyContent: "space-between",
|
|
976
|
+
borderRadius: 6,
|
|
977
|
+
border: `1px solid ${buoyColors.textMuted}99`,
|
|
978
|
+
padding: "6px 8px",
|
|
979
|
+
margin: "2px 0",
|
|
980
|
+
minHeight: 34,
|
|
981
|
+
gap: 8,
|
|
982
|
+
boxSizing: "border-box",
|
|
983
|
+
cursor: "pointer"
|
|
984
|
+
},
|
|
985
|
+
toggleBadge: {
|
|
986
|
+
marginLeft: 6,
|
|
987
|
+
padding: "3px 6px",
|
|
988
|
+
borderRadius: 4,
|
|
989
|
+
display: "inline-flex"
|
|
990
|
+
},
|
|
991
|
+
toggleBadgeText: {
|
|
992
|
+
fontSize: 9,
|
|
993
|
+
fontWeight: 700,
|
|
994
|
+
textTransform: "uppercase",
|
|
995
|
+
letterSpacing: 0.8,
|
|
996
|
+
fontFamily: "ui-monospace, Menlo, monospace"
|
|
997
|
+
},
|
|
998
|
+
toggleBadgeTrue: {
|
|
999
|
+
backgroundColor: buoyColors.primary + "1A",
|
|
1000
|
+
border: `1px solid ${buoyColors.primary}4D`
|
|
1001
|
+
},
|
|
1002
|
+
toggleBadgeFalse: {
|
|
1003
|
+
backgroundColor: buoyColors.textMuted + "1A",
|
|
1004
|
+
border: `1px solid ${buoyColors.textMuted}4D`
|
|
1005
|
+
},
|
|
1006
|
+
toggleTextTrue: {
|
|
1007
|
+
color: buoyColors.primary,
|
|
1008
|
+
fontWeight: 600
|
|
1009
|
+
},
|
|
1010
|
+
toggleTextFalse: {
|
|
1011
|
+
color: buoyColors.textSecondary,
|
|
1012
|
+
fontWeight: 500
|
|
1013
|
+
},
|
|
1014
|
+
booleanRowContainer: {
|
|
1015
|
+
display: "flex",
|
|
1016
|
+
flexDirection: "row",
|
|
1017
|
+
alignItems: "center",
|
|
1018
|
+
width: "100%",
|
|
1019
|
+
gap: 8,
|
|
1020
|
+
padding: "2px 0"
|
|
1021
|
+
},
|
|
1022
|
+
booleanLabel: {
|
|
1023
|
+
color: buoyColors.textSecondary,
|
|
1024
|
+
fontSize: 10,
|
|
1025
|
+
fontWeight: 600,
|
|
1026
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1027
|
+
letterSpacing: 0.4,
|
|
1028
|
+
minWidth: 60,
|
|
1029
|
+
flexShrink: 0
|
|
1030
|
+
},
|
|
1031
|
+
booleanToggleWrapper: {
|
|
1032
|
+
flex: 1,
|
|
1033
|
+
minWidth: 0
|
|
1034
|
+
},
|
|
1035
|
+
// CyberpunkInput.tsx styles, verbatim.
|
|
1036
|
+
cyberContainer: {
|
|
1037
|
+
width: "100%",
|
|
1038
|
+
margin: "3px 0"
|
|
1039
|
+
},
|
|
1040
|
+
cyberRow: {
|
|
1041
|
+
display: "flex",
|
|
1042
|
+
flexDirection: "row",
|
|
1043
|
+
alignItems: "center",
|
|
1044
|
+
gap: 8
|
|
1045
|
+
},
|
|
1046
|
+
cyberLabel: {
|
|
1047
|
+
fontSize: 10,
|
|
1048
|
+
fontWeight: 600,
|
|
1049
|
+
fontFamily: "ui-monospace, Menlo, monospace",
|
|
1050
|
+
color: buoyColors.textMuted,
|
|
1051
|
+
letterSpacing: 0.5,
|
|
1052
|
+
minWidth: 60,
|
|
1053
|
+
flexShrink: 0
|
|
1054
|
+
},
|
|
1055
|
+
cyberLabelFocused: {
|
|
1056
|
+
color: buoyColors.primary
|
|
1057
|
+
},
|
|
1058
|
+
cyberInputContainer: {
|
|
1059
|
+
flex: 1,
|
|
1060
|
+
minWidth: 0,
|
|
1061
|
+
borderWidth: 1,
|
|
1062
|
+
borderStyle: "solid",
|
|
1063
|
+
borderRadius: 6,
|
|
1064
|
+
position: "relative",
|
|
1065
|
+
minHeight: 34,
|
|
1066
|
+
display: "flex",
|
|
1067
|
+
flexDirection: "row",
|
|
1068
|
+
alignItems: "center",
|
|
1069
|
+
boxSizing: "border-box"
|
|
1070
|
+
},
|
|
1071
|
+
cyberInput: {
|
|
1072
|
+
flex: 1,
|
|
1073
|
+
minWidth: 0,
|
|
1074
|
+
padding: "6px 10px",
|
|
1075
|
+
fontSize: 12,
|
|
1076
|
+
backgroundColor: "transparent",
|
|
1077
|
+
zIndex: 1,
|
|
1078
|
+
border: "none",
|
|
1079
|
+
outline: "none"
|
|
1080
|
+
},
|
|
1081
|
+
numberControls: {
|
|
1082
|
+
display: "inline-flex",
|
|
1083
|
+
flexDirection: "row",
|
|
1084
|
+
gap: 2,
|
|
1085
|
+
paddingRight: 4,
|
|
1086
|
+
zIndex: 2
|
|
1087
|
+
},
|
|
1088
|
+
controlButton: {
|
|
1089
|
+
width: 28,
|
|
1090
|
+
height: 28,
|
|
1091
|
+
borderRadius: 6,
|
|
1092
|
+
border: `1px solid ${buoyColors.textMuted}33`,
|
|
1093
|
+
display: "inline-flex",
|
|
1094
|
+
alignItems: "center",
|
|
1095
|
+
justifyContent: "center",
|
|
1096
|
+
boxSizing: "border-box",
|
|
1097
|
+
background: "none",
|
|
1098
|
+
cursor: "pointer",
|
|
1099
|
+
padding: 0,
|
|
1100
|
+
margin: 0
|
|
1101
|
+
},
|
|
1102
|
+
controlButtonFocused: {
|
|
1103
|
+
border: `1px solid ${buoyColors.primary}CC`
|
|
1104
|
+
},
|
|
1105
|
+
cyberDeleteButton: {
|
|
1106
|
+
width: 28,
|
|
1107
|
+
height: 28,
|
|
1108
|
+
borderRadius: 6,
|
|
1109
|
+
border: `1px solid ${buoyColors.error}4D`,
|
|
1110
|
+
display: "inline-flex",
|
|
1111
|
+
alignItems: "center",
|
|
1112
|
+
justifyContent: "center",
|
|
1113
|
+
boxSizing: "border-box",
|
|
1114
|
+
background: "none",
|
|
1115
|
+
cursor: "pointer",
|
|
1116
|
+
padding: 0,
|
|
1117
|
+
marginRight: 4,
|
|
1118
|
+
zIndex: 2
|
|
1119
|
+
},
|
|
1120
|
+
cyberDeleteButtonFocused: {
|
|
1121
|
+
border: `1px solid ${buoyColors.error}CC`
|
|
1122
|
+
},
|
|
1123
|
+
cornerAccent: {
|
|
1124
|
+
position: "absolute",
|
|
1125
|
+
width: 6,
|
|
1126
|
+
height: 1.2,
|
|
1127
|
+
backgroundColor: buoyColors.textMuted + "CC",
|
|
1128
|
+
zIndex: 0
|
|
1129
|
+
},
|
|
1130
|
+
cornerAccentFocused: {
|
|
1131
|
+
backgroundColor: buoyColors.primary
|
|
1132
|
+
}
|
|
1133
|
+
};
|