vue-wiguet-chatweb 0.1.16 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Chat.vue.d.ts +2 -1
- package/dist/components/MessageList.vue.d.ts +3 -2
- package/dist/components/Widget.vue.d.ts +2 -1
- package/dist/components/__tests__/MessageList.spec.d.ts +1 -0
- package/dist/dto/app.dto.d.ts +9 -0
- package/dist/store/index.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/vue-wiguet-chatweb.js +2291 -2191
- package/dist/vue-wiguet-chatweb.umd.cjs +6 -6
- package/package.json +4 -2
- package/src/assets/emojis/AngryIcon.svg +4 -0
- package/src/assets/emojis/HappiestIcon.svg +4 -0
- package/src/assets/emojis/HappyIcon.svg +4 -0
- package/src/assets/emojis/NeutralIcon.svg +4 -0
- package/src/assets/emojis/SadIcon.svg +4 -0
- package/src/components/Chat.vue +122 -34
- package/src/components/MessageList.vue +103 -3
- package/src/components/Widget.vue +2 -1
- package/src/components/__tests__/MessageList.spec.ts +47 -0
package/package.json
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "vue-wiguet-chatweb",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.18",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
7
|
-
"src/components/"
|
7
|
+
"src/components/",
|
8
|
+
"src/assets/"
|
8
9
|
],
|
9
10
|
"main": "./dist/vue-wiguet-chatweb.umd.cjs",
|
10
11
|
"module": "./dist/vue-wiguet-chatweb.js",
|
@@ -56,6 +57,7 @@
|
|
56
57
|
"@types/uuid": "^10.0.0",
|
57
58
|
"@vitejs/plugin-vue": "^5.2.1",
|
58
59
|
"@vitest/coverage-v8": "^2.1.8",
|
60
|
+
"@vue/test-utils": "^2.4.6",
|
59
61
|
"jsdom": "^25.0.1",
|
60
62
|
"typescript": "^5.0.2",
|
61
63
|
"vite": "^5.4.11",
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg version="1.1" viewBox="0 0 2048 2048" width="512" height="512" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path transform="translate(936)" d="m0 0h176v3h16l20 1 10 3 17 1 12 3 14 1 8 3 16 1 7 3 12 2 7 2 13 2 5 2 11 2 5 2 11 2 9 3 8 3 11 2 8 3 16 5 9 3 11 4 12 5 8 3 12 5 9 3 7 3 9 3 32 16 12 4 16 8 15 8 9 6 16 8 11 6 9 6 11 6 9 6 11 6 9 6 10 7 21 14v2l4 2 11 7 10 7 7 6v2l4 2 9 6 7 6v2l4 2 9 6 7 6 4 4v2l4 2 7 6 6 4 7 6 4 4v2h2v2h2v2l4 2v2l4 2v2l4 2v2h2v2h2v2h2v2h2l6 7 6 5 6 7 6 5 6 7 6 5 7 8 5 6 3 5 5 5v2h2v2h2l7 8 5 6 3 5 1 3 3 1 9 11 3 5 9 10 4 5 3 5 7 11 10 12 3 5 7 11 6 9 7 10 9 16 6 9 6 11 5 8 12 23 7 11 8 15 8 18 5 13 10 19 5 12 7 20 5 12 5 13 6 15 3 10 3 11 3 7 2 7 2 6 1 8 3 7 2 7 2 6 1 9 2 2 2 14 2 2 2 18 2 2 2 14 2 2 1 6 1 16 2 1 2 23 2 2 1 6v21l4 1 1 38 3 1v175l-3 2-1 34-2 5-1 1-2 26-2 2-1 18-2 5-1 1-1 18-1 5h-2l-1 12-3 5-1 14-1 5h-2l-1 12-3 6-2 14h-2l-1 9-3 5-2 13-2 3-2 9-3 9-3 7-6 20-5 10-3 10-6 13-5 15-4 10-8 16-7 15-6 15-10 19-4 7-6 10-10 19-3 6-6 9-6 11-5 7-6 12-6 8-4 6-7 11-5 6-2 5-4 5-5 5-3 6-6 7-2 5-8 9-4 4h-2l-2 7-8 9-4 4h-2l-2 7-9 9-7 8-5 4-3 7-85 85h-5l-2 4-8 7-13 13-5 2-10 9-6 5-7 4-11 11-6 3-8 6-7 4-8 7-9 6-11 7-9 6-7 5-11 6-13 8-12 7-7 4-12 7-14 7-7 5-16 8-19 9-6 2-25 12-11 5-18 6-17 7-13 5-7 3-36 12-23 7-11 3-24 6-23 5-25 6-20 3-11 2-25 4-22 3-33 2-1 3h-176l-1-3-38-2-9-2-39-6-33-6-41-9-34-9-36-11-29-10-35-14-7-3-9-2-32-16-3-2-9-2-16-8-17-9-6-5-23-11-8-5-5-4-14-7-6-5-14-7-6-5-6-3-6-5-6-3-6-5-6-3-8-7v-2l-7-2-7-6-6-3-10-10-7-4-8-7-9-8-6-3-17-17-5-4-5-2-84-84-3-6-11-12-10-10-3-6-11-12-3-4-3-5-9-10-4-5-3-5-5-7-3-5-9-11-3-5-6-9-7-10-7-11-8-14-5-7-6-12-6-8-8-16-7-13-5-7-8-16-8-17-3-9-8-16-9-19-7-21-5-11-5-14-4-10-15-45-3-12-6-20-5-22-2-5-2-15-3-10-3-12-2-18-2-5-2-19-2-8-2-20-2-5-1-36-3-1v-175l3-3 1-30 1-7 2-4 1-20 3-7 1-16 3-12 2-16 5-18 3-18 2-5 2-11 5-18 5-16 3-12 16-48 4-8 4-12 5-11 7-21 16-32 3-10 13-26 12-20 4-8 8-15 5-7 6-12 6-8 6-12 6-8 6-9 7-11 3-3 3-6 8-9 6-10 3-3 3-6 13-14 3-6 8-9h2l5-10 7-7 2-3h2l2-4 9-9 2-5 11-11 2-3h2l2-4h2l2-4 6-5 6-7 6-5 5-6 7-6 2-3h2l2-4h2l2-4h2l2-4h2l2-4h2l1-3 8-7 6-5 6-4 9-9 8-7 5-4 6-4 12-11 9-6 11-10 10-6 11-8 9-7 33-22 17-10 13-8 7-4 10-6 19-10 7-4 10-6 19-10 9-4 9-3 32-16 11-3 2-2 10-2 2-2 7-3 11-3 2-2 7-3 11-3 2-2 10-2 2-2 10-2 2-2 10-2 2-2 11-1 5-3 10-2 2-2 14-2 3-2 13-2 4-2 16-2 2-2 14-2 3-2 17-1 5-2 1-1 18-1 8-3 25-1 1-3 38-1zm-424 579-18 1-19 10-12 12-4 7-7 14v35l9 17 11 12 8 7 9 6 7 7 8 7 9 6 6 5 5 5 9 6 6 5 5 5 9 6 5 5h2v2l9 6 8 7 5 5h2v2l9 6 8 7 2 2 1 5-4 2-5 5-6 3-10 9-24 24v2h-2l-3 7-6 7-3 6-6 9-7 14-6 20-2 3-2 13-2 2v69l2 3 3 15 4 12 5 13 7 12 10 17 7 10 9 10 18 18 10 8 9 6 16 9 9 6 6 3 9 2 9 3 7 3 10 1 6 3h62l6-2 1-1 11-1 5-3 10-2 2-2 10-2 9-5 9-6 11-6 9-6 11-9 13-13 5-6 5-5 5-6 6-9 6-10 3-6 6-9 4-11 7-20 1-9 3-8v-65l-3-5-2-13-3-8-6-17-8-16-6-10-6-7-4-6-9-10-26-26-5-4-6-3-13-13-5-4-6-3-9-9-5-4-6-3-9-9-5-4-6-3-9-9-5-4-6-3-13-13-5-4-6-3-9-9-5-4-6-3-9-9-5-4-6-3-9-9-5-4-6-3-13-13-5-4-6-3-10-10-7-4-8-7-9-8-6-3-10-10-7-4-11-9-5-3-13-7zm1006 1-19 10-8 8-6 3-10 9-6 5-7 4-11 11-6 3-10 9-6 5-5 3-10 9-8 8-5 2-10 9-6 5-7 4-11 11-6 3-10 9-5 5-5 2-12 11-7 7-5 2-10 9-6 5-7 4-11 11-6 3-10 9-6 5-7 4-11 11-6 3-10 9-36 36-4 7-7 10-12 24-3 10-4 12-2 10-2 5-1 1v69l2 3 3 15 4 12 5 13 7 12 10 17 7 10 9 10 18 18 10 8 9 6 16 9 9 6 6 3 9 2 9 3 7 3 10 1 6 3h62l6-2 1-1 11-1 5-3 10-2 2-2 10-2 9-5 9-6 11-6 9-6 11-9 13-13 5-6 5-5 5-6 6-9 6-10 3-6 6-9 4-11 7-20 1-9 3-8v-65l-3-5-2-13-3-8-6-17-7-14-6-8-3-5-5-7-3-5-9-10-22-22-5-4-6-3-5-5h-2l-1-4 3-5 8-6 6-4 8-7v-2l4-2 6-5 6-4 12-11 8-5 12-11 8-5 12-11 8-5 7-6 5-5 6-5 9-6v-2l4-2 1-3 4-2 7-9 7-14 1-4v-32l-8-17-12-13-8-6-14-7zm-495 827-4 4-53 1-3 2-23 2-5 2-16 2-5 2-15 2-4 2-15 3-42 14-10 4-19 9-3 2-8 2-20 11-4 3-14 7-18 10-7 7-8 4-11 8-7 5-5 3-10 9-7 7-6 3-10 9-16 16-4 7-7 13v36l9 17 9 10h2v2l9 6 13 7h34l19-9 13-12 9-6 9-9 9-7 18-12 8-7 23-12 9-6 16-8 5-3 9-2 2-2 7-3 11-3 2-2 10-2 2-2 10-2 3-2 13-2 3-2 13-2 4-2 16-1 5-2 1-1h110l1 2 4 1 16 1 8 3 12 2 5 2 11 2 8 3 16 5 8 3 16 7 11 4 16 8 9 6 19 10 6 4 3 1 1 3 11 7 9 6 8 7 6 5 5 5 9 6 5 5h2v2l9 6 13 7h34l19-9 10-9 7-9 7-14 1-3v-34l-9-17-11-12-13-13-5-4-6-3-14-14-7-4-9-7-6-3-6-5-6-3-6-5-6-3-6-5-21-10-7-6-16-8-9-2-28-14-10-3-36-12-30-7-29-6-23-2-7-2-51-1-2-4z" fill="#CA2E22"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg version="1.1" viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path transform="translate(988)" d="m0 0h72l44 2 48 5 35 5 44 8 35 8 42 11 29 9 21 7 23 8 10 4 32 13 19 8 15 7 32 16 27 14 23 13 23 14 19 12 12 8 16 11 17 12 6 4v2l5 2 14 11 10 8 14 11 13 11 12 11 11 9 8 8 8 7 48 48 7 8 11 12 7 8 11 13 11 14 10 12 10 13 5 7v2h2l12 17 11 16 10 15 14 22 9 15 11 19 9 16 15 29 13 26 13 29 11 27 8 20 9 26 7 21 11 37 7 27 6 25 8 40 6 39 3 24 4 38 2 44v72l-2 44-5 48-5 35-8 44-8 35-11 42-9 29-7 21-10 28-15 37-11 25-16 33-12 24-11 20-14 24-13 21-9 14-10 15-9 13-13 18-1 2h-2l-2 5-11 14-8 10-11 14-11 13-10 11-9 11-9 9-7 8-48 48-8 7-11 10-8 7-10 9-9 7-16 13-14 11-11 8h-2v2l-17 12-16 11-15 10-19 12-18 11-17 10-10 6-12 6-19 10-32 16-29 13-27 11-15 6-17 6-20 7-25 8-34 10-36 9-39 8-41 7-32 4-38 4-44 2h-72l-44-2-48-5-35-5-44-8-35-8-42-11-29-9-21-7-23-8-10-4-32-13-19-8-15-7-32-16-27-14-23-13-23-14-19-12-12-8-16-11-17-12-6-4v-2l-5-2-14-11-10-8-14-11-13-11-12-11-11-9-8-8-8-7-48-48-7-8-11-12-7-8-11-13-11-14-10-12-10-13-5-7v-2h-2l-12-17-11-16-10-15-14-22-9-15-11-19-9-16-15-29-13-26-13-29-11-27-8-20-9-26-7-21-11-37-7-27-6-25-8-40-6-39-3-24-4-38-2-44v-72l2-44 5-48 5-35 8-44 8-35 11-42 9-29 7-21 10-28 15-37 11-25 16-33 13-26 10-18 14-24 13-21 9-14 10-15 9-13 13-18 1-2h2l2-5 11-14 8-10 11-14 11-13 10-11 9-11 9-9 7-8 48-48 8-7 11-10 8-7 10-9 9-7 16-13 14-11 11-8h2v-2l17-12 16-11 15-10 19-12 21-13 23-13 22-12 32-16 21-10 30-13 30-12 17-6 20-7 25-8 34-10 36-9 39-8 41-7 32-4 38-4zm-288 579-17 3-20 6-16 8-14 9-13 11-8 8-10 13-10 17-6 15-5 18-2 13v25l3 18 7 21 11 21 10 13 11 12 11 9 13 9 19 9 16 5 16 3h33l16-3 18-6 16-8 11-7 10-8 16-16 9-13 6-10 8-19 5-18 2-16v-18l-2-15-6-21-5-12-7-13-11-15-12-13-14-11-13-8-17-8-21-6-13-2zm623 0-17 3-17 5-21 10-13 9-14 12-10 11-12 18-8 17-5 16-3 16-1 8v18l2 15 6 21 8 18 7 11 9 12 17 17 13 9 10 6 19 8 18 5 8 1h33l16-3 16-5 19-9 17-12 14-13 11-14 8-13 8-17 6-21 2-13v-25l-3-18-7-21-8-16-8-12-11-13-8-8-13-10-17-10-15-6-18-5-13-2zm-859 378-16 3-12 5-10 7-9 8-7 10-6 13-2 6-1 7v34l1 21 5 44 5 28 6 28 5 20 9 28 10 29 13 31 7 15 14 27 12 21 6 9 5 9 13 19 12 17 11 14 14 17 11 12 9 11 30 30 11 9 7 7 11 9 16 13 19 14 27 18 31 19 14 7 19 10 29 13 25 10 33 11 21 6 28 7 31 6 20 3 36 4 21 1h52l21-1 44-5 28-5 28-6 20-5 28-9 29-10 31-13 15-7 29-15 19-11 9-6 9-5 19-13 17-12 14-11 17-14 12-11 11-9 30-30 9-11 7-7 9-11 13-16 14-19 18-27 8-13 10-17 14-26 9-19 13-30 11-30 8-26 5-18 8-36 6-36 4-36 1-21v-34l-2-10-5-13-7-10-8-9-10-7-12-6-12-3-14-1-17 3-16 8-6 4v2l-3 1v2l-4 2-8 11-5 10-3 10-1 8-2 46-3 28-6 35-8 32-12 36-13 31-13 27-9 16-14 23-20 28-8 10-9 11-13 15-32 32-11 9-12 10-14 11-13 9-15 10-25 15-29 15-19 8-11 5-23 8-15 5-25 7-29 6-19 3-28 3-22 1h-36l-34-2-35-5-29-6-29-8-34-12-25-11-25-12-18-10-19-12-12-8-22-16-11-9-15-13-8-7-30-30-9-11-10-12-10-13-10-14-10-15-9-15-8-14-13-25-14-33-7-20-5-15-7-26-4-18-5-29-3-28-2-46-2-12-5-13-7-10-5-6h-2l-1-3h-2v-2l-13-8-13-5-13-2z" fill="#3A8C03"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg version="1.1" viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path transform="translate(932)" d="m0 0h184v3h15l18 1 3 1v2l28 1 9 3 16 1 8 3 12 1 8 3 11 2 7 2 13 2 5 2 11 2 5 2 11 2 9 3 10 3 9 2 8 3 16 5 9 3 7 3 21 7 11 5 11 4 9 4 11 4 24 12 10 3 46 23 8 6 16 8 9 6 16 9 9 6 11 6 9 6 10 7 21 14v2l4 2 11 7 10 7 7 6v2l4 2 12 8v2l4 2 9 6 7 6 4 4v2l4 2 7 6 6 4 7 6 4 4v2h2v2h2v2l4 2v2l4 2v2l4 2v2l4 2v2h2v2h2l6 7 6 5 6 7 6 5 6 7 6 5 6 7 13 13 3 6 6 6v2h2v2h2l7 8 5 6 3 5 9 11 3 5 9 10 4 5 3 5 7 11 10 12 3 5 7 11 6 9 7 10 8 14 7 11 6 9 8 15 6 12 6 9 8 15 9 19 6 12 6 16 8 16 11 27 8 20 10 30 3 11 3 7 2 7 2 6 1 8 3 7 2 7 2 6 1 9 2 2 2 14 2 2 2 14 2 2 2 18 2 2 2 18 2 1 2 23 2 1 1 7v25l4 1 1 35h3v183l-3 2-1 30-2 5-1 1-1 22-1 8-2 2-1 18-2 5-1 1-1 15-1 4h-2l-1 12-3 5-1 15-1 4h-2l-1 12-3 6-2 14h-2l-1 9-3 5-2 13-2 3-2 9-3 9-3 7-3 10-4 12-3 10-6 13-4 11-10 24-8 16-8 20-8 16-10 19-4 7-6 10-9 17-6 9-6 11-5 7-6 12-6 8-4 6-7 11-5 6-2 5-4 5-5 5-3 6-6 7-2 5-8 9-4 4h-2l-2 7-10 11-2 5-7 7-1 2h-2l-2 4-8 7-4 8-93 93h-5l-2 4-8 7-12 12-6 3-10 9-6 3-10 9-4 4-6 3-8 6-7 4-8 7-9 6-11 7-9 6-7 5-11 6-9 6-11 6-9 6-12 6-13 8-19 10-26 13-20 8-22 11-17 6-7 3-17 6-15 6-36 12-23 7-11 3-24 6-54 12-23 4-14 2-13 2-22 3-29 2-1 3h-184l-1-3-34-2-9-2-39-6-33-6-41-9-34-9-36-11-29-10-15-6-17-6-10-5-9-2-16-8-11-6-9-2-32-16-17-9-6-5-21-10-7-6-14-7-6-5-14-7-6-5-6-3-6-5-6-3-6-5-6-3-8-7v-2l-7-2-7-6-6-3-9-9-5-4-6-3-10-9-6-3-17-17-5-4-5-2-92-92-3-6-11-12-10-10-3-6-9-10-3-6-11-12-3-4-3-5-5-7-3-5-9-11-3-5-6-9-7-10-7-11-8-14-5-7-6-12-6-8-7-14-12-20-13-26-5-12-4-10-11-22-5-12-5-13-6-16-5-14-4-10-15-45-3-12-6-20-5-22-3-10-4-18-1-8-2-5-2-15-2-6-2-18-2-9-1-17-2-7-1-4-1-32-3-1v-183l3-3 1-26 2-8 1-3 1-23 3-7 1-17 3-11 2-13 2-6 2-14 5-18 8-32 5-16 3-12 20-60 4-8 4-12 4-8 4-12 12-24 3-10 11-23 11-20 3-6 5-7 8-16 7-13 5-7 6-12 6-8 6-9 7-11 7-10 4-5 3-6 8-9 6-10 3-3 3-6 12-13 5-8 8-9 3-6 8-9h2l2-4 9-9 2-5 11-11 2-3h2l2-4h2l2-4 6-5 6-7 6-5 5-6 7-6 5-6 5-5h2l2-4h2l2-4h2l2-4h2l2-4h2l1-3 8-7 6-5 6-4 9-9 8-7 5-4 6-4 10-8 8-6 10-9 10-6 11-8 9-7 48-32 14-8 10-6 19-10 7-4 10-6 19-10 23-11 10-3 19-10 8-4 9-2 11-6 9-2 2-2 7-3 11-3 2-2 10-2 2-2 10-2 2-2 10-2 2-2 10-2 2-2 11-1 5-3 10-2 2-2 14-2 3-2 13-2 2-2 11-1 6-3 13-1 5-2 1-1 17-1 6-2 1-1 15-1 4-2 6-1 26-1 1-3 34-1zm-219 608-2 2-17 2-3 2-10 2-2 2-9 2-11 6-5 4-9 6-18 18-4 7-7 10-8 15-5 13-3 8v55l3 7 5 17 9 17 9 10 3 6 4 5 11 7 4 2 1 3 11 7 9 6 6 3 9 2 3 2 9 1v2l4 1h48l5-3 10-2 2-2 10-2 9-5 9-6 10-8 3-3 5-2 5-5 2-5 7-7 7-9 4-7 5-14 7-21v-53l-3-6-3-9-8-16-6-10-6-9-9-10-7-7-7-4-9-7-23-11-12-4-1-1-17-2-5-2zm600 0-2 2-17 2-3 2-10 2-2 2-9 2-8 6-7 4-4 3v2l-5 1-12 11-7 7-4 7-7 10-8 15-5 13-3 10v53l3 7 6 18 4 8 6 9 12 15 3 5 5 4 6 4 3 1 1 3 11 7 9 6 6 3 9 2 3 2 9 1v2l4 1h48l5-3 10-2 2-2 10-2 9-5 9-6 10-8 3-3 5-2 5-5 2-5 7-7 7-9 4-7 5-14 7-21v-53l-3-6-3-9-8-16-6-10-6-9-9-10-7-7-7-4-9-7-23-11-12-4-1-1-17-2-5-2zm-807 604-19 10-12 12-4 7-6 12-2 12-3 5v8l3 5 1 11 5 9 9 10 3 6 5 5 8 9h2l2 4h2l2 4 12 12 3 6 10 10 10 7 9 9h2l2 4h2l2 4h2l2 4h2v2l8 7 9 6 5 5h2v2l9 6 5 4h2v2l9 6 10 7 6 4 8 7 14 7 8 6 13 7 9 6 62 31 9 3 9 4 10 5 9 2 8 3 16 5 8 3 16 5 9 3 8 3 11 2 5 2 11 2 7 2 13 2 7 2 15 1 7 3 23 1v2l9 1 30 1 1 2 4 1h77l7-2 1-1 28-1 10-1 2-2 21-1 6-2 1-1 17-1 6-2 1-1 18-2 2-2 14-2 2-2 14-2 2-2 10-2 2-2 11-1 5-3 10-2 2-2 10-2 2-2 7-3 11-3 2-2 8-3 7-2 23-11 38-19 15-8 9-6 11-6 9-6 11-6 9-8 8-5 11-7 9-8 8-5 12-11 8-5 13-13 6-5 5-5v-2l4-2 5-5 6-3 12-12 2-5 11-11 5-6 6-5 7-8 5-5 3-6 8-9 5-10 1-11 3-4v-7l-3-7-2-11-8-16-11-12-8-6-14-7h-33l-2 2-9 2-11 6-14 14-3 7-42 42v2l-4 2-18 18-5 2-12 11-4 3-7 4-7 7-6 3-10 9-6 3-9 6-14 8-4 3-12 6-13 8-19 10-9 3-19 9-14 5-10 4-7 3-11 3-6 2-7 3-12 2-8 3-9 3-15 2-4 2-16 2-4 2-21 2-3 2-31 2h-7l-1 3h-70l-10-1-2-2-24-1-34-5-44-9-29-8-35-12-25-10-5-3-7-3-6-2-5-2-4-2-1-3-10-2-3-3h-2v-2l-17-8-8-5-5-4-7-3-10-6-3-3-6-3-7-6-3-3-6-3-7-6-3-3-6-3-9-9-5-4-5-2-63-63-3-6-9-10-7-4-9-7-9-2-3-2z" fill="#8CBF50"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg version="1.1" viewBox="0 0 2048 2048" width="512" height="512" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path transform="translate(936)" d="m0 0h176v3h16l20 1 10 3 17 1 12 3 14 1 8 3 16 1 7 3 12 2 7 2 13 2 5 2 11 2 5 2 11 2 9 3 8 3 11 2 8 3 16 5 9 3 11 4 12 5 8 3 12 5 9 3 7 3 9 3 32 16 12 4 16 8 15 8 9 6 16 8 11 6 9 6 11 6 9 6 11 6 9 6 10 7 21 14v2l4 2 11 7 10 7 7 6v2l4 2 9 6 7 6v2l4 2 9 6 7 6 4 4v2l4 2 7 6 6 4 7 6 4 4v2h2v2h2v2l4 2v2l4 2v2l4 2v2h2v2h2v2h2v2h2l6 7 6 5 6 7 6 5 6 7 6 5 7 8 5 6 3 5 5 5v2h2v2h2l7 8 5 6 3 5 1 3 3 1 9 11 3 5 9 10 4 5 3 5 7 11 10 12 3 5 7 11 6 9 7 10 9 16 6 9 6 11 5 8 12 23 7 11 8 15 8 18 5 13 10 19 5 12 7 20 5 12 5 13 6 15 3 10 3 11 3 7 2 7 2 6 1 8 3 7 2 7 2 6 1 9 2 2 2 14 2 2 2 18 2 2 2 14 2 2 1 6 1 16 2 1 2 23 2 2 1 6v21l4 1 1 38 3 1v175l-3 2-1 34-2 5-1 1-2 26-2 2-1 18-2 5-1 1-1 18-1 5h-2l-1 12-3 5-1 14-1 5h-2l-1 12-3 6-2 14h-2l-1 9-3 5-2 13-2 3-2 9-3 9-3 7-6 20-5 10-3 10-6 13-5 15-4 10-8 16-7 15-6 15-10 19-4 7-6 10-10 19-3 6-6 9-6 11-5 7-6 12-6 8-4 6-7 11-5 6-2 5-4 5-5 5-3 6-6 7-2 5-8 9-4 4h-2l-2 7-8 9-4 4h-2l-2 7-9 9-7 8-5 4-3 7-85 85h-5l-2 4-8 7-13 13-5 2-10 9-6 5-7 4-11 11-6 3-8 6-7 4-8 7-9 6-11 7-9 6-7 5-11 6-13 8-12 7-7 4-12 7-14 7-7 5-16 8-19 9-6 2-25 12-11 5-18 6-17 7-13 5-7 3-36 12-23 7-11 3-24 6-23 5-25 6-20 3-11 2-25 4-22 3-33 2-1 3h-176l-1-3-38-2-9-2-39-6-33-6-41-9-34-9-36-11-29-10-35-14-7-3-9-2-32-16-3-2-9-2-16-8-17-9-6-5-23-11-8-5-5-4-14-7-6-5-14-7-6-5-6-3-6-5-6-3-6-5-6-3-8-7v-2l-7-2-7-6-6-3-10-10-7-4-8-7-9-8-6-3-17-17-5-4-5-2-84-84-3-6-11-12-10-10-3-6-11-12-3-4-3-5-9-10-4-5-3-5-5-7-3-5-9-11-3-5-6-9-7-10-7-11-8-14-5-7-6-12-6-8-8-16-7-13-5-7-8-16-8-17-3-9-8-16-9-19-7-21-5-11-5-14-4-10-15-45-3-12-6-20-5-22-2-5-2-15-3-10-3-12-2-18-2-5-2-19-2-8-2-20-2-5-1-36-3-1v-175l3-3 1-30 1-7 2-4 1-20 3-7 1-16 3-12 2-16 5-18 3-18 2-5 2-11 5-18 5-16 3-12 16-48 4-8 4-12 5-11 7-21 16-32 3-10 13-26 12-20 4-8 8-15 5-7 6-12 6-8 6-12 6-8 6-9 7-11 3-3 3-6 8-9 6-10 3-3 3-6 13-14 3-6 8-9h2l5-10 7-7 2-3h2l2-4 9-9 2-5 11-11 2-3h2l2-4h2l2-4 6-5 6-7 6-5 5-6 7-6 2-3h2l2-4h2l2-4h2l2-4h2l2-4h2l1-3 8-7 6-5 6-4 9-9 8-7 5-4 6-4 12-11 9-6 11-10 10-6 11-8 9-7 33-22 17-10 13-8 7-4 10-6 19-10 7-4 10-6 19-10 9-4 9-3 32-16 11-3 2-2 10-2 2-2 7-3 11-3 2-2 7-3 11-3 2-2 10-2 2-2 10-2 2-2 10-2 2-2 11-1 5-3 10-2 2-2 14-2 3-2 13-2 4-2 16-2 2-2 14-2 3-2 17-1 5-2 1-1 18-1 8-3 25-1 1-3 38-1zm-323 644-2 2-11 3-1 1-9 2-19 10-8 8-5 2-12 11-2 2-2 6-7 7-6 10-5 11-3 9-3 11-2 3v52l3 7 5 17 9 17 10 12 3 5 4 5h2v2l9 6 11 9 19 10 9 2 3 2 9 1v2l4 1h48l5-3 10-2 2-2 10-2 17-9 11-9 6-4 7-6 4-5 3-6 8-9 5-9 5-14 7-21v-48l-4-11-6-17-7-14-9-10-3-6-9-10-11-7-9-8-16-8-11-3-6-2-7-3zm768 0-2 2-11 3-1 1-9 2-19 10-8 8-5 2-12 11-2 2-2 6-7 7-6 10-5 11-3 9-3 11-2 3v52l3 7 5 17 9 17 10 12 3 5 4 5h2v2l9 6 11 9 19 10 9 2 3 2 9 1v2l4 1h48l5-3 10-2 2-2 10-2 17-9 11-9 6-4 7-6 4-5 3-6 8-9 5-9 5-14 7-21v-48l-4-11-6-17-7-14-9-10-3-6-9-10-11-7-9-8-16-8-11-3-6-2-7-3zm-676 764-2 2-17 2-19 10-12 12-4 7-6 11-1 5v31l5 12 5 8 8 9h2v2l9 6 14 7 17 1v2l4 1h628l8-1 1-2 15-1 11-5 9-5 10-9v-2h2l6-10 5-10 1-3v-33l-8-17-12-13-8-6-14-7-11-1h-7v-2l-2-1z" fill="#E8A654"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg version="1.1" viewBox="0 0 2048 2048" width="512" height="512" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path transform="translate(936)" d="m0 0h176v3h16l20 1 10 3 17 1 12 3 14 1 8 3 16 1 7 3 12 2 7 2 13 2 5 2 11 2 5 2 11 2 9 3 8 3 11 2 8 3 16 5 9 3 11 4 12 5 8 3 12 5 9 3 7 3 9 3 32 16 12 4 16 8 15 8 9 6 16 8 11 6 9 6 11 6 9 6 11 6 9 6 10 7 21 14v2l4 2 11 7 10 7 7 6v2l4 2 9 6 7 6v2l4 2 9 6 7 6 4 4v2l4 2 7 6 6 4 7 6 4 4v2h2v2h2v2l4 2v2l4 2v2l4 2v2h2v2h2v2h2v2h2l6 7 6 5 6 7 6 5 6 7 6 5 7 8 5 6 3 5 5 5v2h2v2h2l7 8 5 6 3 5 1 3 3 1 9 11 3 5 9 10 4 5 3 5 7 11 10 12 3 5 7 11 6 9 7 10 9 16 6 9 6 11 5 8 12 23 7 11 8 15 8 18 5 13 10 19 5 12 7 20 5 12 5 13 6 15 3 10 3 11 3 7 2 7 2 6 1 8 3 7 2 7 2 6 1 9 2 2 2 14 2 2 2 18 2 2 2 14 2 2 1 6 1 16 2 1 2 23 2 2 1 6v21l4 1 1 38 3 1v175l-3 2-1 34-2 5-1 1-2 26-2 2-1 18-2 5-1 1-1 18-1 5h-2l-1 12-3 5-1 14-1 5h-2l-1 12-3 6-2 14h-2l-1 9-3 5-2 13-2 3-2 9-3 9-3 7-6 20-5 10-3 10-6 13-5 15-4 10-8 16-7 15-6 15-10 19-4 7-6 10-10 19-3 6-6 9-6 11-5 7-6 12-6 8-4 6-7 11-5 6-2 5-4 5-5 5-3 6-6 7-2 5-8 9-4 4h-2l-2 7-8 9-4 4h-2l-2 7-9 9-7 8-5 4-3 7-85 85h-5l-2 4-8 7-13 13-5 2-10 9-6 5-7 4-11 11-6 3-8 6-7 4-8 7-9 6-11 7-9 6-7 5-11 6-13 8-12 7-7 4-12 7-14 7-7 5-16 8-19 9-6 2-25 12-11 5-18 6-17 7-13 5-7 3-36 12-23 7-11 3-24 6-23 5-25 6-20 3-11 2-25 4-22 3-33 2-1 3h-176l-1-3-38-2-9-2-39-6-33-6-41-9-34-9-36-11-29-10-35-14-7-3-9-2-32-16-3-2-9-2-16-8-17-9-6-5-23-11-8-5-5-4-14-7-6-5-14-7-6-5-6-3-6-5-6-3-6-5-6-3-8-7v-2l-7-2-7-6-6-3-10-10-7-4-8-7-9-8-6-3-17-17-5-4-5-2-84-84-3-6-11-12-10-10-3-6-11-12-3-4-3-5-9-10-4-5-3-5-5-7-3-5-9-11-3-5-6-9-7-10-7-11-8-14-5-7-6-12-6-8-8-16-7-13-5-7-8-16-8-17-3-9-8-16-9-19-7-21-5-11-5-14-4-10-15-45-3-12-6-20-5-22-2-5-2-15-3-10-3-12-2-18-2-5-2-19-2-8-2-20-2-5-1-36-3-1v-175l3-3 1-30 1-7 2-4 1-20 3-7 1-16 3-12 2-16 5-18 3-18 2-5 2-11 5-18 5-16 3-12 16-48 4-8 4-12 5-11 7-21 16-32 3-10 13-26 12-20 4-8 8-15 5-7 6-12 6-8 6-12 6-8 6-9 7-11 3-3 3-6 8-9 6-10 3-3 3-6 13-14 3-6 8-9h2l5-10 7-7 2-3h2l2-4 9-9 2-5 11-11 2-3h2l2-4h2l2-4 6-5 6-7 6-5 5-6 7-6 2-3h2l2-4h2l2-4h2l2-4h2l2-4h2l1-3 8-7 6-5 6-4 9-9 8-7 5-4 6-4 12-11 9-6 11-10 10-6 11-8 9-7 33-22 17-10 13-8 7-4 10-6 19-10 7-4 10-6 19-10 9-4 9-3 32-16 11-3 2-2 10-2 2-2 7-3 11-3 2-2 7-3 11-3 2-2 10-2 2-2 10-2 2-2 10-2 2-2 11-1 5-3 10-2 2-2 14-2 3-2 13-2 4-2 16-2 2-2 14-2 3-2 17-1 5-2 1-1 18-1 8-3 25-1 1-3 38-1zm-323 644-2 2-11 3-1 1-9 2-19 10-8 8-5 2-12 11-2 2-2 6-7 7-6 10-5 11-3 9-3 11-2 3v52l3 7 5 17 9 17 10 12 3 5 4 5h2v2l9 6 11 9 19 10 9 2 3 2 9 1v2l4 1h48l5-3 10-2 2-2 10-2 17-9 11-9 6-4 7-6 4-5 3-6 8-9 5-9 5-14 7-21v-48l-4-11-6-17-7-14-9-10-3-6-9-10-11-7-9-8-16-8-11-3-6-2-7-3zm768 0-2 2-11 3-1 1-9 2-19 10-8 8-5 2-12 11-2 2-2 6-7 7-6 10-5 11-3 9-3 11-2 3v52l3 7 5 17 9 17 10 12 3 5 4 5h2v2l9 6 11 9 19 10 9 2 3 2 9 1v2l4 1h48l5-3 10-2 2-2 10-2 17-9 11-9 6-4 7-6 4-5 3-6 8-9 5-9 5-14 7-21v-48l-4-11-6-17-7-14-9-10-3-6-9-10-11-7-9-8-16-8-11-3-6-2-7-3zm-424 640-2 2-24 2-4 2-22 2-6 2-15 3-1 1-12 2-4 2-12 2-4 2-12 2-11 5-11 3-14 6-11 3-6 2-10 4-52 26-18 10-8 5-12 7-8 5-9 5-10 9-6 3-10 9-6 3-10 9-6 3-12 11-19 19-5 2-10 9-7 8-2 5-3 3v2h-2l-3 11-2 3v32l9 17 8 9 8 7 8 5 3 1v2l2 1 14 1v2l4 1h8l5-3 12-1 11-6 11-9 6-4 17-17 8-7 5-4 6-4 10-8 16-12 6-4 13-8 7-4 10-6 17-9 5-4 10-3 19-10 8-4 9-2 2-2 10-2 2-2 10-2 2-2 10-2 2-2 10-2 3-2 13-2 6-2 14-2 6-2 14-2 7-2 19-1 7-2 1-1h110l1 2 10 1 22 1v2l20 3 7 2 13 2 5 2 11 2 8 3 16 5 8 3 16 5 8 3 13 6 48 24 10 6 8 5 9 5 4 2 1 3 11 7 9 6 11 9 9 6 5 5h2l2 4h2l2 4h2l2 4h2l2 4h2v2l8 7 11 7 6 4h3v2l2 1h9l5 2 3 2 8-1 2-2 12-1 16-8 9-7 4-5 5-5 4-8 5-11v-30l-3-6-2-7-6-8-3-5-9-10-7-6-6-3-25-25-5-4-6-3-10-9-6-3-10-9-6-3-10-9-7-3-8-5-5-4-14-7-6-5-23-11-17-9-23-11-10-5-10-3-35-12-14-5-51-13-22-4-21-3-19-2-7-2z" fill="#C66021"/>
|
4
|
+
</svg>
|
package/src/components/Chat.vue
CHANGED
@@ -15,16 +15,18 @@
|
|
15
15
|
:canLoadMoreMessages="messagesData.canLoadMoreMessages"
|
16
16
|
@loadMore="getMessages"
|
17
17
|
@retry="retryMessage"
|
18
|
+
@on-qualifying="(args) => onQualifying(args)"
|
18
19
|
/>
|
19
20
|
</div>
|
20
21
|
|
21
22
|
<div class="w-full">
|
22
|
-
<form class="message-send" @submit.prevent="submitMessage">
|
23
|
+
<form class="message-send" @submit.prevent="(event) => submitMessage(event)">
|
23
24
|
<div class="form-message">
|
24
25
|
<div class="jl-inputgroup-chat">
|
25
26
|
<textarea
|
26
27
|
v-model="message"
|
27
28
|
class="jl2-input-chat"
|
29
|
+
placeholder="Escribe tu mensaje"
|
28
30
|
required
|
29
31
|
ref="textAreaRef"
|
30
32
|
@input="() => autoAdjustHeight()"
|
@@ -70,6 +72,7 @@ import {
|
|
70
72
|
getMessagesApi,
|
71
73
|
sendMessageApi,
|
72
74
|
setVistoToTrueApi,
|
75
|
+
updateMessageApi,
|
73
76
|
} from "../store/index";
|
74
77
|
import { getInformationApi } from "../store";
|
75
78
|
import MessageList from "./MessageList.vue";
|
@@ -96,6 +99,7 @@ const emit = defineEmits([
|
|
96
99
|
"new-message",
|
97
100
|
"clear-new-messages",
|
98
101
|
"not-viewed-total",
|
102
|
+
"onQualifying",
|
99
103
|
]);
|
100
104
|
|
101
105
|
const props = defineProps({
|
@@ -156,8 +160,8 @@ function saltoDeLineaOEnviar(event: KeyboardEvent) {
|
|
156
160
|
submitMessage(event);
|
157
161
|
}
|
158
162
|
|
159
|
-
|
160
|
-
if (message
|
163
|
+
function createMessage(message: string) {
|
164
|
+
if (message?.length > 300) {
|
161
165
|
emit("show-toast", {
|
162
166
|
severity: "warn",
|
163
167
|
summary: "Error",
|
@@ -167,7 +171,7 @@ const submitMessage = async (event: Event) => {
|
|
167
171
|
return;
|
168
172
|
}
|
169
173
|
|
170
|
-
if (!message.
|
174
|
+
if (!message.trim()) {
|
171
175
|
emit("show-toast", {
|
172
176
|
severity: "warn",
|
173
177
|
summary: "Error",
|
@@ -177,10 +181,10 @@ const submitMessage = async (event: Event) => {
|
|
177
181
|
return;
|
178
182
|
}
|
179
183
|
|
180
|
-
const newMessage = {
|
184
|
+
const newMessage: Message = {
|
181
185
|
id: uuidv4(),
|
182
186
|
chatId: information.value?.chat?.id,
|
183
|
-
message
|
187
|
+
message,
|
184
188
|
visto: true,
|
185
189
|
multimedia: false,
|
186
190
|
esCliente: true,
|
@@ -192,35 +196,98 @@ const submitMessage = async (event: Event) => {
|
|
192
196
|
ci: props.user.ci,
|
193
197
|
msPersonaId: props.user.msPersonaId,
|
194
198
|
},
|
199
|
+
response: undefined
|
195
200
|
};
|
201
|
+
|
202
|
+
return newMessage
|
203
|
+
}
|
196
204
|
|
197
|
-
|
205
|
+
function updateMessageStatus(
|
206
|
+
newMessage: Message,
|
207
|
+
idxMessageToCommunicate?: number,
|
208
|
+
messageSaved?: Message,
|
209
|
+
tipoCalificacionId?: number
|
210
|
+
) {
|
211
|
+
if (!idxMessageToCommunicate) throw new Error('idx is required')
|
198
212
|
|
199
|
-
|
200
|
-
if (
|
201
|
-
messagesData.value.data[
|
213
|
+
if (!messageSaved) {
|
214
|
+
if (tipoCalificacionId) {
|
215
|
+
const messageAResponder = messagesData.value.data[idxMessageToCommunicate]
|
216
|
+
messageAResponder.response = undefined
|
217
|
+
} else {
|
218
|
+
messagesData.value.data[idxMessageToCommunicate].error = {
|
202
219
|
error: true,
|
203
220
|
id: newMessage.id,
|
204
221
|
};
|
222
|
+
}
|
205
223
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
224
|
+
emit("show-toast", {
|
225
|
+
severity: "error",
|
226
|
+
summary: "Error",
|
227
|
+
detail: "Ocurrio un error al enviar el mensaje, intente nuevamente",
|
228
|
+
life: 5000,
|
229
|
+
});
|
230
|
+
|
231
|
+
return
|
232
|
+
}
|
233
|
+
|
234
|
+
let messageUpdated = { ...messageSaved, chatId: newMessage?.chatId }
|
235
|
+
|
236
|
+
if (tipoCalificacionId) {
|
237
|
+
const messageAResponder = messagesData.value.data[idxMessageToCommunicate]
|
238
|
+
messageAResponder.response = messageSaved
|
239
|
+
|
240
|
+
messageUpdated = { ...messageAResponder, chatId: newMessage?.chatId }
|
241
|
+
} else {
|
242
|
+
messagesData.value.data[idxMessageToCommunicate] = messageUpdated;
|
243
|
+
}
|
244
|
+
|
245
|
+
return messageUpdated;
|
246
|
+
}
|
247
|
+
|
248
|
+
const submitMessage = async (
|
249
|
+
event?: Event,
|
250
|
+
messageExtraData?: { mensajeARespondeId?: string, tipoCalificacionId?: number, codigoTipoMensaje?: number}
|
251
|
+
) => {
|
252
|
+
|
253
|
+
const newMessage = createMessage(message.value);
|
254
|
+
|
255
|
+
if (!newMessage) return;
|
256
|
+
|
257
|
+
let idxMessageToCommunicate = -1;
|
258
|
+
if (messageExtraData?.tipoCalificacionId) {
|
259
|
+
idxMessageToCommunicate = messagesData.value.data.findIndex((val) => val.id === messageExtraData?.mensajeARespondeId )
|
260
|
+
const messageAResponder = messagesData.value.data[idxMessageToCommunicate]
|
261
|
+
|
262
|
+
if ( messageAResponder ) {
|
263
|
+
messageAResponder.response = newMessage
|
223
264
|
}
|
265
|
+
} else {
|
266
|
+
idxMessageToCommunicate = messagesData.value.data.push(newMessage) - 1;
|
267
|
+
}
|
268
|
+
|
269
|
+
const body = {
|
270
|
+
message: message.value,
|
271
|
+
appChatId: appChatId.value,
|
272
|
+
...messageExtraData,
|
273
|
+
}
|
274
|
+
sendApi(body).then((messageSaved) => {
|
275
|
+
let messageUpdated = updateMessageStatus(
|
276
|
+
newMessage,
|
277
|
+
idxMessageToCommunicate,
|
278
|
+
messageSaved,
|
279
|
+
messageExtraData?.tipoCalificacionId
|
280
|
+
)
|
281
|
+
|
282
|
+
if(!messageUpdated) return
|
283
|
+
|
284
|
+
socketService.value?.emit(
|
285
|
+
"sendMessage",
|
286
|
+
{ roomId: information?.value?.appChat.id, message: messageUpdated },
|
287
|
+
(response: any) => {
|
288
|
+
console.log("🚀 ~ socketService.value.emit ~ response:", response);
|
289
|
+
}
|
290
|
+
);
|
224
291
|
});
|
225
292
|
|
226
293
|
message.value = "";
|
@@ -228,11 +295,10 @@ const submitMessage = async (event: Event) => {
|
|
228
295
|
textAreaRef.value && (textAreaRef.value.style.height = "20px");
|
229
296
|
};
|
230
297
|
|
231
|
-
const sendApi = async (
|
298
|
+
const sendApi = async (bodyParam: Omit<SendMessageBody, 'esCliente'>) => {
|
232
299
|
const body: SendMessageBody = {
|
300
|
+
...bodyParam,
|
233
301
|
esCliente: true,
|
234
|
-
message,
|
235
|
-
appChatId,
|
236
302
|
};
|
237
303
|
return sendMessageApi(body, props.tokenAuth);
|
238
304
|
};
|
@@ -267,7 +333,10 @@ const retryMessage = async (message: Message) => {
|
|
267
333
|
emit("show-confirm", async () => {
|
268
334
|
if (!message.error?.id) return;
|
269
335
|
|
270
|
-
const msg = await sendApi(
|
336
|
+
const msg = await sendApi({
|
337
|
+
message: message.message,
|
338
|
+
appChatId: appChatId.value
|
339
|
+
});
|
271
340
|
|
272
341
|
if (!msg) {
|
273
342
|
emit("show-toast", {
|
@@ -361,13 +430,19 @@ function connectMsWebSocket(
|
|
361
430
|
|
362
431
|
socketService.value.on("receiveMessage", (data: any) => {
|
363
432
|
console.log("Mensaje recibido:", data.message, userChat);
|
364
|
-
|
433
|
+
const indexMessage = messagesData.value.data.findIndex((msg) => msg.id === data.message.id);
|
434
|
+
|
365
435
|
if (
|
366
|
-
data.message.sender.msPersonaId === userChat?.chat?.persona?.msPersonaId
|
436
|
+
data.message.sender.msPersonaId === userChat?.chat?.persona?.msPersonaId && indexMessage === -1
|
367
437
|
)
|
368
438
|
return;
|
369
439
|
|
370
|
-
|
440
|
+
if (indexMessage !== -1) {
|
441
|
+
messagesData.value.data[indexMessage].response = data.message.response;
|
442
|
+
} else {
|
443
|
+
messagesData.value.data.push(data.message);
|
444
|
+
}
|
445
|
+
|
371
446
|
setVistoToTrueApi(data.message.appChatId, props.tokenAuth);
|
372
447
|
scrollToBottom();
|
373
448
|
!props.visible && emit("new-message");
|
@@ -413,6 +488,19 @@ function getOS() {
|
|
413
488
|
return os;
|
414
489
|
}
|
415
490
|
|
491
|
+
function onQualifying({ message: messageParam, emoji }: { message: Message, emoji: { iconUnicode: string, value: number } }) {
|
492
|
+
const callback = async () => {
|
493
|
+
if (!messageParam.id || !emoji) return;
|
494
|
+
|
495
|
+
message.value = emoji.iconUnicode
|
496
|
+
|
497
|
+
submitMessage(undefined, { tipoCalificacionId: emoji.value, mensajeARespondeId: messageParam.id }).then();
|
498
|
+
}
|
499
|
+
|
500
|
+
emit('onQualifying', callback)
|
501
|
+
};
|
502
|
+
|
503
|
+
|
416
504
|
onMounted(async () => {
|
417
505
|
if (appChatId.value) return;
|
418
506
|
|
@@ -26,7 +26,32 @@
|
|
26
26
|
<div class="chat-message">
|
27
27
|
<div class="bubble" :class="message.esCliente ? 'right' : 'left'">
|
28
28
|
<div :class="message.esCliente ? 'content-right' : 'content-left'">
|
29
|
-
<div
|
29
|
+
<div v-if="message.message === '😊😄🙂😐🙁'" class="flex gap-2" >
|
30
|
+
<div class="mb-2">
|
31
|
+
<strong style="display: block;">Ayúdanos a mejorar nuestro servicio.</strong>
|
32
|
+
<span>¿Que le pareció la atención?</span>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<a
|
36
|
+
v-for="emojiParam in emojis"
|
37
|
+
:key="emojiParam.value"
|
38
|
+
:href="!message.response ? 'javascript:' : undefined"
|
39
|
+
class="btn-icon"
|
40
|
+
:class="{ 'content-disabled' : !showIcon(message, emojiParam) }"
|
41
|
+
@click="!message.response && emit('onQualifying', { message, emoji: emojiParam })"
|
42
|
+
>
|
43
|
+
<div class="flex flex-col items-center">
|
44
|
+
<img :src="emojiParam.icon" alt="icono" class="icon" />
|
45
|
+
<span>{{ emojiParam.label }}</span>
|
46
|
+
</div>
|
47
|
+
</a>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div v-else-if="emoji[message.message ?? '']">
|
51
|
+
<img :src="emoji[message.message]" alt="icono" class="icon" />
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div v-else class="message-text" style="white-space: pre-line" v-html="textToRichFormat(message.message)"></div>
|
30
55
|
<div class="detail-message flex justify-content-between">
|
31
56
|
<span class="mr-5" v-if="message.sender?.nombreCompleto">
|
32
57
|
{{
|
@@ -53,13 +78,18 @@
|
|
53
78
|
</template>
|
54
79
|
|
55
80
|
<script setup lang="ts">
|
56
|
-
import { PropType, onBeforeMount, ref, watch } from
|
81
|
+
import { PropType, onBeforeMount, ref, watch, h } from 'vue';
|
57
82
|
import { useIntersectionObserver } from "@vueuse/core";
|
58
83
|
import { type Message } from "../dto/app.dto";
|
59
84
|
import { DateTime } from "luxon";
|
60
85
|
import DangerIcon from "./DangerIcon.vue";
|
86
|
+
import SadIcon from '../assets/emojis/SadIcon.svg'
|
87
|
+
import AngryIcon from '../assets/emojis/AngryIcon.svg'
|
88
|
+
import HappiestIcon from '../assets/emojis/HappiestIcon.svg'
|
89
|
+
import NeutralIcon from '../assets/emojis/NeutralIcon.svg'
|
90
|
+
import HappyIcon from '../assets/emojis/HappyIcon.svg'
|
61
91
|
|
62
|
-
const emit = defineEmits(["loadMore", "retry"]);
|
92
|
+
const emit = defineEmits(["loadMore", "retry", "onQualifying"]);
|
63
93
|
const props = defineProps({
|
64
94
|
messages: {
|
65
95
|
type: Array as PropType<Message[]>,
|
@@ -82,6 +112,12 @@ const { pause, resume } = useIntersectionObserver(
|
|
82
112
|
}
|
83
113
|
);
|
84
114
|
|
115
|
+
function showIcon(message: Message, emojiParam: any) {
|
116
|
+
if(!message.response || typeof message.response !=='object') return true;
|
117
|
+
|
118
|
+
return emojiParam.iconUnicode === message.response.message
|
119
|
+
}
|
120
|
+
|
85
121
|
onBeforeMount(() => {
|
86
122
|
if (!props.canLoadMoreMessages) {
|
87
123
|
pause();
|
@@ -135,6 +171,23 @@ function textToRichFormat(text: string) {
|
|
135
171
|
return newMessage().replace(/--custom-tag/g, '');
|
136
172
|
}
|
137
173
|
|
174
|
+
const emojis = [
|
175
|
+
{ label: 'Excelente', value: 1, icon: HappiestIcon, iconUnicode: '😊'},
|
176
|
+
{ label: 'Buena', value: 2, icon: HappyIcon, iconUnicode: '😄'},
|
177
|
+
{ label: 'Aceptable', value: 3, icon: NeutralIcon, iconUnicode: '🙂'},
|
178
|
+
{ label: 'Mala', value: 4, icon: SadIcon, iconUnicode: '😐'},
|
179
|
+
{ label: 'Muy Mala', value: 5, icon: AngryIcon, iconUnicode: '🙁'},
|
180
|
+
]
|
181
|
+
''
|
182
|
+
const emoji: { [key in string]: any } = {
|
183
|
+
'😊': HappiestIcon,
|
184
|
+
'😄': HappyIcon,
|
185
|
+
'🙂': NeutralIcon,
|
186
|
+
'😐': SadIcon,
|
187
|
+
'🙁': AngryIcon,
|
188
|
+
'': null
|
189
|
+
}
|
190
|
+
|
138
191
|
</script>
|
139
192
|
|
140
193
|
<style scoped>
|
@@ -260,4 +313,51 @@ function textToRichFormat(text: string) {
|
|
260
313
|
.messages-container-list {
|
261
314
|
width: 100%;
|
262
315
|
}
|
316
|
+
|
317
|
+
.icon {
|
318
|
+
width: 2rem;
|
319
|
+
}
|
320
|
+
|
321
|
+
.btn-icon {
|
322
|
+
text-decoration: none;
|
323
|
+
border: none;
|
324
|
+
color: rgb(156 163 175 / 1);
|
325
|
+
}
|
326
|
+
|
327
|
+
.btn-icon:hover:not(.content-disabled) {
|
328
|
+
color: rgb(31 41 55 / 1);
|
329
|
+
}
|
330
|
+
|
331
|
+
.btn-icon span {
|
332
|
+
text-wrap: nowrap;
|
333
|
+
}
|
334
|
+
|
335
|
+
.btn-icon .icon {
|
336
|
+
font-size: 2rem;
|
337
|
+
}
|
338
|
+
|
339
|
+
.flex {
|
340
|
+
display: flex;
|
341
|
+
flex-wrap: wrap;
|
342
|
+
}
|
343
|
+
.flex-col {
|
344
|
+
flex-direction: column;
|
345
|
+
}
|
346
|
+
.items-center {
|
347
|
+
align-items: center;
|
348
|
+
}
|
349
|
+
.gap-2 {
|
350
|
+
gap: 0.5rem;
|
351
|
+
}
|
352
|
+
|
353
|
+
.mb-2 {
|
354
|
+
margin-bottom: 8px;
|
355
|
+
}
|
356
|
+
|
357
|
+
.content-disabled {
|
358
|
+
-webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */
|
359
|
+
filter: grayscale(1); /* Microsoft Edge and Firefox 35+ */
|
360
|
+
opacity: 0.5;
|
361
|
+
}
|
362
|
+
|
263
363
|
</style>
|
@@ -50,6 +50,7 @@
|
|
50
50
|
@clear-new-messages="newMessages = 0"
|
51
51
|
@new-message="() => newMessages++"
|
52
52
|
@not-viewed-total="(val) => (newMessages = val)"
|
53
|
+
@on-qualifying="(args)=> emit('onQualifying', args)"
|
53
54
|
/>
|
54
55
|
</div>
|
55
56
|
</div>
|
@@ -63,7 +64,7 @@ import IconTelegram from "./IconTelegram.vue";
|
|
63
64
|
import IconWhatsApp from "./IconWhatsApp.vue";
|
64
65
|
import IconChat from "./IconChat.vue";
|
65
66
|
|
66
|
-
const emit = defineEmits(["show-toast", "show-confirm"]);
|
67
|
+
const emit = defineEmits(["show-toast", "show-confirm", "onQualifying"]);
|
67
68
|
|
68
69
|
const enum MeansCommunication{
|
69
70
|
WHATSAPP,
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { expect, it } from "vitest";
|
2
|
+
import MessageList from "../MessageList.vue";
|
3
|
+
import { describe } from "node:test";
|
4
|
+
import { shallowMount } from "@vue/test-utils";
|
5
|
+
|
6
|
+
describe("MessageList", () => {
|
7
|
+
const message =
|
8
|
+
"-*abc~*ad~aw _awd_ a ~testaaaaaa~* wdawdaw *aaaa_bbb_bbbbbbb* http://www.web.bo/notificacion";
|
9
|
+
|
10
|
+
it("is defined", () => {
|
11
|
+
expect(MessageList).toBeDefined();
|
12
|
+
});
|
13
|
+
|
14
|
+
describe("rich text", () => {
|
15
|
+
it("must contain bold text", () => {
|
16
|
+
const wrapper = shallowMount(MessageList);
|
17
|
+
|
18
|
+
const vm: any = wrapper.vm;
|
19
|
+
|
20
|
+
expect(vm.textToRichFormat(message)).toContain("<strong>");
|
21
|
+
});
|
22
|
+
|
23
|
+
it("must contain italic text", () => {
|
24
|
+
const wrapper = shallowMount(MessageList);
|
25
|
+
|
26
|
+
const vm: any = wrapper.vm;
|
27
|
+
|
28
|
+
expect(vm.textToRichFormat(message)).toContain("<i>");
|
29
|
+
});
|
30
|
+
|
31
|
+
it("must contain crossed out text", () => {
|
32
|
+
const wrapper = shallowMount(MessageList);
|
33
|
+
|
34
|
+
const vm: any = wrapper.vm;
|
35
|
+
|
36
|
+
expect(vm.textToRichFormat(message)).toContain("<del>");
|
37
|
+
});
|
38
|
+
|
39
|
+
it("must contain url text", () => {
|
40
|
+
const wrapper = shallowMount(MessageList);
|
41
|
+
|
42
|
+
const vm: any = wrapper.vm;
|
43
|
+
|
44
|
+
expect(vm.textToRichFormat(message)).toContain("<a");
|
45
|
+
});
|
46
|
+
});
|
47
|
+
});
|