Skip to content

Commit 974c9d2

Browse files
committed
Merge branch 'development' into phone-validate
2 parents b86f7c1 + 5846cf6 commit 974c9d2

22 files changed

Lines changed: 291 additions & 42 deletions

webplugin/css/app/style.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,48 @@ input[type=number]::-webkit-outer-spin-button {
12341234
height: 14px;
12351235
}
12361236

1237+
.answer-feedback-helpful,
1238+
.answer-feedback-not-helpful {
1239+
appearance: none;
1240+
-webkit-appearance: none;
1241+
border: 0;
1242+
cursor: pointer;
1243+
padding: 0;
1244+
background: transparent;
1245+
display: inline-flex;
1246+
align-items: center;
1247+
justify-content: center;
1248+
width: 24px;
1249+
height: 24px;
1250+
min-width: 24px;
1251+
border-radius: 4px;
1252+
line-height: 1;
1253+
position: relative;
1254+
overflow: visible;
1255+
}
1256+
.answer-feedback-helpful::after,
1257+
.answer-feedback-not-helpful::after {
1258+
content: "";
1259+
position: absolute;
1260+
inset: -2px;
1261+
border: 1px solid #ff6b81;
1262+
box-shadow: 0 0 0 2px #ff6b81;
1263+
border-radius: inherit;
1264+
opacity: 0;
1265+
pointer-events: none;
1266+
}
1267+
.answer-feedback-helpful:focus, .answer-feedback-helpful:focus-visible,
1268+
.answer-feedback-not-helpful:focus,
1269+
.answer-feedback-not-helpful:focus-visible {
1270+
background: rgba(255, 107, 129, 0.08);
1271+
outline: none;
1272+
}
1273+
.answer-feedback-helpful:focus::after, .answer-feedback-helpful:focus-visible::after,
1274+
.answer-feedback-not-helpful:focus::after,
1275+
.answer-feedback-not-helpful:focus-visible::after {
1276+
opacity: 1;
1277+
}
1278+
12371279
.km-answer-feedback {
12381280
position: absolute;
12391281
bottom: 5px;

webplugin/js/app/components/answer-feedback-service.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,24 @@ class AnswerFeedback {
219219
});
220220
};
221221

222-
getFeedbackTemplate = (data) => {
223-
return `<div class="answer-feedback-helpful">
222+
getFeedbackTemplate = () => {
223+
return `<button type="button" class="answer-feedback-helpful" aria-label="${
224+
MCK_LABELS.answerFeedback.helpful
225+
}" title="${MCK_LABELS.answerFeedback.helpful}">
224226
${
225227
KommunicateConstants.ANSWER_FEEDBACK_ICONS[
226228
KommunicateConstants.ANSWER_FEEDBACK.HELPFUL
227229
]
228230
}
229-
</div>
230-
<div class="answer-feedback-not-helpful">
231+
</button>
232+
<button type="button" class="answer-feedback-not-helpful" aria-label="${
233+
MCK_LABELS.answerFeedback.notHelpful
234+
}" title="${MCK_LABELS.answerFeedback.notHelpful}">
231235
${
232236
KommunicateConstants.ANSWER_FEEDBACK_ICONS[
233237
KommunicateConstants.ANSWER_FEEDBACK.NOT_HELPFUL
234238
]
235239
}
236-
</div>`;
240+
</button>`;
237241
};
238242
}

