@chat21/chat21-web-widget 5.1.1-rc1 → 5.1.4
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 +50 -0
- package/deploy_amazon_prod.sh +20 -6
- package/package.json +2 -2
- package/src/app/app.component.scss +10 -9
- package/src/app/app.component.ts +38 -10
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +18 -18
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +3 -1
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +1 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +12 -3
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +6 -6
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +35 -13
- package/src/app/component/home/home.component.scss +5 -3
- package/src/app/component/last-message/last-message.component.ts +61 -9
- package/src/app/component/launcher-button/launcher-button.component.html +1 -1
- package/src/app/component/message/avatar/avatar.component.scss +1 -1
- package/src/app/component/message/bubble-message/bubble-message.component.scss +1 -1
- package/src/app/component/message/buttons/action-button/action-button.component.scss +19 -14
- package/src/app/component/message/buttons/link-button/link-button.component.scss +18 -11
- package/src/app/component/message/buttons/text-button/text-button.component.scss +20 -11
- package/src/app/component/message/carousel/carousel.component.scss +25 -17
- package/src/app/component/message/text/text.component.html +1 -2
- package/src/app/component/message-attachment/message-attachment.component.html +7 -3
- package/src/app/component/message-attachment/message-attachment.component.scss +3 -2
- package/src/app/component/send-button/send-button.component.html +2 -2
- package/src/app/pipe/marked.pipe.ts +120 -1
- package/src/app/sass/_variables.scss +9 -4
- package/src/app/utils/globals.ts +8 -3
- package/src/app/utils/utils.ts +71 -4
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -2
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +3 -3
- package/src/chat21-core/utils/utils.ts +4 -0
- package/src/iframe-style.css +33 -7
package/CHANGELOG.md
CHANGED
|
@@ -6,9 +6,59 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
|
|
10
|
+
# 5.1.4
|
|
11
|
+
|
|
12
|
+
# 5.1.3-rc1
|
|
13
|
+
- **changed** Check if the uploaded file extension directly matches one of those allowed in the control panel (e.g. .xls)
|
|
14
|
+
|
|
15
|
+
# 5.1.3
|
|
16
|
+
|
|
17
|
+
# 5.1.2-rc9
|
|
18
|
+
- **added** .xls and .xlsx to file Upload Accept
|
|
19
|
+
|
|
20
|
+
# 5.1.2-rc8
|
|
21
|
+
- **bug-fixed**: css margin icon
|
|
22
|
+
- **added**: added text verification to delete dangerous patterns
|
|
23
|
+
|
|
24
|
+
# 5.1.2-rc7
|
|
25
|
+
- **bug-fixed**: ctest button color (#ffffff)
|
|
26
|
+
|
|
27
|
+
# 5.1.2-rc6
|
|
28
|
+
- **bug-fixed**: cannot upload xlsx files
|
|
29
|
+
|
|
30
|
+
# 5.1.2-rc5
|
|
31
|
+
- **bug-fixed**: css buttons and bubble sender
|
|
32
|
+
|
|
33
|
+
# 5.1.2-rc4
|
|
34
|
+
- **changed**: css sender fullname
|
|
35
|
+
|
|
36
|
+
# 5.1.2-rc3
|
|
37
|
+
- **changed**: disabled badge on launcher-button
|
|
38
|
+
- **bug-fixed**: fullscreen widget position
|
|
39
|
+
- **bug-fixed**: handleIframeHeight disappears when the widget is closed and a new message arrives
|
|
40
|
+
- **changed**: changed avatar size
|
|
41
|
+
|
|
42
|
+
# 5.1.2-rc2
|
|
43
|
+
- **bug-fixed**: set css carousel
|
|
44
|
+
- **changed**: set css top-size
|
|
45
|
+
|
|
46
|
+
# 5.1.2-rc1
|
|
47
|
+
- **bug-fixed**: set left alignment, border-round as uipath, removed animation on over
|
|
48
|
+
- **changed**: Leave the same text area in the intermediate size
|
|
49
|
+
- **bug-fixed**: shadow that appears suddenly
|
|
50
|
+
- **bug-fixed**: missing animation from intermediate to large
|
|
51
|
+
- **changed**: reduce and update padding and resolution of text area icons
|
|
52
|
+
- **bug-fixed**: check button padding in the header
|
|
53
|
+
|
|
54
|
+
# 5.1.1-rc2
|
|
55
|
+
- **bug-fixed**: marked update @types/marked
|
|
56
|
+
|
|
9
57
|
# 5.1.1-rc1
|
|
10
58
|
- **bug-fixed**: marked pipe not renders urls
|
|
11
59
|
|
|
60
|
+
# 5.1.0
|
|
61
|
+
|
|
12
62
|
# 5.1.0-rc34
|
|
13
63
|
- **bug-fixed**: css fixed carousel
|
|
14
64
|
|
package/deploy_amazon_prod.sh
CHANGED
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
+
npm i
|
|
6
|
+
|
|
7
|
+
cp src/environments/real_data/environment.prod.ts src/environments/environment.prod.ts
|
|
8
|
+
|
|
5
9
|
# --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
|
|
6
10
|
ng build --configuration="prod" --aot=true
|
|
11
|
+
##--base-href='./v5/' --output-hashing none
|
|
12
|
+
|
|
13
|
+
### SET HASHING : START ###
|
|
14
|
+
cp ./src/launch_template.js ./dist/browser/launch.js
|
|
15
|
+
node ./src/build_launch.js
|
|
16
|
+
### SET HASHING : END ###
|
|
7
17
|
|
|
8
18
|
#### FIREBASE #####
|
|
9
19
|
# cd dist
|
|
@@ -13,15 +23,19 @@ ng build --configuration="prod" --aot=true
|
|
|
13
23
|
# cd ..
|
|
14
24
|
|
|
15
25
|
# #### MQTT #####
|
|
16
|
-
cd dist
|
|
26
|
+
cd dist/browser
|
|
17
27
|
# aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
18
|
-
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=
|
|
19
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
29
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
30
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
31
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
32
|
+
cd ../..
|
|
22
33
|
|
|
23
34
|
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
35
|
+
|
|
36
|
+
git restore src/environments/environment.pre.ts
|
|
37
|
+
|
|
24
38
|
echo new version deployed $version on s3://tiledesk-widget/v5
|
|
25
39
|
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v5/index.html
|
|
26
40
|
echo https://widget.tiledesk.com/v5/index.html
|
|
27
|
-
echo https://widget.tiledesk.com/v5/$version/index.html
|
|
41
|
+
echo https://widget.tiledesk.com/v5/$version/index.html
|
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.1.
|
|
4
|
+
"version": "5.1.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.tiledesk.com",
|
|
7
7
|
"repository": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"@ctrl/ngx-emoji-mart": "^9.2.0",
|
|
33
33
|
"@ngx-translate/core": "^16.0.4",
|
|
34
34
|
"@ngx-translate/http-loader": "^16.0.1",
|
|
35
|
-
"@types/marked": "^4.0.3",
|
|
36
35
|
"accept-language-parser": "^1.5.0",
|
|
37
36
|
"bootstrap": "^5.1.3",
|
|
38
37
|
"dayjs": "^1.11.7",
|
|
@@ -55,6 +54,7 @@
|
|
|
55
54
|
"@angular/language-service": "^18.2.13",
|
|
56
55
|
"@types/jasmine": "^3.6.11",
|
|
57
56
|
"@types/jasminewd2": "~2.0.3",
|
|
57
|
+
"@types/marked": "^6.0.0",
|
|
58
58
|
"@types/node": "^12.11.1",
|
|
59
59
|
"codelyzer": "^6.0.0",
|
|
60
60
|
"jasmine-core": "^3.8.0",
|
|
@@ -484,11 +484,11 @@ chat-root {
|
|
|
484
484
|
/* CSS BOX CONTAINER */
|
|
485
485
|
#chat21-conversations {
|
|
486
486
|
position: absolute;
|
|
487
|
-
left:
|
|
488
|
-
right:
|
|
489
|
-
top:
|
|
490
|
-
bottom:
|
|
491
|
-
border-radius: 16px;
|
|
487
|
+
left: 0px;
|
|
488
|
+
right: 0px;
|
|
489
|
+
top: 0px;
|
|
490
|
+
bottom: 0px;
|
|
491
|
+
// border-radius: 16px;
|
|
492
492
|
overflow: hidden;
|
|
493
493
|
background-color: transparent;
|
|
494
494
|
// border: 1px solid #cccccc; //NEW GAB
|
|
@@ -510,9 +510,10 @@ chat-root {
|
|
|
510
510
|
border-radius: 0px;
|
|
511
511
|
}
|
|
512
512
|
&.shadow{
|
|
513
|
-
transition: box-shadow 0.8s ease-in;
|
|
514
|
-
box-shadow: rgba(0, 0, 0, 0.16) 0px 8px 36px 0px; /*NEW GAB*/
|
|
513
|
+
// transition: box-shadow 0.8s ease-in;
|
|
514
|
+
// box-shadow: rgba(0, 0, 0, 0.16) 0px 8px 36px 0px; /*NEW GAB*/
|
|
515
515
|
}
|
|
516
|
+
|
|
516
517
|
}
|
|
517
518
|
|
|
518
519
|
|
|
@@ -620,8 +621,9 @@ chat-root {
|
|
|
620
621
|
position: absolute;
|
|
621
622
|
top: 0;
|
|
622
623
|
left: 0;
|
|
623
|
-
width: 100
|
|
624
|
+
width: calc(100% - 18px);
|
|
624
625
|
height: 100%;
|
|
626
|
+
padding: 0 9px;
|
|
625
627
|
|
|
626
628
|
.c21-header-button{
|
|
627
629
|
display: block;
|
|
@@ -690,7 +692,6 @@ chat-root {
|
|
|
690
692
|
padding: 0px;
|
|
691
693
|
margin: 0px auto;
|
|
692
694
|
overflow: auto;
|
|
693
|
-
|
|
694
695
|
.c21-body-container {
|
|
695
696
|
position: absolute;
|
|
696
697
|
top: 0;
|
package/src/app/app.component.ts
CHANGED
|
@@ -134,6 +134,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
134
134
|
public uploadService: UploadService
|
|
135
135
|
){}
|
|
136
136
|
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
137
140
|
ngOnInit(): void {
|
|
138
141
|
this.logger.info('[APP-CONF]---------------- ngOnInit: APP.COMPONENT ---------------- ')
|
|
139
142
|
this.initWidgetParamiters();
|
|
@@ -168,9 +171,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
168
171
|
}
|
|
169
172
|
} else {
|
|
170
173
|
//widget closed
|
|
171
|
-
|
|
172
|
-
let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
|
|
174
|
+
let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
|
|
173
175
|
that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
|
|
176
|
+
// that.setBadgeNewConverstionNumber();
|
|
174
177
|
}
|
|
175
178
|
// that.manageTabNotification()
|
|
176
179
|
// });
|
|
@@ -213,14 +216,13 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
213
216
|
that.g.isOpenNewMessage = true;
|
|
214
217
|
that.logger.debug('[APP-COMP] lastconversationnn', that.lastConversation)
|
|
215
218
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
219
|
let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
|
|
219
220
|
that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
|
|
221
|
+
// that.setBadgeNewConverstionNumber();
|
|
220
222
|
// }
|
|
221
223
|
}
|
|
222
|
-
|
|
223
224
|
that.triggerOnConversationUpdated(conversation);
|
|
225
|
+
|
|
224
226
|
} else {
|
|
225
227
|
this.logger.debug('[APP-COMP] oBSconversationChanged null: errorrr')
|
|
226
228
|
return;
|
|
@@ -260,6 +262,22 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
260
262
|
this.uploadService.initialize();
|
|
261
263
|
}
|
|
262
264
|
|
|
265
|
+
|
|
266
|
+
saveBadgeNewConverstionNumber(){
|
|
267
|
+
let badgeNewConverstionNumber = this.conversationsHandlerService.countIsNew()
|
|
268
|
+
this.appStorageService.setItem('hiddenConversationsBadge', badgeNewConverstionNumber)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
setBadgeNewConverstionNumber(){
|
|
272
|
+
let badgeNewConverstionNumber = this.conversationsHandlerService.countIsNew();
|
|
273
|
+
let hiddenConversationsBadge = this.appStorageService.getItem('hiddenConversationsBadge')
|
|
274
|
+
let newNumberBadge = badgeNewConverstionNumber - hiddenConversationsBadge;
|
|
275
|
+
this.logger.debug('[APP-COMP] setBadgeNewConverstionNumber: ', newNumberBadge, badgeNewConverstionNumber, hiddenConversationsBadge)
|
|
276
|
+
this.g.conversationsBadge = newNumberBadge;
|
|
277
|
+
this.g.setParameter('conversationsBadge', newNumberBadge);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
|
|
263
281
|
private initWidgetParamiters(){
|
|
264
282
|
const that = this;
|
|
265
283
|
const obsSettingsService = this.globalSettingsService.obsSettingsService.subscribe((resp) => {
|
|
@@ -1578,6 +1596,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1578
1596
|
this.logger.debug('[APP-COMP] widgetclosed:::', this.g.conversationsBadge, this.conversationsHandlerService.countIsNew())
|
|
1579
1597
|
// this.g.isOpen = false;
|
|
1580
1598
|
// this.g.setIsOpen(false);
|
|
1599
|
+
// this.setBadgeNewConverstionNumber();
|
|
1581
1600
|
this.f21_close();
|
|
1582
1601
|
}
|
|
1583
1602
|
|
|
@@ -1629,12 +1648,15 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1629
1648
|
// }
|
|
1630
1649
|
// this.g.startFromHome = true;
|
|
1631
1650
|
this.triggerOnOpenEvent();
|
|
1651
|
+
|
|
1632
1652
|
} else {
|
|
1633
1653
|
this.triggerOnCloseEvent();
|
|
1634
1654
|
}
|
|
1635
1655
|
//change status to the widget
|
|
1636
1656
|
this.g.setIsOpen(!this.g.isOpen);
|
|
1637
1657
|
this.appStorageService.setItem('isOpen', this.g.isOpen);
|
|
1658
|
+
|
|
1659
|
+
// this.saveBadgeNewConverstionNumber();
|
|
1638
1660
|
}
|
|
1639
1661
|
|
|
1640
1662
|
/**
|
|
@@ -2013,8 +2035,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2013
2035
|
|
|
2014
2036
|
onWidgetSizeChange(mode: 'min' | 'max' | 'top') {
|
|
2015
2037
|
var tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv');
|
|
2016
|
-
this.g.size = mode
|
|
2017
|
-
|
|
2038
|
+
this.g.size = mode;
|
|
2039
|
+
let parent = tiledeskDiv.parentElement as HTMLElement | null;
|
|
2040
|
+
|
|
2018
2041
|
if(mode==='max'){
|
|
2019
2042
|
tiledeskDiv.classList.add('max-size')
|
|
2020
2043
|
tiledeskDiv.classList.remove('min-size')
|
|
@@ -2158,16 +2181,21 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2158
2181
|
this.styleMapConversation.set('buttonTextColor', this.g.buttonTextColor)
|
|
2159
2182
|
this.styleMapConversation.set('buttonHoverBackgroundColor',this.g.buttonHoverBackgroundColor)
|
|
2160
2183
|
this.styleMapConversation.set('buttonHoverTextColor', this.g.buttonHoverTextColor)
|
|
2161
|
-
|
|
2162
2184
|
this.styleMapConversation.set('iconColor', '#5f6368')
|
|
2163
2185
|
|
|
2164
2186
|
this.el.nativeElement.style.setProperty('--button-in-msg-background-color', this.g.bubbleSentBackground)
|
|
2165
2187
|
this.el.nativeElement.style.setProperty('--button-in-msg-font-size', this.g.buttonFontSize)
|
|
2188
|
+
this.el.nativeElement.style.setProperty('--button-in-msg-font-family', this.g.fontFamily)
|
|
2189
|
+
this.el.nativeElement.style.setProperty('--chat-header-height', this.g.hideHeaderConversation? '0px': null)
|
|
2166
2190
|
this.el.nativeElement.style.setProperty('--font-size-bubble-message', this.g.fontSize)
|
|
2167
2191
|
this.el.nativeElement.style.setProperty('--font-family-bubble-message', this.g.fontFamily)
|
|
2168
|
-
this.el.nativeElement.style.setProperty('--button-in-msg-font-family', this.g.fontFamily)
|
|
2169
2192
|
|
|
2170
|
-
|
|
2193
|
+
|
|
2194
|
+
this.styleMapConversation.set('buttonBackgroundColor', this.g.bubbleReceivedBackground)
|
|
2195
|
+
this.styleMapConversation.set('buttonTextColor', this.g.bubbleReceivedTextColor)
|
|
2196
|
+
this.styleMapConversation.set('buttonHoverBackgroundColor',this.g.bubbleSentBackground)
|
|
2197
|
+
this.styleMapConversation.set('buttonHoverTextColor', this.g.bubbleSentTextColor)
|
|
2198
|
+
|
|
2171
2199
|
}
|
|
2172
2200
|
|
|
2173
2201
|
|
|
@@ -89,9 +89,7 @@
|
|
|
89
89
|
left: 0px;
|
|
90
90
|
right: 0px;
|
|
91
91
|
margin: 0px;
|
|
92
|
-
|
|
93
|
-
// padding: 0;
|
|
94
|
-
|
|
92
|
+
padding: 12px;
|
|
95
93
|
// box-shadow: 0 -1px 0px 0px $trasp-light-gray;
|
|
96
94
|
background: white;
|
|
97
95
|
min-height: 40px;
|
|
@@ -185,11 +183,7 @@ dialog:-internal-dialog-in-top-layer{
|
|
|
185
183
|
|
|
186
184
|
@media(min-width:688px){
|
|
187
185
|
|
|
188
|
-
|
|
189
|
-
left: 20%;
|
|
190
|
-
right: 20%;
|
|
191
|
-
margin: 12px 0px 30px;
|
|
192
|
-
}
|
|
186
|
+
|
|
193
187
|
|
|
194
188
|
:host-context(#chat21-conversations.full-screen-mode){
|
|
195
189
|
--button-in-msg-padding: 10px 16px;
|
|
@@ -214,6 +208,21 @@ dialog:-internal-dialog-in-top-layer{
|
|
|
214
208
|
|
|
215
209
|
}
|
|
216
210
|
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
::ng-deep .chat21-sheet-content{
|
|
215
|
+
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height) + 34px)!important;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@media(min-width:689px){
|
|
221
|
+
#chat21-footer{
|
|
222
|
+
left: 20%;
|
|
223
|
+
right: 20%;
|
|
224
|
+
margin: 12px 0px 30px;
|
|
225
|
+
}
|
|
217
226
|
chat-conversation-footer ::ng-deep {
|
|
218
227
|
.textarea-container {
|
|
219
228
|
padding: 8px 24px;
|
|
@@ -229,9 +238,7 @@ dialog:-internal-dialog-in-top-layer{
|
|
|
229
238
|
border-radius: 2rem;
|
|
230
239
|
background-color: #ffffff;
|
|
231
240
|
box-shadow: 0px 4px 4px 0px var(--tw-shadow-color, var(--shadow-color-1, #0000000a)), 0px 0px 1px 0px var(--tw-shadow-color, var(--shadow-color-2, #0000009e));
|
|
232
|
-
transition: border-color 0.2s
|
|
233
|
-
ease, box-shadow 0.2s
|
|
234
|
-
ease;
|
|
241
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
235
242
|
|
|
236
243
|
.visible-text-area {
|
|
237
244
|
background-color: #ffffff;
|
|
@@ -242,11 +249,4 @@ dialog:-internal-dialog-in-top-layer{
|
|
|
242
249
|
bottom: calc(100% + 6px);
|
|
243
250
|
}
|
|
244
251
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
::ng-deep .chat21-sheet-content{
|
|
249
|
-
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height) + 34px)!important;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
252
|
}
|
|
@@ -1414,7 +1414,9 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
1414
1414
|
this.logger.log('[CONV-COMP] ----> FILE - (dragleave) drag ev ', event)
|
|
1415
1415
|
if (event.dataTransfer && event.dataTransfer.files) {
|
|
1416
1416
|
const files = event.dataTransfer.files;
|
|
1417
|
-
const
|
|
1417
|
+
const nameFile = files[0].name;
|
|
1418
|
+
const typeFile = files[0].type;
|
|
1419
|
+
const canUploadFile = checkAcceptedFile(nameFile, typeFile, this.g.fileUploadAccept)
|
|
1418
1420
|
if(!canUploadFile){
|
|
1419
1421
|
this.logger.error('[IMAGE-UPLOAD] detectFiles: can not upload current file type--> NOT ALLOWED', this.g.fileUploadAccept)
|
|
1420
1422
|
return;
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss
CHANGED
|
@@ -43,13 +43,19 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.chat21-textarea-button {
|
|
46
|
-
// fill: var(--icon-fill-color);
|
|
47
46
|
color: var(--icon-fill-color);
|
|
48
47
|
pointer-events: auto;
|
|
49
|
-
// height: var(--chat-footer-height);
|
|
50
48
|
bottom: 22px;
|
|
51
49
|
opacity: 0.3;
|
|
52
50
|
cursor: initial;
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
// background-color: aquamarine;
|
|
56
|
+
width: 25px;
|
|
57
|
+
height: 25px;
|
|
58
|
+
|
|
53
59
|
&.active {
|
|
54
60
|
opacity: 1;
|
|
55
61
|
cursor: pointer;
|
|
@@ -58,7 +64,10 @@
|
|
|
58
64
|
opacity: 0.3 !important;
|
|
59
65
|
pointer-events: none !important;
|
|
60
66
|
cursor: not-allowed !important;
|
|
61
|
-
|
|
67
|
+
}
|
|
68
|
+
span svg {
|
|
69
|
+
width: 20px;
|
|
70
|
+
height: 20px;
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts
CHANGED
|
@@ -138,19 +138,19 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
138
138
|
|
|
139
139
|
const that = this;
|
|
140
140
|
if (event.target.files && event.target.files[0]) {
|
|
141
|
+
const nameFile = event.target.files[0].name;
|
|
142
|
+
const typeFile = event.target.files[0].type;
|
|
143
|
+
const size = event.target.files[0].size;
|
|
141
144
|
|
|
142
|
-
const canUploadFile = checkAcceptedFile(
|
|
145
|
+
const canUploadFile = checkAcceptedFile(nameFile, typeFile, this.fileUploadAccept)
|
|
143
146
|
if(!canUploadFile){
|
|
144
147
|
this.logger.error('[IMAGE-UPLOAD] detectFiles: can not upload current file type--> NOT ALLOWED', this.fileUploadAccept)
|
|
145
148
|
this.isFilePendingToUpload = false;
|
|
146
149
|
return;
|
|
147
150
|
}
|
|
148
|
-
|
|
149
|
-
const nameFile = event.target.files[0].name;
|
|
150
|
-
const typeFile = event.target.files[0].type;
|
|
151
|
-
const size = event.target.files[0].size
|
|
151
|
+
|
|
152
152
|
const reader = new FileReader();
|
|
153
|
-
that.logger.debug('[CONV-FOOTER] OK preload: ', nameFile, typeFile, reader);
|
|
153
|
+
// that.logger.debug('[CONV-FOOTER] OK preload: ', nameFile, typeFile, reader);
|
|
154
154
|
reader.addEventListener('load', function () {
|
|
155
155
|
that.logger.debug('[CONV-FOOTER] addEventListener load', reader.result);
|
|
156
156
|
that.isFileSelected = true;
|
|
@@ -90,23 +90,48 @@ export class EyeeyeCatcherCardComponent implements OnInit {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// checkIsEmoji() {
|
|
94
|
+
// let title = this.g.CALLOUT_TITLE_PLACEHOLDER.trim();
|
|
95
|
+
// if (this.g.calloutTitle && this.g.calloutTitle !== '') {
|
|
96
|
+
// title = this.g.calloutTitle.trim();
|
|
97
|
+
// }
|
|
98
|
+
// this.title = title;
|
|
99
|
+
// const regex = emojiRegex();
|
|
100
|
+
// let match: any;
|
|
101
|
+
// // this.logger.debug('[EYEEYE-CATCHER-CARD]-->regex, emojiRegex', regex, emojiRegex)
|
|
102
|
+
// while (match = regex.exec(title)) {
|
|
103
|
+
// const emoji = match[0];
|
|
104
|
+
// this.logger.debug('[EYEEYE-CATCHER-CARD]--> match', match)
|
|
105
|
+
// if (title.indexOf(emoji) === 0) {
|
|
106
|
+
// this.title = title.replace(emoji, '');
|
|
107
|
+
// this.emoticon = emoji;
|
|
108
|
+
// }
|
|
109
|
+
// break;
|
|
110
|
+
// }
|
|
111
|
+
// }
|
|
112
|
+
|
|
113
|
+
|
|
93
114
|
checkIsEmoji() {
|
|
94
115
|
let title = this.g.CALLOUT_TITLE_PLACEHOLDER.trim();
|
|
95
116
|
if (this.g.calloutTitle && this.g.calloutTitle !== '') {
|
|
96
117
|
title = this.g.calloutTitle.trim();
|
|
97
118
|
}
|
|
119
|
+
|
|
120
|
+
// Reset emoticon
|
|
121
|
+
this.emoticon = null;
|
|
98
122
|
this.title = title;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
|
|
124
|
+
// Regex per emoji Unicode (compatibile)
|
|
125
|
+
const regex = /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/;
|
|
126
|
+
const match = title.match(regex);
|
|
127
|
+
|
|
128
|
+
if (match) {
|
|
103
129
|
const emoji = match[0];
|
|
104
|
-
this.logger.debug('[EYEEYE-CATCHER-CARD]-->
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
break;
|
|
130
|
+
this.logger.debug('[EYEEYE-CATCHER-CARD]--> emoji trovata:', emoji);
|
|
131
|
+
|
|
132
|
+
// Estrai la prima emoji trovata e rimuovila dal testo
|
|
133
|
+
this.title = title.replace(emoji, '').trim();
|
|
134
|
+
this.emoticon = emoji;
|
|
110
135
|
}
|
|
111
136
|
}
|
|
112
137
|
|
|
@@ -164,6 +189,3 @@ export class EyeeyeCatcherCardComponent implements OnInit {
|
|
|
164
189
|
}
|
|
165
190
|
|
|
166
191
|
|
|
167
|
-
export default function emojiRegex(): RegExp {
|
|
168
|
-
return /(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u2700-\u27BF])|(?:\u24C2)|(?:[\u1F680-\u1F6FF])/g;
|
|
169
|
-
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
position: absolute;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
|
|
5
|
+
background-color: #ffffff;
|
|
6
6
|
/********* Animations **********/
|
|
7
7
|
&.start-animation .fade-in-top {
|
|
8
8
|
-webkit-animation: fade-in-top 0.5s cubic-bezier(0.390, 0.575, 0.565, 1.000) 0.3s both;
|
|
@@ -242,8 +242,10 @@
|
|
|
242
242
|
line-height: 1.4;
|
|
243
243
|
color: var(--black);
|
|
244
244
|
overflow: hidden;
|
|
245
|
-
-webkit-box-shadow: 0 4px 15px 0 var(--trasp-light-black), 0 1px 2px 0 var(--trasp-light-black);
|
|
246
|
-
box-shadow: 0 4px 15px 0 var(--trasp-light-black), 0 1px 2px 0 var(--trasp-light-black);
|
|
245
|
+
// -webkit-box-shadow: 0 4px 15px 0 var(--trasp-light-black), 0 1px 2px 0 var(--trasp-light-black);
|
|
246
|
+
// box-shadow: 0 4px 15px 0 var(--trasp-light-black), 0 1px 2px 0 var(--trasp-light-black);
|
|
247
|
+
|
|
248
|
+
box-shadow:rgba(0, 0, 0, 0.16) 0px 8px 36px 0px;
|
|
247
249
|
z-index: 20;
|
|
248
250
|
text-align: left;
|
|
249
251
|
|
|
@@ -142,16 +142,65 @@ export class LastMessageComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
execute(commands[0])
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
145
150
|
|
|
151
|
+
private manageIframeHeight(retryCount = 0) {
|
|
152
|
+
const maxRetries = 5;
|
|
153
|
+
requestAnimationFrame(() => {
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
const element = this.messageListWRP.last?.nativeElement;
|
|
156
|
+
if (!element) {
|
|
157
|
+
this.retryIfNeeded(retryCount, maxRetries);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const height = this.getElementHeight(element);
|
|
161
|
+
if (height === 0 && retryCount < maxRetries) {
|
|
162
|
+
this.retryIfNeeded(retryCount, maxRetries);
|
|
163
|
+
} else {
|
|
164
|
+
this.g.setWidgetPreviewContainerSize(0, height);
|
|
165
|
+
}
|
|
166
|
+
}, 100);
|
|
167
|
+
});
|
|
146
168
|
}
|
|
147
169
|
|
|
148
|
-
private
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
private getElementHeight(element: HTMLElement): number {
|
|
171
|
+
// Forza il calcolo dell'altezza
|
|
172
|
+
const originalHeight = element.style.height;
|
|
173
|
+
element.style.height = 'auto';
|
|
174
|
+
let height = element.getBoundingClientRect().height;
|
|
175
|
+
// Prova diverse proprietà di altezza
|
|
176
|
+
if (height === 0) height = element.offsetHeight;
|
|
177
|
+
if (height === 0) height = element.scrollHeight;
|
|
178
|
+
if (height === 0) height = element.clientHeight;
|
|
179
|
+
// Se ancora 0, calcola l'altezza dai figli
|
|
180
|
+
if (height === 0) {
|
|
181
|
+
height = this.calculateHeightFromChildren(element);
|
|
182
|
+
}
|
|
183
|
+
// Ripristina l'altezza originale
|
|
184
|
+
element.style.height = originalHeight;
|
|
185
|
+
return height;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private calculateHeightFromChildren(element: HTMLElement): number {
|
|
189
|
+
let totalHeight = 0;
|
|
190
|
+
for (let i = 0; i < element.children.length; i++) {
|
|
191
|
+
totalHeight += element.children[i].getBoundingClientRect().height;
|
|
192
|
+
}
|
|
193
|
+
return totalHeight;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private retryIfNeeded(retryCount: number, maxRetries: number) {
|
|
197
|
+
if (retryCount < maxRetries) {
|
|
198
|
+
setTimeout(() => {
|
|
199
|
+
this.manageIframeHeight(retryCount + 1);
|
|
200
|
+
}, 100 * (retryCount + 1));
|
|
201
|
+
} else {
|
|
202
|
+
console.warn('Element not found after maximum retries');
|
|
203
|
+
}
|
|
155
204
|
}
|
|
156
205
|
|
|
157
206
|
isSameSender(senderId: string, index: number){
|
|
@@ -191,10 +240,13 @@ export class LastMessageComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
191
240
|
|
|
192
241
|
onElementRenderedFN(event){
|
|
193
242
|
this.messageListWRP.forEach((item, index)=> {
|
|
243
|
+
console.log('messageListWRP ---------------------> ', item);
|
|
194
244
|
setTimeout(() => {
|
|
195
245
|
if(this.messageListWRP.get(index)){
|
|
196
|
-
let height = getComputedStyle(this.messageListWRP.get(index).nativeElement).height
|
|
197
|
-
this.g.setWidgetPreviewContainerSize(0, +height.substring(0, height.length-2))
|
|
246
|
+
// let height = getComputedStyle(this.messageListWRP.get(index).nativeElement).height
|
|
247
|
+
// this.g.setWidgetPreviewContainerSize(0, +height.substring(0, height.length-2))
|
|
248
|
+
let height = this.messageListWRP.get(this.messages.length-1).nativeElement.offsetHeight
|
|
249
|
+
this.g.setWidgetPreviewContainerSize(0, height)
|
|
198
250
|
}
|
|
199
251
|
}, 50);
|
|
200
252
|
})
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
aria-label=" apri chat"
|
|
10
10
|
>
|
|
11
11
|
|
|
12
|
-
<div *ngIf="g.conversationsBadge>0
|
|
12
|
+
<!-- <div *ngIf="g.conversationsBadge>0" class="c21-divBudge">{{g.conversationsBadge}}</div> -->
|
|
13
13
|
|
|
14
14
|
<!-- OPEN ICON -->
|
|
15
15
|
<div *ngIf="!g.isOpen" class="launcher-button rotate-center" [@enterBubbleAnimation]>
|