mirror of
https://github.com/nomadic-labs/safesupport-chatbox
synced 2025-12-16 15:33:23 +00:00
Compare commits
5 Commits
v1.1.3
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cdc7bd4f6 | ||
|
|
569a8e76c2 | ||
|
|
b76eebcacb | ||
|
|
c592253707 | ||
|
|
ebb06b3377 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "safesupport-chatbox",
|
"name": "safesupport-chatbox",
|
||||||
"version": "1.1.3",
|
"version": "1.1.5",
|
||||||
"description": "A secure and private embeddable chatbox that connects to Riot",
|
"description": "A secure and private embeddable chatbox that connects to Riot",
|
||||||
"main": "dist/chatbox.js",
|
"main": "dist/chatbox.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@
|
|||||||
width: 400px;
|
width: 400px;
|
||||||
max-width: calc(100vw - 10px);
|
max-width: calc(100vw - 10px);
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
margin: 0;
|
||||||
animation-duration: 0.2s;
|
animation-duration: 0.2s;
|
||||||
animation-fill-mode: forwards;
|
animation-fill-mode: forwards;
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,6 @@
|
|||||||
.message {
|
.message {
|
||||||
&.from-bot {
|
&.from-bot {
|
||||||
color: transparentize($light-text-color, 0.3);
|
color: transparentize($light-text-color, 0.3);
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.from-me {
|
&.from-me {
|
||||||
|
|||||||
@@ -599,103 +599,105 @@ class ChatBox extends React.Component {
|
|||||||
const inputLabel = 'Send a message...'
|
const inputLabel = 'Send a message...'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="docked-widget" role="complementary">
|
<div id="safesupport">
|
||||||
<Transition in={opened} timeout={250} onExited={this.handleWidgetExit} onEntered={this.handleWidgetEnter}>
|
<div className="docked-widget" role="complementary">
|
||||||
{(status) => {
|
<Transition in={opened} timeout={250} onExited={this.handleWidgetExit} onEntered={this.handleWidgetEnter}>
|
||||||
return (
|
{(status) => {
|
||||||
<div className={`widget widget-${status}`} aria-hidden={!opened}>
|
return (
|
||||||
<div id="safesupport-chatbox" aria-haspopup="dialog">
|
<div className={`widget widget-${status}`} aria-hidden={!opened}>
|
||||||
<Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />
|
<div id="safesupport-chatbox" aria-haspopup="dialog">
|
||||||
|
<Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />
|
||||||
|
|
||||||
<div className="message-window" ref={this.messageWindow}>
|
<div className="message-window" ref={this.messageWindow}>
|
||||||
<div className="messages">
|
<div className="messages">
|
||||||
<div className={`message from-bot`}>
|
<div className={`message from-bot`}>
|
||||||
<div className="text">{ this.props.introMessage }</div>
|
<div className="text">{ this.props.introMessage }</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={`message from-bot`}>
|
|
||||||
<div className="text">Please read the full <a href={this.props.termsUrl} ref={this.termsUrl} target='_blank' rel='noopener noreferrer'>terms and conditions</a>. By using this chat, you agree to these terms.</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={`message from-bot`}>
|
|
||||||
<div className="text">{ this.props.agreementMessage }</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={`message from-bot`}>
|
|
||||||
<div className="text buttons">
|
|
||||||
{`👉`}
|
|
||||||
<button className="btn" id="accept" onClick={this.handleAcceptTerms}>YES</button>
|
|
||||||
<button className="btn" id="reject" onClick={this.handleRejectTerms}>NO</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
<div className={`message from-bot`}>
|
||||||
messages.map((message, index) => {
|
<div className="text">Please read the full <a href={this.props.termsUrl} ref={this.termsUrl} target='_blank' rel='noopener noreferrer'>terms and conditions</a>. By using this chat, you agree to these terms.</div>
|
||||||
return(
|
</div>
|
||||||
<Message key={message.id} message={message} userId={userId} botId={this.props.botId} client={this.state.client} />
|
|
||||||
)
|
<div className={`message from-bot`}>
|
||||||
})
|
<div className="text">{ this.props.agreementMessage }</div>
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
messagesInFlight.map((message, index) => {
|
|
||||||
return(
|
|
||||||
<Message key={`message-inflight-${index}`} message={{ content: { body: message }}} placeholder={true} />
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
{ typingStatus &&
|
|
||||||
<div className="notices">
|
|
||||||
<div role="status">{typingStatus}</div>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
{ Boolean(Object.keys(decryptionErrors).length) &&
|
|
||||||
<div className={`message from-bot`}>
|
<div className={`message from-bot`}>
|
||||||
<div className="text buttons">
|
<div className="text buttons">
|
||||||
{`Restart chat without encryption?`}
|
{`👉`}
|
||||||
<button className="btn" id="accept" onClick={this.initializeUnencryptedChat}>RESTART</button>
|
<button className="btn" id="accept" onClick={this.handleAcceptTerms}>YES</button>
|
||||||
|
<button className="btn" id="reject" onClick={this.handleRejectTerms}>NO</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
{ !ready && <div className={`loader`}>loading...</div> }
|
{
|
||||||
|
messages.map((message, index) => {
|
||||||
|
return(
|
||||||
|
<Message key={message.id} message={message} userId={userId} botId={this.props.botId} client={this.state.client} />
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
messagesInFlight.map((message, index) => {
|
||||||
|
return(
|
||||||
|
<Message key={`message-inflight-${index}`} message={{ content: { body: message }}} placeholder={true} />
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
{ typingStatus &&
|
||||||
|
<div className="notices">
|
||||||
|
<div role="status">{typingStatus}</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{ Boolean(Object.keys(decryptionErrors).length) &&
|
||||||
|
<div className={`message from-bot`}>
|
||||||
|
<div className="text buttons">
|
||||||
|
{`Restart chat without encryption?`}
|
||||||
|
<button className="btn" id="accept" onClick={this.initializeUnencryptedChat}>RESTART</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{ !ready && <div className={`loader`}>loading...</div> }
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="input-window">
|
||||||
|
<form onSubmit={this.handleSubmit}>
|
||||||
|
<div className="message-input-container">
|
||||||
|
<input
|
||||||
|
id="message-input"
|
||||||
|
type="text"
|
||||||
|
onChange={this.handleInputChange}
|
||||||
|
value={inputValue}
|
||||||
|
aria-label={inputLabel}
|
||||||
|
placeholder={inputLabel}
|
||||||
|
autoFocus={true}
|
||||||
|
ref={this.chatboxInput}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
(status === "entered") && !isMobile &&
|
||||||
|
<EmojiSelector
|
||||||
|
onEmojiClick={this.onEmojiClick}
|
||||||
|
emojiSelectorOpen={emojiSelectorOpen}
|
||||||
|
toggleEmojiSelector={this.toggleEmojiSelector}
|
||||||
|
closeEmojiSelector={this.closeEmojiSelector}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<input type="submit" value="Send" id="submit" onClick={this.handleSubmit} />
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-window">
|
|
||||||
<form onSubmit={this.handleSubmit}>
|
|
||||||
<div className="message-input-container">
|
|
||||||
<input
|
|
||||||
id="message-input"
|
|
||||||
type="text"
|
|
||||||
onChange={this.handleInputChange}
|
|
||||||
value={inputValue}
|
|
||||||
aria-label={inputLabel}
|
|
||||||
placeholder={inputLabel}
|
|
||||||
autoFocus={true}
|
|
||||||
ref={this.chatboxInput}
|
|
||||||
/>
|
|
||||||
{
|
|
||||||
(status === "entered") && !isMobile &&
|
|
||||||
<EmojiSelector
|
|
||||||
onEmojiClick={this.onEmojiClick}
|
|
||||||
emojiSelectorOpen={emojiSelectorOpen}
|
|
||||||
toggleEmojiSelector={this.toggleEmojiSelector}
|
|
||||||
closeEmojiSelector={this.closeEmojiSelector}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<input type="submit" value="Send" id="submit" onClick={this.handleSubmit} />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
)}
|
}
|
||||||
}
|
</Transition>
|
||||||
</Transition>
|
{showDock && !roomId && <Dock handleToggleOpen={this.handleToggleOpen} />}
|
||||||
{showDock && !roomId && <Dock handleToggleOpen={this.handleToggleOpen} />}
|
{showDock && roomId && <Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />}
|
||||||
{showDock && roomId && <Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
@import "variables";
|
#safesupport {
|
||||||
@import "loader";
|
@import "variables";
|
||||||
@import "chat";
|
@import "loader";
|
||||||
@import "dark_mode";
|
@import "chat";
|
||||||
|
@import "dark_mode";
|
||||||
|
}
|
||||||
22
yarn.lock
22
yarn.lock
@@ -2634,9 +2634,9 @@ bser@2.1.1:
|
|||||||
node-int64 "^0.4.0"
|
node-int64 "^0.4.0"
|
||||||
|
|
||||||
buffer-from@^1.0.0:
|
buffer-from@^1.0.0:
|
||||||
version "1.1.1"
|
version "1.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
|
||||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
|
||||||
|
|
||||||
buffer-indexof@^1.0.0:
|
buffer-indexof@^1.0.0:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
@@ -9140,7 +9140,7 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2:
|
|||||||
source-map-url "^0.4.0"
|
source-map-url "^0.4.0"
|
||||||
urix "^0.1.0"
|
urix "^0.1.0"
|
||||||
|
|
||||||
source-map-support@0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12:
|
source-map-support@0.5.16:
|
||||||
version "0.5.16"
|
version "0.5.16"
|
||||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042"
|
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042"
|
||||||
integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==
|
integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==
|
||||||
@@ -9148,6 +9148,14 @@ source-map-support@0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12
|
|||||||
buffer-from "^1.0.0"
|
buffer-from "^1.0.0"
|
||||||
source-map "^0.6.0"
|
source-map "^0.6.0"
|
||||||
|
|
||||||
|
source-map-support@^0.5.6, source-map-support@~0.5.12:
|
||||||
|
version "0.5.21"
|
||||||
|
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
|
||||||
|
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
|
||||||
|
dependencies:
|
||||||
|
buffer-from "^1.0.0"
|
||||||
|
source-map "^0.6.0"
|
||||||
|
|
||||||
source-map-url@^0.4.0:
|
source-map-url@^0.4.0:
|
||||||
version "0.4.0"
|
version "0.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
|
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
|
||||||
@@ -9584,9 +9592,9 @@ terser-webpack-plugin@^1.4.3:
|
|||||||
worker-farm "^1.7.0"
|
worker-farm "^1.7.0"
|
||||||
|
|
||||||
terser@^4.1.2:
|
terser@^4.1.2:
|
||||||
version "4.6.3"
|
version "4.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.3.tgz#e33aa42461ced5238d352d2df2a67f21921f8d87"
|
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f"
|
||||||
integrity sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==
|
integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==
|
||||||
dependencies:
|
dependencies:
|
||||||
commander "^2.20.0"
|
commander "^2.20.0"
|
||||||
source-map "~0.6.1"
|
source-map "~0.6.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user