@chat21/chat21-web-widget 5.0.51 → 5.0.52-rc.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.52-rc.3
4
+ - added: build info in menu conversation-header component if singleConversation is enabled
5
+ - bug-fixed: splitted messages is shown twice
6
+ - removed: open automatically the widget after 3s in index-dev.html page
7
+
8
+ ### 5.0.52-rc.1
9
+ - changed: background opacity in chatbot-panel html page
10
+ - bug-fixed: splitted messages is shown twice
11
+
3
12
  ### 5.0.51 in PROD
4
13
 
5
14
  ### 5.0.51-rc.2
@@ -108,6 +108,7 @@
108
108
  background-position: inherit;
109
109
  background-attachment: fixed;
110
110
  background-size: cover;
111
+ opacity: 0.4;
111
112
  }
112
113
 
113
114
  .row {
@@ -261,6 +262,7 @@
261
262
  calloutTimer: 1,
262
263
  singleConversation: true,
263
264
  restartConversation: true,
265
+ isLogEnabled: true,
264
266
  hideCloseConversationOptionMenu: true
265
267
  // autostart: false
266
268
 
@@ -418,29 +420,6 @@
418
420
  // console.log('tiledesk_projectid: ', tiledesk_projectid);
419
421
  // console.log('project_name: ', project_name);
420
422
 
421
- window.onload = function() {
422
- document.getElementById("project_id").innerHTML = '"' + tiledesk_projectid + '"';
423
- // document.getElementById("project_name").innerHTML = project_name;
424
-
425
- if(role !== 'agent'){
426
- document.getElementById("testPageButton").style.display = 'block'
427
- }
428
- }
429
-
430
- // window.tileDeskAsyncInit = function() {
431
- // window.tiledesk.on('onLoadParams', function(event_data) {
432
- // // console.log('onLoadParams: ')
433
- // window.tiledesk.open();
434
- // });
435
-
436
- // window.tiledesk.on('onInit', function(event_data) {
437
- // setTimeout(() => {
438
- // document.getElementById("preloader").style.display = "none";
439
- // }, 1000);
440
-
441
- // });
442
- // };
443
-
444
423
  function getQueryVariable(variable) {
445
424
  var query = window.location.search.substring(1);
446
425
  var vars = query.split("&");
@@ -460,11 +460,11 @@
460
460
  document.getElementById('events').scrollTop = document.getElementById('events').scrollHeight
461
461
  }, 1000);
462
462
  //open widget after 3s if is closed
463
- setTimeout(() => {
464
- if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
465
- window.Tiledesk('open')
466
- }
467
- }, 3000);
463
+ // setTimeout(() => {
464
+ // if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
465
+ // window.Tiledesk('open')
466
+ // }
467
+ // }, 3000);
468
468
  });
469
469
 
470
470
  window.Tiledesk('onAuthStateChanged', function(event_data) {
package/dist/launch.js CHANGED
@@ -161,14 +161,73 @@ function loadIframe(tiledeskScriptBaseLocation) {
161
161
  });
162
162
  /**** END EVENST ****/
163
163
 
164
- // ifrm.srcdoc = srcTileDesk
165
164
  iDiv.appendChild(ifrm);
165
+
166
+ // buildIframeDOM(ifrm)
167
+ // ifrm.contentWindow.document.open();
168
+ // ifrm.document.srcdoc = srcTileDesk;
169
+ // ifrm.srcdoc = srcTileDesk
166
170
  ifrm.contentWindow.document.open();
167
171
  ifrm.contentWindow.document.write(srcTileDesk);
168
172
  ifrm.contentWindow.document.close();
169
173
 
170
174
  }
171
175
 
176
+ function buildIframeDOM(iframe){
177
+
178
+ var meta = document.createElement('meta');
179
+ meta.setAttribute('charset', 'utf-8')
180
+ var meta_2 = document.createElement('meta')
181
+ meta_2.setAttribute('name', 'viewport')
182
+ meta_2.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0')
183
+ var title = document.createElement('title')
184
+ title.title = 'Tilechat Widget'
185
+ var base = document.createElement('base')
186
+ base.setAttribute('href', './')
187
+ var link_1 = document.createElement('link')
188
+ link_1.setAttribute('rel', 'icon')
189
+ link_1.setAttribute('type', 'image/x-icon')
190
+ link_1.setAttribute('href', 'favicon.ico')
191
+ var link_2 = document.createElement('link')
192
+ link_2.setAttribute('rel', 'stylesheet')
193
+ link_2.setAttribute('type', 'text/css')
194
+ link_2.setAttribute('href', tiledeskScriptBaseLocation + '/assets/styles/tiledesk_v1.scss')
195
+ link_2.setAttribute('media','all')
196
+
197
+
198
+ let head = iframe.contentWindow.document.getElementsByTagName('head')[0]
199
+ head.appendChild(meta)
200
+ head.appendChild(meta_2)
201
+ head.appendChild(title)
202
+ head.appendChild(base)
203
+ head.appendChild(link_1)
204
+ head.appendChild(link_2)
205
+
206
+ var script_1 = document.createElement('script')
207
+ script_1.setAttribute('type','text/javascript')
208
+ script_1.setAttribute('src',tiledeskScriptBaseLocation + '/runtime.js')
209
+ var script_2 = document.createElement('script')
210
+ script_2.setAttribute('type','text/javascript')
211
+ script_2.setAttribute('src',tiledeskScriptBaseLocation + '/polyfills.js')
212
+ var script_3 = document.createElement('script')
213
+ script_3.setAttribute('type','text/javascript')
214
+ script_3.setAttribute('src',tiledeskScriptBaseLocation + '/styles.css')
215
+ var script_4 = document.createElement('script')
216
+ script_4.setAttribute('type','text/javascript')
217
+ script_4.setAttribute('src',tiledeskScriptBaseLocation + '/vendor.js')
218
+ var script_5 = document.createElement('script')
219
+ script_5.setAttribute('type','text/javascript')
220
+ script_5.setAttribute('src',tiledeskScriptBaseLocation + '/main.js')
221
+
222
+ let body= iframe.contentWindow.document.getElementsByTagName('body')[0]
223
+ body.appendChild(document.createElement('chat-root'))
224
+ body.appendChild(script_1)
225
+ body.appendChild(script_2)
226
+ body.appendChild(script_3)
227
+ body.appendChild(script_4)
228
+ body.appendChild(script_5)
229
+ }
230
+
172
231
 
173
232
  function initAysncEvents() {
174
233
  console.log('INIT ASYNC EVENTS')