@chat21/chat21-web-widget 5.0.53-rc.1 → 5.0.53-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.
Files changed (131) hide show
  1. package/.github/workflows/docker-community-push-latest.yml +1 -0
  2. package/.github/workflows/docker-image-tag-community-tag-push.yml +1 -0
  3. package/CHANGELOG.md +17 -0
  4. package/Dockerfile +2 -2
  5. package/angular.json +6 -22
  6. package/deploy_amazon_beta.sh +1 -1
  7. package/deploy_amazon_prod.sh +1 -1
  8. package/karma.conf.js +1 -0
  9. package/package.json +20 -21
  10. package/src/app/app-routing.module.ts +1 -1
  11. package/src/app/app.component.scss +38 -10
  12. package/src/app/app.module.ts +3 -3
  13. package/src/app/component/conversation-detail/conversation/conversation.component.ts +0 -10
  14. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +0 -2
  15. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +0 -10
  16. package/src/app/component/form/form-builder/form-builder.component.ts +1 -1
  17. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +1 -1
  18. package/src/app/component/form/inputs/form-label/form-label.component.ts +1 -1
  19. package/src/app/component/form/inputs/form-text/form-text.component.ts +2 -2
  20. package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +2 -2
  21. package/src/app/component/form/prechat-form/prechat-form.component.ts +1 -1
  22. package/src/app/component/message/bubble-message/bubble-message.component.html +1 -4
  23. package/src/app/component/message/bubble-message/bubble-message.component.ts +1 -37
  24. package/src/app/component/message/image/image.component.ts +1 -9
  25. package/src/app/component/message/info-message/info-message.component.html +3 -3
  26. package/src/app/component/message/info-message/info-message.component.ts +0 -10
  27. package/src/app/directives/tooltip.directive.spec.ts +8 -0
  28. package/src/app/directives/tooltip.directive.ts +46 -0
  29. package/src/assets/twp/index-dev.html +3 -3
  30. package/src/assets/twp/index.html +4 -4
  31. package/src/chat21-core/providers/abstract/archivedconversations-handler.service.ts +5 -5
  32. package/src/chat21-core/providers/abstract/conversation-handler.service.ts +6 -6
  33. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +6 -6
  34. package/src/chat21-core/providers/abstract/groups-handler.service.ts +5 -5
  35. package/src/chat21-core/providers/abstract/messagingAuth.service.ts +2 -2
  36. package/src/chat21-core/providers/abstract/notifications.service.ts +1 -1
  37. package/src/chat21-core/providers/abstract/presence.service.ts +2 -2
  38. package/src/chat21-core/providers/abstract/typing.service.ts +2 -2
  39. package/src/chat21-core/providers/abstract/upload.service.ts +1 -1
  40. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
  41. package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +1 -1
  42. package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -1
  43. package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
  44. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +0 -1
  45. package/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts +1 -1
  46. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +1 -1
  47. package/src/chat21-core/utils/constants.ts +3 -2
  48. package/src/chat21-core/utils/utils.ts +2 -0
  49. package/src/launch.js +10 -6
  50. package/{dist/launch.js → src/launch_old.js} +80 -5
  51. package/src/main.ts +1 -0
  52. package/src/polyfills.ts +0 -10
  53. package/src/test.ts +3 -1
  54. package/tsconfig.json +5 -3
  55. package/dist/3rdpartylicenses.txt +0 -942
  56. package/dist/assets/i18n/en.json +0 -94
  57. package/dist/assets/i18n/es.json +0 -90
  58. package/dist/assets/i18n/fr.json +0 -90
  59. package/dist/assets/i18n/it.json +0 -90
  60. package/dist/assets/images/avatar_bot_tiledesk.svg +0 -1
  61. package/dist/assets/images/chat_human_avatar.svg +0 -12
  62. package/dist/assets/images/f21ico-done.svg +0 -1
  63. package/dist/assets/images/f21ico-done_all.svg +0 -1
  64. package/dist/assets/images/f21ico-schedule.svg +0 -1
  65. package/dist/assets/images/file-alt-solid.png +0 -0
  66. package/dist/assets/images/light_avatar_placeholder.svg +0 -1
  67. package/dist/assets/images/tommy_bot_tiledesk.svg +0 -48
  68. package/dist/assets/images/website_mockup.jpg +0 -0
  69. package/dist/assets/js/chat21client.js +0 -1066
  70. package/dist/assets/js/mqtt/4.1.0/mqtt.min.js +0 -1
  71. package/dist/assets/js/mqtt/4.2.6/mqtt.min.js +0 -1
  72. package/dist/assets/js/mqtt/4.2.8/mqtt.min.js +0 -1
  73. package/dist/assets/sounds/Carme.mp3 +0 -0
  74. package/dist/assets/sounds/justsaying.mp3 +0 -0
  75. package/dist/assets/sounds/pling.mp3 +0 -0
  76. package/dist/assets/styles/tiledesk_v1.scss +0 -22
  77. package/dist/assets/twp/chatbot-panel.html +0 -424
  78. package/dist/assets/twp/index-dev.html +0 -2430
  79. package/dist/assets/twp/index.html +0 -603
  80. package/dist/assets/twp/tiledesk_widget_files/bootstrap.min.css +0 -5
  81. package/dist/assets/twp/tiledesk_widget_files/bootstrap.min.js +0 -7
  82. package/dist/assets/twp/tiledesk_widget_files/facebook.png +0 -0
  83. package/dist/assets/twp/tiledesk_widget_files/font-awesome.min.css +0 -4
  84. package/dist/assets/twp/tiledesk_widget_files/icon +0 -23
  85. package/dist/assets/twp/tiledesk_widget_files/jquery.min.js +0 -2
  86. package/dist/assets/twp/tiledesk_widget_files/linkedin.png +0 -0
  87. package/dist/assets/twp/tiledesk_widget_files/logo-black.png +0 -0
  88. package/dist/assets/twp/tiledesk_widget_files/logo-mobile.png +0 -0
  89. package/dist/assets/twp/tiledesk_widget_files/logo-short.png +0 -0
  90. package/dist/assets/twp/tiledesk_widget_files/logo.png +0 -0
  91. package/dist/assets/twp/tiledesk_widget_files/logo@2x-black.png +0 -0
  92. package/dist/assets/twp/tiledesk_widget_files/telegram.png +0 -0
  93. package/dist/assets/twp/tiledesk_widget_files/twitter.png +0 -0
  94. package/dist/assets/twp/tiledesk_widget_files/website-poly.min.css +0 -5623
  95. package/dist/assets/twp/tiledesk_widget_files/whatsapp.png +0 -0
  96. package/dist/base_script.html +0 -57
  97. package/dist/environments/real_data/widget-config-docker.json +0 -28
  98. package/dist/environments/real_data/widget-config-firebase.json +0 -30
  99. package/dist/environments/real_data/widget-config-mqtt.json +0 -27
  100. package/dist/environments/real_data/widget-config-native-mqtt.json +0 -28
  101. package/dist/environments/real_data/widget-config-native-prod.json +0 -27
  102. package/dist/f21ico-done.svg +0 -1
  103. package/dist/f21ico-done_all.svg +0 -1
  104. package/dist/f21ico-schedule.svg +0 -1
  105. package/dist/favicon.ico +0 -0
  106. package/dist/iframe-style.css +0 -189
  107. package/dist/index.html +0 -16
  108. package/dist/main.js +0 -1
  109. package/dist/polyfills-es5.js +0 -1
  110. package/dist/polyfills.js +0 -1
  111. package/dist/runtime.js +0 -1
  112. package/dist/scripts.js +0 -1
  113. package/dist/styles.css +0 -1
  114. package/dist/styles.js +0 -1
  115. package/dist/test-custom-auth.html +0 -50
  116. package/dist/test-new.html +0 -231
  117. package/dist/test.html +0 -142
  118. package/dist/tiledesk.js +0 -72
  119. package/dist/vendor.js +0 -1
  120. package/dist/widget-config-template.json +0 -29
  121. package/dist/widget-config.json +0 -29
  122. package/e2e/protractor.conf.js +0 -32
  123. package/src/base_script.html +0 -57
  124. package/src/environments/environment.pre.ts +0 -42
  125. package/src/environments/environment.prod.ts +0 -40
  126. package/src/environments/environment.ts +0 -41
  127. package/src/environments/real_data/widget-config-docker.json +0 -28
  128. package/src/environments/real_data/widget-config-firebase.json +0 -30
  129. package/src/environments/real_data/widget-config-mqtt.json +0 -27
  130. package/src/environments/real_data/widget-config-native-mqtt.json +0 -28
  131. package/src/environments/real_data/widget-config-native-prod.json +0 -27
