@utilia-os/widget 1.0.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 +143 -0
- package/dist/components/audio-recorder.d.ts +66 -0
- package/dist/components/audio-recorder.d.ts.map +1 -0
- package/dist/components/file-upload.d.ts +42 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/ticket-detail.d.ts +27 -0
- package/dist/components/ticket-detail.d.ts.map +1 -0
- package/dist/components/ticket-form.d.ts +51 -0
- package/dist/components/ticket-form.d.ts.map +1 -0
- package/dist/components/ticket-list.d.ts +19 -0
- package/dist/components/ticket-list.d.ts.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/styles/base.d.ts +6 -0
- package/dist/styles/base.d.ts.map +1 -0
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utilia-widget.esm.js +5936 -0
- package/dist/utilia-widget.esm.js.map +1 -0
- package/dist/utilia-widget.js +2 -0
- package/dist/utilia-widget.js.map +1 -0
- package/dist/utils/sanitize.d.ts +21 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/widget.d.ts +43 -0
- package/dist/widget.d.ts.map +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# @utilia-os/widget
|
|
2
|
+
|
|
3
|
+
Widget embebible de soporte para UTILIA OS.
|
|
4
|
+
|
|
5
|
+
## Instalacion via CDN
|
|
6
|
+
|
|
7
|
+
La forma mas simple de usar el widget:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<script
|
|
11
|
+
src="https://cdn.utilia.ai/widget/utilia-widget.js"
|
|
12
|
+
data-utilia-widget
|
|
13
|
+
data-base-url="https://os.utilia.ai/api"
|
|
14
|
+
data-api-key="tu-api-key"
|
|
15
|
+
data-user-id="user-123"
|
|
16
|
+
data-user-email="user@example.com"
|
|
17
|
+
data-user-name="Juan Perez"
|
|
18
|
+
data-position="bottom-right"
|
|
19
|
+
data-theme="light"
|
|
20
|
+
></script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Instalacion via NPM
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @utilia-os/widget
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Uso Programatico
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { initUtiliaWidget } from '@utilia-os/widget';
|
|
33
|
+
|
|
34
|
+
const widget = initUtiliaWidget({
|
|
35
|
+
baseURL: 'https://os.utilia.ai/api',
|
|
36
|
+
apiKey: 'tu-api-key',
|
|
37
|
+
userId: 'user-123',
|
|
38
|
+
userEmail: 'user@example.com',
|
|
39
|
+
userName: 'Juan Perez',
|
|
40
|
+
position: 'bottom-right',
|
|
41
|
+
theme: 'light',
|
|
42
|
+
autoContext: true,
|
|
43
|
+
onTicketCreated: (ticket) => {
|
|
44
|
+
console.log('Ticket creado:', ticket.ticketKey);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Metodos disponibles
|
|
49
|
+
widget.open();
|
|
50
|
+
widget.close();
|
|
51
|
+
widget.showNewTicketForm();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Uso como Web Component
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<utilia-support
|
|
58
|
+
base-url="https://os.utilia.ai/api"
|
|
59
|
+
api-key="tu-api-key"
|
|
60
|
+
user-id="user-123"
|
|
61
|
+
user-email="user@example.com"
|
|
62
|
+
user-name="Juan Perez"
|
|
63
|
+
position="bottom-right"
|
|
64
|
+
theme="light"
|
|
65
|
+
></utilia-support>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Configuracion
|
|
69
|
+
|
|
70
|
+
| Opcion | Tipo | Requerido | Descripcion |
|
|
71
|
+
|--------|------|-----------|-------------|
|
|
72
|
+
| `baseURL` | string | Si | URL base de la API de UTILIA OS |
|
|
73
|
+
| `apiKey` | string | Si | API Key de la aplicacion externa |
|
|
74
|
+
| `userId` | string | Si | ID del usuario en tu sistema |
|
|
75
|
+
| `userEmail` | string | No | Email del usuario |
|
|
76
|
+
| `userName` | string | No | Nombre del usuario |
|
|
77
|
+
| `userMetadata` | object | No | Metadatos adicionales |
|
|
78
|
+
| `position` | 'bottom-right' \| 'bottom-left' | No | Posicion del widget (default: bottom-right) |
|
|
79
|
+
| `theme` | 'light' \| 'dark' \| 'auto' | No | Tema del widget (default: light) |
|
|
80
|
+
| `defaultCategory` | string | No | Categoria por defecto para nuevos tickets |
|
|
81
|
+
| `defaultPriority` | string | No | Prioridad por defecto para nuevos tickets |
|
|
82
|
+
| `autoContext` | boolean | No | Capturar URL y browser info automaticamente |
|
|
83
|
+
| `onTicketCreated` | function | No | Callback cuando se crea un ticket |
|
|
84
|
+
| `onError` | function | No | Callback cuando ocurre un error |
|
|
85
|
+
|
|
86
|
+
## Personalizacion de Estilos
|
|
87
|
+
|
|
88
|
+
El widget usa CSS Custom Properties que puedes sobrescribir:
|
|
89
|
+
|
|
90
|
+
```css
|
|
91
|
+
utilia-support {
|
|
92
|
+
--utilia-primary: #tu-color-principal;
|
|
93
|
+
--utilia-primary-hover: #tu-color-hover;
|
|
94
|
+
--utilia-bg: #ffffff;
|
|
95
|
+
--utilia-bg-secondary: #f8fafc;
|
|
96
|
+
--utilia-text: #1e293b;
|
|
97
|
+
--utilia-text-secondary: #64748b;
|
|
98
|
+
--utilia-border: #e2e8f0;
|
|
99
|
+
--utilia-radius: 12px;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Variables Disponibles
|
|
104
|
+
|
|
105
|
+
| Variable | Default (light) | Descripcion |
|
|
106
|
+
|----------|-----------------|-------------|
|
|
107
|
+
| `--utilia-primary` | #2563eb | Color principal |
|
|
108
|
+
| `--utilia-primary-hover` | #1d4ed8 | Color principal en hover |
|
|
109
|
+
| `--utilia-bg` | #ffffff | Fondo principal |
|
|
110
|
+
| `--utilia-bg-secondary` | #f8fafc | Fondo secundario |
|
|
111
|
+
| `--utilia-text` | #1e293b | Color de texto |
|
|
112
|
+
| `--utilia-text-secondary` | #64748b | Color de texto secundario |
|
|
113
|
+
| `--utilia-border` | #e2e8f0 | Color de bordes |
|
|
114
|
+
| `--utilia-radius` | 12px | Radio de bordes |
|
|
115
|
+
| `--utilia-shadow` | ... | Sombra normal |
|
|
116
|
+
| `--utilia-shadow-lg` | ... | Sombra grande |
|
|
117
|
+
|
|
118
|
+
## Eventos
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
const widget = document.querySelector('utilia-support');
|
|
122
|
+
|
|
123
|
+
widget.addEventListener('widget:open', () => {
|
|
124
|
+
console.log('Widget abierto');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
widget.addEventListener('widget:close', () => {
|
|
128
|
+
console.log('Widget cerrado');
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
widget.addEventListener('ticket:created', (e) => {
|
|
132
|
+
console.log('Ticket creado:', e.detail.ticketKey);
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Requisitos
|
|
137
|
+
|
|
138
|
+
- Navegador moderno con soporte para Web Components
|
|
139
|
+
- API Key valida de UTILIA OS
|
|
140
|
+
|
|
141
|
+
## Licencia
|
|
142
|
+
|
|
143
|
+
MIT
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Componente de grabacion de audio
|
|
3
|
+
* Usa MediaRecorder API para capturar audio del microfono
|
|
4
|
+
*/
|
|
5
|
+
export type RecorderState = 'idle' | 'recording' | 'processing';
|
|
6
|
+
export interface AudioRecorderCallbacks {
|
|
7
|
+
onStateChange?: (state: RecorderState) => void;
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare class AudioRecorder {
|
|
11
|
+
private mediaRecorder;
|
|
12
|
+
private audioChunks;
|
|
13
|
+
private stream;
|
|
14
|
+
private state;
|
|
15
|
+
private callbacks;
|
|
16
|
+
constructor(callbacks?: AudioRecorderCallbacks);
|
|
17
|
+
/**
|
|
18
|
+
* Verifica si el navegador soporta grabacion de audio
|
|
19
|
+
*/
|
|
20
|
+
static isSupported(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Obtiene el estado actual del grabador
|
|
23
|
+
*/
|
|
24
|
+
getState(): RecorderState;
|
|
25
|
+
/**
|
|
26
|
+
* Inicia la grabacion de audio
|
|
27
|
+
*/
|
|
28
|
+
start(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Detiene la grabacion y retorna el audio en base64
|
|
31
|
+
*/
|
|
32
|
+
stop(): Promise<{
|
|
33
|
+
base64: string;
|
|
34
|
+
filename: string;
|
|
35
|
+
mimeType: string;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Cancela la grabacion actual
|
|
39
|
+
*/
|
|
40
|
+
cancel(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Convierte un Blob a base64
|
|
43
|
+
*/
|
|
44
|
+
private blobToBase64;
|
|
45
|
+
/**
|
|
46
|
+
* Obtiene el MIME type soportado por el navegador
|
|
47
|
+
*/
|
|
48
|
+
private getSupportedMimeType;
|
|
49
|
+
/**
|
|
50
|
+
* Obtiene la extension de archivo segun el MIME type
|
|
51
|
+
*/
|
|
52
|
+
private getExtensionFromMimeType;
|
|
53
|
+
/**
|
|
54
|
+
* Actualiza el estado y notifica
|
|
55
|
+
*/
|
|
56
|
+
private setState;
|
|
57
|
+
/**
|
|
58
|
+
* Maneja errores
|
|
59
|
+
*/
|
|
60
|
+
private handleError;
|
|
61
|
+
/**
|
|
62
|
+
* Limpia recursos
|
|
63
|
+
*/
|
|
64
|
+
private cleanup;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=audio-recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-recorder.d.ts","sourceRoot":"","sources":["../../src/components/audio-recorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,SAAS,CAAyB;gBAE9B,SAAS,GAAE,sBAA2B;IAIlD;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,OAAO;IAS7B;;OAEG;IACH,QAAQ,IAAI,aAAa;IAIzB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkD5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAwC7E;;OAEG;IACH,MAAM,IAAI,IAAI;IAQd;;OAEG;IACH,OAAO,CAAC,YAAY;IAcpB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAkB5B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAOhC;;OAEG;IACH,OAAO,CAAC,QAAQ;IAKhB;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACH,OAAO,CAAC,OAAO;CAUhB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UtiliaSDK, UploadedFile } from '@utilia-os/sdk-js';
|
|
2
|
+
export interface FileUploadState {
|
|
3
|
+
files: UploadedFile[];
|
|
4
|
+
pendingFiles: PendingFile[];
|
|
5
|
+
error: string | null;
|
|
6
|
+
}
|
|
7
|
+
interface PendingFile {
|
|
8
|
+
id: string;
|
|
9
|
+
file: File;
|
|
10
|
+
progress: number;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class FileUploadComponent {
|
|
14
|
+
private container;
|
|
15
|
+
private sdk;
|
|
16
|
+
private state;
|
|
17
|
+
private onChange;
|
|
18
|
+
private maxFiles;
|
|
19
|
+
private maxSizeBytes;
|
|
20
|
+
private readonly ALLOWED_TYPES;
|
|
21
|
+
constructor(container: HTMLElement, sdk: UtiliaSDK, onChange: (fileIds: string[]) => void, options?: {
|
|
22
|
+
maxFiles?: number;
|
|
23
|
+
maxSizeBytes?: number;
|
|
24
|
+
});
|
|
25
|
+
getFileIds(): string[];
|
|
26
|
+
reset(): void;
|
|
27
|
+
private render;
|
|
28
|
+
private createFileItem;
|
|
29
|
+
private createPendingItem;
|
|
30
|
+
private createUploadIcon;
|
|
31
|
+
private handleDragOver;
|
|
32
|
+
private handleDragLeave;
|
|
33
|
+
private handleDrop;
|
|
34
|
+
private triggerFileSelect;
|
|
35
|
+
private handleFileSelect;
|
|
36
|
+
private processFiles;
|
|
37
|
+
private removeFile;
|
|
38
|
+
private notifyChange;
|
|
39
|
+
private formatBytes;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=file-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/components/file-upload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAS;IAG7B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAY5B;gBAGA,SAAS,EAAE,WAAW,EACtB,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,EACrC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IAexD,UAAU,IAAI,MAAM,EAAE;IAItB,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,MAAM;IAkEd,OAAO,CAAC,cAAc;IA8BtB,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,gBAAgB;IAgCxB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;YAQV,YAAY;IA0E1B,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UtiliaSDK } from '@utilia-os/sdk-js';
|
|
2
|
+
export declare class TicketDetailComponent {
|
|
3
|
+
private container;
|
|
4
|
+
private sdk;
|
|
5
|
+
private userId;
|
|
6
|
+
private ticketId;
|
|
7
|
+
private ticket;
|
|
8
|
+
private isLoading;
|
|
9
|
+
private isSending;
|
|
10
|
+
private error;
|
|
11
|
+
private fileUpload;
|
|
12
|
+
private attachmentIds;
|
|
13
|
+
constructor(container: HTMLElement, sdk: UtiliaSDK, userId: string, ticketId: string);
|
|
14
|
+
private loadTicket;
|
|
15
|
+
private render;
|
|
16
|
+
private renderLoading;
|
|
17
|
+
private renderError;
|
|
18
|
+
private renderTicketDetail;
|
|
19
|
+
private createHeader;
|
|
20
|
+
private createMessages;
|
|
21
|
+
private createMessage;
|
|
22
|
+
private createFileIcon;
|
|
23
|
+
private createReplyForm;
|
|
24
|
+
private handleSubmit;
|
|
25
|
+
private scrollToBottom;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ticket-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket-detail.d.ts","sourceRoot":"","sources":["../../src/components/ticket-detail.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAA+B,MAAM,mBAAmB,CAAC;AAIhF,qBAAa,qBAAqB;IAChC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,aAAa,CAAgB;gBAGnC,SAAS,EAAE,WAAW,EACtB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM;YASJ,UAAU;IAaxB,OAAO,CAAC,MAAM;IAgBd,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,cAAc;IA0BtB,OAAO,CAAC,aAAa;IAyDrB,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,eAAe;YAmCT,YAAY;IAkC1B,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { UtiliaSDK } from '@utilia-os/sdk-js';
|
|
2
|
+
import { WidgetConfig } from '../types';
|
|
3
|
+
export declare class TicketFormComponent {
|
|
4
|
+
private container;
|
|
5
|
+
private sdk;
|
|
6
|
+
private config;
|
|
7
|
+
private onSuccess;
|
|
8
|
+
private isSubmitting;
|
|
9
|
+
private error;
|
|
10
|
+
private audioRecorder;
|
|
11
|
+
private recorderState;
|
|
12
|
+
private isLoadingAi;
|
|
13
|
+
private aiProgress;
|
|
14
|
+
private aiError;
|
|
15
|
+
private pendingSuggestions;
|
|
16
|
+
private analyticsEventId;
|
|
17
|
+
private suggestionDecisions;
|
|
18
|
+
private suggestionsReceivedAt;
|
|
19
|
+
private aiTextInput;
|
|
20
|
+
private fileUpload;
|
|
21
|
+
private attachmentIds;
|
|
22
|
+
private titleInput;
|
|
23
|
+
private descriptionTextarea;
|
|
24
|
+
private categorySelect;
|
|
25
|
+
private prioritySelect;
|
|
26
|
+
constructor(container: HTMLElement, sdk: UtiliaSDK, config: WidgetConfig, onSuccess: (ticket: {
|
|
27
|
+
id: string;
|
|
28
|
+
ticketKey: string;
|
|
29
|
+
}) => void);
|
|
30
|
+
private render;
|
|
31
|
+
private createAiSection;
|
|
32
|
+
private updateRecordButtonContent;
|
|
33
|
+
private updateRecordButton;
|
|
34
|
+
private createMicrophoneIcon;
|
|
35
|
+
private handleRecordClick;
|
|
36
|
+
private processAudioWithAi;
|
|
37
|
+
private updateLoadingText;
|
|
38
|
+
private processTextWithAi;
|
|
39
|
+
private createCheckIcon;
|
|
40
|
+
private createXIcon;
|
|
41
|
+
private createSuggestionsReview;
|
|
42
|
+
private handleAcceptSuggestions;
|
|
43
|
+
private handleRejectAllSuggestions;
|
|
44
|
+
private applySuggestions;
|
|
45
|
+
private createFormGroup;
|
|
46
|
+
private createInput;
|
|
47
|
+
private createTextarea;
|
|
48
|
+
private createSelect;
|
|
49
|
+
private handleSubmit;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=ticket-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket-form.d.ts","sourceRoot":"","sources":["../../src/components/ticket-form.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAkC,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,SAAS,CAAsD;IACvE,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,KAAK,CAAuB;IAGpC,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,OAAO,CAAuB;IAGtC,OAAO,CAAC,kBAAkB,CAA2H;IACrJ,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,mBAAmB,CAA+C;IAC1E,OAAO,CAAC,qBAAqB,CAAa;IAC1C,OAAO,CAAC,WAAW,CAAc;IAGjC,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,aAAa,CAAgB;IAGrC,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,cAAc,CAAkC;gBAGtD,SAAS,EAAE,WAAW,EACtB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;IAwBhE,OAAO,CAAC,MAAM;IAsGd,OAAO,CAAC,eAAe;IAmGvB,OAAO,CAAC,yBAAyB;IAyBjC,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,oBAAoB;YAkCd,iBAAiB;YAyBjB,kBAAkB;IAqDhC,OAAO,CAAC,iBAAiB;YAOX,iBAAiB;IAoD/B,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,uBAAuB;YAwGjB,uBAAuB;YA6CvB,0BAA0B;IAwBxC,OAAO,CAAC,gBAAgB;IA4CxB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,YAAY;YAoBN,YAAY;CAgE3B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UtiliaSDK } from '@utilia-os/sdk-js';
|
|
2
|
+
export declare class TicketListComponent {
|
|
3
|
+
private container;
|
|
4
|
+
private sdk;
|
|
5
|
+
private userId;
|
|
6
|
+
private onSelect;
|
|
7
|
+
private tickets;
|
|
8
|
+
private isLoading;
|
|
9
|
+
private error;
|
|
10
|
+
constructor(container: HTMLElement, sdk: UtiliaSDK, userId: string, onSelect: (ticketId: string) => void);
|
|
11
|
+
private loadTickets;
|
|
12
|
+
private render;
|
|
13
|
+
private renderLoading;
|
|
14
|
+
private renderError;
|
|
15
|
+
private renderEmpty;
|
|
16
|
+
private renderTicketList;
|
|
17
|
+
private createTicketItem;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ticket-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket-list.d.ts","sourceRoot":"","sources":["../../src/components/ticket-list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,mBAAmB,CAAC;AAGnE,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,KAAK,CAAuB;gBAGlC,SAAS,EAAE,WAAW,EACtB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;YASxB,WAAW;IAczB,OAAO,CAAC,MAAM;IAsBd,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,WAAW;IA2BnB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,gBAAgB;CAsCzB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { UtiliaSupportWidget } from './widget';
|
|
2
|
+
import { WidgetConfig } from './types';
|
|
3
|
+
export { UtiliaSupportWidget };
|
|
4
|
+
export type { WidgetConfig };
|
|
5
|
+
/**
|
|
6
|
+
* Funcion helper para inicializar el widget de forma sencilla
|
|
7
|
+
*
|
|
8
|
+
* @param config - Configuracion del widget
|
|
9
|
+
* @returns Instancia del widget
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const widget = initUtiliaWidget({
|
|
14
|
+
* baseURL: 'https://os.utilia.ai/api',
|
|
15
|
+
* apiKey: 'tu-api-key',
|
|
16
|
+
* userId: 'user-123',
|
|
17
|
+
* userEmail: 'user@example.com',
|
|
18
|
+
* userName: 'Juan Perez',
|
|
19
|
+
* position: 'bottom-right',
|
|
20
|
+
* theme: 'light',
|
|
21
|
+
* autoContext: true,
|
|
22
|
+
* onTicketCreated: (ticket) => {
|
|
23
|
+
* console.log('Ticket creado:', ticket.ticketKey);
|
|
24
|
+
* },
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Metodos disponibles
|
|
28
|
+
* widget.open();
|
|
29
|
+
* widget.close();
|
|
30
|
+
* widget.showNewTicketForm();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function initUtiliaWidget(config: WidgetConfig): UtiliaSupportWidget;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQ5C,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,mBAAmB,CAW1E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estilos base del widget
|
|
3
|
+
* CSS Custom Properties para personalizacion
|
|
4
|
+
*/
|
|
5
|
+
export declare const baseStyles = "\n :host {\n --utilia-primary: #2563eb;\n --utilia-primary-hover: #1d4ed8;\n --utilia-bg: #ffffff;\n --utilia-bg-secondary: #f8fafc;\n --utilia-text: #1e293b;\n --utilia-text-secondary: #64748b;\n --utilia-border: #e2e8f0;\n --utilia-radius: 12px;\n --utilia-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --utilia-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n }\n\n :host([data-theme=\"dark\"]) {\n --utilia-bg: #1e293b;\n --utilia-bg-secondary: #334155;\n --utilia-text: #f8fafc;\n --utilia-text-secondary: #94a3b8;\n --utilia-border: #475569;\n }\n\n * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n }\n\n .utilia-widget {\n position: fixed;\n z-index: 999999;\n }\n\n .utilia-widget[data-position=\"bottom-right\"] {\n bottom: 20px;\n right: 20px;\n }\n\n .utilia-widget[data-position=\"bottom-left\"] {\n bottom: 20px;\n left: 20px;\n }\n\n /* Launcher Button */\n .utilia-launcher {\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--utilia-primary);\n color: white;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: var(--utilia-shadow-lg);\n transition: transform 0.2s, background 0.2s;\n position: relative;\n }\n\n .utilia-launcher:hover {\n background: var(--utilia-primary-hover);\n transform: scale(1.05);\n }\n\n .utilia-icon {\n width: 24px;\n height: 24px;\n }\n\n .utilia-badge {\n position: absolute;\n top: -4px;\n right: -4px;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n background: #ef4444;\n color: white;\n font-size: 11px;\n font-weight: 600;\n border-radius: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .utilia-badge.hidden {\n display: none;\n }\n\n /* Panel */\n .utilia-panel {\n width: 380px;\n max-width: calc(100vw - 40px);\n height: 560px;\n max-height: calc(100vh - 100px);\n background: var(--utilia-bg);\n border-radius: var(--utilia-radius);\n box-shadow: var(--utilia-shadow-lg);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n /* Header */\n .utilia-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px;\n border-bottom: 1px solid var(--utilia-border);\n background: var(--utilia-bg);\n }\n\n .utilia-title {\n font-size: 16px;\n font-weight: 600;\n color: var(--utilia-text);\n }\n\n .utilia-header-actions {\n display: flex;\n gap: 8px;\n }\n\n .utilia-header-actions button {\n width: 32px;\n height: 32px;\n border: none;\n background: transparent;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--utilia-text-secondary);\n transition: background 0.2s, color 0.2s;\n }\n\n .utilia-header-actions button:hover {\n background: var(--utilia-bg-secondary);\n color: var(--utilia-text);\n }\n\n .utilia-header-actions button svg {\n width: 18px;\n height: 18px;\n }\n\n /* Content */\n .utilia-content {\n flex: 1;\n overflow-y: auto;\n padding: 16px;\n }\n\n /* Loading */\n .utilia-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 200px;\n }\n\n .utilia-spinner {\n width: 32px;\n height: 32px;\n border: 3px solid var(--utilia-border);\n border-top-color: var(--utilia-primary);\n border-radius: 50%;\n animation: utilia-spin 0.8s linear infinite;\n }\n\n @keyframes utilia-spin {\n to { transform: rotate(360deg); }\n }\n\n /* Buttons */\n .utilia-btn {\n padding: 10px 16px;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n border: none;\n }\n\n .utilia-btn-primary {\n background: var(--utilia-primary);\n color: white;\n }\n\n .utilia-btn-primary:hover {\n background: var(--utilia-primary-hover);\n }\n\n .utilia-btn-primary:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .utilia-btn-secondary {\n background: var(--utilia-bg-secondary);\n color: var(--utilia-text);\n border: 1px solid var(--utilia-border);\n }\n\n /* Form elements */\n .utilia-input,\n .utilia-textarea,\n .utilia-select {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid var(--utilia-border);\n border-radius: 8px;\n font-size: 14px;\n background: var(--utilia-bg);\n color: var(--utilia-text);\n transition: border-color 0.2s;\n font-family: inherit;\n }\n\n .utilia-input:focus,\n .utilia-textarea:focus,\n .utilia-select:focus {\n outline: none;\n border-color: var(--utilia-primary);\n }\n\n .utilia-textarea {\n min-height: 100px;\n resize: vertical;\n }\n\n .utilia-label {\n display: block;\n margin-bottom: 6px;\n font-size: 13px;\n font-weight: 500;\n color: var(--utilia-text);\n }\n\n .utilia-form-group {\n margin-bottom: 16px;\n }\n\n /* Ticket List */\n .utilia-ticket-item {\n padding: 12px;\n border: 1px solid var(--utilia-border);\n border-radius: 8px;\n margin-bottom: 8px;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .utilia-ticket-item:hover {\n background: var(--utilia-bg-secondary);\n }\n\n .utilia-ticket-title {\n font-weight: 500;\n color: var(--utilia-text);\n margin-bottom: 4px;\n }\n\n .utilia-ticket-meta {\n font-size: 12px;\n color: var(--utilia-text-secondary);\n display: flex;\n gap: 8px;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .utilia-ticket-badge {\n padding: 2px 8px;\n border-radius: 4px;\n font-size: 11px;\n font-weight: 500;\n }\n\n .utilia-ticket-badge.open { background: #dbeafe; color: #1d4ed8; }\n .utilia-ticket-badge.in-review { background: #fef3c7; color: #d97706; }\n .utilia-ticket-badge.resolved { background: #dcfce7; color: #16a34a; }\n .utilia-ticket-badge.closed { background: #f1f5f9; color: #64748b; }\n\n .utilia-unread {\n color: var(--utilia-primary);\n font-weight: 500;\n }\n\n /* Messages */\n .utilia-messages {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding-bottom: 16px;\n }\n\n .utilia-message {\n max-width: 85%;\n padding: 10px 14px;\n border-radius: 12px;\n word-wrap: break-word;\n }\n\n .utilia-message.external {\n align-self: flex-end;\n background: var(--utilia-primary);\n color: white;\n border-bottom-right-radius: 4px;\n }\n\n .utilia-message.internal {\n align-self: flex-start;\n background: var(--utilia-bg-secondary);\n color: var(--utilia-text);\n border-bottom-left-radius: 4px;\n }\n\n .utilia-message-author {\n font-size: 11px;\n font-weight: 500;\n margin-bottom: 4px;\n opacity: 0.9;\n }\n\n .utilia-message-time {\n font-size: 11px;\n opacity: 0.7;\n margin-top: 4px;\n }\n\n /* Ticket Detail Header */\n .utilia-ticket-header {\n margin-bottom: 16px;\n padding-bottom: 16px;\n border-bottom: 1px solid var(--utilia-border);\n }\n\n /* Empty state */\n .utilia-empty {\n text-align: center;\n padding: 40px 20px;\n color: var(--utilia-text-secondary);\n }\n\n .utilia-empty-icon {\n width: 48px;\n height: 48px;\n margin: 0 auto 16px;\n opacity: 0.5;\n }\n\n .utilia-empty-text {\n margin-top: 8px;\n font-size: 12px;\n }\n\n /* Error */\n .utilia-error {\n padding: 12px;\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 8px;\n color: #dc2626;\n font-size: 13px;\n margin-bottom: 16px;\n }\n\n /* Reply form */\n .utilia-reply-form {\n margin-top: auto;\n padding-top: 16px;\n border-top: 1px solid var(--utilia-border);\n }\n\n .utilia-reply-form .utilia-textarea {\n min-height: 60px;\n }\n\n .utilia-reply-form .utilia-btn {\n width: 100%;\n margin-top: 8px;\n }\n\n .utilia-reply-files {\n margin-top: 12px;\n }\n\n .utilia-reply-files .utilia-drop-zone {\n padding: 12px;\n min-height: auto;\n }\n\n .utilia-reply-files .utilia-drop-text {\n font-size: 12px;\n }\n\n .utilia-reply-files .utilia-drop-hint {\n font-size: 11px;\n }\n\n /* Closed ticket notice */\n .utilia-closed-notice {\n text-align: center;\n padding: 16px;\n color: var(--utilia-text-secondary);\n font-size: 13px;\n }\n\n /* AI Section */\n .utilia-ai-section {\n background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);\n border: 1px solid #bae6fd;\n border-radius: 10px;\n padding: 14px;\n margin-bottom: 20px;\n }\n\n :host([data-theme=\"dark\"]) .utilia-ai-section {\n background: linear-gradient(135deg, #1e3a5f 0%, #172554 100%);\n border-color: #1e40af;\n }\n\n .utilia-ai-header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n }\n\n .utilia-ai-label {\n font-size: 13px;\n font-weight: 600;\n color: #0369a1;\n }\n\n :host([data-theme=\"dark\"]) .utilia-ai-label {\n color: #7dd3fc;\n }\n\n .utilia-ai-desc {\n font-size: 12px;\n color: #0c4a6e;\n margin-bottom: 12px;\n line-height: 1.4;\n }\n\n :host([data-theme=\"dark\"]) .utilia-ai-desc {\n color: #bae6fd;\n }\n\n .utilia-ai-controls {\n display: flex;\n gap: 8px;\n }\n\n /* Record Button */\n .utilia-record-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 16px;\n background: var(--utilia-primary);\n color: white;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n transition: all 0.2s;\n width: 100%;\n justify-content: center;\n }\n\n .utilia-record-btn:hover:not(:disabled) {\n background: var(--utilia-primary-hover);\n transform: translateY(-1px);\n }\n\n .utilia-record-btn:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .utilia-record-btn.recording {\n background: #dc2626;\n animation: utilia-pulse 1.5s ease-in-out infinite;\n }\n\n .utilia-record-btn.recording:hover:not(:disabled) {\n background: #b91c1c;\n }\n\n @keyframes utilia-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }\n }\n\n .utilia-mic-icon {\n width: 18px;\n height: 18px;\n flex-shrink: 0;\n }\n\n /* AI Loading */\n .utilia-ai-loading {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 12px;\n padding: 10px;\n background: rgba(255, 255, 255, 0.7);\n border-radius: 6px;\n font-size: 12px;\n color: #0369a1;\n }\n\n :host([data-theme=\"dark\"]) .utilia-ai-loading {\n background: rgba(0, 0, 0, 0.2);\n color: #7dd3fc;\n }\n\n .utilia-spinner-small {\n width: 16px;\n height: 16px;\n border-width: 2px;\n flex-shrink: 0;\n }\n\n /* AI Error */\n .utilia-ai-error {\n margin-top: 10px;\n padding: 8px 12px;\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 6px;\n font-size: 12px;\n color: #dc2626;\n }\n\n :host([data-theme=\"dark\"]) .utilia-ai-error {\n background: rgba(220, 38, 38, 0.15);\n border-color: rgba(220, 38, 38, 0.3);\n color: #fca5a5;\n }\n\n /* ======================================\n FILE UPLOAD STYLES\n ====================================== */\n\n /* Drop Zone */\n .utilia-drop-zone {\n border: 2px dashed var(--utilia-border);\n border-radius: 8px;\n padding: 20px;\n text-align: center;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n }\n\n .utilia-drop-zone:hover,\n .utilia-drop-zone.drag-over {\n border-color: var(--utilia-primary);\n background: rgba(37, 99, 235, 0.05);\n }\n\n .utilia-upload-icon {\n width: 32px;\n height: 32px;\n color: var(--utilia-text-secondary);\n }\n\n .utilia-drop-text {\n font-size: 13px;\n color: var(--utilia-text);\n }\n\n .utilia-drop-hint {\n font-size: 11px;\n color: var(--utilia-text-secondary);\n }\n\n /* File List */\n .utilia-file-list {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .utilia-file-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 12px;\n background: var(--utilia-bg-secondary);\n border-radius: 6px;\n font-size: 13px;\n }\n\n .utilia-file-item.pending {\n opacity: 0.7;\n }\n\n .utilia-file-info {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .utilia-file-name {\n color: var(--utilia-text);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .utilia-file-size {\n font-size: 11px;\n color: var(--utilia-text-secondary);\n }\n\n .utilia-file-remove {\n width: 24px;\n height: 24px;\n border: none;\n background: transparent;\n color: var(--utilia-text-secondary);\n cursor: pointer;\n border-radius: 4px;\n font-size: 18px;\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .utilia-file-remove:hover {\n background: rgba(239, 68, 68, 0.1);\n color: #ef4444;\n }\n\n /* Progress Bar */\n .utilia-file-progress {\n height: 4px;\n background: var(--utilia-border);\n border-radius: 2px;\n overflow: hidden;\n }\n\n .utilia-file-progress-bar {\n height: 100%;\n background: var(--utilia-primary);\n transition: width 0.2s;\n }\n\n /* File Error */\n .utilia-file-error {\n margin-top: 8px;\n padding: 8px 12px;\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 6px;\n font-size: 12px;\n color: #dc2626;\n }\n\n .utilia-file-error-inline {\n font-size: 11px;\n color: #dc2626;\n }\n\n :host([data-theme=\"dark\"]) .utilia-file-error,\n :host([data-theme=\"dark\"]) .utilia-file-error-inline {\n background: rgba(220, 38, 38, 0.15);\n border-color: rgba(220, 38, 38, 0.3);\n color: #fca5a5;\n }\n\n /* Message Attachments */\n .utilia-message-attachments {\n margin-top: 8px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .utilia-attachment-item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n font-size: 12px;\n color: inherit;\n text-decoration: none;\n transition: background 0.2s;\n }\n\n .utilia-attachment-item:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n .utilia-file-icon {\n width: 14px;\n height: 14px;\n flex-shrink: 0;\n }\n\n /* ======================================\n AI SUGGESTIONS REVIEW\n ====================================== */\n\n .utilia-ai-suggestions {\n margin-top: 12px;\n border: 1px solid var(--utilia-border);\n border-radius: 8px;\n overflow: hidden;\n }\n\n .utilia-ai-suggestions-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--utilia-bg-secondary);\n border-bottom: 1px solid var(--utilia-border);\n font-size: 13px;\n font-weight: 500;\n }\n\n .utilia-suggestion-item {\n padding: 10px 14px;\n border-bottom: 1px solid var(--utilia-border);\n display: flex;\n align-items: flex-start;\n gap: 10px;\n }\n\n .utilia-suggestion-item:last-child {\n border-bottom: none;\n }\n\n .utilia-suggestion-field {\n flex: 1;\n min-width: 0;\n }\n\n .utilia-suggestion-field-name {\n font-size: 11px;\n font-weight: 600;\n color: var(--utilia-text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin-bottom: 4px;\n }\n\n .utilia-suggestion-value {\n font-size: 13px;\n color: var(--utilia-text);\n line-height: 1.4;\n max-height: 60px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .utilia-suggestion-actions {\n display: flex;\n gap: 4px;\n flex-shrink: 0;\n }\n\n .utilia-suggestion-btn {\n width: 28px;\n height: 28px;\n border: 1px solid var(--utilia-border);\n border-radius: 6px;\n background: var(--utilia-bg);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s;\n padding: 0;\n }\n\n .utilia-suggestion-btn.accept {\n color: #16a34a;\n }\n\n .utilia-suggestion-btn.accept:hover,\n .utilia-suggestion-btn.accept.active {\n background: #dcfce7;\n border-color: #16a34a;\n }\n\n .utilia-suggestion-btn.reject {\n color: #dc2626;\n }\n\n .utilia-suggestion-btn.reject:hover,\n .utilia-suggestion-btn.reject.active {\n background: #fef2f2;\n border-color: #dc2626;\n }\n\n .utilia-suggestion-btn svg {\n width: 14px;\n height: 14px;\n }\n\n .utilia-suggestions-footer {\n display: flex;\n gap: 8px;\n padding: 10px 14px;\n background: var(--utilia-bg-secondary);\n border-top: 1px solid var(--utilia-border);\n }\n\n .utilia-suggestions-footer .utilia-btn {\n flex: 1;\n padding: 8px 12px;\n font-size: 13px;\n }\n\n /* AI Text Input */\n .utilia-ai-input-group {\n display: flex;\n gap: 8px;\n margin-top: 8px;\n }\n\n .utilia-ai-textarea {\n flex: 1;\n min-height: 60px;\n max-height: 120px;\n resize: vertical;\n padding: 8px 12px;\n border: 1px solid var(--utilia-border);\n border-radius: 6px;\n font-size: 13px;\n font-family: inherit;\n background: var(--utilia-bg);\n color: var(--utilia-text);\n }\n\n .utilia-ai-textarea:focus {\n outline: none;\n border-color: var(--utilia-primary);\n }\n\n .utilia-ai-textarea:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .utilia-ai-generate-btn {\n padding: 8px 14px;\n font-size: 13px;\n white-space: nowrap;\n }\n";
|
|
6
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/styles/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,UAAU,k9jBA62BtB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { TicketCategory, TicketPriority } from '@utilia-os/sdk-js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuracion del widget
|
|
4
|
+
*/
|
|
5
|
+
export interface WidgetConfig {
|
|
6
|
+
/** URL base de la API de UTILIA OS */
|
|
7
|
+
baseURL: string;
|
|
8
|
+
/** API Key de la aplicacion externa */
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/** ID del usuario en la app externa */
|
|
11
|
+
userId: string;
|
|
12
|
+
/** Email del usuario (opcional) */
|
|
13
|
+
userEmail?: string;
|
|
14
|
+
/** Nombre del usuario (opcional) */
|
|
15
|
+
userName?: string;
|
|
16
|
+
/** Metadatos adicionales del usuario */
|
|
17
|
+
userMetadata?: Record<string, unknown>;
|
|
18
|
+
/** Posicion del widget flotante */
|
|
19
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
20
|
+
/** Tema del widget */
|
|
21
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
22
|
+
/** Categoria por defecto para nuevos tickets */
|
|
23
|
+
defaultCategory?: TicketCategory;
|
|
24
|
+
/** Prioridad por defecto para nuevos tickets */
|
|
25
|
+
defaultPriority?: TicketPriority;
|
|
26
|
+
/** Contexto automatico (URL, version, etc) */
|
|
27
|
+
autoContext?: boolean;
|
|
28
|
+
/** Callback cuando se crea un ticket */
|
|
29
|
+
onTicketCreated?: (ticket: {
|
|
30
|
+
id: string;
|
|
31
|
+
ticketKey: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
/** Callback cuando hay error */
|
|
34
|
+
onError?: (error: Error) => void;
|
|
35
|
+
}
|
|
36
|
+
/** Estado de la vista del widget */
|
|
37
|
+
export type WidgetView = 'closed' | 'list' | 'form' | 'detail';
|
|
38
|
+
/** Estado interno del widget */
|
|
39
|
+
export interface WidgetState {
|
|
40
|
+
view: WidgetView;
|
|
41
|
+
selectedTicketId: string | null;
|
|
42
|
+
isLoading: boolean;
|
|
43
|
+
error: string | null;
|
|
44
|
+
unreadCount: number;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;IAC1C,sBAAsB;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,gDAAgD;IAChD,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,gDAAgD;IAChD,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtE,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,oCAAoC;AACpC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/D,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|