diff --git a/app/javascript/widget/assets/scss/views/_conversation.scss b/app/javascript/widget/assets/scss/views/_conversation.scss new file mode 100644 index 000000000..609752f96 --- /dev/null +++ b/app/javascript/widget/assets/scss/views/_conversation.scss @@ -0,0 +1,236 @@ +.file-uploads .attachment-button + label { + cursor: pointer; +} + +.conversation-wrap { + .agent-message { + align-items: flex-end; + display: flex; + flex-direction: row; + justify-content: flex-start; + margin: 0 0 $space-micro $space-small; + max-width: 88%; + + .avatar-wrap { + flex-shrink: 0; + height: $space-medium; + width: $space-medium; + + .user-thumbnail-box { + margin-top: -$space-large; + } + } + + .message-wrap { + flex-grow: 1; + flex-shrink: 0; + margin-left: $space-small; + max-width: 90%; + } + } + + &.is-typing .messages-wrap div:last-child { + .agent-message { + .agent-name { + display: none; + } + + .user-thumbnail-box { + margin-top: 0; + } + } + } + + .agent-name { + color: $color-body; + font-size: $font-size-small; + font-weight: $font-weight-medium; + margin: $space-small 0; + padding-left: $space-micro; + } + + .has-attachment { + overflow: hidden; + padding: 0; + + &.has-text { + margin-top: $space-smaller; + } + } + + .agent-message-wrap { + + .agent-message-wrap { + margin-top: $space-micro; + + .agent-message .chat-bubble { + border-top-left-radius: $space-smaller; + } + } + + + .user-message-wrap { + margin-top: $space-normal; + } + + &.has-response + .user-message-wrap { + margin-top: $space-micro; + + .chat-bubble { + border-top-right-radius: $space-smaller; + } + } + + &.has-response + .agent-message-wrap { + margin-top: $space-normal; + } + } + + .user-message { + align-items: flex-end; + display: flex; + flex-direction: row; + justify-content: flex-end; + margin: 0 $space-smaller $space-micro auto; + max-width: 85%; + text-align: right; + + .message-wrap { + margin-right: $space-small; + max-width: 100%; + } + + .in-progress { + opacity: 0.6; + } + } + + + .user.has-attachment { + .icon-wrap { + color: $color-white; + } + + .download { + color: $color-white; + } + } + + .user-message-wrap { + + .user-message-wrap { + margin-top: $space-micro; + + .user-message .chat-bubble { + border-top-right-radius: $space-smaller; + } + } + + + .agent-message-wrap { + margin-top: $space-normal; + } + } + + p:not(:last-child) { + margin-bottom: $space-normal; + } +} + + +.unread-messages { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + margin-top: 0; + overflow-y: auto; + padding-bottom: $space-small; + width: 100%; + + .chat-bubble-wrap { + margin-bottom: $space-smaller; + + &:first-child { + margin-top: auto; + } + + .chat-bubble { + border: 1px solid $color-border-dark; + } + + + .chat-bubble-wrap { + .chat-bubble { + border-top-left-radius: $space-smaller; + } + } + + &:last-child .chat-bubble { + border-bottom-left-radius: $space-two; + } + } +} + +.is-widget-right .unread-wrap { + overflow: hidden; + text-align: right; + + .chat-bubble-wrap { + .chat-bubble { + border-bottom-right-radius: $space-smaller; + border-radius: $space-two; + } + + + .chat-bubble-wrap { + .chat-bubble { + border-top-right-radius: $space-smaller; + } + } + + &:last-child .chat-bubble { + border-bottom-right-radius: $space-two; + } + } + + .close-unread-wrap { + text-align: right; + } +} + + +.chat-bubble { + @include light-shadow; + background: $color-woot; + border-radius: $space-two; + color: $color-white; + display: inline-block; + font-size: $font-size-default; + line-height: 1.5; + max-width: 100%; + padding: $space-slab $space-normal; + text-align: left; + word-break: break-word; + + > a { + color: $color-primary; + word-break: break-all; + } + + .link { + text-decoration: underline; + } + + &.user { + border-bottom-right-radius: $space-smaller; + + > a { + color: $color-white; + } + } + + &.agent { + background: $color-white; + border-bottom-left-radius: $space-smaller; + color: $color-body; + + .link { + color: $color-woot; + word-break: break-word; + } + } +} diff --git a/app/javascript/widget/assets/scss/woot.scss b/app/javascript/widget/assets/scss/woot.scss index 5d8a44fdf..90948ddaa 100755 --- a/app/javascript/widget/assets/scss/woot.scss +++ b/app/javascript/widget/assets/scss/woot.scss @@ -9,6 +9,7 @@ @import 'utilities'; @import 'shared/assets/fonts/widget_fonts'; @import '~spinkit/scss/spinners/7-three-bounce'; +@import 'views/conversation'; html, body { diff --git a/app/javascript/widget/components/AgentMessage.vue b/app/javascript/widget/components/AgentMessage.vue index 4366dcc2e..e137e9940 100755 --- a/app/javascript/widget/components/AgentMessage.vue +++ b/app/javascript/widget/components/AgentMessage.vue @@ -145,8 +145,9 @@ export default { if (this.messageContentAttributes.submitted_values) { if (this.contentType === 'input_select') { - const [selectionOption = {}] = - this.messageContentAttributes.submitted_values; + const [ + selectionOption = {}, + ] = this.messageContentAttributes.submitted_values; return { content: selectionOption.title || selectionOption.value }; } } @@ -171,78 +172,3 @@ export default { }, }; - - - diff --git a/app/javascript/widget/components/AgentMessageBubble.vue b/app/javascript/widget/components/AgentMessageBubble.vue index 2aec14e05..467b99b47 100755 --- a/app/javascript/widget/components/AgentMessageBubble.vue +++ b/app/javascript/widget/components/AgentMessageBubble.vue @@ -129,22 +129,6 @@ export default { }; - diff --git a/app/javascript/widget/components/ConversationWrap.vue b/app/javascript/widget/components/ConversationWrap.vue index d51380837..828f37e22 100755 --- a/app/javascript/widget/components/ConversationWrap.vue +++ b/app/javascript/widget/components/ConversationWrap.vue @@ -120,15 +120,3 @@ export default { text-align: center; } - diff --git a/app/javascript/widget/components/UserMessage.vue b/app/javascript/widget/components/UserMessage.vue index 640ac4608..b02e8caff 100755 --- a/app/javascript/widget/components/UserMessage.vue +++ b/app/javascript/widget/components/UserMessage.vue @@ -74,61 +74,3 @@ export default { }, }; - - - diff --git a/app/javascript/widget/components/UserMessageBubble.vue b/app/javascript/widget/components/UserMessageBubble.vue index 8b47ac9c1..073766545 100755 --- a/app/javascript/widget/components/UserMessageBubble.vue +++ b/app/javascript/widget/components/UserMessageBubble.vue @@ -29,41 +29,6 @@ export default { }; - - -