-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: get rid of Simplebar (vanilla js based scrollbar) (#2900)
This PR include this other one [PR#2903](#2903) ## Work done so far 1. [Getting rid of `scrollbar` webchat property customization](b8b676e): We don't want to support this feature anymore. This was done before in order to have "nice" styles in Internet Explorer and similar browsers. As IE is not supported anymore, we can remove this. 2. [Having ids for relevant botonic containers](79a2bf8): In this way we can have a better way to access the values of these well differentiated areas of the webchat. 3. [Ensuring elements within webchat are spaced correctly](cd37e6f): This is, spacing elements between in webchat for every container to push the other siblings with same distances. 4. [Remove Simplebar in favour of a new component created by us](e1a937c): Simplebar was giving lots of headaches to us, so we can change it by containers with the ids created in point 2. 5. [Fix replies container not scrolling](72f3eeb) 6. [chatArea container to englobe messages list and replies containers](7dcafa0) 7. [Recalculate chatarea size when iOS safari virtual keyboard is shown](383ff18): As we have modified the containers which where important to calculate when the webchat has to be resized in iOS, we needed to adapt and update a little bit this logic. ## Current state As per the list described above, the functionality should be the same as before. The important thing to notice here is that **WE DON'T RELY ANYMORE** on simplebar selectors `'.simplebar-content'` and `'.simplebar-content-wrapper'`, so bots using them should be adapted. ## Next steps * Create reusable hooks to do calculations over DOM elements or use [Resizer observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) to have the code up to date with new standards and good code practices. * Remove related logic not needed anymore after removing simplebar dependency (possibly tricky parts of the code related to ShadowDOM). --------- Co-authored-by: Oriol Raventos <[email protected]>
- Loading branch information
1 parent
610976e
commit 65ab8aa
Showing
31 changed files
with
554 additions
and
456 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
packages/botonic-react/src/webchat/components/styled-scrollbar.jsx
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
packages/botonic-react/src/webchat/components/styled-scrollbar.scss
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Convert to an enum when all the files using these values are migrated to ts{x} | ||
export const BotonicContainerId = { | ||
Webchat: 'botonic-webchat', | ||
Header: 'botonic-header', | ||
ChatArea: 'botonic-chat-area', | ||
ScrollableMessagesList: 'botonic-scrollable-messages-list', | ||
RepliesContainer: 'botonic-replies-container', | ||
InputPanel: 'botonic-input-panel', | ||
} |
43 changes: 0 additions & 43 deletions
43
packages/botonic-react/src/webchat/devices/device-adapter.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.