@chat21/chat21-web-widget 5.0.82-rc.1 → 5.0.82-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
@@ -6,7 +6,14 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
+ # 5.0.82-rc.3
10
+ - **changed**: close icon into home and conversation-detail components
11
+
12
+ # 5.0.82-rc.2
13
+ - **added**: automatically start widget after 5s
14
+
9
15
  # 5.0.82-rc.1
16
+ - **added**: automatically load widget if is on mobile device
10
17
 
11
18
  # 5.0.81 in PROD
12
19
 
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.82-rc.1",
4
+ "version": "5.0.82-rc.3",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -8,11 +8,16 @@
8
8
 
9
9
  <!-- ICON CLOSE CHAT -->
10
10
  <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-close c21-button-clean" [ngStyle]="{'display': (hideHeaderCloseButton)?'none':'flex'}" (click)="closeWidget()">
11
- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
11
+ <!-- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
12
12
  width="24px" height="24px" viewBox="0 0 24 24">
13
13
  <path fill="none" d="M0 0h24v24H0V0z" />
14
14
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
15
15
  <title id="altIconTitle">{{ translationMap?.get('BUTTON_CLOSE_TO_ICON') }}</title>
16
+ </svg> -->
17
+ <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
18
+ width="24px" height="24px" viewBox="0 0 24 24">
19
+ <path d="M19.35,9.21c.2-.2.2-.51,0-.71l-.71-.71c-.2-.2-.51-.2-.71,0l-5.94,5.94-5.94-5.94c-.2-.2-.51-.2-.71,0l-.71.71c-.2.2-.2.51,0,.71l7,7c.2.2.51.2.71,0l7-7Z"/>
20
+ <title id="altIconTitle">{{ translationMap?.get('BUTTON_CLOSE_TO_ICON') }}</title>
16
21
  </svg>
17
22
  </button>
18
23
 
@@ -10,10 +10,14 @@
10
10
  <div class="c21-header-button" [ngStyle]="{'display': (g.hideHeaderCloseButton)?'none':'block'}">
11
11
  <div class="c21-close-button">
12
12
  <button tabindex="2001" aria-label=" chiudi chat" class="c21-close-button-body" (click)="f21_close()">
13
- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
13
+ <!-- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
14
14
  <path fill="none" d="M0 0h24v24H0V0z"/>
15
15
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
16
16
  <title id="altIconTitle">{{translationMapHeader?.get('BUTTON_CLOSE_TO_ICON')}}</title>
17
+ </svg> -->
18
+ <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
19
+ <path d="M19.35,9.21c.2-.2.2-.51,0-.71l-.71-.71c-.2-.2-.51-.2-.71,0l-5.94,5.94-5.94-5.94c-.2-.2-.51-.2-.71,0l-.71.71c-.2.2-.2.51,0,.71l7,7c.2.2.51.2.71,0l7-7Z"/>
20
+ <title id="altIconTitle">{{translationMapHeader?.get('BUTTON_CLOSE_TO_ICON')}}</title>
17
21
  </svg>
18
22
  </button>
19
23
  </div>
package/src/launch.js CHANGED
@@ -7,51 +7,44 @@ ready(function() {
7
7
  initWidget();
8
8
  });
9
9
 
10
- function detectIfIsMobile(windowContext) {
11
- let isMobile = false;
12
- if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(windowContext.navigator.userAgent))
13
- isMobile = true
14
- else
15
- isMobile = false
16
- return isMobile;
17
- }
18
10
 
19
11
  /** */
