@expo/metro-runtime 0.0.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 +13 -0
- package/README.md +3 -0
- package/assets/alert-triangle.png +0 -0
- package/assets/chevron-left.png +0 -0
- package/assets/chevron-right.png +0 -0
- package/assets/close.png +0 -0
- package/assets/loader.png +0 -0
- package/asyncRequire.js +1 -0
- package/build/HMRClient.d.ts +17 -0
- package/build/HMRClient.d.ts.map +1 -0
- package/build/HMRClient.js +250 -0
- package/build/HMRClient.js.map +1 -0
- package/build/HMRClient.native.d.ts +1 -0
- package/build/HMRClient.native.d.ts.map +1 -0
- package/build/HMRClient.native.js +2 -0
- package/build/HMRClient.native.js.map +1 -0
- package/build/LoadingView.d.ts +8 -0
- package/build/LoadingView.d.ts.map +1 -0
- package/build/LoadingView.js +21 -0
- package/build/LoadingView.js.map +1 -0
- package/build/LoadingView.native.d.ts +1 -0
- package/build/LoadingView.native.d.ts.map +1 -0
- package/build/LoadingView.native.js +2 -0
- package/build/LoadingView.native.js.map +1 -0
- package/build/asyncRequire/buildAsyncRequire.d.ts +24 -0
- package/build/asyncRequire/buildAsyncRequire.d.ts.map +1 -0
- package/build/asyncRequire/buildAsyncRequire.js +50 -0
- package/build/asyncRequire/buildAsyncRequire.js.map +1 -0
- package/build/asyncRequire/buildUrlForBundle.d.ts +8 -0
- package/build/asyncRequire/buildUrlForBundle.d.ts.map +1 -0
- package/build/asyncRequire/buildUrlForBundle.js +25 -0
- package/build/asyncRequire/buildUrlForBundle.js.map +1 -0
- package/build/asyncRequire/buildUrlForBundle.native.d.ts +2 -0
- package/build/asyncRequire/buildUrlForBundle.native.d.ts.map +1 -0
- package/build/asyncRequire/buildUrlForBundle.native.js +25 -0
- package/build/asyncRequire/buildUrlForBundle.native.js.map +1 -0
- package/build/asyncRequire/fetchAsync.d.ts +5 -0
- package/build/asyncRequire/fetchAsync.d.ts.map +1 -0
- package/build/asyncRequire/fetchAsync.js +19 -0
- package/build/asyncRequire/fetchAsync.js.map +1 -0
- package/build/asyncRequire/fetchAsync.native.d.ts +12 -0
- package/build/asyncRequire/fetchAsync.native.d.ts.map +1 -0
- package/build/asyncRequire/fetchAsync.native.js +57 -0
- package/build/asyncRequire/fetchAsync.native.js.map +1 -0
- package/build/asyncRequire/fetchThenEval.d.ts +7 -0
- package/build/asyncRequire/fetchThenEval.d.ts.map +1 -0
- package/build/asyncRequire/fetchThenEval.js +30 -0
- package/build/asyncRequire/fetchThenEval.js.map +1 -0
- package/build/asyncRequire/fetchThenEval.web.d.ts +6 -0
- package/build/asyncRequire/fetchThenEval.web.d.ts.map +1 -0
- package/build/asyncRequire/fetchThenEval.web.js +29 -0
- package/build/asyncRequire/fetchThenEval.web.js.map +1 -0
- package/build/asyncRequire/index.d.ts +2 -0
- package/build/asyncRequire/index.d.ts.map +1 -0
- package/build/asyncRequire/index.js +5 -0
- package/build/asyncRequire/index.js.map +1 -0
- package/build/asyncRequire/loadBundle.android.d.ts +2 -0
- package/build/asyncRequire/loadBundle.android.d.ts.map +1 -0
- package/build/asyncRequire/loadBundle.android.js +22 -0
- package/build/asyncRequire/loadBundle.android.js.map +1 -0
- package/build/asyncRequire/loadBundle.d.ts +2 -0
- package/build/asyncRequire/loadBundle.d.ts.map +1 -0
- package/build/asyncRequire/loadBundle.js +6 -0
- package/build/asyncRequire/loadBundle.js.map +1 -0
- package/build/asyncRequire/loadBundlePolyfill.d.ts +7 -0
- package/build/asyncRequire/loadBundlePolyfill.d.ts.map +1 -0
- package/build/asyncRequire/loadBundlePolyfill.js +40 -0
- package/build/asyncRequire/loadBundlePolyfill.js.map +1 -0
- package/build/effects.d.ts +2 -0
- package/build/effects.d.ts.map +1 -0
- package/build/effects.js +16 -0
- package/build/effects.js.map +1 -0
- package/build/effects.native.d.ts +1 -0
- package/build/effects.native.d.ts.map +1 -0
- package/build/effects.native.js +1 -0
- package/build/effects.native.js.map +1 -0
- package/build/error-overlay/Data/LogBoxData.d.ts +60 -0
- package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -0
- package/build/error-overlay/Data/LogBoxData.js +386 -0
- package/build/error-overlay/Data/LogBoxData.js.map +1 -0
- package/build/error-overlay/Data/LogBoxLog.d.ts +61 -0
- package/build/error-overlay/Data/LogBoxLog.d.ts.map +1 -0
- package/build/error-overlay/Data/LogBoxLog.js +148 -0
- package/build/error-overlay/Data/LogBoxLog.js.map +1 -0
- package/build/error-overlay/Data/LogBoxSymbolication.d.ts +17 -0
- package/build/error-overlay/Data/LogBoxSymbolication.d.ts.map +1 -0
- package/build/error-overlay/Data/LogBoxSymbolication.js +56 -0
- package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -0
- package/build/error-overlay/Data/LogContext.d.ts +14 -0
- package/build/error-overlay/Data/LogContext.d.ts.map +1 -0
- package/build/error-overlay/Data/LogContext.js +27 -0
- package/build/error-overlay/Data/LogContext.js.map +1 -0
- package/build/error-overlay/Data/parseLogBoxLog.d.ts +45 -0
- package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -0
- package/build/error-overlay/Data/parseLogBoxLog.js +286 -0
- package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -0
- package/build/error-overlay/ErrorOverlay.d.ts +18 -0
- package/build/error-overlay/ErrorOverlay.d.ts.map +1 -0
- package/build/error-overlay/ErrorOverlay.js +146 -0
- package/build/error-overlay/ErrorOverlay.js.map +1 -0
- package/build/error-overlay/LogBox.d.ts +16 -0
- package/build/error-overlay/LogBox.d.ts.map +1 -0
- package/build/error-overlay/LogBox.js +31 -0
- package/build/error-overlay/LogBox.js.map +1 -0
- package/build/error-overlay/LogBox.web.d.ts +23 -0
- package/build/error-overlay/LogBox.web.d.ts.map +1 -0
- package/build/error-overlay/LogBox.web.js +129 -0
- package/build/error-overlay/LogBox.web.js.map +1 -0
- package/build/error-overlay/UI/AnsiHighlight.d.ts +6 -0
- package/build/error-overlay/UI/AnsiHighlight.d.ts.map +1 -0
- package/build/error-overlay/UI/AnsiHighlight.js +86 -0
- package/build/error-overlay/UI/AnsiHighlight.js.map +1 -0
- package/build/error-overlay/UI/LogBoxButton.d.ts +14 -0
- package/build/error-overlay/UI/LogBoxButton.d.ts.map +1 -0
- package/build/error-overlay/UI/LogBoxButton.js +59 -0
- package/build/error-overlay/UI/LogBoxButton.js.map +1 -0
- package/build/error-overlay/UI/LogBoxMessage.d.ts +11 -0
- package/build/error-overlay/UI/LogBoxMessage.d.ts.map +1 -0
- package/build/error-overlay/UI/LogBoxMessage.js +53 -0
- package/build/error-overlay/UI/LogBoxMessage.js.map +1 -0
- package/build/error-overlay/UI/LogBoxStyle.d.ts +22 -0
- package/build/error-overlay/UI/LogBoxStyle.d.ts.map +1 -0
- package/build/error-overlay/UI/LogBoxStyle.js +68 -0
- package/build/error-overlay/UI/LogBoxStyle.js.map +1 -0
- package/build/error-overlay/UI/constants.d.ts +2 -0
- package/build/error-overlay/UI/constants.d.ts.map +1 -0
- package/build/error-overlay/UI/constants.js +10 -0
- package/build/error-overlay/UI/constants.js.map +1 -0
- package/build/error-overlay/formatProjectFilePath.d.ts +2 -0
- package/build/error-overlay/formatProjectFilePath.d.ts.map +1 -0
- package/build/error-overlay/formatProjectFilePath.js +27 -0
- package/build/error-overlay/formatProjectFilePath.js.map +1 -0
- package/build/error-overlay/index.d.ts +3 -0
- package/build/error-overlay/index.d.ts.map +1 -0
- package/build/error-overlay/index.js +30 -0
- package/build/error-overlay/index.js.map +1 -0
- package/build/error-overlay/modules/ExceptionsManager/index.d.ts +38 -0
- package/build/error-overlay/modules/ExceptionsManager/index.d.ts.map +1 -0
- package/build/error-overlay/modules/ExceptionsManager/index.js +80 -0
- package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -0
- package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts +2 -0
- package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts.map +1 -0
- package/build/error-overlay/modules/ExceptionsManager/index.native.js +3 -0
- package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -0
- package/build/error-overlay/modules/NativeLogBox/index.d.ts +6 -0
- package/build/error-overlay/modules/NativeLogBox/index.d.ts.map +1 -0
- package/build/error-overlay/modules/NativeLogBox/index.js +34 -0
- package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -0
- package/build/error-overlay/modules/NativeLogBox/index.native.d.ts +3 -0
- package/build/error-overlay/modules/NativeLogBox/index.native.d.ts.map +1 -0
- package/build/error-overlay/modules/NativeLogBox/index.native.js +8 -0
- package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -0
- package/build/error-overlay/modules/openFileInEditor/index.d.ts +3 -0
- package/build/error-overlay/modules/openFileInEditor/index.d.ts.map +1 -0
- package/build/error-overlay/modules/openFileInEditor/index.js +15 -0
- package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -0
- package/build/error-overlay/modules/openFileInEditor/index.native.d.ts +3 -0
- package/build/error-overlay/modules/openFileInEditor/index.native.d.ts.map +1 -0
- package/build/error-overlay/modules/openFileInEditor/index.native.js +8 -0
- package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -0
- package/build/error-overlay/modules/parseErrorStack/index.d.ts +6 -0
- package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -0
- package/build/error-overlay/modules/parseErrorStack/index.js +25 -0
- package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -0
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.d.ts +3 -0
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.d.ts.map +1 -0
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js +9 -0
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -0
- package/build/error-overlay/modules/stringifySafe/index.d.ts +20 -0
- package/build/error-overlay/modules/stringifySafe/index.d.ts.map +1 -0
- package/build/error-overlay/modules/stringifySafe/index.js +117 -0
- package/build/error-overlay/modules/stringifySafe/index.js.map +1 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts +24 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts.map +1 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.js +19 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.d.ts +3 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.d.ts.map +1 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.js +8 -0
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts +5 -0
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +113 -0
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorFooter.d.ts +7 -0
- package/build/error-overlay/overlay/LogBoxInspectorFooter.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js +111 -0
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts +8 -0
- package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +139 -0
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts +12 -0
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +116 -0
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorSection.d.ts +8 -0
- package/build/error-overlay/overlay/LogBoxInspectorSection.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorSection.js +70 -0
- package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts +8 -0
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +127 -0
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts +11 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +103 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts +10 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +177 -0
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -0
- package/build/error-overlay/toast/ErrorToast.d.ts +11 -0
- package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -0
- package/build/error-overlay/toast/ErrorToast.js +147 -0
- package/build/error-overlay/toast/ErrorToast.js.map +1 -0
- package/build/error-overlay/toast/ErrorToastContainer.d.ts +4 -0
- package/build/error-overlay/toast/ErrorToastContainer.d.ts.map +1 -0
- package/build/error-overlay/toast/ErrorToastContainer.js +7 -0
- package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -0
- package/build/error-overlay/toast/ErrorToastContainer.web.d.ts +12 -0
- package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -0
- package/build/error-overlay/toast/ErrorToastContainer.web.js +83 -0
- package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -0
- package/build/error-overlay/toast/ErrorToastMessage.d.ts +5 -0
- package/build/error-overlay/toast/ErrorToastMessage.d.ts.map +1 -0
- package/build/error-overlay/toast/ErrorToastMessage.js +50 -0
- package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -0
- package/build/error-overlay/useRejectionHandler.d.ts +3 -0
- package/build/error-overlay/useRejectionHandler.d.ts.map +1 -0
- package/build/error-overlay/useRejectionHandler.js +60 -0
- package/build/error-overlay/useRejectionHandler.js.map +1 -0
- package/build/getDevServer.d.ts +8 -0
- package/build/getDevServer.d.ts.map +1 -0
- package/build/getDevServer.js +37 -0
- package/build/getDevServer.js.map +1 -0
- package/build/getDevServer.native.d.ts +1 -0
- package/build/getDevServer.native.d.ts.map +1 -0
- package/build/getDevServer.native.js +2 -0
- package/build/getDevServer.native.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +4 -0
- package/build/index.js.map +1 -0
- package/build/messageSocket.d.ts +3 -0
- package/build/messageSocket.d.ts.map +1 -0
- package/build/messageSocket.js +24 -0
- package/build/messageSocket.js.map +1 -0
- package/build/setupFastRefresh.d.ts +10 -0
- package/build/setupFastRefresh.d.ts.map +1 -0
- package/build/setupFastRefresh.js +23 -0
- package/build/setupFastRefresh.js.map +1 -0
- package/build/setupHMR.d.ts +2 -0
- package/build/setupHMR.d.ts.map +1 -0
- package/build/setupHMR.js +14 -0
- package/build/setupHMR.js.map +1 -0
- package/error-overlay.d.ts +1 -0
- package/error-overlay.js +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LogBoxInspectorHeader = void 0;
|
|
30
|
+
/**
|
|
31
|
+
* Copyright (c) Evan Bacon.
|
|
32
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const react_1 = __importDefault(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const LogContext_1 = require("../Data/LogContext");
|
|
40
|
+
const LogBoxButton_1 = require("../UI/LogBoxButton");
|
|
41
|
+
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
42
|
+
function LogBoxInspectorHeader(props) {
|
|
43
|
+
const { selectedLogIndex: selectedIndex, logs } = (0, LogContext_1.useLogs)();
|
|
44
|
+
const total = logs.length;
|
|
45
|
+
if (props.level === "syntax") {
|
|
46
|
+
return (react_1.default.createElement(react_native_1.View, { style: [styles.safeArea, styles[props.level]] },
|
|
47
|
+
react_1.default.createElement(react_native_1.View, { style: styles.header },
|
|
48
|
+
react_1.default.createElement(react_native_1.View, { style: styles.title },
|
|
49
|
+
react_1.default.createElement(react_native_1.Text, { style: styles.titleText }, "Failed to compile")))));
|
|
50
|
+
}
|
|
51
|
+
const prevIndex = selectedIndex - 1 < 0 ? total - 1 : selectedIndex - 1;
|
|
52
|
+
const nextIndex = selectedIndex + 1 > total - 1 ? 0 : selectedIndex + 1;
|
|
53
|
+
const titleText = `Log ${selectedIndex + 1} of ${total}`;
|
|
54
|
+
return (react_1.default.createElement(react_native_1.View, { style: [styles.safeArea, styles[props.level]] },
|
|
55
|
+
react_1.default.createElement(react_native_1.View, { style: styles.header },
|
|
56
|
+
react_1.default.createElement(LogBoxInspectorHeaderButton, { disabled: total <= 1, level: props.level, image: require("@expo/metro-runtime/assets/chevron-left.png"), onPress: () => props.onSelectIndex(prevIndex) }),
|
|
57
|
+
react_1.default.createElement(react_native_1.View, { style: styles.title },
|
|
58
|
+
react_1.default.createElement(react_native_1.Text, { style: styles.titleText }, titleText)),
|
|
59
|
+
react_1.default.createElement(LogBoxInspectorHeaderButton, { disabled: total <= 1, level: props.level, image: require("@expo/metro-runtime/assets/chevron-right.png"), onPress: () => props.onSelectIndex(nextIndex) }))));
|
|
60
|
+
}
|
|
61
|
+
exports.LogBoxInspectorHeader = LogBoxInspectorHeader;
|
|
62
|
+
const backgroundForLevel = (level) => ({
|
|
63
|
+
warn: {
|
|
64
|
+
default: "transparent",
|
|
65
|
+
pressed: LogBoxStyle.getWarningDarkColor(),
|
|
66
|
+
},
|
|
67
|
+
error: {
|
|
68
|
+
default: "transparent",
|
|
69
|
+
pressed: LogBoxStyle.getErrorDarkColor(),
|
|
70
|
+
},
|
|
71
|
+
fatal: {
|
|
72
|
+
default: "transparent",
|
|
73
|
+
pressed: LogBoxStyle.getFatalDarkColor(),
|
|
74
|
+
},
|
|
75
|
+
syntax: {
|
|
76
|
+
default: "transparent",
|
|
77
|
+
pressed: LogBoxStyle.getFatalDarkColor(),
|
|
78
|
+
},
|
|
79
|
+
}[level]);
|
|
80
|
+
function LogBoxInspectorHeaderButton(props) {
|
|
81
|
+
return (react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: backgroundForLevel(props.level), onPress: props.disabled ? undefined : props.onPress, style: headerStyles.button }, props.disabled ? null : (react_1.default.createElement(react_native_1.Image, { source: props.image, style: headerStyles.buttonImage }))));
|
|
82
|
+
}
|
|
83
|
+
const headerStyles = react_native_1.StyleSheet.create({
|
|
84
|
+
button: {
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
aspectRatio: 1,
|
|
87
|
+
justifyContent: "center",
|
|
88
|
+
marginTop: 5,
|
|
89
|
+
marginRight: 6,
|
|
90
|
+
marginLeft: 6,
|
|
91
|
+
marginBottom: react_native_1.Platform.select({
|
|
92
|
+
web: 0,
|
|
93
|
+
default: -8,
|
|
94
|
+
}),
|
|
95
|
+
borderRadius: 3,
|
|
96
|
+
},
|
|
97
|
+
buttonImage: {
|
|
98
|
+
height: 14,
|
|
99
|
+
width: 8,
|
|
100
|
+
tintColor: LogBoxStyle.getTextColor(),
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
const styles = react_native_1.StyleSheet.create({
|
|
104
|
+
syntax: {
|
|
105
|
+
backgroundColor: LogBoxStyle.getFatalColor(),
|
|
106
|
+
},
|
|
107
|
+
fatal: {
|
|
108
|
+
backgroundColor: LogBoxStyle.getFatalColor(),
|
|
109
|
+
},
|
|
110
|
+
warn: {
|
|
111
|
+
backgroundColor: LogBoxStyle.getWarningColor(),
|
|
112
|
+
},
|
|
113
|
+
error: {
|
|
114
|
+
backgroundColor: LogBoxStyle.getErrorColor(),
|
|
115
|
+
},
|
|
116
|
+
header: {
|
|
117
|
+
flexDirection: "row",
|
|
118
|
+
height: react_native_1.Platform.select({
|
|
119
|
+
default: 48,
|
|
120
|
+
ios: 44,
|
|
121
|
+
}),
|
|
122
|
+
},
|
|
123
|
+
title: {
|
|
124
|
+
alignItems: "center",
|
|
125
|
+
flex: 1,
|
|
126
|
+
justifyContent: "center",
|
|
127
|
+
},
|
|
128
|
+
titleText: {
|
|
129
|
+
color: LogBoxStyle.getTextColor(),
|
|
130
|
+
fontSize: 16,
|
|
131
|
+
fontWeight: "600",
|
|
132
|
+
includeFontPadding: false,
|
|
133
|
+
lineHeight: 20,
|
|
134
|
+
},
|
|
135
|
+
safeArea: {
|
|
136
|
+
paddingTop: react_native_1.Platform.OS !== "ios" ? react_native_1.StatusBar.currentHeight : 40,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=LogBoxInspectorHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorHeader.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAOsB;AAGtB,mDAA6C;AAC7C,qDAAkD;AAClD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAE1B,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC5B,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjD,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK;oBACvB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,wBAA0B,CAClD,CACF,CACF,CACR,CAAC;KACH;IAED,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,GAAG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AE;KACtC;CACF,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,KAAK,EAAE;QACL,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,WAAW,CAAC,eAAe,EAAE;KAC/C;IACD,KAAK,EAAE;QACL,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,MAAM,EAAE;QACN,aAAa,EAAE,KAAK;QACpB,MAAM,EAAE,uBAAQ,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IACD,KAAK,EAAE;QACL,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,wBAAS,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;KACjE;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport {\n Image,\n Platform,\n StatusBar,\n StyleSheet,\n Text,\n View,\n} from \"react-native\";\n\nimport type { LogLevel } from \"../Data/LogBoxLog\";\nimport { useLogs } from \"../Data/LogContext\";\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n onSelectIndex: (selectedIndex: number) => void;\n level: LogLevel;\n};\n\nexport function LogBoxInspectorHeader(props: Props) {\n const { selectedLogIndex: selectedIndex, logs } = useLogs();\n const total = logs.length;\n\n if (props.level === \"syntax\") {\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <View style={styles.title}>\n <Text style={styles.titleText}>Failed to compile</Text>\n </View>\n </View>\n </View>\n );\n }\n\n const prevIndex = selectedIndex - 1 < 0 ? total - 1 : selectedIndex - 1;\n const nextIndex = selectedIndex + 1 > total - 1 ? 0 : selectedIndex + 1;\n\n const titleText = `Log ${selectedIndex + 1} of ${total}`;\n\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require(\"@expo/metro-runtime/assets/chevron-left.png\")}\n onPress={() => props.onSelectIndex(prevIndex)}\n />\n <View style={styles.title}>\n <Text style={styles.titleText}>{titleText}</Text>\n </View>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require(\"@expo/metro-runtime/assets/chevron-right.png\")}\n onPress={() => props.onSelectIndex(nextIndex)}\n />\n </View>\n </View>\n );\n}\n\nconst backgroundForLevel = (level: LogLevel) =>\n ({\n warn: {\n default: \"transparent\",\n pressed: LogBoxStyle.getWarningDarkColor(),\n },\n error: {\n default: \"transparent\",\n pressed: LogBoxStyle.getErrorDarkColor(),\n },\n fatal: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n syntax: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n }[level]);\n\nfunction LogBoxInspectorHeaderButton(props: {\n disabled: boolean;\n image: number;\n level: LogLevel;\n onPress?: () => void;\n}) {\n return (\n <LogBoxButton\n backgroundColor={backgroundForLevel(props.level)}\n onPress={props.disabled ? undefined : props.onPress}\n style={headerStyles.button}\n >\n {props.disabled ? null : (\n <Image source={props.image} style={headerStyles.buttonImage} />\n )}\n </LogBoxButton>\n );\n}\n\nconst headerStyles = StyleSheet.create({\n button: {\n alignItems: \"center\",\n aspectRatio: 1,\n justifyContent: \"center\",\n marginTop: 5,\n marginRight: 6,\n marginLeft: 6,\n marginBottom: Platform.select({\n web: 0,\n default: -8,\n }),\n borderRadius: 3,\n },\n buttonImage: {\n height: 14,\n width: 8,\n tintColor: LogBoxStyle.getTextColor(),\n },\n});\n\nconst styles = StyleSheet.create({\n syntax: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n fatal: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n warn: {\n backgroundColor: LogBoxStyle.getWarningColor(),\n },\n error: {\n backgroundColor: LogBoxStyle.getErrorColor(),\n },\n header: {\n flexDirection: \"row\",\n height: Platform.select({\n default: 48,\n ios: 44,\n }),\n },\n title: {\n alignItems: \"center\",\n flex: 1,\n justifyContent: \"center\",\n },\n titleText: {\n color: LogBoxStyle.getTextColor(),\n fontSize: 16,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 20,\n },\n safeArea: {\n paddingTop: Platform.OS !== \"ios\" ? StatusBar.currentHeight : 40,\n },\n});\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LogLevel } from "../Data/LogBoxLog";
|
|
2
|
+
import type { Message } from "../Data/parseLogBoxLog";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
message: Message;
|
|
6
|
+
level: LogLevel;
|
|
7
|
+
title: string;
|
|
8
|
+
onPress: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function LogBoxInspectorMessageHeader(props: Props): JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=LogBoxInspectorMessageHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorMessageHeader.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorMessageHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAItD,aAAK,KAAK,GAAG;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAmBF,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,eAkBxD"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LogBoxInspectorMessageHeader = void 0;
|
|
30
|
+
/**
|
|
31
|
+
* Copyright (c) Evan Bacon.
|
|
32
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const react_1 = __importDefault(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const LogBoxMessage_1 = require("../UI/LogBoxMessage");
|
|
40
|
+
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
41
|
+
const SHOW_MORE_MESSAGE_LENGTH = 300;
|
|
42
|
+
function ShowMoreButton({ message, collapsed, onPress, }) {
|
|
43
|
+
if (message.content.length < SHOW_MORE_MESSAGE_LENGTH || !collapsed) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return (react_1.default.createElement(react_native_1.Text, { style: styles.collapse, onPress: onPress }, "... See More"));
|
|
47
|
+
}
|
|
48
|
+
function LogBoxInspectorMessageHeader(props) {
|
|
49
|
+
return (react_1.default.createElement(react_native_1.View, { style: styles.body },
|
|
50
|
+
react_1.default.createElement(react_native_1.View, { style: styles.heading },
|
|
51
|
+
react_1.default.createElement(react_native_1.Text, { style: [styles.headingText, styles[props.level]] }, props.title)),
|
|
52
|
+
react_1.default.createElement(react_native_1.Text, { style: styles.bodyText },
|
|
53
|
+
react_1.default.createElement(LogBoxMessage_1.LogBoxMessage, { maxLength: props.collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity, message: props.message, style: styles.messageText }),
|
|
54
|
+
react_1.default.createElement(ShowMoreButton, { ...props }))));
|
|
55
|
+
}
|
|
56
|
+
exports.LogBoxInspectorMessageHeader = LogBoxInspectorMessageHeader;
|
|
57
|
+
const styles = react_native_1.StyleSheet.create({
|
|
58
|
+
body: {
|
|
59
|
+
backgroundColor: LogBoxStyle.getBackgroundColor(1),
|
|
60
|
+
shadowColor: "#000",
|
|
61
|
+
shadowOffset: { width: 0, height: 2 },
|
|
62
|
+
shadowRadius: 2,
|
|
63
|
+
shadowOpacity: 0.5,
|
|
64
|
+
// flex: 0,
|
|
65
|
+
},
|
|
66
|
+
bodyText: {
|
|
67
|
+
color: LogBoxStyle.getTextColor(1),
|
|
68
|
+
fontSize: 14,
|
|
69
|
+
includeFontPadding: false,
|
|
70
|
+
lineHeight: 20,
|
|
71
|
+
fontWeight: "500",
|
|
72
|
+
paddingHorizontal: 12,
|
|
73
|
+
paddingBottom: 10,
|
|
74
|
+
},
|
|
75
|
+
heading: {
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
flexDirection: "row",
|
|
78
|
+
paddingHorizontal: 12,
|
|
79
|
+
marginTop: 10,
|
|
80
|
+
marginBottom: 5,
|
|
81
|
+
},
|
|
82
|
+
headingText: {
|
|
83
|
+
flex: 1,
|
|
84
|
+
fontSize: 20,
|
|
85
|
+
fontWeight: "600",
|
|
86
|
+
includeFontPadding: false,
|
|
87
|
+
lineHeight: 28,
|
|
88
|
+
},
|
|
89
|
+
warn: {
|
|
90
|
+
color: LogBoxStyle.getWarningColor(1),
|
|
91
|
+
},
|
|
92
|
+
error: {
|
|
93
|
+
color: LogBoxStyle.getErrorColor(1),
|
|
94
|
+
},
|
|
95
|
+
fatal: {
|
|
96
|
+
color: LogBoxStyle.getFatalColor(1),
|
|
97
|
+
},
|
|
98
|
+
syntax: {
|
|
99
|
+
color: LogBoxStyle.getFatalColor(1),
|
|
100
|
+
},
|
|
101
|
+
messageText: {
|
|
102
|
+
color: LogBoxStyle.getTextColor(0.6),
|
|
103
|
+
},
|
|
104
|
+
collapse: {
|
|
105
|
+
color: LogBoxStyle.getTextColor(0.7),
|
|
106
|
+
fontSize: 14,
|
|
107
|
+
fontWeight: "300",
|
|
108
|
+
lineHeight: 12,
|
|
109
|
+
},
|
|
110
|
+
button: {
|
|
111
|
+
paddingVertical: 5,
|
|
112
|
+
paddingHorizontal: 10,
|
|
113
|
+
borderRadius: 3,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=LogBoxInspectorMessageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorMessageHeader.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorMessageHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAsD;AAItD,uDAAoD;AACpD,+DAAiD;AAUjD,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,SAAS,cAAc,CAAC,EACtB,OAAO,EACP,SAAS,EACT,OAAO,GAC0C;IACjD,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,wBAAwB,IAAI,CAAC,SAAS,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,mBAEvC,CACR,CAAC;AACJ,CAAC;AAED,SAAgB,4BAA4B,CAAC,KAAY;IACvD,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO;YACzB,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IACnD,KAAK,CAAC,KAAK,CACP,CACF;QACP,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ;YAC1B,8BAAC,6BAAa,IACZ,S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AW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;KACf;IACD,MAAM,EAAE;QACN,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport type { LogLevel } from \"../Data/LogBoxLog\";\nimport type { Message } from \"../Data/parseLogBoxLog\";\nimport { LogBoxMessage } from \"../UI/LogBoxMessage\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n collapsed: boolean;\n message: Message;\n level: LogLevel;\n title: string;\n onPress: () => void;\n};\n\nconst SHOW_MORE_MESSAGE_LENGTH = 300;\n\nfunction ShowMoreButton({\n message,\n collapsed,\n onPress,\n}: Pick<Props, \"collapsed\" | \"message\" | \"onPress\">) {\n if (message.content.length < SHOW_MORE_MESSAGE_LENGTH || !collapsed) {\n return null;\n }\n return (\n <Text style={styles.collapse} onPress={onPress}>\n ... See More\n </Text>\n );\n}\n\nexport function LogBoxInspectorMessageHeader(props: Props) {\n return (\n <View style={styles.body}>\n <View style={styles.heading}>\n <Text style={[styles.headingText, styles[props.level]]}>\n {props.title}\n </Text>\n </View>\n <Text style={styles.bodyText}>\n <LogBoxMessage\n maxLength={props.collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity}\n message={props.message}\n style={styles.messageText}\n />\n <ShowMoreButton {...props} />\n </Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n body: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n shadowColor: \"#000\",\n shadowOffset: { width: 0, height: 2 },\n shadowRadius: 2,\n shadowOpacity: 0.5,\n // flex: 0,\n },\n bodyText: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n fontWeight: \"500\",\n paddingHorizontal: 12,\n paddingBottom: 10,\n },\n heading: {\n alignItems: \"center\",\n flexDirection: \"row\",\n paddingHorizontal: 12,\n marginTop: 10,\n marginBottom: 5,\n },\n headingText: {\n flex: 1,\n fontSize: 20,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 28,\n },\n warn: {\n color: LogBoxStyle.getWarningColor(1),\n },\n error: {\n color: LogBoxStyle.getErrorColor(1),\n },\n fatal: {\n color: LogBoxStyle.getFatalColor(1),\n },\n syntax: {\n color: LogBoxStyle.getFatalColor(1),\n },\n messageText: {\n color: LogBoxStyle.getTextColor(0.6),\n },\n collapse: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 14,\n fontWeight: \"300\",\n lineHeight: 12,\n },\n button: {\n paddingVertical: 5,\n paddingHorizontal: 10,\n borderRadius: 3,\n },\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSection.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSection.tsx"],"names":[],"mappings":"AAYA,aAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,MAAC;IACT,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,eAUlD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LogBoxInspectorSection = void 0;
|
|
30
|
+
/**
|
|
31
|
+
* Copyright (c) Evan Bacon.
|
|
32
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const react_1 = __importDefault(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
40
|
+
function LogBoxInspectorSection(props) {
|
|
41
|
+
return (react_1.default.createElement(react_native_1.View, { style: styles.section },
|
|
42
|
+
react_1.default.createElement(react_native_1.View, { style: styles.heading },
|
|
43
|
+
react_1.default.createElement(react_native_1.Text, { style: styles.headingText }, props.heading),
|
|
44
|
+
props.action),
|
|
45
|
+
react_1.default.createElement(react_native_1.View, { style: styles.body }, props.children)));
|
|
46
|
+
}
|
|
47
|
+
exports.LogBoxInspectorSection = LogBoxInspectorSection;
|
|
48
|
+
const styles = react_native_1.StyleSheet.create({
|
|
49
|
+
section: {
|
|
50
|
+
marginTop: 15,
|
|
51
|
+
},
|
|
52
|
+
heading: {
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
flexDirection: "row",
|
|
55
|
+
paddingHorizontal: 12,
|
|
56
|
+
marginBottom: 10,
|
|
57
|
+
},
|
|
58
|
+
headingText: {
|
|
59
|
+
color: LogBoxStyle.getTextColor(1),
|
|
60
|
+
flex: 1,
|
|
61
|
+
fontSize: 18,
|
|
62
|
+
fontWeight: "600",
|
|
63
|
+
includeFontPadding: false,
|
|
64
|
+
lineHeight: 20,
|
|
65
|
+
},
|
|
66
|
+
body: {
|
|
67
|
+
paddingBottom: 10,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=LogBoxInspectorSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSection.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAsD;AAEtD,+DAAiD;AAQjD,SAAgB,sBAAsB,CAAC,KAAY;IACjD,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO;QACzB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO;YACzB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,WAAW,IAAG,KAAK,CAAC,OAAO,CAAQ;YACtD,KAAK,CAAC,MAAM,CACR;QACP,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,IAAG,KAAK,CAAC,QAAQ,CAAQ,CAC5C,CACR,CAAC;AACJ,CAAC;AAVD,wDAUC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,SAAS,EAAE,EAAE;KACd;IACD,OAAO,EAAE;QACP,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,EAAE;KACjB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,EAAE;KAClB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n heading: string;\n children;\n action?: any;\n};\n\nexport function LogBoxInspectorSection(props: Props) {\n return (\n <View style={styles.section}>\n <View style={styles.heading}>\n <Text style={styles.headingText}>{props.heading}</Text>\n {props.action}\n </View>\n <View style={styles.body}>{props.children}</View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n section: {\n marginTop: 15,\n },\n heading: {\n alignItems: \"center\",\n flexDirection: \"row\",\n paddingHorizontal: 12,\n marginBottom: 10,\n },\n headingText: {\n color: LogBoxStyle.getTextColor(1),\n flex: 1,\n fontSize: 18,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 20,\n },\n body: {\n paddingBottom: 10,\n },\n});\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GestureResponderEvent } from "react-native";
|
|
2
|
+
declare type Props = {
|
|
3
|
+
onPress?: ((event: GestureResponderEvent) => void) | null;
|
|
4
|
+
status: "COMPLETE" | "FAILED" | "NONE" | "PENDING";
|
|
5
|
+
};
|
|
6
|
+
export declare function LogBoxInspectorSourceMapStatus(props: Props): JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=LogBoxInspectorSourceMapStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSourceMapStatus.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"AAQA,OAAO,EAGL,qBAAqB,EAGtB,MAAM,cAAc,CAAC;AAKtB,aAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1D,MAAM,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,KAAK,sBAuF1D"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.LogBoxInspectorSourceMapStatus = void 0;
|
|
27
|
+
/**
|
|
28
|
+
* Copyright (c) Evan Bacon.
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/
|
|
34
|
+
const react_1 = __importStar(require("react"));
|
|
35
|
+
const react_native_1 = require("react-native");
|
|
36
|
+
const LogBoxButton_1 = require("../UI/LogBoxButton");
|
|
37
|
+
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
38
|
+
function LogBoxInspectorSourceMapStatus(props) {
|
|
39
|
+
const [state, setState] = (0, react_1.useState)({
|
|
40
|
+
animation: null,
|
|
41
|
+
rotate: null,
|
|
42
|
+
});
|
|
43
|
+
(0, react_1.useEffect)(() => {
|
|
44
|
+
if (props.status === "PENDING") {
|
|
45
|
+
if (state.animation == null) {
|
|
46
|
+
const animated = new react_native_1.Animated.Value(0);
|
|
47
|
+
const animation = react_native_1.Animated.loop(react_native_1.Animated.timing(animated, {
|
|
48
|
+
duration: 2000,
|
|
49
|
+
easing: react_native_1.Easing.linear,
|
|
50
|
+
toValue: 1,
|
|
51
|
+
useNativeDriver: true,
|
|
52
|
+
}));
|
|
53
|
+
setState({
|
|
54
|
+
animation,
|
|
55
|
+
rotate: animated.interpolate({
|
|
56
|
+
inputRange: [0, 1],
|
|
57
|
+
outputRange: ["0deg", "360deg"],
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
animation.start();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
if (state.animation != null) {
|
|
65
|
+
state.animation.stop();
|
|
66
|
+
setState({
|
|
67
|
+
animation: null,
|
|
68
|
+
rotate: null,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return () => {
|
|
73
|
+
if (state.animation != null) {
|
|
74
|
+
state.animation.stop();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}, [props.status, state.animation]);
|
|
78
|
+
let image;
|
|
79
|
+
let color;
|
|
80
|
+
switch (props.status) {
|
|
81
|
+
case "FAILED":
|
|
82
|
+
image = require("@expo/metro-runtime/assets/alert-triangle.png");
|
|
83
|
+
color = LogBoxStyle.getErrorColor(1);
|
|
84
|
+
break;
|
|
85
|
+
case "PENDING":
|
|
86
|
+
image = require("@expo/metro-runtime/assets/loader.png");
|
|
87
|
+
color = LogBoxStyle.getWarningColor(1);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (props.status === "COMPLETE" || image == null) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return (react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: {
|
|
94
|
+
default: "transparent",
|
|
95
|
+
pressed: LogBoxStyle.getBackgroundColor(1),
|
|
96
|
+
}, hitSlop: { bottom: 8, left: 8, right: 8, top: 8 }, onPress: props.onPress, style: styles.root },
|
|
97
|
+
react_1.default.createElement(react_native_1.Animated.Image, { source: image, style: [
|
|
98
|
+
styles.image,
|
|
99
|
+
{ tintColor: color },
|
|
100
|
+
state.rotate == null || props.status !== "PENDING"
|
|
101
|
+
? null
|
|
102
|
+
: { transform: [{ rotate: state.rotate }] },
|
|
103
|
+
] }),
|
|
104
|
+
react_1.default.createElement(react_native_1.Text, { style: [styles.text, { color }] }, "Source Map")));
|
|
105
|
+
}
|
|
106
|
+
exports.LogBoxInspectorSourceMapStatus = LogBoxInspectorSourceMapStatus;
|
|
107
|
+
const styles = react_native_1.StyleSheet.create({
|
|
108
|
+
root: {
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
borderRadius: 12,
|
|
111
|
+
flexDirection: "row",
|
|
112
|
+
height: 24,
|
|
113
|
+
paddingHorizontal: 8,
|
|
114
|
+
},
|
|
115
|
+
image: {
|
|
116
|
+
height: 14,
|
|
117
|
+
width: 16,
|
|
118
|
+
marginEnd: 4,
|
|
119
|
+
tintColor: LogBoxStyle.getTextColor(0.4),
|
|
120
|
+
},
|
|
121
|
+
text: {
|
|
122
|
+
fontSize: 12,
|
|
123
|
+
includeFontPadding: false,
|
|
124
|
+
lineHeight: 16,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=LogBoxInspectorSourceMapStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSourceMapStatus.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAmD;AACnD,+CAMsB;AAEtB,qDAAkD;AAClD,+DAAiD;AAOjD,SAAgB,8BAA8B,CAAC,KAAY;IACzD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAG/B;QACD,SAAS,EAAE,IAAI;QACf,M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BAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,KAAK;QACpB,MAAM,EAAE,EAAE;QACV,iBAAiB,EAAE,CAAC;KACrB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACzC;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useEffect, useState } from \"react\";\nimport {\n Animated,\n Easing,\n GestureResponderEvent,\n StyleSheet,\n Text,\n} from \"react-native\";\n\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n onPress?: ((event: GestureResponderEvent) => void) | null;\n status: \"COMPLETE\" | \"FAILED\" | \"NONE\" | \"PENDING\";\n};\n\nexport function LogBoxInspectorSourceMapStatus(props: Props) {\n const [state, setState] = useState<{\n animation: null | Animated.CompositeAnimation;\n rotate: null | Animated.AnimatedInterpolation;\n }>({\n animation: null,\n rotate: null,\n });\n\n useEffect(() => {\n if (props.status === \"PENDING\") {\n if (state.animation == null) {\n const animated = new Animated.Value(0);\n const animation = Animated.loop(\n Animated.timing(animated, {\n duration: 2000,\n easing: Easing.linear,\n toValue: 1,\n useNativeDriver: true,\n })\n );\n setState({\n animation,\n rotate: animated.interpolate({\n inputRange: [0, 1],\n outputRange: [\"0deg\", \"360deg\"],\n }),\n });\n animation.start();\n }\n } else {\n if (state.animation != null) {\n state.animation.stop();\n setState({\n animation: null,\n rotate: null,\n });\n }\n }\n\n return () => {\n if (state.animation != null) {\n state.animation.stop();\n }\n };\n }, [props.status, state.animation]);\n\n let image;\n let color;\n switch (props.status) {\n case \"FAILED\":\n image = require(\"@expo/metro-runtime/assets/alert-triangle.png\");\n color = LogBoxStyle.getErrorColor(1);\n break;\n case \"PENDING\":\n image = require(\"@expo/metro-runtime/assets/loader.png\");\n color = LogBoxStyle.getWarningColor(1);\n break;\n }\n\n if (props.status === \"COMPLETE\" || image == null) {\n return null;\n }\n\n return (\n <LogBoxButton\n backgroundColor={{\n default: \"transparent\",\n pressed: LogBoxStyle.getBackgroundColor(1),\n }}\n hitSlop={{ bottom: 8, left: 8, right: 8, top: 8 }}\n onPress={props.onPress}\n style={styles.root}\n >\n <Animated.Image\n source={image}\n style={[\n styles.image,\n { tintColor: color },\n state.rotate == null || props.status !== \"PENDING\"\n ? null\n : { transform: [{ rotate: state.rotate }] },\n ]}\n />\n <Text style={[styles.text, { color }]}>Source Map</Text>\n </LogBoxButton>\n );\n}\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: \"center\",\n borderRadius: 12,\n flexDirection: \"row\",\n height: 24,\n paddingHorizontal: 8,\n },\n image: {\n height: 14,\n width: 16,\n marginEnd: 4,\n tintColor: LogBoxStyle.getTextColor(0.4),\n },\n text: {\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 16,\n },\n});\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GestureResponderEvent } from "react-native";
|
|
2
|
+
import { StackFrame } from "stacktrace-parser";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
frame: StackFrame & {
|
|
5
|
+
collapse?: boolean;
|
|
6
|
+
};
|
|
7
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function LogBoxInspectorStackFrame(props: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=LogBoxInspectorStackFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorStackFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO/C,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,UAAU,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,eAiCrD"}
|