@contember/react-devbar 1.3.0-alpha.14 → 1.3.0-alpha.16
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/DevErrorManager.cjs +98 -0
- package/dist/development/DevErrorManager.cjs.map +1 -0
- package/dist/development/DevErrorManager.js +98 -0
- package/dist/development/DevErrorManager.js.map +1 -0
- package/dist/development/errorHandling.cjs +30 -13
- package/dist/development/errorHandling.cjs.map +1 -1
- package/dist/development/errorHandling.js +30 -13
- package/dist/development/errorHandling.js.map +1 -1
- package/dist/development/ui/DevBar/DevBar.cjs +97 -21
- package/dist/development/ui/DevBar/DevBar.cjs.map +1 -1
- package/dist/development/ui/DevBar/DevBar.js +97 -21
- package/dist/development/ui/DevBar/DevBar.js.map +1 -1
- package/dist/development/ui/DevError/DevError.cjs +25 -5
- package/dist/development/ui/DevError/DevError.cjs.map +1 -1
- package/dist/development/ui/DevError/DevError.js +25 -5
- package/dist/development/ui/DevError/DevError.js.map +1 -1
- package/dist/development/ui/DevError/DevErrorBadge.cjs +11 -3
- package/dist/development/ui/DevError/DevErrorBadge.cjs.map +1 -1
- package/dist/development/ui/DevError/DevErrorBadge.js +11 -3
- package/dist/development/ui/DevError/DevErrorBadge.js.map +1 -1
- package/dist/development/ui/DevError/DevErrorInner.cjs +70 -14
- package/dist/development/ui/DevError/DevErrorInner.cjs.map +1 -1
- package/dist/development/ui/DevError/DevErrorInner.js +70 -14
- package/dist/development/ui/DevError/DevErrorInner.js.map +1 -1
- package/dist/development/ui/DevError/DevErrorList.cjs +70 -18
- package/dist/development/ui/DevError/DevErrorList.cjs.map +1 -1
- package/dist/development/ui/DevError/DevErrorList.js +70 -18
- package/dist/development/ui/DevError/DevErrorList.js.map +1 -1
- package/dist/development/ui/DevError/StackTrace.cjs +58 -15
- package/dist/development/ui/DevError/StackTrace.cjs.map +1 -1
- package/dist/development/ui/DevError/StackTrace.js +58 -15
- package/dist/development/ui/DevError/StackTrace.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useClassNameFactory, useWindowSize, useReferentiallyStableCallback, useOnElementClickOutsideCallback, useId, useOnElementMouseEnterDelayedCallback } from "@contember/react-utils";
|
|
3
3
|
import { dataAttribute } from "@contember/utilities";
|
|
4
4
|
import { useState, useRef, useEffect } from "react";
|
|
@@ -42,7 +42,7 @@ const DevBar = ({
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
const id = `dev-bar-panel${useId()}`;
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ jsxDEV(
|
|
46
46
|
"section",
|
|
47
47
|
{
|
|
48
48
|
"data-transparent": true,
|
|
@@ -62,9 +62,13 @@ const DevBar = ({
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
/* @__PURE__ */ jsxDEV("style", { children: `svg { pointer-events: none }` }, void 0, false, {
|
|
66
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
67
|
+
lineNumber: 83,
|
|
68
|
+
columnNumber: 4
|
|
69
|
+
}, void 0),
|
|
70
|
+
/* @__PURE__ */ jsxDEV("div", { ref: devBarContentRef, className: className("content"), children: [
|
|
71
|
+
/* @__PURE__ */ jsxDEV(
|
|
68
72
|
"div",
|
|
69
73
|
{
|
|
70
74
|
"data-expanded": dataAttribute(expanded),
|
|
@@ -72,12 +76,28 @@ const DevBar = ({
|
|
|
72
76
|
role: "dialog",
|
|
73
77
|
style: { display: "contents" },
|
|
74
78
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
79
|
+
/* @__PURE__ */ jsxDEV("div", { className: className("brand"), children: brand }, void 0, false, {
|
|
80
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
81
|
+
lineNumber: 91,
|
|
82
|
+
columnNumber: 6
|
|
83
|
+
}, void 0),
|
|
84
|
+
/* @__PURE__ */ jsxDEV("div", { className: className("panels"), children }, void 0, false, {
|
|
85
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
86
|
+
lineNumber: 96,
|
|
87
|
+
columnNumber: 6
|
|
88
|
+
}, void 0)
|
|
77
89
|
]
|
|
78
|
-
}
|
|
90
|
+
},
|
|
91
|
+
void 0,
|
|
92
|
+
true,
|
|
93
|
+
{
|
|
94
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
95
|
+
lineNumber: 85,
|
|
96
|
+
columnNumber: 5
|
|
97
|
+
},
|
|
98
|
+
void 0
|
|
79
99
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ jsxDEV(
|
|
81
101
|
"button",
|
|
82
102
|
{
|
|
83
103
|
ref: toggleButtonRef,
|
|
@@ -89,11 +109,31 @@ const DevBar = ({
|
|
|
89
109
|
onClick: handleToggle,
|
|
90
110
|
tabIndex: 0,
|
|
91
111
|
children: expanded ? "🗙" : "ᐸ"
|
|
92
|
-
}
|
|
112
|
+
},
|
|
113
|
+
void 0,
|
|
114
|
+
false,
|
|
115
|
+
{
|
|
116
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
117
|
+
lineNumber: 102,
|
|
118
|
+
columnNumber: 5
|
|
119
|
+
},
|
|
120
|
+
void 0
|
|
93
121
|
)
|
|
94
|
-
] }
|
|
122
|
+
] }, void 0, true, {
|
|
123
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
124
|
+
lineNumber: 84,
|
|
125
|
+
columnNumber: 4
|
|
126
|
+
}, void 0)
|
|
95
127
|
]
|
|
96
|
-
}
|
|
128
|
+
},
|
|
129
|
+
void 0,
|
|
130
|
+
true,
|
|
131
|
+
{
|
|
132
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
133
|
+
lineNumber: 64,
|
|
134
|
+
columnNumber: 3
|
|
135
|
+
},
|
|
136
|
+
void 0
|
|
97
137
|
);
|
|
98
138
|
};
|
|
99
139
|
const DevPanel = ({ heading, icon, children, preview }) => {
|
|
@@ -108,7 +148,7 @@ const DevPanel = ({ heading, icon, children, preview }) => {
|
|
|
108
148
|
setExpanded(true);
|
|
109
149
|
}
|
|
110
150
|
}));
|
|
111
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ jsxDEV(
|
|
112
152
|
"div",
|
|
113
153
|
{
|
|
114
154
|
ref: devPanelRef,
|
|
@@ -125,7 +165,7 @@ const DevPanel = ({ heading, icon, children, preview }) => {
|
|
|
125
165
|
}
|
|
126
166
|
}),
|
|
127
167
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ jsxDEV(
|
|
129
169
|
"button",
|
|
130
170
|
{
|
|
131
171
|
tabIndex: 0,
|
|
@@ -143,16 +183,52 @@ const DevPanel = ({ heading, icon, children, preview }) => {
|
|
|
143
183
|
}),
|
|
144
184
|
children: [
|
|
145
185
|
icon,
|
|
146
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ jsxDEV("span", { className: className("trigger-label-text"), children: preview ?? heading }, void 0, false, {
|
|
187
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
188
|
+
lineNumber: 171,
|
|
189
|
+
columnNumber: 5
|
|
190
|
+
}, void 0)
|
|
147
191
|
]
|
|
148
|
-
}
|
|
192
|
+
},
|
|
193
|
+
void 0,
|
|
194
|
+
true,
|
|
195
|
+
{
|
|
196
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
197
|
+
lineNumber: 155,
|
|
198
|
+
columnNumber: 4
|
|
199
|
+
},
|
|
200
|
+
void 0
|
|
149
201
|
),
|
|
150
|
-
expanded && /* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
153
|
-
|
|
202
|
+
expanded && /* @__PURE__ */ jsxDEV("div", { tabIndex: 0, id, role: "dialog", className: className("panel", "dangerously-remove-native-focus-outline"), children: /* @__PURE__ */ jsxDEV("div", { className: className("panel-content", "native-focus-outline-handler"), children: [
|
|
203
|
+
/* @__PURE__ */ jsxDEV("h2", { className: "h4", children: heading }, void 0, false, {
|
|
204
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
205
|
+
lineNumber: 176,
|
|
206
|
+
columnNumber: 7
|
|
207
|
+
}, void 0),
|
|
208
|
+
/* @__PURE__ */ jsxDEV("div", { className: className("panel-body"), children }, void 0, false, {
|
|
209
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
210
|
+
lineNumber: 179,
|
|
211
|
+
columnNumber: 7
|
|
212
|
+
}, void 0)
|
|
213
|
+
] }, void 0, true, {
|
|
214
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
215
|
+
lineNumber: 175,
|
|
216
|
+
columnNumber: 6
|
|
217
|
+
}, void 0) }, void 0, false, {
|
|
218
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
219
|
+
lineNumber: 174,
|
|
220
|
+
columnNumber: 5
|
|
221
|
+
}, void 0)
|
|
154
222
|
]
|
|
155
|
-
}
|
|
223
|
+
},
|
|
224
|
+
void 0,
|
|
225
|
+
true,
|
|
226
|
+
{
|
|
227
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
|
|
228
|
+
lineNumber: 140,
|
|
229
|
+
columnNumber: 3
|
|
230
|
+
},
|
|
231
|
+
void 0
|
|
156
232
|
);
|
|
157
233
|
};
|
|
158
234
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevBar.js","sources":["../../../../src/ui/DevBar/DevBar.tsx"],"sourcesContent":["import {\n\tuseClassNameFactory,\n\tuseId,\n\tuseOnElementClickOutsideCallback,\n\tuseOnElementMouseEnterDelayedCallback,\n\tuseReferentiallyStableCallback,\n\tuseWindowSize,\n} from '@contember/react-utils'\nimport { dataAttribute } from '@contember/utilities'\nimport { PropsWithChildren, ReactNode, useEffect, useRef, useState } from 'react'\n\nexport const DevBar = ({\n\tbreakpoint = 768,\n\tchildren,\n\tbrand,\n}: PropsWithChildren<{\n\tbrand?: ReactNode;\n\tbreakpoint?: number;\n}>) => {\n\tconst className = useClassNameFactory('devBar')\n\tconst [expanded, setExpanded] = useState(true)\n\tconst isSmallScreen = useWindowSize().width < breakpoint\n\tconst toggleButtonRef = useRef<HTMLButtonElement>(null)\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\tif (expanded) {\n\t\t\t\t\tsetExpanded(false)\n\t\t\t\t\ttoggleButtonRef.current?.blur()\n\t\t\t\t} else {\n\t\t\t\t\tif (toggleButtonRef.current !== document.activeElement) {\n\t\t\t\t\t\ttoggleButtonRef.current?.focus()\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttoggleButtonRef.current?.blur()\n\t\t\t\t\t}\n\t\t\t\t}\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\ttoggleButtonRef.current?.blur()\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\n\t\t\tdata-overrides-lucide-icons\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tdata-small-screen={dataAttribute(isSmallScreen)}\n\t\t\tclassName={className(null)}\n\t\t\tonKeyDown={event => {\n\t\t\t\tif (event.code === 'Escape') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\n\t\t\t\t\tif (expanded) {\n\t\t\t\t\t\tsetExpanded(false)\n\t\t\t\t\t} else if (document.activeElement && document.activeElement instanceof HTMLElement) {\n\t\t\t\t\t\tdocument.activeElement.blur()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<style>{`svg { pointer-events: none }`}</style>\n\t\t\t<div ref={devBarContentRef} className={className('content')}>\n\t\t\t\t<div\n\t\t\t\t\tdata-expanded={dataAttribute(expanded)}\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('brand')}>\n\t\t\t\t\t\t{brand}\n\n\t\t\t\t\t</div>\n\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\n\t\t\t\t</div>\n\n\t\t\t\t<button\n\t\t\t\t\tref={toggleButtonRef}\n\t\t\t\t\tid=\"dev-bar-toggle-button\"\n\t\t\t\t\taria-label=\"Toggle Contember Developer Toolbar\"\n\t\t\t\t\taria-controls={id}\n\t\t\t\t\taria-expanded={expanded}\n\t\t\t\t\tclassName={className('close')}\n\t\t\t\t\tonClick={handleToggle}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t>\n\t\t\t\t\t{expanded ? '🗙' : 'ᐸ'}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</section>\n\t)\n}\n\nexport const DevPanel = ({ heading, icon, children, preview }: {\n\ticon: ReactNode;\n\theading: ReactNode,\n\tchildren: ReactNode,\n\tpreview?: ReactNode\n}) => {\n\tconst id = `cui-devBar-panel-${useId()}`\n\tconst className = useClassNameFactory('devBar')\n\tconst [expanded, setExpanded] = useState(false)\n\tconst mouseEnterTimeStampRef = useRef<ReturnType<typeof Date.now> | undefined>(undefined)\n\n\tconst devPanelRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementMouseEnterDelayedCallback(devPanelRef, useReferentiallyStableCallback(({ type }) => {\n\t\tif (type === 'mouseenter') {\n\t\t\tmouseEnterTimeStampRef.current = Date.now() + 300\n\t\t\tsetExpanded(true)\n\t\t}\n\t}))\n\n\treturn (\n\t\t<div\n\t\t\tref={devPanelRef}\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tclassName={className('trigger')}\n\t\t\tonMouseLeave={useReferentiallyStableCallback(() => {\n\t\t\t\tsetExpanded(false)\n\t\t\t})}\n\t\t\tonKeyDown={useReferentiallyStableCallback(event => {\n\t\t\t\tif (expanded && event.code === 'Escape') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsetExpanded(false)\n\t\t\t\t}\n\t\t\t})}\n\t\t>\n\t\t\t<button\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-controls={id}\n\t\t\t\taria-expanded={expanded}\n\t\t\t\tclassName={className('trigger-label')}\n\t\t\t\tonClick={useReferentiallyStableCallback(() => {\n\t\t\t\t\tif (mouseEnterTimeStampRef.current && Date.now() < mouseEnterTimeStampRef.current) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetExpanded(expanded => !expanded)\n\t\t\t\t\t\tmouseEnterTimeStampRef.current = undefined\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className={className('trigger-label-text')}>{preview ?? heading}</span>\n\t\t\t</button>\n\t\t\t{expanded && (\n\t\t\t\t<div tabIndex={0} id={id} role=\"dialog\" className={className('panel', 'dangerously-remove-native-focus-outline')}>\n\t\t\t\t\t<div className={className('panel-content', 'native-focus-outline-handler')}>\n\t\t\t\t\t\t<h2 className=\"h4\">\n\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<div className={className('panel-body')}>\n\t\t\t\t\t\t\t{children}\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)}\n\t\t</div>\n\t)\n}\n"],"names":["expanded"],"mappings":";;;;AAWO,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AAAA,EACA;AACD,MAGO;AACA,QAAA,YAAY,oBAAoB,QAAQ;AAC9C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,IAAI;AACvC,QAAA,gBAAgB,gBAAgB,QAAQ;AACxC,QAAA,kBAAkB,OAA0B,IAAI;AAEhD,QAAA,eAAe,+BAA+B,MAAM;AAC7C,gBAAA,CAAAA,cAAY,CAACA,SAAQ;AAAA,EAAA,CACjC;AAED,YAAU,MAAM;AACf,aAAS,cAAc,OAAsB;AAC5C,UAAI,MAAM,SAAS,WAAW,MAAM,WAAW,MAAM,UAAU;AAC9D,cAAM,eAAe;AACrB,cAAM,gBAAgB;AAEtB,YAAI,UAAU;AACb,sBAAY,KAAK;AACjB,0BAAgB,SAAS;QAAK,OACxB;AACF,cAAA,gBAAgB,YAAY,SAAS,eAAe;AACvD,4BAAgB,SAAS;UAAM,OACzB;AACN,4BAAgB,SAAS;UAC1B;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAES,aAAA,iBAAiB,WAAW,aAAa;AAClD,WAAO,MAAM,SAAS,oBAAoB,WAAW,aAAa;AAAA,EAAA,GAChE,CAAC,UAAU,YAAY,CA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AA;AAAA,cAAA;AAAA,kCACA,QAAK,EAAA,WAAW,UAAU,oBAAoB,GAAI,qBAAW,SAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QACvE;AAAA,QACC,YACC,oBAAA,OAAA,EAAI,UAAU,GAAG,IAAQ,MAAK,UAAS,WAAW,UAAU,SAAS,yCAAyC,GAC9G,UAAC,qBAAA,OAAA,EAAI,WAAW,UAAU,iBAAiB,8BAA8B,GACxE,UAAA;AAAA,UAAC,oBAAA,MAAA,EAAG,WAAU,MACZ,UACF,SAAA;AAAA,8BACC,OAAI,EAAA,WAAW,UAAU,YAAY,GACpC,UACF;AAAA,QAAA,EAAA,CACD,EACD,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIJ;"}
|
|
1
|
+
{"version":3,"file":"DevBar.js","sources":["../../../../src/ui/DevBar/DevBar.tsx"],"sourcesContent":["import {\n\tuseClassNameFactory,\n\tuseId,\n\tuseOnElementClickOutsideCallback,\n\tuseOnElementMouseEnterDelayedCallback,\n\tuseReferentiallyStableCallback,\n\tuseWindowSize,\n} from '@contember/react-utils'\nimport { dataAttribute } from '@contember/utilities'\nimport { PropsWithChildren, ReactNode, useEffect, useRef, useState } from 'react'\n\nexport const DevBar = ({\n\tbreakpoint = 768,\n\tchildren,\n\tbrand,\n}: PropsWithChildren<{\n\tbrand?: ReactNode;\n\tbreakpoint?: number;\n}>) => {\n\tconst className = useClassNameFactory('devBar')\n\tconst [expanded, setExpanded] = useState(true)\n\tconst isSmallScreen = useWindowSize().width < breakpoint\n\tconst toggleButtonRef = useRef<HTMLButtonElement>(null)\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\tif (expanded) {\n\t\t\t\t\tsetExpanded(false)\n\t\t\t\t\ttoggleButtonRef.current?.blur()\n\t\t\t\t} else {\n\t\t\t\t\tif (toggleButtonRef.current !== document.activeElement) {\n\t\t\t\t\t\ttoggleButtonRef.current?.focus()\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttoggleButtonRef.current?.blur()\n\t\t\t\t\t}\n\t\t\t\t}\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\ttoggleButtonRef.current?.blur()\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\n\t\t\tdata-overrides-lucide-icons\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tdata-small-screen={dataAttribute(isSmallScreen)}\n\t\t\tclassName={className(null)}\n\t\t\tonKeyDown={event => {\n\t\t\t\tif (event.code === 'Escape') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\n\t\t\t\t\tif (expanded) {\n\t\t\t\t\t\tsetExpanded(false)\n\t\t\t\t\t} else if (document.activeElement && document.activeElement instanceof HTMLElement) {\n\t\t\t\t\t\tdocument.activeElement.blur()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<style>{`svg { pointer-events: none }`}</style>\n\t\t\t<div ref={devBarContentRef} className={className('content')}>\n\t\t\t\t<div\n\t\t\t\t\tdata-expanded={dataAttribute(expanded)}\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('brand')}>\n\t\t\t\t\t\t{brand}\n\n\t\t\t\t\t</div>\n\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\n\t\t\t\t</div>\n\n\t\t\t\t<button\n\t\t\t\t\tref={toggleButtonRef}\n\t\t\t\t\tid=\"dev-bar-toggle-button\"\n\t\t\t\t\taria-label=\"Toggle Contember Developer Toolbar\"\n\t\t\t\t\taria-controls={id}\n\t\t\t\t\taria-expanded={expanded}\n\t\t\t\t\tclassName={className('close')}\n\t\t\t\t\tonClick={handleToggle}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t>\n\t\t\t\t\t{expanded ? '🗙' : 'ᐸ'}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</section>\n\t)\n}\n\nexport const DevPanel = ({ heading, icon, children, preview }: {\n\ticon: ReactNode;\n\theading: ReactNode,\n\tchildren: ReactNode,\n\tpreview?: ReactNode\n}) => {\n\tconst id = `cui-devBar-panel-${useId()}`\n\tconst className = useClassNameFactory('devBar')\n\tconst [expanded, setExpanded] = useState(false)\n\tconst mouseEnterTimeStampRef = useRef<ReturnType<typeof Date.now> | undefined>(undefined)\n\n\tconst devPanelRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementMouseEnterDelayedCallback(devPanelRef, useReferentiallyStableCallback(({ type }) => {\n\t\tif (type === 'mouseenter') {\n\t\t\tmouseEnterTimeStampRef.current = Date.now() + 300\n\t\t\tsetExpanded(true)\n\t\t}\n\t}))\n\n\treturn (\n\t\t<div\n\t\t\tref={devPanelRef}\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tclassName={className('trigger')}\n\t\t\tonMouseLeave={useReferentiallyStableCallback(() => {\n\t\t\t\tsetExpanded(false)\n\t\t\t})}\n\t\t\tonKeyDown={useReferentiallyStableCallback(event => {\n\t\t\t\tif (expanded && event.code === 'Escape') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsetExpanded(false)\n\t\t\t\t}\n\t\t\t})}\n\t\t>\n\t\t\t<button\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-controls={id}\n\t\t\t\taria-expanded={expanded}\n\t\t\t\tclassName={className('trigger-label')}\n\t\t\t\tonClick={useReferentiallyStableCallback(() => {\n\t\t\t\t\tif (mouseEnterTimeStampRef.current && Date.now() < mouseEnterTimeStampRef.current) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetExpanded(expanded => !expanded)\n\t\t\t\t\t\tmouseEnterTimeStampRef.current = undefined\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className={className('trigger-label-text')}>{preview ?? heading}</span>\n\t\t\t</button>\n\t\t\t{expanded && (\n\t\t\t\t<div tabIndex={0} id={id} role=\"dialog\" className={className('panel', 'dangerously-remove-native-focus-outline')}>\n\t\t\t\t\t<div className={className('panel-content', 'native-focus-outline-handler')}>\n\t\t\t\t\t\t<h2 className=\"h4\">\n\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<div className={className('panel-body')}>\n\t\t\t\t\t\t\t{children}\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)}\n\t\t</div>\n\t)\n}\n"],"names":["expanded","this"],"mappings":";;;;AAWO,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AAAA,EACA;AACD,MAGO;AACA,QAAA,YAAY,oBAAoB,QAAQ;AAC9C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,IAAI;AACvC,QAAA,gBAAgB,gBAAgB,QAAQ;AACxC,QAAA,kBAAkB,OAA0B,IAAI;AAEhD,QAAA,eAAe,+BAA+B,MAAM;AAC7C,gBAAA,CAAAA,cAAY,CAACA,SAAQ;AAAA,EAAA,CACjC;AAED,YAAU,MAAM;AACf,aAAS,cAAc,OAAsB;AA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react/jsx-dev-runtime");
|
|
4
4
|
const reactUtils = require("@contember/react-utils");
|
|
5
5
|
const DevErrorInner = require("./DevErrorInner.cjs");
|
|
6
6
|
function DevError(props) {
|
|
7
7
|
const componentClassName = reactUtils.useClassNameFactory("devError");
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName(), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("in"), children: [
|
|
9
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("bar"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("errorSource"), children: props.source }, void 0, false, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
11
|
+
lineNumber: 15,
|
|
12
|
+
columnNumber: 6
|
|
13
|
+
}, this) }, void 0, false, {
|
|
14
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
15
|
+
lineNumber: 14,
|
|
16
|
+
columnNumber: 5
|
|
17
|
+
}, this),
|
|
18
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV(DevErrorInner.DevErrorInner, { error: props.error }, void 0, false, {
|
|
19
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
20
|
+
lineNumber: 17,
|
|
21
|
+
columnNumber: 5
|
|
22
|
+
}, this)
|
|
23
|
+
] }, void 0, true, {
|
|
24
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
25
|
+
lineNumber: 13,
|
|
26
|
+
columnNumber: 4
|
|
27
|
+
}, this) }, void 0, false, {
|
|
28
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
29
|
+
lineNumber: 12,
|
|
30
|
+
columnNumber: 3
|
|
31
|
+
}, this);
|
|
12
32
|
}
|
|
13
33
|
exports.DevError = DevError;
|
|
14
34
|
//# sourceMappingURL=DevError.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevError.cjs","sources":["../../../../src/ui/DevError/DevError.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\nimport { DevErrorInner, DevErrorInnerProps } from './DevErrorInner'\n\nexport interface DevErrorProps extends DevErrorInnerProps {\n\tsource: string\n}\n\nexport function DevError(props: DevErrorProps) {\n\tconst componentClassName = useClassNameFactory('devError')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<div className={componentClassName('in')}>\n\t\t\t\t<div className={componentClassName('bar')}>\n\t\t\t\t\t<div className={componentClassName('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":["useClassNameFactory","
|
|
1
|
+
{"version":3,"file":"DevError.cjs","sources":["../../../../src/ui/DevError/DevError.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\nimport { DevErrorInner, DevErrorInnerProps } from './DevErrorInner'\n\nexport interface DevErrorProps extends DevErrorInnerProps {\n\tsource: string\n}\n\nexport function DevError(props: DevErrorProps) {\n\tconst componentClassName = useClassNameFactory('devError')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<div className={componentClassName('in')}>\n\t\t\t\t<div className={componentClassName('bar')}>\n\t\t\t\t\t<div className={componentClassName('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":["useClassNameFactory","jsxDEV","DevErrorInner"],"mappings":";;;;;AAOO,SAAS,SAAS,OAAsB;AACxC,QAAA,qBAAqBA,+BAAoB,UAAU;AAGxD,SAAAC,8BAAA,OAAC,OAAI,EAAA,WAAW,mBAAmB,GAClC,+CAAC,OAAI,EAAA,WAAW,mBAAmB,IAAI,GACtC,UAAA;AAAA,IAAAA,qCAAC,OAAI,EAAA,WAAW,mBAAmB,KAAK,GACvC,UAAAA,8BAAAA,OAAC,OAAI,EAAA,WAAW,mBAAmB,aAAa,GAAI,UAAA,MAAM,OAA1D,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAA,IAAiE,EADlE,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAEA,GAAA,IAAA;AAAA,IACCA,qCAAAC,cAAAA,eAAA,EAAc,OAAO,MAAM,SAA5B,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAmC,GAAA,IAAA;AAAA,EAAA,KAJpC,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAKA,EAND,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAOA,GAAA,IAAA;AAEF;;"}
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useClassNameFactory } from "@contember/react-utils";
|
|
3
3
|
import { DevErrorInner } from "./DevErrorInner.js";
|
|
4
4
|
function DevError(props) {
|
|
5
5
|
const componentClassName = useClassNameFactory("devError");
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
return /* @__PURE__ */ jsxDEV("div", { className: componentClassName(), children: /* @__PURE__ */ jsxDEV("div", { className: componentClassName("in"), children: [
|
|
7
|
+
/* @__PURE__ */ jsxDEV("div", { className: componentClassName("bar"), children: /* @__PURE__ */ jsxDEV("div", { className: componentClassName("errorSource"), children: props.source }, void 0, false, {
|
|
8
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
9
|
+
lineNumber: 15,
|
|
10
|
+
columnNumber: 6
|
|
11
|
+
}, this) }, void 0, false, {
|
|
12
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
13
|
+
lineNumber: 14,
|
|
14
|
+
columnNumber: 5
|
|
15
|
+
}, this),
|
|
16
|
+
/* @__PURE__ */ jsxDEV(DevErrorInner, { error: props.error }, void 0, false, {
|
|
17
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
18
|
+
lineNumber: 17,
|
|
19
|
+
columnNumber: 5
|
|
20
|
+
}, this)
|
|
21
|
+
] }, void 0, true, {
|
|
22
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
23
|
+
lineNumber: 13,
|
|
24
|
+
columnNumber: 4
|
|
25
|
+
}, this) }, void 0, false, {
|
|
26
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevError.tsx",
|
|
27
|
+
lineNumber: 12,
|
|
28
|
+
columnNumber: 3
|
|
29
|
+
}, this);
|
|
10
30
|
}
|
|
11
31
|
export {
|
|
12
32
|
DevError
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevError.js","sources":["../../../../src/ui/DevError/DevError.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\nimport { DevErrorInner, DevErrorInnerProps } from './DevErrorInner'\n\nexport interface DevErrorProps extends DevErrorInnerProps {\n\tsource: string\n}\n\nexport function DevError(props: DevErrorProps) {\n\tconst componentClassName = useClassNameFactory('devError')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<div className={componentClassName('in')}>\n\t\t\t\t<div className={componentClassName('bar')}>\n\t\t\t\t\t<div className={componentClassName('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":";;;AAOO,SAAS,SAAS,OAAsB;AACxC,QAAA,qBAAqB,oBAAoB,UAAU;AAGxD,SAAA,
|
|
1
|
+
{"version":3,"file":"DevError.js","sources":["../../../../src/ui/DevError/DevError.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\nimport { DevErrorInner, DevErrorInnerProps } from './DevErrorInner'\n\nexport interface DevErrorProps extends DevErrorInnerProps {\n\tsource: string\n}\n\nexport function DevError(props: DevErrorProps) {\n\tconst componentClassName = useClassNameFactory('devError')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<div className={componentClassName('in')}>\n\t\t\t\t<div className={componentClassName('bar')}>\n\t\t\t\t\t<div className={componentClassName('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":";;;AAOO,SAAS,SAAS,OAAsB;AACxC,QAAA,qBAAqB,oBAAoB,UAAU;AAGxD,SAAA,uBAAC,OAAI,EAAA,WAAW,mBAAmB,GAClC,iCAAC,OAAI,EAAA,WAAW,mBAAmB,IAAI,GACtC,UAAA;AAAA,IAAA,uBAAC,OAAI,EAAA,WAAW,mBAAmB,KAAK,GACvC,UAAA,uBAAC,OAAI,EAAA,WAAW,mBAAmB,aAAa,GAAI,UAAA,MAAM,OAA1D,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAA,IAAiE,EADlE,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAEA,GAAA,IAAA;AAAA,IACC,uBAAA,eAAA,EAAc,OAAO,MAAM,SAA5B,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAmC,GAAA,IAAA;AAAA,EAAA,KAJpC,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAKA,EAND,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAOA,GAAA,IAAA;AAEF;"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const reactUtils = require("@contember/react-utils");
|
|
5
5
|
function DevErrorBadge({ errorCount, onOpen }) {
|
|
6
6
|
const componentClassName = reactUtils.useClassNameFactory("devErrorBadge");
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName(), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("a", { className: componentClassName("button"), onClick: onOpen, children: [
|
|
8
8
|
errorCount,
|
|
9
9
|
" ",
|
|
10
10
|
errorCount > 1 ? "errors" : "error"
|
|
11
|
-
] }
|
|
11
|
+
] }, void 0, true, {
|
|
12
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorBadge.tsx",
|
|
13
|
+
lineNumber: 13,
|
|
14
|
+
columnNumber: 4
|
|
15
|
+
}, this) }, void 0, false, {
|
|
16
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorBadge.tsx",
|
|
17
|
+
lineNumber: 12,
|
|
18
|
+
columnNumber: 3
|
|
19
|
+
}, this);
|
|
12
20
|
}
|
|
13
21
|
exports.DevErrorBadge = DevErrorBadge;
|
|
14
22
|
//# sourceMappingURL=DevErrorBadge.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorBadge.cjs","sources":["../../../../src/ui/DevError/DevErrorBadge.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\n\nexport interface DevErrorBadgeProps {\n\tonOpen: () => void\n\terrorCount: number\n}\n\nexport function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps) {\n\tconst componentClassName = useClassNameFactory('devErrorBadge')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<a className={componentClassName('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":["useClassNameFactory","
|
|
1
|
+
{"version":3,"file":"DevErrorBadge.cjs","sources":["../../../../src/ui/DevError/DevErrorBadge.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\n\nexport interface DevErrorBadgeProps {\n\tonOpen: () => void\n\terrorCount: number\n}\n\nexport function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps) {\n\tconst componentClassName = useClassNameFactory('devErrorBadge')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<a className={componentClassName('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":["useClassNameFactory","jsxDEV"],"mappings":";;;;AAOO,SAAS,cAAc,EAAE,YAAY,UAA8B;AACnE,QAAA,qBAAqBA,+BAAoB,eAAe;AAE9D,SACEC,8BAAAA,OAAA,OAAA,EAAI,WAAW,mBAAA,GACf,UAAAA,8BAAA,OAAC,KAAE,EAAA,WAAW,mBAAmB,QAAQ,GAAG,SAAS,QACnD,UAAA;AAAA,IAAA;AAAA,IAAW;AAAA,IAAE,aAAa,IAAI,WAAW;AAAA,EAAA,KAD3C,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAIA,GAAA,IAAA;AAEF;;"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useClassNameFactory } from "@contember/react-utils";
|
|
3
3
|
function DevErrorBadge({ errorCount, onOpen }) {
|
|
4
4
|
const componentClassName = useClassNameFactory("devErrorBadge");
|
|
5
|
-
return /* @__PURE__ */
|
|
5
|
+
return /* @__PURE__ */ jsxDEV("div", { className: componentClassName(), children: /* @__PURE__ */ jsxDEV("a", { className: componentClassName("button"), onClick: onOpen, children: [
|
|
6
6
|
errorCount,
|
|
7
7
|
" ",
|
|
8
8
|
errorCount > 1 ? "errors" : "error"
|
|
9
|
-
] }
|
|
9
|
+
] }, void 0, true, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorBadge.tsx",
|
|
11
|
+
lineNumber: 13,
|
|
12
|
+
columnNumber: 4
|
|
13
|
+
}, this) }, void 0, false, {
|
|
14
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorBadge.tsx",
|
|
15
|
+
lineNumber: 12,
|
|
16
|
+
columnNumber: 3
|
|
17
|
+
}, this);
|
|
10
18
|
}
|
|
11
19
|
export {
|
|
12
20
|
DevErrorBadge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorBadge.js","sources":["../../../../src/ui/DevError/DevErrorBadge.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\n\nexport interface DevErrorBadgeProps {\n\tonOpen: () => void\n\terrorCount: number\n}\n\nexport function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps) {\n\tconst componentClassName = useClassNameFactory('devErrorBadge')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<a className={componentClassName('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":";;AAOO,SAAS,cAAc,EAAE,YAAY,UAA8B;AACnE,QAAA,qBAAqB,oBAAoB,eAAe;AAE9D,SACE,
|
|
1
|
+
{"version":3,"file":"DevErrorBadge.js","sources":["../../../../src/ui/DevError/DevErrorBadge.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\n\nexport interface DevErrorBadgeProps {\n\tonOpen: () => void\n\terrorCount: number\n}\n\nexport function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps) {\n\tconst componentClassName = useClassNameFactory('devErrorBadge')\n\n\treturn (\n\t\t<div className={componentClassName()}>\n\t\t\t<a className={componentClassName('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":";;AAOO,SAAS,cAAc,EAAE,YAAY,UAA8B;AACnE,QAAA,qBAAqB,oBAAoB,eAAe;AAE9D,SACE,uBAAA,OAAA,EAAI,WAAW,mBAAA,GACf,UAAA,uBAAC,KAAE,EAAA,WAAW,mBAAmB,QAAQ,GAAG,SAAS,QACnD,UAAA;AAAA,IAAA;AAAA,IAAW;AAAA,IAAE,aAAa,IAAI,WAAW;AAAA,EAAA,KAD3C,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,IAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAIA,GAAA,IAAA;AAEF;"}
|
|
@@ -1,24 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const reactUtils = require("@contember/react-utils");
|
|
5
5
|
const StackTrace = require("./StackTrace.cjs");
|
|
6
6
|
function DevErrorInner({ error, level = 1 }) {
|
|
7
7
|
const componentClassName = reactUtils.useClassNameFactory("devError");
|
|
8
8
|
let errorObject = error.error instanceof Error ? error.error : void 0;
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: [
|
|
10
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("header"), children: errorObject ? /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("h1", { className: componentClassName("errorName"), children: errorObject.name }, void 0, false, {
|
|
12
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
13
|
+
lineNumber: 20,
|
|
14
|
+
columnNumber: 7
|
|
15
|
+
}, this),
|
|
16
|
+
error.cause && /* @__PURE__ */ jsxDevRuntime.jsxDEV("a", { href: `#error-${level}`, className: componentClassName("causeLink"), children: "caused by >" }, void 0, false, {
|
|
17
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
18
|
+
lineNumber: 21,
|
|
19
|
+
columnNumber: 23
|
|
20
|
+
}, this),
|
|
21
|
+
errorObject.message && /* @__PURE__ */ jsxDevRuntime.jsxDEV("h2", { className: componentClassName("errorMessage"), children: errorObject.message }, void 0, false, {
|
|
22
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
23
|
+
lineNumber: 22,
|
|
24
|
+
columnNumber: 31
|
|
25
|
+
}, this),
|
|
26
|
+
"details" in errorObject && /* @__PURE__ */ jsxDevRuntime.jsxDEV("h3", { className: componentClassName("errorDetails"), children: errorObject.details }, void 0, false, {
|
|
27
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
28
|
+
lineNumber: 23,
|
|
29
|
+
columnNumber: 36
|
|
30
|
+
}, this)
|
|
31
|
+
] }, void 0, true, {
|
|
32
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
33
|
+
lineNumber: 19,
|
|
34
|
+
columnNumber: 6
|
|
35
|
+
}, this) : /* @__PURE__ */ jsxDevRuntime.jsxDEV("h1", { className: componentClassName("errorName"), children: "Unknown error" }, void 0, false, {
|
|
36
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
37
|
+
lineNumber: 26,
|
|
38
|
+
columnNumber: 6
|
|
39
|
+
}, this) }, void 0, false, {
|
|
40
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
41
|
+
lineNumber: 17,
|
|
42
|
+
columnNumber: 4
|
|
43
|
+
}, this),
|
|
44
|
+
error.parsedStackStrace ? /* @__PURE__ */ jsxDevRuntime.jsxDEV(StackTrace.StackTrace, { stackTrace: error.parsedStackStrace }, void 0, false, {
|
|
45
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
46
|
+
lineNumber: 30,
|
|
47
|
+
columnNumber: 5
|
|
48
|
+
}, this) : errorObject?.stack ? /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("stack"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("stack-dump"), children: errorObject.stack }, void 0, false, {
|
|
49
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
50
|
+
lineNumber: 33,
|
|
51
|
+
columnNumber: 6
|
|
52
|
+
}, this) }, void 0, false, {
|
|
53
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
54
|
+
lineNumber: 32,
|
|
55
|
+
columnNumber: 5
|
|
56
|
+
}, this) : null,
|
|
57
|
+
error.cause ? /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: componentClassName("causedBy"), id: `error-${level}`, children: "Caused by" }, void 0, false, {
|
|
59
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
60
|
+
lineNumber: 38,
|
|
61
|
+
columnNumber: 6
|
|
62
|
+
}, this),
|
|
63
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV(DevErrorInner, { error: error.cause, level: level + 1 }, void 0, false, {
|
|
64
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
65
|
+
lineNumber: 41,
|
|
66
|
+
columnNumber: 6
|
|
67
|
+
}, this)
|
|
68
|
+
] }, void 0, true, {
|
|
69
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
70
|
+
lineNumber: 37,
|
|
71
|
+
columnNumber: 5
|
|
72
|
+
}, this) : null
|
|
73
|
+
] }, void 0, true, {
|
|
74
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
75
|
+
lineNumber: 16,
|
|
76
|
+
columnNumber: 3
|
|
77
|
+
}, this);
|
|
22
78
|
}
|
|
23
79
|
exports.DevErrorInner = DevErrorInner;
|
|
24
80
|
//# sourceMappingURL=DevErrorInner.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorInner.cjs","sources":["../../../../src/ui/DevError/DevErrorInner.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\nimport { StackTrace } from './StackTrace'\nimport type { ProcessedError } from './types'\n\nexport interface DevErrorInnerProps {\n\terror: ProcessedError\n\tlevel?: number\n}\n\nexport function DevErrorInner({ error, level = 1 }: DevErrorInnerProps) {\n\tconst componentClassName = useClassNameFactory('devError')\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={componentClassName('header')}>\n\t\t\t\t{errorObject ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<h1 className={componentClassName('errorName')}>{errorObject.name}</h1>\n\t\t\t\t\t\t{error.cause && <a href={`#error-${level}`} className={componentClassName('causeLink')}>caused by ></a>}\n\t\t\t\t\t\t{errorObject.message && <h2 className={componentClassName('errorMessage')}>{errorObject.message}</h2>}\n\t\t\t\t\t\t{'details' in errorObject && <h3 className={componentClassName('errorDetails')}>{(errorObject as any).details}</h3>}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<h1 className={componentClassName('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={componentClassName('stack')}>\n\t\t\t\t\t<div className={componentClassName('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={componentClassName('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":["useClassNameFactory","
|
|
1
|
+
{"version":3,"file":"DevErrorInner.cjs","sources":["../../../../src/ui/DevError/DevErrorInner.tsx"],"sourcesContent":["import { useClassNameFactory } from '@contember/react-utils'\nimport { StackTrace } from './StackTrace'\nimport type { ProcessedError } from './types'\n\nexport interface DevErrorInnerProps {\n\terror: ProcessedError\n\tlevel?: number\n}\n\nexport function DevErrorInner({ error, level = 1 }: DevErrorInnerProps) {\n\tconst componentClassName = useClassNameFactory('devError')\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={componentClassName('header')}>\n\t\t\t\t{errorObject ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<h1 className={componentClassName('errorName')}>{errorObject.name}</h1>\n\t\t\t\t\t\t{error.cause && <a href={`#error-${level}`} className={componentClassName('causeLink')}>caused by ></a>}\n\t\t\t\t\t\t{errorObject.message && <h2 className={componentClassName('errorMessage')}>{errorObject.message}</h2>}\n\t\t\t\t\t\t{'details' in errorObject && <h3 className={componentClassName('errorDetails')}>{(errorObject as any).details}</h3>}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<h1 className={componentClassName('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={componentClassName('stack')}>\n\t\t\t\t\t<div className={componentClassName('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={componentClassName('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":["useClassNameFactory","jsxDEV","Fragment","StackTrace"],"mappings":";;;;;AASO,SAAS,cAAc,EAAE,OAAO,QAAQ,KAAyB;AACjE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AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EA4BA,GAAA,IAAA;AAEF;;"}
|
|
@@ -1,22 +1,78 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useClassNameFactory } from "@contember/react-utils";
|
|
3
3
|
import { StackTrace } from "./StackTrace.js";
|
|
4
4
|
function DevErrorInner({ error, level = 1 }) {
|
|
5
5
|
const componentClassName = useClassNameFactory("devError");
|
|
6
6
|
let errorObject = error.error instanceof Error ? error.error : void 0;
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
return /* @__PURE__ */ jsxDEV(Fragment, { children: [
|
|
8
|
+
/* @__PURE__ */ jsxDEV("div", { className: componentClassName("header"), children: errorObject ? /* @__PURE__ */ jsxDEV(Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ jsxDEV("h1", { className: componentClassName("errorName"), children: errorObject.name }, void 0, false, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
11
|
+
lineNumber: 20,
|
|
12
|
+
columnNumber: 7
|
|
13
|
+
}, this),
|
|
14
|
+
error.cause && /* @__PURE__ */ jsxDEV("a", { href: `#error-${level}`, className: componentClassName("causeLink"), children: "caused by >" }, void 0, false, {
|
|
15
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
16
|
+
lineNumber: 21,
|
|
17
|
+
columnNumber: 23
|
|
18
|
+
}, this),
|
|
19
|
+
errorObject.message && /* @__PURE__ */ jsxDEV("h2", { className: componentClassName("errorMessage"), children: errorObject.message }, void 0, false, {
|
|
20
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
21
|
+
lineNumber: 22,
|
|
22
|
+
columnNumber: 31
|
|
23
|
+
}, this),
|
|
24
|
+
"details" in errorObject && /* @__PURE__ */ jsxDEV("h3", { className: componentClassName("errorDetails"), children: errorObject.details }, void 0, false, {
|
|
25
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
26
|
+
lineNumber: 23,
|
|
27
|
+
columnNumber: 36
|
|
28
|
+
}, this)
|
|
29
|
+
] }, void 0, true, {
|
|
30
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
31
|
+
lineNumber: 19,
|
|
32
|
+
columnNumber: 6
|
|
33
|
+
}, this) : /* @__PURE__ */ jsxDEV("h1", { className: componentClassName("errorName"), children: "Unknown error" }, void 0, false, {
|
|
34
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
35
|
+
lineNumber: 26,
|
|
36
|
+
columnNumber: 6
|
|
37
|
+
}, this) }, void 0, false, {
|
|
38
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
39
|
+
lineNumber: 17,
|
|
40
|
+
columnNumber: 4
|
|
41
|
+
}, this),
|
|
42
|
+
error.parsedStackStrace ? /* @__PURE__ */ jsxDEV(StackTrace, { stackTrace: error.parsedStackStrace }, void 0, false, {
|
|
43
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
44
|
+
lineNumber: 30,
|
|
45
|
+
columnNumber: 5
|
|
46
|
+
}, this) : errorObject?.stack ? /* @__PURE__ */ jsxDEV("div", { className: componentClassName("stack"), children: /* @__PURE__ */ jsxDEV("div", { className: componentClassName("stack-dump"), children: errorObject.stack }, void 0, false, {
|
|
47
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
48
|
+
lineNumber: 33,
|
|
49
|
+
columnNumber: 6
|
|
50
|
+
}, this) }, void 0, false, {
|
|
51
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
52
|
+
lineNumber: 32,
|
|
53
|
+
columnNumber: 5
|
|
54
|
+
}, this) : null,
|
|
55
|
+
error.cause ? /* @__PURE__ */ jsxDEV(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsxDEV("div", { className: componentClassName("causedBy"), id: `error-${level}`, children: "Caused by" }, void 0, false, {
|
|
57
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
58
|
+
lineNumber: 38,
|
|
59
|
+
columnNumber: 6
|
|
60
|
+
}, this),
|
|
61
|
+
/* @__PURE__ */ jsxDEV(DevErrorInner, { error: error.cause, level: level + 1 }, void 0, false, {
|
|
62
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
63
|
+
lineNumber: 41,
|
|
64
|
+
columnNumber: 6
|
|
65
|
+
}, this)
|
|
66
|
+
] }, void 0, true, {
|
|
67
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
68
|
+
lineNumber: 37,
|
|
69
|
+
columnNumber: 5
|
|
70
|
+
}, this) : null
|
|
71
|
+
] }, void 0, true, {
|
|
72
|
+
fileName: "/__w/interface/interface/packages/react-devbar/src/ui/DevError/DevErrorInner.tsx",
|
|
73
|
+
lineNumber: 16,
|
|
74
|
+
columnNumber: 3
|
|
75
|
+
}, this);
|
|
20
76
|
}
|
|
21
77
|
export {
|
|
22
78
|
DevErrorInner
|