rio-assist-widget 0.1.23 → 0.1.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rio-assist-widget",
3
- "version": "0.1.23",
3
+ "version": "0.1.26",
4
4
  "description": "Web Component do painel lateral Rio Insight, pronto para ser embutido em qualquer projeto.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -119,14 +119,18 @@ const renderConversationSurface = (
119
119
  })}
120
120
  @click=${(event: Event) => event.stopPropagation()}
121
121
  >
122
- <button
123
- type="button"
124
- @click=${() =>
125
- component.handleConversationAction('rename', conversation.id)}
126
- >
127
- <img src=${editIconUrl} alt="" aria-hidden="true" />
128
- Renomear
129
- </button>
122
+ ${/* Renomear ocultado enquanto backend nao suporta */ false
123
+ ? html`
124
+ <button
125
+ type="button"
126
+ @click=${() =>
127
+ component.handleConversationAction('rename', conversation.id)}
128
+ >
129
+ <img src=${editIconUrl} alt="" aria-hidden="true" />
130
+ Renomear
131
+ </button>
132
+ `
133
+ : null}
130
134
  <button
131
135
  type="button"
132
136
  @click=${() =>
@@ -232,46 +232,66 @@ export const miniPanelStyles = css`
232
232
  text-align: right;
233
233
  }
234
234
 
235
- .typing {
236
- font-style: italic;
237
- opacity: 0.75;
238
- }
239
-
240
- .typing__dots {
241
- display: inline-flex;
242
- gap: 2px;
243
- margin-left: 4px;
244
- }
245
-
246
- .typing__dots span {
247
- display: inline-block;
248
- animation: typing-bounce 1.2s infinite;
249
- }
250
-
251
- .typing__dots span:nth-child(2) {
252
- animation-delay: 0.2s;
253
- }
254
-
255
- .typing__dots span:nth-child(3) {
256
- animation-delay: 0.4s;
257
- }
258
-
259
- @keyframes typing-bounce {
260
- 0%,
261
- 80%,
262
- 100% {
263
- transform: translateY(0);
264
- opacity: 0.25;
265
- }
266
- 40% {
267
- transform: translateY(-4px);
268
- opacity: 1;
269
- }
270
- }
271
-
272
- .message--user time {
273
- margin-top: 3px;
274
- }
235
+ .typing {
236
+ font-style: italic;
237
+ opacity: 0.75;
238
+ display: flex;
239
+ align-items: center;
240
+ gap: 8px;
241
+ }
242
+
243
+ .typing::before {
244
+ content: '';
245
+ display: inline-block;
246
+ width: 16px;
247
+ height: 16px;
248
+ border: 2px solid var(--accent-color, #008B9A);
249
+ border-radius: 50%;
250
+ border-top-color: transparent;
251
+ animation: typing-spin 0.8s linear infinite;
252
+ }
253
+
254
+ @keyframes typing-spin {
255
+ to {
256
+ transform: rotate(360deg);
257
+ }
258
+ }
259
+
260
+ .typing__dots {
261
+ display: inline-flex;
262
+ gap: 2px;
263
+ margin-left: 4px;
264
+ }
265
+
266
+ .typing__dots span {
267
+ display: inline-block;
268
+ animation: typing-bounce 1.2s infinite;
269
+ }
270
+
271
+ .typing__dots span:nth-child(2) {
272
+ animation-delay: 0.2s;
273
+ }
274
+
275
+ .typing__dots span:nth-child(3) {
276
+ animation-delay: 0.4s;
277
+ }
278
+
279
+ @keyframes typing-bounce {
280
+ 0%,
281
+ 80%,
282
+ 100% {
283
+ transform: translateY(0);
284
+ opacity: 0.25;
285
+ }
286
+ 40% {
287
+ transform: translateY(-4px);
288
+ opacity: 1;
289
+ }
290
+ }
291
+
292
+ .message--user time {
293
+ margin-top: 3px;
294
+ }
275
295
 
276
296
  .panel-footer {
277
297
  width: 100%;
@@ -283,12 +303,12 @@ export const miniPanelStyles = css`
283
303
  margin-top: auto;
284
304
  }
285
305
 
286
- .suggestions {
287
- display: flex;
288
- flex-wrap: wrap;
289
- gap: 12px;
290
- justify-content: center;
291
- }
306
+ .suggestions {
307
+ display: flex;
308
+ flex-wrap: wrap;
309
+ gap: 12px;
310
+ justify-content: center;
311
+ }
292
312
 
293
313
  .suggestions-wrapper {
294
314
  width: 100%;
@@ -320,18 +340,18 @@ export const miniPanelStyles = css`
320
340
  white-space: nowrap;
321
341
  }
322
342
 
323
- form {
324
- display: flex;
325
- align-items: center;
326
- gap: 12px;
327
- border: 1px solid #a4afbb;
328
- border-radius: 80px;
329
- padding: 8px 12px 8px 16px;
330
- background: #fff;
331
- width: 100%;
332
- max-width: 520px;
333
- margin-bottom: 0;
334
- height: 56px;
343
+ form {
344
+ display: flex;
345
+ align-items: center;
346
+ gap: 12px;
347
+ border: 1px solid #a4afbb;
348
+ border-radius: 80px;
349
+ padding: 8px 12px 8px 16px;
350
+ background: #fff;
351
+ width: 100%;
352
+ max-width: 520px;
353
+ margin-bottom: 0;
354
+ height: 56px;
335
355
  box-sizing: border-box;
336
356
  }
337
357
 
@@ -50,6 +50,15 @@ const baseStyles = css`
50
50
  color: #1f2f36;
51
51
  }
52
52
 
53
+ .dialog__message--title {
54
+ font-weight: 700;
55
+ }
56
+
57
+ .dialog__message--error {
58
+ color: #d9534f;
59
+ white-space: pre-wrap;
60
+ }
61
+
53
62
  .dialog__input {
54
63
  width: 100%;
55
64
  box-sizing: border-box;
@@ -64,6 +64,42 @@ export const renderRioAssist = (component: RioAssistWidget) => {
64
64
  </div>
65
65
  `
66
66
  : null}
67
+ ${component.conversationActionError
68
+ ? html`
69
+ <div class="dialog-overlay" role="dialog" aria-modal="true">
70
+ <div class="dialog">
71
+ <p class="dialog__message dialog__message--title">
72
+ Erro ao
73
+ ${component.conversationActionError.action === 'delete'
74
+ ? 'excluir'
75
+ : 'renomear'}
76
+ conversa:
77
+ </p>
78
+ <p class="dialog__message">
79
+ O agente retornou o seguinte erro ao tentar
80
+ ${component.conversationActionError.action === 'delete' ? 'excluir' : 'renomear'}
81
+ a conversa:
82
+ </p>
83
+ <p class="dialog__message dialog__message--error">
84
+ ${component.conversationActionError.message}
85
+ </p>
86
+ <div class="dialog__actions">
87
+ <button type="button" class="dialog__button dialog__button--ghost" @click=${() =>
88
+ component.cancelConversationActionError()}>
89
+ Cancelar ação
90
+ </button>
91
+ <button
92
+ type="button"
93
+ class="dialog__button dialog__button--primary"
94
+ @click=${() => component.retryConversationAction()}
95
+ >
96
+ Tentar novamente
97
+ </button>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ `
102
+ : null}
67
103
  </div>
68
104
  `;
69
105
  };