@xyo-network/react-error 2.63.1 → 2.64.0-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.mts.map +1 -0
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.ts +21 -0
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.mts +7 -0
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.mts.map +1 -0
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.ts +7 -0
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/index.d.mts.map +1 -0
- package/dist/{esm/components/ErrorBoundary/index.js → components/ErrorBoundary/index.d.ts} +1 -1
- package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/components/ErrorRender/ErrorAlert.d.mts.map +1 -0
- package/dist/components/ErrorRender/ErrorAlert.d.ts +10 -0
- package/dist/components/ErrorRender/ErrorAlert.d.ts.map +1 -0
- package/dist/components/ErrorRender/Props.d.mts.map +1 -0
- package/dist/components/ErrorRender/Props.d.ts +12 -0
- package/dist/components/ErrorRender/Props.d.ts.map +1 -0
- package/dist/components/ErrorRender/Render.d.mts.map +1 -0
- package/dist/components/ErrorRender/Render.d.ts +4 -0
- package/dist/components/ErrorRender/Render.d.ts.map +1 -0
- package/dist/components/ErrorRender/index.d.mts.map +1 -0
- package/dist/{esm/components/ErrorRender/index.js → components/ErrorRender/index.d.ts} +1 -1
- package/dist/components/ErrorRender/index.d.ts.map +1 -0
- package/dist/components/index.d.mts.map +1 -0
- package/dist/{esm/components/index.js → components/index.d.ts} +1 -1
- package/dist/components/index.d.ts.map +1 -0
- package/dist/contexts/ErrorReporter/Context.d.mts.map +1 -0
- package/dist/contexts/ErrorReporter/Context.d.ts +4 -0
- package/dist/contexts/ErrorReporter/Context.d.ts.map +1 -0
- package/dist/contexts/ErrorReporter/Provider.d.mts.map +1 -0
- package/dist/contexts/ErrorReporter/Provider.d.ts +9 -0
- package/dist/contexts/ErrorReporter/Provider.d.ts.map +1 -0
- package/dist/contexts/ErrorReporter/Provider.stories.d.mts +10 -0
- package/dist/contexts/ErrorReporter/Provider.stories.d.mts.map +1 -0
- package/dist/contexts/ErrorReporter/Provider.stories.d.ts +10 -0
- package/dist/contexts/ErrorReporter/Provider.stories.d.ts.map +1 -0
- package/dist/contexts/ErrorReporter/State.d.mts.map +1 -0
- package/dist/contexts/ErrorReporter/State.d.ts +5 -0
- package/dist/contexts/ErrorReporter/State.d.ts.map +1 -0
- package/dist/contexts/ErrorReporter/index.d.mts.map +1 -0
- package/dist/{esm/contexts/ErrorReporter/index.js → contexts/ErrorReporter/index.d.ts} +1 -1
- package/dist/contexts/ErrorReporter/index.d.ts.map +1 -0
- package/dist/contexts/ErrorReporter/useRollbar.d.mts.map +1 -0
- package/dist/contexts/ErrorReporter/useRollbar.d.ts +3 -0
- package/dist/contexts/ErrorReporter/useRollbar.d.ts.map +1 -0
- package/dist/contexts/index.d.mts.map +1 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/{esm/index.js → index.d.ts} +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +149 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +118 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +28 -19
- package/src/components/ErrorRender/ErrorAlert.tsx +1 -1
- package/dist/cjs/components/ErrorBoundary/ThrownErrorBoundary.js +0 -43
- package/dist/cjs/components/ErrorBoundary/ThrownErrorBoundary.js.map +0 -1
- package/dist/cjs/components/ErrorBoundary/index.js +0 -5
- package/dist/cjs/components/ErrorBoundary/index.js.map +0 -1
- package/dist/cjs/components/ErrorRender/ErrorAlert.js +0 -14
- package/dist/cjs/components/ErrorRender/ErrorAlert.js.map +0 -1
- package/dist/cjs/components/ErrorRender/Props.js +0 -3
- package/dist/cjs/components/ErrorRender/Props.js.map +0 -1
- package/dist/cjs/components/ErrorRender/Render.js +0 -30
- package/dist/cjs/components/ErrorRender/Render.js.map +0 -1
- package/dist/cjs/components/ErrorRender/index.js +0 -7
- package/dist/cjs/components/ErrorRender/index.js.map +0 -1
- package/dist/cjs/components/index.js +0 -6
- package/dist/cjs/components/index.js.map +0 -1
- package/dist/cjs/contexts/ErrorReporter/Context.js +0 -6
- package/dist/cjs/contexts/ErrorReporter/Context.js.map +0 -1
- package/dist/cjs/contexts/ErrorReporter/Provider.js +0 -17
- package/dist/cjs/contexts/ErrorReporter/Provider.js.map +0 -1
- package/dist/cjs/contexts/ErrorReporter/State.js +0 -3
- package/dist/cjs/contexts/ErrorReporter/State.js.map +0 -1
- package/dist/cjs/contexts/ErrorReporter/index.js +0 -7
- package/dist/cjs/contexts/ErrorReporter/index.js.map +0 -1
- package/dist/cjs/contexts/ErrorReporter/useRollbar.js +0 -14
- package/dist/cjs/contexts/ErrorReporter/useRollbar.js.map +0 -1
- package/dist/cjs/contexts/index.js +0 -5
- package/dist/cjs/contexts/index.js.map +0 -1
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/index.js.map +0 -1
- package/dist/docs.json +0 -25215
- package/dist/esm/components/ErrorBoundary/ThrownErrorBoundary.js +0 -36
- package/dist/esm/components/ErrorBoundary/ThrownErrorBoundary.js.map +0 -1
- package/dist/esm/components/ErrorBoundary/index.js.map +0 -1
- package/dist/esm/components/ErrorRender/ErrorAlert.js +0 -8
- package/dist/esm/components/ErrorRender/ErrorAlert.js.map +0 -1
- package/dist/esm/components/ErrorRender/Props.js +0 -2
- package/dist/esm/components/ErrorRender/Props.js.map +0 -1
- package/dist/esm/components/ErrorRender/Render.js +0 -23
- package/dist/esm/components/ErrorRender/Render.js.map +0 -1
- package/dist/esm/components/ErrorRender/index.js.map +0 -1
- package/dist/esm/components/index.js.map +0 -1
- package/dist/esm/contexts/ErrorReporter/Context.js +0 -3
- package/dist/esm/contexts/ErrorReporter/Context.js.map +0 -1
- package/dist/esm/contexts/ErrorReporter/Provider.js +0 -14
- package/dist/esm/contexts/ErrorReporter/Provider.js.map +0 -1
- package/dist/esm/contexts/ErrorReporter/State.js +0 -2
- package/dist/esm/contexts/ErrorReporter/State.js.map +0 -1
- package/dist/esm/contexts/ErrorReporter/index.js.map +0 -1
- package/dist/esm/contexts/ErrorReporter/useRollbar.js +0 -11
- package/dist/esm/contexts/ErrorReporter/useRollbar.js.map +0 -1
- package/dist/esm/contexts/index.js +0 -2
- package/dist/esm/contexts/index.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/types/components/ErrorBoundary/ThrownErrorBoundary.d.ts.map +0 -1
- package/dist/types/components/ErrorBoundary/index.d.ts.map +0 -1
- package/dist/types/components/ErrorRender/ErrorAlert.d.ts.map +0 -1
- package/dist/types/components/ErrorRender/Props.d.ts.map +0 -1
- package/dist/types/components/ErrorRender/Render.d.ts.map +0 -1
- package/dist/types/components/ErrorRender/index.d.ts.map +0 -1
- package/dist/types/components/index.d.ts.map +0 -1
- package/dist/types/contexts/ErrorReporter/Context.d.ts.map +0 -1
- package/dist/types/contexts/ErrorReporter/Provider.d.ts.map +0 -1
- package/dist/types/contexts/ErrorReporter/State.d.ts.map +0 -1
- package/dist/types/contexts/ErrorReporter/index.d.ts.map +0 -1
- package/dist/types/contexts/ErrorReporter/useRollbar.d.ts.map +0 -1
- package/dist/types/contexts/index.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- /package/dist/{types/components/ErrorBoundary/ThrownErrorBoundary.d.ts → components/ErrorBoundary/ThrownErrorBoundary.d.mts} +0 -0
- /package/dist/{types/components/ErrorBoundary/index.d.ts → components/ErrorBoundary/index.d.mts} +0 -0
- /package/dist/{types/components/ErrorRender/ErrorAlert.d.ts → components/ErrorRender/ErrorAlert.d.mts} +0 -0
- /package/dist/{types/components/ErrorRender/Props.d.ts → components/ErrorRender/Props.d.mts} +0 -0
- /package/dist/{types/components/ErrorRender/Render.d.ts → components/ErrorRender/Render.d.mts} +0 -0
- /package/dist/{types/components/ErrorRender/index.d.ts → components/ErrorRender/index.d.mts} +0 -0
- /package/dist/{types/components/index.d.ts → components/index.d.mts} +0 -0
- /package/dist/{types/contexts/ErrorReporter/Context.d.ts → contexts/ErrorReporter/Context.d.mts} +0 -0
- /package/dist/{types/contexts/ErrorReporter/Provider.d.ts → contexts/ErrorReporter/Provider.d.mts} +0 -0
- /package/dist/{types/contexts/ErrorReporter/State.d.ts → contexts/ErrorReporter/State.d.mts} +0 -0
- /package/dist/{types/contexts/ErrorReporter/index.d.ts → contexts/ErrorReporter/index.d.mts} +0 -0
- /package/dist/{types/contexts/ErrorReporter/useRollbar.d.ts → contexts/ErrorReporter/useRollbar.d.mts} +0 -0
- /package/dist/{types/contexts/index.d.ts → contexts/index.d.mts} +0 -0
- /package/dist/{types/index.d.ts → index.d.mts} +0 -0
@@ -1,36 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { ModuleErrorSchema } from '@xyo-network/payload-model';
|
3
|
-
import { Component } from 'react';
|
4
|
-
import { ErrorRender } from '../ErrorRender';
|
5
|
-
export class ThrownErrorBoundary extends Component {
|
6
|
-
state = {
|
7
|
-
xyoError: undefined,
|
8
|
-
};
|
9
|
-
static getDerivedStateFromError(error) {
|
10
|
-
return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) };
|
11
|
-
}
|
12
|
-
static normalizeError(error) {
|
13
|
-
return (error.schema === ModuleErrorSchema ? error : { message: error.message, schema: ModuleErrorSchema, sources: [] });
|
14
|
-
}
|
15
|
-
componentDidCatch(error, errorInfo) {
|
16
|
-
const { rethrow, rollbar } = this.props;
|
17
|
-
const { xyoError } = this.state;
|
18
|
-
rollbar?.error(error);
|
19
|
-
console.error('Error:', xyoError, errorInfo);
|
20
|
-
if (rethrow) {
|
21
|
-
throw error;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
render() {
|
25
|
-
const { xyoError } = this.state;
|
26
|
-
const { children, boundaryName, errorComponent } = this.props;
|
27
|
-
if (xyoError) {
|
28
|
-
if (errorComponent) {
|
29
|
-
return errorComponent(xyoError);
|
30
|
-
}
|
31
|
-
return _jsx(ErrorRender, { error: xyoError, errorContext: `${boundaryName} Boundary` });
|
32
|
-
}
|
33
|
-
return children;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
//# sourceMappingURL=ThrownErrorBoundary.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ThrownErrorBoundary.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAA;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAc5C,MAAM,OAAO,mBAAoB,SAAQ,SAA6D;IACpF,KAAK,GAA6B;QAChD,QAAQ,EAAE,SAAS;KACpB,CAAA;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,CAAC,cAAc,CAAC,KAAK,CAAC,EAA8B,CAAA;IAC5G,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,KAA0B;QACrD,OAAO,CACJ,KAAqB,CAAC,MAAM,KAAK,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAAE,EAAE,CAClH,CAAA;IAClB,CAAC;IAEe,iBAAiB,CAAC,KAAY,EAAE,SAAoB;QAClE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QACvC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE/B,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;QAErB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;QAC5C,IAAI,OAAO,EAAE;YACX,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;IAEe,MAAM;QACpB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC/B,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC7D,IAAI,QAAQ,EAAE;YACZ,IAAI,cAAc,EAAE;gBAClB,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAA;aAChC;YACD,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,YAAY,WAAW,GAAI,CAAA;SAClF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import ExitIcon from '@mui/icons-material/ExitToApp';
|
3
|
-
import { Alert, AlertTitle, Typography } from '@mui/material';
|
4
|
-
import { ButtonEx } from '@xylabs/react-button';
|
5
|
-
export const ErrorAlert = ({ onCancel, error, errorContext, ...props }) => {
|
6
|
-
return (_jsxs(Alert, { severity: "error", ...props, children: [_jsx(AlertTitle, { children: "Whoops! Something went wrong" }), errorContext ? (_jsx(Typography, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext })) : null, _jsx(Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }), _jsx(Typography, { variant: "caption", children: error?.message }), onCancel ? (_jsx(ButtonEx, { variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 }, children: _jsx(ExitIcon, { fontSize: "small" }) })) : null] }));
|
7
|
-
};
|
8
|
-
//# sourceMappingURL=ErrorAlert.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,KAAK,EAAc,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAS/C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACnG,OAAO,CACL,MAAC,KAAK,IAAC,QAAQ,EAAC,OAAO,KAAK,KAAK,aAC/B,KAAC,UAAU,+CAA0C,EACpD,YAAY,CAAC,CAAC,CAAC,CACd,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,GAAG,EAAC,OAAO,EAAC,OAAO,YAClE,YAAY,GACF,CACd,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,MAAM,uBAE3C,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,YAAE,KAAK,EAAE,OAAO,GAAc,EAC1D,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,QAAQ,IAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,YAC1G,KAAC,QAAQ,IAAC,QAAQ,EAAC,OAAO,GAAG,GACpB,CACZ,CAAC,CAAC,CAAC,IAAI,IACF,CACT,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Props.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Props.ts"],"names":[],"mappings":""}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
-
import { FlexCol } from '@xylabs/react-flexbox';
|
3
|
-
import { useEffect } from 'react';
|
4
|
-
import { useLocation } from 'react-router-dom';
|
5
|
-
import { ErrorAlert } from './ErrorAlert';
|
6
|
-
export const ErrorRender = ({ onCancel, error, noErrorDisplay = false, customError = null, children, errorContext, ...props }) => {
|
7
|
-
const location = useLocation();
|
8
|
-
useEffect(() => {
|
9
|
-
// ensure we end up at the same place we are now after logging in
|
10
|
-
location.state = {
|
11
|
-
from: {
|
12
|
-
pathname: window.location.pathname,
|
13
|
-
},
|
14
|
-
};
|
15
|
-
}, [location]);
|
16
|
-
if (error) {
|
17
|
-
return (_jsx(FlexCol, { alignItems: "stretch", ...props, children: noErrorDisplay ? (customError) : (_jsx(FlexCol, { alignItems: "center", ...props, children: _jsx(ErrorAlert, { error: error, errorContext: errorContext, onCancel: onCancel }) })) }));
|
18
|
-
}
|
19
|
-
else {
|
20
|
-
return _jsx(_Fragment, { children: children }) ?? null;
|
21
|
-
}
|
22
|
-
};
|
23
|
-
//# sourceMappingURL=Render.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Render.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,QAAQ,EACR,KAAK,EACL,cAAc,GAAG,KAAK,EACtB,WAAW,GAAG,IAAI,EAClB,QAAQ,EACR,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,SAAS,CAAC,GAAG,EAAE;QACb,iEAAiE;QACjE,QAAQ,CAAC,KAAK,GAAG;YACf,IAAI,EAAE;gBACJ,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;aACnC;SACF,CAAA;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,IAAI,KAAK,EAAE;QACT,OAAO,CACL,KAAC,OAAO,IAAC,UAAU,EAAC,SAAS,KAAK,KAAK,YACpC,cAAc,CAAC,CAAC,CAAC,CAChB,WAAW,CACZ,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,IAAC,UAAU,EAAC,QAAQ,KAAK,KAAK,YACpC,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,GACpE,CACX,GACO,CACX,CAAA;KACF;SAAM;QACL,OAAO,4BAAG,QAAQ,GAAI,IAAI,IAAI,CAAA;KAC/B;AACH,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAIrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B,EAAE,CAAC,CAAA"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { useEffect, useState } from 'react';
|
3
|
-
import { ErrorReporterContext } from './Context';
|
4
|
-
const ErrorReporterProvider = ({ children, rollbar }) => {
|
5
|
-
const [rollbarInstance, setRollBarInstance] = useState();
|
6
|
-
useEffect(() => {
|
7
|
-
if (rollbarInstance) {
|
8
|
-
setRollBarInstance(rollbarInstance);
|
9
|
-
}
|
10
|
-
}, [rollbar, rollbarInstance]);
|
11
|
-
return _jsx(ErrorReporterContext.Provider, { value: { rollbar }, children: children });
|
12
|
-
};
|
13
|
-
export { ErrorReporterProvider };
|
14
|
-
//# sourceMappingURL=Provider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/Provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAMhD,MAAM,qBAAqB,GAAuD,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1G,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,EAAW,CAAA;IAEjE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,eAAe,EAAE;YACnB,kBAAkB,CAAC,eAAe,CAAC,CAAA;SACpC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAA;IAE9B,OAAO,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,YAAG,QAAQ,GAAiC,CAAA;AACtG,CAAC,CAAA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"State.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/State.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { useContext } from 'react';
|
2
|
-
import { ErrorReporterContext } from './Context';
|
3
|
-
const useRollbar = () => {
|
4
|
-
const context = useContext(ErrorReporterContext);
|
5
|
-
if (context === undefined) {
|
6
|
-
console.warn('useRollbar must be used within a ErrorReporterContext');
|
7
|
-
}
|
8
|
-
return context ?? {};
|
9
|
-
};
|
10
|
-
export { useRollbar };
|
11
|
-
//# sourceMappingURL=useRollbar.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRollbar.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/useRollbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEhD,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IAChD,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAA;KACtE;IAED,OAAO,OAAO,IAAI,EAAE,CAAA;AACtB,CAAC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
package/dist/esm/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ThrownErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,OAAO,MAAM,SAAS,CAAA;AAI7B,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,SAAS,CAAA;IACnB,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,SAAS,CAAA;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB;AAED,qBAAa,mBAAoB,SAAQ,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IACpF,KAAK,EAAE,wBAAwB,CAE9C;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;WAI9B,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW;IAMrD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAYpD,MAAM;CAYvB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ErrorAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx"],"names":[],"mappings":";AACA,OAAO,EAAS,UAAU,EAA0B,MAAM,eAAe,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoBhD,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Props.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Render.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Render.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkClD,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorRender/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/Context.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAEnD,eAAO,MAAM,oBAAoB,oDAA+C,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAO,OAAO,MAAM,SAAS,CAAA;AAI7B,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAU7E,CAAA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/State.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRollbar.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/useRollbar.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU,mDAOf,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
File without changes
|
/package/dist/{types/components/ErrorBoundary/index.d.ts → components/ErrorBoundary/index.d.mts}
RENAMED
File without changes
|
File without changes
|
/package/dist/{types/components/ErrorRender/Props.d.ts → components/ErrorRender/Props.d.mts}
RENAMED
File without changes
|
/package/dist/{types/components/ErrorRender/Render.d.ts → components/ErrorRender/Render.d.mts}
RENAMED
File without changes
|
/package/dist/{types/components/ErrorRender/index.d.ts → components/ErrorRender/index.d.mts}
RENAMED
File without changes
|
File without changes
|
/package/dist/{types/contexts/ErrorReporter/Context.d.ts → contexts/ErrorReporter/Context.d.mts}
RENAMED
File without changes
|
/package/dist/{types/contexts/ErrorReporter/Provider.d.ts → contexts/ErrorReporter/Provider.d.mts}
RENAMED
File without changes
|
/package/dist/{types/contexts/ErrorReporter/State.d.ts → contexts/ErrorReporter/State.d.mts}
RENAMED
File without changes
|
/package/dist/{types/contexts/ErrorReporter/index.d.ts → contexts/ErrorReporter/index.d.mts}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|