@xyo-network/react-error 2.56.0 → 2.56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorAlert = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const ExitToApp_1 = tslib_1.__importDefault(require("@mui/icons-material/ExitToApp"));
6
7
  const material_1 = require("@mui/material");
8
+ const react_button_1 = require("@xylabs/react-button");
7
9
  const ErrorAlert = (_a) => {
8
- var { error, errorContext } = _a, props = tslib_1.__rest(_a, ["error", "errorContext"]);
9
- 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 }))] })));
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, { variant: "caption", my: 0.5, lineHeight: "1", display: "block", children: errorContext })) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", mr: 0.5, fontWeight: "bold", children: "Error:" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: error === null || error === void 0 ? void 0 : error.message }), onCancel ? ((0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, { 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] })));
10
12
  };
11
13
  exports.ErrorAlert = ErrorAlert;
12
14
  //# sourceMappingURL=ErrorAlert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/ErrorAlert.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAyE;AAQlE,MAAM,UAAU,GAA8B,CAAC,EAAiC,EAAE,EAAE;QAArC,EAAE,KAAK,EAAE,YAAY,OAAY,EAAP,KAAK,sBAA/B,yBAAiC,CAAF;IACnF,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,KACrD,CACT,CAAA;AACH,CAAC,CAAA;AAfY,QAAA,UAAU,cAetB"}
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,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,uBAAC,qBAAU,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,MAAM,uBAE3C,EACb,uBAAC,qBAAU,IAAC,OAAO,EAAC,SAAS,YAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,GAAc,EAC1D,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,uBAAQ,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,uBAAC,mBAAQ,IAAC,QAAQ,EAAC,OAAO,GAAG,GACpB,CACZ,CAAC,CAAC,CAAC,IAAI,KACF,CACT,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,UAAU,cAoBtB"}
@@ -9,7 +9,7 @@ const react_router_dom_1 = require("react-router-dom");
9
9
  const ErrorAlert_1 = require("./ErrorAlert");
10
10
  const ErrorRender = (_a) => {
11
11
  var _b;
12
- var { error, noErrorDisplay = false, customError = null, children, errorContext } = _a, props = tslib_1.__rest(_a, ["error", "noErrorDisplay", "customError", "children", "errorContext"]);
12
+ var { onCancel, error, noErrorDisplay = false, customError = null, children, errorContext } = _a, props = tslib_1.__rest(_a, ["onCancel", "error", "noErrorDisplay", "customError", "children", "errorContext"]);
13
13
  const location = (0, react_router_dom_1.useLocation)();
14
14
  (0, react_1.useEffect)(() => {
15
15
  // ensure we end up at the same place we are now after logging in
@@ -20,7 +20,7 @@ const ErrorRender = (_a) => {
20
20
  };
21
21
  }, [location]);
22
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 }) }))) })));
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
24
  }
25
25
  else {
26
26
  return (_b = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })) !== null && _b !== void 0 ? _b : null;
@@ -1 +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,EAAuF,EAAE,EAAE;;QAA3F,EAAE,KAAK,EAAE,cAAc,GAAG,KAAK,EAAE,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,YAAY,OAAY,EAAP,KAAK,sBAArF,sEAAuF,CAAF;IAC3I,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAA;IAC9B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,iEAAiE;QACjE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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"}
@@ -11,7 +11,7 @@ const ErrorReporterProvider = ({ children, rollbar }) => {
11
11
  setRollBarInstance(rollbarInstance);
12
12
  }
13
13
  }, [rollbar, rollbarInstance]);
14
- return (0, jsx_runtime_1.jsx)(Context_1.ErrorReporterContext.Provider, Object.assign({ value: { rollbar } }, { children: children }));
14
+ return (0, jsx_runtime_1.jsx)(Context_1.ErrorReporterContext.Provider, { value: { rollbar }, children: children });
15
15
  };
16
16
  exports.ErrorReporterProvider = ErrorReporterProvider;
17
17
  //# sourceMappingURL=Provider.js.map
@@ -1 +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"}
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,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,YAAG,QAAQ,GAAiC,CAAA;AACtG,CAAC,CAAA;AAEQ,sDAAqB"}