@meetelise/chat 1.22.11 → 1.22.13

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.22.11",
3
+ "version": "1.22.13",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -146,14 +146,27 @@
146
146
  buttonOfInterest.setAttribute("style", "visibility: hidden;");
147
147
  }
148
148
  const onWidgetLoaded = () => {
149
- buttonOfInterest.setAttribute("style", "visibility: visible;");
150
- buttonOfInterest.innerHTML = "You've been yeeted my boy";
151
- console.log("Widget loaded");
149
+ const meetEliseChats = document.getElementsByTagName("me-chat");
150
+ if (!meetEliseChats || meetEliseChats.length === 0) {
151
+ return;
152
+ }
153
+ const meetEliseChat = meetEliseChats[0];
154
+ meetEliseChat.setAttribute("style", "visibility: hidden;");
155
+ console.log(`Chat widget loaded`);
152
156
  };
153
157
 
154
158
  MEChat.start({
155
159
  organization: "test-company",
156
160
  building: "3fc93384-91f5-11ed-98a3-43f5a2f42588",
161
+ onSstClose: () => {
162
+ const meetEliseChats = document.getElementsByTagName("me-chat");
163
+ if (!meetEliseChats || meetEliseChats.length === 0) {
164
+ return;
165
+ }
166
+ const meetEliseChat = meetEliseChats[0];
167
+ meetEliseChat.setAttribute("style", "display: none;");
168
+ },
169
+ onWidgetLoaded: onWidgetLoaded,
157
170
 
158
171
  // organization: "4c78cac8-017a-4497-8b71-3df15779a83c",
159
172
 
@@ -189,7 +202,16 @@
189
202
  Open chat without widget
190
203
  </button>
191
204
  <div>
192
- <a href="javascript:void(0);" onclick="window.eliseAi.onOpenSST()"
205
+ <a
206
+ href="javascript:void(0);"
207
+ onclick="window.eliseAi.onOpenSST(() => {
208
+ const meetEliseChats = document.getElementsByTagName('me-chat');
209
+ if (!meetEliseChats || meetEliseChats.length === 0) {
210
+ return;
211
+ }
212
+ const meetEliseChat = meetEliseChats[0];
213
+ meetEliseChat.setAttribute('style', '');
214
+ })"
193
215
  >Open SST without using widget</a
194
216
  >
195
217
  </div>