@@ -19,4 +19,5 @@ jobs:
19
19
  username: ${{ secrets.DOCKERHUB_USERNAME }}
20
20
  password: ${{ secrets.DOCKERHUB_TOKEN }}
21
21
  repository: chat21/chat21-web-widget
22
+ push: true
22
23
  tags: latest
@@ -18,4 +18,5 @@ jobs:
18
18
  username: ${{ secrets.DOCKERHUB_USERNAME }}
19
19
  password: ${{ secrets.DOCKERHUB_TOKEN }}
20
20
  repository: chat21/chat21-web-widget
21
+ push: true
21
22
  tag_with_ref: true
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.53-rc.3
4
+ - added: html descriptions to index.html and index-dev.html
5
+ - changed: script tag for style.css to link tag with rel="stylesheet"
6
+ - changed: binding to tiledesk iframe from scr to srcdoc
7
+ - removed: base_script.html
8
+ - removed: jquery plugin
9
+ - removed: relativeLinkResolution from forRoot in RooterModule
10
+
11
+
12
+ ### 5.0.53-rc.2
13
+ - added: angular 15 engine
14
+ - added: custom tooltip directive
15
+ - changed: buildOptimization ng build parameter to build-optimization
16
+ - removed: ng2-tooltip-directive and ng2-tooltip-directive-ng13fix
17
+ - removed: initializatoin of abstract variables in chat21-core abstract providers
18
+ - removed: enableIvy parameter from tsconfig.json
19
+
3
20
  ### 5.0.53-rc.1
