test this please im tired
This commit is contained in:
parent
148b7a75a1
commit
aabc45b3ec
129 changed files with 615 additions and 312 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<AddonCard
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Settings, useSettings } from "@api/Settings";
|
|||
import { BaseText } from "@components/BaseText";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { CopyIcon, PasteIcon, ResetIcon } from "@components/Icons";
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot } from "@utils/modal";
|
||||
import { showToast, Toasts, Tooltip } from "@webpack/common";
|
||||
import { type ReactNode } from "react";
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@
|
|||
|
||||
import { useSettings } from "@api/Settings";
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { Card } from "@components/Card";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { PluginCard } from "@components/settings/tabs/plugins/PluginCard";
|
||||
import { ChangeList } from "@utils/ChangeList";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import { Button, Card, React, Tooltip } from "@webpack/common";
|
||||
import { Button, React, Tooltip } from "@webpack/common";
|
||||
|
||||
import Plugins from "~plugins";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import "./styles.css";
|
||||
|
||||
import { Card } from "@components/Card";
|
||||
import { Divider } from "@components/Divider";
|
||||
import { ErrorCard } from "@components/ErrorCard";
|
||||
import { Heading } from "@components/Heading";
|
||||
|
|
@ -13,15 +14,15 @@ import { DeleteIcon } from "@components/Icons";
|
|||
import { Link } from "@components/Link";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { SettingsTab, wrapTab } from "@components/settings/tabs/BaseTab";
|
||||
import { HashLink } from "@components/settings/tabs/updater/Components";
|
||||
import { gitHashShort } from "@shared/vencordUserAgent";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { useAwaiter } from "@utils/react";
|
||||
import { getRepo, UpdateLogger } from "@utils/updater";
|
||||
import { Alerts, Button, Card, React, Toasts } from "@webpack/common";
|
||||
import { Alerts, Button, React, Toasts } from "@webpack/common";
|
||||
|
||||
import gitHash from "~git-hash";
|
||||
|
||||
import { HashLink } from "../updater/Components";
|
||||
import {
|
||||
ChangelogEntry,
|
||||
ChangelogHistory,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import * as DataStore from "@api/DataStore";
|
||||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { disableStyle, enableStyle } from "@api/Styles";
|
||||
import { Devs } from "@utils/constants";
|
||||
|
|
@ -138,7 +139,7 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
getBanner(userId: string): string | undefined {
|
||||
if (Vencord.Plugins.isPluginEnabled("USRBG") && (Vencord.Plugins.plugins.USRBG as iUSRBG).userHasBackground(userId)) {
|
||||
if (isPluginEnabled("USRBG") && (Vencord.Plugins.plugins.USRBG as iUSRBG).userHasBackground(userId)) {
|
||||
let banner = (Vencord.Plugins.plugins.USRBG as iUSRBG).getImageUrl(userId);
|
||||
if (banner === null) banner = "";
|
||||
return banner;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Flex } from "@components/Flex";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Button, ChannelStore } from "@webpack/common";
|
||||
|
|
@ -82,7 +82,7 @@ function openDecodedBase64Modal(decodedContent) {
|
|||
</div>
|
||||
</ModalContent >
|
||||
<ModalFooter>
|
||||
<Flex cellSpacing={10}>
|
||||
<Flex gap={10}>
|
||||
{decodedContent.map((content, index) => (
|
||||
<Button key={index} onClick={() => copyWithToast(content, "Decoded content copied to clipboard!")}>
|
||||
Copy Decoded Content {index + 1}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@
|
|||
*/
|
||||
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { ActivityTooltipProps } from "@equicordplugins\betterActivities/types";
|
||||
import { ActivityView, cl } from "@equicordplugins\betterActivities/utils";
|
||||
import { UserStore } from "@webpack/common";
|
||||
|
||||
import { ActivityTooltipProps } from "../types";
|
||||
import { ActivityView, cl } from "../utils";
|
||||
|
||||
export function ActivityTooltip({ activity, application, user }: Readonly<ActivityTooltipProps>) {
|
||||
const currentUser = UserStore.getCurrentUser();
|
||||
if (!currentUser) return null;
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { CarouselControlsProps } from "@equicordplugins\betterActivities/types";
|
||||
import { cl } from "@equicordplugins\betterActivities/utils";
|
||||
import { React, Tooltip } from "@webpack/common";
|
||||
|
||||
import { CarouselControlsProps } from "../types";
|
||||
import { cl } from "../utils";
|
||||
import { Caret } from "./Caret";
|
||||
|
||||
export function CarouselControls({ activities, currentActivity, onActivityChange }: CarouselControlsProps) {
|
||||
|
|
|
|||
|
|
@ -5,16 +5,15 @@
|
|||
*/
|
||||
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { ActivityTooltip } from "@equicordplugins\betterActivities/components/ActivityTooltip";
|
||||
import { TwitchIcon } from "@equicordplugins\betterActivities/components/TwitchIcon";
|
||||
import { settings } from "@equicordplugins\betterActivities/settings";
|
||||
import { ActivityListIcon, ActivityListProps, ApplicationIcon, IconCSSProperties } from "@equicordplugins\betterActivities/types";
|
||||
import { cl, getApplicationIcons } from "@equicordplugins\betterActivities/utils";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { React, Tooltip } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { ActivityTooltip } from "../components/ActivityTooltip";
|
||||
import { TwitchIcon } from "../components/TwitchIcon";
|
||||
import { settings } from "../settings";
|
||||
import { ActivityListIcon, ActivityListProps, ApplicationIcon, IconCSSProperties } from "../types";
|
||||
import { cl, getApplicationIcons } from "../utils";
|
||||
|
||||
// Discord no longer shows an icon here by default but we use the one from the popout now here
|
||||
const DefaultActivityIcon = findComponentByCodeLazy("M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm6.81 7c-.54 0-1 .26-1.23.61A1 1 0 0 1 8.92 8.5 3.49 3.49 0 0 1 11.82 7c1.81 0 3.43 1.38 3.43 3.25 0 1.45-.98 2.61-2.27 3.06a1 1 0 0 1-1.96.37l-.19-1a1 1 0 0 1 .98-1.18c.87 0 1.44-.63 1.44-1.25S12.68 9 11.81 9ZM13 16a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm7-10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM18.5 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM7 18.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM5.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z");
|
||||
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@
|
|||
*/
|
||||
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { CarouselControls } from "@equicordplugins\betterActivities/components/CarouselControls";
|
||||
import { settings } from "@equicordplugins\betterActivities/settings";
|
||||
import { AllActivitiesProps } from "@equicordplugins\betterActivities/types";
|
||||
import { ActivityView, getActivityApplication } from "@equicordplugins\betterActivities/utils";
|
||||
import { Activity } from "@vencord/discord-types";
|
||||
import { PresenceStore, React, useEffect, useMemo, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { CarouselControls } from "../components/CarouselControls";
|
||||
import { settings } from "../settings";
|
||||
import { AllActivitiesProps } from "../types";
|
||||
import { ActivityView, getActivityApplication } from "../utils";
|
||||
|
||||
export function showAllActivitiesComponent({ activity, user, ...props }: Readonly<AllActivitiesProps>): JSX.Element | null {
|
||||
const currentUser = UserStore.getCurrentUser();
|
||||
if (!currentUser) return null;
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, isBookmarkFolder, isTabSelected, navigateToBookmark, openedTabs, settings, switchChannel, useBookmarks } from "@equicordplugins/channelTabs/util";
|
||||
import { CircleQuestionIcon, DiscoveryIcon, EnvelopeIcon, FriendsIcon, NitroIcon, QuestIcon, ShopIcon } from "@equicordplugins/channelTabs/util/icons";
|
||||
import { getGuildAcronym, getIntlMessage } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import { closeModal, openModal } from "@utils/modal";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { Avatar, ChannelStore, ContextMenuApi, FluxDispatcher, GuildStore, Menu, React, ReadStateStore, ReadStateUtils, SelectedChannelStore, SelectedGuildStore, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore, useState } from "@webpack/common";
|
||||
|
||||
import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, isBookmarkFolder, isTabSelected, navigateToBookmark, openedTabs, settings, switchChannel, useBookmarks } from "../util";
|
||||
import { CircleQuestionIcon, DiscoveryIcon, EnvelopeIcon, FriendsIcon, NitroIcon, QuestIcon, ShopIcon } from "../util/icons";
|
||||
import { NotificationDot } from "./ChannelTab";
|
||||
import { BookmarkContextMenu, EditModal } from "./ContextMenus";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { ChannelTabsProps, closeTab, isTabSelected, moveDraggedTabs, moveToTab, openedTabs, settings } from "@equicordplugins/channelTabs/util";
|
||||
import { ActivityIcon, CircleQuestionIcon, DiscoveryIcon, EnvelopeIcon, FriendsIcon, ICYMIIcon, NitroIcon, QuestIcon, ShopIcon } from "@equicordplugins/channelTabs/util/icons";
|
||||
import { activeQuestIntervals } from "@equicordplugins/questify"; // sorry murphy!
|
||||
import { getGuildAcronym, getIntlMessage, getUniqueUsername } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
|
|
@ -14,8 +16,6 @@ import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
|||
import { Avatar, ChannelStore, ContextMenuApi, GuildStore, PresenceStore, ReadStateStore, TypingStore, useDrag, useDrop, useEffect, useRef, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { ChannelTabsProps, closeTab, isTabSelected, moveDraggedTabs, moveToTab, openedTabs, settings } from "../util";
|
||||
import { ActivityIcon, CircleQuestionIcon, DiscoveryIcon, EnvelopeIcon, FriendsIcon, ICYMIIcon, NitroIcon, QuestIcon, ShopIcon } from "../util/icons";
|
||||
import { TabContextMenu } from "./ContextMenus";
|
||||
|
||||
const ThreeDots = findComponentByCodeLazy(".dots,", "dotRadius:");
|
||||
|
|
@ -137,12 +137,14 @@ function ChannelTabContent(props: ChannelTabsProps & {
|
|||
showStatusIndicators
|
||||
} = settings.use(["noPomeloNames", "showStatusIndicators"]);
|
||||
|
||||
if (!recipients) return null;
|
||||
|
||||
const [isTyping, status, isMobile] = useStateFromStores(
|
||||
[TypingStore, PresenceStore],
|
||||
() => [
|
||||
!!((Object.keys(TypingStore.getTypingUsers(props.channelId)) as string[]).filter(id => id !== userId).length),
|
||||
PresenceStore.getStatus(recipients?.[0]) as string,
|
||||
PresenceStore.isMobileOnline(recipients?.[0]) as boolean
|
||||
PresenceStore.getStatus(recipients[0]) as string,
|
||||
PresenceStore.isMobileOnline(recipients[0]) as boolean
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,15 +5,16 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { BasicChannelTabsProps, ChannelTabsProps, clearStaleNavigationContext, closeTab, createTab, handleChannelSwitch, isNavigationFromSource, isTabSelected, moveToTab, openedTabs, openStartupTabs, saveTabs, settings, setUpdaterFunction, useGhostTabs } from "@equicordplugins/channelTabs/util";
|
||||
import { IS_MAC } from "@utils/constants";
|
||||
import { classes } from "@utils/misc";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import { findComponentByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { Button, ContextMenuApi, Flex, FluxDispatcher, useCallback, useEffect, useRef, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||
import { Button, ContextMenuApi, FluxDispatcher, useCallback, useEffect, useRef, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { BasicChannelTabsProps, ChannelTabsProps, clearStaleNavigationContext, closeTab, createTab, handleChannelSwitch, isNavigationFromSource, isTabSelected, moveToTab, openedTabs, openStartupTabs, saveTabs, settings, setUpdaterFunction, useGhostTabs } from "../util";
|
||||
import BookmarkContainer, { HorizontalScroller } from "./BookmarkContainer";
|
||||
import ChannelTab, { PreviewTab } from "./ChannelTab";
|
||||
import { BasicContextMenu } from "./ContextMenus";
|
||||
|
|
|
|||
|
|
@ -7,14 +7,13 @@
|
|||
import { BaseText } from "@components/BaseText";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { bookmarkFolderColors, bookmarkPlaceholderName, closeOtherTabs, closeTab, closeTabsToTheLeft, closeTabsToTheRight, createTab, hasClosedTabs, isBookmarkFolder, openedTabs, reopenClosedTab, settings, toggleCompactTab } from "@equicordplugins/channelTabs/util";
|
||||
import { Bookmark, BookmarkFolder, Bookmarks, ChannelTabsProps, UseBookmarkMethods } from "@equicordplugins/channelTabs/util/types";
|
||||
import { getIntlMessage } from "@utils/discord";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { closeModal, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from "@utils/modal";
|
||||
import { Button, ChannelStore, FluxDispatcher, Menu, ReadStateStore, ReadStateUtils, Select, TextInput, useState } from "@webpack/common";
|
||||
|
||||
import { bookmarkFolderColors, bookmarkPlaceholderName, closeOtherTabs, closeTab, closeTabsToTheLeft, closeTabsToTheRight, createTab, hasClosedTabs, isBookmarkFolder, openedTabs, reopenClosedTab, settings, toggleCompactTab } from "../util";
|
||||
import { Bookmark, BookmarkFolder, Bookmarks, ChannelTabsProps, UseBookmarkMethods } from "../util/types";
|
||||
|
||||
export function BasicContextMenu() {
|
||||
const { showBookmarkBar } = settings.use(["showBookmarkBar"]);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,11 @@ import { Divider } from "@components/Divider";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { settings } from "@equicordplugins/channelTabs/util";
|
||||
import { IS_MAC } from "@utils/constants";
|
||||
import { Button, React, Text, useEffect, useRef, useState } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { settings } from "../util";
|
||||
|
||||
interface KeybindInputProps {
|
||||
label: string;
|
||||
description: string;
|
||||
|
|
|
|||
|
|
@ -7,14 +7,13 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { ChannelTabsPreview } from "@equicordplugins/channelTabs/components/ChannelTabsContainer";
|
||||
import { KeybindSettings } from "@equicordplugins/channelTabs/components/KeybindSettings";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { makeRange, OptionType } from "@utils/types";
|
||||
import { SearchableSelect, useState } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { ChannelTabsPreview } from "../components/ChannelTabsContainer";
|
||||
import { KeybindSettings } from "../components/KeybindSettings";
|
||||
|
||||
interface DynamicDropdownSettingOption {
|
||||
label: string;
|
||||
value: string;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { NavigationRouter, SelectedChannelStore, SelectedGuildStore, showToast, Toasts, useEffect, useRef, useState } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
|
@ -457,7 +458,7 @@ export function openStartupTabs(props: BasicChannelTabsProps & { userId: string;
|
|||
replaceArray(openTabHistory);
|
||||
highestIdIndex = 0;
|
||||
|
||||
if (settings.store.onStartup !== "nothing" && Vencord.Plugins.isPluginEnabled("KeepCurrentChannel"))
|
||||
if (settings.store.onStartup !== "nothing" && isPluginEnabled("KeepCurrentChannel"))
|
||||
return showToast("Not restoring tabs as KeepCurrentChannel is enabled", Toasts.Type.FAILURE);
|
||||
|
||||
switch (settings.store.onStartup) {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@
|
|||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import { SettingsStore } from "@api/Settings";
|
||||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import { openPluginModal } from "@components/settings/tabs";
|
||||
import { toggleEnabled } from "@equicordplugins/equicordHelper/utils";
|
||||
import type { Plugin } from "@utils/types";
|
||||
import { changes, checkForUpdates } from "@utils/updater";
|
||||
import { findByPropsLazy, findStoreLazy } from "@webpack";
|
||||
|
|
@ -15,8 +17,6 @@ import { ChannelActionCreators, ChannelRouter, ChannelStore, ComponentDispatch,
|
|||
import type { FC, ReactElement, ReactNode } from "react";
|
||||
import { Settings } from "Vencord";
|
||||
|
||||
import { toggleEnabled } from "../equicordHelper/utils";
|
||||
|
||||
type CommandHandler = () => void | Promise<void>;
|
||||
|
||||
type ToastKind = (typeof Toasts.Type)[keyof typeof Toasts.Type];
|
||||
|
|
@ -1571,7 +1571,7 @@ function createPluginKeywords(plugin: Plugin): string[] {
|
|||
}
|
||||
|
||||
function buildPluginToggleCommand(plugin: Plugin): CommandEntry {
|
||||
const enabled = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const enabled = isPluginEnabled(plugin.name);
|
||||
const keywords = Array.from(new Set([
|
||||
...createPluginKeywords(plugin),
|
||||
"settings",
|
||||
|
|
@ -1588,9 +1588,9 @@ function buildPluginToggleCommand(plugin: Plugin): CommandEntry {
|
|||
searchGroup: `plugin-${plugin.name.toLowerCase()}`,
|
||||
tags: [TAG_PLUGINS, TAG_UTILITY],
|
||||
handler: async () => {
|
||||
const before = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const before = isPluginEnabled(plugin.name);
|
||||
const result = await toggleEnabled(plugin.name);
|
||||
const after = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const after = isPluginEnabled(plugin.name);
|
||||
|
||||
if (result && before !== after) {
|
||||
showToast(`${after ? "Enabled" : "Disabled"} ${plugin.name}.`, Toasts.Type.SUCCESS);
|
||||
|
|
@ -2473,7 +2473,7 @@ function registerSystemUtilityCommands() {
|
|||
}
|
||||
|
||||
function hotReloadPlugin(plugin: Plugin) {
|
||||
if (!Vencord.Plugins.isPluginEnabled(plugin.name)) {
|
||||
if (!isPluginEnabled(plugin.name)) {
|
||||
showToast(`${plugin.name} is disabled.`, Toasts.Type.MESSAGE);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2503,7 +2503,7 @@ async function reloadAllPlugins() {
|
|||
const entries = Object.values(Vencord.Plugins.plugins) as Plugin[];
|
||||
let count = 0;
|
||||
for (const plugin of entries) {
|
||||
if (!Vencord.Plugins.isPluginEnabled(plugin.name)) continue;
|
||||
if (!isPluginEnabled(plugin.name)) continue;
|
||||
if (hotReloadPlugin(plugin)) count += 1;
|
||||
}
|
||||
|
||||
|
|
@ -2518,17 +2518,17 @@ async function setAllPluginsEnabled(enabled: boolean) {
|
|||
const { plugins } = Vencord.Plugins;
|
||||
let changed = 0;
|
||||
for (const plugin of Object.values(plugins) as Plugin[]) {
|
||||
const currentlyEnabled = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const currentlyEnabled = isPluginEnabled(plugin.name);
|
||||
if (enabled && currentlyEnabled) continue;
|
||||
if (!enabled) {
|
||||
if (Vencord.Plugins.isPluginRequired(plugin.name)) continue;
|
||||
if (isPluginEnabled(plugin.name)) continue;
|
||||
if (!currentlyEnabled) continue;
|
||||
}
|
||||
if (plugin.patches?.length) continue;
|
||||
|
||||
const result = await toggleEnabled(plugin.name);
|
||||
if (result) {
|
||||
const nowEnabled = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const nowEnabled = isPluginEnabled(plugin.name);
|
||||
if (nowEnabled === enabled) changed += 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -2607,7 +2607,7 @@ function createPluginToolboxCommands(): CommandEntry[] {
|
|||
}
|
||||
usedIds.add(uniqueId);
|
||||
|
||||
const enabled = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const enabled = isPluginEnabled(plugin.name);
|
||||
|
||||
const keywords = Array.from(new Set([
|
||||
...createPluginKeywords(plugin),
|
||||
|
|
@ -2623,7 +2623,7 @@ function createPluginToolboxCommands(): CommandEntry[] {
|
|||
categoryId: TOOLBOX_ACTIONS_CATEGORY_ID,
|
||||
tags: [TAG_PLUGINS, TAG_UTILITY, TAG_DEVELOPER],
|
||||
handler: () => {
|
||||
if (!Vencord.Plugins.isPluginEnabled(plugin.name)) {
|
||||
if (!isPluginEnabled(plugin.name)) {
|
||||
showToast(`${plugin.name} is disabled. Enable the plugin to use this action.`, Toasts.Type.FAILURE);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@
|
|||
|
||||
import { AudioPlayerInterface, playAudio } from "@api/AudioPlayer";
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { Card } from "@components/Card";
|
||||
import { FormSwitch } from "@components/FormSwitch";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import { makeRange } from "@utils/types";
|
||||
import { findLazy } from "@webpack";
|
||||
import { Button, Card, React, Select, showToast, Slider } from "@webpack/common";
|
||||
import { Button, React, Select, showToast, Slider } from "@webpack/common";
|
||||
import { ComponentType, Ref, SyntheticEvent } from "react";
|
||||
|
||||
import { deleteAudio, getAllAudio, saveAudio, StoredAudioFile } from "./audioStore";
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { ChromiumIcon, DevBannerIcon, DiscordIcon, ElectronIcon, EquicordIcon } from "@equicordplugins/discordDevBanner/icons";
|
||||
import { gitHashShort } from "@shared/vencordUserAgent";
|
||||
import { React } from "@webpack/common";
|
||||
import SettingsPlugin from "plugins/_core/settings";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { ChromiumIcon, DevBannerIcon, DiscordIcon, ElectronIcon, EquicordIcon } from "../icons";
|
||||
import { names, settings } from ".";
|
||||
|
||||
export function makeDevBanner(state?: string): string | JSX.Element {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { isEquicordGuild, isEquicordSupport } from "@utils/misc";
|
||||
|
|
@ -30,7 +31,7 @@ export const PluginButtons = ErrorBoundary.wrap(function PluginCards({ message }
|
|||
|
||||
if (shouldAddPluginButtons) {
|
||||
if (pluginData.required || pluginData.name.endsWith("API")) return;
|
||||
const isEnabled = Vencord.Plugins.isPluginEnabled(matchedPlugin);
|
||||
const isEnabled = isPluginEnabled(matchedPlugin);
|
||||
|
||||
let label = `${matchedPlugin} is already ${isEnabled ? "enabled" : "disabled"}`;
|
||||
let disabled = true;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { isPluginEnabled, isPluginRequired } from "@api/PluginManager";
|
||||
import { useSettings } from "@api/Settings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { WarningIcon } from "@components/Icons";
|
||||
|
|
@ -13,7 +14,7 @@ import { PluginCard } from "@components/settings/tabs/plugins/PluginCard";
|
|||
import { EQUIBOT_USER_ID } from "@utils/constants";
|
||||
import { isEquicordGuild, isEquicordSupport } from "@utils/misc";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { showToast, Tooltip, TooltipContainer } from "@webpack/common";
|
||||
import { showToast, Tooltip, TooltipContainer, useMemo } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import plugins, { ExcludedPlugins } from "~plugins";
|
||||
|
|
@ -58,8 +59,22 @@ export function ChatPluginCard({ url, description }: { url: string, description:
|
|||
|
||||
const onRestartNeeded = () => showToast("A restart is required for the change to take effect!");
|
||||
|
||||
const required = Vencord.Plugins.isPluginRequired(pluginName);
|
||||
const dependents = Vencord.Plugins.calculatePluginDependencyMap()[p.name]?.filter(d => Vencord.Plugins.isPluginEnabled(d));
|
||||
const depMap = useMemo(() => {
|
||||
const o = {} as Record<string, string[]>;
|
||||
for (const plugin in plugins) {
|
||||
const deps = plugins[plugin].dependencies;
|
||||
if (deps) {
|
||||
for (const dep of deps) {
|
||||
o[dep] ??= [];
|
||||
o[dep].push(plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
return o;
|
||||
}, []);
|
||||
|
||||
const required = isPluginRequired(pluginName);
|
||||
const dependents = depMap[p.name]?.filter(d => isPluginEnabled(d));
|
||||
|
||||
if (required) {
|
||||
const tooltipText = p.required || !dependents.length
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
.vc-toolbox-btn,
|
||||
.vc-toolbox-icon {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
.vc-toolbox-icon {
|
||||
color: var(--interactive-normal);
|
||||
}
|
||||
|
||||
.vc-toolbox-btn[class*="selected"] .vc-toolbox-icon {
|
||||
color: var(--interactive-active);
|
||||
}
|
||||
|
||||
.vc-toolbox-btn:hover .vc-toolbox-icon {
|
||||
color: var(--interactive-hover);
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
import "./styles.css";
|
||||
|
||||
import { definePluginSettings, migratePluginSetting } from "@api/Settings";
|
||||
import { Card } from "@components/Card";
|
||||
import { HeadingSecondary, HeadingTertiary } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { debounce } from "@shared/debounce";
|
||||
|
|
@ -14,7 +15,7 @@ import { EquicordDevs } from "@utils/constants";
|
|||
import { Margins } from "@utils/margins";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Card, React, TextInput } from "@webpack/common";
|
||||
import { React, TextInput } from "@webpack/common";
|
||||
|
||||
interface GoogleFontMetadata {
|
||||
family: string;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@
|
|||
import "./styles.css";
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { HeadingTertiary } from "@components/Heading";
|
||||
import { copyToClipboard } from "@utils/clipboard";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Button, Flex, Forms, Parser, useEffect, useState } from "@webpack/common";
|
||||
import { Button, Forms, Parser, useEffect, useState } from "@webpack/common";
|
||||
|
||||
import { FriendInvite } from "./types";
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ function CopyButton({ copyText, copiedText, onClick }) {
|
|||
function FriendInviteCard({ invite }: { invite: FriendInvite; }) {
|
||||
return (
|
||||
<div className="vc-friend-codes-card">
|
||||
<Flex justify={Flex.Justify.START}>
|
||||
<Flex justifyContent="start">
|
||||
<div className="vc-friend-codes-card-title">
|
||||
<HeadingTertiary style={{ textTransform: "none" }}>
|
||||
{invite.code}
|
||||
|
|
@ -50,7 +51,7 @@ function FriendInviteCard({ invite }: { invite: FriendInvite; }) {
|
|||
Expires {Parser.parse(`<t:${new Date(invite.expires_at).getTime() / 1000}:R>`)} • {invite.uses}/{invite.max_uses} uses
|
||||
</span>
|
||||
</div>
|
||||
<Flex justify={Flex.Justify.END}>
|
||||
<Flex justifyContent="end">
|
||||
<CopyButton
|
||||
copyText="Copy"
|
||||
copiedText="Copied!"
|
||||
|
|
@ -85,10 +86,10 @@ export default function FriendCodesPanel() {
|
|||
|
||||
<Flex
|
||||
style={{ marginBottom: "16px" }}
|
||||
justify={Flex.Justify.BETWEEN}
|
||||
justifyContent="space-between"
|
||||
>
|
||||
<h2 className="vc-friend-codes-info-header">{`Friend Codes - ${invites.length}`}</h2>
|
||||
<Flex justify={Flex.Justify.END}>
|
||||
<Flex justifyContent="end">
|
||||
<Button
|
||||
color={Button.Colors.GREEN}
|
||||
look={Button.Looks.FILLED}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@
|
|||
import { BadgeUserArgs, ProfileBadge } from "@api/Badges";
|
||||
import { Badges } from "@api/index";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { ModalContent, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Button, Flex, Forms, RelationshipStore } from "@webpack/common";
|
||||
import { Button, Forms, RelationshipStore } from "@webpack/common";
|
||||
|
||||
import { bestiesIcon, bloomingIcon, burningIcon, fighterIcon, royalIcon, sproutIcon, starIcon } from "./icons";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { settings } from "@equicordplugins/gifCollections/index";
|
||||
import { Collection, Gif } from "@equicordplugins/gifCollections/types";
|
||||
import { Toasts } from "@webpack/common";
|
||||
|
||||
import { settings } from "../index";
|
||||
import { Collection, Gif } from "../types";
|
||||
import { getFormat } from "./getFormat";
|
||||
|
||||
export const DATA_COLLECTION_NAME = "gif-collections-collections";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Format } from "../types";
|
||||
import { Format } from "@equicordplugins/gifCollections/types";
|
||||
|
||||
import { getUrlExtension } from "./getUrlExtension";
|
||||
|
||||
const videoExtensions = ["mp4", "ogg", "webm", "avi", "wmv", "flv", "mov", "mkv", "m4v"];
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { settings } from "@equicordplugins/gifCollections/index";
|
||||
import { Gif } from "@equicordplugins/gifCollections/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { MessageStore, SnowflakeUtils } from "@webpack/common";
|
||||
|
||||
import { settings } from "../index";
|
||||
import { Gif } from "../types";
|
||||
import { cleanUrl } from "./cleanUrl";
|
||||
import { isAudio } from "./isAudio";
|
||||
import { uuidv4 } from "./uuidv4";
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Gif } from "@equicordplugins/gifCollections/types";
|
||||
import { RestAPI } from "@webpack/common";
|
||||
|
||||
import { Gif } from "../types";
|
||||
|
||||
async function fetchMessageFromAPI(channelId: string, messageId: string): Promise<any> {
|
||||
try {
|
||||
const response = await RestAPI.get({
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { Toasts } from "@webpack/common";
|
|||
|
||||
import { DATA_COLLECTION_NAME, getCollections, refreshCacheCollection } from "./collectionManager";
|
||||
|
||||
// 99% of this is coppied from src\utils\settingsSync.ts
|
||||
// 99% of this is coppied from src/utils/settingsSync.ts
|
||||
|
||||
export async function downloadCollections() {
|
||||
const filename = "gif-collections.json";
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Button, TextButton } from "@components/Button";
|
||||
import { fetchReposByUserId, fetchReposByUsername, fetchUserInfo, GitHubUserInfo } from "@equicordplugins/githubRepos/githubApi";
|
||||
import { GitHubRepo } from "@equicordplugins/githubRepos/types";
|
||||
import { openModal } from "@utils/modal";
|
||||
import { React, useEffect, UserProfileStore, useState } from "@webpack/common";
|
||||
|
||||
import { cl, settings } from "..";
|
||||
import { fetchReposByUserId, fetchReposByUsername, fetchUserInfo, GitHubUserInfo } from "../githubApi";
|
||||
import { GitHubRepo } from "../types";
|
||||
import { RepoCard } from "./RepoCard";
|
||||
import { ReposModal } from "./ReposModal";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { getLanguageColor } from "@equicordplugins/githubRepos/colors";
|
||||
import { RepoCardProps } from "@equicordplugins/githubRepos/types";
|
||||
import { React, Tooltip } from "@webpack/common";
|
||||
|
||||
import { cl } from "..";
|
||||
import { getLanguageColor } from "../colors";
|
||||
import { RepoCardProps } from "../types";
|
||||
import { Star } from "./Star";
|
||||
|
||||
export function RepoCard({ repo, showStars, showLanguage }: RepoCardProps) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
import { Button } from "@components/Button";
|
||||
import { HeadingPrimary } from "@components/Heading";
|
||||
import { getLanguageColor } from "@equicordplugins/githubRepos/colors";
|
||||
import { GitHubRepo } from "@equicordplugins/githubRepos/types";
|
||||
import { ModalContent, ModalFooter, ModalHeader, ModalRoot } from "@utils/modal";
|
||||
import { React } from "@webpack/common";
|
||||
|
||||
import { cl } from "..";
|
||||
import { getLanguageColor } from "../colors";
|
||||
import { GitHubRepo } from "../types";
|
||||
import { Star } from "./Star";
|
||||
|
||||
interface ReposModalProps {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { IconProps } from "@equicordplugins/githubRepos/types";
|
||||
import { React } from "@webpack/common";
|
||||
|
||||
import { IconProps } from "../types";
|
||||
|
||||
export function Star({ className, width = 16, height = 16 }: IconProps) {
|
||||
return (
|
||||
<svg
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ async function zipGuildAssets(guild: Guild, type: "emojis" | "stickers") {
|
|||
Promise.all(assetPromises)
|
||||
.then(results => {
|
||||
const zipped = zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
|
||||
const blob = new Blob([zipped], { type: "application/zip" });
|
||||
const blob = new Blob([new Uint8Array(zipped)], { type: "application/zip" });
|
||||
const link = document.createElement("a");
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = `${guild.name}-${type}.zip`;
|
||||
|
|
|
|||
|
|
@ -20,11 +20,10 @@ import "@equicordplugins/_misc/styles.css";
|
|||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { disableStyle, enableStyle } from "@api/Styles";
|
||||
import clanBadges from "@equicordplugins/_misc/clanBadges.css?managed";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
||||
import clanBadges from "../_misc/clanBadges.css?managed";
|
||||
|
||||
const settings = definePluginSettings({
|
||||
hideTags: {
|
||||
type: OptionType.BOOLEAN,
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
import "./style.css";
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { HiddenServersStore } from "@equicordplugins/hideServers/HiddenServersStore";
|
||||
import { Button, GuildStore, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { HiddenServersStore } from "../HiddenServersStore";
|
||||
import { openHiddenServersModal } from "./HiddenServersMenu";
|
||||
|
||||
const cl = classNameFactory("vc-hideservers-");
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
import { classNameFactory } from "@api/Styles";
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { HiddenServersStore } from "@equicordplugins/hideServers/HiddenServersStore";
|
||||
import { getGuildAcronym } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import {
|
||||
|
|
@ -24,7 +25,6 @@ import { findByPropsLazy } from "@webpack";
|
|||
import { Button, IconUtils, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { SortedGuildStore } from "..";
|
||||
import { HiddenServersStore } from "../HiddenServersStore";
|
||||
|
||||
const cl = classNameFactory("vc-hideservers-");
|
||||
const IconClasses = findByPropsLazy("icon", "acronym", "childWrapper");
|
||||
|
|
|
|||
|
|
@ -6,13 +6,12 @@
|
|||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { noteHandler } from "@equicordplugins/holyNotes/NoteHandler";
|
||||
import { downloadNotes, uploadNotes } from "@equicordplugins/holyNotes/utils";
|
||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal";
|
||||
import { findByProps } from "@webpack";
|
||||
import { Button } from "@webpack/common";
|
||||
|
||||
import { noteHandler } from "../../NoteHandler";
|
||||
import { downloadNotes, uploadNotes } from "../../utils";
|
||||
|
||||
export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void; }) => {
|
||||
const { statusTagGreen } = findByProps("statusTagGreen");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { SvgOverFlowIcon } from "@equicordplugins/holyNotes/components/icons/overFlowIcon";
|
||||
import { classes } from "@utils/misc";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Button, Clickable, Menu, Popout, React, useRef } from "@webpack/common";
|
||||
|
||||
import { SvgOverFlowIcon } from "../icons/overFlowIcon";
|
||||
|
||||
const { overflowIcon } = findByPropsLazy("overflowIcon", "forceButtonsShow");
|
||||
|
||||
export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: string[], selectedTabId: string, onSelectTab: (tab: string) => void; }) {
|
||||
|
|
|
|||
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Flex } from "@components/Flex";
|
||||
import HelpIcon from "@equicordplugins/holyNotes/components/icons/HelpIcon";
|
||||
import { noteHandler } from "@equicordplugins/holyNotes/NoteHandler";
|
||||
import { HolyNotes } from "@equicordplugins/holyNotes/types";
|
||||
import { classes } from "@utils/misc";
|
||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { findByProps } from "@webpack";
|
||||
import { ContextMenuApi, Flex, FluxDispatcher, Menu, React, TextInput } from "@webpack/common";
|
||||
import { ContextMenuApi, FluxDispatcher, Menu, React, TextInput } from "@webpack/common";
|
||||
|
||||
import { noteHandler } from "../../NoteHandler";
|
||||
import { HolyNotes } from "../../types";
|
||||
import HelpIcon from "../icons/HelpIcon";
|
||||
import Errors from "./Error";
|
||||
import HelpModal from "./HelpModal";
|
||||
import ManageNotebookButton from "./ManageNotebookButton";
|
||||
|
|
@ -82,7 +83,7 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => {
|
|||
return (
|
||||
<ErrorBoundary>
|
||||
<ModalRoot {...props} className={classes("vc-notebook")} size={ModalSize.LARGE}>
|
||||
<Flex className={classes("vc-notebook-flex")} direction={Flex.Direction.VERTICAL} style={{ width: "100%" }}>
|
||||
<Flex className={classes("vc-notebook-flex")} flexDirection="column" style={{ width: "100%" }}>
|
||||
<div className={classes("vc-notebook-top-section")}>
|
||||
<ModalHeader className={classes("vc-notebook-header-main")}>
|
||||
<BaseText
|
||||
|
|
@ -126,7 +127,7 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => {
|
|||
<ManageNotebookButton notebook={currentNotebook} setNotebook={setCurrentNotebook} />
|
||||
<div className={classes("sort-button-container", "vc-notebook-display-left")}>
|
||||
<Flex
|
||||
align={Flex.Align.CENTER}
|
||||
alignItems="center"
|
||||
className={quickSelect}
|
||||
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
|
||||
ContextMenuApi.openContextMenu(event, () => (
|
||||
|
|
@ -166,7 +167,7 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => {
|
|||
}}
|
||||
>
|
||||
<BaseText className={quickSelectLabel}>Change Sorting:</BaseText>
|
||||
<Flex grow={0} align={Flex.Align.CENTER} className={quickSelectQuick}>
|
||||
<Flex style={{ flexGrow: 0 }} alignItems="center" className={quickSelectQuick}>
|
||||
<BaseText className={quickSelectValue}>
|
||||
{sortDirection ? "Ascending" : "Descending"} /{" "}
|
||||
{sortType ? "Date Added" : "Message Date"}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@
|
|||
*/
|
||||
|
||||
import { HeadingSecondary } from "@components/Heading";
|
||||
import { noteHandler } from "@equicordplugins/holyNotes/NoteHandler";
|
||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal";
|
||||
import { Button, React, TextInput } from "@webpack/common";
|
||||
|
||||
import { noteHandler } from "../../NoteHandler";
|
||||
|
||||
export default (props: ModalProps & { onClose: () => void; }) => {
|
||||
const [notebookName, setNotebookName] = React.useState("");
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { HeadingSecondary } from "@components/Heading";
|
||||
import { noteHandler } from "@equicordplugins/holyNotes/NoteHandler";
|
||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal";
|
||||
import { Button, React } from "@webpack/common";
|
||||
|
||||
import { noteHandler } from "../../NoteHandler";
|
||||
import Error from "./Error";
|
||||
import { RenderMessage } from "./RenderMessage";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,14 @@
|
|||
import { CopyIcon, DeleteIcon, IDIcon, LinkIcon, OpenExternalIcon } from "@components/Icons";
|
||||
import { makeDummyUser } from "@components/settings/tabs/plugins/PluginModal";
|
||||
import { MessageType } from "@equicordplugins/holyNotes";
|
||||
import { noteHandler } from "@equicordplugins/holyNotes/NoteHandler";
|
||||
import { HolyNotes } from "@equicordplugins/holyNotes/types";
|
||||
import { copyToClipboard } from "@utils/clipboard";
|
||||
import { classes } from "@utils/misc";
|
||||
import { ModalProps } from "@utils/modal";
|
||||
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import { ContextMenuApi, FluxDispatcher, Menu, NavigationRouter, React } from "@webpack/common";
|
||||
|
||||
import { noteHandler } from "../../NoteHandler";
|
||||
import { HolyNotes } from "../../types";
|
||||
|
||||
const messageClasses = findByPropsLazy("message", "groupStart", "cozyMessage");
|
||||
const Channel = findByCodeLazy("computeLurkerPermissionsAllowList(){");
|
||||
const ChannelMessage = findComponentByCodeLazy("Message must not be a thread");
|
||||
|
|
|
|||
|
|
@ -6,9 +6,10 @@
|
|||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { openUserProfile } from "@utils/discord";
|
||||
import { Avatar, Clickable, Flex, React, TextInput, Tooltip, } from "@webpack/common";
|
||||
import { Avatar, Clickable, React, TextInput, Tooltip, } from "@webpack/common";
|
||||
|
||||
import { Data, IStorageUser } from "./data";
|
||||
|
||||
|
|
|
|||
227
src/equicordplugins/invisibleChat.desktop/index.tsx
Normal file
227
src/equicordplugins/invisibleChat.desktop/index.tsx
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
* Vencord, a modification for Discord's desktop app
|
||||
* Copyright (c) 2023 Vendicated and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons";
|
||||
import { updateMessage } from "@api/MessageUpdater";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { getStegCloak } from "@utils/dependencies";
|
||||
import definePlugin, { OptionType, ReporterTestable } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { ChannelStore, Constants, RestAPI, Tooltip } from "@webpack/common";
|
||||
|
||||
import { buildDecModal } from "./components/DecryptionModal";
|
||||
import { buildEncModal } from "./components/EncryptionModal";
|
||||
|
||||
let steggo: any;
|
||||
|
||||
function PopOverIcon() {
|
||||
return (
|
||||
|
||||
<svg
|
||||
fill="var(--header-secondary)"
|
||||
width={24} height={24}
|
||||
viewBox={"0 0 64 64"}
|
||||
>
|
||||
<path d="M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function Indicator() {
|
||||
return (
|
||||
<Tooltip text="This message has a hidden message! (InvisibleChat)">
|
||||
{({ onMouseEnter, onMouseLeave }) => (
|
||||
<img
|
||||
aria-label="Hidden Message Indicator (InvisibleChat)"
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
src="https://github.com/SammCheese/invisible-chat/raw/NewReplugged/src/assets/lock.png"
|
||||
width={20}
|
||||
height={20}
|
||||
style={{ transform: "translateY(4p)", paddingInline: 4 }}
|
||||
/>
|
||||
)}
|
||||
</Tooltip>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
const ChatBarIcon: ChatBarButtonFactory = ({ isMainChat }) => {
|
||||
if (!isMainChat) return null;
|
||||
|
||||
return (
|
||||
<ChatBarButton
|
||||
tooltip="Encrypt Message"
|
||||
onClick={() => buildEncModal()}
|
||||
buttonProps={{
|
||||
"aria-haspopup": "dialog",
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
aria-hidden
|
||||
role="img"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox={"0 0 64 64"}
|
||||
style={{ scale: "1.39", translate: "0 -1px" }}
|
||||
>
|
||||
<path fill="currentColor" d="M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z" />
|
||||
</svg>
|
||||
</ChatBarButton>
|
||||
);
|
||||
};
|
||||
|
||||
const settings = definePluginSettings({
|
||||
savedPasswords: {
|
||||
type: OptionType.STRING,
|
||||
default: "password, Password",
|
||||
description: "Saved Passwords (Seperated with a , )"
|
||||
}
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
name: "InvisibleChat",
|
||||
description: "Encrypt your Messages in a non-suspicious way!",
|
||||
authors: [Devs.SammCheese],
|
||||
dependencies: ["MessageUpdaterAPI"],
|
||||
reporterTestable: ReporterTestable.Patches,
|
||||
settings,
|
||||
|
||||
patches: [
|
||||
{
|
||||
// Indicator
|
||||
find: ".SEND_FAILED,",
|
||||
replacement: {
|
||||
match: /let\{className:\i,message:\i[^}]*\}=(\i)/,
|
||||
replace: "try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&"
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
EMBED_API_URL: "https://embed.sammcheese.net",
|
||||
INV_REGEX: new RegExp(/( \u200c|\u200d |[\u2060-\u2064])[^\u200b]/),
|
||||
URL_REGEX: new RegExp(
|
||||
/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,
|
||||
),
|
||||
async start() {
|
||||
const { default: StegCloak } = await getStegCloak();
|
||||
steggo = new StegCloak(true, false);
|
||||
},
|
||||
|
||||
renderMessagePopoverButton(message) {
|
||||
return this.INV_REGEX.test(message?.content)
|
||||
? {
|
||||
label: "Decrypt Message",
|
||||
icon: this.popOverIcon,
|
||||
message: message,
|
||||
channel: ChannelStore.getChannel(message.channel_id),
|
||||
onClick: async () => {
|
||||
const res = await iteratePasswords(message);
|
||||
|
||||
if (res)
|
||||
this.buildEmbed(message, res);
|
||||
else
|
||||
buildDecModal({ message });
|
||||
}
|
||||
}
|
||||
: null;
|
||||
},
|
||||
|
||||
renderChatBarButton: ChatBarIcon,
|
||||
|
||||
colorCodeFromNumber(color: number): string {
|
||||
return `#${[color >> 16, color >> 8, color]
|
||||
.map(x => (x & 0xFF).toString(16))
|
||||
.join("")}`;
|
||||
},
|
||||
|
||||
// Gets the Embed of a Link
|
||||
async getEmbed(url: URL): Promise<Object | {}> {
|
||||
const { body } = await RestAPI.post({
|
||||
url: Constants.Endpoints.UNFURL_EMBED_URLS,
|
||||
body: {
|
||||
urls: [url]
|
||||
}
|
||||
});
|
||||
// The endpoint returns the color as a number, but Discord expects a string
|
||||
body.embeds[0].color = this.colorCodeFromNumber(body.embeds[0].color);
|
||||
return await body.embeds[0];
|
||||
},
|
||||
|
||||
async buildEmbed(message: any, revealed: string): Promise<void> {
|
||||
const urlCheck = revealed.match(this.URL_REGEX);
|
||||
|
||||
message.embeds.push({
|
||||
type: "rich",
|
||||
rawTitle: "Decrypted Message",
|
||||
color: "#45f5f5",
|
||||
rawDescription: revealed,
|
||||
footer: {
|
||||
text: "Made with ❤️ by c0dine and Sammy!",
|
||||
},
|
||||
});
|
||||
|
||||
if (urlCheck?.length) {
|
||||
const embed = await this.getEmbed(new URL(urlCheck[0]));
|
||||
if (embed)
|
||||
message.embeds.push(embed);
|
||||
}
|
||||
|
||||
updateMessage(message.channel_id, message.id, { embeds: message.embeds });
|
||||
},
|
||||
|
||||
popOverIcon: () => <PopOverIcon />,
|
||||
indicator: ErrorBoundary.wrap(Indicator, { noop: true })
|
||||
});
|
||||
|
||||
export function encrypt(secret: string, password: string, cover: string): string {
|
||||
return steggo.hide(secret + "\u200b", password, cover);
|
||||
}
|
||||
|
||||
export function decrypt(encrypted: string, password: string, removeIndicator: boolean): string {
|
||||
const decrypted = steggo.reveal(encrypted, password);
|
||||
return removeIndicator ? decrypted.replace("\u200b", "") : decrypted;
|
||||
}
|
||||
|
||||
export function isCorrectPassword(result: string): boolean {
|
||||
return result.endsWith("\u200b");
|
||||
}
|
||||
|
||||
export async function iteratePasswords(message: Message): Promise<string | false> {
|
||||
const passwords = settings.store.savedPasswords.split(",").map(s => s.trim());
|
||||
|
||||
if (!message?.content || !passwords?.length) return false;
|
||||
|
||||
let { content } = message;
|
||||
|
||||
// we use an extra variable so we dont have to edit the message content directly
|
||||
if (/^\W/.test(message.content)) content = `d ${message.content}d`;
|
||||
|
||||
for (let i = 0; i < passwords.length; i++) {
|
||||
const result = decrypt(content, passwords[i], false);
|
||||
if (isCorrectPassword(result)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7,12 +7,12 @@
|
|||
import "./style.css";
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { actions } from "@equicordplugins/keyboardNavigation/commands";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { closeAllModals, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { React, TextInput, useEffect, useState } from "@webpack/common";
|
||||
|
||||
import { settings } from "..";
|
||||
import { actions } from "../commands";
|
||||
|
||||
const logger = new Logger("CommandPalette", "#e5c890");
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
import "./style.css";
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { ButtonAction } from "@equicordplugins/keyboardNavigation/commands";
|
||||
import { closeAllModals, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { React, TextInput, useEffect, useState } from "@webpack/common";
|
||||
|
||||
import { settings } from "..";
|
||||
import { ButtonAction } from "../commands";
|
||||
|
||||
interface MultipleChoiceProps {
|
||||
modalProps: ModalProps;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { images } from "@equicordplugins/loginWithQR/images";
|
||||
import { getIntlMessage } from "@utils/discord";
|
||||
import {
|
||||
ModalContent,
|
||||
|
|
@ -25,7 +26,6 @@ import {
|
|||
import jsQR, { QRCode } from "jsqr";
|
||||
import { MutableRefObject, ReactElement } from "react";
|
||||
|
||||
import { images } from "../../images";
|
||||
import { cl, QrCodeIcon, Spinner, SpinnerTypes } from "..";
|
||||
import openVerifyModal from "./VerifyModal";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Button, TextButton } from "@components/Button";
|
||||
import { images } from "@equicordplugins/loginWithQR/images";
|
||||
import { getIntlMessage } from "@utils/discord";
|
||||
import {
|
||||
ModalContent,
|
||||
|
|
@ -23,7 +24,6 @@ import {
|
|||
useState,
|
||||
} from "@webpack/common";
|
||||
|
||||
import { images } from "../../images";
|
||||
import { cl } from "..";
|
||||
|
||||
const { Controller } = findByPropsLazy("Controller");
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@
|
|||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import { DEFAULT_IMAGE_CACHE_DIR } from "@equicordplugins/messageLoggerEnhanced/utils/constants";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
import { Button, Toasts } from "@webpack/common";
|
||||
|
||||
import { Native, settings } from "..";
|
||||
import { DEFAULT_IMAGE_CACHE_DIR } from "../utils/constants";
|
||||
|
||||
const cl = classNameFactory("folder-upload");
|
||||
|
||||
|
|
|
|||
|
|
@ -8,19 +8,18 @@ import { classNameFactory } from "@api/Styles";
|
|||
import { BaseText } from "@components/BaseText";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { InfoIcon } from "@components/Icons";
|
||||
import { clearMessagesIDB, DBMessageRecord, deleteMessageIDB, deleteMessagesBulkIDB } from "@equicordplugins/messageLoggerEnhanced/db";
|
||||
import { settings } from "@equicordplugins/messageLoggerEnhanced/index";
|
||||
import { LoggedMessage, LoggedMessageJSON } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { messageJsonToMessageClass } from "@equicordplugins/messageLoggerEnhanced/utils";
|
||||
import { importLogs } from "@equicordplugins/messageLoggerEnhanced/utils/settingsUtils";
|
||||
import { openUserProfile } from "@utils/discord";
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import { closeAllModals, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { LazyComponent } from "@utils/react";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { find, findByCode, findByCodeLazy } from "@webpack";
|
||||
import { Alerts, Button, ChannelStore, ContextMenuApi, FluxDispatcher, GuildStore, Menu, NavigationRouter, React, TabBar, TextInput, Tooltip, useMemo, useRef, useState } from "@webpack/common";
|
||||
|
||||
import { clearMessagesIDB, DBMessageRecord, deleteMessageIDB, deleteMessagesBulkIDB } from "../db";
|
||||
import { settings } from "../index";
|
||||
import { LoggedMessage, LoggedMessageJSON } from "../types";
|
||||
import { messageJsonToMessageClass } from "../utils";
|
||||
import { importLogs } from "../utils/settingsUtils";
|
||||
import { useMessages } from "./hooks";
|
||||
|
||||
export interface MessagePreviewProps {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { countMessagesByStatusIDB, countMessagesIDB, DBMessageRecord, DBMessageStatus, getDateStortedMessagesByStatusIDB } from "@equicordplugins/messageLoggerEnhanced/db";
|
||||
import { doesMatch, tokenizeQuery } from "@equicordplugins/messageLoggerEnhanced/utils/parseQuery";
|
||||
import { useEffect, useState } from "@webpack/common";
|
||||
|
||||
import { countMessagesByStatusIDB, countMessagesIDB, DBMessageRecord, DBMessageStatus, getDateStortedMessagesByStatusIDB } from "../db";
|
||||
import { doesMatch, tokenizeQuery } from "../utils/parseQuery";
|
||||
import { LogTabs } from "./LogsModal";
|
||||
|
||||
function useDebouncedValue<T>(value: T, delay: number): T {
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
import { readdir, readFile, unlink, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
import { LoggedAttachment } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { LOGS_DATA_FILENAME } from "@equicordplugins/messageLoggerEnhanced/utils/constants";
|
||||
import { DATA_DIR } from "@main/utils/constants";
|
||||
import { dialog, IpcMainInvokeEvent, shell } from "electron";
|
||||
|
||||
import { LoggedAttachment } from "../types";
|
||||
import { LOGS_DATA_FILENAME } from "../utils/constants";
|
||||
import { getSettings, saveSettings } from "./settings";
|
||||
import { ensureDirectoryExists, getAttachmentIdFromFilename, sleep } from "./utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { settings } from "../index";
|
||||
import { settings } from "@equicordplugins/messageLoggerEnhanced/index";
|
||||
|
||||
export class LimitedMap<K, V> {
|
||||
public map: Map<K, V> = new Map();
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoggedMessageJSON, RefrencedMessage } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { MessageStore } from "@webpack/common";
|
||||
|
||||
import { LoggedMessageJSON, RefrencedMessage } from "../types";
|
||||
import { getGuildIdByChannel, isGhostPinged } from "./index";
|
||||
|
||||
export function cleanupMessage(message: any, removeDetails: boolean = true): LoggedMessageJSON {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
*/
|
||||
|
||||
import { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from "@api/ContextMenu";
|
||||
import { openLogModal } from "@equicordplugins/messageLoggerEnhanced/components/LogsModal";
|
||||
import { deleteMessageIDB } from "@equicordplugins/messageLoggerEnhanced/db";
|
||||
import { settings } from "@equicordplugins/messageLoggerEnhanced/index";
|
||||
import { FluxDispatcher, Menu, MessageActions, React, Toasts, UserStore } from "@webpack/common";
|
||||
|
||||
import { openLogModal } from "../components/LogsModal";
|
||||
import { deleteMessageIDB } from "../db";
|
||||
import { settings } from "../index";
|
||||
import { addToXAndRemoveFromOpposite, ListType, removeFromX } from ".";
|
||||
|
||||
const idFunctions = {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
*/
|
||||
|
||||
import { Settings } from "@api/Settings";
|
||||
import { settings } from "@equicordplugins/messageLoggerEnhanced/index";
|
||||
import { LoggedMessageJSON } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { ChannelStore, SelectedChannelStore, UserStore } from "@webpack/common";
|
||||
|
||||
import { settings } from "../index";
|
||||
import { LoggedMessageJSON } from "../types";
|
||||
import { findLastIndex, getGuildIdByChannel } from "./misc";
|
||||
|
||||
export * from "./cleanUp";
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { DBMessageStatus } from "@equicordplugins/messageLoggerEnhanced/db";
|
||||
import { LoggedMessageJSON } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { PluginNative } from "@utils/types";
|
||||
import { findByCodeLazy, findLazy } from "@webpack";
|
||||
import { ChannelStore, moment, UserStore } from "@webpack/common";
|
||||
|
||||
import { DBMessageStatus } from "../db";
|
||||
import { LoggedMessageJSON } from "../types";
|
||||
import { DEFAULT_IMAGE_CACHE_DIR } from "./constants";
|
||||
import { DISCORD_EPOCH } from "./index";
|
||||
import { memoize } from "./memoize";
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoggedMessageJSON } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { ChannelStore, GuildStore } from "@webpack/common";
|
||||
|
||||
import { LoggedMessageJSON } from "../types";
|
||||
import { getGuildIdByChannel } from "./index";
|
||||
import { memoize } from "./memoize";
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,11 @@ import {
|
|||
keys,
|
||||
set,
|
||||
} from "@api/DataStore";
|
||||
import { Flogger, Native } from "@equicordplugins/messageLoggerEnhanced";
|
||||
import { LoggedAttachment } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { DEFAULT_IMAGE_CACHE_DIR } from "@equicordplugins/messageLoggerEnhanced/utils/constants";
|
||||
import { sleep } from "@utils/misc";
|
||||
|
||||
import { Flogger, Native } from "../..";
|
||||
import { LoggedAttachment } from "../../types";
|
||||
import { DEFAULT_IMAGE_CACHE_DIR } from "../constants";
|
||||
|
||||
const ImageStore = createStore("MessageLoggerImageData", "MessageLoggerImageStore");
|
||||
|
||||
interface IDBSavedImage { attachmentId: string, path: string; }
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Flogger, settings } from "@equicordplugins/messageLoggerEnhanced";
|
||||
import { LoggedAttachment, LoggedMessage, LoggedMessageJSON } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { memoize } from "@equicordplugins/messageLoggerEnhanced/utils/memoize";
|
||||
import { MessageAttachment } from "@vencord/discord-types";
|
||||
|
||||
import { Flogger, settings } from "../..";
|
||||
import { LoggedAttachment, LoggedMessage, LoggedMessageJSON } from "../../types";
|
||||
import { memoize } from "../memoize";
|
||||
import { deleteImage, downloadAttachment, getImage, } from "./ImageManager";
|
||||
|
||||
export function getFileExtension(str: string) {
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { addMessagesBulkIDB, DBMessageRecord, getAllMessagesIDB } from "@equicordplugins/messageLoggerEnhanced/db";
|
||||
import { LoggedMessage, LoggedMessageJSON } from "@equicordplugins/messageLoggerEnhanced/types";
|
||||
import { chooseFile as chooseFileWeb } from "@utils/web";
|
||||
import { Toasts } from "@webpack/common";
|
||||
|
||||
import { Native } from "..";
|
||||
import { addMessagesBulkIDB, DBMessageRecord, getAllMessagesIDB } from "../db";
|
||||
import { LoggedMessage, LoggedMessageJSON } from "../types";
|
||||
|
||||
async function getLogContents(): Promise<string> {
|
||||
if (IS_WEB) {
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { CategoryImageProps, StickerCategoryProps } from "@equicordplugins/moreStickers/types";
|
||||
import { cl } from "@equicordplugins/moreStickers/utils";
|
||||
import { React } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { CategoryImageProps, StickerCategoryProps } from "../types";
|
||||
import { cl } from "../utils";
|
||||
|
||||
export function CategoryImage({ src, alt, isActive }: CategoryImageProps) {
|
||||
return (
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -11,16 +11,15 @@ import { Divider } from "@components/Divider";
|
|||
import { Flex } from "@components/Flex";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { convert as convertLineEP, getIdFromUrl as getLineEmojiPackIdFromUrl, getStickerPackById as getLineEmojiPackById, isLineEmojiPackHtml, parseHtml as getLineEPFromHtml } from "@equicordplugins/moreStickers/lineEmojis";
|
||||
import { convert as convertLineSP, getIdFromUrl as getLineStickerPackIdFromUrl, getStickerPackById as getLineStickerPackById, isLineStickerPackHtml, parseHtml as getLineSPFromHtml } from "@equicordplugins/moreStickers/lineStickers";
|
||||
import { isV1, migrate } from "@equicordplugins/moreStickers/migrate-v1";
|
||||
import { deleteStickerPack, getStickerPack, getStickerPackMetas, saveStickerPack } from "@equicordplugins/moreStickers/stickers";
|
||||
import { SettingsTabsKey, Sticker, StickerPack, StickerPackMeta } from "@equicordplugins/moreStickers/types";
|
||||
import { cl, clPicker, Mutex } from "@equicordplugins/moreStickers/utils";
|
||||
import { Button, React, TabBar, TextArea, Toasts } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { convert as convertLineEP, getIdFromUrl as getLineEmojiPackIdFromUrl, getStickerPackById as getLineEmojiPackById, isLineEmojiPackHtml, parseHtml as getLineEPFromHtml } from "../lineEmojis";
|
||||
import { convert as convertLineSP, getIdFromUrl as getLineStickerPackIdFromUrl, getStickerPackById as getLineStickerPackById, isLineStickerPackHtml, parseHtml as getLineSPFromHtml } from "../lineStickers";
|
||||
import { isV1, migrate } from "../migrate-v1";
|
||||
import { deleteStickerPack, getStickerPack, getStickerPackMetas, saveStickerPack } from "../stickers";
|
||||
import { SettingsTabsKey, Sticker, StickerPack, StickerPackMeta } from "../types";
|
||||
import { cl, clPicker, Mutex } from "../utils";
|
||||
|
||||
const mutex = new Mutex();
|
||||
|
||||
// The ID of recent sticker and recent sticker pack
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
*/
|
||||
|
||||
import { HeadingPrimary } from "@components/Heading";
|
||||
import { PickerContent, PickerContentHeader, PickerContentRow, PickerContentRowGrid, PickerHeaderProps, SidebarProps, Sticker, StickerCategoryType, StickerPack } from "@equicordplugins/moreStickers/types";
|
||||
import { sendSticker } from "@equicordplugins/moreStickers/upload";
|
||||
import { clPicker, FFmpegStateContext } from "@equicordplugins/moreStickers/utils";
|
||||
import { debounce } from "@shared/debounce";
|
||||
import { ModalContent, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { React, TextInput } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import { PickerContent, PickerContentHeader, PickerContentRow, PickerContentRowGrid, PickerHeaderProps, SidebarProps, Sticker, StickerCategoryType, StickerPack } from "../types";
|
||||
import { sendSticker } from "../upload";
|
||||
import { clPicker, FFmpegStateContext } from "../utils";
|
||||
import { CategoryImage, CategoryScroller, CategoryWrapper, StickerCategory } from "./categories";
|
||||
import { CancelIcon, CogIcon, IconContainer, RecentlyUsedIcon, SearchIcon } from "./icons";
|
||||
import { addRecentSticker, getRecentStickers, Header, Packs, RECENT_STICKERS_ID, RECENT_STICKERS_TITLE } from "./misc";
|
||||
|
|
|
|||
|
|
@ -88,7 +88,13 @@ async function toGIF(url: string, ffmpeg: FFmpeg): Promise<File> {
|
|||
if (typeof data === "string") {
|
||||
throw new Error("Could not read file");
|
||||
}
|
||||
return new File([new Uint8Array(data.buffer)], outputFilename, { type: "image/gif" });
|
||||
|
||||
const uint8 = new Uint8Array(data.length);
|
||||
uint8.set(data);
|
||||
|
||||
return new File([uint8], outputFilename, {
|
||||
type: "image/gif",
|
||||
});
|
||||
}
|
||||
|
||||
export async function sendSticker({
|
||||
|
|
|
|||
|
|
@ -5,11 +5,13 @@
|
|||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Card } from "@components/Card";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { FormSwitch } from "@components/FormSwitch";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { OptionType } from "@utils/types";
|
||||
import { Card, Flex, Forms, TextInput, Tooltip } from "@webpack/common";
|
||||
import { Forms, TextInput, Tooltip } from "@webpack/common";
|
||||
|
||||
import { Tag, tags } from "./consts";
|
||||
import { TagSettings } from "./types";
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { Track } from "@equicordplugins/musicControls/spotify/SpotifyStore";
|
||||
|
||||
import { settings } from "../../settings";
|
||||
import { Track } from "../SpotifyStore";
|
||||
import { getLyricsLrclib } from "./providers/lrclibAPI";
|
||||
import { getLyricsSpotify } from "./providers/SpotifyAPI";
|
||||
import { LyricsData, Provider, SyncedLyric } from "./providers/types";
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import { providers } from "@equicordplugins/musicControls/spotify/lyrics/api";
|
||||
import { lyricsAlternative } from "@equicordplugins/musicControls/spotify/lyrics/providers/store";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { FluxDispatcher, Menu } from "@webpack/common";
|
||||
|
||||
import { providers } from "../api";
|
||||
import { lyricsAlternative } from "../providers/store";
|
||||
import { useLyrics } from "./util";
|
||||
|
||||
const CopyIcon = findComponentByCodeLazy(" 1-.5.5H10a6");
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { SpotifyLrcStore } from "@equicordplugins/musicControls/spotify/lyrics/providers/store";
|
||||
import { SpotifyStore } from "@equicordplugins/musicControls/spotify/SpotifyStore";
|
||||
import { openModal } from "@utils/modal";
|
||||
import { ContextMenuApi, React, TooltipContainer, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { settings } from "../../../settings";
|
||||
import { SpotifyStore } from "../../SpotifyStore";
|
||||
import { SpotifyLrcStore } from "../providers/store";
|
||||
import { LyricsContextMenu } from "./ctxMenu";
|
||||
import { LyricsModal } from "./modal";
|
||||
import { cl, NoteSvg, useLyrics } from "./util";
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { SpotifyStore, Track } from "@equicordplugins/musicControls/spotify/SpotifyStore";
|
||||
import { openImageModal } from "@utils/discord";
|
||||
import { ModalContent, ModalHeader, ModalProps, ModalRoot } from "@utils/modal";
|
||||
import { React } from "@webpack/common";
|
||||
|
||||
import { SpotifyStore, Track } from "../../SpotifyStore";
|
||||
import { cl, NoteSvg, scrollClasses, useLyrics } from "./util";
|
||||
|
||||
const formatTime = (time: number) => {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { SpotifyLrcStore } from "@equicordplugins/musicControls/spotify/lyrics/providers/store";
|
||||
import { SyncedLyric } from "@equicordplugins/musicControls/spotify/lyrics/providers/types";
|
||||
import { SpotifyStore } from "@equicordplugins/musicControls/spotify/SpotifyStore";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { settings } from "../../../settings";
|
||||
import { SpotifyStore } from "../../SpotifyStore";
|
||||
import { SpotifyLrcStore } from "../providers/store";
|
||||
import { SyncedLyric } from "../providers/types";
|
||||
|
||||
export const scrollClasses = findByPropsLazy("auto", "customTheme");
|
||||
|
||||
export const cl = classNameFactory("vc-spotify-lyrics-");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { LyricsData, Provider } from "../types";
|
||||
import { LyricsData, Provider } from "@equicordplugins/musicControls/spotify/lyrics/providers/types";
|
||||
|
||||
interface LyricsAPIResp {
|
||||
error: boolean;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Track } from "../../../SpotifyStore";
|
||||
import { LyricsData, Provider } from "../types";
|
||||
import { LyricsData, Provider } from "@equicordplugins/musicControls/spotify/lyrics/providers/types";
|
||||
import { Track } from "@equicordplugins/musicControls/spotify/SpotifyStore";
|
||||
|
||||
const baseUrlLrclib = "https://lrclib.net/api/get";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
*/
|
||||
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { getLyrics, lyricFetchers, providers, updateLyrics } from "@equicordplugins/musicControls/spotify/lyrics/api";
|
||||
import { SpotifyStore, type Track } from "@equicordplugins/musicControls/spotify/SpotifyStore";
|
||||
import { proxyLazyWebpack } from "@webpack";
|
||||
import { Flux, FluxDispatcher } from "@webpack/common";
|
||||
|
||||
import { settings } from "../../../settings";
|
||||
import { SpotifyStore, type Track } from "../../SpotifyStore";
|
||||
import { getLyrics, lyricFetchers, providers, updateLyrics } from "../api";
|
||||
import { lyricsAlternativeFetchers } from "./translator";
|
||||
import { LyricsData, Provider } from "./types";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import settings from "../../../..";
|
||||
import { Provider, SyncedLyric } from "../types";
|
||||
import settings from "@equicordplugins/musicControls";
|
||||
import { Provider, SyncedLyric } from "@equicordplugins/musicControls/spotify/lyrics/providers/types";
|
||||
|
||||
// stolen from src\plugins\translate\utils.ts
|
||||
// stolen from src/plugins/translate/utils.ts
|
||||
|
||||
interface GoogleData {
|
||||
src: string;
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@ import "./tidalStyles.css";
|
|||
|
||||
import { Settings } from "@api/Settings";
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { ImageIcon, LinkIcon, OpenExternalIcon } from "@components/Icons";
|
||||
import { SeekBar } from "@equicordplugins/musicControls/spotify/SeekBar";
|
||||
import { debounce } from "@shared/debounce";
|
||||
import { openImageModal } from "@utils/discord";
|
||||
import { classes, copyWithToast } from "@utils/misc";
|
||||
import { ContextMenuApi, Flex, FluxDispatcher, Menu, React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
import { copyWithToast, openImageModal } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import { ContextMenuApi, FluxDispatcher, Menu, React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { SeekBar } from "../spotify/SeekBar";
|
||||
import { type PlayerState, type Repeat, TidalStore } from "./TidalStore";
|
||||
|
||||
const cl = (className: string) => `eq-tdl-${className}`;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Track } from "../TidalStore";
|
||||
import { Track } from "@equicordplugins/musicControls/tidal/TidalStore";
|
||||
|
||||
import { EnhancedLyric } from "./types";
|
||||
|
||||
export async function getLyrics(track: Track | null, retries = 3): Promise<EnhancedLyric[] | null> {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { FluxDispatcher, Menu } from "@webpack/common";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { TidalLrcStore } from "@equicordplugins/musicControls/tidal/lyrics/providers/store";
|
||||
import { TidalStore } from "@equicordplugins/musicControls/tidal/TidalStore";
|
||||
import { openModal } from "@utils/modal";
|
||||
import { ContextMenuApi, TooltipContainer, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { settings } from "../../../settings";
|
||||
import { TidalStore } from "../../TidalStore";
|
||||
import { TidalLrcStore } from "../providers/store";
|
||||
import { LyricsContextMenu } from "./ctxMenu";
|
||||
import { LyricsModal } from "./modal";
|
||||
import { cl, NoteSvg, useLyrics } from "./util";
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { TidalStore, Track } from "@equicordplugins/musicControls/tidal/TidalStore";
|
||||
import { ModalContent, ModalHeader, ModalProps, ModalRoot } from "@utils/modal";
|
||||
|
||||
import { TidalStore, Track } from "../../TidalStore";
|
||||
import { cl, NoteSvg, scrollClasses, useLyrics } from "./util";
|
||||
|
||||
const formatTime = (time: number) => {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { TidalLrcStore } from "@equicordplugins/musicControls/tidal/lyrics/providers/store";
|
||||
import { EnhancedLyric } from "@equicordplugins/musicControls/tidal/lyrics/types";
|
||||
import { TidalStore } from "@equicordplugins/musicControls/tidal/TidalStore";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { settings } from "../../../settings";
|
||||
import { TidalStore } from "../../TidalStore";
|
||||
import { TidalLrcStore } from "../providers/store";
|
||||
import { EnhancedLyric } from "../types";
|
||||
|
||||
export const scrollClasses = findByPropsLazy("auto", "customTheme");
|
||||
|
||||
export const cl = classNameFactory("eq-tidal-lyrics-");
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
*/
|
||||
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { settings } from "@equicordplugins/musicControls/settings";
|
||||
import { getLyrics } from "@equicordplugins/musicControls/tidal/lyrics/api";
|
||||
import { EnhancedLyric } from "@equicordplugins/musicControls/tidal/lyrics/types";
|
||||
import { TidalStore } from "@equicordplugins/musicControls/tidal/TidalStore";
|
||||
import { proxyLazyWebpack } from "@webpack";
|
||||
import { Flux, FluxDispatcher } from "@webpack/common";
|
||||
|
||||
import { settings } from "../../../settings";
|
||||
import { TidalStore } from "../../TidalStore";
|
||||
import { getLyrics } from "../api";
|
||||
import { EnhancedLyric } from "../types";
|
||||
|
||||
function showNotif(title: string, body: string) {
|
||||
if (settings.store.ShowFailedToasts) {
|
||||
showNotification({
|
||||
|
|
|
|||
|
|
@ -19,12 +19,13 @@
|
|||
import "./ytmStyles.css";
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { ImageIcon, LinkIcon, OpenExternalIcon } from "@components/Icons";
|
||||
import { SeekBar } from "@equicordplugins/musicControls/spotify/SeekBar";
|
||||
import { debounce } from "@shared/debounce";
|
||||
import { openImageModal } from "@utils/discord";
|
||||
import { classes, copyWithToast } from "@utils/misc";
|
||||
import { ContextMenuApi, Flex, FluxDispatcher, Menu, React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
import { copyWithToast, openImageModal } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import { ContextMenuApi, FluxDispatcher, Menu, React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { type Repeat, type Song, YoutubeMusicStore } from "./YtmStore";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { Settings, useSettings } from "@api/Settings";
|
|||
import { classNameFactory } from "@api/Styles";
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { PluginCard } from "@components/settings/tabs/plugins/PluginCard";
|
||||
import { ChangeList } from "@utils/ChangeList";
|
||||
|
|
@ -17,7 +18,7 @@ import { classes, Margins } from "@utils/index";
|
|||
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { Button, Flex, React, Tooltip, useMemo } from "@webpack/common";
|
||||
import { Button, React, Tooltip, useMemo } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import Plugins from "~plugins";
|
||||
|
|
@ -128,14 +129,14 @@ export function NewPluginsModal({ modalProps, newPlugins, newSettings }: { modal
|
|||
</div>
|
||||
</ModalContent>
|
||||
<ModalFooter>
|
||||
<Flex direction={Flex.Direction.HORIZONTAL_REVERSE}>
|
||||
<Flex flexDirection="row-reverse">
|
||||
<ContinueButton
|
||||
close={modalProps.onClose}
|
||||
changes={changes}
|
||||
callback={(v: () => void) => updateContinueButton = v}
|
||||
/>
|
||||
</Flex>
|
||||
<Flex direction={Flex.Direction.HORIZONTAL}>
|
||||
<Flex flexDirection="row">
|
||||
<div className="vc-newPluginsManager-disable-wrapper">
|
||||
<Checkbox
|
||||
type="inverted"
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { questIsIgnored, settings } from "@equicordplugins/questify/settings";
|
||||
import { getIntlMessageFromHash, runtimeHashMessageKey, runtimeHashMessageKeyLegacy } from "@utils/index";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { FluxDispatcher, RestAPI, UserStore } from "@webpack/common";
|
||||
|
||||
import { questIsIgnored, settings } from "../settings";
|
||||
import { Quest, QuestStatus, RGB } from "./components";
|
||||
|
||||
export const q = classNameFactory("questify-");
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { initInput } from "@equicordplugins/remix/editor/input";
|
||||
import { bounds } from "@equicordplugins/remix/editor/tools/crop";
|
||||
import { heightFromBounds, widthFromBounds } from "@equicordplugins/remix/editor/utils/canvas";
|
||||
import { useEffect, useRef } from "@webpack/common";
|
||||
|
||||
import { initInput } from "../input";
|
||||
import { bounds } from "../tools/crop";
|
||||
import { heightFromBounds, widthFromBounds } from "../utils/canvas";
|
||||
|
||||
export let canvas: HTMLCanvasElement | null = null;
|
||||
export let ctx: CanvasRenderingContext2D | null = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { Switch } from "@components/settings";
|
||||
import { BrushTool } from "@equicordplugins/remix/editor/tools/brush";
|
||||
import { CropTool, resetBounds } from "@equicordplugins/remix/editor/tools/crop";
|
||||
import { EraseTool } from "@equicordplugins/remix/editor/tools/eraser";
|
||||
import { currentShape, setShape, setShapeFill, Shape, ShapeTool } from "@equicordplugins/remix/editor/tools/shape";
|
||||
import { Button, Select, Slider, useEffect, useState } from "@webpack/common";
|
||||
|
||||
import { BrushTool } from "../tools/brush";
|
||||
import { CropTool, resetBounds } from "../tools/crop";
|
||||
import { EraseTool } from "../tools/eraser";
|
||||
import { currentShape, setShape, setShapeFill, Shape, ShapeTool } from "../tools/shape";
|
||||
import { brushCanvas, canvas, cropCanvas, render, shapeCanvas } from "./Canvas";
|
||||
import { SettingColorComponent } from "./SettingColorComponent";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { brushCanvas, ctx, render } from "../components/Canvas";
|
||||
import { currentSize, ToolDefinition } from "../components/Toolbar";
|
||||
import { Mouse } from "../input";
|
||||
import { line } from "../utils/canvas";
|
||||
import { brushCanvas, ctx, render } from "@equicordplugins/remix/editor/components/Canvas";
|
||||
import { currentSize, ToolDefinition } from "@equicordplugins/remix/editor/components/Toolbar";
|
||||
import { Mouse } from "@equicordplugins/remix/editor/input";
|
||||
import { line } from "@equicordplugins/remix/editor/utils/canvas";
|
||||
|
||||
export const BrushTool: ToolDefinition = {
|
||||
onMouseMove() {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { canvas, cropCanvas, render } from "../components/Canvas";
|
||||
import { ToolDefinition } from "../components/Toolbar";
|
||||
import { Mouse } from "../input";
|
||||
import { dist, fillCircle } from "../utils/canvas";
|
||||
import { canvas, cropCanvas, render } from "@equicordplugins/remix/editor/components/Canvas";
|
||||
import { ToolDefinition } from "@equicordplugins/remix/editor/components/Toolbar";
|
||||
import { Mouse } from "@equicordplugins/remix/editor/input";
|
||||
import { dist, fillCircle } from "@equicordplugins/remix/editor/utils/canvas";
|
||||
|
||||
export const bounds = {
|
||||
top: 0,
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { brushCanvas, render } from "../components/Canvas";
|
||||
import { currentSize, ToolDefinition } from "../components/Toolbar";
|
||||
import { Mouse } from "../input";
|
||||
import { brushCanvas, render } from "@equicordplugins/remix/editor/components/Canvas";
|
||||
import { currentSize, ToolDefinition } from "@equicordplugins/remix/editor/components/Toolbar";
|
||||
import { Mouse } from "@equicordplugins/remix/editor/input";
|
||||
|
||||
export const EraseTool: ToolDefinition = {
|
||||
onMouseMove() {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { brushCanvas, render, shapeCanvas } from "../components/Canvas";
|
||||
import { ToolDefinition } from "../components/Toolbar";
|
||||
import { Mouse } from "../input";
|
||||
import { line } from "../utils/canvas";
|
||||
import { brushCanvas, render, shapeCanvas } from "@equicordplugins/remix/editor/components/Canvas";
|
||||
import { ToolDefinition } from "@equicordplugins/remix/editor/components/Toolbar";
|
||||
import { Mouse } from "@equicordplugins/remix/editor/input";
|
||||
import { line } from "@equicordplugins/remix/editor/utils/canvas";
|
||||
|
||||
export type Shape = "rectangle" | "ellipse" | "line" | "arrow";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { brushCanvas } from "../components/Canvas";
|
||||
import { brushCanvas } from "@equicordplugins/remix/editor/components/Canvas";
|
||||
|
||||
export function fillCircle(x: number, y: number, radius: number, canvas = brushCanvas) {
|
||||
canvas.beginPath();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Card } from "@components/Card";
|
||||
import { CheckedTextInput } from "@components/CheckedTextInput";
|
||||
import { FormSwitch } from "@components/FormSwitch";
|
||||
import { Heading, HeadingSecondary } from "@components/Heading";
|
||||
|
|
@ -12,7 +13,7 @@ import { Margins } from "@utils/margins";
|
|||
import { identity } from "@utils/misc";
|
||||
import { Activity } from "@vencord/discord-types";
|
||||
import { ActivityFlags, ActivityType } from "@vencord/discord-types/enums";
|
||||
import { Card, PresenceStore, React, Select, SnowflakeUtils, TextInput, UserStore } from "@webpack/common";
|
||||
import { PresenceStore, React, Select, SnowflakeUtils, TextInput, UserStore } from "@webpack/common";
|
||||
|
||||
import { AppIdSetting, makeEmptyAppId } from ".";
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue