vue-wiguet-chatweb 0.0.10 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Chat.vue.d.ts +28 -6
- package/dist/components/Loader.vue.d.ts +2 -0
- package/dist/components/MessageList.vue.d.ts +28 -0
- package/dist/components/Widget.vue.d.ts +21 -9
- package/dist/dto/app.dto.d.ts +81 -0
- package/dist/resources/functions.helpers.d.ts +1 -2
- package/dist/store/index.d.ts +13 -3
- package/dist/style.css +1 -1
- package/dist/vue-wiguet-chatweb.js +7771 -4841
- package/dist/vue-wiguet-chatweb.umd.cjs +5 -14
- package/package.json +8 -6
- package/src/components/Chat.vue +1 -2
- package/src/components/MessageList.vue +56 -51
- package/src/components/Widget.vue +17 -3
- package/dist/components/ChatMessage.vue.d.ts +0 -12
- /package/dist/components/{IconUser.vue.d.ts → DangerIcon.vue.d.ts} +0 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vue-wiguet-chatweb",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.12",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -29,14 +29,16 @@
|
|
29
29
|
"build": "vue-tsc && vite build",
|
30
30
|
"preview": "vite preview"
|
31
31
|
},
|
32
|
-
"
|
33
|
-
"@vueuse/core": "^10.
|
32
|
+
"peerDependencies": {
|
33
|
+
"@vueuse/core": "^10.0.0",
|
34
34
|
"axios": "^1.4.0",
|
35
|
-
"luxon": "^3.
|
36
|
-
"socket.io-client": "^4.7.2",
|
35
|
+
"luxon": "^3.0.0",
|
37
36
|
"uuid": "^9.0.1",
|
37
|
+
"vue": "^3.2.0"
|
38
|
+
},
|
39
|
+
"dependencies": {
|
40
|
+
"socket.io-client": "^4.7.2",
|
38
41
|
"vite-plugin-dts": "^3.4.0",
|
39
|
-
"vue": "^3.3.4",
|
40
42
|
"vue-rabbit-frontend": "^0.0.15"
|
41
43
|
},
|
42
44
|
"devDependencies": {
|
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,8 +156,6 @@ 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;
|
@@ -166,12 +163,15 @@ watch(
|
|
166
163
|
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 20%); */
|
167
164
|
}
|
168
165
|
|
169
|
-
.message
|
166
|
+
.message {
|
167
|
+
width: 100%;
|
170
168
|
display: flex;
|
169
|
+
}
|
170
|
+
|
171
|
+
.message-left {
|
171
172
|
justify-content: start;
|
172
173
|
}
|
173
174
|
.message-right {
|
174
|
-
display: flex;
|
175
175
|
justify-content: end;
|
176
176
|
}
|
177
177
|
.target {
|
@@ -205,6 +205,11 @@ watch(
|
|
205
205
|
}
|
206
206
|
|
207
207
|
.message-container {
|
208
|
-
|
208
|
+
min-width: 80%;
|
209
|
+
max-width: 80%;
|
210
|
+
}
|
211
|
+
|
212
|
+
.messages-container-list {
|
213
|
+
width: 100%;
|
209
214
|
}
|
210
215
|
</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
|
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
2
|
-
message: {
|
3
|
-
type: ObjectConstructor;
|
4
|
-
required: true;
|
5
|
-
};
|
6
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
7
|
-
message: {
|
8
|
-
type: ObjectConstructor;
|
9
|
-
required: true;
|
10
|
-
};
|
11
|
-
}>>, {}, {}>;
|
12
|
-
export default _default;
|
File without changes
|