webplugin/js/app/km-message-markup-1.0.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Kommunicate.messageTemplate = {
44
},
55
getAttachmentApplicationTemplate: function (attachment) {
66
return `<div class="km-attachment-wrapper mck-attachment {{attachmentClass}} notranslate mck-attachment-{{key}}" data-groupId="{{groupId}}" data-filemetakey="{{fileMetaKey}}" data-filename="{{fileMeta.name}}" data-thumbnailUrl="{{fileMeta.thumbnailUrl}}" data-filetype="{{fileMeta.contentType}}" data-fileurl="{{fileUrl}" data-filesize="{{fileMeta.size}}+" data-msgkey ="{{key}}"><div class="mck-msg-box vis {{previewContainerClass}}" data-groupId="{{groupId}}" data-filemetakey="{{fileMetaKey}}">
7-
<svg width="9" height="9" class="km-attachment-icon km-attachment-cancel-icon km-attachment-cancel-icon-{{key}} {{cancelIconClass}}" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.7338 0.275312C11.3788 -0.0796375 10.8055 -0.0796375 10.4505 0.275312L6 4.71672L1.54949 0.266213C1.19454 -0.0887375 0.621163 -0.0887375 0.266213 0.266213C-0.0887375 0.621163 -0.0887375 1.19454 0.266213 1.54949L4.71672 6L0.266213 10.4505C-0.0887375 10.8055 -0.0887375 11.3788 0.266213 11.7338C0.621163 12.0887 1.19454 12.0887 1.54949 11.7338L6 7.28328L10.4505 11.7338C10.8055 12.0887 11.3788 12.0887 11.7338 11.7338C12.0887 11.3788 12.0887 10.8055 11.7338 10.4505L7.28328 6L11.7338 1.54949C12.0796 1.20364 12.0796 0.621162 11.7338 0.275312Z" fill="white"/></svg>
8-
<svg width="16" height="16" class="km-attachment-icon km-attachment-upload-icon km-attachment-upload-icon-{{key}} {{uploadIconClass}}" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 0C3.55556 0 0 3.55556 0 8C0 12.4444 3.55556 16 8 16C12.4444 16 16 12.4444 16 8C16 3.55556 12.4444 0 8 0ZM5.88889 5.44444L7.88889 3.22222C7.88889 3.11111 8 3.11111 8.11111 3.11111C8.22222 3.11111 8.22222 3.11111 8.33333 3.22222L10.3333 5.44444C10.4444 5.55556 10.4444 5.66667 10.3333 5.77778C10.3333 5.88889 10.2222 5.88889 10.1111 5.88889H8.88889V9.44444C8.88889 9.55556 8.77778 9.66667 8.66667 9.66667H7.55556C7.44445 9.66667 7.33333 9.55556 7.33333 9.44444V5.88889H6.22222C6.11111 5.88889 6 5.77778 6 5.77778C5.77778 5.66667 5.77778 5.55556 5.88889 5.44444ZM12.2222 11.4444C12.2222 11.7778 12 12 11.6667 12H4.44444C4.11111 12 3.88889 11.7778 3.88889 11.4444V9.22222H5V10.8889H11.1111V9.22222H12.2222V11.4444Z" fill="white"/></svg><a class="km-attachment-preview-href-{{key}} {{fileEncClass}}" href="{{fileMeta.url}}" target="_blank" download data-blobkey="{{blobKey}}"><svg width="16" height="16" class="km-attachment-download-icon-{{key}} km-attachment-download-icon {{downloadIconClass}}" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 0C3.6 0 0 3.6 0 8C0 12.4 3.6 16 8 16C12.4 16 16 12.4 16 8C16 3.6 12.4 0 8 0ZM11.6 12H5V11.1H11.6V12ZM8.3 10.1L5 6.8H6.9V4H9.7V6.8H11.6L8.3 10.1Z" fill="white"></path></svg>
7+
<button type="button" class="km-attachment-icon km-attachment-cancel-icon km-attachment-cancel-icon-{{key}} {{cancelIconClass}}" aria-label="{{cancelUploadLabel}}" title="{{cancelUploadLabel}}"><svg width="9" height="9" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M11.7338 0.275312C11.3788 -0.0796375 10.8055 -0.0796375 10.4505 0.275312L6 4.71672L1.54949 0.266213C1.19454 -0.0887375 0.621163 -0.0887375 0.266213 0.266213C-0.0887375 0.621163 -0.0887375 1.19454 0.266213 1.54949L4.71672 6L0.266213 10.4505C-0.0887375 10.8055 -0.0887375 11.3788 0.266213 11.7338C0.621163 12.0887 1.19454 12.0887 1.54949 11.7338L6 7.28328L10.4505 11.7338C10.8055 12.0887 11.3788 12.0887 11.7338 11.7338C12.0887 11.3788 12.0887 10.8055 11.7338 10.4505L7.28328 6L11.7338 1.54949C12.0796 1.20364 12.0796 0.621162 11.7338 0.275312Z" fill="white"/></svg></button>
8+
<button type="button" class="km-attachment-icon km-attachment-upload-icon km-attachment-upload-icon-{{key}} {{uploadIconClass}}" aria-label="{{retryUploadLabel}}" title="{{retryUploadLabel}}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M8 0C3.55556 0 0 3.55556 0 8C0 12.4444 3.55556 16 8 16C12.4444 16 16 12.4444 16 8C16 3.55556 12.4444 0 8 0ZM5.88889 5.44444L7.88889 3.22222C7.88889 3.11111 8 3.11111 8.11111 3.11111C8.22222 3.11111 8.22222 3.11111 8.33333 3.22222L10.3333 5.44444C10.4444 5.55556 10.4444 5.66667 10.3333 5.77778C10.3333 5.88889 10.2222 5.88889 10.1111 5.88889H8.88889V9.44444C8.88889 9.55556 8.77778 9.66667 8.66667 9.66667H7.55556C7.44445 9.66667 7.33333 9.55556 7.33333 9.44444V5.88889H6.22222C6.11111 5.88889 6 5.77778 6 5.77778C5.77778 5.66667 5.77778 5.55556 5.88889 5.44444ZM12.2222 11.4444C12.2222 11.7778 12 12 11.6667 12H4.44444C4.11111 12 3.88889 11.7778 3.88889 11.4444V9.22222H5V10.8889H11.1111V9.22222H12.2222V11.4444Z" fill="white"/></svg></button><a class="km-attachment-preview-href-{{key}} {{fileEncClass}}" href="{{fileMeta.url}}" target="_blank" download data-blobkey="{{blobKey}}" aria-label="{{downloadAttachmentLabel}}" title="{{downloadAttachmentLabel}}"><svg width="16" height="16" class="km-attachment-download-icon-{{key}} km-attachment-download-icon {{downloadIconClass}}" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 0C3.6 0 0 3.6 0 8C0 12.4 3.6 16 8 16C12.4 16 16 12.4 16 8C16 3.6 12.4 0 8 0ZM11.6 12H5V11.1H11.6V12ZM8.3 10.1L5 6.8H6.9V4H9.7V6.8H11.6L8.3 10.1Z" fill="white"></path></svg>
99
<span class="km-attachment-file-name">{{fileNameToShow}}<span/>{{fileMeta.previewSize}}</a></div><div class="km-attachment-progress-bar-wrapper km-attachment-progress-bar-wrapper-{{key}} {{progressBarClass}}"><div class="km-attachment-progress-bar-success km-attachment-progress-bar-success-{{key}} vis"></div></div></div>`;
1010
},
1111
getProgressMeter: function (key) {
@@ -14,6 +14,14 @@ Kommunicate.messageTemplate = {
1414
getAttachmentContanier: function (data, fileExpr, isUserMsg, fileUrl) {
1515
data.fileExpr = fileExpr;
1616
data.fileUrl = fileUrl;
17+
var attachmentLabels = window.MCK_LABELS || {};
18+
var downloadAttachmentLabel =
19+
attachmentLabels['attachment.download'] || 'Download attachment';
20+
data.cancelUploadLabel = attachmentLabels['attachment.cancelUpload'] || 'Cancel upload';
21+
data.retryUploadLabel = attachmentLabels['attachment.retryUpload'] || 'Retry upload';
22+
data.downloadAttachmentLabel =
23+
downloadAttachmentLabel +
24+
(data.fileMeta && data.fileMeta.name ? ': ' + data.fileMeta.name : '');
1725
data.previewContainerClass = isUserMsg
1826
? 'km-custom-widget-background-color'
1927
: 'km-attach-preview-container';
@@ -171,8 +179,15 @@ Kommunicate.popupChatTemplate = {
171179
? 'km-anonymous-chat-launcher'
172180
: 'applozic-launcher';
173181
var templateCss = KommunicateConstants.CHAT_POPUP_TEMPLATE_CLASS[templateKey];
182+
var closeButtonLabel =
183+
(window.MCK_LABELS && MCK_LABELS['popup.close']) || 'Close popup message';
184+
var closeButtonLabelAttr = kommunicateCommons.escapeAttributeValue(closeButtonLabel);
174185
var closeButtonMarkup =
175-
'<div class="chat-popup-widget-close-btn-container" aria-label="Close"><div class="chat-popup-widget-close-btn"><span class="chat-popup-widget-close-icon-svg"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M12.6667 4.27337L11.7267 3.33337L8.00001 7.06004L4.27334 3.33337L3.33334 4.27337L7.06001 8.00004L3.33334 11.7267L4.27334 12.6667L8.00001 8.94004L11.7267 12.6667L12.6667 11.7267L8.94001 8.00004L12.6667 4.27337Z" fill="#1C1C1C"/></svg></span></div></div>';
186+
'<button type="button" class="chat-popup-widget-close-btn-container" aria-label="' +
187+
closeButtonLabelAttr +
188+
'" title="' +
189+
closeButtonLabelAttr +
190+
'"><div class="chat-popup-widget-close-btn"><span class="chat-popup-widget-close-icon-svg"> <svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M12.6667 4.27337L11.7267 3.33337L8.00001 7.06004L4.27334 3.33337L3.33334 4.27337L7.06001 8.00004L3.33334 11.7267L4.27334 12.6667L8.00001 8.94004L11.7267 12.6667L12.6667 11.7267L8.94001 8.00004L12.6667 4.27337Z" fill="#1C1C1C"/></svg></span></div></button>';
176191

177192
chatPopupTemplateMarkup =
178193
'<div id="chat-popup-widget-container" class="chat-popup-widget-container ' +

webplugin/js/app/kommunicate-ui.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,16 +1296,27 @@ KommunicateUI = {
12961296
kommunicateCommons.show($statusText);
12971297
},
12981298
toggleVoiceOutputOverride: function (voiceOutput) {
1299+
var voiceOutputButton = document.getElementById('user-overide-voice-output');
1300+
var voiceOutputText = document.getElementById('user-overide-voice-output-text');
1301+
var dropdownLabels = KommunicateUI.getLabel('conversation.header.dropdown', {});
1302+
var voiceOutputLabel;
12991303
if (voiceOutput) {
13001304
kommunicateCommons.hide('#user-overide-voice-output-svg-off');
13011305
kommunicateCommons.show('#user-overide-voice-output-svg-on');
1302-
document.getElementById('user-overide-voice-output-text').innerText =
1303-
MCK_LABELS['conversation.header.dropdown'].USER_OVERIDE_VOICE_OUTPUT_OFF;
1306+
voiceOutputLabel =
1307+
dropdownLabels.USER_OVERIDE_VOICE_OUTPUT_OFF || 'Turn voice output off';
13041308
} else {
13051309
kommunicateCommons.hide('#user-overide-voice-output-svg-on');
13061310
kommunicateCommons.show('#user-overide-voice-output-svg-off');
1307-
document.getElementById('user-overide-voice-output-text').innerText =
1308-
MCK_LABELS['conversation.header.dropdown'].USER_OVERIDE_VOICE_OUTPUT_ON;
1311+
voiceOutputLabel =
1312+
dropdownLabels.USER_OVERIDE_VOICE_OUTPUT_ON || 'Turn voice output on';
1313+
}
1314+
if (voiceOutputText) {
1315+
voiceOutputText.innerText = voiceOutputLabel;
1316+
}
1317+
if (voiceOutputButton) {
1318+
voiceOutputButton.setAttribute('aria-label', voiceOutputLabel);
1319+
voiceOutputButton.setAttribute('title', voiceOutputLabel);
13091320
}
13101321
},
13111322
loadQuickReplies: function (quickReplies) {

webplugin/js/app/kommunicateCommons.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,19 @@ function KommunicateCommons() {
152152
if (isNaN(baseHeight)) {
153153
return;
154154
}
155-
155+
var iframeBottomOffset =
156+
computedStyle && computedStyle.bottom ? parseFloat(computedStyle.bottom) : NaN;
157+
if (isNaN(iframeBottomOffset)) {
158+
iframeBottomOffset = IFRAME_BOTTOM_OFFSET;
159+
}
156160
var navHeight = getBottomNavHeight(iframeElement);
157161
if (isNaN(navHeight) || navHeight <= 0) {
158162
navHeight = DEFAULT_BOTTOM_NAV_HEIGHT;
159163
}
160164
var navAdjustedIframeHeight = baseHeight - navHeight;
161-
var finalIframeHeight = navAdjustedIframeHeight > 0 ? navAdjustedIframeHeight : baseHeight;
165+
var finalIframeHeight =
166+
(navAdjustedIframeHeight > 0 ? navAdjustedIframeHeight : baseHeight) -
167+
iframeBottomOffset;
162168
var shouldEnforceTopGap =
163169
iframeElement.classList &&
164170
iframeElement.classList.contains('km-iframe-dimension-with-popup');
@@ -167,7 +173,7 @@ function KommunicateCommons() {
167173
heightSourceWindow && heightSourceWindow.innerHeight
168174
? heightSourceWindow.innerHeight
169175
: window.innerHeight;
170-
var maxIframeHeightWithTopGap = viewportHeight - MIN_TOP_CTA_GAP - IFRAME_BOTTOM_OFFSET;
176+
var maxIframeHeightWithTopGap = viewportHeight - MIN_TOP_CTA_GAP - iframeBottomOffset;
171177
if (!isNaN(maxIframeHeightWithTopGap) && maxIframeHeightWithTopGap > 0) {
172178
finalIframeHeight = Math.max(finalIframeHeight, maxIframeHeightWithTopGap);
173179
}

webplugin/js/app/labels/default-labels-en.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@
6060
'mck.empty.welcome.cta.continue': 'View conversations',
6161
'no.more.conversations': 'No more conversations!',
6262
'search.placeholder': 'Search...',
63+
'search.clear': 'Clear search',
6364
'mck.email.placeholder': 'Enter your email...',
6465
'location.placeholder': 'Enter a location',
66+
'options': 'Options',
67+
'conversation.options': 'Conversation options',
6568
'form.label.to': 'To:',
6669
'form.label.userId': 'User ID',
6770
'form.error.required': 'This is a required field',
6871
'form.error.invalidValue': 'You have entered an invalid Value',
6972
'location.coordinates.lat': 'Lat.:',
7073
'location.coordinates.lon': 'Long.:',
74+
'reply.preview.close': 'Close reply preview',
7175
'create.group.title': 'Create Group',
7276
'members.title': 'Members',
7377
'add.members.title': 'Add Member',
@@ -111,6 +115,21 @@
111115
'save': 'Save',
112116
'file.attachment': 'Upload Attachment',
113117
'file.attach.title': 'Attach File',
118+
'upload.image': 'Upload Image',
119+
'upload.video': 'Upload Video',
120+
'attachment.cancelUpload': 'Cancel upload',
121+
'attachment.retryUpload': 'Retry upload',
122+
'attachment.download': 'Download attachment',
123+
'voice.input': 'Voice input',
124+
'voice.input.options': 'Voice input options',
125+
'voice.mode': 'Voice mode',
126+
'quick.replies': 'Quick replies',
127+
'recording.delete': 'Delete recording',
128+
'recording.pause': 'Pause recording',
129+
'recording.play': 'Play recording',
130+
'recording.send': 'Send recording',
131+
'recording.stop': 'Stop recording',
132+
'popup.close': 'Close popup message',
114133
'last.seen': 'Last seen',
115134
'last.seen.on': 'Last seen on',
116135
'hour': ' hour',
@@ -198,6 +217,11 @@
198217
CONVERSATION_RESOLVED: 'This conversation was resolved', //if conversation resolved through zendesk,
199218
CONVERSATION_RATING_HEADING: 'How satisfied are you with the conversation?',
200219
RATE_ERROR_MSG: 'Please rate the conversation',
220+
STAR_1: '1 star',
221+
STAR_2: '2 stars',
222+
STAR_3: '3 stars',
223+
STAR_4: '4 stars',
224+
STAR_5: '5 stars',
201225
},
202226
'page.title.on.new.message': 'New message from ',
203227
'emoji.hover.text': {
@@ -286,7 +310,7 @@
286310
noActiveConversation: 'Please open a conversation first.',
287311
silenceTimeout: 'No speech detected. Listening for more...',
288312
listeningNote: 'AI assistant is listening for you—just speak.',
289-
mutedNote: 'Microphone paused. Tap the mic to resume voice input.',
313+
mutedNote: 'Microphone paused. Use the microphone button to resume voice input.',
290314
processing: 'Processing',
291315
processingFailed: 'Unable to transcribe the recording. Please try again.',
292316
noSpeechDetected: 'No speech detected. Please try again.',

0 commit comments

Comments
 (0)