@expo/metro-runtime 2.2.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +17 -1
  2. package/async-require.d.ts +1 -1
  3. package/async-require.js +1 -1
  4. package/build/HMRClient.d.ts +1 -1
  5. package/build/HMRClient.d.ts.map +1 -1
  6. package/build/HMRClient.js +40 -68
  7. package/build/HMRClient.js.map +1 -1
  8. package/build/HMRClient.native.js +2 -4
  9. package/build/HMRClient.native.js.map +1 -1
  10. package/build/LoadingView.d.ts +1 -1
  11. package/build/LoadingView.d.ts.map +1 -1
  12. package/build/LoadingView.js +4 -10
  13. package/build/LoadingView.js.map +1 -1
  14. package/build/LoadingView.native.d.ts +2 -0
  15. package/build/LoadingView.native.d.ts.map +1 -1
  16. package/build/LoadingView.native.js +2 -2
  17. package/build/LoadingView.native.js.map +1 -1
  18. package/build/async-require/buildAsyncRequire.js +3 -7
  19. package/build/async-require/buildAsyncRequire.js.map +1 -1
  20. package/build/async-require/buildUrlForBundle.js +2 -6
  21. package/build/async-require/buildUrlForBundle.js.map +1 -1
  22. package/build/async-require/buildUrlForBundle.native.js +6 -9
  23. package/build/async-require/buildUrlForBundle.native.js.map +1 -1
  24. package/build/async-require/fetchAsync.d.ts.map +1 -1
  25. package/build/async-require/fetchAsync.js +4 -8
  26. package/build/async-require/fetchAsync.js.map +1 -1
  27. package/build/async-require/fetchAsync.native.d.ts +1 -1
  28. package/build/async-require/fetchAsync.native.d.ts.map +1 -1
  29. package/build/async-require/fetchAsync.native.js +14 -21
  30. package/build/async-require/fetchAsync.native.js.map +1 -1
  31. package/build/async-require/fetchThenEval.d.ts.map +1 -1
  32. package/build/async-require/fetchThenEval.js +5 -10
  33. package/build/async-require/fetchThenEval.js.map +1 -1
  34. package/build/async-require/fetchThenEval.web.d.ts.map +1 -1
  35. package/build/async-require/fetchThenEval.web.js +14 -27
  36. package/build/async-require/fetchThenEval.web.js.map +1 -1
  37. package/build/async-require/index.js +2 -6
  38. package/build/async-require/index.js.map +1 -1
  39. package/build/async-require/loadBundle.d.ts.map +1 -1
  40. package/build/async-require/loadBundle.js +14 -18
  41. package/build/async-require/loadBundle.js.map +1 -1
  42. package/build/effects.js +5 -7
  43. package/build/effects.js.map +1 -1
  44. package/build/effects.native.js +0 -1
  45. package/build/error-overlay/Data/LogBoxData.d.ts +5 -5
  46. package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
  47. package/build/error-overlay/Data/LogBoxData.js +76 -127
  48. package/build/error-overlay/Data/LogBoxData.js.map +1 -1
  49. package/build/error-overlay/Data/LogBoxLog.d.ts +10 -10
  50. package/build/error-overlay/Data/LogBoxLog.d.ts.map +1 -1
  51. package/build/error-overlay/Data/LogBoxLog.js +46 -69
  52. package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
  53. package/build/error-overlay/Data/LogBoxSymbolication.d.ts +2 -2
  54. package/build/error-overlay/Data/LogBoxSymbolication.js +9 -17
  55. package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
  56. package/build/error-overlay/Data/LogContext.d.ts +2 -2
  57. package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
  58. package/build/error-overlay/Data/LogContext.js +12 -20
  59. package/build/error-overlay/Data/LogContext.js.map +1 -1
  60. package/build/error-overlay/Data/parseLogBoxLog.d.ts +2 -2
  61. package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -1
  62. package/build/error-overlay/Data/parseLogBoxLog.js +35 -50
  63. package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
  64. package/build/error-overlay/ErrorOverlay.d.ts +10 -3
  65. package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
  66. package/build/error-overlay/ErrorOverlay.js +55 -86
  67. package/build/error-overlay/ErrorOverlay.js.map +1 -1
  68. package/build/error-overlay/LogBox.d.ts +2 -2
  69. package/build/error-overlay/LogBox.d.ts.map +1 -1
  70. package/build/error-overlay/LogBox.js +1 -4
  71. package/build/error-overlay/LogBox.js.map +1 -1
  72. package/build/error-overlay/LogBox.web.d.ts +3 -3
  73. package/build/error-overlay/LogBox.web.d.ts.map +1 -1
  74. package/build/error-overlay/LogBox.web.js +12 -17
  75. package/build/error-overlay/LogBox.web.js.map +1 -1
  76. package/build/error-overlay/UI/AnsiHighlight.d.ts +2 -2
  77. package/build/error-overlay/UI/AnsiHighlight.d.ts.map +1 -1
  78. package/build/error-overlay/UI/AnsiHighlight.js +28 -36
  79. package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
  80. package/build/error-overlay/UI/LogBoxButton.d.ts +1 -1
  81. package/build/error-overlay/UI/LogBoxButton.d.ts.map +1 -1
  82. package/build/error-overlay/UI/LogBoxButton.js +18 -44
  83. package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
  84. package/build/error-overlay/UI/LogBoxMessage.d.ts +2 -2
  85. package/build/error-overlay/UI/LogBoxMessage.d.ts.map +1 -1
  86. package/build/error-overlay/UI/LogBoxMessage.js +10 -17
  87. package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
  88. package/build/error-overlay/UI/LogBoxStyle.d.ts +1 -1
  89. package/build/error-overlay/UI/LogBoxStyle.js +15 -32
  90. package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
  91. package/build/error-overlay/UI/constants.js +5 -8
  92. package/build/error-overlay/UI/constants.js.map +1 -1
  93. package/build/error-overlay/formatProjectFilePath.d.ts +1 -1
  94. package/build/error-overlay/formatProjectFilePath.d.ts.map +1 -1
  95. package/build/error-overlay/formatProjectFilePath.js +7 -14
  96. package/build/error-overlay/formatProjectFilePath.js.map +1 -1
  97. package/build/error-overlay/index.d.ts +1 -1
  98. package/build/error-overlay/index.d.ts.map +1 -1
  99. package/build/error-overlay/index.js +9 -17
  100. package/build/error-overlay/index.js.map +1 -1
  101. package/build/error-overlay/modules/ExceptionsManager/index.d.ts +1 -1
  102. package/build/error-overlay/modules/ExceptionsManager/index.d.ts.map +1 -1
  103. package/build/error-overlay/modules/ExceptionsManager/index.js +11 -21
  104. package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
  105. package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts +2 -1
  106. package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts.map +1 -1
  107. package/build/error-overlay/modules/ExceptionsManager/index.native.js +3 -3
  108. package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -1
  109. package/build/error-overlay/modules/NativeLogBox/index.d.ts.map +1 -1
  110. package/build/error-overlay/modules/NativeLogBox/index.js +10 -15
  111. package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
  112. package/build/error-overlay/modules/NativeLogBox/index.native.d.ts +1 -1
  113. package/build/error-overlay/modules/NativeLogBox/index.native.d.ts.map +1 -1
  114. package/build/error-overlay/modules/NativeLogBox/index.native.js +2 -8
  115. package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -1
  116. package/build/error-overlay/modules/openFileInEditor/index.js +5 -7
  117. package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
  118. package/build/error-overlay/modules/openFileInEditor/index.native.d.ts +1 -1
  119. package/build/error-overlay/modules/openFileInEditor/index.native.d.ts.map +1 -1
  120. package/build/error-overlay/modules/openFileInEditor/index.native.js +2 -8
  121. package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -1
  122. package/build/error-overlay/modules/parseErrorStack/index.d.ts +1 -1
  123. package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -1
  124. package/build/error-overlay/modules/parseErrorStack/index.js +4 -7
  125. package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
  126. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.d.ts +1 -1
  127. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js +2 -8
  128. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -1
  129. package/build/error-overlay/modules/stringifySafe/index.d.ts +1 -1
  130. package/build/error-overlay/modules/stringifySafe/index.d.ts.map +1 -1
  131. package/build/error-overlay/modules/stringifySafe/index.js +16 -22
  132. package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
  133. package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts +2 -2
  134. package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts.map +1 -1
  135. package/build/error-overlay/modules/symbolicateStackTrace/index.js +6 -8
  136. package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
  137. package/build/error-overlay/modules/symbolicateStackTrace/index.native.d.ts +1 -1
  138. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js +2 -7
  139. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -1
  140. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts +2 -2
  141. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
  142. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +28 -58
  143. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
  144. package/build/error-overlay/overlay/LogBoxInspectorFooter.d.ts.map +1 -1
  145. package/build/error-overlay/overlay/LogBoxInspectorFooter.js +35 -64
  146. package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
  147. package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts +1 -1
  148. package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts.map +1 -1
  149. package/build/error-overlay/overlay/LogBoxInspectorHeader.js +37 -71
  150. package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
  151. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts +2 -2
  152. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts.map +1 -1
  153. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +20 -54
  154. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
  155. package/build/error-overlay/overlay/LogBoxInspectorSection.d.ts +2 -2
  156. package/build/error-overlay/overlay/LogBoxInspectorSection.js +13 -43
  157. package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
  158. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts +2 -2
  159. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts.map +1 -1
  160. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +26 -55
  161. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
  162. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts +2 -2
  163. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts.map +1 -1
  164. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +23 -53
  165. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
  166. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts +2 -2
  167. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -1
  168. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +42 -76
  169. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
  170. package/build/error-overlay/toast/ErrorToast.d.ts +2 -2
  171. package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -1
  172. package/build/error-overlay/toast/ErrorToast.js +44 -72
  173. package/build/error-overlay/toast/ErrorToast.js.map +1 -1
  174. package/build/error-overlay/toast/ErrorToastContainer.d.ts +1 -1
  175. package/build/error-overlay/toast/ErrorToastContainer.js +3 -9
  176. package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
  177. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts +2 -2
  178. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -1
  179. package/build/error-overlay/toast/ErrorToastContainer.web.js +22 -49
  180. package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
  181. package/build/error-overlay/toast/ErrorToastMessage.d.ts +1 -1
  182. package/build/error-overlay/toast/ErrorToastMessage.d.ts.map +1 -1
  183. package/build/error-overlay/toast/ErrorToastMessage.js +8 -37
  184. package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
  185. package/build/error-overlay/useRejectionHandler.d.ts +1 -1
  186. package/build/error-overlay/useRejectionHandler.d.ts.map +1 -1
  187. package/build/error-overlay/useRejectionHandler.js +20 -28
  188. package/build/error-overlay/useRejectionHandler.js.map +1 -1
  189. package/build/getDevServer.d.ts.map +1 -1
  190. package/build/getDevServer.js +10 -16
  191. package/build/getDevServer.js.map +1 -1
  192. package/build/getDevServer.native.d.ts +2 -0
  193. package/build/getDevServer.native.d.ts.map +1 -1
  194. package/build/getDevServer.native.js +2 -2
  195. package/build/getDevServer.native.js.map +1 -1
  196. package/build/index.d.ts +2 -2
  197. package/build/index.js +4 -6
  198. package/build/index.js.map +1 -1
  199. package/build/location/Location.js +2 -7
  200. package/build/location/Location.js.map +1 -1
  201. package/build/location/Location.native.d.ts.map +1 -1
  202. package/build/location/Location.native.js +25 -32
  203. package/build/location/Location.native.js.map +1 -1
  204. package/build/location/install.js +0 -1
  205. package/build/location/install.native.d.ts +1 -1
  206. package/build/location/install.native.js +23 -34
  207. package/build/location/install.native.js.map +1 -1
  208. package/build/messageSocket.d.ts.map +1 -1
  209. package/build/messageSocket.js +5 -6
  210. package/build/messageSocket.js.map +1 -1
  211. package/build/setupFastRefresh.d.ts.map +1 -1
  212. package/build/setupFastRefresh.js +2 -4
  213. package/build/setupFastRefresh.js.map +1 -1
  214. package/build/setupHMR.js +5 -12
  215. package/build/setupHMR.js.map +1 -1
  216. package/build/symbolicate.d.ts +3 -3
  217. package/build/symbolicate.js +4 -25
  218. package/build/symbolicate.js.map +1 -1
  219. package/error-overlay.d.ts +1 -1
  220. package/error-overlay.js +1 -1
  221. package/package.json +25 -14
  222. package/LICENSE +0 -13
