@foisit/vue-wrapper 2.4.5 → 3.1.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/README.md +63 -4
- package/index.d.ts +1 -0
- package/index.mjs +636 -398
- package/lib/services/AssistantService.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Transform your Vue app into an intelligent, voice-ready platform. Foisit provide
|
|
|
33
33
|
- **Programmatic UI Triggers** - Direct command execution via `runCommand()`
|
|
34
34
|
- **Rich Markdown Rendering** - Enhanced response formatting with headings, code, and links
|
|
35
35
|
- **Advanced File Validations** - Comprehensive client-side file validation with size, type, and dimension checks
|
|
36
|
-
- **Premium UI** -
|
|
36
|
+
- **Premium UI** - Glass or solid theme with dark/light mode support
|
|
37
37
|
- **Zero Backend Required** - Secure proxy architecture keeps API keys server-side
|
|
38
38
|
- **Vue Native** - Uses Composition API, `provide/inject`, and Vue 3 patterns
|
|
39
39
|
- **Type-Safe** - Full TypeScript support with comprehensive types
|
|
@@ -131,9 +131,9 @@ Define parameters and Foisit will automatically generate forms to collect them:
|
|
|
131
131
|
command: 'create user',
|
|
132
132
|
description: 'Create a new user account',
|
|
133
133
|
parameters: [
|
|
134
|
-
{ name: 'username', type: 'string', required: true },
|
|
135
|
-
{ name: 'email', type: 'string', required: true },
|
|
136
|
-
{ name: 'age', type: 'number', required: false }
|
|
134
|
+
{ name: 'username', label: 'Username', type: 'string', required: true },
|
|
135
|
+
{ name: 'email', label: 'Email address', type: 'string', required: true },
|
|
136
|
+
{ name: 'age', label: 'Age', type: 'number', required: false }
|
|
137
137
|
],
|
|
138
138
|
action: (params) => userService.create(params)
|
|
139
139
|
}
|
|
@@ -167,10 +167,18 @@ Example:
|
|
|
167
167
|
- `number` - Numeric input
|
|
168
168
|
- `date` - Date picker
|
|
169
169
|
- `select` - Dropdown (static or async options)
|
|
170
|
+
- **new:** set `multiple: true` on a `select` parameter to allow picking several values; the result is sent as an array.
|
|
170
171
|
- `file` - File upload input
|
|
171
172
|
|
|
173
|
+
**Field label text**
|
|
174
|
+
|
|
175
|
+
- By default, the form label uses `description` (or falls back to `name`).
|
|
176
|
+
- Set `label` on a parameter when you want explicit, user-friendly label text.
|
|
177
|
+
|
|
172
178
|
### 3. File Parameters
|
|
173
179
|
|
|
180
|
+
> **Tip:** to present users with multiple pill‑style options and let them pick more than one, use the `select` parameter with `multiple: true` or call `overlayManager.addOptions(..., { allowMultiple: true })` in custom integrations. The overlay now supports multi‑choice behaviour via either method.
|
|
181
|
+
|
|
174
182
|
Collect files via the built-in form UI and receive them in your command `action`.
|
|
175
183
|
|
|
176
184
|
```javascript
|
|
@@ -454,9 +462,60 @@ interface AssistantConfig {
|
|
|
454
462
|
customHtml?: string;
|
|
455
463
|
position?: { bottom: string; right: string };
|
|
456
464
|
};
|
|
465
|
+
|
|
466
|
+
// Theme mode: 'glass' (default) or 'solid'
|
|
467
|
+
theme?: 'glass' | 'solid';
|
|
468
|
+
|
|
469
|
+
// Custom colors for solid theme (ignored in glass mode)
|
|
470
|
+
themeColors?: ThemeColors;
|
|
471
|
+
}
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### `ThemeColors`
|
|
475
|
+
|
|
476
|
+
Custom colors for solid theme mode:
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
interface ThemeColors {
|
|
480
|
+
background?: string; // Background color (e.g., '#1e1e2e')
|
|
481
|
+
text?: string; // Primary text color (e.g., '#ffffff')
|
|
482
|
+
accent?: string; // Accent color for highlights (e.g., '#89b4fa' or a gradient)
|
|
483
|
+
userBubbleBg?: string; // User message bubble background
|
|
484
|
+
systemBubbleBg?: string; // System message bubble background
|
|
485
|
+
border?: string; // Border color
|
|
486
|
+
checkboxAccent?: string; // Checkbox accent color
|
|
487
|
+
checkboxBorder?: string; // Checkbox border color
|
|
488
|
+
checkboxCheck?: string; // Checkbox checkmark color
|
|
457
489
|
}
|
|
458
490
|
```
|
|
459
491
|
|
|
492
|
+
### Theme Customization Example
|
|
493
|
+
|
|
494
|
+
```vue
|
|
495
|
+
<script setup>
|
|
496
|
+
const config = {
|
|
497
|
+
commands: [...],
|
|
498
|
+
// Use solid theme with custom colors
|
|
499
|
+
theme: 'solid',
|
|
500
|
+
themeColors: {
|
|
501
|
+
background: '#1e1e2e',
|
|
502
|
+
text: '#cdd6f4',
|
|
503
|
+
accent: '#89b4fa',
|
|
504
|
+
userBubbleBg: 'rgba(137, 180, 250, 0.2)',
|
|
505
|
+
systemBubbleBg: 'rgba(255, 255, 255, 0.05)',
|
|
506
|
+
},
|
|
507
|
+
};
|
|
508
|
+
</script>
|
|
509
|
+
|
|
510
|
+
<template>
|
|
511
|
+
<AssistantProvider :config="config">
|
|
512
|
+
<App />
|
|
513
|
+
</AssistantProvider>
|
|
514
|
+
</template>
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
> **Note**: Glass theme (default) uses glassmorphism with blur effects and adapts to light/dark mode via `prefers-color-scheme`. Solid theme ignores system preferences and uses configured colors.
|
|
518
|
+
|
|
460
519
|
---
|
|
461
520
|
|
|
462
521
|
## Advanced Usage
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as AssistantProvider } from './lib/components/AssistantProvider.vue';
|
|
2
2
|
export { useAssistant } from './lib/composables/useAssistant';
|
|
3
3
|
export { AssistantService } from './lib/services/AssistantService';
|
|
4
|
+
export type { ThemeColors } from '../../core/src/index.ts';
|