@xyo-network/react-error 2.62.3 → 2.63.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/components/ErrorBoundary/ThrownErrorBoundary.js +43 -0
- package/dist/cjs/components/ErrorBoundary/ThrownErrorBoundary.js.map +1 -0
- package/dist/cjs/components/ErrorBoundary/index.js +5 -0
- package/dist/cjs/components/ErrorBoundary/index.js.map +1 -0
- package/dist/cjs/components/ErrorRender/ErrorAlert.js +14 -0
- package/dist/cjs/components/ErrorRender/ErrorAlert.js.map +1 -0
- package/dist/cjs/components/ErrorRender/Props.js +3 -0
- package/dist/cjs/components/ErrorRender/Props.js.map +1 -0
- package/dist/cjs/components/ErrorRender/Render.js +30 -0
- package/dist/cjs/components/ErrorRender/Render.js.map +1 -0
- package/dist/cjs/components/ErrorRender/index.js +7 -0
- package/dist/cjs/components/ErrorRender/index.js.map +1 -0
- package/dist/cjs/components/index.js +6 -0
- package/dist/cjs/components/index.js.map +1 -0
- package/dist/cjs/contexts/ErrorReporter/Context.js +6 -0
- package/dist/cjs/contexts/ErrorReporter/Context.js.map +1 -0
- package/dist/cjs/contexts/ErrorReporter/Provider.js +17 -0
- package/dist/cjs/contexts/ErrorReporter/Provider.js.map +1 -0
- package/dist/cjs/contexts/ErrorReporter/State.js +3 -0
- package/dist/cjs/contexts/ErrorReporter/State.js.map +1 -0
- package/dist/cjs/contexts/ErrorReporter/index.js +7 -0
- package/dist/cjs/contexts/ErrorReporter/index.js.map +1 -0
- package/dist/cjs/contexts/ErrorReporter/useRollbar.js +14 -0
- package/dist/cjs/contexts/ErrorReporter/useRollbar.js.map +1 -0
- package/dist/cjs/contexts/index.js +5 -0
- package/dist/cjs/contexts/index.js.map +1 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/docs.json +44 -44
- package/dist/esm/components/ErrorBoundary/ThrownErrorBoundary.js +36 -0
- package/dist/esm/components/ErrorBoundary/ThrownErrorBoundary.js.map +1 -0
- package/dist/{components/ErrorBoundary/index.d.mts → esm/components/ErrorBoundary/index.js} +1 -1
- package/dist/esm/components/ErrorBoundary/index.js.map +1 -0
- package/dist/esm/components/ErrorRender/ErrorAlert.js +8 -0
- package/dist/esm/components/ErrorRender/ErrorAlert.js.map +1 -0
- package/dist/esm/components/ErrorRender/Props.js +2 -0
- package/dist/esm/components/ErrorRender/Props.js.map +1 -0
- package/dist/esm/components/ErrorRender/Render.js +23 -0
- package/dist/esm/components/ErrorRender/Render.js.map +1 -0
- package/dist/{components/ErrorRender/index.d.mts → esm/components/ErrorRender/index.js} +1 -1
- package/dist/esm/components/ErrorRender/index.js.map +1 -0
- package/dist/{components/index.d.mts → esm/components/index.js} +1 -1
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/contexts/ErrorReporter/Context.js +3 -0
- package/dist/esm/contexts/ErrorReporter/Context.js.map +1 -0
- package/dist/esm/contexts/ErrorReporter/Provider.js +14 -0
- package/dist/esm/contexts/ErrorReporter/Provider.js.map +1 -0
- package/dist/esm/contexts/ErrorReporter/State.js +2 -0
- package/dist/esm/contexts/ErrorReporter/State.js.map +1 -0
- package/dist/{contexts/ErrorReporter/index.d.mts → esm/contexts/ErrorReporter/index.js} +1 -1
- package/dist/esm/contexts/ErrorReporter/index.js.map +1 -0
- package/dist/esm/contexts/ErrorReporter/useRollbar.js +11 -0
- package/dist/esm/contexts/ErrorReporter/useRollbar.js.map +1 -0
- package/dist/esm/contexts/index.js +2 -0
- package/dist/esm/contexts/index.js.map +1 -0
- package/dist/{index.d.mts → esm/index.js} +1 -1
- package/dist/esm/index.js.map +1 -0
- package/dist/types/components/ErrorBoundary/ThrownErrorBoundary.d.ts.map +1 -0
- package/dist/types/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/types/components/ErrorRender/ErrorAlert.d.ts.map +1 -0
- package/dist/types/components/ErrorRender/Props.d.ts.map +1 -0
- package/dist/types/components/ErrorRender/Render.d.ts.map +1 -0
- package/dist/types/components/ErrorRender/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/contexts/ErrorReporter/Context.d.ts.map +1 -0
- package/dist/types/contexts/ErrorReporter/Provider.d.ts.map +1 -0
- package/dist/types/contexts/ErrorReporter/State.d.ts.map +1 -0
- package/dist/types/contexts/ErrorReporter/index.d.ts.map +1 -0
- package/dist/types/contexts/ErrorReporter/useRollbar.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +19 -27
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.mts +0 -21
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.mts.map +0 -1
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.ts.map +0 -1
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.mts +0 -7
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.mts.map +0 -1
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.ts +0 -7
- package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.ts.map +0 -1
- package/dist/components/ErrorBoundary/index.d.mts.map +0 -1
- package/dist/components/ErrorBoundary/index.d.ts.map +0 -1
- package/dist/components/ErrorRender/ErrorAlert.d.mts +0 -10
- package/dist/components/ErrorRender/ErrorAlert.d.mts.map +0 -1
- package/dist/components/ErrorRender/ErrorAlert.d.ts.map +0 -1
- package/dist/components/ErrorRender/Props.d.mts +0 -12
- package/dist/components/ErrorRender/Props.d.mts.map +0 -1
- package/dist/components/ErrorRender/Props.d.ts.map +0 -1
- package/dist/components/ErrorRender/Render.d.mts +0 -4
- package/dist/components/ErrorRender/Render.d.mts.map +0 -1
- package/dist/components/ErrorRender/Render.d.ts.map +0 -1
- package/dist/components/ErrorRender/index.d.mts.map +0 -1
- package/dist/components/ErrorRender/index.d.ts.map +0 -1
- package/dist/components/index.d.mts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/contexts/ErrorReporter/Context.d.mts +0 -4
- package/dist/contexts/ErrorReporter/Context.d.mts.map +0 -1
- package/dist/contexts/ErrorReporter/Context.d.ts.map +0 -1
- package/dist/contexts/ErrorReporter/Provider.d.mts +0 -9
- package/dist/contexts/ErrorReporter/Provider.d.mts.map +0 -1
- package/dist/contexts/ErrorReporter/Provider.d.ts.map +0 -1
- package/dist/contexts/ErrorReporter/Provider.stories.d.mts +0 -10
- package/dist/contexts/ErrorReporter/Provider.stories.d.mts.map +0 -1
- package/dist/contexts/ErrorReporter/Provider.stories.d.ts +0 -10
- package/dist/contexts/ErrorReporter/Provider.stories.d.ts.map +0 -1
- package/dist/contexts/ErrorReporter/State.d.mts +0 -5
- package/dist/contexts/ErrorReporter/State.d.mts.map +0 -1
- package/dist/contexts/ErrorReporter/State.d.ts.map +0 -1
- package/dist/contexts/ErrorReporter/index.d.mts.map +0 -1
- package/dist/contexts/ErrorReporter/index.d.ts.map +0 -1
- package/dist/contexts/ErrorReporter/useRollbar.d.mts +0 -3
- package/dist/contexts/ErrorReporter/useRollbar.d.mts.map +0 -1
- package/dist/contexts/ErrorReporter/useRollbar.d.ts.map +0 -1
- package/dist/contexts/index.d.mts +0 -2
- package/dist/contexts/index.d.mts.map +0 -1
- package/dist/contexts/index.d.ts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -159
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -118
- package/dist/index.mjs.map +0 -1
- /package/dist/{components → types/components}/ErrorBoundary/ThrownErrorBoundary.d.ts +0 -0
- /package/dist/{components → types/components}/ErrorBoundary/index.d.ts +0 -0
- /package/dist/{components → types/components}/ErrorRender/ErrorAlert.d.ts +0 -0
- /package/dist/{components → types/components}/ErrorRender/Props.d.ts +0 -0
- /package/dist/{components → types/components}/ErrorRender/Render.d.ts +0 -0
- /package/dist/{components → types/components}/ErrorRender/index.d.ts +0 -0
- /package/dist/{components → types/components}/index.d.ts +0 -0
- /package/dist/{contexts → types/contexts}/ErrorReporter/Context.d.ts +0 -0
- /package/dist/{contexts → types/contexts}/ErrorReporter/Provider.d.ts +0 -0
- /package/dist/{contexts → types/contexts}/ErrorReporter/State.d.ts +0 -0
- /package/dist/{contexts → types/contexts}/ErrorReporter/index.d.ts +0 -0
- /package/dist/{contexts → types/contexts}/ErrorReporter/useRollbar.d.ts +0 -0
- /package/dist/{contexts → types/contexts}/index.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ThrownErrorBoundary = void 0;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const payload_model_1 = require("@xyo-network/payload-model");
|
6
|
+
const react_1 = require("react");
|
7
|
+
const ErrorRender_1 = require("../ErrorRender");
|
8
|
+
class ThrownErrorBoundary extends react_1.Component {
|
9
|
+
constructor() {
|
10
|
+
super(...arguments);
|
11
|
+
this.state = {
|
12
|
+
xyoError: undefined,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
static getDerivedStateFromError(error) {
|
16
|
+
return { hasError: true, xyoError: ThrownErrorBoundary.normalizeError(error) };
|
17
|
+
}
|
18
|
+
static normalizeError(error) {
|
19
|
+
return (error.schema === payload_model_1.ModuleErrorSchema ? error : { message: error.message, schema: payload_model_1.ModuleErrorSchema, sources: [] });
|
20
|
+
}
|
21
|
+
componentDidCatch(error, errorInfo) {
|
22
|
+
const { rethrow, rollbar } = this.props;
|
23
|
+
const { xyoError } = this.state;
|
24
|
+
rollbar === null || rollbar === void 0 ? void 0 : rollbar.error(error);
|
25
|
+
console.error('Error:', xyoError, errorInfo);
|
26
|
+
if (rethrow) {
|
27
|
+
throw error;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
render() {
|
31
|
+
const { xyoError } = this.state;
|
32
|
+
const { children, boundaryName, errorComponent } = this.props;
|
33
|
+
if (xyoError) {
|
34
|
+
if (errorComponent) {
|
35
|
+
return errorComponent(xyoError);
|
36
|
+
}
|
37
|
+
return (0, jsx_runtime_1.jsx)(ErrorRender_1.ErrorRender, { error: xyoError, errorContext: `${boundaryName} Boundary` });
|
38
|
+
}
|
39
|
+
return children;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
exports.ThrownErrorBoundary = ThrownErrorBoundary;
|
43
|
+
//# sourceMappingURL=ThrownErrorBoundary.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ThrownErrorBoundary.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/ThrownErrorBoundary.tsx"],"names":[],"mappings":";;;;AAAA,8DAA2E;AAC3E,iCAAuD;AAGvD,gDAA4C;AAc5C,MAAa,mBAAoB,SAAQ,iBAA6D;IAAtG;;QACkB,UAAK,GAA6B;YAChD,QAAQ,EAAE,SAAS;SACpB,CAAA;IAoCH,CAAC;IAlCC,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,iCAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,iCAAiB,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,aAAP,OAAO,uBAAP,OAAO,CAAE,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,uBAAC,yBAAW,IAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,YAAY,WAAW,GAAI,CAAA;SAClF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAvCD,kDAuCC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/index.ts"],"names":[],"mappings":";;;AAAA,gEAAqC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ErrorAlert = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const ExitToApp_1 = tslib_1.__importDefault(require("@mui/icons-material/ExitToApp"));
|
7
|
+
const material_1 = require("@mui/material");
|
8
|
+
const react_button_1 = require("@xylabs/react-button");
|
9
|
+
const ErrorAlert = (_a) => {
|
10
|
+
var { onCancel, error, errorContext } = _a, props = tslib_1.__rest(_a, ["onCancel", "error", "errorContext"]);
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Alert, Object.assign({ severity: "error" }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: "Whoops! Something went wrong" }), errorContext ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption", my: 0.5, lineHeight: "1", display: "block" }, { children: errorContext }))) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption", mr: 0.5, fontWeight: "bold" }, { children: "Error:" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: error === null || error === void 0 ? void 0 : error.message })), onCancel ? ((0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, Object.assign({ variant: "outlined", size: "small", onClick: onCancel, position: "absolute", style: { right: 8, top: 8 } }, { children: (0, jsx_runtime_1.jsx)(ExitToApp_1.default, { fontSize: "small" }) }))) : null] })));
|
12
|
+
};
|
13
|
+
exports.ErrorAlert = ErrorAlert;
|
14
|
+
//# sourceMappingURL=ErrorAlert.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx"],"names":[],"mappings":";;;;;AAAA,sFAAoD;AACpD,4CAAyE;AACzE,uDAA+C;AASxC,MAAM,UAAU,GAA8B,CAAC,EAA2C,EAAE,EAAE;QAA/C,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,OAAY,EAAP,KAAK,sBAAzC,qCAA2C,CAAF;IAC7F,OAAO,CACL,wBAAC,gBAAK,kBAAC,QAAQ,EAAC,OAAO,IAAK,KAAK,eAC/B,uBAAC,qBAAU,+CAA0C,EACpD,YAAY,CAAC,CAAC,CAAC,CACd,uBAAC,qBAAU,kBAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,GAAG,EAAC,OAAO,EAAC,OAAO,gBAClE,YAAY,IACF,CACd,CAAC,CAAC,CAAC,IAAI,EACR,uBAAC,qBAAU,kBAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,MAAM,4BAE3C,EACb,uBAAC,qBAAU,kBAAC,OAAO,EAAC,SAAS,gBAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,IAAc,EAC1D,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,uBAAQ,kBAAC,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,gBAC1G,uBAAC,mBAAQ,IAAC,QAAQ,EAAC,OAAO,GAAG,IACpB,CACZ,CAAC,CAAC,CAAC,IAAI,KACF,CACT,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,UAAU,cAoBtB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Props.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Props.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ErrorRender = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
7
|
+
const react_1 = require("react");
|
8
|
+
const react_router_dom_1 = require("react-router-dom");
|
9
|
+
const ErrorAlert_1 = require("./ErrorAlert");
|
10
|
+
const ErrorRender = (_a) => {
|
11
|
+
var _b;
|
12
|
+
var { onCancel, error, noErrorDisplay = false, customError = null, children, errorContext } = _a, props = tslib_1.__rest(_a, ["onCancel", "error", "noErrorDisplay", "customError", "children", "errorContext"]);
|
13
|
+
const location = (0, react_router_dom_1.useLocation)();
|
14
|
+
(0, react_1.useEffect)(() => {
|
15
|
+
// ensure we end up at the same place we are now after logging in
|
16
|
+
location.state = {
|
17
|
+
from: {
|
18
|
+
pathname: window.location.pathname,
|
19
|
+
},
|
20
|
+
};
|
21
|
+
}, [location]);
|
22
|
+
if (error) {
|
23
|
+
return ((0, jsx_runtime_1.jsx)(react_flexbox_1.FlexCol, Object.assign({ alignItems: "stretch" }, props, { children: noErrorDisplay ? (customError) : ((0, jsx_runtime_1.jsx)(react_flexbox_1.FlexCol, Object.assign({ alignItems: "center" }, props, { children: (0, jsx_runtime_1.jsx)(ErrorAlert_1.ErrorAlert, { error: error, errorContext: errorContext, onCancel: onCancel }) }))) })));
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
return (_b = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })) !== null && _b !== void 0 ? _b : null;
|
27
|
+
}
|
28
|
+
};
|
29
|
+
exports.ErrorRender = ErrorRender;
|
30
|
+
//# sourceMappingURL=Render.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Render.tsx"],"names":[],"mappings":";;;;;AAAA,yDAA+C;AAC/C,iCAAiC;AACjC,uDAA8C;AAE9C,6CAAyC;AAGlC,MAAM,WAAW,GAA+B,CAAC,EAQvD,EAAE,EAAE;;QARmD,EACtD,QAAQ,EACR,KAAK,EACL,cAAc,GAAG,KAAK,EACtB,WAAW,GAAG,IAAI,EAClB,QAAQ,EACR,YAAY,OAEb,EADI,KAAK,sBAP8C,kFAQvD,CADS;IAER,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAA;IAC9B,IAAA,iBAAS,EAAC,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,uBAAC,uBAAO,kBAAC,UAAU,EAAC,SAAS,IAAK,KAAK,cACpC,cAAc,CAAC,CAAC,CAAC,CAChB,WAAW,CACZ,CAAC,CAAC,CAAC,CACF,uBAAC,uBAAO,kBAAC,UAAU,EAAC,QAAQ,IAAK,KAAK,cACpC,uBAAC,uBAAU,IAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,IACpE,CACX,IACO,CACX,CAAA;KACF;SAAM;QACL,OAAO,MAAA,2DAAG,QAAQ,GAAI,mCAAI,IAAI,CAAA;KAC/B;AACH,CAAC,CAAA;AAlCY,QAAA,WAAW,eAkCvB"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./ErrorAlert"), exports);
|
5
|
+
tslib_1.__exportStar(require("./Props"), exports);
|
6
|
+
tslib_1.__exportStar(require("./Render"), exports);
|
7
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,kDAAuB;AACvB,mDAAwB"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./ErrorBoundary"), exports);
|
5
|
+
tslib_1.__exportStar(require("./ErrorRender"), exports);
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B;AAC/B,wDAA6B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/Context.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAIxB,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAA4B,EAAE,CAAC,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ErrorReporterProvider = void 0;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const react_1 = require("react");
|
6
|
+
const Context_1 = require("./Context");
|
7
|
+
const ErrorReporterProvider = ({ children, rollbar }) => {
|
8
|
+
const [rollbarInstance, setRollBarInstance] = (0, react_1.useState)();
|
9
|
+
(0, react_1.useEffect)(() => {
|
10
|
+
if (rollbarInstance) {
|
11
|
+
setRollBarInstance(rollbarInstance);
|
12
|
+
}
|
13
|
+
}, [rollbar, rollbarInstance]);
|
14
|
+
return (0, jsx_runtime_1.jsx)(Context_1.ErrorReporterContext.Provider, Object.assign({ value: { rollbar } }, { children: children }));
|
15
|
+
};
|
16
|
+
exports.ErrorReporterProvider = ErrorReporterProvider;
|
17
|
+
//# sourceMappingURL=Provider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/Provider.tsx"],"names":[],"mappings":";;;;AACA,iCAA2C;AAG3C,uCAAgD;AAMhD,MAAM,qBAAqB,GAAuD,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1G,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,GAAW,CAAA;IAEjE,IAAA,iBAAS,EAAC,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,uBAAC,8BAAoB,CAAC,QAAQ,kBAAC,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAG,QAAQ,IAAiC,CAAA;AACtG,CAAC,CAAA;AAEQ,sDAAqB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"State.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/State.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./Provider"), exports);
|
5
|
+
tslib_1.__exportStar(require("./State"), exports);
|
6
|
+
tslib_1.__exportStar(require("./useRollbar"), exports);
|
7
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,kDAAuB;AACvB,uDAA4B"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.useRollbar = void 0;
|
4
|
+
const react_1 = require("react");
|
5
|
+
const Context_1 = require("./Context");
|
6
|
+
const useRollbar = () => {
|
7
|
+
const context = (0, react_1.useContext)(Context_1.ErrorReporterContext);
|
8
|
+
if (context === undefined) {
|
9
|
+
console.warn('useRollbar must be used within a ErrorReporterContext');
|
10
|
+
}
|
11
|
+
return context !== null && context !== void 0 ? context : {};
|
12
|
+
};
|
13
|
+
exports.useRollbar = useRollbar;
|
14
|
+
//# sourceMappingURL=useRollbar.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useRollbar.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/useRollbar.tsx"],"names":[],"mappings":";;;AAAA,iCAAkC;AAElC,uCAAgD;AAEhD,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,8BAAoB,CAAC,CAAA;IAChD,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAA;KACtE;IAED,OAAO,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAA;AACtB,CAAC,CAAA;AAEQ,gCAAU"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,qDAA0B"}
|