liquidcn 0.0.1 → 0.1.0-alpha.6
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/README.md +209 -2
- package/dist/esm/client/components/audio-visualizer.js +88 -0
- package/dist/esm/client/components/audio-visualizer.js.map +1 -0
- package/dist/esm/client/components/chat-view.js +182 -0
- package/dist/esm/client/components/chat-view.js.map +1 -0
- package/dist/esm/client/components/form-builder.js +416 -0
- package/dist/esm/client/components/form-builder.js.map +1 -0
- package/dist/esm/client/components/index.js +3 -0
- package/dist/esm/client/components/index.js.map +1 -1
- package/dist/esm/client/components/ui/dialog.js +3 -3
- package/dist/esm/client/components/ui/dialog.js.map +1 -1
- package/dist/esm/client/components/ui/index.js +2 -0
- package/dist/esm/client/components/ui/index.js.map +1 -1
- package/dist/esm/client/components/ui/label.js +9 -0
- package/dist/esm/client/components/ui/label.js.map +1 -0
- package/dist/esm/client/components/ui/resizable-navbar.js +8 -8
- package/dist/esm/client/components/ui/resizable-navbar.js.map +1 -1
- package/dist/esm/client/components/ui/select.js +5 -5
- package/dist/esm/client/components/ui/select.js.map +1 -1
- package/dist/esm/client/components/ui/slider.js +10 -0
- package/dist/esm/client/components/ui/slider.js.map +1 -0
- package/dist/esm/client/components/ui/switch.js +1 -1
- package/dist/esm/client/components/ui/switch.js.map +1 -1
- package/dist/esm/client/components/ui/tabs.js +7 -6
- package/dist/esm/client/components/ui/tabs.js.map +1 -1
- package/dist/esm/client/hooks/index.js +1 -0
- package/dist/esm/client/hooks/index.js.map +1 -1
- package/dist/esm/client/hooks/use-speech-to-text.js +54 -0
- package/dist/esm/client/hooks/use-speech-to-text.js.map +1 -0
- package/dist/esm/client/utils/audio-utils.js +83 -0
- package/dist/esm/client/utils/audio-utils.js.map +1 -0
- package/dist/esm/components/ui/badge.js +6 -6
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/button.js +6 -6
- package/dist/esm/components/ui/button.js.map +1 -1
- package/dist/esm/components/ui/input.js +2 -2
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/textarea.js +2 -2
- package/dist/esm/components/ui/textarea.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/speech-to-text/index.js +3 -0
- package/dist/esm/speech-to-text/index.js.map +1 -0
- package/dist/esm/speech-to-text/server.js +63 -0
- package/dist/esm/speech-to-text/server.js.map +1 -0
- package/dist/esm/speech-to-text/types.js +2 -0
- package/dist/esm/speech-to-text/types.js.map +1 -0
- package/dist/styles.css +116 -25
- package/dist/types/client/components/audio-visualizer.d.ts +49 -0
- package/dist/types/client/components/audio-visualizer.d.ts.map +1 -0
- package/dist/types/client/components/chat-view.d.ts +55 -0
- package/dist/types/client/components/chat-view.d.ts.map +1 -0
- package/dist/types/client/components/form-builder.d.ts +211 -0
- package/dist/types/client/components/form-builder.d.ts.map +1 -0
- package/dist/types/client/components/index.d.ts +3 -0
- package/dist/types/client/components/index.d.ts.map +1 -1
- package/dist/types/client/components/ui/dialog.d.ts.map +1 -1
- package/dist/types/client/components/ui/index.d.ts +2 -0
- package/dist/types/client/components/ui/index.d.ts.map +1 -1
- package/dist/types/client/components/ui/label.d.ts +5 -0
- package/dist/types/client/components/ui/label.d.ts.map +1 -0
- package/dist/types/client/components/ui/resizable-navbar.d.ts.map +1 -1
- package/dist/types/client/components/ui/select.d.ts.map +1 -1
- package/dist/types/client/components/ui/slider.d.ts +5 -0
- package/dist/types/client/components/ui/slider.d.ts.map +1 -0
- package/dist/types/client/components/ui/switch.d.ts.map +1 -1
- package/dist/types/client/components/ui/tabs.d.ts.map +1 -1
- package/dist/types/client/hooks/index.d.ts +1 -0
- package/dist/types/client/hooks/index.d.ts.map +1 -1
- package/dist/types/client/hooks/use-speech-to-text.d.ts +51 -0
- package/dist/types/client/hooks/use-speech-to-text.d.ts.map +1 -0
- package/dist/types/client/utils/audio-utils.d.ts +20 -0
- package/dist/types/client/utils/audio-utils.d.ts.map +1 -0
- package/dist/types/components/ui/badge.d.ts.map +1 -1
- package/dist/types/components/ui/input.d.ts.map +1 -1
- package/dist/types/components/ui/textarea.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/speech-to-text/index.d.ts +7 -0
- package/dist/types/speech-to-text/index.d.ts.map +1 -0
- package/dist/types/speech-to-text/server.d.ts +35 -0
- package/dist/types/speech-to-text/server.d.ts.map +1 -0
- package/dist/types/speech-to-text/types.d.ts +94 -0
- package/dist/types/speech-to-text/types.d.ts.map +1 -0
- package/package.json +21 -10
- package/dist/cjs/client/components/index.js +0 -18
- package/dist/cjs/client/components/index.js.map +0 -1
- package/dist/cjs/client/components/ui/dialog.js +0 -48
- package/dist/cjs/client/components/ui/dialog.js.map +0 -1
- package/dist/cjs/client/components/ui/index.js +0 -24
- package/dist/cjs/client/components/ui/index.js.map +0 -1
- package/dist/cjs/client/components/ui/pretty-date.js +0 -91
- package/dist/cjs/client/components/ui/pretty-date.js.map +0 -1
- package/dist/cjs/client/components/ui/resizable-navbar.js +0 -126
- package/dist/cjs/client/components/ui/resizable-navbar.js.map +0 -1
- package/dist/cjs/client/components/ui/select.js +0 -50
- package/dist/cjs/client/components/ui/select.js.map +0 -1
- package/dist/cjs/client/components/ui/sonner.js +0 -12
- package/dist/cjs/client/components/ui/sonner.js.map +0 -1
- package/dist/cjs/client/components/ui/switch.js +0 -11
- package/dist/cjs/client/components/ui/switch.js.map +0 -1
- package/dist/cjs/client/components/ui/tabs.js +0 -53
- package/dist/cjs/client/components/ui/tabs.js.map +0 -1
- package/dist/cjs/client/hooks/index.js +0 -18
- package/dist/cjs/client/hooks/index.js.map +0 -1
- package/dist/cjs/client/hooks/use-cookie-with-fallback.js +0 -107
- package/dist/cjs/client/hooks/use-cookie-with-fallback.js.map +0 -1
- package/dist/cjs/client/index.js +0 -19
- package/dist/cjs/client/index.js.map +0 -1
- package/dist/cjs/components/index.js +0 -18
- package/dist/cjs/components/index.js.map +0 -1
- package/dist/cjs/components/ui/alert.js +0 -33
- package/dist/cjs/components/ui/alert.js.map +0 -1
- package/dist/cjs/components/ui/badge.js +0 -28
- package/dist/cjs/components/ui/badge.js.map +0 -1
- package/dist/cjs/components/ui/button.js +0 -39
- package/dist/cjs/components/ui/button.js.map +0 -1
- package/dist/cjs/components/ui/card.js +0 -48
- package/dist/cjs/components/ui/card.js.map +0 -1
- package/dist/cjs/components/ui/footer.js +0 -9
- package/dist/cjs/components/ui/footer.js.map +0 -1
- package/dist/cjs/components/ui/index.js +0 -25
- package/dist/cjs/components/ui/index.js.map +0 -1
- package/dist/cjs/components/ui/input.js +0 -12
- package/dist/cjs/components/ui/input.js.map +0 -1
- package/dist/cjs/components/ui/pretty-amount.js +0 -167
- package/dist/cjs/components/ui/pretty-amount.js.map +0 -1
- package/dist/cjs/components/ui/textarea.js +0 -12
- package/dist/cjs/components/ui/textarea.js.map +0 -1
- package/dist/cjs/index.js +0 -19
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/utils.js +0 -9
- package/dist/cjs/utils.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { openai } from '@ai-sdk/openai';
|
|
2
|
+
import { experimental_transcribe as transcribe } from 'ai';
|
|
3
|
+
const DEFAULT_MODEL = 'gpt-4o-transcribe';
|
|
4
|
+
export async function transcribeAudio(audioData, options) {
|
|
5
|
+
const model = options?.model || DEFAULT_MODEL;
|
|
6
|
+
const result = await transcribe({
|
|
7
|
+
model: openai.transcription(model),
|
|
8
|
+
audio: audioData,
|
|
9
|
+
providerOptions: {
|
|
10
|
+
openai: {
|
|
11
|
+
...(options?.language && { language: options.language }),
|
|
12
|
+
timestampGranularities: ['segment'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
text: result.text,
|
|
18
|
+
segments: result.segments,
|
|
19
|
+
duration: result.durationInSeconds,
|
|
20
|
+
language: result.language,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function createSpeechToTextHandler(options) {
|
|
24
|
+
return async (req) => {
|
|
25
|
+
try {
|
|
26
|
+
if (!process.env.OPENAI_API_KEY) {
|
|
27
|
+
return new Response(JSON.stringify({
|
|
28
|
+
error: 'Missing OPENAI_API_KEY environment variable',
|
|
29
|
+
}), { status: 500, headers: { 'Content-Type': 'application/json' } });
|
|
30
|
+
}
|
|
31
|
+
if (options?.authenticate) {
|
|
32
|
+
const isAuthenticated = await options.authenticate(req);
|
|
33
|
+
if (!isAuthenticated) {
|
|
34
|
+
return new Response(JSON.stringify({ error: 'Unauthorized' }), { status: 401, headers: { 'Content-Type': 'application/json' } });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const formData = await req.formData();
|
|
38
|
+
const audioFile = formData.get('audio');
|
|
39
|
+
const language = formData.get('language') || undefined;
|
|
40
|
+
const model = formData.get('model') || options?.defaultModel || DEFAULT_MODEL;
|
|
41
|
+
if (!audioFile) {
|
|
42
|
+
return new Response(JSON.stringify({
|
|
43
|
+
error: 'Audio file is required',
|
|
44
|
+
}), { status: 400, headers: { 'Content-Type': 'application/json' } });
|
|
45
|
+
}
|
|
46
|
+
const arrayBuffer = await audioFile.arrayBuffer();
|
|
47
|
+
const audioData = new Uint8Array(arrayBuffer);
|
|
48
|
+
const result = await transcribeAudio(audioData, { model, language });
|
|
49
|
+
return new Response(JSON.stringify(result), {
|
|
50
|
+
status: 200,
|
|
51
|
+
headers: { 'Content-Type': 'application/json' },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error('Speech-to-text error:', error);
|
|
56
|
+
return new Response(JSON.stringify({
|
|
57
|
+
error: 'Failed to transcribe audio',
|
|
58
|
+
details: error instanceof Error ? error.message : 'Unknown error',
|
|
59
|
+
}), { status: 500, headers: { 'Content-Type': 'application/json' } });
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63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AI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;gBAC1C,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;aAChD,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAA;YAC7C,OAAO,IAAI,QAAQ,CACjB,IAAI,CAAC,SAAS,CAAC;gBACb,KAAK,EAAE,4BAA4B;gBACnC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAC9B,CAAC,EACtC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CACjE,CAAA;QACH,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/speech-to-text/types.ts"],"names":[],"mappings":""}
|
package/dist/styles.css
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/* Size variants - backdrop blur + saturation + wrapper shadow */
|
|
19
|
+
/* NO background-color here - components define their own backgrounds */
|
|
20
|
+
|
|
19
21
|
.glass-sm {
|
|
20
22
|
backdrop-filter: blur(24px) saturate(1.1);
|
|
21
23
|
-webkit-backdrop-filter: blur(24px) saturate(1.1);
|
|
@@ -99,6 +101,15 @@
|
|
|
99
101
|
background: rgba(0, 0, 0, 0.02);
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
/* Dialog-specific tint - visible on light backgrounds */
|
|
105
|
+
.glass-tint-dialog {
|
|
106
|
+
background: rgba(255, 255, 255, 0.5);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.dark .glass-tint-dialog {
|
|
110
|
+
background: rgba(0, 0, 0, 0.02);
|
|
111
|
+
}
|
|
112
|
+
|
|
102
113
|
.glass-tint-light {
|
|
103
114
|
background: rgba(255, 255, 255, 0.03);
|
|
104
115
|
}
|
|
@@ -176,6 +187,86 @@
|
|
|
176
187
|
height: 100%;
|
|
177
188
|
}
|
|
178
189
|
|
|
190
|
+
/* ============================================================================
|
|
191
|
+
Glass Select Component Styles
|
|
192
|
+
============================================================================ */
|
|
193
|
+
|
|
194
|
+
/* Select trigger - light mode: subtle dark tint */
|
|
195
|
+
.glass-select-trigger {
|
|
196
|
+
backdrop-filter: blur(24px) saturate(1.1);
|
|
197
|
+
-webkit-backdrop-filter: blur(24px) saturate(1.1);
|
|
198
|
+
box-shadow:
|
|
199
|
+
0 2px 8px rgba(0, 0, 0, 0.06),
|
|
200
|
+
0 0 0 1px rgba(0, 0, 0, 0.04),
|
|
201
|
+
inset 0 1px 0px rgba(255, 255, 255, 0.5),
|
|
202
|
+
inset 0 -0.5px 0 0 rgba(0, 0, 0, 0.03);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Select trigger - dark mode: subtle light tint */
|
|
206
|
+
.dark .glass-select-trigger {
|
|
207
|
+
box-shadow:
|
|
208
|
+
0 2px 8px rgba(0, 0, 0, 0.15),
|
|
209
|
+
0 0 0 1px rgba(255, 255, 255, 0.08),
|
|
210
|
+
inset 0 1px 0px rgba(255, 255, 255, 0.15),
|
|
211
|
+
inset 0 -0.5px 0 0 rgba(0, 0, 0, 0.12);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Select content dropdown - light mode */
|
|
215
|
+
.glass-select-content {
|
|
216
|
+
backdrop-filter: blur(32px) saturate(1.15);
|
|
217
|
+
-webkit-backdrop-filter: blur(32px) saturate(1.15);
|
|
218
|
+
box-shadow:
|
|
219
|
+
0 8px 24px rgba(0, 0, 0, 0.1),
|
|
220
|
+
0 0 0 1px rgba(0, 0, 0, 0.05),
|
|
221
|
+
inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Select content dropdown - dark mode */
|
|
225
|
+
.dark .glass-select-content {
|
|
226
|
+
box-shadow:
|
|
227
|
+
0 8px 24px rgba(0, 0, 0, 0.25),
|
|
228
|
+
0 0 0 1px rgba(255, 255, 255, 0.1),
|
|
229
|
+
inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* ============================================================================
|
|
233
|
+
Glass Input/Textarea Component Styles
|
|
234
|
+
============================================================================ */
|
|
235
|
+
|
|
236
|
+
/* Input/Textarea glass wrapper - light mode */
|
|
237
|
+
.glass.glass-lg[class*='border-foreground'] {
|
|
238
|
+
box-shadow:
|
|
239
|
+
inset 0 1px 0px rgba(255, 255, 255, 0.7),
|
|
240
|
+
0 1px 3px rgba(0, 0, 0, 0.06),
|
|
241
|
+
0 2px 6px rgba(0, 0, 0, 0.04);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Input/Textarea glass wrapper - dark mode */
|
|
245
|
+
.dark .glass.glass-lg[class*='border-foreground'] {
|
|
246
|
+
box-shadow:
|
|
247
|
+
inset 0 1px 0px rgba(255, 255, 255, 0.1),
|
|
248
|
+
0 2px 8px rgba(0, 0, 0, 0.15),
|
|
249
|
+
0 4px 12px rgba(0, 0, 0, 0.1);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* ============================================================================
|
|
253
|
+
Glass Slider Component Styles
|
|
254
|
+
============================================================================ */
|
|
255
|
+
|
|
256
|
+
/* Slider track - light mode adjustments */
|
|
257
|
+
.glass.glass-sm[class*='bg-foreground'] {
|
|
258
|
+
box-shadow:
|
|
259
|
+
inset 0 1px 2px rgba(0, 0, 0, 0.08),
|
|
260
|
+
0 1px 0px rgba(255, 255, 255, 0.8);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* Slider track - dark mode */
|
|
264
|
+
.dark .glass.glass-sm[class*='bg-foreground'] {
|
|
265
|
+
box-shadow:
|
|
266
|
+
inset 0 1px 2px rgba(0, 0, 0, 0.2),
|
|
267
|
+
0 1px 0px rgba(255, 255, 255, 0.08);
|
|
268
|
+
}
|
|
269
|
+
|
|
179
270
|
/* ============================================================================
|
|
180
271
|
Liquid Glass - Shared Heavy Distortion Effect
|
|
181
272
|
============================================================================ */
|
|
@@ -184,7 +275,7 @@
|
|
|
184
275
|
overflow: hidden;
|
|
185
276
|
backdrop-filter: blur(200px) saturate(2) contrast(1.1);
|
|
186
277
|
-webkit-backdrop-filter: blur(200px) saturate(2) contrast(1.1);
|
|
187
|
-
background-color: oklch(
|
|
278
|
+
background-color: oklch(from var(--card) l c h / 0.82);
|
|
188
279
|
box-shadow:
|
|
189
280
|
0 8px 32px rgba(0, 0, 0, 0.18),
|
|
190
281
|
0 0 0 1px rgba(255, 255, 255, 0.4),
|
|
@@ -195,7 +286,7 @@
|
|
|
195
286
|
}
|
|
196
287
|
|
|
197
288
|
.dark .liquid-glass {
|
|
198
|
-
background-color: oklch(
|
|
289
|
+
background-color: oklch(from var(--card) l c h / 0.82);
|
|
199
290
|
box-shadow:
|
|
200
291
|
0 8px 32px rgba(0, 0, 0, 0.35),
|
|
201
292
|
0 0 0 1px rgba(255, 255, 255, 0.15),
|
|
@@ -256,32 +347,32 @@
|
|
|
256
347
|
background: linear-gradient(
|
|
257
348
|
90deg,
|
|
258
349
|
transparent 0%,
|
|
259
|
-
oklch(
|
|
260
|
-
oklch(
|
|
350
|
+
oklch(from var(--border) l c h / 0.3) 10%,
|
|
351
|
+
oklch(from var(--border) l c h / 0.6) 30%,
|
|
261
352
|
oklch(1 0 0 / 0.8) 50%,
|
|
262
|
-
oklch(
|
|
263
|
-
oklch(
|
|
353
|
+
oklch(from var(--border) l c h / 0.6) 70%,
|
|
354
|
+
oklch(from var(--border) l c h / 0.3) 90%,
|
|
264
355
|
transparent 100%
|
|
265
356
|
);
|
|
266
357
|
box-shadow:
|
|
267
|
-
0 0 20px 2px oklch(
|
|
268
|
-
0 0 40px 4px oklch(
|
|
358
|
+
0 0 20px 2px oklch(from var(--border) l c h / 0.15),
|
|
359
|
+
0 0 40px 4px oklch(from var(--border) l c h / 0.1);
|
|
269
360
|
}
|
|
270
361
|
|
|
271
362
|
.dark .liquid-glass-border {
|
|
272
363
|
background: linear-gradient(
|
|
273
364
|
90deg,
|
|
274
365
|
transparent 0%,
|
|
275
|
-
oklch(
|
|
276
|
-
oklch(
|
|
277
|
-
oklch(
|
|
278
|
-
oklch(
|
|
279
|
-
oklch(
|
|
366
|
+
oklch(from var(--border) l c h / 0.3) 10%,
|
|
367
|
+
oklch(from var(--border) l c h / 0.5) 30%,
|
|
368
|
+
oklch(from var(--border) l c h / 0.7) 50%,
|
|
369
|
+
oklch(from var(--border) l c h / 0.5) 70%,
|
|
370
|
+
oklch(from var(--border) l c h / 0.3) 90%,
|
|
280
371
|
transparent 100%
|
|
281
372
|
);
|
|
282
373
|
box-shadow:
|
|
283
|
-
0 0 20px 2px oklch(
|
|
284
|
-
0 0 40px 4px oklch(
|
|
374
|
+
0 0 20px 2px oklch(from var(--border) l c h / 0.2),
|
|
375
|
+
0 0 40px 4px oklch(from var(--border) l c h / 0.1);
|
|
285
376
|
}
|
|
286
377
|
|
|
287
378
|
/* ============================================================================
|
|
@@ -292,7 +383,7 @@
|
|
|
292
383
|
[data-rk] [role='dialog'] > div {
|
|
293
384
|
backdrop-filter: blur(200px) saturate(2) contrast(1.1);
|
|
294
385
|
-webkit-backdrop-filter: blur(200px) saturate(2) contrast(1.1);
|
|
295
|
-
background-color: oklch(
|
|
386
|
+
background-color: oklch(from var(--card) l c h / 0.82);
|
|
296
387
|
border-radius: 1rem;
|
|
297
388
|
box-shadow:
|
|
298
389
|
0 8px 32px rgba(0, 0, 0, 0.18),
|
|
@@ -302,7 +393,7 @@
|
|
|
302
393
|
}
|
|
303
394
|
|
|
304
395
|
.dark [data-rk] [role='dialog'] > div {
|
|
305
|
-
background-color: oklch(
|
|
396
|
+
background-color: oklch(from var(--card) l c h / 0.82);
|
|
306
397
|
box-shadow:
|
|
307
398
|
0 8px 32px rgba(0, 0, 0, 0.35),
|
|
308
399
|
0 0 0 1px rgba(255, 255, 255, 0.15),
|
|
@@ -321,7 +412,7 @@
|
|
|
321
412
|
border: none !important;
|
|
322
413
|
backdrop-filter: blur(200px) saturate(2) contrast(1.1) !important;
|
|
323
414
|
-webkit-backdrop-filter: blur(200px) saturate(2) contrast(1.1) !important;
|
|
324
|
-
background-color: oklch(
|
|
415
|
+
background-color: oklch(from var(--card) l c h / 0.85) !important;
|
|
325
416
|
box-shadow:
|
|
326
417
|
0 8px 32px rgba(0, 0, 0, 0.18),
|
|
327
418
|
0 0 0 1px rgba(255, 255, 255, 0.4),
|
|
@@ -332,7 +423,7 @@
|
|
|
332
423
|
}
|
|
333
424
|
|
|
334
425
|
.dark [data-sonner-toaster] [data-sonner-toast].liquid-glass {
|
|
335
|
-
background-color: oklch(
|
|
426
|
+
background-color: oklch(from var(--card) l c h / 0.85) !important;
|
|
336
427
|
box-shadow:
|
|
337
428
|
0 8px 32px rgba(0, 0, 0, 0.35),
|
|
338
429
|
0 0 0 1px rgba(255, 255, 255, 0.15),
|
|
@@ -384,21 +475,21 @@
|
|
|
384
475
|
[data-sonner-toaster] [data-sonner-toast].liquid-glass [data-title] {
|
|
385
476
|
position: relative !important;
|
|
386
477
|
z-index: 2 !important;
|
|
387
|
-
color:
|
|
478
|
+
color: var(--foreground) !important;
|
|
388
479
|
}
|
|
389
480
|
|
|
390
481
|
[data-sonner-toaster] [data-sonner-toast].liquid-glass [data-description] {
|
|
391
482
|
position: relative !important;
|
|
392
483
|
z-index: 2 !important;
|
|
393
|
-
color:
|
|
484
|
+
color: var(--muted-foreground) !important;
|
|
394
485
|
}
|
|
395
486
|
|
|
396
487
|
.dark [data-sonner-toaster] [data-sonner-toast].liquid-glass [data-title] {
|
|
397
|
-
color:
|
|
488
|
+
color: var(--foreground) !important;
|
|
398
489
|
}
|
|
399
490
|
|
|
400
491
|
.dark [data-sonner-toaster] [data-sonner-toast].liquid-glass [data-description] {
|
|
401
|
-
color:
|
|
492
|
+
color: var(--muted-foreground) !important;
|
|
402
493
|
}
|
|
403
494
|
|
|
404
495
|
/* Toast icon container - ensure above refraction */
|
|
@@ -418,12 +509,12 @@
|
|
|
418
509
|
position: relative !important;
|
|
419
510
|
z-index: 2 !important;
|
|
420
511
|
backdrop-filter: blur(20px) !important;
|
|
421
|
-
background-color: oklch(
|
|
512
|
+
background-color: oklch(from var(--secondary) l c h / 0.5) !important;
|
|
422
513
|
border: 1px solid rgba(255, 255, 255, 0.3) !important;
|
|
423
514
|
}
|
|
424
515
|
|
|
425
516
|
.dark [data-sonner-toaster] [data-sonner-toast].liquid-glass [data-button] {
|
|
426
|
-
background-color: oklch(
|
|
517
|
+
background-color: oklch(from var(--secondary) l c h / 0.5) !important;
|
|
427
518
|
border: 1px solid rgba(255, 255, 255, 0.1) !important;
|
|
428
519
|
}
|
|
429
520
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Props for AudioVisualizer component
|
|
3
|
+
*/
|
|
4
|
+
export interface AudioVisualizerProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description Whether recording is active
|
|
7
|
+
*/
|
|
8
|
+
isRecording: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @description MediaRecorder instance for audio analysis
|
|
11
|
+
*/
|
|
12
|
+
mediaRecorder: MediaRecorder | null;
|
|
13
|
+
/**
|
|
14
|
+
* @description Canvas width in pixels
|
|
15
|
+
* @default 280
|
|
16
|
+
*/
|
|
17
|
+
width?: number;
|
|
18
|
+
/**
|
|
19
|
+
* @description Canvas height in pixels
|
|
20
|
+
* @default 60
|
|
21
|
+
*/
|
|
22
|
+
height?: number;
|
|
23
|
+
/**
|
|
24
|
+
* @description Bar color when recording
|
|
25
|
+
* @default '#a78bfa'
|
|
26
|
+
*/
|
|
27
|
+
barColor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* @description Width of each bar in pixels
|
|
30
|
+
* @default 3
|
|
31
|
+
*/
|
|
32
|
+
barWidth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* @description Gap between bars in pixels
|
|
35
|
+
* @default 2
|
|
36
|
+
*/
|
|
37
|
+
gap?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @description Audio visualizer component that displays waveform during recording
|
|
41
|
+
* @example
|
|
42
|
+
* <AudioVisualizer
|
|
43
|
+
* isRecording={isRecording}
|
|
44
|
+
* mediaRecorder={mediaRecorder}
|
|
45
|
+
* barColor="#a78bfa"
|
|
46
|
+
* />
|
|
47
|
+
*/
|
|
48
|
+
export declare function AudioVisualizer({ isRecording, mediaRecorder, width, height, barColor, barWidth, gap, }: AudioVisualizerProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
//# sourceMappingURL=audio-visualizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-visualizer.d.ts","sourceRoot":"","sources":["../../../../src/client/components/audio-visualizer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,aAAa,EACb,KAAW,EACX,MAAW,EACX,QAAoB,EACpB,QAAY,EACZ,GAAO,GACR,EAAE,oBAAoB,2CAyGtB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AIFormMessage } from 'tanstack-effect';
|
|
2
|
+
/**
|
|
3
|
+
* @description Props for ChatView component
|
|
4
|
+
*/
|
|
5
|
+
export interface ChatViewProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description Messages in the conversation
|
|
8
|
+
*/
|
|
9
|
+
messages: AIFormMessage[];
|
|
10
|
+
/**
|
|
11
|
+
* @description Current status of AI
|
|
12
|
+
*/
|
|
13
|
+
status: 'idle' | 'filling' | 'clarifying' | 'complete' | 'error';
|
|
14
|
+
/**
|
|
15
|
+
* @description Callback to send a message
|
|
16
|
+
*/
|
|
17
|
+
onSend: (message: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* @description Optional className for container
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
/**
|
|
23
|
+
* @description Placeholder text for input
|
|
24
|
+
*/
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/**
|
|
27
|
+
* @description Enable voice input (requires OPENAI_API_KEY on server)
|
|
28
|
+
* Developer must explicitly enable this when they've configured the API key
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
enableVoice?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description Custom endpoint for speech-to-text API
|
|
34
|
+
* @default '/api/speech-to-text'
|
|
35
|
+
*/
|
|
36
|
+
voiceEndpoint?: string;
|
|
37
|
+
/**
|
|
38
|
+
* @description Maximum height for the messages container
|
|
39
|
+
* When reached, the container will scroll
|
|
40
|
+
* @example '400px', '50vh'
|
|
41
|
+
*/
|
|
42
|
+
maxHeight?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @description Full chat UI for AI form filling with optional voice input
|
|
46
|
+
* @example
|
|
47
|
+
* <ChatView
|
|
48
|
+
* messages={messages}
|
|
49
|
+
* status={status}
|
|
50
|
+
* onSend={handleSend}
|
|
51
|
+
* enableVoice={true} // Enable when OPENAI_API_KEY is configured
|
|
52
|
+
* />
|
|
53
|
+
*/
|
|
54
|
+
export declare function ChatView({ messages, status, onSend, className, placeholder, enableVoice, voiceEndpoint, maxHeight, }: ChatViewProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
//# sourceMappingURL=chat-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-view.d.ts","sourceRoot":"","sources":["../../../../src/client/components/chat-view.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AASpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAA;IAChE;;OAEG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA6HD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,EACT,WAAoD,EACpD,WAAmB,EACnB,aAAqC,EACrC,SAAS,GACV,EAAE,aAAa,2CAyPf"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import type { FormBuilderProps, FormFieldDefinition, FormFieldProps as BaseFormFieldProps, NestedFormProps, UseSchemaFormReturn } from 'tanstack-effect';
|
|
2
|
+
/**
|
|
3
|
+
* Field metadata returned by the resolver
|
|
4
|
+
*/
|
|
5
|
+
export interface FieldMeta {
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Field metadata resolver function type.
|
|
11
|
+
* Used to dynamically resolve field labels and descriptions based on field path.
|
|
12
|
+
* Common use cases: i18n translations, dynamic labels, context-aware descriptions.
|
|
13
|
+
*/
|
|
14
|
+
export type FieldMetaResolver = (fieldPath: string) => FieldMeta | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Form builder variants for different display densities
|
|
17
|
+
* - default: Standard spacing and all features visible
|
|
18
|
+
* - compact: Reduced spacing, sections collapsed by default, smaller text
|
|
19
|
+
* - wizard: Step-by-step mode showing one section at a time with navigation
|
|
20
|
+
*/
|
|
21
|
+
export type FormBuilderVariant = 'default' | 'compact' | 'wizard';
|
|
22
|
+
/**
|
|
23
|
+
* Extended FormFieldProps with optional overrides
|
|
24
|
+
*/
|
|
25
|
+
export interface FormFieldProps extends BaseFormFieldProps {
|
|
26
|
+
/**
|
|
27
|
+
* Optional custom options to override field.literalOptions.
|
|
28
|
+
* Use this when you need to dynamically provide options based on context (e.g., chain).
|
|
29
|
+
* When provided, this will be used instead of field.literalOptions for select fields.
|
|
30
|
+
* @example
|
|
31
|
+
* // Chain-specific paired token options
|
|
32
|
+
* options={['ETH', 'USDC', 'DAI']}
|
|
33
|
+
*/
|
|
34
|
+
options?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Optional label override. When provided, this will be used instead of field.label.
|
|
37
|
+
*/
|
|
38
|
+
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional description override. When provided, this will be used instead of field.description.
|
|
41
|
+
*/
|
|
42
|
+
description?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional field metadata resolver. When provided, this will be called with the field path
|
|
45
|
+
* to get label and description. Used for nested fields in FormSection.
|
|
46
|
+
* @example
|
|
47
|
+
* // i18n translation resolver
|
|
48
|
+
* getFieldMeta={(path) => ({ label: t(`fields.${path}.label`), description: t(`fields.${path}.description`) })}
|
|
49
|
+
*/
|
|
50
|
+
getFieldMeta?: FieldMetaResolver;
|
|
51
|
+
/**
|
|
52
|
+
* Full form data for evaluating conditional requirements (requiredWhen).
|
|
53
|
+
* When provided, enables dynamic required indicator based on other field values.
|
|
54
|
+
*/
|
|
55
|
+
formData?: any;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Individual form field component
|
|
59
|
+
*/
|
|
60
|
+
export declare function FormField({ field, value, onChange, error, minimal, options: customOptions, label: labelOverride, description: descriptionOverride, getFieldMeta, formData, }: FormFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to check if a form is valid (including root-level errors)
|
|
63
|
+
* This should be used instead of Object.keys(form.validationErrors).length === 0
|
|
64
|
+
* Also checks for conditionally required fields (requiredWhen) that are missing
|
|
65
|
+
*/
|
|
66
|
+
export declare function isFormValid<T = any>(form: UseSchemaFormReturn<T>): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Form validation status alert component
|
|
69
|
+
*/
|
|
70
|
+
export interface FormValidationAlertProps<T = any> {
|
|
71
|
+
form: UseSchemaFormReturn<T>;
|
|
72
|
+
requiredFields?: Array<{
|
|
73
|
+
key: string;
|
|
74
|
+
label: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
export declare function FormValidationAlert<T = any>({ form, requiredFields, }: FormValidationAlertProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
/**
|
|
79
|
+
* Create default item for array fields
|
|
80
|
+
*/
|
|
81
|
+
export declare function createDefaultItem(children: Record<string, any>): any;
|
|
82
|
+
/**
|
|
83
|
+
* Props for DiscriminatedUnionSection
|
|
84
|
+
*/
|
|
85
|
+
export interface DiscriminatedUnionSectionProps {
|
|
86
|
+
field: FormFieldDefinition;
|
|
87
|
+
form: UseSchemaFormReturn<any>;
|
|
88
|
+
minimal?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Base path for the union (e.g., "fees")
|
|
91
|
+
*/
|
|
92
|
+
basePath?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Optional label override
|
|
95
|
+
*/
|
|
96
|
+
label?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Optional description override
|
|
99
|
+
*/
|
|
100
|
+
description?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Optional field metadata resolver function
|
|
103
|
+
*/
|
|
104
|
+
getFieldMeta?: FieldMetaResolver;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Discriminated union section component
|
|
108
|
+
*/
|
|
109
|
+
export declare function DiscriminatedUnionSection({ field, form, minimal, basePath, label: labelOverride, description: descriptionOverride, getFieldMeta, }: DiscriminatedUnionSectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
110
|
+
/**
|
|
111
|
+
* Extended NestedFormProps with optional label and description overrides
|
|
112
|
+
*/
|
|
113
|
+
export interface FormSectionProps<T = unknown> extends NestedFormProps<T> {
|
|
114
|
+
/**
|
|
115
|
+
* Optional label override. When provided, this will be used instead of field.label.
|
|
116
|
+
*/
|
|
117
|
+
label?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Optional description override. When provided, this will be used instead of field.description.
|
|
120
|
+
*/
|
|
121
|
+
description?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Optional field metadata resolver. When provided, this will be called with the field path
|
|
124
|
+
* to get label and description for nested fields.
|
|
125
|
+
*/
|
|
126
|
+
getFieldMeta?: FieldMetaResolver;
|
|
127
|
+
/**
|
|
128
|
+
* Display variant for the section
|
|
129
|
+
*/
|
|
130
|
+
variant?: FormBuilderVariant;
|
|
131
|
+
/**
|
|
132
|
+
* If true, renders content without Card wrapper (flat mode)
|
|
133
|
+
*/
|
|
134
|
+
flat?: boolean;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Recursive form section component for objects and arrays
|
|
138
|
+
*/
|
|
139
|
+
export declare function FormSection<T = unknown>({ field, form, basePath, level, initialCollapsed, minimal, label: labelOverride, description: descriptionOverride, getFieldMeta, variant, flat, }: FormSectionProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
140
|
+
/**
|
|
141
|
+
* Form builder mode for AI or Edit
|
|
142
|
+
*/
|
|
143
|
+
export type FormBuilderMode = 'ai' | 'edit';
|
|
144
|
+
/**
|
|
145
|
+
* Extended form builder props with variant support
|
|
146
|
+
*/
|
|
147
|
+
export interface ExtendedFormBuilderProps<T = any> extends FormBuilderProps<T> {
|
|
148
|
+
/**
|
|
149
|
+
* Display variant for the form
|
|
150
|
+
* - default: Standard spacing and all features visible
|
|
151
|
+
* - compact: Reduced spacing, sections collapsed by default, smaller text
|
|
152
|
+
* - wizard: Step-by-step mode showing one section at a time
|
|
153
|
+
*/
|
|
154
|
+
variant?: FormBuilderVariant;
|
|
155
|
+
/**
|
|
156
|
+
* Whether all sections should be collapsed by default
|
|
157
|
+
* Overrides variant defaults when specified
|
|
158
|
+
*/
|
|
159
|
+
sectionsCollapsed?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Field keys to pin at the top level (shown above wizard steps or at the top of the form)
|
|
162
|
+
* Useful for fields like "isActive" that should be visible on all steps
|
|
163
|
+
*/
|
|
164
|
+
pinnedFields?: string[];
|
|
165
|
+
/**
|
|
166
|
+
* Field keys to hide from the form entirely
|
|
167
|
+
* Useful for fields that are set programmatically and shouldn't be user-editable
|
|
168
|
+
*/
|
|
169
|
+
hiddenFields?: string[];
|
|
170
|
+
/**
|
|
171
|
+
* Enable AI mode toggle. When true, shows AI/Edit mode switcher.
|
|
172
|
+
* Requires form.ai to be configured in useSchemaForm.
|
|
173
|
+
*/
|
|
174
|
+
enableAIMode?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Initial mode when AI is enabled
|
|
177
|
+
* @default 'ai'
|
|
178
|
+
*/
|
|
179
|
+
initialMode?: FormBuilderMode;
|
|
180
|
+
/**
|
|
181
|
+
* Placeholder for AI chat input
|
|
182
|
+
*/
|
|
183
|
+
aiPlaceholder?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Minimum height for the chat view in AI mode
|
|
186
|
+
* @default '300px'
|
|
187
|
+
*/
|
|
188
|
+
aiChatMinHeight?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Maximum height for the chat view in AI mode
|
|
191
|
+
* When reached, the chat will scroll
|
|
192
|
+
* @example '400px', '50vh'
|
|
193
|
+
*/
|
|
194
|
+
aiChatMaxHeight?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Enable voice input in AI chat (requires OPENAI_API_KEY on server)
|
|
197
|
+
* Developer must explicitly enable this when the API key is configured
|
|
198
|
+
* @default false
|
|
199
|
+
*/
|
|
200
|
+
enableVoice?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Custom endpoint for speech-to-text API
|
|
203
|
+
* @default '/api/speech-to-text'
|
|
204
|
+
*/
|
|
205
|
+
voiceEndpoint?: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Main form builder component
|
|
209
|
+
*/
|
|
210
|
+
export declare function FormBuilder<T = any>({ form, className, title, collapsible, initialCollapsed, variant, sectionsCollapsed, pinnedFields, hiddenFields, enableAIMode, initialMode, aiPlaceholder, aiChatMinHeight, aiChatMaxHeight, enableVoice, voiceEndpoint, }: ExtendedFormBuilderProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
211
|
+
//# sourceMappingURL=form-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-builder.d.ts","sourceRoot":"","sources":["../../../../src/client/components/form-builder.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,IAAI,kBAAkB,EACpC,eAAe,EACf,mBAAmB,EACpB,MAAM,iBAAiB,CAAA;AAKxB;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AA4BD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,KA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EG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IAC5E;;;;;OAKG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,EACnC,IAAI,EACJ,SAAS,EACT,KAAK,EACL,WAAmB,EACnB,gBAAwB,EACxB,OAAmB,EACnB,iBAAiB,EACjB,YAAiB,EACjB,YAAiB,EACjB,YAAoB,EACpB,WAAkB,EAClB,aAAa,EACb,eAAyB,EACzB,eAAe,EACf,WAAmB,EACnB,aAAa,GACd,EAAE,wBAAwB,CAAC,CAAC,CAAC,kDAgU7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,MAAM,CAAA"}
|