vue-wiguet-chatweb 0.1.9 → 0.1.10
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/dist/style.css +1 -1
- package/dist/vue-wiguet-chatweb.js +480 -472
- package/dist/vue-wiguet-chatweb.umd.cjs +5 -5
- package/package.json +1 -1
- package/src/components/MessageList.vue +11 -3
package/package.json
CHANGED
@@ -26,9 +26,7 @@
|
|
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 class="message-text">
|
30
|
-
{{ message.message }}
|
31
|
-
</div>
|
29
|
+
<div class="message-text" v-html="convertUrlsToLinks(message.message)"></div>
|
32
30
|
<div class="detail-message flex justify-content-between">
|
33
31
|
<span class="mr-5" v-if="message.sender?.nombreCompleto">
|
34
32
|
{{
|
@@ -99,6 +97,16 @@ watch(
|
|
99
97
|
pause();
|
100
98
|
}
|
101
99
|
);
|
100
|
+
|
101
|
+
function convertUrlsToLinks(content:string) {
|
102
|
+
// Expresión regular para detectar URLs
|
103
|
+
const urlRegex = /(https?:\/\/[^\s]+)/g;
|
104
|
+
|
105
|
+
// Reemplazar las URLs con etiquetas <a>
|
106
|
+
return content.replace(urlRegex, (url) => {
|
107
|
+
return `<a href="${url}" target="_blank">${url}</a>`;
|
108
|
+
});
|
109
|
+
}
|
102
110
|
</script>
|
103
111
|
|
104
112
|
<style scoped>
|