@expo/metro-runtime 3.2.0 → 3.2.2
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.map +1 -1
- package/build/LoadingView.native.d.ts +1 -1
- package/build/LoadingView.native.d.ts.map +1 -1
- package/build/LoadingView.native.js +9 -5
- package/build/LoadingView.native.js.map +1 -1
- package/build/async-require/buildAsyncRequire.js +2 -1
- package/build/async-require/buildAsyncRequire.js.map +1 -1
- package/build/async-require/buildUrlForBundle.js +2 -1
- package/build/async-require/buildUrlForBundle.js.map +1 -1
- package/build/async-require/buildUrlForBundle.native.js +2 -1
- package/build/async-require/buildUrlForBundle.native.js.map +1 -1
- package/build/async-require/fetchAsync.js +2 -1
- package/build/async-require/fetchAsync.js.map +1 -1
- package/build/async-require/fetchAsync.native.js +2 -1
- package/build/async-require/fetchAsync.native.js.map +1 -1
- package/build/async-require/fetchThenEval.web.js +2 -1
- package/build/async-require/fetchThenEval.web.js.map +1 -1
- package/build/async-require/fetchThenEvalJs.js +2 -1
- package/build/async-require/fetchThenEvalJs.js.map +1 -1
- package/build/async-require/index.native.js.map +1 -1
- package/build/async-require/loadBundle.js +2 -1
- package/build/async-require/loadBundle.js.map +1 -1
- package/build/effects.js.map +1 -1
- package/build/error-overlay/Data/LogBoxData.js +21 -20
- package/build/error-overlay/Data/LogBoxData.js.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
- package/build/error-overlay/Data/LogBoxSymbolication.js +3 -2
- package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
- package/build/error-overlay/Data/LogContext.js +3 -3
- package/build/error-overlay/Data/LogContext.js.map +1 -1
- package/build/error-overlay/Data/parseLogBoxLog.js +6 -5
- package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
- package/build/error-overlay/ErrorOverlay.js +5 -4
- package/build/error-overlay/ErrorOverlay.js.map +1 -1
- package/build/error-overlay/LogBox.web.js.map +1 -1
- package/build/error-overlay/UI/AnsiHighlight.js +2 -1
- package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
- package/build/error-overlay/UI/LogBoxButton.js +2 -1
- package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
- package/build/error-overlay/UI/LogBoxMessage.js +2 -1
- package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
- package/build/error-overlay/UI/LogBoxStyle.js +15 -14
- package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
- package/build/error-overlay/formatProjectFilePath.js +3 -2
- package/build/error-overlay/formatProjectFilePath.js.map +1 -1
- package/build/error-overlay/index.js +2 -1
- package/build/error-overlay/index.js.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
- package/build/error-overlay/modules/stringifySafe/index.js +2 -1
- package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSection.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +2 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +3 -2
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
- package/build/error-overlay/toast/ErrorToast.js +2 -1
- package/build/error-overlay/toast/ErrorToast.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.js +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.js +2 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastMessage.js +2 -1
- package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
- package/build/error-overlay/useRejectionHandler.js +2 -1
- package/build/error-overlay/useRejectionHandler.js.map +1 -1
- package/build/getDevServer.js.map +1 -1
- package/build/location/Location.js +3 -2
- package/build/location/Location.js.map +1 -1
- package/build/location/Location.native.js +3 -2
- package/build/location/Location.native.js.map +1 -1
- package/build/location/install.native.js.map +1 -1
- package/build/messageSocket.js.map +1 -1
- package/build/setupFastRefresh.js.map +1 -1
- package/package.json +2 -2
- package/src/LoadingView.native.ts +8 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorSourceMapStatus.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSourceMapStatus.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAmD;AACnD,+CAAyF;AAEzF,qDAAkD;AAClD,+DAAiD;AAOjD,SAAgB,8BAA8B,CAAC,KAAY;IACzD,MAAM,CAAC,KAAK,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,EAAE,KAAK,EAAE,CAAC,iBAAmB,CAC3C,CAChB,CAAC;AACJ,CAAC;AAtFD,wEAsFC;AAED,MAAM,MAAM,GAAG,yBAAU,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;KACb;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;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 */\n\n'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { Animated, Easing, GestureResponderEvent, StyleSheet, Text } 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<string>;\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 <Animated.Image\n source={image}\n tintColor={color ?? LogBoxStyle.getTextColor(0.4)}\n style={[\n styles.image,\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 },\n text: {\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 16,\n },\n});\n"]}
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.LogBoxInspectorStackFrame =
|
|
29
|
+
exports.LogBoxInspectorStackFrame = void 0;
|
|
30
30
|
/**
|
|
31
31
|
* Copyright (c) 650 Industries.
|
|
32
32
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -51,6 +51,7 @@ function LogBoxInspectorStackFrame(props) {
|
|
|
51
51
|
react_1.default.createElement(react_native_1.Text, { style: [styles.name, frame.collapse === true && styles.dim] }, frame.methodName),
|
|
52
52
|
react_1.default.createElement(react_native_1.Text, { ellipsizeMode: "middle", numberOfLines: 1, style: [styles.location, frame.collapse === true && styles.dim] }, location))));
|
|
53
53
|
}
|
|
54
|
+
exports.LogBoxInspectorStackFrame = LogBoxInspectorStackFrame;
|
|
54
55
|
const styles = react_native_1.StyleSheet.create({
|
|
55
56
|
frameContainer: {
|
|
56
57
|
flexDirection: 'row',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorStackFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorStackFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAA6E;AAG7E,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAqE;AASrE,SAAgB,yBAAyB,CAAC,KAAY;IACpD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAA,iDAAyB,EAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACjF,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc;QAChC,8BAAC,2BAAY,IACX,eAAe,EAAE;gBACf,OAAO,EAAE,aAAa;gBACtB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa;aACrE,EACD,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,CAAC,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K,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;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 { GestureResponderEvent, StyleSheet, Text, View } from 'react-native';\nimport { StackFrame } from 'stacktrace-parser';\n\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\nimport { CODE_FONT } from '../UI/constants';\nimport { getStackFormattedLocation } from '../formatProjectFilePath';\n\ndeclare const process: any;\n\ntype Props = {\n frame: StackFrame & { collapse?: boolean };\n onPress?: (event: GestureResponderEvent) => void;\n};\n\nexport function LogBoxInspectorStackFrame(props: Props) {\n const { frame, onPress } = props;\n const location = getStackFormattedLocation(process.env.EXPO_PROJECT_ROOT, frame);\n return (\n <View style={styles.frameContainer}>\n <LogBoxButton\n backgroundColor={{\n default: 'transparent',\n pressed: onPress ? LogBoxStyle.getBackgroundColor(1) : 'transparent',\n }}\n onPress={onPress}\n style={styles.frame}>\n <Text style={[styles.name, frame.collapse === true && styles.dim]}>{frame.methodName}</Text>\n <Text\n ellipsizeMode=\"middle\"\n numberOfLines={1}\n style={[styles.location, frame.collapse === true && styles.dim]}>\n {location}\n </Text>\n </LogBoxButton>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n frameContainer: {\n flexDirection: 'row',\n paddingHorizontal: 15,\n },\n frame: {\n flex: 1,\n paddingVertical: 4,\n paddingHorizontal: 10,\n borderRadius: 5,\n },\n lineLocation: {\n flexDirection: 'row',\n },\n name: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 18,\n fontWeight: '400',\n fontFamily: CODE_FONT,\n },\n location: {\n color: LogBoxStyle.getTextColor(0.8),\n fontSize: 12,\n fontWeight: '300',\n includeFontPadding: false,\n lineHeight: 16,\n paddingLeft: 10,\n },\n dim: {\n color: LogBoxStyle.getTextColor(0.4),\n fontWeight: '300',\n },\n line: {\n color: LogBoxStyle.getTextColor(0.8),\n fontSize: 12,\n fontWeight: '300',\n includeFontPadding: false,\n lineHeight: 16,\n },\n});\n"]}
|
|
@@ -26,8 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getCollapseMessage =
|
|
30
|
-
exports.LogBoxInspectorStackFrames = LogBoxInspectorStackFrames;
|
|
29
|
+
exports.LogBoxInspectorStackFrames = exports.getCollapseMessage = void 0;
|
|
31
30
|
/**
|
|
32
31
|
* Copyright (c) 650 Industries.
|
|
33
32
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -69,6 +68,7 @@ function getCollapseMessage(stackFrames, collapsed) {
|
|
|
69
68
|
: `Collapse ${collapsedCount} ${framePlural}`;
|
|
70
69
|
}
|
|
71
70
|
}
|
|
71
|
+
exports.getCollapseMessage = getCollapseMessage;
|
|
72
72
|
function LogBoxInspectorStackFrames({ onRetry, type }) {
|
|
73
73
|
const log = (0, LogContext_1.useSelectedLog)();
|
|
74
74
|
const [collapsed, setCollapsed] = (0, react_1.useState)(() => {
|
|
@@ -92,6 +92,7 @@ function LogBoxInspectorStackFrames({ onRetry, type }) {
|
|
|
92
92
|
react_1.default.createElement(StackFrameList, { list: getStackList(), status: log.symbolicated[type].status }),
|
|
93
93
|
react_1.default.createElement(StackFrameFooter, { onPress: () => setCollapsed(!collapsed), message: getCollapseMessage(log.getAvailableStack(type), !!collapsed) })));
|
|
94
94
|
}
|
|
95
|
+
exports.LogBoxInspectorStackFrames = LogBoxInspectorStackFrames;
|
|
95
96
|
function StackFrameList({ list, status, }) {
|
|
96
97
|
return list.map((frame, index) => {
|
|
97
98
|
const { file, lineNumber } = frame;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorStackFrames.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrames.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,gDA2BC;AAED,gEA4CC;AAlGD;;;;;;GAMG;AACH,+CAAwC;AACxC,+CAAsD;AAEtD,qEAAkE;AAClE,qFAAkF;AAClF,2EAAwE;AAGxE,mDAAoD;AACpD,qDAAkD;AAClD,+DAAiD;AACjD,mFAA2D;AAO3D,SAAgB,kBAAkB,CAAC,WAAkB,EAAE,SAAkB;IACvE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChE,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,KAAK,GAAG,CAAC,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,MAAM,WAAW,GAAG,QAAQ,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5D,IAAI,cAAc,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QAC1C,OAAO,SAAS;YACd,CAAC,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,cAAc,cAAc,WAAW,EAAE;YACtF,CAAC,C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,EAAE,EAAE;QACd,UAAU,EAAE,KAAK;QACjB,gBAAgB,EAAE,EAAE;KACrB;IACD,OAAO,EAAE;QACP,eAAe,EAAE,WAAW,CAAC,kBAAkB,EAAE;QACjD,gBAAgB,EAAE,EAAE;QACpB,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;KAChB;IACD,iBAAiB,EAAE;QACjB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,YAAY,EAAE,CAAC;KAChB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,CAAC;KACnB;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, { useState } from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { LogBoxInspectorSection } from './LogBoxInspectorSection';\nimport { LogBoxInspectorSourceMapStatus } from './LogBoxInspectorSourceMapStatus';\nimport { LogBoxInspectorStackFrame } from './LogBoxInspectorStackFrame';\nimport type { StackType } from '../Data/LogBoxLog';\nimport type { Stack } from '../Data/LogBoxSymbolication';\nimport { useSelectedLog } from '../Data/LogContext';\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\nimport openFileInEditor from '../modules/openFileInEditor';\n\ntype Props = {\n type: StackType;\n onRetry: () => void;\n};\n\nexport function getCollapseMessage(stackFrames: Stack, collapsed: boolean): string {\n if (stackFrames.length === 0) {\n return 'No frames to show';\n }\n\n const collapsedCount = stackFrames.reduce((count, { collapse }) => {\n if (collapse === true) {\n return count + 1;\n }\n\n return count;\n }, 0);\n\n if (collapsedCount === 0) {\n return 'Showing all frames';\n }\n\n const framePlural = `frame${collapsedCount > 1 ? 's' : ''}`;\n if (collapsedCount === stackFrames.length) {\n return collapsed\n ? `See${collapsedCount > 1 ? ' all ' : ' '}${collapsedCount} collapsed ${framePlural}`\n : `Collapse${collapsedCount > 1 ? ' all ' : ' '}${collapsedCount} ${framePlural}`;\n } else {\n return collapsed\n ? `See ${collapsedCount} more ${framePlural}`\n : `Collapse ${collapsedCount} ${framePlural}`;\n }\n}\n\nexport function LogBoxInspectorStackFrames({ onRetry, type }: Props) {\n const log = useSelectedLog();\n\n const [collapsed, setCollapsed] = useState(() => {\n // Only collapse frames initially if some frames are not collapsed.\n return log.getAvailableStack(type)?.some(({ collapse }) => !collapse);\n });\n\n function getStackList() {\n if (collapsed === true) {\n return log.getAvailableStack(type)?.filter(({ collapse }) => !collapse);\n } else {\n return log.getAvailableStack(type);\n }\n }\n\n if (log.getAvailableStack(type)?.length === 0) {\n return null;\n }\n\n return (\n <LogBoxInspectorSection\n heading={type === 'component' ? 'Component Stack' : 'Call Stack'}\n action={\n <LogBoxInspectorSourceMapStatus\n onPress={log.symbolicated[type].status === 'FAILED' ? onRetry : null}\n status={log.symbolicated[type].status}\n />\n }>\n {log.symbolicated[type].status !== 'COMPLETE' && (\n <View style={stackStyles.hintBox}>\n <Text style={stackStyles.hintText}>\n This call stack is not symbolicated. Some features are unavailable such as viewing the\n function name or tapping to open files.\n </Text>\n </View>\n )}\n <StackFrameList list={getStackList()!} status={log.symbolicated[type].status} />\n <StackFrameFooter\n onPress={() => setCollapsed(!collapsed)}\n message={getCollapseMessage(log.getAvailableStack(type)!, !!collapsed)}\n />\n </LogBoxInspectorSection>\n );\n}\n\nfunction StackFrameList({\n list,\n status,\n}: {\n list: Stack;\n status: 'NONE' | 'PENDING' | 'COMPLETE' | 'FAILED';\n}): any {\n return list.map((frame, index) => {\n const { file, lineNumber } = frame;\n return (\n <LogBoxInspectorStackFrame\n key={index}\n frame={frame}\n onPress={\n status === 'COMPLETE' && file != null && lineNumber != null\n ? () => openFileInEditor(file, lineNumber)\n : undefined\n }\n />\n );\n });\n}\n\nfunction StackFrameFooter({ message, onPress }: { message: string; onPress: () => void }) {\n return (\n <View style={stackStyles.collapseContainer}>\n <LogBoxButton\n backgroundColor={{\n default: 'transparent',\n pressed: LogBoxStyle.getBackgroundColor(1),\n }}\n onPress={onPress}\n style={stackStyles.collapseButton}>\n <Text style={stackStyles.collapse}>{message}</Text>\n </LogBoxButton>\n </View>\n );\n}\n\nconst stackStyles = 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: 20,\n fontWeight: '600',\n includeFontPadding: false,\n lineHeight: 20,\n },\n body: {\n paddingBottom: 10,\n },\n bodyText: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 18,\n fontWeight: '500',\n paddingHorizontal: 27,\n },\n hintText: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 13,\n includeFontPadding: false,\n lineHeight: 18,\n fontWeight: '400',\n marginHorizontal: 10,\n },\n hintBox: {\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n marginHorizontal: 10,\n paddingHorizontal: 5,\n paddingVertical: 10,\n borderRadius: 5,\n marginBottom: 5,\n },\n collapseContainer: {\n marginLeft: 15,\n flexDirection: 'row',\n },\n collapseButton: {\n borderRadius: 5,\n },\n collapse: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 12,\n fontWeight: '300',\n lineHeight: 20,\n marginTop: 0,\n paddingHorizontal: 10,\n paddingVertical: 5,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorStackFrames.js","sourceRo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BAAiB,EAAE;QACjB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,YAAY,EAAE,CAAC;KAChB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,CAAC;KACnB;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, { useState } from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { LogBoxInspectorSection } from './LogBoxInspectorSection';\nimport { LogBoxInspectorSourceMapStatus } from './LogBoxInspectorSourceMapStatus';\nimport { LogBoxInspectorStackFrame } from './LogBoxInspectorStackFrame';\nimport type { StackType } from '../Data/LogBoxLog';\nimport type { Stack } from '../Data/LogBoxSymbolication';\nimport { useSelectedLog } from '../Data/LogContext';\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\nimport openFileInEditor from '../modules/openFileInEditor';\n\ntype Props = {\n type: StackType;\n onRetry: () => void;\n};\n\nexport function getCollapseMessage(stackFrames: Stack, collapsed: boolean): string {\n if (stackFrames.length === 0) {\n return 'No frames to show';\n }\n\n const collapsedCount = stackFrames.reduce((count, { collapse }) => {\n if (collapse === true) {\n return count + 1;\n }\n\n return count;\n }, 0);\n\n if (collapsedCount === 0) {\n return 'Showing all frames';\n }\n\n const framePlural = `frame${collapsedCount > 1 ? 's' : ''}`;\n if (collapsedCount === stackFrames.length) {\n return collapsed\n ? `See${collapsedCount > 1 ? ' all ' : ' '}${collapsedCount} collapsed ${framePlural}`\n : `Collapse${collapsedCount > 1 ? ' all ' : ' '}${collapsedCount} ${framePlural}`;\n } else {\n return collapsed\n ? `See ${collapsedCount} more ${framePlural}`\n : `Collapse ${collapsedCount} ${framePlural}`;\n }\n}\n\nexport function LogBoxInspectorStackFrames({ onRetry, type }: Props) {\n const log = useSelectedLog();\n\n const [collapsed, setCollapsed] = useState(() => {\n // Only collapse frames initially if some frames are not collapsed.\n return log.getAvailableStack(type)?.some(({ collapse }) => !collapse);\n });\n\n function getStackList() {\n if (collapsed === true) {\n return log.getAvailableStack(type)?.filter(({ collapse }) => !collapse);\n } else {\n return log.getAvailableStack(type);\n }\n }\n\n if (log.getAvailableStack(type)?.length === 0) {\n return null;\n }\n\n return (\n <LogBoxInspectorSection\n heading={type === 'component' ? 'Component Stack' : 'Call Stack'}\n action={\n <LogBoxInspectorSourceMapStatus\n onPress={log.symbolicated[type].status === 'FAILED' ? onRetry : null}\n status={log.symbolicated[type].status}\n />\n }>\n {log.symbolicated[type].status !== 'COMPLETE' && (\n <View style={stackStyles.hintBox}>\n <Text style={stackStyles.hintText}>\n This call stack is not symbolicated. Some features are unavailable such as viewing the\n function name or tapping to open files.\n </Text>\n </View>\n )}\n <StackFrameList list={getStackList()!} status={log.symbolicated[type].status} />\n <StackFrameFooter\n onPress={() => setCollapsed(!collapsed)}\n message={getCollapseMessage(log.getAvailableStack(type)!, !!collapsed)}\n />\n </LogBoxInspectorSection>\n );\n}\n\nfunction StackFrameList({\n list,\n status,\n}: {\n list: Stack;\n status: 'NONE' | 'PENDING' | 'COMPLETE' | 'FAILED';\n}): any {\n return list.map((frame, index) => {\n const { file, lineNumber } = frame;\n return (\n <LogBoxInspectorStackFrame\n key={index}\n frame={frame}\n onPress={\n status === 'COMPLETE' && file != null && lineNumber != null\n ? () => openFileInEditor(file, lineNumber)\n : undefined\n }\n />\n );\n });\n}\n\nfunction StackFrameFooter({ message, onPress }: { message: string; onPress: () => void }) {\n return (\n <View style={stackStyles.collapseContainer}>\n <LogBoxButton\n backgroundColor={{\n default: 'transparent',\n pressed: LogBoxStyle.getBackgroundColor(1),\n }}\n onPress={onPress}\n style={stackStyles.collapseButton}>\n <Text style={stackStyles.collapse}>{message}</Text>\n </LogBoxButton>\n </View>\n );\n}\n\nconst stackStyles = 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: 20,\n fontWeight: '600',\n includeFontPadding: false,\n lineHeight: 20,\n },\n body: {\n paddingBottom: 10,\n },\n bodyText: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 18,\n fontWeight: '500',\n paddingHorizontal: 27,\n },\n hintText: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 13,\n includeFontPadding: false,\n lineHeight: 18,\n fontWeight: '400',\n marginHorizontal: 10,\n },\n hintBox: {\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n marginHorizontal: 10,\n paddingHorizontal: 5,\n paddingVertical: 10,\n borderRadius: 5,\n marginBottom: 5,\n },\n collapseContainer: {\n marginLeft: 15,\n flexDirection: 'row',\n },\n collapseButton: {\n borderRadius: 5,\n },\n collapse: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 12,\n fontWeight: '300',\n lineHeight: 20,\n marginTop: 0,\n paddingHorizontal: 10,\n paddingVertical: 5,\n },\n});\n"]}
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ErrorToast =
|
|
26
|
+
exports.ErrorToast = void 0;
|
|
27
27
|
/**
|
|
28
28
|
* Copyright (c) 650 Industries.
|
|
29
29
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -65,6 +65,7 @@ function ErrorToast(props) {
|
|
|
65
65
|
react_1.default.createElement(ErrorToastMessage_1.ErrorToastMessage, { message: log.message }),
|
|
66
66
|
react_1.default.createElement(Dismiss, { onPress: props.onPressDismiss }))))));
|
|
67
67
|
}
|
|
68
|
+
exports.ErrorToast = ErrorToast;
|
|
68
69
|
function Count({ count, level }) {
|
|
69
70
|
return (react_1.default.createElement(react_native_1.View, { style: [countStyles.inside, countStyles[level]] },
|
|
70
71
|
react_1.default.createElement(react_native_1.Text, { style: countStyles.text }, count <= 1 ? '!' : count)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorToast.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToast.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorToast.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAyC;AACzC,+CAAkF;AAElF,2DAAwD;AACxD,+DAAiD;AAEjD,+DAAiD;AAUjD,SAAS,kBAAkB,CAAC,GAAc;IACxC,0EAA0E;IAC1E,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,UAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5C,UAAU,CAAC,kBAAkB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,SAAgB,UAAU,CAAC,KAAY;IACrC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAE5C,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAExB,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,WAAW,CAAC,SAAS;QAChC,8BAAC,wBAAS,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC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AC1B,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,CAAC;KACT;CACF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,yBAAU,CAAC,MAAM,CAAC;IACpC,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,CAAC;KAChB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,WAAW,CAAC,kBAAkB,EAAE;QACjD,IAAI,EAAE,CAAC;QACP,iBAAiB,EAAE,EAAE;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, { useEffect } from 'react';\nimport { Image, Platform, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { ErrorToastMessage } from './ErrorToastMessage';\nimport * as LogBoxData from '../Data/LogBoxData';\nimport { LogBoxLog } from '../Data/LogBoxLog';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n log: LogBoxLog;\n totalLogCount: number;\n level: 'warn' | 'error';\n onPressOpen: () => void;\n onPressDismiss: () => void;\n};\n\nfunction useSymbolicatedLog(log: LogBoxLog) {\n // Eagerly symbolicate so the stack is available when pressing to inspect.\n useEffect(() => {\n LogBoxData.symbolicateLogLazy('stack', log);\n LogBoxData.symbolicateLogLazy('component', log);\n }, [log]);\n}\n\nexport function ErrorToast(props: Props) {\n const { totalLogCount, level, log } = props;\n\n useSymbolicatedLog(log);\n\n return (\n <View style={toastStyles.container}>\n <Pressable style={{ flex: 1 }} onPress={props.onPressOpen}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[\n toastStyles.press,\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 <Count count={totalLogCount} level={level} />\n <ErrorToastMessage message={log.message} />\n <Dismiss onPress={props.onPressDismiss} />\n </View>\n )}\n </Pressable>\n </View>\n );\n}\n\nfunction Count({ count, level }: { count: number; level: Props['level'] }) {\n return (\n <View style={[countStyles.inside, countStyles[level]]}>\n <Text style={countStyles.text}>{count <= 1 ? '!' : count}</Text>\n </View>\n );\n}\n\nfunction Dismiss({ onPress }: { onPress: () => void }) {\n return (\n <Pressable\n style={{\n marginLeft: 5,\n }}\n hitSlop={{\n top: 12,\n right: 10,\n bottom: 12,\n left: 10,\n }}\n onPress={onPress}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[dismissStyles.press, hovered && { opacity: 0.8 }, pressed && { opacity: 0.5 }]}>\n <Image\n source={require('@expo/metro-runtime/assets/close.png')}\n style={dismissStyles.image}\n />\n </View>\n )}\n </Pressable>\n );\n}\n\nconst countStyles = StyleSheet.create({\n warn: {\n backgroundColor: LogBoxStyle.getWarningColor(1),\n },\n error: {\n backgroundColor: LogBoxStyle.getErrorColor(1),\n },\n log: {\n backgroundColor: LogBoxStyle.getLogColor(1),\n },\n inside: {\n marginRight: 8,\n minWidth: 22,\n aspectRatio: 1,\n paddingHorizontal: 4,\n borderRadius: 11,\n justifyContent: 'center',\n alignItems: 'center',\n },\n text: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n lineHeight: 18,\n textAlign: 'center',\n fontWeight: '600',\n ...Platform.select({\n web: {\n textShadow: `0px 0px 3px ${LogBoxStyle.getBackgroundColor(0.8)}`,\n },\n }),\n },\n});\n\nconst dismissStyles = StyleSheet.create({\n press: {\n backgroundColor: '#323232',\n height: 20,\n width: 20,\n borderRadius: 25,\n alignItems: 'center',\n justifyContent: 'center',\n },\n image: {\n height: 8,\n width: 8,\n },\n});\n\nconst toastStyles = StyleSheet.create({\n container: {\n height: 48,\n justifyContent: 'center',\n marginBottom: 4,\n },\n press: {\n borderWidth: 1,\n borderRadius: 8,\n overflow: 'hidden',\n flexDirection: 'row',\n alignItems: 'center',\n borderColor: '#323232',\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n flex: 1,\n paddingHorizontal: 12,\n },\n});\n"]}
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = ErrorToastContainer;
|
|
7
6
|
const react_1 = __importDefault(require("react"));
|
|
8
7
|
function ErrorToastContainer({ children, }) {
|
|
9
8
|
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
10
9
|
}
|
|
10
|
+
exports.default = ErrorToastContainer;
|
|
11
11
|
//# sourceMappingURL=ErrorToastContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorToastContainer.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"ErrorToastContainer.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,SAAwB,mBAAmB,CAAC,EAC1C,QAAQ,GAGT;IACC,OAAO,8DAAG,QAAQ,CAAI,CAAC;AACzB,CAAC;AAND,sCAMC","sourcesContent":["import React from 'react';\n\nexport default function ErrorToastContainer({\n children,\n}: {\n children: React.ReactNode;\n}): React.ReactElement {\n return <>{children}</>;\n}\n"]}
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ErrorToastContainer =
|
|
26
|
+
exports.ErrorToastContainer = void 0;
|
|
27
27
|
/**
|
|
28
28
|
* Copyright (c) 650 Industries.
|
|
29
29
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -45,6 +45,7 @@ function ErrorToastContainer() {
|
|
|
45
45
|
}
|
|
46
46
|
return react_1.default.createElement(ErrorToastStack, { logs: logs });
|
|
47
47
|
}
|
|
48
|
+
exports.ErrorToastContainer = ErrorToastContainer;
|
|
48
49
|
function ErrorToastStack({ logs }) {
|
|
49
50
|
const onDismissWarns = (0, react_1.useCallback)(() => {
|
|
50
51
|
LogBoxData.clearWarnings();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorToastContainer.web.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorToastContainer.web.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.web.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAoD;AACpD,+CAAgD;AAEhD,6CAA0C;AAC1C,+DAAiD;AAEjD,mDAA6C;AAC7C,gEAA6D;AAE7D,SAAgB,mBAAmB;IACjC,IAAA,yCAAmB,GAAE,CAAC;IACtB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IACvC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,8BAAC,eAAe,IAAC,IAAI,EAAE,IAAI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IAAI;QACrB,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,8BAAC,uBAAU,IACT,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAClC,KAAK,EAAC,MAAM,EACZ,aAAa,EAAE,QAAQ,CAAC,MAAM,EAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EACzD,cAAc,EAAE,cAAc,GAC9B,CACH;QAEA,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,8BAAC,uBAAU,IACT,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EAC9B,KAAK,EAAC,OAAO,EACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAC5B,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EACrD,cAAc,EAAE,eAAe,GAC/B,CACH,CACI,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,GAAG;QACb,mBAAmB;QACnB,QAAQ,EAAE,OAAO;KAClB;CACF,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC,gBAAgB,CAAC,mBAAmB,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, { useCallback, useMemo } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { ErrorToast } from './ErrorToast';\nimport * as LogBoxData from '../Data/LogBoxData';\nimport { LogBoxLog } from '../Data/LogBoxLog';\nimport { useLogs } from '../Data/LogContext';\nimport { useRejectionHandler } from '../useRejectionHandler';\n\nexport function ErrorToastContainer() {\n useRejectionHandler();\n const { logs, isDisabled } = useLogs();\n if (!logs.length || isDisabled) {\n return null;\n }\n return <ErrorToastStack logs={logs} />;\n}\n\nfunction ErrorToastStack({ logs }: { logs: LogBoxLog[] }) {\n const onDismissWarns = useCallback(() => {\n LogBoxData.clearWarnings();\n }, []);\n\n const onDismissErrors = useCallback(() => {\n LogBoxData.clearErrors();\n }, []);\n\n const setSelectedLog = useCallback((index: number): void => {\n LogBoxData.setSelectedLog(index);\n }, []);\n\n function openLog(log: LogBoxLog) {\n let index = logs.length - 1;\n\n // Stop at zero because if we don't find any log, we'll open the first log.\n while (index > 0 && logs[index] !== log) {\n index -= 1;\n }\n setSelectedLog(index);\n }\n\n const warnings = useMemo(() => logs.filter((log) => log.level === 'warn'), [logs]);\n\n const errors = useMemo(\n () => logs.filter((log) => log.level === 'error' || log.level === 'fatal'),\n [logs]\n );\n\n return (\n <View style={styles.list}>\n {warnings.length > 0 && (\n <ErrorToast\n log={warnings[warnings.length - 1]}\n level=\"warn\"\n totalLogCount={warnings.length}\n onPressOpen={() => openLog(warnings[warnings.length - 1])}\n onPressDismiss={onDismissWarns}\n />\n )}\n\n {errors.length > 0 && (\n <ErrorToast\n log={errors[errors.length - 1]}\n level=\"error\"\n totalLogCount={errors.length}\n onPressOpen={() => openLog(errors[errors.length - 1])}\n onPressDismiss={onDismissErrors}\n />\n )}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n list: {\n bottom: 6,\n left: 10,\n right: 10,\n maxWidth: 320,\n // @ts-expect-error\n position: 'fixed',\n },\n});\n\nexport default LogBoxData.withSubscription(ErrorToastContainer);\n"]}
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ErrorToastMessage =
|
|
29
|
+
exports.ErrorToastMessage = void 0;
|
|
30
30
|
const react_1 = __importDefault(require("react"));
|
|
31
31
|
const react_native_1 = require("react-native");
|
|
32
32
|
const LogBoxMessage_1 = require("../UI/LogBoxMessage");
|
|
@@ -34,6 +34,7 @@ const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
|
34
34
|
function ErrorToastMessage({ message }) {
|
|
35
35
|
return (react_1.default.createElement(react_native_1.Text, { numberOfLines: 1, style: styles.text }, message && react_1.default.createElement(LogBoxMessage_1.LogBoxMessage, { plaintext: true, message: message, style: styles.substitutionText })));
|
|
36
36
|
}
|
|
37
|
+
exports.ErrorToastMessage = ErrorToastMessage;
|
|
37
38
|
const styles = react_native_1.StyleSheet.create({
|
|
38
39
|
text: {
|
|
39
40
|
userSelect: 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorToastMessage.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastMessage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorToastMessage.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAgD;AAGhD,uDAAoD;AACpD,+DAAiD;AAEjD,SAAgB,iBAAiB,CAAC,EAAE,OAAO,EAA6B;IACtE,OAAO,CACL,8BAAC,mBAAI,IAAC,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,IACvC,OAAO,IAAI,8BAAC,6BAAa,IAAC,SAAS,QAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,GAAI,CACpF,CACR,CAAC;AACJ,CAAC;AAND,8CAMC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE,CAAC;QACd,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;KACf;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { StyleSheet, Text } from 'react-native';\n\nimport type { Message as MessageType } from '../Data/parseLogBoxLog';\nimport { LogBoxMessage } from '../UI/LogBoxMessage';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\nexport function ErrorToastMessage({ message }: { message?: MessageType }) {\n return (\n <Text numberOfLines={1} style={styles.text}>\n {message && <LogBoxMessage plaintext message={message} style={styles.substitutionText} />}\n </Text>\n );\n}\n\nconst styles = StyleSheet.create({\n text: {\n userSelect: 'none',\n paddingLeft: 8,\n color: LogBoxStyle.getTextColor(1),\n flex: 1,\n fontSize: 14,\n lineHeight: 22,\n },\n substitutionText: {\n color: LogBoxStyle.getTextColor(0.6),\n },\n});\n"]}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useRejectionHandler =
|
|
6
|
+
exports.useRejectionHandler = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const ExceptionsManager_1 = __importDefault(require("./modules/ExceptionsManager"));
|
|
9
9
|
function useStackTraceLimit(limit) {
|
|
@@ -55,4 +55,5 @@ function useRejectionHandler() {
|
|
|
55
55
|
}, []);
|
|
56
56
|
return hasError;
|
|
57
57
|
}
|
|
58
|
+
exports.useRejectionHandler = useRejectionHandler;
|
|
58
59
|
//# sourceMappingURL=useRejectionHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRejectionHandler.js","sourceRoot":"","sources":["../../src/error-overlay/useRejectionHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRejectionHandler.js","sourceRoot":"","sources":["../../src/error-overlay/useRejectionHandler.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oFAA4D;AAE5D,SAAS,kBAAkB,CAAC,KAAa;IACvC,MAAM,OAAO,GAAG,eAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAChC,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI;YACF,qEAAqE;YACrE,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC;YAC3C,qEAAqE;YACrE,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC;YAC9B,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC;SAChC;QAAC,MAAM,GAAE;QACV,OAAO,GAAG,EAAE;YACV,IAAI;gBACF,qEAAqE;gBACrE,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;aACzC;YAAC,MAAM,GAAE;QACZ,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,mBAAmB;IACjC,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAEvB,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,gBAAgB,CAAC,EAAc;YACtC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YAExB,MAAM,KAAK,GAAG,EAAE,EAAE,KAAK,CAAC;YACxB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;gBAC1E,OAAO;aACR;YAED,2BAAiB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QAED,SAAS,oBAAoB,CAAC,EAAyB;YACrD,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YAExB,MAAM,MAAM,GAAG,EAAE,EAAE,MAAM,CAAC;YAC1B,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,YAAY,KAAK,CAAC,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;gBAC7E,OAAO;aACR;YAED,2BAAiB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QACpE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;YACtD,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QACzE,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC;AArCD,kDAqCC","sourcesContent":["import React from 'react';\n\nimport ExceptionsManager from './modules/ExceptionsManager';\n\nfunction useStackTraceLimit(limit: number) {\n const current = React.useRef(0);\n React.useEffect(() => {\n try {\n // @ts-expect-error: StackTraceLimit is not defined in the Error type\n const currentLimit = Error.stackTraceLimit;\n // @ts-expect-error: StackTraceLimit is not defined in the Error type\n Error.stackTraceLimit = limit;\n current.current = currentLimit;\n } catch {}\n return () => {\n try {\n // @ts-expect-error: StackTraceLimit is not defined in the Error type\n Error.stackTraceLimit = current.current;\n } catch {}\n };\n }, [limit]);\n}\n\nexport function useRejectionHandler() {\n const hasError = React.useRef(false);\n\n useStackTraceLimit(35);\n\n React.useEffect(() => {\n function onUnhandledError(ev: ErrorEvent) {\n hasError.current = true;\n\n const error = ev?.error;\n if (!error || !(error instanceof Error) || typeof error.stack !== 'string') {\n return;\n }\n\n ExceptionsManager.handleException(error);\n }\n\n function onUnhandledRejection(ev: PromiseRejectionEvent) {\n hasError.current = true;\n\n const reason = ev?.reason;\n if (!reason || !(reason instanceof Error) || typeof reason.stack !== 'string') {\n return;\n }\n\n ExceptionsManager.handleException(reason);\n }\n\n window.addEventListener('unhandledrejection', onUnhandledRejection);\n window.addEventListener('error', onUnhandledError);\n return () => {\n window.removeEventListener('error', onUnhandledError);\n window.removeEventListener('unhandledrejection', onUnhandledRejection);\n };\n }, []);\n\n return hasError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevServer.js","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,kBAAkB;IAClB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"getDevServer.js","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,kBAAkB;IAClB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO;YACL,sBAAsB,EAAE,IAAI;YAC5B,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IAED,OAAO;QACL,4DAA4D;QAC5D,sBAAsB,EAAE,IAAI;QAE5B,0DAA0D;QAC1D,IAAI,aAAa;YACf,IAAI,QAAQ,EAAE,aAAa,IAAI,KAAK,IAAI,QAAQ,CAAC,aAAa,EAAE;gBAC9D,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;aACnC;YAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAEzC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAE9C,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC9B,CAAC;QACD,GAAG,EAAE,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ;KACzC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC","sourcesContent":["const getDevServer = () => {\n // Disable for SSR\n if (typeof window === 'undefined') {\n return {\n bundleLoadedFromServer: true,\n fullBundleUrl: '',\n url: '',\n };\n }\n\n return {\n // The bundle is always loaded from a server in the browser.\n bundleLoadedFromServer: true,\n\n /** URL but ensures that platform query param is added. */\n get fullBundleUrl() {\n if (document?.currentScript && 'src' in document.currentScript) {\n return document.currentScript.src;\n }\n\n const bundleUrl = new URL(location.href);\n\n bundleUrl.searchParams.set('platform', 'web');\n\n return bundleUrl.toString();\n },\n url: location.origin + location.pathname,\n };\n};\n\nexport default getDevServer;\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.install =
|
|
4
|
-
exports.setLocationHref = setLocationHref;
|
|
3
|
+
exports.setLocationHref = exports.install = void 0;
|
|
5
4
|
function install() { }
|
|
5
|
+
exports.install = install;
|
|
6
6
|
function setLocationHref(href) { }
|
|
7
|
+
exports.setLocationHref = setLocationHref;
|
|
7
8
|
//# sourceMappingURL=Location.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Location.js","sourceRoot":"","sources":["../../src/location/Location.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Location.js","sourceRoot":"","sources":["../../src/location/Location.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,KAAI,CAAC;AAA5B,0BAA4B;AAE5B,SAAgB,eAAe,CAAC,IAAY,IAAG,CAAC;AAAhD,0CAAgD","sourcesContent":["export function install() {}\n\nexport function setLocationHref(href: string) {}\n"]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Copyright © 2023 650 Industries.
|
|
3
3
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.setLocationHref =
|
|
6
|
-
exports.install = install;
|
|
5
|
+
exports.install = exports.setLocationHref = void 0;
|
|
7
6
|
class DOMException extends Error {
|
|
8
7
|
constructor(message, name) {
|
|
9
8
|
super(message);
|
|
@@ -175,6 +174,7 @@ let location = undefined;
|
|
|
175
174
|
function setLocationHref(href) {
|
|
176
175
|
location = new Location(href);
|
|
177
176
|
}
|
|
177
|
+
exports.setLocationHref = setLocationHref;
|
|
178
178
|
function install() {
|
|
179
179
|
Object.defineProperty(global, 'Location', {
|
|
180
180
|
value: Location,
|
|
@@ -191,4 +191,5 @@ function install() {
|
|
|
191
191
|
enumerable: true,
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
+
exports.install = install;
|
|
194
195
|
//# sourceMappingURL=Location.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Location.native.js","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,0EAA0E
|
|
1
|
+
{"version":3,"file":"Location.native.js","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,0EAA0E;;;AAE1E,MAAM,YAAa,SAAQ,KAAK;IAC9B,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,6EAA6E;AAC7E,uEAAuE;AACvE,gCAAgC;AAChC,+EAA+E;AAC/E,uDAAuD;AACvD,MAAM,QAAQ;IACZ,YAAY,OAAsB,IAAI;QACpC,MAAM,GAAG,GAAG,IAAI,GAAG;QACjB,mBAAmB;QACnB,IAAI,CACL,CAAC;QAEF,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;QAElB,GAA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,eAAe,CAAC,IAAY;IAC1C,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAFD,0CAEC;AAED,SAAgB,OAAO;IACrB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,GAAG;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,GAAG;YACD,MAAM,IAAI,YAAY,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC;QACxE,CAAC;QACD,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;AACL,CAAC;AAhBD,0BAgBC","sourcesContent":["// Copyright © 2023 650 Industries.\n// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.\n\nclass DOMException extends Error {\n constructor(message: string, name: string) {\n super(message);\n this.name = name;\n }\n}\n\n// The differences between the definitions of `Location` and `WorkerLocation`\n// are because of the `LegacyUnforgeable` attribute only specified upon\n// `Location`'s properties. See:\n// - https://html.spec.whatwg.org/multipage/history.html#the-location-interface\n// - https://heycam.github.io/webidl/#LegacyUnforgeable\nclass Location {\n constructor(href: string | null = null) {\n const url = new URL(\n // @ts-expect-error\n href\n );\n\n url.username = '';\n\n url.password = '';\n Object.defineProperties(this, {\n hash: {\n get() {\n return url.hash;\n },\n set() {\n throw new DOMException(`Cannot set \"location.hash\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n host: {\n get() {\n return url.host;\n },\n set() {\n throw new DOMException(`Cannot set \"location.host\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n hostname: {\n get() {\n return url.hostname;\n },\n set() {\n throw new DOMException(`Cannot set \"location.hostname\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n href: {\n get() {\n return url.href;\n },\n set() {\n throw new DOMException(`Cannot set \"location.href\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n origin: {\n get() {\n return url.origin;\n },\n enumerable: true,\n },\n pathname: {\n get() {\n return url.pathname;\n },\n set() {\n throw new DOMException(`Cannot set \"location.pathname\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n port: {\n get() {\n return url.port;\n },\n set() {\n throw new DOMException(`Cannot set \"location.port\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n protocol: {\n get() {\n return url.protocol;\n },\n set() {\n throw new DOMException(`Cannot set \"location.protocol\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n search: {\n get() {\n return url.search;\n },\n set() {\n throw new DOMException(`Cannot set \"location.search\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n ancestorOrigins: {\n get() {\n return {\n length: 0,\n item: () => null,\n contains: () => false,\n };\n },\n enumerable: true,\n },\n assign: {\n value: function assign() {\n throw new DOMException(`Cannot call \"location.assign()\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n reload: {\n value: function reload() {\n if (process.env.NODE_ENV !== 'production') {\n // NOTE: This does change how native fast refresh works. The upstream metro-runtime will check\n // if `location.reload` exists before falling back on an implementation that is nearly identical to\n // this. The main difference is that on iOS there is a \"reason\" message sent, but at the time of writing\n // this, that message is unused (ref: `RCTTriggerReloadCommandNotification`).\n const DevSettings = (require('react-native') as typeof import('react-native'))\n .DevSettings;\n return DevSettings.reload();\n } else {\n throw new DOMException(`Cannot call \"location.reload()\".`, 'NotSupportedError');\n }\n },\n enumerable: true,\n },\n replace: {\n value: function replace() {\n throw new DOMException(`Cannot call \"location.replace()\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n toString: {\n value: function toString() {\n return url.href;\n },\n enumerable: true,\n },\n [Symbol.for('Expo.privateCustomInspect')]: {\n value(inspect: any) {\n const object = {\n hash: this.hash,\n host: this.host,\n hostname: this.hostname,\n href: this.href,\n origin: this.origin,\n pathname: this.pathname,\n port: this.port,\n protocol: this.protocol,\n search: this.search,\n };\n return `${this.constructor.name} ${inspect(object)}`;\n },\n },\n });\n }\n}\n\nObject.defineProperties(Location.prototype, {\n [Symbol.toString()]: {\n value: 'Location',\n configurable: true,\n },\n});\n\nlet location: Location | undefined = undefined;\n\nexport function setLocationHref(href: string) {\n location = new Location(href);\n}\n\nexport function install() {\n Object.defineProperty(global, 'Location', {\n value: Location,\n configurable: true,\n writable: true,\n });\n\n Object.defineProperty(window, 'location', {\n get() {\n return location;\n },\n set() {\n throw new DOMException(`Cannot set \"location\".`, 'NotSupportedError');\n },\n enumerable: true,\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.native.js","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":";;;;;AAAA,wFAAwF;AACxF,sDAAoD;AAEpD,oEAAuC;AAEvC,yCAAsD;AACtD,mEAA2C;AAE3C,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,MAAM,QAAQ,GAAG,wBAAS,CAAC,UAAwC,CAAC;AAEpE,mEAAmE;AACnE,uEAAuE;AACvE,2EAA2E;AAC3E,SAAS,iCAAiC,CAAC,UAAkB;IAC3D,IAAI,SAAS,EAAE
|
|
1
|
+
{"version":3,"file":"install.native.js","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":";;;;;AAAA,wFAAwF;AACxF,sDAAoD;AAEpD,oEAAuC;AAEvC,yCAAsD;AACtD,mEAA2C;AAE3C,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,MAAM,QAAQ,GAAG,wBAAS,CAAC,UAAwC,CAAC;AAEpE,mEAAmE;AACnE,uEAAuE;AACvE,2EAA2E;AAC3E,SAAS,iCAAiC,CAAC,UAAkB;IAC3D,IAAI,SAAS,EAAE;QACb,OAAO;KACR;IACD,SAAS,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QACpC,OAAO,CAAC,IAAI,CACV,+BAA+B,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AG,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACpF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;oBACzC,iCAAiC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC7C;gBAED,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;aAC1E;SACF;QACD,OAAO,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,MAAM,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAEzC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAI,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,KAAK,EAAE;IAC7C,+CAA+C;IAC/C,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACrD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,IAAI,GAAG,EAAE;YACP,IAAA,0BAAe,EAAC,GAAG,CAAC,CAAC;YACrB,IAAA,kBAAO,GAAE,CAAC;SACX;KACF;IACD,iDAAiD;IACjD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;QACrC,KAAK,EAAE,2BAA2B,CAAC,KAAK,CAAC;KAC1C,CAAC,CAAC;CACJ","sourcesContent":["// This MUST be first to ensure that `fetch` is defined in the React Native environment.\nimport 'react-native/Libraries/Core/InitializeCore';\n\nimport Constants from 'expo-constants';\n\nimport { install, setLocationHref } from './Location';\nimport getDevServer from '../getDevServer';\n\nlet hasWarned = false;\n\nconst manifest = Constants.expoConfig as Record<string, any> | null;\n\n// Add a development warning for fetch requests with relative paths\n// to ensure developers are aware of the need to configure a production\n// base URL in the Expo config (app.json) under `expo.extra.router.origin`.\nfunction warnProductionOriginNotConfigured(requestUrl: string) {\n if (hasWarned) {\n return;\n }\n hasWarned = true;\n if (!manifest?.extra?.router?.origin) {\n console.warn(\n `The relative fetch request \"${requestUrl}\" will not work in production until the Expo Router Config Plugin (app.json) is configured with the \\`origin\\` prop set to the base URL of your web server, e.g. \\`{ plugins: [[\"expo-router\", { origin: \"...\" }]] }\\`. [Learn more](https://expo.github.io/router/docs/lab/runtime-location)`\n );\n }\n}\n\n// TODO: This would be better if native and tied as close to the JS engine as possible, i.e. it should\n// reflect the exact location of the JS file that was executed.\nfunction getBaseUrl() {\n if (process.env.NODE_ENV !== 'production') {\n // e.g. http://localhost:19006\n return getDevServer().url?.replace(/\\/$/, '');\n }\n\n // TODO: Make it official by moving out of `extra`\n const productionBaseUrl = manifest?.extra?.router?.origin;\n\n if (!productionBaseUrl) {\n return null;\n }\n\n // Ensure no trailing slash\n return productionBaseUrl?.replace(/\\/$/, '');\n}\n\nfunction wrapFetchWithWindowLocation(fetch: Function & { __EXPO_BASE_URL_POLYFILLED?: boolean }) {\n if (fetch.__EXPO_BASE_URL_POLYFILLED) {\n return fetch;\n }\n\n const _fetch = (...props: any[]) => {\n if (props[0] && typeof props[0] === 'string' && props[0].startsWith('/')) {\n if (process.env.NODE_ENV !== 'production') {\n warnProductionOriginNotConfigured(props[0]);\n }\n\n props[0] = new URL(props[0], window.location?.origin).toString();\n } else if (props[0] && typeof props[0] === 'object') {\n if (props[0].url && typeof props[0].url === 'string' && props[0].url.startsWith('/')) {\n if (process.env.NODE_ENV !== 'production') {\n warnProductionOriginNotConfigured(props[0]);\n }\n\n props[0].url = new URL(props[0].url, window.location?.origin).toString();\n }\n }\n return fetch(...props);\n };\n\n _fetch.__EXPO_BASE_URL_POLYFILLED = true;\n\n return _fetch;\n}\n\nif (manifest?.extra?.router?.origin !== false) {\n // Polyfill window.location in native runtimes.\n if (typeof window !== 'undefined' && !window.location) {\n const url = getBaseUrl();\n if (url) {\n setLocationHref(url);\n install();\n }\n }\n // Polyfill native fetch to support relative URLs\n Object.defineProperty(global, 'fetch', {\n value: wrapFetchWithWindowLocation(fetch),\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageSocket.js","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,yEAAyE;AACzE,+CAA+C;AAE/C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,GAAG,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,CAAC;AACrF,aAAa,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"messageSocket.js","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,yEAAyE;AACzE,+CAA+C;AAE/C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,GAAG,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,CAAC;AACrF,aAAa,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE;QACnB,KAAK,gBAAgB;YACnB,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBACxB,KAAK,QAAQ;oBACX,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACzB,MAAM;aACT;YACD,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM;QACR,KAAK,SAAS;YACZ,QAAQ;YACR,MAAM;KACT;AACH,CAAC,CAAC","sourcesContent":["/* eslint-env browser */\n\n// Setup websocket messages for reloading the page from the command line.\n// This is normally setup on the native client.\n\nconst protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';\nconst messageSocket = new WebSocket(`${protocol}://${window.location.host}/message`);\nmessageSocket.onmessage = (message) => {\n const data = JSON.parse(String(message.data));\n switch (data.method) {\n case 'sendDevCommand':\n switch (data.params.name) {\n case 'reload':\n window.location.reload();\n break;\n }\n break;\n case 'reload':\n window.location.reload();\n break;\n case 'devMenu':\n // no-op\n break;\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupFastRefresh.js","sourceRoot":"","sources":["../src/setupFastRefresh.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC7D,mBAAmB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,OAAO,GAAG;IACd,kBAAkB;QAChB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACpB,CAAC;IAED,mCAAmC,EAAE,mBAAmB,CAAC,mCAAmC;IAE5F,qBAAqB,EAAE,mBAAmB,CAAC,qBAAqB;IAEhE,eAAe,EAAE,mBAAmB,CAAC,eAAe;IAEpD,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IAEtC,mBAAmB;QACjB,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"setupFastRefresh.js","sourceRoot":"","sources":["../src/setupFastRefresh.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC7D,mBAAmB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,OAAO,GAAG;IACd,kBAAkB;QAChB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACpB,CAAC;IAED,mCAAmC,EAAE,mBAAmB,CAAC,mCAAmC;IAE5F,qBAAqB,EAAE,mBAAmB,CAAC,qBAAqB;IAEhE,eAAe,EAAE,mBAAmB,CAAC,eAAe;IAEpD,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IAEtC,mBAAmB;QACjB,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,EAAE;YAChD,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO;SACR;QACD,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;IAC5C,CAAC;CACF,CAAC;AAEF,oFAAoF;AACpF,mFAAmF;AACnF,MAAM,CAAC,CAAC,MAAM,CAAC,uBAAuB,IAAI,EAAE,CAAC,GAAG,gBAAgB,CAAC,GAAG,OAAO,CAAC","sourcesContent":["// This needs to run before the renderer initializes.\n\nconst ReactRefreshRuntime = require('react-refresh/runtime');\nReactRefreshRuntime.injectIntoGlobalHook(global);\n\nconst Refresh = {\n performFullRefresh() {\n location.reload();\n },\n\n createSignatureFunctionForTransform: ReactRefreshRuntime.createSignatureFunctionForTransform,\n\n isLikelyComponentType: ReactRefreshRuntime.isLikelyComponentType,\n\n getFamilyByType: ReactRefreshRuntime.getFamilyByType,\n\n register: ReactRefreshRuntime.register,\n\n performReactRefresh() {\n if (ReactRefreshRuntime.hasUnrecoverableErrors()) {\n location.reload();\n return;\n }\n ReactRefreshRuntime.performReactRefresh();\n },\n};\n\n// The metro require polyfill can not have dependencies (applies for all polyfills).\n// Expose `Refresh` by assigning it to global to make it available in the polyfill.\nglobal[(global.__METRO_GLOBAL_PREFIX__ || '') + '__ReactRefresh'] = Refresh;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-runtime",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Tools for making advanced Metro bundler features work",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"types": "build",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react-native": "*"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "332ba65c4e421bdb8973cc749e3e34b5fa5ce903"
|
|
40
40
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
let LoadingView: typeof import('react-native/Libraries/Utilities/LoadingView').default;
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
LoadingView = require('react-native/Libraries/Utilities/LoadingView');
|
|
5
|
+
} catch {
|
|
6
|
+
// In react-native 0.75.0 LoadingView was renamed to DevLoadingView
|
|
7
|
+
LoadingView = require('react-native/Libraries/Utilities/DevLoadingView');
|
|
8
|
+
}
|
|
2
9
|
|
|
3
10
|
export default LoadingView;
|