@chat21/chat21-web-widget 5.0.56 → 5.0.57-rc.2
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 +12 -0
- package/README.md +0 -3
- package/package.json +1 -1
- package/src/app/component/conversation-detail/conversation/conversation.component.html +4 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +57 -4
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +86 -93
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +76 -60
- package/src/app/component/last-message/last-message.component.html +2 -1
- package/src/app/component/last-message/last-message.component.ts +16 -0
- package/src/app/component/message/bubble-message/bubble-message.component.ts +2 -0
- package/src/app/component/message/image/image.component.html +2 -1
- package/src/app/providers/global-settings.service.ts +18 -1
- package/src/app/sass/_variables.scss +1 -0
- package/src/app/utils/globals.ts +2 -0
- package/src/chat21-core/providers/abstract/typing.service.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +4 -4
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +25 -11
- package/src/chat21-core/utils/utils-message.ts +2 -2
- package/src/widget-config-template.json +0 -1
- package/src/widget-config.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# chat21-web-widget ver 5.0
|
|
2
2
|
|
|
3
|
+
### 5.0.57-rc.2
|
|
4
|
+
- changed: tiledesk logo during conversation
|
|
5
|
+
- removed: image loader wrapper
|
|
6
|
+
- bug-fixed: callout not render right height if heavy image is received
|
|
7
|
+
|
|
8
|
+
### 5.0.57-rc.1
|
|
9
|
+
- added: fileUploadAccept as a tiledesk property
|
|
10
|
+
- added: tiledesk logo during conversation
|
|
11
|
+
- added: presence manger on mqtt service
|
|
12
|
+
- changed: new conversation-footer UI
|
|
13
|
+
- removed: fileUploadAccept from envs and template
|
|
14
|
+
|
|
3
15
|
### 5.0.56 in PROD
|
|
4
16
|
|
|
5
17
|
### 5.0.56-rc.6
|
package/README.md
CHANGED
|
@@ -72,7 +72,6 @@ export const environment = {
|
|
|
72
72
|
remoteTranslationsUrl: 'https://<YOUR_REMOTE_TRANSLATIONS_URL>/',
|
|
73
73
|
chatEngine: "mqtt", // OR YOUR CUSTOM CHAT ENGINE
|
|
74
74
|
updloaEngine: "native", // OR YOUR CUSTOM UPLOAD ENGINE
|
|
75
|
-
fileUploadAccept:"*/*",
|
|
76
75
|
logLevel: '<YOUR-PREFERRED-LOG-LEVEL-NUMBER>',
|
|
77
76
|
firebaseConfig: {
|
|
78
77
|
apiKey: '123ABC..',
|
|
@@ -103,8 +102,6 @@ export const environment = {
|
|
|
103
102
|
* `logLevel`: The Tiledesk web-widget supports 4 log levels. The order is as follows:
|
|
104
103
|
`Error < Warn < Info < Debug`
|
|
105
104
|
|
|
106
|
-
* `fileUploadAccept`: The Tiledesk web-widget allows you to manage the type of files that can be uploaded. By default, all file types are accepted.
|
|
107
|
-
|
|
108
105
|
### RUN in dev
|
|
109
106
|
|
|
110
107
|
Run the app with `ng serve`
|
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<!-- CONTENT -->
|
|
47
47
|
<chat-conversation-content
|
|
48
|
+
[class.hideTextReply]="!hideFooterTextReply"
|
|
48
49
|
[messages]="messages"
|
|
49
50
|
[senderId]="senderId"
|
|
50
51
|
[baseLocation]="g?.windowContext['tiledesk']?.getBaseLocation()"
|
|
@@ -92,7 +93,8 @@
|
|
|
92
93
|
</chat-conversation-attachment-preview>
|
|
93
94
|
|
|
94
95
|
<!-- FOOTER -->
|
|
95
|
-
|
|
96
|
+
<!-- [class.maximize-width]="(g?.singleConversation && hideTextAreaContent) || (isConversationArchived && !g?.allowReopen)" -->
|
|
97
|
+
<div id="chat21-footer">
|
|
96
98
|
<div *ngIf="showBadgeScroollToBottom" id="chat21-buttonToBottom" (click)="scrollToBottom()">
|
|
97
99
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path opacity=".87" fill="none" d="M24 24H0V0h24v24z"/><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"/></svg>
|
|
98
100
|
<div *ngIf="messagesBadgeCount!=0" id="chat21-divBudge" class="c21-divBudge">{{messagesBadgeCount}}</div>
|
|
@@ -115,7 +117,7 @@
|
|
|
115
117
|
[isMobile]="g?.isMobile"
|
|
116
118
|
[isEmojiiPickerShow]="isEmojiiPickerShow"
|
|
117
119
|
[footerMessagePlaceholder]="footerMessagePlaceholder"
|
|
118
|
-
[fileUploadAccept]="
|
|
120
|
+
[fileUploadAccept]="g?.fileUploadAccept"
|
|
119
121
|
[dropEvent]="dropEvent"
|
|
120
122
|
[poweredBy]="g?.poweredBy"
|
|
121
123
|
[stylesMap]="stylesMap"
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
--foregroundColor: var(--col-msg-sent);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
:host chat-conversation-content.hideTextReply ::ng-deep .chat21-sheet-content{
|
|
13
|
+
|
|
14
|
+
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height)) !important
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
// ============= CSS #chat21-conversation-component ================= //
|
|
13
18
|
#chat21-conversation-component {
|
|
14
19
|
// background-color: #ffffff;
|
|
@@ -29,6 +34,56 @@
|
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
/* ================== CSS chat21-footer ==================== */
|
|
37
|
+
|
|
38
|
+
#hiddenFooter{
|
|
39
|
+
.c21-powered-by {
|
|
40
|
+
height: 40px;
|
|
41
|
+
text-align: center;
|
|
42
|
+
padding: 0;
|
|
43
|
+
// margin: 5px 0;
|
|
44
|
+
// position: absolute;
|
|
45
|
+
color: var(--gray);
|
|
46
|
+
// top: 0;
|
|
47
|
+
// left: 20px; //60px;
|
|
48
|
+
// right: 60px;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
|
|
53
|
+
&::ng-deep a {
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
display: inline-block;
|
|
57
|
+
color: var(--gray);
|
|
58
|
+
font-size: 1.1em;
|
|
59
|
+
font-weight: 500;
|
|
60
|
+
line-height: 22px;
|
|
61
|
+
|
|
62
|
+
font-family: Mulish, sans-serif;
|
|
63
|
+
letter-spacing: -0.24px;
|
|
64
|
+
-webkit-font-smoothing: antialiased;
|
|
65
|
+
|
|
66
|
+
span {
|
|
67
|
+
display: inline-block;
|
|
68
|
+
position: relative;
|
|
69
|
+
top: 2px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
img {
|
|
73
|
+
width: 80px; //60px;
|
|
74
|
+
height: auto;
|
|
75
|
+
max-height: 40px;
|
|
76
|
+
position: relative;
|
|
77
|
+
vertical-align: middle;
|
|
78
|
+
object-fit: contain;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
b{
|
|
82
|
+
font-weight: bolder;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
32
87
|
#chat21-footer {
|
|
33
88
|
position: fixed;
|
|
34
89
|
bottom: 0px;
|
|
@@ -36,9 +91,7 @@
|
|
|
36
91
|
right: 0px;
|
|
37
92
|
margin: 0px;
|
|
38
93
|
// padding: 0;
|
|
39
|
-
|
|
40
|
-
padding-left: 70px;
|
|
41
|
-
padding-right: 45px;
|
|
94
|
+
|
|
42
95
|
// box-shadow: 0 -1px 0px 0px $trasp-light-gray;
|
|
43
96
|
background: white;
|
|
44
97
|
min-height: 40px;
|
|
@@ -55,7 +108,7 @@
|
|
|
55
108
|
#chat21-buttonToBottom {
|
|
56
109
|
display: flex;
|
|
57
110
|
position: relative;
|
|
58
|
-
margin-right:
|
|
111
|
+
margin-right: 10px; //-25px;
|
|
59
112
|
margin-top: -40px;
|
|
60
113
|
float: right;
|
|
61
114
|
width: 30px;
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<svg [ngStyle]="{'fill': 'yellow' }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
|
|
5
|
-
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}"/>
|
|
6
|
-
</svg>
|
|
7
|
-
</span>
|
|
8
|
-
<span class="v-align-center c21-label-button">
|
|
9
|
-
{{translationMap?.get('LABEL_START_NW_CONV')}}
|
|
10
|
-
</span>
|
|
11
|
-
<div class="clear"></div>
|
|
12
|
-
</button>
|
|
13
|
-
<button *ngIf="showContinueConversationButton" tabindex="1040" class="c21-button-primary" (click)="onContinueConversation()" [ngStyle]="{'background-color': stylesMap.get('themeColor'), 'border-color': stylesMap.get('themeColor'), 'color': stylesMap?.get('foregroundColor')}">
|
|
14
|
-
<span class="v-align-center c21-label-button">
|
|
15
|
-
{{translationMap?.get('CONTINUE')}}
|
|
16
|
-
</span>
|
|
17
|
-
<div class="clear"></div>
|
|
18
|
-
</button>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div id="hiddenFooter" *ngIf="hideTextReply && !hideTextAreaContent" class="fade-in-bottom">
|
|
1
|
+
<!-- LOGO-->
|
|
2
|
+
<div id="hiddenFooter" *ngIf="!hideTextAreaContent" class="fade-in-bottom"
|
|
3
|
+
[class.hideTextReply]="hideTextReply">
|
|
22
4
|
<div tabindex="-1" class="c21-powered-by" [innerHTML]="poweredBy"></div>
|
|
23
5
|
</div>
|
|
24
6
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
7
|
+
<!-- TEXTAREA + ICONS: conv active-->
|
|
8
|
+
<div class="textarea-container" *ngIf="!hideTextAreaContent && !hideTextReply">
|
|
9
|
+
|
|
10
|
+
<div class="icons-container">
|
|
11
|
+
<!-- ICON ATTACHMENT -->
|
|
12
|
+
<label *ngIf="showAttachmentButton == true" tabindex="1502" aria-label="allegati" for="chat21-file" class="chat21-textarea-button" [class.active]="!isFilePendingToUpload && !hideTextReply" id="chat21-start-upload-doc">
|
|
13
|
+
<span class="v-align-center">
|
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 28 28" transform="rotate(45)">
|
|
15
|
+
<path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" />
|
|
16
|
+
</svg>
|
|
17
|
+
</span>
|
|
18
|
+
<input
|
|
19
|
+
[attr.disabled] = "(isFilePendingToUpload || isConversationArchived || hideTextReply)? true : null"
|
|
20
|
+
tabindex="1503"
|
|
21
|
+
type="file"
|
|
22
|
+
aria-label="seleziona allegato"
|
|
23
|
+
[accept]="fileUploadAccept"
|
|
24
|
+
name="chat21-file"
|
|
25
|
+
id="chat21-file"
|
|
26
|
+
#chat21_file
|
|
27
|
+
class="inputfile"
|
|
28
|
+
[ngStyle]="{'display': 'block', height:'1px', width:'1px', overflow: 'hidden' }"
|
|
29
|
+
(change)="detectFiles($event)"/>
|
|
30
|
+
</label>
|
|
31
|
+
<!-- ICON EMOJII -->
|
|
32
|
+
<label tabindex="1504" aria-label="emojii" for="chat21-emojii" class="chat21-textarea-button" [class.active]="!isFilePendingToUpload && !hideTextReply" id="chat21-emoticon-picker" (click)="onEmojiiPickerClicked()">
|
|
33
|
+
<span class="v-align-center">
|
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 28 28" >
|
|
35
|
+
<path d="M0 0h24v24H0V0z" fill="none"/>
|
|
36
|
+
<circle cx="15.5" cy="9.5" r="1.5"/>
|
|
37
|
+
<circle cx="8.5" cy="9.5" r="1.5"/>
|
|
38
|
+
<path d="M12 16c-1.48 0-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5s4.32-1.45 5.12-3.5h-1.67c-.7 1.19-1.97 2-3.45 2zm-.01-14C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>
|
|
39
|
+
</svg>
|
|
40
|
+
</span>
|
|
41
|
+
</label>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<div class="visible-text-area" [class.disabled] = "( isConversationArchived || hideTextReply)? true : null">
|
|
48
|
+
<!-- isFilePendingToUpload || -->
|
|
49
|
+
<textarea
|
|
50
|
+
[attr.disabled] = "(hideTextReply)? true : null"
|
|
51
|
+
[attr.placeholder] ="(footerMessagePlaceholder)? footerMessagePlaceholder : translationMap?.get('LABEL_PLACEHOLDER')"
|
|
52
|
+
start-focus-chat21-conversation-component
|
|
53
|
+
inputTextArea
|
|
54
|
+
#textbox
|
|
55
|
+
tabindex="1501"
|
|
56
|
+
aria-labelledby="altTextArea"
|
|
57
|
+
rows="1"
|
|
58
|
+
id="chat21-main-message-context"
|
|
59
|
+
class='f21textarea c21-button-clean'
|
|
60
|
+
[(ngModel)]="textInputTextArea"
|
|
61
|
+
(ngModelChange)="onTextAreaChange()"
|
|
62
|
+
(keypress)="onkeypress($event)"
|
|
63
|
+
(keydown)="onkeydown($event)"
|
|
64
|
+
(paste)="onPaste($event)">
|
|
65
|
+
</textarea>
|
|
66
|
+
|
|
67
|
+
</div>
|
|
44
68
|
|
|
45
|
-
</div>
|
|
46
|
-
<!-- -->
|
|
47
|
-
<div #div_attached *ngIf="!hideTextAreaContent && !hideTextReply">
|
|
48
|
-
<!-- ICON ATTACHMENT -->
|
|
49
|
-
<label *ngIf="showAttachmentButton == true" tabindex="1502" aria-label="allegati" for="chat21-file" class="chat21-textarea-button" [class.active]="!isFilePendingToUpload && !hideTextReply" id="chat21-start-upload-doc">
|
|
50
|
-
<span class="v-align-center">
|
|
51
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 28 28" transform="rotate(45)">
|
|
52
|
-
<path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" />
|
|
53
|
-
</svg>
|
|
54
|
-
</span>
|
|
55
|
-
<input
|
|
56
|
-
[attr.disabled] = "(isFilePendingToUpload || isConversationArchived || hideTextReply)? true : null"
|
|
57
|
-
tabindex="1503"
|
|
58
|
-
type="file"
|
|
59
|
-
aria-label="seleziona allegato"
|
|
60
|
-
[accept]="fileUploadAccept"
|
|
61
|
-
name="chat21-file"
|
|
62
|
-
id="chat21-file"
|
|
63
|
-
#chat21_file
|
|
64
|
-
class="inputfile"
|
|
65
|
-
[ngStyle]="{'display': 'block', height:'1px', width:'1px', overflow: 'hidden' }"
|
|
66
|
-
(change)="detectFiles($event)"/>
|
|
67
|
-
</label>
|
|
68
69
|
<!-- ICON SEND -->
|
|
69
70
|
<div tabindex="-1" class="chat21-textarea-button" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
|
|
70
71
|
<span class="v-align-center">
|
|
@@ -73,39 +74,10 @@
|
|
|
73
74
|
</svg>
|
|
74
75
|
</span>
|
|
75
76
|
</div>
|
|
76
|
-
<!-- ICON EMOJII -->
|
|
77
|
-
<label tabindex="1504" aria-label="emojii" for="chat21-emojii" class="chat21-textarea-button" [class.active]="!isFilePendingToUpload && !hideTextReply" id="chat21-emoticon-picker" (click)="onEmojiiPickerClicked()">
|
|
78
|
-
<span class="v-align-center">
|
|
79
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 28 28" >
|
|
80
|
-
<path d="M0 0h24v24H0V0z" fill="none"/>
|
|
81
|
-
<circle cx="15.5" cy="9.5" r="1.5"/>
|
|
82
|
-
<circle cx="8.5" cy="9.5" r="1.5"/>
|
|
83
|
-
<path d="M12 16c-1.48 0-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5s4.32-1.45 5.12-3.5h-1.67c-.7 1.19-1.97 2-3.45 2zm-.01-14C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>
|
|
84
|
-
</svg>
|
|
85
|
-
</span>
|
|
86
|
-
</label>
|
|
87
77
|
</div>
|
|
88
78
|
|
|
89
79
|
|
|
90
|
-
<!--
|
|
91
|
-
<button *ngIf="!isRecording" tabindex="1502" aria-label="microfono" for="chat21-file" [class.active]="true" class="chat21-textarea-button c21-button-clean" id="chat21-start-mic" (click)="toggleRecording($event)">
|
|
92
|
-
<span class="v-align-center">
|
|
93
|
-
<svg aria-label="registra traccia audio" xmlns="http://www.w3.org/2000/svg" [ngStyle]="{'fill': g.themeColor}" width="24" height="24" viewBox="0 0 28 28">
|
|
94
|
-
<path d="M12,14c1.66,0,3-1.34,3-3V5c0-1.66-1.34-3-3-3S9,3.34,9,5v6C9,12.66,10.34,14,12,14z"/>
|
|
95
|
-
<path d="M17,11c0,2.76-2.24,5-5,5s-5-2.24-5-5H5c0,3.53,2.61,6.43,6,6.92V21h2v-3.08c3.39-0.49,6-3.39,6-6.92H17z"/>
|
|
96
|
-
</svg>
|
|
97
|
-
</span>
|
|
98
|
-
</button>
|
|
99
|
-
<button *ngIf="isRecording" tabindex="1502" aria-label="stop registrazione" for="chat21-file" [class.active]="true" class="chat21-textarea-button c21-button-clean " id="chat21-start-mic" (click)="toggleRecording($event)" autofocus>
|
|
100
|
-
<span class="v-align-center">
|
|
101
|
-
<svg aria-label="termina registrazione" xmlns="http://www.w3.org/2000/svg" [ngStyle]="{'fill': g.themeColor}" width="24" height="24" viewBox="0 0 28 28">
|
|
102
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
103
|
-
<path d="M6 6h12v12H6z"/>
|
|
104
|
-
</svg>
|
|
105
|
-
</span>
|
|
106
|
-
</button>
|
|
107
|
-
</div> -->
|
|
108
|
-
|
|
80
|
+
<!-- EMOJII PICKER-->
|
|
109
81
|
<div [style.visibility]="isEmojiiPickerShow?'visible':'hidden'" class="emoji-container">
|
|
110
82
|
<emoji-mart id="emoji-mart"
|
|
111
83
|
*ngIf="showEmojiPicker"
|
|
@@ -120,3 +92,24 @@
|
|
|
120
92
|
(emojiSelect)="addEmoji($event)">
|
|
121
93
|
</emoji-mart>
|
|
122
94
|
</div>
|
|
95
|
+
|
|
96
|
+
<!-- NEW CONV & CONTINE buttons: conv archived-->
|
|
97
|
+
<div id="floating-container" *ngIf="hideTextAreaContent" class="fade-in-bottom" start-focus-chat21-conversation-component>
|
|
98
|
+
<button tabindex="1040" aflistconv #aflistconv class="c21-button-primary" (click)="openNewConversation()" [ngStyle]="{'background-color': stylesMap.get('themeColor'), 'border-color': stylesMap.get('themeColor'), 'color': stylesMap?.get('foregroundColor')}">
|
|
99
|
+
<span class="v-align-center">
|
|
100
|
+
<svg [ngStyle]="{'fill': 'yellow' }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
|
|
101
|
+
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}"/>
|
|
102
|
+
</svg>
|
|
103
|
+
</span>
|
|
104
|
+
<span class="v-align-center c21-label-button">
|
|
105
|
+
{{translationMap?.get('LABEL_START_NW_CONV')}}
|
|
106
|
+
</span>
|
|
107
|
+
<div class="clear"></div>
|
|
108
|
+
</button>
|
|
109
|
+
<button *ngIf="showContinueConversationButton" tabindex="1040" class="c21-button-primary" (click)="onContinueConversation()" [ngStyle]="{'background-color': stylesMap.get('themeColor'), 'border-color': stylesMap.get('themeColor'), 'color': stylesMap?.get('foregroundColor')}">
|
|
110
|
+
<span class="v-align-center c21-label-button">
|
|
111
|
+
{{translationMap?.get('CONTINUE')}}
|
|
112
|
+
</span>
|
|
113
|
+
<div class="clear"></div>
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
// @import 'src/app/sass/variables';
|
|
2
2
|
|
|
3
|
+
.textarea-container{
|
|
4
|
+
// padding: 8px 34px;
|
|
5
|
+
// padding-left: 70px;
|
|
6
|
+
// padding-right: 45px;
|
|
7
|
+
display: flex;
|
|
8
|
+
width: 100%;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 10px;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icons-container{
|
|
15
|
+
display: flex;
|
|
16
|
+
align-self: flex-end;
|
|
17
|
+
margin-left: 8px
|
|
18
|
+
}
|
|
19
|
+
|
|
3
20
|
.visible-text-area {
|
|
21
|
+
width: 70%;
|
|
22
|
+
margin: 8px 0px;
|
|
4
23
|
pointer-events: auto;
|
|
5
24
|
border-radius: var(--chat-footer-border-radius);
|
|
6
25
|
background-color: var(--chat-footer-background-color);
|
|
@@ -12,6 +31,26 @@
|
|
|
12
31
|
.chat21-textarea-button {
|
|
13
32
|
fill: var(--icon-fill-color);
|
|
14
33
|
pointer-events: auto;
|
|
34
|
+
|
|
35
|
+
height: var(--chat-footer-height);
|
|
36
|
+
bottom: 22px;
|
|
37
|
+
opacity: 0.3;
|
|
38
|
+
cursor: initial;
|
|
39
|
+
&.active {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.chat21-textarea-button span svg:hover {
|
|
46
|
+
background: rgba(240,240,240,0.4)!important;
|
|
47
|
+
opacity: 1!important;
|
|
48
|
+
transition: all .45s ease-in-out 0s!important;
|
|
49
|
+
-moz-transition: all .45s ease-in-out 0s!important;
|
|
50
|
+
-webkit-transition: all .45s ease-in-out 0s!important;
|
|
51
|
+
padding: 0px;
|
|
52
|
+
margin: 0px;
|
|
53
|
+
border-radius: 50%;
|
|
15
54
|
}
|
|
16
55
|
|
|
17
56
|
textarea,
|
|
@@ -107,13 +146,6 @@ textarea:active{
|
|
|
107
146
|
}
|
|
108
147
|
}
|
|
109
148
|
|
|
110
|
-
textarea,
|
|
111
|
-
textarea:visited,
|
|
112
|
-
textarea:focus,
|
|
113
|
-
textarea:hover,
|
|
114
|
-
textarea:active{
|
|
115
|
-
all: unset;
|
|
116
|
-
}
|
|
117
149
|
|
|
118
150
|
#chat21-main-message-context {
|
|
119
151
|
overflow: hidden;
|
|
@@ -152,53 +184,14 @@ textarea:active{
|
|
|
152
184
|
}
|
|
153
185
|
}
|
|
154
186
|
|
|
155
|
-
.chat21-textarea-button {
|
|
156
|
-
position: absolute;
|
|
157
|
-
display: block;
|
|
158
|
-
height: var(--chat-footer-height);
|
|
159
|
-
bottom: 22px;
|
|
160
|
-
opacity: 0.3;
|
|
161
|
-
cursor: initial;
|
|
162
|
-
&.active {
|
|
163
|
-
opacity: 1;
|
|
164
|
-
cursor: pointer;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.chat21-textarea-button span svg:hover {
|
|
169
|
-
background: rgba(240,240,240,0.4)!important;
|
|
170
|
-
opacity: 1!important;
|
|
171
|
-
transition: all .45s ease-in-out 0s!important;
|
|
172
|
-
-moz-transition: all .45s ease-in-out 0s!important;
|
|
173
|
-
-webkit-transition: all .45s ease-in-out 0s!important;
|
|
174
|
-
padding: 0px;
|
|
175
|
-
margin: 0px;
|
|
176
|
-
border-radius: 50%;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.chat21-back-button{
|
|
180
|
-
position: absolute;
|
|
181
|
-
display: block;
|
|
182
|
-
height: var(--chat-footer-height);
|
|
183
|
-
cursor: pointer;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.chat21-back-button span svg:hover {
|
|
187
|
-
background: rgba(240,240,240,0.4)!important;
|
|
188
|
-
opacity: 1!important;
|
|
189
|
-
transition: all .45s ease-in-out 0s!important;
|
|
190
|
-
-moz-transition: all .45s ease-in-out 0s!important;
|
|
191
|
-
-webkit-transition: all .45s ease-in-out 0s!important;
|
|
192
|
-
padding: 0px;
|
|
193
|
-
margin: 0px;
|
|
194
|
-
border-radius: 50%;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
187
|
#chat21-button-send {
|
|
199
|
-
right: 8px;
|
|
200
|
-
bottom: 0;
|
|
188
|
+
// right: 8px;
|
|
189
|
+
// bottom: 0;
|
|
190
|
+
display: flex;
|
|
191
|
+
align-self: flex-end;
|
|
192
|
+
margin: 0 8px
|
|
201
193
|
}
|
|
194
|
+
|
|
202
195
|
#chat21-file{
|
|
203
196
|
left: 8px;
|
|
204
197
|
bottom: 0;
|
|
@@ -212,10 +205,8 @@ textarea:active{
|
|
|
212
205
|
left: 8px;
|
|
213
206
|
bottom: 0;
|
|
214
207
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
bottom: 0;
|
|
218
|
-
}
|
|
208
|
+
|
|
209
|
+
|
|
219
210
|
|
|
220
211
|
#floating-container{
|
|
221
212
|
width: 100%; //not 100% due to vertical scroll bar
|
|
@@ -231,6 +222,7 @@ textarea:active{
|
|
|
231
222
|
box-shadow: none;
|
|
232
223
|
vertical-align: top;
|
|
233
224
|
text-align: center;
|
|
225
|
+
padding: 8px 0px;
|
|
234
226
|
|
|
235
227
|
.c21-label-button {
|
|
236
228
|
margin-left: 8px;
|
|
@@ -253,10 +245,28 @@ textarea:active{
|
|
|
253
245
|
|
|
254
246
|
|
|
255
247
|
#hiddenFooter{
|
|
248
|
+
// position: absolute;
|
|
249
|
+
bottom: 100%;
|
|
250
|
+
width: 100%;
|
|
251
|
+
height: 22px;
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
// position: absolute;
|
|
256
|
+
box-shadow: inset 0px -22px 16px -15px rgba(0,0,0,0.1);
|
|
257
|
+
&.hideTextReply{
|
|
258
|
+
height: var(--chat-footer-height);
|
|
259
|
+
position: unset;
|
|
260
|
+
box-shadow: none;
|
|
261
|
+
.c21-powered-by{
|
|
262
|
+
background-color: var(--chat-footer-background-color);
|
|
263
|
+
|
|
264
|
+
}
|
|
265
|
+
}
|
|
256
266
|
.c21-powered-by {
|
|
257
|
-
height: 40px;
|
|
267
|
+
// height: 40px;
|
|
258
268
|
text-align: center;
|
|
259
|
-
padding: 0;
|
|
269
|
+
// padding: 0;
|
|
260
270
|
// margin: 5px 0;
|
|
261
271
|
// position: absolute;
|
|
262
272
|
color: var(--gray);
|
|
@@ -267,6 +277,12 @@ textarea:active{
|
|
|
267
277
|
align-items: center;
|
|
268
278
|
justify-content: center;
|
|
269
279
|
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
// background: white;
|
|
283
|
+
border-radius: 16px;
|
|
284
|
+
padding: 1px 8px;
|
|
285
|
+
|
|
270
286
|
&::ng-deep a {
|
|
271
287
|
text-decoration: none;
|
|
272
288
|
cursor: pointer;
|
|
@@ -287,7 +303,7 @@ textarea:active{
|
|
|
287
303
|
}
|
|
288
304
|
|
|
289
305
|
img {
|
|
290
|
-
width:
|
|
306
|
+
width: 60px; //60px;
|
|
291
307
|
height: auto;
|
|
292
308
|
max-height: 40px;
|
|
293
309
|
position: relative;
|
|
@@ -311,7 +327,7 @@ textarea:active{
|
|
|
311
327
|
height: 312px;
|
|
312
328
|
position: absolute;
|
|
313
329
|
overflow: hidden;
|
|
314
|
-
width:
|
|
330
|
+
width: 89%;
|
|
315
331
|
bottom: 100%;
|
|
316
332
|
z-index: 10;
|
|
317
333
|
left: 10px;
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
[fontColor]="stylesMap.get('bubbleReceivedTextColor')"
|
|
39
39
|
[fontSize]="stylesMap.get('fontSize')"
|
|
40
40
|
[fontFamily]="stylesMap.get('fontFamily')"
|
|
41
|
-
[stylesMap]="stylesMap"
|
|
41
|
+
[stylesMap]="stylesMap"
|
|
42
|
+
(onElementRendered)="onElementRenderedFN($event)">
|
|
42
43
|
</chat-bubble-message>
|
|
43
44
|
|
|
44
45
|
<div class="c21-icon-avatar" *ngIf="isFirst">
|
|
@@ -150,10 +150,12 @@ export class LastMessageComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
150
150
|
setTimeout(() => {
|
|
151
151
|
if(this.messageListWRP.get(this.messages.length-1)){
|
|
152
152
|
let height = getComputedStyle(this.messageListWRP.get(this.messages.length-1).nativeElement).height
|
|
153
|
+
// console.log('heightttttt--<', height, this.messages[this.messages.length-1])
|
|
153
154
|
this.g.setWidgetPreviewContainerSize(0, +height.substring(0, height.length-2))
|
|
154
155
|
}
|
|
155
156
|
}, 50);
|
|
156
157
|
}
|
|
158
|
+
|
|
157
159
|
isSameSender(senderId: string, index: number){
|
|
158
160
|
return isSameSender(this.messages, senderId, index)
|
|
159
161
|
}
|
|
@@ -186,6 +188,20 @@ export class LastMessageComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
186
188
|
// this.logger.debug('3 isOpenNewMessage: ' + this.g.isOpenNewMessage);
|
|
187
189
|
this.onCloseMessagePreview.emit();
|
|
188
190
|
}
|
|
191
|
+
|
|
192
|
+
onElementRenderedFN(event){
|
|
193
|
+
console.log('eventttttttt-->', event, this.messageListWRP)
|
|
194
|
+
this.messageListWRP.forEach((item, index)=> {
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
if(this.messageListWRP.get(index)){
|
|
197
|
+
let height = getComputedStyle(this.messageListWRP.get(index).nativeElement).height
|
|
198
|
+
console.log('heightttttt--<', height, this.messages[this.messages.length-1])
|
|
199
|
+
this.g.setWidgetPreviewContainerSize(0, +height.substring(0, height.length-2))
|
|
200
|
+
}
|
|
201
|
+
}, 50);
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
}
|
|
189
205
|
// ========= begin:: event emitter function ============//
|
|
190
206
|
|
|
191
207
|
|
|
@@ -99,6 +99,8 @@ export class BubbleMessageComponent implements OnInit {
|
|
|
99
99
|
height: metadata.height
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
// console.log('sizeeeeeeee--<', sizeImage, metadata)
|
|
103
|
+
|
|
102
104
|
if (metadata.width && metadata.width < MAX_WIDTH_IMAGES) {
|
|
103
105
|
if (metadata.width <= 55) {
|
|
104
106
|
const ratio = (metadata['width'] / metadata['height']);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<!-- [ngStyle] = "{ 'max-width': width +'px', 'max-height': height +'px' }" style="position: relative; text-align: center; margin: auto"-->
|
|
2
2
|
<div class="c21-img-container" >
|
|
3
|
-
<div *ngIf="loading" class="loader" [ngStyle] = "{ 'width': width , 'height': height }"></div>
|
|
3
|
+
<!-- <div *ngIf="loading" class="loader" [ngStyle] = "{ 'width': width , 'height': height }"></div> -->
|
|
4
4
|
<img
|
|
5
5
|
class="message-contentX message-content-imageX"
|
|
6
|
+
[alt]="metadata?.name"
|
|
6
7
|
[ngClass]="{'isLoadingImage': loading}"
|
|
7
8
|
[ngStyle] = "{ 'width': width, 'height': height }"
|
|
8
9
|
[src]="metadata.src"
|
|
@@ -503,6 +503,9 @@ export class GlobalSettingsService {
|
|
|
503
503
|
if (variables.hasOwnProperty('themeColorOpacity')) {
|
|
504
504
|
globals['themeColorOpacity'] = variables['themeColorOpacity'];
|
|
505
505
|
}
|
|
506
|
+
if (variables.hasOwnProperty('fileUploadAccept')) {
|
|
507
|
+
globals['fileUploadAccept'] = variables['fileUploadAccept'];
|
|
508
|
+
}
|
|
506
509
|
|
|
507
510
|
}
|
|
508
511
|
}
|
|
@@ -1009,7 +1012,12 @@ export class GlobalSettingsService {
|
|
|
1009
1012
|
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > telegramUsername:: ', TEMP]);
|
|
1010
1013
|
if (TEMP !== undefined) {
|
|
1011
1014
|
globals.telegramUsername = TEMP;
|
|
1012
|
-
}
|
|
1015
|
+
}
|
|
1016
|
+
TEMP = tiledeskSettings['fileUploadAccept'];
|
|
1017
|
+
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > telegramUsername:: ', TEMP]);
|
|
1018
|
+
if (TEMP !== undefined) {
|
|
1019
|
+
globals.fileUploadAccept = TEMP;
|
|
1020
|
+
}
|
|
1013
1021
|
}
|
|
1014
1022
|
|
|
1015
1023
|
/**
|
|
@@ -1272,6 +1280,10 @@ export class GlobalSettingsService {
|
|
|
1272
1280
|
if (TEMP !== null) {
|
|
1273
1281
|
this.globals.participants = TEMP.split(',').map(key => { return key.trim()});
|
|
1274
1282
|
}
|
|
1283
|
+
TEMP = el.nativeElement.getAttribute('fileUploadAccept');
|
|
1284
|
+
if (TEMP !== null) {
|
|
1285
|
+
this.globals.fileUploadAccept = TEMP;
|
|
1286
|
+
}
|
|
1275
1287
|
|
|
1276
1288
|
}
|
|
1277
1289
|
|
|
@@ -1709,6 +1721,11 @@ export class GlobalSettingsService {
|
|
|
1709
1721
|
if (TEMP) {
|
|
1710
1722
|
globals.participants = TEMP.split(',').map(key => { return key.trim()});
|
|
1711
1723
|
}
|
|
1724
|
+
|
|
1725
|
+
TEMP = getParameterByName(windowContext, 'tiledesk_fileUploadAccept');
|
|
1726
|
+
if (TEMP) {
|
|
1727
|
+
globals.fileUploadAccept = TEMP;
|
|
1728
|
+
}
|
|
1712
1729
|
}
|
|
1713
1730
|
|
|
1714
1731
|
/**
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -211,6 +211,7 @@ export class Globals {
|
|
|
211
211
|
whatsappNumber: string; // ******* new ********
|
|
212
212
|
messangerPageTitle: string; // ******* new ********
|
|
213
213
|
telegramUsername: string; // ******* new ********
|
|
214
|
+
fileUploadAccept: string; // ******* new ********
|
|
214
215
|
constructor(
|
|
215
216
|
) { }
|
|
216
217
|
|
|
@@ -385,6 +386,7 @@ export class Globals {
|
|
|
385
386
|
/**enable user to set a facebook messanger page to chat with */
|
|
386
387
|
this.telegramUsername = ''
|
|
387
388
|
/**enable user to set a telegram number to chat with */
|
|
389
|
+
this.fileUploadAccept = "image/*,.pdf,.txt"
|
|
388
390
|
|
|
389
391
|
this.showWaitTime = true;
|
|
390
392
|
|
|
@@ -9,8 +9,8 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
9
9
|
export abstract class TypingService {
|
|
10
10
|
|
|
11
11
|
// BehaviorSubject
|
|
12
|
-
BSIsTyping: BehaviorSubject<any>;
|
|
13
|
-
BSSetTyping: BehaviorSubject<any>;
|
|
12
|
+
abstract BSIsTyping: BehaviorSubject<any>;
|
|
13
|
+
abstract BSSetTyping: BehaviorSubject<any>;
|
|
14
14
|
|
|
15
15
|
// params
|
|
16
16
|
// private DEFAULT_TENANT: string = environment.firebaseConfig.tenant;
|
|
@@ -148,6 +148,10 @@ export class FirebasePresenceService extends PresenceService {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
public imHere(){
|
|
152
|
+
//NOT IMPLEMENTED FOR FIREBASE ENGINE
|
|
153
|
+
}
|
|
154
|
+
|
|
151
155
|
/**
|
|
152
156
|
* removePresence
|
|
153
157
|
* richiamato prima del logout
|
|
@@ -186,8 +190,4 @@ export class FirebasePresenceService extends PresenceService {
|
|
|
186
190
|
return connectionsRef;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
|
-
public imHere(){
|
|
190
|
-
//NOT IMPLEMENTED FOR FIREBASE ENGINE
|
|
191
|
-
}
|
|
192
|
-
|
|
193
193
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chat21Service } from 'src/chat21-core/providers/mqtt/chat-service';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Inject, Injectable, Optional } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
// firebase
|
|
@@ -32,7 +32,8 @@ export class MQTTPresenceService extends PresenceService {
|
|
|
32
32
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
33
33
|
|
|
34
34
|
constructor(
|
|
35
|
-
public chat21Service: Chat21Service
|
|
35
|
+
public chat21Service: Chat21Service,
|
|
36
|
+
@Optional() @Inject('webSocketService') public webSocketService?: any,
|
|
36
37
|
) {
|
|
37
38
|
super();
|
|
38
39
|
}
|
|
@@ -45,7 +46,20 @@ export class MQTTPresenceService extends PresenceService {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
userIsOnline(userid: string): Observable<any> {
|
|
48
|
-
|
|
49
|
+
const that = this;
|
|
50
|
+
let local_BSIsOnline = new BehaviorSubject<any>(null);
|
|
51
|
+
this.webSocketService.wsRequesterStatus$.subscribe((data: any) => {
|
|
52
|
+
this.logger.log('[NATIVEPresenceSERVICE] $subs to wsService - data ', data, userid);
|
|
53
|
+
if (data && data.presence && data.presence.status === 'online' ) {
|
|
54
|
+
that.BSIsOnline.next({ uid: data.uuid_user, isOnline: true });
|
|
55
|
+
local_BSIsOnline.next({ uid: data.uuid_user, isOnline: true });
|
|
56
|
+
} else {
|
|
57
|
+
that.BSIsOnline.next({ uid: data.uuid_user, isOnline: false });
|
|
58
|
+
local_BSIsOnline.next({ uid: data.uuid_user, isOnline: false });
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return local_BSIsOnline
|
|
49
63
|
}
|
|
50
64
|
|
|
51
65
|
lastOnlineForUser(userid: string) {
|
|
@@ -53,14 +67,6 @@ export class MQTTPresenceService extends PresenceService {
|
|
|
53
67
|
}
|
|
54
68
|
|
|
55
69
|
public setPresence(userid: string): void {
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* removePresence
|
|
61
|
-
* richiamato prima del logout
|
|
62
|
-
*/
|
|
63
|
-
public removePresence(): void {
|
|
64
70
|
|
|
65
71
|
}
|
|
66
72
|
|
|
@@ -71,4 +77,12 @@ export class MQTTPresenceService extends PresenceService {
|
|
|
71
77
|
}, 2000);
|
|
72
78
|
}
|
|
73
79
|
|
|
80
|
+
/**
|
|
81
|
+
* removePresence
|
|
82
|
+
* richiamato prima del logout
|
|
83
|
+
*/
|
|
84
|
+
public removePresence(): void {
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
74
88
|
}
|
|
@@ -243,9 +243,9 @@ export function commandToMessage(msg: MessageModel, conversation: ConversationMo
|
|
|
243
243
|
message.timestamp = conversation.timestamp
|
|
244
244
|
message.metadata = msg['metadata']
|
|
245
245
|
message.channel_type = conversation.channel_type
|
|
246
|
-
message.type = msg
|
|
246
|
+
message.type = msg['type']
|
|
247
247
|
message.isSender = isSender(message.sender, currentUserId)
|
|
248
|
-
message.attributes = { ...conversation.attributes, ...msg
|
|
248
|
+
message.attributes = { ...conversation.attributes, ...msg['attributes']}
|
|
249
249
|
|
|
250
250
|
return message as MessageModel
|
|
251
251
|
}
|