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.
- package/dist/cjs/cli/build.cjs +98 -58
- package/dist/cjs/cli/build.native.js +106 -63
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli/buildPage.cjs +3 -3
- package/dist/cjs/cli/buildPage.native.js +3 -3
- package/dist/cjs/cli/buildPage.native.js.map +1 -1
- package/dist/cjs/constants.cjs +2 -0
- package/dist/cjs/constants.native.js +2 -0
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/createAPIRoute.native.js.map +1 -1
- package/dist/cjs/createApp.cjs +2 -6
- package/dist/cjs/createHandleRequest.cjs +2 -2
- package/dist/cjs/createHandleRequest.native.js +2 -2
- package/dist/cjs/createHandleRequest.native.js.map +1 -1
- package/dist/cjs/hooks.cjs +5 -1
- package/dist/cjs/hooks.native.js +7 -1
- package/dist/cjs/hooks.native.js.map +1 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.cjs +10 -7
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +13 -10
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.test.cjs +23 -0
- package/dist/cjs/metro-config/getViteMetroPluginOptions.test.native.js +26 -0
- package/dist/cjs/metro-config/getViteMetroPluginOptions.test.native.js.map +1 -0
- package/dist/cjs/router/Route.cjs +21 -1
- package/dist/cjs/router/Route.native.js +22 -1
- package/dist/cjs/router/Route.native.js.map +1 -1
- package/dist/cjs/router/interceptRoutes.cjs +6 -6
- package/dist/cjs/router/interceptRoutes.native.js +6 -6
- package/dist/cjs/router/interceptRoutes.native.js.map +1 -1
- package/dist/cjs/router/params.cjs +46 -0
- package/dist/cjs/router/params.native.js +70 -0
- package/dist/cjs/router/params.native.js.map +1 -0
- package/dist/cjs/router/useScreens.cjs +3 -0
- package/dist/cjs/router/useScreens.native.js +2 -0
- package/dist/cjs/router/useScreens.native.js.map +1 -1
- package/dist/cjs/serve-worker.native.js.map +1 -1
- package/dist/cjs/server/getServerManifest.cjs +6 -6
- package/dist/cjs/server/getServerManifest.native.js +6 -6
- package/dist/cjs/server/getServerManifest.native.js.map +1 -1
- package/dist/cjs/server/oneServe.cjs +9 -5
- package/dist/cjs/server/oneServe.native.js +9 -5
- package/dist/cjs/server/oneServe.native.js.map +1 -1
- package/dist/cjs/server/workerHandler.cjs +2 -2
- package/dist/cjs/server/workerHandler.native.js +2 -2
- package/dist/cjs/server/workerHandler.native.js.map +1 -1
- package/dist/cjs/skewProtection.cjs +48 -7
- package/dist/cjs/skewProtection.native.js +48 -7
- package/dist/cjs/skewProtection.native.js.map +1 -1
- package/dist/cjs/useLoader.cjs +67 -69
- package/dist/cjs/useLoader.native.js +113 -117
- package/dist/cjs/useLoader.native.js.map +1 -1
- package/dist/cjs/utils/dynamicImport.cjs +3 -1
- package/dist/cjs/utils/dynamicImport.native.js +22 -1
- package/dist/cjs/utils/dynamicImport.native.js.map +1 -1
- package/dist/cjs/utils/toAbsolute.cjs +5 -2
- package/dist/cjs/utils/toAbsolute.native.js +6 -1
- package/dist/cjs/utils/toAbsolute.native.js.map +1 -1
- package/dist/cjs/utils/workerImport.cjs +1 -1
- package/dist/cjs/utils/workerImport.native.js +1 -1
- package/dist/cjs/utils/workerImport.native.js.map +1 -1
- package/dist/cjs/views/RootErrorBoundary.cjs +114 -117
- package/dist/cjs/views/RootErrorBoundary.native.js +126 -146
- package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -1
- package/dist/cjs/views/Try.cjs +17 -18
- package/dist/cjs/views/Try.native.js +28 -42
- package/dist/cjs/views/Try.native.js.map +1 -1
- package/dist/cjs/vite/plugins/criticalCSSPlugin.cjs +2 -1
- package/dist/cjs/vite/plugins/criticalCSSPlugin.native.js +2 -1
- package/dist/cjs/vite/plugins/criticalCSSPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/criticalCSSPlugin.test.cjs +26 -20
- package/dist/cjs/vite/plugins/criticalCSSPlugin.test.native.js +28 -20
- package/dist/cjs/vite/plugins/criticalCSSPlugin.test.native.js.map +1 -1
- package/dist/cjs/vite/plugins/imageDataPlugin.cjs +3 -2
- package/dist/cjs/vite/plugins/imageDataPlugin.native.js +3 -2
- package/dist/cjs/vite/plugins/imageDataPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/imageDataPlugin.test.cjs +34 -69
- package/dist/cjs/vite/plugins/imageDataPlugin.test.native.js +34 -69
- package/dist/cjs/vite/plugins/imageDataPlugin.test.native.js.map +1 -1
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.cjs +20 -2
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.native.js +23 -2
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.test.cjs +21 -0
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.test.native.js +28 -0
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.test.native.js.map +1 -0
- package/dist/cjs/vite/resolveResponse.cjs +7 -2
- package/dist/cjs/vite/resolveResponse.native.js +7 -2
- package/dist/cjs/vite/resolveResponse.native.js.map +1 -1
- package/dist/esm/cli/build.mjs +100 -60
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +108 -65
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.mjs +4 -4
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js +4 -4
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/constants.mjs +2 -1
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +2 -1
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/createAPIRoute.mjs.map +1 -1
- package/dist/esm/createAPIRoute.native.js.map +1 -1
- package/dist/esm/createApp.mjs +2 -6
- package/dist/esm/createApp.mjs.map +1 -1
- package/dist/esm/createHandleRequest.mjs +2 -2
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js +2 -2
- package/dist/esm/createHandleRequest.native.js.map +1 -1
- package/dist/esm/hooks.mjs +5 -1
- package/dist/esm/hooks.mjs.map +1 -1
- package/dist/esm/hooks.native.js +7 -1
- package/dist/esm/hooks.native.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs +9 -7
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +12 -10
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.test.mjs +24 -0
- package/dist/esm/metro-config/getViteMetroPluginOptions.test.mjs.map +1 -0
- package/dist/esm/metro-config/getViteMetroPluginOptions.test.native.js +24 -0
- package/dist/esm/metro-config/getViteMetroPluginOptions.test.native.js.map +1 -0
- package/dist/esm/router/Route.mjs +21 -1
- package/dist/esm/router/Route.mjs.map +1 -1
- package/dist/esm/router/Route.native.js +22 -1
- package/dist/esm/router/Route.native.js.map +1 -1
- package/dist/esm/router/interceptRoutes.mjs +7 -7
- package/dist/esm/router/interceptRoutes.mjs.map +1 -1
- package/dist/esm/router/interceptRoutes.native.js +7 -7
- package/dist/esm/router/interceptRoutes.native.js.map +1 -1
- package/dist/esm/router/params.mjs +21 -0
- package/dist/esm/router/params.mjs.map +1 -0
- package/dist/esm/router/params.native.js +42 -0
- package/dist/esm/router/params.native.js.map +1 -0
- package/dist/esm/router/useScreens.mjs +3 -0
- package/dist/esm/router/useScreens.mjs.map +1 -1
- package/dist/esm/router/useScreens.native.js +2 -0
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/dist/esm/serve-worker.mjs.map +1 -1
- package/dist/esm/serve-worker.native.js.map +1 -1
- package/dist/esm/server/getServerManifest.mjs +6 -6
- package/dist/esm/server/getServerManifest.mjs.map +1 -1
- package/dist/esm/server/getServerManifest.native.js +6 -6
- package/dist/esm/server/getServerManifest.native.js.map +1 -1
- package/dist/esm/server/oneServe.mjs +11 -7
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js +11 -7
- package/dist/esm/server/oneServe.native.js.map +1 -1
- package/dist/esm/server/workerHandler.mjs +2 -2
- package/dist/esm/server/workerHandler.mjs.map +1 -1
- package/dist/esm/server/workerHandler.native.js +2 -2
- package/dist/esm/server/workerHandler.native.js.map +1 -1
- package/dist/esm/skewProtection.mjs +48 -8
- package/dist/esm/skewProtection.mjs.map +1 -1
- package/dist/esm/skewProtection.native.js +48 -8
- package/dist/esm/skewProtection.native.js.map +1 -1
- package/dist/esm/useLoader.mjs +64 -66
- package/dist/esm/useLoader.mjs.map +1 -1
- package/dist/esm/useLoader.native.js +112 -116
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/utils/dynamicImport.mjs +1 -1
- package/dist/esm/utils/dynamicImport.mjs.map +1 -1
- package/dist/esm/utils/dynamicImport.native.js +20 -1
- package/dist/esm/utils/dynamicImport.native.js.map +1 -1
- package/dist/esm/utils/toAbsolute.mjs +3 -1
- package/dist/esm/utils/toAbsolute.mjs.map +1 -1
- package/dist/esm/utils/toAbsolute.native.js +5 -1
- package/dist/esm/utils/toAbsolute.native.js.map +1 -1
- package/dist/esm/utils/workerImport.mjs +2 -2
- package/dist/esm/utils/workerImport.mjs.map +1 -1
- package/dist/esm/utils/workerImport.native.js +2 -2
- package/dist/esm/utils/workerImport.native.js.map +1 -1
- package/dist/esm/views/RootErrorBoundary.mjs +114 -117
- package/dist/esm/views/RootErrorBoundary.mjs.map +1 -1
- package/dist/esm/views/RootErrorBoundary.native.js +126 -146
- package/dist/esm/views/RootErrorBoundary.native.js.map +1 -1
- package/dist/esm/views/Try.mjs +17 -18
- package/dist/esm/views/Try.mjs.map +1 -1
- package/dist/esm/views/Try.native.js +28 -42
- package/dist/esm/views/Try.native.js.map +1 -1
- package/dist/esm/vite/plugins/criticalCSSPlugin.mjs +2 -1
- package/dist/esm/vite/plugins/criticalCSSPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/criticalCSSPlugin.native.js +2 -1
- package/dist/esm/vite/plugins/criticalCSSPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/criticalCSSPlugin.test.mjs +26 -20
- package/dist/esm/vite/plugins/criticalCSSPlugin.test.mjs.map +1 -1
- package/dist/esm/vite/plugins/criticalCSSPlugin.test.native.js +28 -20
- package/dist/esm/vite/plugins/criticalCSSPlugin.test.native.js.map +1 -1
- package/dist/esm/vite/plugins/imageDataPlugin.mjs +4 -3
- package/dist/esm/vite/plugins/imageDataPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/imageDataPlugin.native.js +4 -3
- package/dist/esm/vite/plugins/imageDataPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/imageDataPlugin.test.mjs +34 -69
- package/dist/esm/vite/plugins/imageDataPlugin.test.mjs.map +1 -1
- package/dist/esm/vite/plugins/imageDataPlugin.test.native.js +34 -69
- package/dist/esm/vite/plugins/imageDataPlugin.test.native.js.map +1 -1
- package/dist/esm/vite/plugins/sourceInspectorPlugin.mjs +19 -3
- package/dist/esm/vite/plugins/sourceInspectorPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/sourceInspectorPlugin.native.js +22 -3
- package/dist/esm/vite/plugins/sourceInspectorPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/sourceInspectorPlugin.test.mjs +22 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.test.mjs.map +1 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.test.native.js +26 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.test.native.js.map +1 -0
- package/dist/esm/vite/resolveResponse.mjs +7 -2
- package/dist/esm/vite/resolveResponse.mjs.map +1 -1
- package/dist/esm/vite/resolveResponse.native.js +7 -2
- package/dist/esm/vite/resolveResponse.native.js.map +1 -1
- package/expo-plugin.cjs +1 -0
- package/package.json +15 -10
- package/react-native-commands.cjs +1 -0
- package/src/cli/build.ts +156 -99
- package/src/cli/buildPage.ts +4 -4
- package/src/constants.ts +15 -0
- package/src/createAPIRoute.ts +35 -2
- package/src/createApp.tsx +2 -6
- package/src/createHandleRequest.ts +6 -2
- package/src/hooks.tsx +9 -1
- package/src/index.ts +8 -1
- package/src/metro-config/getViteMetroPluginOptions.test.ts +34 -0
- package/src/metro-config/getViteMetroPluginOptions.ts +14 -11
- package/src/router/Route.tsx +52 -2
- package/src/router/interceptRoutes.ts +7 -7
- package/src/router/params.ts +32 -0
- package/src/router/useScreens.tsx +18 -0
- package/src/serve-worker.ts +4 -2
- package/src/server/getServerManifest.ts +11 -7
- package/src/server/oneServe.ts +12 -14
- package/src/server/workerHandler.ts +13 -2
- package/src/skewProtection.ts +45 -5
- package/src/useLoader.ts +6 -4
- package/src/utils/dynamicImport.ts +2 -2
- package/src/utils/toAbsolute.ts +5 -0
- package/src/utils/workerImport.ts +2 -2
- package/src/views/RootErrorBoundary.tsx +18 -0
- package/src/views/Try.tsx +18 -0
- package/src/vite/plugins/criticalCSSPlugin.test.ts +34 -24
- package/src/vite/plugins/criticalCSSPlugin.ts +3 -2
- package/src/vite/plugins/imageDataPlugin.test.ts +39 -83
- package/src/vite/plugins/imageDataPlugin.ts +5 -4
- package/src/vite/plugins/sourceInspectorPlugin.test.ts +40 -0
- package/src/vite/plugins/sourceInspectorPlugin.ts +30 -2
- package/src/vite/resolveResponse.ts +6 -2
- package/types/cli/build.d.ts.map +1 -1
- package/types/constants.d.ts +9 -0
- package/types/constants.d.ts.map +1 -1
- package/types/createAPIRoute.d.ts +28 -3
- package/types/createAPIRoute.d.ts.map +1 -1
- package/types/createApp.d.ts.map +1 -1
- package/types/createHandleRequest.d.ts +1 -1
- package/types/createHandleRequest.d.ts.map +1 -1
- package/types/headless-server.d.ts +1 -1
- package/types/hooks.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/metro-config/getViteMetroPluginOptions.d.ts +5 -0
- package/types/metro-config/getViteMetroPluginOptions.d.ts.map +1 -1
- package/types/metro-config/getViteMetroPluginOptions.test.d.ts +2 -0
- package/types/metro-config/getViteMetroPluginOptions.test.d.ts.map +1 -0
- package/types/router/Route.d.ts +1 -0
- package/types/router/Route.d.ts.map +1 -1
- package/types/router/params.d.ts +3 -0
- package/types/router/params.d.ts.map +1 -0
- package/types/router/useScreens.d.ts.map +1 -1
- package/types/serve-worker.d.ts +5 -3
- package/types/serve-worker.d.ts.map +1 -1
- package/types/server/getServerManifest.d.ts.map +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/server/workerHandler.d.ts +1 -1
- package/types/server/workerHandler.d.ts.map +1 -1
- package/types/skewProtection.d.ts +1 -0
- package/types/skewProtection.d.ts.map +1 -1
- package/types/useLoader.d.ts.map +1 -1
- package/types/utils/dynamicImport.d.ts +2 -0
- package/types/utils/dynamicImport.d.ts.map +1 -1
- package/types/utils/toAbsolute.d.ts +3 -0
- package/types/utils/toAbsolute.d.ts.map +1 -1
- package/types/views/RootErrorBoundary.d.ts.map +1 -1
- package/types/views/Try.d.ts.map +1 -1
- package/types/vite/plugins/criticalCSSPlugin.d.ts.map +1 -1
- package/types/vite/plugins/imageDataPlugin.d.ts.map +1 -1
- package/types/vite/plugins/sourceInspectorPlugin.d.ts +2 -0
- package/types/vite/plugins/sourceInspectorPlugin.d.ts.map +1 -1
- package/types/vite/plugins/sourceInspectorPlugin.test.d.ts +2 -0
- package/types/vite/plugins/sourceInspectorPlugin.test.d.ts.map +1 -0
- package/types/vite/resolveResponse.d.ts +1 -1
- 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 (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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.
|
|
108
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
|
|
103
109
|
style: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
153
|
-
|
|
171
|
+
fontWeight: 500,
|
|
172
|
+
cursor: "pointer"
|
|
154
173
|
},
|
|
155
|
-
children:
|
|
156
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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: "
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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.
|
|
192
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
|
|
204
193
|
style: {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
254
|
-
|
|
255
|
+
fontWeight: 500,
|
|
256
|
+
cursor: "pointer"
|
|
255
257
|
},
|
|
256
|
-
children:
|
|
257
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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: "
|
|
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,
|