@expo/metro-runtime 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/build/HMRClient.js +43 -15
  2. package/build/HMRClient.js.map +1 -1
  3. package/build/HMRClient.native.js +3 -1
  4. package/build/HMRClient.native.js.map +1 -1
  5. package/build/LoadingView.d.ts +6 -0
  6. package/build/LoadingView.d.ts.map +1 -1
  7. package/build/LoadingView.js +12 -4
  8. package/build/LoadingView.js.map +1 -1
  9. package/build/LoadingView.native.js +7 -2
  10. package/build/LoadingView.native.js.map +1 -1
  11. package/build/async-require/buildAsyncRequire.js +7 -3
  12. package/build/async-require/buildAsyncRequire.js.map +1 -1
  13. package/build/async-require/buildUrlForBundle.js +5 -1
  14. package/build/async-require/buildUrlForBundle.js.map +1 -1
  15. package/build/async-require/buildUrlForBundle.native.js +5 -1
  16. package/build/async-require/buildUrlForBundle.native.js.map +1 -1
  17. package/build/async-require/fetchAsync.d.ts +6 -0
  18. package/build/async-require/fetchAsync.d.ts.map +1 -1
  19. package/build/async-require/fetchAsync.js +6 -3
  20. package/build/async-require/fetchAsync.js.map +1 -1
  21. package/build/async-require/fetchAsync.native.js +13 -6
  22. package/build/async-require/fetchAsync.native.js.map +1 -1
  23. package/build/async-require/fetchThenEval.d.ts +1 -6
  24. package/build/async-require/fetchThenEval.d.ts.map +1 -1
  25. package/build/async-require/fetchThenEval.js +5 -31
  26. package/build/async-require/fetchThenEval.js.map +1 -1
  27. package/build/async-require/fetchThenEval.web.js +6 -2
  28. package/build/async-require/fetchThenEval.web.js.map +1 -1
  29. package/build/async-require/fetchThenEvalJs.d.ts +7 -0
  30. package/build/async-require/fetchThenEvalJs.d.ts.map +1 -0
  31. package/build/async-require/fetchThenEvalJs.js +36 -0
  32. package/build/async-require/fetchThenEvalJs.js.map +1 -0
  33. package/build/async-require/index.js +4 -2
  34. package/build/async-require/index.js.map +1 -1
  35. package/build/async-require/index.native.d.ts +7 -0
  36. package/build/async-require/index.native.d.ts.map +1 -0
  37. package/build/async-require/index.native.js +14 -0
  38. package/build/async-require/index.native.js.map +1 -0
  39. package/build/async-require/loadBundle.js +10 -6
  40. package/build/async-require/loadBundle.js.map +1 -1
  41. package/build/effects.d.ts +0 -1
  42. package/build/effects.js +7 -10
  43. package/build/effects.js.map +1 -1
  44. package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
  45. package/build/error-overlay/Data/LogBoxData.js +82 -33
  46. package/build/error-overlay/Data/LogBoxData.js.map +1 -1
  47. package/build/error-overlay/Data/LogBoxLog.js +29 -2
  48. package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
  49. package/build/error-overlay/Data/LogBoxSymbolication.js +12 -4
  50. package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
  51. package/build/error-overlay/Data/LogContext.js +17 -9
  52. package/build/error-overlay/Data/LogContext.js.map +1 -1
  53. package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -1
  54. package/build/error-overlay/Data/parseLogBoxLog.js +20 -11
  55. package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
  56. package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
  57. package/build/error-overlay/ErrorOverlay.js +73 -41
  58. package/build/error-overlay/ErrorOverlay.js.map +1 -1
  59. package/build/error-overlay/LogBox.js +3 -1
  60. package/build/error-overlay/LogBox.js.map +1 -1
  61. package/build/error-overlay/LogBox.web.d.ts.map +1 -1
  62. package/build/error-overlay/LogBox.web.js +4 -3
  63. package/build/error-overlay/LogBox.web.js.map +1 -1
  64. package/build/error-overlay/UI/AnsiHighlight.js +15 -8
  65. package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
  66. package/build/error-overlay/UI/LogBoxButton.js +35 -8
  67. package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
  68. package/build/error-overlay/UI/LogBoxMessage.js +13 -6
  69. package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
  70. package/build/error-overlay/UI/LogBoxStyle.js +31 -14
  71. package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
  72. package/build/error-overlay/UI/constants.js +5 -2
  73. package/build/error-overlay/UI/constants.js.map +1 -1
  74. package/build/error-overlay/formatProjectFilePath.js +7 -2
  75. package/build/error-overlay/formatProjectFilePath.js.map +1 -1
  76. package/build/error-overlay/index.d.ts.map +1 -1
  77. package/build/error-overlay/index.js +19 -9
  78. package/build/error-overlay/index.js.map +1 -1
  79. package/build/error-overlay/modules/ExceptionsManager/index.js +8 -3
  80. package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
  81. package/build/error-overlay/modules/ExceptionsManager/index.native.js +7 -2
  82. package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -1
  83. package/build/error-overlay/modules/NativeLogBox/index.js +10 -5
  84. package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
  85. package/build/error-overlay/modules/NativeLogBox/index.native.js +7 -2
  86. package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -1
  87. package/build/error-overlay/modules/openFileInEditor/index.js +3 -1
  88. package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
  89. package/build/error-overlay/modules/openFileInEditor/index.native.js +7 -2
  90. package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -1
  91. package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -1
  92. package/build/error-overlay/modules/parseErrorStack/index.js +10 -7
  93. package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
  94. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js +8 -2
  95. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -1
  96. package/build/error-overlay/modules/stringifySafe/index.js +6 -2
  97. package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
  98. package/build/error-overlay/modules/symbolicateStackTrace/index.js +3 -1
  99. package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
  100. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js +7 -2
  101. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -1
  102. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
  103. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +52 -22
  104. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
  105. package/build/error-overlay/overlay/LogBoxInspectorFooter.js +48 -18
  106. package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
  107. package/build/error-overlay/overlay/LogBoxInspectorHeader.js +53 -23
  108. package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
  109. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +43 -13
  110. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
  111. package/build/error-overlay/overlay/LogBoxInspectorSection.js +39 -9
  112. package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
  113. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +41 -14
  114. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
  115. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +44 -14
  116. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
  117. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -1
  118. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +55 -24
  119. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
  120. package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -1
  121. package/build/error-overlay/toast/ErrorToast.js +48 -21
  122. package/build/error-overlay/toast/ErrorToast.js.map +1 -1
  123. package/build/error-overlay/toast/ErrorToastContainer.js +9 -3
  124. package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
  125. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -1
  126. package/build/error-overlay/toast/ErrorToastContainer.web.js +49 -21
  127. package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
  128. package/build/error-overlay/toast/ErrorToastMessage.js +37 -7
  129. package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
  130. package/build/error-overlay/useRejectionHandler.js +16 -9
  131. package/build/error-overlay/useRejectionHandler.js.map +1 -1
  132. package/build/getDevServer.d.ts.map +1 -1
  133. package/build/getDevServer.js +10 -9
  134. package/build/getDevServer.js.map +1 -1
  135. package/build/getDevServer.native.js +7 -2
  136. package/build/getDevServer.native.js.map +1 -1
  137. package/build/index.d.ts +7 -0
  138. package/build/index.d.ts.map +1 -1
  139. package/build/index.js +12 -8
  140. package/build/index.js.map +1 -1
  141. package/build/location/Location.js +7 -2
  142. package/build/location/Location.js.map +1 -1
  143. package/build/location/Location.native.js +12 -4
  144. package/build/location/Location.native.js.map +1 -1
  145. package/build/location/install.native.js +16 -11
  146. package/build/location/install.native.js.map +1 -1
  147. package/build/setupHMR.js +28 -26
  148. package/build/setupHMR.js.map +1 -1
  149. package/build/symbolicate.js +25 -4
  150. package/build/symbolicate.js.map +1 -1
  151. package/package.json +5 -2
  152. package/src/HMRClient.native.ts +3 -0
  153. package/src/HMRClient.ts +316 -0
  154. package/src/LoadingView.native.ts +3 -0
  155. package/src/LoadingView.ts +24 -0
  156. package/src/__mocks__/LoadingView.ts +4 -0
  157. package/src/async-require/buildAsyncRequire.ts +34 -0
  158. package/src/async-require/buildUrlForBundle.native.ts +28 -0
  159. package/src/async-require/buildUrlForBundle.ts +18 -0
  160. package/src/async-require/fetchAsync.native.ts +72 -0
  161. package/src/async-require/fetchAsync.ts +19 -0
  162. package/src/async-require/fetchThenEval.ts +1 -0
  163. package/src/async-require/fetchThenEval.web.ts +70 -0
  164. package/src/async-require/fetchThenEvalJs.ts +39 -0
  165. package/src/async-require/index.native.ts +15 -0
  166. package/src/async-require/index.ts +10 -0
  167. package/src/async-require/loadBundle.ts +46 -0
  168. package/src/effects.native.ts +0 -0
  169. package/src/effects.ts +11 -0
  170. package/src/error-overlay/Data/LogBoxData.tsx +438 -0
  171. package/src/error-overlay/Data/LogBoxLog.ts +221 -0
  172. package/src/error-overlay/Data/LogBoxSymbolication.tsx +64 -0
  173. package/src/error-overlay/Data/LogContext.tsx +41 -0
  174. package/src/error-overlay/Data/parseLogBoxLog.tsx +342 -0
  175. package/src/error-overlay/ErrorOverlay.tsx +191 -0
  176. package/src/error-overlay/LogBox.ts +51 -0
  177. package/src/error-overlay/LogBox.web.ts +174 -0
  178. package/src/error-overlay/UI/AnsiHighlight.tsx +96 -0
  179. package/src/error-overlay/UI/LogBoxButton.tsx +63 -0
  180. package/src/error-overlay/UI/LogBoxMessage.tsx +73 -0
  181. package/src/error-overlay/UI/LogBoxStyle.ts +64 -0
  182. package/src/error-overlay/UI/constants.ts +7 -0
  183. package/src/error-overlay/formatProjectFilePath.ts +38 -0
  184. package/src/error-overlay/index.tsx +34 -0
  185. package/src/error-overlay/modules/ExceptionsManager/index.native.ts +4 -0
  186. package/src/error-overlay/modules/ExceptionsManager/index.ts +82 -0
  187. package/src/error-overlay/modules/NativeLogBox/index.native.ts +3 -0
  188. package/src/error-overlay/modules/NativeLogBox/index.tsx +27 -0
  189. package/src/error-overlay/modules/openFileInEditor/index.native.ts +3 -0
  190. package/src/error-overlay/modules/openFileInEditor/index.ts +16 -0
  191. package/src/error-overlay/modules/parseErrorStack/index.ts +26 -0
  192. package/src/error-overlay/modules/parseErrorStack/parseHermesStack.ts +3 -0
  193. package/src/error-overlay/modules/stringifySafe/index.ts +115 -0
  194. package/src/error-overlay/modules/symbolicateStackTrace/index.native.ts +3 -0
  195. package/src/error-overlay/modules/symbolicateStackTrace/index.ts +39 -0
  196. package/src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx +102 -0
  197. package/src/error-overlay/overlay/LogBoxInspectorFooter.tsx +111 -0
  198. package/src/error-overlay/overlay/LogBoxInspectorHeader.tsx +167 -0
  199. package/src/error-overlay/overlay/LogBoxInspectorMessageHeader.tsx +116 -0
  200. package/src/error-overlay/overlay/LogBoxInspectorSection.tsx +52 -0
  201. package/src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx +125 -0
  202. package/src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx +89 -0
  203. package/src/error-overlay/overlay/LogBoxInspectorStackFrames.tsx +201 -0
  204. package/src/error-overlay/toast/ErrorToast.tsx +167 -0
  205. package/src/error-overlay/toast/ErrorToastContainer.tsx +9 -0
  206. package/src/error-overlay/toast/ErrorToastContainer.web.tsx +92 -0
  207. package/src/error-overlay/toast/ErrorToastMessage.tsx +28 -0
  208. package/src/error-overlay/useRejectionHandler.ts +61 -0
  209. package/src/getDevServer.native.ts +3 -0
  210. package/src/getDevServer.ts +34 -0
  211. package/src/index.ts +12 -0
  212. package/src/location/Location.native.ts +201 -0
  213. package/src/location/Location.ts +3 -0
  214. package/src/location/install.native.ts +90 -0
  215. package/src/location/install.ts +0 -0
  216. package/src/messageSocket.ts +25 -0
  217. package/src/setupFastRefresh.ts +30 -0
  218. package/src/setupHMR.ts +28 -0
  219. package/src/symbolicate.ts +6 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorOverlay.js","sourceRoot":"","sources":["../../src/error-overlay/ErrorOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,iCAAiC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AC;QACP,qEAAqE;QACrE,QAAQ,EAAE,OAAO;KAClB;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { Keyboard, ScrollView, View, StyleSheet } from 'react-native';\n\nimport * as LogBoxData from './Data/LogBoxData';\nimport { LogBoxLog, StackType } from './Data/LogBoxLog';\nimport { useLogs, useSelectedLog } from './Data/LogContext';\nimport * as LogBoxStyle from './UI/LogBoxStyle';\nimport { LogBoxInspectorCodeFrame } from './overlay/LogBoxInspectorCodeFrame';\nimport { LogBoxInspectorFooter as ErrorOverlayFooter } from './overlay/LogBoxInspectorFooter';\nimport { LogBoxInspectorHeader as ErrorOverlayHeader } from './overlay/LogBoxInspectorHeader';\nimport { LogBoxInspectorMessageHeader } from './overlay/LogBoxInspectorMessageHeader';\nimport { LogBoxInspectorStackFrames } from './overlay/LogBoxInspectorStackFrames';\n\nconst HEADER_TITLE_MAP = {\n warn: 'Console Warning',\n error: 'Console Error',\n fatal: 'Uncaught Error',\n syntax: 'Syntax Error',\n static: 'Static Rendering Error (Node.js)',\n component: 'Render Error',\n};\n\nexport function LogBoxInspectorContainer() {\n const { selectedLogIndex, logs } = useLogs();\n const log = logs[selectedLogIndex];\n if (log == null) {\n return null;\n }\n return <LogBoxInspector log={log} selectedLogIndex={selectedLogIndex} logs={logs} />;\n}\n\nexport function LogBoxInspector({\n log,\n selectedLogIndex,\n logs,\n}: {\n log: LogBoxLog;\n selectedLogIndex: number;\n logs: LogBoxLog[];\n}) {\n const onDismiss = useCallback((): void => {\n // Here we handle the cases when the log is dismissed and it\n // was either the last log, or when the current index\n // is now outside the bounds of the log array.\n const logsArray = Array.from(logs);\n if (selectedLogIndex != null) {\n if (logsArray.length - 1 <= 0) {\n LogBoxData.setSelectedLog(-1);\n } else if (selectedLogIndex >= logsArray.length - 1) {\n LogBoxData.setSelectedLog(selectedLogIndex - 1);\n }\n\n LogBoxData.dismiss(logsArray[selectedLogIndex]);\n }\n }, [selectedLogIndex]);\n\n const onMinimize = useCallback((): void => {\n LogBoxData.setSelectedLog(-1);\n }, []);\n\n const onChangeSelectedIndex = useCallback((index: number): void => {\n LogBoxData.setSelectedLog(index);\n }, []);\n\n useEffect(() => {\n if (log) {\n LogBoxData.symbolicateLogNow('stack', log);\n LogBoxData.symbolicateLogNow('component', log);\n }\n }, [log]);\n\n useEffect(() => {\n // Optimistically symbolicate the last and next logs.\n if (logs.length > 1) {\n const selected = selectedLogIndex;\n const lastIndex = logs.length - 1;\n const prevIndex = selected - 1 < 0 ? lastIndex : selected - 1;\n const nextIndex = selected + 1 > lastIndex ? 0 : selected + 1;\n for (const type of ['component', 'stack'] as const) {\n LogBoxData.symbolicateLogLazy(type, logs[prevIndex]);\n LogBoxData.symbolicateLogLazy(type, logs[nextIndex]);\n }\n }\n }, [logs, selectedLogIndex]);\n\n useEffect(() => {\n Keyboard.dismiss();\n }, []);\n\n const _handleRetry = useCallback(\n (type: StackType) => {\n LogBoxData.retrySymbolicateLogNow(type, log);\n },\n [log]\n );\n\n return (\n <View style={styles.container}>\n <ErrorOverlayHeader onSelectIndex={onChangeSelectedIndex} level={log.level} />\n <ErrorOverlayBody onRetry={_handleRetry} />\n <ErrorOverlayFooter onDismiss={onDismiss} onMinimize={onMinimize} />\n </View>\n );\n}\n\nexport function ErrorOverlayBody({ onRetry }: { onRetry: (type: StackType) => void }) {\n const log = useSelectedLog();\n return <ErrorOverlayBodyContents log={log} onRetry={onRetry} />;\n}\n\nexport function ErrorOverlayBodyContents({\n log,\n onRetry,\n}: {\n log: LogBoxLog;\n onRetry: (type: StackType) => void;\n}) {\n const [collapsed, setCollapsed] = useState(true);\n\n useEffect(() => {\n setCollapsed(true);\n }, [log]);\n\n const headerTitle = HEADER_TITLE_MAP[log.isComponentError ? 'component' : log.level] ?? log.type;\n\n const header = (\n <LogBoxInspectorMessageHeader\n collapsed={collapsed}\n onPress={() => setCollapsed(!collapsed)}\n message={log.message}\n level={log.level}\n title={headerTitle}\n />\n );\n\n return (\n <>\n {collapsed && header}\n <ScrollView style={styles.scrollBody}>\n {!collapsed && header}\n\n <LogBoxInspectorCodeFrame codeFrame={log.codeFrame} />\n <LogBoxInspectorStackFrames\n type=\"stack\"\n // eslint-disable-next-line react/jsx-no-bind\n onRetry={onRetry.bind(onRetry, 'stack')}\n />\n {!!log?.componentStack?.length && (\n <LogBoxInspectorStackFrames\n type=\"component\"\n // eslint-disable-next-line react/jsx-no-bind\n onRetry={onRetry.bind(onRetry, 'component')}\n />\n )}\n </ScrollView>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n scrollBody: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n flex: 1,\n },\n container: {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 999,\n flex: 1,\n // @ts-expect-error: fixed is not in the RN types but it works on web\n position: 'fixed',\n },\n});\n\nexport default LogBoxData.withSubscription(LogBoxInspectorContainer);\n"]}
1
+ {"version":3,"file":"ErrorOverlay.js","sourceRoot":"","sources":["../../src/error-overlay/ErrorOverlay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAgE;AAChE,+CAAsE;AAEtE,8DAAgD;AAEhD,kDAA4D;AAC5D,8DAAgD;AAChD,iFAA8E;AAC9E,2EAA8F;AAC9F,2EAA8F;AAC9F,yFAAsF;AACtF,qFAAkF;AAElF,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,kCAAkC;IAC1C,SAAS,EAAE,cAAc;CAC1B,CAAC;AAEF,SA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","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { Keyboard, ScrollView, View, StyleSheet } from 'react-native';\n\nimport * as LogBoxData from './Data/LogBoxData';\nimport { LogBoxLog, StackType } from './Data/LogBoxLog';\nimport { useLogs, useSelectedLog } from './Data/LogContext';\nimport * as LogBoxStyle from './UI/LogBoxStyle';\nimport { LogBoxInspectorCodeFrame } from './overlay/LogBoxInspectorCodeFrame';\nimport { LogBoxInspectorFooter as ErrorOverlayFooter } from './overlay/LogBoxInspectorFooter';\nimport { LogBoxInspectorHeader as ErrorOverlayHeader } from './overlay/LogBoxInspectorHeader';\nimport { LogBoxInspectorMessageHeader } from './overlay/LogBoxInspectorMessageHeader';\nimport { LogBoxInspectorStackFrames } from './overlay/LogBoxInspectorStackFrames';\n\nconst HEADER_TITLE_MAP = {\n warn: 'Console Warning',\n error: 'Console Error',\n fatal: 'Uncaught Error',\n syntax: 'Syntax Error',\n static: 'Static Rendering Error (Node.js)',\n component: 'Render Error',\n};\n\nexport function LogBoxInspectorContainer() {\n const { selectedLogIndex, logs } = useLogs();\n const log = logs[selectedLogIndex];\n if (log == null) {\n return null;\n }\n return <LogBoxInspector log={log} selectedLogIndex={selectedLogIndex} logs={logs} />;\n}\n\nexport function LogBoxInspector({\n log,\n selectedLogIndex,\n logs,\n}: {\n log: LogBoxLog;\n selectedLogIndex: number;\n logs: LogBoxLog[];\n}) {\n const onDismiss = useCallback((): void => {\n // Here we handle the cases when the log is dismissed and it\n // was either the last log, or when the current index\n // is now outside the bounds of the log array.\n const logsArray = Array.from(logs);\n if (selectedLogIndex != null) {\n if (logsArray.length - 1 <= 0) {\n LogBoxData.setSelectedLog(-1);\n } else if (selectedLogIndex >= logsArray.length - 1) {\n LogBoxData.setSelectedLog(selectedLogIndex - 1);\n }\n\n LogBoxData.dismiss(logsArray[selectedLogIndex]);\n }\n }, [selectedLogIndex]);\n\n const onMinimize = useCallback((): void => {\n LogBoxData.setSelectedLog(-1);\n }, []);\n\n const onChangeSelectedIndex = useCallback((index: number): void => {\n LogBoxData.setSelectedLog(index);\n }, []);\n\n useEffect(() => {\n if (log) {\n LogBoxData.symbolicateLogNow('stack', log);\n LogBoxData.symbolicateLogNow('component', log);\n }\n }, [log]);\n\n useEffect(() => {\n // Optimistically symbolicate the last and next logs.\n if (logs.length > 1) {\n const selected = selectedLogIndex;\n const lastIndex = logs.length - 1;\n const prevIndex = selected - 1 < 0 ? lastIndex : selected - 1;\n const nextIndex = selected + 1 > lastIndex ? 0 : selected + 1;\n for (const type of ['component', 'stack'] as const) {\n LogBoxData.symbolicateLogLazy(type, logs[prevIndex]);\n LogBoxData.symbolicateLogLazy(type, logs[nextIndex]);\n }\n }\n }, [logs, selectedLogIndex]);\n\n useEffect(() => {\n Keyboard.dismiss();\n }, []);\n\n const _handleRetry = useCallback(\n (type: StackType) => {\n LogBoxData.retrySymbolicateLogNow(type, log);\n },\n [log]\n );\n\n return (\n <View style={styles.container}>\n <ErrorOverlayHeader onSelectIndex={onChangeSelectedIndex} level={log.level} />\n <ErrorOverlayBody onRetry={_handleRetry} />\n <ErrorOverlayFooter onDismiss={onDismiss} onMinimize={onMinimize} />\n </View>\n );\n}\n\nexport function ErrorOverlayBody({ onRetry }: { onRetry: (type: StackType) => void }) {\n const log = useSelectedLog();\n return <ErrorOverlayBodyContents log={log} onRetry={onRetry} />;\n}\n\nexport function ErrorOverlayBodyContents({\n log,\n onRetry,\n}: {\n log: LogBoxLog;\n onRetry: (type: StackType) => void;\n}) {\n const [collapsed, setCollapsed] = useState(true);\n\n useEffect(() => {\n setCollapsed(true);\n }, [log]);\n\n const headerTitle = HEADER_TITLE_MAP[log.isComponentError ? 'component' : log.level] ?? log.type;\n\n const header = (\n <LogBoxInspectorMessageHeader\n collapsed={collapsed}\n onPress={() => setCollapsed(!collapsed)}\n message={log.message}\n level={log.level}\n title={headerTitle}\n />\n );\n\n // Hide useless React stack.\n const needsStack = !log.message.content.match(\n /(Expected server HTML to contain a matching|Text content did not match\\.)/\n );\n\n return (\n <>\n {collapsed && header}\n <ScrollView style={styles.scrollBody}>\n {!collapsed && header}\n\n <LogBoxInspectorCodeFrame codeFrame={log.codeFrame} />\n {needsStack && (\n <LogBoxInspectorStackFrames\n type=\"stack\"\n // eslint-disable-next-line react/jsx-no-bind\n onRetry={onRetry.bind(onRetry, 'stack')}\n />\n )}\n {!!log?.componentStack?.length && (\n <LogBoxInspectorStackFrames\n type=\"component\"\n // eslint-disable-next-line react/jsx-no-bind\n onRetry={onRetry.bind(onRetry, 'component')}\n />\n )}\n </ScrollView>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n scrollBody: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n flex: 1,\n },\n container: {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 999,\n flex: 1,\n // @ts-expect-error: fixed is not in the RN types but it works on web\n position: 'fixed',\n },\n});\n\nexport default LogBoxData.withSubscription(LogBoxInspectorContainer);\n"]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const LogBox = {
2
4
  install() {
3
5
  // Do nothing.
@@ -24,5 +26,5 @@ const LogBox = {
24
26
  // Do nothing.
25
27
  },
26
28
  };
27
- export default LogBox;
29
+ exports.default = LogBox;
28
30
  //# sourceMappingURL=LogBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBox.js","sourceRoot":"","sources":["../../src/error-overlay/LogBox.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,GAAY;IACtB,OAAO;QACL,cAAc;IAChB,CAAC;IAED,SAAS;QACP,cAAc;IAChB,CAAC;IAED,WAAW;QACT,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU,CAAC,QAAkC;QAC3C,cAAc;IAChB,CAAC;IAED,aAAa,CAAC,KAAe;QAC3B,cAAc;IAChB,CAAC;IAED,YAAY;QACV,cAAc;IAChB,CAAC;IAED,MAAM,CAAC,GAAY;QACjB,cAAc;IAChB,CAAC;IAED,YAAY,CAAC,EAAyB;QACpC,cAAc;IAChB,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { IgnorePattern, LogData } from './Data/LogBoxData';\nimport { ExtendedExceptionData } from './Data/parseLogBoxLog';\n\nexport { LogData, ExtendedExceptionData, IgnorePattern };\n\ninterface ILogBox {\n install(): void;\n uninstall(): void;\n isInstalled(): boolean;\n ignoreLogs(patterns: readonly IgnorePattern[]): void;\n ignoreAllLogs(ignore?: boolean): void;\n clearAllLogs(): void;\n addLog(log: LogData): void;\n addException(error: ExtendedExceptionData): void;\n}\n\nconst LogBox: ILogBox = {\n install(): void {\n // Do nothing.\n },\n\n uninstall(): void {\n // Do nothing.\n },\n\n isInstalled(): boolean {\n return false;\n },\n\n ignoreLogs(patterns: readonly IgnorePattern[]): void {\n // Do nothing.\n },\n\n ignoreAllLogs(value?: boolean): void {\n // Do nothing.\n },\n\n clearAllLogs(): void {\n // Do nothing.\n },\n\n addLog(log: LogData): void {\n // Do nothing.\n },\n\n addException(ex: ExtendedExceptionData): void {\n // Do nothing.\n },\n};\n\nexport default LogBox;\n"]}
1
+ {"version":3,"file":"LogBox.js","sourceRoot":"","sources":["../../src/error-overlay/LogBox.ts"],"names":[],"mappings":";;AAgBA,MAAM,MAAM,GAAY;IACtB,OAAO;QACL,cAAc;IAChB,CAAC;IAED,SAAS;QACP,cAAc;IAChB,CAAC;IAED,WAAW;QACT,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU,CAAC,QAAkC;QAC3C,cAAc;IAChB,CAAC;IAED,aAAa,CAAC,KAAe;QAC3B,cAAc;IAChB,CAAC;IAED,YAAY;QACV,cAAc;IAChB,CAAC;IAED,MAAM,CAAC,GAAY;QACjB,cAAc;IAChB,CAAC;IAED,YAAY,CAAC,EAAyB;QACpC,cAAc;IAChB,CAAC;CACF,CAAC;AAEF,kBAAe,MAAM,CAAC","sourcesContent":["import { IgnorePattern, LogData } from './Data/LogBoxData';\nimport { ExtendedExceptionData } from './Data/parseLogBoxLog';\n\nexport { LogData, ExtendedExceptionData, IgnorePattern };\n\ninterface ILogBox {\n install(): void;\n uninstall(): void;\n isInstalled(): boolean;\n ignoreLogs(patterns: readonly IgnorePattern[]): void;\n ignoreAllLogs(ignore?: boolean): void;\n clearAllLogs(): void;\n addLog(log: LogData): void;\n addException(error: ExtendedExceptionData): void;\n}\n\nconst LogBox: ILogBox = {\n install(): void {\n // Do nothing.\n },\n\n uninstall(): void {\n // Do nothing.\n },\n\n isInstalled(): boolean {\n return false;\n },\n\n ignoreLogs(patterns: readonly IgnorePattern[]): void {\n // Do nothing.\n },\n\n ignoreAllLogs(value?: boolean): void {\n // Do nothing.\n },\n\n clearAllLogs(): void {\n // Do nothing.\n },\n\n addLog(log: LogData): void {\n // Do nothing.\n },\n\n addException(ex: ExtendedExceptionData): void {\n // Do nothing.\n },\n};\n\nexport default LogBox;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LogBox.web.d.ts","sourceRoot":"","sources":["../../src/error-overlay/LogBox.web.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,CAAC;AAEzD,QAAA,IAAI,MAAM,EAAE,OAAO,CAAC;AAEpB,UAAU,OAAO;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,SAAS,IAAI,IAAI,CAAC;IAClB,WAAW,IAAI,OAAO,CAAC;IACvB,UAAU,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IACrD,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,YAAY,IAAI,IAAI,CAAC;IACrB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAClD;AAqJD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"LogBox.web.d.ts","sourceRoot":"","sources":["../../src/error-overlay/LogBox.web.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,CAAC;AAEzD,QAAA,IAAI,MAAM,EAAE,OAAO,CAAC;AAEpB,UAAU,OAAO;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,SAAS,IAAI,IAAI,CAAC;IAClB,WAAW,IAAI,OAAO,CAAC;IACvB,UAAU,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IACrD,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,YAAY,IAAI,IAAI,CAAC;IACrB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAClD;AAqJD,eAAe,MAAM,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * Copyright (c) 650 Industries.
3
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -5,7 +6,7 @@
5
6
  * This source code is licensed under the MIT license found in the
6
7
  * LICENSE file in the root directory of this source tree.
7
8
  */
8
- import { Platform } from 'react-native';
9
+ Object.defineProperty(exports, "__esModule", { value: true });
9
10
  let LogBox;
10
11
  /**
11
12
  * LogBox displays logs in the app.
@@ -35,7 +36,7 @@ if (__DEV__) {
35
36
  };
36
37
  }
37
38
  consoleErrorImpl = registerError;
38
- if (Platform.isTesting) {
39
+ if (process.env.NODE_ENV === 'test') {
39
40
  LogBoxData.setDisabled(true);
40
41
  }
41
42
  },
@@ -130,5 +131,5 @@ else {
130
131
  addException(ex) { },
131
132
  };
132
133
  }
133
- export default LogBox;
134
+ exports.default = LogBox;
134
135
  //# sourceMappingURL=LogBox.web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBox.web.js","sourceRoot":"","sources":["../../src/error-overlay/LogBox.web.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,IAAI,MAAe,CAAC;AAapB;;GAEG;AACH,IAAI,OAAO,EAAE;IACX,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChD,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAC1C,OAAO,CAAC,uBAAuB,CAA2C,CAAC;IAE7E,IAAI,oBAAsD,CAAC;IAC3D,IAAI,gBAAkD,CAAC;IAEvD,IAAI,iBAAiB,GAAY,KAAK,CAAC;IAEvC,MAAM,GAAG;QACP,OAAO;YACL,IAAI,iBAAiB,EAAE;gBACrB,OAAO;aACR;YAED,iBAAiB,GAAG,IAAI,CAAC;YAEzB,yCAAyC;YACzC,kDAAkD;YAElD,wEAAwE;YACxE,mEAAmE;YACnE,0BAA0B;YAC1B,MAAM,cAAc,GAAG,oBAAoB,IAAI,IAAI,CAAC;YACpD,IAAI,cAAc,EAAE;gBAClB,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEnD,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;oBAC1B,gBAAgB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;gBAC9B,CAAC,CAAC;aACH;YAED,gBAAgB,GAAG,a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ACvC,YAAY,KAAU,CAAC;QACvB,MAAM,CAAC,GAAY,IAAS,CAAC;QAC7B,YAAY,CAAC,EAAyB,IAAS,CAAC;KACjD,CAAC;CACH;AAED,eAAe,MAAM,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 { Platform } from 'react-native';\n\nimport { IgnorePattern, LogData } from './Data/LogBoxData';\nimport { ExtendedExceptionData } from './Data/parseLogBoxLog';\n\nexport { LogData, ExtendedExceptionData, IgnorePattern };\n\nlet LogBox: ILogBox;\n\ninterface ILogBox {\n install(): void;\n uninstall(): void;\n isInstalled(): boolean;\n ignoreLogs(patterns: readonly IgnorePattern[]): void;\n ignoreAllLogs(ignore?: boolean): void;\n clearAllLogs(): void;\n addLog(log: LogData): void;\n addException(error: ExtendedExceptionData): void;\n}\n\n/**\n * LogBox displays logs in the app.\n */\nif (__DEV__) {\n const LogBoxData = require('./Data/LogBoxData');\n const { parseLogBoxLog, parseInterpolation } =\n require('./Data/parseLogBoxLog') as typeof import('./Data/parseLogBoxLog');\n\n let originalConsoleError: typeof console.error | undefined;\n let consoleErrorImpl: typeof console.error | undefined;\n\n let isLogBoxInstalled: boolean = false;\n\n LogBox = {\n install(): void {\n if (isLogBoxInstalled) {\n return;\n }\n\n isLogBoxInstalled = true;\n\n // Trigger lazy initialization of module.\n // require(\"../NativeModules/specs/NativeLogBox\");\n\n // IMPORTANT: we only overwrite `console.error` and `console.warn` once.\n // When we uninstall we keep the same reference and only change its\n // internal implementation\n const isFirstInstall = originalConsoleError == null;\n if (isFirstInstall) {\n originalConsoleError = console.error.bind(console);\n\n console.error = (...args) => {\n consoleErrorImpl?.(...args);\n };\n }\n\n consoleErrorImpl = registerError;\n\n if (Platform.isTesting) {\n LogBoxData.setDisabled(true);\n }\n },\n\n uninstall(): void {\n if (!isLogBoxInstalled) {\n return;\n }\n\n isLogBoxInstalled = false;\n\n // IMPORTANT: we don't re-assign to `console` in case the method has been\n // decorated again after installing LogBox. E.g.:\n // Before uninstalling: original > LogBox > OtherErrorHandler\n // After uninstalling: original > LogBox (noop) > OtherErrorHandler\n consoleErrorImpl = originalConsoleError;\n delete (console as any).disableLogBox;\n },\n\n isInstalled(): boolean {\n return isLogBoxInstalled;\n },\n\n ignoreLogs(patterns: readonly IgnorePattern[]): void {\n LogBoxData.addIgnorePatterns(patterns);\n },\n\n ignoreAllLogs(value?: boolean): void {\n LogBoxData.setDisabled(value == null ? true : value);\n },\n\n clearAllLogs(): void {\n LogBoxData.clear();\n },\n\n addLog(log: LogData): void {\n if (isLogBoxInstalled) {\n LogBoxData.addLog(log);\n }\n },\n\n addException(error: ExtendedExceptionData): void {\n if (isLogBoxInstalled) {\n LogBoxData.addException(error);\n }\n },\n };\n\n const isWarningModuleWarning = (...args: any) => {\n return typeof args[0] === 'string' && args[0].startsWith('Warning: ');\n };\n\n const registerError = (...args: Parameters<typeof console.error>): void => {\n // Let errors within LogBox itself fall through.\n if (LogBoxData.isLogBoxErrorMessage(args[0])) {\n originalConsoleError?.(...args);\n return;\n }\n\n try {\n if (!isWarningModuleWarning(...args)) {\n // Only show LogBox for the 'warning' module, otherwise pass through.\n // By passing through, this will get picked up by the React console override,\n // potentially adding the component stack. React then passes it back to the\n // React Native ExceptionsManager, which reports it to LogBox as an error.\n //\n // The 'warning' module needs to be handled here because React internally calls\n // `console.error('Warning: ')` with the component stack already included.\n originalConsoleError?.(...args);\n return;\n }\n\n const { category, message, componentStack } = parseLogBoxLog(args);\n\n if (!LogBoxData.isMessageIgnored(message.content)) {\n // Interpolate the message so they are formatted for adb and other CLIs.\n // This is different than the message.content above because it includes component stacks.\n const interpolated = parseInterpolation(args);\n originalConsoleError?.(interpolated.message.content);\n\n LogBoxData.addLog({\n // Always show the static rendering issues as full screen since they\n // are too confusing otherwise.\n level: /did not match\\. Server:/.test(message.content) ? 'fatal' : 'error',\n category,\n message,\n componentStack,\n });\n }\n } catch (err) {\n LogBoxData.reportUnexpectedLogBoxError(err);\n }\n };\n} else {\n LogBox = {\n install(): void {},\n uninstall(): void {},\n isInstalled(): boolean {\n return false;\n },\n ignoreLogs(patterns: readonly IgnorePattern[]): void {},\n ignoreAllLogs(value?: boolean): void {},\n clearAllLogs(): void {},\n addLog(log: LogData): void {},\n addException(ex: ExtendedExceptionData): void {},\n };\n}\n\nexport default LogBox;\n"]}
1
+ {"version":3,"file":"LogBox.web.js","sourceRoot":"","sources":["../../src/error-overlay/LogBox.web.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAOH,IAAI,MAAe,CAAC;AAapB;;GAEG;AACH,IAAI,OAAO,EAAE;IACX,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChD,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAC1C,OAAO,CAAC,uBAAuB,CAA2C,CAAC;IAE7E,IAAI,oBAAsD,CAAC;IAC3D,IAAI,gBAAkD,CAAC;IAEvD,IAAI,iBAAiB,GAAY,KAAK,CAAC;IAEvC,MAAM,GAAG;QACP,OAAO;YACL,IAAI,iBAAiB,EAAE;gBACrB,OAAO;aACR;YAED,iBAAiB,GAAG,IAAI,CAAC;YAEzB,yCAAyC;YACzC,kDAAkD;YAElD,wEAAwE;YACxE,mEAAmE;YACnE,0BAA0B;YAC1B,MAAM,cAAc,GAAG,oBAAoB,IAAI,IAAI,CAAC;YACpD,IAAI,cAAc,EAAE;gBAClB,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEnD,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;oBAC1B,gBAAgB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;gBAC9B,CAAC,CAAC;aACH;YAED,gBAAgB,GAAG,aAAa,CAAC;YAEjC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK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AAC,GAAY,IAAS,CAAC;QAC7B,YAAY,CAAC,EAAyB,IAAS,CAAC;KACjD,CAAC;CACH;AAED,kBAAe,MAAM,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 { IgnorePattern, LogData } from './Data/LogBoxData';\nimport { ExtendedExceptionData } from './Data/parseLogBoxLog';\n\nexport { LogData, ExtendedExceptionData, IgnorePattern };\n\nlet LogBox: ILogBox;\n\ninterface ILogBox {\n install(): void;\n uninstall(): void;\n isInstalled(): boolean;\n ignoreLogs(patterns: readonly IgnorePattern[]): void;\n ignoreAllLogs(ignore?: boolean): void;\n clearAllLogs(): void;\n addLog(log: LogData): void;\n addException(error: ExtendedExceptionData): void;\n}\n\n/**\n * LogBox displays logs in the app.\n */\nif (__DEV__) {\n const LogBoxData = require('./Data/LogBoxData');\n const { parseLogBoxLog, parseInterpolation } =\n require('./Data/parseLogBoxLog') as typeof import('./Data/parseLogBoxLog');\n\n let originalConsoleError: typeof console.error | undefined;\n let consoleErrorImpl: typeof console.error | undefined;\n\n let isLogBoxInstalled: boolean = false;\n\n LogBox = {\n install(): void {\n if (isLogBoxInstalled) {\n return;\n }\n\n isLogBoxInstalled = true;\n\n // Trigger lazy initialization of module.\n // require(\"../NativeModules/specs/NativeLogBox\");\n\n // IMPORTANT: we only overwrite `console.error` and `console.warn` once.\n // When we uninstall we keep the same reference and only change its\n // internal implementation\n const isFirstInstall = originalConsoleError == null;\n if (isFirstInstall) {\n originalConsoleError = console.error.bind(console);\n\n console.error = (...args) => {\n consoleErrorImpl?.(...args);\n };\n }\n\n consoleErrorImpl = registerError;\n\n if (process.env.NODE_ENV === 'test') {\n LogBoxData.setDisabled(true);\n }\n },\n\n uninstall(): void {\n if (!isLogBoxInstalled) {\n return;\n }\n\n isLogBoxInstalled = false;\n\n // IMPORTANT: we don't re-assign to `console` in case the method has been\n // decorated again after installing LogBox. E.g.:\n // Before uninstalling: original > LogBox > OtherErrorHandler\n // After uninstalling: original > LogBox (noop) > OtherErrorHandler\n consoleErrorImpl = originalConsoleError;\n delete (console as any).disableLogBox;\n },\n\n isInstalled(): boolean {\n return isLogBoxInstalled;\n },\n\n ignoreLogs(patterns: readonly IgnorePattern[]): void {\n LogBoxData.addIgnorePatterns(patterns);\n },\n\n ignoreAllLogs(value?: boolean): void {\n LogBoxData.setDisabled(value == null ? true : value);\n },\n\n clearAllLogs(): void {\n LogBoxData.clear();\n },\n\n addLog(log: LogData): void {\n if (isLogBoxInstalled) {\n LogBoxData.addLog(log);\n }\n },\n\n addException(error: ExtendedExceptionData): void {\n if (isLogBoxInstalled) {\n LogBoxData.addException(error);\n }\n },\n };\n\n const isWarningModuleWarning = (...args: any) => {\n return typeof args[0] === 'string' && args[0].startsWith('Warning: ');\n };\n\n const registerError = (...args: Parameters<typeof console.error>): void => {\n // Let errors within LogBox itself fall through.\n if (LogBoxData.isLogBoxErrorMessage(args[0])) {\n originalConsoleError?.(...args);\n return;\n }\n\n try {\n if (!isWarningModuleWarning(...args)) {\n // Only show LogBox for the 'warning' module, otherwise pass through.\n // By passing through, this will get picked up by the React console override,\n // potentially adding the component stack. React then passes it back to the\n // React Native ExceptionsManager, which reports it to LogBox as an error.\n //\n // The 'warning' module needs to be handled here because React internally calls\n // `console.error('Warning: ')` with the component stack already included.\n originalConsoleError?.(...args);\n return;\n }\n\n const { category, message, componentStack } = parseLogBoxLog(args);\n\n if (!LogBoxData.isMessageIgnored(message.content)) {\n // Interpolate the message so they are formatted for adb and other CLIs.\n // This is different than the message.content above because it includes component stacks.\n const interpolated = parseInterpolation(args);\n originalConsoleError?.(interpolated.message.content);\n\n LogBoxData.addLog({\n // Always show the static rendering issues as full screen since they\n // are too confusing otherwise.\n level: /did not match\\. Server:/.test(message.content) ? 'fatal' : 'error',\n category,\n message,\n componentStack,\n });\n }\n } catch (err) {\n LogBoxData.reportUnexpectedLogBoxError(err);\n }\n };\n} else {\n LogBox = {\n install(): void {},\n uninstall(): void {},\n isInstalled(): boolean {\n return false;\n },\n ignoreLogs(patterns: readonly IgnorePattern[]): void {},\n ignoreAllLogs(value?: boolean): void {},\n clearAllLogs(): void {},\n addLog(log: LogData): void {},\n addException(ex: ExtendedExceptionData): void {},\n };\n}\n\nexport default LogBox;\n"]}
@@ -1,3 +1,9 @@
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.Ansi = void 0;
1
7
  /**
2
8
  * Copyright (c) 650 Industries.
3
9
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -5,9 +11,9 @@
5
11
  * This source code is licensed under the MIT license found in the
6
12
  * LICENSE file in the root directory of this source tree.
7
13
  */
8
- import Anser from 'anser';
9
- import React from 'react';
10
- import { StyleSheet, Text, View } from 'react-native';
14
+ const anser_1 = __importDefault(require("anser"));
15
+ const react_1 = __importDefault(require("react"));
16
+ const react_native_1 = require("react-native");
11
17
  // Afterglow theme from https://iterm2colorschemes.com/
12
18
  const COLORS = {
13
19
  'ansi-black': 'rgb(27, 27, 27)',
@@ -28,9 +34,9 @@ const COLORS = {
28
34
  'ansi-bright-cyan': 'rgb(140, 220, 216)',
29
35
  'ansi-bright-white': 'rgb(247, 247, 247)',
30
36
  };
31
- export function Ansi({ text, style }) {
37
+ function Ansi({ text, style }) {
32
38
  let commonWhitespaceLength = Infinity;
33
- const parsedLines = text.split(/\n/).map((line) => Anser.ansiToJson(line, {
39
+ const parsedLines = text.split(/\n/).map((line) => anser_1.default.ansiToJson(line, {
34
40
  json: true,
35
41
  remove_empty: true,
36
42
  use_classes: true,
@@ -58,7 +64,7 @@ export function Ansi({ text, style }) {
58
64
  return content;
59
65
  }
60
66
  };
61
- return (React.createElement(View, null, parsedLines.map((items, i) => (React.createElement(View, { style: styles.line, key: i }, items.map((bundle, key) => {
67
+ return (react_1.default.createElement(react_native_1.View, null, parsedLines.map((items, i) => (react_1.default.createElement(react_native_1.View, { style: styles.line, key: i }, items.map((bundle, key) => {
62
68
  const textStyle = bundle.fg && COLORS[bundle.fg]
63
69
  ? {
64
70
  backgroundColor: bundle.bg && COLORS[bundle.bg],
@@ -67,10 +73,11 @@ export function Ansi({ text, style }) {
67
73
  : {
68
74
  backgroundColor: bundle.bg && COLORS[bundle.bg],
69
75
  };
70
- return (React.createElement(Text, { style: [style, textStyle], key: key }, getText(bundle.content, key)));
76
+ return (react_1.default.createElement(react_native_1.Text, { style: [style, textStyle], key: key }, getText(bundle.content, key)));
71
77
  }))))));
72
78
  }
73
- const styles = StyleSheet.create({
79
+ exports.Ansi = Ansi;
80
+ const styles = react_native_1.StyleSheet.create({
74
81
  line: {
75
82
  flexDirection: 'row',
76
83
  },
@@ -1 +1 @@
1
- {"version":3,"file":"AnsiHighlight.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/AnsiHighlight.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,UAAU,EAAE,IAAI,EAAa,IAAI,EAAE,MAAM,cAAc,CAAC;AAE5E,uDAAuD;AACvD,MAAM,MAAM,GAA2B;IACrC,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,mBAAmB;IACjC,aAAa,EAAE,oBAAoB;IACnC,WAAW,EAAE,oBAAoB;IACjC,cAAc,EAAE,oBAAoB;IACpC,WAAW,EAAE,oBAAoB;IACjC,oEAAoE;IACpE,sCAAsC;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,iBAAiB,EAAE,kBAAkB;IACrC,mBAAmB,EAAE,mBAAmB;IACxC,oBAAoB,EAAE,oBAAoB;IAC1C,kBAAkB,EAAE,oBAAoB;IACxC,qBAAqB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,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,IAAI,QACF,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAC7B,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAC7B,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACzB,MAAM,SAAS,GACb,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,CAAC,CAAC;gBACE,eAAe,EAAE,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC/C,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;aACtC;YACH,CAAC,CAAC;gBACE,eAAe,EAAE,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;aAChD,CAAC;QACR,OAAO,CACL,oBAAC,IAAI,IAAC,KAAK,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,IACtC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CACxB,CACR,CAAC;IACJ,CAAC,CAAC,CACG,CACR,CAAC,CACG,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,aAAa,EAAE,KAAK;KACrB;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 Anser from 'anser';\nimport React from 'react';\nimport { StyleProp, StyleSheet, Text, TextStyle, View } from 'react-native';\n\n// Afterglow theme from https://iterm2colorschemes.com/\nconst COLORS: Record<string, string> = {\n 'ansi-black': 'rgb(27, 27, 27)',\n 'ansi-red': 'rgb(187, 86, 83)',\n 'ansi-green': 'rgb(144, 157, 98)',\n 'ansi-yellow': 'rgb(234, 193, 121)',\n 'ansi-blue': 'rgb(125, 169, 199)',\n 'ansi-magenta': 'rgb(176, 101, 151)',\n 'ansi-cyan': 'rgb(140, 220, 216)',\n // Instead of white, use the default color provided to the component\n // 'ansi-white': 'rgb(216, 216, 216)',\n 'ansi-bright-black': 'rgb(98, 98, 98)',\n 'ansi-bright-red': 'rgb(187, 86, 83)',\n 'ansi-bright-green': 'rgb(144, 157, 98)',\n 'ansi-bright-yellow': 'rgb(234, 193, 121)',\n 'ansi-bright-blue': 'rgb(125, 169, 199)',\n 'ansi-bright-magenta': 'rgb(176, 101, 151)',\n 'ansi-bright-cyan': 'rgb(140, 220, 216)',\n 'ansi-bright-white': 'rgb(247, 247, 247)',\n};\n\nexport function Ansi({ text, style }: { text: string; style: StyleProp<TextStyle> }) {\n let commonWhitespaceLength = Infinity;\n const parsedLines = text.split(/\\n/).map((line) =>\n Anser.ansiToJson(line, {\n json: true,\n remove_empty: true,\n use_classes: true,\n })\n );\n\n parsedLines.map((lines) => {\n // The third item on each line includes the whitespace of the source code.\n // We are looking for the least amount of common whitespace to trim all lines.\n // Example: Array [\" \", \" 96 |\", \" text\", ...]\n const match = lines[2] && lines[2]?.content?.match(/^ +/);\n const whitespaceLength = (match && match[0]?.length) || 0;\n if (whitespaceLength < commonWhitespaceLength) {\n commonWhitespaceLength = whitespaceLength;\n }\n });\n\n const getText = (content: string, key: number) => {\n if (key === 1) {\n // Remove the vertical bar after line numbers\n return content.replace(/\\| $/, ' ');\n } else if (key === 2 && commonWhitespaceLength < Infinity) {\n // Remove common whitespace at the beginning of the line\n return content.substr(commonWhitespaceLength);\n } else {\n return content;\n }\n };\n\n return (\n <View>\n {parsedLines.map((items, i) => (\n <View style={styles.line} key={i}>\n {items.map((bundle, key) => {\n const textStyle =\n bundle.fg && COLORS[bundle.fg]\n ? {\n backgroundColor: bundle.bg && COLORS[bundle.bg],\n color: bundle.fg && COLORS[bundle.fg],\n }\n : {\n backgroundColor: bundle.bg && COLORS[bundle.bg],\n };\n return (\n <Text style={[style, textStyle]} key={key}>\n {getText(bundle.content, key)}\n </Text>\n );\n })}\n </View>\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n line: {\n flexDirection: 'row',\n },\n});\n"]}
1
+ {"version":3,"file":"AnsiHighlight.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/AnsiHighlight.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,kDAA0B;AAC1B,+CAA4E;AAE5E,uDAAuD;AACvD,MAAM,MAAM,GAA2B;IACrC,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,mBAAmB;IACjC,aAAa,EAAE,oBAAoB;IACnC,WAAW,EAAE,oBAAoB;IACjC,cAAc,EAAE,oBAAoB;IACpC,WAAW,EAAE,oBAAoB;IACjC,oEAAoE;IACpE,sCAAsC;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,iBAAiB,EAAE,kBAAkB;IACrC,mBAAmB,EAAE,mBAAmB;IACxC,oBAAoB,EAAE,oBAAoB;IAC1C,kBAAkB,EAAE,oBAAoB;IACxC,qBAAqB,EAAE,oBAAoB;IAC3C,kBAAkB,EAAE,oBAAoB;IACxC,mBAAmB,EAAE,oBAAoB;CAC1C,CAAC;AAEF,SAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAiD;IACjF,IAAI,sBAAsB,GAAG,QAAQ,CAAC;IACtC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAChD,eAAK,CAAC,UAAU,CAAC,IAAI,EAAE;QACrB,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE,IAAI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IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC/C,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;aACtC;YACH,CAAC,CAAC;gBACE,eAAe,EAAE,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;aAChD,CAAC;QACR,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,IACtC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CACxB,CACR,CAAC;IACJ,CAAC,CAAC,CACG,CACR,CAAC,CACG,CACR,CAAC;AACJ,CAAC;AAzDD,oBAyDC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,aAAa,EAAE,KAAK;KACrB;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 Anser from 'anser';\nimport React from 'react';\nimport { StyleProp, StyleSheet, Text, TextStyle, View } from 'react-native';\n\n// Afterglow theme from https://iterm2colorschemes.com/\nconst COLORS: Record<string, string> = {\n 'ansi-black': 'rgb(27, 27, 27)',\n 'ansi-red': 'rgb(187, 86, 83)',\n 'ansi-green': 'rgb(144, 157, 98)',\n 'ansi-yellow': 'rgb(234, 193, 121)',\n 'ansi-blue': 'rgb(125, 169, 199)',\n 'ansi-magenta': 'rgb(176, 101, 151)',\n 'ansi-cyan': 'rgb(140, 220, 216)',\n // Instead of white, use the default color provided to the component\n // 'ansi-white': 'rgb(216, 216, 216)',\n 'ansi-bright-black': 'rgb(98, 98, 98)',\n 'ansi-bright-red': 'rgb(187, 86, 83)',\n 'ansi-bright-green': 'rgb(144, 157, 98)',\n 'ansi-bright-yellow': 'rgb(234, 193, 121)',\n 'ansi-bright-blue': 'rgb(125, 169, 199)',\n 'ansi-bright-magenta': 'rgb(176, 101, 151)',\n 'ansi-bright-cyan': 'rgb(140, 220, 216)',\n 'ansi-bright-white': 'rgb(247, 247, 247)',\n};\n\nexport function Ansi({ text, style }: { text: string; style: StyleProp<TextStyle> }) {\n let commonWhitespaceLength = Infinity;\n const parsedLines = text.split(/\\n/).map((line) =>\n Anser.ansiToJson(line, {\n json: true,\n remove_empty: true,\n use_classes: true,\n })\n );\n\n parsedLines.map((lines) => {\n // The third item on each line includes the whitespace of the source code.\n // We are looking for the least amount of common whitespace to trim all lines.\n // Example: Array [\" \", \" 96 |\", \" text\", ...]\n const match = lines[2] && lines[2]?.content?.match(/^ +/);\n const whitespaceLength = (match && match[0]?.length) || 0;\n if (whitespaceLength < commonWhitespaceLength) {\n commonWhitespaceLength = whitespaceLength;\n }\n });\n\n const getText = (content: string, key: number) => {\n if (key === 1) {\n // Remove the vertical bar after line numbers\n return content.replace(/\\| $/, ' ');\n } else if (key === 2 && commonWhitespaceLength < Infinity) {\n // Remove common whitespace at the beginning of the line\n return content.substr(commonWhitespaceLength);\n } else {\n return content;\n }\n };\n\n return (\n <View>\n {parsedLines.map((items, i) => (\n <View style={styles.line} key={i}>\n {items.map((bundle, key) => {\n const textStyle =\n bundle.fg && COLORS[bundle.fg]\n ? {\n backgroundColor: bundle.bg && COLORS[bundle.bg],\n color: bundle.fg && COLORS[bundle.fg],\n }\n : {\n backgroundColor: bundle.bg && COLORS[bundle.bg],\n };\n return (\n <Text style={[style, textStyle]} key={key}>\n {getText(bundle.content, key)}\n </Text>\n );\n })}\n </View>\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n line: {\n flexDirection: 'row',\n },\n});\n"]}
@@ -1,3 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.LogBoxButton = void 0;
1
27
  /**
2
28
  * Copyright (c) 650 Industries.
3
29
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -5,11 +31,11 @@
5
31
  * This source code is licensed under the MIT license found in the
6
32
  * LICENSE file in the root directory of this source tree.
7
33
  */
8
- import React, { useState } from 'react';
9
- import { Platform, Pressable, View } from 'react-native';
10
- import * as LogBoxStyle from './LogBoxStyle';
11
- export function LogBoxButton(props) {
12
- const [pressed, setPressed] = useState(false);
34
+ const react_1 = __importStar(require("react"));
35
+ const react_native_1 = require("react-native");
36
+ const LogBoxStyle = __importStar(require("./LogBoxStyle"));
37
+ function LogBoxButton(props) {
38
+ const [pressed, setPressed] = (0, react_1.useState)(false);
13
39
  let backgroundColor = props.backgroundColor;
14
40
  if (!backgroundColor) {
15
41
  backgroundColor = {
@@ -17,10 +43,10 @@ export function LogBoxButton(props) {
17
43
  pressed: LogBoxStyle.getBackgroundColor(0.6),
18
44
  };
19
45
  }
20
- const content = (React.createElement(View, { style: [
46
+ const content = (react_1.default.createElement(react_native_1.View, { style: [
21
47
  {
22
48
  backgroundColor: pressed ? backgroundColor.pressed : backgroundColor.default,
23
- ...Platform.select({
49
+ ...react_native_1.Platform.select({
24
50
  web: {
25
51
  cursor: 'pointer',
26
52
  },
@@ -28,6 +54,7 @@ export function LogBoxButton(props) {
28
54
  },
29
55
  props.style,
30
56
  ] }, props.children));
31
- return props.onPress == null ? (content) : (React.createElement(Pressable, { hitSlop: props.hitSlop, onPress: props.onPress, onPressIn: () => setPressed(true), onPressOut: () => setPressed(false) }, content));
57
+ return props.onPress == null ? (content) : (react_1.default.createElement(react_native_1.Pressable, { hitSlop: props.hitSlop, onPress: props.onPress, onPressIn: () => setPressed(true), onPressOut: () => setPressed(false) }, content));
32
58
  }
59
+ exports.LogBoxButton = LogBoxButton;
33
60
  //# sourceMappingURL=LogBoxButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxButton.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/LogBoxButton.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAiC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAEnG,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAa7C,MAAM,UAAU,YAAY,CAAC,KAAY;IACvC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,IAAI,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IAC5C,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG;YAChB,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC7C,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC;SAC7C,CAAC;KACH;IAED,MAAM,OAAO,GAAG,CACd,oBAAC,IAAI,IACH,KAAK,EAAE;YACL;gBACE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO;gBAC5E,GAAG,QAAQ,CAAC,MAAM,CAAC;oBACjB,GAAG,EAAE;wBACH,MAAM,EAAE,SAAS;qBAClB;iBACF,CAAC;aACH;YACD,KAAK,CAAC,KAAK;SACZ,IACA,KAAK,CAAC,QAAQ,CACV,CACR,CAAC;IAEF,OAAO,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAC7B,OAAO,CACR,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,IACR,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACjC,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAClC,OAAO,CACE,CACb,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useState } from 'react';\nimport { GestureResponderEvent, Insets, Platform, Pressable, View, ViewStyle } from 'react-native';\n\nimport * as LogBoxStyle from './LogBoxStyle';\n\ntype Props = {\n backgroundColor: {\n default: string;\n pressed: string;\n };\n children?: any;\n hitSlop?: Insets;\n onPress?: ((event: GestureResponderEvent) => void) | null;\n style?: ViewStyle;\n};\n\nexport function LogBoxButton(props: Props) {\n const [pressed, setPressed] = useState(false);\n\n let backgroundColor = props.backgroundColor;\n if (!backgroundColor) {\n backgroundColor = {\n default: LogBoxStyle.getBackgroundColor(0.95),\n pressed: LogBoxStyle.getBackgroundColor(0.6),\n };\n }\n\n const content = (\n <View\n style={[\n {\n backgroundColor: pressed ? backgroundColor.pressed : backgroundColor.default,\n ...Platform.select({\n web: {\n cursor: 'pointer',\n },\n }),\n },\n props.style,\n ]}>\n {props.children}\n </View>\n );\n\n return props.onPress == null ? (\n content\n ) : (\n <Pressable\n hitSlop={props.hitSlop}\n onPress={props.onPress}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}>\n {content}\n </Pressable>\n );\n}\n"]}
1
+ {"version":3,"file":"LogBoxButton.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/LogBoxButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAwC;AACxC,+CAAmG;AAEnG,2DAA6C;AAa7C,SAAgB,YAAY,CAAC,KAAY;IACvC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE9C,IAAI,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IAC5C,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG;YAChB,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC7C,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC;SAC7C,CAAC;KACH;IAED,MAAM,OAAO,GAAG,CACd,8BAAC,mBAAI,IACH,KAAK,EAAE;YACL;gBACE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO;gBAC5E,GAAG,uBAAQ,CAAC,MAAM,CAAC;oBACjB,GAAG,EAAE;wBACH,MAAM,EAAE,SAAS;qBAClB;iBACF,CAAC;aACH;YACD,KAAK,CAAC,KAAK;SACZ,IACA,KAAK,CAAC,QAAQ,CACV,CACR,CAAC;IAEF,OAAO,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAC7B,OAAO,CACR,CAAC,CAAC,CAAC,CACF,8BAAC,wBAAS,IACR,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACjC,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAClC,OAAO,CACE,CACb,CAAC;AACJ,CAAC;AAvCD,oCAuCC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useState } from 'react';\nimport { GestureResponderEvent, Insets, Platform, Pressable, View, ViewStyle } from 'react-native';\n\nimport * as LogBoxStyle from './LogBoxStyle';\n\ntype Props = {\n backgroundColor: {\n default: string;\n pressed: string;\n };\n children?: any;\n hitSlop?: Insets;\n onPress?: ((event: GestureResponderEvent) => void) | null;\n style?: ViewStyle;\n};\n\nexport function LogBoxButton(props: Props) {\n const [pressed, setPressed] = useState(false);\n\n let backgroundColor = props.backgroundColor;\n if (!backgroundColor) {\n backgroundColor = {\n default: LogBoxStyle.getBackgroundColor(0.95),\n pressed: LogBoxStyle.getBackgroundColor(0.6),\n };\n }\n\n const content = (\n <View\n style={[\n {\n backgroundColor: pressed ? backgroundColor.pressed : backgroundColor.default,\n ...Platform.select({\n web: {\n cursor: 'pointer',\n },\n }),\n },\n props.style,\n ]}>\n {props.children}\n </View>\n );\n\n return props.onPress == null ? (\n content\n ) : (\n <Pressable\n hitSlop={props.hitSlop}\n onPress={props.onPress}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}>\n {content}\n </Pressable>\n );\n}\n"]}
@@ -1,3 +1,9 @@
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.LogBoxMessage = void 0;
1
7
  /**
2
8
  * Copyright (c) 650 Industries.
3
9
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -5,13 +11,13 @@
5
11
  * This source code is licensed under the MIT license found in the
6
12
  * LICENSE file in the root directory of this source tree.
7
13
  */
8
- import React from 'react';
9
- import { Text } from 'react-native';
14
+ const react_1 = __importDefault(require("react"));
15
+ const react_native_1 = require("react-native");
10
16
  const cleanContent = (content) => content.replace(/^(TransformError |Warning: (Warning: )?|Error: )/g, '');
11
- export function LogBoxMessage(props) {
17
+ function LogBoxMessage(props) {
12
18
  const { content, substitutions } = props.message;
13
19
  if (props.plaintext === true) {
14
- return React.createElement(Text, null, cleanContent(content));
20
+ return react_1.default.createElement(react_native_1.Text, null, cleanContent(content));
15
21
  }
16
22
  const maxLength = props.maxLength != null ? props.maxLength : Infinity;
17
23
  const substitutionStyle = props.style;
@@ -23,7 +29,7 @@ export function LogBoxMessage(props) {
23
29
  cleanMessage = cleanMessage.slice(0, props.maxLength - length);
24
30
  }
25
31
  if (length < maxLength) {
26
- elements.push(React.createElement(Text, { key: key, style: style }, cleanMessage));
32
+ elements.push(react_1.default.createElement(react_native_1.Text, { key: key, style: style }, cleanMessage));
27
33
  }
28
34
  length += cleanMessage.length;
29
35
  };
@@ -41,6 +47,7 @@ export function LogBoxMessage(props) {
41
47
  const lastPart = content.substr(lastOffset);
42
48
  createUnderLength('-1', lastPart);
43
49
  }
44
- return React.createElement(React.Fragment, null, elements);
50
+ return react_1.default.createElement(react_1.default.Fragment, null, elements);
45
51
  }
52
+ exports.LogBoxMessage = LogBoxMessage;
46
53
  //# sourceMappingURL=LogBoxMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxMessage.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/LogBoxMessage.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,IAAI,EAAa,MAAM,cAAc,CAAC;AAW1D,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CACvC,OAAO,CAAC,OAAO,CAAC,mDAAmD,EAA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OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;YAE9E,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SAClC;QAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QAElF,iBAAiB,CAAC,GAAG,GAAG,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;QACnE,OAAO,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IACnD,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAI,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACnC;IAED,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,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 { StyleProp, Text, TextStyle } from 'react-native';\n\nimport type { Message } from '../Data/parseLogBoxLog';\n\ntype Props = {\n message: Message;\n style: StyleProp<TextStyle>;\n plaintext?: boolean;\n maxLength?: number;\n};\n\nconst cleanContent = (content: string) =>\n content.replace(/^(TransformError |Warning: (Warning: )?|Error: )/g, '');\n\nexport function LogBoxMessage(props: Props): JSX.Element {\n const { content, substitutions }: Message = props.message;\n\n if (props.plaintext === true) {\n return <Text>{cleanContent(content)}</Text>;\n }\n\n const maxLength = props.maxLength != null ? props.maxLength : Infinity;\n const substitutionStyle: StyleProp<TextStyle> = props.style;\n const elements: JSX.Element[] = [];\n let length = 0;\n const createUnderLength = (key: string | '-1', message: string, style?: StyleProp<TextStyle>) => {\n let cleanMessage = cleanContent(message);\n\n if (props.maxLength != null) {\n cleanMessage = cleanMessage.slice(0, props.maxLength - length);\n }\n\n if (length < maxLength) {\n elements.push(\n <Text key={key} style={style}>\n {cleanMessage}\n </Text>\n );\n }\n\n length += cleanMessage.length;\n };\n\n const lastOffset = substitutions.reduce((prevOffset, substitution, index) => {\n const key = String(index);\n\n if (substitution.offset > prevOffset) {\n const prevPart = content.substr(prevOffset, substitution.offset - prevOffset);\n\n createUnderLength(key, prevPart);\n }\n\n const substititionPart = content.substr(substitution.offset, substitution.length);\n\n createUnderLength(key + '.5', substititionPart, substitutionStyle);\n return substitution.offset + substitution.length;\n }, 0);\n\n if (lastOffset < content.length) {\n const lastPart = content.substr(lastOffset);\n createUnderLength('-1', lastPart);\n }\n\n return <>{elements}</>;\n}\n"]}
1
+ {"version":3,"file":"LogBoxMessage.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/LogBoxMessage.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAA0D;AAW1D,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CACvC,OAAO,CAAC,OAAO,CAAC,mDAAmD,EAAE,EAAE,CAAC,CAAC;AAE3E,SAAgB,aAAa,CAAC,KAAY;IACxC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAY,KAAK,CAAC,OAAO,CAAC;IAE1D,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,EAAE;QAC5B,OAAO,8BAAC,mBAAI,QAAE,YAAY,CAAC,OAAO,CAAC,CAAQ,CAAC;KAC7C;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvE,MAAM,iBAAiB,GAAyB,KAAK,CAAC,KAAK,CAAC;IAC5D,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,IAAI,MAAM,GAAG,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OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACnC;IAED,OAAO,8DAAG,QAAQ,CAAI,CAAC;AACzB,CAAC;AAlDD,sCAkDC","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 { StyleProp, Text, TextStyle } from 'react-native';\n\nimport type { Message } from '../Data/parseLogBoxLog';\n\ntype Props = {\n message: Message;\n style: StyleProp<TextStyle>;\n plaintext?: boolean;\n maxLength?: number;\n};\n\nconst cleanContent = (content: string) =>\n content.replace(/^(TransformError |Warning: (Warning: )?|Error: )/g, '');\n\nexport function LogBoxMessage(props: Props): JSX.Element {\n const { content, substitutions }: Message = props.message;\n\n if (props.plaintext === true) {\n return <Text>{cleanContent(content)}</Text>;\n }\n\n const maxLength = props.maxLength != null ? props.maxLength : Infinity;\n const substitutionStyle: StyleProp<TextStyle> = props.style;\n const elements: JSX.Element[] = [];\n let length = 0;\n const createUnderLength = (key: string | '-1', message: string, style?: StyleProp<TextStyle>) => {\n let cleanMessage = cleanContent(message);\n\n if (props.maxLength != null) {\n cleanMessage = cleanMessage.slice(0, props.maxLength - length);\n }\n\n if (length < maxLength) {\n elements.push(\n <Text key={key} style={style}>\n {cleanMessage}\n </Text>\n );\n }\n\n length += cleanMessage.length;\n };\n\n const lastOffset = substitutions.reduce((prevOffset, substitution, index) => {\n const key = String(index);\n\n if (substitution.offset > prevOffset) {\n const prevPart = content.substr(prevOffset, substitution.offset - prevOffset);\n\n createUnderLength(key, prevPart);\n }\n\n const substititionPart = content.substr(substitution.offset, substitution.length);\n\n createUnderLength(key + '.5', substititionPart, substitutionStyle);\n return substitution.offset + substitution.length;\n }, 0);\n\n if (lastOffset < content.length) {\n const lastPart = content.substr(lastOffset);\n createUnderLength('-1', lastPart);\n }\n\n return <>{elements}</>;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * Copyright (c) 650 Industries.
3
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -5,47 +6,63 @@
5
6
  * This source code is licensed under the MIT license found in the
6
7
  * LICENSE file in the root directory of this source tree.
7
8
  */
8
- export function getBackgroundColor(opacity) {
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getTextColor = exports.getHighlightColor = exports.getDividerColor = exports.getWarningHighlightColor = exports.getLogColor = exports.getErrorDarkColor = exports.getErrorColor = exports.getFatalDarkColor = exports.getFatalColor = exports.getWarningDarkColor = exports.getWarningColor = exports.getBackgroundDarkColor = exports.getBackgroundLightColor = exports.getBackgroundColor = void 0;
11
+ function getBackgroundColor(opacity) {
9
12
  return `rgba(0, 0, 0, ${opacity == null ? 1 : opacity})`;
10
13
  // return `rgba(51, 51, 51, ${opacity == null ? 1 : opacity})`;
11
14
  }
12
- export function getBackgroundLightColor(opacity) {
15
+ exports.getBackgroundColor = getBackgroundColor;
16
+ function getBackgroundLightColor(opacity) {
13
17
  return `rgba(69, 69, 69, ${opacity == null ? 1 : opacity})`;
14
18
  }
15
- export function getBackgroundDarkColor(opacity) {
19
+ exports.getBackgroundLightColor = getBackgroundLightColor;
20
+ function getBackgroundDarkColor(opacity) {
16
21
  return `rgba(34, 34, 34, ${opacity == null ? 1 : opacity})`;
17
22
  }
18
- export function getWarningColor(opacity) {
23
+ exports.getBackgroundDarkColor = getBackgroundDarkColor;
24
+ function getWarningColor(opacity) {
19
25
  return `rgba(250, 186, 48, ${opacity == null ? 1 : opacity})`;
20
26
  }
21
- export function getWarningDarkColor(opacity) {
27
+ exports.getWarningColor = getWarningColor;
28
+ function getWarningDarkColor(opacity) {
22
29
  return `rgba(224, 167, 8, ${opacity == null ? 1 : opacity})`;
23
30
  }
24
- export function getFatalColor(opacity) {
31
+ exports.getWarningDarkColor = getWarningDarkColor;
32
+ function getFatalColor(opacity) {
25
33
  return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`;
26
34
  }
27
- export function getFatalDarkColor(opacity) {
35
+ exports.getFatalColor = getFatalColor;
36
+ function getFatalDarkColor(opacity) {
28
37
  return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`;
29
38
  }
30
- export function getErrorColor(opacity) {
39
+ exports.getFatalDarkColor = getFatalDarkColor;
40
+ function getErrorColor(opacity) {
31
41
  return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`;
32
42
  }
33
- export function getErrorDarkColor(opacity) {
43
+ exports.getErrorColor = getErrorColor;
44
+ function getErrorDarkColor(opacity) {
34
45
  return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`;
35
46
  }
36
- export function getLogColor(opacity) {
47
+ exports.getErrorDarkColor = getErrorDarkColor;
48
+ function getLogColor(opacity) {
37
49
  return `rgba(119, 119, 119, ${opacity == null ? 1 : opacity})`;
38
50
  }
39
- export function getWarningHighlightColor(opacity) {
51
+ exports.getLogColor = getLogColor;
52
+ function getWarningHighlightColor(opacity) {
40
53
  return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`;
41
54
  }
42
- export function getDividerColor(opacity) {
55
+ exports.getWarningHighlightColor = getWarningHighlightColor;
56
+ function getDividerColor(opacity) {
43
57
  return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`;
44
58
  }
45
- export function getHighlightColor(opacity) {
59
+ exports.getDividerColor = getDividerColor;
60
+ function getHighlightColor(opacity) {
46
61
  return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`;
47
62
  }
48
- export function getTextColor(opacity) {
63
+ exports.getHighlightColor = getHighlightColor;
64
+ function getTextColor(opacity) {
49
65
  return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`;
50
66
  }
67
+ exports.getTextColor = getTextColor;
51
68
  //# sourceMappingURL=LogBoxStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LogBoxStyle.js","sourceRoot":"","sources":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,CAAC,CAAC,OAAO,GAAG,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO,qBAAqB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO,uBAAuB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,OAAO,sBAAsB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,OAAO,uBAAuB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO,sBAAsB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO,uBAAuB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACjE,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\nexport function getBackgroundColor(opacity?: number): string {\n return `rgba(0, 0, 0, ${opacity == null ? 1 : opacity})`;\n // return `rgba(51, 51, 51, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getBackgroundLightColor(opacity?: number): string {\n return `rgba(69, 69, 69, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getBackgroundDarkColor(opacity?: number): string {\n return `rgba(34, 34, 34, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getWarningColor(opacity?: number): string {\n return `rgba(250, 186, 48, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getWarningDarkColor(opacity?: number): string {\n return `rgba(224, 167, 8, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getFatalColor(opacity?: number): string {\n return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getFatalDarkColor(opacity?: number): string {\n return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getErrorColor(opacity?: number): string {\n return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getErrorDarkColor(opacity?: number): string {\n return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getLogColor(opacity?: number): string {\n return `rgba(119, 119, 119, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getWarningHighlightColor(opacity?: number): string {\n return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getDividerColor(opacity?: number): string {\n return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getHighlightColor(opacity?: number): string {\n return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getTextColor(opacity?: number): string {\n return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`;\n}\n"]}
1
+ {"version":3,"file":"LogBoxStyle.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/LogBoxStyle.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,OAAO,iBAAiB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;IACzD,+DAA+D;AACjE,CAAC;AAHD,gDAGC;AAED,SAAgB,uBAA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;AAFD,8CAEC;AAED,SAAgB,WAAW,CAAC,OAAgB;IAC1C,OAAO,uBAAuB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACjE,CAAC;AAFD,kCAEC;AAED,SAAgB,wBAAwB,CAAC,OAAgB;IACvD,OAAO,sBAAsB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AAChE,CAAC;AAFD,4DAEC;AAED,SAAgB,eAAe,CAAC,OAAgB;IAC9C,OAAO,uBAAuB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACjE,CAAC;AAFD,0CAEC;AAED,SAAgB,iBAAiB,CAAC,OAAgB;IAChD,OAAO,sBAAsB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AAChE,CAAC;AAFD,8CAEC;AAED,SAAgB,YAAY,CAAC,OAAgB;IAC3C,OAAO,uBAAuB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACjE,CAAC;AAFD,oCAEC","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\nexport function getBackgroundColor(opacity?: number): string {\n return `rgba(0, 0, 0, ${opacity == null ? 1 : opacity})`;\n // return `rgba(51, 51, 51, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getBackgroundLightColor(opacity?: number): string {\n return `rgba(69, 69, 69, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getBackgroundDarkColor(opacity?: number): string {\n return `rgba(34, 34, 34, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getWarningColor(opacity?: number): string {\n return `rgba(250, 186, 48, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getWarningDarkColor(opacity?: number): string {\n return `rgba(224, 167, 8, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getFatalColor(opacity?: number): string {\n return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getFatalDarkColor(opacity?: number): string {\n return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getErrorColor(opacity?: number): string {\n return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getErrorDarkColor(opacity?: number): string {\n return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getLogColor(opacity?: number): string {\n return `rgba(119, 119, 119, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getWarningHighlightColor(opacity?: number): string {\n return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getDividerColor(opacity?: number): string {\n return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getHighlightColor(opacity?: number): string {\n return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`;\n}\n\nexport function getTextColor(opacity?: number): string {\n return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`;\n}\n"]}
@@ -1,5 +1,8 @@
1
- import { Platform } from 'react-native';
2
- export const CODE_FONT = Platform.select({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CODE_FONT = void 0;
4
+ const react_native_1 = require("react-native");
5
+ exports.CODE_FONT = react_native_1.Platform.select({
3
6
  default: 'Courier',
4
7
  ios: 'Courier New',
5
8
  android: 'monospace',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC","sourcesContent":["import { Platform } from 'react-native';\n\nexport const CODE_FONT = Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n});\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/constants.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AAE3B,QAAA,SAAS,GAAG,uBAAQ,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC","sourcesContent":["import { Platform } from 'react-native';\n\nexport const CODE_FONT = Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n});\n"]}
@@ -1,9 +1,13 @@
1
- export function formatProjectFilePath(projectRoot, file) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStackFormattedLocation = exports.formatProjectFilePath = void 0;
4
+ function formatProjectFilePath(projectRoot, file) {
2
5
  if (file == null) {
3
6
  return '<unknown>';
4
7
  }
5
8
  return pathRelativeToPath(file.replace(/\\/g, '/'), projectRoot.replace(/\\/g, '/')).replace(/\?.*$/, '');
6
9
  }
10
+ exports.formatProjectFilePath = formatProjectFilePath;
7
11
  function pathRelativeToPath(path, relativeTo, sep = '/') {
8
12
  const relativeToParts = relativeTo.split(sep);
9
13
  const pathParts = path.split(sep);
@@ -16,7 +20,7 @@ function pathRelativeToPath(path, relativeTo, sep = '/') {
16
20
  }
17
21
  return pathParts.slice(i).join(sep);
18
22
  }
19
- export function getStackFormattedLocation(projectRoot, frame) {
23
+ function getStackFormattedLocation(projectRoot, frame) {
20
24
  const column = frame.column != null && parseInt(String(frame.column), 10);
21
25
  const location = formatProjectFilePath(projectRoot, frame.file) +
22
26
  (frame.lineNumber != null
@@ -24,4 +28,5 @@ export function getStackFormattedLocation(projectRoot, frame) {
24
28
  : '');
25
29
  return location;
26
30
  }
31
+ exports.getStackFormattedLocation = getStackFormattedLocation;
27
32
  //# sourceMappingURL=formatProjectFilePath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatProjectFilePath.js","sourceRoot":"","sources":["../../src/error-overlay/formatProjectFilePath.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,qBAAqB,CAAC,WAAmB,EAAE,IAAoB;IAC7E,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,WAAW,CAAC;KACpB;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAC1F,OAAO,EACP,EAAE,CACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,UAAkB,EAAE,GAAG,GAAG,GAAG;IACrE,MAAM,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,eAAe,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE;QACzD,IAAI,eAAe,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;YACvC,MAAM;SACP;QACD,CAAC,EAAE,CAAC;KACL;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,WAAmB,EAAE,KAAsB;IACnF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,QAAQ,GACZ,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC;QAC9C,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI;YACvB,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/E,CAAC,CAAC,EAAE,CAAC,CAAC;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { StackFrame } from 'stacktrace-parser';\n\nexport type MetroStackFrame = StackFrame & { collapse?: boolean };\n\nexport function formatProjectFilePath(projectRoot: string, file?: string | null): string {\n if (file == null) {\n return '<unknown>';\n }\n\n return pathRelativeToPath(file.replace(/\\\\/g, '/'), projectRoot.replace(/\\\\/g, '/')).replace(\n /\\?.*$/,\n ''\n );\n}\n\nfunction pathRelativeToPath(path: string, relativeTo: string, sep = '/') {\n const relativeToParts = relativeTo.split(sep);\n const pathParts = path.split(sep);\n let i = 0;\n while (i < relativeToParts.length && i < pathParts.length) {\n if (relativeToParts[i] !== pathParts[i]) {\n break;\n }\n i++;\n }\n return pathParts.slice(i).join(sep);\n}\n\nexport function getStackFormattedLocation(projectRoot: string, frame: MetroStackFrame) {\n const column = frame.column != null && parseInt(String(frame.column), 10);\n const location =\n formatProjectFilePath(projectRoot, frame.file) +\n (frame.lineNumber != null\n ? ':' + frame.lineNumber + (column && !isNaN(column) ? ':' + (column + 1) : '')\n : '');\n\n return location;\n}\n"]}
1
+ {"version":3,"file":"formatProjectFilePath.js","sourceRoot":"","sources":["../../src/error-overlay/formatProjectFilePath.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CAAC,WAAmB,EAAE,IAAoB;IAC7E,IAAI,IAAI,IAAI,IAAI,EAAE;QACh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CAAC,CAAC,EAAE,CAAC;YAC/E,CAAC,CAAC,EAAE,CAAC,CAAC;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC;AATD,8DASC","sourcesContent":["import type { StackFrame } from 'stacktrace-parser';\n\nexport type MetroStackFrame = StackFrame & { collapse?: boolean };\n\nexport function formatProjectFilePath(projectRoot: string, file?: string | null): string {\n if (file == null) {\n return '<unknown>';\n }\n\n return pathRelativeToPath(file.replace(/\\\\/g, '/'), projectRoot.replace(/\\\\/g, '/')).replace(\n /\\?.*$/,\n ''\n );\n}\n\nfunction pathRelativeToPath(path: string, relativeTo: string, sep = '/') {\n const relativeToParts = relativeTo.split(sep);\n const pathParts = path.split(sep);\n let i = 0;\n while (i < relativeToParts.length && i < pathParts.length) {\n if (relativeToParts[i] !== pathParts[i]) {\n break;\n }\n i++;\n }\n return pathParts.slice(i).join(sep);\n}\n\nexport function getStackFormattedLocation(projectRoot: string, frame: MetroStackFrame) {\n const column = frame.column != null && parseInt(String(frame.column), 10);\n const location =\n formatProjectFilePath(projectRoot, frame.file) +\n (frame.lineNumber != null\n ? ':' + frame.lineNumber + (column && !isNaN(column) ? ':' + (column + 1) : '')\n : '');\n\n return location;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-overlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,uCAIzB,GAAG,kBAOxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-overlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsB1B,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,uCAIzB,GAAG,kBAOxC"}