Skip to content

Commit 0627a0f

Browse files
CodFrmCopilot
andauthored
✨ 卡片模式引导 (#894)
* wip: 卡片视图引导 * 卡片模式引导 * 翻译 * Update src/locales/en-US/translation.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent cca11e0 commit 0627a0f

File tree

12 files changed

+136
-37
lines changed

12 files changed

+136
-37
lines changed

src/locales/ach-UG/translation.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "crwdns8570:0crwdne8570:0",
385385
"guide_script_list_apply_to_run_status_title": "crwdns8572:0crwdne8572:0",
386386
"guide_script_list_apply_to_run_status_content": "crwdns8574:0crwdne8574:0",
387-
"guide_script_list_sort_title": "crwdns8576:0crwdne8576:0",
388-
"guide_script_list_sort_content": "crwdns8578:0crwdne8578:0",
387+
"guide_script_list_sort_title": "crwdns12858:0crwdne12858:0",
388+
"guide_script_list_sort_content": "crwdns12860:0crwdne12860:0",
389+
"guide_script_list_update_title": "crwdns12862:0crwdne12862:0",
390+
"guide_script_list_update_content": "crwdns12864:0crwdne12864:0",
391+
"guide_script_list_action_title": "crwdns12866:0crwdne12866:0",
392+
"guide_script_list_action_content": "crwdns12868:0crwdne12868:0",
389393
"guide_tools_title": "crwdns8580:0crwdne8580:0",
390394
"guide_tools_content": "crwdns8582:0crwdne8582:0",
391395
"guide_tools_backup_title": "crwdns8584:0crwdne8584:0",
@@ -533,5 +537,6 @@
533537
"script_sync_delete_desc": "crwdns12852:0{{scriptName}}crwdne12852:0",
534538
"subscribe_update": "crwdns12854:0{{subscribeName}}crwdne12854:0",
535539
"subscribe_update_desc": "crwdns12856:0{{newScripts}}crwdnd12856:0{{deletedScripts}}crwdne12856:0"
536-
}
540+
},
541+
"loading": "crwdns12870:0crwdne12870:0"
537542
}

src/locales/de-DE/translation.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "Skripte müssen aktiviert werden, um verwendet zu werden. Seitenskripte sind bei der Installation standardmäßig aktiviert, Hintergrundskripte sind bei der Installation standardmäßig deaktiviert",
385385
"guide_script_list_apply_to_run_status_title": "Anwenden auf und Ausführungsstatus",
386386
"guide_script_list_apply_to_run_status_content": "Zeigt den Ausführungsstatus von Skripten an. Bewegen Sie die Maus über das Tag, um den Skripttyp zu sehen",
387-
"guide_script_list_sort_title": "Sortierung/Letzte Aktualisierung/Operation",
388-
"guide_script_list_sort_content": "Sie können Skript-Tags durch Ziehen sortieren. Klicken Sie auf das Tag der letzten Aktualisierung, um eine Update-Überprüfung für das Skript durchzuführen. Die Operationsspalte ermöglicht Skript-Bearbeitung, Steuerung der Skript-Ausführung/Stopp (Hintergrundskripte), Einstellung von <Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>",
387+
"guide_script_list_sort_title": "Sortierung",
388+
"guide_script_list_sort_content": "Sie können die Skriptbezeichnungen per Drag & Drop sortieren.",
389+
"guide_script_list_update_title": "Zuletzt aktualisiert",
390+
"guide_script_list_update_content": "Durch Klicken auf die Spaltenüberschrift „Zuletzt aktualisiert“ wird geprüft, ob es Aktualisierungen des Skripts gibt.",
391+
"guide_script_list_action_title": "Aktion",
392+
"guide_script_list_action_content": "Die Bedienleiste ermöglicht den Zugriff auf die Skriptbearbeitung, die Steuerung der Skriptausführung und -beendigung (Hintergrundskripte) sowie auf die Einstellungen (siehe <Link href=\"https://docs.scriptcat.org/en/docs/dev/config/\">UserConfig</Link>). Über die Schaltflächen auf der rechten Seite können Sie auf erweiterte Filterfunktionen zugreifen und zwischen verschiedenen Ansichtsmodi wechseln.",
389393
"guide_tools_title": "Häufig verwendete Werkzeuge",
390394
"guide_tools_content": "Werkzeuge bieten Backup- und Entwicklungstools",
391395
"guide_tools_backup_title": "Backup",
@@ -533,5 +537,6 @@
533537
"script_sync_delete_desc": "Skript {{scriptName}} wurde gelöscht",
534538
"subscribe_update": "Abonnement {{subscribeName}} wurde aktualisiert",
535539
"subscribe_update_desc": "Neue Skripte: {{newScripts}}\nGelöschte Skripte: {{deletedScripts}}"
536-
}
540+
},
541+
"loading": "Wird geladen..."
537542
}

src/locales/en-US/translation.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"import_link": "Link Import",
33
"import_link_failure": "Link Import Failed",
4-
"create_user_script": "Create UserScript",
4+
"create_user_script": "Create User Script",
55
"create_background_script": "Create Background Script",
66
"create_scheduled_script": "Create Scheduled Script",
77
"import_by_local": "Local Import",
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "Scripts need to be enabled to be used. Page scripts are enabled by default upon installation, while background scripts are disabled by default.",
385385
"guide_script_list_apply_to_run_status_title": "Apply To and Run Status",
386386
"guide_script_list_apply_to_run_status_content": "The running status of scripts is displayed here. Hover over the tags to view the script type.",
387-
"guide_script_list_sort_title": "Sort/Last Update/Actions",
388-
"guide_script_list_sort_content": "You can drag the tags of scripts to sort them. Clicking on the \"Last Update\" column label will check for updates once. The \"Actions\" column allows you to enter script editing, control script running/stopping (for background scripts), and configure <Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>.",
387+
"guide_script_list_sort_title": "Sort",
388+
"guide_script_list_sort_content": "You can drag the tag of the script to sort",
389+
"guide_script_list_update_title": "Last Updated",
390+
"guide_script_list_update_content": "Click the last update column label to check for updates to the script",
391+
"guide_script_list_action_title": "Action",
392+
"guide_script_list_action_content": "The operation bar allows access to script editing, control script execution and termination (background scripts), and settings (see <Link href=\"https://docs.scriptcat.org/en/docs/dev/config/\">UserConfig</Link>). The buttons on the right allow access to advanced filtering and toggling view modes.",
389393
"guide_tools_title": "Common Tools",
390394
"guide_tools_content": "The tools provide backup and development features.",
391395
"guide_tools_backup_title": "Backup",

src/locales/ja-JP/translation.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "スクリプトは有効にしないと使用できません。ページスクリプトはインストール時にデフォルトで有効、バックグラウンドスクリプトはインストール時にデフォルトで無効です",
385385
"guide_script_list_apply_to_run_status_title": "適用先と実行状態",
386386
"guide_script_list_apply_to_run_status_content": "スクリプトの実行状態を表示します。タグにマウスを合わせるとスクリプトタイプを確認できます",
387-
"guide_script_list_sort_title": "ソート/最終更新/操作",
388-
"guide_script_list_sort_content": "スクリプトのタグをドラッグしてソートできます。最終更新列のタグをクリックしてスクリプトの更新チェックを実行できます。操作列からスクリプト編集、スクリプトの実行停止制御(バックグラウンドスクリプト)、<Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>の設定ができます",
387+
"guide_script_list_sort_title": "ソート",
388+
"guide_script_list_sort_content": "スクリプトをドラッグして順番を付ける事ができます。",
389+
"guide_script_list_update_title": "最終更新",
390+
"guide_script_list_update_content": "「最終更新」列ラベルをクリックすると、スクリプトの更新がチェックされます。",
391+
"guide_script_list_action_title": "アクション",
392+
"guide_script_list_action_content": "操作バーでは、スクリプトの編集、制御スクリプトの実行と終了(バックグラウンドスクリプト)、および設定(<Link href=\"https://docs.scriptcat.org/en/docs/dev/config/\">UserConfig</Link> を参照)にアクセスできます。右側のボタンからは、高度なフィルタリングや表示モードの切り替えにアクセスできます。",
389393
"guide_tools_title": "常用ツール",
390394
"guide_tools_content": "ツールにはバックアップと開発のツールが提供されています",
391395
"guide_tools_backup_title": "バックアップ",
@@ -533,5 +537,6 @@
533537
"script_sync_delete_desc": "スクリプト {{scriptName}} が削除されました",
534538
"subscribe_update": "サブスクリプション {{subscribeName}} が更新されました",
535539
"subscribe_update_desc": "新しいスクリプト: {{newScripts}}\n削除されたスクリプト: {{deletedScripts}}"
536-
}
540+
},
541+
"loading": "読み込み中..."
537542
}

