@contember/react-devbar 2.0.0-alpha.8 → 2.0.0-beta.1
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.
- package/dist/development/src/DevErrorManager.cjs.map +1 -1
- package/dist/development/src/DevErrorManager.js.map +1 -1
- package/dist/development/src/errorHandling.cjs.map +1 -1
- package/dist/development/src/errorHandling.js.map +1 -1
- package/dist/development/src/hooks/useParsedStacktrace.cjs +6 -1
- package/dist/development/src/hooks/useParsedStacktrace.cjs.map +1 -1
- package/dist/development/src/hooks/useParsedStacktrace.js +6 -1
- package/dist/development/src/hooks/useParsedStacktrace.js.map +1 -1
- package/dist/development/src/ui/DevBar/DevBar.cjs +128 -174
- package/dist/development/src/ui/DevBar/DevBar.cjs.map +1 -1
- package/dist/development/src/ui/DevBar/DevBar.js +130 -176
- package/dist/development/src/ui/DevBar/DevBar.js.map +1 -1
- package/dist/development/src/ui/DevError/DevError.cjs +5 -5
- package/dist/development/src/ui/DevError/DevError.cjs.map +1 -1
- package/dist/development/src/ui/DevError/DevError.js +5 -5
- package/dist/development/src/ui/DevError/DevError.js.map +1 -1
- package/dist/development/src/ui/DevError/DevErrorInner.cjs +1 -1
- package/dist/development/src/ui/DevError/DevErrorInner.cjs.map +1 -1
- package/dist/development/src/ui/DevError/DevErrorInner.js +1 -1
- package/dist/development/src/ui/DevError/DevErrorInner.js.map +1 -1
- package/dist/development/src/ui/DevError/DevErrorList.cjs +28 -17
- package/dist/development/src/ui/DevError/DevErrorList.cjs.map +1 -1
- package/dist/development/src/ui/DevError/DevErrorList.js +28 -17
- package/dist/development/src/ui/DevError/DevErrorList.js.map +1 -1
- package/dist/development/src/ui/DevError/StackTrace.cjs.map +1 -1
- package/dist/development/src/ui/DevError/StackTrace.js.map +1 -1
- package/dist/production/src/errorHandling.cjs.map +1 -1
- package/dist/production/src/errorHandling.js.map +1 -1
- package/dist/production/src/hooks/useParsedStacktrace.cjs +6 -1
- package/dist/production/src/hooks/useParsedStacktrace.cjs.map +1 -1
- package/dist/production/src/hooks/useParsedStacktrace.js +6 -1
- package/dist/production/src/hooks/useParsedStacktrace.js.map +1 -1
- package/dist/production/src/ui/DevBar/DevBar.cjs +74 -112
- package/dist/production/src/ui/DevBar/DevBar.cjs.map +1 -1
- package/dist/production/src/ui/DevBar/DevBar.js +77 -115
- package/dist/production/src/ui/DevBar/DevBar.js.map +1 -1
- package/dist/production/src/ui/DevError/DevError.cjs.map +1 -1
- package/dist/production/src/ui/DevError/DevError.js.map +1 -1
- package/dist/production/src/ui/DevError/DevErrorBadge.cjs.map +1 -1
- package/dist/production/src/ui/DevError/DevErrorBadge.js.map +1 -1
- package/dist/production/src/ui/DevError/DevErrorInner.cjs +1 -1
- package/dist/production/src/ui/DevError/DevErrorInner.cjs.map +1 -1
- package/dist/production/src/ui/DevError/DevErrorInner.js +1 -1
- package/dist/production/src/ui/DevError/DevErrorInner.js.map +1 -1
- package/dist/production/src/ui/DevError/DevErrorList.cjs +11 -4
- package/dist/production/src/ui/DevError/DevErrorList.cjs.map +1 -1
- package/dist/production/src/ui/DevError/DevErrorList.js +11 -4
- package/dist/production/src/ui/DevError/DevErrorList.js.map +1 -1
- package/dist/production/src/ui/DevError/StackTrace.cjs.map +1 -1
- package/dist/production/src/ui/DevError/StackTrace.js.map +1 -1
- package/dist/types/hooks/useParsedStacktrace.d.ts +1 -1
- package/dist/types/hooks/useParsedStacktrace.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ui/DevBar/DevBar.d.ts +5 -4
- package/dist/types/ui/DevBar/DevBar.d.ts.map +1 -1
- package/dist/types/ui/DevError/DevError.d.ts.map +1 -1
- package/dist/types/ui/DevError/DevErrorList.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/hooks/useParsedStacktrace.ts +6 -1
- package/src/index.css +290 -227
- package/src/ui/DevBar/DevBar.tsx +72 -97
- package/src/ui/DevError/DevError.tsx +0 -1
- package/src/ui/DevError/DevErrorInner.tsx +1 -1
- package/src/ui/DevError/DevErrorList.tsx +14 -5
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const DevErrorInner = require("./DevErrorInner.cjs");
|
|
5
|
+
const React = require("react");
|
|
5
6
|
const className = (cls) => cls ? `cui-devError-${cls}` : "cui-devError";
|
|
6
7
|
function DevErrorList({
|
|
7
8
|
currentError,
|
|
@@ -12,11 +13,17 @@ function DevErrorList({
|
|
|
12
13
|
onNext,
|
|
13
14
|
onPrevious
|
|
14
15
|
}) {
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
document.body.classList.add("cui-devError-body");
|
|
18
|
+
return () => {
|
|
19
|
+
document.body.classList.remove("cui-devError-body");
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
15
22
|
return /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className(), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("in"), children: [
|
|
16
23
|
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("bar"), children: [
|
|
17
24
|
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("errorSource"), children: currentErrorSource }, void 0, false, {
|
|
18
25
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
19
|
-
lineNumber:
|
|
26
|
+
lineNumber: 37,
|
|
20
27
|
columnNumber: 6
|
|
21
28
|
}, this),
|
|
22
29
|
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("actions"), children: [
|
|
@@ -28,61 +35,65 @@ function DevErrorList({
|
|
|
28
35
|
errorCount
|
|
29
36
|
] }, void 0, true, {
|
|
30
37
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
31
|
-
lineNumber:
|
|
38
|
+
lineNumber: 41,
|
|
32
39
|
columnNumber: 9
|
|
33
40
|
}, this),
|
|
34
41
|
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("switcherButtons"), children: [
|
|
35
|
-
/* @__PURE__ */ jsxDevRuntime.jsxDEV("button", { className: className("switcherButton"), onClick: onPrevious, children: "
|
|
42
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("button", { className: className("switcherButton"), onClick: onPrevious, children: "←" }, void 0, false, {
|
|
36
43
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
37
|
-
lineNumber:
|
|
44
|
+
lineNumber: 45,
|
|
38
45
|
columnNumber: 10
|
|
39
46
|
}, this),
|
|
40
|
-
/* @__PURE__ */ jsxDevRuntime.jsxDEV("button", { className: className("switcherButton"), onClick: onNext, children: "
|
|
47
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("button", { className: className("switcherButton"), onClick: onNext, children: "→" }, void 0, false, {
|
|
41
48
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
42
|
-
lineNumber:
|
|
49
|
+
lineNumber: 48,
|
|
43
50
|
columnNumber: 10
|
|
44
51
|
}, this)
|
|
45
52
|
] }, void 0, true, {
|
|
46
53
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
47
|
-
lineNumber:
|
|
54
|
+
lineNumber: 44,
|
|
48
55
|
columnNumber: 9
|
|
49
56
|
}, this)
|
|
50
57
|
] }, void 0, true, {
|
|
51
58
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
52
|
-
lineNumber:
|
|
59
|
+
lineNumber: 40,
|
|
53
60
|
columnNumber: 8
|
|
54
61
|
}, this) : null,
|
|
55
|
-
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("close"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("button", { className: className("closeButton"), onClick: onClose, children: "
|
|
62
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("close"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("button", { className: className("closeButton"), onClick: onClose, children: "✕" }, void 0, false, {
|
|
56
63
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
57
|
-
lineNumber:
|
|
64
|
+
lineNumber: 55,
|
|
58
65
|
columnNumber: 8
|
|
59
66
|
}, this) }, void 0, false, {
|
|
60
67
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
61
|
-
lineNumber:
|
|
68
|
+
lineNumber: 54,
|
|
62
69
|
columnNumber: 7
|
|
63
70
|
}, this)
|
|
64
71
|
] }, void 0, true, {
|
|
65
72
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
66
|
-
lineNumber:
|
|
73
|
+
lineNumber: 38,
|
|
67
74
|
columnNumber: 6
|
|
68
75
|
}, this)
|
|
69
76
|
] }, void 0, true, {
|
|
70
77
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
71
|
-
lineNumber:
|
|
78
|
+
lineNumber: 36,
|
|
72
79
|
columnNumber: 5
|
|
73
80
|
}, this),
|
|
74
|
-
/* @__PURE__ */ jsxDevRuntime.jsxDEV(DevErrorInner.DevErrorInner, { error: currentError }, void 0, false, {
|
|
81
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("content"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(DevErrorInner.DevErrorInner, { error: currentError }, void 0, false, {
|
|
75
82
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
76
|
-
lineNumber:
|
|
83
|
+
lineNumber: 62,
|
|
84
|
+
columnNumber: 6
|
|
85
|
+
}, this) }, void 0, false, {
|
|
86
|
+
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
87
|
+
lineNumber: 61,
|
|
77
88
|
columnNumber: 5
|
|
78
89
|
}, this)
|
|
79
90
|
] }, void 0, true, {
|
|
80
91
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
81
|
-
lineNumber:
|
|
92
|
+
lineNumber: 35,
|
|
82
93
|
columnNumber: 4
|
|
83
94
|
}, this) }, void 0, false, {
|
|
84
95
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
85
|
-
lineNumber:
|
|
96
|
+
lineNumber: 34,
|
|
86
97
|
columnNumber: 3
|
|
87
98
|
}, this);
|
|
88
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorList.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorList.tsx"],"sourcesContent":["import { DevErrorInner } from './DevErrorInner'\nimport { ProcessedError } from './types'\n\nexport interface DevErrorListProps {\n\tcurrentError: ProcessedError\n\tcurrentErrorSource: string\n\tcurrentErrorIndex: number\n\terrorCount: number\n\tonPrevious: () => void\n\tonNext: () => void\n\tonClose: () => void\n}\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevErrorList({\n\tcurrentError,\n\tcurrentErrorIndex,\n\tcurrentErrorSource,\n\terrorCount,\n\tonClose,\n\tonNext,\n\tonPrevious,\n}: DevErrorListProps) {\n\treturn (\n\t\t<div className={className()}>\n\t\t\t<div className={className('in')}>\n\t\t\t\t<div className={className('bar')}>\n\t\t\t\t\t<div className={className('errorSource')}>{currentErrorSource}</div>\n\t\t\t\t\t<div className={className('actions')}>\n\t\t\t\t\t\t{errorCount > 1 ? (\n\t\t\t\t\t\t\t<div className={className('switcher')}>\n\t\t\t\t\t\t\t\t<p className={className('errorCount')}>\n\t\t\t\t\t\t\t\t\tError {currentErrorIndex + 1} of {errorCount}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<div className={className('switcherButtons')}>\n\t\t\t\t\t\t\t\t\t<button className={className('switcherButton')} onClick={onPrevious}>\n\t\t\t\t\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"file":"DevErrorList.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorList.tsx"],"sourcesContent":["import { DevErrorInner } from './DevErrorInner'\nimport { ProcessedError } from './types'\nimport { useEffect } from 'react'\n\nexport interface DevErrorListProps {\n\tcurrentError: ProcessedError\n\tcurrentErrorSource: string\n\tcurrentErrorIndex: number\n\terrorCount: number\n\tonPrevious: () => void\n\tonNext: () => void\n\tonClose: () => void\n}\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevErrorList({\n\tcurrentError,\n\tcurrentErrorIndex,\n\tcurrentErrorSource,\n\terrorCount,\n\tonClose,\n\tonNext,\n\tonPrevious,\n}: DevErrorListProps) {\n\tuseEffect(() => {\n\t\tdocument.body.classList.add('cui-devError-body')\n\t\treturn () => {\n\t\t\tdocument.body.classList.remove('cui-devError-body')\n\t\t}\n\t}, [])\n\n\treturn (\n\t\t<div className={className()}>\n\t\t\t<div className={className('in')}>\n\t\t\t\t<div className={className('bar')}>\n\t\t\t\t\t<div className={className('errorSource')}>{currentErrorSource}</div>\n\t\t\t\t\t<div className={className('actions')}>\n\t\t\t\t\t\t{errorCount > 1 ? (\n\t\t\t\t\t\t\t<div className={className('switcher')}>\n\t\t\t\t\t\t\t\t<p className={className('errorCount')}>\n\t\t\t\t\t\t\t\t\tError {currentErrorIndex + 1} of {errorCount}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<div className={className('switcherButtons')}>\n\t\t\t\t\t\t\t\t\t<button className={className('switcherButton')} onClick={onPrevious}>\n\t\t\t\t\t\t\t\t\t\t←\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button className={className('switcherButton')} onClick={onNext}>\n\t\t\t\t\t\t\t\t\t\t→\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t<div className={className('close')}>\n\t\t\t\t\t\t\t<button className={className('closeButton')} onClick={onClose}>\n\t\t\t\t\t\t\t\t✕\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className={className('content')}>\n\t\t\t\t\t<DevErrorInner error={currentError} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n"],"names":["useEffect","jsxDEV","DevErrorInner"],"mappings":";;;;;AAcA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAElE,SAAS,aAAa;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAsB;AACrBA,QAAAA,UAAU,MAAM;AACN,aAAA,KAAK,UAAU,IAAI,mBAAmB;AAC/C,WAAO,MAAM;AACH,eAAA,KAAK,UAAU,OAAO,mBAAmB;AAAA,IACnD;AAAA,EACD,GAAG,EAAE;AAGJ,SAAAC,8BAAA,OAAC,OAAI,EAAA,WAAW,UAAU,GACzB,+CAAC,OAAI,EAAA,WAAW,UAAU,IAAI,GAC7B,UAAA;AAAA,IAAAA,8BAAA,OAAC,OAAI,EAAA,WAAW,UAAU,KAAK,GAC9B,UAAA;AAAA,MAAAA,8BAAAA,OAAC,OAAI,EAAA,WAAW,UAAU,aAAa,GAAI,UAA3C,mBAAA,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAA8D,GAAA,IAAA;AAAA,MAC7DA,8BAAA,OAAA,OAAA,EAAI,WAAW,UAAU,SAA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A,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAIA,IAAA;AAAA,MAAA,KApBD,QAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAqBA,IAAA;AAAA,IAAA,KAvBD,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAwBA,GAAA,IAAA;AAAA,IACAA,8BAAA,OAAC,SAAI,WAAW,UAAU,SAAS,GAClC,UAAAA,8BAAA,OAACC,cAAc,eAAA,EAAA,OAAO,aAAtB,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAA,IAAoC,EADrC,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAEA,IAAA;AAAA,EAAA,KA5BD,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IA6BA,EA9BD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EA+BA,GAAA,IAAA;AAEF;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { DevErrorInner } from "./DevErrorInner.js";
|
|
3
|
+
import { useEffect } from "react";
|
|
3
4
|
const className = (cls) => cls ? `cui-devError-${cls}` : "cui-devError";
|
|
4
5
|
function DevErrorList({
|
|
5
6
|
currentError,
|
|
@@ -10,11 +11,17 @@ function DevErrorList({
|
|
|
10
11
|
onNext,
|
|
11
12
|
onPrevious
|
|
12
13
|
}) {
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
document.body.classList.add("cui-devError-body");
|
|
16
|
+
return () => {
|
|
17
|
+
document.body.classList.remove("cui-devError-body");
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
13
20
|
return /* @__PURE__ */ jsxDEV("div", { className: className(), children: /* @__PURE__ */ jsxDEV("div", { className: className("in"), children: [
|
|
14
21
|
/* @__PURE__ */ jsxDEV("div", { className: className("bar"), children: [
|
|
15
22
|
/* @__PURE__ */ jsxDEV("div", { className: className("errorSource"), children: currentErrorSource }, void 0, false, {
|
|
16
23
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
17
|
-
lineNumber:
|
|
24
|
+
lineNumber: 37,
|
|
18
25
|
columnNumber: 6
|
|
19
26
|
}, this),
|
|
20
27
|
/* @__PURE__ */ jsxDEV("div", { className: className("actions"), children: [
|
|
@@ -26,61 +33,65 @@ function DevErrorList({
|
|
|
26
33
|
errorCount
|
|
27
34
|
] }, void 0, true, {
|
|
28
35
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
29
|
-
lineNumber:
|
|
36
|
+
lineNumber: 41,
|
|
30
37
|
columnNumber: 9
|
|
31
38
|
}, this),
|
|
32
39
|
/* @__PURE__ */ jsxDEV("div", { className: className("switcherButtons"), children: [
|
|
33
|
-
/* @__PURE__ */ jsxDEV("button", { className: className("switcherButton"), onClick: onPrevious, children: "
|
|
40
|
+
/* @__PURE__ */ jsxDEV("button", { className: className("switcherButton"), onClick: onPrevious, children: "←" }, void 0, false, {
|
|
34
41
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
35
|
-
lineNumber:
|
|
42
|
+
lineNumber: 45,
|
|
36
43
|
columnNumber: 10
|
|
37
44
|
}, this),
|
|
38
|
-
/* @__PURE__ */ jsxDEV("button", { className: className("switcherButton"), onClick: onNext, children: "
|
|
45
|
+
/* @__PURE__ */ jsxDEV("button", { className: className("switcherButton"), onClick: onNext, children: "→" }, void 0, false, {
|
|
39
46
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
40
|
-
lineNumber:
|
|
47
|
+
lineNumber: 48,
|
|
41
48
|
columnNumber: 10
|
|
42
49
|
}, this)
|
|
43
50
|
] }, void 0, true, {
|
|
44
51
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
45
|
-
lineNumber:
|
|
52
|
+
lineNumber: 44,
|
|
46
53
|
columnNumber: 9
|
|
47
54
|
}, this)
|
|
48
55
|
] }, void 0, true, {
|
|
49
56
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
50
|
-
lineNumber:
|
|
57
|
+
lineNumber: 40,
|
|
51
58
|
columnNumber: 8
|
|
52
59
|
}, this) : null,
|
|
53
|
-
/* @__PURE__ */ jsxDEV("div", { className: className("close"), children: /* @__PURE__ */ jsxDEV("button", { className: className("closeButton"), onClick: onClose, children: "
|
|
60
|
+
/* @__PURE__ */ jsxDEV("div", { className: className("close"), children: /* @__PURE__ */ jsxDEV("button", { className: className("closeButton"), onClick: onClose, children: "✕" }, void 0, false, {
|
|
54
61
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
55
|
-
lineNumber:
|
|
62
|
+
lineNumber: 55,
|
|
56
63
|
columnNumber: 8
|
|
57
64
|
}, this) }, void 0, false, {
|
|
58
65
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
59
|
-
lineNumber:
|
|
66
|
+
lineNumber: 54,
|
|
60
67
|
columnNumber: 7
|
|
61
68
|
}, this)
|
|
62
69
|
] }, void 0, true, {
|
|
63
70
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
64
|
-
lineNumber:
|
|
71
|
+
lineNumber: 38,
|
|
65
72
|
columnNumber: 6
|
|
66
73
|
}, this)
|
|
67
74
|
] }, void 0, true, {
|
|
68
75
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
69
|
-
lineNumber:
|
|
76
|
+
lineNumber: 36,
|
|
70
77
|
columnNumber: 5
|
|
71
78
|
}, this),
|
|
72
|
-
/* @__PURE__ */ jsxDEV(DevErrorInner, { error: currentError }, void 0, false, {
|
|
79
|
+
/* @__PURE__ */ jsxDEV("div", { className: className("content"), children: /* @__PURE__ */ jsxDEV(DevErrorInner, { error: currentError }, void 0, false, {
|
|
73
80
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
74
|
-
lineNumber:
|
|
81
|
+
lineNumber: 62,
|
|
82
|
+
columnNumber: 6
|
|
83
|
+
}, this) }, void 0, false, {
|
|
84
|
+
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
85
|
+
lineNumber: 61,
|
|
75
86
|
columnNumber: 5
|
|
76
87
|
}, this)
|
|
77
88
|
] }, void 0, true, {
|
|
78
89
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
79
|
-
lineNumber:
|
|
90
|
+
lineNumber: 35,
|
|
80
91
|
columnNumber: 4
|
|
81
92
|
}, this) }, void 0, false, {
|
|
82
93
|
fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevError/DevErrorList.tsx",
|
|
83
|
-
lineNumber:
|
|
94
|
+
lineNumber: 34,
|
|
84
95
|
columnNumber: 3
|
|
85
96
|
}, this);
|
|
86
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorList.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorList.tsx"],"sourcesContent":["import { DevErrorInner } from './DevErrorInner'\nimport { ProcessedError } from './types'\n\nexport interface DevErrorListProps {\n\tcurrentError: ProcessedError\n\tcurrentErrorSource: string\n\tcurrentErrorIndex: number\n\terrorCount: number\n\tonPrevious: () => void\n\tonNext: () => void\n\tonClose: () => void\n}\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevErrorList({\n\tcurrentError,\n\tcurrentErrorIndex,\n\tcurrentErrorSource,\n\terrorCount,\n\tonClose,\n\tonNext,\n\tonPrevious,\n}: DevErrorListProps) {\n\treturn (\n\t\t<div className={className()}>\n\t\t\t<div className={className('in')}>\n\t\t\t\t<div className={className('bar')}>\n\t\t\t\t\t<div className={className('errorSource')}>{currentErrorSource}</div>\n\t\t\t\t\t<div className={className('actions')}>\n\t\t\t\t\t\t{errorCount > 1 ? (\n\t\t\t\t\t\t\t<div className={className('switcher')}>\n\t\t\t\t\t\t\t\t<p className={className('errorCount')}>\n\t\t\t\t\t\t\t\t\tError {currentErrorIndex + 1} of {errorCount}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<div className={className('switcherButtons')}>\n\t\t\t\t\t\t\t\t\t<button className={className('switcherButton')} onClick={onPrevious}>\n\t\t\t\t\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"file":"DevErrorList.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorList.tsx"],"sourcesContent":["import { DevErrorInner } from './DevErrorInner'\nimport { ProcessedError } from './types'\nimport { useEffect } from 'react'\n\nexport interface DevErrorListProps {\n\tcurrentError: ProcessedError\n\tcurrentErrorSource: string\n\tcurrentErrorIndex: number\n\terrorCount: number\n\tonPrevious: () => void\n\tonNext: () => void\n\tonClose: () => void\n}\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevErrorList({\n\tcurrentError,\n\tcurrentErrorIndex,\n\tcurrentErrorSource,\n\terrorCount,\n\tonClose,\n\tonNext,\n\tonPrevious,\n}: DevErrorListProps) {\n\tuseEffect(() => {\n\t\tdocument.body.classList.add('cui-devError-body')\n\t\treturn () => {\n\t\t\tdocument.body.classList.remove('cui-devError-body')\n\t\t}\n\t}, [])\n\n\treturn (\n\t\t<div className={className()}>\n\t\t\t<div className={className('in')}>\n\t\t\t\t<div className={className('bar')}>\n\t\t\t\t\t<div className={className('errorSource')}>{currentErrorSource}</div>\n\t\t\t\t\t<div className={className('actions')}>\n\t\t\t\t\t\t{errorCount > 1 ? (\n\t\t\t\t\t\t\t<div className={className('switcher')}>\n\t\t\t\t\t\t\t\t<p className={className('errorCount')}>\n\t\t\t\t\t\t\t\t\tError {currentErrorIndex + 1} of {errorCount}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<div className={className('switcherButtons')}>\n\t\t\t\t\t\t\t\t\t<button className={className('switcherButton')} onClick={onPrevious}>\n\t\t\t\t\t\t\t\t\t\t←\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button className={className('switcherButton')} onClick={onNext}>\n\t\t\t\t\t\t\t\t\t\t→\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t<div className={className('close')}>\n\t\t\t\t\t\t\t<button className={className('closeButton')} onClick={onClose}>\n\t\t\t\t\t\t\t\t✕\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className={className('content')}>\n\t\t\t\t\t<DevErrorInner error={currentError} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";;;AAcA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAElE,SAAS,aAAa;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAsB;AACrB,YAAU,MAAM;AACN,aAAA,KAAK,UAAU,IAAI,mBAAmB;AAC/C,WAAO,MAAM;AACH,e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@@
|
|
|
1
|
-
{"version":3,"file":"StackTrace.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/StackTrace.tsx"],"sourcesContent":["import { ParsedStackFrame, ParsedStackTrace } from './types'\n\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\nexport const StackTrace = ({ stackTrace }: { stackTrace: ParsedStackTrace }) => {\n\treturn (\n\t\t<div className={className('stack')}>\n\t\t\t{stackTrace.map((it, index) => (\n\t\t\t\t<StackFrame stackFrame={it} key={index} />\n\t\t\t))}\n\t\t</div>\n\t)\n}\n\nconst StackFrame = ({ stackFrame }: { stackFrame: ParsedStackFrame }) => {\n\tconst line = stackFrame.line\n\n\treturn (\n\t\t<div className={className('stackFrame')}>\n\t\t\t<div className={className('stackFrameHeader')}>\n\t\t\t\t<div className={className('stackFrameSource')}>\n\t\t\t\t\t{stackFrame.filename}:{line}\n\t\t\t\t</div>\n\t\t\t\t{stackFrame.callee && <div className={className('stackFrameCallee')}>{stackFrame.callee}</div>}\n\t\t\t</div>\n\t\t\t{line !== undefined && stackFrame.sourceCodeLines && (\n\t\t\t\t<div className={className('stackFrameCode')}>\n\t\t\t\t\t{stackFrame.sourceCodeLines.map((it, index) => {\n\t\t\t\t\t\tconst lineNumber = index + 1\n\t\t\t\t\t\tif (lineNumber + 5 < line || lineNumber - 3 > line) {\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={`${className('stackFrameLine')} ${lineNumber === line && 'is-active'}`}\n\t\t\t\t\t\t\t\tkey={lineNumber}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineNumber')}>{lineNumber}</div>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineCode')}>{it}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["jsxDEV","this"],"mappings":";;;AAGA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAClE,MAAM,aAAa,CAAC,EAAE,iBAAmD;AAC/E,SACEA,8BAAA,OAAA,OAAA,EAAI,WAAW,UAAU,OAAO,GAC/B,UAAA,WAAW,IAAI,CAAC,IAAI,UACpBA,8BAAAA,OAAC,YAAW,EAAA,YAAY,MAAS,OAAjC,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAAwC,CACxC,EAHF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAIA,GAAAA,MAAA;AAEF;AAEA,MAAM,aAAa,CAAC,EAAE,iBAAmD;AACxE,QAAM,OAAO,WAAW;AAExB,SACED,8BAAAA,OAAA,OAAA,EAAI,WAAW,UAAU,YAAY,GACrC,UAAA;AAAA,IAAAA,8BAAA,OAAC,OAAI,EAAA,WAAW,UAAU,kBAAkB,GAC3C,UAAA;AAAA,MAAAA,8BAAA,OAAC,OAAI,EAAA,WAAW,UAAU,kBAAkB,GAC1C,UAAA;AAAA,QAAW,WAAA;AAAA,QAAS;AAAA,QAAE;AAAA,MAAA,KADxB,QAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAEA,GAAAC,MAAA;AAAA,MACC,WAAW,UAAWD,8BAAAA,OAAA,OAAA,EAAI,WAAW,UAAU,kBAAkB,GAAI,UAAA,WAAW,OAA3D,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"StackTrace.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/StackTrace.tsx"],"sourcesContent":["import { ParsedStackFrame, ParsedStackTrace } from './types'\n\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\nexport const StackTrace = ({ stackTrace }: { stackTrace: ParsedStackTrace }) => {\n\treturn (\n\t\t<div className={className('stack')}>\n\t\t\t{stackTrace.map((it, index) => (\n\t\t\t\t<StackFrame stackFrame={it} key={index} />\n\t\t\t))}\n\t\t</div>\n\t)\n}\n\nconst StackFrame = ({ stackFrame }: { stackFrame: ParsedStackFrame }) => {\n\tconst line = stackFrame.line\n\n\treturn (\n\t\t<div className={className('stackFrame')}>\n\t\t\t<div className={className('stackFrameHeader')}>\n\t\t\t\t<div className={className('stackFrameSource')}>\n\t\t\t\t\t{stackFrame.filename}:{line}\n\t\t\t\t</div>\n\t\t\t\t{stackFrame.callee && <div className={className('stackFrameCallee')}>{stackFrame.callee}</div>}\n\t\t\t</div>\n\t\t\t{line !== undefined && stackFrame.sourceCodeLines && (\n\t\t\t\t<div className={className('stackFrameCode')}>\n\t\t\t\t\t{stackFrame.sourceCodeLines.map((it, index) => {\n\t\t\t\t\t\tconst lineNumber = index + 1\n\t\t\t\t\t\tif (lineNumber + 5 < line || lineNumber - 3 > line) {\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={`${className('stackFrameLine')} ${lineNumber === line && 'is-active'}`}\n\t\t\t\t\t\t\t\tkey={lineNumber}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineNumber')}>{lineNumber}</div>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineCode')}>{it}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["jsxDEV","this"],"mappings":";;;AAGA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAClE,MAAM,aAAa,CAAC,EAAE,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;AAC3B,UAAI,aAAa,IAAI,QAAQ,aAAa,IAAI,MAAM;AAC5C,eAAA;AAAA,MAAA;AAGP,aAAAD,8BAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,WAAW,GAAG,UAAU,gBAAgB,CAAC,IAAI,eAAe,QAAQ,WAAW;AAAA,UAG/E,UAAA;AAAA,YAAAA,8BAAAA,OAAC,OAAI,EAAA,WAAW,UAAU,sBAAsB,GAAI,UAApD,WAAA,GAAA,QAAA,OAAA;AAAA,cAAA,UAAA;AAAA,cAAA,YAAA;AAAA,cAAA,cAAA;AAAA,YAA+D,GAAAC,MAAA;AAAA,iDAC9D,OAAI,EAAA,WAAW,UAAU,oBAAoB,GAAI,UAAlD,GAAA,GAAA,QAAA,OAAA;AAAA,cAAA,UAAA;AAAA,cAAA,YAAA;AAAA,cAAA,cAAA;AAAA,YAAA,GAAqDA,MAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAHhD;AAAA,QAFN;AAAA,QAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA;AAAA,QAAAA;AAAAA,MAMA;AAAA,IAAA,CAED,EAfF,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAgBAA,MAAA;AAAA,EAAA,KAxBF,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EA0BA,GAAAA,MAAA;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackTrace.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/StackTrace.tsx"],"sourcesContent":["import { ParsedStackFrame, ParsedStackTrace } from './types'\n\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\nexport const StackTrace = ({ stackTrace }: { stackTrace: ParsedStackTrace }) => {\n\treturn (\n\t\t<div className={className('stack')}>\n\t\t\t{stackTrace.map((it, index) => (\n\t\t\t\t<StackFrame stackFrame={it} key={index} />\n\t\t\t))}\n\t\t</div>\n\t)\n}\n\nconst StackFrame = ({ stackFrame }: { stackFrame: ParsedStackFrame }) => {\n\tconst line = stackFrame.line\n\n\treturn (\n\t\t<div className={className('stackFrame')}>\n\t\t\t<div className={className('stackFrameHeader')}>\n\t\t\t\t<div className={className('stackFrameSource')}>\n\t\t\t\t\t{stackFrame.filename}:{line}\n\t\t\t\t</div>\n\t\t\t\t{stackFrame.callee && <div className={className('stackFrameCallee')}>{stackFrame.callee}</div>}\n\t\t\t</div>\n\t\t\t{line !== undefined && stackFrame.sourceCodeLines && (\n\t\t\t\t<div className={className('stackFrameCode')}>\n\t\t\t\t\t{stackFrame.sourceCodeLines.map((it, index) => {\n\t\t\t\t\t\tconst lineNumber = index + 1\n\t\t\t\t\t\tif (lineNumber + 5 < line || lineNumber - 3 > line) {\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={`${className('stackFrameLine')} ${lineNumber === line && 'is-active'}`}\n\t\t\t\t\t\t\t\tkey={lineNumber}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineNumber')}>{lineNumber}</div>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineCode')}>{it}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["this"],"mappings":";AAGA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAClE,MAAM,aAAa,CAAC,EAAE,iBAAmD;AAC/E,SACE,uBAAA,OAAA,EAAI,WAAW,UAAU,OAAO,GAC/B,UAAA,WAAW,IAAI,CAAC,IAAI,UACpB,uBAAC,YAAW,EAAA,YAAY,MAAS,OAAjC,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAwC,CACxC,EAHF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAIA,GAAAA,MAAA;AAEF;AAEA,MAAM,aAAa,CAAC,EAAE,iBAAmD;AACxE,QAAM,OAAO,WAAW;AAExB,SACE,uBAAA,OAAA,EAAI,WAAW,UAAU,YAAY,GACrC,UAAA;AAAA,IAAA,uBAAC,OAAI,EAAA,WAAW,UAAU,kBAAkB,GAC3C,UAAA;AAAA,MAAA,uBAAC,OAAI,EAAA,WAAW,UAAU,kBAAkB,GAC1C,UAAA;AAAA,QAAW,WAAA;AAAA,QAAS;AAAA,QAAE;AAAA,MAAA,KADxB,QAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAEA,GAAAA,MAAA;AAAA,MACC,WAAW,UAAW,uBAAA,OAAA,EAAI,WAAW,UAAU,kBAAkB,GAAI,UAAA,WAAW,OAA3D,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"StackTrace.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/StackTrace.tsx"],"sourcesContent":["import { ParsedStackFrame, ParsedStackTrace } from './types'\n\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\nexport const StackTrace = ({ stackTrace }: { stackTrace: ParsedStackTrace }) => {\n\treturn (\n\t\t<div className={className('stack')}>\n\t\t\t{stackTrace.map((it, index) => (\n\t\t\t\t<StackFrame stackFrame={it} key={index} />\n\t\t\t))}\n\t\t</div>\n\t)\n}\n\nconst StackFrame = ({ stackFrame }: { stackFrame: ParsedStackFrame }) => {\n\tconst line = stackFrame.line\n\n\treturn (\n\t\t<div className={className('stackFrame')}>\n\t\t\t<div className={className('stackFrameHeader')}>\n\t\t\t\t<div className={className('stackFrameSource')}>\n\t\t\t\t\t{stackFrame.filename}:{line}\n\t\t\t\t</div>\n\t\t\t\t{stackFrame.callee && <div className={className('stackFrameCallee')}>{stackFrame.callee}</div>}\n\t\t\t</div>\n\t\t\t{line !== undefined && stackFrame.sourceCodeLines && (\n\t\t\t\t<div className={className('stackFrameCode')}>\n\t\t\t\t\t{stackFrame.sourceCodeLines.map((it, index) => {\n\t\t\t\t\t\tconst lineNumber = index + 1\n\t\t\t\t\t\tif (lineNumber + 5 < line || lineNumber - 3 > line) {\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={`${className('stackFrameLine')} ${lineNumber === line && 'is-active'}`}\n\t\t\t\t\t\t\t\tkey={lineNumber}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineNumber')}>{lineNumber}</div>\n\t\t\t\t\t\t\t\t<div className={className('stackFrameLineCode')}>{it}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["this"],"mappings":";AAGA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAClE,MAAM,aAAa,CAAC,EAAE,iBAAmD;AAC/E,SACE,uBAAA,OAAA,EAAI,WAAW,UAAU,OAAO,GAC/B,UAAA,WAAW,IAAI,CAAC,IAAI,UACpB,uBAAC,YAAW,EAAA,YAAY,MAAS,OAAjC,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAwC,CACxC,EAHF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAIA,GAAAA,MAAA;AA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,OAAI,EAAA,WAAW,UAAU,oBAAoB,GAAI,UAAlD,GAAA,GAAA,QAAA,OAAA;AAAA,cAAA,UAAA;AAAA,cAAA,YAAA;AAAA,cAAA,cAAA;AAAA,YAAA,GAAqDA,MAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAHhD;AAAA,QAFN;AAAA,QAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA;AAAA,QAAAA;AAAAA,MAMA;AAAA,IAAA,CAED,EAfF,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAgBAA,MAAA;AAAA,EAAA,KAxBF,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EA0BA,GAAAA,MAAA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.cjs","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":["ReactDOM","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnBA,wBAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,
|
|
1
|
+
{"version":3,"file":"errorHandling.cjs","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":["ReactDOM","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnBA,wBAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EAAA;AAGlC,SAAA;AACR;AAqCA,MAAM,mBAAmB,CAAC,aAAyC;AAClE,QAAM,cAAc,MAAM;AAChB,aAAA,qBAAsBC,+BAAA,MAAG,EAAA,UAAA,cAAW,CAAA,GAAO,MAAM;AAAA,IAAA,CAAE;AAAA,EAC7D;AAEO,SAAA,iBAAiB,SAAS,WAAW;AACrC,SAAA,iBAAiB,sBAAsB,WAAW;AAEzD,SAAO,OAAM,OAAM;AACd,QAAA;AACG,YAAA,GAAG,CAAK,MAAA;AACb,gBAAQ,KAAK,CAAC;AAAA,MAAA,CACd;AAAA,aACO,GAAG;AACX,cAAQ,MAAM,CAAC;AACH,kBAAA;AAAA,IAAA;AAAA,EAEd;AACD;AAGa,MAAA,qBAAqB,CAAC,aAAiC;AAG5D;AACN,WAAO,iBAAiB,QAAQ;AAAA,EAAA;AAElC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.js","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnB,aAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,
|
|
1
|
+
{"version":3,"file":"errorHandling.js","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnB,aAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EAAA;AAGlC,SAAA;AACR;AAqCA,MAAM,mBAAmB,CAAC,aAAyC;AAClE,QAAM,cAAc,MAAM;AAChB,aAAA,qBAAsB,oBAAA,MAAG,EAAA,UAAA,cAAW,CAAA,GAAO,MAAM;AAAA,IAAA,CAAE;AAAA,EAC7D;AAEO,SAAA,iBAAiB,SAAS,WAAW;AACrC,SAAA,iBAAiB,sBAAsB,WAAW;AAEzD,SAAO,OAAM,OAAM;AACd,QAAA;AACG,YAAA,GAAG,CAAK,MAAA;AACb,gBAAQ,KAAK,CAAC;AAAA,MAAA,CACd;AAAA,aACO,GAAG;AACX,cAAQ,MAAM,CAAC;AACH,kBAAA;AAAA,IAAA;AAAA,EAEd;AACD;AAGa,MAAA,qBAAqB,CAAC,aAAiC;AAG5D;AACN,WAAO,iBAAiB,QAAQ;AAAA,EAAA;AAElC;"}
|
|
@@ -24,7 +24,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
25
|
const React = require("react");
|
|
26
26
|
const parseStacktrace = async (e) => {
|
|
27
|
-
|
|
27
|
+
let StackTracey;
|
|
28
|
+
try {
|
|
29
|
+
StackTracey = (await import("stacktracey")).default;
|
|
30
|
+
} catch {
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
28
33
|
return (await new StackTracey(e).withSourcesAsync()).items.map((it) => ({
|
|
29
34
|
filename: it.fileShort,
|
|
30
35
|
line: it.line,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParsedStacktrace.cjs","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\
|
|
1
|
+
{"version":3,"file":"useParsedStacktrace.cjs","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tlet StackTracey\n\ttry {\n\t\tStackTracey = (await import('stacktracey')).default\n\t} catch {\n\t\treturn undefined\n\t}\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError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+1,11 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
const parseStacktrace = async (e) => {
|
|
3
|
-
|
|
3
|
+
let StackTracey;
|
|
4
|
+
try {
|
|
5
|
+
StackTracey = (await import("stacktracey")).default;
|
|
6
|
+
} catch {
|
|
7
|
+
return void 0;
|
|
8
|
+
}
|
|
4
9
|
return (await new StackTracey(e).withSourcesAsync()).items.map((it) => ({
|
|
5
10
|
filename: it.fileShort,
|
|
6
11
|
line: it.line,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParsedStacktrace.js","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\
|
|
1
|
+
{"version":3,"file":"useParsedStacktrace.js","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tlet StackTracey\n\ttry {\n\t\tStackTracey = (await import('stacktracey')).default\n\t} catch {\n\t\treturn undefined\n\t}\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["e"],"mappings":";AAGa,MAAA,kBAAkB,OAAO,MAAa;AAC9C,MAAA;AACA,MAAA;AACY,mBAAA,MAAM,OAAO,aAAa,GAAG;AAAA,EAAA,QACrC;AACA,WAAA;AAAA,EAAA;AAEA,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAAA,EAC/B;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAI,SAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9E,YAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IAAA;AAEK,UAAA,4BAA4B,OAAOA,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,G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