@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.
Files changed (136) hide show
  1. package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.mts.map +1 -0
  2. package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.ts +21 -0
  3. package/dist/components/ErrorBoundary/ThrownErrorBoundary.d.ts.map +1 -0
  4. package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.mts +7 -0
  5. package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.mts.map +1 -0
  6. package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.ts +7 -0
  7. package/dist/components/ErrorBoundary/ThrownErrorBoundary.stories.d.ts.map +1 -0
  8. package/dist/components/ErrorBoundary/index.d.mts.map +1 -0
  9. package/dist/{esm/components/ErrorBoundary/index.js → components/ErrorBoundary/index.d.ts} +1 -1
  10. package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
  11. package/dist/components/ErrorRender/ErrorAlert.d.mts.map +1 -0
  12. package/dist/components/ErrorRender/ErrorAlert.d.ts +10 -0
  13. package/dist/components/ErrorRender/ErrorAlert.d.ts.map +1 -0
  14. package/dist/components/ErrorRender/Props.d.mts.map +1 -0
  15. package/dist/components/ErrorRender/Props.d.ts +12 -0
  16. package/dist/components/ErrorRender/Props.d.ts.map +1 -0
  17. package/dist/components/ErrorRender/Render.d.mts.map +1 -0
  18. package/dist/components/ErrorRender/Render.d.ts +4 -0
  19. package/dist/components/ErrorRender/Render.d.ts.map +1 -0
  20. package/dist/components/ErrorRender/index.d.mts.map +1 -0
  21. package/dist/{esm/components/ErrorRender/index.js → components/ErrorRender/index.d.ts} +1 -1
  22. package/dist/components/ErrorRender/index.d.ts.map +1 -0
  23. package/dist/components/index.d.mts.map +1 -0
  24. package/dist/{esm/components/index.js → components/index.d.ts} +1 -1
  25. package/dist/components/index.d.ts.map +1 -0
  26. package/dist/contexts/ErrorReporter/Context.d.mts.map +1 -0
  27. package/dist/contexts/ErrorReporter/Context.d.ts +4 -0
  28. package/dist/contexts/ErrorReporter/Context.d.ts.map +1 -0
  29. package/dist/contexts/ErrorReporter/Provider.d.mts.map +1 -0
  30. package/dist/contexts/ErrorReporter/Provider.d.ts +9 -0
  31. package/dist/contexts/ErrorReporter/Provider.d.ts.map +1 -0
  32. package/dist/contexts/ErrorReporter/Provider.stories.d.mts +10 -0
  33. package/dist/contexts/ErrorReporter/Provider.stories.d.mts.map +1 -0
  34. package/dist/contexts/ErrorReporter/Provider.stories.d.ts +10 -0
  35. package/dist/contexts/ErrorReporter/Provider.stories.d.ts.map +1 -0
  36. package/dist/contexts/ErrorReporter/State.d.mts.map +1 -0
  37. package/dist/contexts/ErrorReporter/State.d.ts +5 -0
  38. package/dist/contexts/ErrorReporter/State.d.ts.map +1 -0
  39. package/dist/contexts/ErrorReporter/index.d.mts.map +1 -0
  40. package/dist/{esm/contexts/ErrorReporter/index.js → contexts/ErrorReporter/index.d.ts} +1 -1
  41. package/dist/contexts/ErrorReporter/index.d.ts.map +1 -0
  42. package/dist/contexts/ErrorReporter/useRollbar.d.mts.map +1 -0
  43. package/dist/contexts/ErrorReporter/useRollbar.d.ts +3 -0
  44. package/dist/contexts/ErrorReporter/useRollbar.d.ts.map +1 -0
  45. package/dist/contexts/index.d.mts.map +1 -0
  46. package/dist/contexts/index.d.ts +2 -0
  47. package/dist/contexts/index.d.ts.map +1 -0
  48. package/dist/index.d.mts.map +1 -0
  49. package/dist/{esm/index.js → index.d.ts} +1 -1
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +149 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/index.mjs +118 -0
  54. package/dist/index.mjs.map +1 -0
  55. package/package.json +28 -19
  56. package/src/components/ErrorRender/ErrorAlert.tsx +1 -1
  57. package/dist/cjs/components/ErrorBoundary/ThrownErrorBoundary.js +0 -43
  58. package/dist/cjs/components/ErrorBoundary/ThrownErrorBoundary.js.map +0 -1
  59. package/dist/cjs/components/ErrorBoundary/index.js +0 -5
  60. package/dist/cjs/components/ErrorBoundary/index.js.map +0 -1
  61. package/dist/cjs/components/ErrorRender/ErrorAlert.js +0 -14
  62. package/dist/cjs/components/ErrorRender/ErrorAlert.js.map +0 -1
  63. package/dist/cjs/components/ErrorRender/Props.js +0 -3
  64. package/dist/cjs/components/ErrorRender/Props.js.map +0 -1
  65. package/dist/cjs/components/ErrorRender/Render.js +0 -30
  66. package/dist/cjs/components/ErrorRender/Render.js.map +0 -1
  67. package/dist/cjs/components/ErrorRender/index.js +0 -7
  68. package/dist/cjs/components/ErrorRender/index.js.map +0 -1
  69. package/dist/cjs/components/index.js +0 -6
  70. package/dist/cjs/components/index.js.map +0 -1
  71. package/dist/cjs/contexts/ErrorReporter/Context.js +0 -6
  72. package/dist/cjs/contexts/ErrorReporter/Context.js.map +0 -1
  73. package/dist/cjs/contexts/ErrorReporter/Provider.js +0 -17
  74. package/dist/cjs/contexts/ErrorReporter/Provider.js.map +0 -1
  75. package/dist/cjs/contexts/ErrorReporter/State.js +0 -3
  76. package/dist/cjs/contexts/ErrorReporter/State.js.map +0 -1
  77. package/dist/cjs/contexts/ErrorReporter/index.js +0 -7
  78. package/dist/cjs/contexts/ErrorReporter/index.js.map +0 -1
  79. package/dist/cjs/contexts/ErrorReporter/useRollbar.js +0 -14
  80. package/dist/cjs/contexts/ErrorReporter/useRollbar.js.map +0 -1
  81. package/dist/cjs/contexts/index.js +0 -5
  82. package/dist/cjs/contexts/index.js.map +0 -1
  83. package/dist/cjs/index.js +0 -6
  84. package/dist/cjs/index.js.map +0 -1
  85. package/dist/docs.json +0 -25215
  86. package/dist/esm/components/ErrorBoundary/ThrownErrorBoundary.js +0 -36
  87. package/dist/esm/components/ErrorBoundary/ThrownErrorBoundary.js.map +0 -1
  88. package/dist/esm/components/ErrorBoundary/index.js.map +0 -1
  89. package/dist/esm/components/ErrorRender/ErrorAlert.js +0 -8
  90. package/dist/esm/components/ErrorRender/ErrorAlert.js.map +0 -1
  91. package/dist/esm/components/ErrorRender/Props.js +0 -2
  92. package/dist/esm/components/ErrorRender/Props.js.map +0 -1
  93. package/dist/esm/components/ErrorRender/Render.js +0 -23
  94. package/dist/esm/components/ErrorRender/Render.js.map +0 -1
  95. package/dist/esm/components/ErrorRender/index.js.map +0 -1
  96. package/dist/esm/components/index.js.map +0 -1
  97. package/dist/esm/contexts/ErrorReporter/Context.js +0 -3
  98. package/dist/esm/contexts/ErrorReporter/Context.js.map +0 -1
  99. package/dist/esm/contexts/ErrorReporter/Provider.js +0 -14
  100. package/dist/esm/contexts/ErrorReporter/Provider.js.map +0 -1
  101. package/dist/esm/contexts/ErrorReporter/State.js +0 -2
  102. package/dist/esm/contexts/ErrorReporter/State.js.map +0 -1
  103. package/dist/esm/contexts/ErrorReporter/index.js.map +0 -1
  104. package/dist/esm/contexts/ErrorReporter/useRollbar.js +0 -11
  105. package/dist/esm/contexts/ErrorReporter/useRollbar.js.map +0 -1
  106. package/dist/esm/contexts/index.js +0 -2
  107. package/dist/esm/contexts/index.js.map +0 -1
  108. package/dist/esm/index.js.map +0 -1
  109. package/dist/types/components/ErrorBoundary/ThrownErrorBoundary.d.ts.map +0 -1
  110. package/dist/types/components/ErrorBoundary/index.d.ts.map +0 -1
  111. package/dist/types/components/ErrorRender/ErrorAlert.d.ts.map +0 -1
  112. package/dist/types/components/ErrorRender/Props.d.ts.map +0 -1
  113. package/dist/types/components/ErrorRender/Render.d.ts.map +0 -1
  114. package/dist/types/components/ErrorRender/index.d.ts.map +0 -1
  115. package/dist/types/components/index.d.ts.map +0 -1
  116. package/dist/types/contexts/ErrorReporter/Context.d.ts.map +0 -1
  117. package/dist/types/contexts/ErrorReporter/Provider.d.ts.map +0 -1
  118. package/dist/types/contexts/ErrorReporter/State.d.ts.map +0 -1
  119. package/dist/types/contexts/ErrorReporter/index.d.ts.map +0 -1
  120. package/dist/types/contexts/ErrorReporter/useRollbar.d.ts.map +0 -1
  121. package/dist/types/contexts/index.d.ts.map +0 -1
  122. package/dist/types/index.d.ts.map +0 -1
  123. /package/dist/{types/components/ErrorBoundary/ThrownErrorBoundary.d.ts → components/ErrorBoundary/ThrownErrorBoundary.d.mts} +0 -0
  124. /package/dist/{types/components/ErrorBoundary/index.d.ts → components/ErrorBoundary/index.d.mts} +0 -0
  125. /package/dist/{types/components/ErrorRender/ErrorAlert.d.ts → components/ErrorRender/ErrorAlert.d.mts} +0 -0
  126. /package/dist/{types/components/ErrorRender/Props.d.ts → components/ErrorRender/Props.d.mts} +0 -0
  127. /package/dist/{types/components/ErrorRender/Render.d.ts → components/ErrorRender/Render.d.mts} +0 -0
  128. /package/dist/{types/components/ErrorRender/index.d.ts → components/ErrorRender/index.d.mts} +0 -0
  129. /package/dist/{types/components/index.d.ts → components/index.d.mts} +0 -0
  130. /package/dist/{types/contexts/ErrorReporter/Context.d.ts → contexts/ErrorReporter/Context.d.mts} +0 -0
  131. /package/dist/{types/contexts/ErrorReporter/Provider.d.ts → contexts/ErrorReporter/Provider.d.mts} +0 -0
  132. /package/dist/{types/contexts/ErrorReporter/State.d.ts → contexts/ErrorReporter/State.d.mts} +0 -0
  133. /package/dist/{types/contexts/ErrorReporter/index.d.ts → contexts/ErrorReporter/index.d.mts} +0 -0
  134. /package/dist/{types/contexts/ErrorReporter/useRollbar.d.ts → contexts/ErrorReporter/useRollbar.d.mts} +0 -0
  135. /package/dist/{types/contexts/index.d.ts → contexts/index.d.mts} +0 -0
  136. /package/dist/{types/index.d.ts → index.d.mts} +0 -0
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": "~2.19.1",
14
- "@xylabs/react-flexbox": "~2.19.1",
15
- "@xylabs/react-shared": "~2.19.1",
16
- "@xyo-network/payload-model": "^2.74.3"
13
+ "@xylabs/react-button": "^3.1.0-rc.3",
14
+ "@xylabs/react-flexbox": "^3.1.0-rc.3",
15
+ "@xylabs/react-shared": "^3.1.0-rc.3",
16
+ "@xyo-network/payload-model": "^2.74.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.3",
29
- "@xylabs/ts-scripts-yarn3": "^2.19.12",
30
- "@xylabs/tsconfig-react": "^2.19.12",
29
+ "@xylabs/ts-scripts-yarn3": "^3.0.28",
30
+ "@xylabs/tsconfig-react": "^3.0.28",
31
31
  "typescript": "^5.2.2"
