@rork-ai/toolkit-dev-sdk 0.2.6 → 0.2.7
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/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/inspector.53.js +413 -0
- package/lib/module/inspector.53.js.map +1 -0
- package/lib/module/inspector.js +290 -0
- package/lib/module/inspector.js.map +1 -0
- package/lib/module/inspector.web.js +11 -0
- package/lib/module/inspector.web.js.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/inspector.53.d.ts +23 -0
- package/lib/typescript/src/inspector.53.d.ts.map +1 -0
- package/lib/typescript/src/inspector.d.ts +23 -0
- package/lib/typescript/src/inspector.d.ts.map +1 -0
- package/lib/typescript/src/inspector.web.d.ts +4 -0
- package/lib/typescript/src/inspector.web.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/index.tsx +4 -1
- package/src/inspector.53.tsx +467 -0
- package/src/inspector.tsx +345 -0
- package/src/inspector.web.tsx +3 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
The code here will is moved to our infrastructure (with ctrl+c ctrl+v)
|
|
5
|
+
where we add it in _layout.tsx as it is.
|
|
6
|
+
|
|
7
|
+
It will be added at .rork/BundleInspector.tsx (web vestoin too).
|
|
8
|
+
|
|
9
|
+
That is why:
|
|
10
|
+
1. This file should never import other files
|
|
11
|
+
2. This file should never import other modules that will not be on the device.
|
|
12
|
+
We import react-native-safe-area-context and lucide-react-native
|
|
13
|
+
but we are confident it will be there. Still not great.
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { BlurView } from "expo-blur";
|
|
18
|
+
import { requireOptionalNativeModule } from "expo-modules-core";
|
|
19
|
+
import { X } from "lucide-react-native";
|
|
20
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
21
|
+
import { Dimensions, LogBox, NativeModules, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
22
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
import DebuggingOverlay from "react-native/Libraries/Debugging/DebuggingOverlay.js";
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import useSubscribeToDebuggingOverlayRegistry from "react-native/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry";
|
|
27
|
+
import ErrorUtils from "react-native/Libraries/vendor/core/ErrorUtils";
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
const getInspectorDataForViewAtPoint = require("react-native/src/private/devsupport/devmenu/elementinspector/getInspectorDataForViewAtPoint").default;
|
|
30
|
+
const InspectorOverlay = require("react-native/src/private/devsupport/devmenu/elementinspector/InspectorOverlay").default;
|
|
31
|
+
// Removed InspectorPanel import - implementing inline
|
|
32
|
+
|
|
33
|
+
const BridgeModule = requireOptionalNativeModule("Bridge");
|
|
34
|
+
export function isRorkSandbox() {
|
|
35
|
+
return !!NativeModules.RorkSandbox;
|
|
36
|
+
}
|
|
37
|
+
if (BridgeModule) {
|
|
38
|
+
LogBox.ignoreAllLogs();
|
|
39
|
+
LogBox.uninstall();
|
|
40
|
+
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
ErrorUtils.setGlobalHandler(error => {
|
|
43
|
+
sendBridgeMessage("runtime-error", {
|
|
44
|
+
stack: error.stack,
|
|
45
|
+
message: error.message
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function sendBridgeMessage(type, data) {
|
|
50
|
+
if (data) {
|
|
51
|
+
return BridgeModule?.sendMessage({
|
|
52
|
+
type,
|
|
53
|
+
data: JSON.stringify(data)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return BridgeModule?.sendMessage({
|
|
57
|
+
type
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function addBridgeListener(listener) {
|
|
61
|
+
return BridgeModule?.addListener("onMessage", data => {
|
|
62
|
+
if (typeof data !== "object") return;
|
|
63
|
+
if (data.data) {
|
|
64
|
+
listener({
|
|
65
|
+
...data,
|
|
66
|
+
data: JSON.parse(data.data)
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
listener(data);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export function useBridge() {
|
|
74
|
+
const [state, setState] = useState({
|
|
75
|
+
inspectorEnabled: false
|
|
76
|
+
});
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const subscription = addBridgeListener(data => {
|
|
79
|
+
if (typeof data === "object" && data.type === "merge-inspector-state") {
|
|
80
|
+
setState(prev => ({
|
|
81
|
+
...prev,
|
|
82
|
+
...data.data
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
sendBridgeMessage("runtime-ready");
|
|
87
|
+
return () => subscription?.remove();
|
|
88
|
+
}, []);
|
|
89
|
+
const disableInspector = useCallback(() => {
|
|
90
|
+
setState(prev => ({
|
|
91
|
+
...prev,
|
|
92
|
+
inspectorEnabled: false
|
|
93
|
+
}));
|
|
94
|
+
sendBridgeMessage("merge-inspector-state", {
|
|
95
|
+
inspectorEnabled: false
|
|
96
|
+
});
|
|
97
|
+
}, []);
|
|
98
|
+
return {
|
|
99
|
+
...state,
|
|
100
|
+
disableInspector
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function BundleInspector(props) {
|
|
104
|
+
const innerViewRef = useRef(null);
|
|
105
|
+
const appContainerRootViewRef = useRef(null);
|
|
106
|
+
const debuggingOverlayRef = useRef(null);
|
|
107
|
+
const {
|
|
108
|
+
inspectorEnabled,
|
|
109
|
+
disableInspector
|
|
110
|
+
} = useBridge();
|
|
111
|
+
const [panelPosition, setPanelPosition] = useState("bottom");
|
|
112
|
+
const [inspectedElement, setInspectedElement] = useState(null);
|
|
113
|
+
const [lastPayload, setLastPayload] = useState(null);
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (inspectorEnabled) return;
|
|
116
|
+
setInspectedElement(null);
|
|
117
|
+
setPanelPosition("bottom");
|
|
118
|
+
}, [inspectorEnabled]);
|
|
119
|
+
useSubscribeToDebuggingOverlayRegistry(appContainerRootViewRef, debuggingOverlayRef);
|
|
120
|
+
const handleInspectedElementChange = useCallback(viewData => {
|
|
121
|
+
if (viewData) {
|
|
122
|
+
const payload = {
|
|
123
|
+
style: viewData.props.style,
|
|
124
|
+
frame: viewData.frame,
|
|
125
|
+
componentStack: viewData.componentStack,
|
|
126
|
+
hierarchy: viewData.hierarchy?.map(h => ({
|
|
127
|
+
name: h.name ?? null
|
|
128
|
+
}))
|
|
129
|
+
};
|
|
130
|
+
setLastPayload(payload);
|
|
131
|
+
}
|
|
132
|
+
}, []);
|
|
133
|
+
const onTouchPoint = (locationX, locationY) => {
|
|
134
|
+
getInspectorDataForViewAtPoint(innerViewRef.current, locationX, locationY, viewData => {
|
|
135
|
+
setPanelPosition(viewData.pointerY > Dimensions.get("window").height * 0.8 ? "top" : "bottom");
|
|
136
|
+
setInspectedElement({
|
|
137
|
+
frame: viewData.frame,
|
|
138
|
+
style: viewData.props.style
|
|
139
|
+
});
|
|
140
|
+
handleInspectedElementChange(viewData);
|
|
141
|
+
return false;
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
const {
|
|
145
|
+
top,
|
|
146
|
+
bottom
|
|
147
|
+
} = useSafeAreaInsets();
|
|
148
|
+
const panelContainerStyle = panelPosition === "bottom" ? {
|
|
149
|
+
bottom: 0,
|
|
150
|
+
marginBottom: bottom
|
|
151
|
+
} : {
|
|
152
|
+
top: 0,
|
|
153
|
+
marginTop: top
|
|
154
|
+
};
|
|
155
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
156
|
+
style: styles.container,
|
|
157
|
+
ref: appContainerRootViewRef,
|
|
158
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
159
|
+
style: styles.container,
|
|
160
|
+
ref: innerViewRef,
|
|
161
|
+
children: props.children
|
|
162
|
+
}), inspectorEnabled && /*#__PURE__*/_jsx(DebuggingOverlay, {
|
|
163
|
+
ref: debuggingOverlayRef,
|
|
164
|
+
style: styles.absolute
|
|
165
|
+
}), inspectorEnabled && /*#__PURE__*/_jsxs(View, {
|
|
166
|
+
style: styles.inspectorContainer,
|
|
167
|
+
pointerEvents: "box-none",
|
|
168
|
+
children: [/*#__PURE__*/_jsx(InspectorOverlay, {
|
|
169
|
+
inspected: inspectedElement,
|
|
170
|
+
onTouchPoint: onTouchPoint
|
|
171
|
+
}), /*#__PURE__*/_jsx(BlurView, {
|
|
172
|
+
style: [{
|
|
173
|
+
position: "absolute",
|
|
174
|
+
left: 0,
|
|
175
|
+
right: 0,
|
|
176
|
+
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
177
|
+
borderRadius: 30,
|
|
178
|
+
marginHorizontal: 12,
|
|
179
|
+
padding: 12,
|
|
180
|
+
paddingLeft: 20,
|
|
181
|
+
overflow: "hidden"
|
|
182
|
+
}, panelContainerStyle],
|
|
183
|
+
children: inspectedElement ? /*#__PURE__*/_jsxs(View, {
|
|
184
|
+
style: styles.floatingIsland,
|
|
185
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
186
|
+
style: styles.islandText,
|
|
187
|
+
children: "Element selected"
|
|
188
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
189
|
+
style: styles.buttonGroup,
|
|
190
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
191
|
+
style: styles.selectButton,
|
|
192
|
+
onPress: () => {
|
|
193
|
+
if (lastPayload) {
|
|
194
|
+
sendBridgeMessage("inspector-element", lastPayload);
|
|
195
|
+
disableInspector();
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
199
|
+
style: styles.buttonText,
|
|
200
|
+
children: "Select"
|
|
201
|
+
})
|
|
202
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
203
|
+
activeOpacity: 0.72,
|
|
204
|
+
style: styles.cancelButton,
|
|
205
|
+
onPress: disableInspector,
|
|
206
|
+
children: /*#__PURE__*/_jsx(X, {
|
|
207
|
+
size: 18,
|
|
208
|
+
color: "#808080",
|
|
209
|
+
strokeWidth: 2.5
|
|
210
|
+
})
|
|
211
|
+
})]
|
|
212
|
+
})]
|
|
213
|
+
}) : /*#__PURE__*/_jsxs(View, {
|
|
214
|
+
style: styles.floatingIsland,
|
|
215
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
216
|
+
style: styles.islandText,
|
|
217
|
+
children: "Touch any element to inspect"
|
|
218
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
219
|
+
activeOpacity: 0.72,
|
|
220
|
+
style: styles.cancelTextButton,
|
|
221
|
+
onPress: disableInspector,
|
|
222
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
223
|
+
style: styles.buttonText,
|
|
224
|
+
children: "Cancel"
|
|
225
|
+
})
|
|
226
|
+
})]
|
|
227
|
+
})
|
|
228
|
+
})]
|
|
229
|
+
})]
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const styles = StyleSheet.create({
|
|
233
|
+
container: {
|
|
234
|
+
flex: 1
|
|
235
|
+
},
|
|
236
|
+
absolute: StyleSheet.absoluteFillObject,
|
|
237
|
+
inspectorContainer: {
|
|
238
|
+
position: "absolute",
|
|
239
|
+
backgroundColor: "transparent",
|
|
240
|
+
top: 0,
|
|
241
|
+
left: 0,
|
|
242
|
+
right: 0,
|
|
243
|
+
bottom: 0
|
|
244
|
+
},
|
|
245
|
+
floatingIsland: {
|
|
246
|
+
flexDirection: "row",
|
|
247
|
+
justifyContent: "space-between",
|
|
248
|
+
alignItems: "center",
|
|
249
|
+
gap: 16
|
|
250
|
+
},
|
|
251
|
+
islandText: {
|
|
252
|
+
color: "white",
|
|
253
|
+
fontSize: 16,
|
|
254
|
+
fontWeight: "600",
|
|
255
|
+
flex: 1
|
|
256
|
+
},
|
|
257
|
+
buttonGroup: {
|
|
258
|
+
flexDirection: "row",
|
|
259
|
+
gap: 8
|
|
260
|
+
},
|
|
261
|
+
selectButton: {
|
|
262
|
+
backgroundColor: "#007AFF",
|
|
263
|
+
paddingHorizontal: 12,
|
|
264
|
+
paddingVertical: 6,
|
|
265
|
+
borderRadius: 16,
|
|
266
|
+
minWidth: 60
|
|
267
|
+
},
|
|
268
|
+
cancelButton: {
|
|
269
|
+
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
|
270
|
+
borderRadius: 16,
|
|
271
|
+
aspectRatio: 1,
|
|
272
|
+
height: 28,
|
|
273
|
+
justifyContent: "center",
|
|
274
|
+
alignItems: "center"
|
|
275
|
+
},
|
|
276
|
+
cancelTextButton: {
|
|
277
|
+
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
|
278
|
+
paddingHorizontal: 12,
|
|
279
|
+
paddingVertical: 6,
|
|
280
|
+
borderRadius: 16,
|
|
281
|
+
minWidth: 60
|
|
282
|
+
},
|
|
283
|
+
buttonText: {
|
|
284
|
+
color: "white",
|
|
285
|
+
fontSize: 14,
|
|
286
|
+
fontWeight: "600",
|
|
287
|
+
textAlign: "center"
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
//# sourceMappingURL=inspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BlurView","requireOptionalNativeModule","X","React","useCallback","useEffect","useRef","useState","Dimensions","LogBox","NativeModules","StyleSheet","Text","TouchableOpacity","View","useSafeAreaInsets","DebuggingOverlay","useSubscribeToDebuggingOverlayRegistry","ErrorUtils","jsx","_jsx","jsxs","_jsxs","getInspectorDataForViewAtPoint","require","default","InspectorOverlay","BridgeModule","isRorkSandbox","RorkSandbox","ignoreAllLogs","uninstall","setGlobalHandler","error","sendBridgeMessage","stack","message","type","data","sendMessage","JSON","stringify","addBridgeListener","listener","addListener","parse","useBridge","state","setState","inspectorEnabled","subscription","prev","remove","disableInspector","BundleInspector","props","innerViewRef","appContainerRootViewRef","debuggingOverlayRef","panelPosition","setPanelPosition","inspectedElement","setInspectedElement","lastPayload","setLastPayload","handleInspectedElementChange","viewData","payload","style","frame","componentStack","hierarchy","map","h","name","onTouchPoint","locationX","locationY","current","pointerY","get","height","top","bottom","panelContainerStyle","marginBottom","marginTop","styles","container","ref","children","absolute","inspectorContainer","pointerEvents","inspected","position","left","right","backgroundColor","borderRadius","marginHorizontal","padding","paddingLeft","overflow","floatingIsland","islandText","buttonGroup","selectButton","onPress","buttonText","activeOpacity","cancelButton","size","color","strokeWidth","cancelTextButton","create","flex","absoluteFillObject","flexDirection","justifyContent","alignItems","gap","fontSize","fontWeight","paddingHorizontal","paddingVertical","minWidth","aspectRatio","textAlign"],"sourceRoot":"../../src","sources":["inspector.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,WAAW;AACpC,SACEC,2BAA2B,QAEtB,mBAAmB;AAC1B,SAASC,CAAC,QAAQ,qBAAqB;AAEvC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEvE,SACEC,UAAU,EACVC,MAAM,EACNC,aAAa,EACbC,UAAU,EACVC,IAAI,EAEJC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AACrB,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE;AACA,OAAOC,gBAAgB,MAAM,sDAAsD;AACnF;AACA,OAAOC,sCAAsC,MAAM,yEAAyE;AAM5H,OAAOC,UAAU,MAAM,+CAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvE,MAAMC,8BAA8B,GAClCC,OAAO,CAAC,6FAA6F,CAAC,CAACC,OAAO;AAChH,MAAMC,gBAAgB,GACpBF,OAAO,CAAC,+EAA+E,CAA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AC;EACDN,gBAAgB,EAAE;IAChBjB,eAAe,EAAE,2BAA2B;IAC5C2B,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClB3B,YAAY,EAAE,EAAE;IAChB4B,QAAQ,EAAE;EACZ,CAAC;EACDlB,UAAU,EAAE;IACVI,KAAK,EAAE,OAAO;IACdU,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBK,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export function BundleInspector({
|
|
5
|
+
children
|
|
6
|
+
}) {
|
|
7
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
8
|
+
children: children
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=inspector.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BundleInspector","children","_jsx","_Fragment"],"sourceRoot":"../../src","sources":["inspector.web.tsx"],"mappings":";;;AAAA,OAAO,SAASA,eAAeA,CAAC;EAAEC;AAAwC,CAAC,EAAE;EAC3E,oBAAOC,IAAA,CAAAC,SAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAQzE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type EventSubscription } from "expo-modules-core";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { ViewStyle } from "react-native";
|
|
4
|
+
import type { InspectorData, TouchedViewDataAtPoint } from "react-native/Libraries/Renderer/shims/ReactNativeTypes";
|
|
5
|
+
export type InspectedElementFrame = TouchedViewDataAtPoint["frame"];
|
|
6
|
+
export type InspectedElement = Readonly<{
|
|
7
|
+
frame: InspectedElementFrame;
|
|
8
|
+
style?: ViewStyle;
|
|
9
|
+
}>;
|
|
10
|
+
export type ElementsHierarchy = InspectorData["hierarchy"];
|
|
11
|
+
export type BundleInspectorRef = {
|
|
12
|
+
enableDebuggingOverlay: () => void;
|
|
13
|
+
};
|
|
14
|
+
export type BundleInspectorProps = PropsWithChildren<{}>;
|
|
15
|
+
export declare function isRorkSandbox(): boolean;
|
|
16
|
+
export declare function sendBridgeMessage(type: "inspector-element" | "merge-inspector-state" | "runtime-ready" | "runtime-error", data?: Record<string, any>): any;
|
|
17
|
+
export declare function addBridgeListener(listener: (data: Record<string, any>) => void): EventSubscription;
|
|
18
|
+
export declare function useBridge(): {
|
|
19
|
+
disableInspector: () => void;
|
|
20
|
+
inspectorEnabled: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function BundleInspector(props: BundleInspectorProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=inspector.53.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.53.d.ts","sourceRoot":"","sources":["../../../src/inspector.53.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAe9C,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EAEvB,MAAM,wDAAwD,CAAC;AAWhE,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG;IAAE,sBAAsB,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAIzD,wBAAgB,aAAa,YAE5B;AAeD,wBAAgB,iBAAiB,CAC/B,IAAI,EACA,mBAAmB,GACnB,uBAAuB,GACvB,eAAe,GACf,eAAe,EACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAO3B;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAC5C,iBAAiB,CASnB;AAED,wBAAgB,SAAS;;;EAqBxB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAsJ1D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type EventSubscription } from "expo-modules-core";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { ViewStyle } from "react-native";
|
|
4
|
+
import type { InspectorData, TouchedViewDataAtPoint } from "react-native/Libraries/Renderer/shims/ReactNativeTypes";
|
|
5
|
+
export type InspectedElementFrame = TouchedViewDataAtPoint["frame"];
|
|
6
|
+
export type InspectedElement = Readonly<{
|
|
7
|
+
frame: InspectedElementFrame;
|
|
8
|
+
style?: ViewStyle;
|
|
9
|
+
}>;
|
|
10
|
+
export type ElementsHierarchy = InspectorData["hierarchy"];
|
|
11
|
+
export type BundleInspectorRef = {
|
|
12
|
+
enableDebuggingOverlay: () => void;
|
|
13
|
+
};
|
|
14
|
+
export type BundleInspectorProps = PropsWithChildren<{}>;
|
|
15
|
+
export declare function isRorkSandbox(): boolean;
|
|
16
|
+
export declare function sendBridgeMessage(type: "inspector-element" | "merge-inspector-state" | "runtime-ready" | "runtime-error", data?: Record<string, any>): any;
|
|
17
|
+
export declare function addBridgeListener(listener: (data: Record<string, any>) => void): EventSubscription;
|
|
18
|
+
export declare function useBridge(): {
|
|
19
|
+
disableInspector: () => void;
|
|
20
|
+
inspectorEnabled: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function BundleInspector(props: BundleInspectorProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../src/inspector.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgB9C,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EAEvB,MAAM,wDAAwD,CAAC;AAWhE,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG;IAAE,sBAAsB,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAIzD,wBAAgB,aAAa,YAE5B;AAeD,wBAAgB,iBAAiB,CAC/B,IAAI,EACA,mBAAmB,GACnB,uBAAuB,GACvB,eAAe,GACf,eAAe,EACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAO3B;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAC5C,iBAAiB,CASnB;AAED,wBAAgB,SAAS;;;EAqBxB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAsJ1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.web.d.ts","sourceRoot":"","sources":["../../../src/inspector.web.tsx"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE1E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rork-ai/toolkit-dev-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"author": "Levan Kvirkvelia <lekvirkvelia@gmail.com> (https://github.com/LevanKvirkvelia)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react-native": "*",
|
|
31
31
|
"expo": "*",
|
|
32
|
-
"expo-modules-core": "*"
|
|
32
|
+
"expo-modules-core": "*",
|
|
33
|
+
"lucide-react-native": "*",
|
|
34
|
+
"expo-blur": "*"
|
|
33
35
|
},
|
|
34
36
|
"exports": {
|
|
35
37
|
".": {
|
package/src/index.tsx
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { RorkErrorBoundary } from "./error-boundary";
|
|
2
|
+
import { BundleInspector } from "./inspector";
|
|
2
3
|
import { RorkSafeInsets } from "./safe-insets-content";
|
|
3
4
|
|
|
4
5
|
export function RorkDevWrapper({ children }: { children: React.ReactNode }) {
|
|
5
6
|
return (
|
|
6
7
|
<RorkErrorBoundary>
|
|
7
|
-
<
|
|
8
|
+
<BundleInspector>
|
|
9
|
+
<RorkSafeInsets>{children}</RorkSafeInsets>
|
|
10
|
+
</BundleInspector>
|
|
8
11
|
</RorkErrorBoundary>
|
|
9
12
|
);
|
|
10
13
|
}
|