@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 +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,OAAO,EAAE,KAAK,EAAc,MAAM,mBAAmB,CAAC;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,mEAAmE;IACnE,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,OAAO,CAAC,oBAAoB,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;KAC7D;IAED,OAAO,KAAK,CAAC,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,eAAe,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 // 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,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parseErrorStack = void 0;
7
- const parseErrorStack_1 = __importDefault(require("react-native/Libraries/Core/Devtools/parseErrorStack"));
8
- exports.parseErrorStack = parseErrorStack_1.default;
1
+ import parseErrorStack from 'react-native/Libraries/Core/Devtools/parseErrorStack';
2
+ export { parseErrorStack };
9
3
  //# sourceMappingURL=parseHermesStack.js.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,OAAO,eAAe,MAAM,sDAAsD,CAAC;AAEnF,OAAO,EAAE,eAAe,EAAE,CAAC","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,32 +1,29 @@
1
- "use strict";
2
1
  /**
3
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
4
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
4
  *
6
5
  * This source code is licensed under the MIT license found in the
7
6
  * LICENSE file in the root directory of this source tree.
8
7
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.createStringifySafeWithLimits = void 0;
11
8
  /**
12
9
  * Tries to stringify with JSON.stringify and toString, but catches exceptions
13
10
  * (e.g. from circular objects) and always returns a string and never throws.
14
11
  */
