From 78d8767124dc998f1d73c0df11740b2ce435a743 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Tue, 17 Oct 2023 01:57:20 +0000 Subject: [PATCH] feat: :sparkles: allow users to choose icon set Co-authored-by: naskya --- locales/en-US.yml | 7 ++ locales/ja-JP.yml | 7 ++ packages/client/package.json | 1 + packages/client/src/account.ts | 9 ++- .../src/components/MkAbuseReportWindow.vue | 3 +- .../src/components/MkChannelFollowButton.vue | 7 +- .../src/components/MkChannelPreview.vue | 8 +- .../client/src/components/MkContainer.vue | 10 ++- .../client/src/components/MkContextMenu.vue | 3 +- .../src/components/MkDateSeparatedList.vue | 5 +- packages/client/src/components/MkDialog.vue | 37 ++++----- packages/client/src/components/MkDonation.vue | 5 +- .../client/src/components/MkDrive.file.vue | 15 ++-- .../client/src/components/MkDrive.folder.vue | 11 +-- .../src/components/MkDrive.navFolder.vue | 3 +- packages/client/src/components/MkDrive.vue | 17 ++-- .../src/components/MkDriveFileThumbnail.vue | 31 +++----- .../src/components/MkEmojiPicker.section.vue | 7 +- .../client/src/components/MkEmojiPicker.vue | 11 +-- .../client/src/components/MkFileTypeIcon.vue | 3 +- packages/client/src/components/MkFolder.vue | 8 +- .../client/src/components/MkFollowButton.vue | 17 ++-- packages/client/src/components/MkGoogle.vue | 3 +- packages/client/src/components/MkInfo.vue | 11 +-- packages/client/src/components/MkKeyValue.vue | 4 +- .../client/src/components/MkLaunchPad.vue | 4 +- packages/client/src/components/MkLink.vue | 5 +- packages/client/src/components/MkMedia.vue | 7 +- .../client/src/components/MkMediaBanner.vue | 5 +- packages/client/src/components/MkMention.vue | 3 +- packages/client/src/components/MkMenu.vue | 24 +++--- .../client/src/components/MkModPlayer.vue | 26 +++---- .../src/components/MkModalPageWindow.vue | 16 ++-- .../client/src/components/MkModalWindow.vue | 7 +- packages/client/src/components/MkMoved.vue | 6 +- packages/client/src/components/MkNote.vue | 38 ++++----- .../client/src/components/MkNoteDetailed.vue | 11 +-- .../client/src/components/MkNoteHeader.vue | 3 +- packages/client/src/components/MkNoteSub.vue | 24 +++--- .../client/src/components/MkNotification.vue | 31 ++++---- .../src/components/MkNotificationToast.vue | 3 +- .../client/src/components/MkPageWindow.vue | 13 ++-- .../client/src/components/MkPagination.vue | 9 ++- packages/client/src/components/MkPoll.vue | 3 +- .../client/src/components/MkPollEditor.vue | 5 +- packages/client/src/components/MkPostForm.vue | 51 ++++++------ .../src/components/MkPostFormAttaches.vue | 16 ++-- .../client/src/components/MkQuoteButton.vue | 6 +- .../client/src/components/MkRenoteButton.vue | 19 ++--- packages/client/src/components/MkSignin.vue | 7 +- packages/client/src/components/MkSignup.vue | 63 +++++++-------- .../client/src/components/MkStarButton.vue | 7 +- .../src/components/MkStarButtonNoEmoji.vue | 17 ++-- .../src/components/MkSubNoteContent.vue | 15 ++-- packages/client/src/components/MkTimeline.vue | 7 +- packages/client/src/components/MkToast.vue | 3 +- packages/client/src/components/MkTooltip.vue | 3 +- .../src/components/MkTutorialDialog.vue | 31 ++++---- .../client/src/components/MkUrlPreview.vue | 9 ++- .../src/components/MkUrlPreviewPopup.vue | 3 +- .../client/src/components/MkUserPreview.vue | 3 +- .../client/src/components/MkVisibility.vue | 13 ++-- .../src/components/MkVisibilityPicker.vue | 20 +++-- .../client/src/components/MkWaitingDialog.vue | 2 +- packages/client/src/components/MkWidgets.vue | 9 ++- packages/client/src/components/MkWindow.vue | 10 ++- .../client/src/components/form/checkbox.vue | 2 +- .../client/src/components/form/folder.vue | 6 +- packages/client/src/components/form/input.vue | 3 +- packages/client/src/components/form/link.vue | 8 +- .../client/src/components/form/select.vue | 5 +- .../client/src/components/form/suspense.vue | 11 ++- .../client/src/components/form/textarea.vue | 6 +- packages/client/src/components/global/MkA.vue | 9 ++- .../client/src/components/global/MkAcct.vue | 3 +- .../client/src/components/global/MkAd.vue | 3 +- .../client/src/components/global/MkAvatar.vue | 10 ++- .../client/src/components/global/MkError.vue | 6 +- .../src/components/global/MkPageHeader.vue | 3 +- .../client/src/components/global/MkUrl.vue | 3 +- .../client/src/components/page/page.post.vue | 9 ++- packages/client/src/init.ts | 10 +-- packages/client/src/navbar.ts | 37 ++++----- packages/client/src/pages/_error_.vue | 10 ++- packages/client/src/pages/about-firefish.vue | 7 +- packages/client/src/pages/about.emojis.vue | 3 +- .../client/src/pages/about.federation.vue | 3 +- packages/client/src/pages/about.vue | 13 ++-- packages/client/src/pages/admin-file.vue | 13 ++-- packages/client/src/pages/admin/abuses.vue | 3 +- .../client/src/pages/admin/announcements.vue | 11 ++- .../client/src/pages/admin/bot-protection.vue | 11 +-- .../client/src/pages/admin/custom-css.vue | 3 +- packages/client/src/pages/admin/database.vue | 3 +- .../client/src/pages/admin/email-settings.vue | 7 +- .../src/pages/admin/emoji-edit-dialog.vue | 3 +- packages/client/src/pages/admin/emojis.vue | 27 +++---- .../client/src/pages/admin/experiments.vue | 5 +- .../client/src/pages/admin/federation.vue | 3 +- packages/client/src/pages/admin/files.vue | 7 +- packages/client/src/pages/admin/hashtags.vue | 5 +- packages/client/src/pages/admin/index.vue | 55 ++++++------- .../client/src/pages/admin/instance-block.vue | 5 +- .../client/src/pages/admin/object-storage.vue | 9 ++- .../client/src/pages/admin/other-settings.vue | 5 +- .../src/pages/admin/overview.federation.vue | 5 +- .../src/pages/admin/overview.instances.vue | 3 +- .../src/pages/admin/overview.metrics.vue | 11 ++- .../src/pages/admin/overview.moderators.vue | 3 +- .../client/src/pages/admin/overview.stats.vue | 14 ++-- .../client/src/pages/admin/overview.users.vue | 3 +- packages/client/src/pages/admin/overview.vue | 3 +- .../client/src/pages/admin/promotions.vue | 9 ++- .../client/src/pages/admin/proxy-account.vue | 3 +- packages/client/src/pages/admin/queue.vue | 9 ++- packages/client/src/pages/admin/relays.vue | 16 ++-- packages/client/src/pages/admin/security.vue | 21 ++--- packages/client/src/pages/admin/settings.vue | 31 ++++---- packages/client/src/pages/admin/users.vue | 9 ++- packages/client/src/pages/announcements.vue | 5 +- .../client/src/pages/antenna-timeline.vue | 5 +- packages/client/src/pages/api-console.vue | 5 +- packages/client/src/pages/channel-editor.vue | 11 +-- packages/client/src/pages/channel.vue | 17 ++-- packages/client/src/pages/channels.vue | 19 +++-- packages/client/src/pages/clip.vue | 7 +- packages/client/src/pages/drive.vue | 3 +- packages/client/src/pages/emojis.emoji.vue | 5 +- packages/client/src/pages/explore.users.vue | 20 ++--- packages/client/src/pages/explore.vue | 7 +- packages/client/src/pages/favorites.vue | 3 +- packages/client/src/pages/follow-requests.vue | 7 +- packages/client/src/pages/gallery/edit.vue | 15 ++-- packages/client/src/pages/gallery/index.vue | 17 ++-- packages/client/src/pages/gallery/post.vue | 26 ++++--- packages/client/src/pages/instance-info.vue | 19 +++-- packages/client/src/pages/messaging/index.vue | 15 ++-- .../pages/messaging/messaging-room.form.vue | 13 ++-- .../messaging/messaging-room.message.vue | 5 +- .../src/pages/messaging/messaging-room.vue | 5 +- packages/client/src/pages/mfm-cheat-sheet.vue | 3 +- packages/client/src/pages/miauth.vue | 6 +- .../client/src/pages/my-antennas/create.vue | 3 +- .../client/src/pages/my-antennas/edit.vue | 3 +- .../client/src/pages/my-antennas/editor.vue | 5 +- .../client/src/pages/my-antennas/index.vue | 9 +-- packages/client/src/pages/my-clips/index.vue | 5 +- packages/client/src/pages/my-groups/group.vue | 13 ++-- packages/client/src/pages/my-groups/index.vue | 7 +- packages/client/src/pages/my-lists/index.vue | 9 ++- packages/client/src/pages/my-lists/list.vue | 10 ++- packages/client/src/pages/no-graze.vue | 6 +- packages/client/src/pages/not-found.vue | 3 +- packages/client/src/pages/note.vue | 8 +- packages/client/src/pages/notifications.vue | 17 ++-- .../page-editor/els/page-editor.el.button.vue | 3 +- .../page-editor/els/page-editor.el.canvas.vue | 5 +- .../els/page-editor.el.counter.vue | 5 +- .../page-editor/els/page-editor.el.if.vue | 5 +- .../page-editor/els/page-editor.el.image.vue | 5 +- .../page-editor/els/page-editor.el.note.vue | 3 +- .../els/page-editor.el.number-input.vue | 5 +- .../page-editor/els/page-editor.el.post.vue | 3 +- .../els/page-editor.el.radio-button.vue | 5 +- .../els/page-editor.el.section.vue | 8 +- .../page-editor/els/page-editor.el.switch.vue | 5 +- .../els/page-editor.el.text-input.vue | 5 +- .../page-editor/els/page-editor.el.text.vue | 3 +- .../els/page-editor.el.textarea-input.vue | 5 +- .../els/page-editor.el.textarea.vue | 3 +- .../page-editor/page-editor.container.vue | 9 ++- .../page-editor/page-editor.script-block.vue | 6 +- .../src/pages/page-editor/page-editor.vue | 27 +++---- packages/client/src/pages/page.vue | 34 ++++---- packages/client/src/pages/pages.vue | 13 ++-- packages/client/src/pages/preview.vue | 3 +- packages/client/src/pages/registry.keys.vue | 3 +- packages/client/src/pages/registry.value.vue | 7 +- packages/client/src/pages/registry.vue | 3 +- packages/client/src/pages/reset-password.vue | 5 +- packages/client/src/pages/scratchpad.vue | 5 +- packages/client/src/pages/search.vue | 7 +- packages/client/src/pages/settings/2fa.vue | 20 ++--- .../src/pages/settings/account-info.vue | 3 +- .../client/src/pages/settings/accounts.vue | 9 ++- packages/client/src/pages/settings/api.vue | 3 +- packages/client/src/pages/settings/apps.vue | 5 +- .../client/src/pages/settings/custom-css.vue | 3 +- .../src/pages/settings/custom-katex-macro.vue | 3 +- packages/client/src/pages/settings/deck.vue | 3 +- .../src/pages/settings/delete-account.vue | 3 +- packages/client/src/pages/settings/drive.vue | 5 +- packages/client/src/pages/settings/email.vue | 7 +- .../client/src/pages/settings/general.vue | 39 ++++++++-- .../src/pages/settings/import-export.vue | 43 ++++++----- packages/client/src/pages/settings/index.vue | 51 ++++++------ .../src/pages/settings/instance-mute.vue | 5 +- .../client/src/pages/settings/migration.vue | 12 +-- .../client/src/pages/settings/mute-block.vue | 3 +- packages/client/src/pages/settings/navbar.vue | 21 +++-- .../src/pages/settings/notifications.vue | 5 +- packages/client/src/pages/settings/other.vue | 7 +- .../src/pages/settings/plugin.install.vue | 5 +- packages/client/src/pages/settings/plugin.vue | 9 ++- .../pages/settings/preferences-backups.vue | 77 ++++++++++--------- .../client/src/pages/settings/privacy.vue | 3 +- .../client/src/pages/settings/profile.vue | 17 ++-- .../client/src/pages/settings/reaction.vue | 11 ++- .../client/src/pages/settings/security.vue | 11 ++- packages/client/src/pages/settings/sounds.vue | 7 +- .../client/src/pages/settings/statusbar.vue | 3 +- .../src/pages/settings/theme.install.vue | 7 +- .../src/pages/settings/theme.manage.vue | 5 +- packages/client/src/pages/settings/theme.vue | 27 +++---- .../src/pages/settings/webhook.edit.vue | 7 +- .../client/src/pages/settings/webhook.new.vue | 7 +- .../client/src/pages/settings/webhook.vue | 9 ++- .../client/src/pages/settings/word-mute.vue | 5 +- packages/client/src/pages/share.vue | 3 +- packages/client/src/pages/signup-complete.vue | 3 +- packages/client/src/pages/tag.vue | 7 +- packages/client/src/pages/theme-editor.vue | 11 ++- packages/client/src/pages/timeline.vue | 33 ++++---- packages/client/src/pages/user-info.vue | 25 +++--- .../client/src/pages/user-list-timeline.vue | 7 +- packages/client/src/pages/user/followers.vue | 3 +- packages/client/src/pages/user/following.vue | 3 +- packages/client/src/pages/user/home.vue | 47 +++++------ .../client/src/pages/user/index.activity.vue | 8 +- .../client/src/pages/user/index.photos.vue | 3 +- packages/client/src/pages/user/index.vue | 13 ++-- packages/client/src/pages/verify-email.vue | 3 +- .../client/src/pages/welcome.entrance.a.vue | 9 ++- .../client/src/pages/welcome.entrance.b.vue | 7 +- .../client/src/pages/welcome.entrance.c.vue | 7 +- packages/client/src/pages/welcome.setup.vue | 5 +- .../client/src/pages/welcome.timeline.vue | 3 +- packages/client/src/scripts/get-note-menu.ts | 61 +++++++-------- packages/client/src/scripts/get-user-menu.ts | 45 +++++------ packages/client/src/scripts/helpMenu.ts | 19 ++--- packages/client/src/scripts/hpml/index.ts | 23 ++++-- packages/client/src/scripts/hpml/lib.ts | 76 +++++++++--------- packages/client/src/scripts/icon.ts | 5 ++ packages/client/src/scripts/select-file.ts | 7 +- packages/client/src/store.ts | 18 +++-- .../src/ui/_common_/navbar-for-mobile.vue | 23 +++--- packages/client/src/ui/_common_/navbar.vue | 17 ++-- .../src/ui/_common_/stream-indicator.vue | 3 +- packages/client/src/ui/_common_/upload.vue | 4 +- packages/client/src/ui/deck.vue | 45 ++++++----- .../client/src/ui/deck/antenna-column.vue | 5 +- .../client/src/ui/deck/channel-column.vue | 5 +- packages/client/src/ui/deck/column.vue | 36 ++++----- packages/client/src/ui/deck/direct-column.vue | 4 +- packages/client/src/ui/deck/list-column.vue | 5 +- packages/client/src/ui/deck/main-column.vue | 8 +- .../client/src/ui/deck/mentions-column.vue | 4 +- .../src/ui/deck/notifications-column.vue | 5 +- packages/client/src/ui/deck/tl-column.vue | 13 ++-- .../client/src/ui/deck/widgets-column.vue | 5 +- packages/client/src/ui/universal.vue | 54 +++++++------ packages/client/src/ui/universal.widgets.vue | 7 +- packages/client/src/ui/visitor/a.vue | 4 +- packages/client/src/ui/visitor/b.vue | 24 +++--- packages/client/src/ui/visitor/header.vue | 17 ++-- packages/client/src/widgets/activity.vue | 13 ++-- packages/client/src/widgets/aiscript.vue | 11 +-- packages/client/src/widgets/federation.vue | 14 ++-- packages/client/src/widgets/job-queue.vue | 14 ++-- packages/client/src/widgets/memo.vue | 12 +-- packages/client/src/widgets/notifications.vue | 13 ++-- packages/client/src/widgets/photos.vue | 11 +-- packages/client/src/widgets/rss-ticker.vue | 14 ++-- packages/client/src/widgets/rss.vue | 14 ++-- .../client/src/widgets/server-metric/cpu.vue | 3 +- .../client/src/widgets/server-metric/disk.vue | 3 +- .../src/widgets/server-metric/index.vue | 13 ++-- .../src/widgets/server-metric/meilisearch.vue | 11 +-- .../client/src/widgets/server-metric/mem.vue | 11 +-- packages/client/src/widgets/timeline.vue | 42 +++++----- packages/client/src/widgets/trends.vue | 14 ++-- packages/client/src/widgets/user-list.vue | 5 +- pnpm-lock.yaml | 3 + 283 files changed, 1711 insertions(+), 1523 deletions(-) create mode 100644 packages/client/src/scripts/icon.ts diff --git a/locales/en-US.yml b/locales/en-US.yml index 10c84425b6..24fc392444 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1153,6 +1153,7 @@ detectPostLanguage: "Automatically detect the language and show a translate butt for posts in foreign languages" vibrate: "Play vibrations" openServerInfo: "Show server information by clicking the server ticker on a post" +iconSet: "Icon set" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing @@ -2152,3 +2153,9 @@ _feeds: rss: "RSS" atom: "Atom" jsonFeed: "JSON feed" +_iconSets: + bold: "Bold" + light: "Light" + regular: "Regular" + fill: "Filled" + duotone: "Duotone" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 8f136ed24b..31d817b7b0 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -991,6 +991,7 @@ remindMeLater: "また後で" addRe: "閲覧注意の投稿への返信で、注釈の先頭に\"re:\"を追加する" languageForTranslation: "投稿翻訳に使用する言語" detectPostLanguage: "投稿の言語を自動検出し、外国語の投稿に翻訳ボタンを表示する" +iconSet: "アイコンのスタイル" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" @@ -1994,3 +1995,9 @@ indexableDescription: MastodonやFirefishなどの検索機能に、あなたの clickToShowPatterns: クリックしてトラックを表示 vibrate: 振動を有効にする indexable: 投稿検索に登録 +_iconSets: + bold: "太め" + light: "細め" + regular: "標準" + fill: "塗りつぶし" + duotone: "2色" diff --git a/packages/client/package.json b/packages/client/package.json index 7e9236b51f..890aba4ab8 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -31,6 +31,7 @@ "@types/uuid": "9.0.3", "@vitejs/plugin-vue": "4.3.4", "@vue/compiler-sfc": "3.3.4", + "@vue/runtime-core": "3.3.4", "autobind-decorator": "2.4.0", "autosize": "6.0.1", "blurhash": "2.0.5", diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 1f8d512a07..761ebe5e00 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -3,8 +3,9 @@ import type * as firefish from "firefish-js"; import { i18n } from "./i18n"; import { del, get, set } from "@/scripts/idb-proxy"; import { apiUrl } from "@/config"; -import { alert, api, popup, popupMenu, success, waiting } from "@/os"; +import { alert, api, popup, popupMenu, waiting } from "@/os"; import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; +import icon from "@/scripts/icon"; // TODO: 他のタブと永続化されたstateを同期 @@ -249,7 +250,7 @@ export async function openAccountMenu( ...accountItemPromises, { type: "parent", - icon: "ph-plus ph-bold ph-lg", + icon: `${icon("ph-plus")}`, text: i18n.ts.addAccount, children: [ { @@ -268,13 +269,13 @@ export async function openAccountMenu( }, { type: "link", - icon: "ph-users ph-bold ph-lg", + icon: `${icon("ph-users")}`, text: i18n.ts.manageAccounts, to: "/settings/accounts", }, { type: "button", - icon: "ph-sign-out ph-bold ph-lg", + icon: `${icon("ph-sign-out")}`, text: i18n.ts.logout, action: () => { signout(); diff --git a/packages/client/src/components/MkAbuseReportWindow.vue b/packages/client/src/components/MkAbuseReportWindow.vue index 3839789436..8d5675868b 100644 --- a/packages/client/src/components/MkAbuseReportWindow.vue +++ b/packages/client/src/components/MkAbuseReportWindow.vue @@ -8,7 +8,7 @@ > @@ -26,6 +26,7 @@ import { ref } from "vue"; import * as os from "@/os"; import { i18n } from "@/i18n"; +import icon from "@/scripts/icon"; const props = withDefaults( defineProps<{ diff --git a/packages/client/src/components/MkChannelPreview.vue b/packages/client/src/components/MkChannelPreview.vue index 12df63bf0c..f824a1b2f5 100644 --- a/packages/client/src/components/MkChannelPreview.vue +++ b/packages/client/src/components/MkChannelPreview.vue @@ -3,11 +3,12 @@