32
32
  },
33
33
  "peerDependenciesMeta": {
@@ -36,27 +36,35 @@
36
36
  }
37
37
  },
38
38
  "description": "Common React library for all XYO projects that use React",
39
- "browser": "dist/esm/index.js",
40
39
  "docs": "dist/docs.json",
41
40
  "exports": {
42
41
  ".": {
43
42
  "node": {
44
- "import": "./dist/esm/index.js",
45
- "require": "./dist/cjs/index.js"
43
+ "import": {
44
+ "types": "./dist/index.d.mts",
45
+ "default": "./dist/index.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./dist/index.d.ts",
49
+ "default": "./dist/index.js"
50
+ }
46
51
  },
47
52
  "browser": {
48
- "import": "./dist/esm/index.js",
49
- "require": "./dist/cjs/index.js"
53
+ "import": {
54
+ "types": "./dist/index.d.mts",
55
+ "default": "./dist/index.mjs"
56
+ },
57
+ "require": {
58
+ "types": "./dist/index.d.ts",
59
+ "default": "./dist/index.js"
60
+ }
50
61
  },
51
- "default": "./dist/esm/index.js"
52
- },
53
- "./dist/docs.json": {
54
- "default": "./dist/docs.json"
62
+ "default": "./dist/index.mjs"
55
63
  },
56
64
  "./package.json": "./package.json"
57
65
  },
