rio-assist-widget 0.1.9 → 0.1.11
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 +1 -2
- package/dist/rio-assist.js +94 -65
- package/package.json +1 -1
- package/src/components/conversations-panel/conversations-panel.styles.ts +22 -1
- package/src/components/conversations-panel/conversations-panel.template.ts +36 -21
- package/src/components/fullscreen/fullscreen.template.ts +3 -1
- package/src/components/rio-assist/rio-assist.ts +671 -122
- package/src/services/rioWebsocket.ts +119 -74
package/package.json
CHANGED
|
@@ -173,12 +173,14 @@ export const conversationsPanelStyles = css`
|
|
|
173
173
|
display: flex;
|
|
174
174
|
align-items: center;
|
|
175
175
|
justify-content: space-between;
|
|
176
|
-
padding: 0
|
|
176
|
+
padding: 0 40px 0 6px;
|
|
177
177
|
border-radius: 8px;
|
|
178
178
|
color: #1f2f36;
|
|
179
179
|
font-size: 15px;
|
|
180
180
|
position: relative;
|
|
181
181
|
height: 40px;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
transition: color 0.2s ease, background-color 0.2s ease;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
.conversations-panel--sidebar .conversation-item {
|
|
@@ -199,6 +201,17 @@ export const conversationsPanelStyles = css`
|
|
|
199
201
|
.conversation-item__text {
|
|
200
202
|
flex: 1;
|
|
201
203
|
padding-right: 16px;
|
|
204
|
+
transition: color 0.2s ease;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.conversation-item:hover .conversation-item__text,
|
|
208
|
+
.conversation-item:focus-visible .conversation-item__text {
|
|
209
|
+
color: var(--accent-color, #008b9a);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.conversation-item:hover,
|
|
213
|
+
.conversation-item:focus-visible {
|
|
214
|
+
background: rgba(0, 139, 154, 0.08);
|
|
202
215
|
}
|
|
203
216
|
|
|
204
217
|
.conversation-menu-button {
|
|
@@ -210,6 +223,8 @@ export const conversationsPanelStyles = css`
|
|
|
210
223
|
display: flex;
|
|
211
224
|
align-items: center;
|
|
212
225
|
justify-content: center;
|
|
226
|
+
margin-left: 4px;
|
|
227
|
+
flex-shrink: 0;
|
|
213
228
|
}
|
|
214
229
|
|
|
215
230
|
.conversation-menu {
|
|
@@ -250,6 +265,12 @@ export const conversationsPanelStyles = css`
|
|
|
250
265
|
height: 16px;
|
|
251
266
|
}
|
|
252
267
|
|
|
268
|
+
.conversation-loading {
|
|
269
|
+
font-size: 13px;
|
|
270
|
+
color: #4b5b68;
|
|
271
|
+
padding: 6px 12px 2px;
|
|
272
|
+
}
|
|
273
|
+
|
|
253
274
|
.new-conversation-cta {
|
|
254
275
|
overflow: hidden;
|
|
255
276
|
max-height: 0;
|
|
@@ -47,11 +47,11 @@ const renderConversationSurface = (
|
|
|
47
47
|
component: RioAssistWidget,
|
|
48
48
|
variant: ConversationsPanelVariant,
|
|
49
49
|
) => {
|
|
50
|
-
const isSidebar = variant === 'sidebar';
|
|
51
|
-
|
|
52
|
-
const newConversationCta = isSidebar
|
|
53
|
-
? html`
|
|
54
|
-
<div
|
|
50
|
+
const isSidebar = variant === 'sidebar';
|
|
51
|
+
|
|
52
|
+
const newConversationCta = isSidebar
|
|
53
|
+
? html`
|
|
54
|
+
<div
|
|
55
55
|
class=${classMap({
|
|
56
56
|
'new-conversation-cta': true,
|
|
57
57
|
open: component.showNewConversationShortcut,
|
|
@@ -81,15 +81,27 @@ const renderConversationSurface = (
|
|
|
81
81
|
>
|
|
82
82
|
${component.filteredConversations.map(
|
|
83
83
|
(conversation) => {
|
|
84
|
-
const menuOpen = component.conversationMenuId === conversation.id;
|
|
85
|
-
|
|
86
|
-
return html`
|
|
87
|
-
<div
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
const menuOpen = component.conversationMenuId === conversation.id;
|
|
85
|
+
|
|
86
|
+
return html`
|
|
87
|
+
<div
|
|
88
|
+
class="conversation-item"
|
|
89
|
+
role="button"
|
|
90
|
+
tabindex="0"
|
|
91
|
+
title=${`Recuperar ${conversation.title}`}
|
|
92
|
+
@click=${() => component.handleConversationSelect(conversation.id)}
|
|
93
|
+
@keydown=${(event: KeyboardEvent) => {
|
|
94
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
component.handleConversationSelect(conversation.id);
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<div class="conversation-item__text">
|
|
101
|
+
${conversation.title}
|
|
102
|
+
</div>
|
|
103
|
+
<button
|
|
104
|
+
class="conversation-menu-button"
|
|
93
105
|
type="button"
|
|
94
106
|
@click=${(event: Event) =>
|
|
95
107
|
component.handleConversationMenuToggle(event, conversation.id)}
|
|
@@ -145,13 +157,16 @@ const renderConversationSurface = (
|
|
|
145
157
|
/>
|
|
146
158
|
</div>
|
|
147
159
|
|
|
148
|
-
<div
|
|
149
|
-
class=${classMap({
|
|
150
|
-
'conversation-list-wrapper': true,
|
|
151
|
-
'conversation-list-wrapper--sidebar': isSidebar,
|
|
152
|
-
})}
|
|
153
|
-
>
|
|
154
|
-
${
|
|
160
|
+
<div
|
|
161
|
+
class=${classMap({
|
|
162
|
+
'conversation-list-wrapper': true,
|
|
163
|
+
'conversation-list-wrapper--sidebar': isSidebar,
|
|
164
|
+
})}
|
|
165
|
+
>
|
|
166
|
+
${component.conversationHistoryLoading
|
|
167
|
+
? html`<div class="conversation-loading">Carregando conversas...</div>`
|
|
168
|
+
: null}
|
|
169
|
+
${list}
|
|
155
170
|
${isSidebar
|
|
156
171
|
? html`
|
|
157
172
|
<div
|
|
@@ -67,7 +67,9 @@ export const renderFullscreen = (component: RioAssistWidget) => {
|
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
69
|
<div class="fullscreen-header__tabs">
|
|
70
|
-
|
|
70
|
+
${component.activeConversationTitle
|
|
71
|
+
? html`<span class="fullscreen-header__tab">${component.activeConversationTitle}</span>`
|
|
72
|
+
: null}
|
|
71
73
|
</div>
|
|
72
74
|
|
|
73
75
|
<div class="fullscreen-header__actions">
|