rio-assist-widget 0.2.7 → 0.2.9
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 +8 -2
- package/dist/rio-assist.es.js +8748 -0
- package/dist/rio-assist.js +148 -112
- package/package.json +8 -3
- package/src/components/fullscreen/fullscreen.template.ts +3 -3
- package/src/components/mini-panel/message-actions.template.ts +22 -55
- package/src/components/mini-panel/mini-panel.styles.ts +34 -23
- package/src/components/mini-panel/mini-panel.template.ts +13 -13
- package/src/components/rio-assist/history-utils.ts +101 -0
- package/src/components/rio-assist/rio-assist.ts +77 -114
- package/src/consultant-agent/consultant-agent.ts +17 -15
- package/src/main.ts +4 -0
- package/src/playground.ts +8 -4
- package/src/services/rioMessageParser.ts +31 -0
- package/src/services/rioWebsocket.ts +29 -49
- package/src/types/markdown-it.d.ts +1 -0
- package/src/utils/logger.ts +27 -0
- package/vite.config.ts +1 -1
package/README.md
CHANGED
|
@@ -45,6 +45,8 @@ Se nenhum parametro abaixo for informado, o widget mantem o comportamento e os v
|
|
|
45
45
|
- `floatingButtonIconUrl`: icone principal do botao flutuante.
|
|
46
46
|
- `floatingButtonLabelIconUrl`: imagem/label do botao flutuante.
|
|
47
47
|
- `floatingButtonBackgroundIconUrl`: imagem de fundo do botao flutuante.
|
|
48
|
+
- `wsBaseUrl`: URL base do websocket (padrao: `wss://ws.volkswagen.latam-sandbox.rio.cloud`).
|
|
49
|
+
- `consultantApiBaseUrl`: URL base da API do consultor (padrao: `https://consultant-api.latam-sandbox.rio.cloud/consultant/api/v1`).
|
|
48
50
|
- `title`: titulo exibido no mini painel e no modo tela cheia.
|
|
49
51
|
- `consultantAgentButtonText`: texto do botao "Consulte o UptAIme Agent".
|
|
50
52
|
- `showConsultantAgentButton`: controla se o botao "Consulte o UptAIme Agent" sera exibido (`true` ou `false`).
|
|
@@ -61,6 +63,8 @@ Exemplo:
|
|
|
61
63
|
floatingButtonIconUrl: 'https://cdn.exemplo.com/icones/projeto-a/icon.png',
|
|
62
64
|
floatingButtonLabelIconUrl: 'https://cdn.exemplo.com/icones/projeto-a/label.png',
|
|
63
65
|
floatingButtonBackgroundIconUrl: 'https://cdn.exemplo.com/icones/projeto-a/bg.png',
|
|
66
|
+
wsBaseUrl: 'wss://ws.projeto-a.exemplo.com',
|
|
67
|
+
consultantApiBaseUrl: 'https://consultor.projeto-a.exemplo.com/consultant/api/v1',
|
|
64
68
|
consultantAgentButtonText: 'Falar com especialista',
|
|
65
69
|
showConsultantAgentButton: true,
|
|
66
70
|
consultantAgentInitialMessage:
|
|
@@ -81,6 +85,8 @@ Tambem e possivel configurar via atributos `data-*` no elemento:
|
|
|
81
85
|
data-floating-button-icon-url="https://cdn.exemplo.com/icones/projeto-a/icon.png"
|
|
82
86
|
data-floating-button-label-icon-url="https://cdn.exemplo.com/icones/projeto-a/label.png"
|
|
83
87
|
data-floating-button-background-icon-url="https://cdn.exemplo.com/icones/projeto-a/bg.png"
|
|
88
|
+
data-ws-base-url="wss://ws.projeto-a.exemplo.com"
|
|
89
|
+
data-consultant-api-base-url="https://consultor.projeto-a.exemplo.com/consultant/api/v1"
|
|
84
90
|
data-auto-start-consultant-flow="true"
|
|
85
91
|
></rio-assist-widget>
|
|
86
92
|
```
|
|
@@ -102,8 +108,8 @@ Tambem e possivel configurar via atributos `data-*` no elemento:
|
|
|
102
108
|
3. Se preferir instanciar manualmente, coloque `<rio-assist-widget></rio-assist-widget>` no HTML e defina os atributos `data-*` (`data-title`, `data-button-label`, `data-rio-token` etc.).
|
|
103
109
|
|
|
104
110
|
## Eventos disponibilizados
|
|
105
|
-
- `rioassist:open` / `rioassist:close` - disparados ao abrir/fechar o painel.
|
|
106
|
-
- `rioassist:send` - disparado quando o usuario envia uma mensagem. O `detail` contem `{ message, apiBaseUrl,
|
|
111
|
+
- `rioassist:open` / `rioassist:close` - disparados ao abrir/fechar o painel.
|
|
112
|
+
- `rioassist:send` - disparado quando o usuario envia uma mensagem. O `detail` contem `{ message, apiBaseUrl, hasToken, tokenPreview }`.
|
|
107
113
|
|
|
108
114
|
Escute esses eventos caso queira registrar logs ou interceptar mensagens antes/depois de irem para o websocket.
|
|
109
115
|
|