58
- "main": "dist/cjs/index.js",
59
- "module": "dist/esm/index.js",
66
+ "main": "dist/index.js",
67
+ "module": "dist/index.mjs",
60
68
  "homepage": "https://xyo.network",
61
69
  "keywords": [
62
70
  "xyo",
@@ -77,6 +85,7 @@
77
85
  "license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
78
86
  },
79
87
  "sideEffects": false,
80
- "types": "dist/types/index.d.ts",
81
- "version": "2.63.1"
88
+ "types": "dist/index.d.ts",
89
+ "version": "2.64.0-rc.2",
90
+ "stableVersion": "2.63.1"
82
91
  }
@@ -1,4 +1,4 @@
1
- import ExitIcon from '@mui/icons-material/ExitToApp'
1
+ import { ExitToApp as ExitIcon } from '@mui/icons-material'
2
2
  import { Alert, AlertProps, AlertTitle, Typography } from '@mui/material'
3
3
  import { ButtonEx } from '@xylabs/react-button'
4
4
  import { ModuleError } from '@xyo-network/payload-model'
@@ -1,43 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./ThrownErrorBoundary"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/index.ts"],"names":[],"mappings":";;;AAAA,gEAAqC"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Props.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Props.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/Props.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ErrorRender/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,kDAAuB;AACvB,mDAAwB"}
@@ -1,6 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B;AAC/B,wDAA6B"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ErrorReporterContext = void 0;
4
- const react_1 = require("react");
5
- exports.ErrorReporterContext = (0, react_1.createContext)({});
6
- //# sourceMappingURL=Context.js.map
@@ -1 +0,0 @@
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"}
@@ -1,17 +0,0 @@
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
@@ -1 +0,0 @@
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,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=State.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"State.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/State.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/contexts/ErrorReporter/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,kDAAuB;AACvB,uDAA4B"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./ErrorReporter"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B"}
package/dist/cjs/index.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./components"), exports);
5
- tslib_1.__exportStar(require("./contexts"), exports);
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,qDAA0B"}