@expo/metro-runtime 2.2.7 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) 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 +27 -27
  7. package/build/HMRClient.js.map +1 -1
  8. package/build/HMRClient.native.js +1 -1
  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 +2 -6
  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 +6 -1
  17. package/build/LoadingView.native.js.map +1 -1
  18. package/build/async-require/buildAsyncRequire.js.map +1 -1
  19. package/build/async-require/buildUrlForBundle.js +1 -1
  20. package/build/async-require/buildUrlForBundle.js.map +1 -1
  21. package/build/async-require/buildUrlForBundle.native.js +5 -4
  22. package/build/async-require/buildUrlForBundle.native.js.map +1 -1
  23. package/build/async-require/fetchAsync.d.ts.map +1 -1
  24. package/build/async-require/fetchAsync.js +2 -2
  25. package/build/async-require/fetchAsync.js.map +1 -1
  26. package/build/async-require/fetchAsync.native.d.ts +1 -1
  27. package/build/async-require/fetchAsync.native.d.ts.map +1 -1
  28. package/build/async-require/fetchAsync.native.js +10 -10
  29. package/build/async-require/fetchAsync.native.js.map +1 -1
  30. package/build/async-require/fetchThenEval.d.ts.map +1 -1
  31. package/build/async-require/fetchThenEval.js +2 -3
  32. package/build/async-require/fetchThenEval.js.map +1 -1
  33. package/build/async-require/fetchThenEval.web.d.ts.map +1 -1
  34. package/build/async-require/fetchThenEval.web.js +13 -22
  35. package/build/async-require/fetchThenEval.web.js.map +1 -1
  36. package/build/async-require/index.js +1 -3
  37. package/build/async-require/index.js.map +1 -1
  38. package/build/async-require/loadBundle.d.ts.map +1 -1
  39. package/build/async-require/loadBundle.js +8 -8
  40. package/build/async-require/loadBundle.js.map +1 -1
  41. package/build/effects.js +10 -10
  42. package/build/effects.js.map +1 -1
  43. package/build/effects.native.js +0 -1
  44. package/build/error-overlay/Data/LogBoxData.d.ts +5 -5
  45. package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
  46. package/build/error-overlay/Data/LogBoxData.js +46 -48
  47. package/build/error-overlay/Data/LogBoxData.js.map +1 -1
  48. package/build/error-overlay/Data/LogBoxLog.d.ts +10 -10
  49. package/build/error-overlay/Data/LogBoxLog.d.ts.map +1 -1
  50. package/build/error-overlay/Data/LogBoxLog.js +44 -40
  51. package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
  52. package/build/error-overlay/Data/LogBoxSymbolication.d.ts +2 -2
  53. package/build/error-overlay/Data/LogBoxSymbolication.js +5 -5
  54. package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
  55. package/build/error-overlay/Data/LogContext.d.ts +2 -2
  56. package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
  57. package/build/error-overlay/Data/LogContext.js +4 -4
  58. package/build/error-overlay/Data/LogContext.js.map +1 -1
  59. package/build/error-overlay/Data/parseLogBoxLog.d.ts +2 -2
  60. package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -1
  61. package/build/error-overlay/Data/parseLogBoxLog.js +26 -31
  62. package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
  63. package/build/error-overlay/ErrorOverlay.d.ts +10 -3
  64. package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
  65. package/build/error-overlay/ErrorOverlay.js +22 -21
  66. package/build/error-overlay/ErrorOverlay.js.map +1 -1
  67. package/build/error-overlay/LogBox.d.ts +2 -2
  68. package/build/error-overlay/LogBox.d.ts.map +1 -1
  69. package/build/error-overlay/LogBox.js +0 -1
  70. package/build/error-overlay/LogBox.js.map +1 -1
  71. package/build/error-overlay/LogBox.web.d.ts +3 -3
  72. package/build/error-overlay/LogBox.web.d.ts.map +1 -1
  73. package/build/error-overlay/LogBox.web.js +9 -12
  74. package/build/error-overlay/LogBox.web.js.map +1 -1
  75. package/build/error-overlay/UI/AnsiHighlight.d.ts +2 -2
  76. package/build/error-overlay/UI/AnsiHighlight.d.ts.map +1 -1
  77. package/build/error-overlay/UI/AnsiHighlight.js +21 -22
  78. package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
  79. package/build/error-overlay/UI/LogBoxButton.d.ts +1 -1
  80. package/build/error-overlay/UI/LogBoxButton.d.ts.map +1 -1
  81. package/build/error-overlay/UI/LogBoxButton.js +3 -5
  82. package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
  83. package/build/error-overlay/UI/LogBoxMessage.d.ts +2 -2
  84. package/build/error-overlay/UI/LogBoxMessage.d.ts.map +1 -1
  85. package/build/error-overlay/UI/LogBoxMessage.js +4 -4
  86. package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
  87. package/build/error-overlay/UI/LogBoxStyle.d.ts +1 -1
  88. package/build/error-overlay/UI/LogBoxStyle.js +1 -1
  89. package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
  90. package/build/error-overlay/UI/constants.js +3 -3
  91. package/build/error-overlay/UI/constants.js.map +1 -1
  92. package/build/error-overlay/formatProjectFilePath.d.ts +1 -1
  93. package/build/error-overlay/formatProjectFilePath.d.ts.map +1 -1
  94. package/build/error-overlay/formatProjectFilePath.js +5 -7
  95. package/build/error-overlay/formatProjectFilePath.js.map +1 -1
  96. package/build/error-overlay/index.d.ts +1 -1
  97. package/build/error-overlay/index.d.ts.map +1 -1
  98. package/build/error-overlay/index.js +6 -5
  99. package/build/error-overlay/index.js.map +1 -1
  100. package/build/error-overlay/modules/ExceptionsManager/index.d.ts +1 -1
  101. package/build/error-overlay/modules/ExceptionsManager/index.d.ts.map +1 -1
  102. package/build/error-overlay/modules/ExceptionsManager/index.js +9 -14
  103. package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
  104. package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts +2 -1
  105. package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts.map +1 -1
  106. package/build/error-overlay/modules/ExceptionsManager/index.native.js +7 -2
  107. package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -1
  108. package/build/error-overlay/modules/NativeLogBox/index.d.ts.map +1 -1
  109. package/build/error-overlay/modules/NativeLogBox/index.js +5 -5
  110. package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
  111. package/build/error-overlay/modules/NativeLogBox/index.native.d.ts +1 -1
  112. package/build/error-overlay/modules/NativeLogBox/index.native.d.ts.map +1 -1
  113. package/build/error-overlay/modules/NativeLogBox/index.native.js +0 -1
  114. package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -1
  115. package/build/error-overlay/modules/openFileInEditor/index.js +4 -4
  116. package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
  117. package/build/error-overlay/modules/openFileInEditor/index.native.d.ts +1 -1
  118. package/build/error-overlay/modules/openFileInEditor/index.native.d.ts.map +1 -1
  119. package/build/error-overlay/modules/openFileInEditor/index.native.js +0 -1
  120. package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -1
  121. package/build/error-overlay/modules/parseErrorStack/index.d.ts +1 -1
  122. package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -1
  123. package/build/error-overlay/modules/parseErrorStack/index.js +5 -5
  124. package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
  125. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.d.ts +1 -1
  126. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -1
  127. package/build/error-overlay/modules/stringifySafe/index.d.ts +1 -1
  128. package/build/error-overlay/modules/stringifySafe/index.d.ts.map +1 -1
  129. package/build/error-overlay/modules/stringifySafe/index.js +14 -16
  130. package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
  131. package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts +2 -2
  132. package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts.map +1 -1
  133. package/build/error-overlay/modules/symbolicateStackTrace/index.js +5 -5
  134. package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
  135. package/build/error-overlay/modules/symbolicateStackTrace/index.native.d.ts +1 -1
  136. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -1
  137. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts +2 -2
  138. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
  139. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +10 -11
  140. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
  141. package/build/error-overlay/overlay/LogBoxInspectorFooter.d.ts.map +1 -1
  142. package/build/error-overlay/overlay/LogBoxInspectorFooter.js +27 -24
  143. package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
  144. package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts +1 -1
  145. package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts.map +1 -1
  146. package/build/error-overlay/overlay/LogBoxInspectorHeader.js +18 -18
  147. package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
  148. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts +2 -2
  149. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts.map +1 -1
  150. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +6 -6
  151. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
  152. package/build/error-overlay/overlay/LogBoxInspectorSection.d.ts +2 -2
  153. package/build/error-overlay/overlay/LogBoxInspectorSection.js +4 -4
  154. package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
  155. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts +2 -2
  156. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts.map +1 -1
  157. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +13 -13
  158. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
  159. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts +2 -2
  160. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts.map +1 -1
  161. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +9 -9
  162. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
  163. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts +2 -2
  164. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -1
  165. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +24 -27
  166. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
  167. package/build/error-overlay/toast/ErrorToast.d.ts +2 -2
  168. package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -1
  169. package/build/error-overlay/toast/ErrorToast.js +35 -34
  170. package/build/error-overlay/toast/ErrorToast.js.map +1 -1
  171. package/build/error-overlay/toast/ErrorToastContainer.d.ts +1 -1
  172. package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
  173. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts +2 -2
  174. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -1
  175. package/build/error-overlay/toast/ErrorToastContainer.web.js +6 -5
  176. package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
  177. package/build/error-overlay/toast/ErrorToastMessage.d.ts +1 -1
  178. package/build/error-overlay/toast/ErrorToastMessage.d.ts.map +1 -1
  179. package/build/error-overlay/toast/ErrorToastMessage.js +4 -4
  180. package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
  181. package/build/error-overlay/useRejectionHandler.d.ts +1 -1
  182. package/build/error-overlay/useRejectionHandler.d.ts.map +1 -1
  183. package/build/error-overlay/useRejectionHandler.js +11 -12
  184. package/build/error-overlay/useRejectionHandler.js.map +1 -1
  185. package/build/getDevServer.d.ts.map +1 -1
  186. package/build/getDevServer.js +4 -5
  187. package/build/getDevServer.js.map +1 -1
  188. package/build/getDevServer.native.d.ts +2 -0
  189. package/build/getDevServer.native.d.ts.map +1 -1
  190. package/build/getDevServer.native.js +6 -1
  191. package/build/getDevServer.native.js.map +1 -1
  192. package/build/index.d.ts +1 -2
  193. package/build/index.d.ts.map +1 -1
  194. package/build/index.js +4 -4
  195. package/build/index.js.map +1 -1
  196. package/build/location/Location.native.d.ts.map +1 -1
  197. package/build/location/Location.native.js +21 -20
  198. package/build/location/Location.native.js.map +1 -1
  199. package/build/location/install.js +0 -1
  200. package/build/location/install.native.d.ts +1 -1
  201. package/build/location/install.native.js +16 -22
  202. package/build/location/install.native.js.map +1 -1
  203. package/build/messageSocket.d.ts.map +1 -1
  204. package/build/messageSocket.js +5 -6
  205. package/build/messageSocket.js.map +1 -1
  206. package/build/setupFastRefresh.d.ts.map +1 -1
  207. package/build/setupFastRefresh.js +2 -4
  208. package/build/setupFastRefresh.js.map +1 -1
  209. package/build/setupHMR.js +1 -3
  210. package/build/setupHMR.js.map +1 -1
  211. package/build/symbolicate.d.ts +3 -3
  212. package/build/symbolicate.js.map +1 -1
  213. package/error-overlay.d.ts +1 -1
  214. package/error-overlay.js +1 -1
  215. package/package.json +25 -14
  216. package/LICENSE +0 -13
