From d61eed7169c9438a0c348f849caf32d16c8cadbb Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Wed, 5 Jul 2023 15:19:20 +0530 Subject: [PATCH] Add more changes --- .../components/widgets/AIAssistanceButton.vue | 19 ++- .../components/widgets/AIAssistanceModal.vue | 109 +++++++----------- .../components/widgets/AIAssistanceReply.vue | 81 ++++++++----- 3 files changed, 110 insertions(+), 99 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue b/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue index d076e3805..887a7b2f9 100644 --- a/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue +++ b/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue @@ -80,13 +80,19 @@ :show.sync="showAIAssistanceModal" :on-close="hideAIAssistanceModal" > - + - + @@ -184,8 +190,8 @@ export default { ninja.open({ parent: 'ai_assist' }); }, onAIAssist() { - this.showAIAssistanceModal = true; - // this.showAIAssistanceReply = true; + // this.showAIAssistanceModal = true; + this.showAIAssistanceReply = true; }, toggleDropdown() { this.showDropdown = !this.showDropdown; @@ -202,6 +208,11 @@ export default { }); } }, + insertText(message) { + console.log('message', message); + + this.$emit('replace-text', message); + }, async processEvent(type = 'rephrase') { this.uiFlags[type] = true; try { diff --git a/app/javascript/dashboard/components/widgets/AIAssistanceModal.vue b/app/javascript/dashboard/components/widgets/AIAssistanceModal.vue index 419719ad7..fa6c482d0 100644 --- a/app/javascript/dashboard/components/widgets/AIAssistanceModal.vue +++ b/app/javascript/dashboard/components/widgets/AIAssistanceModal.vue @@ -16,22 +16,15 @@ AI generated content - -
- +
+
+ + +
+ + +
- - - @@ -70,6 +76,10 @@ export default { this.$emit('close'); }, chooseTime() {}, + applyContent() { + this.$emit('apply-text', this.generatedContent); + this.$emit('close'); + }, }, }; @@ -83,39 +93,56 @@ export default { width: 100%; } -.animation-container { - width: 100%; +.ai-typing--wrap { display: flex; align-items: center; - justify-content: center; -} -.loader { - width: 12px; - height: 12px; - border-radius: 50%; - display: block; - margin-top: 2rem; - position: relative; - color: #000; - box-sizing: border-box; - animation: animloader 2s linear infinite; + gap: 4px; + + .ai-typing--icon { + color: var(--v-500); + } } -@keyframes animloader { - 0% { - box-shadow: 14px 0 0 -2px, 38px 0 0 -2px, -14px 0 0 -2px, -38px 0 0 -2px; +.animation-container { + position: relative; + display: flex; +} + +.animation-container label { + display: inline-block; + margin-right: 8px; + color: var(--v-400); +} + +.loader { + display: inline-block; + width: 6px; + height: 6px; + margin-right: 4px; + margin-top: 12px; + background-color: var(--v-300); + border-radius: 50%; + animation: bubble-scale 1.2s infinite; +} + +.loader:nth-child(2) { + animation-delay: 0.4s; +} + +.loader:nth-child(3) { + animation-delay: 0.8s; +} + +@keyframes bubble-scale { + 0%, + 100% { + transform: scale(1); } 25% { - box-shadow: 14px 0 0 -2px, 38px 0 0 -2px, -14px 0 0 -2px, -38px 0 0 2px; + transform: scale(1.3); } 50% { - box-shadow: 14px 0 0 -2px, 38px 0 0 -2px, -14px 0 0 2px, -38px 0 0 -2px; - } - 75% { - box-shadow: 14px 0 0 2px, 38px 0 0 -2px, -14px 0 0 -2px, -38px 0 0 -2px; - } - 100% { - box-shadow: 14px 0 0 -2px, 38px 0 0 2px, -14px 0 0 -2px, -38px 0 0 -2px; + transform: scale(1); } }