From aabc45b3ec56758b32c756f84b0630cb4b52417f Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 18 Nov 2025 23:48:50 -0500 Subject: [PATCH] test this please im tired --- eslint.config.mjs | 4 +- src/api/SettingsSync/offline.ts | 46 +++- src/components/ThemeSettings/ThemesTab.tsx | 6 +- src/components/ThemeSettings/UserCSSModal.tsx | 2 +- .../tabs/changelog/NewPluginsSection.tsx | 3 +- .../settings/tabs/changelog/index.tsx | 5 +- .../bannersEverywhere/index.tsx | 3 +- src/equicordplugins/baseDecoder/index.tsx | 4 +- .../components/ActivityTooltip.tsx | 5 +- .../components/CarouselControls.tsx | 4 +- .../patch-helpers/activityList.tsx | 11 +- .../betterActivities/patch-helpers/popout.tsx | 9 +- .../components/BookmarkContainer.tsx | 4 +- .../channelTabs/components/ChannelTab.tsx | 10 +- .../components/ChannelTabsContainer.tsx | 5 +- .../channelTabs/components/ContextMenus.tsx | 5 +- .../components/KeybindSettings.tsx | 3 +- .../channelTabs/util/constants.tsx | 5 +- src/equicordplugins/channelTabs/util/tabs.tsx | 3 +- .../commandPalette/registry.tsx | 24 +- .../customSounds/SoundOverrideComponent.tsx | 3 +- .../components/makeDevBanner.tsx | 2 +- .../equicordHelper/pluginButtons.tsx | 3 +- .../equicordHelper/pluginCards.tsx | 21 +- src/equicordplugins/equicordToolbox/style.css | 16 -- src/equicordplugins/fontLoader/index.tsx | 3 +- .../friendCodes/FriendCodesPanel.tsx | 11 +- src/equicordplugins/friendshipRanks/index.tsx | 3 +- .../gifCollections/utils/collectionManager.ts | 4 +- .../gifCollections/utils/getFormat.ts | 3 +- .../gifCollections/utils/getGif.ts | 4 +- .../gifCollections/utils/refreshUrl.ts | 3 +- .../gifCollections/utils/settingsUtils.ts | 2 +- .../components/GitHubReposComponent.tsx | 4 +- .../githubRepos/components/RepoCard.tsx | 4 +- .../githubRepos/components/ReposModal.tsx | 4 +- .../githubRepos/components/Star.tsx | 3 +- .../guildPickerDumper/index.tsx | 2 +- src/equicordplugins/guildTagSettings/index.ts | 3 +- .../components/HiddenServersButton.tsx | 2 +- .../components/HiddenServersMenu.tsx | 2 +- .../holyNotes/components/modals/HelpModal.tsx | 5 +- .../components/modals/NoteBookTab.tsx | 3 +- .../holyNotes/components/modals/Notebook.tsx | 15 +- .../components/modals/NotebookCreateModal.tsx | 3 +- .../components/modals/NotebookDeleteModal.tsx | 2 +- .../components/modals/RenderMessage.tsx | 5 +- .../iRememberYou/components/ui.tsx | 3 +- .../components/DecryptionModal.tsx | 0 .../components/EncryptionModal.tsx | 0 .../invisibleChat.desktop/index.tsx | 227 ++++++++++++++++++ .../components/CommandPalette.tsx | 2 +- .../components/MultipleChoice.tsx | 2 +- .../loginWithQR/ui/modals/QrModal.tsx | 2 +- .../loginWithQR/ui/modals/VerifyModal.tsx | 2 +- .../components/FolderSelectInput.tsx | 4 +- .../components/LogsModal.tsx | 11 +- .../messageLoggerEnhanced/components/hooks.ts | 4 +- .../messageLoggerEnhanced/native/index.ts | 4 +- .../messageLoggerEnhanced/utils/LimitedMap.ts | 2 +- .../messageLoggerEnhanced/utils/cleanUp.ts | 2 +- .../utils/contextMenu.tsx | 6 +- .../messageLoggerEnhanced/utils/index.ts | 4 +- .../messageLoggerEnhanced/utils/misc.ts | 4 +- .../messageLoggerEnhanced/utils/parseQuery.ts | 2 +- .../utils/saveImage/ImageManager.ts | 7 +- .../utils/saveImage/index.ts | 6 +- .../utils/settingsUtils.ts | 4 +- .../moreStickers/components/categories.tsx | 5 +- .../moreStickers/components/misc.tsx | 13 +- .../moreStickers/components/picker.tsx | 6 +- src/equicordplugins/moreStickers/upload.ts | 8 +- src/equicordplugins/moreUserTags/settings.tsx | 4 +- .../musicControls/spotify/lyrics/api.tsx | 4 +- .../spotify/lyrics/components/ctxMenu.tsx | 6 +- .../spotify/lyrics/components/lyrics.tsx | 6 +- .../spotify/lyrics/components/modal.tsx | 2 +- .../spotify/lyrics/components/util.tsx | 9 +- .../lyrics/providers/SpotifyAPI/index.ts | 2 +- .../lyrics/providers/lrclibAPI/index.ts | 4 +- .../spotify/lyrics/providers/store.ts | 6 +- .../lyrics/providers/translator/index.ts | 6 +- .../musicControls/tidal/TidalPlayer.tsx | 9 +- .../musicControls/tidal/lyrics/api.tsx | 3 +- .../tidal/lyrics/components/ctxMenu.tsx | 2 +- .../tidal/lyrics/components/lyrics.tsx | 6 +- .../tidal/lyrics/components/modal.tsx | 2 +- .../tidal/lyrics/components/util.tsx | 9 +- .../tidal/lyrics/providers/store.ts | 9 +- .../youtubeMusic/PlayerComponent.tsx | 7 +- .../newPluginsManager/NewPluginsModal.tsx | 7 +- src/equicordplugins/questify/utils/misc.tsx | 2 +- .../remix/editor/components/Canvas.tsx | 7 +- .../remix/editor/components/Toolbar.tsx | 8 +- .../remix/editor/tools/brush.ts | 8 +- .../remix/editor/tools/crop.ts | 8 +- .../remix/editor/tools/eraser.ts | 6 +- .../remix/editor/tools/shape.ts | 8 +- .../remix/editor/utils/canvas.ts | 2 +- .../rpcEditor/ReplaceSettings.tsx | 3 +- .../sekaiStickers/Components/Picker.tsx | 3 +- .../Components/SekaiStickersModal.tsx | 2 +- .../songLink.desktop/SongLinker.tsx | 3 +- .../soundBoardLogger/components/Icons.tsx | 2 +- .../components/MoreUsersModal.tsx | 3 +- .../components/SoundBoardLog.tsx | 9 +- .../soundBoardLogger/components/UserModal.tsx | 6 +- .../components/LikesComponent.tsx | 6 +- .../themeLibrary/components/ThemeCard.tsx | 5 +- .../components/ThemeInfoModal.tsx | 4 +- .../themeLibrary/components/ThemeTab.tsx | 2 +- .../themeLibrary/utils/auth.tsx | 3 +- .../components/NotificationComponent.tsx | 2 +- .../components/Notifications.tsx | 2 +- .../translatePlus/utils/accessory.tsx | 4 +- .../translatePlus/utils/icon.tsx | 2 +- .../translatePlus/utils/translator.ts | 2 +- src/equicordplugins/voiceButtons/index.tsx | 5 +- .../VoiceChannelLogEntryComponent.tsx | 2 +- .../components/VoiceChannelLogEntryIcons.tsx | 2 +- .../components/VoiceChannelLogModal.tsx | 2 +- .../wallpaperFree/components/ctxmenu.tsx | 2 +- .../wallpaperFree/components/util.tsx | 2 +- src/equicordplugins/webpackTarball/index.tsx | 5 +- src/plugins/fakeProfileThemes/style.css | 3 - src/plugins/sortFriendRequests/index.tsx | 3 +- src/utils/native.ts | 7 + src/utils/themes/bd/index.ts | 2 +- tsconfig.json | 51 ++-- 129 files changed, 615 insertions(+), 312 deletions(-) delete mode 100644 src/equicordplugins/equicordToolbox/style.css rename src/{plugins => equicordplugins}/invisibleChat.desktop/components/DecryptionModal.tsx (100%) rename src/{plugins => equicordplugins}/invisibleChat.desktop/components/EncryptionModal.tsx (100%) create mode 100644 src/equicordplugins/invisibleChat.desktop/index.tsx delete mode 100644 src/plugins/fakeProfileThemes/style.css diff --git a/eslint.config.mjs b/eslint.config.mjs index e764a20b0..e047113d7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -36,7 +36,7 @@ export default tseslint.config( "@stylistic": stylistic, "@typescript-eslint": tseslint.plugin, "simple-import-sort": simpleImportSort, - "unused-imports": unusedImports + "unused-imports": unusedImports, }, settings: { "import/resolver": { @@ -138,7 +138,7 @@ export default tseslint.config( // Plugin Rules "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", - "unused-imports/no-unused-imports": "error", + "unused-imports/no-unused-imports": "error" } } ); diff --git a/src/api/SettingsSync/offline.ts b/src/api/SettingsSync/offline.ts index aced11e81..12fa9001c 100644 --- a/src/api/SettingsSync/offline.ts +++ b/src/api/SettingsSync/offline.ts @@ -9,6 +9,8 @@ import { Logger } from "@utils/Logger"; import { chooseFile, saveFile } from "@utils/web"; import { moment, Toasts } from "@webpack/common"; +import { DataStore } from ".."; + const toast = (type: string, message: string) => Toasts.show({ type, @@ -43,12 +45,48 @@ export async function importSettings(data: string) { export async function exportSettings({ minify }: { minify?: boolean; } = {}) { const settings = VencordNative.settings.get(); const quickCss = await VencordNative.quickCss.get(); - return JSON.stringify({ settings, quickCss }, null, minify ? undefined : 4); + const dataStore = await DataStore.entries(); + return JSON.stringify({ settings, quickCss, dataStore }, null, minify ? undefined : 4); } -export async function downloadSettingsBackup() { - const filename = `vencord-settings-backup-${moment().format("YYYY-MM-DD")}.json`; - const backup = await exportSettings(); +export async function exportPlugins({ minify }: { minify?: boolean; } = {}) { + const { plugins } = VencordNative.settings.get(); + return JSON.stringify({ settings: { plugins } }, null, minify ? undefined : 4); +} + +export async function exportCSS({ minify }: { minify?: boolean; } = {}) { + const quickCss = await VencordNative.quickCss.get(); + return JSON.stringify({ quickCss }, null, minify ? undefined : 4); +} + +export async function exportDataStores({ minify }: { minify?: boolean; } = {}) { + const dataStore = await DataStore.entries(); + return JSON.stringify({ dataStore }, null, minify ? undefined : 4); +} + +type BackupType = "settings" | "plugins" | "css" | "datastore"; + +export async function downloadSettingsBackup(type: BackupType, { minify }: { minify?: boolean; } = {}) { + let backup: string; + + switch (type) { + case "settings": + backup = await exportSettings({ minify }); + break; + case "plugins": + backup = await exportPlugins({ minify }); + break; + case "css": + backup = await exportCSS({ minify }); + break; + case "datastore": + backup = await exportDataStores({ minify }); + break; + default: + throw new Error("Invalid backup type"); + } + + const filename = `equicord-${type}-backup-${moment().format("YYYY-MM-DD")}.json`; const data = new TextEncoder().encode(backup); if (IS_DISCORD_DESKTOP) { diff --git a/src/components/ThemeSettings/ThemesTab.tsx b/src/components/ThemeSettings/ThemesTab.tsx index eb8034f99..fd63dc352 100644 --- a/src/components/ThemeSettings/ThemesTab.tsx +++ b/src/components/ThemeSettings/ThemesTab.tsx @@ -18,8 +18,10 @@ import "./themesStyles.css"; +import { isPluginEnabled } from "@api/PluginManager"; import { Settings, useSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; +import { Card } from "@components/Card"; import { Divider } from "@components/Divider"; import { ErrorCard } from "@components/ErrorCard"; import { Flex } from "@components/Flex"; @@ -41,7 +43,7 @@ import { getThemeInfo, stripBOM, type UserThemeHeader } from "@utils/themes/bd"; import { usercssParse } from "@utils/themes/usercss"; import { getStylusWebStoreUrl } from "@utils/web"; import { findLazy } from "@webpack"; -import { Alerts, Button, Card, React, showToast, TabBar, TextInput, Tooltip, useEffect, useMemo, useRef, useState } from "@webpack/common"; +import { Alerts, Button, React, showToast, TabBar, TextInput, Tooltip, useEffect, useMemo, useRef, useState } from "@webpack/common"; import type { ComponentType, Ref, SyntheticEvent } from "react"; import type { UserstyleHeader } from "usercss-meta"; @@ -102,7 +104,7 @@ interface UserCSSCardProps { function UserCSSThemeCard({ theme, enabled, onChange, onDelete, onSettingsReset }: UserCSSCardProps) { const missingPlugins = useMemo(() => - theme.requiredPlugins?.filter(p => !Vencord.Plugins.isPluginEnabled(p)), [theme]); + theme.requiredPlugins?.filter(p => !isPluginEnabled(p)), [theme]); return ( - + {decodedContent.map((content, index) => (