diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f16f1e273..e86effb19 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,11 +1,9 @@ { "recommendations": [ "dbaeumer.vscode-eslint", - "eamodio.gitlens", "EditorConfig.EditorConfig", - "ExodiusStudios.comment-anchors", - "formulahendry.auto-rename-tag", "GregorBiswanger.json2ts", - "stylelint.vscode-stylelint" + "stylelint.vscode-stylelint", + "Vendicated.vencord-companion" ] } diff --git a/package.json b/package.json index 97d3da576..95f98a8ba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.8.1", + "version": "1.8.4", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { diff --git a/scripts/generateReport.ts b/scripts/generateReport.ts index 912f38eda..164e409df 100644 --- a/scripts/generateReport.ts +++ b/scripts/generateReport.ts @@ -303,8 +303,10 @@ async function runtime(token: string) { delete patch.predicate; delete patch.group; - if (!Array.isArray(patch.replacement)) + Vencord.Util.canonicalizeFind(patch); + if (!Array.isArray(patch.replacement)) { patch.replacement = [patch.replacement]; + } patch.replacement.forEach(r => { delete r.predicate; diff --git a/src/api/Commands/commandHelpers.ts b/src/api/Commands/commandHelpers.ts index dc5ecfd67..2f7039137 100644 --- a/src/api/Commands/commandHelpers.ts +++ b/src/api/Commands/commandHelpers.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { mergeDefaults } from "@utils/misc"; +import { mergeDefaults } from "@utils/mergeDefaults"; import { findByPropsLazy } from "@webpack"; import { MessageActions, SnowflakeUtils } from "@webpack/common"; import { Message } from "discord-types/general"; diff --git a/src/api/Settings.ts b/src/api/Settings.ts index 696c12c28..490e6ef7f 100644 --- a/src/api/Settings.ts +++ b/src/api/Settings.ts @@ -20,7 +20,7 @@ import { debounce } from "@shared/debounce"; import { SettingsStore as SettingsStoreClass } from "@shared/SettingsStore"; import { localStorage } from "@utils/localStorage"; import { Logger } from "@utils/Logger"; -import { mergeDefaults } from "@utils/misc"; +import { mergeDefaults } from "@utils/mergeDefaults"; import { putCloudSettings } from "@utils/settingsSync"; import { DefinedSettings, OptionType, SettingsChecks, SettingsDefinition } from "@utils/types"; import { React } from "@webpack/common"; diff --git a/src/components/VencordSettings/AddonCard.tsx b/src/components/VencordSettings/AddonCard.tsx index c4c3aaca9..1161a6411 100644 --- a/src/components/VencordSettings/AddonCard.tsx +++ b/src/components/VencordSettings/AddonCard.tsx @@ -21,7 +21,7 @@ import "./addonCard.css"; import { classNameFactory } from "@api/Styles"; import { Badge } from "@components/Badge"; import { Switch } from "@components/Switch"; -import { Text } from "@webpack/common"; +import { Text, useRef } from "@webpack/common"; import type { MouseEventHandler, ReactNode } from "react"; const cl = classNameFactory("vc-addon-"); @@ -42,6 +42,8 @@ interface Props { } export function AddonCard({ disabled, isNew, name, infoButton, footer, author, enabled, setEnabled, description, onMouseEnter, onMouseLeave }: Props) { + const titleRef = useRef(null); + const titleContainerRef = useRef(null); return (
- {name}{isNew && } +
+
{ + const title = titleRef.current!; + const titleContainer = titleContainerRef.current!; + + title.style.setProperty("--offset", `${titleContainer.clientWidth - title.scrollWidth}px`); + title.style.setProperty("--duration", `${Math.max(0.5, (title.scrollWidth - titleContainer.clientWidth) / 7)}s`); + }} + > + {name} +
+
{isNew && }
{!!author && ( diff --git a/src/components/VencordSettings/PatchHelperTab.tsx b/src/components/VencordSettings/PatchHelperTab.tsx index 064c872ab..9e2980e7e 100644 --- a/src/components/VencordSettings/PatchHelperTab.tsx +++ b/src/components/VencordSettings/PatchHelperTab.tsx @@ -180,7 +180,8 @@ function ReplacementInput({ replacement, setReplacement, replacementError }) { return ( <> - replacement + {/* FormTitle adds a class if className is not set, so we set it to an empty string to prevent that */} + replacement {!isFunc && (
- Cheat Sheet + Cheat Sheet {Object.entries({ "\\i": "Special regex escape sequence that matches identifiers (varnames, classnames, etc.)", "$$": "Insert a $", @@ -220,11 +221,12 @@ function ReplacementInput({ replacement, setReplacement, replacementError }) { interface FullPatchInputProps { setFind(v: string): void; + setParsedFind(v: string | RegExp): void; setMatch(v: string): void; setReplacement(v: string | ReplaceFn): void; } -function FullPatchInput({ setFind, setMatch, setReplacement }: FullPatchInputProps) { +function FullPatchInput({ setFind, setParsedFind, setMatch, setReplacement }: FullPatchInputProps) { const [fullPatch, setFullPatch] = React.useState(""); const [fullPatchError, setFullPatchError] = React.useState(""); @@ -233,6 +235,7 @@ function FullPatchInput({ setFind, setMatch, setReplacement }: FullPatchInputPro setFullPatchError(""); setFind(""); + setParsedFind(""); setMatch(""); setReplacement(""); return; @@ -256,7 +259,8 @@ function FullPatchInput({ setFind, setMatch, setReplacement }: FullPatchInputPro if (!parsed.replacement.match) throw new Error("No 'replacement.match' field"); if (!parsed.replacement.replace) throw new Error("No 'replacement.replace' field"); - setFind(parsed.find); + setFind(parsed.find instanceof RegExp ? parsed.find.toString() : parsed.find); + setParsedFind(parsed.find); setMatch(parsed.replacement.match instanceof RegExp ? parsed.replacement.match.source : parsed.replacement.match); setReplacement(parsed.replacement.replace); setFullPatchError(""); @@ -266,7 +270,7 @@ function FullPatchInput({ setFind, setMatch, setReplacement }: FullPatchInputPro } return <> - Paste your full JSON patch here to fill out the fields + Paste your full JSON patch here to fill out the fields