Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 9ce64b6

Browse files
JP-Artsolalpe
andauthored
Pre release v.3.7.8 (#134)
* Updates to Carousel * Update messagelist component so messages can scroll down automatically * Updates to components * update package versions * removed TTS/STT * add touch navigation to carousel cards * added styles to modal window Co-authored-by: alpe <alpe@Ubuntu.myguest.virtualbox.org>
1 parent 5493c1b commit 9ce64b6

17 files changed

+356
-916
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
# v3.7.8
2+
## July-2023
3+
* Bug Fixes
4+
* Message does not scroll down automatically.
5+
* Carousel Scrolling Bug with Arrows.
6+
* Carousel Bug when Switching Cards.
7+
* ASR microphone button behaving erratically.
8+
* Hiding User input when upload panel is displayed.
19
# v3.7.7
210
## June-2023
311
* Features
412
* Attachment Messages.
5-
* Rating Messages.
6-
* [MCS integration](docs/features/TWC+MCS%20integration.md).
13+
* Rating Messages.
714

815

916
* Bug Fixes

docs/features/TWC+MCS integration.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

package-lock.json

Lines changed: 12 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "teneo-web-chat",
3-
"version": "3.7.7",
3+
"version": "3.7.8",
44
"description": "Teneo Web Chat widget that can be embedded in websites.",
55
"scripts": {
66
"analyze": "NODE_ENV=production webpack --config webpack.prod.js --profile --json > stats-prod.json && webpack-bundle-analyzer stats-prod.json dist/",
@@ -24,7 +24,6 @@
2424
"express": "^4.17.1",
2525
"install": "^0.13.0",
2626
"isomorphic-dompurify": "^0.24.0",
27-
"microsoft-cognitiveservices-speech-sdk": "^1.30.1",
2827
"vue": "^2.6.14"
2928
},
3029
"devDependencies": {

src/components/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060

6161
<style scoped>
6262
.twc-header {
63-
background: var(--header-bg-color, #4e8cff);
63+
background: var(--header-bg-color, #2f286e);
6464
min-height: 64px;
6565
border-top-left-radius: 9px;
6666
border-top-right-radius: 9px;

src/components/LaunchButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default {
9393
</script>
9494
<style scoped>
9595
.twc-launch-button {
96-
background-color: var(--launch-button-bg-color, #4e8cff);
96+
background-color: var(--launch-button-bg-color, #2f286e);
9797
width: 60px;
9898
height: 60px;
9999
background-position: center;

src/components/MessageList.vue

Lines changed: 36 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<script>
1313
import Message from './Message.vue';
14-
import { EventBus,events } from '../utils/event-bus';
14+
import { EventBus, events } from '../utils/event-bus';
1515
1616
export default {
1717
components: {
@@ -26,90 +26,57 @@ export default {
2626
data() {
2727
return {
2828
showScrollDownButton: false,
29+
mutationObserver: null,
2930
};
3031
},
3132
mounted() {
32-
// Setup a downwards scroller
33-
EventBus.$on(events.SCROLL_CHAT_DOWN, () => {
34-
setTimeout(() => {
35-
this._scrollDown();
36-
}, 40);
37-
});
33+
// Used MutationObserver to detect changes in the messageList or new messages are added
34+
this.mutationObserver = new MutationObserver(this.handleMutation);
3835
39-
// Add scroll event listener to show/hide scroll down button
40-
this.$refs.scrollList.addEventListener('scroll', () => {
41-
this.handleScroll();
42-
});
36+
// Start observing changes in the scrollList
37+
this.mutationObserver.observe(this.$refs.scrollList, {
38+
childList: true,
39+
});
4340
44-
},
45-
updated() {
46-
if (this.shouldScrollToBottom() && !this.showScrollDownButton) {
47-
this.$nextTick(this._scrollDown);
48-
}
49-
// Additional scroll down after images etc have loaded
50-
setTimeout(this._scrollDown.bind(this), 700);
41+
// Scroll to the last message when component is mounted
42+
this.$nextTick(this.scrollDown);
5143
},
5244
beforeDestroy() {
53-
// Remove scroll event listener
54-
this.$refs.scrollList.removeEventListener('scroll', this.handleScroll);
45+
// Stop observing changes and disconnect MutationObserver
46+
this.mutationObserver.disconnect();
5547
},
5648
methods: {
57-
_scrollDown() {
58-
const scrollList = this.$refs.scrollList;
59-
const latestMessage = document.querySelector('.twc-message:last-child');
49+
scrollDown() {
50+
const scrollList = this.$refs.scrollList;
6051
61-
if (!scrollList) {
62-
return;
63-
}
52+
if (!scrollList) {
53+
return;
54+
}
6455
65-
// Only scroll to the bottom if the user is already at the bottom
66-
if (scrollList.scrollTop === (scrollList.scrollHeight - scrollList.offsetHeight)) {
67-
if (latestMessage && typeof latestMessage.scrollIntoView === 'function') {
68-
latestMessage.scrollIntoView({
69-
behavior: 'smooth',
70-
block: 'end',
71-
inline: 'nearest'
56+
this.$nextTick(() => {
57+
const latestMessage = scrollList.querySelector('.twc-message:last-child');
58+
59+
if (latestMessage && typeof latestMessage.scrollIntoView === 'function') {
60+
latestMessage.scrollIntoView({
61+
behavior: 'smooth',
62+
block: 'end',
63+
inline: 'nearest',
64+
});
65+
} else {
66+
scrollList.scrollTop = scrollList.scrollHeight;
67+
}
7268
});
73-
} else {
74-
scrollList.scrollTop = scrollList.scrollHeight;
75-
}
76-
}
77-
},
78-
79-
shouldScrollToBottom() {
80-
return this.$refs.scrollList.scrollTop >= 0;
81-
},
82-
83-
84-
handleScroll() {
85-
const scrollList = this.$refs.scrollList;
86-
87-
if (scrollList.scrollTop === (scrollList.scrollHeight - scrollList.offsetHeight)) {
88-
this.showScrollDownButton = false;
89-
} else {
90-
this.showScrollDownButton = true;
91-
}
92-
},
93-
69+
},
70+
handleMutation() {
71+
this.$nextTick(this.scrollDown);
72+
},
9473
scrollDownDirectly() {
95-
const latestMessage = document.querySelector('.twc-message:last-child');
96-
97-
if (latestMessage && typeof latestMessage.scrollIntoView === 'function') {
98-
latestMessage.scrollIntoView({
99-
behavior: 'smooth',
100-
block: 'end',
101-
inline: 'nearest'
102-
});
103-
} else if (this.$refs.scrollList) {
104-
this.$refs.scrollList.scrollTop = this.$refs.scrollList.scrollHeight;
105-
}
74+
this.scrollDown();
10675
},
10776
},
10877
};
10978
</script>
11079

111-
112-
11380
<style scoped>
11481
:root {
11582
--user-input-bg-color: #fff;
@@ -127,7 +94,8 @@ handleScroll() {
12794
}
12895
12996
.twc-message-list::-webkit-scrollbar-track {
130-
background: var(--user-input-bg-color); border-radius: 10px;
97+
background: var(--user-input-bg-color);
98+
border-radius: 10px;
13199
margin: 2px 0;
132100
}
133101

0 commit comments

Comments
 (0)