@xyo-network/react-error 2.64.0 → 2.64.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/components/ErrorBoundary/ThrownErrorBoundary.js +52 -6
- package/dist/browser/components/ErrorBoundary/ThrownErrorBoundary.js.map +1 -1
- package/dist/browser/components/ErrorBoundary/index.js +84 -1
- package/dist/browser/components/ErrorBoundary/index.js.map +1 -1
- package/dist/browser/components/ErrorRender/ErrorAlert.js +3 -2
- package/dist/browser/components/ErrorRender/ErrorAlert.js.map +1 -1
- package/dist/browser/components/ErrorRender/Render.js +22 -5
- package/dist/browser/components/ErrorRender/Render.js.map +1 -1
- package/dist/browser/components/ErrorRender/index.js +47 -3
- package/dist/browser/components/ErrorRender/index.js.map +1 -1
- package/dist/browser/components/index.js +86 -2
- package/dist/browser/components/index.js.map +1 -1
- package/dist/browser/contexts/ErrorReporter/Context.js +2 -1
- package/dist/browser/contexts/ErrorReporter/Context.js.map +1 -1
- package/dist/browser/contexts/ErrorReporter/Provider.js +9 -3
- package/dist/browser/contexts/ErrorReporter/Provider.js.map +1 -1
- package/dist/browser/contexts/ErrorReporter/index.js +32 -3
- package/dist/browser/contexts/ErrorReporter/index.js.map +1 -1
- package/dist/browser/contexts/ErrorReporter/useRollbar.js +8 -2
- package/dist/browser/contexts/ErrorReporter/useRollbar.js.map +1 -1
- package/dist/browser/contexts/index.js +32 -1
- package/dist/browser/contexts/index.js.map +1 -1
- package/dist/browser/index.js +117 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/docs.json +44 -44
- package/package.json +7 -7
@@ -1,13 +1,59 @@
|
|
1
|
-
|
1
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
2
2
|
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
3
3
|
import { Component } from "react";
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
6
|
+
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
7
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
8
|
+
import { ButtonEx } from "@xylabs/react-button";
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
10
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
11
|
+
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
12
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
13
|
+
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
14
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }),
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: error?.message }),
|
16
|
+
onCancel ? /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: /* @__PURE__ */ jsx(ExitIcon, { fontSize: "small" }) }) : null
|
17
|
+
] });
|
18
|
+
};
|
19
|
+
|
20
|
+
// src/components/ErrorRender/Render.tsx
|
21
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
22
|
+
import { useEffect } from "react";
|
23
|
+
import { useLocation } from "react-router-dom";
|
24
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
25
|
+
var ErrorRender = ({
|
26
|
+
onCancel,
|
27
|
+
error,
|
28
|
+
noErrorDisplay = false,
|
29
|
+
customError = null,
|
30
|
+
children,
|
31
|
+
errorContext,
|
32
|
+
...props
|
33
|
+
}) => {
|
34
|
+
const location = useLocation();
|
35
|
+
useEffect(() => {
|
36
|
+
location.state = {
|
37
|
+
from: {
|
38
|
+
pathname: window.location.pathname
|
39
|
+
}
|
40
|
+
};
|
41
|
+
}, [location]);
|
42
|
+
if (error) {
|
43
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? customError : /* @__PURE__ */ jsx2(FlexCol, { alignItems: "center", ...props, children: /* @__PURE__ */ jsx2(ErrorAlert, { error, errorContext, onCancel }) }) });
|
44
|
+
} else {
|
45
|
+
return /* @__PURE__ */ jsx2(Fragment, { children }) ?? null;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
50
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
51
|
+
var ThrownErrorBoundary = class _ThrownErrorBoundary extends Component {
|
6
52
|
state = {
|
7
53
|
xyoError: void 0
|
8
54
|
};
|
9
55
|
static getDerivedStateFromError(error) {
|
10
|
-
return { hasError: true, xyoError:
|
56
|
+
return { hasError: true, xyoError: _ThrownErrorBoundary.normalizeError(error) };
|
11
57
|
}
|
12
58
|
static normalizeError(error) {
|
13
59
|
return error.schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] };
|
@@ -28,11 +74,11 @@ class ThrownErrorBoundary extends Component {
|
|
28
74
|
if (errorComponent) {
|
29
75
|
return errorComponent(xyoError);
|
30
76
|
}
|
31
|
-
return /* @__PURE__ */
|
77
|
+
return /* @__PURE__ */ jsx3(ErrorRender, { error: xyoError, errorContext: `${boundaryName} Boundary` });
|
32
78
|
}
|
33
79
|
return children;
|
34
80
|
}
|
35
|
-
}
|
81
|
+
};
|
36
82
|
export {
|
37
83
|
ThrownErrorBoundary
|
38
84
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx"],"sourcesContent":["import { ModuleError, ModuleErrorSchema } from '@xyo-network/payload-model'\nimport { Component, ErrorInfo, ReactNode } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorRender } from '../ErrorRender'\n\nexport interface ThrownErrorBoundaryProps {\n boundaryName?: string\n children: ReactNode\n errorComponent?: (e: ModuleError, boundaryName?: string) => ReactNode\n rethrow?: boolean\n rollbar?: Rollbar\n}\n\nexport interface ThrownErrorBoundaryState {\n xyoError?: ModuleError\n}\n\nexport class ThrownErrorBoundary extends Component<ThrownErrorBoundaryProps, ThrownErrorBoundaryState> {\n public override state: ThrownErrorBoundaryState = {\n xyoError: undefined,\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) } as ThrownErrorBoundaryState\n }\n\n public static normalizeError(error: Error | ModuleError): ModuleError {\n return (\n (error as ModuleError).schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] }\n ) as ModuleError\n }\n\n public override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n const { rethrow, rollbar } = this.props\n const { xyoError } = this.state\n\n rollbar?.error(error)\n\n console.error('Error:', xyoError, errorInfo)\n if (rethrow) {\n throw error\n }\n }\n\n public override render() {\n const { xyoError } = this.state\n const { children, boundaryName, errorComponent } = this.props\n if (xyoError) {\n if (errorComponent) {\n return errorComponent(xyoError)\n }\n return <ErrorRender error={xyoError} errorContext={`${boundaryName} Boundary`} />\n }\n\n return children\n }\n}\n"],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx","../../../../src/components/ErrorRender/ErrorAlert.tsx","../../../../src/components/ErrorRender/Render.tsx"],"sourcesContent":["import { ModuleError, ModuleErrorSchema } from '@xyo-network/payload-model'\nimport { Component, ErrorInfo, ReactNode } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorRender } from '../ErrorRender'\n\nexport interface ThrownErrorBoundaryProps {\n boundaryName?: string\n children: ReactNode\n errorComponent?: (e: ModuleError, boundaryName?: string) => ReactNode\n rethrow?: boolean\n rollbar?: Rollbar\n}\n\nexport interface ThrownErrorBoundaryState {\n xyoError?: ModuleError\n}\n\nexport class ThrownErrorBoundary extends Component<ThrownErrorBoundaryProps, ThrownErrorBoundaryState> {\n public override state: ThrownErrorBoundaryState = {\n xyoError: undefined,\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) } as ThrownErrorBoundaryState\n }\n\n public static normalizeError(error: Error | ModuleError): ModuleError {\n return (\n (error as ModuleError).schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] }\n ) as ModuleError\n }\n\n public override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n const { rethrow, rollbar } = this.props\n const { xyoError } = this.state\n\n rollbar?.error(error)\n\n console.error('Error:', xyoError, errorInfo)\n if (rethrow) {\n throw error\n }\n }\n\n public override render() {\n const { xyoError } = this.state\n const { children, boundaryName, errorComponent } = this.props\n if (xyoError) {\n if (errorComponent) {\n return errorComponent(xyoError)\n }\n return <ErrorRender error={xyoError} errorContext={`${boundaryName} Boundary`} />\n }\n\n return children\n }\n}\n","import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n"],"mappings":";AAAA,SAAsB,yBAAyB;AAC/C,SAAS,iBAAuC;;;ACDhD,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;;;AC/BA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AA+BhB,SAMD,UANC,OAAAA,YAAA;AA1BL,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY;AAC7B,YAAU,MAAM;AAEd,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,QACJ,UAAU,OAAO,SAAS;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,OAAO;AACT,WACE,gBAAAA,KAAC,WAAQ,YAAW,WAAW,GAAG,OAC/B,2BACC,cAEA,gBAAAA,KAAC,WAAQ,YAAW,UAAU,GAAG,OAC/B,0BAAAA,KAAC,cAAW,OAAc,cAA4B,UAAoB,GAC5E,GAEJ;AAAA,EAEJ,OAAO;AACL,WAAO,gBAAAA,KAAA,YAAG,UAAS,KAAO;AAAA,EAC5B;AACF;;;AFWa,gBAAAC,YAAA;AAlCN,IAAM,sBAAN,MAAM,6BAA4B,UAA8D;AAAA,EACrF,QAAkC;AAAA,IAChD,UAAU;AAAA,EACZ;AAAA,EAEA,OAAO,yBAAyB,OAAc;AAC5C,WAAO,EAAE,UAAU,MAAM,UAAU,qBAAoB,eAAe,KAAK,EAAE;AAAA,EAC/E;AAAA,EAEA,OAAc,eAAe,OAAyC;AACpE,WACG,MAAsB,WAAW,oBAAoB,QAAQ,EAAE,SAAS,MAAM,SAAS,QAAQ,mBAAmB,SAAS,CAAC,EAAE;AAAA,EAEnI;AAAA,EAEgB,kBAAkB,OAAc,WAAsB;AACpE,UAAM,EAAE,SAAS,QAAQ,IAAI,KAAK;AAClC,UAAM,EAAE,SAAS,IAAI,KAAK;AAE1B,aAAS,MAAM,KAAK;AAEpB,YAAQ,MAAM,UAAU,UAAU,SAAS;AAC3C,QAAI,SAAS;AACX,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEgB,SAAS;AACvB,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,UAAU,cAAc,eAAe,IAAI,KAAK;AACxD,QAAI,UAAU;AACZ,UAAI,gBAAgB;AAClB,eAAO,eAAe,QAAQ;AAAA,MAChC;AACA,aAAO,gBAAAA,KAAC,eAAY,OAAO,UAAU,cAAc,GAAG,YAAY,aAAa;AAAA,IACjF;AAEA,WAAO;AAAA,EACT;AACF;","names":["jsx","jsx"]}
|
@@ -1,2 +1,85 @@
|
|
1
|
-
|
1
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
2
|
+
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
3
|
+
import { Component } from "react";
|
4
|
+
|
5
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
6
|
+
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
7
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
8
|
+
import { ButtonEx } from "@xylabs/react-button";
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
10
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
11
|
+
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
12
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
13
|
+
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
14
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }),
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: error?.message }),
|
16
|
+
onCancel ? /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: /* @__PURE__ */ jsx(ExitIcon, { fontSize: "small" }) }) : null
|
17
|
+
] });
|
18
|
+
};
|
19
|
+
|
20
|
+
// src/components/ErrorRender/Render.tsx
|
21
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
22
|
+
import { useEffect } from "react";
|
23
|
+
import { useLocation } from "react-router-dom";
|
24
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
25
|
+
var ErrorRender = ({
|
26
|
+
onCancel,
|
27
|
+
error,
|
28
|
+
noErrorDisplay = false,
|
29
|
+
customError = null,
|
30
|
+
children,
|
31
|
+
errorContext,
|
32
|
+
...props
|
33
|
+
}) => {
|
34
|
+
const location = useLocation();
|
35
|
+
useEffect(() => {
|
36
|
+
location.state = {
|
37
|
+
from: {
|
38
|
+
pathname: window.location.pathname
|
39
|
+
}
|
40
|
+
};
|
41
|
+
}, [location]);
|
42
|
+
if (error) {
|
43
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? customError : /* @__PURE__ */ jsx2(FlexCol, { alignItems: "center", ...props, children: /* @__PURE__ */ jsx2(ErrorAlert, { error, errorContext, onCancel }) }) });
|
44
|
+
} else {
|
45
|
+
return /* @__PURE__ */ jsx2(Fragment, { children }) ?? null;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
50
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
51
|
+
var ThrownErrorBoundary = class _ThrownErrorBoundary extends Component {
|
52
|
+
state = {
|
53
|
+
xyoError: void 0
|
54
|
+
};
|
55
|
+
static getDerivedStateFromError(error) {
|
56
|
+
return { hasError: true, xyoError: _ThrownErrorBoundary.normalizeError(error) };
|
57
|
+
}
|
58
|
+
static normalizeError(error) {
|
59
|
+
return error.schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] };
|
60
|
+
}
|
61
|
+
componentDidCatch(error, errorInfo) {
|
62
|
+
const { rethrow, rollbar } = this.props;
|
63
|
+
const { xyoError } = this.state;
|
64
|
+
rollbar?.error(error);
|
65
|
+
console.error("Error:", xyoError, errorInfo);
|
66
|
+
if (rethrow) {
|
67
|
+
throw error;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
render() {
|
71
|
+
const { xyoError } = this.state;
|
72
|
+
const { children, boundaryName, errorComponent } = this.props;
|
73
|
+
if (xyoError) {
|
74
|
+
if (errorComponent) {
|
75
|
+
return errorComponent(xyoError);
|
76
|
+
}
|
77
|
+
return /* @__PURE__ */ jsx3(ErrorRender, { error: xyoError, errorContext: `${boundaryName} Boundary` });
|
78
|
+
}
|
79
|
+
return children;
|
80
|
+
}
|
81
|
+
};
|
82
|
+
export {
|
83
|
+
ThrownErrorBoundary
|
84
|
+
};
|
2
85
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ErrorBoundary/
|
1
|
+
{"version":3,"sources":["../../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx","../../../../src/components/ErrorRender/ErrorAlert.tsx","../../../../src/components/ErrorRender/Render.tsx"],"sourcesContent":["import { ModuleError, ModuleErrorSchema } from '@xyo-network/payload-model'\nimport { Component, ErrorInfo, ReactNode } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorRender } from '../ErrorRender'\n\nexport interface ThrownErrorBoundaryProps {\n boundaryName?: string\n children: ReactNode\n errorComponent?: (e: ModuleError, boundaryName?: string) => ReactNode\n rethrow?: boolean\n rollbar?: Rollbar\n}\n\nexport interface ThrownErrorBoundaryState {\n xyoError?: ModuleError\n}\n\nexport class ThrownErrorBoundary extends Component<ThrownErrorBoundaryProps, ThrownErrorBoundaryState> {\n public override state: ThrownErrorBoundaryState = {\n xyoError: undefined,\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) } as ThrownErrorBoundaryState\n }\n\n public static normalizeError(error: Error | ModuleError): ModuleError {\n return (\n (error as ModuleError).schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] }\n ) as ModuleError\n }\n\n public override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n const { rethrow, rollbar } = this.props\n const { xyoError } = this.state\n\n rollbar?.error(error)\n\n console.error('Error:', xyoError, errorInfo)\n if (rethrow) {\n throw error\n }\n }\n\n public override render() {\n const { xyoError } = this.state\n const { children, boundaryName, errorComponent } = this.props\n if (xyoError) {\n if (errorComponent) {\n return errorComponent(xyoError)\n }\n return <ErrorRender error={xyoError} errorContext={`${boundaryName} Boundary`} />\n }\n\n return children\n }\n}\n","import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n"],"mappings":";AAAA,SAAsB,yBAAyB;AAC/C,SAAS,iBAAuC;;;ACDhD,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;;;AC/BA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AA+BhB,SAMD,UANC,OAAAA,YAAA;AA1BL,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY;AAC7B,YAAU,MAAM;AAEd,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,QACJ,UAAU,OAAO,SAAS;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,OAAO;AACT,WACE,gBAAAA,KAAC,WAAQ,YAAW,WAAW,GAAG,OAC/B,2BACC,cAEA,gBAAAA,KAAC,WAAQ,YAAW,UAAU,GAAG,OAC/B,0BAAAA,KAAC,cAAW,OAAc,cAA4B,UAAoB,GAC5E,GAEJ;AAAA,EAEJ,OAAO;AACL,WAAO,gBAAAA,KAAA,YAAG,UAAS,KAAO;AAAA,EAC5B;AACF;;;AFWa,gBAAAC,YAAA;AAlCN,IAAM,sBAAN,MAAM,6BAA4B,UAA8D;AAAA,EACrF,QAAkC;AAAA,IAChD,UAAU;AAAA,EACZ;AAAA,EAEA,OAAO,yBAAyB,OAAc;AAC5C,WAAO,EAAE,UAAU,MAAM,UAAU,qBAAoB,eAAe,KAAK,EAAE;AAAA,EAC/E;AAAA,EAEA,OAAc,eAAe,OAAyC;AACpE,WACG,MAAsB,WAAW,oBAAoB,QAAQ,EAAE,SAAS,MAAM,SAAS,QAAQ,mBAAmB,SAAS,CAAC,EAAE;AAAA,EAEnI;AAAA,EAEgB,kBAAkB,OAAc,WAAsB;AACpE,UAAM,EAAE,SAAS,QAAQ,IAAI,KAAK;AAClC,UAAM,EAAE,SAAS,IAAI,KAAK;AAE1B,aAAS,MAAM,KAAK;AAEpB,YAAQ,MAAM,UAAU,UAAU,SAAS;AAC3C,QAAI,SAAS;AACX,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEgB,SAAS;AACvB,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,UAAU,cAAc,eAAe,IAAI,KAAK;AACxD,QAAI,UAAU;AACZ,UAAI,gBAAgB;AAClB,eAAO,eAAe,QAAQ;AAAA,MAChC;AACA,aAAO,gBAAAA,KAAC,eAAY,OAAO,UAAU,cAAc,GAAG,YAAY,aAAa;AAAA,IACjF;AAEA,WAAO;AAAA,EACT;AACF;","names":["jsx","jsx"]}
|
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
2
2
|
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
3
3
|
import { Alert, AlertTitle, Typography } from "@mui/material";
|
4
4
|
import { ButtonEx } from "@xylabs/react-button";
|
5
|
-
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
6
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
6
7
|
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
7
8
|
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
8
9
|
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx"],"sourcesContent":["import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n"],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx"],"sourcesContent":["import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n"],"mappings":";AAAA,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;","names":[]}
|
@@ -1,9 +1,26 @@
|
|
1
|
-
|
1
|
+
// src/components/ErrorRender/Render.tsx
|
2
2
|
import { FlexCol } from "@xylabs/react-flexbox";
|
3
3
|
import { useEffect } from "react";
|
4
4
|
import { useLocation } from "react-router-dom";
|
5
|
-
|
6
|
-
|
5
|
+
|
6
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
7
|
+
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
8
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
9
|
+
import { ButtonEx } from "@xylabs/react-button";
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
11
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
12
|
+
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
13
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
14
|
+
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }),
|
16
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: error?.message }),
|
17
|
+
onCancel ? /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: /* @__PURE__ */ jsx(ExitIcon, { fontSize: "small" }) }) : null
|
18
|
+
] });
|
19
|
+
};
|
20
|
+
|
21
|
+
// src/components/ErrorRender/Render.tsx
|
22
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
23
|
+
var ErrorRender = ({
|
7
24
|
onCancel,
|
8
25
|
error,
|
9
26
|
noErrorDisplay = false,
|
@@ -21,9 +38,9 @@ const ErrorRender = ({
|
|
21
38
|
};
|
22
39
|
}, [location]);
|
23
40
|
if (error) {
|
24
|
-
return /* @__PURE__ */
|
41
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? customError : /* @__PURE__ */ jsx2(FlexCol, { alignItems: "center", ...props, children: /* @__PURE__ */ jsx2(ErrorAlert, { error, errorContext, onCancel }) }) });
|
25
42
|
} else {
|
26
|
-
return /* @__PURE__ */
|
43
|
+
return /* @__PURE__ */ jsx2(Fragment, { children }) ?? null;
|
27
44
|
}
|
28
45
|
};
|
29
46
|
export {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ErrorRender/Render.tsx"],"sourcesContent":["import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n"],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../../src/components/ErrorRender/Render.tsx","../../../../src/components/ErrorRender/ErrorAlert.tsx"],"sourcesContent":["import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n","import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;;;ACF5B,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;;;ADEY,SAMD,UANC,OAAAA,YAAA;AA1BL,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY;AAC7B,YAAU,MAAM;AAEd,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,QACJ,UAAU,OAAO,SAAS;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,OAAO;AACT,WACE,gBAAAA,KAAC,WAAQ,YAAW,WAAW,GAAG,OAC/B,2BACC,cAEA,gBAAAA,KAAC,WAAQ,YAAW,UAAU,GAAG,OAC/B,0BAAAA,KAAC,cAAW,OAAc,cAA4B,UAAoB,GAC5E,GAEJ;AAAA,EAEJ,OAAO;AACL,WAAO,gBAAAA,KAAA,YAAG,UAAS,KAAO;AAAA,EAC5B;AACF;","names":["jsx"]}
|
@@ -1,4 +1,48 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
2
|
+
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
3
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
4
|
+
import { ButtonEx } from "@xylabs/react-button";
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
6
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
7
|
+
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
8
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
9
|
+
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
10
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }),
|
11
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: error?.message }),
|
12
|
+
onCancel ? /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: /* @__PURE__ */ jsx(ExitIcon, { fontSize: "small" }) }) : null
|
13
|
+
] });
|
14
|
+
};
|
15
|
+
|
16
|
+
// src/components/ErrorRender/Render.tsx
|
17
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
18
|
+
import { useEffect } from "react";
|
19
|
+
import { useLocation } from "react-router-dom";
|
20
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
21
|
+
var ErrorRender = ({
|
22
|
+
onCancel,
|
23
|
+
error,
|
24
|
+
noErrorDisplay = false,
|
25
|
+
customError = null,
|
26
|
+
children,
|
27
|
+
errorContext,
|
28
|
+
...props
|
29
|
+
}) => {
|
30
|
+
const location = useLocation();
|
31
|
+
useEffect(() => {
|
32
|
+
location.state = {
|
33
|
+
from: {
|
34
|
+
pathname: window.location.pathname
|
35
|
+
}
|
36
|
+
};
|
37
|
+
}, [location]);
|
38
|
+
if (error) {
|
39
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? customError : /* @__PURE__ */ jsx2(FlexCol, { alignItems: "center", ...props, children: /* @__PURE__ */ jsx2(ErrorAlert, { error, errorContext, onCancel }) }) });
|
40
|
+
} else {
|
41
|
+
return /* @__PURE__ */ jsx2(Fragment, { children }) ?? null;
|
42
|
+
}
|
43
|
+
};
|
44
|
+
export {
|
45
|
+
ErrorAlert,
|
46
|
+
ErrorRender
|
47
|
+
};
|
4
48
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ErrorRender/
|
1
|
+
{"version":3,"sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx","../../../../src/components/ErrorRender/Render.tsx"],"sourcesContent":["import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n"],"mappings":";AAAA,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;;;AC/BA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AA+BhB,SAMD,UANC,OAAAA,YAAA;AA1BL,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY;AAC7B,YAAU,MAAM;AAEd,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,QACJ,UAAU,OAAO,SAAS;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,OAAO;AACT,WACE,gBAAAA,KAAC,WAAQ,YAAW,WAAW,GAAG,OAC/B,2BACC,cAEA,gBAAAA,KAAC,WAAQ,YAAW,UAAU,GAAG,OAC/B,0BAAAA,KAAC,cAAW,OAAc,cAA4B,UAAoB,GAC5E,GAEJ;AAAA,EAEJ,OAAO;AACL,WAAO,gBAAAA,KAAA,YAAG,UAAS,KAAO;AAAA,EAC5B;AACF;","names":["jsx"]}
|
@@ -1,3 +1,87 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
2
|
+
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
3
|
+
import { Component } from "react";
|
4
|
+
|
5
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
6
|
+
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
7
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
8
|
+
import { ButtonEx } from "@xylabs/react-button";
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
10
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
11
|
+
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
12
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
13
|
+
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
14
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }),
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: error?.message }),
|
16
|
+
onCancel ? /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: /* @__PURE__ */ jsx(ExitIcon, { fontSize: "small" }) }) : null
|
17
|
+
] });
|
18
|
+
};
|
19
|
+
|
20
|
+
// src/components/ErrorRender/Render.tsx
|
21
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
22
|
+
import { useEffect } from "react";
|
23
|
+
import { useLocation } from "react-router-dom";
|
24
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
25
|
+
var ErrorRender = ({
|
26
|
+
onCancel,
|
27
|
+
error,
|
28
|
+
noErrorDisplay = false,
|
29
|
+
customError = null,
|
30
|
+
children,
|
31
|
+
errorContext,
|
32
|
+
...props
|
33
|
+
}) => {
|
34
|
+
const location = useLocation();
|
35
|
+
useEffect(() => {
|
36
|
+
location.state = {
|
37
|
+
from: {
|
38
|
+
pathname: window.location.pathname
|
39
|
+
}
|
40
|
+
};
|
41
|
+
}, [location]);
|
42
|
+
if (error) {
|
43
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? customError : /* @__PURE__ */ jsx2(FlexCol, { alignItems: "center", ...props, children: /* @__PURE__ */ jsx2(ErrorAlert, { error, errorContext, onCancel }) }) });
|
44
|
+
} else {
|
45
|
+
return /* @__PURE__ */ jsx2(Fragment, { children }) ?? null;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
50
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
51
|
+
var ThrownErrorBoundary = class _ThrownErrorBoundary extends Component {
|
52
|
+
state = {
|
53
|
+
xyoError: void 0
|
54
|
+
};
|
55
|
+
static getDerivedStateFromError(error) {
|
56
|
+
return { hasError: true, xyoError: _ThrownErrorBoundary.normalizeError(error) };
|
57
|
+
}
|
58
|
+
static normalizeError(error) {
|
59
|
+
return error.schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] };
|
60
|
+
}
|
61
|
+
componentDidCatch(error, errorInfo) {
|
62
|
+
const { rethrow, rollbar } = this.props;
|
63
|
+
const { xyoError } = this.state;
|
64
|
+
rollbar?.error(error);
|
65
|
+
console.error("Error:", xyoError, errorInfo);
|
66
|
+
if (rethrow) {
|
67
|
+
throw error;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
render() {
|
71
|
+
const { xyoError } = this.state;
|
72
|
+
const { children, boundaryName, errorComponent } = this.props;
|
73
|
+
if (xyoError) {
|
74
|
+
if (errorComponent) {
|
75
|
+
return errorComponent(xyoError);
|
76
|
+
}
|
77
|
+
return /* @__PURE__ */ jsx3(ErrorRender, { error: xyoError, errorContext: `${boundaryName} Boundary` });
|
78
|
+
}
|
79
|
+
return children;
|
80
|
+
}
|
81
|
+
};
|
82
|
+
export {
|
83
|
+
ErrorAlert,
|
84
|
+
ErrorRender,
|
85
|
+
ThrownErrorBoundary
|
86
|
+
};
|
3
87
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/
|
1
|
+
{"version":3,"sources":["../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx","../../../src/components/ErrorRender/ErrorAlert.tsx","../../../src/components/ErrorRender/Render.tsx"],"sourcesContent":["import { ModuleError, ModuleErrorSchema } from '@xyo-network/payload-model'\nimport { Component, ErrorInfo, ReactNode } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorRender } from '../ErrorRender'\n\nexport interface ThrownErrorBoundaryProps {\n boundaryName?: string\n children: ReactNode\n errorComponent?: (e: ModuleError, boundaryName?: string) => ReactNode\n rethrow?: boolean\n rollbar?: Rollbar\n}\n\nexport interface ThrownErrorBoundaryState {\n xyoError?: ModuleError\n}\n\nexport class ThrownErrorBoundary extends Component<ThrownErrorBoundaryProps, ThrownErrorBoundaryState> {\n public override state: ThrownErrorBoundaryState = {\n xyoError: undefined,\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) } as ThrownErrorBoundaryState\n }\n\n public static normalizeError(error: Error | ModuleError): ModuleError {\n return (\n (error as ModuleError).schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] }\n ) as ModuleError\n }\n\n public override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n const { rethrow, rollbar } = this.props\n const { xyoError } = this.state\n\n rollbar?.error(error)\n\n console.error('Error:', xyoError, errorInfo)\n if (rethrow) {\n throw error\n }\n }\n\n public override render() {\n const { xyoError } = this.state\n const { children, boundaryName, errorComponent } = this.props\n if (xyoError) {\n if (errorComponent) {\n return errorComponent(xyoError)\n }\n return <ErrorRender error={xyoError} errorContext={`${boundaryName} Boundary`} />\n }\n\n return children\n }\n}\n","import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n"],"mappings":";AAAA,SAAsB,yBAAyB;AAC/C,SAAS,iBAAuC;;;ACDhD,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;;;AC/BA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AA+BhB,SAMD,UANC,OAAAA,YAAA;AA1BL,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY;AAC7B,YAAU,MAAM;AAEd,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,QACJ,UAAU,OAAO,SAAS;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,OAAO;AACT,WACE,gBAAAA,KAAC,WAAQ,YAAW,WAAW,GAAG,OAC/B,2BACC,cAEA,gBAAAA,KAAC,WAAQ,YAAW,UAAU,GAAG,OAC/B,0BAAAA,KAAC,cAAW,OAAc,cAA4B,UAAoB,GAC5E,GAEJ;AAAA,EAEJ,OAAO;AACL,WAAO,gBAAAA,KAAA,YAAG,UAAS,KAAO;AAAA,EAC5B;AACF;;;AFWa,gBAAAC,YAAA;AAlCN,IAAM,sBAAN,MAAM,6BAA4B,UAA8D;AAAA,EACrF,QAAkC;AAAA,IAChD,UAAU;AAAA,EACZ;AAAA,EAEA,OAAO,yBAAyB,OAAc;AAC5C,WAAO,EAAE,UAAU,MAAM,UAAU,qBAAoB,eAAe,KAAK,EAAE;AAAA,EAC/E;AAAA,EAEA,OAAc,eAAe,OAAyC;AACpE,WACG,MAAsB,WAAW,oBAAoB,QAAQ,EAAE,SAAS,MAAM,SAAS,QAAQ,mBAAmB,SAAS,CAAC,EAAE;AAAA,EAEnI;AAAA,EAEgB,kBAAkB,OAAc,WAAsB;AACpE,UAAM,EAAE,SAAS,QAAQ,IAAI,KAAK;AAClC,UAAM,EAAE,SAAS,IAAI,KAAK;AAE1B,aAAS,MAAM,KAAK;AAEpB,YAAQ,MAAM,UAAU,UAAU,SAAS;AAC3C,QAAI,SAAS;AACX,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEgB,SAAS;AACvB,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,UAAU,cAAc,eAAe,IAAI,KAAK;AACxD,QAAI,UAAU;AACZ,UAAI,gBAAgB;AAClB,eAAO,eAAe,QAAQ;AAAA,MAChC;AACA,aAAO,gBAAAA,KAAC,eAAY,OAAO,UAAU,cAAc,GAAG,YAAY,aAAa;AAAA,IACjF;AAEA,WAAO;AAAA,EACT;AACF;","names":["jsx","jsx"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/Context.ts"],"sourcesContent":["import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n"],"mappings":"AAAA,SAAS,qBAAqB;AAIvB,
|
1
|
+
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/Context.ts"],"sourcesContent":["import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n"],"mappings":";AAAA,SAAS,qBAAqB;AAIvB,IAAM,uBAAuB,cAAyC,CAAC,CAAC;","names":[]}
|
@@ -1,7 +1,13 @@
|
|
1
|
-
|
1
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
2
2
|
import { useEffect, useState } from "react";
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
// src/contexts/ErrorReporter/Context.ts
|
5
|
+
import { createContext } from "react";
|
6
|
+
var ErrorReporterContext = createContext({});
|
7
|
+
|
8
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
10
|
+
var ErrorReporterProvider = ({ children, rollbar }) => {
|
5
11
|
const [rollbarInstance, setRollBarInstance] = useState();
|
6
12
|
useEffect(() => {
|
7
13
|
if (rollbarInstance) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/Provider.tsx"],"sourcesContent":["import { WithChildren } from '@xylabs/react-shared'\nimport { useEffect, useState } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorReporterContext } from './Context'\n\nexport interface ErrorReporterProviderProps {\n rollbar: Rollbar\n}\n\nconst ErrorReporterProvider: React.FC<WithChildren<ErrorReporterProviderProps>> = ({ children, rollbar }) => {\n const [rollbarInstance, setRollBarInstance] = useState<Rollbar>()\n\n useEffect(() => {\n if (rollbarInstance) {\n setRollBarInstance(rollbarInstance)\n }\n }, [rollbar, rollbarInstance])\n\n return <ErrorReporterContext.Provider value={{ rollbar }}>{children}</ErrorReporterContext.Provider>\n}\n\nexport { ErrorReporterProvider }\n"],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/Provider.tsx","../../../../src/contexts/ErrorReporter/Context.ts"],"sourcesContent":["import { WithChildren } from '@xylabs/react-shared'\nimport { useEffect, useState } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorReporterContext } from './Context'\n\nexport interface ErrorReporterProviderProps {\n rollbar: Rollbar\n}\n\nconst ErrorReporterProvider: React.FC<WithChildren<ErrorReporterProviderProps>> = ({ children, rollbar }) => {\n const [rollbarInstance, setRollBarInstance] = useState<Rollbar>()\n\n useEffect(() => {\n if (rollbarInstance) {\n setRollBarInstance(rollbarInstance)\n }\n }, [rollbar, rollbarInstance])\n\n return <ErrorReporterContext.Provider value={{ rollbar }}>{children}</ErrorReporterContext.Provider>\n}\n\nexport { ErrorReporterProvider }\n","import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n"],"mappings":";AACA,SAAS,WAAW,gBAAgB;;;ACDpC,SAAS,qBAAqB;AAIvB,IAAM,uBAAuB,cAAyC,CAAC,CAAC;;;ADetE;AATT,IAAM,wBAA4E,CAAC,EAAE,UAAU,QAAQ,MAAM;AAC3G,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAkB;AAEhE,YAAU,MAAM;AACd,QAAI,iBAAiB;AACnB,yBAAmB,eAAe;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,SAAS,eAAe,CAAC;AAE7B,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,EAAE,QAAQ,GAAI,UAAS;AACtE;","names":[]}
|
@@ -1,4 +1,33 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
2
|
+
import { useEffect, useState } from "react";
|
3
|
+
|
4
|
+
// src/contexts/ErrorReporter/Context.ts
|
5
|
+
import { createContext } from "react";
|
6
|
+
var ErrorReporterContext = createContext({});
|
7
|
+
|
8
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
10
|
+
var ErrorReporterProvider = ({ children, rollbar }) => {
|
11
|
+
const [rollbarInstance, setRollBarInstance] = useState();
|
12
|
+
useEffect(() => {
|
13
|
+
if (rollbarInstance) {
|
14
|
+
setRollBarInstance(rollbarInstance);
|
15
|
+
}
|
16
|
+
}, [rollbar, rollbarInstance]);
|
17
|
+
return /* @__PURE__ */ jsx(ErrorReporterContext.Provider, { value: { rollbar }, children });
|
18
|
+
};
|
19
|
+
|
20
|
+
// src/contexts/ErrorReporter/useRollbar.tsx
|
21
|
+
import { useContext } from "react";
|
22
|
+
var useRollbar = () => {
|
23
|
+
const context = useContext(ErrorReporterContext);
|
24
|
+
if (context === void 0) {
|
25
|
+
console.warn("useRollbar must be used within a ErrorReporterContext");
|
26
|
+
}
|
27
|
+
return context ?? {};
|
28
|
+
};
|
29
|
+
export {
|
30
|
+
ErrorReporterProvider,
|
31
|
+
useRollbar
|
32
|
+
};
|
4
33
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/
|
1
|
+
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/Provider.tsx","../../../../src/contexts/ErrorReporter/Context.ts","../../../../src/contexts/ErrorReporter/useRollbar.tsx"],"sourcesContent":["import { WithChildren } from '@xylabs/react-shared'\nimport { useEffect, useState } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorReporterContext } from './Context'\n\nexport interface ErrorReporterProviderProps {\n rollbar: Rollbar\n}\n\nconst ErrorReporterProvider: React.FC<WithChildren<ErrorReporterProviderProps>> = ({ children, rollbar }) => {\n const [rollbarInstance, setRollBarInstance] = useState<Rollbar>()\n\n useEffect(() => {\n if (rollbarInstance) {\n setRollBarInstance(rollbarInstance)\n }\n }, [rollbar, rollbarInstance])\n\n return <ErrorReporterContext.Provider value={{ rollbar }}>{children}</ErrorReporterContext.Provider>\n}\n\nexport { ErrorReporterProvider }\n","import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n","import { useContext } from 'react'\n\nimport { ErrorReporterContext } from './Context'\n\nconst useRollbar = () => {\n const context = useContext(ErrorReporterContext)\n if (context === undefined) {\n console.warn('useRollbar must be used within a ErrorReporterContext')\n }\n\n return context ?? {}\n}\n\nexport { useRollbar }\n"],"mappings":";AACA,SAAS,WAAW,gBAAgB;;;ACDpC,SAAS,qBAAqB;AAIvB,IAAM,uBAAuB,cAAyC,CAAC,CAAC;;;ADetE;AATT,IAAM,wBAA4E,CAAC,EAAE,UAAU,QAAQ,MAAM;AAC3G,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAkB;AAEhE,YAAU,MAAM;AACd,QAAI,iBAAiB;AACnB,yBAAmB,eAAe;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,SAAS,eAAe,CAAC;AAE7B,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,EAAE,QAAQ,GAAI,UAAS;AACtE;;;AEpBA,SAAS,kBAAkB;AAI3B,IAAM,aAAa,MAAM;AACvB,QAAM,UAAU,WAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":[]}
|
@@ -1,6 +1,12 @@
|
|
1
|
+
// src/contexts/ErrorReporter/useRollbar.tsx
|
1
2
|
import { useContext } from "react";
|
2
|
-
|
3
|
-
|
3
|
+
|
4
|
+
// src/contexts/ErrorReporter/Context.ts
|
5
|
+
import { createContext } from "react";
|
6
|
+
var ErrorReporterContext = createContext({});
|
7
|
+
|
8
|
+
// src/contexts/ErrorReporter/useRollbar.tsx
|
9
|
+
var useRollbar = () => {
|
4
10
|
const context = useContext(ErrorReporterContext);
|
5
11
|
if (context === void 0) {
|
6
12
|
console.warn("useRollbar must be used within a ErrorReporterContext");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/useRollbar.tsx"],"sourcesContent":["import { useContext } from 'react'\n\nimport { ErrorReporterContext } from './Context'\n\nconst useRollbar = () => {\n const context = useContext(ErrorReporterContext)\n if (context === undefined) {\n console.warn('useRollbar must be used within a ErrorReporterContext')\n }\n\n return context ?? {}\n}\n\nexport { useRollbar }\n"],"mappings":"AAAA,SAAS,kBAAkB
|
1
|
+
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/useRollbar.tsx","../../../../src/contexts/ErrorReporter/Context.ts"],"sourcesContent":["import { useContext } from 'react'\n\nimport { ErrorReporterContext } from './Context'\n\nconst useRollbar = () => {\n const context = useContext(ErrorReporterContext)\n if (context === undefined) {\n console.warn('useRollbar must be used within a ErrorReporterContext')\n }\n\n return context ?? {}\n}\n\nexport { useRollbar }\n","import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n"],"mappings":";AAAA,SAAS,kBAAkB;;;ACA3B,SAAS,qBAAqB;AAIvB,IAAM,uBAAuB,cAAyC,CAAC,CAAC;;;ADA/E,IAAM,aAAa,MAAM;AACvB,QAAM,UAAU,WAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":[]}
|
@@ -1,2 +1,33 @@
|
|
1
|
-
|
1
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
2
|
+
import { useEffect, useState } from "react";
|
3
|
+
|
4
|
+
// src/contexts/ErrorReporter/Context.ts
|
5
|
+
import { createContext } from "react";
|
6
|
+
var ErrorReporterContext = createContext({});
|
7
|
+
|
8
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
10
|
+
var ErrorReporterProvider = ({ children, rollbar }) => {
|
11
|
+
const [rollbarInstance, setRollBarInstance] = useState();
|
12
|
+
useEffect(() => {
|
13
|
+
if (rollbarInstance) {
|
14
|
+
setRollBarInstance(rollbarInstance);
|
15
|
+
}
|
16
|
+
}, [rollbar, rollbarInstance]);
|
17
|
+
return /* @__PURE__ */ jsx(ErrorReporterContext.Provider, { value: { rollbar }, children });
|
18
|
+
};
|
19
|
+
|
20
|
+
// src/contexts/ErrorReporter/useRollbar.tsx
|
21
|
+
import { useContext } from "react";
|
22
|
+
var useRollbar = () => {
|
23
|
+
const context = useContext(ErrorReporterContext);
|
24
|
+
if (context === void 0) {
|
25
|
+
console.warn("useRollbar must be used within a ErrorReporterContext");
|
26
|
+
}
|
27
|
+
return context ?? {};
|
28
|
+
};
|
29
|
+
export {
|
30
|
+
ErrorReporterProvider,
|
31
|
+
useRollbar
|
32
|
+
};
|
2
33
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/contexts/
|
1
|
+
{"version":3,"sources":["../../../src/contexts/ErrorReporter/Provider.tsx","../../../src/contexts/ErrorReporter/Context.ts","../../../src/contexts/ErrorReporter/useRollbar.tsx"],"sourcesContent":["import { WithChildren } from '@xylabs/react-shared'\nimport { useEffect, useState } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorReporterContext } from './Context'\n\nexport interface ErrorReporterProviderProps {\n rollbar: Rollbar\n}\n\nconst ErrorReporterProvider: React.FC<WithChildren<ErrorReporterProviderProps>> = ({ children, rollbar }) => {\n const [rollbarInstance, setRollBarInstance] = useState<Rollbar>()\n\n useEffect(() => {\n if (rollbarInstance) {\n setRollBarInstance(rollbarInstance)\n }\n }, [rollbar, rollbarInstance])\n\n return <ErrorReporterContext.Provider value={{ rollbar }}>{children}</ErrorReporterContext.Provider>\n}\n\nexport { ErrorReporterProvider }\n","import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n","import { useContext } from 'react'\n\nimport { ErrorReporterContext } from './Context'\n\nconst useRollbar = () => {\n const context = useContext(ErrorReporterContext)\n if (context === undefined) {\n console.warn('useRollbar must be used within a ErrorReporterContext')\n }\n\n return context ?? {}\n}\n\nexport { useRollbar }\n"],"mappings":";AACA,SAAS,WAAW,gBAAgB;;;ACDpC,SAAS,qBAAqB;AAIvB,IAAM,uBAAuB,cAAyC,CAAC,CAAC;;;ADetE;AATT,IAAM,wBAA4E,CAAC,EAAE,UAAU,QAAQ,MAAM;AAC3G,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAkB;AAEhE,YAAU,MAAM;AACd,QAAI,iBAAiB;AACnB,yBAAmB,eAAe;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,SAAS,eAAe,CAAC;AAE7B,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,EAAE,QAAQ,GAAI,UAAS;AACtE;;;AEpBA,SAAS,kBAAkB;AAI3B,IAAM,aAAa,MAAM;AACvB,QAAM,UAAU,WAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":[]}
|
package/dist/browser/index.js
CHANGED
@@ -1,3 +1,118 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
2
|
+
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
3
|
+
import { Component } from "react";
|
4
|
+
|
5
|
+
// src/components/ErrorRender/ErrorAlert.tsx
|
6
|
+
import { ExitToApp as ExitIcon } from "@mui/icons-material";
|
7
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
8
|
+
import { ButtonEx } from "@xylabs/react-button";
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
10
|
+
var ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
11
|
+
return /* @__PURE__ */ jsxs(Alert, { severity: "error", ...props, children: [
|
12
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Whoops! Something went wrong" }),
|
13
|
+
errorContext ? /* @__PURE__ */ jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext }) : null,
|
14
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }),
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: error?.message }),
|
16
|
+
onCancel ? /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: /* @__PURE__ */ jsx(ExitIcon, { fontSize: "small" }) }) : null
|
17
|
+
] });
|
18
|
+
};
|
19
|
+
|
20
|
+
// src/components/ErrorRender/Render.tsx
|
21
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
22
|
+
import { useEffect } from "react";
|
23
|
+
import { useLocation } from "react-router-dom";
|
24
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
25
|
+
var ErrorRender = ({
|
26
|
+
onCancel,
|
27
|
+
error,
|
28
|
+
noErrorDisplay = false,
|
29
|
+
customError = null,
|
30
|
+
children,
|
31
|
+
errorContext,
|
32
|
+
...props
|
33
|
+
}) => {
|
34
|
+
const location = useLocation();
|
35
|
+
useEffect(() => {
|
36
|
+
location.state = {
|
37
|
+
from: {
|
38
|
+
pathname: window.location.pathname
|
39
|
+
}
|
40
|
+
};
|
41
|
+
}, [location]);
|
42
|
+
if (error) {
|
43
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? customError : /* @__PURE__ */ jsx2(FlexCol, { alignItems: "center", ...props, children: /* @__PURE__ */ jsx2(ErrorAlert, { error, errorContext, onCancel }) }) });
|
44
|
+
} else {
|
45
|
+
return /* @__PURE__ */ jsx2(Fragment, { children }) ?? null;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
// src/components/ErrorBoundary/ThrownErrorBoundary.tsx
|
50
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
51
|
+
var ThrownErrorBoundary = class _ThrownErrorBoundary extends Component {
|
52
|
+
state = {
|
53
|
+
xyoError: void 0
|
54
|
+
};
|
55
|
+
static getDerivedStateFromError(error) {
|
56
|
+
return { hasError: true, xyoError: _ThrownErrorBoundary.normalizeError(error) };
|
57
|
+
}
|
58
|
+
static normalizeError(error) {
|
59
|
+
return error.schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] };
|
60
|
+
}
|
61
|
+
componentDidCatch(error, errorInfo) {
|
62
|
+
const { rethrow, rollbar } = this.props;
|
63
|
+
const { xyoError } = this.state;
|
64
|
+
rollbar?.error(error);
|
65
|
+
console.error("Error:", xyoError, errorInfo);
|
66
|
+
if (rethrow) {
|
67
|
+
throw error;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
render() {
|
71
|
+
const { xyoError } = this.state;
|
72
|
+
const { children, boundaryName, errorComponent } = this.props;
|
73
|
+
if (xyoError) {
|
74
|
+
if (errorComponent) {
|
75
|
+
return errorComponent(xyoError);
|
76
|
+
}
|
77
|
+
return /* @__PURE__ */ jsx3(ErrorRender, { error: xyoError, errorContext: `${boundaryName} Boundary` });
|
78
|
+
}
|
79
|
+
return children;
|
80
|
+
}
|
81
|
+
};
|
82
|
+
|
83
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
84
|
+
import { useEffect as useEffect2, useState } from "react";
|
85
|
+
|
86
|
+
// src/contexts/ErrorReporter/Context.ts
|
87
|
+
import { createContext } from "react";
|
88
|
+
var ErrorReporterContext = createContext({});
|
89
|
+
|
90
|
+
// src/contexts/ErrorReporter/Provider.tsx
|
91
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
92
|
+
var ErrorReporterProvider = ({ children, rollbar }) => {
|
93
|
+
const [rollbarInstance, setRollBarInstance] = useState();
|
94
|
+
useEffect2(() => {
|
95
|
+
if (rollbarInstance) {
|
96
|
+
setRollBarInstance(rollbarInstance);
|
97
|
+
}
|
98
|
+
}, [rollbar, rollbarInstance]);
|
99
|
+
return /* @__PURE__ */ jsx4(ErrorReporterContext.Provider, { value: { rollbar }, children });
|
100
|
+
};
|
101
|
+
|
102
|
+
// src/contexts/ErrorReporter/useRollbar.tsx
|
103
|
+
import { useContext } from "react";
|
104
|
+
var useRollbar = () => {
|
105
|
+
const context = useContext(ErrorReporterContext);
|
106
|
+
if (context === void 0) {
|
107
|
+
console.warn("useRollbar must be used within a ErrorReporterContext");
|
108
|
+
}
|
109
|
+
return context ?? {};
|
110
|
+
};
|
111
|
+
export {
|
112
|
+
ErrorAlert,
|
113
|
+
ErrorRender,
|
114
|
+
ErrorReporterProvider,
|
115
|
+
ThrownErrorBoundary,
|
116
|
+
useRollbar
|
117
|
+
};
|
3
118
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/
|
1
|
+
{"version":3,"sources":["../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx","../../src/components/ErrorRender/ErrorAlert.tsx","../../src/components/ErrorRender/Render.tsx","../../src/contexts/ErrorReporter/Provider.tsx","../../src/contexts/ErrorReporter/Context.ts","../../src/contexts/ErrorReporter/useRollbar.tsx"],"sourcesContent":["import { ModuleError, ModuleErrorSchema } from '@xyo-network/payload-model'\nimport { Component, ErrorInfo, ReactNode } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorRender } from '../ErrorRender'\n\nexport interface ThrownErrorBoundaryProps {\n boundaryName?: string\n children: ReactNode\n errorComponent?: (e: ModuleError, boundaryName?: string) => ReactNode\n rethrow?: boolean\n rollbar?: Rollbar\n}\n\nexport interface ThrownErrorBoundaryState {\n xyoError?: ModuleError\n}\n\nexport class ThrownErrorBoundary extends Component<ThrownErrorBoundaryProps, ThrownErrorBoundaryState> {\n public override state: ThrownErrorBoundaryState = {\n xyoError: undefined,\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) } as ThrownErrorBoundaryState\n }\n\n public static normalizeError(error: Error | ModuleError): ModuleError {\n return (\n (error as ModuleError).schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] }\n ) as ModuleError\n }\n\n public override componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n const { rethrow, rollbar } = this.props\n const { xyoError } = this.state\n\n rollbar?.error(error)\n\n console.error('Error:', xyoError, errorInfo)\n if (rethrow) {\n throw error\n }\n }\n\n public override render() {\n const { xyoError } = this.state\n const { children, boundaryName, errorComponent } = this.props\n if (xyoError) {\n if (errorComponent) {\n return errorComponent(xyoError)\n }\n return <ErrorRender error={xyoError} errorContext={`${boundaryName} Boundary`} />\n }\n\n return children\n }\n}\n","import { ExitToApp as ExitIcon } from '@mui/icons-material'\nimport { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ModuleError } from '@xyo-network/payload-model'\n\nexport interface ErrorAlertProps extends AlertProps {\n error?: ModuleError | Error\n errorContext?: string\n onCancel?: () => void\n}\n\nexport const ErrorAlert: React.FC<ErrorAlertProps> = ({ onCancel, error, errorContext, ...props }) => {\n return (\n <Alert severity=\"error\" {...props}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {errorContext ? (\n <Typography variant=\"caption\" my={0.5} lineHeight=\"1\" display=\"block\">\n {errorContext}\n </Typography>\n ) : null}\n <Typography variant=\"caption\" mr={0.5} fontWeight=\"bold\">\n Error:\n </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n {onCancel ? (\n <ButtonEx variant=\"outlined\" size=\"small\" onClick={onCancel} position=\"absolute\" style={{ right: 8, top: 8 }}>\n <ExitIcon fontSize=\"small\" />\n </ButtonEx>\n ) : null}\n </Alert>\n )\n}\n","import { FlexCol } from '@xylabs/react-flexbox'\nimport { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { ErrorAlert } from './ErrorAlert'\nimport { ErrorRenderProps } from './Props'\n\nexport const ErrorRender: React.FC<ErrorRenderProps> = ({\n onCancel,\n error,\n noErrorDisplay = false,\n customError = null,\n children,\n errorContext,\n ...props\n}) => {\n const location = useLocation()\n useEffect(() => {\n // ensure we end up at the same place we are now after logging in\n location.state = {\n from: {\n pathname: window.location.pathname,\n },\n }\n }, [location])\n\n if (error) {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n {noErrorDisplay ? (\n customError\n ) : (\n <FlexCol alignItems=\"center\" {...props}>\n <ErrorAlert error={error} errorContext={errorContext} onCancel={onCancel} />\n </FlexCol>\n )}\n </FlexCol>\n )\n } else {\n return <>{children}</> ?? null\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\nimport { useEffect, useState } from 'react'\nimport Rollbar from 'rollbar'\n\nimport { ErrorReporterContext } from './Context'\n\nexport interface ErrorReporterProviderProps {\n rollbar: Rollbar\n}\n\nconst ErrorReporterProvider: React.FC<WithChildren<ErrorReporterProviderProps>> = ({ children, rollbar }) => {\n const [rollbarInstance, setRollBarInstance] = useState<Rollbar>()\n\n useEffect(() => {\n if (rollbarInstance) {\n setRollBarInstance(rollbarInstance)\n }\n }, [rollbar, rollbarInstance])\n\n return <ErrorReporterContext.Provider value={{ rollbar }}>{children}</ErrorReporterContext.Provider>\n}\n\nexport { ErrorReporterProvider }\n","import { createContext } from 'react'\n\nimport { ErrorReporterContextState } from './State'\n\nexport const ErrorReporterContext = createContext<ErrorReporterContextState>({})\n","import { useContext } from 'react'\n\nimport { ErrorReporterContext } from './Context'\n\nconst useRollbar = () => {\n const context = useContext(ErrorReporterContext)\n if (context === undefined) {\n console.warn('useRollbar must be used within a ErrorReporterContext')\n }\n\n return context ?? {}\n}\n\nexport { useRollbar }\n"],"mappings":";AAAA,SAAsB,yBAAyB;AAC/C,SAAS,iBAAuC;;;ACDhD,SAAS,aAAa,gBAAgB;AACtC,SAAS,OAAmB,YAAY,kBAAkB;AAC1D,SAAS,gBAAgB;AAWrB,SACE,KADF;AAFG,IAAM,aAAwC,CAAC,EAAE,UAAU,OAAO,cAAc,GAAG,MAAM,MAAM;AACpG,SACE,qBAAC,SAAM,UAAS,SAAS,GAAG,OAC1B;AAAA,wBAAC,cAAW,0CAA4B;AAAA,IACvC,eACC,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,KAAI,SAAQ,SAC3D,wBACH,IACE;AAAA,IACJ,oBAAC,cAAW,SAAQ,WAAU,IAAI,KAAK,YAAW,QAAO,oBAEzD;AAAA,IACA,oBAAC,cAAW,SAAQ,WAAW,iBAAO,SAAQ;AAAA,IAC7C,WACC,oBAAC,YAAS,SAAQ,YAAW,MAAK,SAAQ,SAAS,UAAU,UAAS,YAAW,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GACzG,8BAAC,YAAS,UAAS,SAAQ,GAC7B,IACE;AAAA,KACN;AAEJ;;;AC/BA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AA+BhB,SAMD,UANC,OAAAA,YAAA;AA1BL,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,YAAY;AAC7B,YAAU,MAAM;AAEd,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,QACJ,UAAU,OAAO,SAAS;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,OAAO;AACT,WACE,gBAAAA,KAAC,WAAQ,YAAW,WAAW,GAAG,OAC/B,2BACC,cAEA,gBAAAA,KAAC,WAAQ,YAAW,UAAU,GAAG,OAC/B,0BAAAA,KAAC,cAAW,OAAc,cAA4B,UAAoB,GAC5E,GAEJ;AAAA,EAEJ,OAAO;AACL,WAAO,gBAAAA,KAAA,YAAG,UAAS,KAAO;AAAA,EAC5B;AACF;;;AFWa,gBAAAC,YAAA;AAlCN,IAAM,sBAAN,MAAM,6BAA4B,UAA8D;AAAA,EACrF,QAAkC;AAAA,IAChD,UAAU;AAAA,EACZ;AAAA,EAEA,OAAO,yBAAyB,OAAc;AAC5C,WAAO,EAAE,UAAU,MAAM,UAAU,qBAAoB,eAAe,KAAK,EAAE;AAAA,EAC/E;AAAA,EAEA,OAAc,eAAe,OAAyC;AACpE,WACG,MAAsB,WAAW,oBAAoB,QAAQ,EAAE,SAAS,MAAM,SAAS,QAAQ,mBAAmB,SAAS,CAAC,EAAE;AAAA,EAEnI;AAAA,EAEgB,kBAAkB,OAAc,WAAsB;AACpE,UAAM,EAAE,SAAS,QAAQ,IAAI,KAAK;AAClC,UAAM,EAAE,SAAS,IAAI,KAAK;AAE1B,aAAS,MAAM,KAAK;AAEpB,YAAQ,MAAM,UAAU,UAAU,SAAS;AAC3C,QAAI,SAAS;AACX,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEgB,SAAS;AACvB,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,UAAU,cAAc,eAAe,IAAI,KAAK;AACxD,QAAI,UAAU;AACZ,UAAI,gBAAgB;AAClB,eAAO,eAAe,QAAQ;AAAA,MAChC;AACA,aAAO,gBAAAA,KAAC,eAAY,OAAO,UAAU,cAAc,GAAG,YAAY,aAAa;AAAA,IACjF;AAEA,WAAO;AAAA,EACT;AACF;;;AGxDA,SAAS,aAAAC,YAAW,gBAAgB;;;ACDpC,SAAS,qBAAqB;AAIvB,IAAM,uBAAuB,cAAyC,CAAC,CAAC;;;ADetE,gBAAAC,YAAA;AATT,IAAM,wBAA4E,CAAC,EAAE,UAAU,QAAQ,MAAM;AAC3G,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAkB;AAEhE,EAAAC,WAAU,MAAM;AACd,QAAI,iBAAiB;AACnB,yBAAmB,eAAe;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,SAAS,eAAe,CAAC;AAE7B,SAAO,gBAAAD,KAAC,qBAAqB,UAArB,EAA8B,OAAO,EAAE,QAAQ,GAAI,UAAS;AACtE;;;AEpBA,SAAS,kBAAkB;AAI3B,IAAM,aAAa,MAAM;AACvB,QAAM,UAAU,WAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":["jsx","jsx","useEffect","jsx","useEffect"]}
|
package/dist/docs.json
CHANGED
@@ -194,7 +194,7 @@
|
|
194
194
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
195
195
|
"line": 20,
|
196
196
|
"character": 18,
|
197
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
197
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L20"
|
198
198
|
}
|
199
199
|
],
|
200
200
|
"type": {
|
@@ -223,7 +223,7 @@
|
|
223
223
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
224
224
|
"line": 34,
|
225
225
|
"character": 18,
|
226
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
226
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L34"
|
227
227
|
}
|
228
228
|
],
|
229
229
|
"signatures": [
|
@@ -238,7 +238,7 @@
|
|
238
238
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
239
239
|
"line": 34,
|
240
240
|
"character": 2,
|
241
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
241
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L34"
|
242
242
|
}
|
243
243
|
],
|
244
244
|
"parameters": [
|
@@ -306,7 +306,7 @@
|
|
306
306
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
307
307
|
"line": 46,
|
308
308
|
"character": 18,
|
309
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
309
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L46"
|
310
310
|
}
|
311
311
|
],
|
312
312
|
"signatures": [
|
@@ -321,7 +321,7 @@
|
|
321
321
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
322
322
|
"line": 46,
|
323
323
|
"character": 2,
|
324
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
324
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L46"
|
325
325
|
}
|
326
326
|
],
|
327
327
|
"type": {
|
@@ -406,7 +406,7 @@
|
|
406
406
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
407
407
|
"line": 24,
|
408
408
|
"character": 9,
|
409
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
409
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L24"
|
410
410
|
}
|
411
411
|
],
|
412
412
|
"signatures": [
|
@@ -421,7 +421,7 @@
|
|
421
421
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
422
422
|
"line": 24,
|
423
423
|
"character": 2,
|
424
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
424
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L24"
|
425
425
|
}
|
426
426
|
],
|
427
427
|
"parameters": [
|
@@ -465,7 +465,7 @@
|
|
465
465
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
466
466
|
"line": 28,
|
467
467
|
"character": 16,
|
468
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
468
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L28"
|
469
469
|
}
|
470
470
|
],
|
471
471
|
"signatures": [
|
@@ -480,7 +480,7 @@
|
|
480
480
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
481
481
|
"line": 28,
|
482
482
|
"character": 2,
|
483
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
483
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L28"
|
484
484
|
}
|
485
485
|
],
|
486
486
|
"parameters": [
|
@@ -618,7 +618,7 @@
|
|
618
618
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
619
619
|
"line": 19,
|
620
620
|
"character": 13,
|
621
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
621
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L19"
|
622
622
|
}
|
623
623
|
],
|
624
624
|
"extendedTypes": [
|
@@ -668,7 +668,7 @@
|
|
668
668
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
669
669
|
"line": 7,
|
670
670
|
"character": 2,
|
671
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
671
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L7"
|
672
672
|
}
|
673
673
|
],
|
674
674
|
"type": {
|
@@ -739,7 +739,7 @@
|
|
739
739
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
740
740
|
"line": 8,
|
741
741
|
"character": 2,
|
742
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
742
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L8"
|
743
743
|
}
|
744
744
|
],
|
745
745
|
"type": {
|
@@ -760,7 +760,7 @@
|
|
760
760
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
761
761
|
"line": 9,
|
762
762
|
"character": 2,
|
763
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
763
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L9"
|
764
764
|
}
|
765
765
|
],
|
766
766
|
"type": {
|
@@ -776,7 +776,7 @@
|
|
776
776
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
777
777
|
"line": 9,
|
778
778
|
"character": 13,
|
779
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
779
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L9"
|
780
780
|
}
|
781
781
|
],
|
782
782
|
"signatures": [
|
@@ -791,7 +791,7 @@
|
|
791
791
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
792
792
|
"line": 9,
|
793
793
|
"character": 13,
|
794
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
794
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L9"
|
795
795
|
}
|
796
796
|
],
|
797
797
|
"type": {
|
@@ -819,7 +819,7 @@
|
|
819
819
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
820
820
|
"line": 6,
|
821
821
|
"character": 17,
|
822
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
822
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L6"
|
823
823
|
}
|
824
824
|
],
|
825
825
|
"extendedTypes": [
|
@@ -5544,7 +5544,7 @@
|
|
5544
5544
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
5545
5545
|
"line": 6,
|
5546
5546
|
"character": 2,
|
5547
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
5547
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L6"
|
5548
5548
|
}
|
5549
5549
|
],
|
5550
5550
|
"type": {
|
@@ -5855,7 +5855,7 @@
|
|
5855
5855
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
5856
5856
|
"line": 7,
|
5857
5857
|
"character": 2,
|
5858
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
5858
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L7"
|
5859
5859
|
}
|
5860
5860
|
],
|
5861
5861
|
"type": {
|
@@ -5926,7 +5926,7 @@
|
|
5926
5926
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
5927
5927
|
"line": 8,
|
5928
5928
|
"character": 2,
|
5929
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
5929
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L8"
|
5930
5930
|
}
|
5931
5931
|
],
|
5932
5932
|
"type": {
|
@@ -16111,7 +16111,7 @@
|
|
16111
16111
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
16112
16112
|
"line": 9,
|
16113
16113
|
"character": 2,
|
16114
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
16114
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L9"
|
16115
16115
|
}
|
16116
16116
|
],
|
16117
16117
|
"type": {
|
@@ -16132,7 +16132,7 @@
|
|
16132
16132
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
16133
16133
|
"line": 10,
|
16134
16134
|
"character": 2,
|
16135
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
16135
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L10"
|
16136
16136
|
}
|
16137
16137
|
],
|
16138
16138
|
"type": {
|
@@ -16153,7 +16153,7 @@
|
|
16153
16153
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
16154
16154
|
"line": 11,
|
16155
16155
|
"character": 2,
|
16156
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
16156
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L11"
|
16157
16157
|
}
|
16158
16158
|
],
|
16159
16159
|
"type": {
|
@@ -16169,7 +16169,7 @@
|
|
16169
16169
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
16170
16170
|
"line": 11,
|
16171
16171
|
"character": 13,
|
16172
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
16172
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L11"
|
16173
16173
|
}
|
16174
16174
|
],
|
16175
16175
|
"signatures": [
|
@@ -16184,7 +16184,7 @@
|
|
16184
16184
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
16185
16185
|
"line": 11,
|
16186
16186
|
"character": 13,
|
16187
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
16187
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L11"
|
16188
16188
|
}
|
16189
16189
|
],
|
16190
16190
|
"type": {
|
@@ -22634,7 +22634,7 @@
|
|
22634
22634
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Props.ts",
|
22635
22635
|
"line": 5,
|
22636
22636
|
"character": 17,
|
22637
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22637
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Props.ts#L5"
|
22638
22638
|
}
|
22639
22639
|
],
|
22640
22640
|
"extendedTypes": [
|
@@ -22669,7 +22669,7 @@
|
|
22669
22669
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/State.ts",
|
22670
22670
|
"line": 4,
|
22671
22671
|
"character": 2,
|
22672
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22672
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/State.ts#L4"
|
22673
22673
|
}
|
22674
22674
|
],
|
22675
22675
|
"type": {
|
@@ -22696,7 +22696,7 @@
|
|
22696
22696
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/State.ts",
|
22697
22697
|
"line": 3,
|
22698
22698
|
"character": 17,
|
22699
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22699
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/State.ts#L3"
|
22700
22700
|
}
|
22701
22701
|
]
|
22702
22702
|
},
|
@@ -22718,7 +22718,7 @@
|
|
22718
22718
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/Provider.tsx",
|
22719
22719
|
"line": 8,
|
22720
22720
|
"character": 2,
|
22721
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22721
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/Provider.tsx#L8"
|
22722
22722
|
}
|
22723
22723
|
],
|
22724
22724
|
"type": {
|
@@ -22745,7 +22745,7 @@
|
|
22745
22745
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/Provider.tsx",
|
22746
22746
|
"line": 7,
|
22747
22747
|
"character": 17,
|
22748
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22748
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/Provider.tsx#L7"
|
22749
22749
|
}
|
22750
22750
|
]
|
22751
22751
|
},
|
@@ -22769,7 +22769,7 @@
|
|
22769
22769
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22770
22770
|
"line": 8,
|
22771
22771
|
"character": 2,
|
22772
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22772
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L8"
|
22773
22773
|
}
|
22774
22774
|
],
|
22775
22775
|
"type": {
|
@@ -22788,7 +22788,7 @@
|
|
22788
22788
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22789
22789
|
"line": 9,
|
22790
22790
|
"character": 2,
|
22791
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22791
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L9"
|
22792
22792
|
}
|
22793
22793
|
],
|
22794
22794
|
"type": {
|
@@ -22815,7 +22815,7 @@
|
|
22815
22815
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22816
22816
|
"line": 10,
|
22817
22817
|
"character": 2,
|
22818
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22818
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L10"
|
22819
22819
|
}
|
22820
22820
|
],
|
22821
22821
|
"type": {
|
@@ -22831,7 +22831,7 @@
|
|
22831
22831
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22832
22832
|
"line": 10,
|
22833
22833
|
"character": 19,
|
22834
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22834
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L10"
|
22835
22835
|
}
|
22836
22836
|
],
|
22837
22837
|
"signatures": [
|
@@ -22846,7 +22846,7 @@
|
|
22846
22846
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22847
22847
|
"line": 10,
|
22848
22848
|
"character": 19,
|
22849
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22849
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L10"
|
22850
22850
|
}
|
22851
22851
|
],
|
22852
22852
|
"parameters": [
|
@@ -22939,7 +22939,7 @@
|
|
22939
22939
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22940
22940
|
"line": 11,
|
22941
22941
|
"character": 2,
|
22942
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22942
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L11"
|
22943
22943
|
}
|
22944
22944
|
],
|
22945
22945
|
"type": {
|
@@ -22960,7 +22960,7 @@
|
|
22960
22960
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22961
22961
|
"line": 12,
|
22962
22962
|
"character": 2,
|
22963
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22963
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L12"
|
22964
22964
|
}
|
22965
22965
|
],
|
22966
22966
|
"type": {
|
@@ -22991,7 +22991,7 @@
|
|
22991
22991
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
22992
22992
|
"line": 7,
|
22993
22993
|
"character": 17,
|
22994
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
22994
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L7"
|
22995
22995
|
}
|
22996
22996
|
]
|
22997
22997
|
},
|
@@ -23015,7 +23015,7 @@
|
|
23015
23015
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
23016
23016
|
"line": 16,
|
23017
23017
|
"character": 2,
|
23018
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23018
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L16"
|
23019
23019
|
}
|
23020
23020
|
],
|
23021
23021
|
"type": {
|
@@ -23073,7 +23073,7 @@
|
|
23073
23073
|
"fileName": "packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx",
|
23074
23074
|
"line": 15,
|
23075
23075
|
"character": 17,
|
23076
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23076
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorBoundary/ThrownErrorBoundary.tsx#L15"
|
23077
23077
|
}
|
23078
23078
|
]
|
23079
23079
|
},
|
@@ -23088,7 +23088,7 @@
|
|
23088
23088
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx",
|
23089
23089
|
"line": 12,
|
23090
23090
|
"character": 13,
|
23091
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23091
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/ErrorAlert.tsx#L12"
|
23092
23092
|
}
|
23093
23093
|
],
|
23094
23094
|
"signatures": [
|
@@ -23176,7 +23176,7 @@
|
|
23176
23176
|
"fileName": "packages/sdk/packages/error/src/components/ErrorRender/Render.tsx",
|
23177
23177
|
"line": 8,
|
23178
23178
|
"character": 13,
|
23179
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23179
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/components/ErrorRender/Render.tsx#L8"
|
23180
23180
|
}
|
23181
23181
|
],
|
23182
23182
|
"signatures": [
|
@@ -23264,7 +23264,7 @@
|
|
23264
23264
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/Provider.tsx",
|
23265
23265
|
"line": 11,
|
23266
23266
|
"character": 6,
|
23267
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23267
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/Provider.tsx#L11"
|
23268
23268
|
}
|
23269
23269
|
],
|
23270
23270
|
"signatures": [
|
@@ -23363,7 +23363,7 @@
|
|
23363
23363
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/useRollbar.tsx",
|
23364
23364
|
"line": 5,
|
23365
23365
|
"character": 6,
|
23366
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23366
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/useRollbar.tsx#L5"
|
23367
23367
|
}
|
23368
23368
|
],
|
23369
23369
|
"signatures": [
|
@@ -23378,7 +23378,7 @@
|
|
23378
23378
|
"fileName": "packages/sdk/packages/error/src/contexts/ErrorReporter/useRollbar.tsx",
|
23379
23379
|
"line": 5,
|
23380
23380
|
"character": 19,
|
23381
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
23381
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/feff6b161/packages/sdk/packages/error/src/contexts/ErrorReporter/useRollbar.tsx#L5"
|
23382
23382
|
}
|
23383
23383
|
],
|
23384
23384
|
"type": {
|
package/package.json
CHANGED
@@ -10,10 +10,10 @@
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
11
11
|
},
|
12
12
|
"dependencies": {
|
13
|
-
"@xylabs/react-button": "^3.0.
|
14
|
-
"@xylabs/react-flexbox": "^3.0.
|
15
|
-
"@xylabs/react-shared": "^3.0.
|
16
|
-
"@xyo-network/payload-model": "^2.75.
|
13
|
+
"@xylabs/react-button": "^3.0.6",
|
14
|
+
"@xylabs/react-flexbox": "^3.0.6",
|
15
|
+
"@xylabs/react-shared": "^3.0.6",
|
16
|
+
"@xyo-network/payload-model": "^2.75.4"
|
17
17
|
},
|
18
18
|
"peerDependencies": {
|
19
19
|
"@mui/icons-material": "^5",
|
@@ -26,8 +26,8 @@
|
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@storybook/react": "^7.4.5",
|
29
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
30
|
-
"@xylabs/tsconfig-react": "^3.0.
|
29
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.79",
|
30
|
+
"@xylabs/tsconfig-react": "^3.0.79",
|
31
31
|
"typescript": "^5.2.2"
|
32
32
|
},
|
33
33
|
"peerDependenciesMeta": {
|
@@ -86,6 +86,6 @@
|
|
86
86
|
},
|
87
87
|
"sideEffects": false,
|
88
88
|
"types": "dist/browser/index.d.ts",
|
89
|
-
"version": "2.64.
|
89
|
+
"version": "2.64.2",
|
90
90
|
"type": "module"
|
91
91
|
}
|