@webitel/ui-chats 26.8.5 → 26.8.6

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": "@webitel/ui-chats",
3
- "version": "26.8.5",
3
+ "version": "26.8.6",
4
4
  "description": "Reusable Webitel Frontend Code for Chats UI",
5
5
  "workspaces": [
6
6
  "../../",
@@ -40,6 +40,7 @@
40
40
  v-if="hasAction(ChatComposerAction.Emoji)"
41
41
  :popup-teleport-to="`#${composerId}`"
42
42
  :rounded="false"
43
+ variant="text"
43
44
  size="sm"
44
45
  :title="t('composer.emoji')"
45
46
  @insert-emoji="insertText"
@@ -54,6 +55,7 @@
54
55
  class="chat-composer__send"
55
56
  icon="chat-send"
56
57
  color="secondary"
58
+ size="sm"
57
59
  :loading="isSending"
58
60
  :disabled="isLocked || !canSend"
59
61
  :title="t('composer.send')"
@@ -224,8 +224,7 @@ watch(
224
224
  width: 100%;
225
225
  overflow-x: hidden;
226
226
  overflow-y: auto;
227
- padding-right: var(--scrollbar-width);
228
- scrollbar-gutter: stable both-edges;
227
+ scrollbar-gutter: stable;
229
228
  }
230
229
 
231
230
  .chat-history__content {
@@ -233,6 +232,8 @@ watch(
233
232
  flex-direction: column;
234
233
  gap: var(--wt-ws-chat-window-sizes-root-gap);
235
234
  padding: var(--wt-ws-chat-window-sizes-root-padding-y) var(--wt-ws-chat-window-sizes-root-padding-x);
235
+ /* the scrollbar sits a root gap away from the messages, as in DES-730 */
236
+ padding-right: calc(var(--wt-ws-chat-window-sizes-root-padding-x) + var(--wt-ws-chat-window-sizes-root-gap));
236
237
  }
237
238
 
238
239
  .chat-history__sentinel {
@@ -33,4 +33,10 @@ const label = computed(() =>
33
33
  display: flex;
34
34
  justify-content: center;
35
35
  }
36
+
37
+ /* DES-730 draws the chip a step lighter than the default secondary; the
38
+ surface palette does not flip with the theme, so dark keeps the default */
39
+ :global(:root:not(.theme--dark)) .chat-date-divider {
40
+ --p-chip-secondary-background: var(--p-surface-50);
41
+ }
36
42
  </style>
@@ -40,12 +40,12 @@
40
40
  {{ t('history.unsupportedMessage') }}
41
41
  </p>
42
42
  </template>
43
- <div class="chat-message__meta typo-caption">
44
- <span v-if="time">{{ time }}</span>
43
+ <div class="chat-message__meta typo-body-2">
45
44
  <message-status
46
45
  v-if="status"
47
46
  :status="status"
48
47
  />
48
+ <span v-if="time">{{ time }}</span>
49
49
  </div>
50
50
  </div>
51
51
  </div>
@@ -104,6 +104,8 @@ const status = computed(() =>
104
104
 
105
105
  <style scoped>
106
106
  .chat-message {
107
+ --chat-message-tail-size: 8px;
108
+
107
109
  display: flex;
108
110
  align-items: flex-start;
109
111
  gap: var(--wt-ws-chat-window-sizes-message-item-gap);
@@ -122,25 +124,49 @@ const status = computed(() =>
122
124
  display: flex;
123
125
  flex-direction: column;
124
126
  gap: var(--wt-ws-chat-window-sizes-message-item-chat-message-gap);
127
+ position: relative;
125
128
  max-width: 70%;
126
129
  min-width: 0;
127
130
  padding: var(--wt-ws-chat-window-sizes-message-item-chat-message-padding-y) var(--wt-ws-chat-window-sizes-message-item-chat-message-padding-x);
128
131
  border-radius: var(--wt-ws-chat-window-sizes-message-item-chat-message-border-radius);
129
- background: var(--wt-ws-chat-window-colors-message-item-chat-message-client-background);
132
+ background: var(--chat-message-bubble-background);
130
133
  color: var(--wt-ws-chat-window-colors-message-item-chat-message-client-color);
134
+ --chat-message-bubble-background: var(--wt-ws-chat-window-colors-message-item-chat-message-client-background);
131
135
  }
132
136
 
133
- /* the corner next to the avatar is square, as in DES-730 */
137
+ /* the corner next to the avatar is square and carries an 8px tail, as in DES-730 */
134
138
  .chat-message:not(.chat-message--outgoing) .chat-message__bubble {
139
+ margin-left: var(--chat-message-tail-size);
135
140
  border-top-left-radius: 0;
136
141
  }
137
142
 
138
143
  .chat-message--outgoing .chat-message__bubble {
144
+ margin-right: var(--chat-message-tail-size);
139
145
  border-top-right-radius: 0;
140
- background: var(--wt-ws-chat-window-colors-message-item-chat-message-agent-background);
146
+ --chat-message-bubble-background: var(--wt-ws-chat-window-colors-message-item-chat-message-agent-background);
141
147
  color: var(--wt-ws-chat-window-colors-message-item-chat-message-agent-color);
142
148
  }
143
149
 
150
+ /* the tail is the bubble colour left over once a circle is cut out of the
151
+ square beside the bubble's square corner */
152
+ .chat-message__bubble::before {
153
+ position: absolute;
154
+ top: 0;
155
+ width: var(--chat-message-tail-size);
156
+ height: var(--chat-message-tail-size);
157
+ content: '';
158
+ }
159
+
160
+ .chat-message:not(.chat-message--outgoing) .chat-message__bubble::before {
161
+ right: 100%;
162
+ background: radial-gradient(circle 7.333px at 0.667px 7.333px, transparent 7.2px, var(--chat-message-bubble-background) 7.45px);
163
+ }
164
+
165
+ .chat-message--outgoing .chat-message__bubble::before {
166
+ left: 100%;
167
+ background: radial-gradient(circle 7.333px at 7.333px 7.333px, transparent 7.2px, var(--chat-message-bubble-background) 7.45px);
168
+ }
169
+
144
170
  .chat-message__placeholder {
145
171
  margin: 0;
146
172
  font-style: italic;
@@ -8,6 +8,7 @@
8
8
  </div>
9
9
  <wt-rounded-action
10
10
  icon="arrow-down"
11
+ size="sm"
11
12
  rounded
12
13
  @click="emit('scroll')"
13
14
  />
@@ -34,7 +35,7 @@ const emit = defineEmits<{
34
35
  <style scoped>
35
36
  .scroll-to-bottom-btn {
36
37
  position: absolute;
37
- right: calc(var(--scrollbar-width) + var(--spacing-xs));
38
+ right: calc(var(--scrollbar-width) + var(--wt-ws-chat-window-sizes-root-gap) + var(--spacing-xs));
38
39
  bottom: var(--spacing-xs);
39
40
  display: flex;
40
41
  flex-direction: column;