src/locales/ru-RU/translation.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "Скрипты нужно включить для использования. Скрипты страниц включены по умолчанию при установке, фоновые скрипты выключены по умолчанию",
385385
"guide_script_list_apply_to_run_status_title": "Применить к и статус выполнения",
386386
"guide_script_list_apply_to_run_status_content": "Отображение статуса выполнения скрипта. Наведите курсор на тег, чтобы увидеть тип скрипта",
387-
"guide_script_list_sort_title": "Сортировка/Последнее обновление/Операции",
388-
"guide_script_list_sort_content": "Вы можете перетаскивать теги скриптов для сортировки. Щелкните по тегу колонки «Последнее обновление», чтобы проверить обновления скрипта. В колонке операций можно войти в редактирование скрипта, управлять запуском/остановкой скрипта (фоновые скрипты), настроить <Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>",
387+
"guide_script_list_sort_title": "Сортировка",
388+
"guide_script_list_sort_content": "Вы можете перетаскивать метки сценариев, чтобы сортировать их.",
389+
"guide_script_list_update_title": "Последнее обновление",
390+
"guide_script_list_update_content": "При нажатии на заголовок столбца «Последнее обновление» будет выполнена проверка наличия обновлений для скрипта.",
391+
"guide_script_list_action_title": "Действие",
392+
"guide_script_list_action_content": "Панель управления позволяет редактировать скрипты, управлять их выполнением и завершением (фоновые скрипты), а также настраивать параметры (см. <Link href=\"https://docs.scriptcat.org/en/docs/dev/config/\">UserConfig</Link>). Кнопки справа позволяют получить доступ к расширенной фильтрации и переключать режимы просмотра.",
389393
"guide_tools_title": "Часто используемые инструменты",
390394
"guide_tools_content": "В инструментах предоставлены функции резервного копирования и разработки",
391395
"guide_tools_backup_title": "Резервное копирование",
@@ -533,5 +537,6 @@
533537
"script_sync_delete_desc": "Скрипт {{scriptName}} был удален",
534538
"subscribe_update": "Подписка {{subscribeName}} была обновлена",
535539
"subscribe_update_desc": "Новые скрипты: {{newScripts}}\nУдаленные скрипты: {{deletedScripts}}"
536-
}
540+
},
541+
"loading": "Загрузка..."
537542
}

src/locales/vi-VN/translation.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "Script cần được bật để sử dụng. Script trang được bật theo mặc định khi cài đặt, trong khi script nền bị tắt theo mặc định.",
385385
"guide_script_list_apply_to_run_status_title": "Áp dụng cho và trạng thái chạy",
386386
"guide_script_list_apply_to_run_status_content": "Trạng thái chạy của script được hiển thị ở đây. Di chuột qua các thẻ để xem loại script.",
387-
"guide_script_list_sort_title": "Sắp xếp/cập nhật lần cuối/hành động",
388-
"guide_script_list_sort_content": "Bạn có thể kéo các thẻ của script để sắp xếp chúng. Nhấp vào nhãn cột \"cập nhật lần cuối\" sẽ kiểm tra cập nhật một lần. Cột \"hành động\" cho phép bạn vào chỉnh sửa script, kiểm soát việc chạy/dừng script (đối với script nền) và cấu hình <Link href=\"https://docs.scriptcat.org/docs/dev/config/\">userconfig</Link>.",
387+
"guide_script_list_sort_title": "Sắp xếp",
388+
"guide_script_list_sort_content": "Bạn có thể kéo nhãn tập lệnh để sắp xếp chúng.",
389+
"guide_script_list_update_title": "Cập nhật lần cuối",
390+
"guide_script_list_update_content": "Nhấp vào nhãn cột \"Cập nhật lần cuối\" sẽ thực hiện kiểm tra các bản cập nhật cho tập lệnh.",
391+
"guide_script_list_action_title": "Thao tác",
392+
"guide_script_list_action_content": "Thanh thao tác cho phép truy cập vào chức năng chỉnh sửa tập lệnh, kiểm soát việc thực thi và kết thúc tập lệnh (tập lệnh nền) và cài đặt (xem <Link href=\"https://docs.scriptcat.org/en/docs/dev/config/\">UserConfig</Link>). Các nút bên phải cho phép truy cập vào chức năng lọc nâng cao và chuyển đổi chế độ xem.",
389393
"guide_tools_title": "Công cụ chung",
390394
"guide_tools_content": "Các công cụ cung cấp tính năng sao lưu và phát triển.",
391395
"guide_tools_backup_title": "Sao lưu",
@@ -533,5 +537,6 @@
533537
"script_sync_delete_desc": "Script {{scriptName}} đã bị xóa",
534538
"subscribe_update": "Đăng ký {{subscribeName}} đã được cập nhật",
535539
"subscribe_update_desc": "Script mới: {{newScripts}}\nScript đã xóa: {{deletedScripts}}"
536-
}
540+
},
541+
"loading": "Đang tải..."
537542
}

src/locales/zh-CN/translation.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "脚本需要开启才能使用,页面脚本安装默认开启,后台脚本安装默认关闭",
385385
"guide_script_list_apply_to_run_status_title": "应用至、与运行状态",
386386
"guide_script_list_apply_to_run_status_content": "脚本运行状态展示,鼠标悬浮至标签可以查看脚本类型",
387-
"guide_script_list_sort_title": "排序/最后更新/操作",
388-
"guide_script_list_sort_content": "你可以拖动脚本的标签进行排序,点击最后更新列标签可以对脚本进行一次检查更新,操作列可以进入脚本编辑、控制脚本的运行停止(后台脚本)、设置<Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>",
387+
"guide_script_list_sort_title": "排序",
388+
"guide_script_list_sort_content": "你可以拖动脚本的标签进行排序",
389+
"guide_script_list_update_title": "最后更新",
390+
"guide_script_list_update_content": "点击最后更新列标签可以对脚本进行一次检查更新",
391+
"guide_script_list_action_title": "操作",
392+
"guide_script_list_action_content": "操作列可以进入脚本编辑、控制脚本的运行停止(后台脚本)、设置<Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>,操作右侧按钮可以打开高级筛选与切换视图模式",
389393
"guide_tools_title": "常用工具",
390394
"guide_tools_content": "工具中提供了备份和开发的工具",
391395
"guide_tools_backup_title": "备份",

