bump dependencies, migrate to new Vencord Switch component

This commit is contained in:
Vendicated
2025-10-07 00:37:45 +02:00
parent a55b1f0250
commit 8cc34e217c
9 changed files with 556 additions and 573 deletions

View File

@@ -34,15 +34,15 @@
},
"devDependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
"@stylistic/eslint-plugin": "^5.3.1",
"@types/node": "^24.3.1",
"@types/react": "18.3.1",
"@vencord/types": "^1.11.5",
"dotenv": "^17.2.2",
"@stylistic/eslint-plugin": "^5.4.0",
"@types/node": "^24.7.0",
"@types/react": "19.2.1",
"@vencord/types": "^1.13.2",
"dotenv": "^17.2.3",
"electron": "^38.0.0",
"electron-builder": "^26.0.12",
"esbuild": "^0.25.9",
"eslint": "^9.34.0",
"esbuild": "^0.25.10",
"eslint": "^9.37.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-path-alias": "^2.1.0",
"eslint-plugin-prettier": "^5.5.4",
@@ -51,11 +51,11 @@
"eslint-plugin-unused-imports": "^4.2.0",
"prettier": "^3.6.2",
"source-map-support": "^0.5.21",
"tsx": "^4.20.5",
"type-fest": "^4.41.0",
"typescript": "^5.9.2",
"typescript-eslint": "^8.42.0",
"xml-formatter": "^3.6.6"
"tsx": "^4.20.6",
"type-fest": "^5.0.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.0",
"xml-formatter": "^3.6.7"
},
"packageManager": "pnpm@10.7.1",
"engines": {

944
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,19 +6,10 @@
import "./screenSharePicker.css";
import { FormSwitch } from "@vencord/types/components";
import { closeModal, Logger, Modals, ModalSize, openModal, useAwaiter } from "@vencord/types/utils";
import { onceReady } from "@vencord/types/webpack";
import {
Button,
Card,
FluxDispatcher,
Forms,
Select,
Switch,
Text,
UserStore,
useState
} from "@vencord/types/webpack/common";
import { Button, Card, FluxDispatcher, Forms, Select, Text, UserStore, useState } from "@vencord/types/webpack/common";
import { Node } from "@vencord/venmic";
import type { Dispatch, SetStateAction } from "react";
import { MediaEngineStore } from "renderer/common";
@@ -202,67 +193,64 @@ function AudioSettingsModal({
<Modals.ModalCloseButton onClick={close} />
</Modals.ModalHeader>
<Modals.ModalContent className={cl("modal")}>
<Switch
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, workaround: v })}
value={Settings.audio?.workaround ?? false}
note={
<FormSwitch
title="Microphone Workaround"
description={
<>
Work around an issue that causes the microphone to be shared instead of the correct audio.
Only enable if you're experiencing this issue.
</>
}
>
Microphone Workaround
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, onlySpeakers: v })}
value={Settings.audio?.onlySpeakers ?? true}
note={
onChange={v => (Settings.audio = { ...Settings.audio, workaround: v })}
value={Settings.audio?.workaround ?? false}
/>
<FormSwitch
title="Only Speakers"
description={
<>
When sharing entire desktop audio, only share apps that play to a speaker. You may want to
disable this when using "mix bussing".
</>
}
>
Only Speakers
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, onlyDefaultSpeakers: v })}
value={Settings.audio?.onlyDefaultSpeakers ?? true}
note={
onChange={v => (Settings.audio = { ...Settings.audio, onlySpeakers: v })}
value={Settings.audio?.onlySpeakers ?? true}
/>
<FormSwitch
title="Only Default Speakers"
description={
<>
When sharing entire desktop audio, only share apps that play to the <b>default</b> speakers.
You may want to disable this when using "mix bussing".
</>
}
>
Only Default Speakers
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, onlyDefaultSpeakers: v })}
value={Settings.audio?.onlyDefaultSpeakers ?? true}
/>
<FormSwitch
title="Ignore Inputs"
description={<>Exclude nodes that are intended to capture audio.</>}
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, ignoreInputMedia: v })}
value={Settings.audio?.ignoreInputMedia ?? true}
note={<>Exclude nodes that are intended to capture audio.</>}
>
Ignore Inputs
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, ignoreVirtual: v })}
value={Settings.audio?.ignoreVirtual ?? false}
note={
/>
<FormSwitch
title="Ignore Virtual"
description={
<>
Exclude virtual nodes, such as nodes belonging to loopbacks. This might be useful when using
"mix bussing".
</>
}
>
Ignore Virtual
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audio = { ...Settings.audio, ignoreVirtual: v })}
value={Settings.audio?.ignoreVirtual ?? false}
/>
<FormSwitch
title="Ignore Devices"
description={<>Exclude device nodes, such as nodes belonging to microphones or speakers.</>}
hideBorder
onChange={v =>
(Settings.audio = {
@@ -272,22 +260,25 @@ function AudioSettingsModal({
})
}
value={Settings.audio?.ignoreDevices ?? true}
note={<>Exclude device nodes, such as nodes belonging to microphones or speakers.</>}
>
Ignore Devices
</Switch>
<Switch
/>
<FormSwitch
title="Granular Selection"
description={<>Allow to select applications more granularly.</>}
hideBorder
onChange={value => {
Settings.audio = { ...Settings.audio, granularSelect: value };
setAudioSources("None");
}}
value={Settings.audio?.granularSelect ?? false}
note={<>Allow to select applications more granularly.</>}
>
Granular Selection
</Switch>
<Switch
/>
<FormSwitch
title="Device Selection"
description={
<>
Allow to select devices such as microphones. Requires <b>Ignore Devices</b> to be turned
off.
</>
}
hideBorder
onChange={value => {
Settings.audio = { ...Settings.audio, deviceSelect: value };
@@ -295,15 +286,7 @@ function AudioSettingsModal({
}}
value={Settings.audio?.deviceSelect ?? false}
disabled={Settings.audio?.ignoreDevices}
note={
<>
Allow to select devices such as microphones. Requires <b>Ignore Devices</b> to be turned
off.
</>
}
>
Device Selection
</Switch>
/>
</Modals.ModalContent>
<Modals.ModalFooter className={cl("footer")}>
<Button color={Button.Colors.TRANSPARENT} onClick={close}>
@@ -427,14 +410,13 @@ function StreamSettingsUi({
</div>
</div>
{isWindows && (
<Switch
<FormSwitch
title="Stream With Audio"
hideBorder
value={settings.audio}
onChange={checked => setSettings(s => ({ ...s, audio: checked }))}
hideBorder
className={cl("audio")}
>
Stream With Audio
</Switch>
/>
)}
</section>
</div>

View File

@@ -14,14 +14,13 @@ export const AutoStartToggle: SettingsComponent = () => {
return (
<VesktopSettingsSwitch
title="Start With System"
description="Automatically start Vesktop on computer start-up"
value={autoStartEnabled}
onChange={async v => {
await VesktopNative.autostart[v ? "enable" : "disable"]();
setAutoStartEnabled(v);
}}
note="Automatically start Vesktop on computer start-up"
>
Start With System
</VesktopSettingsSwitch>
/>
);
};

View File

@@ -12,15 +12,14 @@ import { VesktopSettingsSwitch } from "./VesktopSettingsSwitch";
export const NotificationBadgeToggle: SettingsComponent = ({ settings }) => {
return (
<VesktopSettingsSwitch
title="Notification Badge"
description="Show mention badge on the app icon"
value={settings.appBadge ?? true}
onChange={v => {
settings.appBadge = v;
if (v) setBadge();
else VesktopNative.app.setBadgeCount(0);
}}
note="Show mention badge on the app icon"
>
Notification Badge
</VesktopSettingsSwitch>
/>
);
};

View File

@@ -158,14 +158,13 @@ function SettingsSections() {
return (
<VesktopSettingsSwitch
title={title}
description={description}
value={Settings[key as any] ?? defaultValue}
onChange={v => (Settings[key as any] = v)}
note={description}
disabled={disabled?.()}
key={key}
>
{title}
</VesktopSettingsSwitch>
/>
);
})}
</div>
@@ -181,8 +180,6 @@ export default ErrorBoundary.wrap(
function SettingsUI() {
return (
<Forms.FormSection>
{/* FIXME: Outdated type */}
{/* @ts-expect-error Outdated type */}
<Text variant="heading-xl/semibold" color="header-primary" className="vcd-settings-title">
Vesktop Settings
</Text>

View File

@@ -4,13 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Switch } from "@vencord/types/webpack/common";
import { FormSwitch } from "@vencord/types/components";
import { ComponentProps } from "react";
export function VesktopSettingsSwitch(props: ComponentProps<typeof Switch>) {
return (
<Switch {...props} hideBorder className="vcd-settings-switch">
{props.children}
</Switch>
);
export function VesktopSettingsSwitch(props: ComponentProps<typeof FormSwitch>) {
return <FormSwitch {...props} hideBorder className="vcd-settings-switch" />;
}

View File

@@ -49,7 +49,7 @@ export interface State {
maximized?: boolean;
minimized?: boolean;
windowBounds?: Rectangle;
displayId: int;
displayId: number;
firstLaunch?: boolean;

View File

@@ -10,7 +10,7 @@
"target": "ESNEXT",
"jsx": "preserve",
// we have duplicate electron types but it's w/e
// @vencord/types has some errors for now
"skipLibCheck": true,
"baseUrl": "./src/",