@@ -8,11 +8,11 @@ function parseErrorStack(stack) {
8
8
  if (Array.isArray(stack)) {
9
9
  return stack;
10
10
  }
11
- // Native support for parsing for non-standard Hermes stack traces.
12
- // @ts-expect-error: HermesInternal is not a global variable, but it is injected by the Hermes VM.
13
- if (global.HermesInternal) {
14
- return require("./parseHermesStack").parseErrorStack(stack);
15
- }
11
+ // This file seems to be web-only, so we can remove this.
12
+ // // Native support for parsing for non-standard Hermes stack traces.
13
+ // if (global.HermesInternal) {
14
+ // return require('./parseHermesStack').parseErrorStack(stack);
15
+ // }
16
16
  return (0, stacktrace_parser_1.parse)(stack).map((frame) => {
17
17
  // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`
18
18
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/index.ts"],"names":[],"mappings":";;AAAA,yDAAsD;AAEtD,SAAS,eAAe,CACtB,KAAc;IAEd,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,EAAE,CAAC;KACX;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IAED,mEAAmE;IACnE,kGAAkG;IAClG,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,OAAO,CAAC,oBAAoB,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;KAC7D;IAED,OAAO,IAAA,yBAAK,EAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,wGAAwG;QACxG,OAAO;YACL,GAAG,KAAK;YACR,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;SACvD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,eAAe,CAAC","sourcesContent":["import { parse, StackFrame } from \"stacktrace-parser\";\n\nfunction parseErrorStack(\n stack?: string\n): (StackFrame & { collapse?: boolean })[] {\n if (stack == null) {\n return [];\n }\n if (Array.isArray(stack)) {\n return stack;\n }\n\n // Native support for parsing for non-standard Hermes stack traces.\n // @ts-expect-error: HermesInternal is not a global variable, but it is injected by the Hermes VM.\n if (global.HermesInternal) {\n return require(\"./parseHermesStack\").parseErrorStack(stack);\n }\n\n return parse(stack).map((frame) => {\n // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`\n return {\n ...frame,\n column: frame.column != null ? frame.column - 1 : null,\n };\n });\n}\n\nexport default parseErrorStack;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/index.ts"],"names":[],"mappings":";;AAAA,yDAAsD;AAEtD,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,EAAE,CAAC;KACX;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IAED,yDAAyD;IACzD,sEAAsE;IACtE,+BAA+B;IAC/B,iEAAiE;IACjE,IAAI;IAEJ,OAAO,IAAA,yBAAK,EAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,wGAAwG;QACxG,OAAO;YACL,GAAG,KAAK;YACR,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;SACvD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,eAAe,CAAC","sourcesContent":["import { parse, StackFrame } from 'stacktrace-parser';\n\nfunction parseErrorStack(stack?: string): (StackFrame & { collapse?: boolean })[] {\n if (stack == null) {\n return [];\n }\n if (Array.isArray(stack)) {\n return stack;\n }\n\n // This file seems to be web-only, so we can remove this.\n // // Native support for parsing for non-standard Hermes stack traces.\n // if (global.HermesInternal) {\n // return require('./parseHermesStack').parseErrorStack(stack);\n // }\n\n return parse(stack).map((frame) => {\n // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`\n return {\n ...frame,\n column: frame.column != null ? frame.column - 1 : null,\n };\n });\n}\n\nexport default parseErrorStack;\n"]}
@@ -1,3 +1,3 @@
1
- import parseErrorStack from "react-native/Libraries/Core/Devtools/parseErrorStack";
1
+ import parseErrorStack from 'react-native/Libraries/Core/Devtools/parseErrorStack';
2
2
  export { parseErrorStack };
3
3
  //# sourceMappingURL=parseHermesStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseHermesStack.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/parseHermesStack.ts"],"names":[],"mappings":";;;;;;AAAA,2GAAmF;AAE1E,0BAFF,yBAAe,CAEE","sourcesContent":["import parseErrorStack from \"react-native/Libraries/Core/Devtools/parseErrorStack\";\n\nexport { parseErrorStack };\n"]}
1
+ {"version":3,"file":"parseHermesStack.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/parseErrorStack/parseHermesStack.ts"],"names":[],"mappings":";;;;;;AAAA,2GAAmF;AAE1E,0BAFF,yBAAe,CAEE","sourcesContent":["import parseErrorStack from 'react-native/Libraries/Core/Devtools/parseErrorStack';\n\nexport { parseErrorStack };\n"]}
@@ -1,5 +1,5 @@
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CA0FvB;AAED,QAAA,MAAM,aAAa,QA5FT,GAAG,KAAK,MAiGhB,CAAC;AAEH,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAwFvB;AAED,QAAA,MAAM,aAAa,QA1FT,GAAG,KAAK,MA+FhB,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) Evan Bacon.
3
+ * Copyright (c) 650 Industries.
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
6
6
  * This source code is licensed under the MIT license found in the
