@meetelise/chat 1.20.155 → 1.20.156
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/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -3319,7 +3319,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3319
3319
|
target="_blank"
|
|
3320
3320
|
rel="noopener noreferrer"
|
|
3321
3321
|
>${e}
|
|
3322
|
-
</a>`}return U`${t} `}))}<br />`:U``}))}`,this.imagesToDisplay=r,Promise.all(i).then((e=>{this.websitePreviewInfo=e}))}removeTrailingPunctuation(e){return[".",",","!","?",":",";"].includes(e[e.length-1])?this.removeTrailingPunctuation(e.slice(0,-1)):e}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>/g)),n=[],i=t.map((t=>{const n=t[0];if(
|
|
3322
|
+
</a>`}return U`${t} `}))}<br />`:U``}))}`,this.imagesToDisplay=r,Promise.all(i).then((e=>{this.websitePreviewInfo=e}))}removeTrailingPunctuation(e){return[".",",","!","?",":",";"].includes(e[e.length-1])?this.removeTrailingPunctuation(e.slice(0,-1)):e}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>/g)),n=[],i=t.map((t=>{const n=t[0];if(void 0===t.index)return;const i=e[t.index-1],r=e[t.index+n.length];return{eliseLink:t[0],link:t[0].split("|")[0].replace("<",""),hyperlink:t[0].split("|")[1].replace(">",""),addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}));return i.forEach((t=>{try{if(!t)return;if(t.link&&t.hyperlink){const i=br().replace(/-/g,"");n.push({link:this.removeTrailingPunctuation(t.link),hyperlink:this.removeTrailingPunctuation(t.hyperlink),mark:t.eliseLink,id:i}),e=e.replace(t.eliseLink,`${t.addSpaceBefore?" ":""}${i}${t.addSpaceAfter?" ":""}`)}}catch(e){}})),{hyperlinks:n,markedText:e}}async getLinkData(e){var n,i,r,o,a,s;try{const u=(await t().get(e)).data,l=(new DOMParser).parseFromString(u,"text/html");return l?{title:null!==(i=null===(n=l.querySelector("title"))||void 0===n?void 0:n.textContent)&&void 0!==i?i:null,description:(null===(r=l.querySelector('meta[name="description"]'))||void 0===r?void 0:r.getAttribute("content"))||null,image:(null===(o=l.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:(null===(a=l.querySelector('link[rel="shortcut icon"]'))||void 0===a?void 0:a.getAttribute("href"))||(null===(s=l.querySelector('link[rel="icon"]'))||void 0===s?void 0:s.getAttribute("href"))||null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return console.error("Error fetching website details:",t),{title:null,description:null,image:null,favicon:null,link:e}}}updated(){this.onMount()}render(){return this.message?U`<div class="message-inner-body">
|
|
3323
3323
|
<p
|
|
3324
3324
|
class=${fe({"message-text":!0,"webchat-font__desktop":!un(),"webchat-font__mobile":un()})}
|
|
3325
3325
|
>
|
|
@@ -125,7 +125,7 @@ export class PubnubMessage extends LitElement {
|
|
|
125
125
|
}[] = [];
|
|
126
126
|
const matchesParsed = matches.map((match) => {
|
|
127
127
|
const eliseLink = match[0];
|
|
128
|
-
if (
|
|
128
|
+
if (match.index === undefined) return;
|
|
129
129
|
const charBefore = text[match.index - 1];
|
|
130
130
|
const charAfter = text[match.index + eliseLink.length];
|
|
131
131
|
return {
|