vue-wiguet-chatweb 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "vue-wiguet-chatweb",
3
- "version": "0.1.17",
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>
@@ -20,12 +20,13 @@
20
20
  </div>
21
21
 
22
22
  <div class="w-full">
23
- <form class="message-send" @submit.prevent="submitMessage">
23
+ <form class="message-send" @submit.prevent="(event) => submitMessage(event)">
24
24
  <div class="form-message">
25
25
  <div class="jl-inputgroup-chat">
26
26
  <textarea
27
27
  v-model="message"
28
28
  class="jl2-input-chat"
29
+ placeholder="Escribe tu mensaje"
29
30
  required
30
31
  ref="textAreaRef"
31
32
  @input="() => autoAdjustHeight()"
@@ -159,8 +160,8 @@ function saltoDeLineaOEnviar(event: KeyboardEvent) {
159
160
  submitMessage(event);
160
161
  }
161
162
 
162
- const submitMessage = async (event: Event) => {
163
- if (message.value?.length > 300) {
163
+ function createMessage(message: string) {
164
+ if (message?.length > 300) {
164
165
  emit("show-toast", {
165
166
  severity: "warn",
166
167
  summary: "Error",
@@ -170,7 +171,7 @@ const submitMessage = async (event: Event) => {
170
171
  return;
171
172
  }
172
173
 
173
- if (!message.value.trim()) {
174
+ if (!message.trim()) {
174
175
  emit("show-toast", {
175
176
  severity: "warn",
176
177
  summary: "Error",
@@ -180,10 +181,10 @@ const submitMessage = async (event: Event) => {
180
181
  return;
181
182
  }
182
183
 
183
- const newMessage = {
184
+ const newMessage: Message = {
184
185
  id: uuidv4(),
185
186
  chatId: information.value?.chat?.id,
186
- message: message.value,
187
+ message,
187
188
  visto: true,
188
189
  multimedia: false,
189
190
  esCliente: true,
@@ -195,35 +196,98 @@ const submitMessage = async (event: Event) => {
195
196
  ci: props.user.ci,
196
197
  msPersonaId: props.user.msPersonaId,
197
198
  },
199
+ response: undefined
198
200
  };
201
+
202
+ return newMessage
203
+ }
199
204
 
200
- const idx = messagesData.value.data.push(newMessage) - 1;
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')
201
212
 
202
- sendApi(message.value, appChatId.value).then((newMsg) => {
203
- if (!newMsg) {
204
- messagesData.value.data[idx].error = {
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 = {
205
219
  error: true,
206
220
  id: newMessage.id,
207
221
  };
222
+ }
208
223
 
209
- emit("show-toast", {
210
- severity: "error",
211
- summary: "Error",
212
- detail: "Ocurrio un error al enviar el mensaje, intente nuevamente",
213
- life: 5000,
214
- });
215
- } else {
216
- messagesData.value.data[idx] = newMsg;
217
-
218
- const message = { ...newMsg, chatId: newMessage.chatId };
219
- socketService.value?.emit(
220
- "sendMessage",
221
- { roomId: information?.value?.appChat.id, message },
222
- (response: any) => {
223
- console.log("🚀 ~ socketService.value.emit ~ response:", response);
224
- }
225
- );
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
226
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
+ );
227
291
  });
228
292
 
229
293
  message.value = "";
@@ -231,11 +295,10 @@ const submitMessage = async (event: Event) => {
231
295
  textAreaRef.value && (textAreaRef.value.style.height = "20px");
232
296
  };
233
297
 
234
- const sendApi = async (message: string, appChatId: string) => {
298
+ const sendApi = async (bodyParam: Omit<SendMessageBody, 'esCliente'>) => {
235
299
  const body: SendMessageBody = {
300
+ ...bodyParam,
236
301
  esCliente: true,
237
- message,
238
- appChatId,
239
302
  };
240
303
  return sendMessageApi(body, props.tokenAuth);
241
304
  };
@@ -270,7 +333,10 @@ const retryMessage = async (message: Message) => {
270
333
  emit("show-confirm", async () => {
271
334
  if (!message.error?.id) return;
272
335
 
273
- const msg = await sendApi(message.message, appChatId.value);
336
+ const msg = await sendApi({
337
+ message: message.message,
338
+ appChatId: appChatId.value
339
+ });
274
340
 
275
341
  if (!msg) {
276
342
  emit("show-toast", {
@@ -364,13 +430,19 @@ function connectMsWebSocket(
364
430
 
365
431
  socketService.value.on("receiveMessage", (data: any) => {
366
432
  console.log("Mensaje recibido:", data.message, userChat);
367
-
433
+ const indexMessage = messagesData.value.data.findIndex((msg) => msg.id === data.message.id);
434
+
368
435
  if (
369
- data.message.sender.msPersonaId === userChat?.chat?.persona?.msPersonaId
436
+ data.message.sender.msPersonaId === userChat?.chat?.persona?.msPersonaId && indexMessage === -1
370
437
  )
371
438
  return;
372
439
 
373
- messagesData.value.data.push(data.message);
440
+ if (indexMessage !== -1) {
441
+ messagesData.value.data[indexMessage].response = data.message.response;
442
+ } else {
443
+ messagesData.value.data.push(data.message);
444
+ }
445
+
374
446
  setVistoToTrueApi(data.message.appChatId, props.tokenAuth);
375
447
  scrollToBottom();
376
448
  !props.visible && emit("new-message");
@@ -416,36 +488,13 @@ function getOS() {
416
488
  return os;
417
489
  }
418
490
 
419
- function onQualifying({ message, emoji }: { message: Message, emoji: {icon: string, value: number } }) {
491
+ function onQualifying({ message: messageParam, emoji }: { message: Message, emoji: { iconUnicode: string, value: number } }) {
420
492
  const callback = async () => {
421
- if (!message.id || !emoji) return;
493
+ if (!messageParam.id || !emoji) return;
422
494
 
423
- const idx = searchFromLast<Message>(
424
- messagesData.value.data,
425
- "id",
426
- message.id
427
- );
495
+ message.value = emoji.iconUnicode
428
496
 
429
- let prevMessage = messagesData.value?.data?.[idx].message
430
- messagesData.value?.data?.[idx] && (messagesData.value.data[idx].message = emoji.icon);
431
-
432
- const msg = await updateMessageApi(message.id, { message: emoji.icon, tipoCalificacionId: emoji.value }, props.tokenAuth);
433
-
434
- if (!msg) {
435
- messagesData.value?.data?.[idx] && (messagesData.value.data[idx].message = prevMessage);
436
- emit("show-toast", {
437
- severity: "error",
438
- summary: "Error",
439
- detail: "Ocurrio un error al enviar el mensaje, intente nuevamente",
440
- life: 5000,
441
- });
442
- return
443
- }
444
-
445
- socketService.value?.emit("sendMessage", {
446
- roomId: information?.value?.appChat.id,
447
- message,
448
- });
497
+ submitMessage(undefined, { tipoCalificacionId: emoji.value, mensajeARespondeId: messageParam.id }).then();
449
498
  }
450
499
 
451
500
  emit('onQualifying', callback)
@@ -27,23 +27,30 @@
27
27
  <div class="bubble" :class="message.esCliente ? 'right' : 'left'">
28
28
  <div :class="message.esCliente ? 'content-right' : 'content-left'">
29
29
  <div v-if="message.message === '😊😄🙂😐🙁'" class="flex gap-2" >
30
- <div>
31
- <strong style="display: block; margin-bottom: 0.5rem;">Ayúdanos a mejorar nuestro servicio.</strong>
32
- <span>Que le pareció la atención:</span>
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
33
  </div>
34
+
34
35
  <a
35
- v-for="emoji in emojis"
36
- href="javascript:"
36
+ v-for="emojiParam in emojis"
37
+ :key="emojiParam.value"
38
+ :href="!message.response ? 'javascript:' : undefined"
37
39
  class="btn-icon"
38
- :key="emoji.value"
39
- @click="emit('onQualifying', { message, emoji })"
40
+ :class="{ 'content-disabled' : !showIcon(message, emojiParam) }"
41
+ @click="!message.response && emit('onQualifying', { message, emoji: emojiParam })"
40
42
  >
41
43
  <div class="flex flex-col items-center">
42
- <div class="icon">{{ emoji.icon }}</div>
43
- <span>{{ emoji.label }}</span>
44
+ <img :src="emojiParam.icon" alt="icono" class="icon" />
45
+ <span>{{ emojiParam.label }}</span>
44
46
  </div>
45
47
  </a>
46
48
  </div>
49
+
50
+ <div v-else-if="emoji[message.message ?? '']">
51
+ <img :src="emoji[message.message]" alt="icono" class="icon" />
52
+ </div>
53
+
47
54
  <div v-else class="message-text" style="white-space: pre-line" v-html="textToRichFormat(message.message)"></div>
48
55
  <div class="detail-message flex justify-content-between">
49
56
  <span class="mr-5" v-if="message.sender?.nombreCompleto">
@@ -76,6 +83,11 @@ import { useIntersectionObserver } from "@vueuse/core";
76
83
  import { type Message } from "../dto/app.dto";
77
84
  import { DateTime } from "luxon";
78
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'
79
91
 
80
92
  const emit = defineEmits(["loadMore", "retry", "onQualifying"]);
81
93
  const props = defineProps({
@@ -100,6 +112,12 @@ const { pause, resume } = useIntersectionObserver(
100
112
  }
101
113
  );
102
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
+
103
121
  onBeforeMount(() => {
104
122
  if (!props.canLoadMoreMessages) {
105
123
  pause();
@@ -154,12 +172,21 @@ function textToRichFormat(text: string) {
154
172
  }
155
173
 
156
174
  const emojis = [
157
- { label: 'Excelente', value: 1, icon: '😊' },
158
- { label: 'Buena', value: 2, icon: '😄' },
159
- { label: 'Aceptable', value: 3, icon: '🙂' },
160
- { label: 'Mala', value: 4, icon: '😐' },
161
- { label: 'Muy Mala', value: 5, icon: '🙁' },
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: '🙁'},
162
180
  ]
181
+ ''
182
+ const emoji: { [key in string]: any } = {
183
+ '😊': HappiestIcon,
184
+ '😄': HappyIcon,
185
+ '🙂': NeutralIcon,
186
+ '😐': SadIcon,
187
+ '🙁': AngryIcon,
188
+ '': null
189
+ }
163
190
 
164
191
  </script>
165
192
 
@@ -287,12 +314,21 @@ const emojis = [
287
314
  width: 100%;
288
315
  }
289
316
 
317
+ .icon {
318
+ width: 2rem;
319
+ }
320
+
290
321
  .btn-icon {
291
322
  text-decoration: none;
292
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);
293
329
  }
330
+
294
331
  .btn-icon span {
295
- color: currentColor;
296
332
  text-wrap: nowrap;
297
333
  }
298
334
 
@@ -314,4 +350,14 @@ const emojis = [
314
350
  gap: 0.5rem;
315
351
  }
316
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
+
317
363
  </style>
@@ -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
+ });