@contember/react-devbar 1.3.0-rc.3 → 2.0.0-alpha.10
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 +3 -3
- package/dist/development/src/hooks/useParsedStacktrace.cjs.map +1 -0
- package/dist/development/src/hooks/useParsedStacktrace.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevBar/DevBar.cjs +31 -32
- package/dist/development/src/ui/DevBar/DevBar.cjs.map +1 -0
- package/dist/development/{ui → src/ui}/DevBar/DevBar.js +24 -25
- package/dist/development/src/ui/DevBar/DevBar.js.map +1 -0
- package/dist/development/src/ui/DevError/DevError.cjs +33 -0
- package/dist/development/src/ui/DevError/DevError.cjs.map +1 -0
- package/dist/development/src/ui/DevError/DevError.js +33 -0
- package/dist/development/src/ui/DevError/DevError.js.map +1 -0
- package/dist/development/{ui → src/ui}/DevError/DevErrorBadge.cjs +6 -7
- package/dist/development/src/ui/DevError/DevErrorBadge.cjs.map +1 -0
- package/dist/development/src/ui/DevError/DevErrorBadge.js +21 -0
- package/dist/development/src/ui/DevError/DevErrorBadge.js.map +1 -0
- package/dist/development/src/ui/DevError/DevErrorInner.cjs +79 -0
- package/dist/development/src/ui/DevError/DevErrorInner.cjs.map +1 -0
- package/dist/development/src/ui/DevError/DevErrorInner.js +79 -0
- package/dist/development/src/ui/DevError/DevErrorInner.js.map +1 -0
- package/dist/development/src/ui/DevError/DevErrorList.cjs +90 -0
- package/dist/development/src/ui/DevError/DevErrorList.cjs.map +1 -0
- package/dist/development/src/ui/DevError/DevErrorList.js +90 -0
- package/dist/development/src/ui/DevError/DevErrorList.js.map +1 -0
- package/dist/development/src/ui/DevError/StackTrace.cjs +82 -0
- package/dist/development/src/ui/DevError/StackTrace.cjs.map +1 -0
- package/dist/development/src/ui/DevError/StackTrace.js +82 -0
- 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 +3 -3
- package/dist/production/src/hooks/useParsedStacktrace.cjs.map +1 -0
- package/dist/production/src/hooks/useParsedStacktrace.js.map +1 -0
- package/dist/production/{ui → src/ui}/DevBar/DevBar.cjs +10 -11
- package/dist/production/src/ui/DevBar/DevBar.cjs.map +1 -0
- package/dist/production/{ui → src/ui}/DevBar/DevBar.js +3 -4
- package/dist/production/src/ui/DevBar/DevBar.js.map +1 -0
- package/dist/production/src/ui/DevError/DevError.cjs +13 -0
- package/dist/production/src/ui/DevError/DevError.cjs.map +1 -0
- package/dist/production/src/ui/DevError/DevError.js +13 -0
- package/dist/production/src/ui/DevError/DevError.js.map +1 -0
- package/dist/production/{ui → src/ui}/DevError/DevErrorBadge.cjs +2 -3
- package/dist/production/src/ui/DevError/DevErrorBadge.cjs.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorBadge.js +13 -0
- package/dist/production/src/ui/DevError/DevErrorBadge.js.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorInner.cjs +23 -0
- package/dist/production/src/ui/DevError/DevErrorInner.cjs.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorInner.js +23 -0
- package/dist/production/src/ui/DevError/DevErrorInner.js.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorList.cjs +38 -0
- package/dist/production/src/ui/DevError/DevErrorList.cjs.map +1 -0
- package/dist/production/src/ui/DevError/DevErrorList.js +38 -0
- package/dist/production/src/ui/DevError/DevErrorList.js.map +1 -0
- package/dist/production/src/ui/DevError/StackTrace.cjs +39 -0
- package/dist/production/src/ui/DevError/StackTrace.cjs.map +1 -0
- package/dist/production/src/ui/DevError/StackTrace.js +39 -0
- package/dist/production/src/ui/DevError/StackTrace.js.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- 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/DevErrorBadge.d.ts.map +1 -1
- package/dist/types/ui/DevError/DevErrorInner.d.ts.map +1 -1
- package/dist/types/ui/DevError/DevErrorList.d.ts.map +1 -1
- package/dist/types/ui/DevError/StackTrace.d.ts.map +1 -1
- package/package.json +7 -18
- package/src/DevErrorManager.tsx +4 -4
- package/src/index.css +385 -2
- package/src/tsconfig.json +5 -2
- package/src/ui/DevBar/DevBar.tsx +9 -10
- package/src/ui/DevError/DevError.tsx +6 -6
- package/src/ui/DevError/DevErrorBadge.tsx +5 -6
- package/src/ui/DevError/DevErrorInner.tsx +12 -11
- package/src/ui/DevError/DevErrorList.tsx +13 -15
- package/src/ui/DevError/StackTrace.tsx +11 -13
- 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.map +0 -1
- package/dist/development/ui/DevBar/DevBar.js.map +0 -1
- package/dist/development/ui/DevError/DevError.cjs +0 -34
- package/dist/development/ui/DevError/DevError.cjs.map +0 -1
- package/dist/development/ui/DevError/DevError.js +0 -34
- 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 +0 -22
- package/dist/development/ui/DevError/DevErrorBadge.js.map +0 -1
- package/dist/development/ui/DevError/DevErrorInner.cjs +0 -80
- package/dist/development/ui/DevError/DevErrorInner.cjs.map +0 -1
- package/dist/development/ui/DevError/DevErrorInner.js +0 -80
- package/dist/development/ui/DevError/DevErrorInner.js.map +0 -1
- package/dist/development/ui/DevError/DevErrorList.cjs +0 -91
- package/dist/development/ui/DevError/DevErrorList.cjs.map +0 -1
- package/dist/development/ui/DevError/DevErrorList.js +0 -91
- package/dist/development/ui/DevError/DevErrorList.js.map +0 -1
- package/dist/development/ui/DevError/StackTrace.cjs +0 -84
- package/dist/development/ui/DevError/StackTrace.cjs.map +0 -1
- package/dist/development/ui/DevError/StackTrace.js +0 -84
- 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.map +0 -1
- package/dist/production/ui/DevBar/DevBar.js.map +0 -1
- package/dist/production/ui/DevError/DevError.cjs +0 -14
- package/dist/production/ui/DevError/DevError.cjs.map +0 -1
- package/dist/production/ui/DevError/DevError.js +0 -14
- 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 +0 -14
- package/dist/production/ui/DevError/DevErrorBadge.js.map +0 -1
- package/dist/production/ui/DevError/DevErrorInner.cjs +0 -24
- package/dist/production/ui/DevError/DevErrorInner.cjs.map +0 -1
- package/dist/production/ui/DevError/DevErrorInner.js +0 -24
- package/dist/production/ui/DevError/DevErrorInner.js.map +0 -1
- package/dist/production/ui/DevError/DevErrorList.cjs +0 -39
- package/dist/production/ui/DevError/DevErrorList.cjs.map +0 -1
- package/dist/production/ui/DevError/DevErrorList.js +0 -39
- package/dist/production/ui/DevError/DevErrorList.js.map +0 -1
- package/dist/production/ui/DevError/StackTrace.cjs +0 -41
- package/dist/production/ui/DevError/StackTrace.cjs.map +0 -1
- package/dist/production/ui/DevError/StackTrace.js +0 -41
- 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/development/{hooks → src/hooks}/useParsedStacktrace.js +0 -0
- /package/dist/production/{hooks → src/hooks}/useParsedStacktrace.js +0 -0
package/dist/assets/index.css
DELETED
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
.cui-devBar {
|
|
2
|
-
align-items: center;
|
|
3
|
-
bottom: 0;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
position: fixed;
|
|
7
|
-
z-index: 1000;
|
|
8
|
-
left: 0;
|
|
9
|
-
right: 0;
|
|
10
|
-
opacity: 1;
|
|
11
|
-
padding: 1rem;
|
|
12
|
-
transition-property: opacity, transform;
|
|
13
|
-
transition-duration: 200ms;
|
|
14
|
-
transition-timing-function: ease-in-out;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cui-devBar-content,
|
|
18
|
-
.cui-devBar-panel-content {
|
|
19
|
-
background: #eee;
|
|
20
|
-
color: #002251;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.cui-devBar-content {
|
|
24
|
-
align-self: center;
|
|
25
|
-
align-items: center;
|
|
26
|
-
border-radius: 1rem;
|
|
27
|
-
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
28
|
-
display: flex;
|
|
29
|
-
gap: 1rem;
|
|
30
|
-
padding: 0.5rem;
|
|
31
|
-
margin: 0 auto;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.cui-devBar-close,
|
|
35
|
-
.cui-devBar-trigger-label,
|
|
36
|
-
.cui-devBar-brand {
|
|
37
|
-
align-items: center;
|
|
38
|
-
height: 2rem;
|
|
39
|
-
border-radius: 0.5rem;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
max-height: 2rem;
|
|
42
|
-
min-height: 2rem;
|
|
43
|
-
white-space: nowrap;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.cui-devBar-close {
|
|
47
|
-
background: transparent;
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
display: flex;
|
|
50
|
-
max-width: 2rem;
|
|
51
|
-
width: 2rem;
|
|
52
|
-
order: 999;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.cui-devBar-brand {
|
|
56
|
-
align-items: center;
|
|
57
|
-
display: flex;
|
|
58
|
-
gap: 1rem;
|
|
59
|
-
text-align: right;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.cui-devBar-brand svg {
|
|
63
|
-
max-height: 2rem;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.cui-devBar-panels {
|
|
67
|
-
display: flex;
|
|
68
|
-
gap: 1rem;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.cui-devBar-trigger {
|
|
72
|
-
display: flex;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.cui-devBar-trigger-label {
|
|
76
|
-
align-items: center;
|
|
77
|
-
color: inherit;
|
|
78
|
-
cursor: pointer;
|
|
79
|
-
display: inline-flex;
|
|
80
|
-
font-weight: normal;
|
|
81
|
-
gap: 0.3rem;
|
|
82
|
-
padding: 0 0.2rem;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.cui-devBar-trigger-label:hover {
|
|
86
|
-
background-color: #e0e0e0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.cui-devBar-panel {
|
|
90
|
-
justify-content: center;
|
|
91
|
-
display: flex;
|
|
92
|
-
flex-direction: row;
|
|
93
|
-
gap: 1rem;
|
|
94
|
-
left: 0;
|
|
95
|
-
position: absolute;
|
|
96
|
-
right: 0;
|
|
97
|
-
bottom: 0;
|
|
98
|
-
padding: 2rem;
|
|
99
|
-
transform: translateY(-1rem);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.cui-devBar-trigger:not([data-expanded]) > .cui-devBar-panel {
|
|
103
|
-
display: none;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.cui-devBar-panel-content {
|
|
107
|
-
background: #fff;
|
|
108
|
-
border: 1px solid #ccc;
|
|
109
|
-
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
110
|
-
border-radius: 0.5rem;
|
|
111
|
-
display: flex;
|
|
112
|
-
min-width: min(20rem, 100%);
|
|
113
|
-
max-width: 100%;
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
flex-shrink: 1;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.cui-devBar-panel-content h2 {
|
|
119
|
-
font-weight: bold;
|
|
120
|
-
margin-bottom: 0;
|
|
121
|
-
padding: 0.4rem 1rem;
|
|
122
|
-
border-radius: 0.5rem 0.5rem 0 0;
|
|
123
|
-
background: #f8f8f8;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@media screen and (min-width: 768px) {
|
|
127
|
-
.cui-devBar-trigger {
|
|
128
|
-
position: relative;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.cui-devBar-panel-content {
|
|
132
|
-
min-width: unset;
|
|
133
|
-
max-width: unset;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.cui-devBar-panel-body {
|
|
137
|
-
min-width: 20rem;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.cui-devBar-panel-body {
|
|
142
|
-
border-top: 1px solid #ccc;
|
|
143
|
-
display: flex;
|
|
144
|
-
flex-direction: column;
|
|
145
|
-
gap: 1rem;
|
|
146
|
-
padding: 1rem;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.cui-devBar:not([data-expanded]) {
|
|
150
|
-
transform: translateY(2rem);
|
|
151
|
-
opacity: 0;
|
|
152
|
-
max-width: 5rem;
|
|
153
|
-
margin: auto;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.cui-devBar:not([data-expanded]):hover,
|
|
157
|
-
.cui-devBar:not([data-expanded]):focus-within {
|
|
158
|
-
transform: unset;
|
|
159
|
-
opacity: unset;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
[id^="dev-bar-panel"]:not([data-expanded]) > * {
|
|
163
|
-
display: none;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.cui-devBar-panel .cui-table-wrapper {
|
|
167
|
-
overflow: auto;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.cui-devError {
|
|
171
|
-
position: absolute;
|
|
172
|
-
top: 0;
|
|
173
|
-
right: 0;
|
|
174
|
-
bottom: 0;
|
|
175
|
-
left: 0;
|
|
176
|
-
width: 100vw;
|
|
177
|
-
height: 100vh;
|
|
178
|
-
z-index: 99;
|
|
179
|
-
display: flex;
|
|
180
|
-
justify-content: center;
|
|
181
|
-
align-items: flex-start;
|
|
182
|
-
background: rgba(212, 212, 212, 0.66);
|
|
183
|
-
font-family: Poppins, Roboto, sans-serif;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.cui-devError-in {
|
|
187
|
-
z-index: 100;
|
|
188
|
-
width: 100%;
|
|
189
|
-
height: 100%;
|
|
190
|
-
color: #333;
|
|
191
|
-
background: #222;
|
|
192
|
-
box-shadow: 3px 3px 10px rgba(50, 50, 50, 0.5);
|
|
193
|
-
display: flex;
|
|
194
|
-
flex-direction: column;
|
|
195
|
-
overflow: auto;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.cui-devError-header {
|
|
199
|
-
background: #CD1818;
|
|
200
|
-
color: #FFF;
|
|
201
|
-
padding: 0.5em 1em;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.cui-devError-errorMessage,
|
|
205
|
-
.cui-devError-errorName,
|
|
206
|
-
.cui-devError-errorDetails {
|
|
207
|
-
margin: 0;
|
|
208
|
-
flex: 0 0 auto;
|
|
209
|
-
font-weight: 300;
|
|
210
|
-
white-space: pre-wrap;
|
|
211
|
-
overflow-wrap: break-word;
|
|
212
|
-
line-height: 130%;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.cui-devError-errorMessage {
|
|
216
|
-
font-family: monospace;
|
|
217
|
-
margin-top: 0.5em;
|
|
218
|
-
font-size: 1.7em;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.cui-devError-errorDetails {
|
|
222
|
-
font-family: monospace;
|
|
223
|
-
margin-top: 0.5em;
|
|
224
|
-
font-size: 1em;
|
|
225
|
-
white-space: pre;
|
|
226
|
-
overflow-x: scroll;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.cui-devError-causeLink {
|
|
230
|
-
color: #FFCC00;
|
|
231
|
-
text-decoration: underline;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.cui-devError-stack {
|
|
235
|
-
flex: 1 1 auto;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.cui-devError-stack-dump {
|
|
239
|
-
color: #fff;
|
|
240
|
-
margin-top: 1em;
|
|
241
|
-
padding: 1em;
|
|
242
|
-
white-space: pre-wrap;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.cui-devError-bar {
|
|
246
|
-
padding: 0.2em 0.2em 0.2em 1em;
|
|
247
|
-
background: #ac1616;
|
|
248
|
-
color: #eee;
|
|
249
|
-
display: flex;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.cui-devError-causedBy {
|
|
253
|
-
padding: 0.2em 0.2em 0.2em 1em;
|
|
254
|
-
background: #FFCC00;
|
|
255
|
-
color: #000;
|
|
256
|
-
display: flex;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.cui-devError-actions {
|
|
260
|
-
margin-left: auto;
|
|
261
|
-
display: flex;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.cui-devError-actions .cui-button {
|
|
265
|
-
color: #fff;
|
|
266
|
-
border-color: #cbcbcb;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.cui-devError-actions .cui-button:hover {
|
|
270
|
-
color: #fff;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.cui-devError-close {
|
|
274
|
-
margin-left: 1em;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.cui-devError-close .cui-button {
|
|
278
|
-
border-color: transparent;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.cui-devError-switcher {
|
|
282
|
-
display: flex;
|
|
283
|
-
align-items: center;
|
|
284
|
-
margin-left: 2em;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.cui-devError-switcherButtons {
|
|
288
|
-
display: flex;
|
|
289
|
-
align-items: center;
|
|
290
|
-
gap: 0.5em;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.cui-devError-closeButton,
|
|
294
|
-
.cui-devError-switcherButton {
|
|
295
|
-
border: 1px solid #cbcbcb;
|
|
296
|
-
border-radius: 0.2em;
|
|
297
|
-
padding: 0.2em 0.5em;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.cui-devError-errorCount {
|
|
301
|
-
margin: 0;
|
|
302
|
-
margin-right: 0.5em;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.cui-devError-stackFrame {
|
|
306
|
-
font-family: monospace;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.cui-devError-stackFrame:last-child {
|
|
310
|
-
border-bottom: 1px solid #666;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.cui-devError-stackFrameHeader {
|
|
314
|
-
display: flex;
|
|
315
|
-
padding: 0.5em 1em;
|
|
316
|
-
background: #333;
|
|
317
|
-
color: #fff;
|
|
318
|
-
border-bottom: 1px solid #666;
|
|
319
|
-
border-top: 1px solid #666;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.cui-devError-stackFrameSource {
|
|
323
|
-
margin-left: 0.2em;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.cui-devError-stackFrameCallee {
|
|
327
|
-
margin-left: 1em;
|
|
328
|
-
color: #a4ffa4;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.cui-devError-stackFrameCode {
|
|
332
|
-
background: #222;
|
|
333
|
-
color: #D5D5D5;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.cui-devError-stackFrameLine {
|
|
337
|
-
display: flex;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.cui-devError-stackFrameLine.is-active {
|
|
341
|
-
color: #fff;
|
|
342
|
-
background: #CD1818;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.cui-devError-stackFrameLine.is-active .cui-devError-stackFrameLineNumber {
|
|
346
|
-
color: #fff;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.cui-devError-stackFrameLineNumber {
|
|
350
|
-
color: #888;
|
|
351
|
-
flex: 0 0 50px;
|
|
352
|
-
text-align: right;
|
|
353
|
-
padding: 0.2em;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.cui-devError-stackFrameLineCode {
|
|
357
|
-
padding: 0.2em 1em;
|
|
358
|
-
white-space: pre-wrap;
|
|
359
|
-
tab-size: 4;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
:where(.cui-devErrorBadge) {
|
|
363
|
-
position: fixed;
|
|
364
|
-
bottom: 20px;
|
|
365
|
-
left: 20px;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
:where(.cui-devErrorBadge-button) {
|
|
369
|
-
display: block;
|
|
370
|
-
background: #CD1818;
|
|
371
|
-
color: #fff;
|
|
372
|
-
font-weight: 600;
|
|
373
|
-
box-shadow: 3px 3px 7px rgba(50, 50, 50, 0.5);
|
|
374
|
-
border-radius: 10px;
|
|
375
|
-
padding: 1em 2em;
|
|
376
|
-
cursor: pointer;
|
|
377
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorManager.cjs","sources":["../../src/DevErrorManager.tsx"],"sourcesContent":["import { DevErrorBadge, DevErrorList, ErrorType } from './ui/DevError'\nimport { useEffect, useState } from 'react'\nimport { useProcessedError } from './hooks/useParsedStacktrace'\n\nexport class ErrorBus {\n\tprivate queue: { error: ErrorType, source: string }[] = []\n\tprivate listener: null | ((error: { error: ErrorType, source: string }) => void) = null\n\n\tasync handleError(source: string, error: ErrorType) {\n\t\tconst boxedError = { error, source }\n\n\t\tif (!this.listener) {\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\n\t\t} else {\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t}\n\t}\n\n\tregister(listener: (error: { error: ErrorType, source: string }) => void): () => void {\n\t\tthis.listener = listener\n\t\tthis.queue.forEach(listener)\n\t\tthis.queue = []\n\t\treturn () => {\n\t\t\tthis.listener = null\n\t\t}\n\t}\n}\n\nexport interface DevErrorManagerProps {\n\tbus: ErrorBus\n}\n\nexport function DevErrorManager(props: DevErrorManagerProps) {\n\tconst [errors, setErrors] = useState<{ error: ErrorType, source: string }[]>([])\n\tconst [errIndex, setErrorIndex] = useState(0)\n\tconst [open, setOpen] = useState(false)\n\n\tuseEffect(\n\t\t() => {\n\t\t\treturn props.bus.register(err => {\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tsetErrors(errors => [err, ...errors])\n\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t},\n\t\t\t\t\t0,\n\t\t\t\t)\n\t\t\t})\n\t\t},\n\t\t[props.bus],\n\t)\n\n\tconst currentError = errors[errIndex]\n\tconst processedError = useProcessedError(currentError?.error)\n\tif (!currentError) {\n\t\treturn null\n\t}\n\tconst onPrevious = () => setErrorIndex(it => Math.max(0, it - 1))\n\tconst onNext = () => setErrorIndex(it => Math.min(errors.length - 1, it + 1))\n\tconst onClose = () => setOpen(false)\n\tif (!open) {\n\t\treturn <DevErrorBadge errorCount={errors.length} onOpen={() => setOpen(true)} />\n\t}\n\treturn (\n\t\t<DevErrorList\n\t\t\tcurrentError={processedError}\n\t\t\tcurrentErrorSource={currentError.source}\n\t\t\tcurrentErrorIndex={errIndex}\n\t\t\terrorCount={errors.length}\n\t\t\tonPrevious={onPrevious}\n\t\t\tonNext={onNext}\n\t\t\tonClose={onClose}\n\t\t/>\n\t)\n}\n"],"names":["useState","useEffect","errors","useProcessedError","jsxDEV","DevErrorBadge","DevErrorList"],"mappings":";;;;;;;;;;;;;AAIO,MAAM,SAAS;AAAA,EAAf;AACE,iCAAgD,CAAA;AAChD,oCAA2E;AAAA;AAAA,EAEnF,MAAM,YAAY,QAAgB,OAAkB;AAC7C,UAAA,aAAa,EAAE,OAAO;AAExB,QAAA,CAAC,KAAK,UAAU;AACd,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AAAA,IAAA,OAEpB;AACN,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,SAAS,UAA6E;AACrF,SAAK,WAAW;AACX,SAAA,MAAM,QAAQ,QAA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B,YAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAPD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAA;AAAA,EAAA;AAUF;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevErrorManager.js","sources":["../../src/DevErrorManager.tsx"],"sourcesContent":["import { DevErrorBadge, DevErrorList, ErrorType } from './ui/DevError'\nimport { useEffect, useState } from 'react'\nimport { useProcessedError } from './hooks/useParsedStacktrace'\n\nexport class ErrorBus {\n\tprivate queue: { error: ErrorType, source: string }[] = []\n\tprivate listener: null | ((error: { error: ErrorType, source: string }) => void) = null\n\n\tasync handleError(source: string, error: ErrorType) {\n\t\tconst boxedError = { error, source }\n\n\t\tif (!this.listener) {\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\n\t\t} else {\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t}\n\t}\n\n\tregister(listener: (error: { error: ErrorType, source: string }) => void): () => void {\n\t\tthis.listener = listener\n\t\tthis.queue.forEach(listener)\n\t\tthis.queue = []\n\t\treturn () => {\n\t\t\tthis.listener = null\n\t\t}\n\t}\n}\n\nexport interface DevErrorManagerProps {\n\tbus: ErrorBus\n}\n\nexport function DevErrorManager(props: DevErrorManagerProps) {\n\tconst [errors, setErrors] = useState<{ error: ErrorType, source: string }[]>([])\n\tconst [errIndex, setErrorIndex] = useState(0)\n\tconst [open, setOpen] = useState(false)\n\n\tuseEffect(\n\t\t() => {\n\t\t\treturn props.bus.register(err => {\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tsetErrors(errors => [err, ...errors])\n\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t},\n\t\t\t\t\t0,\n\t\t\t\t)\n\t\t\t})\n\t\t},\n\t\t[props.bus],\n\t)\n\n\tconst currentError = errors[errIndex]\n\tconst processedError = useProcessedError(currentError?.error)\n\tif (!currentError) {\n\t\treturn null\n\t}\n\tconst onPrevious = () => setErrorIndex(it => Math.max(0, it - 1))\n\tconst onNext = () => setErrorIndex(it => Math.min(errors.length - 1, it + 1))\n\tconst onClose = () => setOpen(false)\n\tif (!open) {\n\t\treturn <DevErrorBadge errorCount={errors.length} onOpen={() => setOpen(true)} />\n\t}\n\treturn (\n\t\t<DevErrorList\n\t\t\tcurrentError={processedError}\n\t\t\tcurrentErrorSource={currentError.source}\n\t\t\tcurrentErrorIndex={errIndex}\n\t\t\terrorCount={errors.length}\n\t\t\tonPrevious={onPrevious}\n\t\t\tonNext={onNext}\n\t\t\tonClose={onClose}\n\t\t/>\n\t)\n}\n"],"names":["errors"],"mappings":";;;;;;;;;;;AAIO,MAAM,SAAS;AAAA,EAAf;AACE,iCAAgD,CAAA;AAChD,oCAA2E;AAAA;AAAA,EAEnF,MAAM,YAAY,QAAgB,OAAkB;AAC7C,UAAA,aAAa,EAAE,OAAO;AAExB,QAAA,CAAC,KAAK,UAAU;AACd,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AAAA,IAAA,OAEpB;AACN,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,SAAS,UAA6E;AACrF,SAAK,WAAW;AACX,SAAA,MAAM,QAAQ,QAAQ;AAC3B,SAAK,QAAQ;AACb,WAAO,MAAM;AACZ,WAAK,WAAW;AAAA,IAAA;AAAA,EAElB;AACD;AAMO,SAAS,gBAAgB,OAA6B;AAC5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IAAA;AAAA,EAAA;AAUF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.cjs","sources":["../../src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":["ReactDOM","ErrorBus","Buffer","jsxDEV","DevErrorManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnBA,wBAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EACzC;AAEO,SAAA;AACR;AAEA,MAAM,kBAAkB,CAAC,aAAyC;AAC3D,QAAA,WAAW,IAAIC,gBAAAA;AAEnB,SAAe,SAASC;AACnB,SAAA,iBAAiB,SAAS,CAAK,MAAA;AACrC,QAAI,EAAE,QAAQ,WAAW,gBAAgB,GAAG;AAE3C;AAAA,IACD;AACS,aAAA,YAAY,mBAAmB,EAAE,KAAK;AAAA,EAAA,CAC/C;AAEM,SAAA,iBAAiB,sBAAsB,CAAK,MAAA,SAAS,YAAY,+BAA+B,EAAE,MAAM,CAAC;AAEhH,QAAM,cAAc,QAAQ;AACpB,UAAA,QAAQ,IAAI,SAAS;AAC5B,gBAAY,GAAG,IAAI;AACnB,eAAW,OAAO,MAAM;AACvB,UAAI,eAAe,OAAO;AAChB,iBAAA,YAAY,gBAAgB,GAAG;AAAA,MACzC;AAAA,IACD;AAAA,EAAA;AAEQ,WAAA,qBAAsBC,8BAAAA,OAAAC,gBAAA,iBAAA,EAAgB,KAAK,SAAtB,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAgC,GAAI,MAAM;AAAA,EAAA,CAAE;AAE1E,SAAO,OAAM,OAAM;AACd,QAAA;AACH,YAAM,GAAG,CAAK,MAAA,SAAS,YAAY,2BAA2B,CAAC,CAAC;AAAA,aACxD,GAAG;AACF,eAAA,YAAY,oBAAoB,CAAC;AAAA,IAC3C;AAAA,EAAA;AAEF;AAwBa,MAAA,qBAAqB,CAAC,aAAiC;AAC1C;AACxB,WAAO,gBAAgB,QAAQ;AAAA,EAGhC;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.js","sources":["../../src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnB,aAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EACzC;AAEO,SAAA;AACR;AAEA,MAAM,kBAAkB,CAAC,aAAyC;AAC3D,QAAA,WAAW,IAAI;AAEnB,SAAe,SAAS;AACnB,SAAA,iBAAiB,SAAS,CAAK,MAAA;AACrC,QAAI,EAAE,QAAQ,WAAW,gBAAgB,GAAG;AAE3C;AAAA,IACD;AACS,aAAA,YAAY,mBAAmB,EAAE,KAAK;AAAA,EAAA,CAC/C;AAEM,SAAA,iBAAiB,sBAAsB,CAAK,MAAA,SAAS,YAAY,+BAA+B,EAAE,MAAM,CAAC;AAEhH,QAAM,cAAc,QAAQ;AACpB,UAAA,QAAQ,IAAI,SAAS;AAC5B,gBAAY,GAAG,IAAI;AACnB,eAAW,OAAO,MAAM;AACvB,UAAI,eAAe,OAAO;AAChB,iBAAA,YAAY,gBAAgB,GAAG;AAAA,MACzC;AAAA,IACD;AAAA,EAAA;AAEQ,WAAA,qBAAsB,uBAAA,iBAAA,EAAgB,KAAK,SAAtB,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAgC,GAAI,MAAM;AAAA,EAAA,CAAE;AAE1E,SAAO,OAAM,OAAM;AACd,QAAA;AACH,YAAM,GAAG,CAAK,MAAA,SAAS,YAAY,2BAA2B,CAAC,CAAC;AAAA,aACxD,GAAG;AACF,eAAA,YAAY,oBAAoB,CAAC;AAAA,IAC3C;AAAA,EAAA;AAEF;AAwBa,MAAA,qBAAqB,CAAC,aAAiC;AAC1C;AACxB,WAAO,gBAAgB,QAAQ;AAAA,EAGhC;AACD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useParsedStacktrace.cjs","sources":["../../../src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tconst StackTracey = (await import('stacktracey')).default\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["useState","useEffect","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGa,MAAA,kBAAkB,OAAO,MAAa;AAClD,QAAM,eAAe,MAAM,OAAO,aAAa,GAAG;AAC1C,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAC/B,EAAA;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAIA,eAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9EC,QAAAA,UAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IACD;AACM,UAAA,4BAA4B,OAAOC,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,GAAU,KAAK,IAAI;AAAA,MAAA;AAAA,IACnI;AAED,KAAC,YAAY;AACH,eAAA,MAAM,0BAA0B,CAAC,CAAC;AAAA,IAAA;EACzC,GACD,CAAC,CAAC,CAAC;AAEC,SAAA;AACR;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useParsedStacktrace.js","sources":["../../../src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tconst StackTracey = (await import('stacktracey')).default\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["e"],"mappings":";AAGa,MAAA,kBAAkB,OAAO,MAAa;AAClD,QAAM,eAAe,MAAM,OAAO,aAAa,GAAG;AAC1C,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAC/B,EAAA;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAI,SAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9E,YAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IACD;AACM,UAAA,4BAA4B,OAAOA,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,GAAU,KAAK,IAAI;AAAA,MAAA;AAAA,IACnI;AAED,KAAC,YAAY;AACH,eAAA,MAAM,0BAA0B,CAAC,CAAC;AAAA,IAAA;EACzC,GACD,CAAC,CAAC,CAAC;AAEC,SAAA;AACR;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevBar.cjs","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":["useClassNameFactory","useState","useWindowSize","useRef","useReferentiallyStableCallback","expanded","useEffect","useOnElementClickOutsideCallback","useId","jsxDEV","dataAttribute","this","useOnElementMouseEnterDelayedCallback"],"mappings":";;;;;;AAWO,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AAAA,EACA;AACD,MAGO;AACA,QAAA,YAAYA,+BAAoB,QAAQ;AAC9C,QAAM,CAAC,UAAU,WAAW,IAAIC,eAAS,IAAI;AACvC,QAAA,gBAAgBC,WAAAA,gBAAgB,QAAQ;AACxC,QAAA,kBAAkBC,aAA0B,IAAI;AAEhD,QAAA,eAAeC,WAAAA,+BAA+B,MAAM;AAC7C,gBAAA,CAAAC,cAAY,CAACA,SAAQ;AAAA,EAAA,CACjC;AAEDC,QAAAA,UAAU,MAAM;AACf,aAAS,cAAc,OAAsB;AAC5C,UAAI,MAAM,SAAS,WAAW,MAAM,WAAW,MAAM,UAAU;A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.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;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,CAAC;AAErB,QAAA,mBAAmB,OAAuB,IAAI;AAEpD,mCAAiC,kBAAkB,MAAM;AACxD,QAAI,UAAU;AACb,kBA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A,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAEA,GAAAA,MAAA;AAAA,iCACC,OAAI,EAAA,WAAW,UAAU,YAAY,GACpC,SADF,GAAA,QAAA,OAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAEA,GAAAA,MAAA;AAAA,QAAA,KAND,QAAA,MAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAAAA,MAOA,EARD,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QASA,GAAAA,MAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IA3CF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA+CF;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
-
const reactUtils = require("@contember/react-utils");
|
|
5
|
-
const DevErrorInner = require("./DevErrorInner.cjs");
|
|
6
|
-
function DevError(props) {
|
|
7
|
-
const componentClassName = reactUtils.useClassNameFactory("devError");
|
|
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);
|
|
32
|
-
}
|
|
33
|
-
exports.DevError = DevError;
|
|
34
|
-
//# sourceMappingURL=DevError.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,34 +0,0 @@
|
|
|
1
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
-
import { useClassNameFactory } from "@contember/react-utils";
|
|
3
|
-
import { DevErrorInner } from "./DevErrorInner.js";
|
|
4
|
-
function DevError(props) {
|
|
5
|
-
const componentClassName = useClassNameFactory("devError");
|
|
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);
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
DevError
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=DevError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,22 +0,0 @@
|
|
|
1
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
-
import { useClassNameFactory } from "@contember/react-utils";
|
|
3
|
-
function DevErrorBadge({ errorCount, onOpen }) {
|
|
4
|
-
const componentClassName = useClassNameFactory("devErrorBadge");
|
|
5
|
-
return /* @__PURE__ */ jsxDEV("div", { className: componentClassName(), children: /* @__PURE__ */ jsxDEV("a", { className: componentClassName("button"), onClick: onOpen, children: [
|
|
6
|
-
errorCount,
|
|
7
|
-
" ",
|
|
8
|
-
errorCount > 1 ? "errors" : "error"
|
|
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);
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
DevErrorBadge
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=DevErrorBadge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;"}
|