@chat21/chat21-web-widget 5.0.94-rc6 → 5.1.0-rc1

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,6 +6,12 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
+ # 5.1.0-rc1
10
+ - **added**: angular v17
11
+
12
+ # 5.0.94-rc7
13
+ - **added**: touchstart and touchend events for mobile mic footer button
14
+
9
15
  # 5.0.94-rc6
10
16
  - **bug-fixed**: logoChat is not rendered if contains special characters (ex. "(" or ")" ) in the name of the resource
11
17
 
package/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  ### STAGE 1: Build ###
2
2
 
3
3
  # We label our stage as ‘builder’
4
- FROM node:16.20.2-alpine3.18 as builder
4
+ FROM node:18.20.8-alpine AS builder
5
5
 
6
6
  COPY package.json package-lock.json ./
7
7
 
@@ -2,8 +2,14 @@
2
2
  version=`node -e 'console.log(require("./package.json").version)'`
3
3
  echo "version $version"
4
4
 
5
+ npm i
6
+
5
7
  ng build --configuration="pre" --aot=true --base-href --build-optimizer=true
6
8
 
9
+ ### SET HASHING : START ###
10
+ cp ./src/launch_template.js ./dist/launch.js
11
+ node ./src/build_launch.js
12
+ ### SET HASHING : END ###
7
13
 
8
14
  # ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
9
15
 
@@ -24,11 +30,10 @@ ng build --configuration="pre" --aot=true --base-href --build-optimizer=true
24
30
 
25
31
  # ########## --->>>> FIREBASE folder START <<<<<------ ########## #
26
32
  cd dist
27
- aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
28
- aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300
29
- cd ..
30
-
31
- #aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
33
+ aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300 --exclude='launch.js' #7days
34
+ aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
35
+ aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300 --exclude='launch.js' #7days
36
+ aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
32
37
  cd ..
33
38
 
34
39
  aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
@@ -4,6 +4,12 @@ echo "version $version"
4
4
 
5
5
  # --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
6
6
  ng build --configuration="prod" --aot=true --build-optimizer=true --vendor-chunk=true
7
+ ##--base-href='./v5/' --output-hashing none
8
+
9
+ ### SET HASHING : START ###
10
+ cp ./src/launch_template.js ./dist/launch.js
11
+ node ./src/build_launch.js
12
+ ### SET HASHING : END ###
7
13
 
8
14
  #### FIREBASE #####
9
15
  # cd dist
@@ -15,11 +21,12 @@ ng build --configuration="prod" --aot=true --build-optimizer=true --vendor-chu
15
21
  # #### MQTT #####
16
22
  cd dist
17
23
  # aws s3 sync . s3://tiledesk-widget/v5/latest/
18
- aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=300
19
- aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=300
24
+ aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=86400 --exclude='launch.js' #8days
25
+ aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
26
+ aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
27
+ aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
20
28
  cd ..
21
29
 
22
-
23
30
  aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
24
31
  echo new version deployed $version on s3://tiledesk-widget/v5
25
32
  echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v5/index.html
package/deploy_prod.sh CHANGED
@@ -4,9 +4,18 @@ ECHO "____________WIDGET-V5______________"
4
4
  echo "CREATING TAG ON GIT FOR version: $version"
5
5
  # echo "version $version"
6
6
 
7
+ # Get curent branch name
8
+ current_branch=$(git rev-parse --abbrev-ref HEAD)
9
+ remote_name=$(git config --get branch.$current_branch.remote)
10
+
11
+ ## Push commit to git
12
+ git add .
13
+ git commit -m "version added: ### $version"
14
+ git push "$remote_name" "$current_branch"
15
+
7
16
  if [ "$version" != "" ]; then
8
17
  git tag -a "$version" -m "`git log -1 --format=%s`"
9
18
  echo "Created a new tag, $version"
10
- git push remoteTiledesk --tags
19
+ git push --tags
11
20
  npm publish
12
21
  fi
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.94-rc6",
4
+ "version": "5.1.0-rc1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -19,16 +19,16 @@
19
19
  },
20
20
  "private": false,
