@xyo-network/react-error 2.64.9 → 2.65.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +7 -7
- package/dist/browser/components/ErrorBoundary/ThrownErrorBoundary.cjs +0 -106
- package/dist/browser/components/ErrorBoundary/ThrownErrorBoundary.cjs.map +0 -1
- package/dist/browser/components/ErrorBoundary/ThrownErrorBoundary.js +0 -85
- package/dist/browser/components/ErrorBoundary/ThrownErrorBoundary.js.map +0 -1
- package/dist/browser/components/ErrorBoundary/index.cjs +0 -108
- package/dist/browser/components/ErrorBoundary/index.cjs.map +0 -1
- package/dist/browser/components/ErrorBoundary/index.js +0 -85
- package/dist/browser/components/ErrorBoundary/index.js.map +0 -1
- package/dist/browser/components/ErrorRender/ErrorAlert.cjs +0 -39
- package/dist/browser/components/ErrorRender/ErrorAlert.cjs.map +0 -1
- package/dist/browser/components/ErrorRender/ErrorAlert.js +0 -18
- package/dist/browser/components/ErrorRender/ErrorAlert.js.map +0 -1
- package/dist/browser/components/ErrorRender/Props.cjs +0 -19
- package/dist/browser/components/ErrorRender/Props.cjs.map +0 -1
- package/dist/browser/components/ErrorRender/Props.js +0 -1
- package/dist/browser/components/ErrorRender/Props.js.map +0 -1
- package/dist/browser/components/ErrorRender/Render.cjs +0 -70
- package/dist/browser/components/ErrorRender/Render.cjs.map +0 -1
- package/dist/browser/components/ErrorRender/Render.js +0 -49
- package/dist/browser/components/ErrorRender/Render.js.map +0 -1
- package/dist/browser/components/ErrorRender/index.cjs +0 -71
- package/dist/browser/components/ErrorRender/index.cjs.map +0 -1
- package/dist/browser/components/ErrorRender/index.js +0 -48
- package/dist/browser/components/ErrorRender/index.js.map +0 -1
- package/dist/browser/components/index.cjs +0 -110
- package/dist/browser/components/index.cjs.map +0 -1
- package/dist/browser/components/index.js +0 -87
- package/dist/browser/components/index.js.map +0 -1
- package/dist/browser/contexts/ErrorReporter/Context.cjs +0 -28
- package/dist/browser/contexts/ErrorReporter/Context.cjs.map +0 -1
- package/dist/browser/contexts/ErrorReporter/Context.js +0 -7
- package/dist/browser/contexts/ErrorReporter/Context.js.map +0 -1
- package/dist/browser/contexts/ErrorReporter/Provider.cjs +0 -43
- package/dist/browser/contexts/ErrorReporter/Provider.cjs.map +0 -1
- package/dist/browser/contexts/ErrorReporter/Provider.js +0 -22
- package/dist/browser/contexts/ErrorReporter/Provider.js.map +0 -1
- package/dist/browser/contexts/ErrorReporter/State.cjs +0 -19
- package/dist/browser/contexts/ErrorReporter/State.cjs.map +0 -1
- package/dist/browser/contexts/ErrorReporter/State.js +0 -1
- package/dist/browser/contexts/ErrorReporter/State.js.map +0 -1
- package/dist/browser/contexts/ErrorReporter/index.cjs +0 -56
- package/dist/browser/contexts/ErrorReporter/index.cjs.map +0 -1
- package/dist/browser/contexts/ErrorReporter/index.js +0 -33
- package/dist/browser/contexts/ErrorReporter/index.js.map +0 -1
- package/dist/browser/contexts/ErrorReporter/useRollbar.cjs +0 -40
- package/dist/browser/contexts/ErrorReporter/useRollbar.cjs.map +0 -1
- package/dist/browser/contexts/ErrorReporter/useRollbar.js +0 -19
- package/dist/browser/contexts/ErrorReporter/useRollbar.js.map +0 -1
- package/dist/browser/contexts/index.cjs +0 -56
- package/dist/browser/contexts/index.cjs.map +0 -1
- package/dist/browser/contexts/index.js +0 -33
- package/dist/browser/contexts/index.js.map +0 -1
- package/dist/docs.json +0 -25215
- package/dist/node/components/ErrorBoundary/ThrownErrorBoundary.cjs +0 -110
- package/dist/node/components/ErrorBoundary/ThrownErrorBoundary.cjs.map +0 -1
- package/dist/node/components/ErrorBoundary/ThrownErrorBoundary.js +0 -85
- package/dist/node/components/ErrorBoundary/ThrownErrorBoundary.js.map +0 -1
- package/dist/node/components/ErrorBoundary/index.cjs +0 -112
- package/dist/node/components/ErrorBoundary/index.cjs.map +0 -1
- package/dist/node/components/ErrorBoundary/index.js +0 -85
- package/dist/node/components/ErrorBoundary/index.js.map +0 -1
- package/dist/node/components/ErrorRender/ErrorAlert.cjs +0 -43
- package/dist/node/components/ErrorRender/ErrorAlert.cjs.map +0 -1
- package/dist/node/components/ErrorRender/ErrorAlert.js +0 -18
- package/dist/node/components/ErrorRender/ErrorAlert.js.map +0 -1
- package/dist/node/components/ErrorRender/Props.cjs +0 -19
- package/dist/node/components/ErrorRender/Props.cjs.map +0 -1
- package/dist/node/components/ErrorRender/Props.js +0 -1
- package/dist/node/components/ErrorRender/Props.js.map +0 -1
- package/dist/node/components/ErrorRender/Render.cjs +0 -74
- package/dist/node/components/ErrorRender/Render.cjs.map +0 -1
- package/dist/node/components/ErrorRender/Render.js +0 -49
- package/dist/node/components/ErrorRender/Render.js.map +0 -1
- package/dist/node/components/ErrorRender/index.cjs +0 -76
- package/dist/node/components/ErrorRender/index.cjs.map +0 -1
- package/dist/node/components/ErrorRender/index.js +0 -48
- package/dist/node/components/ErrorRender/index.js.map +0 -1
- package/dist/node/components/index.cjs +0 -116
- package/dist/node/components/index.cjs.map +0 -1
- package/dist/node/components/index.js +0 -87
- package/dist/node/components/index.js.map +0 -1
- package/dist/node/contexts/ErrorReporter/Context.cjs +0 -32
- package/dist/node/contexts/ErrorReporter/Context.cjs.map +0 -1
- package/dist/node/contexts/ErrorReporter/Context.js +0 -7
- package/dist/node/contexts/ErrorReporter/Context.js.map +0 -1
- package/dist/node/contexts/ErrorReporter/Provider.cjs +0 -47
- package/dist/node/contexts/ErrorReporter/Provider.cjs.map +0 -1
- package/dist/node/contexts/ErrorReporter/Provider.js +0 -22
- package/dist/node/contexts/ErrorReporter/Provider.js.map +0 -1
- package/dist/node/contexts/ErrorReporter/State.cjs +0 -19
- package/dist/node/contexts/ErrorReporter/State.cjs.map +0 -1
- package/dist/node/contexts/ErrorReporter/State.js +0 -1
- package/dist/node/contexts/ErrorReporter/State.js.map +0 -1
- package/dist/node/contexts/ErrorReporter/index.cjs +0 -61
- package/dist/node/contexts/ErrorReporter/index.cjs.map +0 -1
- package/dist/node/contexts/ErrorReporter/index.js +0 -33
- package/dist/node/contexts/ErrorReporter/index.js.map +0 -1
- package/dist/node/contexts/ErrorReporter/useRollbar.cjs +0 -44
- package/dist/node/contexts/ErrorReporter/useRollbar.cjs.map +0 -1
- package/dist/node/contexts/ErrorReporter/useRollbar.js +0 -19
- package/dist/node/contexts/ErrorReporter/useRollbar.js.map +0 -1
- package/dist/node/contexts/index.cjs +0 -61
- package/dist/node/contexts/index.cjs.map +0 -1
- package/dist/node/contexts/index.js +0 -33
- package/dist/node/contexts/index.js.map +0 -1
@@ -1,22 +0,0 @@
|
|
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
|
-
export {
|
20
|
-
ErrorReporterProvider
|
21
|
-
};
|
22
|
-
//# sourceMappingURL=Provider.js.map
|
@@ -1 +0,0 @@
|
|
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,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
-
for (let key of __getOwnPropNames(from))
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
-
}
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
15
|
-
|
16
|
-
// src/contexts/ErrorReporter/State.ts
|
17
|
-
var State_exports = {};
|
18
|
-
module.exports = __toCommonJS(State_exports);
|
19
|
-
//# sourceMappingURL=State.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/State.ts"],"sourcesContent":["import Rollbar from 'rollbar'\n\nexport interface ErrorReporterContextState {\n rollbar?: Rollbar\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
//# sourceMappingURL=State.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/ErrorReporter/index.ts
|
21
|
-
var ErrorReporter_exports = {};
|
22
|
-
__export(ErrorReporter_exports, {
|
23
|
-
ErrorReporterProvider: () => ErrorReporterProvider,
|
24
|
-
useRollbar: () => useRollbar
|
25
|
-
});
|
26
|
-
module.exports = __toCommonJS(ErrorReporter_exports);
|
27
|
-
|
28
|
-
// src/contexts/ErrorReporter/Provider.tsx
|
29
|
-
var import_react2 = require("react");
|
30
|
-
|
31
|
-
// src/contexts/ErrorReporter/Context.ts
|
32
|
-
var import_react = require("react");
|
33
|
-
var ErrorReporterContext = (0, import_react.createContext)({});
|
34
|
-
|
35
|
-
// src/contexts/ErrorReporter/Provider.tsx
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
37
|
-
var ErrorReporterProvider = ({ children, rollbar }) => {
|
38
|
-
const [rollbarInstance, setRollBarInstance] = (0, import_react2.useState)();
|
39
|
-
(0, import_react2.useEffect)(() => {
|
40
|
-
if (rollbarInstance) {
|
41
|
-
setRollBarInstance(rollbarInstance);
|
42
|
-
}
|
43
|
-
}, [rollbar, rollbarInstance]);
|
44
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorReporterContext.Provider, { value: { rollbar }, children });
|
45
|
-
};
|
46
|
-
|
47
|
-
// src/contexts/ErrorReporter/useRollbar.tsx
|
48
|
-
var import_react3 = require("react");
|
49
|
-
var useRollbar = () => {
|
50
|
-
const context = (0, import_react3.useContext)(ErrorReporterContext);
|
51
|
-
if (context === void 0) {
|
52
|
-
console.warn("useRollbar must be used within a ErrorReporterContext");
|
53
|
-
}
|
54
|
-
return context ?? {};
|
55
|
-
};
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
57
|
-
0 && (module.exports = {
|
58
|
-
ErrorReporterProvider,
|
59
|
-
useRollbar
|
60
|
-
});
|
61
|
-
//# sourceMappingURL=index.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ErrorReporter/index.ts","../../../../src/contexts/ErrorReporter/Provider.tsx","../../../../src/contexts/ErrorReporter/Context.ts","../../../../src/contexts/ErrorReporter/useRollbar.tsx"],"sourcesContent":["export * from './Provider'\nexport * from './State'\nexport * from './useRollbar'\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;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,gBAAoC;;;ACDpC,mBAA8B;AAIvB,IAAM,2BAAuB,4BAAyC,CAAC,CAAC;;;ADetE;AATT,IAAM,wBAA4E,CAAC,EAAE,UAAU,QAAQ,MAAM;AAC3G,QAAM,CAAC,iBAAiB,kBAAkB,QAAI,wBAAkB;AAEhE,+BAAU,MAAM;AACd,QAAI,iBAAiB;AACnB,yBAAmB,eAAe;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,SAAS,eAAe,CAAC;AAE7B,SAAO,4CAAC,qBAAqB,UAArB,EAA8B,OAAO,EAAE,QAAQ,GAAI,UAAS;AACtE;;;AEpBA,IAAAC,gBAA2B;AAI3B,IAAM,aAAa,MAAM;AACvB,QAAM,cAAU,0BAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":["import_react","import_react"]}
|
@@ -1,33 +0,0 @@
|
|
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
|
-
};
|
33
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
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,44 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/ErrorReporter/useRollbar.tsx
|
21
|
-
var useRollbar_exports = {};
|
22
|
-
__export(useRollbar_exports, {
|
23
|
-
useRollbar: () => useRollbar
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(useRollbar_exports);
|
26
|
-
var import_react2 = require("react");
|
27
|
-
|
28
|
-
// src/contexts/ErrorReporter/Context.ts
|
29
|
-
var import_react = require("react");
|
30
|
-
var ErrorReporterContext = (0, import_react.createContext)({});
|
31
|
-
|
32
|
-
// src/contexts/ErrorReporter/useRollbar.tsx
|
33
|
-
var useRollbar = () => {
|
34
|
-
const context = (0, import_react2.useContext)(ErrorReporterContext);
|
35
|
-
if (context === void 0) {
|
36
|
-
console.warn("useRollbar must be used within a ErrorReporterContext");
|
37
|
-
}
|
38
|
-
return context ?? {};
|
39
|
-
};
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
41
|
-
0 && (module.exports = {
|
42
|
-
useRollbar
|
43
|
-
});
|
44
|
-
//# sourceMappingURL=useRollbar.cjs.map
|
@@ -1 +0,0 @@
|
|
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;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA2B;;;ACA3B,mBAA8B;AAIvB,IAAM,2BAAuB,4BAAyC,CAAC,CAAC;;;ADA/E,IAAM,aAAa,MAAM;AACvB,QAAM,cAAU,0BAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":["import_react"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
// src/contexts/ErrorReporter/useRollbar.tsx
|
2
|
-
import { useContext } from "react";
|
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 = () => {
|
10
|
-
const context = useContext(ErrorReporterContext);
|
11
|
-
if (context === void 0) {
|
12
|
-
console.warn("useRollbar must be used within a ErrorReporterContext");
|
13
|
-
}
|
14
|
-
return context ?? {};
|
15
|
-
};
|
16
|
-
export {
|
17
|
-
useRollbar
|
18
|
-
};
|
19
|
-
//# sourceMappingURL=useRollbar.js.map
|
@@ -1 +0,0 @@
|
|
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,61 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/index.ts
|
21
|
-
var contexts_exports = {};
|
22
|
-
__export(contexts_exports, {
|
23
|
-
ErrorReporterProvider: () => ErrorReporterProvider,
|
24
|
-
useRollbar: () => useRollbar
|
25
|
-
});
|
26
|
-
module.exports = __toCommonJS(contexts_exports);
|
27
|
-
|
28
|
-
// src/contexts/ErrorReporter/Provider.tsx
|
29
|
-
var import_react2 = require("react");
|
30
|
-
|
31
|
-
// src/contexts/ErrorReporter/Context.ts
|
32
|
-
var import_react = require("react");
|
33
|
-
var ErrorReporterContext = (0, import_react.createContext)({});
|
34
|
-
|
35
|
-
// src/contexts/ErrorReporter/Provider.tsx
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
37
|
-
var ErrorReporterProvider = ({ children, rollbar }) => {
|
38
|
-
const [rollbarInstance, setRollBarInstance] = (0, import_react2.useState)();
|
39
|
-
(0, import_react2.useEffect)(() => {
|
40
|
-
if (rollbarInstance) {
|
41
|
-
setRollBarInstance(rollbarInstance);
|
42
|
-
}
|
43
|
-
}, [rollbar, rollbarInstance]);
|
44
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorReporterContext.Provider, { value: { rollbar }, children });
|
45
|
-
};
|
46
|
-
|
47
|
-
// src/contexts/ErrorReporter/useRollbar.tsx
|
48
|
-
var import_react3 = require("react");
|
49
|
-
var useRollbar = () => {
|
50
|
-
const context = (0, import_react3.useContext)(ErrorReporterContext);
|
51
|
-
if (context === void 0) {
|
52
|
-
console.warn("useRollbar must be used within a ErrorReporterContext");
|
53
|
-
}
|
54
|
-
return context ?? {};
|
55
|
-
};
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
57
|
-
0 && (module.exports = {
|
58
|
-
ErrorReporterProvider,
|
59
|
-
useRollbar
|
60
|
-
});
|
61
|
-
//# sourceMappingURL=index.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/contexts/index.ts","../../../src/contexts/ErrorReporter/Provider.tsx","../../../src/contexts/ErrorReporter/Context.ts","../../../src/contexts/ErrorReporter/useRollbar.tsx"],"sourcesContent":["export * from './ErrorReporter'\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;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,gBAAoC;;;ACDpC,mBAA8B;AAIvB,IAAM,2BAAuB,4BAAyC,CAAC,CAAC;;;ADetE;AATT,IAAM,wBAA4E,CAAC,EAAE,UAAU,QAAQ,MAAM;AAC3G,QAAM,CAAC,iBAAiB,kBAAkB,QAAI,wBAAkB;AAEhE,+BAAU,MAAM;AACd,QAAI,iBAAiB;AACnB,yBAAmB,eAAe;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,SAAS,eAAe,CAAC;AAE7B,SAAO,4CAAC,qBAAqB,UAArB,EAA8B,OAAO,EAAE,QAAQ,GAAI,UAAS;AACtE;;;AEpBA,IAAAC,gBAA2B;AAI3B,IAAM,aAAa,MAAM;AACvB,QAAM,cAAU,0BAAW,oBAAoB;AAC/C,MAAI,YAAY,QAAW;AACzB,YAAQ,KAAK,uDAAuD;AAAA,EACtE;AAEA,SAAO,WAAW,CAAC;AACrB;","names":["import_react","import_react"]}
|
@@ -1,33 +0,0 @@
|
|
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
|
-
};
|
33
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
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":[]}
|