src/locales/zh-TW/translation.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@
384384
"guide_script_list_enable_content": "腳本需要開啟才能使用,頁面腳本安裝預設開啟,背景腳本安裝預設關閉",
385385
"guide_script_list_apply_to_run_status_title": "應用至、與執行狀態",
386386
"guide_script_list_apply_to_run_status_content": "腳本執行狀態展示,滑鼠懸停至標籤可以查看腳本類型",
387-
"guide_script_list_sort_title": "排序/最近更新/操作",
388-
"guide_script_list_sort_content": "您可以拖動腳本的標籤進行排序,點選最近更新欄位標籤可以對腳本進行一次檢查更新,操作欄可以進入腳本編輯、控制腳本的執行停止(背景腳本)、設定<Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>",
387+
"guide_script_list_sort_title": "排序",
388+
"guide_script_list_sort_content": "你可以拖曳腳本的標籤進行排序",
389+
"guide_script_list_update_title": "最後更新",
390+
"guide_script_list_update_content": "點擊最後更新列標籤可以對腳本進行一次檢查更新",
391+
"guide_script_list_action_title": "操作",
392+
"guide_script_list_action_content": "操作列可以進入腳本編輯、控制腳本的運行停止(後台腳本)、設定<Link href=\"https://docs.scriptcat.org/docs/dev/config/\">UserConfig</Link>,操作右側按鈕可開啟進階篩選與切換視圖模式",
389393
"guide_tools_title": "常用工具",
390394
"guide_tools_content": "工具中提供了備份和開發的工具",
391395
"guide_tools_backup_title": "備份",
@@ -533,5 +537,6 @@
533537
"script_sync_delete_desc": "腳本 {{scriptName}} 已被刪除",
534538
"subscribe_update": "訂閱 {{subscribeName}} 已更新",
535539
"subscribe_update_desc": "新增腳本:{{newScripts}}\n刪除腳本:{{deletedScripts}}"
536-
}
540+
},
541+
"loading": "加載中..."
537542
}

src/pages/components/layout/SiderGuide.tsx

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Joyride from "react-joyride";
55
import type { Path } from "react-router-dom";
66
import { useLocation, useNavigate } from "react-router-dom";
77
import CustomTrans from "../CustomTrans";
8+
import { useAppContext } from "@App/pages/store/AppContext";
89

910
const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> = (_props, ref) => {
1011
const { t } = useTranslation();
@@ -13,8 +14,12 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
1314
const [run, setRun] = useState(false);
1415
const navigate = useNavigate();
1516
const location = useLocation();
17+
const { setGuideMode } = useAppContext();
1618
useImperativeHandle(ref, () => ({
17-
open: () => setRun(true),
19+
open: () => {
20+
setRun(true);
21+
setGuideMode(true);
22+
},
1823
}));
1924
useEffect(() => {
2025
// 首次使用时,打开引导
@@ -45,6 +50,9 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
4550
title: t("guide_script_list_title"),
4651
placement: "auto",
4752
},
53+
];
54+
55+
steps.push(
4856
{
4957
content: t("guide_script_list_enable_content"),
5058
target: ".script-enable",
@@ -58,8 +66,21 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
5866
{
5967
target: ".script-sort",
6068
title: t("guide_script_list_sort_title"),
61-
content: <CustomTrans i18nKey="guide_script_list_sort_content" />,
69+
content: t("guide_script_list_sort_content"),
70+
},
71+
{
72+
target: ".script-updatetime",
73+
title: t("guide_script_list_update_title"),
74+
content: <CustomTrans i18nKey="guide_script_list_update_content" />,
6275
},
76+
{
77+
target: ".script-action",
78+
title: t("guide_script_list_action_title"),
79+
content: <CustomTrans i18nKey="guide_script_list_action_content" />,
80+
}
81+
);
82+
83+
steps.push(
6384
{
6485
target: ".menu-tools",
6586
title: t("guide_tools_title"),
@@ -81,8 +102,8 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
81102
target: ".setting .sync",
82103
title: t("guide_setting_sync_title"),
83104
content: t("guide_setting_sync_content"),
84-
},
85-
];
105+
}
106+
);
86107

87108
const gotoNavigate = (go: Partial<Path>) => {
88109
if (go.pathname !== location.pathname) {
@@ -101,15 +122,16 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
101122
<Joyride
102123
callback={(data) => {
103124
if (data.action === "stop" || data.action === "close" || data.status === "finished") {
125+
setGuideMode(false);
104126
setRun(false);
105127
setStepIndex(0);
106128
gotoNavigate(initRoute);
107129
} else if (data.action === "next" && data.lifecycle === "complete") {
108130
switch (data.index) {
109-
case 5:
131+
case 7:
110132
gotoNavigate({ pathname: "/tools" });
111133
break;
112-
case 7:
134+
case 9:
113135
gotoNavigate({ pathname: "/setting" });
114136
break;
115137
default:

0 commit comments

Comments
 (0)