@@ -1,88 +1,62 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ErrorToast = void 0;
27
1
  /**
28
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
29
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
30
4
  *
31
5
  * This source code is licensed under the MIT license found in the
32
6
  * LICENSE file in the root directory of this source tree.
33
7
  */
34
- const react_views_1 = require("@bacons/react-views");
35
- const react_1 = __importStar(require("react"));
36
- const LogBoxData = __importStar(require("../Data/LogBoxData"));
37
- const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
38
- const ErrorToastMessage_1 = require("./ErrorToastMessage");
8
+ import React, { useEffect } from 'react';
9
+ import { Image, Pressable, StyleSheet, Text, View } from 'react-native';
10
+ import * as LogBoxData from '../Data/LogBoxData';
11
+ import * as LogBoxStyle from '../UI/LogBoxStyle';
12
+ import { ErrorToastMessage } from './ErrorToastMessage';
39
13
  function useSymbolicatedLog(log) {
40
14
  // Eagerly symbolicate so the stack is available when pressing to inspect.
41
- (0, react_1.useEffect)(() => {
42
- LogBoxData.symbolicateLogLazy("stack", log);
43
- LogBoxData.symbolicateLogLazy("component", log);
15
+ useEffect(() => {
16
+ LogBoxData.symbolicateLogLazy('stack', log);
17
+ LogBoxData.symbolicateLogLazy('component', log);
44
18
  }, [log]);
45
19
  }
46
- function ErrorToast(props) {
20
+ export function ErrorToast(props) {
47
21
  const { totalLogCount, level, log } = props;
48
22
  useSymbolicatedLog(log);
49
- return (react_1.default.createElement(react_views_1.View, { style: toastStyles.container },
50
- react_1.default.createElement(react_views_1.Pressable, { style: { flex: 1 }, onPress: props.onPressOpen }, ({ hovered, pressed }) => (react_1.default.createElement(react_views_1.View, { style: [
23
+ return (React.createElement(View, { style: toastStyles.container },
24
+ React.createElement(Pressable, { style: { flex: 1 }, onPress: props.onPressOpen }, ({
25
+ /** @ts-expect-error: react-native types are broken. */
26
+ hovered, pressed, }) => (React.createElement(View, { style: [
51
27
  toastStyles.press,
52
28
  {
53
- transitionDuration: "150ms",
29
+ // @ts-expect-error: web-only type
30
+ transitionDuration: '150ms',
54
31
  backgroundColor: pressed
55
- ? "#323232"
32
+ ? '#323232'
56
33
  : hovered
57
- ? "#111111"
34
+ ? '#111111'
58
35
  : LogBoxStyle.getBackgroundColor(),
59
36
  },
60
37
  ] },
61
- react_1.default.createElement(Count, { count: totalLogCount, level: level }),
62
- react_1.default.createElement(ErrorToastMessage_1.ErrorToastMessage, { message: log.message }),
63
- react_1.default.createElement(Dismiss, { onPress: props.onPressDismiss }))))));
38
+ React.createElement(Count, { count: totalLogCount, level: level }),
39
+ React.createElement(ErrorToastMessage, { message: log.message }),
40
+ React.createElement(Dismiss, { onPress: props.onPressDismiss }))))));
64
41
  }
65
- exports.ErrorToast = ErrorToast;
66
42
  function Count({ count, level }) {
67
- return (react_1.default.createElement(react_views_1.View, { style: [countStyles.inside, countStyles[level]] },
68
- react_1.default.createElement(react_views_1.Text, { style: countStyles.text }, count <= 1 ? "!" : count)));
43
+ return (React.createElement(View, { style: [countStyles.inside, countStyles[level]] },
44
+ React.createElement(Text, { style: countStyles.text }, count <= 1 ? '!' : count)));
69
45
  }
70
46
  function Dismiss({ onPress }) {
71
- return (react_1.default.createElement(react_views_1.Pressable, { style: {
47
+ return (React.createElement(Pressable, { style: {
72
48
  marginLeft: 5,
73
49
  }, hitSlop: {
74
50
  top: 12,
75
51
  right: 10,
76
52
  bottom: 12,
77
53
  left: 10,
78
- }, onPress: onPress }, ({ hovered, pressed }) => (react_1.default.createElement(react_views_1.View, { style: [
79
- dismissStyles.press,
80
- hovered && { opacity: 0.8 },
81
- pressed && { opacity: 0.5 },
82
- ] },
83
- react_1.default.createElement(react_views_1.Image, { source: require("@expo/metro-runtime/assets/close.png"), style: dismissStyles.image })))));
54
+ }, onPress: onPress }, ({
55
+ /** @ts-expect-error: react-native types are broken. */
56
+ hovered, pressed, }) => (React.createElement(View, { style: [dismissStyles.press, hovered && { opacity: 0.8 }, pressed && { opacity: 0.5 }] },
57
+ React.createElement(Image, { source: require('@expo/metro-runtime/assets/close.png'), style: dismissStyles.image })))));
84
58
  }
85
- const countStyles = react_views_1.StyleSheet.create({
59
+ const countStyles = StyleSheet.create({
86
60
  warn: {
87
61
  backgroundColor: LogBoxStyle.getWarningColor(1),
88
62
  },
@@ -98,47 +72,45 @@ const countStyles = react_views_1.StyleSheet.create({
98
72
  aspectRatio: 1,
99
73
  paddingHorizontal: 4,
100
74
  borderRadius: 11,
101
- justifyContent: "center",
102
- alignItems: "center",
75
+ justifyContent: 'center',
76
+ alignItems: 'center',
103
77
  },
104
78
  text: {
105
79
  color: LogBoxStyle.getTextColor(1),
106
80
  fontSize: 14,
107
81
  lineHeight: 18,
108
- textAlign: "center",
109
- fontWeight: "600",
110
- textShadowColor: LogBoxStyle.getBackgroundColor(0.8),
111
- textShadowOffset: { width: 0, height: 0 },
112
- textShadowRadius: 3,
82
+ textAlign: 'center',
83
+ fontWeight: '600',
84
+ textShadow: `0px 0px 3px ${LogBoxStyle.getBackgroundColor(0.8)}`,
113
85
  },
114
86
  });
115
- const dismissStyles = react_views_1.StyleSheet.create({
87
+ const dismissStyles = StyleSheet.create({
116
88
  press: {
117
- backgroundColor: "#323232",
89
+ backgroundColor: '#323232',
118
90
  height: 20,
119
91
  width: 20,
120
92
  borderRadius: 25,
121
- alignItems: "center",
122
- justifyContent: "center",
93
+ alignItems: 'center',
94
+ justifyContent: 'center',
123
95
  },
124
96
  image: {
125
97
  height: 8,
126
98
  width: 8,
127
99
  },
128
100
  });
129
- const toastStyles = react_views_1.StyleSheet.create({
101
+ const toastStyles = StyleSheet.create({
130
102
  container: {
131
103
  height: 48,
132
- justifyContent: "center",
104
+ justifyContent: 'center',
133
105
  marginBottom: 4,
134
106
  },
135
107
  press: {
136
108
  borderWidth: 1,
137
109
  borderRadius: 8,
138
- overflow: "hidden",
139
- flexDirection: "row",
140
- alignItems: "center",
141
- borderColor: "#323232",
110
+ overflow: 'hidden',
111
+ flexDirection: 'row',
112
+ alignItems: 'center',
113
+ borderColor: '#323232',
142
114
  backgroundColor: LogBoxStyle.getBackgroundColor(),
143
115
  flex: 1,
144
116
  paddingHorizontal: 12,
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorToast.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,qDAA+E;AAC/E,+CAAyC;AAEzC,+DAAiD;AAEjD,+DAAiD;AACjD,2DAAwD;AAUxD,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,GAA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,EAAE,CAAC,EAAE;QACzC,gBAAgB,EAAE,CAAC;KACpB;CACF,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,wBAAU,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE;QACL,eAAe,EAAE,SAAS;QAC1B,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,wBAAU,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) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Image, Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport React, { useEffect } from \"react\";\n\nimport * as LogBoxData from \"../Data/LogBoxData\";\nimport { LogBoxLog } from \"../Data/LogBoxLog\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\nimport { ErrorToastMessage } from \"./ErrorToastMessage\";\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 {({ hovered, pressed }) => (\n <View\n style={[\n toastStyles.press,\n {\n transitionDuration: \"150ms\",\n backgroundColor: pressed\n ? \"#323232\"\n : hovered\n ? \"#111111\"\n : LogBoxStyle.getBackgroundColor(),\n },\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 {({ hovered, pressed }) => (\n <View\n style={[\n dismissStyles.press,\n hovered && { opacity: 0.8 },\n pressed && { opacity: 0.5 },\n ]}\n >\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 textShadowColor: LogBoxStyle.getBackgroundColor(0.8),\n textShadowOffset: { width: 0, height: 0 },\n textShadowRadius: 3,\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"]}
1
+ {"version":3,"file":"ErrorToast.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToast.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD,SAAS,kBAAkB,CAAC,GAAc;IACxC,0EAA0E;IAC1E,SAAS,CAAC,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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;QACd,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,eAAe,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE;KACjE;CACF,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE;QACL,eAAe,EAAE,SAAS;QAC1B,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,UAAU,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, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport * as LogBoxData from '../Data/LogBoxData';\nimport { LogBoxLog } from '../Data/LogBoxLog';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\nimport { ErrorToastMessage } from './ErrorToastMessage';\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 textShadow: `0px 0px 3px ${LogBoxStyle.getBackgroundColor(0.8)}`,\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"]}
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export default function ErrorToastContainer({ children, }: {
3
3
  children: React.ReactNode;
4
4
  }): React.ReactElement;
@@ -1,11 +1,5 @@
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 react_1 = __importDefault(require("react"));
7
- function ErrorToastContainer({ children, }) {
8
- return react_1.default.createElement(react_1.default.Fragment, null, children);
1
+ import React from 'react';
2
+ export default function ErrorToastContainer({ children, }) {
3
+ return React.createElement(React.Fragment, null, children);
9
4
  }
10
- exports.default = ErrorToastContainer;
11
5
  //# sourceMappingURL=ErrorToastContainer.js.map
@@ -1 +1 @@
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"]}
1
+ {"version":3,"file":"ErrorToastContainer.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,QAAQ,GAGT;IACC,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,CAAC","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"]}
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
3
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- import React from "react";
8
+ import React from 'react';
9
9
  export declare function ErrorToastContainer(): JSX.Element | null;
10
10
  declare const _default: React.Component<object, {}, any>;
11
11
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorToastContainer.web.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.web.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AASpD,wBAAgB,mBAAmB,uBAOlC;;AAsED,wBAAgE"}
1
+ {"version":3,"file":"ErrorToastContainer.web.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.web.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AASpD,wBAAgB,mBAAmB,uBAOlC;;AAmED,wBAAgE"}
@@ -1,59 +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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ErrorToastContainer = void 0;
27
1
  /**
28
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
29
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
30
4
  *
31
5
  * This source code is licensed under the MIT license found in the
32
6
  * LICENSE file in the root directory of this source tree.
33
7
  */
34
- const react_1 = __importStar(require("react"));
35
- const react_native_1 = require("react-native");
36
- const LogBoxData = __importStar(require("../Data/LogBoxData"));
37
- const LogContext_1 = require("../Data/LogContext");
38
- const useRejectionHandler_1 = require("../useRejectionHandler");
39
- const ErrorToast_1 = require("./ErrorToast");
40
- function ErrorToastContainer() {
41
- (0, useRejectionHandler_1.useRejectionHandler)();
42
- const { logs, isDisabled } = (0, LogContext_1.useLogs)();
8
+ import React, { useCallback, useMemo } from 'react';
9
+ import { StyleSheet, View } from 'react-native';
10
+ import * as LogBoxData from '../Data/LogBoxData';
11
+ import { useLogs } from '../Data/LogContext';
12
+ import { useRejectionHandler } from '../useRejectionHandler';
13
+ import { ErrorToast } from './ErrorToast';
14
+ export function ErrorToastContainer() {
15
+ useRejectionHandler();
16
+ const { logs, isDisabled } = useLogs();
43
17
  if (!logs.length || isDisabled) {
44
18
  return null;
45
19
  }
46
- return react_1.default.createElement(ErrorToastStack, { logs: logs });
20
+ return React.createElement(ErrorToastStack, { logs: logs });
47
21
  }
48
- exports.ErrorToastContainer = ErrorToastContainer;
49
22
  function ErrorToastStack({ logs }) {
50
- const onDismissWarns = (0, react_1.useCallback)(() => {
23
+ const onDismissWarns = useCallback(() => {
51
24
  LogBoxData.clearWarnings();
52
25
  }, []);
53
- const onDismissErrors = (0, react_1.useCallback)(() => {
26
+ const onDismissErrors = useCallback(() => {
54
27
  LogBoxData.clearErrors();
55
28
  }, []);
56
- const setSelectedLog = (0, react_1.useCallback)((index) => {
29
+ const setSelectedLog = useCallback((index) => {
57
30
  LogBoxData.setSelectedLog(index);
58
31
  }, []);
59
32
  function openLog(log) {
@@ -64,20 +37,20 @@ function ErrorToastStack({ logs }) {
64
37
  }
65
38
  setSelectedLog(index);
66
39
  }
67
- const warnings = (0, react_1.useMemo)(() => logs.filter((log) => log.level === "warn"), [logs]);
68
- const errors = (0, react_1.useMemo)(() => logs.filter((log) => log.level === "error" || log.level === "fatal"), [logs]);
69
- return (react_1.default.createElement(react_native_1.View, { style: styles.list },
70
- warnings.length > 0 && (react_1.default.createElement(ErrorToast_1.ErrorToast, { log: warnings[warnings.length - 1], level: "warn", totalLogCount: warnings.length, onPressOpen: () => openLog(warnings[warnings.length - 1]), onPressDismiss: onDismissWarns })),
71
- errors.length > 0 && (react_1.default.createElement(ErrorToast_1.ErrorToast, { log: errors[errors.length - 1], level: "error", totalLogCount: errors.length, onPressOpen: () => openLog(errors[errors.length - 1]), onPressDismiss: onDismissErrors }))));
40
+ const warnings = useMemo(() => logs.filter((log) => log.level === 'warn'), [logs]);
41
+ const errors = useMemo(() => logs.filter((log) => log.level === 'error' || log.level === 'fatal'), [logs]);
42
+ return (React.createElement(View, { style: styles.list },
43
+ warnings.length > 0 && (React.createElement(ErrorToast, { log: warnings[warnings.length - 1], level: "warn", totalLogCount: warnings.length, onPressOpen: () => openLog(warnings[warnings.length - 1]), onPressDismiss: onDismissWarns })),
44
+ errors.length > 0 && (React.createElement(ErrorToast, { log: errors[errors.length - 1], level: "error", totalLogCount: errors.length, onPressOpen: () => openLog(errors[errors.length - 1]), onPressDismiss: onDismissErrors }))));
72
45
  }
73
- const styles = react_native_1.StyleSheet.create({
46
+ const styles = StyleSheet.create({
74
47
  list: {
75
48
  bottom: 6,
76
49
  left: 10,
77
50
  right: 10,
78
- position: "absolute",
51
+ position: 'absolute',
79
52
  maxWidth: 320,
80
53
  },
81
54
  });
82
- exports.default = LogBoxData.withSubscription(ErrorToastContainer);
55
+ export default LogBoxData.withSubscription(ErrorToastContainer);
83
56
  //# sourceMappingURL=ErrorToastContainer.web.js.map
@@ -1 +1 @@
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,+DAAiD;AAEjD,mDAA6C;AAC7C,gEAA6D;AAC7D,6CAA0C;AAE1C,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,GAAI,CAAC;AACzC,CAAC;AAPD,kDAOC;AAED,SAAS,eAAe,CA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C,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,UAAU;QACpB,QAAQ,EAAE,GAAG;KACd;CACF,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useCallback, useMemo } from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport * as LogBoxData from \"../Data/LogBoxData\";\nimport { LogBoxLog } from \"../Data/LogBoxLog\";\nimport { useLogs } from \"../Data/LogContext\";\nimport { useRejectionHandler } from \"../useRejectionHandler\";\nimport { ErrorToast } from \"./ErrorToast\";\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(\n () => logs.filter((log) => log.level === \"warn\"),\n [logs]\n );\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 position: \"absolute\",\n maxWidth: 320,\n },\n});\n\nexport default LogBoxData.withSubscription(ErrorToastContainer);\n"]}
1
+ {"version":3,"file":"ErrorToastContainer.web.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastContainer.web.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,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AC;QACT,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,GAAG;KACd;CACF,CAAC,CAAC;AAEH,eAAe,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 * as LogBoxData from '../Data/LogBoxData';\nimport { LogBoxLog } from '../Data/LogBoxLog';\nimport { useLogs } from '../Data/LogContext';\nimport { useRejectionHandler } from '../useRejectionHandler';\nimport { ErrorToast } from './ErrorToast';\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 position: 'absolute',\n maxWidth: 320,\n },\n});\n\nexport default LogBoxData.withSubscription(ErrorToastContainer);\n"]}
@@ -1,4 +1,4 @@
1
- import type { Message as MessageType } from "../Data/parseLogBoxLog";
1
+ import type { Message as MessageType } from '../Data/parseLogBoxLog';
2
2
  export declare function ErrorToastMessage({ message }: {
3
3
  message?: MessageType;
4
4
  }): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorToastMessage.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrE,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,eAYvE"}
1
+ {"version":3,"file":"ErrorToastMessage.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrE,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,eAMvE"}
@@ -1,42 +1,13 @@
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.ErrorToastMessage = void 0;
30
- const react_views_1 = require("@bacons/react-views");
31
- const react_1 = __importDefault(require("react"));
32
- const LogBoxMessage_1 = require("../UI/LogBoxMessage");
33
- const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
34
- function ErrorToastMessage({ message }) {
35
- return (react_1.default.createElement(react_views_1.Text, { numberOfLines: 1, selectable: false, style: styles.text }, message && (react_1.default.createElement(LogBoxMessage_1.LogBoxMessage, { plaintext: true, message: message, style: styles.substitutionText }))));
1
+ import React from 'react';
2
+ import { StyleSheet, Text } from 'react-native';
3
+ import { LogBoxMessage } from '../UI/LogBoxMessage';
4
+ import * as LogBoxStyle from '../UI/LogBoxStyle';
5
+ export function ErrorToastMessage({ message }) {
6
+ return (React.createElement(Text, { numberOfLines: 1, style: styles.text }, message && React.createElement(LogBoxMessage, { plaintext: true, message: message, style: styles.substitutionText })));
36
7
  }
37
- exports.ErrorToastMessage = ErrorToastMessage;
38
- const styles = react_views_1.StyleSheet.create({
8
+ const styles = StyleSheet.create({
39
9
  text: {
10
+ userSelect: 'none',
40
11
  paddingLeft: 8,
41
12
  color: LogBoxStyle.getTextColor(1),
42
13
  flex: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorToastMessage.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuD;AACvD,kDAA0B;AAG1B,uDAAoD;AACpD,+DAAiD;AAEjD,SAAgB,iBAAiB,CAAC,EAAE,OAAO,EAA6B;IACtE,OAAO,CACL,8BAAC,kBAAI,IAAC,aAAa,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,IAC1D,OAAO,IAAI,CACV,8BAAC,6BAAa,IACZ,SAAS,QACT,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,CAAC,gBAAgB,GAC9B,CACH,CACI,CACR,CAAC;AACJ,CAAC;AAZD,8CAYC;AAED,MAAM,MAAM,GAAG,wBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,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 { StyleSheet, Text } from \"@bacons/react-views\";\nimport React from \"react\";\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} selectable={false} style={styles.text}>\n {message && (\n <LogBoxMessage\n plaintext\n message={message}\n style={styles.substitutionText}\n />\n )}\n </Text>\n );\n}\n\nconst styles = StyleSheet.create({\n text: {\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"]}
1
+ {"version":3,"file":"ErrorToastMessage.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToastMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,iBAAiB,CAAC,EAAE,OAAO,EAA6B;IACtE,OAAO,CACL,oBAAC,IAAI,IAAC,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,IACvC,OAAO,IAAI,oBAAC,aAAa,IAAC,SAAS,QAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,GAAI,CACpF,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,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"]}
@@ -1,3 +1,3 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare function useRejectionHandler(): React.MutableRefObject<boolean>;
3
3
  //# sourceMappingURL=useRejectionHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRejectionHandler.d.ts","sourceRoot":"","sources":["../../src/error-overlay/useRejectionHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,wBAAgB,mBAAmB,oCA6ClC"}
1
+ {"version":3,"file":"useRejectionHandler.d.ts","sourceRoot":"","sources":["../../src/error-overlay/useRejectionHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,wBAAgB,mBAAmB,oCAqClC"}
@@ -1,60 +1,52 @@
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.useRejectionHandler = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const ExceptionsManager_1 = __importDefault(require("./modules/ExceptionsManager"));
1
+ import React from 'react';
2
+ import ExceptionsManager from './modules/ExceptionsManager';
9
3
  function useStackTraceLimit(limit) {
10
- const current = react_1.default.useRef(0);
11
- react_1.default.useEffect(() => {
4
+ const current = React.useRef(0);
5
+ React.useEffect(() => {
12
6
  try {
7
+ // @ts-expect-error: StackTraceLimit is not defined in the Error type
13
8
  const currentLimit = Error.stackTraceLimit;
9
+ // @ts-expect-error: StackTraceLimit is not defined in the Error type
14
10
  Error.stackTraceLimit = limit;
15
11
  current.current = currentLimit;
16
12
  }
17
13
  catch { }
18
14
  return () => {
19
15
  try {
16
+ // @ts-expect-error: StackTraceLimit is not defined in the Error type
20
17
  Error.stackTraceLimit = current.current;
21
18
  }
22
19
  catch { }
23
20
  };
24
21
  }, [limit]);
25
22
  }
26
- function useRejectionHandler() {
27
- const hasError = react_1.default.useRef(false);
23
+ export function useRejectionHandler() {
24
+ const hasError = React.useRef(false);
28
25
  useStackTraceLimit(35);
29
- react_1.default.useEffect(() => {
26
+ React.useEffect(() => {
30
27
  function onUnhandledError(ev) {
31
28
  hasError.current = true;
32
- const error = ev === null || ev === void 0 ? void 0 : ev.error;
33
- if (!error ||
34
- !(error instanceof Error) ||
35
- typeof error.stack !== "string") {
29
+ const error = ev?.error;
30
+ if (!error || !(error instanceof Error) || typeof error.stack !== 'string') {
36
31
  return;
37
32
  }
38
- ExceptionsManager_1.default.handleException(error);
33
+ ExceptionsManager.handleException(error);
39
34
  }
40
35
  function onUnhandledRejection(ev) {
41
36
  hasError.current = true;
42
- const reason = ev === null || ev === void 0 ? void 0 : ev.reason;
43
- if (!reason ||
44
- !(reason instanceof Error) ||
45
- typeof reason.stack !== "string") {
37
+ const reason = ev?.reason;
38
+ if (!reason || !(reason instanceof Error) || typeof reason.stack !== 'string') {
46
39
  return;
47
40
  }
48
- ExceptionsManager_1.default.handleException(reason);
41
+ ExceptionsManager.handleException(reason);
49
42
  }
50
- window.addEventListener("unhandledrejection", onUnhandledRejection);
51
- window.addEventListener("error", onUnhandledError);
43
+ window.addEventListener('unhandledrejection', onUnhandledRejection);
44
+ window.addEventListener('error', onUnhandledError);
52
45
  return () => {
53
- window.removeEventListener("error", onUnhandledError);
54
- window.removeEventListener("unhandledrejection", onUnhandledRejection);
46
+ window.removeEventListener('error', onUnhandledError);
47
+ window.removeEventListener('unhandledrejection', onUnhandledRejection);
55
48
  };
56
49
  }, []);
57
50
  return hasError;
58
51
  }
59
- exports.useRejectionHandler = useRejectionHandler;
60
52
  //# sourceMappingURL=useRejectionHandler.js.map
@@ -1 +1 @@
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,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC;YAC3C,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC;YAC9B,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC;SAChC;QAAC,MAAM,GAAE;QACV,OAAO,GAAG,EAAE;YACV,IAAI;gBACF,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,aAAF,EAAE,uBAAF,EAAE,CAAE,KAAK,CAAC;YACxB,IACE,CAAC,KAAK;gBACN,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;gBACzB,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAC/B;gBACA,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,aAAF,EAAE,uBAAF,EAAE,CAAE,MAAM,CAAC;YAC1B,IACE,CAAC,MAAM;gBACP,CAAC,CAAC,MAAM,YAAY,KAAK,CAAC;gBAC1B,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAChC;gBACA,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;AA7CD,kDA6CC","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 const currentLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = limit;\n current.current = currentLimit;\n } catch {}\n return () => {\n try {\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 (\n !error ||\n !(error instanceof Error) ||\n typeof error.stack !== \"string\"\n ) {\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 (\n !reason ||\n !(reason instanceof Error) ||\n typeof reason.stack !== \"string\"\n ) {\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
+ {"version":3,"file":"useRejectionHandler.js","sourceRoot":"","sources":["../../src/error-overlay/useRejectionHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAE5D,SAAS,kBAAkB,CAAC,KAAa;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAChC,KAAK,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,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAEvB,KAAK,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,iBAAiB,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,iBAAiB,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","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.d.ts","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY;;IAcd,0DAA0D;;;CAkB7D,CAAC;AAGF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"getDevServer.d.ts","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY;;IAcd,0DAA0D;;;CAkB7D,CAAC;AAEF,eAAe,YAAY,CAAC"}