@buoy-gg/debug-borders 7.0.8 → 7.0.9
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/debug-borders/utils/ViewTypeMapper.js +264 -0
- package/lib/module/debug-borders/utils/ViewTypeMapper.js +255 -0
- package/lib/typescript/debug-borders/utils/ViewTypeMapper.d.ts +66 -0
- package/lib/typescript/debug-borders/utils/ViewTypeMapper.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViewTypeMapper
|
|
3
|
+
*
|
|
4
|
+
* Maps native view class names (e.g., "RCTView", "RCTText") to their
|
|
5
|
+
* developer-friendly React Native component names (e.g., "View", "Text").
|
|
6
|
+
*
|
|
7
|
+
* This makes the render tracking UI more understandable since developers
|
|
8
|
+
* work with component names, not native class names.
|
|
9
|
+
*
|
|
10
|
+
* Sources:
|
|
11
|
+
* - React Native core: packages/react-native/Libraries/Components/*
|
|
12
|
+
* - React Native Android: ReactAndroid/src/main/java/com/facebook/react/views/*
|
|
13
|
+
* - FabricNameComponentMapping.kt
|
|
14
|
+
* - Common third-party libraries (react-native-svg, gesture-handler, etc.)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Mapping from native view class names to React component names.
|
|
21
|
+
*
|
|
22
|
+
* Format: { "NativeClassName": "ComponentName" }
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", {
|
|
25
|
+
value: true
|
|
26
|
+
});
|
|
27
|
+
exports.default = exports.VIEW_TYPE_MAP = void 0;
|
|
28
|
+
exports.getAllComponentNames = getAllComponentNames;
|
|
29
|
+
exports.getAllNativeViewTypes = getAllNativeViewTypes;
|
|
30
|
+
exports.getComponentDisplayName = getComponentDisplayName;
|
|
31
|
+
exports.getNativeViewType = getNativeViewType;
|
|
32
|
+
exports.isKnownViewType = isKnownViewType;
|
|
33
|
+
const VIEW_TYPE_MAP = exports.VIEW_TYPE_MAP = {
|
|
34
|
+
// ==========================================================================
|
|
35
|
+
// REACT NATIVE CORE - Views
|
|
36
|
+
// ==========================================================================
|
|
37
|
+
RCTView: "View",
|
|
38
|
+
RCTSafeAreaView: "SafeAreaView",
|
|
39
|
+
RCTModalHostView: "Modal",
|
|
40
|
+
// ==========================================================================
|
|
41
|
+
// REACT NATIVE CORE - Text
|
|
42
|
+
// ==========================================================================
|
|
43
|
+
RCTText: "Text",
|
|
44
|
+
RCTRawText: "RawText",
|
|
45
|
+
RCTVirtualText: "VirtualText",
|
|
46
|
+
RCTTextInlineImage: "TextInlineImage",
|
|
47
|
+
// ==========================================================================
|
|
48
|
+
// REACT NATIVE CORE - Images
|
|
49
|
+
// ==========================================================================
|
|
50
|
+
RCTImageView: "Image",
|
|
51
|
+
RCTImage: "Image",
|
|
52
|
+
// ==========================================================================
|
|
53
|
+
// REACT NATIVE CORE - ScrollView
|
|
54
|
+
// ==========================================================================
|
|
55
|
+
RCTScrollView: "ScrollView",
|
|
56
|
+
RCTScrollContentView: "ScrollContentView",
|
|
57
|
+
AndroidHorizontalScrollView: "HorizontalScrollView",
|
|
58
|
+
AndroidHorizontalScrollContentView: "HorizontalScrollContentView",
|
|
59
|
+
// ==========================================================================
|
|
60
|
+
// REACT NATIVE CORE - TextInput
|
|
61
|
+
// ==========================================================================
|
|
62
|
+
RCTSinglelineTextInputView: "TextInput",
|
|
63
|
+
RCTMultilineTextInputView: "TextInput (Multiline)",
|
|
64
|
+
AndroidTextInput: "TextInput",
|
|
65
|
+
RCTInputAccessoryView: "InputAccessoryView",
|
|
66
|
+
// ==========================================================================
|
|
67
|
+
// REACT NATIVE CORE - Lists (FlatList/SectionList internals)
|
|
68
|
+
// ==========================================================================
|
|
69
|
+
RCTRefreshControl: "RefreshControl",
|
|
70
|
+
AndroidSwipeRefreshLayout: "RefreshControl",
|
|
71
|
+
PullToRefreshView: "RefreshControl",
|
|
72
|
+
// ==========================================================================
|
|
73
|
+
// REACT NATIVE CORE - Buttons & Touchables
|
|
74
|
+
// ==========================================================================
|
|
75
|
+
RCTSwitch: "Switch",
|
|
76
|
+
AndroidSwitch: "Switch",
|
|
77
|
+
RCTSlider: "Slider",
|
|
78
|
+
// ==========================================================================
|
|
79
|
+
// REACT NATIVE CORE - Activity Indicators
|
|
80
|
+
// ==========================================================================
|
|
81
|
+
RCTActivityIndicatorView: "ActivityIndicator",
|
|
82
|
+
AndroidProgressBar: "ActivityIndicator",
|
|
83
|
+
// ==========================================================================
|
|
84
|
+
// REACT NATIVE CORE - Android-specific
|
|
85
|
+
// ==========================================================================
|
|
86
|
+
AndroidDrawerLayout: "DrawerLayout",
|
|
87
|
+
VirtualView: "VirtualView",
|
|
88
|
+
VirtualViewExperimental: "VirtualView",
|
|
89
|
+
// ==========================================================================
|
|
90
|
+
// REACT NATIVE CORE - Debugging & Internal
|
|
91
|
+
// ==========================================================================
|
|
92
|
+
DebuggingOverlay: "DebuggingOverlay",
|
|
93
|
+
LayoutConformance: "LayoutConformance",
|
|
94
|
+
UnimplementedNativeView: "UnimplementedView",
|
|
95
|
+
// ==========================================================================
|
|
96
|
+
// REACT NATIVE CORE - Legacy/Deprecated
|
|
97
|
+
// ==========================================================================
|
|
98
|
+
RKShimmeringView: "ShimmeringView",
|
|
99
|
+
RCTTemplateView: "TemplateView",
|
|
100
|
+
RCTAxialGradientView: "AxialGradientView",
|
|
101
|
+
// "RCTVideo": "Video",
|
|
102
|
+
RCTMap: "Map",
|
|
103
|
+
RCTWebView: "WebView",
|
|
104
|
+
RCTKeyframes: "Keyframes",
|
|
105
|
+
RCTImpressionTrackingView: "ImpressionTrackingView",
|
|
106
|
+
// ==========================================================================
|
|
107
|
+
// REACT-NATIVE-SVG
|
|
108
|
+
// ==========================================================================
|
|
109
|
+
RNSVGSvgView: "Svg",
|
|
110
|
+
RNSVGGroup: "G",
|
|
111
|
+
RNSVGPath: "Path",
|
|
112
|
+
RNSVGText: "SvgText",
|
|
113
|
+
RNSVGTSpan: "TSpan",
|
|
114
|
+
RNSVGTextPath: "TextPath",
|
|
115
|
+
RNSVGImage: "SvgImage",
|
|
116
|
+
RNSVGCircle: "Circle",
|
|
117
|
+
RNSVGEllipse: "Ellipse",
|
|
118
|
+
RNSVGLine: "Line",
|
|
119
|
+
RNSVGRect: "Rect",
|
|
120
|
+
RNSVGClipPath: "ClipPath",
|
|
121
|
+
RNSVGDefs: "Defs",
|
|
122
|
+
RNSVGUse: "Use",
|
|
123
|
+
RNSVGSymbol: "Symbol",
|
|
124
|
+
RNSVGPattern: "Pattern",
|
|
125
|
+
RNSVGMask: "Mask",
|
|
126
|
+
RNSVGForeignObject: "ForeignObject",
|
|
127
|
+
RNSVGMarker: "Marker",
|
|
128
|
+
RNSVGLinearGradient: "LinearGradient",
|
|
129
|
+
RNSVGRadialGradient: "RadialGradient",
|
|
130
|
+
RNSVGFilter: "Filter",
|
|
131
|
+
RNSVGFeBlend: "FeBlend",
|
|
132
|
+
RNSVGFeColorMatrix: "FeColorMatrix",
|
|
133
|
+
RNSVGFeComposite: "FeComposite",
|
|
134
|
+
RNSVGFeFlood: "FeFlood",
|
|
135
|
+
RNSVGFeGaussianBlur: "FeGaussianBlur",
|
|
136
|
+
RNSVGFeMerge: "FeMerge",
|
|
137
|
+
RNSVGFeOffset: "FeOffset",
|
|
138
|
+
RNSVGPolygon: "Polygon",
|
|
139
|
+
RNSVGPolyline: "Polyline",
|
|
140
|
+
RNSVGStop: "Stop",
|
|
141
|
+
// ==========================================================================
|
|
142
|
+
// REACT-NATIVE-GESTURE-HANDLER
|
|
143
|
+
// ==========================================================================
|
|
144
|
+
RNGestureHandlerRootView: "GestureHandlerRootView",
|
|
145
|
+
RNGestureHandlerButton: "GestureHandlerButton",
|
|
146
|
+
// ==========================================================================
|
|
147
|
+
// REACT-NATIVE-SAFE-AREA-CONTEXT
|
|
148
|
+
// ==========================================================================
|
|
149
|
+
RNCSafeAreaProvider: "SafeAreaProvider",
|
|
150
|
+
RNCSafeAreaView: "SafeAreaView",
|
|
151
|
+
// ==========================================================================
|
|
152
|
+
// REACT-NATIVE-SCREENS (React Navigation)
|
|
153
|
+
// ==========================================================================
|
|
154
|
+
RNSScreen: "Screen",
|
|
155
|
+
RNSScreenContainer: "ScreenContainer",
|
|
156
|
+
RNSScreenStack: "ScreenStack",
|
|
157
|
+
RNSScreenStackHeaderConfig: "ScreenStackHeaderConfig",
|
|
158
|
+
RNSScreenStackHeaderSubview: "ScreenStackHeaderSubview",
|
|
159
|
+
RNSSearchBar: "SearchBar",
|
|
160
|
+
RNSFullWindowOverlay: "FullWindowOverlay",
|
|
161
|
+
RNSModalScreen: "ModalScreen",
|
|
162
|
+
// ==========================================================================
|
|
163
|
+
// REACT-NATIVE-REANIMATED
|
|
164
|
+
// ==========================================================================
|
|
165
|
+
ReanimatedView: "Animated.View",
|
|
166
|
+
// ==========================================================================
|
|
167
|
+
// EXPO MODULES
|
|
168
|
+
// ==========================================================================
|
|
169
|
+
ExpoView: "ExpoView",
|
|
170
|
+
ExpoBlurView: "BlurView",
|
|
171
|
+
ExpoLinearGradient: "LinearGradient",
|
|
172
|
+
ExpoImage: "ExpoImage",
|
|
173
|
+
ExpoVideoView: "VideoView",
|
|
174
|
+
ExpoCamera: "Camera",
|
|
175
|
+
ExpoBarCodeScannerView: "BarCodeScanner",
|
|
176
|
+
// ==========================================================================
|
|
177
|
+
// REACT-NATIVE-WEBVIEW
|
|
178
|
+
// ==========================================================================
|
|
179
|
+
RNCWebView: "WebView",
|
|
180
|
+
// ==========================================================================
|
|
181
|
+
// REACT-NATIVE-MAPS
|
|
182
|
+
// ==========================================================================
|
|
183
|
+
AIRMap: "MapView",
|
|
184
|
+
AIRMapMarker: "Marker",
|
|
185
|
+
AIRMapPolyline: "Polyline",
|
|
186
|
+
AIRMapPolygon: "Polygon",
|
|
187
|
+
AIRMapCircle: "Circle",
|
|
188
|
+
AIRMapCallout: "Callout",
|
|
189
|
+
// ==========================================================================
|
|
190
|
+
// REACT-NATIVE-VIDEO
|
|
191
|
+
// ==========================================================================
|
|
192
|
+
RCTVideo: "Video",
|
|
193
|
+
// ==========================================================================
|
|
194
|
+
// LOTTIE-REACT-NATIVE
|
|
195
|
+
// ==========================================================================
|
|
196
|
+
LottieAnimationView: "LottieView",
|
|
197
|
+
// ==========================================================================
|
|
198
|
+
// REACT-NATIVE-FAST-IMAGE
|
|
199
|
+
// ==========================================================================
|
|
200
|
+
FastImageView: "FastImage"
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Get the developer-friendly component name for a native view type.
|
|
205
|
+
* Returns the original viewType if no mapping exists.
|
|
206
|
+
*
|
|
207
|
+
* @param viewType - The native view class name (e.g., "RCTView")
|
|
208
|
+
* @returns The component name (e.g., "View")
|
|
209
|
+
*/
|
|
210
|
+
function getComponentDisplayName(viewType) {
|
|
211
|
+
return VIEW_TYPE_MAP[viewType] || viewType;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Get the native view class name for a component name (reverse lookup).
|
|
216
|
+
* Returns null if no mapping exists.
|
|
217
|
+
*
|
|
218
|
+
* @param componentName - The component name (e.g., "View")
|
|
219
|
+
* @returns The native view class name (e.g., "RCTView") or null
|
|
220
|
+
*/
|
|
221
|
+
function getNativeViewType(componentName) {
|
|
222
|
+
for (const [native, display] of Object.entries(VIEW_TYPE_MAP)) {
|
|
223
|
+
if (display === componentName) {
|
|
224
|
+
return native;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Check if a view type is a known native component.
|
|
232
|
+
*
|
|
233
|
+
* @param viewType - The native view class name
|
|
234
|
+
* @returns true if it's a known component
|
|
235
|
+
*/
|
|
236
|
+
function isKnownViewType(viewType) {
|
|
237
|
+
return viewType in VIEW_TYPE_MAP;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Get all known view types (useful for autocomplete/suggestions).
|
|
242
|
+
*
|
|
243
|
+
* @returns Array of all native view class names
|
|
244
|
+
*/
|
|
245
|
+
function getAllNativeViewTypes() {
|
|
246
|
+
return Object.keys(VIEW_TYPE_MAP);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Get all known component names (useful for autocomplete/suggestions).
|
|
251
|
+
*
|
|
252
|
+
* @returns Array of all component display names
|
|
253
|
+
*/
|
|
254
|
+
function getAllComponentNames() {
|
|
255
|
+
return [...new Set(Object.values(VIEW_TYPE_MAP))];
|
|
256
|
+
}
|
|
257
|
+
var _default = exports.default = {
|
|
258
|
+
VIEW_TYPE_MAP,
|
|
259
|
+
getComponentDisplayName,
|
|
260
|
+
getNativeViewType,
|
|
261
|
+
isKnownViewType,
|
|
262
|
+
getAllNativeViewTypes,
|
|
263
|
+
getAllComponentNames
|
|
264
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViewTypeMapper
|
|
3
|
+
*
|
|
4
|
+
* Maps native view class names (e.g., "RCTView", "RCTText") to their
|
|
5
|
+
* developer-friendly React Native component names (e.g., "View", "Text").
|
|
6
|
+
*
|
|
7
|
+
* This makes the render tracking UI more understandable since developers
|
|
8
|
+
* work with component names, not native class names.
|
|
9
|
+
*
|
|
10
|
+
* Sources:
|
|
11
|
+
* - React Native core: packages/react-native/Libraries/Components/*
|
|
12
|
+
* - React Native Android: ReactAndroid/src/main/java/com/facebook/react/views/*
|
|
13
|
+
* - FabricNameComponentMapping.kt
|
|
14
|
+
* - Common third-party libraries (react-native-svg, gesture-handler, etc.)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Mapping from native view class names to React component names.
|
|
21
|
+
*
|
|
22
|
+
* Format: { "NativeClassName": "ComponentName" }
|
|
23
|
+
*/
|
|
24
|
+
export const VIEW_TYPE_MAP = {
|
|
25
|
+
// ==========================================================================
|
|
26
|
+
// REACT NATIVE CORE - Views
|
|
27
|
+
// ==========================================================================
|
|
28
|
+
RCTView: "View",
|
|
29
|
+
RCTSafeAreaView: "SafeAreaView",
|
|
30
|
+
RCTModalHostView: "Modal",
|
|
31
|
+
// ==========================================================================
|
|
32
|
+
// REACT NATIVE CORE - Text
|
|
33
|
+
// ==========================================================================
|
|
34
|
+
RCTText: "Text",
|
|
35
|
+
RCTRawText: "RawText",
|
|
36
|
+
RCTVirtualText: "VirtualText",
|
|
37
|
+
RCTTextInlineImage: "TextInlineImage",
|
|
38
|
+
// ==========================================================================
|
|
39
|
+
// REACT NATIVE CORE - Images
|
|
40
|
+
// ==========================================================================
|
|
41
|
+
RCTImageView: "Image",
|
|
42
|
+
RCTImage: "Image",
|
|
43
|
+
// ==========================================================================
|
|
44
|
+
// REACT NATIVE CORE - ScrollView
|
|
45
|
+
// ==========================================================================
|
|
46
|
+
RCTScrollView: "ScrollView",
|
|
47
|
+
RCTScrollContentView: "ScrollContentView",
|
|
48
|
+
AndroidHorizontalScrollView: "HorizontalScrollView",
|
|
49
|
+
AndroidHorizontalScrollContentView: "HorizontalScrollContentView",
|
|
50
|
+
// ==========================================================================
|
|
51
|
+
// REACT NATIVE CORE - TextInput
|
|
52
|
+
// ==========================================================================
|
|
53
|
+
RCTSinglelineTextInputView: "TextInput",
|
|
54
|
+
RCTMultilineTextInputView: "TextInput (Multiline)",
|
|
55
|
+
AndroidTextInput: "TextInput",
|
|
56
|
+
RCTInputAccessoryView: "InputAccessoryView",
|
|
57
|
+
// ==========================================================================
|
|
58
|
+
// REACT NATIVE CORE - Lists (FlatList/SectionList internals)
|
|
59
|
+
// ==========================================================================
|
|
60
|
+
RCTRefreshControl: "RefreshControl",
|
|
61
|
+
AndroidSwipeRefreshLayout: "RefreshControl",
|
|
62
|
+
PullToRefreshView: "RefreshControl",
|
|
63
|
+
// ==========================================================================
|
|
64
|
+
// REACT NATIVE CORE - Buttons & Touchables
|
|
65
|
+
// ==========================================================================
|
|
66
|
+
RCTSwitch: "Switch",
|
|
67
|
+
AndroidSwitch: "Switch",
|
|
68
|
+
RCTSlider: "Slider",
|
|
69
|
+
// ==========================================================================
|
|
70
|
+
// REACT NATIVE CORE - Activity Indicators
|
|
71
|
+
// ==========================================================================
|
|
72
|
+
RCTActivityIndicatorView: "ActivityIndicator",
|
|
73
|
+
AndroidProgressBar: "ActivityIndicator",
|
|
74
|
+
// ==========================================================================
|
|
75
|
+
// REACT NATIVE CORE - Android-specific
|
|
76
|
+
// ==========================================================================
|
|
77
|
+
AndroidDrawerLayout: "DrawerLayout",
|
|
78
|
+
VirtualView: "VirtualView",
|
|
79
|
+
VirtualViewExperimental: "VirtualView",
|
|
80
|
+
// ==========================================================================
|
|
81
|
+
// REACT NATIVE CORE - Debugging & Internal
|
|
82
|
+
// ==========================================================================
|
|
83
|
+
DebuggingOverlay: "DebuggingOverlay",
|
|
84
|
+
LayoutConformance: "LayoutConformance",
|
|
85
|
+
UnimplementedNativeView: "UnimplementedView",
|
|
86
|
+
// ==========================================================================
|
|
87
|
+
// REACT NATIVE CORE - Legacy/Deprecated
|
|
88
|
+
// ==========================================================================
|
|
89
|
+
RKShimmeringView: "ShimmeringView",
|
|
90
|
+
RCTTemplateView: "TemplateView",
|
|
91
|
+
RCTAxialGradientView: "AxialGradientView",
|
|
92
|
+
// "RCTVideo": "Video",
|
|
93
|
+
RCTMap: "Map",
|
|
94
|
+
RCTWebView: "WebView",
|
|
95
|
+
RCTKeyframes: "Keyframes",
|
|
96
|
+
RCTImpressionTrackingView: "ImpressionTrackingView",
|
|
97
|
+
// ==========================================================================
|
|
98
|
+
// REACT-NATIVE-SVG
|
|
99
|
+
// ==========================================================================
|
|
100
|
+
RNSVGSvgView: "Svg",
|
|
101
|
+
RNSVGGroup: "G",
|
|
102
|
+
RNSVGPath: "Path",
|
|
103
|
+
RNSVGText: "SvgText",
|
|
104
|
+
RNSVGTSpan: "TSpan",
|
|
105
|
+
RNSVGTextPath: "TextPath",
|
|
106
|
+
RNSVGImage: "SvgImage",
|
|
107
|
+
RNSVGCircle: "Circle",
|
|
108
|
+
RNSVGEllipse: "Ellipse",
|
|
109
|
+
RNSVGLine: "Line",
|
|
110
|
+
RNSVGRect: "Rect",
|
|
111
|
+
RNSVGClipPath: "ClipPath",
|
|
112
|
+
RNSVGDefs: "Defs",
|
|
113
|
+
RNSVGUse: "Use",
|
|
114
|
+
RNSVGSymbol: "Symbol",
|
|
115
|
+
RNSVGPattern: "Pattern",
|
|
116
|
+
RNSVGMask: "Mask",
|
|
117
|
+
RNSVGForeignObject: "ForeignObject",
|
|
118
|
+
RNSVGMarker: "Marker",
|
|
119
|
+
RNSVGLinearGradient: "LinearGradient",
|
|
120
|
+
RNSVGRadialGradient: "RadialGradient",
|
|
121
|
+
RNSVGFilter: "Filter",
|
|
122
|
+
RNSVGFeBlend: "FeBlend",
|
|
123
|
+
RNSVGFeColorMatrix: "FeColorMatrix",
|
|
124
|
+
RNSVGFeComposite: "FeComposite",
|
|
125
|
+
RNSVGFeFlood: "FeFlood",
|
|
126
|
+
RNSVGFeGaussianBlur: "FeGaussianBlur",
|
|
127
|
+
RNSVGFeMerge: "FeMerge",
|
|
128
|
+
RNSVGFeOffset: "FeOffset",
|
|
129
|
+
RNSVGPolygon: "Polygon",
|
|
130
|
+
RNSVGPolyline: "Polyline",
|
|
131
|
+
RNSVGStop: "Stop",
|
|
132
|
+
// ==========================================================================
|
|
133
|
+
// REACT-NATIVE-GESTURE-HANDLER
|
|
134
|
+
// ==========================================================================
|
|
135
|
+
RNGestureHandlerRootView: "GestureHandlerRootView",
|
|
136
|
+
RNGestureHandlerButton: "GestureHandlerButton",
|
|
137
|
+
// ==========================================================================
|
|
138
|
+
// REACT-NATIVE-SAFE-AREA-CONTEXT
|
|
139
|
+
// ==========================================================================
|
|
140
|
+
RNCSafeAreaProvider: "SafeAreaProvider",
|
|
141
|
+
RNCSafeAreaView: "SafeAreaView",
|
|
142
|
+
// ==========================================================================
|
|
143
|
+
// REACT-NATIVE-SCREENS (React Navigation)
|
|
144
|
+
// ==========================================================================
|
|
145
|
+
RNSScreen: "Screen",
|
|
146
|
+
RNSScreenContainer: "ScreenContainer",
|
|
147
|
+
RNSScreenStack: "ScreenStack",
|
|
148
|
+
RNSScreenStackHeaderConfig: "ScreenStackHeaderConfig",
|
|
149
|
+
RNSScreenStackHeaderSubview: "ScreenStackHeaderSubview",
|
|
150
|
+
RNSSearchBar: "SearchBar",
|
|
151
|
+
RNSFullWindowOverlay: "FullWindowOverlay",
|
|
152
|
+
RNSModalScreen: "ModalScreen",
|
|
153
|
+
// ==========================================================================
|
|
154
|
+
// REACT-NATIVE-REANIMATED
|
|
155
|
+
// ==========================================================================
|
|
156
|
+
ReanimatedView: "Animated.View",
|
|
157
|
+
// ==========================================================================
|
|
158
|
+
// EXPO MODULES
|
|
159
|
+
// ==========================================================================
|
|
160
|
+
ExpoView: "ExpoView",
|
|
161
|
+
ExpoBlurView: "BlurView",
|
|
162
|
+
ExpoLinearGradient: "LinearGradient",
|
|
163
|
+
ExpoImage: "ExpoImage",
|
|
164
|
+
ExpoVideoView: "VideoView",
|
|
165
|
+
ExpoCamera: "Camera",
|
|
166
|
+
ExpoBarCodeScannerView: "BarCodeScanner",
|
|
167
|
+
// ==========================================================================
|
|
168
|
+
// REACT-NATIVE-WEBVIEW
|
|
169
|
+
// ==========================================================================
|
|
170
|
+
RNCWebView: "WebView",
|
|
171
|
+
// ==========================================================================
|
|
172
|
+
// REACT-NATIVE-MAPS
|
|
173
|
+
// ==========================================================================
|
|
174
|
+
AIRMap: "MapView",
|
|
175
|
+
AIRMapMarker: "Marker",
|
|
176
|
+
AIRMapPolyline: "Polyline",
|
|
177
|
+
AIRMapPolygon: "Polygon",
|
|
178
|
+
AIRMapCircle: "Circle",
|
|
179
|
+
AIRMapCallout: "Callout",
|
|
180
|
+
// ==========================================================================
|
|
181
|
+
// REACT-NATIVE-VIDEO
|
|
182
|
+
// ==========================================================================
|
|
183
|
+
RCTVideo: "Video",
|
|
184
|
+
// ==========================================================================
|
|
185
|
+
// LOTTIE-REACT-NATIVE
|
|
186
|
+
// ==========================================================================
|
|
187
|
+
LottieAnimationView: "LottieView",
|
|
188
|
+
// ==========================================================================
|
|
189
|
+
// REACT-NATIVE-FAST-IMAGE
|
|
190
|
+
// ==========================================================================
|
|
191
|
+
FastImageView: "FastImage"
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Get the developer-friendly component name for a native view type.
|
|
196
|
+
* Returns the original viewType if no mapping exists.
|
|
197
|
+
*
|
|
198
|
+
* @param viewType - The native view class name (e.g., "RCTView")
|
|
199
|
+
* @returns The component name (e.g., "View")
|
|
200
|
+
*/
|
|
201
|
+
export function getComponentDisplayName(viewType) {
|
|
202
|
+
return VIEW_TYPE_MAP[viewType] || viewType;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get the native view class name for a component name (reverse lookup).
|
|
207
|
+
* Returns null if no mapping exists.
|
|
208
|
+
*
|
|
209
|
+
* @param componentName - The component name (e.g., "View")
|
|
210
|
+
* @returns The native view class name (e.g., "RCTView") or null
|
|
211
|
+
*/
|
|
212
|
+
export function getNativeViewType(componentName) {
|
|
213
|
+
for (const [native, display] of Object.entries(VIEW_TYPE_MAP)) {
|
|
214
|
+
if (display === componentName) {
|
|
215
|
+
return native;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Check if a view type is a known native component.
|
|
223
|
+
*
|
|
224
|
+
* @param viewType - The native view class name
|
|
225
|
+
* @returns true if it's a known component
|
|
226
|
+
*/
|
|
227
|
+
export function isKnownViewType(viewType) {
|
|
228
|
+
return viewType in VIEW_TYPE_MAP;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Get all known view types (useful for autocomplete/suggestions).
|
|
233
|
+
*
|
|
234
|
+
* @returns Array of all native view class names
|
|
235
|
+
*/
|
|
236
|
+
export function getAllNativeViewTypes() {
|
|
237
|
+
return Object.keys(VIEW_TYPE_MAP);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Get all known component names (useful for autocomplete/suggestions).
|
|
242
|
+
*
|
|
243
|
+
* @returns Array of all component display names
|
|
244
|
+
*/
|
|
245
|
+
export function getAllComponentNames() {
|
|
246
|
+
return [...new Set(Object.values(VIEW_TYPE_MAP))];
|
|
247
|
+
}
|
|
248
|
+
export default {
|
|
249
|
+
VIEW_TYPE_MAP,
|
|
250
|
+
getComponentDisplayName,
|
|
251
|
+
getNativeViewType,
|
|
252
|
+
isKnownViewType,
|
|
253
|
+
getAllNativeViewTypes,
|
|
254
|
+
getAllComponentNames
|
|
255
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViewTypeMapper
|
|
3
|
+
*
|
|
4
|
+
* Maps native view class names (e.g., "RCTView", "RCTText") to their
|
|
5
|
+
* developer-friendly React Native component names (e.g., "View", "Text").
|
|
6
|
+
*
|
|
7
|
+
* This makes the render tracking UI more understandable since developers
|
|
8
|
+
* work with component names, not native class names.
|
|
9
|
+
*
|
|
10
|
+
* Sources:
|
|
11
|
+
* - React Native core: packages/react-native/Libraries/Components/*
|
|
12
|
+
* - React Native Android: ReactAndroid/src/main/java/com/facebook/react/views/*
|
|
13
|
+
* - FabricNameComponentMapping.kt
|
|
14
|
+
* - Common third-party libraries (react-native-svg, gesture-handler, etc.)
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Mapping from native view class names to React component names.
|
|
18
|
+
*
|
|
19
|
+
* Format: { "NativeClassName": "ComponentName" }
|
|
20
|
+
*/
|
|
21
|
+
export declare const VIEW_TYPE_MAP: Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the developer-friendly component name for a native view type.
|
|
24
|
+
* Returns the original viewType if no mapping exists.
|
|
25
|
+
*
|
|
26
|
+
* @param viewType - The native view class name (e.g., "RCTView")
|
|
27
|
+
* @returns The component name (e.g., "View")
|
|
28
|
+
*/
|
|
29
|
+
export declare function getComponentDisplayName(viewType: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the native view class name for a component name (reverse lookup).
|
|
32
|
+
* Returns null if no mapping exists.
|
|
33
|
+
*
|
|
34
|
+
* @param componentName - The component name (e.g., "View")
|
|
35
|
+
* @returns The native view class name (e.g., "RCTView") or null
|
|
36
|
+
*/
|
|
37
|
+
export declare function getNativeViewType(componentName: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a view type is a known native component.
|
|
40
|
+
*
|
|
41
|
+
* @param viewType - The native view class name
|
|
42
|
+
* @returns true if it's a known component
|
|
43
|
+
*/
|
|
44
|
+
export declare function isKnownViewType(viewType: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get all known view types (useful for autocomplete/suggestions).
|
|
47
|
+
*
|
|
48
|
+
* @returns Array of all native view class names
|
|
49
|
+
*/
|
|
50
|
+
export declare function getAllNativeViewTypes(): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Get all known component names (useful for autocomplete/suggestions).
|
|
53
|
+
*
|
|
54
|
+
* @returns Array of all component display names
|
|
55
|
+
*/
|
|
56
|
+
export declare function getAllComponentNames(): string[];
|
|
57
|
+
declare const _default: {
|
|
58
|
+
VIEW_TYPE_MAP: Record<string, string>;
|
|
59
|
+
getComponentDisplayName: typeof getComponentDisplayName;
|
|
60
|
+
getNativeViewType: typeof getNativeViewType;
|
|
61
|
+
isKnownViewType: typeof isKnownViewType;
|
|
62
|
+
getAllNativeViewTypes: typeof getAllNativeViewTypes;
|
|
63
|
+
getAllComponentNames: typeof getAllComponentNames;
|
|
64
|
+
};
|
|
65
|
+
export default _default;
|
|
66
|
+
//# sourceMappingURL=ViewTypeMapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewTypeMapper.d.ts","sourceRoot":"","sources":["../../../../src/debug-borders/utils/ViewTypeMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6LhD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOtE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;;;;;;;;;AAED,wBAOE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/debug-borders",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.9",
|
|
4
4
|
"description": "Layout debugging borders for React Native — depth-colored, touch-through, tap any label to inspect testIDs & styles. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@buoy-gg/
|
|
30
|
-
"@buoy-gg/
|
|
29
|
+
"@buoy-gg/shared-ui": "^7.0.9",
|
|
30
|
+
"@buoy-gg/core": "^7.0.9"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": "*",
|
|
34
34
|
"react-native": "*",
|
|
35
|
-
"@buoy-gg/license": "7.0.
|
|
35
|
+
"@buoy-gg/license": "7.0.9"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/react": "^19.1.0",
|
|
39
39
|
"@types/react-native": "^0.73.0",
|
|
40
40
|
"typescript": "~5.8.3",
|
|
41
|
-
"@buoy-gg/license": "7.0.
|
|
41
|
+
"@buoy-gg/license": "^7.0.9"
|
|
42
42
|
},
|
|
43
43
|
"react-native-builder-bob": {
|
|
44
44
|
"source": "src",
|