mirror of
https://github.com/nomadic-labs/safesupport-chatbox
synced 2025-12-16 07:23:23 +00:00
Compare commits
5 Commits
v1.1.3
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fa06b98d2 | ||
|
|
569a8e76c2 | ||
|
|
b76eebcacb | ||
|
|
c592253707 | ||
|
|
ebb06b3377 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "safesupport-chatbox",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.5",
|
||||
"description": "A secure and private embeddable chatbox that connects to Riot",
|
||||
"main": "dist/chatbox.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
width: 400px;
|
||||
max-width: calc(100vw - 10px);
|
||||
border-bottom: none;
|
||||
margin: 0;
|
||||
animation-duration: 0.2s;
|
||||
animation-fill-mode: forwards;
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
.message {
|
||||
&.from-bot {
|
||||
color: transparentize($light-text-color, 0.3);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
&.from-me {
|
||||
|
||||
@@ -599,103 +599,105 @@ class ChatBox extends React.Component {
|
||||
const inputLabel = 'Send a message...'
|
||||
|
||||
return (
|
||||
<div className="docked-widget" role="complementary">
|
||||
<Transition in={opened} timeout={250} onExited={this.handleWidgetExit} onEntered={this.handleWidgetEnter}>
|
||||
{(status) => {
|
||||
return (
|
||||
<div className={`widget widget-${status}`} aria-hidden={!opened}>
|
||||
<div id="safesupport-chatbox" aria-haspopup="dialog">
|
||||
<Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />
|
||||
<div id="safesupport">
|
||||
<div className="docked-widget" role="complementary">
|
||||
<Transition in={opened} timeout={250} onExited={this.handleWidgetExit} onEntered={this.handleWidgetEnter}>
|
||||
{(status) => {
|
||||
return (
|
||||
<div className={`widget widget-${status}`} aria-hidden={!opened}>
|
||||
<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="messages">
|
||||
<div className={`message from-bot`}>
|
||||
<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 className="message-window" ref={this.messageWindow}>
|
||||
<div className="messages">
|
||||
<div className={`message from-bot`}>
|
||||
<div className="text">{ this.props.introMessage }</div>
|
||||
</div>
|
||||
</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 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>
|
||||
}
|
||||
|
||||
{ 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>
|
||||
{`👉`}
|
||||
<button className="btn" id="accept" onClick={this.handleAcceptTerms}>YES</button>
|
||||
<button className="btn" id="reject" onClick={this.handleRejectTerms}>NO</button>
|
||||
</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 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>
|
||||
)}
|
||||
}
|
||||
</Transition>
|
||||
{showDock && !roomId && <Dock handleToggleOpen={this.handleToggleOpen} />}
|
||||
{showDock && roomId && <Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />}
|
||||
)}
|
||||
}
|
||||
</Transition>
|
||||
{showDock && !roomId && <Dock handleToggleOpen={this.handleToggleOpen} />}
|
||||
{showDock && roomId && <Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
@import "variables";
|
||||
@import "loader";
|
||||
@import "chat";
|
||||
@import "dark_mode";
|
||||
#safesupport {
|
||||
@import "variables";
|
||||
@import "loader";
|
||||
@import "chat";
|
||||
@import "dark_mode";
|
||||
}
|
||||
23
yarn.lock
23
yarn.lock
@@ -3403,7 +3403,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5:
|
||||
debug@^3.1.0, debug@^3.1.1, debug@^3.2.5:
|
||||
version "3.2.6"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
||||
@@ -4215,11 +4215,16 @@ etag@~1.8.1:
|
||||
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
|
||||
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
|
||||
|
||||
eventemitter3@4.0.0, eventemitter3@^4.0.0:
|
||||
eventemitter3@4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb"
|
||||
integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==
|
||||
|
||||
eventemitter3@^4.0.0:
|
||||
version "4.0.7"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
|
||||
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
|
||||
|
||||
events@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59"
|
||||
@@ -4616,11 +4621,9 @@ flush-write-stream@^1.0.0:
|
||||
readable-stream "^2.3.6"
|
||||
|
||||
follow-redirects@^1.0.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.10.0.tgz#01f5263aee921c6a54fb91667f08f4155ce169eb"
|
||||
integrity sha512-4eyLK6s6lH32nOvLLwlIOnr9zrL8Sm+OvW4pVTJNoXeGzYIkHVf+pADQi+OJ0E67hiuSLezPVPyBcIZO50TmmQ==
|
||||
dependencies:
|
||||
debug "^3.0.0"
|
||||
version "1.13.0"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
|
||||
integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==
|
||||
|
||||
for-in@^1.0.2:
|
||||
version "1.0.2"
|
||||
@@ -5179,9 +5182,9 @@ http-proxy-middleware@0.19.1, http-proxy-middleware@^0.19.0:
|
||||
micromatch "^3.1.10"
|
||||
|
||||
http-proxy@^1.17.0:
|
||||
version "1.18.0"
|
||||
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.0.tgz#dbe55f63e75a347db7f3d99974f2692a314a6a3a"
|
||||
integrity sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==
|
||||
version "1.18.1"
|
||||
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
|
||||
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
|
||||
dependencies:
|
||||
eventemitter3 "^4.0.0"
|
||||
follow-redirects "^1.0.0"
|
||||
|
||||
Reference in New Issue
Block a user