21
21
  "dependencies": {
22
- "@angular/animations": "^15.0.4",
23
- "@angular/cdk": "^15.0.3",
24
- "@angular/common": "^15.0.4",
25
- "@angular/compiler": "^15.0.4",
26
- "@angular/core": "^15.0.4",
27
- "@angular/forms": "^15.0.4",
28
- "@angular/localize": "^15.0.4",
29
- "@angular/platform-browser": "^15.0.4",
30
- "@angular/platform-browser-dynamic": "^15.0.4",
31
- "@angular/router": "^15.0.4",
22
+ "@angular/animations": "^17.3.12",
23
+ "@angular/cdk": "^17.3.10",
24
+ "@angular/common": "^17.3.12",
25
+ "@angular/compiler": "^17.3.12",
26
+ "@angular/core": "^17.3.12",
27
+ "@angular/forms": "^17.3.12",
28
+ "@angular/localize": "^17.3.12",
29
+ "@angular/platform-browser": "^17.3.12",
30
+ "@angular/platform-browser-dynamic": "^17.3.12",
31
+ "@angular/router": "^17.3.12",
32
32
  "@ctrl/ngx-emoji-mart": "^7.1.0",
33
33
  "@ngx-translate/core": "^14.0.0",
34
34
  "@ngx-translate/http-loader": "^4.0.0",
@@ -48,13 +48,13 @@
48
48
  "source-map-explorer": "^2.5.3",
49
49
  "tslib": "^2.0.0",
50
50
  "uuid": "^8.3.2",
51
- "zone.js": "~0.11.4"
51
+ "zone.js": "~0.14.10"
52
52
  },
53
53
  "devDependencies": {
54
- "@angular-devkit/build-angular": "^15.0.4",
55
- "@angular/cli": "^15.0.4",
56
- "@angular/compiler-cli": "^15.0.4",
57
- "@angular/language-service": "^15.0.4",
54
+ "@angular-devkit/build-angular": "^17.3.17",
55
+ "@angular/cli": "^17.3.17",
56
+ "@angular/compiler-cli": "^17.3.12",
57
+ "@angular/language-service": "^17.3.12",
58
58
  "@types/jasmine": "^3.6.11",
59
59
  "@types/jasminewd2": "~2.0.3",
60
60
  "@types/node": "^12.11.1",
@@ -70,6 +70,6 @@
70
70
  "protractor": "~7.0.0",
71
71
  "ts-node": "~7.0.0",
72
72
  "tslint": "~6.1.0",
73
- "typescript": "^4.8.4"
73
+ "typescript": "~5.4"
74
74
  }
75
75
  }
@@ -1,31 +1,31 @@
1
1
  <div class="audio-recorder">
2
- <button *ngIf="audioUrl" (click)="deleteRecording()">
3
- <span class="v-align-center">
4
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm80-160h80v-360h-80v360Zm160 0h80v-360h-80v360Z"/></svg>
5
- <!-- <i class="material-icons">delete_outline</i> -->
6
- </span>
7
- </button>
2
+ <button *ngIf="audioUrl" (click)="deleteRecording()">
3
+ <span class="v-align-center">
4
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm80-160h80v-360h-80v360Zm160 0h80v-360h-80v360Z"/></svg>
5
+ <!-- <i class="material-icons">delete_outline</i> -->
6
+ </span>
7
+ </button>
8
8
 
9
- <chat-audio class="test" *ngIf="audioBlob && audioUrl"
10
- [audioBlob] = "audioBlob"
11
- [color]="'var(--chat-footer-color)'"
12
- [fontSize]="stylesMap.get('fontSize')"
13
- [stylesMap]="stylesMap">
14
- </chat-audio>
15
-
16
- <button *ngIf="!audioUrl" class="mic-button" (mousedown)="startRecording()" (mouseup)="stopRecording()">
17
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
18
- <path d="M480-400q-50 0-85-35t-35-85v-240q0-50 35-85t85-35q50 0 85 35t35 85v240q0 50-35 85t-85 35Zm0-240Zm-40 520v-123q-104-14-172-93t-68-184h80q0 83 58.5 141.5T480-320q83 0 141.5-58.5T680-520h80q0 105-68 184t-172 93v123h-80Zm40-360q17 0 28.5-11.5T520-520v-240q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760v240q0 17 11.5 28.5T480-480Z"/>
19
- </svg>
20
- </button>
21
- <!-- <button *ngIf="isRecording" (click)="stopRecording()"><i class="material-icons">pause_circle_outline</i></button> -->
9
+ <chat-audio class="test" *ngIf="audioBlob && audioUrl"
10
+ [audioBlob] = "audioBlob"
11
+ [color]="'var(--chat-footer-color)'"
12
+ [fontSize]="stylesMap.get('fontSize')"
13
+ [stylesMap]="stylesMap">
14
+ </chat-audio>
22
15
 
