one 1.15.10 → 1.16.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 (288) hide show
  1. package/dist/cjs/cli/build.cjs +98 -58
  2. package/dist/cjs/cli/build.native.js +106 -63
  3. package/dist/cjs/cli/build.native.js.map +1 -1
  4. package/dist/cjs/cli/buildPage.cjs +3 -3
  5. package/dist/cjs/cli/buildPage.native.js +3 -3
  6. package/dist/cjs/cli/buildPage.native.js.map +1 -1
  7. package/dist/cjs/constants.cjs +2 -0
  8. package/dist/cjs/constants.native.js +2 -0
  9. package/dist/cjs/constants.native.js.map +1 -1
  10. package/dist/cjs/createAPIRoute.native.js.map +1 -1
  11. package/dist/cjs/createApp.cjs +2 -6
  12. package/dist/cjs/createHandleRequest.cjs +2 -2
  13. package/dist/cjs/createHandleRequest.native.js +2 -2
  14. package/dist/cjs/createHandleRequest.native.js.map +1 -1
  15. package/dist/cjs/hooks.cjs +5 -1
  16. package/dist/cjs/hooks.native.js +7 -1
  17. package/dist/cjs/hooks.native.js.map +1 -1
  18. package/dist/cjs/index.native.js.map +1 -1
  19. package/dist/cjs/metro-config/getViteMetroPluginOptions.cjs +10 -7
  20. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +13 -10
  21. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
  22. package/dist/cjs/metro-config/getViteMetroPluginOptions.test.cjs +23 -0
  23. package/dist/cjs/metro-config/getViteMetroPluginOptions.test.native.js +26 -0
  24. package/dist/cjs/metro-config/getViteMetroPluginOptions.test.native.js.map +1 -0
  25. package/dist/cjs/router/Route.cjs +21 -1
  26. package/dist/cjs/router/Route.native.js +22 -1
  27. package/dist/cjs/router/Route.native.js.map +1 -1
  28. package/dist/cjs/router/interceptRoutes.cjs +6 -6
  29. package/dist/cjs/router/interceptRoutes.native.js +6 -6
  30. package/dist/cjs/router/interceptRoutes.native.js.map +1 -1
  31. package/dist/cjs/router/params.cjs +46 -0
  32. package/dist/cjs/router/params.native.js +70 -0
  33. package/dist/cjs/router/params.native.js.map +1 -0
  34. package/dist/cjs/router/useScreens.cjs +3 -0
  35. package/dist/cjs/router/useScreens.native.js +2 -0
  36. package/dist/cjs/router/useScreens.native.js.map +1 -1
  37. package/dist/cjs/serve-worker.native.js.map +1 -1
  38. package/dist/cjs/server/getServerManifest.cjs +6 -6
  39. package/dist/cjs/server/getServerManifest.native.js +6 -6
  40. package/dist/cjs/server/getServerManifest.native.js.map +1 -1
  41. package/dist/cjs/server/oneServe.cjs +9 -5
  42. package/dist/cjs/server/oneServe.native.js +9 -5
  43. package/dist/cjs/server/oneServe.native.js.map +1 -1
  44. package/dist/cjs/server/workerHandler.cjs +2 -2
  45. package/dist/cjs/server/workerHandler.native.js +2 -2
  46. package/dist/cjs/server/workerHandler.native.js.map +1 -1
  47. package/dist/cjs/skewProtection.cjs +48 -7
  48. package/dist/cjs/skewProtection.native.js +48 -7
  49. package/dist/cjs/skewProtection.native.js.map +1 -1
  50. package/dist/cjs/useLoader.cjs +67 -69
  51. package/dist/cjs/useLoader.native.js +113 -117
  52. package/dist/cjs/useLoader.native.js.map +1 -1
  53. package/dist/cjs/utils/dynamicImport.cjs +3 -1
  54. package/dist/cjs/utils/dynamicImport.native.js +22 -1
  55. package/dist/cjs/utils/dynamicImport.native.js.map +1 -1
  56. package/dist/cjs/utils/toAbsolute.cjs +5 -2
  57. package/dist/cjs/utils/toAbsolute.native.js +6 -1
  58. package/dist/cjs/utils/toAbsolute.native.js.map +1 -1
  59. package/dist/cjs/utils/workerImport.cjs +1 -1
  60. package/dist/cjs/utils/workerImport.native.js +1 -1
  61. package/dist/cjs/utils/workerImport.native.js.map +1 -1
  62. package/dist/cjs/views/RootErrorBoundary.cjs +114 -117
  63. package/dist/cjs/views/RootErrorBoundary.native.js +126 -146
  64. package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -1
  65. package/dist/cjs/views/Try.cjs +17 -18
  66. package/dist/cjs/views/Try.native.js +28 -42
  67. package/dist/cjs/views/Try.native.js.map +1 -1
  68. package/dist/cjs/vite/plugins/criticalCSSPlugin.cjs +2 -1
  69. package/dist/cjs/vite/plugins/criticalCSSPlugin.native.js +2 -1
  70. package/dist/cjs/vite/plugins/criticalCSSPlugin.native.js.map +1 -1
  71. package/dist/cjs/vite/plugins/criticalCSSPlugin.test.cjs +26 -20
  72. package/dist/cjs/vite/plugins/criticalCSSPlugin.test.native.js +28 -20
  73. package/dist/cjs/vite/plugins/criticalCSSPlugin.test.native.js.map +1 -1
  74. package/dist/cjs/vite/plugins/imageDataPlugin.cjs +3 -2
  75. package/dist/cjs/vite/plugins/imageDataPlugin.native.js +3 -2
  76. package/dist/cjs/vite/plugins/imageDataPlugin.native.js.map +1 -1
  77. package/dist/cjs/vite/plugins/imageDataPlugin.test.cjs +34 -69
  78. package/dist/cjs/vite/plugins/imageDataPlugin.test.native.js +34 -69
  79. package/dist/cjs/vite/plugins/imageDataPlugin.test.native.js.map +1 -1
  80. package/dist/cjs/vite/plugins/sourceInspectorPlugin.cjs +20 -2
  81. package/dist/cjs/vite/plugins/sourceInspectorPlugin.native.js +23 -2
  82. package/dist/cjs/vite/plugins/sourceInspectorPlugin.native.js.map +1 -1
  83. package/dist/cjs/vite/plugins/sourceInspectorPlugin.test.cjs +21 -0
  84. package/dist/cjs/vite/plugins/sourceInspectorPlugin.test.native.js +28 -0
  85. package/dist/cjs/vite/plugins/sourceInspectorPlugin.test.native.js.map +1 -0
  86. package/dist/cjs/vite/resolveResponse.cjs +7 -2
  87. package/dist/cjs/vite/resolveResponse.native.js +7 -2
  88. package/dist/cjs/vite/resolveResponse.native.js.map +1 -1
  89. package/dist/esm/cli/build.mjs +100 -60
  90. package/dist/esm/cli/build.mjs.map +1 -1
  91. package/dist/esm/cli/build.native.js +108 -65
  92. package/dist/esm/cli/build.native.js.map +1 -1
  93. package/dist/esm/cli/buildPage.mjs +4 -4
  94. package/dist/esm/cli/buildPage.mjs.map +1 -1
  95. package/dist/esm/cli/buildPage.native.js +4 -4
  96. package/dist/esm/cli/buildPage.native.js.map +1 -1
  97. package/dist/esm/constants.mjs +2 -1
  98. package/dist/esm/constants.mjs.map +1 -1
  99. package/dist/esm/constants.native.js +2 -1
  100. package/dist/esm/constants.native.js.map +1 -1
  101. package/dist/esm/createAPIRoute.mjs.map +1 -1
  102. package/dist/esm/createAPIRoute.native.js.map +1 -1
  103. package/dist/esm/createApp.mjs +2 -6
  104. package/dist/esm/createApp.mjs.map +1 -1
  105. package/dist/esm/createHandleRequest.mjs +2 -2
  106. package/dist/esm/createHandleRequest.mjs.map +1 -1
  107. package/dist/esm/createHandleRequest.native.js +2 -2
  108. package/dist/esm/createHandleRequest.native.js.map +1 -1
  109. package/dist/esm/hooks.mjs +5 -1
  110. package/dist/esm/hooks.mjs.map +1 -1
  111. package/dist/esm/hooks.native.js +7 -1
  112. package/dist/esm/hooks.native.js.map +1 -1
  113. package/dist/esm/index.js.map +1 -1
  114. package/dist/esm/index.mjs.map +1 -1
  115. package/dist/esm/index.native.js.map +1 -1
  116. package/dist/esm/metro-config/getViteMetroPluginOptions.mjs +9 -7
  117. package/dist/esm/metro-config/getViteMetroPluginOptions.mjs.map +1 -1
  118. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +12 -10
  119. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
  120. package/dist/esm/metro-config/getViteMetroPluginOptions.test.mjs +24 -0
  121. package/dist/esm/metro-config/getViteMetroPluginOptions.test.mjs.map +1 -0
  122. package/dist/esm/metro-config/getViteMetroPluginOptions.test.native.js +24 -0
  123. package/dist/esm/metro-config/getViteMetroPluginOptions.test.native.js.map +1 -0
  124. package/dist/esm/router/Route.mjs +21 -1
  125. package/dist/esm/router/Route.mjs.map +1 -1
  126. package/dist/esm/router/Route.native.js +22 -1
  127. package/dist/esm/router/Route.native.js.map +1 -1
  128. package/dist/esm/router/interceptRoutes.mjs +7 -7
  129. package/dist/esm/router/interceptRoutes.mjs.map +1 -1
  130. package/dist/esm/router/interceptRoutes.native.js +7 -7
  131. package/dist/esm/router/interceptRoutes.native.js.map +1 -1
  132. package/dist/esm/router/params.mjs +21 -0
  133. package/dist/esm/router/params.mjs.map +1 -0
  134. package/dist/esm/router/params.native.js +42 -0
  135. package/dist/esm/router/params.native.js.map +1 -0
  136. package/dist/esm/router/useScreens.mjs +3 -0
  137. package/dist/esm/router/useScreens.mjs.map +1 -1
  138. package/dist/esm/router/useScreens.native.js +2 -0
  139. package/dist/esm/router/useScreens.native.js.map +1 -1
  140. package/dist/esm/serve-worker.mjs.map +1 -1
  141. package/dist/esm/serve-worker.native.js.map +1 -1
  142. package/dist/esm/server/getServerManifest.mjs +6 -6
  143. package/dist/esm/server/getServerManifest.mjs.map +1 -1
  144. package/dist/esm/server/getServerManifest.native.js +6 -6
  145. package/dist/esm/server/getServerManifest.native.js.map +1 -1
  146. package/dist/esm/server/oneServe.mjs +11 -7
  147. package/dist/esm/server/oneServe.mjs.map +1 -1
  148. package/dist/esm/server/oneServe.native.js +11 -7
  149. package/dist/esm/server/oneServe.native.js.map +1 -1
  150. package/dist/esm/server/workerHandler.mjs +2 -2
  151. package/dist/esm/server/workerHandler.mjs.map +1 -1
  152. package/dist/esm/server/workerHandler.native.js +2 -2
  153. package/dist/esm/server/workerHandler.native.js.map +1 -1
  154. package/dist/esm/skewProtection.mjs +48 -8
  155. package/dist/esm/skewProtection.mjs.map +1 -1
  156. package/dist/esm/skewProtection.native.js +48 -8
  157. package/dist/esm/skewProtection.native.js.map +1 -1
  158. package/dist/esm/useLoader.mjs +64 -66
  159. package/dist/esm/useLoader.mjs.map +1 -1
  160. package/dist/esm/useLoader.native.js +112 -116
  161. package/dist/esm/useLoader.native.js.map +1 -1
  162. package/dist/esm/utils/dynamicImport.mjs +1 -1
  163. package/dist/esm/utils/dynamicImport.mjs.map +1 -1
  164. package/dist/esm/utils/dynamicImport.native.js +20 -1
  165. package/dist/esm/utils/dynamicImport.native.js.map +1 -1
  166. package/dist/esm/utils/toAbsolute.mjs +3 -1
  167. package/dist/esm/utils/toAbsolute.mjs.map +1 -1
  168. package/dist/esm/utils/toAbsolute.native.js +5 -1
  169. package/dist/esm/utils/toAbsolute.native.js.map +1 -1
  170. package/dist/esm/utils/workerImport.mjs +2 -2
  171. package/dist/esm/utils/workerImport.mjs.map +1 -1
  172. package/dist/esm/utils/workerImport.native.js +2 -2
  173. package/dist/esm/utils/workerImport.native.js.map +1 -1
  174. package/dist/esm/views/RootErrorBoundary.mjs +114 -117
  175. package/dist/esm/views/RootErrorBoundary.mjs.map +1 -1
  176. package/dist/esm/views/RootErrorBoundary.native.js +126 -146
  177. package/dist/esm/views/RootErrorBoundary.native.js.map +1 -1
  178. package/dist/esm/views/Try.mjs +17 -18
  179. package/dist/esm/views/Try.mjs.map +1 -1
  180. package/dist/esm/views/Try.native.js +28 -42
  181. package/dist/esm/views/Try.native.js.map +1 -1
  182. package/dist/esm/vite/plugins/criticalCSSPlugin.mjs +2 -1
  183. package/dist/esm/vite/plugins/criticalCSSPlugin.mjs.map +1 -1
  184. package/dist/esm/vite/plugins/criticalCSSPlugin.native.js +2 -1
  185. package/dist/esm/vite/plugins/criticalCSSPlugin.native.js.map +1 -1
  186. package/dist/esm/vite/plugins/criticalCSSPlugin.test.mjs +26 -20
  187. package/dist/esm/vite/plugins/criticalCSSPlugin.test.mjs.map +1 -1
  188. package/dist/esm/vite/plugins/criticalCSSPlugin.test.native.js +28 -20
  189. package/dist/esm/vite/plugins/criticalCSSPlugin.test.native.js.map +1 -1
  190. package/dist/esm/vite/plugins/imageDataPlugin.mjs +4 -3
  191. package/dist/esm/vite/plugins/imageDataPlugin.mjs.map +1 -1
  192. package/dist/esm/vite/plugins/imageDataPlugin.native.js +4 -3
  193. package/dist/esm/vite/plugins/imageDataPlugin.native.js.map +1 -1
  194. package/dist/esm/vite/plugins/imageDataPlugin.test.mjs +34 -69
  195. package/dist/esm/vite/plugins/imageDataPlugin.test.mjs.map +1 -1
  196. package/dist/esm/vite/plugins/imageDataPlugin.test.native.js +34 -69
  197. package/dist/esm/vite/plugins/imageDataPlugin.test.native.js.map +1 -1
  198. package/dist/esm/vite/plugins/sourceInspectorPlugin.mjs +19 -3
  199. package/dist/esm/vite/plugins/sourceInspectorPlugin.mjs.map +1 -1
  200. package/dist/esm/vite/plugins/sourceInspectorPlugin.native.js +22 -3
  201. package/dist/esm/vite/plugins/sourceInspectorPlugin.native.js.map +1 -1
  202. package/dist/esm/vite/plugins/sourceInspectorPlugin.test.mjs +22 -0
  203. package/dist/esm/vite/plugins/sourceInspectorPlugin.test.mjs.map +1 -0
  204. package/dist/esm/vite/plugins/sourceInspectorPlugin.test.native.js +26 -0
  205. package/dist/esm/vite/plugins/sourceInspectorPlugin.test.native.js.map +1 -0
  206. package/dist/esm/vite/resolveResponse.mjs +7 -2
  207. package/dist/esm/vite/resolveResponse.mjs.map +1 -1
  208. package/dist/esm/vite/resolveResponse.native.js +7 -2
  209. package/dist/esm/vite/resolveResponse.native.js.map +1 -1
  210. package/expo-plugin.cjs +1 -0
  211. package/package.json +15 -10
  212. package/react-native-commands.cjs +1 -0
  213. package/src/cli/build.ts +156 -99
  214. package/src/cli/buildPage.ts +4 -4
  215. package/src/constants.ts +15 -0
  216. package/src/createAPIRoute.ts +35 -2
  217. package/src/createApp.tsx +2 -6
  218. package/src/createHandleRequest.ts +6 -2
  219. package/src/hooks.tsx +9 -1
  220. package/src/index.ts +8 -1
  221. package/src/metro-config/getViteMetroPluginOptions.test.ts +34 -0
  222. package/src/metro-config/getViteMetroPluginOptions.ts +14 -11
  223. package/src/router/Route.tsx +52 -2
  224. package/src/router/interceptRoutes.ts +7 -7
  225. package/src/router/params.ts +32 -0
  226. package/src/router/useScreens.tsx +18 -0
  227. package/src/serve-worker.ts +4 -2
  228. package/src/server/getServerManifest.ts +11 -7
  229. package/src/server/oneServe.ts +12 -14
  230. package/src/server/workerHandler.ts +13 -2
  231. package/src/skewProtection.ts +45 -5
  232. package/src/useLoader.ts +6 -4
  233. package/src/utils/dynamicImport.ts +2 -2
  234. package/src/utils/toAbsolute.ts +5 -0
  235. package/src/utils/workerImport.ts +2 -2
  236. package/src/views/RootErrorBoundary.tsx +18 -0
  237. package/src/views/Try.tsx +18 -0
  238. package/src/vite/plugins/criticalCSSPlugin.test.ts +34 -24
  239. package/src/vite/plugins/criticalCSSPlugin.ts +3 -2
  240. package/src/vite/plugins/imageDataPlugin.test.ts +39 -83
  241. package/src/vite/plugins/imageDataPlugin.ts +5 -4
  242. package/src/vite/plugins/sourceInspectorPlugin.test.ts +40 -0
  243. package/src/vite/plugins/sourceInspectorPlugin.ts +30 -2
  244. package/src/vite/resolveResponse.ts +6 -2
  245. package/types/cli/build.d.ts.map +1 -1
  246. package/types/constants.d.ts +9 -0
  247. package/types/constants.d.ts.map +1 -1
  248. package/types/createAPIRoute.d.ts +28 -3
  249. package/types/createAPIRoute.d.ts.map +1 -1
  250. package/types/createApp.d.ts.map +1 -1
  251. package/types/createHandleRequest.d.ts +1 -1
  252. package/types/createHandleRequest.d.ts.map +1 -1
  253. package/types/headless-server.d.ts +1 -1
  254. package/types/hooks.d.ts.map +1 -1
  255. package/types/index.d.ts +1 -1
  256. package/types/index.d.ts.map +1 -1
  257. package/types/metro-config/getViteMetroPluginOptions.d.ts +5 -0
  258. package/types/metro-config/getViteMetroPluginOptions.d.ts.map +1 -1
  259. package/types/metro-config/getViteMetroPluginOptions.test.d.ts +2 -0
  260. package/types/metro-config/getViteMetroPluginOptions.test.d.ts.map +1 -0
  261. package/types/router/Route.d.ts +1 -0
  262. package/types/router/Route.d.ts.map +1 -1
  263. package/types/router/params.d.ts +3 -0
  264. package/types/router/params.d.ts.map +1 -0
  265. package/types/router/useScreens.d.ts.map +1 -1
  266. package/types/serve-worker.d.ts +5 -3
  267. package/types/serve-worker.d.ts.map +1 -1
  268. package/types/server/getServerManifest.d.ts.map +1 -1
  269. package/types/server/oneServe.d.ts.map +1 -1
  270. package/types/server/workerHandler.d.ts +1 -1
  271. package/types/server/workerHandler.d.ts.map +1 -1
  272. package/types/skewProtection.d.ts +1 -0
  273. package/types/skewProtection.d.ts.map +1 -1
  274. package/types/useLoader.d.ts.map +1 -1
  275. package/types/utils/dynamicImport.d.ts +2 -0
  276. package/types/utils/dynamicImport.d.ts.map +1 -1
  277. package/types/utils/toAbsolute.d.ts +3 -0
  278. package/types/utils/toAbsolute.d.ts.map +1 -1
  279. package/types/views/RootErrorBoundary.d.ts.map +1 -1
  280. package/types/views/Try.d.ts.map +1 -1
  281. package/types/vite/plugins/criticalCSSPlugin.d.ts.map +1 -1
  282. package/types/vite/plugins/imageDataPlugin.d.ts.map +1 -1
  283. package/types/vite/plugins/sourceInspectorPlugin.d.ts +2 -0
  284. package/types/vite/plugins/sourceInspectorPlugin.d.ts.map +1 -1
  285. package/types/vite/plugins/sourceInspectorPlugin.test.d.ts +2 -0
  286. package/types/vite/plugins/sourceInspectorPlugin.test.d.ts.map +1 -0
  287. package/types/vite/resolveResponse.d.ts +1 -1
  288. package/types/vite/resolveResponse.d.ts.map +1 -1
