diff --git a/README.md b/README.md index ff03436..be2559c 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,9 @@ This will start a development server and watch for changes in the source files. | Chrome | ✅ | ✅ | ✅ | | Brave | ✅ | ✅ | ✅ | | Firefox | ✅ | ✅ | ✅ | +| Vivaldi | ✅ | ✅ | ✅ | | Edge | ✅ | ❌ | ✅ | -| Opera GX | ❌ | ❌ | ✅ | +| Opera | ❌ | ❌ | ✅ | | Arc | ❌ | ❌ | ✅ | ## Local AI Provider @@ -134,6 +135,13 @@ This will start a development server and watch for changes in the source files. - [ ] More Customization Options - [ ] Better UI/UX + +## Privacy + +Page Assist does not collect any personal data. The only time the extension communicates with the server is when you are using the share feature, which can be disabled from the settings. + +All the data is stored locally in the browser storage. You can view the source code and verify it yourself. + ## Contributing Contributions are welcome. If you have any feature requests, bug reports, or questions, feel free to create an issue. @@ -146,6 +154,17 @@ If you like the project and want to support it, you can buy me a coffee. It will or you can sponsor me on GitHub. + +## Blogs and Videos About Page Assist + +This are some of the blogs and videos about Page Assist. If you have written a blog or made a video about Page Assist, feel free to create a PR and add it here. + +- [OllamaをChromeAddonのPage Assistで簡単操作](https://note.com/lucas_san/n/nf00d01a02c3a) by [LucasChatGPT](https://twitter.com/LucasChatGPT) + +- [This Chrome Extension Surprised Me](https://www.youtube.com/watch?v=IvLTlDy9G8c) by [Matt Williams](https://www.youtube.com/@technovangelist) + +- [Ollama With 1 Click](https://www.youtube.com/watch?v=61uN5jtj2wo) by [Yaron Been From EcomXFactor](https://www.youtube.com/@ecomxfactor-YaronBeen) + ## License MIT diff --git a/src/assets/locale/en/settings.json b/src/assets/locale/en/settings.json index acfcfa5..de86d3d 100644 --- a/src/assets/locale/en/settings.json +++ b/src/assets/locale/en/settings.json @@ -195,7 +195,7 @@ "delete": "Are you sure you want to delete this share? This action cannot be undone." }, "label": "Manage Page Share", - "description": "Enable or disable the page share feature. By default, the page share feature is enabled." + "description": "Enable or disable the page share feature" }, "notification": { "pageShareSuccess": "Page Share URL updated successfully", diff --git a/src/assets/locale/ja-JP/settings.json b/src/assets/locale/ja-JP/settings.json index 8fd2860..c519a71 100644 --- a/src/assets/locale/ja-JP/settings.json +++ b/src/assets/locale/ja-JP/settings.json @@ -198,7 +198,7 @@ "delete": "本当にこの共有を削除しますか?この操作は元に戻せません。" }, "label": "ページ共有を管理する", - "description": "ページ共有機能を有効または無効にします。デフォルトでは、ページ共有機能は有効になっています。" + "description": "ページ共有機能を有効または無効にする" }, "notification": { "pageShareSuccess": "ページ共有URLが正常に更新されました", diff --git a/src/assets/locale/ml/settings.json b/src/assets/locale/ml/settings.json index b3384c7..937b1e3 100644 --- a/src/assets/locale/ml/settings.json +++ b/src/assets/locale/ml/settings.json @@ -198,7 +198,7 @@ "delete": "ഈ പങ്കിടല്‍ ഇല്ലാതാക്കണമെന്ന് തീർച്ചയാണോ? ഈ പ്രവർത്തനം പിന്നീട് പിൻവലിക്കാനാകില്ല." }, "label": "പേജ് ഷെയർ നിയന്ത്രിക്കുക", - "description": "പേജ് ഷെയർ സവിശേഷത സജീവമാക്കുകയോ അക്ഷമമാക്കുകയോ ചെയ്യുക. സ്ഥിരംമായി, പേജ് ഷെയർ സവിശേഷത സജീവമാക്കപ്പെടുന്നു." + "description": "പേജ് ഷെയർ സാങ്കേതികത സജ്ജീകരിക്കുക അല്ലെങ്കിൽ നിലവിളിക്കുക ." }, "notification": { "pageShareSuccess": "പേജ് പങ്കിടാനുള്ള URL വിജയകരമായി അപ്ഡേറ്റ് ചെയ്തു", diff --git a/src/assets/locale/ru/settings.json b/src/assets/locale/ru/settings.json index 51fa44e..913025f 100644 --- a/src/assets/locale/ru/settings.json +++ b/src/assets/locale/ru/settings.json @@ -195,7 +195,7 @@ "delete": "Вы уверены, что хотите удалить этот обмен? Это действие нельзя отменить." }, "label": "Управление общим доступом к странице", - "description": "Включите или отключите функцию общего доступа к странице. По умолчанию функция общего доступа к странице включена." + "description": "Включить или отключить функцию обмена страницей" }, "notification": { "pageShareSuccess": "URL обмена страницей успешно обновлен", diff --git a/src/assets/locale/zh/settings.json b/src/assets/locale/zh/settings.json index 883ae22..2cf06de 100644 --- a/src/assets/locale/zh/settings.json +++ b/src/assets/locale/zh/settings.json @@ -199,7 +199,7 @@ "delete": "您确定要删除此对话共享吗?这个操作不能撤销。" }, "label": "管理页面分享", - "description": "启用或禁用页面分享功能。默认情况下,页面分享功能已启用。" + "description": "启用或禁用页面分享功能 " }, "notification": { "pageShareSuccess": "对话共享服务 URL 已成功更新", diff --git a/src/components/Common/PromptSelect.tsx b/src/components/Common/PromptSelect.tsx new file mode 100644 index 0000000..fadd8c0 --- /dev/null +++ b/src/components/Common/PromptSelect.tsx @@ -0,0 +1,90 @@ +import { useQuery } from "@tanstack/react-query" +import { Dropdown, Empty, Tooltip } from "antd" +import { BookIcon, ComputerIcon, ZapIcon } from "lucide-react" +import React from "react" +import { useTranslation } from "react-i18next" +import { getAllPrompts } from "@/db" +import { useMessageOption } from "@/hooks/useMessageOption" + +export const PromptSelect: React.FC = () => { + const { t } = useTranslation("option") + const { + selectedSystemPrompt, + setSelectedQuickPrompt, + setSelectedSystemPrompt + } = useMessageOption() + + const { data } = useQuery({ + queryKey: ["getAllPromptsForSelect"], + queryFn: getAllPrompts + }) + const handlePromptChange = (value?: string) => { + if (!value) { + setSelectedSystemPrompt(undefined) + setSelectedQuickPrompt(undefined) + return + } + const prompt = data?.find((prompt) => prompt.id === value) + if (prompt?.is_system) { + setSelectedSystemPrompt(prompt.id) + } else { + setSelectedSystemPrompt(undefined) + setSelectedQuickPrompt(prompt!.content) + } + } + return ( + <> + {data && ( + 0 + ? data?.map((prompt) => ({ + key: prompt.id, + label: ( +
+ + {prompt.is_system ? ( + + ) : ( + + )} + {prompt.title} + +
+ ), + onClick: () => { + if (selectedSystemPrompt === prompt.id) { + setSelectedSystemPrompt(undefined) + } else { + handlePromptChange(prompt.id) + } + } + })) + : [ + { + key: "empty", + label: + } + ], + style: { + maxHeight: 500, + overflowY: "scroll" + }, + className: "no-scrollbar", + activeKey: selectedSystemPrompt + }} + placement={"topLeft"} + trigger={["click"]}> + + + +
+ )} + + ) +} diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index 03916be..2156710 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -12,6 +12,7 @@ import { ComputerIcon, GithubIcon, PanelLeftIcon, + SlashIcon, SquarePen, ZapIcon } from "lucide-react" @@ -21,6 +22,8 @@ import { useTranslation } from "react-i18next" import { OllamaIcon } from "../Icons/Ollama" import { SelectedKnowledge } from "../Option/Knowledge/SelectedKnwledge" import { useStorage } from "@plasmohq/storage/hook" +import { ModelSelect } from "../Common/ModelSelect" +import { PromptSelect } from "../Common/PromptSelect" export default function OptionLayout({ children @@ -29,7 +32,7 @@ export default function OptionLayout({ }) { const [sidebarOpen, setSidebarOpen] = useState(false) const { t } = useTranslation(["option", "common"]) - const [shareModeEnabled] = useStorage("shareMode", true) + const [shareModeEnabled] = useStorage("shareMode", false) const { selectedModel, @@ -89,7 +92,7 @@ export default function OptionLayout({ - + )} @@ -103,15 +106,17 @@ export default function OptionLayout({
{"/"} -
+
+
+ +
@@ -190,7 +201,7 @@ export default function OptionLayout({ + className="!text-gray-500 hidden lg:block dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"> diff --git a/src/components/Option/Knowledge/SelectedKnwledge.tsx b/src/components/Option/Knowledge/SelectedKnwledge.tsx index b7eaa2d..066c91f 100644 --- a/src/components/Option/Knowledge/SelectedKnwledge.tsx +++ b/src/components/Option/Knowledge/SelectedKnwledge.tsx @@ -1,5 +1,6 @@ import { Blocks, XIcon } from "lucide-react" import { useMessageOption } from "@/hooks/useMessageOption" +import { Tooltip } from "antd" export const SelectedKnowledge = () => { const { selectedKnowledge: knowledge, setSelectedKnowledge } = @@ -8,17 +9,21 @@ export const SelectedKnowledge = () => { if (!knowledge) return <> return ( -
+
{"/"} -
-
- - +
+ +
+ + {knowledge.title}
+