20
12
  function ready(callbackFunction){
21
- // if(document.readyState != 'loading'){
22
- // console.log('in ifffffff', document.readyState)
23
- // callbackFunction()
24
- // }
25
- // else{
26
- // document.addEventListener("DOMContentLoaded", callbackFunction)
27
- // }
28
- document.addEventListener('scroll', start);
29
- document.addEventListener('mousedown', start);
30
- document.addEventListener('mousemove', start);
31
- document.addEventListener('touchstart', start);
32
- document.addEventListener('keydown', start);
33
-
34
- let isMobile = detectIfIsMobile(window)
35
- if(isMobile){
36
- console.log('Mobile device detected: load Widget')
37
- document.dispatchEvent(new Event('mousemove'))
13
+ // if(document.readyState != 'loading'){
14
+ // console.log('in ifffffff', document.readyState)
15
+ // callbackFunction()
16
+ // }
17
+ // else{
18
+ // document.addEventListener("DOMContentLoaded", callbackFunction)
19
+ // }
20
+ document.addEventListener('scroll', start);
21
+ document.addEventListener('mousedown', start);
22
+ document.addEventListener('mousemove', start);
23
+ document.addEventListener('touchstart', start);
24
+ document.addEventListener('keydown', start);
25
+
26
+ let time = 5000;
27
+ let timeout = setTimeout(()=> {
28
+ console.log('in timeout')
29
+ start();
30
+ }, time)
31
+
32
+ function start(){
33
+ clearTimeout(timeout);
34
+ if(document.readyState==='complete'){
35
+ callbackFunction()
36
+ }else if(window.attachEvent){
37
+ window.attachEvent('onload',callbackFunction);
38
+ }else{
39
+ window.addEventListener('load',callbackFunction,false);
38
40
  }
39
41
 
40
- function start(){
41
- if(document.readyState==='complete'){
42
- callbackFunction()
43
- }else if(window.attachEvent){
44
- window.attachEvent('onload',callbackFunction);
45
- }else{
46
- window.addEventListener('load',callbackFunction,false);
47
- }
48
-
49
- document.removeEventListener('scroll', start);
50
- document.removeEventListener('mousedown', start);
51
- document.removeEventListener('mousemove', start);
52
- document.removeEventListener('touchstart', start);
53
- document.removeEventListener('keydown', start);
54
- }
42
+ document.removeEventListener('scroll', start);
43
+ document.removeEventListener('mousedown', start);
44
+ document.removeEventListener('mousemove', start);
45
+ document.removeEventListener('touchstart', start);
46
+ document.removeEventListener('keydown', start);
47
+ }
55
48
 
56
49
 
57
50
  }
@@ -7,52 +7,45 @@ ready(function() {
7
7
  initWidget();
8
8
  });
9
9
 
10
- function detectIfIsMobile(windowContext) {
11
- let isMobile = false;
12
- if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(windowContext.navigator.userAgent))
13
- isMobile = true
14
- else
15
- isMobile = false
16
- return isMobile;
17
- }
18
10
 
19
11
  /** */
20
12
  function ready(callbackFunction){
21
- // if(document.readyState != 'loading'){
22
- // console.log('in ifffffff', document.readyState)
23
- // callbackFunction()
24
- // }
25
- // else{
26
- // document.addEventListener("DOMContentLoaded", callbackFunction)
27
- // }
28
- document.addEventListener('scroll', start);
29
- document.addEventListener('mousedown', start);
30
- document.addEventListener('mousemove', start);
31
- document.addEventListener('touchstart', start);
32
- document.addEventListener('keydown', start);
33
-
34
- let isMobile = detectIfIsMobile(window)
35
- if(isMobile){
36
- console.log('Mobile device detected: load Widget')
37
- document.dispatchEvent(new Event('mousemove'))
38
- }
39
-
40
- function start(){
41
- if(document.readyState==='complete'){
42
- callbackFunction()
43
- }else if(window.attachEvent){
44
- window.attachEvent('onload',callbackFunction);
45
- }else{
46
- window.addEventListener('load',callbackFunction,false);
47
- }
48
-
49
- document.removeEventListener('scroll', start);
50
- document.removeEventListener('mousedown', start);
51
- document.removeEventListener('mousemove', start);
52
- document.removeEventListener('touchstart', start);
53
- document.removeEventListener('scroll', start);
54
- document.removeEventListener('keydown', start);
13
+ // if(document.readyState != 'loading'){
14
+ // console.log('in ifffffff', document.readyState)
15
+ // callbackFunction()
16
+ // }
17
+ // else{
18
+ // document.addEventListener("DOMContentLoaded", callbackFunction)
19
+ // }
20
+ document.addEventListener('scroll', start);
21
+ document.addEventListener('mousedown', start);
22
+ document.addEventListener('mousemove', start);
23
+ document.addEventListener('touchstart', start);
24
+ document.addEventListener('keydown', start);
25
+
26
+ let time = 5000;
27
+ let timeout = setTimeout(()=> {
28
+ console.log('in timeout')
29
+ start();
30
+ }, time)
31
+
32
+ function start(){
33
+ clearTimeout(timeout);
34
+ if(document.readyState==='complete'){
35
+ callbackFunction()
36
+ }else if(window.attachEvent){
37
+ window.attachEvent('onload',callbackFunction);
38
+ }else{
39
+ window.addEventListener('load',callbackFunction,false);
55
40
  }
41
+
42
+ document.removeEventListener('scroll', start);
43
+ document.removeEventListener('mousedown', start);
44
+ document.removeEventListener('mousemove', start);
45
+ document.removeEventListener('touchstart', start);
46
+ document.removeEventListener('scroll', start);
47
+ document.removeEventListener('keydown', start);
48
+ }
56
49
 
57
50
 
58
51
  }