@expo/metro-runtime 3.0.0 → 3.0.1
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/build/HMRClient.js +43 -15
- package/build/HMRClient.js.map +1 -1
- package/build/HMRClient.native.js +3 -1
- package/build/HMRClient.native.js.map +1 -1
- package/build/LoadingView.js +6 -4
- package/build/LoadingView.js.map +1 -1
- package/build/LoadingView.native.js +7 -2
- package/build/LoadingView.native.js.map +1 -1
- package/build/async-require/buildAsyncRequire.js +7 -3
- package/build/async-require/buildAsyncRequire.js.map +1 -1
- package/build/async-require/buildUrlForBundle.js +5 -1
- package/build/async-require/buildUrlForBundle.js.map +1 -1
- package/build/async-require/buildUrlForBundle.native.js +5 -1
- package/build/async-require/buildUrlForBundle.native.js.map +1 -1
- package/build/async-require/fetchAsync.js +7 -3
- package/build/async-require/fetchAsync.js.map +1 -1
- package/build/async-require/fetchAsync.native.js +13 -6
- package/build/async-require/fetchAsync.native.js.map +1 -1
- package/build/async-require/fetchThenEval.js +7 -3
- package/build/async-require/fetchThenEval.js.map +1 -1
- package/build/async-require/fetchThenEval.web.js +5 -1
- package/build/async-require/fetchThenEval.web.js.map +1 -1
- package/build/async-require/index.js +4 -2
- package/build/async-require/index.js.map +1 -1
- package/build/async-require/loadBundle.js +10 -6
- package/build/async-require/loadBundle.js.map +1 -1
- package/build/effects.js +12 -10
- package/build/effects.js.map +1 -1
- package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxData.js +82 -33
- package/build/error-overlay/Data/LogBoxData.js.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.js +29 -2
- package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
- package/build/error-overlay/Data/LogBoxSymbolication.js +12 -4
- package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
- package/build/error-overlay/Data/LogContext.js +17 -9
- package/build/error-overlay/Data/LogContext.js.map +1 -1
- package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -1
- package/build/error-overlay/Data/parseLogBoxLog.js +21 -11
- package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
- package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
- package/build/error-overlay/ErrorOverlay.js +73 -41
- package/build/error-overlay/ErrorOverlay.js.map +1 -1
- package/build/error-overlay/LogBox.js +3 -1
- package/build/error-overlay/LogBox.js.map +1 -1
- package/build/error-overlay/LogBox.web.js +5 -3
- package/build/error-overlay/LogBox.web.js.map +1 -1
- package/build/error-overlay/UI/AnsiHighlight.js +15 -8
- package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
- package/build/error-overlay/UI/LogBoxButton.js +35 -8
- package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
- package/build/error-overlay/UI/LogBoxMessage.js +13 -6
- package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
- package/build/error-overlay/UI/LogBoxStyle.js +31 -14
- package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
- package/build/error-overlay/UI/constants.js +5 -2
- package/build/error-overlay/UI/constants.js.map +1 -1
- package/build/error-overlay/formatProjectFilePath.js +7 -2
- package/build/error-overlay/formatProjectFilePath.js.map +1 -1
- package/build/error-overlay/index.d.ts.map +1 -1
- package/build/error-overlay/index.js +18 -9
- package/build/error-overlay/index.js.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.js +8 -3
- package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.native.js +7 -2
- package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.js +10 -5
- package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.native.js +7 -2
- package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.js +3 -1
- package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.native.js +7 -2
- package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.js +10 -7
- package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js +8 -2
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -1
- package/build/error-overlay/modules/stringifySafe/index.js +6 -2
- package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.js +3 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.js +7 -2
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +52 -22
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js +48 -18
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +53 -23
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +43 -13
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSection.js +39 -9
- package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +41 -14
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +44 -14
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +55 -24
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
- package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -1
- package/build/error-overlay/toast/ErrorToast.js +48 -21
- package/build/error-overlay/toast/ErrorToast.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.js +9 -3
- package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.js +49 -21
- package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastMessage.js +37 -7
- package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
- package/build/error-overlay/useRejectionHandler.js +16 -9
- package/build/error-overlay/useRejectionHandler.js.map +1 -1
- package/build/getDevServer.js +11 -6
- package/build/getDevServer.js.map +1 -1
- package/build/getDevServer.native.js +7 -2
- package/build/getDevServer.native.js.map +1 -1
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -3
- package/build/index.js.map +1 -1
- package/build/location/Location.js +7 -2
- package/build/location/Location.js.map +1 -1
- package/build/location/Location.native.js +12 -4
- package/build/location/Location.native.js.map +1 -1
- package/build/location/install.native.js +16 -11
- package/build/location/install.native.js.map +1 -1
- package/build/setupHMR.js +10 -5
- package/build/setupHMR.js.map +1 -1
- package/build/symbolicate.js +25 -4
- package/build/symbolicate.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
function openFileInEditor(file, lineNumber) {
|
|
2
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
3
5
|
// TODO: This is not a great URL since it now blocks users from accessing the `/open-stack-frame` url in their router
|
|
@@ -9,5 +11,5 @@ function openFileInEditor(file, lineNumber) {
|
|
|
9
11
|
});
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
|
-
|
|
14
|
+
exports.default = openFileInEditor;
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/openFileInEditor/index.ts"],"names":[],"mappings":"AAEA,SAAS,gBAAgB,CAAC,IAAY,EAAE,UAAkB;IACxD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,qHAAqH;QACrH,oEAAoE;QACpE,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAEvE,KAAK,CAAC,OAAO,GAAG,mBAAmB,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;SAC3C,CAAC,CAAC;KACJ;AACH,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/openFileInEditor/index.ts"],"names":[],"mappings":";;AAEA,SAAS,gBAAgB,CAAC,IAAY,EAAE,UAAkB;IACxD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,qHAAqH;QACrH,oEAAoE;QACpE,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAEvE,KAAK,CAAC,OAAO,GAAG,mBAAmB,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;SAC3C,CAAC,CAAC;KACJ;AACH,CAAC;AAED,kBAAe,gBAAgB,CAAC","sourcesContent":["declare const process: any;\n\nfunction openFileInEditor(file: string, lineNumber: number) {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: This is not a great URL since it now blocks users from accessing the `/open-stack-frame` url in their router\n // ideally it would be something like `/_devtools/open-stack-frame`.\n const baseUrl = window.location.protocol + '//' + window.location.host;\n\n fetch(baseUrl + '/open-stack-frame', {\n method: 'POST',\n body: JSON.stringify({ file, lineNumber }),\n });\n }\n}\n\nexport default openFileInEditor;\n"]}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const openFileInEditor_1 = __importDefault(require("react-native/Libraries/Core/Devtools/openFileInEditor"));
|
|
7
|
+
exports.default = openFileInEditor_1.default;
|
|
3
8
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/openFileInEditor/index.native.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/openFileInEditor/index.native.ts"],"names":[],"mappings":";;;;;AAAA,6GAAqF;AAErF,kBAAe,0BAAgB,CAAC","sourcesContent":["import openFileInEditor from 'react-native/Libraries/Core/Devtools/openFileInEditor';\n\nexport default openFileInEditor;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtD,iBAAS,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtD,iBAAS,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,EAAE,CAqBhF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const stacktrace_parser_1 = require("stacktrace-parser");
|
|
2
4
|
function parseErrorStack(stack) {
|
|
3
5
|
if (stack == null) {
|
|
4
6
|
return [];
|
|
@@ -6,11 +8,12 @@ function parseErrorStack(stack) {
|
|
|
6
8
|
if (Array.isArray(stack)) {
|
|
7
9
|
return stack;
|
|
8
10
|
}
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// This file seems to be web-only, so we can remove this.
|
|
12
|
+
// // Native support for parsing for non-standard Hermes stack traces.
|
|
13
|
+
// if (global.HermesInternal) {
|
|
14
|
+
// return require('./parseHermesStack').parseErrorStack(stack);
|
|
15
|
+
// }
|
|
16
|
+
return (0, stacktrace_parser_1.parse)(stack).map((frame) => {
|
|
14
17
|
// frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`
|
|
15
18
|
return {
|
|
16
19
|
...frame,
|
|
@@ -18,5 +21,5 @@ function parseErrorStack(stack) {
|
|
|
18
21
|
};
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
|
-
|
|
24
|
+
exports.default = parseErrorStack;
|
|
22
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/index.ts"],"names":[],"mappings":";;AAAA,yDAAsD;AAEtD,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,EAAE,CAAC;KACX;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IAED,yDAAyD;IACzD,sEAAsE;IACtE,+BAA+B;IAC/B,iEAAiE;IACjE,IAAI;IAEJ,OAAO,IAAA,yBAAK,EAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,wGAAwG;QACxG,OAAO;YACL,GAAG,KAAK;YACR,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;SACvD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,eAAe,CAAC","sourcesContent":["import { parse, StackFrame } from 'stacktrace-parser';\n\nfunction parseErrorStack(stack?: string): (StackFrame & { collapse?: boolean })[] {\n if (stack == null) {\n return [];\n }\n if (Array.isArray(stack)) {\n return stack;\n }\n\n // This file seems to be web-only, so we can remove this.\n // // Native support for parsing for non-standard Hermes stack traces.\n // if (global.HermesInternal) {\n // return require('./parseHermesStack').parseErrorStack(stack);\n // }\n\n return parse(stack).map((frame) => {\n // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`\n return {\n ...frame,\n column: frame.column != null ? frame.column - 1 : null,\n };\n });\n}\n\nexport default parseErrorStack;\n"]}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseErrorStack = void 0;
|
|
7
|
+
const parseErrorStack_1 = __importDefault(require("react-native/Libraries/Core/Devtools/parseErrorStack"));
|
|
8
|
+
exports.parseErrorStack = parseErrorStack_1.default;
|
|
3
9
|
//# sourceMappingURL=parseHermesStack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseHermesStack.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/parseHermesStack.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"parseHermesStack.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/parseHermesStack.ts"],"names":[],"mappings":";;;;;;AAAA,2GAAmF;AAE1E,0BAFF,yBAAe,CAEE","sourcesContent":["import parseErrorStack from 'react-native/Libraries/Core/Devtools/parseErrorStack';\n\nexport { parseErrorStack };\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) 650 Industries.
|
|
3
4
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -5,11 +6,13 @@
|
|
|
5
6
|
* This source code is licensed under the MIT license found in the
|
|
6
7
|
* LICENSE file in the root directory of this source tree.
|
|
7
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createStringifySafeWithLimits = void 0;
|
|
8
11
|
/**
|
|
9
12
|
* Tries to stringify with JSON.stringify and toString, but catches exceptions
|
|
10
13
|
* (e.g. from circular objects) and always returns a string and never throws.
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
function createStringifySafeWithLimits(limits) {
|
|
13
16
|
const { maxDepth = Number.POSITIVE_INFINITY, maxStringLimit = Number.POSITIVE_INFINITY, maxArrayLimit = Number.POSITIVE_INFINITY, maxObjectKeysLimit = Number.POSITIVE_INFINITY, } = limits;
|
|
14
17
|
const stack = [];
|
|
15
18
|
function replacer(_key, value) {
|
|
@@ -100,11 +103,12 @@ export function createStringifySafeWithLimits(limits) {
|
|
|
100
103
|
return '["' + typeof arg + '" failed to stringify]';
|
|
101
104
|
};
|
|
102
105
|
}
|
|
106
|
+
exports.createStringifySafeWithLimits = createStringifySafeWithLimits;
|
|
103
107
|
const stringifySafe = createStringifySafeWithLimits({
|
|
104
108
|
maxDepth: 10,
|
|
105
109
|
maxStringLimit: 100,
|
|
106
110
|
maxArrayLimit: 50,
|
|
107
111
|
maxObjectKeysLimit: 50,
|
|
108
112
|
});
|
|
109
|
-
|
|
113
|
+
exports.default = stringifySafe;
|
|
110
114
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;GAGG;AACH,SAAgB,6BAA6B,CAAC,MAK7C;IACC,MAAM,EACJ,QAAQ,GAAG,MAAM,CAAC,iBAAiB,EACnC,cAAc,GAAG,MAAM,CAAC,iBAAiB,EACzC,aAAa,GAAG,MAAM,CAAC,iBAAiB,EACxC,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,GAC9C,GAAG,MAAM,CAAC;IACX,MAAM,KAAK,GAAU,EAAE,CAAC;IACxB,SAAS,QAAQ,CAAgB,IAAY,EAAE,KAAU;QACvD,OAAO,KAAK,CAAC,MAAM,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CA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MAAM,GAAE;iBACX;aACF;SACF;QACD,OAAO,IAAI,GAAG,OAAO,GAAG,GAAG,wBAAwB,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC;AA7FD,sEA6FC;AAED,MAAM,aAAa,GAAG,6BAA6B,CAAC;IAClD,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,GAAG;IACnB,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,EAAE;CACvB,CAAC,CAAC;AAEH,kBAAe,aAAa,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\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 */\n\n/**\n * Tries to stringify with JSON.stringify and toString, but catches exceptions\n * (e.g. from circular objects) and always returns a string and never throws.\n */\nexport function createStringifySafeWithLimits(limits: {\n maxDepth?: number;\n maxStringLimit?: number;\n maxArrayLimit?: number;\n maxObjectKeysLimit?: number;\n}): (foo: any) => string {\n const {\n maxDepth = Number.POSITIVE_INFINITY,\n maxStringLimit = Number.POSITIVE_INFINITY,\n maxArrayLimit = Number.POSITIVE_INFINITY,\n maxObjectKeysLimit = Number.POSITIVE_INFINITY,\n } = limits;\n const stack: any[] = [];\n function replacer(this: unknown, _key: string, value: any): any {\n while (stack.length && this !== stack[0]) {\n stack.shift();\n }\n\n if (typeof value === 'string') {\n const truncatedString = '...(truncated)...';\n if (value.length > maxStringLimit + truncatedString.length) {\n return value.substring(0, maxStringLimit) + truncatedString;\n }\n return value;\n }\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n\n let retval = value;\n if (Array.isArray(value)) {\n if (stack.length >= maxDepth) {\n retval = `[ ... array with ${value.length} values ... ]`;\n } else if (value.length > maxArrayLimit) {\n retval = value\n .slice(0, maxArrayLimit)\n .concat([`... extra ${value.length - maxArrayLimit} values truncated ...`]);\n }\n } else {\n // Add refinement after Array.isArray call.\n if (typeof value !== 'object') {\n throw new Error('This was already found earlier');\n }\n const keys = Object.keys(value);\n if (stack.length >= maxDepth) {\n retval = `{ ... object with ${keys.length} keys ... }`;\n } else if (keys.length > maxObjectKeysLimit) {\n // Return a sample of the keys.\n retval = {};\n for (const k of keys.slice(0, maxObjectKeysLimit)) {\n retval[k] = value[k];\n }\n const truncatedKey = '...(truncated keys)...';\n retval[truncatedKey] = keys.length - maxObjectKeysLimit;\n }\n }\n stack.unshift(retval);\n return retval;\n }\n\n return function stringifySafe(arg: any): string {\n if (arg === undefined) {\n return 'undefined';\n } else if (arg === null) {\n return 'null';\n } else if (typeof arg === 'function') {\n try {\n return arg.toString();\n } catch {\n return '[function unknown]';\n }\n } else if (arg instanceof Error) {\n return arg.name + ': ' + arg.message;\n } else {\n // Perform a try catch, just in case the object has a circular\n // reference or stringify throws for some other reason.\n try {\n const ret = JSON.stringify(arg, replacer);\n if (ret === undefined) {\n return '[\"' + typeof arg + '\" failed to stringify]';\n }\n return ret;\n } catch {\n if (typeof arg.toString === 'function') {\n try {\n // $FlowFixMe[incompatible-use] : toString shouldn't take any arguments in general.\n return arg.toString();\n } catch {}\n }\n }\n }\n return '[\"' + typeof arg + '\" failed to stringify]';\n };\n}\n\nconst stringifySafe = createStringifySafeWithLimits({\n maxDepth: 10,\n maxStringLimit: 100,\n maxArrayLimit: 50,\n maxObjectKeysLimit: 50,\n});\n\nexport default stringifySafe;\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) 650 Industries.
|
|
3
4
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -5,6 +6,7 @@
|
|
|
5
6
|
* This source code is licensed under the MIT license found in the
|
|
6
7
|
* LICENSE file in the root directory of this source tree.
|
|
7
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
10
|
async function symbolicateStackTrace(stack) {
|
|
9
11
|
const baseUrl = typeof window === 'undefined'
|
|
10
12
|
? process.env.EXPO_DEV_SERVER_ORIGIN
|
|
@@ -15,5 +17,5 @@ async function symbolicateStackTrace(stack) {
|
|
|
15
17
|
});
|
|
16
18
|
return await response.json();
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
exports.default = symbolicateStackTrace;
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,KAAK,UAAU,qBAAqB,CAAC,KAAmB;IACtD,MAAM,OAAO,GACX,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB;QACpC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,GAAG,cAAc,EAAE;QACrD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,kBAAe,qBAAqB,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\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 */\n\nimport { StackFrame } from 'stacktrace-parser';\n\nexport type CodeFrame = {\n content: string;\n location?: {\n row: number;\n column: number;\n [key: string]: any;\n };\n fileName: string;\n};\n\nexport type SymbolicatedStackTrace = {\n stack: StackFrame[];\n codeFrame?: CodeFrame;\n};\n\nasync function symbolicateStackTrace(stack: StackFrame[]): Promise<SymbolicatedStackTrace> {\n const baseUrl =\n typeof window === 'undefined'\n ? process.env.EXPO_DEV_SERVER_ORIGIN\n : window.location.protocol + '//' + window.location.host;\n\n const response = await fetch(baseUrl + '/symbolicate', {\n method: 'POST',\n body: JSON.stringify({ stack }),\n });\n return await response.json();\n}\n\nexport default symbolicateStackTrace;\n"]}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const symbolicateStackTrace_1 = __importDefault(require("react-native/Libraries/Core/Devtools/symbolicateStackTrace"));
|
|
7
|
+
exports.default = symbolicateStackTrace_1.default;
|
|
3
8
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.native.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.native.ts"],"names":[],"mappings":";;;;;AAAA,uHAA+F;AAE/F,kBAAe,+BAAqB,CAAC","sourcesContent":["import symbolicateStackTrace from 'react-native/Libraries/Core/Devtools/symbolicateStackTrace';\n\nexport default symbolicateStackTrace;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorCodeFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorCodeFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUxD,wBAAgB,wBAAwB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,sBA2ChF"}
|
|
@@ -1,3 +1,32 @@
|
|
|
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.LogBoxInspectorCodeFrame = void 0;
|
|
1
30
|
/**
|
|
2
31
|
* Copyright (c) 650 Industries.
|
|
3
32
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -5,21 +34,21 @@
|
|
|
5
34
|
* This source code is licensed under the MIT license found in the
|
|
6
35
|
* LICENSE file in the root directory of this source tree.
|
|
7
36
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
const react_1 = __importDefault(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const LogBoxInspectorSection_1 = require("./LogBoxInspectorSection");
|
|
40
|
+
const AnsiHighlight_1 = require("../UI/AnsiHighlight");
|
|
41
|
+
const LogBoxButton_1 = require("../UI/LogBoxButton");
|
|
42
|
+
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
43
|
+
const constants_1 = require("../UI/constants");
|
|
44
|
+
const formatProjectFilePath_1 = require("../formatProjectFilePath");
|
|
45
|
+
const openFileInEditor_1 = __importDefault(require("../modules/openFileInEditor"));
|
|
46
|
+
function LogBoxInspectorCodeFrame({ codeFrame }) {
|
|
18
47
|
if (codeFrame == null) {
|
|
19
48
|
return null;
|
|
20
49
|
}
|
|
21
50
|
function getFileName() {
|
|
22
|
-
return formatProjectFilePath(process.env.EXPO_PROJECT_ROOT, codeFrame?.fileName);
|
|
51
|
+
return (0, formatProjectFilePath_1.formatProjectFilePath)(process.env.EXPO_PROJECT_ROOT, codeFrame?.fileName);
|
|
23
52
|
}
|
|
24
53
|
function getLocation() {
|
|
25
54
|
const location = codeFrame?.location;
|
|
@@ -28,22 +57,23 @@ export function LogBoxInspectorCodeFrame({ codeFrame }) {
|
|
|
28
57
|
}
|
|
29
58
|
return null;
|
|
30
59
|
}
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
return (react_1.default.createElement(LogBoxInspectorSection_1.LogBoxInspectorSection, { heading: "Source" },
|
|
61
|
+
react_1.default.createElement(react_native_1.View, { style: styles.box },
|
|
62
|
+
react_1.default.createElement(react_native_1.View, { style: styles.frame },
|
|
63
|
+
react_1.default.createElement(react_native_1.ScrollView, { horizontal: true },
|
|
64
|
+
react_1.default.createElement(AnsiHighlight_1.Ansi, { style: styles.content, text: codeFrame.content }))),
|
|
65
|
+
react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: {
|
|
37
66
|
default: 'transparent',
|
|
38
67
|
pressed: LogBoxStyle.getBackgroundDarkColor(1),
|
|
39
68
|
}, style: styles.button, onPress: () => {
|
|
40
|
-
|
|
69
|
+
(0, openFileInEditor_1.default)(codeFrame.fileName, codeFrame.location?.row ?? 0);
|
|
41
70
|
} },
|
|
42
|
-
|
|
71
|
+
react_1.default.createElement(react_native_1.Text, { style: styles.fileText },
|
|
43
72
|
getFileName(),
|
|
44
73
|
getLocation())))));
|
|
45
74
|
}
|
|
46
|
-
|
|
75
|
+
exports.LogBoxInspectorCodeFrame = LogBoxInspectorCodeFrame;
|
|
76
|
+
const styles = react_native_1.StyleSheet.create({
|
|
47
77
|
box: {
|
|
48
78
|
backgroundColor: LogBoxStyle.getBackgroundColor(),
|
|
49
79
|
borderWidth: 1,
|
|
@@ -67,7 +97,7 @@ const styles = StyleSheet.create({
|
|
|
67
97
|
fontSize: 12,
|
|
68
98
|
includeFontPadding: false,
|
|
69
99
|
lineHeight: 20,
|
|
70
|
-
fontFamily: CODE_FONT,
|
|
100
|
+
fontFamily: constants_1.CODE_FONT,
|
|
71
101
|
},
|
|
72
102
|
fileText: {
|
|
73
103
|
userSelect: 'none',
|
|
@@ -76,7 +106,7 @@ const styles = StyleSheet.create({
|
|
|
76
106
|
flex: 1,
|
|
77
107
|
fontSize: 16,
|
|
78
108
|
includeFontPadding: false,
|
|
79
|
-
fontFamily: CODE_FONT,
|
|
109
|
+
fontFamily: constants_1.CODE_FONT,
|
|
80
110
|
},
|
|
81
111
|
});
|
|
82
112
|
//# sourceMappingURL=LogBoxInspectorCodeFrame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAkE;AAElE,qEAAkE;AAElE,uDAA2C;AAC3C,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAiE;AACjE,mFAA2D;AAI3D,SAAgB,wBAAwB,CAAC,EAAE,SAAS,EAA6B;IAC/E,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IAED,SAAS,WAAW;QAClB,OAAO,IAAA,6CAAqB,EAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnF,CAAC;IAED,SAAS,WAAW;QAClB,MAAM,QAAQ,GAAG,SAAS,EAAE,QAAQ,CAAC;QACrC,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO,KAAK,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,yCAAyC,GAAG,CAAC;SAC9F;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,+CAAsB,IAAC,OAAO,EAAC,QAAQ;QACtC,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG;YACrB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACvB,8BAAC,yBAAU,IAAC,UAAU;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,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,qBAAS;KACtB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\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 { ScrollView, StyleSheet, Text, View } from 'react-native';\n\nimport { LogBoxInspectorSection } from './LogBoxInspectorSection';\nimport type { CodeFrame } from '../Data/parseLogBoxLog';\nimport { Ansi } from '../UI/AnsiHighlight';\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\nimport { CODE_FONT } from '../UI/constants';\nimport { formatProjectFilePath } from '../formatProjectFilePath';\nimport openFileInEditor from '../modules/openFileInEditor';\n\ndeclare const process: any;\n\nexport function LogBoxInspectorCodeFrame({ codeFrame }: { codeFrame?: CodeFrame }) {\n if (codeFrame == null) {\n return null;\n }\n\n function getFileName() {\n return formatProjectFilePath(process.env.EXPO_PROJECT_ROOT, codeFrame?.fileName);\n }\n\n function getLocation() {\n const location = codeFrame?.location;\n if (location != null) {\n return ` (${location.row}:${location.column + 1 /* Code frame columns are zero indexed */})`;\n }\n\n return null;\n }\n\n return (\n <LogBoxInspectorSection heading=\"Source\">\n <View style={styles.box}>\n <View style={styles.frame}>\n <ScrollView horizontal>\n <Ansi style={styles.content} text={codeFrame.content} />\n </ScrollView>\n </View>\n <LogBoxButton\n backgroundColor={{\n default: 'transparent',\n pressed: LogBoxStyle.getBackgroundDarkColor(1),\n }}\n style={styles.button}\n onPress={() => {\n openFileInEditor(codeFrame.fileName, codeFrame.location?.row ?? 0);\n }}>\n <Text style={styles.fileText}>\n {getFileName()}\n {getLocation()}\n </Text>\n </LogBoxButton>\n </View>\n </LogBoxInspectorSection>\n );\n}\n\nconst styles = StyleSheet.create({\n box: {\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n borderWidth: 1,\n borderColor: '#323232',\n marginLeft: 10,\n marginRight: 10,\n marginTop: 5,\n borderRadius: 3,\n },\n frame: {\n padding: 10,\n borderBottomColor: LogBoxStyle.getTextColor(0.1),\n borderBottomWidth: 1,\n },\n button: {\n paddingTop: 10,\n paddingBottom: 10,\n },\n content: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 20,\n fontFamily: CODE_FONT,\n },\n fileText: {\n userSelect: 'none',\n color: LogBoxStyle.getTextColor(0.5),\n textAlign: 'center',\n flex: 1,\n fontSize: 16,\n includeFontPadding: false,\n fontFamily: CODE_FONT,\n },\n});\n"]}
|
|
@@ -1,3 +1,32 @@
|
|
|
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.LogBoxInspectorFooter = void 0;
|
|
1
30
|
/**
|
|
2
31
|
* Copyright (c) 650 Industries.
|
|
3
32
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -5,25 +34,26 @@
|
|
|
5
34
|
* This source code is licensed under the MIT license found in the
|
|
6
35
|
* LICENSE file in the root directory of this source tree.
|
|
7
36
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const log = useSelectedLog();
|
|
37
|
+
const react_1 = __importDefault(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const LogContext_1 = require("../Data/LogContext");
|
|
40
|
+
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
41
|
+
function LogBoxInspectorFooter(props) {
|
|
42
|
+
const log = (0, LogContext_1.useSelectedLog)();
|
|
14
43
|
if (['static', 'syntax'].includes(log.level)) {
|
|
15
|
-
return (
|
|
16
|
-
|
|
17
|
-
|
|
44
|
+
return (react_1.default.createElement(react_native_1.View, { style: styles.root },
|
|
45
|
+
react_1.default.createElement(react_native_1.View, { style: styles.button },
|
|
46
|
+
react_1.default.createElement(react_native_1.Text, { style: styles.syntaxErrorText }, "This error cannot be dismissed."))));
|
|
18
47
|
}
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
48
|
+
return (react_1.default.createElement(react_native_1.View, { style: styles.root },
|
|
49
|
+
react_1.default.createElement(FooterButton, { text: "Dismiss", onPress: props.onDismiss }),
|
|
50
|
+
react_1.default.createElement(FooterButton, { text: "Minimize", onPress: props.onMinimize })));
|
|
22
51
|
}
|
|
52
|
+
exports.LogBoxInspectorFooter = LogBoxInspectorFooter;
|
|
23
53
|
function FooterButton({ text, onPress }) {
|
|
24
|
-
return (
|
|
54
|
+
return (react_1.default.createElement(react_native_1.Pressable, { onPress: onPress, style: { flex: 1 } }, ({
|
|
25
55
|
/** @ts-expect-error: react-native types are broken. */
|
|
26
|
-
hovered, pressed, }) => (
|
|
56
|
+
hovered, pressed, }) => (react_1.default.createElement(react_native_1.View, { style: [
|
|
27
57
|
buttonStyles.safeArea,
|
|
28
58
|
{
|
|
29
59
|
// @ts-expect-error: web-only type
|
|
@@ -35,10 +65,10 @@ function FooterButton({ text, onPress }) {
|
|
|
35
65
|
: LogBoxStyle.getBackgroundColor(),
|
|
36
66
|
},
|
|
37
67
|
] },
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
react_1.default.createElement(react_native_1.View, { style: buttonStyles.content },
|
|
69
|
+
react_1.default.createElement(react_native_1.Text, { style: buttonStyles.label }, text))))));
|
|
40
70
|
}
|
|
41
|
-
const buttonStyles = StyleSheet.create({
|
|
71
|
+
const buttonStyles = react_native_1.StyleSheet.create({
|
|
42
72
|
safeArea: {
|
|
43
73
|
flex: 1,
|
|
44
74
|
borderTopWidth: 1,
|
|
@@ -58,7 +88,7 @@ const buttonStyles = StyleSheet.create({
|
|
|
58
88
|
lineHeight: 20,
|
|
59
89
|
},
|
|
60
90
|
});
|
|
61
|
-
const styles = StyleSheet.create({
|
|
91
|
+
const styles = react_native_1.StyleSheet.create({
|
|
62
92
|
root: {
|
|
63
93
|
backgroundColor: LogBoxStyle.getBackgroundColor(1),
|
|
64
94
|
boxShadow: `0 -2px 0 2px #000`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAiE;AAEjE,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAAG,GAAG,IAAA,2BAAc,GAAE,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC5C,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;YACtB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,sCAAwC,CACtE,CACF,CACR,CAAC;KACH;IAED,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,YAAY,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAI;QACzD,8BAAC,YAAY,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,KAAK,CAAC,UAAU,GAAI,CACtD,CACR,CAAC;AACJ,CAAC;AAnBD,sDAmBC;AAED,SAAS,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAyC;IAC5E,OAAO,CACL,8BAAC,wBAAS,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAC5C,CAAC;IACA,uDAAuD;IACvD,OAAO,EACP,OAAO,GACR,EAAE,EAAE,CAAC,CACJ,8BAAC,mBAAI,IACH,KAAK,EAAE;YACL,YAAY,CAAC,QAAQ;YACr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jB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\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 { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { useSelectedLog } from '../Data/LogContext';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n onDismiss: () => void;\n onMinimize: () => void;\n};\n\nexport function LogBoxInspectorFooter(props: Props) {\n const log = useSelectedLog();\n\n if (['static', 'syntax'].includes(log.level)) {\n return (\n <View style={styles.root}>\n <View style={styles.button}>\n <Text style={styles.syntaxErrorText}>This error cannot be dismissed.</Text>\n </View>\n </View>\n );\n }\n\n return (\n <View style={styles.root}>\n <FooterButton text=\"Dismiss\" onPress={props.onDismiss} />\n <FooterButton text=\"Minimize\" onPress={props.onMinimize} />\n </View>\n );\n}\n\nfunction FooterButton({ text, onPress }: { onPress: () => void; text: string }) {\n return (\n <Pressable onPress={onPress} style={{ flex: 1 }}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[\n buttonStyles.safeArea,\n {\n // @ts-expect-error: web-only type\n transitionDuration: '150ms',\n backgroundColor: pressed\n ? '#323232'\n : hovered\n ? '#111111'\n : LogBoxStyle.getBackgroundColor(),\n },\n ]}>\n <View style={buttonStyles.content}>\n <Text style={buttonStyles.label}>{text}</Text>\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst buttonStyles = StyleSheet.create({\n safeArea: {\n flex: 1,\n borderTopWidth: 1,\n borderColor: '#323232',\n // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,\n },\n content: {\n alignItems: 'center',\n height: 48,\n justifyContent: 'center',\n },\n label: {\n userSelect: 'none',\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n },\n});\n\nconst styles = StyleSheet.create({\n root: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n boxShadow: `0 -2px 0 2px #000`,\n flexDirection: 'row',\n },\n button: {\n flex: 1,\n },\n syntaxErrorText: {\n textAlign: 'center',\n width: '100%',\n height: 48,\n fontSize: 14,\n lineHeight: 20,\n paddingTop: 20,\n paddingBottom: 50,\n fontStyle: 'italic',\n color: LogBoxStyle.getTextColor(0.6),\n },\n});\n"]}
|