vue-wiguet-chatweb 0.0.11 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Widget.vue.d.ts +11 -1
- package/dist/main.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/vue-wiguet-chatweb.js +668 -659
- package/dist/vue-wiguet-chatweb.umd.cjs +4 -4
- package/package.json +1 -1
- package/src/components/Chat.vue +1 -2
- package/src/components/MessageList.vue +56 -52
- package/src/components/Widget.vue +17 -3
package/package.json
CHANGED
package/src/components/Chat.vue
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
/>
|
19
19
|
</div>
|
20
20
|
|
21
|
-
<div class="
|
21
|
+
<div class="w-full">
|
22
22
|
<form class="message-send" @submit.prevent="submitMessage">
|
23
23
|
<div class="form-message">
|
24
24
|
<!-- <button type="submit">
|
@@ -291,7 +291,6 @@ const mantainElementsOnViewport = (scrollHeightBeforeAdd: number) => {
|
|
291
291
|
</script>
|
292
292
|
|
293
293
|
<style scoped>
|
294
|
-
@import url(../style.css);
|
295
294
|
.btn-primary {
|
296
295
|
padding: 10px 12px;
|
297
296
|
&:hover {
|
@@ -1,42 +1,44 @@
|
|
1
1
|
<template>
|
2
2
|
<div ref="target" class="target"></div>
|
3
|
-
<div
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<div
|
11
|
-
<
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<div class="
|
24
|
-
<div :class="message.esCliente ? '
|
25
|
-
<div class="message">
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
<
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
3
|
+
<div class="messages-container-list">
|
4
|
+
<div
|
5
|
+
v-for="message in props.messages"
|
6
|
+
:key="message.id"
|
7
|
+
class="message"
|
8
|
+
:class="message.esCliente ? 'message-left' : 'message-right'"
|
9
|
+
>
|
10
|
+
<div class="message-container">
|
11
|
+
<div v-if="message.error && message.esCliente" class="btn-container">
|
12
|
+
<button
|
13
|
+
text
|
14
|
+
rounded
|
15
|
+
class="btn-danger"
|
16
|
+
icon="fa-solid fa-circle-exclamation"
|
17
|
+
aria-label="Cancel"
|
18
|
+
@click="emit('retry', message)"
|
19
|
+
>
|
20
|
+
<DangerIcon />
|
21
|
+
</button>
|
22
|
+
</div>
|
23
|
+
<div class="chat-message">
|
24
|
+
<div class="bubble" :class="message.esCliente ? 'left' : 'right'">
|
25
|
+
<div :class="message.esCliente ? 'content-left' : 'content-right'">
|
26
|
+
<div class="message-text">
|
27
|
+
{{ message.message }}
|
28
|
+
</div>
|
29
|
+
<div class="detail-message flex justify-content-between">
|
30
|
+
<span class="mr-5" v-if="message.sender?.nombreCompleto">
|
31
|
+
{{ message.sender?.nombreCompleto }}
|
32
|
+
</span>
|
33
|
+
<span class="mr-5" v-else> </span>
|
34
|
+
<span>
|
35
|
+
{{
|
36
|
+
DateTime.fromISO(message.createdAt).toFormat(
|
37
|
+
"dd-MM-yyyy HH:mm"
|
38
|
+
)
|
39
|
+
}}
|
40
|
+
</span>
|
41
|
+
</div>
|
40
42
|
</div>
|
41
43
|
</div>
|
42
44
|
</div>
|
@@ -99,8 +101,7 @@ watch(
|
|
99
101
|
--t: 30px;
|
100
102
|
/* the size of the tail */
|
101
103
|
|
102
|
-
|
103
|
-
min-width: 250px;
|
104
|
+
width: 100%;
|
104
105
|
padding: calc(2 * var(--r) / 3);
|
105
106
|
-webkit-mask: radial-gradient(var(--t) at var(--_d) 0, #0000 98%, #000 102%)
|
106
107
|
var(--_d) 100% / calc(100% - var(--r)) var(--t) no-repeat,
|
@@ -119,11 +120,11 @@ watch(
|
|
119
120
|
}
|
120
121
|
|
121
122
|
.left {
|
123
|
+
--_d: 0%;
|
122
124
|
border-left: var(--t) solid #0000;
|
123
|
-
margin-right:
|
125
|
+
margin-right: 0;
|
124
126
|
background-color: #fcd7ae;
|
125
127
|
color: #4d4d4d;
|
126
|
-
place-self: start;
|
127
128
|
}
|
128
129
|
|
129
130
|
.bubble > .content-left {
|
@@ -132,11 +133,11 @@ watch(
|
|
132
133
|
}
|
133
134
|
|
134
135
|
.right {
|
136
|
+
--_d: 100%;
|
135
137
|
border-right: var(--t) solid #0000;
|
136
|
-
margin-
|
138
|
+
margin-right: 0;
|
137
139
|
background-color: #fdeedb;
|
138
140
|
color: #4d4d4d;
|
139
|
-
place-self: end;
|
140
141
|
}
|
141
142
|
|
142
143
|
.bubble > .content-right {
|
@@ -144,9 +145,7 @@ watch(
|
|
144
145
|
margin-right: 10px;
|
145
146
|
}
|
146
147
|
|
147
|
-
.message {
|
148
|
-
text-align: initial;
|
149
|
-
word-break: break-all;
|
148
|
+
.message-text {
|
150
149
|
margin-bottom: 10px;
|
151
150
|
}
|
152
151
|
.detail-message {
|
@@ -157,21 +156,21 @@ watch(
|
|
157
156
|
}
|
158
157
|
|
159
158
|
.chat-message {
|
160
|
-
max-width: 90%;
|
161
|
-
min-width: 90%;
|
162
159
|
display: flex;
|
163
160
|
flex-direction: column;
|
164
161
|
justify-content: center;
|
165
162
|
margin-bottom: 0.5rem;
|
166
|
-
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 20%); */
|
167
163
|
}
|
168
164
|
|
169
|
-
.message
|
165
|
+
.message {
|
166
|
+
width: 100%;
|
170
167
|
display: flex;
|
168
|
+
}
|
169
|
+
|
170
|
+
.message-left {
|
171
171
|
justify-content: start;
|
172
172
|
}
|
173
173
|
.message-right {
|
174
|
-
display: flex;
|
175
174
|
justify-content: end;
|
176
175
|
}
|
177
176
|
.target {
|
@@ -205,6 +204,11 @@ watch(
|
|
205
204
|
}
|
206
205
|
|
207
206
|
.message-container {
|
208
|
-
|
207
|
+
min-width: 80%;
|
208
|
+
max-width: 80%;
|
209
|
+
}
|
210
|
+
|
211
|
+
.messages-container-list {
|
212
|
+
width: 100%;
|
209
213
|
}
|
210
214
|
</style>
|
@@ -1,6 +1,14 @@
|
|
1
1
|
<template>
|
2
|
-
<div
|
3
|
-
|
2
|
+
<div
|
3
|
+
class="widget-css-reset widget-container"
|
4
|
+
:class="isDarkMode ? 'chat-dark-mode' : ''"
|
5
|
+
>
|
6
|
+
<div
|
7
|
+
id="chat-circle"
|
8
|
+
@click="toggleChat"
|
9
|
+
class="widget-container"
|
10
|
+
v-show="!isChatBoxVisible"
|
11
|
+
>
|
4
12
|
<div class="new-message-badge" v-if="newMessages">
|
5
13
|
{{ newMessages > 9 ? "9+" : newMessages }}
|
6
14
|
</div>
|
@@ -46,11 +54,17 @@ defineProps({
|
|
46
54
|
}>,
|
47
55
|
required: true,
|
48
56
|
},
|
57
|
+
isDarkMode: {
|
58
|
+
type: Boolean,
|
59
|
+
default: false,
|
60
|
+
},
|
49
61
|
});
|
50
62
|
</script>
|
63
|
+
<style>
|
64
|
+
@import url(../style.css);
|
65
|
+
</style>
|
51
66
|
|
52
67
|
<style scoped>
|
53
|
-
@import url(../style.css);
|
54
68
|
.widget-container {
|
55
69
|
position: relative;
|
56
70
|
}
|