4
21
  - added: Rules class (work in progress)
5
22
  - added: base_script.html to load element inside tiledesk-iframe
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:12.20.2-alpine as builder
4
+ FROM node:14.21.2-alpine as builder
5
5
 
6
6
  COPY package.json package-lock.json ./
7
7
 
@@ -15,7 +15,7 @@ COPY . .
15
15
 
16
16
  ## Build the angular app in production mode and store the artifacts in dist folder
17
17
 
18
- RUN npm run ng build -- --configuration="prod" --output-path=dist --base-href="./" --output-hashing=none --buildOptimizer=false --vendor-chunk
18
+ RUN npm run ng build -- --configuration="prod" --output-path=dist --base-href="./" --output-hashing=none --build-optimizer=false --vendor-chunk
19
19
 
20
20
 
21
21
  ### STAGE 2: Setup ###
package/angular.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
3
  "version": 1,
4
- "defaultProject": "widget",
5
4
  "newProjectRoot": "projects",
6
5
  "projects": {
7
6
  "widget": {
@@ -43,21 +42,20 @@
43
42
  ],
44
43
  "styles": [
45
44
  "src/app/sass/styles.scss",
46
- "node_modules/@ctrl/ngx-emoji-mart/picker.css",
47
- "node_modules/bootstrap/dist/js/bootstrap.min.js",
48
- "node_modules/popper.js/dist/umd/popper.min.js"
45
+ "node_modules/@ctrl/ngx-emoji-mart/picker.css"
49
46
  ],
50
47
  "scripts": [
51
48
  "src/assets/js/mqtt/4.2.6/mqtt.min.js",
52
- "node_modules/jquery/dist/jquery.min.js",
53
- "node_modules/bootstrap/dist/js/bootstrap.min.js"
49
+ "node_modules/bootstrap/dist/js/bootstrap.min.js",
50
+ "node_modules/popper.js/dist/umd/popper.min.js"
54
51
  ],
55
52
  "vendorChunk": true,
56
53
  "extractLicenses": false,
57
54
  "buildOptimizer": false,
58
55
  "allowedCommonJsDependencies": [
59
56
  "rxjs-compat",
60
- "moment"
57
+ "moment",
58
+ "idb"
61
59
  ],
62
60
  "sourceMap": true,
63
61
  "optimization": false,
@@ -144,8 +142,7 @@
144
142
  "test": {
145
143
  "builder": "@angular-devkit/build-angular:karma",
146
144
  "options": {
147
- "main": "src/test.ts",
148
- "polyfills": "src/polyfills.ts",
145
+ "polyfills": ["zone.js", "zone.js/testing"],
149
146
  "tsConfig": "tsconfig.spec.json",
150
147
  "karmaConfig": "karma.conf.js",
151
148
  "assets": [
@@ -159,19 +156,6 @@
159
156
  "codeCoverage": true
160
157
  }
161
158
  },
162
- "lint": {
163
- "builder": "@angular-devkit/build-angular:tslint",
164
- "options": {
165
- "tsConfig": [
166
- "tsconfig.app.json",
167
- "tsconfig.spec.json",
168
- "e2e/tsconfig.json"
169
- ],
170
- "exclude": [
171
- "**/node_modules/**"
172
- ]
173
- }
174
- },
175
159
  "e2e": {
176
160
  "builder": "@angular-devkit/build-angular:protractor",
177
161
  "options": {
@@ -2,7 +2,7 @@
2
2
  version=`node -e 'console.log(require("./package.json").version)'`
3
3
  echo "version $version"
4
4
 
5
- ng build --configuration="pre" --aot=true --base-href --output-hashing none --buildOptimizer=true
5
+ ng build --configuration="pre" --aot=true --base-href --output-hashing none --build-optimizer=true
6
6
 
7
7
  # ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
8
8
 
@@ -3,7 +3,7 @@ version=`node -e 'console.log(require("./package.json").version)'`
3
3
  echo "version $version"
4
4
 
5
5
  # --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
6
- ng build --configuration="prod" --aot=true --base-href --output-hashing none --buildOptimizer=true --vendor-chunk=true
6
+ ng build --configuration="prod" --aot=true --base-href --output-hashing none --build-optimizer=true --vendor-chunk=true
7
7
 
8
8
  cd dist
9
9
  # aws s3 sync . s3://tiledesk-widget/v5/latest/
package/karma.conf.js CHANGED
@@ -7,6 +7,7 @@ module.exports = function (config) {
7
7
  frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
8
  plugins: [
9
9
  require('karma-jasmine'),
10
+ require('karma-coverage'),
10
11
  require('karma-chrome-launcher'),
11
12
  require('karma-jasmine-html-reporter'),
12
13
  require('karma-coverage-istanbul-reporter'),
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.53-rc.1",
5
- "license": "MIT License",
4
+ "version": "5.0.53-rc.3",
5
+ "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
8
8
  "type": "git",
@@ -18,18 +18,18 @@
18
18
  },
19
19
  "private": false,
20
20
  "dependencies": {
21
- "@angular/animations": "^12.2.16",
22
- "@angular/cdk": "^12.2.13",
23
- "@angular/common": "^12.2.16",
24
- "@angular/compiler": "~12.2.16",
25
- "@angular/core": "~12.2.16",
26
- "@angular/forms": "~12.2.16",
27
- "@angular/localize": "^12.2.16",
28
- "@angular/platform-browser": "^12.2.16",
29
- "@angular/platform-browser-dynamic": "~12.2.16",
30
- "@angular/router": "~12.2.16",
31
- "@ctrl/ngx-emoji-mart": "^5.1.2",
32
- "@ngx-translate/core": "^12.1.2",
21
+ "@angular/animations": "^15.0.4",
22
+ "@angular/cdk": "^15.0.3",
23
+ "@angular/common": "^15.0.4",
24
+ "@angular/compiler": "^15.0.4",
25
+ "@angular/core": "^15.0.4",
26
+ "@angular/forms": "^15.0.4",
27
+ "@angular/localize": "^15.0.4",
28
+ "@angular/platform-browser": "^15.0.4",
29
+ "@angular/platform-browser-dynamic": "^15.0.4",
30
+ "@angular/router": "^15.0.4",
31
+ "@ctrl/ngx-emoji-mart": "^7.1.0",
32
+ "@ngx-translate/core": "^14.0.0",
33
33
  "@ngx-translate/http-loader": "^4.0.0",
34
34
  "@popperjs/core": "^2.11.5",
35
35
  "@types/marked": "^4.0.3",
@@ -38,10 +38,8 @@
38
38
  "file-saver": "^2.0.5",
39
39
  "firebase": "^8.6.7",
40
40
  "humanize-duration-ts": "^2.1.1",
41
- "jquery": "^3.6.0",
42
41
  "marked": "^4.0.16",
43
42
  "moment": "^2.29.3",
44
- "ng2-tooltip-directive": "^2.10.3",
45
43
  "ngx-logger": "^5.0.11",
46
44
  "ngx-moment": "^6.0.2",
47
45
  "popper.js": "^1.16.1",
@@ -51,10 +49,10 @@
51
49
  "zone.js": "~0.11.4"
52
50
  },
53
51
  "devDependencies": {
54
- "@angular-devkit/build-angular": "~12.2.17",
55
- "@angular/cli": "~12.2.17",
56
- "@angular/compiler-cli": "~12.2.16",
57
- "@angular/language-service": "~12.2.16",
52
+ "@angular-devkit/build-angular": "^15.0.4",
53
+ "@angular/cli": "^15.0.4",
54
+ "@angular/compiler-cli": "^15.0.4",
55
+ "@angular/language-service": "^15.0.4",
58
56
  "@types/jasmine": "^3.6.11",
59
57
  "@types/jasminewd2": "~2.0.3",
60
58
  "@types/node": "^12.11.1",
@@ -63,12 +61,13 @@
63
61
  "jasmine-spec-reporter": "~5.0.0",
64
62
  "karma": "~6.3.20",
65
63
  "karma-chrome-launcher": "~3.1.0",
64
+ "karma-coverage": "^2.2.0",
66
65
  "karma-coverage-istanbul-reporter": "~3.0.2",
67
66
  "karma-jasmine": "~4.0.0",
68
67
  "karma-jasmine-html-reporter": "^1.5.0",
69
68
  "protractor": "~7.0.0",
70
69
  "ts-node": "~7.0.0",
71
70
  "tslint": "~6.1.0",
72
- "typescript": "~4.3.5"
71
+ "typescript": "^4.8.4"
73
72
  }
74
73
  }
@@ -5,7 +5,7 @@ import { Routes, RouterModule } from '@angular/router';
5
5
  const routes: Routes = [];
6
6
 
7
7
  @NgModule({
8
- imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
8
+ imports: [RouterModule.forRoot(routes)],
9
9
  exports: [RouterModule]
10
10
  })
11
11
  export class AppRoutingModule { }
@@ -5,7 +5,7 @@
5
5
  @import 'src/app/sass/variables';
6
6
  @import url('./sass/animations.scss');
7
7
  @import url("./sass/hover.css");
8
- @import '~@ctrl/ngx-emoji-mart/picker';
8
+ @import '@ctrl/ngx-emoji-mart/picker';
9
9
  // @import "~bootstrap/dist/css/bootstrap.css";
10
10
  /** custom scroll bar **/
11
11
  input, select:focus, textarea {
@@ -47,15 +47,6 @@ input, select:focus, textarea {
47
47
  --button-in-msg-font-size: 15px;
48
48
  }
49
49
 
50
- .chat-tooltip {
51
- font-family: 'Roboto','Google Sans', Helvetica, Arial, sans-serif;
52
- font-size: 12px;
53
- font-style: normal;
54
- letter-spacing: normal;
55
- font-stretch: normal;
56
- font-variant: normal;
57
- font-weight: 300;
58
- }
59
50
 
60
51
  body {
61
52
  margin:0px;
@@ -216,7 +207,44 @@ textarea::placeholder {
216
207
  }
217
208
  }
218
209
 
210
+ }
211
+
212
+ .tooltip-container {
213
+ font-family: 'Roboto','Google Sans', Helvetica, Arial, sans-serif;
214
+ font-size: 12px;
215
+ font-style: normal;
216
+ letter-spacing: normal;
217
+ font-stretch: normal;
218
+ font-variant: normal;
219
+ font-weight: 300;
220
+ z-index: 100;
221
+ position: fixed;
222
+ padding: 6px 12px;
223
+ line-height: initial;
224
+ color: black;
225
+ width: auto;
226
+ background:rgb(255, 255, 255);
227
+ border-radius: 10px;
228
+ -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
229
+ box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
230
+ box-sizing: border-box;
231
+ opacity: 0;
232
+ transform: translate(-80%, -70%);
233
+ animation: tooltip-slide 0.18s ease-out 0.5s;
234
+ animation-fill-mode: forwards;
235
+ pointer-events: none;
236
+ }
237
+
238
+ @keyframes tooltip-slide {
239
+ 0% {
240
+ opacity: 0;
241
+ transform: translate(-50%, -70%);
219
242
  }
243
+ 100% {
244
+ opacity: 1;
245
+ transform: translate(-50%, -50%);
246
+ }
247
+ }
220
248
 
221
249
  chat-root {
222
250
  position: absolute;
@@ -57,7 +57,6 @@ import { environment } from 'src/environments/environment';
57
57
  //THIRD-PART MODULES
58
58
  import { TranslateModule } from '@ngx-translate/core';
59
59
  import { MomentModule } from 'ngx-moment';
60
- import { TooltipModule } from 'ng2-tooltip-directive';
61
60
  import { PickerModule } from '@ctrl/ngx-emoji-mart';
62
61
  import { INGXLoggerMetadata, LoggerModule, NGXLogger, NgxLoggerLevel, NGXLoggerServerService, TOKEN_LOGGER_SERVER_SERVICE } from "ngx-logger";
63
62
 
@@ -128,6 +127,7 @@ import { WaitingService } from './providers/waiting.service';
128
127
  import { StarRatingWidgetService } from './providers/star-rating-widget.service';
129
128
  import { LikeUnlikeComponent } from './component/message/like-unlike/like-unlike.component';
130
129
  import { Rules } from './utils/rules';
130
+ import { TooltipDirective } from 'src/app/directives/tooltip.directive';
131
131
 
132
132
 
133
133
  const appInitializerFn = (appConfig: AppConfigService, logger: NGXLogger) => {
@@ -283,7 +283,8 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
283
283
  HtmlEntitiesEncodePipe,
284
284
  MarkedPipe,
285
285
  SafeHtmlPipe,
286
- LikeUnlikeComponent
286
+ LikeUnlikeComponent,
287
+ TooltipDirective
287
288
  ],
288
289
  imports: [
289
290
  BrowserModule,
@@ -293,7 +294,6 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
293
294
  FormsModule,
294
295
  ReactiveFormsModule,
295
296
  MomentModule,
296
- TooltipModule,
297
297
  PickerModule,
298
298
  TranslateModule.forRoot(//),
299
299
  {
@@ -144,16 +144,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
144
144
  dropEvent: Event
145
145
  // ========== end:: DRAG & DROP =======
146
146
 
147
- tooltipOptions = {
148
- 'show-delay': 1500,
149
- 'tooltip-class': 'chat-tooltip',
150
- 'theme': 'light',
151
- 'shadow': false,
152
- 'hide-delay-mobile': 0,
153
- 'hideDelayAfterClick': 3000,
154
- 'hide-delay': 200
155
- };
156
-
157
147
  translationMapHeader: Map<string, string>;
158
148
  translationMapFooter: Map<string, string>;
159
149
  translationMapContent: Map<string, string>;
@@ -1,5 +1,4 @@
1
1
  import { MomentModule } from 'ngx-moment';
2
- import { TooltipModule } from 'ng2-tooltip-directive';
3
2
  import { async, ComponentFixture, TestBed, waitForAsync, inject } from '@angular/core/testing';
4
3
 
5
4
  import { ConversationContentComponent } from './conversation-content.component';
@@ -36,7 +35,6 @@ describe('ConversationContentComponent', () => {
36
35
  HtmlEntitiesEncodePipe,
37
36
  ],
38
37
  imports: [
39
- TooltipModule,
40
38
  MomentModule
41
39
  ],
42
40
  providers: [
@@ -67,16 +67,6 @@ export class ConversationContentComponent implements OnInit {
67
67
  MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
68
68
  // ========== end:: check message type functions ======= //
69
69
 
70
- tooltipOptions = {
71
- 'show-delay': 1500,
72
- 'tooltip-class': 'chat-tooltip',
73
- 'theme': 'light',
74
- 'shadow': false,
75
- 'hide-delay-mobile': 0,
76
- 'hideDelayAfterClick': 3000,
77
- 'hide-delay': 200
78
- };
79
-
80
70
  urlBOTImage = 'https://s3.eu-west-1.amazonaws.com/tiledesk-widget/dev/2.0.4-beta.7/assets/images/avatar_bot_tiledesk.svg'
81
71
  uploadProgress: number;
82
72
  showUploadProgress: boolean = false;
@@ -52,7 +52,7 @@ export class FormBuilderComponent implements OnInit {
52
52
  }
53
53
  }
54
54
 
55
- buildFormGroup(inputJson: Array<FormArray>): FormGroup {
55
+ buildFormGroup(inputJson: Array<FormArray>): FormGroup<any> {
56
56
  let objectFormBuilder: { [key: string]: FormControl } = {}
57
57
  let restoreDefault = false;
58
58
  let initIndex:number = 1411;
@@ -17,7 +17,7 @@ export class FormCheckboxComponent implements OnInit {
17
17
  @Input() hasSubmitted: boolean;
18
18
  @Output() onKeyEnterPressed = new EventEmitter<any>();
19
19
 
20
- form: FormGroup;
20
+ form: FormGroup<any>;
21
21
  constructor(private rootFormGroup: FormGroupDirective,
22
22
  private elementRef: ElementRef) { }
23
23
 
@@ -14,7 +14,7 @@ export class FormLabelComponent implements OnInit {
14
14
  @Input() controlName: string;
15
15
  @Input() hasSubmitted: boolean;
16
16
 
17
- form: FormGroup;
17
+ form: FormGroup<any>;
18
18
  constructor(private rootFormGroup: FormGroupDirective) { }
19
19
 
20
20
  ngOnInit() {
@@ -18,13 +18,13 @@ export class FormTextComponent implements OnInit {
18
18
  @Output() onKeyEnterPressed = new EventEmitter<any>();
19
19
 
20
20
  @ViewChild('div_input') input: ElementRef;
21
- form: FormGroup;
21
+ form: FormGroup<any>;
22
22
  inputType: string = 'text'
23
23
  constructor(private rootFormGroup: FormGroupDirective,
24
24
  private elementRef: ElementRef) { }
25
25
 
26
26
  ngOnInit() {
27
- this.form = this.rootFormGroup.control as FormGroup;
27
+ this.form = this.rootFormGroup.control as FormGroup<any>;
28
28
  if(this.form && this.form.controls && this.form.controls[this.controlName]){
29
29
  this.form.controls[this.controlName].valueChanges.subscribe((value) => {
30
30
  this.hasSubmitted= false;
@@ -17,12 +17,12 @@ export class FormTextareaComponent implements OnInit {
17
17
  @Input() hasSubmitted: boolean;
18
18
  @Output() onKeyEnterPressed = new EventEmitter<any>();
19
19
  @ViewChild('div_input') input: ElementRef;
20
- form: FormGroup;
20
+ form: FormGroup<any>;
21
21
  constructor(private rootFormGroup: FormGroupDirective,
22
22
  private elementRef: ElementRef) { }
23
23
 
24
24
  ngOnInit() {
25
- this.form = this.rootFormGroup.control as FormGroup;
25
+ this.form = this.rootFormGroup.control as FormGroup<any>;
26
26
  if(this.form && this.form.controls && this.form.controls[this.controlName]){
27
27
  this.form.controls[this.controlName].valueChanges.subscribe((value) => {
28
28
  this.hasSubmitted= false;
@@ -23,7 +23,7 @@ export class PrechatFormComponent implements OnInit, AfterViewInit {
23
23
 
24
24
 
25
25
  // ========= begin:: component variables ======= //
26
- preChatFormGroup: FormGroup;
26
+ preChatFormGroup: FormGroup<any>;
27
27
  userFullname: string;
28
28
  userEmail: string;
29
29
  // ========= end:: component variables ======= //
@@ -46,10 +46,7 @@
46
46
  <!-- <div *ngIf="message.type == 'text'"> -->
47
47
 
48
48
 
49
- <div *ngIf="message?.text" [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" contentType="template" (click)="handleTooltipEvents($event)">
50
- <ng-template #timeTooltipLeft>
51
- <span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
52
- </ng-template>
49
+ <div *ngIf="message?.text" tooltip="{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})">
53
50
 
54
51
 
55
52
  <!-- [htmlEnabled]="(message?.type==='html')? true : false" -->
@@ -6,7 +6,7 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
6
6
  import { MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
7
7
  import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
8
8
  import { isFile, isFrame, isImage, messageType } from 'src/chat21-core/utils/utils-message';
9
- import { MAX_WIDTH_IMAGES, MIN_WIDTH_IMAGES} from '../../../utils/constants';
9
+ import { MAX_WIDTH_IMAGES, MIN_WIDTH_IMAGES} from 'src/chat21-core/utils/constants';
10
10
 
11
11
  @Component({
12
12
  selector: 'chat-bubble-message',
@@ -35,16 +35,6 @@ export class BubbleMessageComponent implements OnInit {
35
35
  MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
36
36
  MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
37
37
  // ========== end:: check message type functions ======= //
38
-
39
- tooltipOptions = {
40
- 'show-delay': 500,
41
- 'tooltip-class': 'chat-tooltip',
42
- 'theme': 'light',
43
- 'shadow': false,
44
- 'hide-delay-mobile': 0,
45
- 'hideDelayAfterClick': 3000,
46
- 'hide-delay': 200
47
- };
48
38
  sizeImage : { width: number, height: number}
49
39
 
50
40
  private logger: LoggerService = LoggerInstance.getInstance()
@@ -119,32 +109,6 @@ export class BubbleMessageComponent implements OnInit {
119
109
  return sizeImage
120
110
  }
121
111
 
122
- /**
123
- * function customize tooltip
124
- */
125
- handleTooltipEvents(event) {
126
- const that = this;
127
- const showDelay = this.tooltipOptions['showDelay'];
128
- setTimeout(function () {
129
- try {
130
- const domRepresentation = document.getElementsByClassName('chat-tooltip');
131
- if (domRepresentation) {
132
- const item = domRepresentation[0] as HTMLInputElement;
133
- if (!item.classList.contains('tooltip-show')) {
134
- item.classList.add('tooltip-show');
135
- }
136
- setTimeout(function () {
137
- if (item.classList.contains('tooltip-show')) {
138
- item.classList.remove('tooltip-show');
139
- }
140
- }, that.tooltipOptions['hideDelayAfterClick']);
141
- }
142
- } catch (err) {
143
- that.logger.error('[BUBBLE-MESSAGE] handleTooltipEvents >>>> Error :' + err);
144
- }
145
- }, showDelay);
146
- }
147
-
148
112
  // ========= begin:: event emitter function ============//
149
113
 
150
114
  // returnOpenAttachment(event: String) {
@@ -17,15 +17,7 @@ export class ImageComponent implements OnInit {
17
17
 
18
18
  loading: boolean = true
19
19
  tooltipMessage: string;
20
- tooltipOptions = {
21
- 'show-delay': 0,
22
- 'tooltip-class': 'chat-tooltip',
23
- 'theme': 'light',
24
- 'shadow': false,
25
- 'hide-delay-mobile': 0,
26
- 'hideDelayAfterClick': 3000,
27
- 'hide-delay': 200
28
- };
20
+
29
21
 
30
22
  popupUrl = popupUrl;
31
23
 
@@ -6,10 +6,10 @@
6
6
  </div>
7
7
 
8
8
  <div style="max-width: 70%;">
9
- <span class="base_info" [innerHTML]="message?.text | marked" [options]="tooltipOptions" [tooltip]="timeTooltipLeft" placement="left" contentType="template"></span>
10
- <ng-template #timeTooltipLeft>
9
+ <span class="base_info" [innerHTML]="message?.text | marked" tooltip="{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})" placement="left" contentType="template"></span>
10
+ <!-- <ng-template #timeTooltipLeft>
11
11
  <span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
12
- </ng-template>
12
+ </ng-template> -->
13
13
  </div>
14
14
 
15
15
  <div class="spinner">
@@ -15,16 +15,6 @@ export class InfoMessageComponent implements OnInit {
15
15
 
16
16
  public message_text: string
17
17
  private logger: LoggerService = LoggerInstance.getInstance()
18
-
19
- tooltipOptions = {
20
- 'show-delay': 500,
21
- 'tooltip-class': 'chat-tooltip',
22
- 'theme': 'light',
23
- 'shadow': false,
24
- 'hide-delay-mobile': 0,
25
- 'hideDelayAfterClick': 3000,
26
- 'hide-delay': 200
27
- };
28
18
 
29
19
  constructor() { }
30
20
 
@@ -0,0 +1,8 @@
1
+ import { TooltipDirective } from './tooltip.directive';
2
+
3
+ describe('TooltipDirective', () => {
4
+ // it('should create an instance', () => {
5
+ // const directive = new TooltipDirective();
6
+ // expect(directive).toBeTruthy();
7
+ // });
8
+ });
@@ -0,0 +1,46 @@
1
+ import { Directive, ElementRef, HostListener, Input, OnDestroy } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[tooltip]'
5
+ })
6
+ export class TooltipDirective implements OnDestroy{
7
+
8
+ @Input() tooltip: any; // The text for the tooltip to display
9
+ @Input() delay? = 190; // Optional delay input, in ms
10
+
11
+ private myPopup;
12
+ private timer;
13
+
14
+ constructor(private el: ElementRef) { }
15
+
16
+ ngOnDestroy(): void {
17
+ if (this.myPopup) { this.myPopup.remove() }
18
+ }
19
+
20
+ @HostListener('mouseenter') onMouseEnter() {
21
+ this.timer = setTimeout(() => {
22
+ let x = this.el.nativeElement.getBoundingClientRect().left + this.el.nativeElement.offsetWidth / 2; // Get the middle of the element
23
+ let y = this.el.nativeElement.getBoundingClientRect().top + this.el.nativeElement.offsetHeight + 6; // Get the bottom of the element, plus a little extra
24
+ this.createTooltipPopup(x, y);
25
+ }, this.delay)
26
+ }
27
+
28
+ @HostListener('mouseleave') onMouseLeave() {
29
+ if (this.timer) clearTimeout(this.timer);
30
+ if (this.myPopup) { this.myPopup.remove() }
31
+ }
32
+
33
+ private createTooltipPopup(x: number, y: number) {
34
+ let popup = document.createElement('div');
35
+ popup.innerHTML = this.tooltip;
36
+ popup.setAttribute("class", "tooltip-container");
37
+ popup.style.top = y.toString() + "px";
38
+ popup.style.left = x.toString() + "px";
39
+ document.body.appendChild(popup);
40
+ this.myPopup = popup;
41
+ setTimeout(() => {
42
+ if (this.myPopup) this.myPopup.remove();
43
+ }, 5000); // Remove tooltip after 5 seconds
44
+ }
45
+
46
+ }