@buoy-gg/network 7.0.41 → 7.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -85
- package/lib/commonjs/index.js +1 -332
- package/lib/commonjs/index.web.js +1 -420
- package/lib/commonjs/network/components/DataViewer.web.js +1 -879
- package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
- package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
- package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
- package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
- package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
- package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
- package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
- package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
- package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
- package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
- package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
- package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
- package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
- package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
- package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
- package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
- package/lib/commonjs/network/components/NetworkListScreen.js +1 -403
- package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -624
- package/lib/commonjs/network/components/NetworkModal.js +1 -786
- package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
- package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
- package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
- package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
- package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
- package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
- package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
- package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
- package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
- package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
- package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
- package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
- package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
- package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
- package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
- package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
- package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
- package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
- package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
- package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
- package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
- package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
- package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
- package/lib/commonjs/network/conditions/store.js +1 -75
- package/lib/commonjs/network/conditions/wait.js +1 -43
- package/lib/commonjs/network/conditions/xhr.js +1 -135
- package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
- package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
- package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
- package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
- package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
- package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
- package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
- package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
- package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
- package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
- package/lib/commonjs/network/overrides/applyToXhr.js +2 -510
- package/lib/commonjs/network/overrides/engine.js +1 -93
- package/lib/commonjs/network/overrides/matchRule.js +1 -87
- package/lib/commonjs/network/overrides/overriddenRows.js +1 -37
- package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
- package/lib/commonjs/network/overrides/presets.js +1 -70
- package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
- package/lib/commonjs/network/overrides/types.js +1 -90
- package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
- package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
- package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
- package/lib/commonjs/network/types/index.js +1 -5
- package/lib/commonjs/network/utils/extractOperationName.js +1 -80
- package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
- package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
- package/lib/commonjs/network/utils/formatting.js +1 -30
- package/lib/commonjs/network/utils/generateCurl.js +2 -71
- package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
- package/lib/commonjs/network/utils/httpCompletion.js +1 -37
- package/lib/commonjs/network/utils/networkEventStore.js +1 -411
- package/lib/commonjs/network/utils/networkListener.js +4 -1352
- package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
- package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
- package/lib/commonjs/network/utils/realNow.js +1 -0
- package/lib/commonjs/network/utils/requestId.js +1 -16
- package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -15
- package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
- package/lib/commonjs/network/utils/startNetworkCapture.js +1 -24
- package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
- package/lib/commonjs/preset.js +1 -93
- package/lib/module/index.js +1 -104
- package/lib/module/index.web.js +1 -82
- package/lib/module/network/components/DataViewer.web.js +1 -875
- package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
- package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
- package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
- package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
- package/lib/module/network/components/NetworkDetailStepper.js +1 -104
- package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
- package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
- package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
- package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
- package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
- package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
- package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
- package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
- package/lib/module/network/components/NetworkHeaderLive.js +1 -366
- package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
- package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
- package/lib/module/network/components/NetworkListScreen.js +1 -399
- package/lib/module/network/components/NetworkListScreen.web.js +1 -622
- package/lib/module/network/components/NetworkModal.js +1 -781
- package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
- package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
- package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
- package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
- package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
- package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
- package/lib/module/network/components/NetworkOverridesButton.js +1 -87
- package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
- package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
- package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
- package/lib/module/network/components/NetworkSavedScreen.js +1 -222
- package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
- package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
- package/lib/module/network/components/response-editor/Explorer.js +1 -972
- package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
- package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
- package/lib/module/network/components/response-editor/editorContext.js +1 -29
- package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
- package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
- package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
- package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
- package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
- package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
- package/lib/module/network/conditions/store.js +1 -65
- package/lib/module/network/conditions/wait.js +1 -38
- package/lib/module/network/conditions/xhr.js +1 -131
- package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
- package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
- package/lib/module/network/hooks/useNetworkEventList.js +1 -104
- package/lib/module/network/hooks/useNetworkEvents.js +1 -314
- package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
- package/lib/module/network/hooks/useNetworkSaved.js +1 -34
- package/lib/module/network/hooks/useNetworkSelection.js +1 -46
- package/lib/module/network/hooks/useOverrideRules.js +1 -32
- package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
- package/lib/module/network/overrides/applyToFetch.js +1 -72
- package/lib/module/network/overrides/applyToXhr.js +2 -502
- package/lib/module/network/overrides/engine.js +1 -85
- package/lib/module/network/overrides/matchRule.js +1 -81
- package/lib/module/network/overrides/overriddenRows.js +1 -33
- package/lib/module/network/overrides/overrideRulesStore.js +1 -547
- package/lib/module/network/overrides/presets.js +1 -65
- package/lib/module/network/overrides/resolveOverride.js +1 -152
- package/lib/module/network/overrides/types.js +1 -86
- package/lib/module/network/sync/networkBodyResolver.js +1 -34
- package/lib/module/network/sync/networkSyncAdapter.js +1 -880
- package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
- package/lib/module/network/types/index.js +1 -3
- package/lib/module/network/utils/extractOperationName.js +1 -76
- package/lib/module/network/utils/filterNetworkEvents.js +1 -92
- package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
- package/lib/module/network/utils/formatting.js +1 -9
- package/lib/module/network/utils/generateCurl.js +2 -67
- package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
- package/lib/module/network/utils/httpCompletion.js +1 -32
- package/lib/module/network/utils/networkEventStore.js +1 -409
- package/lib/module/network/utils/networkListener.js +4 -1341
- package/lib/module/network/utils/networkSavedStore.js +3 -572
- package/lib/module/network/utils/networkSelectionStore.js +1 -188
- package/lib/module/network/utils/realNow.js +1 -0
- package/lib/module/network/utils/requestId.js +1 -12
- package/lib/module/network/utils/resolveRequestUrl.js +1 -11
- package/lib/module/network/utils/selectSavedEvents.js +1 -35
- package/lib/module/network/utils/startNetworkCapture.js +1 -21
- package/lib/module/network/utils/withPinnedFirst.js +1 -28
- package/lib/module/preset.js +1 -91
- package/lib/typescript/network/overrides/engine.d.ts +1 -1
- package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
- package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
- package/lib/typescript/network/overrides/types.d.ts +9 -0
- package/lib/typescript/network/utils/networkListener.d.ts +11 -0
- package/lib/typescript/network/utils/realNow.d.ts +18 -0
- package/lib/web/index.mjs +73 -74
- package/package.json +3 -6
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/index.web.d.ts.map +0 -1
- package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
- package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
- package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
- package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
- package/lib/typescript/network/conditions/store.d.ts.map +0 -1
- package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
- package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
- package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
- package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
- package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
- package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
- package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
- package/lib/typescript/network/overrides/overriddenRows.d.ts.map +0 -1
- package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
- package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
- package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
- package/lib/typescript/network/overrides/types.d.ts.map +0 -1
- package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
- package/lib/typescript/network/types/index.d.ts.map +0 -1
- package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
- package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
- package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
- package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
- package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
- package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
- package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
- package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
- package/lib/typescript/network/utils/requestId.d.ts.map +0 -1
- package/lib/typescript/network/utils/resolveRequestUrl.d.ts.map +0 -1
- package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
- package/lib/typescript/network/utils/startNetworkCapture.d.ts.map +0 -1
- package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
|
@@ -1,1133 +1 @@
|
|
|
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
|
-
};
|
|
1
|
+
"use strict";import{useState as F,useMemo as M,useCallback as W,useRef as j,useEffect as X,memo as E}from"react";import{CopyButton as q}from"../DataViewer.web";import{updateNestedDataByPath as v}from"./updateNestedDataByPath";import{deleteNestedDataByPath as P}from"./deleteNestedDataByPath";import{useResponseEditor as z}from"./editorContext";import{jsx as n,jsxs as p,Fragment as A}from"react/jsx-runtime";const D=100;const ee=12;const e={card:"#1A1A1A",text:"#E0E0E0",textSecondary:"#A0A0A0",textMuted:"#888888",primary:"#20C997",warning:"#FFA94D",error:"#EF4444"};function $({size:r=14,color:i="currentColor",strokeWidth:o=2,children:l}){return n("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:l})}const te=r=>n($,{...r,children:n("path",{d:"m9 18 6-6-6-6"})});const K=r=>n($,{...r,children:n("path",{d:"m6 9 6 6 6-6"})});const ne=r=>n($,{...r,children:n("path",{d:"m18 15-6-6-6 6"})});const G=r=>p($,{...r,children:[n("path",{d:"M3 6h18"}),n("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),n("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]});function oe(r){if(r===void 0)return"undefined";if(typeof r==="bigint")return`${r}n`;if(typeof r==="function")return String(r).slice(0,50);if(typeof r==="symbol")return String(r);try{return JSON.stringify(r)??String(r)}catch{return String(r)}}const re=(r,i=D)=>{if(i<1||r.length===0)return[];const o=[];for(let l=0;l<r.length;l+=i){o.push(r.slice(l,l+i))}return o};const V=E(({expanded:r,isFocused:i=false,isMain:o=false})=>{const l=i?e.primary:o?e.text:e.textSecondary;const y=r?K:te;return n("span",{style:{...t.expanderIcon,...o?t.expanderIconMain:null},children:n(y,{size:o?14:ee,color:l,strokeWidth:2.5})})});V.displayName="Expander";const Q=E(({value:r,isFocused:i=false})=>{return n(q,{value:r,size:14,buttonStyle:i?{...t.buttonStyle,...t.buttonStyleFocused}:t.buttonStyle})});Q.displayName="CopyButton";const H=E(({dataPath:r,isFocused:i=false})=>{const o=z();const l=W(()=>{if(!o)return;o.onChange(P(o.root,r))},[o,r]);if(!o)return null;return n("button",{type:"button",onClick:l,style:{...t.deleteButton,...i?t.deleteButtonFocused:null},"aria-label":"Delete item",children:n(G,{size:14,strokeWidth:2,color:i?e.error:e.error+"CC"})})});H.displayName="DeleteItemButton";const Z=E(({dataPath:r,isFocused:i=false})=>{const o=z();const l=W(()=>{if(!o)return;o.onChange(v(o.root,r,[]))},[o,r]);if(!o)return null;return n("button",{type:"button",style:{...t.clearButton,...i?t.clearButtonFocused:null},"aria-label":"Remove all items",onClick:l,children:n("span",{style:{...t.clearButtonText,color:i?e.warning:e.warning+"CC"},children:"[]"})})});Z.displayName="ClearArrayButton";function ie({dataPath:r,value:i,itemsDeletable:o}){const l=z();const y=W(()=>{if(!l)return;const u=typeof i==="boolean"?i:false;l.onChange(v(l.root,r,!u))},[l,r,i]);const h=W(()=>{if(!l)return;l.onChange(P(l.root,r))},[l,r]);if(!l)return null;const m=i?t.toggleBadgeTrue:t.toggleBadgeFalse;const x=i?t.toggleTextTrue:t.toggleTextFalse;return p("div",{role:"button",tabIndex:0,style:t.modernToggleButton,onClick:y,onKeyDown:u=>{if(u.key==="Enter"||u.key===" ")y()},"aria-label":i?"Set to false":"Set to true",children:[n("span",{style:{...t.toggleBadge,...m},children:n("span",{style:{...t.toggleBadgeText,...x},children:i?"TRUE":"FALSE"})}),o&&n("button",{type:"button",onClick:u=>{u.stopPropagation();h()},style:t.deleteButtonInToggle,"aria-label":"Delete item",children:n(G,{size:14,strokeWidth:2,color:e.error+"CC"})})]})}function le({label:r,value:i,isNumber:o,onChangeText:l,onFocus:y,onBlur:h,showNumberControls:m=false,onIncrement:x,onDecrement:u,showDeleteButton:T=false,onDelete:w,"aria-label":I}){const[g,C]=F(false);const S=k=>({...t.cornerAccent,...k,...g?t.cornerAccentFocused:null});return n("div",{style:t.cyberContainer,children:p("div",{style:t.cyberRow,children:[r?n("span",{style:{...t.cyberLabel,...g?t.cyberLabelFocused:null},children:r.toUpperCase()}):null,p("div",{style:{...t.cyberInputContainer,opacity:g?1:.6,borderColor:g?e.primary:e.textMuted+"4D"},children:[n("input",{value:i,onChange:k=>l(k.target.value),onFocus:()=>{C(true);y?.()},onBlur:()=>{C(false);h?.()},inputMode:o?"decimal":void 0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:false,"aria-label":I??"Data input field for editing values",style:{...t.cyberInput,...o?t.textNumber:t.textString}}),m&&p("span",{style:t.numberControls,children:[n("button",{type:"button",style:{...t.controlButton,...g?t.controlButtonFocused:null},onClick:x,"aria-label":"Increment value",children:n(ne,{size:14,strokeWidth:2.5,color:g?e.primary:e.textMuted})}),n("button",{type:"button",style:{...t.controlButton,...g?t.controlButtonFocused:null},onClick:u,"aria-label":"Decrement value",children:n(K,{size:14,strokeWidth:2.5,color:g?e.primary:e.textMuted})})]}),T&&n("button",{type:"button",style:{...t.cyberDeleteButton,...g?t.cyberDeleteButtonFocused:null},onClick:w,"aria-label":"Delete item",children:n(G,{size:14,strokeWidth:2,color:g?e.error:e.error+"CC"})}),n("span",{style:S({top:-1,left:5})}),n("span",{style:S({top:-1,right:5})}),n("span",{style:S({bottom:-1,left:5})}),n("span",{style:S({bottom:-1,right:5})})]})]})})}export default function O({editable:r,label:i,value:o,defaultExpanded:l,dataPath:y,itemsDeletable:h,dataVersion:m=0}){const x=z();const[u,T]=F(false);const[w,I]=F("");X(()=>{if(o!==null&&o!==void 0&&(typeof o==="string"||typeof o==="number")){const d=o.toString();I(d)}},[o,i,m]);const g=M(()=>{const d=i.toUpperCase();return["DATA","QUERY","QUERYKEY","TYPES","STATS","OPTIONS","OBSERVERS"].includes(d)},[i]);const[C,S]=F((l||[]).includes(i));const k=()=>S(d=>!d);const[L,J]=F([]);const B=M(()=>{if(o===null||o===void 0||typeof o!=="object"){return[]}if(Array.isArray(o)){const a=o.length>1e3?o.slice(0,1e3):o;return a.map((s,f)=>({label:f.toString(),value:s}))}if(o instanceof Map){const a=Array.from(o.entries()).slice(0,1e3);return a.map(([s,f])=>({label:String(s),value:f}))}if(o instanceof Set){const a=Array.from(o).slice(0,1e3);return a.map((s,f)=>({label:f.toString(),value:s}))}const d=Object.entries(o).slice(0,1e3);return d.map(([a,s])=>({label:a,value:s}))},[o]);const c=M(()=>{if(Array.isArray(o))return"array";if(o===null||typeof o!=="object")return typeof o;if(o instanceof Map||o instanceof Set)return"Iterable";return"object"},[o]);const R=M(()=>{return re(B,D)},[B]);const b=y??[];const U=j(x);const _=j(b);const Y=j(c);U.current=x;_.current=b;Y.current=c;const N=W((d,a)=>{I(a);const s=U.current;if(!s)return;if(d&&isNaN(Number(a)))return;const f=Y.current==="number"?Number(a):a;s.onChange(v(s.root,_.current,f))},[I]);return n("div",{style:t.minWidthWrapper,children:p("div",{style:t.fullWidthMarginRight,children:[R.length>0&&p(A,{children:[p("div",{style:{...t.flexRowItemsCenterGap,...g?t.flexRowItemsCenterGapMain:null},children:[p("button",{type:"button",style:t.expanderButton,onClick:k,"aria-expanded":C,children:[n(V,{expanded:C,isFocused:u,isMain:g}),n("span",{style:{...t.labelText,...u?t.labelTextFocused:null,...g?t.labelTextMain:null},children:i}),n("span",{style:t.textGray500,children:`${String(c).toLowerCase()==="iterable"?"(Iterable) ":""}${B.length} ${B.length>1?`items`:`item`}`})]}),r&&p("span",{style:t.flexRowGapItemsCenter,children:[n(Q,{value:o,isFocused:u}),h&&x!==null&&n(H,{dataPath:b,isFocused:u}),c==="array"&&x!==null&&n(Z,{dataPath:b,isFocused:u})]})]}),C&&p(A,{children:[R.length===1&&n("div",{style:{...t.singleEntryContainer,...g?t.singleEntryContainerMain:null},children:B.map((d,a)=>n(O,{defaultExpanded:l,label:d.label,value:d.value,editable:r,dataPath:[...b,d.label],itemsDeletable:c==="array"||c==="Iterable"||c==="object",dataVersion:m},d.label+a))}),R.length>1&&n("div",{style:t.multiEntryContainer,children:R.map((d,a)=>n("div",{children:p("div",{style:t.relativeOutlineNone,children:[p("button",{type:"button",onClick:()=>J(s=>s.includes(a)?s.filter(f=>f!==a):[...s,a]),style:t.pageExpanderButton,"aria-expanded":L.includes(a),children:[n(V,{expanded:L.includes(a)}),p("span",{style:t.pageRangeText,children:["[",a*D,"...",a*D+D-1,"]"]})]}),L.includes(a)&&n("div",{style:t.entriesContainer,children:d.map(s=>n(O,{defaultExpanded:l,label:s.label,value:s.value,editable:r,dataPath:[...b,s.label],dataVersion:m},s.label))})]})},a))})]})]}),R.length===0&&p("div",{style:t.flexRowGapFullWidth,children:[r&&x!==null&&(c==="string"||c==="number"||c==="boolean")?p(A,{children:[r&&x&&(c==="string"||c==="number")&&n("div",{style:t.nebulaInputWrapper,children:n(le,{label:i,value:w,isNumber:c==="number",onChangeText:d=>N(c==="number",d),onFocus:()=>T(true),onBlur:()=>T(false),showNumberControls:c==="number",onIncrement:()=>{const d=Number(w)||0;N(true,String(d+1))},onDecrement:()=>{const d=Number(w)||0;N(true,String(d-1))},showDeleteButton:h,onDelete:()=>{x.onChange(P(x.root,b))}})}),c==="boolean"&&p("div",{style:t.booleanRowContainer,children:[n("span",{style:t.booleanLabel,children:i}),n("div",{style:t.booleanToggleWrapper,children:n(ie,{dataPath:b,value:o,itemsDeletable:h})})]})]}):p(A,{children:[n("span",{style:t.text344054,children:i}),n("span",{style:t.displayValueText,children:oe(o)})]}),r&&h&&x!==null&&c!=="string"&&c!=="number"&&c!=="boolean"&&n(H,{dataPath:b,isFocused:u})]})]})})}const t={buttonStyle:{backgroundColor:e.card+"E6",border:`1px solid ${e.textSecondary}33`,borderRadius:6,display:"inline-flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:28,height:28,boxSizing:"border-box",position:"relative",padding:0},buttonStyleFocused:{border:`1px solid ${e.primary}CC`,backgroundColor:e.primary+"26"},deleteButton:{backgroundColor:e.error+"1A",border:`1px solid ${e.error}4D`,borderRadius:6,padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,boxSizing:"border-box",position:"relative",cursor:"pointer",margin:0,flexShrink:0},deleteButtonFocused:{border:`1px solid ${e.error}CC`,backgroundColor:e.error+"33"},deleteButtonInToggle:{backgroundColor:e.error+"1A",border:`1px solid ${e.error}4D`,borderRadius:6,padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,boxSizing:"border-box",cursor:"pointer",margin:0},clearButton:{backgroundColor:e.warning+"1A",border:`1px solid ${e.warning}4D`,borderRadius:6,display:"inline-flex",flexDirection:"row",padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,boxSizing:"border-box",position:"relative",zIndex:10,cursor:"pointer",margin:0,flexShrink:0},clearButtonFocused:{border:`1px solid ${e.warning}CC`,backgroundColor:e.warning+"33"},clearButtonText:{fontSize:12,fontWeight:700,fontFamily:"ui-monospace, Menlo, monospace"},expanderIcon:{width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",marginRight:1,backgroundColor:e.textSecondary+"14",borderRadius:3,boxSizing:"border-box",flexShrink:0},expanderIconMain:{backgroundColor:e.textSecondary+"1A",width:20,height:20,borderRadius:4,border:`0.5px solid ${e.textSecondary}33`},minWidthWrapper:{minWidth:180,fontSize:11,display:"flex",flexDirection:"row",flexWrap:"wrap",width:"100%",margin:"0.5px 0"},fullWidthMarginRight:{position:"relative",width:"100%",marginRight:1},flexRowItemsCenterGap:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"3px 6px",margin:"1px 0",borderRadius:4,backgroundColor:e.card+"66",border:`0.5px solid ${e.textSecondary}1A`,boxSizing:"border-box"},flexRowItemsCenterGapMain:{backgroundColor:e.card+"E6",border:`1px solid ${e.textSecondary}26`,borderLeft:`2.5px solid ${e.textSecondary}80`,padding:"5px 8px",marginBottom:3},expanderButton:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:"transparent",padding:"1px 2px",gap:6,border:"none",minHeight:24,flex:1,minWidth:0,cursor:"pointer",margin:0,textAlign:"left",font:"inherit"},labelText:{color:e.textSecondary,fontSize:10,fontWeight:600,marginRight:4,fontFamily:"ui-monospace, Menlo, monospace",letterSpacing:.4},labelTextFocused:{color:e.text},labelTextMain:{color:e.text,fontSize:11,fontWeight:700,letterSpacing:.6},textGray500:{color:e.textMuted,fontSize:10,fontWeight:400,fontFamily:"ui-monospace, Menlo, monospace",opacity:.7},pageRangeText:{color:e.textSecondary,fontSize:10,fontWeight:600,fontFamily:"ui-monospace, Menlo, monospace"},flexRowGapItemsCenter:{display:"flex",flexDirection:"row",alignItems:"center",gap:4,paddingLeft:2},singleEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeft:`1.5px solid ${e.textSecondary}40`},singleEntryContainerMain:{borderLeft:`1.5px solid ${e.textSecondary}4D`,marginLeft:4,paddingLeft:10},multiEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeft:`1.5px solid ${e.textSecondary}40`},relativeOutlineNone:{position:"relative"},pageExpanderButton:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:e.card+"66",padding:"3px 6px",gap:6,borderRadius:4,border:`0.5px solid ${e.textSecondary}1A`,marginBottom:2,minHeight:24,cursor:"pointer",margin:"0 0 2px 0",width:"100%",boxSizing:"border-box",textAlign:"left",font:"inherit"},entriesContainer:{marginLeft:2,paddingLeft:8,marginTop:2,borderLeft:`1.5px solid ${e.textSecondary}40`},textNumber:{color:e.text,fontWeight:600,fontFamily:"ui-monospace, Menlo, monospace"},textString:{color:e.text,fontFamily:"ui-monospace, Menlo, monospace"},flexRowGapFullWidth:{display:"flex",flexDirection:"row",width:"100%",alignItems:"center",margin:"1px 0",gap:6,padding:"2px 4px",borderRadius:3,boxSizing:"border-box"},text344054:{color:e.textSecondary,fontWeight:600,fontSize:9,minWidth:50,fontFamily:"ui-monospace, Menlo, monospace",letterSpacing:.4,opacity:.8,flexShrink:0},nebulaInputWrapper:{flex:1,width:"100%",position:"relative",minWidth:0},displayValueText:{flex:1,minWidth:0,color:e.text,fontWeight:400,fontFamily:"ui-monospace, Menlo, monospace",fontSize:12,padding:"6px 10px",borderRadius:6,border:`1px solid ${e.textMuted}66`,minHeight:34,boxSizing:"border-box",overflowWrap:"anywhere"},modernToggleButton:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:6,border:`1px solid ${e.textMuted}99`,padding:"6px 8px",margin:"2px 0",minHeight:34,gap:8,boxSizing:"border-box",cursor:"pointer"},toggleBadge:{marginLeft:6,padding:"3px 6px",borderRadius:4,display:"inline-flex"},toggleBadgeText:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:.8,fontFamily:"ui-monospace, Menlo, monospace"},toggleBadgeTrue:{backgroundColor:e.primary+"1A",border:`1px solid ${e.primary}4D`},toggleBadgeFalse:{backgroundColor:e.textMuted+"1A",border:`1px solid ${e.textMuted}4D`},toggleTextTrue:{color:e.primary,fontWeight:600},toggleTextFalse:{color:e.textSecondary,fontWeight:500},booleanRowContainer:{display:"flex",flexDirection:"row",alignItems:"center",width:"100%",gap:8,padding:"2px 0"},booleanLabel:{color:e.textSecondary,fontSize:10,fontWeight:600,fontFamily:"ui-monospace, Menlo, monospace",letterSpacing:.4,minWidth:60,flexShrink:0},booleanToggleWrapper:{flex:1,minWidth:0},cyberContainer:{width:"100%",margin:"3px 0"},cyberRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:8},cyberLabel:{fontSize:10,fontWeight:600,fontFamily:"ui-monospace, Menlo, monospace",color:e.textMuted,letterSpacing:.5,minWidth:60,flexShrink:0},cyberLabelFocused:{color:e.primary},cyberInputContainer:{flex:1,minWidth:0,borderWidth:1,borderStyle:"solid",borderRadius:6,position:"relative",minHeight:34,display:"flex",flexDirection:"row",alignItems:"center",boxSizing:"border-box"},cyberInput:{flex:1,minWidth:0,padding:"6px 10px",fontSize:12,backgroundColor:"transparent",zIndex:1,border:"none",outline:"none"},numberControls:{display:"inline-flex",flexDirection:"row",gap:2,paddingRight:4,zIndex:2},controlButton:{width:28,height:28,borderRadius:6,border:`1px solid ${e.textMuted}33`,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"none",cursor:"pointer",padding:0,margin:0},controlButtonFocused:{border:`1px solid ${e.primary}CC`},cyberDeleteButton:{width:28,height:28,borderRadius:6,border:`1px solid ${e.error}4D`,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"none",cursor:"pointer",padding:0,marginRight:4,zIndex:2},cyberDeleteButtonFocused:{border:`1px solid ${e.error}CC`},cornerAccent:{position:"absolute",width:6,height:1.2,backgroundColor:e.textMuted+"CC",zIndex:0},cornerAccentFocused:{backgroundColor:e.primary}};
|