@buoy-gg/shared-ui 7.0.4 → 7.0.5
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/colors/index.js +49 -0
- package/lib/commonjs/dataViewer/DataTreeActionBar.js +389 -0
- package/lib/commonjs/dataViewer/DataTreeActionDock.js +222 -0
- package/lib/commonjs/dataViewer/DataViewer.js +18 -3
- package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +227 -28
- package/lib/commonjs/dataViewer/index.js +88 -0
- package/lib/commonjs/dataViewer/jsonOps.js +320 -0
- package/lib/commonjs/dataViewer/lineDiff.js +285 -83
- package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +20 -5
- package/lib/commonjs/dataViewer/treeActions.js +167 -0
- package/lib/commonjs/env/EnvironmentSelector.js +2 -2
- package/lib/commonjs/env/EnvironmentSelectorInline.js +2 -2
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/index.js +79 -3
- package/lib/commonjs/icons/lucide-icons-original-full.js +5 -1
- package/lib/commonjs/icons/lucide-icons.js +59 -2
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/settings/components/BubbleSettingsSection.js +21 -19
- package/lib/commonjs/storage/devToolsStorageKeys.js +6 -3
- package/lib/commonjs/ui/components/Badge.js +2 -0
- package/lib/commonjs/ui/components/CompactRow.js +7 -0
- package/lib/commonjs/ui/components/CopyButton.js +27 -4
- package/lib/commonjs/ui/components/DevToolsCard.js +11 -0
- package/lib/commonjs/ui/components/DynamicFilterView.js +8 -1
- package/lib/commonjs/ui/components/EmptyState.js +12 -5
- package/lib/commonjs/ui/components/ErrorBoundary.js +3 -2
- package/lib/commonjs/ui/components/EventHistoryViewer/EventHistoryViewer.js +63 -11
- package/lib/commonjs/ui/components/ExpandableSection.js +4 -3
- package/lib/commonjs/ui/components/ExpandableSectionHeader.js +2 -1
- package/lib/commonjs/ui/components/FilterViewPattern.js +8 -7
- package/lib/commonjs/ui/components/ListItem.js +7 -5
- package/lib/commonjs/ui/components/PowerToggleButton.js +4 -1
- package/lib/commonjs/ui/components/TabSelector.js +3 -0
- package/lib/commonjs/ui/console/CyberpunkConsoleSection.js +1 -1
- package/lib/commonjs/ui/console/GalaxyButton.js +1 -1
- package/lib/commonjs/ui/gameUI/components/GameUICompactStats.js +2 -2
- package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +28 -6
- package/lib/commonjs/ui/gameUI/constants/macOSDesignSystemColors.js +22 -4
- package/lib/commonjs/utils/index.js +25 -0
- package/lib/commonjs/utils/reloadApp.js +144 -0
- package/lib/module/colors/index.js +21 -0
- package/lib/module/dataViewer/DataTreeActionBar.js +384 -0
- package/lib/module/dataViewer/DataTreeActionDock.js +218 -0
- package/lib/module/dataViewer/DataViewer.js +18 -3
- package/lib/module/dataViewer/VirtualizedDataExplorer.js +228 -30
- package/lib/module/dataViewer/index.js +16 -1
- package/lib/module/dataViewer/jsonOps.js +311 -0
- package/lib/module/dataViewer/lineDiff.js +284 -82
- package/lib/module/dataViewer/tree/TreeDiffViewer.js +20 -5
- package/lib/module/dataViewer/treeActions.js +161 -0
- package/lib/module/env/EnvironmentSelector.js +2 -2
- package/lib/module/env/EnvironmentSelectorInline.js +2 -2
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/index.js +10 -1
- package/lib/module/icons/lucide-icons-original-full.js +5 -1
- package/lib/module/icons/lucide-icons.js +56 -0
- package/lib/module/index.js +4 -0
- package/lib/module/settings/components/BubbleSettingsSection.js +21 -19
- package/lib/module/storage/devToolsStorageKeys.js +6 -3
- package/lib/module/ui/components/Badge.js +2 -0
- package/lib/module/ui/components/CompactRow.js +7 -0
- package/lib/module/ui/components/CopyButton.js +29 -6
- package/lib/module/ui/components/DevToolsCard.js +11 -0
- package/lib/module/ui/components/DynamicFilterView.js +8 -1
- package/lib/module/ui/components/EmptyState.js +12 -5
- package/lib/module/ui/components/ErrorBoundary.js +3 -2
- package/lib/module/ui/components/EventHistoryViewer/EventHistoryViewer.js +63 -11
- package/lib/module/ui/components/ExpandableSection.js +4 -3
- package/lib/module/ui/components/ExpandableSectionHeader.js +2 -1
- package/lib/module/ui/components/FilterViewPattern.js +9 -7
- package/lib/module/ui/components/ListItem.js +7 -5
- package/lib/module/ui/components/PowerToggleButton.js +4 -1
- package/lib/module/ui/components/TabSelector.js +3 -0
- package/lib/module/ui/console/CyberpunkConsoleSection.js +1 -1
- package/lib/module/ui/console/GalaxyButton.js +1 -1
- package/lib/module/ui/gameUI/components/GameUICompactStats.js +2 -2
- package/lib/module/ui/gameUI/constants/gameUIColors.js +27 -6
- package/lib/module/ui/gameUI/constants/macOSDesignSystemColors.js +19 -2
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/reloadApp.js +137 -0
- package/lib/typescript/commonjs/colors/index.d.ts +22 -0
- package/lib/typescript/commonjs/colors/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/DataTreeActionBar.d.ts +53 -0
- package/lib/typescript/commonjs/dataViewer/DataTreeActionBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/DataTreeActionDock.d.ts +33 -0
- package/lib/typescript/commonjs/dataViewer/DataTreeActionDock.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/DataViewer.d.ts +14 -1
- package/lib/typescript/commonjs/dataViewer/DataViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/VirtualizedDataExplorer.d.ts +30 -1
- package/lib/typescript/commonjs/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/__tests__/jsonOps.test.d.ts +19 -0
- package/lib/typescript/commonjs/dataViewer/__tests__/jsonOps.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/index.d.ts +5 -1
- package/lib/typescript/commonjs/dataViewer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/jsonOps.d.ts +124 -0
- package/lib/typescript/commonjs/dataViewer/jsonOps.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/lineDiff.d.ts +27 -0
- package/lib/typescript/commonjs/dataViewer/lineDiff.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts +8 -1
- package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/treeActions.d.ts +83 -0
- package/lib/typescript/commonjs/dataViewer/treeActions.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +6 -1
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/lucide-icons-original-full.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/lucide-icons.d.ts +9 -0
- package/lib/typescript/commonjs/icons/lucide-icons.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/settings/components/BubbleSettingsSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +5 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CopyButton.d.ts +7 -1
- package/lib/typescript/commonjs/ui/components/CopyButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventHistoryViewer/EventHistoryViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventHistoryViewer/types.d.ts +23 -7
- package/lib/typescript/commonjs/ui/components/EventHistoryViewer/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ExpandableSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ExpandableSectionHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FilterViewPattern.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ListItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +36 -30
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/constants/macOSDesignSystemColors.d.ts +5 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/macOSDesignSystemColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/index.d.ts +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/reloadApp.d.ts +68 -0
- package/lib/typescript/commonjs/utils/reloadApp.d.ts.map +1 -0
- package/lib/typescript/module/colors/index.d.ts +22 -0
- package/lib/typescript/module/colors/index.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/DataTreeActionBar.d.ts +53 -0
- package/lib/typescript/module/dataViewer/DataTreeActionBar.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/DataTreeActionDock.d.ts +33 -0
- package/lib/typescript/module/dataViewer/DataTreeActionDock.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/DataViewer.d.ts +14 -1
- package/lib/typescript/module/dataViewer/DataViewer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/VirtualizedDataExplorer.d.ts +30 -1
- package/lib/typescript/module/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/__tests__/jsonOps.test.d.ts +19 -0
- package/lib/typescript/module/dataViewer/__tests__/jsonOps.test.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/index.d.ts +5 -1
- package/lib/typescript/module/dataViewer/index.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/jsonOps.d.ts +124 -0
- package/lib/typescript/module/dataViewer/jsonOps.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/lineDiff.d.ts +27 -0
- package/lib/typescript/module/dataViewer/lineDiff.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts +8 -1
- package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/treeActions.d.ts +83 -0
- package/lib/typescript/module/dataViewer/treeActions.d.ts.map +1 -0
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts +6 -1
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/icons/lucide-icons-original-full.d.ts.map +1 -1
- package/lib/typescript/module/icons/lucide-icons.d.ts +9 -0
- package/lib/typescript/module/icons/lucide-icons.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/settings/components/BubbleSettingsSection.d.ts.map +1 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +5 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CopyButton.d.ts +7 -1
- package/lib/typescript/module/ui/components/CopyButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventHistoryViewer/EventHistoryViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventHistoryViewer/types.d.ts +23 -7
- package/lib/typescript/module/ui/components/EventHistoryViewer/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ExpandableSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ExpandableSectionHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FilterViewPattern.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ListItem.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +36 -30
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/constants/macOSDesignSystemColors.d.ts +5 -0
- package/lib/typescript/module/ui/gameUI/constants/macOSDesignSystemColors.d.ts.map +1 -1
- package/lib/typescript/module/utils/index.d.ts +1 -0
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/reloadApp.d.ts +68 -0
- package/lib/typescript/module/utils/reloadApp.d.ts.map +1 -0
- package/package.json +15 -4
- package/lib/commonjs/icons/ImageOverlayIcon.js +0 -142
- package/lib/module/icons/ImageOverlayIcon.js +0 -137
- package/lib/typescript/commonjs/icons/ImageOverlayIcon.d.ts +0 -14
- package/lib/typescript/commonjs/icons/ImageOverlayIcon.d.ts.map +0 -1
- package/lib/typescript/module/icons/ImageOverlayIcon.d.ts +0 -14
- package/lib/typescript/module/icons/ImageOverlayIcon.d.ts.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "buoyColors", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _gameUIColors.buoyColors;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "dialColors", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _gameUIColors.dialColors;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "gameUIColors", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _gameUIColors.gameUIColors;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "macOSColors", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _macOSDesignSystemColors.macOSColors;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "macOSGameUIColors", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _macOSDesignSystemColors.macOSGameUIColors;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "refreshGameUIColors", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _gameUIColors.refreshGameUIColors;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "refreshMacOSGameUIColors", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _macOSDesignSystemColors.refreshMacOSGameUIColors;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var _macOSDesignSystemColors = require("../ui/gameUI/constants/macOSDesignSystemColors.js");
|
|
49
|
+
var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DataTreeActionBar = DataTreeActionBar;
|
|
7
|
+
exports.DataTreeInlineEditor = DataTreeInlineEditor;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _index = require("../icons/index.js");
|
|
11
|
+
var _index2 = require("../ui/gameUI/index.js");
|
|
12
|
+
var _treeActions = require("./treeActions.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* Footer bar for the data explorer's selected node — the editor's controls.
|
|
16
|
+
*
|
|
17
|
+
* Ports the action strip from the desktop mockup ("Desktop app network dev
|
|
18
|
+
* tools redesign" → Value card footer): the selected node's label and type on
|
|
19
|
+
* the left, its available operations on the right, and a hint line when nothing
|
|
20
|
+
* is selected yet.
|
|
21
|
+
*
|
|
22
|
+
* The controls deliberately do NOT live inside the tree rows. A row is 28px
|
|
23
|
+
* tall and already carries a caret, a key, a value and a copy button, so
|
|
24
|
+
* per-row icon buttons land around 20px — under the touch target a phone needs,
|
|
25
|
+
* and immediately beside the copy button, which makes mis-taps easy. Hosting
|
|
26
|
+
* them in one bar keeps every target full size and in a predictable place.
|
|
27
|
+
*
|
|
28
|
+
* So the split is: the tree owns SELECTION, this bar owns ACTIONS.
|
|
29
|
+
*
|
|
30
|
+
* Nothing here mutates. Each control emits a {@link JsonOp} against the
|
|
31
|
+
* selection's path and the host applies it, so the explorer stays a pure view.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Palette. The explorer renders on the phone's dark modal AND inside the
|
|
36
|
+
* dashboard's light table, so every value is paired rather than hardcoded —
|
|
37
|
+
* the light column is the mockup's own ramp.
|
|
38
|
+
*/
|
|
39
|
+
const T = {
|
|
40
|
+
barBg: _index2.macOSColors.background.card,
|
|
41
|
+
barBorder: _index2.macOSColors.border.default,
|
|
42
|
+
label: _index2.macOSColors.text.primary,
|
|
43
|
+
badgeBg: _index2.macOSColors.background.hover,
|
|
44
|
+
badgeText: _index2.macOSColors.text.secondary,
|
|
45
|
+
hint: _index2.macOSColors.text.muted,
|
|
46
|
+
btnBg: _index2.macOSColors.background.hover,
|
|
47
|
+
btnBorder: _index2.macOSColors.border.default,
|
|
48
|
+
btnText: _index2.macOSColors.text.primary,
|
|
49
|
+
btnIcon: _index2.macOSColors.text.secondary,
|
|
50
|
+
dangerBorder: _index2.macOSColors.semantic.error + "55",
|
|
51
|
+
dangerText: _index2.macOSColors.semantic.error
|
|
52
|
+
};
|
|
53
|
+
const ICON = 13;
|
|
54
|
+
function Button({
|
|
55
|
+
label,
|
|
56
|
+
onPress,
|
|
57
|
+
icon,
|
|
58
|
+
danger,
|
|
59
|
+
iconOnly,
|
|
60
|
+
disabled,
|
|
61
|
+
style
|
|
62
|
+
}) {
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
64
|
+
"sentry-label": "ignore devtools tree action",
|
|
65
|
+
accessibilityLabel: label,
|
|
66
|
+
accessibilityState: {
|
|
67
|
+
disabled: !!disabled
|
|
68
|
+
},
|
|
69
|
+
onPress: disabled ? undefined : onPress,
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
hitSlop: {
|
|
72
|
+
top: 8,
|
|
73
|
+
bottom: 8,
|
|
74
|
+
left: 6,
|
|
75
|
+
right: 6
|
|
76
|
+
},
|
|
77
|
+
style: [styles.button, iconOnly && styles.buttonIconOnly, danger && {
|
|
78
|
+
borderColor: T.dangerBorder
|
|
79
|
+
}, disabled && styles.buttonDisabled, style],
|
|
80
|
+
children: [icon, iconOnly ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
81
|
+
style: [styles.buttonText, danger && {
|
|
82
|
+
color: T.dangerText
|
|
83
|
+
}],
|
|
84
|
+
children: label
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function DataTreeActionBar({
|
|
89
|
+
root,
|
|
90
|
+
selection,
|
|
91
|
+
onEdit,
|
|
92
|
+
onRequestInlineEdit,
|
|
93
|
+
chipStyle
|
|
94
|
+
}) {
|
|
95
|
+
const has = selection != null;
|
|
96
|
+
// The bar's inline editor is a single-line field in a 28px row, so it can't
|
|
97
|
+
// take a container — hence `containersEditable` left off.
|
|
98
|
+
const a = (0, _treeActions.treeActionMap)((0, _treeActions.treeActionsFor)(root, selection));
|
|
99
|
+
const apply = op => op && onEdit(op);
|
|
100
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
101
|
+
style: styles.bar,
|
|
102
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
103
|
+
style: [styles.selectionLabel, !has && styles.selectionLabelEmpty],
|
|
104
|
+
numberOfLines: 1,
|
|
105
|
+
children: has ? (0, _treeActions.breadcrumb)(selection.path) : "Select a row to edit"
|
|
106
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
107
|
+
style: styles.badge,
|
|
108
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
109
|
+
style: styles.badgeText,
|
|
110
|
+
children: has ? (0, _treeActions.typeLabel)(selection.value) : "—"
|
|
111
|
+
})
|
|
112
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
113
|
+
style: styles.actions,
|
|
114
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
115
|
+
label: a.editValue.label,
|
|
116
|
+
disabled: !a.editValue.enabled,
|
|
117
|
+
style: chipStyle,
|
|
118
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Edit3, {
|
|
119
|
+
size: ICON,
|
|
120
|
+
color: T.btnIcon
|
|
121
|
+
}),
|
|
122
|
+
onPress: () => a.editValue.op ? onEdit(a.editValue.op) : onRequestInlineEdit()
|
|
123
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
124
|
+
label: a.add.label,
|
|
125
|
+
disabled: !a.add.enabled,
|
|
126
|
+
style: chipStyle,
|
|
127
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Plus, {
|
|
128
|
+
size: ICON,
|
|
129
|
+
color: T.btnIcon
|
|
130
|
+
}),
|
|
131
|
+
onPress: () => apply(a.add.op)
|
|
132
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
133
|
+
label: a.moveUp.label,
|
|
134
|
+
iconOnly: true,
|
|
135
|
+
disabled: !a.moveUp.enabled,
|
|
136
|
+
style: chipStyle,
|
|
137
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ChevronUp, {
|
|
138
|
+
size: 14,
|
|
139
|
+
color: T.btnIcon
|
|
140
|
+
}),
|
|
141
|
+
onPress: () => apply(a.moveUp.op)
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
143
|
+
label: a.moveDown.label,
|
|
144
|
+
iconOnly: true,
|
|
145
|
+
disabled: !a.moveDown.enabled,
|
|
146
|
+
style: chipStyle,
|
|
147
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ChevronDown, {
|
|
148
|
+
size: 14,
|
|
149
|
+
color: T.btnIcon
|
|
150
|
+
}),
|
|
151
|
+
onPress: () => apply(a.moveDown.op)
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
153
|
+
label: a.duplicate.label,
|
|
154
|
+
disabled: !a.duplicate.enabled,
|
|
155
|
+
style: chipStyle,
|
|
156
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Copy, {
|
|
157
|
+
size: ICON,
|
|
158
|
+
color: T.btnIcon
|
|
159
|
+
}),
|
|
160
|
+
onPress: () => apply(a.duplicate.op)
|
|
161
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
162
|
+
label: a.remove.label,
|
|
163
|
+
danger: true,
|
|
164
|
+
disabled: !a.remove.enabled,
|
|
165
|
+
style: chipStyle,
|
|
166
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Minus, {
|
|
167
|
+
size: ICON,
|
|
168
|
+
color: T.dangerText
|
|
169
|
+
}),
|
|
170
|
+
onPress: () => apply(a.remove.op)
|
|
171
|
+
})]
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The field that replaces a row's value while editing it, per the mockup.
|
|
178
|
+
*
|
|
179
|
+
* Type-preserving by construction rather than by parsing guesswork: the
|
|
180
|
+
* ORIGINAL value's type decides how the draft is read back, so editing a number
|
|
181
|
+
* can only ever produce a number. Booleans skip text entirely — there is
|
|
182
|
+
* nothing to type, so they commit straight from a two-way toggle.
|
|
183
|
+
*/
|
|
184
|
+
function DataTreeInlineEditor({
|
|
185
|
+
value,
|
|
186
|
+
onCommit,
|
|
187
|
+
onCancel
|
|
188
|
+
}) {
|
|
189
|
+
const [draft, setDraft] = (0, _react.useState)(() => value === null || value === undefined ? "" : String(value));
|
|
190
|
+
if (typeof value === "boolean") {
|
|
191
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
192
|
+
style: styles.inlineRow,
|
|
193
|
+
children: [[true, false].map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
194
|
+
accessibilityLabel: `Set ${option}`,
|
|
195
|
+
onPress: () => onCommit(option),
|
|
196
|
+
hitSlop: {
|
|
197
|
+
top: 8,
|
|
198
|
+
bottom: 8,
|
|
199
|
+
left: 6,
|
|
200
|
+
right: 6
|
|
201
|
+
},
|
|
202
|
+
style: [styles.button, value === option && styles.buttonActive],
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
204
|
+
style: styles.buttonText,
|
|
205
|
+
children: String(option)
|
|
206
|
+
})
|
|
207
|
+
}, String(option))), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
208
|
+
accessibilityLabel: "Cancel edit",
|
|
209
|
+
onPress: onCancel,
|
|
210
|
+
hitSlop: {
|
|
211
|
+
top: 8,
|
|
212
|
+
bottom: 8,
|
|
213
|
+
left: 6,
|
|
214
|
+
right: 6
|
|
215
|
+
},
|
|
216
|
+
style: styles.button,
|
|
217
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
218
|
+
style: styles.buttonText,
|
|
219
|
+
children: "Cancel"
|
|
220
|
+
})
|
|
221
|
+
})]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
const isNumber = typeof value === "number";
|
|
225
|
+
const invalid = isNumber && (draft.trim() === "" || Number.isNaN(Number(draft)));
|
|
226
|
+
const commit = () => {
|
|
227
|
+
if (invalid) return;
|
|
228
|
+
onCommit(isNumber ? Number(draft) : draft);
|
|
229
|
+
};
|
|
230
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
231
|
+
style: styles.inlineRow,
|
|
232
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
233
|
+
value: draft,
|
|
234
|
+
onChangeText: setDraft,
|
|
235
|
+
onSubmitEditing: commit,
|
|
236
|
+
autoFocus: true,
|
|
237
|
+
autoCapitalize: "none",
|
|
238
|
+
autoCorrect: false,
|
|
239
|
+
spellCheck: false,
|
|
240
|
+
keyboardType: isNumber ? "numeric" : "default",
|
|
241
|
+
style: [styles.input, invalid && styles.inputInvalid],
|
|
242
|
+
placeholderTextColor: T.hint
|
|
243
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
244
|
+
accessibilityLabel: "Save value",
|
|
245
|
+
onPress: commit,
|
|
246
|
+
hitSlop: {
|
|
247
|
+
top: 8,
|
|
248
|
+
bottom: 8,
|
|
249
|
+
left: 6,
|
|
250
|
+
right: 6
|
|
251
|
+
},
|
|
252
|
+
style: [styles.saveButton, invalid && styles.saveButtonDisabled],
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
254
|
+
style: styles.saveText,
|
|
255
|
+
children: "Save"
|
|
256
|
+
})
|
|
257
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
258
|
+
accessibilityLabel: "Cancel edit",
|
|
259
|
+
onPress: onCancel,
|
|
260
|
+
hitSlop: {
|
|
261
|
+
top: 8,
|
|
262
|
+
bottom: 8,
|
|
263
|
+
left: 6,
|
|
264
|
+
right: 6
|
|
265
|
+
},
|
|
266
|
+
style: styles.button,
|
|
267
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
268
|
+
style: styles.buttonText,
|
|
269
|
+
children: "Cancel"
|
|
270
|
+
})
|
|
271
|
+
})]
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
const styles = _reactNative.StyleSheet.create({
|
|
275
|
+
inlineRow: {
|
|
276
|
+
flex: 1,
|
|
277
|
+
flexDirection: "row",
|
|
278
|
+
alignItems: "center",
|
|
279
|
+
gap: 6
|
|
280
|
+
},
|
|
281
|
+
input: {
|
|
282
|
+
flex: 1,
|
|
283
|
+
minWidth: 0,
|
|
284
|
+
height: 28,
|
|
285
|
+
color: T.label,
|
|
286
|
+
backgroundColor: _index2.macOSColors.background.input,
|
|
287
|
+
borderWidth: 1,
|
|
288
|
+
borderColor: _index2.macOSColors.border.input,
|
|
289
|
+
borderRadius: 7,
|
|
290
|
+
paddingHorizontal: 9,
|
|
291
|
+
paddingVertical: 0,
|
|
292
|
+
fontSize: 12,
|
|
293
|
+
fontFamily: "monospace"
|
|
294
|
+
},
|
|
295
|
+
inputInvalid: {
|
|
296
|
+
borderColor: _index2.macOSColors.semantic.error
|
|
297
|
+
},
|
|
298
|
+
saveButton: {
|
|
299
|
+
height: 28,
|
|
300
|
+
justifyContent: "center",
|
|
301
|
+
paddingHorizontal: 10,
|
|
302
|
+
borderRadius: 7,
|
|
303
|
+
backgroundColor: _index2.macOSColors.semantic.success
|
|
304
|
+
},
|
|
305
|
+
saveButtonDisabled: {
|
|
306
|
+
opacity: 0.4
|
|
307
|
+
},
|
|
308
|
+
saveText: {
|
|
309
|
+
color: _index2.macOSColors.background.base,
|
|
310
|
+
fontSize: 12,
|
|
311
|
+
fontWeight: "600"
|
|
312
|
+
},
|
|
313
|
+
buttonActive: {
|
|
314
|
+
borderColor: _index2.macOSColors.semantic.success
|
|
315
|
+
},
|
|
316
|
+
bar: {
|
|
317
|
+
flexDirection: "row",
|
|
318
|
+
flexWrap: "wrap",
|
|
319
|
+
alignItems: "center",
|
|
320
|
+
gap: 8,
|
|
321
|
+
paddingHorizontal: 12,
|
|
322
|
+
paddingVertical: 9,
|
|
323
|
+
borderTopWidth: 1,
|
|
324
|
+
borderTopColor: T.barBorder,
|
|
325
|
+
backgroundColor: T.barBg
|
|
326
|
+
},
|
|
327
|
+
actions: {
|
|
328
|
+
flexDirection: "row",
|
|
329
|
+
flexWrap: "wrap",
|
|
330
|
+
alignItems: "center",
|
|
331
|
+
gap: 6,
|
|
332
|
+
marginLeft: "auto"
|
|
333
|
+
},
|
|
334
|
+
selectionLabelEmpty: {
|
|
335
|
+
color: T.hint,
|
|
336
|
+
fontWeight: "400"
|
|
337
|
+
},
|
|
338
|
+
selectionLabel: {
|
|
339
|
+
color: T.label,
|
|
340
|
+
fontSize: 12,
|
|
341
|
+
fontWeight: "600",
|
|
342
|
+
fontFamily: "monospace",
|
|
343
|
+
flexShrink: 1
|
|
344
|
+
},
|
|
345
|
+
badge: {
|
|
346
|
+
paddingHorizontal: 7,
|
|
347
|
+
paddingVertical: 1,
|
|
348
|
+
borderRadius: 5,
|
|
349
|
+
backgroundColor: T.badgeBg
|
|
350
|
+
},
|
|
351
|
+
badgeText: {
|
|
352
|
+
color: T.badgeText,
|
|
353
|
+
fontSize: 11,
|
|
354
|
+
fontWeight: "600"
|
|
355
|
+
},
|
|
356
|
+
button: {
|
|
357
|
+
flexDirection: "row",
|
|
358
|
+
alignItems: "center",
|
|
359
|
+
gap: 6,
|
|
360
|
+
// Sized for a finger, not just a cursor — this bar is shared with the phone.
|
|
361
|
+
minHeight: 32,
|
|
362
|
+
paddingHorizontal: 11,
|
|
363
|
+
borderRadius: 8,
|
|
364
|
+
borderWidth: 1,
|
|
365
|
+
borderColor: T.btnBorder,
|
|
366
|
+
backgroundColor: T.btnBg
|
|
367
|
+
},
|
|
368
|
+
buttonDisabled: {
|
|
369
|
+
// Dimmed, not removed. An action that vanishes when it stops applying
|
|
370
|
+
// reflows every other control — so moving the selection between siblings
|
|
371
|
+
// would shuffle the buttons under the user's finger.
|
|
372
|
+
opacity: 0.35
|
|
373
|
+
},
|
|
374
|
+
buttonIconOnly: {
|
|
375
|
+
paddingHorizontal: 0,
|
|
376
|
+
width: 32,
|
|
377
|
+
justifyContent: "center"
|
|
378
|
+
},
|
|
379
|
+
buttonText: {
|
|
380
|
+
color: T.btnText,
|
|
381
|
+
fontSize: 12,
|
|
382
|
+
fontWeight: "600"
|
|
383
|
+
},
|
|
384
|
+
hint: {
|
|
385
|
+
color: T.hint,
|
|
386
|
+
fontSize: 12,
|
|
387
|
+
flexShrink: 1
|
|
388
|
+
}
|
|
389
|
+
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DataTreeActionDock = DataTreeActionDock;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _index = require("../icons/index.js");
|
|
9
|
+
var _index2 = require("../ui/gameUI/index.js");
|
|
10
|
+
var _treeActions = require("./treeActions.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* The phone's edit controls — a fixed grid of six thumb-sized tiles, docked
|
|
14
|
+
* under a full-screen tree.
|
|
15
|
+
*
|
|
16
|
+
* The dashboard renders the same six actions as {@link DataTreeActionBar}: a
|
|
17
|
+
* row of small chips, which is right beside a cursor and wrong under a thumb.
|
|
18
|
+
* Both read their list from `treeActionsFor`, so what's legal can't drift
|
|
19
|
+
* between them — only the shape does.
|
|
20
|
+
*
|
|
21
|
+
* Two tiles per row of three, always in the same slots, disabled rather than
|
|
22
|
+
* hidden. See `treeActionsFor` for why the list is fixed-length.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const T = {
|
|
26
|
+
dockBg: _index2.macOSColors.background.card,
|
|
27
|
+
dockBorder: _index2.macOSColors.border.default,
|
|
28
|
+
tileBg: _index2.macOSColors.background.hover,
|
|
29
|
+
tileBorder: _index2.macOSColors.border.default,
|
|
30
|
+
tileText: _index2.macOSColors.text.primary,
|
|
31
|
+
tileIcon: _index2.macOSColors.text.secondary,
|
|
32
|
+
hint: _index2.macOSColors.text.muted,
|
|
33
|
+
label: _index2.macOSColors.text.primary,
|
|
34
|
+
badgeBg: _index2.macOSColors.background.hover,
|
|
35
|
+
badgeText: _index2.macOSColors.text.secondary,
|
|
36
|
+
dangerBorder: _index2.macOSColors.semantic.error + "55",
|
|
37
|
+
dangerText: _index2.macOSColors.semantic.error
|
|
38
|
+
};
|
|
39
|
+
const ICON = 16;
|
|
40
|
+
|
|
41
|
+
/** Icons live with the renderer, not the action list — see `treeActions`. */
|
|
42
|
+
function iconFor(id, color) {
|
|
43
|
+
switch (id) {
|
|
44
|
+
case "editValue":
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Edit3, {
|
|
46
|
+
size: ICON,
|
|
47
|
+
color: color
|
|
48
|
+
});
|
|
49
|
+
case "add":
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Plus, {
|
|
51
|
+
size: ICON,
|
|
52
|
+
color: color
|
|
53
|
+
});
|
|
54
|
+
case "duplicate":
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Copy, {
|
|
56
|
+
size: ICON,
|
|
57
|
+
color: color
|
|
58
|
+
});
|
|
59
|
+
case "moveUp":
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ChevronUp, {
|
|
61
|
+
size: ICON + 2,
|
|
62
|
+
color: color
|
|
63
|
+
});
|
|
64
|
+
case "moveDown":
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ChevronDown, {
|
|
66
|
+
size: ICON + 2,
|
|
67
|
+
color: color
|
|
68
|
+
});
|
|
69
|
+
case "remove":
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Minus, {
|
|
71
|
+
size: ICON,
|
|
72
|
+
color: color
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function Tile({
|
|
77
|
+
action,
|
|
78
|
+
onPress
|
|
79
|
+
}) {
|
|
80
|
+
const {
|
|
81
|
+
enabled,
|
|
82
|
+
danger,
|
|
83
|
+
label,
|
|
84
|
+
id
|
|
85
|
+
} = action;
|
|
86
|
+
const color = danger && enabled ? T.dangerText : T.tileIcon;
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
88
|
+
"sentry-label": "ignore devtools tree action",
|
|
89
|
+
accessibilityLabel: label,
|
|
90
|
+
accessibilityState: {
|
|
91
|
+
disabled: !enabled
|
|
92
|
+
},
|
|
93
|
+
disabled: !enabled,
|
|
94
|
+
onPress: enabled ? onPress : undefined,
|
|
95
|
+
style: [styles.tile, danger && enabled && {
|
|
96
|
+
borderColor: T.dangerBorder
|
|
97
|
+
}, !enabled && styles.tileDisabled],
|
|
98
|
+
children: [iconFor(id, color), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
99
|
+
style: [styles.tileText, danger && enabled && {
|
|
100
|
+
color: T.dangerText
|
|
101
|
+
}],
|
|
102
|
+
numberOfLines: 1,
|
|
103
|
+
children: label
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function DataTreeActionDock({
|
|
108
|
+
root,
|
|
109
|
+
selection,
|
|
110
|
+
onEdit,
|
|
111
|
+
onSelectPath,
|
|
112
|
+
onEditValue,
|
|
113
|
+
containersEditable = true
|
|
114
|
+
}) {
|
|
115
|
+
const actions = (0, _treeActions.treeActionsFor)(root, selection, {
|
|
116
|
+
containersEditable
|
|
117
|
+
});
|
|
118
|
+
const has = selection != null;
|
|
119
|
+
const run = action => {
|
|
120
|
+
// No op means the host has to ask the user something — today that's only
|
|
121
|
+
// "edit this value". A boolean arrives here WITH an op and so just flips.
|
|
122
|
+
if (!action.op) {
|
|
123
|
+
onEditValue();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
onEdit(action.op);
|
|
127
|
+
// Ops that CREATE a node say where it landed; the ones that move or delete
|
|
128
|
+
// one are handled by `selectionPathAfterOp` inside the host's draft.
|
|
129
|
+
if (action.selectAfter) onSelectPath(action.selectAfter);
|
|
130
|
+
};
|
|
131
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
132
|
+
style: styles.dock,
|
|
133
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
134
|
+
style: styles.header,
|
|
135
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
136
|
+
style: [styles.selectionLabel, !has && styles.selectionLabelEmpty],
|
|
137
|
+
numberOfLines: 1,
|
|
138
|
+
children: has ? (0, _treeActions.breadcrumb)(selection.path) : "Tap a row to select it"
|
|
139
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
140
|
+
style: styles.badge,
|
|
141
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
142
|
+
style: styles.badgeText,
|
|
143
|
+
children: has ? (0, _treeActions.typeLabel)(selection.value) : "—"
|
|
144
|
+
})
|
|
145
|
+
})]
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
147
|
+
style: styles.grid,
|
|
148
|
+
children: actions.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tile, {
|
|
149
|
+
action: action,
|
|
150
|
+
onPress: () => run(action)
|
|
151
|
+
}, action.id))
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const styles = _reactNative.StyleSheet.create({
|
|
156
|
+
dock: {
|
|
157
|
+
borderTopWidth: 1,
|
|
158
|
+
borderTopColor: T.dockBorder,
|
|
159
|
+
backgroundColor: T.dockBg,
|
|
160
|
+
paddingHorizontal: 10,
|
|
161
|
+
paddingTop: 8,
|
|
162
|
+
paddingBottom: 10,
|
|
163
|
+
gap: 8
|
|
164
|
+
},
|
|
165
|
+
header: {
|
|
166
|
+
flexDirection: "row",
|
|
167
|
+
alignItems: "center",
|
|
168
|
+
gap: 8,
|
|
169
|
+
paddingHorizontal: 2
|
|
170
|
+
},
|
|
171
|
+
selectionLabel: {
|
|
172
|
+
flex: 1,
|
|
173
|
+
color: T.label,
|
|
174
|
+
fontSize: 12,
|
|
175
|
+
fontWeight: "600",
|
|
176
|
+
fontFamily: "monospace"
|
|
177
|
+
},
|
|
178
|
+
selectionLabelEmpty: {
|
|
179
|
+
color: T.hint,
|
|
180
|
+
fontWeight: "400"
|
|
181
|
+
},
|
|
182
|
+
badge: {
|
|
183
|
+
paddingHorizontal: 7,
|
|
184
|
+
paddingVertical: 1,
|
|
185
|
+
borderRadius: 5,
|
|
186
|
+
backgroundColor: T.badgeBg
|
|
187
|
+
},
|
|
188
|
+
badgeText: {
|
|
189
|
+
color: T.badgeText,
|
|
190
|
+
fontSize: 11,
|
|
191
|
+
fontWeight: "600"
|
|
192
|
+
},
|
|
193
|
+
grid: {
|
|
194
|
+
flexDirection: "row",
|
|
195
|
+
flexWrap: "wrap",
|
|
196
|
+
gap: 8
|
|
197
|
+
},
|
|
198
|
+
tile: {
|
|
199
|
+
// Three per row, sized off the gaps rather than a fixed width so the grid
|
|
200
|
+
// survives a narrow phone and a tablet split view alike.
|
|
201
|
+
flexBasis: "31%",
|
|
202
|
+
flexGrow: 1,
|
|
203
|
+
minHeight: 54,
|
|
204
|
+
alignItems: "center",
|
|
205
|
+
justifyContent: "center",
|
|
206
|
+
gap: 3,
|
|
207
|
+
paddingHorizontal: 6,
|
|
208
|
+
borderRadius: 10,
|
|
209
|
+
borderWidth: 1,
|
|
210
|
+
borderColor: T.tileBorder,
|
|
211
|
+
backgroundColor: T.tileBg
|
|
212
|
+
},
|
|
213
|
+
tileDisabled: {
|
|
214
|
+
// Dimmed, not removed — see `treeActionsFor`.
|
|
215
|
+
opacity: 0.35
|
|
216
|
+
},
|
|
217
|
+
tileText: {
|
|
218
|
+
color: T.tileText,
|
|
219
|
+
fontSize: 11,
|
|
220
|
+
fontWeight: "600"
|
|
221
|
+
}
|
|
222
|
+
});
|
|
@@ -26,7 +26,12 @@ const DataViewer = ({
|
|
|
26
26
|
rawMode = true,
|
|
27
27
|
showTypeFilter = true,
|
|
28
28
|
initialExpanded = false,
|
|
29
|
-
disableCopy = false
|
|
29
|
+
disableCopy = false,
|
|
30
|
+
onSelectionChange,
|
|
31
|
+
onRequestInlineEdit,
|
|
32
|
+
inlineEditPath,
|
|
33
|
+
renderInlineEditor,
|
|
34
|
+
selectPath
|
|
30
35
|
}) => {
|
|
31
36
|
const [activeFilter, setActiveFilter] = (0, _react.useState)(null);
|
|
32
37
|
|
|
@@ -95,7 +100,12 @@ const DataViewer = ({
|
|
|
95
100
|
|
|
96
101
|
// Render content based on filter state
|
|
97
102
|
const renderContent = () => {
|
|
98
|
-
// Show filtered results if filter is active
|
|
103
|
+
// Show filtered results if filter is active.
|
|
104
|
+
//
|
|
105
|
+
// Selection is deliberately NOT forwarded here: the filtered view is a
|
|
106
|
+
// DERIVED object, so its row paths address that projection rather than the
|
|
107
|
+
// real document. An op built from one would edit an unrelated node —
|
|
108
|
+
// silently, and with a plausible-looking result.
|
|
99
109
|
if (activeFilter && getFilteredData) {
|
|
100
110
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VirtualizedDataExplorer.VirtualizedDataExplorer, {
|
|
101
111
|
title: `${activeFilter} values`,
|
|
@@ -114,7 +124,12 @@ const DataViewer = ({
|
|
|
114
124
|
maxDepth: maxDepth,
|
|
115
125
|
rawMode: rawMode,
|
|
116
126
|
initialExpanded: initialExpanded,
|
|
117
|
-
disableCopy: disableCopy
|
|
127
|
+
disableCopy: disableCopy,
|
|
128
|
+
onSelectionChange: onSelectionChange,
|
|
129
|
+
onRequestInlineEdit: onRequestInlineEdit,
|
|
130
|
+
inlineEditPath: inlineEditPath,
|
|
131
|
+
renderInlineEditor: renderInlineEditor,
|
|
132
|
+
selectPath: selectPath
|
|
118
133
|
});
|
|
119
134
|
};
|
|
120
135
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|