@@ -19,14 +19,14 @@ function createStringifySafeWithLimits(limits) {
19
19
  while (stack.length && this !== stack[0]) {
20
20
  stack.shift();
21
21
  }
22
- if (typeof value === "string") {
23
- const truncatedString = "...(truncated)...";
22
+ if (typeof value === 'string') {
23
+ const truncatedString = '...(truncated)...';
24
24
  if (value.length > maxStringLimit + truncatedString.length) {
25
25
  return value.substring(0, maxStringLimit) + truncatedString;
26
26
  }
27
27
  return value;
28
28
  }
29
- if (typeof value !== "object" || value === null) {
29
+ if (typeof value !== 'object' || value === null) {
30
30
  return value;
31
31
  }
32
32
  let retval = value;
@@ -37,15 +37,13 @@ function createStringifySafeWithLimits(limits) {
37
37
  else if (value.length > maxArrayLimit) {
38
38
  retval = value
39
39
  .slice(0, maxArrayLimit)
40
- .concat([
41
- `... extra ${value.length - maxArrayLimit} values truncated ...`,
42
- ]);
40
+ .concat([`... extra ${value.length - maxArrayLimit} values truncated ...`]);
43
41
  }
44
42
  }
45
43
  else {
46
44
  // Add refinement after Array.isArray call.
47
- if (typeof value !== "object") {
48
- throw new Error("This was already found earlier");
45
+ if (typeof value !== 'object') {
46
+ throw new Error('This was already found earlier');
49
47
  }
50
48
  const keys = Object.keys(value);
51
49
  if (stack.length >= maxDepth) {
@@ -57,7 +55,7 @@ function createStringifySafeWithLimits(limits) {
57
55
  for (const k of keys.slice(0, maxObjectKeysLimit)) {
58
56
  retval[k] = value[k];
59
57
  }
60
- const truncatedKey = "...(truncated keys)...";
58
+ const truncatedKey = '...(truncated keys)...';
61
59
  retval[truncatedKey] = keys.length - maxObjectKeysLimit;
62
60
  }
63
61
  }
@@ -66,21 +64,21 @@ function createStringifySafeWithLimits(limits) {
66
64
  }
67
65
  return function stringifySafe(arg) {
68
66
  if (arg === undefined) {
69
- return "undefined";
67
+ return 'undefined';
70
68
  }
71
69
  else if (arg === null) {
72
- return "null";
70
+ return 'null';
73
71
  }
74
- else if (typeof arg === "function") {
72
+ else if (typeof arg === 'function') {
75
73
  try {
76
74
  return arg.toString();
77
75
  }
78
76
  catch {
79
- return "[function unknown]";
77
+ return '[function unknown]';
80
78
  }
81
79
  }
82
80
  else if (arg instanceof Error) {
83
- return arg.name + ": " + arg.message;
81
+ return arg.name + ': ' + arg.message;
84
82
  }
85
83
  else {
86
84
  // Perform a try catch, just in case the object has a circular
@@ -93,7 +91,7 @@ function createStringifySafeWithLimits(limits) {
93
91
  return ret;
94
92
  }
95
93
  catch {
96
- if (typeof arg.toString === "function") {
94
+ if (typeof arg.toString === 'function') {
97
95
  try {
98
96
  // $FlowFixMe[incompatible-use] : toString shouldn't take any arguments in general.
99
97
  return arg.toString();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;GAGG;AACH,SAAgB,6BAA6B,CAAC,MAK7C;IACC,MAAM,EACJ,QAAQ,GAAG,MAAM,CAAC,iBAAiB,EACnC,cAAc,GAAG,MAAM,CAAC,iBAAiB,EACzC,aAAa,GAAG,MAAM,CAAC,iBAAiB,EACxC,kBAAkB,GAAG,MA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BACrD;gBACD,OAAO,GAAG,CAAC;aACZ;YAAC,MAAM;gBACN,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,EAAE;oBACtC,IAAI;wBACF,mFAAmF;wBACnF,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;qBACvB;oBAAC,MAAM,GAAE;iBACX;aACF;SACF;QACD,OAAO,IAAI,GAAG,OAAO,GAAG,GAAG,wBAAwB,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC;AA/FD,sEA+FC;AAED,MAAM,aAAa,GAAG,6BAA6B,CAAC;IAClD,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,GAAG;IACnB,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,EAAE;CACvB,CAAC,CAAC;AAEH,kBAAe,aAAa,CAAC","sourcesContent":["/**\n * Copyright (c) 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 */\n\n/**\n * Tries to stringify with JSON.stringify and toString, but catches exceptions\n * (e.g. from circular objects) and always returns a string and never throws.\n */\nexport function createStringifySafeWithLimits(limits: {\n maxDepth?: number;\n maxStringLimit?: number;\n maxArrayLimit?: number;\n maxObjectKeysLimit?: number;\n}): (foo: any) => string {\n const {\n maxDepth = Number.POSITIVE_INFINITY,\n maxStringLimit = Number.POSITIVE_INFINITY,\n maxArrayLimit = Number.POSITIVE_INFINITY,\n maxObjectKeysLimit = Number.POSITIVE_INFINITY,\n } = limits;\n const stack: any[] = [];\n function replacer(this: unknown, _key: string, value: any): any {\n while (stack.length && this !== stack[0]) {\n stack.shift();\n }\n\n if (typeof value === \"string\") {\n const truncatedString = \"...(truncated)...\";\n if (value.length > maxStringLimit + truncatedString.length) {\n return value.substring(0, maxStringLimit) + truncatedString;\n }\n return value;\n }\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n let retval = value;\n if (Array.isArray(value)) {\n if (stack.length >= maxDepth) {\n retval = `[ ... array with ${value.length} values ... ]`;\n } else if (value.length > maxArrayLimit) {\n retval = value\n .slice(0, maxArrayLimit)\n .concat([\n `... extra ${value.length - maxArrayLimit} values truncated ...`,\n ]);\n }\n } else {\n // Add refinement after Array.isArray call.\n if (typeof value !== \"object\") {\n throw new Error(\"This was already found earlier\");\n }\n const keys = Object.keys(value);\n if (stack.length >= maxDepth) {\n retval = `{ ... object with ${keys.length} keys ... }`;\n } else if (keys.length > maxObjectKeysLimit) {\n // Return a sample of the keys.\n retval = {};\n for (const k of keys.slice(0, maxObjectKeysLimit)) {\n retval[k] = value[k];\n }\n const truncatedKey = \"...(truncated keys)...\";\n retval[truncatedKey] = keys.length - maxObjectKeysLimit;\n }\n }\n stack.unshift(retval);\n return retval;\n }\n\n return function stringifySafe(arg: any): string {\n if (arg === undefined) {\n return \"undefined\";\n } else if (arg === null) {\n return \"null\";\n } else if (typeof arg === \"function\") {\n try {\n return arg.toString();\n } catch {\n return \"[function unknown]\";\n }\n } else if (arg instanceof Error) {\n return arg.name + \": \" + arg.message;\n } else {\n // Perform a try catch, just in case the object has a circular\n // reference or stringify throws for some other reason.\n try {\n const ret = JSON.stringify(arg, replacer);\n if (ret === undefined) {\n return '[\"' + typeof arg + '\" failed to stringify]';\n }\n return ret;\n } catch {\n if (typeof arg.toString === \"function\") {\n try {\n // $FlowFixMe[incompatible-use] : toString shouldn't take any arguments in general.\n return arg.toString();\n } catch {}\n }\n }\n }\n return '[\"' + typeof arg + '\" failed to stringify]';\n };\n}\n\nconst stringifySafe = createStringifySafeWithLimits({\n maxDepth: 10,\n maxStringLimit: 100,\n maxArrayLimit: 50,\n maxObjectKeysLimit: 50,\n});\n\nexport default stringifySafe;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;GAGG;AACH,SAAgB,6BAA6B,CAAC,MAK7C;IACC,MAAM,EACJ,Q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AAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBAC1C,IAAI,GAAG,KAAK,SAAS,EAAE;oBACrB,OAAO,IAAI,GAAG,OAAO,GAAG,GAAG,wBAAwB,CAAC;iBACrD;gBACD,OAAO,GAAG,CAAC;aACZ;YAAC,MAAM;gBACN,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,EAAE;oBACtC,IAAI;wBACF,mFAAmF;wBACnF,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;qBACvB;oBAAC,MAAM,GAAE;iBACX;aACF;SACF;QACD,OAAO,IAAI,GAAG,OAAO,GAAG,GAAG,wBAAwB,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC;AA7FD,sEA6FC;AAED,MAAM,aAAa,GAAG,6BAA6B,CAAC;IAClD,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,GAAG;IACnB,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,EAAE;CACvB,CAAC,CAAC;AAEH,kBAAe,aAAa,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Tries to stringify with JSON.stringify and toString, but catches exceptions\n * (e.g. from circular objects) and always returns a string and never throws.\n */\nexport function createStringifySafeWithLimits(limits: {\n maxDepth?: number;\n maxStringLimit?: number;\n maxArrayLimit?: number;\n maxObjectKeysLimit?: number;\n}): (foo: any) => string {\n const {\n maxDepth = Number.POSITIVE_INFINITY,\n maxStringLimit = Number.POSITIVE_INFINITY,\n maxArrayLimit = Number.POSITIVE_INFINITY,\n maxObjectKeysLimit = Number.POSITIVE_INFINITY,\n } = limits;\n const stack: any[] = [];\n function replacer(this: unknown, _key: string, value: any): any {\n while (stack.length && this !== stack[0]) {\n stack.shift();\n }\n\n if (typeof value === 'string') {\n const truncatedString = '...(truncated)...';\n if (value.length > maxStringLimit + truncatedString.length) {\n return value.substring(0, maxStringLimit) + truncatedString;\n }\n return value;\n }\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n\n let retval = value;\n if (Array.isArray(value)) {\n if (stack.length >= maxDepth) {\n retval = `[ ... array with ${value.length} values ... ]`;\n } else if (value.length > maxArrayLimit) {\n retval = value\n .slice(0, maxArrayLimit)\n .concat([`... extra ${value.length - maxArrayLimit} values truncated ...`]);\n }\n } else {\n // Add refinement after Array.isArray call.\n if (typeof value !== 'object') {\n throw new Error('This was already found earlier');\n }\n const keys = Object.keys(value);\n if (stack.length >= maxDepth) {\n retval = `{ ... object with ${keys.length} keys ... }`;\n } else if (keys.length > maxObjectKeysLimit) {\n // Return a sample of the keys.\n retval = {};\n for (const k of keys.slice(0, maxObjectKeysLimit)) {\n retval[k] = value[k];\n }\n const truncatedKey = '...(truncated keys)...';\n retval[truncatedKey] = keys.length - maxObjectKeysLimit;\n }\n }\n stack.unshift(retval);\n return retval;\n }\n\n return function stringifySafe(arg: any): string {\n if (arg === undefined) {\n return 'undefined';\n } else if (arg === null) {\n return 'null';\n } else if (typeof arg === 'function') {\n try {\n return arg.toString();\n } catch {\n return '[function unknown]';\n }\n } else if (arg instanceof Error) {\n return arg.name + ': ' + arg.message;\n } else {\n // Perform a try catch, just in case the object has a circular\n // reference or stringify throws for some other reason.\n try {\n const ret = JSON.stringify(arg, replacer);\n if (ret === undefined) {\n return '[\"' + typeof arg + '\" failed to stringify]';\n }\n return ret;\n } catch {\n if (typeof arg.toString === 'function') {\n try {\n // $FlowFixMe[incompatible-use] : toString shouldn't take any arguments in general.\n return arg.toString();\n } catch {}\n }\n }\n }\n return '[\"' + typeof arg + '\" failed to stringify]';\n };\n}\n\nconst stringifySafe = createStringifySafeWithLimits({\n maxDepth: 10,\n maxStringLimit: 100,\n maxArrayLimit: 50,\n maxObjectKeysLimit: 50,\n});\n\nexport default stringifySafe;\n"]}
@@ -1,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 { StackFrame } from "stacktrace-parser";
8
+ import { StackFrame } from 'stacktrace-parser';
9
9
  export type CodeFrame = {
10
10
  content: string;
11
11
  location?: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,iBAAe,qBAAqB,CAClC,KAAK,EAAE,UAAU,EAAE,GAClB,OAAO,CAAC,sBAAsB,CAAC,CAWjC;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,iBAAe,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAWzF;AAED,eAAe,qBAAqB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) Evan Bacon.
3
+ * Copyright (c) 650 Industries.
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
6
6
  * This source code is licensed under the MIT license found in the
@@ -8,11 +8,11 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  async function symbolicateStackTrace(stack) {
11
- const baseUrl = typeof window === "undefined"
11
+ const baseUrl = typeof window === 'undefined'
12
12
  ? process.env.EXPO_DEV_SERVER_ORIGIN
13
- : window.location.protocol + "//" + window.location.host;
14
- const response = await fetch(baseUrl + "/symbolicate", {
15
- method: "POST",
13
+ : window.location.protocol + '//' + window.location.host;
14
+ const response = await fetch(baseUrl + '/symbolicate', {
15
+ method: 'POST',
16
16
  body: JSON.stringify({ stack }),
17
17
  });
18
18
  return await response.json();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,KAAK,UAAU,qBAAqB,CAClC,KAAmB;IAEnB,MAAM,OAAO,GACX,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB;QACpC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,GAAG,cAAc,EAAE;QACrD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,kBAAe,qBAAqB,CAAC","sourcesContent":["/**\n * Copyright (c) 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 */\n\nimport { StackFrame } from \"stacktrace-parser\";\n\nexport type CodeFrame = {\n content: string;\n location?: {\n row: number;\n column: number;\n [key: string]: any;\n };\n fileName: string;\n};\n\nexport type SymbolicatedStackTrace = {\n stack: StackFrame[];\n codeFrame?: CodeFrame;\n};\n\nasync function symbolicateStackTrace(\n stack: StackFrame[]\n): Promise<SymbolicatedStackTrace> {\n const baseUrl =\n typeof window === \"undefined\"\n ? process.env.EXPO_DEV_SERVER_ORIGIN\n : window.location.protocol + \"//\" + window.location.host;\n\n const response = await fetch(baseUrl + \"/symbolicate\", {\n method: \"POST\",\n body: JSON.stringify({ stack }),\n });\n return await response.json();\n}\n\nexport default symbolicateStackTrace;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,KAAK,UAAU,qBAAqB,CAAC,KAAmB;IACtD,MAAM,OAAO,GACX,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB;QACpC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,GAAG,cAAc,EAAE;QACrD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,kBAAe,qBAAqB,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { StackFrame } from 'stacktrace-parser';\n\nexport type CodeFrame = {\n content: string;\n location?: {\n row: number;\n column: number;\n [key: string]: any;\n };\n fileName: string;\n};\n\nexport type SymbolicatedStackTrace = {\n stack: StackFrame[];\n codeFrame?: CodeFrame;\n};\n\nasync function symbolicateStackTrace(stack: StackFrame[]): Promise<SymbolicatedStackTrace> {\n const baseUrl =\n typeof window === 'undefined'\n ? process.env.EXPO_DEV_SERVER_ORIGIN\n : window.location.protocol + '//' + window.location.host;\n\n const response = await fetch(baseUrl + '/symbolicate', {\n method: 'POST',\n body: JSON.stringify({ stack }),\n });\n return await response.json();\n}\n\nexport default symbolicateStackTrace;\n"]}
@@ -1,3 +1,3 @@
1
- import symbolicateStackTrace from "react-native/Libraries/Core/Devtools/symbolicateStackTrace";
1
+ import symbolicateStackTrace from 'react-native/Libraries/Core/Devtools/symbolicateStackTrace';
2
2
  export default symbolicateStackTrace;
3
3
  //# sourceMappingURL=index.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.native.ts"],"names":[],"mappings":";;;;;AAAA,uHAA+F;AAE/F,kBAAe,+BAAqB,CAAC","sourcesContent":["import symbolicateStackTrace from \"react-native/Libraries/Core/Devtools/symbolicateStackTrace\";\n\nexport default symbolicateStackTrace;\n"]}
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.native.ts"],"names":[],"mappings":";;;;;AAAA,uHAA+F;AAE/F,kBAAe,+BAAqB,CAAC","sourcesContent":["import symbolicateStackTrace from 'react-native/Libraries/Core/Devtools/symbolicateStackTrace';\n\nexport default symbolicateStackTrace;\n"]}
@@ -1,5 +1,5 @@
1
- import type { CodeFrame } from "../Data/parseLogBoxLog";
2
- export declare function LogBoxInspectorCodeFrame({ codeFrame, }: {
1
+ import type { CodeFrame } from '../Data/parseLogBoxLog';
2
+ export declare function LogBoxInspectorCodeFrame({ codeFrame }: {
3
3
  codeFrame?: CodeFrame;
4
4
  }): JSX.Element | null;
5
5
  //# sourceMappingURL=LogBoxInspectorCodeFrame.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxInspectorCodeFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAWxD,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,GACV,EAAE;IACD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,sBAiDA"}
1
+ {"version":3,"file":"LogBoxInspectorCodeFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUxD,wBAAgB,wBAAwB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,sBA2ChF"}
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.LogBoxInspectorCodeFrame = void 0;
30
30
  /**
31
- * Copyright (c) Evan Bacon.
31
+ * Copyright (c) 650 Industries.
32
32
  * Copyright (c) Meta Platforms, Inc. and affiliates.
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
@@ -36,22 +36,22 @@ exports.LogBoxInspectorCodeFrame = void 0;
36
36
  */
37
37
  const react_1 = __importDefault(require("react"));
38
38
  const react_native_1 = require("react-native");
39
+ const LogBoxInspectorSection_1 = require("./LogBoxInspectorSection");
39
40
  const AnsiHighlight_1 = require("../UI/AnsiHighlight");
40
41
  const LogBoxButton_1 = require("../UI/LogBoxButton");
41
42
  const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
42
43
  const constants_1 = require("../UI/constants");
43
44
  const formatProjectFilePath_1 = require("../formatProjectFilePath");
44
45
  const openFileInEditor_1 = __importDefault(require("../modules/openFileInEditor"));
45
- const LogBoxInspectorSection_1 = require("./LogBoxInspectorSection");
46
- function LogBoxInspectorCodeFrame({ codeFrame, }) {
46
+ function LogBoxInspectorCodeFrame({ codeFrame }) {
47
47
  if (codeFrame == null) {
48
48
  return null;
49
49
  }
50
50
  function getFileName() {
51
- return (0, formatProjectFilePath_1.formatProjectFilePath)(process.env.EXPO_PROJECT_ROOT, codeFrame === null || codeFrame === void 0 ? void 0 : codeFrame.fileName);
51
+ return (0, formatProjectFilePath_1.formatProjectFilePath)(process.env.EXPO_PROJECT_ROOT, codeFrame?.fileName);
52
52
  }
53
53
  function getLocation() {
54
- const location = codeFrame === null || codeFrame === void 0 ? void 0 : codeFrame.location;
54
+ const location = codeFrame?.location;
55
55
  if (location != null) {
56
56
  return ` (${location.row}:${location.column + 1 /* Code frame columns are zero indexed */})`;
57
57
  }
@@ -63,11 +63,10 @@ function LogBoxInspectorCodeFrame({ codeFrame, }) {
63
63
  react_1.default.createElement(react_native_1.ScrollView, { horizontal: true },
64
64
  react_1.default.createElement(AnsiHighlight_1.Ansi, { style: styles.content, text: codeFrame.content }))),
65
65
  react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: {
66
- default: "transparent",
66
+ default: 'transparent',
67
67
  pressed: LogBoxStyle.getBackgroundDarkColor(1),
68
68
  }, style: styles.button, onPress: () => {
69
- var _a, _b;
70
- (0, openFileInEditor_1.default)(codeFrame.fileName, (_b = (_a = codeFrame.location) === null || _a === void 0 ? void 0 : _a.row) !== null && _b !== void 0 ? _b : 0);
69
+ (0, openFileInEditor_1.default)(codeFrame.fileName, codeFrame.location?.row ?? 0);
71
70
  } },
72
71
  react_1.default.createElement(react_native_1.Text, { style: styles.fileText },
73
72
  getFileName(),
@@ -78,7 +77,7 @@ const styles = react_native_1.StyleSheet.create({
78
77
  box: {
79
78
  backgroundColor: LogBoxStyle.getBackgroundColor(),
80
79
  borderWidth: 1,
81
- borderColor: "#323232",
80
+ borderColor: '#323232',
82
81
  marginLeft: 10,
83
82
  marginRight: 10,
84
83
  marginTop: 5,
@@ -101,9 +100,9 @@ const styles = react_native_1.StyleSheet.create({
101
100
  fontFamily: constants_1.CODE_FONT,
102
101
  },
103
102
  fileText: {
104
- userSelect: "none",
103
+ userSelect: 'none',
105
104
  color: LogBoxStyle.getTextColor(0.5),
106
- textAlign: "center",
105
+ textAlign: 'center',
107
106
  flex: 1,
108
107
  fontSize: 16,
109
108
  includeFontPadding: false,
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAkE;AAGlE,uDAA2C;AAC3C,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAiE;AACjE,mFAA2D;AAC3D,qEAAkE;AAIlE,SAAgB,wBAAwB,CAAC,EACvC,SAAS,GAGV;IACC,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IAED,SAAS,WAAW;QAClB,OAAO,IAAA,6CAAqB,EAC1B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAC7B,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,CACpB,CAAC;IAC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S;QACtB,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,EAAE;QACX,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QAChD,iBAAiB,EAAE,CAAC;KACrB;IACD,MAAM,EAAE;QACN,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;KAClB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,qBAAS;KACtB;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,qBAAS;KACtB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { ScrollView, StyleSheet, Text, View } from \"react-native\";\n\nimport type { CodeFrame } from \"../Data/parseLogBoxLog\";\nimport { Ansi } from \"../UI/AnsiHighlight\";\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\nimport { CODE_FONT } from \"../UI/constants\";\nimport { formatProjectFilePath } from \"../formatProjectFilePath\";\nimport openFileInEditor from \"../modules/openFileInEditor\";\nimport { LogBoxInspectorSection } from \"./LogBoxInspectorSection\";\n\ndeclare const process: any;\n\nexport function LogBoxInspectorCodeFrame({\n codeFrame,\n}: {\n codeFrame?: CodeFrame;\n}) {\n if (codeFrame == null) {\n return null;\n }\n\n function getFileName() {\n return formatProjectFilePath(\n process.env.EXPO_PROJECT_ROOT,\n codeFrame?.fileName\n );\n }\n\n function getLocation() {\n const location = codeFrame?.location;\n if (location != null) {\n return ` (${location.row}:${\n location.column + 1 /* Code frame columns are zero indexed */\n })`;\n }\n\n return null;\n }\n\n return (\n <LogBoxInspectorSection heading=\"Source\">\n <View style={styles.box}>\n <View style={styles.frame}>\n <ScrollView horizontal>\n <Ansi style={styles.content} text={codeFrame.content} />\n </ScrollView>\n </View>\n <LogBoxButton\n backgroundColor={{\n default: \"transparent\",\n pressed: LogBoxStyle.getBackgroundDarkColor(1),\n }}\n style={styles.button}\n onPress={() => {\n openFileInEditor(codeFrame.fileName, codeFrame.location?.row ?? 0);\n }}\n >\n <Text style={styles.fileText}>\n {getFileName()}\n {getLocation()}\n </Text>\n </LogBoxButton>\n </View>\n </LogBoxInspectorSection>\n );\n}\n\nconst styles = StyleSheet.create({\n box: {\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n borderWidth: 1,\n borderColor: \"#323232\",\n marginLeft: 10,\n marginRight: 10,\n marginTop: 5,\n borderRadius: 3,\n },\n frame: {\n padding: 10,\n borderBottomColor: LogBoxStyle.getTextColor(0.1),\n borderBottomWidth: 1,\n },\n button: {\n paddingTop: 10,\n paddingBottom: 10,\n },\n content: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 20,\n fontFamily: CODE_FONT,\n },\n fileText: {\n userSelect: \"none\",\n color: LogBoxStyle.getTextColor(0.5),\n textAlign: \"center\",\n flex: 1,\n fontSize: 16,\n includeFontPadding: false,\n fontFamily: CODE_FONT,\n },\n});\n"]}
1
+ {"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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IAAI,CAAC,CAAC,CAAC;gBACrE,CAAC;gBACD,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ;oBACzB,WAAW,EAAE;oBACb,WAAW,EAAE,CACT,CACM,CACV,CACgB,CAC1B,CAAC;AACJ,CAAC;AA3CD,4DA2CC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,eAAe,EAAE,WAAW,CAAC,kBAAkB,EAAE;QACjD,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;QACtB,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,EAAE;QACX,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QAChD,iBAAiB,EAAE,CAAC;KACrB;IACD,MAAM,EAAE;QACN,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;KAClB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,qBAAS;KACtB;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,qBAAS;KACtB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\nimport { ScrollView, StyleSheet, Text, View } from 'react-native';\n\nimport { LogBoxInspectorSection } from './LogBoxInspectorSection';\nimport type { CodeFrame } from '../Data/parseLogBoxLog';\nimport { Ansi } from '../UI/AnsiHighlight';\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\nimport { CODE_FONT } from '../UI/constants';\nimport { formatProjectFilePath } from '../formatProjectFilePath';\nimport openFileInEditor from '../modules/openFileInEditor';\n\ndeclare const process: any;\n\nexport function LogBoxInspectorCodeFrame({ codeFrame }: { codeFrame?: CodeFrame }) {\n if (codeFrame == null) {\n return null;\n }\n\n function getFileName() {\n return formatProjectFilePath(process.env.EXPO_PROJECT_ROOT, codeFrame?.fileName);\n }\n\n function getLocation() {\n const location = codeFrame?.location;\n if (location != null) {\n return ` (${location.row}:${location.column + 1 /* Code frame columns are zero indexed */})`;\n }\n\n return null;\n }\n\n return (\n <LogBoxInspectorSection heading=\"Source\">\n <View style={styles.box}>\n <View style={styles.frame}>\n <ScrollView horizontal>\n <Ansi style={styles.content} text={codeFrame.content} />\n </ScrollView>\n </View>\n <LogBoxButton\n backgroundColor={{\n default: 'transparent',\n pressed: LogBoxStyle.getBackgroundDarkColor(1),\n }}\n style={styles.button}\n onPress={() => {\n openFileInEditor(codeFrame.fileName, codeFrame.location?.row ?? 0);\n }}>\n <Text style={styles.fileText}>\n {getFileName()}\n {getLocation()}\n </Text>\n </LogBoxButton>\n </View>\n </LogBoxInspectorSection>\n );\n}\n\nconst styles = StyleSheet.create({\n box: {\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n borderWidth: 1,\n borderColor: '#323232',\n marginLeft: 10,\n marginRight: 10,\n marginTop: 5,\n borderRadius: 3,\n },\n frame: {\n padding: 10,\n borderBottomColor: LogBoxStyle.getTextColor(0.1),\n borderBottomWidth: 1,\n },\n button: {\n paddingTop: 10,\n paddingBottom: 10,\n },\n content: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 20,\n fontFamily: CODE_FONT,\n },\n fileText: {\n userSelect: 'none',\n color: LogBoxStyle.getTextColor(0.5),\n textAlign: 'center',\n flex: 1,\n fontSize: 16,\n includeFontPadding: false,\n fontFamily: CODE_FONT,\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxInspectorFooter.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":"AAaA,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,eAqBjD"}
1
+ {"version":3,"file":"LogBoxInspectorFooter.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":"AAaA,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,eAmBjD"}
@@ -28,81 +28,84 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.LogBoxInspectorFooter = void 0;
30
30
  /**
31
- * Copyright (c) Evan Bacon.
31
+ * Copyright (c) 650 Industries.
32
32
  * Copyright (c) Meta Platforms, Inc. and affiliates.
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
36
  */
37
- const react_views_1 = require("@bacons/react-views");
38
37
  const react_1 = __importDefault(require("react"));
38
+ const react_native_1 = require("react-native");
39
39
  const LogContext_1 = require("../Data/LogContext");
40
40
  const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
41
41
  function LogBoxInspectorFooter(props) {
42
42
  const log = (0, LogContext_1.useSelectedLog)();
43
- if (["static", "syntax"].includes(log.level)) {
44
- return (react_1.default.createElement(react_views_1.View, { style: styles.root },
45
- react_1.default.createElement(react_views_1.View, { style: styles.button },
46
- react_1.default.createElement(react_views_1.Text, { style: styles.syntaxErrorText }, "This error cannot be dismissed."))));
43
+ if (['static', 'syntax'].includes(log.level)) {
44
+ return (react_1.default.createElement(react_native_1.View, { style: styles.root },
45
+ react_1.default.createElement(react_native_1.View, { style: styles.button },
46
+ react_1.default.createElement(react_native_1.Text, { style: styles.syntaxErrorText }, "This error cannot be dismissed."))));
47
47
  }
48
- return (react_1.default.createElement(react_views_1.View, { style: styles.root },
48
+ return (react_1.default.createElement(react_native_1.View, { style: styles.root },
49
49
  react_1.default.createElement(FooterButton, { text: "Dismiss", onPress: props.onDismiss }),
50
50
  react_1.default.createElement(FooterButton, { text: "Minimize", onPress: props.onMinimize })));
51
51
  }
52
52
  exports.LogBoxInspectorFooter = LogBoxInspectorFooter;
53
- function FooterButton({ text, onPress, }) {
54
- return (react_1.default.createElement(react_views_1.Pressable, { onPress: onPress, style: { flex: 1 } }, ({ hovered, pressed }) => (react_1.default.createElement(react_views_1.View, { style: [
53
+ function FooterButton({ text, onPress }) {
54
+ return (react_1.default.createElement(react_native_1.Pressable, { onPress: onPress, style: { flex: 1 } }, ({
55
+ /** @ts-expect-error: react-native types are broken. */
56
+ hovered, pressed, }) => (react_1.default.createElement(react_native_1.View, { style: [
55
57
  buttonStyles.safeArea,
56
58
  {
57
- transitionDuration: "150ms",
59
+ // @ts-expect-error: web-only type
60
+ transitionDuration: '150ms',
58
61
  backgroundColor: pressed
59
- ? "#323232"
62
+ ? '#323232'
60
63
  : hovered
61
- ? "#111111"
64
+ ? '#111111'
62
65
  : LogBoxStyle.getBackgroundColor(),
63
66
  },
64
67
  ] },
65
- react_1.default.createElement(react_views_1.View, { style: buttonStyles.content },
66
- react_1.default.createElement(react_views_1.Text, { style: buttonStyles.label }, text))))));
68
+ react_1.default.createElement(react_native_1.View, { style: buttonStyles.content },
69
+ react_1.default.createElement(react_native_1.Text, { style: buttonStyles.label }, text))))));
67
70
  }
68
- const buttonStyles = react_views_1.StyleSheet.create({
71
+ const buttonStyles = react_native_1.StyleSheet.create({
69
72
  safeArea: {
70
73
  flex: 1,
71
74
  borderTopWidth: 1,
72
- borderColor: "#323232",
75
+ borderColor: '#323232',
73
76
  // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,
74
77
  },
75
78
  content: {
76
- alignItems: "center",
79
+ alignItems: 'center',
77
80
  height: 48,
78
- justifyContent: "center",
81
+ justifyContent: 'center',
79
82
  },
80
83
  label: {
81
- userSelect: "none",
84
+ userSelect: 'none',
82
85
  color: LogBoxStyle.getTextColor(1),
83
86
  fontSize: 14,
84
87
  includeFontPadding: false,
85
88
  lineHeight: 20,
86
89
  },
87
90
  });
88
- const styles = react_views_1.StyleSheet.create({
91
+ const styles = react_native_1.StyleSheet.create({
89
92
  root: {
90
93
  backgroundColor: LogBoxStyle.getBackgroundColor(1),
91
94
  boxShadow: `0 -2px 0 2px #000`,
92
- flexDirection: "row",
95
+ flexDirection: 'row',
93
96
  },
94
97
  button: {
95
98
  flex: 1,
96
99
  },
97
100
  syntaxErrorText: {
98
- textAlign: "center",
99
- width: "100%",
101
+ textAlign: 'center',
102
+ width: '100%',
100
103
  height: 48,
101
104
  fontSize: 14,
102
105
  lineHeight: 20,
103
106
  paddingTop: 20,
104
107
  paddingBottom: 50,
105
- fontStyle: "italic",
108
+ fontStyle: 'italic',
106
109
  color: LogBoxStyle.getTextColor(0.6),
107
110
  },
108
111
  });
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,qDAAwE;AACxE,kDAA0B;AAE1B,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAA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F,CACR,CACS,CACb,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,wBAAU,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE;QACR,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,CAAC;QACjB,WAAW,EAAE,SAAS;QACtB,0EAA0E;KAC3E;IACD,OAAO,EAAE;QACP,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;CACF,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,wBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,eAAe,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAClD,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,KAAK;KACrB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;KACR;IACD,eAAe,EAAE;QACf,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;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 { Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport React from \"react\";\n\nimport { useSelectedLog } from \"../Data/LogContext\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n onDismiss: () => void;\n onMinimize: () => void;\n};\n\nexport function LogBoxInspectorFooter(props: Props) {\n const log = useSelectedLog();\n\n if ([\"static\", \"syntax\"].includes(log.level)) {\n return (\n <View style={styles.root}>\n <View style={styles.button}>\n <Text style={styles.syntaxErrorText}>\n This error cannot be dismissed.\n </Text>\n </View>\n </View>\n );\n }\n\n return (\n <View style={styles.root}>\n <FooterButton text=\"Dismiss\" onPress={props.onDismiss} />\n <FooterButton text=\"Minimize\" onPress={props.onMinimize} />\n </View>\n );\n}\n\nfunction FooterButton({\n text,\n onPress,\n}: {\n onPress: () => void;\n text: string;\n}) {\n return (\n <Pressable onPress={onPress} style={{ flex: 1 }}>\n {({ hovered, pressed }) => (\n <View\n style={[\n buttonStyles.safeArea,\n {\n transitionDuration: \"150ms\",\n backgroundColor: pressed\n ? \"#323232\"\n : hovered\n ? \"#111111\"\n : LogBoxStyle.getBackgroundColor(),\n },\n ]}\n >\n <View style={buttonStyles.content}>\n <Text style={buttonStyles.label}>{text}</Text>\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst buttonStyles = StyleSheet.create({\n safeArea: {\n flex: 1,\n borderTopWidth: 1,\n borderColor: \"#323232\",\n // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,\n },\n content: {\n alignItems: \"center\",\n height: 48,\n justifyContent: \"center\",\n },\n label: {\n userSelect: \"none\",\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n },\n});\n\nconst styles = StyleSheet.create({\n root: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n boxShadow: `0 -2px 0 2px #000`,\n flexDirection: \"row\",\n },\n button: {\n flex: 1,\n },\n syntaxErrorText: {\n textAlign: \"center\",\n width: \"100%\",\n height: 48,\n fontSize: 14,\n lineHeight: 20,\n paddingTop: 20,\n paddingBottom: 50,\n fontStyle: \"italic\",\n color: LogBoxStyle.getTextColor(0.6),\n },\n});\n"]}
1
+ {"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAiE;AAEjE,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAAG,GAAG,IAAA,2BAAc,GAAE,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC5C,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;YACtB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,sCAAwC,CACtE,CACF,CACR,CAAC;KACH;IAED,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,YAAY,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAI;QACzD,8BAAC,YAAY,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,KAAK,CAAC,UAAU,GAAI,CACtD,CACR,CAAC;AACJ,CAAC;AAnBD,sDAmBC;AAED,SAAS,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAyC;IAC5E,OAAO,CACL,8BAAC,wBAAS,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAC5C,CAAC;IACA,uDAAuD;IACvD,OAAO,EACP,OAAO,GACR,EAAE,EAAE,CAAC,CACJ,8BAAC,mBAAI,IACH,KAAK,EAAE;YACL,YAAY,CAAC,QAAQ;YACrB;gBACE,kCAAkC;gBAClC,kBAA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KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { useSelectedLog } from '../Data/LogContext';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n onDismiss: () => void;\n onMinimize: () => void;\n};\n\nexport function LogBoxInspectorFooter(props: Props) {\n const log = useSelectedLog();\n\n if (['static', 'syntax'].includes(log.level)) {\n return (\n <View style={styles.root}>\n <View style={styles.button}>\n <Text style={styles.syntaxErrorText}>This error cannot be dismissed.</Text>\n </View>\n </View>\n );\n }\n\n return (\n <View style={styles.root}>\n <FooterButton text=\"Dismiss\" onPress={props.onDismiss} />\n <FooterButton text=\"Minimize\" onPress={props.onMinimize} />\n </View>\n );\n}\n\nfunction FooterButton({ text, onPress }: { onPress: () => void; text: string }) {\n return (\n <Pressable onPress={onPress} style={{ flex: 1 }}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[\n buttonStyles.safeArea,\n {\n // @ts-expect-error: web-only type\n transitionDuration: '150ms',\n backgroundColor: pressed\n ? '#323232'\n : hovered\n ? '#111111'\n : LogBoxStyle.getBackgroundColor(),\n },\n ]}>\n <View style={buttonStyles.content}>\n <Text style={buttonStyles.label}>{text}</Text>\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst buttonStyles = StyleSheet.create({\n safeArea: {\n flex: 1,\n borderTopWidth: 1,\n borderColor: '#323232',\n // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,\n },\n content: {\n alignItems: 'center',\n height: 48,\n justifyContent: 'center',\n },\n label: {\n userSelect: 'none',\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n },\n});\n\nconst styles = StyleSheet.create({\n root: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n boxShadow: `0 -2px 0 2px #000`,\n flexDirection: 'row',\n },\n button: {\n flex: 1,\n },\n syntaxErrorText: {\n textAlign: 'center',\n width: '100%',\n height: 48,\n fontSize: 14,\n lineHeight: 20,\n paddingTop: 20,\n paddingBottom: 50,\n fontStyle: 'italic',\n color: LogBoxStyle.getTextColor(0.6),\n },\n});\n"]}
@@ -1,4 +1,4 @@
1
- import type { LogLevel } from "../Data/LogBoxLog";
1
+ import type { LogLevel } from '../Data/LogBoxLog';
2
2
  type Props = {
3
3
  onSelectIndex: (selectedIndex: number) => void;
4
4
  level: LogLevel;
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxInspectorHeader.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorHeader.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAKlD,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,eA0CjD"}
1
+ {"version":3,"file":"LogBoxInspectorHeader.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAKlD,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,eA0CjD"}