@adea-ai/ui 0.142.1 → 0.142.3
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/components/composites/chat/chat.d.ts +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.d.ts.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.js +71 -9
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/conversation/ime-guard.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/avatar/avatar.d.ts +5 -5
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +2 -2
- package/dist/components/ui/board/board.d.ts +1 -1
- package/dist/components/ui/bubble/bubble.d.ts +2 -2
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/callout/callout.d.ts +2 -2
- package/dist/components/ui/card/card.d.ts +1 -1
- package/dist/components/ui/chart/chart-options.d.ts +1 -1
- package/dist/components/ui/chart/chart-options.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts +4 -4
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/diff-block/diff-block.d.ts +1 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts +3 -3
- package/dist/components/ui/item/item.d.ts +2 -2
- package/dist/components/ui/kbd/kbd.d.ts +2 -2
- package/dist/components/ui/marker/marker.d.ts +1 -1
- package/dist/components/ui/sheet/sheet.d.ts +2 -2
- package/dist/components/ui/spinner/spinner.d.ts +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +3 -3
- package/dist/components/ui/toast/toast.d.ts +4 -4
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts +17 -17
- package/dist/components/ui/typography/typography.d.ts.map +1 -1
- package/dist/lib/accent-roles.d.ts +1 -1
- package/dist/lib/accent-roles.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.d.ts +1 -1
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/cn-tables.generated.d.ts.map +1 -1
- package/dist/lib/font-catalog.d.ts +44 -44
- package/dist/lib/font-catalog.d.ts.map +1 -1
- package/dist/lib/form-field.d.ts +1 -1
- package/dist/lib/overlay.d.ts +2 -2
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/theme-engine.d.ts.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/variants.d.ts +15 -15
- package/dist/lib/variants.d.ts.map +1 -1
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +78 -8
- package/package.json +1 -1
- package/src/components/composites/stack-trace/parse-stack-trace.ts +78 -8
|
@@ -100,6 +100,31 @@ export function splitLocation(location: string): { file: string; line?: number;
|
|
|
100
100
|
return { file: last.rest, line: last.value }
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Split the pre-1.78 Rust panic suffix `'message', location`. The message may
|
|
105
|
+
* contain `', ` itself, and the greedy pattern this replaces took the last
|
|
106
|
+
* occurrence with a non-space behind it — this scan keeps that last-wins
|
|
107
|
+
* answer, in one pass, so a message repeating the marker stays linear.
|
|
108
|
+
*/
|
|
109
|
+
function splitRustOldPanic(after: string): { message: string; location: string } | undefined {
|
|
110
|
+
// As in `parsePython`: no `.` in the old pattern could cross a line break.
|
|
111
|
+
if (/[\n\r\u2028\u2029]/.test(after) || !after.startsWith("'")) return undefined
|
|
112
|
+
let close: number | undefined
|
|
113
|
+
let search = 1
|
|
114
|
+
for (;;) {
|
|
115
|
+
const at = after.indexOf("', ", search)
|
|
116
|
+
if (at < 0) break
|
|
117
|
+
search = at + 1
|
|
118
|
+
const start = at + 3
|
|
119
|
+
if (start >= after.length) continue
|
|
120
|
+
// Preserve ECMAScript \S, including NBSP/BOM and Unicode space separators.
|
|
121
|
+
if (/\s/.test(after[start]!)) continue
|
|
122
|
+
close = at
|
|
123
|
+
}
|
|
124
|
+
if (close === undefined) return undefined
|
|
125
|
+
return { message: after.slice(1, close), location: after.slice(close + 3) }
|
|
126
|
+
}
|
|
127
|
+
|
|
103
128
|
const FILE_LIKE = /[\\/]|\.[A-Za-z0-9]{1,6}$/
|
|
104
129
|
const URL_LIKE = /^node:/i
|
|
105
130
|
|
|
@@ -154,13 +179,58 @@ function parseV8(trimmed: string): Draft | undefined {
|
|
|
154
179
|
return draft
|
|
155
180
|
}
|
|
156
181
|
|
|
157
|
-
const
|
|
182
|
+
const PYTHON_PREFIX = 'File "'
|
|
183
|
+
const PYTHON_LINE = '", line '
|
|
184
|
+
const PYTHON_IN = ', in '
|
|
185
|
+
|
|
186
|
+
/** Whether a character is an ASCII digit, as `\d` was in the pattern this replaced. */
|
|
187
|
+
function isDigit(code: number): boolean {
|
|
188
|
+
return code >= 48 && code <= 57
|
|
189
|
+
}
|
|
158
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Read a Python frame: `File "<file>", line <n>[, in <fn>]`.
|
|
193
|
+
*
|
|
194
|
+
* Scanned, not matched. A line repeating the frame shape many times must still
|
|
195
|
+
* cost one pass, so the closing `", line ` is found by walking its candidates
|
|
196
|
+
* left to right. The last valid candidate wins — what the greedy pattern this
|
|
197
|
+
* replaces would have settled on — so a file path containing a quote still
|
|
198
|
+
* parses exactly as it always did.
|
|
199
|
+
*/
|
|
159
200
|
function parsePython(trimmed: string): Draft | undefined {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
201
|
+
// `.` never matches a line break, so the whole-line pattern this replaces
|
|
202
|
+
// could not have matched a string containing one either.
|
|
203
|
+
if (/[\n\r\u2028\u2029]/.test(trimmed) || !trimmed.startsWith(PYTHON_PREFIX)) return undefined
|
|
204
|
+
let close: number | undefined
|
|
205
|
+
let digits = 0
|
|
206
|
+
let rest = 0
|
|
207
|
+
let hasIn = false
|
|
208
|
+
let search = PYTHON_PREFIX.length
|
|
209
|
+
for (;;) {
|
|
210
|
+
const at = trimmed.indexOf(PYTHON_LINE, search)
|
|
211
|
+
if (at < 0) break
|
|
212
|
+
search = at + 1
|
|
213
|
+
let end = at + PYTHON_LINE.length
|
|
214
|
+
const start = end
|
|
215
|
+
while (end < trimmed.length && isDigit(trimmed.charCodeAt(end))) end += 1
|
|
216
|
+
if (end === start) continue
|
|
217
|
+
if (end < trimmed.length && !trimmed.startsWith(PYTHON_IN, end)) continue
|
|
218
|
+
close = at
|
|
219
|
+
digits = end - start
|
|
220
|
+
rest = end
|
|
221
|
+
hasIn = end < trimmed.length
|
|
222
|
+
}
|
|
223
|
+
if (close === undefined) return undefined
|
|
224
|
+
const draft: Draft = {
|
|
225
|
+
raw: trimmed,
|
|
226
|
+
format: 'python',
|
|
227
|
+
file: trimmed.slice(PYTHON_PREFIX.length, close),
|
|
228
|
+
line: Number(trimmed.slice(rest - digits, rest)),
|
|
229
|
+
}
|
|
230
|
+
if (hasIn) {
|
|
231
|
+
const fn = trimmed.slice(rest + PYTHON_IN.length)
|
|
232
|
+
if (fn) draft.function = fn
|
|
233
|
+
}
|
|
164
234
|
return draft
|
|
165
235
|
}
|
|
166
236
|
|
|
@@ -341,13 +411,13 @@ function liftHeader(entries: StackEntry[], format: StackTraceFormat): StackTrace
|
|
|
341
411
|
if (at < 0) return undefined
|
|
342
412
|
const type = first.slice(0, at).trim()
|
|
343
413
|
const after = first.slice(at + 4)
|
|
344
|
-
const old =
|
|
414
|
+
const old = splitRustOldPanic(after)
|
|
345
415
|
let consumed = 1
|
|
346
416
|
let message: string
|
|
347
417
|
let location: string | undefined
|
|
348
418
|
if (old) {
|
|
349
|
-
message = old
|
|
350
|
-
location = old
|
|
419
|
+
message = old.message
|
|
420
|
+
location = old.location
|
|
351
421
|
} else {
|
|
352
422
|
location = after.replace(/:$/, '')
|
|
353
423
|
const body: string[] = []
|