@chat21/chat21-web-widget 5.0.43 → 5.0.44

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.43",
4
+ "version": "5.0.44",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -158,7 +158,7 @@ export class ConversationPreviewComponent implements OnInit {
158
158
  that.logger.debug('[LOADER-PREVIEW-PAGE] OK: ', metadata);
159
159
  that.arrayFiles.push({metadata});
160
160
  if (!that.fileSelected) {
161
- that.fileSelected = {metadata};
161
+ that.fileSelected = Object.assign({}, metadata)
162
162
  }
163
163
  };
164
164
  }
@@ -502,6 +502,12 @@ export class GlobalSettingsService {
502
502
  globals.showInfoMessage.push('CHAT_CLOSED')
503
503
  }
504
504
  }
505
+ if (variables.hasOwnProperty('singleConversation')) {
506
+ globals['singleConversation'] = variables['singleConversation'];
507
+ }
508
+ if (variables.hasOwnProperty('themeColorOpacity')) {
509
+ globals['themeColorOpacity'] = variables['themeColorOpacity'];
510
+ }
505
511
 
506
512
  }
507
513
  }
@@ -1058,8 +1058,8 @@ class Chat21Client {
1058
1058
  }
1059
1059
 
1060
1060
  function isBrowser() {
1061
- // return true;
1062
- return false;
1061
+ return true;
1062
+ // return false;
1063
1063
  }
1064
1064
 
1065
1065
  export { Chat21Client }; // Browser
@@ -393,7 +393,7 @@
393
393
  window.tiledeskSettings = {
394
394
  marginX: "100px",
395
395
  marginY: "50px",
396
- calloutTimer: 5,
396
+ calloutTimer: 1,
397
397
  };
398
398
 
399
399
  (function(d, s, id) {
@@ -455,6 +455,12 @@
455
455
  document.getElementById('events').value += 'onInit --> FIRED!' + '\n'
456
456
  document.getElementById('events').scrollTop = document.getElementById('events').scrollHeight
457
457
  }, 1000);
458
+ //open widget after 3s if is closed
459
+ setTimeout(() => {
460
+ if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
461
+ window.Tiledesk('open')
462
+ }
463
+ }, 3000);
458
464
  });
459
465
 
460
466
  window.Tiledesk('onAuthStateChanged', function(event_data) {
@@ -241,6 +241,7 @@
241
241
  window.tiledeskSettings = {
242
242
  marginX: "100px",
243
243
  marginY: "50px",
244
+ calloutTimer: 1
244
245
  // autostart: false
245
246
 
246
247
  };
@@ -290,6 +291,12 @@
290
291
  setTimeout(() => {
291
292
  document.getElementById("preloader").style.display = "none";
292
293
  }, 1000);
294
+ //open widget after 3s if is closed
295
+ setTimeout(() => {
296
+ if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
297
+ window.Tiledesk('open')
298
+ }
299
+ }, 3000);
293
300
  });
294
301
 
