diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx
index 959a4d01e..371c3082c 100644
--- a/src/components/PluginSettings/index.tsx
+++ b/src/components/PluginSettings/index.tsx
@@ -69,7 +69,7 @@ function ReloadRequiredCard({ required }: { required: boolean; }) {
Restart now to apply new plugins and their settings
-
}
/>
diff --git a/src/components/PluginSettings/styles.css b/src/components/PluginSettings/styles.css
index d3d182e58..a4f9aeee1 100644
--- a/src/components/PluginSettings/styles.css
+++ b/src/components/PluginSettings/styles.css
@@ -63,10 +63,7 @@
height: 8em;
display: flex;
flex-direction: column;
-}
-
-.vc-plugins-info-card div {
- line-height: 32px;
+ gap: 0.25em;
}
.vc-plugins-restart-card {
@@ -76,11 +73,11 @@
color: var(--info-warning-text);
}
-.vc-plugins-restart-card button {
+.vc-plugins-restart-button {
margin-top: 0.5em;
background: var(--info-warning-foreground) !important;
}
-.vc-plugins-info-button svg:not(:hover, :focus) {
+.vc-plugins-info-icon:not(:hover, :focus) {
color: var(--text-muted);
}
diff --git a/src/plugins/blurNsfw/index.ts b/src/plugins/blurNsfw/index.ts
index 948de0ac6..c4023f098 100644
--- a/src/plugins/blurNsfw/index.ts
+++ b/src/plugins/blurNsfw/index.ts
@@ -24,14 +24,14 @@ let style: HTMLStyleElement;
function setCss() {
style.textContent = `
- .vc-nsfw-img [class^=imageWrapper] img,
- .vc-nsfw-img [class^=wrapperPaused] video {
+ .vc-nsfw-img [class^=imageContainer],
+ .vc-nsfw-img [class^=wrapperPaused] {
filter: blur(${Settings.plugins.BlurNSFW.blurAmount}px);
transition: filter 0.2s;
- }
- .vc-nsfw-img [class^=imageWrapper]:hover img,
- .vc-nsfw-img [class^=wrapperPaused]:hover video {
- filter: unset;
+
+ &:hover {
+ filter: blur(0);
+ }
}
`;
}
@@ -54,7 +54,7 @@ export default definePlugin({
options: {
blurAmount: {
type: OptionType.NUMBER,
- description: "Blur Amount",
+ description: "Blur Amount (in pixels)",
default: 10,
onChange: setCss
}
diff --git a/src/plugins/clientTheme/clientTheme.css b/src/plugins/clientTheme/clientTheme.css
index 64aefdcf5..795b5457e 100644
--- a/src/plugins/clientTheme/clientTheme.css
+++ b/src/plugins/clientTheme/clientTheme.css
@@ -1,29 +1,29 @@
-.client-theme-settings {
+.vc-clientTheme-settings {
display: flex;
flex-direction: column;
}
-.client-theme-container {
+.vc-clientTheme-container {
display: flex;
flex-direction: row;
justify-content: space-between;
}
-.client-theme-settings-labels {
+.vc-clientTheme-labels {
display: flex;
flex-direction: column;
justify-content: flex-start;
}
-.client-theme-container > [class^="colorSwatch"] > [class^="swatch"] {
+.vc-clientTheme-container [class^="swatch"] {
border: thin solid var(--background-modifier-accent) !important;
}
-.client-theme-warning * {
+.vc-clientTheme-warning-text {
color: var(--text-danger);
}
-.client-theme-contrast-warning {
+.vc-clientTheme-contrast-warning {
background-color: var(--background-primary);
padding: 0.5rem;
border-radius: .5rem;
diff --git a/src/plugins/clientTheme/index.tsx b/src/plugins/clientTheme/index.tsx
index 2dc7ccf6c..c7e0e50de 100644
--- a/src/plugins/clientTheme/index.tsx
+++ b/src/plugins/clientTheme/index.tsx
@@ -7,6 +7,7 @@
import "./clientTheme.css";
import { definePluginSettings } from "@api/Settings";
+import { classNameFactory } from "@api/Styles";
import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins";
import { classes } from "@utils/misc";
@@ -14,6 +15,8 @@ import definePlugin, { OptionType, StartAt } from "@utils/types";
import { findByCodeLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
import { Button, Forms, ThemeStore, useStateFromStores } from "@webpack/common";
+const cl = classNameFactory("vc-clientTheme-");
+
const ColorPicker = findComponentByCodeLazy("#{intl::USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR}", ".BACKGROUND_PRIMARY)");
const colorPresets = [
@@ -60,9 +63,9 @@ function ThemeSettings() {
}
return (
-
-
-
+
+
+
Theme Color
Add a color to your Discord client theme
@@ -76,10 +79,10 @@ function ThemeSettings() {
{(contrastWarning || nitroThemeEnabled) && (<>
-
-
Warning, your theme won't look good:
- {contrastWarning &&
Selected color won't contrast well with text}
- {nitroThemeEnabled &&
Nitro themes aren't supported}
+
+ Warning, your theme won't look good:
+ {contrastWarning && Selected color won't contrast well with text}
+ {nitroThemeEnabled && Nitro themes aren't supported}
{(contrastWarning && fixableContrast) &&
setTheme(oppositeTheme)} color={Button.Colors.RED}>Switch to {oppositeTheme} mode}
{(nitroThemeEnabled) &&
setTheme(theme)} color={Button.Colors.RED}>Disable Nitro Theme}
@@ -123,6 +126,7 @@ export default definePlugin({
stop() {
document.getElementById("clientThemeVars")?.remove();
document.getElementById("clientThemeOffsets")?.remove();
+ document.getElementById("clientThemeLightModeFixes")?.remove();
}
});
diff --git a/src/plugins/dearrow/index.tsx b/src/plugins/dearrow/index.tsx
index b7e90e096..7cb60384e 100644
--- a/src/plugins/dearrow/index.tsx
+++ b/src/plugins/dearrow/index.tsx
@@ -121,6 +121,7 @@ function DearrowButton({ component }: { component: Component
; }) {
height="24px"
viewBox="0 0 36 36"
aria-label="Toggle Dearrow"
+ className="vc-dearrow-icon"
>
.
*/
+import "./styles.css";
+
import { get, set } from "@api/DataStore";
+import { updateMessage } from "@api/MessageUpdater";
+import { migratePluginSettings } from "@api/Settings";
import { ImageInvisible, ImageVisible } from "@components/Icons";
import { Devs } from "@utils/constants";
+import { classes } from "@utils/misc";
import definePlugin from "@utils/types";
import { ChannelStore } from "@webpack/common";
import { MessageSnapshot } from "@webpack/types";
-let style: HTMLStyleElement;
-
const KEY = "HideAttachments_HiddenIds";
-let hiddenMessages: Set = new Set();
-const getHiddenMessages = () => get(KEY).then(set => {
- hiddenMessages = set ?? new Set();
+let hiddenMessages = new Set();
+
+async function getHiddenMessages() {
+ hiddenMessages = await get(KEY) ?? new Set();
return hiddenMessages;
-});
+}
+
const saveHiddenMessages = (ids: Set) => set(KEY, ids);
+migratePluginSettings("HideMedia", "HideAttachments");
+
export default definePlugin({
- name: "HideAttachments",
- description: "Hide attachments and Embeds for individual messages via hover button",
+ name: "HideMedia",
+ description: "Hide attachments and embeds for individual messages via hover button",
authors: [Devs.Ven],
+ dependencies: ["MessageUpdaterAPI"],
+
+ patches: [{
+ find: "this.renderAttachments(",
+ replacement: {
+ match: /(?<=\i=)this\.render(?:Attachments|Embeds|StickersAccessories)\((\i)\)/g,
+ replace: "$self.shouldHide($1?.id)?null:$&"
+ }
+ }],
renderMessagePopoverButton(msg) {
// @ts-ignore - discord-types lags behind discord.
@@ -50,49 +66,42 @@ export default definePlugin({
const isHidden = hiddenMessages.has(msg.id);
return {
- label: isHidden ? "Show Attachments" : "Hide Attachments",
+ label: isHidden ? "Show Media" : "Hide Media",
icon: isHidden ? ImageVisible : ImageInvisible,
message: msg,
channel: ChannelStore.getChannel(msg.channel_id),
- onClick: () => this.toggleHide(msg.id)
+ onClick: () => this.toggleHide(msg.channel_id, msg.id)
};
},
- async start() {
- style = document.createElement("style");
- style.id = "VencordHideAttachments";
- document.head.appendChild(style);
+ renderMessageAccessory({ message }) {
+ if (!this.shouldHide(message.id)) return null;
+ return (
+
+ Media Hidden
+
+ );
+ },
+
+ async start() {
await getHiddenMessages();
- await this.buildCss();
},
stop() {
- style.remove();
hiddenMessages.clear();
},
- async buildCss() {
- const elements = [...hiddenMessages].map(id => `#message-accessories-${id}`).join(",");
- style.textContent = `
- :is(${elements}) :is([class*="embedWrapper"], [class*="clickableSticker"]) {
- /* important is not necessary, but add it to make sure bad themes won't break it */
- display: none !important;
- }
- :is(${elements})::after {
- content: "Attachments hidden";
- color: var(--text-muted);
- font-size: 80%;
- }
- `;
+ shouldHide(messageId: string) {
+ return hiddenMessages.has(messageId);
},
- async toggleHide(id: string) {
+ async toggleHide(channelId: string, messageId: string) {
const ids = await getHiddenMessages();
- if (!ids.delete(id))
- ids.add(id);
+ if (!ids.delete(messageId))
+ ids.add(messageId);
await saveHiddenMessages(ids);
- await this.buildCss();
+ updateMessage(channelId, messageId);
}
});
diff --git a/src/plugins/hideAttachments/styles.css b/src/plugins/hideAttachments/styles.css
new file mode 100644
index 000000000..4cbd10a6f
--- /dev/null
+++ b/src/plugins/hideAttachments/styles.css
@@ -0,0 +1,10 @@
+.vc-hideAttachments-accessory {
+ color: var(--text-muted);
+ margin-top: 0.5em;
+ font-style: italic;
+ font-weight: 400;
+}
+
+.vc-hideAttachments-no-content {
+ margin-top: 0;
+}
diff --git a/src/plugins/imageZoom/components/Magnifier.tsx b/src/plugins/imageZoom/components/Magnifier.tsx
index 31fa7a117..009165ff2 100644
--- a/src/plugins/imageZoom/components/Magnifier.tsx
+++ b/src/plugins/imageZoom/components/Magnifier.tsx
@@ -195,6 +195,7 @@ export const Magnifier = ErrorBoundary.wrap(({ instance, size: i
/>
) : (
img {
+.vc-imgzoom-nearest-neighbor > .vc-imgzoom-image {
image-rendering: pixelated;
/* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */
diff --git a/src/plugins/messageLogger/deleteStyleText.css b/src/plugins/messageLogger/deleteStyleText.css
index a4e9a93c1..a114b7de8 100644
--- a/src/plugins/messageLogger/deleteStyleText.css
+++ b/src/plugins/messageLogger/deleteStyleText.css
@@ -1,24 +1,8 @@
-/* Message content highlighting */
-.messagelogger-deleted [class*="contents"] > :is(div, h1, h2, h3, p) {
- color: var(--status-danger, #f04747) !important;
-}
-
-/* Markdown title highlighting */
-.messagelogger-deleted [class*="contents"] :is(h1, h2, h3) {
- color: var(--status-danger, #f04747) !important;
-}
-
-/* Bot "thinking" text highlighting */
-.messagelogger-deleted [class*="colorStandard"] {
- color: var(--status-danger, #f04747) !important;
-}
-
-/* Embed highlighting */
-.messagelogger-deleted article :is(div, span, h1, h2, h3, p) {
- color: var(--status-danger, #f04747) !important;
-}
-
-.messagelogger-deleted a {
- color: var(--red-460, #be3535) !important;
- text-decoration: underline;
+.messagelogger-deleted {
+ --text-normal: var(--status-danger, #f04747);
+ --interactive-normal: var(--status-danger, #f04747);
+ --text-muted: var(--status-danger, #f04747);
+ --embed-title: var(--red-460, #be3535);
+ --text-link: var(--red-460, #be3535);
+ --header-primary: var(--red-460, #be3535);
}
diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx
index 90b9c30f2..dee58f2f9 100644
--- a/src/plugins/messageLogger/index.tsx
+++ b/src/plugins/messageLogger/index.tsx
@@ -442,15 +442,10 @@ export default definePlugin({
{
// Attachment renderer
find: ".removeMosaicItemHoverButton",
- group: true,
replacement: [
{
- match: /(className:\i,item:\i),/,
- replace: "$1,item: deleted,"
- },
- {
- match: /\[\i\.obscured\]:.+?,/,
- replace: "$& 'messagelogger-deleted-attachment': deleted,"
+ match: /\[\i\.obscured\]:.+?,(?<=item:(\i).+?)/,
+ replace: '$&"messagelogger-deleted-attachment":$1.originalItem?.deleted,'
}
]
},
diff --git a/src/plugins/messageLogger/messageLogger.css b/src/plugins/messageLogger/messageLogger.css
index 2759129d9..a76e98888 100644
--- a/src/plugins/messageLogger/messageLogger.css
+++ b/src/plugins/messageLogger/messageLogger.css
@@ -4,12 +4,12 @@
.messagelogger-deleted
:is(
- video,
+ .messagelogger-deleted-attachment,
.emoji,
[data-type="sticker"],
- iframe,
- .messagelogger-deleted-attachment,
- [class|="inlineMediaEmbed"]
+ [class*="embedIframe"],
+ [class*="embedSpotify"],
+ [class*="imageContainer"]
) {
filter: grayscale(1) !important;
transition: 150ms filter ease-in-out;
@@ -17,18 +17,14 @@
&[class*="hiddenMosaicItem_"] {
filter: grayscale(1) blur(var(--custom-message-attachment-spoiler-blur-radius, 44px)) !important;
}
+
+ &:hover {
+ filter: grayscale(0) !important;
+ }
}
-.messagelogger-deleted
-:is(
- video,
- .emoji,
- [data-type="sticker"],
- iframe,
- .messagelogger-deleted-attachment,
- [class|="inlineMediaEmbed"]
-):hover {
- filter: grayscale(0) !important;
+.messagelogger-deleted [class*="spoilerWarning"] {
+ color: var(--status-danger);
}
.theme-dark .messagelogger-edited {
diff --git a/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx b/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx
index 341971ff8..02662fe97 100644
--- a/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx
+++ b/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx
@@ -157,7 +157,7 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
src={user.getAvatarURL(void 0, void 0, false)}
/>
)}
-
+
{
permission.type === PermissionType.Role
? role?.name ?? "Unknown Role"
diff --git a/src/plugins/permissionsViewer/styles.css b/src/plugins/permissionsViewer/styles.css
index b7e420964..2ca61025d 100644
--- a/src/plugins/permissionsViewer/styles.css
+++ b/src/plugins/permissionsViewer/styles.css
@@ -73,7 +73,7 @@
background-color: var(--background-modifier-selected);
}
-.vc-permviewer-modal-list-item > div {
+.vc-permviewer-modal-list-item-text {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
diff --git a/src/plugins/reviewDB/components/BlockedUserModal.tsx b/src/plugins/reviewDB/components/BlockedUserModal.tsx
index 43c81eb52..8b8271746 100644
--- a/src/plugins/reviewDB/components/BlockedUserModal.tsx
+++ b/src/plugins/reviewDB/components/BlockedUserModal.tsx
@@ -39,7 +39,7 @@ function BlockedUser({ user, isBusy, setIsBusy }: { user: ReviewDBUser; isBusy:
return (
-

+
{user.username}
{
diff --git a/src/plugins/reviewDB/components/ReviewModal.tsx b/src/plugins/reviewDB/components/ReviewModal.tsx
index 71ac021f0..1485022da 100644
--- a/src/plugins/reviewDB/components/ReviewModal.tsx
+++ b/src/plugins/reviewDB/components/ReviewModal.tsx
@@ -65,7 +65,7 @@ function Modal({ modalProps, modalKey, discordId, name, type }: { modalProps: an
-
+
{ownReview && (
div {
+.vc-rdb-modal-footer-wrapper {
width: 100%;
margin: 6px 16px;
}
-/* When input becomes disabled(while sending review), input adds unneccesary padding to left, this prevents it */
-.vc-rdb-input > div > div {
- padding-left: 0 !important;
-}
-
.vc-rdb-placeholder {
margin-bottom: 4px;
font-weight: bold;
@@ -69,7 +64,7 @@
border-radius: 8px;
}
-.vc-rdb-review-comment img {
+.vc-rdb-review-comment [class*="avatar"] {
vertical-align: text-top;
}
@@ -117,13 +112,13 @@
align-items: center;
}
-.vc-rdb-block-modal-row img {
+.vc-rdb-block-modal-avatar {
border-radius: 50%;
height: 2em;
width: 2em;
}
-.vc-rdb-block-modal img::before {
+.vc-rdb-block-modal-avatar::before {
content: "";
display: block;
width: 100%;
diff --git a/src/plugins/sendTimestamps/index.tsx b/src/plugins/sendTimestamps/index.tsx
index 437df1a58..57b9de0df 100644
--- a/src/plugins/sendTimestamps/index.tsx
+++ b/src/plugins/sendTimestamps/index.tsx
@@ -68,15 +68,16 @@ function PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): voi
return (
-
+
Timestamp Picker
-
+
setValue(e.currentTarget.value)}
@@ -86,23 +87,25 @@ function PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): voi
/>
Timestamp Format
-