23
- <button *ngIf="audioUrl" (click)="sendMessage()">
24
- <span class="v-align-center">
25
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="20" width="24" viewBox="0 0 24 20" xml:space="preserve">
26
- <path d="M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"/>
27
- </svg>
28
- </span>
29
- </button>
16
+ <button *ngIf="!audioUrl" class="mic-button" (mousedown)="startRecording($event)" (mouseup)="stopRecording($event)" (touchstart)="startRecording($event)" (touchend)="stopRecording($event)">
17
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
18
+ <path d="M480-400q-50 0-85-35t-35-85v-240q0-50 35-85t85-35q50 0 85 35t35 85v240q0 50-35 85t-85 35Zm0-240Zm-40 520v-123q-104-14-172-93t-68-184h80q0 83 58.5 141.5T480-320q83 0 141.5-58.5T680-520h80q0 105-68 184t-172 93v123h-80Zm40-360q17 0 28.5-11.5T520-520v-240q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760v240q0 17 11.5 28.5T480-480Z"/>
19
+ </svg>
20
+ </button>
21
+ <!-- <button *ngIf="isRecording" (click)="stopRecording()"><i class="material-icons">pause_circle_outline</i></button> -->
22
+
23
+ <button *ngIf="audioUrl" (click)="sendMessage()">
24
+ <span class="v-align-center">
25
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="20" width="24" viewBox="0 0 24 20" xml:space="preserve">
26
+ <path d="M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"/>
27
+ </svg>
28
+ </span>
29
+ </button>
30
30
 
31
31
  </div>
@@ -29,8 +29,12 @@ export class ConversationAudioRecorderComponent {
29
29
  constructor(private sanitizer: DomSanitizer) {}
30
30
 
31
31
 
32
- startRecording() {
32
+ startRecording(event: Event) {
33
33
  // console.log('startRecording');
34
+ if (event.type === 'touchstart') {
35
+ event.preventDefault(); // Blocca il successivo mousedown
36
+ }
37
+
34
38
  this.startTime = Date.now();
35
39
  navigator.mediaDevices.getUserMedia({ audio: true })
36
40
  .then(stream => {
@@ -55,7 +59,12 @@ export class ConversationAudioRecorderComponent {
55
59
  });
56
60
  }
57
61
 
58
- stopRecording() {
62
+ stopRecording(event: Event) {
63
+
64
+ if (event.type === 'touchend') {
65
+ event.preventDefault(); // Previene il mouseup successivo
66
+ }
67
+
59
68
  let endTime = Date.now();
60
69
  let time = endTime - this.startTime;
61
70
  if(time > 500){
@@ -36,7 +36,7 @@
36
36
 
37
37
 
38
38
  <!--CASE: no conversations EXIST - >1 agents is available -->
39
- <div *ngIf="(!listConversations || listConversations.length == 0) && availableAgents && availableAgents.length > 1 && g.showAvailableAgents === true" style="margin: 20px 30px;">
39
+ <div *ngIf="(!listConversations || listConversations.length == 0) && availableAgents && availableAgents.length > 1 && g.showAvailableAgents === true" style="display: flex; margin: 20px 30px;">
40
40
  <div *ngFor="let agent of availableAgents" class="c21-pallozzo">
41
41
  <div class="c21-ball" [ngStyle] = "{ 'background-color':setColorFromString(agent.firstname) }" >
42
42
  <span class="c21-ball-label">{{avatarPlaceholder(agent.firstname)}}</span>
@@ -67,7 +67,7 @@ export class HomeConversationsComponent implements OnInit, OnDestroy {
67
67
  availableAgents: Array<UserAgent> = [];
68
68
  // ========= end:: variabili del componente ======== //
69
69
 
70
- waitingTime: Number;
70
+ waitingTime: number;
71
71
  langService: HumanizeDurationLanguage = new HumanizeDurationLanguage();
72
72
  humanizer: HumanizeDuration;
73
73
  humanWaitingTime: string;
package/src/polyfills.ts CHANGED
@@ -46,7 +46,7 @@
46
46
  * Zone JS is required by default for Angular itself.
47
47
  */
48
48
  // import './zone-flag';
49
- import 'zone.js/dist/zone'; // Included with Angular CLI.
49
+ import 'zone.js'; // Included with Angular CLI.
50
50
 
51
51
 
52
52
  /***************************************************************************************************