295
302
  window.Tiledesk('onAuthStateChanged', function(event_data) {
@@ -66,12 +66,11 @@ export class MQTTAuthService extends MessagingAuthService {
66
66
  this.logger.log("[MQTTAuthService] logout: closing mqtt connection...");
67
67
  return new Promise((resolve, reject) => {
68
68
  this.chat21Service.chatClient.close(() => {
69
- console.log("[MQTTAuthService] logout: mqtt connection closed. OK");
70
69
  // remove
71
70
  // this.appStorage.removeItem('tiledeskToken');
72
71
  // this.appStorage.removeItem('currentUser');
73
72
  this.currentUser = null;
74
- console.log("[MQTTAuthService] logout: user removed");
73
+ this.logger.debug("[MQTTAuthService] logout: mqtt connection closed. user removed. OK");
75
74
  this.BSSignOut.next(true);
76
75
  this.BSAuthStateChanged.next('offline');
77
76
  resolve(true)
@@ -93,20 +92,20 @@ z
93
92
 
94
93
  /** */
95
94
  getToken(): string {
96
- console.log('[MQTTAuthService]::getToken');
95
+ this.logger.debug('[MQTTAuthService]::getToken');
97
96
  return this.token;
98
97
  }
99
98
 
100
99
  /**
101
100
  */
102
101
  onAuthStateChanged() {
103
- console.log('UserService::onAuthStateChanged');
102
+ this.logger.debug('UserService::onAuthStateChanged');
104
103
  // if (this.appStorage.getItem('tiledeskToken') == null) {
105
104
  // this.currentUser = null;
106
105
  this.BSAuthStateChanged.next('offline');
107
106
  // }
108
107
  // const that = this;
109
- console.log("STORAGE CHANGED: added listner")
108
+ this.logger.debug("STORAGE CHANGED: added listner")
110
109
  // window.addEventListener('storage', (e) => {
111
110
  // console.log('STORAGE CHANGED:', e.key);
112
111
  // if (this.appStorage.getItem('tiledeskToken') == null && this.appStorage.getItem('currentUser') == null) {
@@ -254,19 +253,19 @@ z
254
253
  // const that = this;
255
254
  this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN, postData, { headers, responseType})
256
255
  .subscribe(data => {
257
- console.log("[MQTTAuthService] connectWithCustomToken: **** data", data)
256
+ this.logger.debug("[MQTTAuthService] connectWithCustomToken: **** data", data)
258
257
  const result = JSON.parse(data);
259
258
  this.connectMQTT(result);
260
259
  }, error => {
261
- console.log(error);
260
+ this.logger.error(error);
262
261
  });
263
262
  }
264
263
 
265
264
  connectMQTT(credentials: any): any {
266
- console.log('[MQTTAuthService] connectMQTT: **** credentials:', credentials);
265
+ this.logger.debug('[MQTTAuthService] connectMQTT: **** credentials:', credentials);
267
266
  const userid = credentials.userid;
268
267
  this.chat21Service.chatClient.connect(userid, credentials.token, () => {
269
- console.log('[MQTTAuthService] connectMQTT: Chat connected.');
268
+ this.logger.debug('[MQTTAuthService] connectMQTT: Chat connected.');
270
269
  this.BSAuthStateChanged.next('online');
271
270
  });
272
271
  }
@@ -5,23 +5,23 @@
5
5
 
6
6
  export const environment = {
7
7
  production: true,
8
- version: require('../../package.json').version,
9
- remoteConfig: false,
8
+ version: require('../../package.json').version, // https://stackoverflow.com/questions/34907682/how-to-display-app-version-in-angular2
9
+ remoteConfig: true,
10
10
  remoteConfigUrl: '/widget-config.json',
11
- remoteTranslationsUrl: 'https://tiledesk-server-pre.herokuapp.com/',
11
+ remoteTranslationsUrl: 'http://localhost:3000/',
12
12
  loadRemoteTranslations: true,
13
- chatEngine: 'firebase',
14
- uploadEngine: 'firebase',
13
+ chatEngine: 'mqtt',
14
+ uploadEngine: 'native',
15
15
  fileUploadAccept:"*/*",
16
- logLevel: 'DEBUG',
16
+ logLevel: 'INFO',
17
17
  firebaseConfig: {
18
- apiKey: 'AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4',
19
- authDomain: 'chat21-pre-01.firebaseapp.com',
20
- databaseURL: 'https://chat21-pre-01.firebaseio.com',
21
- projectId: 'chat21-pre-01',
22
- storageBucket: 'chat21-pre-01.appspot.com',
23
- messagingSenderId: '269505353043',
24
- appId: '1:269505353043:web:b82af070572669e3707da6',
18
+ apiKey: 'CHANGEIT',
19
+ authDomain: 'CHANGEIT',
20
+ databaseURL: 'CHANGEIT',
21
+ projectId: 'CHANGEIT',
22
+ storageBucket: 'CHANGEIT',
23
+ messagingSenderId: 'CHANGEIT',
24
+ appId: 'CHANGEIT',
25
25
  tenant: 'tilechat',
26
26
  },
27
27
  chat21Config: {
@@ -29,14 +29,14 @@ export const environment = {
29
29
  MQTTendpoint: 'mqtt://localhost:15675/ws', // MQTT endpoint
30
30
  APIendpoint: 'http://localhost:8004/api'
31
31
  },
32
- apiUrl: 'https://tiledesk-server-pre.herokuapp.com/',
32
+ apiUrl: 'http://localhost:3000/',
33
33
  baseImageUrl: 'https://firebasestorage.googleapis.com/v0/b/',
34
34
  dashboardUrl: "https://support-pre.tiledesk.com/dashboard/",
35
35
  defaultLang : 'en',
36
36
  storage_prefix : 'widget_sv5',
37
37
  authPersistence: 'LOCAL',
38
38
  supportMode: true,
39
- enbedJs: true
39
+ enbedJs: true
40
40
  };
41
41
 
42
42
 
@@ -6,30 +6,30 @@
6
6
  export const environment = {
7
7
  production: true,
8
8
  version: require('../../package.json').version, // https://stackoverflow.com/questions/34907682/how-to-display-app-version-in-angular2
9
- remoteConfig: false,
9
+ remoteConfig: true,
10
10
  remoteConfigUrl: '/widget-config.json',
11
11
  loadRemoteTranslations: true,
12
- remoteTranslationsUrl: 'https://api.tiledesk.com/v2/',
13
- chatEngine: 'firebase',
14
- uploadEngine: 'firebase',
12
+ remoteTranslationsUrl: 'http://localhost:3000/',
13
+ chatEngine: 'CHANGEIT',
14
+ uploadEngine: 'CHANGEIT',
15
15
  fileUploadAccept:"*/*",
16
- logLevel: 'ERROR',
16
+ logLevel: 'INFO',
17
17
  firebaseConfig: {
18
- apiKey: 'AIzaSyDKfdKrlD7AYcbQ-U-xxgV-b3FUQ4xt7NM',
19
- authDomain: 'tiledesk-prod-v2.firebaseapp.com',
20
- databaseURL: 'https://tiledesk-prod-v2.firebaseio.com',
21
- projectId: 'tiledesk-prod-v2',
22
- storageBucket: 'tiledesk-prod-v2.appspot.com',
23
- messagingSenderId: '92907897826',
24
- appId: '1:92907897826:web:f255664014a7cc14ee2fbb',
25
- tenant: 'tilechat',
18
+ apiKey: 'CHANGEIT',
19
+ authDomain: 'CHANGEIT',
20
+ databaseURL: 'CHANGEIT',
21
+ projectId: 'CHANGEIT',
22
+ storageBucket: 'CHANGEIT',
23
+ messagingSenderId: 'CHANGEIT',
24
+ appId: 'CHANGEIT',
25
+ tenant: 'CHANGEIT',
26
26
  },
27
27
  chat21Config: {
28
28
  appId: 'tilechat',
29
29
  MQTTendpoint: 'mqtt://localhost:15675/ws', // MQTT endpoint
30
30
  APIendpoint: 'http://localhost:8004/api'
31
31
  },
32
- apiUrl: 'https://api.tiledesk.com/v2/',
32
+ apiUrl: 'http://localhost:3000/',
33
33
  baseImageUrl: 'https://firebasestorage.googleapis.com/v0/b/',
34
34
  dashboardUrl: 'https://console.tiledesk.com/v2/dashboard/',
35
35
  defaultLang : 'en',
@@ -7,8 +7,7 @@ export const environment = {
7
7
  production: false,
8
8
  version: require('../../package.json').version, // https://stackoverflow.com/questions/34907682/how-to-display-app-version-in-angular2
9
9
  remoteConfig: true,
10
- // remoteConfigUrl: '/widget-config.json',
11
- remoteConfigUrl: '/environments/real_data/widget-config-firebase.json',
10
+ remoteConfigUrl: '/widget-config.json',
12
11
  loadRemoteTranslations: true,
13
12
  remoteTranslationsUrl: 'http://localhost:3000/',
14
13
  chatEngine: 'mqtt',
@@ -33,7 +32,7 @@ export const environment = {
33
32
  },
34
33
  apiUrl: 'http://localhost:3000/',
35
34
  baseImageUrl: 'https://firebasestorage.googleapis.com/v0/b/',
36
- dashboardUrl: "http://localhost:4000/",
35
+ dashboardUrl: 'http://localhost:4500/',
37
36
  defaultLang : 'en',
38
37
  storage_prefix : 'widget_sv5',
39
38
  authPersistence: 'LOCAL',