@contember/react-devbar 2.0.0-alpha.4 → 2.0.0-alpha.40
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/api-extractor.json +3 -0
- package/dist/development/index.cjs +6 -6
- package/dist/development/index.js +6 -6
- package/dist/development/{DevErrorManager.cjs → src/DevErrorManager.cjs} +10 -13
- package/dist/development/src/DevErrorManager.cjs.map +1 -0
- package/dist/development/{DevErrorManager.js → src/DevErrorManager.js} +5 -8
- package/dist/development/src/DevErrorManager.js.map +1 -0
- package/dist/development/{errorHandling.cjs → src/errorHandling.cjs} +1 -1
- package/dist/development/src/errorHandling.cjs.map +1 -0
- package/dist/development/{errorHandling.js → src/errorHandling.js} +2 -2
- package/dist/development/src/errorHandling.js.map +1 -0
- package/dist/development/{hooks → src/hooks}/useParsedStacktrace.cjs +9 -4
- package/dist/development/src/hooks/useParsedStacktrace.cjs.map +1 -0
- package/dist/{production → development/src}/hooks/useParsedStacktrace.js +6 -1
- package/dist/development/src/hooks/useParsedStacktrace.js.map +1 -0
- package/dist/development/src/ui/DevBar/DevBar.cjs +191 -0
- package/dist/development/src/ui/DevBar/DevBar.cjs.map +1 -0
- package/dist/development/src/ui/DevBar/DevBar.js +191 -0
- package/dist/development/src/ui/DevBar/DevBar.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevError.cjs +10 -10
- package/dist/development/src/ui/DevError/DevError.cjs.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevError.js +10 -10
- package/dist/development/src/ui/DevError/DevError.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevErrorBadge.cjs +2 -2
- package/dist/development/src/ui/DevError/DevErrorBadge.cjs.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevErrorBadge.js +2 -2
- package/dist/development/src/ui/DevError/DevErrorBadge.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevErrorInner.cjs +15 -15
- package/dist/development/src/ui/DevError/DevErrorInner.cjs.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevErrorInner.js +15 -15
- package/dist/development/src/ui/DevError/DevErrorInner.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevErrorList.cjs +41 -30
- package/dist/development/src/ui/DevError/DevErrorList.cjs.map +1 -0
- package/dist/development/src/ui/DevError/DevErrorList.js +101 -0
- package/dist/development/src/ui/DevError/DevErrorList.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/StackTrace.cjs +10 -10
- package/dist/development/src/ui/DevError/StackTrace.cjs.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/StackTrace.js +10 -10
- package/dist/development/src/ui/DevError/StackTrace.js.map +1 -0
- package/dist/production/index.cjs +6 -6
- package/dist/production/index.js +6 -6
- package/dist/production/{errorHandling.cjs → src/errorHandling.cjs} +1 -0
- package/dist/production/src/errorHandling.cjs.map +1 -0
- package/dist/production/{errorHandling.js → src/errorHandling.js} +1 -0
- package/dist/production/src/errorHandling.js.map +1 -0
- package/dist/production/{hooks → src/hooks}/useParsedStacktrace.cjs +9 -4
- package/dist/production/src/hooks/useParsedStacktrace.cjs.map +1 -0
- package/dist/{development → production/src}/hooks/useParsedStacktrace.js +6 -1
- package/dist/production/src/hooks/useParsedStacktrace.js.map +1 -0
- package/dist/production/src/ui/DevBar/DevBar.cjs +123 -0
- package/dist/production/src/ui/DevBar/DevBar.cjs.map +1 -0
- package/dist/production/src/ui/DevBar/DevBar.js +123 -0
- package/dist/production/src/ui/DevBar/DevBar.js.map +1 -0
- package/dist/production/src/ui/DevError/DevError.cjs.map +1 -0
- package/dist/production/src/ui/DevError/DevError.js.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorBadge.cjs.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorBadge.js.map +1 -0
- package/dist/production/{ui → src/ui}/DevError/DevErrorInner.cjs +1 -1
- package/dist/production/src/ui/DevError/DevErrorInner.cjs.map +1 -0
- package/dist/production/{ui → src/ui}/DevError/DevErrorInner.js +1 -1
- package/dist/production/src/ui/DevError/DevErrorInner.js.map +1 -0
- package/dist/production/{ui → src/ui}/DevError/DevErrorList.cjs +11 -4
- package/dist/production/src/ui/DevError/DevErrorList.cjs.map +1 -0
- package/dist/production/{ui → src/ui}/DevError/DevErrorList.js +11 -4
- package/dist/production/src/ui/DevError/DevErrorList.js.map +1 -0
- package/dist/production/src/ui/DevError/StackTrace.cjs.map +1 -0
- package/dist/production/src/ui/DevError/StackTrace.js.map +1 -0
- 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 +11 -21
- package/src/DevErrorManager.tsx +4 -4
- package/src/hooks/useParsedStacktrace.ts +6 -1
- package/src/index.css +448 -2
- package/src/tsconfig.json +5 -2
- package/src/ui/DevBar/DevBar.tsx +76 -101
- package/src/ui/DevError/DevError.tsx +0 -1
- package/src/ui/DevError/DevErrorInner.tsx +1 -1
- package/src/ui/DevError/DevErrorList.tsx +14 -5
- package/tsconfig.json +7 -0
- package/tsdoc.json +6 -0
- package/dist/assets/index.css +0 -377
- package/dist/development/DevErrorManager.cjs.map +0 -1
- package/dist/development/DevErrorManager.js.map +0 -1
- package/dist/development/errorHandling.cjs.map +0 -1
- package/dist/development/errorHandling.js.map +0 -1
- package/dist/development/hooks/useParsedStacktrace.cjs.map +0 -1
- package/dist/development/hooks/useParsedStacktrace.js.map +0 -1
- package/dist/development/ui/DevBar/DevBar.cjs +0 -237
- package/dist/development/ui/DevBar/DevBar.cjs.map +0 -1
- package/dist/development/ui/DevBar/DevBar.js +0 -237
- package/dist/development/ui/DevBar/DevBar.js.map +0 -1
- package/dist/development/ui/DevError/DevError.cjs.map +0 -1
- package/dist/development/ui/DevError/DevError.js.map +0 -1
- package/dist/development/ui/DevError/DevErrorBadge.cjs.map +0 -1
- package/dist/development/ui/DevError/DevErrorBadge.js.map +0 -1
- package/dist/development/ui/DevError/DevErrorInner.cjs.map +0 -1
- package/dist/development/ui/DevError/DevErrorInner.js.map +0 -1
- package/dist/development/ui/DevError/DevErrorList.cjs.map +0 -1
- package/dist/development/ui/DevError/DevErrorList.js +0 -90
- package/dist/development/ui/DevError/DevErrorList.js.map +0 -1
- package/dist/development/ui/DevError/StackTrace.cjs.map +0 -1
- package/dist/development/ui/DevError/StackTrace.js.map +0 -1
- package/dist/production/errorHandling.cjs.map +0 -1
- package/dist/production/errorHandling.js.map +0 -1
- package/dist/production/hooks/useParsedStacktrace.cjs.map +0 -1
- package/dist/production/hooks/useParsedStacktrace.js.map +0 -1
- package/dist/production/ui/DevBar/DevBar.cjs +0 -161
- package/dist/production/ui/DevBar/DevBar.cjs.map +0 -1
- package/dist/production/ui/DevBar/DevBar.js +0 -161
- package/dist/production/ui/DevBar/DevBar.js.map +0 -1
- package/dist/production/ui/DevError/DevError.cjs.map +0 -1
- package/dist/production/ui/DevError/DevError.js.map +0 -1
- package/dist/production/ui/DevError/DevErrorBadge.cjs.map +0 -1
- package/dist/production/ui/DevError/DevErrorBadge.js.map +0 -1
- package/dist/production/ui/DevError/DevErrorInner.cjs.map +0 -1
- package/dist/production/ui/DevError/DevErrorInner.js.map +0 -1
- package/dist/production/ui/DevError/DevErrorList.cjs.map +0 -1
- package/dist/production/ui/DevError/DevErrorList.js.map +0 -1
- package/dist/production/ui/DevError/StackTrace.cjs.map +0 -1
- package/dist/production/ui/DevError/StackTrace.js.map +0 -1
- package/src/ui/DevBar/index.css +0 -171
- package/src/ui/DevError/DevError.css +0 -191
- package/src/ui/DevError/DevErrorBadge.css +0 -16
- package/src/ui/DevError/index.css +0 -2
- /package/dist/production/{ui → src/ui}/DevError/DevError.cjs +0 -0
- /package/dist/production/{ui → src/ui}/DevError/DevError.js +0 -0
- /package/dist/production/{ui → src/ui}/DevError/DevErrorBadge.cjs +0 -0
- /package/dist/production/{ui → src/ui}/DevError/DevErrorBadge.js +0 -0
- /package/dist/production/{ui → src/ui}/DevError/StackTrace.cjs +0 -0
- /package/dist/production/{ui → src/ui}/DevError/StackTrace.js +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const reactUtils = require("@contember/react-utils");
|
|
5
|
+
const utilities = require("@contember/utilities");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const className = (cls) => cls ? `cui-devBar-${cls}` : "cui-devBar";
|
|
8
|
+
const DevBar = ({
|
|
9
|
+
breakpoint = 768,
|
|
10
|
+
children
|
|
11
|
+
}) => {
|
|
12
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
13
|
+
const isSmallScreen = reactUtils.useWindowSize().width < breakpoint;
|
|
14
|
+
const handleToggle = reactUtils.useReferentiallyStableCallback(() => {
|
|
15
|
+
setExpanded((expanded2) => !expanded2);
|
|
16
|
+
});
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
function handleKeyDown(event) {
|
|
19
|
+
if (event.code === "KeyJ" && (event.ctrlKey || event.metaKey)) {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
handleToggle();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
26
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
27
|
+
}, [expanded, handleToggle]);
|
|
28
|
+
const devBarContentRef = React.useRef(null);
|
|
29
|
+
reactUtils.useOnElementClickOutsideCallback(devBarContentRef, () => {
|
|
30
|
+
if (expanded) {
|
|
31
|
+
setExpanded(false);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const id = `dev-bar-panel${reactUtils.useId()}`;
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
+
"section",
|
|
37
|
+
{
|
|
38
|
+
"data-transparent": "true",
|
|
39
|
+
"data-overrides-lucide-icons": "true",
|
|
40
|
+
"data-expanded": utilities.dataAttribute(expanded),
|
|
41
|
+
"data-small-screen": utilities.dataAttribute(isSmallScreen),
|
|
42
|
+
className: className(null),
|
|
43
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: devBarContentRef, className: className("content"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
"data-expanded": true,
|
|
47
|
+
id,
|
|
48
|
+
role: "dialog",
|
|
49
|
+
style: { display: "contents" },
|
|
50
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: className("panels"), children })
|
|
51
|
+
}
|
|
52
|
+
) })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
const DevPanel = ({ heading, icon, children, preview }) => {
|
|
57
|
+
const id = `cui-devBar-panel-${reactUtils.useId()}`;
|
|
58
|
+
const dialogRef = React.useRef(null);
|
|
59
|
+
const triggerRef = React.useRef(null);
|
|
60
|
+
const handleOpen = React.useCallback(() => {
|
|
61
|
+
dialogRef.current?.showModal();
|
|
62
|
+
}, []);
|
|
63
|
+
const handleClose = React.useCallback(() => {
|
|
64
|
+
dialogRef.current?.close();
|
|
65
|
+
}, []);
|
|
66
|
+
React.useEffect(() => {
|
|
67
|
+
const dialog = dialogRef.current;
|
|
68
|
+
if (!dialog) return;
|
|
69
|
+
const handleClickOutside = (event) => {
|
|
70
|
+
const rect = dialog.getBoundingClientRect();
|
|
71
|
+
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
|
|
72
|
+
if (!isInDialog) {
|
|
73
|
+
dialog.close();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
dialog.addEventListener("click", handleClickOutside);
|
|
77
|
+
return () => dialog.removeEventListener("click", handleClickOutside);
|
|
78
|
+
}, []);
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
const handleEscape = (event) => {
|
|
81
|
+
if (event.key === "Escape") {
|
|
82
|
+
handleClose();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
document.addEventListener("keydown", handleEscape);
|
|
86
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
87
|
+
}, [handleClose]);
|
|
88
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: className("trigger"), children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
90
|
+
"button",
|
|
91
|
+
{
|
|
92
|
+
ref: triggerRef,
|
|
93
|
+
tabIndex: 0,
|
|
94
|
+
"aria-haspopup": "dialog",
|
|
95
|
+
"aria-controls": id,
|
|
96
|
+
className: className("trigger-label"),
|
|
97
|
+
onClick: handleOpen,
|
|
98
|
+
children: [
|
|
99
|
+
icon,
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: className("trigger-label-text"), children: preview ?? heading })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("dialog", { ref: dialogRef, id, className: className("panel"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: className("panel-content"), children: [
|
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: className("panel-header"), children: [
|
|
106
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "h4", children: heading }),
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
108
|
+
"button",
|
|
109
|
+
{
|
|
110
|
+
onClick: handleClose,
|
|
111
|
+
className: className("close-button"),
|
|
112
|
+
"aria-label": "Close",
|
|
113
|
+
children: "✕"
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: className("panel-body"), children })
|
|
118
|
+
] }) })
|
|
119
|
+
] });
|
|
120
|
+
};
|
|
121
|
+
exports.DevBar = DevBar;
|
|
122
|
+
exports.DevPanel = DevPanel;
|
|
123
|
+
//# sourceMappingURL=DevBar.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevBar.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevBar/DevBar.tsx"],"sourcesContent":["import {\n\tuseId,\n\tuseOnElementClickOutsideCallback,\n\tuseReferentiallyStableCallback,\n\tuseWindowSize,\n} from '@contember/react-utils'\nimport { dataAttribute } from '@contember/utilities'\nimport { PropsWithChildren, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\n\nconst className = (cls: string | null) => cls ? `cui-devBar-${cls}` : 'cui-devBar'\n\nexport const DevBar = ({\n\tbreakpoint = 768,\n\tchildren,\n}: PropsWithChildren<{\n\tbreakpoint?: number\n}>) => {\n\tconst [expanded, setExpanded] = useState(false)\n\tconst isSmallScreen = useWindowSize().width < breakpoint\n\n\tconst handleToggle = useReferentiallyStableCallback(() => {\n\t\tsetExpanded(expanded => !expanded)\n\t})\n\n\tuseEffect(() => {\n\t\tfunction handleKeyDown(event: KeyboardEvent) {\n\t\t\tif (event.code === 'KeyJ' && (event.ctrlKey || event.metaKey)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\n\t\t\t\thandleToggle()\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleKeyDown)\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown)\n\t}, [expanded, handleToggle])\n\n\tconst devBarContentRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementClickOutsideCallback(devBarContentRef, () => {\n\t\tif (expanded) {\n\t\t\tsetExpanded(false)\n\t\t}\n\t})\n\n\tconst id = `dev-bar-panel${useId()}`\n\n\treturn (\n\t\t<section\n\t\t\tdata-transparent=\"true\"\n\t\t\tdata-overrides-lucide-icons=\"true\"\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tdata-small-screen={dataAttribute(isSmallScreen)}\n\t\t\tclassName={className(null)}\n\t\t>\n\t\t\t<div ref={devBarContentRef} className={className('content')}>\n\t\t\t\t<div\n\t\t\t\t\tdata-expanded={true}\n\t\t\t\t\tid={id}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tstyle={{ display: 'contents' }}\n\t\t\t\t>\n\t\t\t\t\t<div className={className('panels')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</section>\n\t)\n}\n\ninterface DevPanelProps {\n\ticon: ReactNode\n\theading: ReactNode\n\tchildren: ReactNode\n\tpreview?: ReactNode\n}\n\nexport const DevPanel = ({ heading, icon, children, preview }: DevPanelProps) => {\n\tconst id = `cui-devBar-panel-${useId()}`\n\tconst dialogRef = useRef<HTMLDialogElement>(null)\n\tconst triggerRef = useRef<HTMLButtonElement>(null)\n\n\tconst handleOpen = useCallback(() => {\n\t\tdialogRef.current?.showModal()\n\t}, [])\n\n\tconst handleClose = useCallback(() => {\n\t\tdialogRef.current?.close()\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst dialog = dialogRef.current\n\t\tif (!dialog) return\n\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\tconst isInDialog = (\n\t\t\t\trect.top <= event.clientY &&\n\t\t\t\tevent.clientY <= rect.top + rect.height &&\n\t\t\t\trect.left <= event.clientX &&\n\t\t\t\tevent.clientX <= rect.left + rect.width\n\t\t\t)\n\n\t\t\tif (!isInDialog) {\n\t\t\t\tdialog.close()\n\t\t\t}\n\t\t}\n\n\t\tdialog.addEventListener('click', handleClickOutside)\n\t\treturn () => dialog.removeEventListener('click', handleClickOutside)\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\thandleClose()\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleEscape)\n\t\treturn () => document.removeEventListener('keydown', handleEscape)\n\t}, [handleClose])\n\n\treturn (\n\t\t<div className={className('trigger')}>\n\t\t\t<button\n\t\t\t\tref={triggerRef}\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-controls={id}\n\t\t\t\tclassName={className('trigger-label')}\n\t\t\t\tonClick={handleOpen}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className={className('trigger-label-text')}>\n\t\t\t\t\t{preview ?? heading}\n\t\t\t\t</span>\n\t\t\t</button>\n\n\t\t\t<dialog ref={dialogRef} id={id} className={className('panel')}>\n\t\t\t\t<div className={className('panel-content')}>\n\t\t\t\t\t<div className={className('panel-header')}>\n\t\t\t\t\t\t<h2 className=\"h4\">{heading}</h2>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\tclassName={className('close-button')}\n\t\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t✕\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className={className('panel-body')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</dialog>\n\t\t</div>\n\t)\n}\n"],"names":["useState","useWindowSize","useReferentiallyStableCallback","expanded","useEffect","useRef","useOnElementClickOutsideCallback","useId","jsx","dataAttribute","useCallback","jsxs"],"mappings":";;;;;;AASA,MAAM,YAAY,CAAC,QAAuB,MAAM,cAAc,GAAG,KAAK;AAE/D,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AACD,MAEO;AACN,QAAM,CAAC,UAAU,WAAW,IAAIA,MAAAA,SAAS,KAAK;AACxC,QAAA,gBAAgBC,WAAAA,gBAAgB,QAAQ;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AA;AAAA,MAAA;AAAA,IACD;AAAA,IAECH,2BAAA,IAAA,UAAA,EAAO,KAAK,WAAW,IAAQ,WAAW,UAAU,OAAO,GAC3D,UAACG,2BAAA,KAAA,OAAA,EAAI,WAAW,UAAU,eAAe,GACxC,UAAA;AAAA,MAAAA,2BAAA,KAAC,OAAI,EAAA,WAAW,UAAU,cAAc,GACvC,UAAA;AAAA,QAACH,2BAAA,IAAA,MAAA,EAAG,WAAU,MAAM,UAAQ,SAAA;AAAA,QAC5BA,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,SAAS;AAAA,YACT,WAAW,UAAU,cAAc;AAAA,YACnC,cAAW;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAED,GACD;AAAA,qCACC,OAAI,EAAA,WAAW,UAAU,YAAY,GACpC,SACF,CAAA;AAAA,IAAA,EAAA,CACD,EACD,CAAA;AAAA,EAAA,GACD;AAEF;;;"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useWindowSize, useReferentiallyStableCallback, useOnElementClickOutsideCallback, useId } from "@contember/react-utils";
|
|
3
|
+
import { dataAttribute } from "@contember/utilities";
|
|
4
|
+
import { useState, useEffect, useRef, useCallback } from "react";
|
|
5
|
+
const className = (cls) => cls ? `cui-devBar-${cls}` : "cui-devBar";
|
|
6
|
+
const DevBar = ({
|
|
7
|
+
breakpoint = 768,
|
|
8
|
+
children
|
|
9
|
+
}) => {
|
|
10
|
+
const [expanded, setExpanded] = useState(false);
|
|
11
|
+
const isSmallScreen = useWindowSize().width < breakpoint;
|
|
12
|
+
const handleToggle = useReferentiallyStableCallback(() => {
|
|
13
|
+
setExpanded((expanded2) => !expanded2);
|
|
14
|
+
});
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
function handleKeyDown(event) {
|
|
17
|
+
if (event.code === "KeyJ" && (event.ctrlKey || event.metaKey)) {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
handleToggle();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
24
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
25
|
+
}, [expanded, handleToggle]);
|
|
26
|
+
const devBarContentRef = useRef(null);
|
|
27
|
+
useOnElementClickOutsideCallback(devBarContentRef, () => {
|
|
28
|
+
if (expanded) {
|
|
29
|
+
setExpanded(false);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const id = `dev-bar-panel${useId()}`;
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"section",
|
|
35
|
+
{
|
|
36
|
+
"data-transparent": "true",
|
|
37
|
+
"data-overrides-lucide-icons": "true",
|
|
38
|
+
"data-expanded": dataAttribute(expanded),
|
|
39
|
+
"data-small-screen": dataAttribute(isSmallScreen),
|
|
40
|
+
className: className(null),
|
|
41
|
+
children: /* @__PURE__ */ jsx("div", { ref: devBarContentRef, className: className("content"), children: /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
"data-expanded": true,
|
|
45
|
+
id,
|
|
46
|
+
role: "dialog",
|
|
47
|
+
style: { display: "contents" },
|
|
48
|
+
children: /* @__PURE__ */ jsx("div", { className: className("panels"), children })
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
const DevPanel = ({ heading, icon, children, preview }) => {
|
|
55
|
+
const id = `cui-devBar-panel-${useId()}`;
|
|
56
|
+
const dialogRef = useRef(null);
|
|
57
|
+
const triggerRef = useRef(null);
|
|
58
|
+
const handleOpen = useCallback(() => {
|
|
59
|
+
dialogRef.current?.showModal();
|
|
60
|
+
}, []);
|
|
61
|
+
const handleClose = useCallback(() => {
|
|
62
|
+
dialogRef.current?.close();
|
|
63
|
+
}, []);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const dialog = dialogRef.current;
|
|
66
|
+
if (!dialog) return;
|
|
67
|
+
const handleClickOutside = (event) => {
|
|
68
|
+
const rect = dialog.getBoundingClientRect();
|
|
69
|
+
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
|
|
70
|
+
if (!isInDialog) {
|
|
71
|
+
dialog.close();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
dialog.addEventListener("click", handleClickOutside);
|
|
75
|
+
return () => dialog.removeEventListener("click", handleClickOutside);
|
|
76
|
+
}, []);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const handleEscape = (event) => {
|
|
79
|
+
if (event.key === "Escape") {
|
|
80
|
+
handleClose();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
document.addEventListener("keydown", handleEscape);
|
|
84
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
85
|
+
}, [handleClose]);
|
|
86
|
+
return /* @__PURE__ */ jsxs("div", { className: className("trigger"), children: [
|
|
87
|
+
/* @__PURE__ */ jsxs(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
ref: triggerRef,
|
|
91
|
+
tabIndex: 0,
|
|
92
|
+
"aria-haspopup": "dialog",
|
|
93
|
+
"aria-controls": id,
|
|
94
|
+
className: className("trigger-label"),
|
|
95
|
+
onClick: handleOpen,
|
|
96
|
+
children: [
|
|
97
|
+
icon,
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: className("trigger-label-text"), children: preview ?? heading })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx("dialog", { ref: dialogRef, id, className: className("panel"), children: /* @__PURE__ */ jsxs("div", { className: className("panel-content"), children: [
|
|
103
|
+
/* @__PURE__ */ jsxs("div", { className: className("panel-header"), children: [
|
|
104
|
+
/* @__PURE__ */ jsx("h2", { className: "h4", children: heading }),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
"button",
|
|
107
|
+
{
|
|
108
|
+
onClick: handleClose,
|
|
109
|
+
className: className("close-button"),
|
|
110
|
+
"aria-label": "Close",
|
|
111
|
+
children: "✕"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsx("div", { className: className("panel-body"), children })
|
|
116
|
+
] }) })
|
|
117
|
+
] });
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
DevBar,
|
|
121
|
+
DevPanel
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=DevBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevBar.js","sources":["../../../../../../packages/react-devbar/src/ui/DevBar/DevBar.tsx"],"sourcesContent":["import {\n\tuseId,\n\tuseOnElementClickOutsideCallback,\n\tuseReferentiallyStableCallback,\n\tuseWindowSize,\n} from '@contember/react-utils'\nimport { dataAttribute } from '@contember/utilities'\nimport { PropsWithChildren, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\n\nconst className = (cls: string | null) => cls ? `cui-devBar-${cls}` : 'cui-devBar'\n\nexport const DevBar = ({\n\tbreakpoint = 768,\n\tchildren,\n}: PropsWithChildren<{\n\tbreakpoint?: number\n}>) => {\n\tconst [expanded, setExpanded] = useState(false)\n\tconst isSmallScreen = useWindowSize().width < breakpoint\n\n\tconst handleToggle = useReferentiallyStableCallback(() => {\n\t\tsetExpanded(expanded => !expanded)\n\t})\n\n\tuseEffect(() => {\n\t\tfunction handleKeyDown(event: KeyboardEvent) {\n\t\t\tif (event.code === 'KeyJ' && (event.ctrlKey || event.metaKey)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\n\t\t\t\thandleToggle()\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleKeyDown)\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown)\n\t}, [expanded, handleToggle])\n\n\tconst devBarContentRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementClickOutsideCallback(devBarContentRef, () => {\n\t\tif (expanded) {\n\t\t\tsetExpanded(false)\n\t\t}\n\t})\n\n\tconst id = `dev-bar-panel${useId()}`\n\n\treturn (\n\t\t<section\n\t\t\tdata-transparent=\"true\"\n\t\t\tdata-overrides-lucide-icons=\"true\"\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tdata-small-screen={dataAttribute(isSmallScreen)}\n\t\t\tclassName={className(null)}\n\t\t>\n\t\t\t<div ref={devBarContentRef} className={className('content')}>\n\t\t\t\t<div\n\t\t\t\t\tdata-expanded={true}\n\t\t\t\t\tid={id}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tstyle={{ display: 'contents' }}\n\t\t\t\t>\n\t\t\t\t\t<div className={className('panels')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</section>\n\t)\n}\n\ninterface DevPanelProps {\n\ticon: ReactNode\n\theading: ReactNode\n\tchildren: ReactNode\n\tpreview?: ReactNode\n}\n\nexport const DevPanel = ({ heading, icon, children, preview }: DevPanelProps) => {\n\tconst id = `cui-devBar-panel-${useId()}`\n\tconst dialogRef = useRef<HTMLDialogElement>(null)\n\tconst triggerRef = useRef<HTMLButtonElement>(null)\n\n\tconst handleOpen = useCallback(() => {\n\t\tdialogRef.current?.showModal()\n\t}, [])\n\n\tconst handleClose = useCallback(() => {\n\t\tdialogRef.current?.close()\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst dialog = dialogRef.current\n\t\tif (!dialog) return\n\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\tconst isInDialog = (\n\t\t\t\trect.top <= event.clientY &&\n\t\t\t\tevent.clientY <= rect.top + rect.height &&\n\t\t\t\trect.left <= event.clientX &&\n\t\t\t\tevent.clientX <= rect.left + rect.width\n\t\t\t)\n\n\t\t\tif (!isInDialog) {\n\t\t\t\tdialog.close()\n\t\t\t}\n\t\t}\n\n\t\tdialog.addEventListener('click', handleClickOutside)\n\t\treturn () => dialog.removeEventListener('click', handleClickOutside)\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\thandleClose()\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleEscape)\n\t\treturn () => document.removeEventListener('keydown', handleEscape)\n\t}, [handleClose])\n\n\treturn (\n\t\t<div className={className('trigger')}>\n\t\t\t<button\n\t\t\t\tref={triggerRef}\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-controls={id}\n\t\t\t\tclassName={className('trigger-label')}\n\t\t\t\tonClick={handleOpen}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className={className('trigger-label-text')}>\n\t\t\t\t\t{preview ?? heading}\n\t\t\t\t</span>\n\t\t\t</button>\n\n\t\t\t<dialog ref={dialogRef} id={id} className={className('panel')}>\n\t\t\t\t<div className={className('panel-content')}>\n\t\t\t\t\t<div className={className('panel-header')}>\n\t\t\t\t\t\t<h2 className=\"h4\">{heading}</h2>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\tclassName={className('close-button')}\n\t\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t✕\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className={className('panel-body')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</dialog>\n\t\t</div>\n\t)\n}\n"],"names":["expanded"],"mappings":";;;;AASA,MAAM,YAAY,CAAC,QAAuB,MAAM,cAAc,GAAG,KAAK;AAE/D,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AACD,MAEO;AACN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C,oBAAA,UAAA,EAAO,KAAK,WAAW,IAAQ,WAAW,UAAU,OAAO,GAC3D,UAAC,qBAAA,OAAA,EAAI,WAAW,UAAU,eAAe,GACxC,UAAA;AAAA,MAAA,qBAAC,OAAI,EAAA,WAAW,UAAU,cAAc,GACvC,UAAA;AAAA,QAAC,oBAAA,MAAA,EAAG,WAAU,MAAM,UAAQ,SAAA;AAAA,QAC5B;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,SAAS;AAAA,YACT,WAAW,UAAU,cAAc;AAAA,YACnC,cAAW;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAED,GACD;AAAA,0BACC,OAAI,EAAA,WAAW,UAAU,YAAY,GACpC,SACF,CAAA;AAAA,IAAA,EAAA,CACD,EACD,CAAA;AAAA,EAAA,GACD;AAEF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevError.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevError.tsx"],"sourcesContent":["import { DevErrorInner, DevErrorInnerProps } from './DevErrorInner'\n\nexport interface DevErrorProps extends DevErrorInnerProps {\n\tsource: string\n}\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevError(props: DevErrorProps) {\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')}>{props.source}</div>\n\t\t\t\t</div>\n\t\t\t\t<DevErrorInner error={props.error} />\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n"],"names":["jsx","DevErrorInner"],"mappings":";;;;AAMA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAElE,SAAS,SAAS,OAAsB;AAE7C,SAAAA,2BAAA,IAAC,OAAI,EAAA,WAAW,UAAU,GACzB,0CAAC,OAAI,EAAA,WAAW,UAAU,IAAI,GAC7B,UAAA;AAAA,IAAAA,2BAAA,IAAC,OAAI,EAAA,WAAW,UAAU,KAAK,GAC9B,UAAAA,+BAAC,OAAI,EAAA,WAAW,UAAU,aAAa,GAAI,UAAA,MAAM,OAAO,CAAA,GACzD;AAAA,IACCA,2BAAAA,IAAAC,cAAAA,eAAA,EAAc,OAAO,MAAM,MAAO,CAAA;AAAA,EAAA,EAAA,CACpC,EACD,CAAA;AAEF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevError.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevError.tsx"],"sourcesContent":["import { DevErrorInner, DevErrorInnerProps } from './DevErrorInner'\n\nexport interface DevErrorProps extends DevErrorInnerProps {\n\tsource: string\n}\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevError(props: DevErrorProps) {\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')}>{props.source}</div>\n\t\t\t\t</div>\n\t\t\t\t<DevErrorInner error={props.error} />\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";;AAMA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAElE,SAAS,SAAS,OAAsB;AAE7C,SAAA,oBAAC,OAAI,EAAA,WAAW,UAAU,GACzB,+BAAC,OAAI,EAAA,WAAW,UAAU,IAAI,GAC7B,UAAA;AAAA,IAAA,oBAAC,OAAI,EAAA,WAAW,UAAU,KAAK,GAC9B,UAAA,oBAAC,OAAI,EAAA,WAAW,UAAU,aAAa,GAAI,UAAA,MAAM,OAAO,CAAA,GACzD;AAAA,IACC,oBAAA,eAAA,EAAc,OAAO,MAAM,MAAO,CAAA;AAAA,EAAA,EAAA,CACpC,EACD,CAAA;AAEF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevErrorBadge.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorBadge.tsx"],"sourcesContent":["export interface DevErrorBadgeProps {\n\tonOpen: () => void\n\terrorCount: number\n}\n\n\nconst className = (cls?: string | null) => cls ? `cui-devErrorBadge-${cls}` : 'cui-devErrorBadge'\n\nexport function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps) {\n\treturn (\n\t\t<div className={className()}>\n\t\t\t<a className={className('button')} onClick={onOpen}>\n\t\t\t\t{errorCount} {errorCount > 1 ? 'errors' : 'error'}\n\t\t\t</a>\n\t\t</div>\n\t)\n}\n"],"names":["jsx","jsxs"],"mappings":";;;AAMA,MAAM,YAAY,CAAC,QAAwB,MAAM,qBAAqB,GAAG,KAAK;AAEvE,SAAS,cAAc,EAAE,YAAY,UAA8B;AACzE,SACEA,2BAAAA,IAAA,OAAA,EAAI,WAAW,UAAA,GACf,UAAAC,2BAAA,KAAC,KAAE,EAAA,WAAW,UAAU,QAAQ,GAAG,SAAS,QAC1C,UAAA;AAAA,IAAA;AAAA,IAAW;AAAA,IAAE,aAAa,IAAI,WAAW;AAAA,EAAA,EAAA,CAC3C,EACD,CAAA;AAEF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevErrorBadge.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorBadge.tsx"],"sourcesContent":["export interface DevErrorBadgeProps {\n\tonOpen: () => void\n\terrorCount: number\n}\n\n\nconst className = (cls?: string | null) => cls ? `cui-devErrorBadge-${cls}` : 'cui-devErrorBadge'\n\nexport function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps) {\n\treturn (\n\t\t<div className={className()}>\n\t\t\t<a className={className('button')} onClick={onOpen}>\n\t\t\t\t{errorCount} {errorCount > 1 ? 'errors' : 'error'}\n\t\t\t</a>\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";AAMA,MAAM,YAAY,CAAC,QAAwB,MAAM,qBAAqB,GAAG,KAAK;AAEvE,SAAS,cAAc,EAAE,YAAY,UAA8B;AACzE,SACE,oBAAA,OAAA,EAAI,WAAW,UAAA,GACf,UAAA,qBAAC,KAAE,EAAA,WAAW,UAAU,QAAQ,GAAG,SAAS,QAC1C,UAAA;AAAA,IAAA;AAAA,IAAW;AAAA,IAAE,aAAa,IAAI,WAAW;AAAA,EAAA,EAAA,CAC3C,EACD,CAAA;AAEF;"}
|
|
@@ -10,7 +10,7 @@ function DevErrorInner({ error, level = 1 }) {
|
|
|
10
10
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: className("errorName"), children: errorObject.name }),
|
|
11
11
|
error.cause && /* @__PURE__ */ jsxRuntime.jsx("a", { href: `#error-${level}`, className: className("causeLink"), children: "caused by >" }),
|
|
12
12
|
errorObject.message && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: className("errorMessage"), children: errorObject.message }),
|
|
13
|
-
"details" in errorObject && /* @__PURE__ */ jsxRuntime.jsx("
|
|
13
|
+
"details" in errorObject && /* @__PURE__ */ jsxRuntime.jsx("div", { className: className("errorDetails"), children: errorObject.details })
|
|
14
14
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: className("errorName"), children: "Unknown error" }) }),
|
|
15
15
|
error.parsedStackStrace ? /* @__PURE__ */ jsxRuntime.jsx(StackTrace.StackTrace, { stackTrace: error.parsedStackStrace }) : errorObject?.stack ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: className("stack"), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: className("stack-dump"), children: errorObject.stack }) }) : null,
|
|
16
16
|
error.cause ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevErrorInner.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorInner.tsx"],"sourcesContent":["import { StackTrace } from './StackTrace'\nimport type { ProcessedError } from './types'\n\nexport interface DevErrorInnerProps {\n\terror: ProcessedError\n\tlevel?: number\n}\n\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevErrorInner({ error, level = 1 }: DevErrorInnerProps) {\n\n\tlet errorObject: Error | undefined = error.error instanceof Error ? error.error : undefined\n\n\treturn (\n\t\t<>\n\t\t\t<div className={className('header')}>\n\t\t\t\t{errorObject ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<h1 className={className('errorName')}>{errorObject.name}</h1>\n\t\t\t\t\t\t{error.cause && <a href={`#error-${level}`} className={className('causeLink')}>caused by ></a>}\n\t\t\t\t\t\t{errorObject.message && <h2 className={className('errorMessage')}>{errorObject.message}</h2>}\n\t\t\t\t\t\t{'details' in errorObject && <div className={className('errorDetails')}>{(errorObject as any).details}</div>}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<h1 className={className('errorName')}>Unknown error</h1>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{error.parsedStackStrace ? (\n\t\t\t\t<StackTrace stackTrace={error.parsedStackStrace} />\n\t\t\t) : errorObject?.stack ? (\n\t\t\t\t<div className={className('stack')}>\n\t\t\t\t\t<div className={className('stack-dump')}>{errorObject.stack}</div>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t{error.cause ? (\n\t\t\t\t<>\n\t\t\t\t\t<div className={className('causedBy')} id={`error-${level}`}>\n\t\t\t\t\t\tCaused by\n\t\t\t\t\t</div>\n\t\t\t\t\t<DevErrorInner error={error.cause} level={level + 1} />\n\t\t\t\t</>\n\t\t\t) : null}\n\t\t</>\n\t)\n}\n"],"names":["jsxs","Fragment","jsx","StackTrace"],"mappings":";;;;AASA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAElE,SAAS,cAAc,EAAE,OAAO,QAAQ,KAAyB;AAEvE,MAAI,cAAiC,MAAM,iBAAiB,QAAQ,MAAM,QAAQ;AAElF,SAEEA,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,IAAAC,2BAAAA,IAAC,SAAI,WAAW,UAAU,QAAQ,GAChC,wBAECF,2BAAAA,KAAAC,WAAA,UAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,QAAG,WAAW,UAAU,WAAW,GAAI,sBAAY,MAAK;AAAA,MACxD,MAAM,SAAUA,2BAAA,IAAA,KAAA,EAAE,MAAM,UAAU,KAAK,IAAI,WAAW,UAAU,WAAW,GAAG,UAAc,eAAA;AAAA,MAC5F,YAAY,WAAYA,+BAAA,MAAA,EAAG,WAAW,UAAU,cAAc,GAAI,UAAA,YAAY,QAAQ,CAAA;AAAA,MACtF,aAAa,eAAgBA,+BAAA,OAAA,EAAI,WAAW,UAAU,cAAc,GAAK,UAAA,YAAoB,QAAQ,CAAA;AAAA,IACvG,EAAA,CAAA,mCAEC,MAAG,EAAA,WAAW,UAAU,WAAW,GAAG,2BAAa,EAEtD,CAAA;AAAA,IACC,MAAM,oBACNA,2BAAAA,IAACC,WAAAA,YAAW,EAAA,YAAY,MAAM,kBAAmB,CAAA,IAC9C,aAAa,QACfD,2BAAAA,IAAA,OAAA,EAAI,WAAW,UAAU,OAAO,GAChC,UAAAA,2BAAA,IAAC,OAAI,EAAA,WAAW,UAAU,YAAY,GAAI,UAAA,YAAY,MAAM,CAAA,EAAA,CAC7D,IACG;AAAA,IACH,MAAM,QAELF,2BAAAA,KAAAC,WAAA,UAAA,EAAA,UAAA;AAAA,MAACC,2BAAAA,IAAA,OAAA,EAAI,WAAW,UAAU,UAAU,GAAG,IAAI,SAAS,KAAK,IAAI,UAE7D,YAAA,CAAA;AAAA,qCACC,eAAc,EAAA,OAAO,MAAM,OAAO,OAAO,QAAQ,EAAG,CAAA;AAAA,IAAA,EAAA,CACtD,IACG;AAAA,EAAA,GACL;AAEF;;"}
|
|
@@ -8,7 +8,7 @@ function DevErrorInner({ error, level = 1 }) {
|
|
|
8
8
|
/* @__PURE__ */ jsx("h1", { className: className("errorName"), children: errorObject.name }),
|
|
9
9
|
error.cause && /* @__PURE__ */ jsx("a", { href: `#error-${level}`, className: className("causeLink"), children: "caused by >" }),
|
|
10
10
|
errorObject.message && /* @__PURE__ */ jsx("h2", { className: className("errorMessage"), children: errorObject.message }),
|
|
11
|
-
"details" in errorObject && /* @__PURE__ */ jsx("
|
|
11
|
+
"details" in errorObject && /* @__PURE__ */ jsx("div", { className: className("errorDetails"), children: errorObject.details })
|
|
12
12
|
] }) : /* @__PURE__ */ jsx("h1", { className: className("errorName"), children: "Unknown error" }) }),
|
|
13
13
|
error.parsedStackStrace ? /* @__PURE__ */ jsx(StackTrace, { stackTrace: error.parsedStackStrace }) : errorObject?.stack ? /* @__PURE__ */ jsx("div", { className: className("stack"), children: /* @__PURE__ */ jsx("div", { className: className("stack-dump"), children: errorObject.stack }) }) : null,
|
|
14
14
|
error.cause ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevErrorInner.js","sources":["../../../../../../packages/react-devbar/src/ui/DevError/DevErrorInner.tsx"],"sourcesContent":["import { StackTrace } from './StackTrace'\nimport type { ProcessedError } from './types'\n\nexport interface DevErrorInnerProps {\n\terror: ProcessedError\n\tlevel?: number\n}\n\n\nconst className = (cls?: string | null) => cls ? `cui-devError-${cls}` : 'cui-devError'\n\nexport function DevErrorInner({ error, level = 1 }: DevErrorInnerProps) {\n\n\tlet errorObject: Error | undefined = error.error instanceof Error ? error.error : undefined\n\n\treturn (\n\t\t<>\n\t\t\t<div className={className('header')}>\n\t\t\t\t{errorObject ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<h1 className={className('errorName')}>{errorObject.name}</h1>\n\t\t\t\t\t\t{error.cause && <a href={`#error-${level}`} className={className('causeLink')}>caused by ></a>}\n\t\t\t\t\t\t{errorObject.message && <h2 className={className('errorMessage')}>{errorObject.message}</h2>}\n\t\t\t\t\t\t{'details' in errorObject && <div className={className('errorDetails')}>{(errorObject as any).details}</div>}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<h1 className={className('errorName')}>Unknown error</h1>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{error.parsedStackStrace ? (\n\t\t\t\t<StackTrace stackTrace={error.parsedStackStrace} />\n\t\t\t) : errorObject?.stack ? (\n\t\t\t\t<div className={className('stack')}>\n\t\t\t\t\t<div className={className('stack-dump')}>{errorObject.stack}</div>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t{error.cause ? (\n\t\t\t\t<>\n\t\t\t\t\t<div className={className('causedBy')} id={`error-${level}`}>\n\t\t\t\t\t\tCaused by\n\t\t\t\t\t</div>\n\t\t\t\t\t<DevErrorInner error={error.cause} level={level + 1} />\n\t\t\t\t</>\n\t\t\t) : null}\n\t\t</>\n\t)\n}\n"],"names":[],"mappings":";;AASA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAElE,SAAS,cAAc,EAAE,OAAO,QAAQ,KAAyB;AAEvE,MAAI,cAAiC,MAAM,iBAAiB,QAAQ,MAAM,QAAQ;AAElF,SAEE,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA,oBAAC,SAAI,WAAW,UAAU,QAAQ,GAChC,wBAEC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,oBAAC,QAAG,WAAW,UAAU,WAAW,GAAI,sBAAY,MAAK;AAAA,MACxD,MAAM,SAAU,oBAAA,KAAA,EAAE,MAAM,UAAU,KAAK,IAAI,WAAW,UAAU,WAAW,GAAG,UAAc,eAAA;AAAA,MAC5F,YAAY,WAAY,oBAAA,MAAA,EAAG,WAAW,UAAU,cAAc,GAAI,UAAA,YAAY,QAAQ,CAAA;AAAA,MACtF,aAAa,eAAgB,oBAAA,OAAA,EAAI,WAAW,UAAU,cAAc,GAAK,UAAA,YAAoB,QAAQ,CAAA;AAAA,IACvG,EAAA,CAAA,wBAEC,MAAG,EAAA,WAAW,UAAU,WAAW,GAAG,2BAAa,EAEtD,CAAA;AAAA,IACC,MAAM,oBACN,oBAAC,YAAW,EAAA,YAAY,MAAM,kBAAmB,CAAA,IAC9C,aAAa,QACf,oBAAA,OAAA,EAAI,WAAW,UAAU,OAAO,GAChC,UAAA,oBAAC,OAAI,EAAA,WAAW,UAAU,YAAY,GAAI,UAAA,YAAY,MAAM,CAAA,EAAA,CAC7D,IACG;AAAA,IACH,MAAM,QAEL,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAC,oBAAA,OAAA,EAAI,WAAW,UAAU,UAAU,GAAG,IAAI,SAAS,KAAK,IAAI,UAE7D,YAAA,CAAA;AAAA,0BACC,eAAc,EAAA,OAAO,MAAM,OAAO,OAAO,QAAQ,EAAG,CAAA;AAAA,IAAA,EAAA,CACtD,IACG;AAAA,EAAA,GACL;AAEF;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-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,6 +13,12 @@ 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__ */ jsxRuntime.jsx("div", { className: className(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: className("in"), children: [
|
|
16
23
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: className("bar"), children: [
|
|
17
24
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: className("errorSource"), children: currentErrorSource }),
|
|
@@ -24,14 +31,14 @@ function DevErrorList({
|
|
|
24
31
|
errorCount
|
|
25
32
|
] }),
|
|
26
33
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: className("switcherButtons"), children: [
|
|
27
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { className: className("switcherButton"), onClick: onPrevious, children: "
|
|
28
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { className: className("switcherButton"), onClick: onNext, children: "
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { className: className("switcherButton"), onClick: onPrevious, children: "←" }),
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { className: className("switcherButton"), onClick: onNext, children: "→" })
|
|
29
36
|
] })
|
|
30
37
|
] }) : null,
|
|
31
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: className("close"), children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: className("closeButton"), onClick: onClose, children: "
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: className("close"), children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: className("closeButton"), onClick: onClose, children: "✕" }) })
|
|
32
39
|
] })
|
|
33
40
|
] }),
|
|
34
|
-
/* @__PURE__ */ jsxRuntime.jsx(DevErrorInner.DevErrorInner, { error: currentError })
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: className("content"), children: /* @__PURE__ */ jsxRuntime.jsx(DevErrorInner.DevErrorInner, { error: currentError }) })
|
|
35
42
|
] }) });
|
|
36
43
|
}
|
|
37
44
|
exports.DevErrorList = DevErrorList;
|
|
@@ -0,0 +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'\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":["useE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AW,UAAU,OAAO,GAChC,UAAAA,+BAAC,UAAO,EAAA,WAAW,UAAU,aAAa,GAAG,SAAS,SAAS,eAE/D,EACD,CAAA;AAAA,MAAA,EACD,CAAA;AAAA,IAAA,GACD;AAAA,IACAA,2BAAAA,IAAC,OAAI,EAAA,WAAW,UAAU,SAAS,GAClC,UAACA,2BAAAA,IAAAE,cAAAA,eAAA,EAAc,OAAO,aAAc,CAAA,EACrC,CAAA;AAAA,EAAA,EAAA,CACD,EACD,CAAA;AAEF;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-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,6 +11,12 @@ 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__ */ jsx("div", { className: className(), children: /* @__PURE__ */ jsxs("div", { className: className("in"), children: [
|
|
14
21
|
/* @__PURE__ */ jsxs("div", { className: className("bar"), children: [
|
|
15
22
|
/* @__PURE__ */ jsx("div", { className: className("errorSource"), children: currentErrorSource }),
|
|
@@ -22,14 +29,14 @@ function DevErrorList({
|
|
|
22
29
|
errorCount
|
|
23
30
|
] }),
|
|
24
31
|
/* @__PURE__ */ jsxs("div", { className: className("switcherButtons"), children: [
|
|
25
|
-
/* @__PURE__ */ jsx("button", { className: className("switcherButton"), onClick: onPrevious, children: "
|
|
26
|
-
/* @__PURE__ */ jsx("button", { className: className("switcherButton"), onClick: onNext, children: "
|
|
32
|
+
/* @__PURE__ */ jsx("button", { className: className("switcherButton"), onClick: onPrevious, children: "←" }),
|
|
33
|
+
/* @__PURE__ */ jsx("button", { className: className("switcherButton"), onClick: onNext, children: "→" })
|
|
27
34
|
] })
|
|
28
35
|
] }) : null,
|
|
29
|
-
/* @__PURE__ */ jsx("div", { className: className("close"), children: /* @__PURE__ */ jsx("button", { className: className("closeButton"), onClick: onClose, children: "
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: className("close"), children: /* @__PURE__ */ jsx("button", { className: className("closeButton"), onClick: onClose, children: "✕" }) })
|
|
30
37
|
] })
|
|
31
38
|
] }),
|
|
32
|
-
/* @__PURE__ */ jsx(DevErrorInner, { error: currentError })
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: className("content"), children: /* @__PURE__ */ jsx(DevErrorInner, { error: currentError }) })
|
|
33
40
|
] }) });
|
|
34
41
|
}
|
|
35
42
|
export {
|
|
@@ -0,0 +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'\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,eAAA,KAAK,UAAU,OAAO,mBAAmB;AAAA,IACnD;AAAA,EACD,GAAG,EAAE;AAGJ,SAAA,oBAAC,OAAI,EAAA,WAAW,UAAU,GACzB,+BAAC,OAAI,EAAA,WAAW,UAAU,IAAI,GAC7B,UAAA;AAAA,IAAA,qBAAC,OAAI,EAAA,WAAW,UAAU,KAAK,GAC9B,UAAA;AAAA,MAAA,oBAAC,OAAI,EAAA,WAAW,UAAU,aAAa,GAAI,UAAmB,oBAAA;AAAA,MAC7D,qBAAA,OAAA,EAAI,WAAW,UAAU,SAAS,GACjC,UAAA;AAAA,QAAA,aAAa,IACZ,qBAAA,OAAA,EAAI,WAAW,UAAU,UAAU,GACnC,UAAA;AAAA,UAAA,qBAAC,KAAE,EAAA,WAAW,UAAU,YAAY,GAAG,UAAA;AAAA,YAAA;AAAA,YAC/B,oBAAoB;AAAA,YAAE;AAAA,YAAK;AAAA,UAAA,GACnC;AAAA,UACC,qBAAA,OAAA,EAAI,WAAW,UAAU,iBAAiB,GAC1C,UAAA;AAAA,YAAA,oBAAC,YAAO,WAAW,UAAU,gBAAgB,GAAG,SAAS,YAAY,UAErE,KAAA;AAAA,YACA,oBAAC,YAAO,WAAW,UAAU,gBAAgB,GAAG,SAAS,QAAQ,UAEjE,IAAA,CAAA;AAAA,UAAA,EACD,CAAA;AAAA,QAAA,EAAA,CACD,IACG;AAAA,QACH,oBAAA,OAAA,EAAI,WAAW,UAAU,OAAO,GAChC,UAAA,oBAAC,UAAO,EAAA,WAAW,UAAU,aAAa,GAAG,SAAS,SAAS,eAE/D,EACD,CAAA;AAAA,MAAA,EACD,CAAA;AAAA,IAAA,GACD;AAAA,IACA,oBAAC,OAAI,EAAA,WAAW,UAAU,SAAS,GAClC,UAAC,oBAAA,eAAA,EAAc,OAAO,aAAc,CAAA,EACrC,CAAA;AAAA,EAAA,EAAA,CACD,EACD,CAAA;AAEF;"}
|
|
@@ -0,0 +1 @@
|
|
|
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":["jsx","jsxs"],"mappings":";;;AAGA,MAAM,YAAY,CAAC,QAAwB,MAAM,gBAAgB,GAAG,KAAK;AAClE,MAAM,aAAa,CAAC,EAAE,iBAAmD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
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>\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A,IAAA,CAED,EACF,CAAA;AAAA,EAAA,GAEF;AAEF;"}
|
|
@@ -5,6 +5,6 @@ export declare const parseStacktrace: (e: Error) => Promise<{
|
|
|
5
5
|
callee: string;
|
|
6
6
|
thirdParty: boolean;
|
|
7
7
|
sourceCodeLines: string[] | undefined;
|
|
8
|
-
}[]>;
|
|
8
|
+
}[] | undefined>;
|
|
9
9
|
export declare const useProcessedError: (e: ErrorType) => ProcessedError;
|
|
10
10
|
//# sourceMappingURL=useParsedStacktrace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParsedStacktrace.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParsedStacktrace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE1D,eAAO,MAAM,eAAe,MAAa,KAAK;;;;;;
|
|
1
|
+
{"version":3,"file":"useParsedStacktrace.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParsedStacktrace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE1D,eAAO,MAAM,eAAe,MAAa,KAAK;;;;;;gBAc7C,CAAA;AAOD,eAAO,MAAM,iBAAiB,MAAO,SAAS,KAAG,cAoBhD,CAAA"}
|