15
- function createStringifySafeWithLimits(limits) {
12
+ export function createStringifySafeWithLimits(limits) {
16
13
  const { maxDepth = Number.POSITIVE_INFINITY, maxStringLimit = Number.POSITIVE_INFINITY, maxArrayLimit = Number.POSITIVE_INFINITY, maxObjectKeysLimit = Number.POSITIVE_INFINITY, } = limits;
17
14
  const stack = [];
18
15
  function replacer(_key, value) {
19
16
  while (stack.length && this !== stack[0]) {
20
17
  stack.shift();
21
18
  }
22
- if (typeof value === "string") {
23
- const truncatedString = "...(truncated)...";
19
+ if (typeof value === 'string') {
20
+ const truncatedString = '...(truncated)...';
24
21
  if (value.length > maxStringLimit + truncatedString.length) {
25
22
  return value.substring(0, maxStringLimit) + truncatedString;
26
23
  }
27
24
  return value;
28
25
  }
29
- if (typeof value !== "object" || value === null) {
26
+ if (typeof value !== 'object' || value === null) {
30
27
  return value;
31
28
  }
32
29
  let retval = value;
@@ -37,15 +34,13 @@ function createStringifySafeWithLimits(limits) {
37
34
  else if (value.length > maxArrayLimit) {
38
35
  retval = value
39
36
  .slice(0, maxArrayLimit)
40
- .concat([
41
- `... extra ${value.length - maxArrayLimit} values truncated ...`,
42
- ]);
37
+ .concat([`... extra ${value.length - maxArrayLimit} values truncated ...`]);
43
38
  }
44
39
  }
45
40
  else {
46
41
  // Add refinement after Array.isArray call.
47
- if (typeof value !== "object") {
48
- throw new Error("This was already found earlier");
42
+ if (typeof value !== 'object') {
43
+ throw new Error('This was already found earlier');
49
44
  }
50
45
  const keys = Object.keys(value);
51
46
  if (stack.length >= maxDepth) {
@@ -57,7 +52,7 @@ function createStringifySafeWithLimits(limits) {
57
52
  for (const k of keys.slice(0, maxObjectKeysLimit)) {
58
53
  retval[k] = value[k];
59
54
  }
60
- const truncatedKey = "...(truncated keys)...";
55
+ const truncatedKey = '...(truncated keys)...';
61
56
  retval[truncatedKey] = keys.length - maxObjectKeysLimit;
62
57
  }
63
58
  }
@@ -66,21 +61,21 @@ function createStringifySafeWithLimits(limits) {
66
61
  }
67
62
  return function stringifySafe(arg) {
68
63
  if (arg === undefined) {
69
- return "undefined";
64
+ return 'undefined';
70
65
  }
71
66
  else if (arg === null) {
72
- return "null";
67
+ return 'null';
73
68
  }
74
- else if (typeof arg === "function") {
69
+ else if (typeof arg === 'function') {
75
70
  try {
76
71
  return arg.toString();
77
72
  }
78
73
  catch {
79
- return "[function unknown]";
74
+ return '[function unknown]';
80
75
  }
81
76
  }
82
77
  else if (arg instanceof Error) {
83
- return arg.name + ": " + arg.message;
78
+ return arg.name + ': ' + arg.message;
84
79
  }
85
80
  else {
86
81
  // Perform a try catch, just in case the object has a circular
@@ -93,7 +88,7 @@ function createStringifySafeWithLimits(limits) {
93
88
  return ret;
94
89
  }
95
90
  catch {
96
- if (typeof arg.toString === "function") {
91
+ if (typeof arg.toString === 'function') {
97
92
  try {
98
93
  // $FlowFixMe[incompatible-use] : toString shouldn't take any arguments in general.
99
94
  return arg.toString();
@@ -105,12 +100,11 @@ function createStringifySafeWithLimits(limits) {
105
100
  return '["' + typeof arg + '" failed to stringify]';
106
101
  };
107
102
  }
108
- exports.createStringifySafeWithLimits = createStringifySafeWithLimits;
109
103
  const stringifySafe = createStringifySafeWithLimits({
110
104
  maxDepth: 10,
111
105
  maxStringLimit: 100,
112
106
  maxArrayLimit: 50,
113
107
  maxObjectKeysLimit: 50,
114
108
  });
115
- exports.default = stringifySafe;
109
+ export default stringifySafe;
116
110
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/stringifySafe/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;GAGG;AACH,SAAgB,6BAA6B,CAAC,MAK7C;IACC,MAAM,EACJ,QAAQ,GAAG,MAAM,CAAC,iBAAiB,EACnC,cAAc,GAAG,MAAM,CAAC,iBAAiB,EACzC,aAAa,GAAG,MAAM,CAAC,iBAAiB,EACxC,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,GAC9C,GAAG,MAAM,CAAC;IACX,MAAM,KAAK,GAAU,EAAE,CAAC;IACxB,SAAS,QAAQ,CAAgB,IAAY,EAAE,KAAU;QACvD,OAAO,KAAK,CAAC,MAAM,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE;YACxC,KAAK,CAAC,KAAK,EAAE,CAAC;SACf;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,eAAe,GAAG,mBAAmB,CAAC;YAC5C,IAAI,KAAK,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BAA6B,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,MAAM,UAAU,6BAA6B,CAAC,MAK7C;IACC,MAAM,EACJ,QAAQ,GAAG,MAAM,CAAC,iBAAiB,EACnC,cAAc,GAAG,MAAM,CAAC,iBAAiB,EACzC,aAAa,GAAG,MAAM,CAAC,iBAAiB,EACxC,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,GAC9C,GAAG,MAAM,CAAC;IACX,MAAM,KAAK,GAAU,EAAE,CAAC;IACxB,SAAS,QAAQ,CAAgB,IAAY,EAAE,KAAU;QACvD,OAAO,KAAK,CAAC,MAAM,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE;YACxC,K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;aACF;SACF;QACD,OAAO,IAAI,GAAG,OAAO,GAAG,GAAG,wBAAwB,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC;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,eAAe,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,21 +1,19 @@
1
- "use strict";
2
1
  /**
3
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
4
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
4
  *
6
5
  * This source code is licensed under the MIT license found in the
7
6
  * LICENSE file in the root directory of this source tree.
8
7
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
8
  async function symbolicateStackTrace(stack) {
11
- const baseUrl = typeof window === "undefined"
9
+ const baseUrl = typeof window === 'undefined'
12
10
  ? process.env.EXPO_DEV_SERVER_ORIGIN
13
- : window.location.protocol + "//" + window.location.host;
14
- const response = await fetch(baseUrl + "/symbolicate", {
15
- method: "POST",
11
+ : window.location.protocol + '//' + window.location.host;
12
+ const response = await fetch(baseUrl + '/symbolicate', {
13
+ method: 'POST',
16
14
  body: JSON.stringify({ stack }),
17
15
  });
18
16
  return await response.json();
19
17
  }
20
- exports.default = symbolicateStackTrace;
18
+ export default symbolicateStackTrace;
21
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;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,eAAe,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,8 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const symbolicateStackTrace_1 = __importDefault(require("react-native/Libraries/Core/Devtools/symbolicateStackTrace"));
7
- exports.default = symbolicateStackTrace_1.default;
1
+ import symbolicateStackTrace from 'react-native/Libraries/Core/Devtools/symbolicateStackTrace';
2
+ export default symbolicateStackTrace;
8
3
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.native.ts"],"names":[],"mappings":";;;;;AAAA,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,OAAO,qBAAqB,MAAM,4DAA4D,CAAC;AAE/F,eAAe,qBAAqB,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":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAWxD,wBAAgB,wBAAwB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,sBA2ChF"}
@@ -1,84 +1,53 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.LogBoxInspectorCodeFrame = void 0;
30
1
  /**
31
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
32
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
33
4
  *
34
5
  * This source code is licensed under the MIT license found in the
35
6
  * LICENSE file in the root directory of this source tree.
36
7
  */
37
- const react_1 = __importDefault(require("react"));
38
- const react_native_1 = require("react-native");
39
- const AnsiHighlight_1 = require("../UI/AnsiHighlight");
40
- const LogBoxButton_1 = require("../UI/LogBoxButton");
41
- const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
42
- const constants_1 = require("../UI/constants");
43
- const formatProjectFilePath_1 = require("../formatProjectFilePath");
44
- const openFileInEditor_1 = __importDefault(require("../modules/openFileInEditor"));
45
- const LogBoxInspectorSection_1 = require("./LogBoxInspectorSection");
46
- function LogBoxInspectorCodeFrame({ codeFrame, }) {
8
+ import React from 'react';
9
+ import { ScrollView, StyleSheet, Text, View } from 'react-native';
10
+ import { Ansi } from '../UI/AnsiHighlight';
11
+ import { LogBoxButton } from '../UI/LogBoxButton';
12
+ import * as LogBoxStyle from '../UI/LogBoxStyle';
13
+ import { CODE_FONT } from '../UI/constants';
14
+ import { formatProjectFilePath } from '../formatProjectFilePath';
15
+ import openFileInEditor from '../modules/openFileInEditor';
16
+ import { LogBoxInspectorSection } from './LogBoxInspectorSection';
17
+ export function LogBoxInspectorCodeFrame({ codeFrame }) {
47
18
  if (codeFrame == null) {
48
19
  return null;
49
20
  }
50
21
  function getFileName() {
51
- return (0, formatProjectFilePath_1.formatProjectFilePath)(process.env.EXPO_PROJECT_ROOT, codeFrame === null || codeFrame === void 0 ? void 0 : codeFrame.fileName);
22
+ return formatProjectFilePath(process.env.EXPO_PROJECT_ROOT, codeFrame?.fileName);
52
23
  }
53
24
  function getLocation() {
54
- const location = codeFrame === null || codeFrame === void 0 ? void 0 : codeFrame.location;
25
+ const location = codeFrame?.location;
55
26
  if (location != null) {
56
27
  return ` (${location.row}:${location.column + 1 /* Code frame columns are zero indexed */})`;
57
28
  }
58
29
  return null;
59
30
  }
60
- return (react_1.default.createElement(LogBoxInspectorSection_1.LogBoxInspectorSection, { heading: "Source" },
61
- react_1.default.createElement(react_native_1.View, { style: styles.box },
62
- react_1.default.createElement(react_native_1.View, { style: styles.frame },
63
- react_1.default.createElement(react_native_1.ScrollView, { horizontal: true },
64
- react_1.default.createElement(AnsiHighlight_1.Ansi, { style: styles.content, text: codeFrame.content }))),
65
- react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: {
66
- default: "transparent",
31
+ return (React.createElement(LogBoxInspectorSection, { heading: "Source" },
32
+ React.createElement(View, { style: styles.box },
33
+ React.createElement(View, { style: styles.frame },
34
+ React.createElement(ScrollView, { horizontal: true },
35
+ React.createElement(Ansi, { style: styles.content, text: codeFrame.content }))),
36
+ React.createElement(LogBoxButton, { backgroundColor: {
37
+ default: 'transparent',
67
38
  pressed: LogBoxStyle.getBackgroundDarkColor(1),
68
39
  }, 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);
40
+ openFileInEditor(codeFrame.fileName, codeFrame.location?.row ?? 0);
71
41
  } },
72
- react_1.default.createElement(react_native_1.Text, { selectable: false, style: styles.fileText },
42
+ React.createElement(Text, { style: styles.fileText },
73
43
  getFileName(),
74
44
  getLocation())))));
75
45
  }
76
- exports.LogBoxInspectorCodeFrame = LogBoxInspectorCodeFrame;
77
- const styles = react_native_1.StyleSheet.create({
46
+ const styles = StyleSheet.create({
78
47
  box: {
79
48
  backgroundColor: LogBoxStyle.getBackgroundColor(),
80
49
  borderWidth: 1,
81
- borderColor: "#323232",
50
+ borderColor: '#323232',
82
51
  marginLeft: 10,
83
52
  marginRight: 10,
84
53
  marginTop: 5,
@@ -98,15 +67,16 @@ const styles = react_native_1.StyleSheet.create({
98
67
  fontSize: 12,
99
68
  includeFontPadding: false,
100
69
  lineHeight: 20,
101
- fontFamily: constants_1.CODE_FONT,
70
+ fontFamily: CODE_FONT,
102
71
  },
103
72
  fileText: {
73
+ userSelect: 'none',
104
74
  color: LogBoxStyle.getTextColor(0.5),
105
- textAlign: "center",
75
+ textAlign: 'center',
106
76
  flex: 1,
107
77
  fontSize: 16,
108
78
  includeFontPadding: false,
109
- fontFamily: constants_1.CODE_FONT,
79
+ fontFamily: CODE_FONT,
110
80
  },
111
81
  });
112
82
  //# sourceMappingURL=LogBoxInspectorCodeFrame.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAkE;AAGlE,uDAA2C;AAC3C,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAiE;AACjE,mFAA2D;A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E,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ;oBAC5C,WAAW,EAAE;oBACb,WAAW,EAAE,CACT,CACM,CACV,CACgB,CAC1B,CAAC;AACJ,CAAC;AArDD,4DAqDC;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,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 selectable={false} 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 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":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,UAAU,wBAAwB,CAAC,EAAE,SAAS,EAA6B;IAC/E,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IAED,SAAS,WAAW;QAClB,OAAO,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnF,CAAC;IAED,SAAS,WAAW;QAClB,MAAM,QAAQ,GAAG,SAAS,EAAE,QAAQ,CAAC;QACrC,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO,KAAK,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,yCAAyC,GAAG,CAAC;SAC9F;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,oBAAC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YAAY,CAAC,CAAC,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,SAAS;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,SAAS;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 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({ 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"}
@@ -1,110 +1,81 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.LogBoxInspectorFooter = void 0;
30
1
  /**
31
- * Copyright (c) Evan Bacon.
2
+ * Copyright (c) 650 Industries.
32
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
33
4
  *
34
5
  * This source code is licensed under the MIT license found in the
35
6
  * LICENSE file in the root directory of this source tree.
36
7
  */
37
- const react_views_1 = require("@bacons/react-views");
38
- const react_1 = __importDefault(require("react"));
39
- const LogContext_1 = require("../Data/LogContext");
40
- const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
41
- function LogBoxInspectorFooter(props) {
42
- const log = (0, LogContext_1.useSelectedLog)();
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."))));
8
+ import React from 'react';
9
+ import { Pressable, StyleSheet, Text, View } from 'react-native';
10
+ import { useSelectedLog } from '../Data/LogContext';
11
+ import * as LogBoxStyle from '../UI/LogBoxStyle';
12
+ export function LogBoxInspectorFooter(props) {
13
+ const log = useSelectedLog();
14
+ if (['static', 'syntax'].includes(log.level)) {
15
+ return (React.createElement(View, { style: styles.root },
16
+ React.createElement(View, { style: styles.button },
17
+ React.createElement(Text, { style: styles.syntaxErrorText }, "This error cannot be dismissed."))));
47
18
  }
48
- return (react_1.default.createElement(react_views_1.View, { style: styles.root },
49
- react_1.default.createElement(FooterButton, { text: "Dismiss", onPress: props.onDismiss }),
50
- react_1.default.createElement(FooterButton, { text: "Minimize", onPress: props.onMinimize })));
19
+ return (React.createElement(View, { style: styles.root },
20
+ React.createElement(FooterButton, { text: "Dismiss", onPress: props.onDismiss }),
21
+ React.createElement(FooterButton, { text: "Minimize", onPress: props.onMinimize })));
51
22
  }
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: [
23
+ function FooterButton({ text, onPress }) {
24
+ return (React.createElement(Pressable, { onPress: onPress, style: { flex: 1 } }, ({
25
+ /** @ts-expect-error: react-native types are broken. */
26
+ hovered, pressed, }) => (React.createElement(View, { style: [
55
27
  buttonStyles.safeArea,
56
28
  {
57
- transitionDuration: "150ms",
29
+ // @ts-expect-error: web-only type
30
+ transitionDuration: '150ms',
58
31
  backgroundColor: pressed
59
- ? "#323232"
32
+ ? '#323232'
60
33
  : hovered
61
- ? "#111111"
34
+ ? '#111111'
62
35
  : LogBoxStyle.getBackgroundColor(),
63
36
  },
64
37
  ] },
65
- react_1.default.createElement(react_views_1.View, { style: buttonStyles.content },
66
- react_1.default.createElement(react_views_1.Text, { selectable: false, style: buttonStyles.label }, text))))));
38
+ React.createElement(View, { style: buttonStyles.content },
39
+ React.createElement(Text, { style: buttonStyles.label }, text))))));
67
40
  }
68
- const buttonStyles = react_views_1.StyleSheet.create({
41
+ const buttonStyles = StyleSheet.create({
69
42
  safeArea: {
70
43
  flex: 1,
71
44
  borderTopWidth: 1,
72
- borderColor: "#323232",
45
+ borderColor: '#323232',
73
46
  // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,
74
47
  },
75
48
  content: {
76
- alignItems: "center",
49
+ alignItems: 'center',
77
50
  height: 48,
78
- justifyContent: "center",
51
+ justifyContent: 'center',
79
52
  },
80
53
  label: {
54
+ userSelect: 'none',
81
55
  color: LogBoxStyle.getTextColor(1),
82
56
  fontSize: 14,
83
57
  includeFontPadding: false,
84
58
  lineHeight: 20,
85
59
  },
86
60
  });
87
- const styles = react_views_1.StyleSheet.create({
61
+ const styles = StyleSheet.create({
88
62
  root: {
89
63
  backgroundColor: LogBoxStyle.getBackgroundColor(1),
90
- shadowColor: "#000",
91
- shadowOffset: { width: 0, height: -2 },
92
- shadowRadius: 2,
93
- shadowOpacity: 0.5,
94
- flexDirection: "row",
64
+ boxShadow: `0 -2px 0 2px #000`,
65
+ flexDirection: 'row',
95
66
  },
96
67
  button: {
97
68
  flex: 1,
98
69
  },
99
70
  syntaxErrorText: {
100
- textAlign: "center",
101
- width: "100%",
71
+ textAlign: 'center',
72
+ width: '100%',
102
73
  height: 48,
103
74
  fontSize: 14,
104
75
  lineHeight: 20,
105
76
  paddingTop: 20,
106
77
  paddingBottom: 50,
107
- fontStyle: "italic",
78
+ fontStyle: 'italic',
108
79
  color: LogBoxStyle.getTextColor(0.6),
109
80
  },
110
81
  });