react-native-element-inspector 0.1.0
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/LICENSE +21 -0
- package/README.md +134 -0
- package/lib/ElementCycler.d.ts +14 -0
- package/lib/ElementCycler.d.ts.map +1 -0
- package/lib/ElementCycler.js +33 -0
- package/lib/ElementCycler.js.map +1 -0
- package/lib/ElementHighlighter.d.ts +21 -0
- package/lib/ElementHighlighter.d.ts.map +1 -0
- package/lib/ElementHighlighter.js +89 -0
- package/lib/ElementHighlighter.js.map +1 -0
- package/lib/ElementInspector.d.ts +12 -0
- package/lib/ElementInspector.d.ts.map +1 -0
- package/lib/ElementInspector.js +74 -0
- package/lib/ElementInspector.js.map +1 -0
- package/lib/components/Checkbox.d.ts +7 -0
- package/lib/components/Checkbox.d.ts.map +1 -0
- package/lib/components/Checkbox.js +30 -0
- package/lib/components/Checkbox.js.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +2 -0
- package/lib/components/index.js.map +1 -0
- package/lib/constants/colors.d.ts +24 -0
- package/lib/constants/colors.d.ts.map +1 -0
- package/lib/constants/colors.js +18 -0
- package/lib/constants/colors.js.map +1 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/index.d.ts.map +1 -0
- package/lib/constants/index.js +3 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/constants/ui.d.ts +56 -0
- package/lib/constants/ui.d.ts.map +1 -0
- package/lib/constants/ui.js +46 -0
- package/lib/constants/ui.js.map +1 -0
- package/lib/fiber/FiberAdapter.d.ts +52 -0
- package/lib/fiber/FiberAdapter.d.ts.map +1 -0
- package/lib/fiber/FiberAdapter.js +112 -0
- package/lib/fiber/FiberAdapter.js.map +1 -0
- package/lib/fiber/detectVersion.d.ts +9 -0
- package/lib/fiber/detectVersion.d.ts.map +1 -0
- package/lib/fiber/detectVersion.js +17 -0
- package/lib/fiber/detectVersion.js.map +1 -0
- package/lib/fiber/index.d.ts +5 -0
- package/lib/fiber/index.d.ts.map +1 -0
- package/lib/fiber/index.js +4 -0
- package/lib/fiber/index.js.map +1 -0
- package/lib/fiber/types.d.ts +35 -0
- package/lib/fiber/types.d.ts.map +1 -0
- package/lib/fiber/types.js +3 -0
- package/lib/fiber/types.js.map +1 -0
- package/lib/floatingPanel/AddPropertyRow.d.ts +13 -0
- package/lib/floatingPanel/AddPropertyRow.d.ts.map +1 -0
- package/lib/floatingPanel/AddPropertyRow.js +61 -0
- package/lib/floatingPanel/AddPropertyRow.js.map +1 -0
- package/lib/floatingPanel/CloseButton.d.ts +7 -0
- package/lib/floatingPanel/CloseButton.d.ts.map +1 -0
- package/lib/floatingPanel/CloseButton.js +21 -0
- package/lib/floatingPanel/CloseButton.js.map +1 -0
- package/lib/floatingPanel/EditableValue.d.ts +12 -0
- package/lib/floatingPanel/EditableValue.d.ts.map +1 -0
- package/lib/floatingPanel/EditableValue.js +67 -0
- package/lib/floatingPanel/EditableValue.js.map +1 -0
- package/lib/floatingPanel/FloatingPanel.d.ts +7 -0
- package/lib/floatingPanel/FloatingPanel.d.ts.map +1 -0
- package/lib/floatingPanel/FloatingPanel.js +70 -0
- package/lib/floatingPanel/FloatingPanel.js.map +1 -0
- package/lib/floatingPanel/HandleContent.d.ts +7 -0
- package/lib/floatingPanel/HandleContent.d.ts.map +1 -0
- package/lib/floatingPanel/HandleContent.js +35 -0
- package/lib/floatingPanel/HandleContent.js.map +1 -0
- package/lib/floatingPanel/InspectorBubble.d.ts +6 -0
- package/lib/floatingPanel/InspectorBubble.d.ts.map +1 -0
- package/lib/floatingPanel/InspectorBubble.js +91 -0
- package/lib/floatingPanel/InspectorBubble.js.map +1 -0
- package/lib/floatingPanel/PanelBody.d.ts +8 -0
- package/lib/floatingPanel/PanelBody.d.ts.map +1 -0
- package/lib/floatingPanel/PanelBody.js +72 -0
- package/lib/floatingPanel/PanelBody.js.map +1 -0
- package/lib/floatingPanel/PanelFooter.d.ts +9 -0
- package/lib/floatingPanel/PanelFooter.d.ts.map +1 -0
- package/lib/floatingPanel/PanelFooter.js +21 -0
- package/lib/floatingPanel/PanelFooter.js.map +1 -0
- package/lib/floatingPanel/PanelHeader.d.ts +13 -0
- package/lib/floatingPanel/PanelHeader.d.ts.map +1 -0
- package/lib/floatingPanel/PanelHeader.js +56 -0
- package/lib/floatingPanel/PanelHeader.js.map +1 -0
- package/lib/floatingPanel/index.d.ts +12 -0
- package/lib/floatingPanel/index.d.ts.map +1 -0
- package/lib/floatingPanel/index.js +11 -0
- package/lib/floatingPanel/index.js.map +1 -0
- package/lib/floatingPanel/panelUtils.d.ts +3 -0
- package/lib/floatingPanel/panelUtils.d.ts.map +1 -0
- package/lib/floatingPanel/panelUtils.js +12 -0
- package/lib/floatingPanel/panelUtils.js.map +1 -0
- package/lib/floatingPanel/types.d.ts +23 -0
- package/lib/floatingPanel/types.d.ts.map +1 -0
- package/lib/floatingPanel/types.js +2 -0
- package/lib/floatingPanel/types.js.map +1 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +8 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useDebouncedCallback.d.ts +2 -0
- package/lib/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/lib/hooks/useDebouncedCallback.js +12 -0
- package/lib/hooks/useDebouncedCallback.js.map +1 -0
- package/lib/hooks/useDebouncedValue.d.ts +2 -0
- package/lib/hooks/useDebouncedValue.d.ts.map +1 -0
- package/lib/hooks/useDebouncedValue.js +10 -0
- package/lib/hooks/useDebouncedValue.js.map +1 -0
- package/lib/hooks/useFloatingPanel.d.ts +14 -0
- package/lib/hooks/useFloatingPanel.d.ts.map +1 -0
- package/lib/hooks/useFloatingPanel.js +132 -0
- package/lib/hooks/useFloatingPanel.js.map +1 -0
- package/lib/hooks/useLayoutSnapshot.d.ts +14 -0
- package/lib/hooks/useLayoutSnapshot.d.ts.map +1 -0
- package/lib/hooks/useLayoutSnapshot.js +39 -0
- package/lib/hooks/useLayoutSnapshot.js.map +1 -0
- package/lib/hooks/useStyleMutation.d.ts +14 -0
- package/lib/hooks/useStyleMutation.d.ts.map +1 -0
- package/lib/hooks/useStyleMutation.js +22 -0
- package/lib/hooks/useStyleMutation.js.map +1 -0
- package/lib/hooks/useStyleOverrides.d.ts +24 -0
- package/lib/hooks/useStyleOverrides.d.ts.map +1 -0
- package/lib/hooks/useStyleOverrides.js +165 -0
- package/lib/hooks/useStyleOverrides.js.map +1 -0
- package/lib/hooks/useTapToSelect.d.ts +20 -0
- package/lib/hooks/useTapToSelect.d.ts.map +1 -0
- package/lib/hooks/useTapToSelect.js +58 -0
- package/lib/hooks/useTapToSelect.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/clamp.d.ts +2 -0
- package/lib/utils/clamp.d.ts.map +1 -0
- package/lib/utils/clamp.js +2 -0
- package/lib/utils/clamp.js.map +1 -0
- package/lib/utils/flattenStyles.d.ts +6 -0
- package/lib/utils/flattenStyles.d.ts.map +1 -0
- package/lib/utils/flattenStyles.js +11 -0
- package/lib/utils/flattenStyles.js.map +1 -0
- package/lib/utils/hitTest.d.ts +7 -0
- package/lib/utils/hitTest.d.ts.map +1 -0
- package/lib/utils/hitTest.js +20 -0
- package/lib/utils/hitTest.js.map +1 -0
- package/lib/utils/index.d.ts +12 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +9 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/layoutSnapshot.d.ts +7 -0
- package/lib/utils/layoutSnapshot.d.ts.map +1 -0
- package/lib/utils/layoutSnapshot.js +42 -0
- package/lib/utils/layoutSnapshot.js.map +1 -0
- package/lib/utils/sourceMapping.d.ts +26 -0
- package/lib/utils/sourceMapping.d.ts.map +1 -0
- package/lib/utils/sourceMapping.js +53 -0
- package/lib/utils/sourceMapping.js.map +1 -0
- package/lib/utils/styleFormatting.d.ts +5 -0
- package/lib/utils/styleFormatting.d.ts.map +1 -0
- package/lib/utils/styleFormatting.js +38 -0
- package/lib/utils/styleFormatting.js.map +1 -0
- package/lib/utils/styleInputParsing.d.ts +5 -0
- package/lib/utils/styleInputParsing.d.ts.map +1 -0
- package/lib/utils/styleInputParsing.js +33 -0
- package/lib/utils/styleInputParsing.js.map +1 -0
- package/lib/utils/yogaLayout.d.ts +33 -0
- package/lib/utils/yogaLayout.d.ts.map +1 -0
- package/lib/utils/yogaLayout.js +33 -0
- package/lib/utils/yogaLayout.js.map +1 -0
- package/package.json +74 -0
- package/src/ElementCycler.tsx +64 -0
- package/src/ElementHighlighter.tsx +122 -0
- package/src/ElementInspector.tsx +119 -0
- package/src/components/Checkbox.tsx +41 -0
- package/src/components/index.ts +1 -0
- package/src/constants/colors.ts +18 -0
- package/src/constants/index.ts +9 -0
- package/src/constants/ui.ts +51 -0
- package/src/fiber/FiberAdapter.ts +153 -0
- package/src/fiber/detectVersion.ts +19 -0
- package/src/fiber/index.ts +4 -0
- package/src/fiber/types.ts +36 -0
- package/src/floatingPanel/AddPropertyRow.tsx +102 -0
- package/src/floatingPanel/CloseButton.tsx +34 -0
- package/src/floatingPanel/EditableValue.tsx +109 -0
- package/src/floatingPanel/FloatingPanel.tsx +114 -0
- package/src/floatingPanel/HandleContent.tsx +45 -0
- package/src/floatingPanel/InspectorBubble.tsx +121 -0
- package/src/floatingPanel/PanelBody.tsx +162 -0
- package/src/floatingPanel/PanelFooter.tsx +36 -0
- package/src/floatingPanel/PanelHeader.tsx +111 -0
- package/src/floatingPanel/index.ts +11 -0
- package/src/floatingPanel/panelUtils.ts +13 -0
- package/src/floatingPanel/types.ts +26 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useDebouncedCallback.ts +18 -0
- package/src/hooks/useDebouncedValue.ts +12 -0
- package/src/hooks/useFloatingPanel.ts +191 -0
- package/src/hooks/useLayoutSnapshot.ts +42 -0
- package/src/hooks/useStyleMutation.ts +31 -0
- package/src/hooks/useStyleOverrides.ts +176 -0
- package/src/hooks/useTapToSelect.ts +76 -0
- package/src/index.ts +2 -0
- package/src/utils/clamp.ts +2 -0
- package/src/utils/flattenStyles.ts +12 -0
- package/src/utils/hitTest.ts +29 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/layoutSnapshot.ts +48 -0
- package/src/utils/sourceMapping.ts +67 -0
- package/src/utils/styleFormatting.ts +34 -0
- package/src/utils/styleInputParsing.ts +33 -0
- package/src/utils/yogaLayout.ts +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mohamed Abdinasir
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# react-native-element-inspector
|
|
2
|
+
|
|
3
|
+
On-device element inspector for React Native. The "Inspect Element" experience for mobile.
|
|
4
|
+
|
|
5
|
+
Tap any element in your app to see its styles, edit them live, toggle properties on and off, and add new ones - all from a draggable floating panel. Zero external dependencies, pure React Native.
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="assets/screenshot.png" alt="Inspecting nested styles" width="270" />
|
|
9
|
+
|
|
10
|
+
<img src="assets/screenshot-add-property.png" alt="Adding a new property" width="270" />
|
|
11
|
+
|
|
12
|
+
<img src="assets/screenshot-edit.png" alt="Editing a value inline" width="270" />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Tap to select** - tap any element to inspect it. Overlapping elements are sorted smallest-first so you always get the one you meant
|
|
18
|
+
- **Floating bubble** - a draggable radar-sweep bubble that snaps to screen edges, built with PanResponder + Animated
|
|
19
|
+
- **Inspector panel** - expands into a scrollable list of every style property on the selected element
|
|
20
|
+
- **Live editing** - tap any value (or key) to edit it inline. Changes apply instantly via React's reconciler
|
|
21
|
+
- **Property toggling** - checkbox next to each property to disable/enable it without deleting
|
|
22
|
+
- **Add properties** - "+ add property" button at the bottom for adding new style properties on the fly
|
|
23
|
+
- **Color swatches** - visual color preview next to color properties
|
|
24
|
+
- **Element cycling** - cycle through overlapping elements at the same tap point
|
|
25
|
+
- **Box model highlight** - Chrome DevTools-style overlay showing margin, padding, and content areas
|
|
26
|
+
- **Source mapping** - displays component name and source file location
|
|
27
|
+
- **React 18 & 19** - version-aware fiber adapters for both React versions
|
|
28
|
+
- **Old Architecture & Fabric** - works on both via `overrideProps()`
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install react-native-element-inspector
|
|
34
|
+
# or
|
|
35
|
+
yarn add react-native-element-inspector
|
|
36
|
+
# or
|
|
37
|
+
bun add react-native-element-inspector
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Peer dependencies
|
|
41
|
+
|
|
42
|
+
- `react >= 18.0.0`
|
|
43
|
+
- `react-native >= 0.72.0`
|
|
44
|
+
|
|
45
|
+
No native modules, no linking, no pod install. It's pure TypeScript.
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
Wrap your root component with `<ElementInspector>`:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { ElementInspector } from 'react-native-element-inspector';
|
|
53
|
+
|
|
54
|
+
const App = () => (
|
|
55
|
+
<ElementInspector enabled={__DEV__}>
|
|
56
|
+
<NavigationContainer>
|
|
57
|
+
{/* your app */}
|
|
58
|
+
</NavigationContainer>
|
|
59
|
+
</ElementInspector>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
export default App;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
That's it. A floating bubble appears in dev mode. Tap it to enter inspect mode, then tap any element.
|
|
66
|
+
|
|
67
|
+
## Usage with Expo
|
|
68
|
+
|
|
69
|
+
Works out of the box with Expo - no config plugins or native code needed:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { ElementInspector } from 'react-native-element-inspector';
|
|
73
|
+
|
|
74
|
+
const App = () => (
|
|
75
|
+
<ElementInspector enabled={__DEV__}>
|
|
76
|
+
<View style={styles.container}>
|
|
77
|
+
<Text style={styles.title}>Hello World</Text>
|
|
78
|
+
</View>
|
|
79
|
+
</ElementInspector>
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
export default App;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Usage with React Navigation
|
|
86
|
+
|
|
87
|
+
Wrap your entire navigation tree so every screen is inspectable:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { NavigationContainer } from '@react-navigation/native';
|
|
91
|
+
import { ElementInspector } from 'react-native-element-inspector';
|
|
92
|
+
|
|
93
|
+
const App = () => (
|
|
94
|
+
<ElementInspector enabled={__DEV__}>
|
|
95
|
+
<NavigationContainer>
|
|
96
|
+
<Tab.Navigator>
|
|
97
|
+
<Tab.Screen name="Home" component={HomeScreen} />
|
|
98
|
+
<Tab.Screen name="Settings" component={SettingsScreen} />
|
|
99
|
+
</Tab.Navigator>
|
|
100
|
+
</NavigationContainer>
|
|
101
|
+
</ElementInspector>
|
|
102
|
+
);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## API
|
|
106
|
+
|
|
107
|
+
### `<ElementInspector>`
|
|
108
|
+
|
|
109
|
+
The only component you need. Wrap your app with it.
|
|
110
|
+
|
|
111
|
+
| Prop | Type | Default | Description |
|
|
112
|
+
|------|------|---------|-------------|
|
|
113
|
+
| `enabled` | `boolean` | `false` | Enable the inspector. Pass `__DEV__` to only enable in development |
|
|
114
|
+
| `children` | `ReactNode` | -| Your app content |
|
|
115
|
+
|
|
116
|
+
When `enabled` is `false`, the component renders only its children with zero overhead.
|
|
117
|
+
|
|
118
|
+
## How it works
|
|
119
|
+
|
|
120
|
+
1. **Fiber access** - uses `__REACT_DEVTOOLS_GLOBAL_HOOK__` to walk the React fiber tree and discover every host element
|
|
121
|
+
2. **Layout snapshots** - measures all elements and caches their positions for fast hit-testing (debounced rebuild on layout changes)
|
|
122
|
+
3. **Hit testing** - on tap, finds all elements at that point and sorts by area (smallest first)
|
|
123
|
+
4. **Style reading** - reads `fiber.memoizedProps.style` and resolves `StyleSheet` IDs to plain objects via `StyleSheet.flatten()`
|
|
124
|
+
5. **Live mutations** - applies style changes through `overrideProps()` on the fiber, which triggers React's reconciler to update the element
|
|
125
|
+
|
|
126
|
+
## Requirements
|
|
127
|
+
|
|
128
|
+
- React Native 0.72+
|
|
129
|
+
- React 18 or 19
|
|
130
|
+
- Development mode (`__DEV__`) recommended - the inspector reads from React internals that are available in dev builds
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ElementCyclerProps {
|
|
2
|
+
/** Total number of overlapping elements at the tap point */
|
|
3
|
+
total: number;
|
|
4
|
+
/** Currently selected index (0-based) */
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
/** Name of the currently selected component */
|
|
7
|
+
componentName: string;
|
|
8
|
+
onPrevious: () => void;
|
|
9
|
+
onNext: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** UI for cycling through overlapping elements at a tap point. */
|
|
12
|
+
export declare const ElementCycler: ({ total, currentIndex, componentName, onPrevious, onNext, }: ElementCyclerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=ElementCycler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementCycler.d.ts","sourceRoot":"","sources":["../src/ElementCycler.tsx"],"names":[],"mappings":"AAEA,UAAU,kBAAkB;IAC1B,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,kEAAkE;AAClE,eAAO,MAAM,aAAa,gEAMvB,kBAAkB,mDAkBpB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
/** UI for cycling through overlapping elements at a tap point. */
|
|
4
|
+
export const ElementCycler = ({ total, currentIndex, componentName, onPrevious, onNext, }) => {
|
|
5
|
+
if (total <= 1)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsxs(View, { style: styles.container, children: [_jsx(TouchableOpacity, { onPress: onPrevious, style: styles.button, activeOpacity: 0.6, children: _jsx(Text, { style: styles.arrow, children: "\u25B2" }) }), _jsxs(Text, { style: styles.label, numberOfLines: 1, children: [componentName, " (", currentIndex + 1, "/", total, ")"] }), _jsx(TouchableOpacity, { onPress: onNext, style: styles.button, activeOpacity: 0.6, children: _jsx(Text, { style: styles.arrow, children: "\u25BC" }) })] }));
|
|
8
|
+
};
|
|
9
|
+
const styles = StyleSheet.create({
|
|
10
|
+
container: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
borderRadius: 6,
|
|
14
|
+
paddingHorizontal: 4,
|
|
15
|
+
paddingVertical: 2,
|
|
16
|
+
},
|
|
17
|
+
button: {
|
|
18
|
+
paddingHorizontal: 8,
|
|
19
|
+
paddingVertical: 4,
|
|
20
|
+
},
|
|
21
|
+
arrow: {
|
|
22
|
+
color: '#AAAAAA',
|
|
23
|
+
fontSize: 13,
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
color: '#DDDDDD',
|
|
27
|
+
fontSize: 13,
|
|
28
|
+
fontWeight: '500',
|
|
29
|
+
marginHorizontal: 4,
|
|
30
|
+
flexShrink: 1,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=ElementCycler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementCycler.js","sourceRoot":"","sources":["../src/ElementCycler.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAaxE,kEAAkE;AAClE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,GACa,EAAE,EAAE;IACvB,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,aAC3B,KAAC,gBAAgB,IAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,YAC7E,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,uBAAU,GAClB,EAEnB,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,aACxC,aAAa,QAAI,YAAY,GAAG,CAAC,OAAG,KAAK,SACrC,EAEP,KAAC,gBAAgB,IAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,YACzE,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,uBAAU,GAClB,IACd,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,CAAC;QACf,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;KACnB;IACD,MAAM,EAAE;QACN,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;KACnB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,gBAAgB,EAAE,CAAC;QACnB,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MeasuredElement } from './fiber';
|
|
2
|
+
interface ElementHighlighterProps {
|
|
3
|
+
element: MeasuredElement | null;
|
|
4
|
+
outlineOnly?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Draws a Chrome DevTools-style highlight on the selected element.
|
|
8
|
+
*
|
|
9
|
+
* Full mode: margin (orange), padding (green), content (blue) fills + outline.
|
|
10
|
+
* Outline-only mode: just the crisp border — keeps selection visible without obscuring content.
|
|
11
|
+
*
|
|
12
|
+
* The measured rect is the border box (includes border + padding, NOT margin).
|
|
13
|
+
* Margin extends outward, padding/content sit inside.
|
|
14
|
+
*
|
|
15
|
+
* Layering trick: each nested View's background covers the parent's color,
|
|
16
|
+
* so only the "strips" around the edges remain visible:
|
|
17
|
+
* orange margin strips → green padding strips → blue content fill
|
|
18
|
+
*/
|
|
19
|
+
export declare const ElementHighlighter: ({ element, outlineOnly }: ElementHighlighterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=ElementHighlighter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementHighlighter.d.ts","sourceRoot":"","sources":["../src/ElementHighlighter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAG7D,UAAU,uBAAuB;IAC/B,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,6BAAsC,uBAAuB,mDA4E3F,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { BOX_MODEL_COLORS, Z_INDEX } from './constants';
|
|
4
|
+
import { FiberAdapter } from './fiber';
|
|
5
|
+
import { extractBoxModel } from './utils';
|
|
6
|
+
/**
|
|
7
|
+
* Draws a Chrome DevTools-style highlight on the selected element.
|
|
8
|
+
*
|
|
9
|
+
* Full mode: margin (orange), padding (green), content (blue) fills + outline.
|
|
10
|
+
* Outline-only mode: just the crisp border — keeps selection visible without obscuring content.
|
|
11
|
+
*
|
|
12
|
+
* The measured rect is the border box (includes border + padding, NOT margin).
|
|
13
|
+
* Margin extends outward, padding/content sit inside.
|
|
14
|
+
*
|
|
15
|
+
* Layering trick: each nested View's background covers the parent's color,
|
|
16
|
+
* so only the "strips" around the edges remain visible:
|
|
17
|
+
* orange margin strips → green padding strips → blue content fill
|
|
18
|
+
*/
|
|
19
|
+
export const ElementHighlighter = ({ element, outlineOnly = false }) => {
|
|
20
|
+
if (!element)
|
|
21
|
+
return null;
|
|
22
|
+
const style = FiberAdapter.getStyle(element.fiber);
|
|
23
|
+
const { margin, border, padding } = extractBoxModel(style, {
|
|
24
|
+
width: element.width,
|
|
25
|
+
height: element.height,
|
|
26
|
+
});
|
|
27
|
+
// Margin box extends outward from the measured rect
|
|
28
|
+
const marginBoxLeft = element.x - margin.left;
|
|
29
|
+
const marginBoxTop = element.y - margin.top;
|
|
30
|
+
const marginBoxWidth = element.width + margin.left + margin.right;
|
|
31
|
+
const marginBoxHeight = element.height + margin.top + margin.bottom;
|
|
32
|
+
return (_jsxs(View, { pointerEvents: 'none', style: styles.root, children: [!outlineOnly && (_jsx(_Fragment, { children: _jsx(View, { style: [
|
|
33
|
+
styles.marginLayer,
|
|
34
|
+
{
|
|
35
|
+
left: marginBoxLeft,
|
|
36
|
+
top: marginBoxTop,
|
|
37
|
+
width: marginBoxWidth,
|
|
38
|
+
height: marginBoxHeight,
|
|
39
|
+
},
|
|
40
|
+
], children: _jsx(View, { style: [
|
|
41
|
+
styles.paddingLayer,
|
|
42
|
+
{
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
left: margin.left,
|
|
45
|
+
top: margin.top,
|
|
46
|
+
width: element.width,
|
|
47
|
+
height: element.height,
|
|
48
|
+
},
|
|
49
|
+
], children: _jsx(View, { style: [
|
|
50
|
+
styles.contentLayer,
|
|
51
|
+
{
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
left: border.left + padding.left,
|
|
54
|
+
top: border.top + padding.top,
|
|
55
|
+
right: border.right + padding.right,
|
|
56
|
+
bottom: border.bottom + padding.bottom,
|
|
57
|
+
},
|
|
58
|
+
] }) }) }) })), _jsx(View, { style: [
|
|
59
|
+
styles.outline,
|
|
60
|
+
{
|
|
61
|
+
left: element.x,
|
|
62
|
+
top: element.y,
|
|
63
|
+
width: element.width,
|
|
64
|
+
height: element.height,
|
|
65
|
+
},
|
|
66
|
+
] })] }));
|
|
67
|
+
};
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
root: {
|
|
70
|
+
...StyleSheet.absoluteFillObject,
|
|
71
|
+
zIndex: Z_INDEX.HIGHLIGHT,
|
|
72
|
+
},
|
|
73
|
+
marginLayer: {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
backgroundColor: BOX_MODEL_COLORS.margin,
|
|
76
|
+
},
|
|
77
|
+
paddingLayer: {
|
|
78
|
+
backgroundColor: BOX_MODEL_COLORS.padding,
|
|
79
|
+
},
|
|
80
|
+
contentLayer: {
|
|
81
|
+
backgroundColor: BOX_MODEL_COLORS.content,
|
|
82
|
+
},
|
|
83
|
+
outline: {
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
borderWidth: 1.5,
|
|
86
|
+
borderColor: BOX_MODEL_COLORS.outline,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=ElementHighlighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementHighlighter.js","sourceRoot":"","sources":["../src/ElementHighlighter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,YAAY,EAAwB,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C;;;;;;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 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ElementInspectorProps {
|
|
3
|
+
/** Only enable in dev mode. Pass `__DEV__` here. */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Root wrapper component. Wrap your app root with this.
|
|
9
|
+
* In production (enabled=false), renders children with zero overhead.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ElementInspector: ({ enabled, children }: ElementInspectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ElementInspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementInspector.d.ts","sourceRoot":"","sources":["../src/ElementInspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,0BAAmC,qBAAqB,4CAyFpF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { FLOATING_PANEL, Z_INDEX } from './constants';
|
|
5
|
+
import { ElementHighlighter } from './ElementHighlighter';
|
|
6
|
+
import { FloatingPanel } from './floatingPanel';
|
|
7
|
+
import { useDebouncedCallback, useLayoutSnapshot, useTapToSelect } from './hooks';
|
|
8
|
+
/**
|
|
9
|
+
* Root wrapper component. Wrap your app root with this.
|
|
10
|
+
* In production (enabled=false), renders children with zero overhead.
|
|
11
|
+
*/
|
|
12
|
+
export const ElementInspector = ({ enabled = false, children }) => {
|
|
13
|
+
const [isInspecting, setIsInspecting] = useState(false);
|
|
14
|
+
const [highlightVisible, setHighlightVisible] = useState(false);
|
|
15
|
+
const { snapshot, buildSnapshot } = useLayoutSnapshot();
|
|
16
|
+
const { selected, matches, selectedIndex, handleTap, cycleNext, cyclePrevious, clearSelection } = useTapToSelect(snapshot);
|
|
17
|
+
const hideHighlight = useDebouncedCallback(() => setHighlightVisible(false), FLOATING_PANEL.HIGHLIGHT_FLASH_MS);
|
|
18
|
+
const flashHighlight = useCallback(() => {
|
|
19
|
+
setHighlightVisible(true);
|
|
20
|
+
hideHighlight();
|
|
21
|
+
}, [hideHighlight]);
|
|
22
|
+
if (!enabled) {
|
|
23
|
+
return _jsx(_Fragment, { children: children });
|
|
24
|
+
}
|
|
25
|
+
// Derive panel state from inspector state
|
|
26
|
+
const panelState = isInspecting ? (selected ? 'expanded' : 'handle') : 'bubble';
|
|
27
|
+
const toggleInspect = async () => {
|
|
28
|
+
if (isInspecting) {
|
|
29
|
+
setIsInspecting(false);
|
|
30
|
+
clearSelection();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
try {
|
|
34
|
+
await buildSnapshot();
|
|
35
|
+
setIsInspecting(true);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
// biome-ignore lint/suspicious/noConsole: dev tool — errors should be visible
|
|
39
|
+
console.warn('[ElementInspector] Snapshot failed:', error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const handleClose = () => {
|
|
44
|
+
if (selected) {
|
|
45
|
+
// Expanded → handle (deselect element, stay in inspect mode)
|
|
46
|
+
clearSelection();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// Handle → bubble (exit inspect mode)
|
|
50
|
+
setIsInspecting(false);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs(View, { style: styles.container, children: [children, isInspecting && (_jsx(View, { style: styles.tapOverlay, onStartShouldSetResponder: () => true, onResponderRelease: (event) => {
|
|
54
|
+
handleTap(event);
|
|
55
|
+
flashHighlight();
|
|
56
|
+
} })), isInspecting && selected && _jsx(ElementHighlighter, { element: selected, outlineOnly: true }), highlightVisible && _jsx(ElementHighlighter, { element: selected }), _jsx(FloatingPanel, { panelState: panelState, selected: selected, matches: matches, selectedIndex: selectedIndex, onToggleInspect: toggleInspect, onCycleNext: () => {
|
|
57
|
+
cycleNext();
|
|
58
|
+
flashHighlight();
|
|
59
|
+
}, onCyclePrevious: () => {
|
|
60
|
+
cyclePrevious();
|
|
61
|
+
flashHighlight();
|
|
62
|
+
}, onClose: handleClose })] }));
|
|
63
|
+
};
|
|
64
|
+
const styles = StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
flex: 1,
|
|
67
|
+
},
|
|
68
|
+
tapOverlay: {
|
|
69
|
+
...StyleSheet.absoluteFillObject,
|
|
70
|
+
backgroundColor: 'transparent',
|
|
71
|
+
zIndex: Z_INDEX.TAP_OVERLAY,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=ElementInspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementInspector.js","sourceRoot":"","sources":["../src/ElementInspector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAmB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQlF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,OAAO,GAAG,KAAK,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AAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;IACD,UAAU,EAAE;QACV,GAAG,UAAU,CAAC,kBAAkB;QAChC,eAAe,EAAE,aAAa;QAC9B,MAAM,EAAE,OAAO,CAAC,WAAW;KAC5B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,0BAA2B,aAAa,4CAM5D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
export const Checkbox = ({ checked, onToggle }) => (_jsx(Pressable, { onPress: onToggle, hitSlop: 6, style: styles.pressable, children: _jsx(View, { style: [styles.box, checked && styles.checked], children: checked && _jsx(Text, { style: styles.tick, children: "\u2713" }) }) }));
|
|
4
|
+
const styles = StyleSheet.create({
|
|
5
|
+
pressable: {
|
|
6
|
+
justifyContent: 'center',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
marginRight: 6,
|
|
9
|
+
},
|
|
10
|
+
box: {
|
|
11
|
+
width: 12,
|
|
12
|
+
height: 12,
|
|
13
|
+
borderRadius: 2,
|
|
14
|
+
borderWidth: 1.5,
|
|
15
|
+
borderColor: '#555',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
},
|
|
19
|
+
checked: {
|
|
20
|
+
backgroundColor: '#4FC3F7',
|
|
21
|
+
borderColor: '#4FC3F7',
|
|
22
|
+
},
|
|
23
|
+
tick: {
|
|
24
|
+
fontSize: 9,
|
|
25
|
+
lineHeight: 11,
|
|
26
|
+
color: '#fff',
|
|
27
|
+
fontWeight: '700',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOjE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAiB,EAAE,EAAE,CAAC,CAChE,KAAC,SAAS,IAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,YAC/D,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,YACjD,OAAO,IAAI,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,uBAAU,GACzC,GACG,CACb,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;KACf;IACD,GAAG,EAAE;QACH,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,GAAG;QAChB,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,OAAO,EAAE;QACP,eAAe,EAAE,SAAS;QAC1B,WAAW,EAAE,SAAS;KACvB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Chrome DevTools-style box model colors */
|
|
2
|
+
export declare const BOX_MODEL_COLORS: {
|
|
3
|
+
readonly margin: "rgba(246, 178, 107, 0.4)";
|
|
4
|
+
readonly marginLabel: "#F6B26B";
|
|
5
|
+
readonly border: "rgba(255, 217, 102, 0.3)";
|
|
6
|
+
readonly borderLabel: "#FFD966";
|
|
7
|
+
readonly padding: "rgba(147, 196, 125, 0.4)";
|
|
8
|
+
readonly paddingLabel: "#6AA84F";
|
|
9
|
+
readonly content: "rgba(79, 195, 247, 0.3)";
|
|
10
|
+
readonly contentLabel: "#4A90D9";
|
|
11
|
+
readonly outline: "#4FC3F7";
|
|
12
|
+
};
|
|
13
|
+
/** VS Code-style syntax colors for the editable style property list */
|
|
14
|
+
export declare const EDITABLE_VALUE_COLORS: {
|
|
15
|
+
readonly key: {
|
|
16
|
+
readonly text: "#9CDCFE";
|
|
17
|
+
readonly underline: "rgba(156, 220, 254, 0.4)";
|
|
18
|
+
};
|
|
19
|
+
readonly value: {
|
|
20
|
+
readonly text: "#CE9178";
|
|
21
|
+
readonly underline: "rgba(206, 145, 120, 0.4)";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/constants/colors.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUnB,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,qBAAqB;;;;;;;;;CAGxB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Chrome DevTools-style box model colors */
|
|
2
|
+
export const BOX_MODEL_COLORS = {
|
|
3
|
+
margin: 'rgba(246, 178, 107, 0.4)',
|
|
4
|
+
marginLabel: '#F6B26B',
|
|
5
|
+
border: 'rgba(255, 217, 102, 0.3)',
|
|
6
|
+
borderLabel: '#FFD966',
|
|
7
|
+
padding: 'rgba(147, 196, 125, 0.4)',
|
|
8
|
+
paddingLabel: '#6AA84F',
|
|
9
|
+
content: 'rgba(79, 195, 247, 0.3)',
|
|
10
|
+
contentLabel: '#4A90D9',
|
|
11
|
+
outline: '#4FC3F7',
|
|
12
|
+
};
|
|
13
|
+
/** VS Code-style syntax colors for the editable style property list */
|
|
14
|
+
export const EDITABLE_VALUE_COLORS = {
|
|
15
|
+
key: { text: '#9CDCFE', underline: 'rgba(156, 220, 254, 0.4)' },
|
|
16
|
+
value: { text: '#CE9178', underline: 'rgba(206, 145, 120, 0.4)' },
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/constants/colors.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,0BAA0B;IAClC,WAAW,EAAE,SAAS;IACtB,MAAM,EAAE,0BAA0B;IAClC,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,0BAA0B;IACnC,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,yBAAyB;IAClC,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,0BAA0B,EAAE;IAC/D,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,0BAA0B,EAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,OAAO,GACR,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,OAAO,GACR,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Cross-platform monospace font family */
|
|
2
|
+
export declare const MONOSPACE_FONT: string;
|
|
3
|
+
/** Z-index layering for inspector UI elements */
|
|
4
|
+
export declare const Z_INDEX: {
|
|
5
|
+
readonly HIGHLIGHT: 9997;
|
|
6
|
+
readonly TAP_OVERLAY: 9998;
|
|
7
|
+
readonly FLOATING_PANEL: 10000;
|
|
8
|
+
};
|
|
9
|
+
/** Timeout for fiber measure() calls (ms) */
|
|
10
|
+
export declare const MEASURE_TIMEOUT_MS = 3000;
|
|
11
|
+
/** Floating panel dimensions and animation config */
|
|
12
|
+
export declare const FLOATING_PANEL: {
|
|
13
|
+
readonly BUBBLE_SIZE: 48;
|
|
14
|
+
readonly HANDLE_WIDTH: 180;
|
|
15
|
+
readonly HANDLE_HEIGHT: 44;
|
|
16
|
+
readonly PANEL_WIDTH: 280;
|
|
17
|
+
readonly PANEL_HEIGHT: 320;
|
|
18
|
+
readonly PANEL_BODY_HEIGHT: 220;
|
|
19
|
+
readonly TAP_THRESHOLD: 5;
|
|
20
|
+
readonly EDGE_MARGIN: 12;
|
|
21
|
+
readonly TOP_SAFE_AREA: 50;
|
|
22
|
+
readonly BOTTOM_SAFE_AREA: 40;
|
|
23
|
+
readonly SNAP_FRICTION: 7;
|
|
24
|
+
readonly SNAP_TENSION: 40;
|
|
25
|
+
readonly EXPAND_DURATION: 250;
|
|
26
|
+
readonly HIGHLIGHT_FLASH_MS: 1500;
|
|
27
|
+
};
|
|
28
|
+
/** Validation constraints for editable style values */
|
|
29
|
+
export declare const EDITABLE_VALUE: {
|
|
30
|
+
readonly VALID_STYLE_KEY: RegExp;
|
|
31
|
+
readonly MAX_VALUE_LENGTH: 200;
|
|
32
|
+
};
|
|
33
|
+
/** InspectorBubble sizing and animation trail config */
|
|
34
|
+
export declare const INSPECTOR_BUBBLE: {
|
|
35
|
+
readonly SIZE: 48;
|
|
36
|
+
readonly SWEEP_WIDTH: 2.5;
|
|
37
|
+
readonly CENTER_DOT_SIZE: 8;
|
|
38
|
+
readonly TRAIL_ARMS: readonly [{
|
|
39
|
+
readonly key: "sweep";
|
|
40
|
+
readonly offsetDeg: 0;
|
|
41
|
+
readonly opacity: 0.9;
|
|
42
|
+
}, {
|
|
43
|
+
readonly key: "trail-1";
|
|
44
|
+
readonly offsetDeg: -18;
|
|
45
|
+
readonly opacity: 0.45;
|
|
46
|
+
}, {
|
|
47
|
+
readonly key: "trail-2";
|
|
48
|
+
readonly offsetDeg: -36;
|
|
49
|
+
readonly opacity: 0.3;
|
|
50
|
+
}, {
|
|
51
|
+
readonly key: "trail-3";
|
|
52
|
+
readonly offsetDeg: -54;
|
|
53
|
+
readonly opacity: 0.2;
|
|
54
|
+
}];
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/constants/ui.ts"],"names":[],"mappings":"AAEA,2CAA2C;AAC3C,eAAO,MAAM,cAAc,QAA0D,CAAC;AAEtF,iDAAiD;AACjD,eAAO,MAAM,OAAO;;;;CAIV,CAAC;AAEX,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,qDAAqD;AACrD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;CAejB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,wDAAwD;AACxD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAUnB,CAAC"}
|