@tylix/core 0.6.0 → 0.7.0
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/LICENSE +21 -0
- package/README.md +68 -17
- package/package.json +38 -7
- package/src/cache/Cache.d.ts +4 -2
- package/src/cache/Cache.js +46 -58
- package/src/channels/ChannelServer.d.ts +5 -0
- package/src/channels/ChannelServer.js +24 -0
- package/src/channels/broadcast.d.ts +3 -0
- package/src/channels/broadcast.js +15 -0
- package/src/http/Server.d.ts +40 -1
- package/src/http/Server.js +214 -24
- package/src/http/enhanceResponse.js +78 -34
- package/src/http/rateLimit.d.ts +9 -1
- package/src/http/rateLimit.js +36 -8
- package/src/index.d.ts +4 -1
- package/src/index.js +7 -1
- package/src/observability/context.js +12 -0
- package/src/observability/health.js +38 -0
- package/src/observability/index.d.ts +68 -0
- package/src/observability/logger.js +127 -0
- package/src/observability/metrics.js +127 -0
- package/src/router/Router.js +116 -49
- package/src/store/database.js +209 -0
- package/src/store/index.d.ts +31 -0
- package/src/store/index.js +52 -0
- package/src/store/memory.js +72 -0
- package/src/store/redis.js +77 -0
- package/src/http/Server.test.js +0 -99
- package/src/http/enhanceResponse.test.js +0 -45
- package/src/http/parseBody.test.js +0 -33
- package/src/http/parseQuery.test.js +0 -15
- package/src/http/requireAuth.test.js +0 -76
- package/src/providers/createProvider.js +0 -16
- package/src/router/Router.test.js +0 -128
- package/src/runtime/useApi.js +0 -405
- package/tsconfig.json +0 -13
package/src/runtime/useApi.js
DELETED
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
export async function useApi(url, options = {}) {
|
|
2
|
-
const {
|
|
3
|
-
method = 'GET',
|
|
4
|
-
body,
|
|
5
|
-
headers = {},
|
|
6
|
-
credentials = 'include',
|
|
7
|
-
} = options
|
|
8
|
-
|
|
9
|
-
const finalHeaders = { ...headers }
|
|
10
|
-
let finalBody = body
|
|
11
|
-
if (body && typeof body === 'object' && !(body instanceof FormData)) {
|
|
12
|
-
finalHeaders['Content-Type'] =
|
|
13
|
-
finalHeaders['Content-Type'] || 'application/json'
|
|
14
|
-
finalBody = JSON.stringify(body)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// __tylixRequestStart/End are injected by the runtime. Guarding them
|
|
18
|
-
// lets this exact file work whether or not they exist.
|
|
19
|
-
const track = typeof __tylixRequestStart === 'function'
|
|
20
|
-
if (track) __tylixRequestStart()
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const response = await fetch(url, {
|
|
24
|
-
method,
|
|
25
|
-
headers: finalHeaders,
|
|
26
|
-
body: finalBody,
|
|
27
|
-
credentials,
|
|
28
|
-
})
|
|
29
|
-
let data = null
|
|
30
|
-
try {
|
|
31
|
-
data = await response.json()
|
|
32
|
-
} catch {
|
|
33
|
-
/* empty body */
|
|
34
|
-
}
|
|
35
|
-
if (!response.ok) {
|
|
36
|
-
// Only present when the server runs with APP_DEBUG=true.
|
|
37
|
-
const debug =
|
|
38
|
-
data && typeof data === 'object' && data.debug ? data.debug : null
|
|
39
|
-
if (debug) showDebug(debug, method, url)
|
|
40
|
-
return {
|
|
41
|
-
ok: false,
|
|
42
|
-
status: response.status,
|
|
43
|
-
data,
|
|
44
|
-
error: (data && (data.error || data.message)) || 'Request failed',
|
|
45
|
-
debug,
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return { ok: true, status: response.status, data, error: null, debug: null }
|
|
49
|
-
} catch (err) {
|
|
50
|
-
console.warn(
|
|
51
|
-
`[tylix] ${method} ${url} could not reach the server: ${err.message}. ` +
|
|
52
|
-
'Is "tylix dev" running, and is the URL correct?',
|
|
53
|
-
)
|
|
54
|
-
return { ok: false, status: 0, data: null, error: err.message, debug: null }
|
|
55
|
-
} finally {
|
|
56
|
-
if (track) __tylixRequestEnd()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// ---------------------------------------------------------------
|
|
60
|
-
// Dev debug UI. Everything lives inside useApi on purpose, so the
|
|
61
|
-
// file still works if the compiler injects only this one function.
|
|
62
|
-
// ---------------------------------------------------------------
|
|
63
|
-
function showDebug(debug, method, url) {
|
|
64
|
-
logToConsole(debug, method, url)
|
|
65
|
-
try {
|
|
66
|
-
showOverlay(debug, method, url)
|
|
67
|
-
} catch (err) {
|
|
68
|
-
console.warn('[tylix] debug overlay failed:', err)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function logToConsole(d, method, url) {
|
|
73
|
-
console.groupCollapsed(
|
|
74
|
-
`%c${d.status} %c${method} ${url} %c${d.title || d.message}`,
|
|
75
|
-
'color:#fb7185;font-weight:bold',
|
|
76
|
-
'color:inherit',
|
|
77
|
-
'color:#fb7185',
|
|
78
|
-
)
|
|
79
|
-
if (d.hint) console.log('How to fix:', d.hint)
|
|
80
|
-
console.log('Message:', d.message)
|
|
81
|
-
if (d.sql) console.log('SQL:', d.sql, d.params?.length ? d.params : '')
|
|
82
|
-
if (d.source) console.log('Source:', `${d.source.file}:${d.source.line}`)
|
|
83
|
-
const mine = (d.frames || []).filter((f) => f.kind === 'app')
|
|
84
|
-
if (mine.length) {
|
|
85
|
-
console.log(
|
|
86
|
-
'Your frames:\n' +
|
|
87
|
-
mine.map((f) => ` ${f.fn || '<anonymous>'} (${f.short}:${f.line})`).join('\n'),
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
console.log('Full payload:', d)
|
|
91
|
-
console.groupEnd()
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function showOverlay(debug, method, url) {
|
|
95
|
-
if (typeof document === 'undefined') return
|
|
96
|
-
|
|
97
|
-
const store = (window.__tylixDebug = window.__tylixDebug || {
|
|
98
|
-
errors: [],
|
|
99
|
-
index: 0,
|
|
100
|
-
open: false,
|
|
101
|
-
})
|
|
102
|
-
store.errors.unshift({ debug, method, url })
|
|
103
|
-
store.errors = store.errors.slice(0, 20)
|
|
104
|
-
store.index = 0
|
|
105
|
-
render()
|
|
106
|
-
|
|
107
|
-
function h(tag, props, ...children) {
|
|
108
|
-
const node = document.createElement(tag)
|
|
109
|
-
for (const [key, value] of Object.entries(props || {})) {
|
|
110
|
-
if (key === 'class') node.className = value
|
|
111
|
-
else if (key.startsWith('on')) node.addEventListener(key.slice(2), value)
|
|
112
|
-
else if (value != null) node.setAttribute(key, value)
|
|
113
|
-
}
|
|
114
|
-
for (const child of children.flat()) {
|
|
115
|
-
if (child == null || child === false) continue
|
|
116
|
-
node.append(child.nodeType ? child : document.createTextNode(String(child)))
|
|
117
|
-
}
|
|
118
|
-
return node
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function getRoot() {
|
|
122
|
-
let host = document.getElementById('__tylix-debug-host')
|
|
123
|
-
if (!host) {
|
|
124
|
-
host = document.createElement('div')
|
|
125
|
-
host.id = '__tylix-debug-host'
|
|
126
|
-
document.body.appendChild(host)
|
|
127
|
-
host.attachShadow({ mode: 'open' })
|
|
128
|
-
document.addEventListener('keydown', (e) => {
|
|
129
|
-
if (e.key === 'Escape' && store.open) {
|
|
130
|
-
store.open = false
|
|
131
|
-
render()
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
return host.shadowRoot
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const KEYWORDS = new Set(
|
|
139
|
-
(
|
|
140
|
-
'SELECT FROM WHERE INSERT INTO VALUES UPDATE SET DELETE CREATE TABLE ALTER ADD DROP COLUMN ' +
|
|
141
|
-
'INDEX UNIQUE PRIMARY KEY JOIN LEFT RIGHT INNER ON AS AND OR NOT NULL IN IS LIKE ORDER BY ' +
|
|
142
|
-
'GROUP HAVING LIMIT OFFSET ASC DESC COUNT RETURNING IF EXISTS DEFAULT'
|
|
143
|
-
).split(' '),
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
function highlightSql(sql, culprits) {
|
|
147
|
-
const re =
|
|
148
|
-
/('(?:[^'\\]|\\.)*')|(`[^`]*`|"[^"]*")|(\?|\$\d+)|(\d+(?:\.\d+)?)|([A-Za-z_]\w*)/g
|
|
149
|
-
const out = []
|
|
150
|
-
let last = 0
|
|
151
|
-
let m
|
|
152
|
-
while ((m = re.exec(sql))) {
|
|
153
|
-
if (m.index > last) out.push(sql.slice(last, m.index))
|
|
154
|
-
const token = m[0]
|
|
155
|
-
let cls = null
|
|
156
|
-
if (m[1]) cls = 'str'
|
|
157
|
-
else if (m[2]) cls = culprits.has(token.slice(1, -1)) ? 'culprit' : 'id'
|
|
158
|
-
else if (m[3]) cls = 'ph'
|
|
159
|
-
else if (m[4]) cls = 'num'
|
|
160
|
-
else if (KEYWORDS.has(token.toUpperCase())) cls = 'kw'
|
|
161
|
-
else if (culprits.has(token)) cls = 'culprit'
|
|
162
|
-
out.push(cls ? h('span', { class: 't-' + cls }, token) : token)
|
|
163
|
-
last = re.lastIndex
|
|
164
|
-
}
|
|
165
|
-
if (last < sql.length) out.push(sql.slice(last))
|
|
166
|
-
return out
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function copy(button, text) {
|
|
170
|
-
const done = () => {
|
|
171
|
-
const old = button.textContent
|
|
172
|
-
button.textContent = 'Copied'
|
|
173
|
-
setTimeout(() => (button.textContent = old), 1400)
|
|
174
|
-
}
|
|
175
|
-
if (navigator.clipboard && window.isSecureContext) {
|
|
176
|
-
navigator.clipboard.writeText(text).then(done, done)
|
|
177
|
-
} else {
|
|
178
|
-
const ta = document.createElement('textarea')
|
|
179
|
-
ta.value = text
|
|
180
|
-
document.body.appendChild(ta)
|
|
181
|
-
ta.select()
|
|
182
|
-
try {
|
|
183
|
-
document.execCommand('copy')
|
|
184
|
-
} catch {
|
|
185
|
-
/* ignore */
|
|
186
|
-
}
|
|
187
|
-
ta.remove()
|
|
188
|
-
done()
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function toMarkdown(d, method, url) {
|
|
193
|
-
const fence = String.fromCharCode(96).repeat(3)
|
|
194
|
-
const lines = [`## ${d.title || d.name}`, '', `**${d.name}${d.driver ? ` (${d.driver})` : ''}:** ${d.message}`]
|
|
195
|
-
if (d.hint) lines.push('', `**Hint:** ${d.hint}`)
|
|
196
|
-
if (d.sql) {
|
|
197
|
-
lines.push('', fence + 'sql', d.sql, fence)
|
|
198
|
-
if (d.params?.length) lines.push('Params: ' + JSON.stringify(d.params))
|
|
199
|
-
}
|
|
200
|
-
lines.push('', `**Request:** ${method} ${url}`)
|
|
201
|
-
const mine = (d.frames || []).filter((f) => f.kind === 'app').slice(0, 8)
|
|
202
|
-
if (mine.length) {
|
|
203
|
-
lines.push('', fence)
|
|
204
|
-
for (const f of mine) lines.push(`at ${f.fn || '<anonymous>'} (${f.short}:${f.line}:${f.column})`)
|
|
205
|
-
lines.push(fence)
|
|
206
|
-
}
|
|
207
|
-
return lines.join('\n')
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function panel(entry) {
|
|
211
|
-
const { debug: d, method, url } = entry
|
|
212
|
-
const culprits = new Set([d.table, d.column].filter(Boolean))
|
|
213
|
-
const mine = (d.frames || []).filter((f) => f.kind === 'app').slice(0, 6)
|
|
214
|
-
|
|
215
|
-
return h(
|
|
216
|
-
'div',
|
|
217
|
-
{ class: 'panel' },
|
|
218
|
-
h(
|
|
219
|
-
'div',
|
|
220
|
-
{ class: 'chips' },
|
|
221
|
-
h('span', { class: 'chip danger' }, d.status),
|
|
222
|
-
d.driver && h('span', { class: 'chip accent' }, d.driver),
|
|
223
|
-
d.kind && h('span', { class: 'chip' }, d.kind.replace(/_/g, ' ')),
|
|
224
|
-
d.code && h('span', { class: 'chip mono' }, d.code),
|
|
225
|
-
),
|
|
226
|
-
h('h1', {}, d.title || String(d.message).split('\n')[0]),
|
|
227
|
-
h('p', { class: 'req mono' }, `${method} ${url}`),
|
|
228
|
-
d.title && h('pre', { class: 'message mono' }, d.message),
|
|
229
|
-
d.hint &&
|
|
230
|
-
h('div', { class: 'hint' }, h('b', {}, 'How to fix'), h('span', {}, d.hint)),
|
|
231
|
-
d.source &&
|
|
232
|
-
h(
|
|
233
|
-
'section',
|
|
234
|
-
{},
|
|
235
|
-
h('h2', {}, `Where it happened ${d.source.file}:${d.source.line}`),
|
|
236
|
-
h(
|
|
237
|
-
'div',
|
|
238
|
-
{ class: 'code' },
|
|
239
|
-
d.source.lines.map((text, i) => {
|
|
240
|
-
const n = d.source.start + i
|
|
241
|
-
return h(
|
|
242
|
-
'div',
|
|
243
|
-
{ class: 'line' + (n === d.source.line ? ' hit' : '') },
|
|
244
|
-
h('span', { class: 'gutter' }, n),
|
|
245
|
-
h('span', { class: 'mono' }, text || ' '),
|
|
246
|
-
)
|
|
247
|
-
}),
|
|
248
|
-
),
|
|
249
|
-
),
|
|
250
|
-
d.sql &&
|
|
251
|
-
h(
|
|
252
|
-
'section',
|
|
253
|
-
{},
|
|
254
|
-
h('h2', {}, d.driver === 'mongodb' ? 'Operation' : 'Query'),
|
|
255
|
-
h('pre', { class: 'sql mono' }, highlightSql(d.sql, culprits)),
|
|
256
|
-
d.params?.length > 0 &&
|
|
257
|
-
h(
|
|
258
|
-
'div',
|
|
259
|
-
{ class: 'params mono' },
|
|
260
|
-
d.params.map((v, i) => h('div', {}, `${i + 1} ${JSON.stringify(v)}`)),
|
|
261
|
-
),
|
|
262
|
-
),
|
|
263
|
-
mine.length > 0 &&
|
|
264
|
-
h(
|
|
265
|
-
'section',
|
|
266
|
-
{},
|
|
267
|
-
h('h2', {}, 'Your code in the stack'),
|
|
268
|
-
mine.map((f) =>
|
|
269
|
-
h(
|
|
270
|
-
'div',
|
|
271
|
-
{ class: 'frame' },
|
|
272
|
-
h('b', {}, f.fn || '<anonymous>'),
|
|
273
|
-
h('span', { class: 'mono' }, `${f.short}:${f.line}:${f.column}`),
|
|
274
|
-
),
|
|
275
|
-
),
|
|
276
|
-
),
|
|
277
|
-
h(
|
|
278
|
-
'div',
|
|
279
|
-
{ class: 'actions' },
|
|
280
|
-
h('button', { onclick: (e) => copy(e.target, toMarkdown(d, method, url)) }, 'Copy as Markdown'),
|
|
281
|
-
h('button', { onclick: (e) => copy(e.target, JSON.stringify(d, null, 2)) }, 'Copy JSON'),
|
|
282
|
-
),
|
|
283
|
-
)
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function render() {
|
|
287
|
-
const root = getRoot()
|
|
288
|
-
const dark =
|
|
289
|
-
document.documentElement.classList.contains('dark') ||
|
|
290
|
-
window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
291
|
-
const entry = store.errors[store.index]
|
|
292
|
-
const total = store.errors.length
|
|
293
|
-
|
|
294
|
-
const nodes = [h('style', {}, CSS)]
|
|
295
|
-
|
|
296
|
-
if (total === 0) {
|
|
297
|
-
root.replaceChildren(...nodes)
|
|
298
|
-
return
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (!store.open) {
|
|
302
|
-
nodes.push(
|
|
303
|
-
h(
|
|
304
|
-
'button',
|
|
305
|
-
{
|
|
306
|
-
class: 'badge' + (dark ? ' dark' : ''),
|
|
307
|
-
onclick: () => {
|
|
308
|
-
store.open = true
|
|
309
|
-
render()
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
h('span', { class: 'dot' }),
|
|
313
|
-
`${entry.debug.status} ${entry.debug.title || entry.debug.message}`.slice(0, 70),
|
|
314
|
-
total > 1 && h('span', { class: 'count' }, `+${total - 1}`),
|
|
315
|
-
),
|
|
316
|
-
)
|
|
317
|
-
} else {
|
|
318
|
-
const close = () => {
|
|
319
|
-
store.open = false
|
|
320
|
-
render()
|
|
321
|
-
}
|
|
322
|
-
nodes.push(
|
|
323
|
-
h(
|
|
324
|
-
'div',
|
|
325
|
-
{ class: 'backdrop' + (dark ? ' dark' : ''), onclick: (e) => e.target === e.currentTarget && close() },
|
|
326
|
-
h(
|
|
327
|
-
'div',
|
|
328
|
-
{ class: 'modal' },
|
|
329
|
-
h(
|
|
330
|
-
'div',
|
|
331
|
-
{ class: 'bar' },
|
|
332
|
-
h('span', {}, 'Tylix debug'),
|
|
333
|
-
total > 1 &&
|
|
334
|
-
h(
|
|
335
|
-
'span',
|
|
336
|
-
{ class: 'pager' },
|
|
337
|
-
h('button', { onclick: () => { store.index = Math.min(total - 1, store.index + 1); render() } }, '‹'),
|
|
338
|
-
`${store.index + 1} / ${total}`,
|
|
339
|
-
h('button', { onclick: () => { store.index = Math.max(0, store.index - 1); render() } }, '›'),
|
|
340
|
-
),
|
|
341
|
-
h(
|
|
342
|
-
'span',
|
|
343
|
-
{ class: 'bar-actions' },
|
|
344
|
-
h('button', { onclick: () => { store.errors = []; store.open = false; render() } }, 'Dismiss all'),
|
|
345
|
-
h('button', { onclick: close }, 'Close (Esc)'),
|
|
346
|
-
),
|
|
347
|
-
),
|
|
348
|
-
panel(entry),
|
|
349
|
-
),
|
|
350
|
-
),
|
|
351
|
-
)
|
|
352
|
-
}
|
|
353
|
-
root.replaceChildren(...nodes)
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
const CSS = `
|
|
357
|
-
* { box-sizing: border-box; }
|
|
358
|
-
.mono, pre { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
|
|
359
|
-
.dark, .backdrop, .badge { --bg:#fff; --bg2:#f1f5f9; --bd:#cbd5e1; --tx:#1e293b; --tx2:#64748b; --ac:#047857; --acbg:rgba(16,185,129,.1);
|
|
360
|
-
--dg:#be123c; --dgbg:#ffe4e6; --kw:#7c3aed; --st:#047857; --nu:#b45309; }
|
|
361
|
-
.dark { --bg:#0f172a; --bg2:#0b1220; --bd:#334155; --tx:#e2e8f0; --tx2:#94a3b8; --ac:#10b981; --acbg:rgba(16,185,129,.12);
|
|
362
|
-
--dg:#fb7185; --dgbg:rgba(76,5,25,.4); --kw:#a78bfa; --st:#34d399; --nu:#fbbf24; }
|
|
363
|
-
button { font: inherit; cursor: pointer; }
|
|
364
|
-
.badge { position: fixed; right: 16px; bottom: 16px; z-index: 2147483647; display: flex; gap: 8px; align-items: center;
|
|
365
|
-
max-width: min(520px, calc(100vw - 32px)); padding: 9px 14px; border-radius: 999px; font: 600 13px system-ui, sans-serif;
|
|
366
|
-
background: var(--bg); color: var(--tx); border: 1px solid var(--dg); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
|
|
367
|
-
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dg); flex: none; }
|
|
368
|
-
.count { background: var(--dgbg); color: var(--dg); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
|
|
369
|
-
.backdrop { position: fixed; inset: 0; z-index: 2147483647; background: rgba(2,6,23,.6); display: flex;
|
|
370
|
-
align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; font: 14px/1.55 system-ui, sans-serif; color: var(--tx); }
|
|
371
|
-
.modal { width: 100%; max-width: 880px; background: var(--bg); border: 1px solid var(--bd); border-radius: 16px; overflow: hidden; }
|
|
372
|
-
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
|
|
373
|
-
border-bottom: 1px solid var(--bd); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
|
|
374
|
-
.bar button, .actions button { background: var(--bg2); color: var(--tx); border: 1px solid var(--bd); border-radius: 999px; padding: 4px 12px; font-size: 12px; }
|
|
375
|
-
.bar button:hover, .actions button:hover { border-color: var(--ac); }
|
|
376
|
-
.bar-actions, .pager { display: flex; gap: 8px; align-items: center; }
|
|
377
|
-
.panel { padding: 22px 26px 26px; }
|
|
378
|
-
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
|
|
379
|
-
.chip { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 10px;
|
|
380
|
-
border-radius: 999px; border: 1px solid var(--bd); color: var(--tx2); }
|
|
381
|
-
.chip.danger { color: var(--dg); background: var(--dgbg); border-color: var(--dg); }
|
|
382
|
-
.chip.accent { color: var(--ac); background: var(--acbg); border-color: var(--ac); }
|
|
383
|
-
h1 { font-size: 22px; line-height: 1.3; margin: 0 0 6px; }
|
|
384
|
-
h2 { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--tx2); margin: 22px 0 8px; }
|
|
385
|
-
.req { color: var(--tx2); font-size: 12.5px; margin: 0 0 12px; }
|
|
386
|
-
.message { background: var(--bg2); border: 1px solid var(--bd); border-left: 3px solid var(--dg); border-radius: 8px;
|
|
387
|
-
padding: 10px 14px; margin: 0 0 14px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
|
|
388
|
-
.hint { display: flex; flex-direction: column; gap: 2px; background: var(--acbg); border: 1px solid var(--ac); border-radius: 10px; padding: 12px 16px; }
|
|
389
|
-
.hint b { color: var(--ac); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
|
|
390
|
-
.code { background: var(--bg2); border: 1px solid var(--bd); border-radius: 10px; padding: 6px 0; overflow-x: auto; }
|
|
391
|
-
.line { display: flex; font-size: 13px; line-height: 1.85; white-space: pre; }
|
|
392
|
-
.gutter { flex: 0 0 52px; text-align: right; padding-right: 14px; color: var(--tx2); user-select: none; }
|
|
393
|
-
.line.hit { background: var(--dgbg); } .line.hit .gutter { color: var(--dg); font-weight: 700; }
|
|
394
|
-
.sql { margin: 0; background: var(--bg2); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px;
|
|
395
|
-
font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
|
|
396
|
-
.t-kw { color: var(--kw); font-weight: 600; } .t-str { color: var(--st); } .t-num { color: var(--nu); } .t-ph { color: var(--nu); }
|
|
397
|
-
.t-culprit { color: var(--dg); background: var(--dgbg); border-radius: 4px; padding: 0 3px; font-weight: 700; }
|
|
398
|
-
.params { margin-top: 8px; font-size: 12.5px; color: var(--tx2); background: var(--bg2); border: 1px solid var(--bd);
|
|
399
|
-
border-radius: 10px; padding: 10px 14px; word-break: break-all; }
|
|
400
|
-
.frame { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--bd); font-size: 13px; }
|
|
401
|
-
.frame span { color: var(--ac); font-size: 12px; word-break: break-all; }
|
|
402
|
-
.actions { display: flex; gap: 8px; margin-top: 22px; }
|
|
403
|
-
`
|
|
404
|
-
}
|
|
405
|
-
}
|
package/tsconfig.json
DELETED