@meetelise/chat 1.20.5 → 1.20.7

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.5",
3
+ "version": "1.20.7",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -526,7 +526,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
526
526
  <time-picker
527
527
  ?selecteddateexists=${!!this.selectedDate}
528
528
  ?horizontal=${e}
529
- .options=${this.selectedDate?null===(t=this.availabilitiesGroupedByDay[Pt(this.selectedDate,"y-MM-dd")])||void 0===t?void 0:t.map((e=>({dateWithTimeZoneOffset:e,displayTime:Pt(tn(`${e.datetime}${e.offset}`),"h:mmaaa")}))):[]}
529
+ .options=${this.selectedDate?null===(t=this.availabilitiesGroupedByDay[Pt(this.selectedDate,"y-MM-dd")])||void 0===t?void 0:t.sort(((e,t)=>function(e,t){Ee(2,arguments);var n=Fe(e),i=Fe(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}(tn(e.datetime),tn(t.datetime)))).map((e=>({dateWithTimeZoneOffset:e,displayTime:Pt(tn(`${e.datetime}${e.offset}`),"h:mmaaa")}))):[]}
530
530
  @change=${e=>{if(e.target instanceof Gt){if(!this.selectedDate)return;const t=this.availabilitiesGroupedByDay[Pt(new Date(this.selectedDate),"y-MM-dd")],n=e.target.selectedTime?t.indexOf(e.target.selectedTime.dateWithTimeZoneOffset):null;this.selectedTime=null!==n?t[n]:null}}}
531
531
  ></time-picker>
532
532
  </div>
@@ -2182,4 +2182,4 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2182
2182
  width: 100%;
2183
2183
  height: 100px;
2184
2184
  }
2185
- `,Pi.session=Oe.ready.then((()=>{const e=new Oe.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Oe.Session({appId:"ogKIvCor",me:e})})),Mi([oe({type:String})],Pi.prototype,"buildingSlug",void 0),Mi([oe({type:String})],Pi.prototype,"orgSlug",void 0),Mi([oe({type:String})],Pi.prototype,"themeId",void 0),Mi([oe({attribute:!1})],Pi.prototype,"avatarSrc",void 0),Mi([oe({type:Boolean})],Pi.prototype,"useMiniWidget",void 0),Mi([oe({type:Object})],Pi.prototype,"launcherStyles",void 0),Mi([ae()],Pi.prototype,"popup",void 0),Mi([ae()],Pi.prototype,"theme",void 0),Mi([ae()],Pi.prototype,"chatId",void 0),Mi([ae()],Pi.prototype,"analytics",void 0),Mi([ae()],Pi.prototype,"isMobile",void 0),Mi([ae()],Pi.prototype,"launcher",void 0),Mi([ae()],Pi.prototype,"building",void 0),Mi([ae()],Pi.prototype,"hasMounted",void 0),Mi([ae()],Pi.prototype,"hideLauncher",void 0),Pi=Fi=Mi([ie("me-chat")],Pi);class Di{static start(e){qi(),Ui();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),e.launcherStyles&&(t.launcherStyles=e.launcherStyles),document.body.appendChild(t),Di.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),Di.meChat=null)}}Di.meChat=null;const qi=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)},Ui=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=1"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
2185
+ `,Pi.session=Oe.ready.then((()=>{const e=new Oe.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Oe.Session({appId:"ogKIvCor",me:e})})),Mi([oe({type:String})],Pi.prototype,"buildingSlug",void 0),Mi([oe({type:String})],Pi.prototype,"orgSlug",void 0),Mi([oe({type:String})],Pi.prototype,"themeId",void 0),Mi([oe({attribute:!1})],Pi.prototype,"avatarSrc",void 0),Mi([oe({type:Boolean})],Pi.prototype,"useMiniWidget",void 0),Mi([oe({type:Object})],Pi.prototype,"launcherStyles",void 0),Mi([ae()],Pi.prototype,"popup",void 0),Mi([ae()],Pi.prototype,"theme",void 0),Mi([ae()],Pi.prototype,"chatId",void 0),Mi([ae()],Pi.prototype,"analytics",void 0),Mi([ae()],Pi.prototype,"isMobile",void 0),Mi([ae()],Pi.prototype,"launcher",void 0),Mi([ae()],Pi.prototype,"building",void 0),Mi([ae()],Pi.prototype,"hasMounted",void 0),Mi([ae()],Pi.prototype,"hideLauncher",void 0),Pi=Fi=Mi([ie("me-chat")],Pi);class Di{static start(e){qi(),Ui();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),e.launcherStyles&&(t.launcherStyles=e.launcherStyles),document.body.appendChild(t),Di.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),Di.meChat=null)}}Di.meChat=null;const qi=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)},Ui=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
package/src/MEChat.ts CHANGED
@@ -84,7 +84,7 @@ const installTalkjsMobileStyleFix = () => {
84
84
  metaTag.setAttribute("name", "viewport");
85
85
  metaTag.setAttribute(
86
86
  "content",
87
- "width=device-width, initial-scale=1, maximum-scale=1"
87
+ "width=device-width, initial-scale=1, maximum-scale=2"
88
88
  );
89
89
  document.head.appendChild(metaTag);
90
90
  };
@@ -25,6 +25,7 @@ import axios from "axios";
25
25
  import { mapValues } from "lodash";
26
26
  import classnames from "classnames";
27
27
  import parseISO from "date-fns/parseISO";
28
+ import compareAsc from "date-fns/compareAsc";
28
29
 
29
30
  const getHumanReadableLayout = (layout: string) => {
30
31
  if (layout == "studio") return "Studio";
@@ -873,15 +874,19 @@ export class TourScheduler extends LitElement {
873
874
  .options=${this.selectedDate
874
875
  ? this.availabilitiesGroupedByDay[
875
876
  format(this.selectedDate, "y-MM-dd")
876
- ]?.map((date) => {
877
- return {
878
- dateWithTimeZoneOffset: date,
879
- displayTime: format(
880
- parseISO(`${date.datetime}${date.offset}`),
881
- "h:mmaaa"
882
- ),
883
- };
884
- })
877
+ ]
878
+ ?.sort((a, b) =>
879
+ compareAsc(parseISO(a.datetime), parseISO(b.datetime))
880
+ )
881
+ .map((date) => {
882
+ return {
883
+ dateWithTimeZoneOffset: date,
884
+ displayTime: format(
885
+ parseISO(`${date.datetime}${date.offset}`),
886
+ "h:mmaaa"
887
+ ),
888
+ };
889
+ })
885
890
  : []}
886
891
  @change=${(e: Event) => {
887
892
  if (e.target instanceof TimePicker) {
@@ -1086,7 +1091,7 @@ export class TourScheduler extends LitElement {
1086
1091
 
1087
1092
  confirmationMessage(): TemplateResult {
1088
1093
  if (!this.selectedDate || !this.selectedTime) return html``;
1089
- // format example: "November 9th, 2022 at 11:00am"
1094
+ // format example: "November 9th, 2022 at 11:00pm"
1090
1095
  const readableDateAndTime = format(
1091
1096
  parseISO(`${this.selectedTime.datetime}${this.selectedTime.offset}`),
1092
1097
  "h:mmaaa"