@meetelise/chat 1.20.129 → 1.20.130

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.20.129",
3
+ "version": "1.20.130",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -3333,7 +3333,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
3333
3333
  cursor: pointer;
3334
3334
  width: fit-content;
3335
3335
  }
3336
- `;var Er=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Rr=class extends re{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isPunctuation=e=>/^[.,;!?]$/.test(e)}firstUpdated(){if(!this.message)return;const{hyperlinks:e,markedText:t}=this.mapAndMarkHyperLinks(this.message.message.text),n=/(https?:\/\/[^\s]+)/g,i=[],r=[];this.parsedMessage=k`${t.split("\n").map((t=>{const o=t.match(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])|(\b[\w']+\b)|([.,;!?])/gi);return o?k`${o.map(((t,a)=>{if(e.find((e=>e.id===t))){const n=e.find((e=>e.id===t));if(!n)return;return r.push({redirectTo:null==n?void 0:n.link,source:null==n?void 0:n.link}),k`<a
3336
+ `;var Er=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Rr=class extends re{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isPunctuation=e=>/^[.,;!?]$/.test(e)}firstUpdated(){if(!this.message)return;const{hyperlinks:e,markedText:t}=this.mapAndMarkHyperLinks(this.message.message.text),n=/(https?:\/\/[^\s]+)/g,i=[],r=[];this.parsedMessage=k`${t.split("\n").map((t=>{const o=t.match(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])|(\b[\w':]+\b)|([.,;!?])/gi);return o?k`${o.map(((t,a)=>{if(e.find((e=>e.id===t))){const n=e.find((e=>e.id===t));if(!n)return;return r.push({redirectTo:null==n?void 0:n.link,source:null==n?void 0:n.link}),k`<a
3337
3337
  class="redirect-link"
3338
3338
  href="${null==n?void 0:n.link}"
3339
3339
  target="_blank"
@@ -3345,7 +3345,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
3345
3345
  target="_blank"
3346
3346
  rel="noopener noreferrer"
3347
3347
  >${t}
3348
- </a>`):a+1<o.length&&this.isPunctuation(o[a+1])?k`${t}`:k`${t} `}))}<br />`:k``}))}`,this.imagesToDisplay=r,Promise.all(i).then((e=>{this.websitePreviewInfo=e}))}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>/g)),n=[];return t.forEach((t=>{try{const i=t[0].split("|")[0].replace("<",""),r=t[0].split("|")[1].replace(">","");if(i&&r){const o=Sr();n.push({link:i,hyperlink:r,mark:t[0],id:o}),e=e.replace(t[0],o)}}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?k`<div class="message-inner-body">
3348
+ </a>`):a+1<o.length&&this.isPunctuation(o[a+1])?k`${t}`:k`${t} `}))}<br />`:k``}))}`,this.imagesToDisplay=r,Promise.all(i).then((e=>{this.websitePreviewInfo=e}))}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>/g)),n=[];return t.forEach((t=>{try{const i=t[0].split("|")[0].replace("<",""),r=t[0].split("|")[1].replace(">","");if(i&&r){const o=Sr().replace(/-/g,"");n.push({link:i,hyperlink:r,mark:t[0],id:o}),e=e.replace(t[0],o)}}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?k`<div class="message-inner-body">
3349
3349
  <p class="message-text">${this.parsedMessage}</p>
3350
3350
  ${this.websitePreviewInfo.length>0&&this.websitePreviewInfo.some((e=>e.title&&(e.image||e.favicon)))?k`<br />`:""}
3351
3351
  ${this.imagesToDisplay.map((e=>k`<a
@@ -55,7 +55,7 @@ export class PubnubMessage extends LitElement {
55
55
  const imagesToDisplay: ImageToDisplay[] = [];
56
56
  this.parsedMessage = html`${markedText.split("\n").map((line) => {
57
57
  const allWords = line.match(
58
- /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])|(\b[\w']+\b)|([.,;!?])/gi
58
+ /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])|(\b[\w':]+\b)|([.,;!?])/gi
59
59
  );
60
60
  if (!allWords) return html``;
61
61
  return html`${allWords.map((word, index) => {
@@ -127,7 +127,7 @@ export class PubnubMessage extends LitElement {
127
127
  const link = match[0].split("|")[0].replace("<", "");
128
128
  const hyperlink = match[0].split("|")[1].replace(">", "");
129
129
  if (link && hyperlink) {
130
- const uniqueKeyMark = uuid();
130
+ const uniqueKeyMark = uuid().replace(/-/g, "");
131
131
  listHyperlinks.push({
132
132
  link,
133
133
  hyperlink,
@@ -137,7 +137,7 @@ export class PubnubMessage extends LitElement {
137
137
  text = text.replace(match[0], uniqueKeyMark);
138
138
  }
139
139
  } catch (_) {
140
- // pass
140
+ // pass and render normally
141
141
  }
142
142
  });
143
143
 
@@ -256,5 +256,3 @@ export class PubnubMessage extends LitElement {
256
256
  </div>`;
257
257
  }
258
258
  }
259
-
260
- ("Would you be available for a tour tomorrow at 11:00am or 3:45pm? We also have additional <https://app.meetelise.com/milhaus/2a5c7bdc-4d63-11ec-aa49-5f037e1156e7/tour?stateId=gAAAAABkihW_IJql0zzRF-Mved31jlp9yDgtBrPsSaZ63db9pV1m2vXLpWSXC4afXzCXqf6YbzCCIsmY7fkyOdX4OJei7v5HwIFa9tPTXhhxRnFTi1GpV5s=|timeslots here.>");