From 9e578c2c23c2f429c622da495bfc07af8f7997f5 Mon Sep 17 00:00:00 2001 From: DingChil Date: Thu, 2 Nov 2023 16:45:17 +0800 Subject: [PATCH] refactor: modify interaction logic of the prompt editing box Signed-off-by: DingChil --- assets/locales/en/messages.json | 3 +++ assets/locales/zh_CN/messages.json | 3 +++ scripts/i18n/gettextOutput/messages.pot | 20 +++++++++------- scripts/i18n/gettextOutput/translations.json | 1 + src/components/FloatControlButtons.vue | 25 ++------------------ src/components/PromptEditor.vue | 15 ++++++------ src/csui/Index/ThePopupBox/ThePopupBox.vue | 2 ++ 7 files changed, 31 insertions(+), 38 deletions(-) diff --git a/assets/locales/en/messages.json b/assets/locales/en/messages.json index 847b222..511d3fc 100644 --- a/assets/locales/en/messages.json +++ b/assets/locales/en/messages.json @@ -122,6 +122,9 @@ "SEO": { "message": "SEO" }, + "Set_a_prompt_here": { + "message": "Set a prompt here" + }, "Set_up_API": { "message": "Set up API" }, diff --git a/assets/locales/zh_CN/messages.json b/assets/locales/zh_CN/messages.json index c213310..ab36c72 100644 --- a/assets/locales/zh_CN/messages.json +++ b/assets/locales/zh_CN/messages.json @@ -122,6 +122,9 @@ "SEO": { "message": "SEO" }, + "Set_a_prompt_here": { + "message": "提词写这里" + }, "Set_up_API": { "message": "设置 API" }, diff --git a/scripts/i18n/gettextOutput/messages.pot b/scripts/i18n/gettextOutput/messages.pot index b859523..5a050c0 100644 --- a/scripts/i18n/gettextOutput/messages.pot +++ b/scripts/i18n/gettextOutput/messages.pot @@ -41,8 +41,8 @@ msgstr "" msgid "Ask a question about this webpage" msgstr "" -#: src/components/FloatControlButtons.vue:20 -#: src/components/FloatControlButtons.vue:21 +#: src/components/FloatControlButtons.vue:14 +#: src/components/FloatControlButtons.vue:15 #: src/components/PromptMenu.vue:19 #: src/components/PromptMenu.vue:20 #: src/components/PromptMenu.vue:29 @@ -75,8 +75,8 @@ msgstr "" msgid "Click" msgstr "" -#: src/components/FloatControlButtons.vue:10 -#: src/components/FloatControlButtons.vue:9 +#: src/components/FloatControlButtons.vue:6 +#: src/components/FloatControlButtons.vue:7 #: src/components/PromptMenu.vue:19 #: src/components/PromptMenu.vue:20 #: src/components/PromptMenu.vue:29 @@ -89,8 +89,8 @@ msgstr "" msgid "Confirm" msgstr "" -#: src/components/FloatControlButtons.vue:42 -#: src/components/FloatControlButtons.vue:43 +#: src/components/FloatControlButtons.vue:30 +#: src/components/FloatControlButtons.vue:31 msgid "Copy" msgstr "" @@ -220,13 +220,17 @@ msgstr "" msgid "SEO" msgstr "" +#: src/components/PromptEditor.vue:15 +msgid "Set a prompt here" +msgstr "" + #: src/tabs/components/StepTwo.vue:2 #: src/tabs/components/StepTwo.vue:3 msgid "Set up API" msgstr "" -#: src/components/FloatControlButtons.vue:31 -#: src/components/FloatControlButtons.vue:32 +#: src/components/FloatControlButtons.vue:22 +#: src/components/FloatControlButtons.vue:23 msgid "Settings" msgstr "" diff --git a/scripts/i18n/gettextOutput/translations.json b/scripts/i18n/gettextOutput/translations.json index 0631ae0..ece18c7 100644 --- a/scripts/i18n/gettextOutput/translations.json +++ b/scripts/i18n/gettextOutput/translations.json @@ -40,6 +40,7 @@ "Save Changes": "Save Changes", "Select text, and press ": "Select text, and press ", "SEO": "SEO", + "Set a prompt here": "Set a prompt here", "Set up API": "Set up API", "Settings": "Settings", "Setup your own API key, to enjoy more": "Setup your own API key, to enjoy more", diff --git a/src/components/FloatControlButtons.vue b/src/components/FloatControlButtons.vue index 4e221d1..40419b0 100644 --- a/src/components/FloatControlButtons.vue +++ b/src/components/FloatControlButtons.vue @@ -3,9 +3,6 @@
  • - @@ -14,9 +11,6 @@
  • - @@ -25,9 +19,6 @@
  • - @@ -36,9 +27,6 @@
  • - @@ -97,7 +85,7 @@ const handleCopy = () => { position: absolute; top: 8px; right: -44px; - margin: 0 !important; + margin: 0; padding: 0; } @@ -106,11 +94,7 @@ const handleCopy = () => { list-style: none; .btn { - box-sizing: content-box !important; - - // display: flex; - // width: 36px; - // height: 36px; + box-sizing: content-box; width: 24px; height: 24px; padding: 6px; @@ -121,11 +105,6 @@ const handleCopy = () => { } } -// .ico { -// flex: 1; -// filter: brightness(var(--webpilot-theme-brightness-number)); -// } - .popover { padding: 4px 8px; color: #fff; diff --git a/src/components/PromptEditor.vue b/src/components/PromptEditor.vue index e0ca8d5..77d2326 100644 --- a/src/components/PromptEditor.vue +++ b/src/components/PromptEditor.vue @@ -7,7 +7,7 @@ :class="$style.content__send" @click="handleSendCommand" /> --> - +