@@ -38,6 +38,8 @@ __export(RootErrorBoundary_exports, {
38
38
  module.exports = __toCommonJS(RootErrorBoundary_exports);
39
39
  var import_react = __toESM(require("react"), 1);
40
40
  var import_react_native = require("react-native-web");
41
+ var import_skewProtection = require("../skewProtection.cjs");
42
+ var import_dynamicImport = require("../utils/dynamicImport.cjs");
41
43
  var import_jsx_runtime = require("react/jsx-runtime");
42
44
  class RootErrorBoundary extends import_react.default.Component {
43
45
  state = {
@@ -58,20 +60,19 @@ class RootErrorBoundary extends import_react.default.Component {
58
60
  console.error(`[One] Root error boundary caught error:
59
61
  ${printError(error)}
60
62
  ${info.componentStack}`);
61
- if (typeof window !== "undefined" && typeof CustomEvent !== "undefined") {
62
- window.dispatchEvent(new CustomEvent("one-error", {
63
- detail: {
64
- error: {
65
- message: error.message,
66
- stack: error.stack,
67
- name: error.name
68
- },
69
- componentStack: info.componentStack,
70
- timestamp: Date.now(),
71
- type: "render"
72
- }
73
- }));
74
- }
63
+ if (process.env.NODE_ENV === "production" && process.env.ONE_SKEW_PROTECTION !== "false") if ((0, import_dynamicImport.isChunkLoadError)(error)) (0, import_dynamicImport.handleSkewError)();else (0, import_skewProtection.checkSkewAndReload)();
64
+ if (typeof window !== "undefined" && typeof CustomEvent !== "undefined") window.dispatchEvent(new CustomEvent("one-error", {
65
+ detail: {
66
+ error: {
67
+ message: error.message,
68
+ stack: error.stack,
69
+ name: error.name
70
+ },
71
+ componentStack: info.componentStack,
72
+ timestamp: Date.now(),
73
+ type: "render"
74
+ }
75
+ }));
75
76
  }
76
77
  handleRetry = () => {
77
78
  this.setState({
@@ -87,120 +88,116 @@ ${info.componentStack}`);
87
88
  componentStack
88
89
  } = this.state;
89
90
  const isDev = process.env.NODE_ENV === "development";
90
- if (import_react_native.Platform.OS === "web") {
91
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
91
+ if (import_react_native.Platform.OS === "web") return /* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
92
+ style: {
93
+ minHeight: "100vh",
94
+ display: "flex",
95
+ alignItems: "center",
96
+ justifyContent: "center",
97
+ backgroundColor: "#0a0a0f",
98
+ fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
99
+ color: "#e8e8e8",
100
+ padding: 24
101
+ },
102
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
92
103
  style: {
93
- minHeight: "100vh",
94
- display: "flex",
95
- alignItems: "center",
96
- justifyContent: "center",
97
- backgroundColor: "#0a0a0f",
98
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
99
- color: "#e8e8e8",
100
- padding: 24
104
+ maxWidth: 500,
105
+ width: "100%",
106
+ textAlign: "center"
101
107
  },
102
- children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
108
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
103
109
  style: {
104
- maxWidth: 500,
105
- width: "100%",
106
- textAlign: "center"
110
+ width: 64,
111
+ height: 64,
112
+ backgroundColor: "#ef4444",
113
+ borderRadius: "50%",
114
+ display: "flex",
115
+ alignItems: "center",
116
+ justifyContent: "center",
117
+ margin: "0 auto 24px"
107
118
  },
108
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
109
- style: {
110
- width: 64,
111
- height: 64,
112
- backgroundColor: "#ef4444",
113
- borderRadius: "50%",
114
- display: "flex",
115
- alignItems: "center",
116
- justifyContent: "center",
117
- margin: "0 auto 24px"
118
- },
119
- children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("svg", {
120
- width: "32",
121
- height: "32",
122
- viewBox: "0 0 24 24",
123
- fill: "none",
124
- stroke: "white",
125
- strokeWidth: "2",
126
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("circle", {
127
- cx: "12",
128
- cy: "12",
129
- r: "10"
130
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
131
- x1: "12",
132
- y1: "8",
133
- x2: "12",
134
- y2: "12"
135
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
136
- x1: "12",
137
- y1: "16",
138
- x2: "12.01",
139
- y2: "16"
140
- })]
141
- })
142
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("h1", {
143
- style: {
144
- fontSize: 24,
145
- fontWeight: 600,
146
- marginBottom: 8
147
- },
148
- children: "Something went wrong"
149
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
119
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("svg", {
120
+ width: "32",
121
+ height: "32",
122
+ viewBox: "0 0 24 24",
123
+ fill: "none",
124
+ stroke: "white",
125
+ strokeWidth: "2",
126
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("circle", {
127
+ cx: "12",
128
+ cy: "12",
129
+ r: "10"
130
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
131
+ x1: "12",
132
+ y1: "8",
133
+ x2: "12",
134
+ y2: "12"
135
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
136
+ x1: "12",
137
+ y1: "16",
138
+ x2: "12.01",
139
+ y2: "16"
140
+ })]
141
+ })
142
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("h1", {
143
+ style: {
144
+ fontSize: 24,
145
+ fontWeight: 600,
146
+ marginBottom: 8
147
+ },
148
+ children: "Something went wrong"
149
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
150
+ style: {
151
+ fontSize: 14,
152
+ color: "#888",
153
+ marginBottom: 24
154
+ },
155
+ children: error?.message || "An unexpected error occurred"
156
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
157
+ style: {
158
+ display: "flex",
159
+ gap: 12,
160
+ justifyContent: "center"
161
+ },
162
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
163
+ onClick: this.handleRetry,
150
164
  style: {
165
+ padding: "12px 24px",
166
+ backgroundColor: "#3b82f6",
167
+ color: "white",
168
+ border: "none",
169
+ borderRadius: 8,
151
170
  fontSize: 14,
152
- color: "#888",
153
- marginBottom: 24
171
+ fontWeight: 500,
172
+ cursor: "pointer"
154
173
  },
155
- children: error?.message || "An unexpected error occurred"
156
- }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
157
- style: {
158
- display: "flex",
159
- gap: 12,
160
- justifyContent: "center"
174
+ children: "Try Again"
175
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
176
+ onClick: () => {
177
+ if (typeof window !== "undefined") window.location.href = "/";
161
178
  },
162
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
163
- onClick: this.handleRetry,
164
- style: {
165
- padding: "12px 24px",
166
- backgroundColor: "#3b82f6",
167
- color: "white",
168
- border: "none",
169
- borderRadius: 8,
170
- fontSize: 14,
171
- fontWeight: 500,
172
- cursor: "pointer"
173
- },
174
- children: "Try Again"
175
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
176
- onClick: () => {
177
- if (typeof window !== "undefined") {
178
- window.location.href = "/";
179
- }
180
- },
181
- style: {
182
- padding: "12px 24px",
183
- backgroundColor: "transparent",
184
- color: "#888",
185
- border: "1px solid #3a3a5a",
186
- borderRadius: 8,
187
- fontSize: 14,
188
- fontWeight: 500,
189
- cursor: "pointer"
190
- },
191
- children: "Go Home"
192
- })]
193
- }), isDev && /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
194
179
  style: {
195
- fontSize: 11,
196
- color: "#666",
197
- marginTop: 24
180
+ padding: "12px 24px",
181
+ backgroundColor: "transparent",
182
+ color: "#888",
183
+ border: "1px solid #3a3a5a",
184
+ borderRadius: 8,
185
+ fontSize: 14,
186
+ fontWeight: 500,
187
+ cursor: "pointer"
198
188
  },
199
- children: "Press Alt+E to view error details"
189
+ children: "Go Home"
200
190
  })]
201
- })
202
- });
203
- }
191
+ }), isDev && /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
192
+ style: {
193
+ fontSize: 11,
194
+ color: "#666",
195
+ marginTop: 24
196
+ },
197
+ children: "Press Alt+E to view error details"
198
+ })]
199
+ })
200
+ });
204
201
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, {
205
202
  style: {
206
203
  flex: 1,
@@ -41,10 +41,10 @@ module.exports = __toCommonJS(RootErrorBoundary_exports);
41
41
  var import_jsx_runtime = require("react/jsx-runtime");
42
42
  var import_react = __toESM(require("react"), 1);
43
43
  var import_react_native = require("react-native");
44
+ require("../skewProtection.native.js");
45
+ require("../utils/dynamicImport.native.js");
44
46
  function _assert_this_initialized(self) {
45
- if (self === void 0) {
46
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
47
- }
47
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
48
48
  return self;
49
49
  }
50
50
  function _call_super(_this, derived, args) {
@@ -52,9 +52,7 @@ function _call_super(_this, derived, args) {
52
52
  return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
53
53
  }
54
54
  function _class_call_check(instance, Constructor) {
55
- if (!(instance instanceof Constructor)) {
56
- throw new TypeError("Cannot call a class as a function");
57
- }
55
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
58
56
  }
59
57
  function _defineProperties(target, props) {
60
58
  for (var i = 0; i < props.length; i++) {
@@ -71,16 +69,12 @@ function _create_class(Constructor, protoProps, staticProps) {
71
69
  return Constructor;
72
70
  }
73
71
  function _define_property(obj, key, value) {
74
- if (key in obj) {
75
- Object.defineProperty(obj, key, {
76
- value,
77
- enumerable: true,
78
- configurable: true,
79
- writable: true
80
- });
81
- } else {
82
- obj[key] = value;
83
- }
72
+ if (key in obj) Object.defineProperty(obj, key, {
73
+ value,
74
+ enumerable: true,
75
+ configurable: true,
76
+ writable: true
77
+ });else obj[key] = value;
84
78
  return obj;
85
79
  }
86
80
  function _get_prototype_of(o) {
@@ -90,9 +84,7 @@ function _get_prototype_of(o) {
90
84
  return _get_prototype_of(o);
91
85
  }
92
86
  function _inherits(subClass, superClass) {
93
- if (typeof superClass !== "function" && superClass !== null) {
94
- throw new TypeError("Super expression must either be null or a function");
95
- }
87
+ if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
96
88
  subClass.prototype = Object.create(superClass && superClass.prototype, {
97
89
  constructor: {
98
90
  value: subClass,
@@ -103,16 +95,10 @@ function _inherits(subClass, superClass) {
103
95
  if (superClass) _set_prototype_of(subClass, superClass);
104
96
  }
105
97
  function _instanceof(left, right) {
106
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
107
- return !!right[Symbol.hasInstance](left);
108
- } else {
109
- return left instanceof right;
110
- }
98
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);else return left instanceof right;
111
99
  }
112
100
  function _possible_constructor_return(self, call) {
113
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
114
- return call;
115
- }
101
+ if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
116
102
  return _assert_this_initialized(self);
117
103
  }
118
104
  function _set_prototype_of(o, p) {
@@ -141,8 +127,8 @@ var RootErrorBoundary = /* @__PURE__ */function (_React_Component) {
141
127
  _inherits(RootErrorBoundary2, _React_Component);
142
128
  function RootErrorBoundary2() {
143
129
  _class_call_check(this, RootErrorBoundary2);
144
- var _this;
145
- _this = _call_super(this, RootErrorBoundary2, arguments), _define_property(_this, "state", {
130
+ var _this = _call_super(this, RootErrorBoundary2, arguments);
131
+ _define_property(_this, "state", {
146
132
  hasError: false,
147
133
  error: null,
148
134
  componentStack: null
@@ -164,20 +150,18 @@ var RootErrorBoundary = /* @__PURE__ */function (_React_Component) {
164
150
  console.error(`[One] Root error boundary caught error:
165
151
  ${printError(error)}
166
152
  ${info.componentStack}`);
167
- if (typeof window !== "undefined" && typeof CustomEvent !== "undefined") {
168
- window.dispatchEvent(new CustomEvent("one-error", {
169
- detail: {
170
- error: {
171
- message: error.message,
172
- stack: error.stack,
173
- name: error.name
174
- },
175
- componentStack: info.componentStack,
176
- timestamp: Date.now(),
177
- type: "render"
178
- }
179
- }));
180
- }
153
+ if (typeof window !== "undefined" && typeof CustomEvent !== "undefined") window.dispatchEvent(new CustomEvent("one-error", {
154
+ detail: {
155
+ error: {
156
+ message: error.message,
157
+ stack: error.stack,
158
+ name: error.name
159
+ },
160
+ componentStack: info.componentStack,
161
+ timestamp: Date.now(),
162
+ type: "render"
163
+ }
164
+ }));
181
165
  }
182
166
  }, {
183
167
  key: "render",
@@ -188,120 +172,116 @@ ${info.componentStack}`);
188
172
  componentStack
189
173
  } = this.state;
190
174
  var isDev = process.env.NODE_ENV === "development";
191
- if (import_react_native.Platform.OS === "web") {
192
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
175
+ if (import_react_native.Platform.OS === "web") return /* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
176
+ style: {
177
+ minHeight: "100vh",
178
+ display: "flex",
179
+ alignItems: "center",
180
+ justifyContent: "center",
181
+ backgroundColor: "#0a0a0f",
182
+ fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
183
+ color: "#e8e8e8",
184
+ padding: 24
185
+ },
186
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
193
187
  style: {
194
- minHeight: "100vh",
195
- display: "flex",
196
- alignItems: "center",
197
- justifyContent: "center",
198
- backgroundColor: "#0a0a0f",
199
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
200
- color: "#e8e8e8",
201
- padding: 24
188
+ maxWidth: 500,
189
+ width: "100%",
190
+ textAlign: "center"
202
191
  },
203
- children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
192
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
204
193
  style: {
205
- maxWidth: 500,
206
- width: "100%",
207
- textAlign: "center"
194
+ width: 64,
195
+ height: 64,
196
+ backgroundColor: "#ef4444",
197
+ borderRadius: "50%",
198
+ display: "flex",
199
+ alignItems: "center",
200
+ justifyContent: "center",
201
+ margin: "0 auto 24px"
208
202
  },
209
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
210
- style: {
211
- width: 64,
212
- height: 64,
213
- backgroundColor: "#ef4444",
214
- borderRadius: "50%",
215
- display: "flex",
216
- alignItems: "center",
217
- justifyContent: "center",
218
- margin: "0 auto 24px"
219
- },
220
- children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("svg", {
221
- width: "32",
222
- height: "32",
223
- viewBox: "0 0 24 24",
224
- fill: "none",
225
- stroke: "white",
226
- strokeWidth: "2",
227
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("circle", {
228
- cx: "12",
229
- cy: "12",
230
- r: "10"
231
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
232
- x1: "12",
233
- y1: "8",
234
- x2: "12",
235
- y2: "12"
236
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
237
- x1: "12",
238
- y1: "16",
239
- x2: "12.01",
240
- y2: "16"
241
- })]
242
- })
243
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("h1", {
244
- style: {
245
- fontSize: 24,
246
- fontWeight: 600,
247
- marginBottom: 8
248
- },
249
- children: "Something went wrong"
250
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
203
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)("svg", {
204
+ width: "32",
205
+ height: "32",
206
+ viewBox: "0 0 24 24",
207
+ fill: "none",
208
+ stroke: "white",
209
+ strokeWidth: "2",
210
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("circle", {
211
+ cx: "12",
212
+ cy: "12",
213
+ r: "10"
214
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
215
+ x1: "12",
216
+ y1: "8",
217
+ x2: "12",
218
+ y2: "12"
219
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("line", {
220
+ x1: "12",
221
+ y1: "16",
222
+ x2: "12.01",
223
+ y2: "16"
224
+ })]
225
+ })
226
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("h1", {
227
+ style: {
228
+ fontSize: 24,
229
+ fontWeight: 600,
230
+ marginBottom: 8
231
+ },
232
+ children: "Something went wrong"
233
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
234
+ style: {
235
+ fontSize: 14,
236
+ color: "#888",
237
+ marginBottom: 24
238
+ },
239
+ children: (error === null || error === void 0 ? void 0 : error.message) || "An unexpected error occurred"
240
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
241
+ style: {
242
+ display: "flex",
243
+ gap: 12,
244
+ justifyContent: "center"
245
+ },
246
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
247
+ onClick: this.handleRetry,
251
248
  style: {
249
+ padding: "12px 24px",
250
+ backgroundColor: "#3b82f6",
251
+ color: "white",
252
+ border: "none",
253
+ borderRadius: 8,
252
254
  fontSize: 14,
253
- color: "#888",
254
- marginBottom: 24
255
+ fontWeight: 500,
256
+ cursor: "pointer"
255
257
  },
256
- children: (error === null || error === void 0 ? void 0 : error.message) || "An unexpected error occurred"
257
- }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)("div", {
258
- style: {
259
- display: "flex",
260
- gap: 12,
261
- justifyContent: "center"
258
+ children: "Try Again"
259
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
260
+ onClick: function () {
261
+ if (typeof window !== "undefined") window.location.href = "/";
262
262
  },
263
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
264
- onClick: this.handleRetry,
265
- style: {
266
- padding: "12px 24px",
267
- backgroundColor: "#3b82f6",
268
- color: "white",
269
- border: "none",
270
- borderRadius: 8,
271
- fontSize: 14,
272
- fontWeight: 500,
273
- cursor: "pointer"
274
- },
275
- children: "Try Again"
276
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
277
- onClick: function () {
278
- if (typeof window !== "undefined") {
279
- window.location.href = "/";
280
- }
281
- },
282
- style: {
283
- padding: "12px 24px",
284
- backgroundColor: "transparent",
285
- color: "#888",
286
- border: "1px solid #3a3a5a",
287
- borderRadius: 8,
288
- fontSize: 14,
289
- fontWeight: 500,
290
- cursor: "pointer"
291
- },
292
- children: "Go Home"
293
- })]
294
- }), isDev && /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
295
263
  style: {
296
- fontSize: 11,
297
- color: "#666",
298
- marginTop: 24
264
+ padding: "12px 24px",
265
+ backgroundColor: "transparent",
266
+ color: "#888",
267
+ border: "1px solid #3a3a5a",
268
+ borderRadius: 8,
269
+ fontSize: 14,
270
+ fontWeight: 500,
271
+ cursor: "pointer"
299
272
  },
300
- children: "Press Alt+E to view error details"
273
+ children: "Go Home"
301
274
  })]
302
- })
303
- });
304
- }
275
+ }), isDev && /* @__PURE__ */(0, import_jsx_runtime.jsx)("p", {
276
+ style: {
277
+ fontSize: 11,
278
+ color: "#666",
279
+ marginTop: 24
280
+ },
281
+ children: "Press Alt+E to view error details"
282
+ })]
283
+ })
284
+ });
305
285
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, {
306
286
  style: {
307
287
  flex: 1,