remove old discord ui workarounds & legacy code (#3585)
Co-authored-by: sadan <117494111+sadan4@users.noreply.github.com> Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
6380111f32
commit
a2253cb4ae
33 changed files with 105 additions and 286 deletions
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
|
|
@ -13,11 +13,14 @@
|
|||
"typescript.format.semicolons": "insert",
|
||||
"typescript.preferences.quoteStyle": "double",
|
||||
"javascript.preferences.quoteStyle": "double",
|
||||
|
||||
"gitlens.remotes": [
|
||||
{
|
||||
"domain": "codeberg.org",
|
||||
"type": "Gitea"
|
||||
}
|
||||
]
|
||||
],
|
||||
"css.format.spaceAroundSelectorSeparator": true,
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "vscode.css-language-features"
|
||||
}
|
||||
}
|
||||
|
|
@ -4,17 +4,13 @@
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
color: var(--text-default);
|
||||
background-color: var(--background-base-lower-alt);
|
||||
background-color: var(--background-base-low);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.visual-refresh .vc-notification-root {
|
||||
background-color: var(--background-base-low);
|
||||
}
|
||||
|
||||
.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) {
|
||||
position: absolute;
|
||||
z-index: 2147483647;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
import { React, TextInput } from "@webpack/common";
|
||||
|
||||
// TODO: Refactor settings to use this as well
|
||||
interface TextInputProps {
|
||||
/**
|
||||
* WARNING: Changing this between renders will have no effect!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
.vc-addon-card {
|
||||
background-color: var(--background-base-lower-alt);
|
||||
background-color: var(--card-primary-bg);
|
||||
color: var(--interactive-active);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 8px;
|
||||
display: block;
|
||||
height: 100%;
|
||||
|
|
@ -11,26 +12,15 @@
|
|||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.visual-refresh .vc-addon-card {
|
||||
background-color: var(--card-primary-bg);
|
||||
border: 1px solid var(--border-subtle);
|
||||
}
|
||||
|
||||
.vc-addon-card-disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.vc-addon-card:hover {
|
||||
background-color: var(--background-tertiary);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--elevation-high);
|
||||
}
|
||||
|
||||
.visual-refresh .vc-addon-card:hover {
|
||||
/* same as non-hover, here to overwrite the non-refresh hover background */
|
||||
background-color: var(--card-primary-bg);
|
||||
}
|
||||
|
||||
.vc-addon-header {
|
||||
margin-top: auto;
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
.vc-settings-quickActions-pill {
|
||||
all: unset;
|
||||
background: var(--background-base-lower);
|
||||
background: var(--button-secondary-background);
|
||||
color: var(--header-secondary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
}
|
||||
|
||||
.vc-settings-quickActions-pill:hover {
|
||||
background: var(--background-base-lower-alt);
|
||||
background: var(--button-secondary-background-hover);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--elevation-high);
|
||||
}
|
||||
|
|
@ -36,14 +36,6 @@
|
|||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.visual-refresh .vc-settings-quickActions-pill {
|
||||
background: var(--button-secondary-background);
|
||||
}
|
||||
|
||||
.visual-refresh .vc-settings-quickActions-pill:hover {
|
||||
background: var(--button-secondary-background-hover);
|
||||
}
|
||||
|
||||
.vc-settings-quickActions-img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
.vc-author-modal-name {
|
||||
text-transform: none;
|
||||
flex-grow: 0;
|
||||
background: var(--background-tertiary);
|
||||
background: var(--background-base-lowest);
|
||||
border-radius: 0 9999px 9999px 0;
|
||||
padding: 6px 0.8em 6px 0.5em;
|
||||
font-size: 20px;
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
position: absolute;
|
||||
height: 100%;
|
||||
width: 32px;
|
||||
background: var(--background-tertiary);
|
||||
background: var(--background-base-lowest);
|
||||
z-index: -1;
|
||||
left: -32px;
|
||||
top: 0;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
height: 32px;
|
||||
width: 32px;
|
||||
border-radius: 50%;
|
||||
border: 4px solid var(--background-tertiary);
|
||||
border: 4px solid var(--background-base-lowest);
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
}
|
||||
|
||||
.vc-settings-theme-links:focus {
|
||||
background-color: var(--background-tertiary);
|
||||
background-color: var(--background-base-lowest);
|
||||
}
|
||||
|
||||
.vc-cloud-settings-sync-grid {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,8 @@ export default definePlugin({
|
|||
{
|
||||
find: '"sticker")',
|
||||
replacement: {
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /return\((!)?\i\.\i(?:\|\||&&)(?=\(.+?(\i)\.push)/,
|
||||
replace: (m, not, children) => not
|
||||
? `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),true)&&`
|
||||
: `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),false)||`
|
||||
match: /return\(\i\.\i\|\|(?=\(.+?(\i)\.push)/,
|
||||
replace: "$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),false)||"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -59,8 +59,7 @@ export default definePlugin({
|
|||
replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}`
|
||||
},
|
||||
{
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?(?:function\(\){return |\(\)=>))\2/,
|
||||
match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?\(\)=>)\2/,
|
||||
replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})`
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
}
|
||||
|
||||
/* These area names need to be hardcoded. Only betterFoldersSidebar is added by the plugin. */
|
||||
.visual-refresh .vc-betterFolders-sidebar-grid {
|
||||
.vc-betterFolders-sidebar-grid {
|
||||
/* stylelint-disable-next-line value-keyword-case */
|
||||
grid-template-columns: [start] min-content [guildsEnd] min-content [sidebarEnd] min-content [channelsEnd] 1fr [end];
|
||||
grid-template-areas:
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ function createColorsOverrides(styles: string) {
|
|||
const darkThemeBaseLightness = visualRefreshColorsLightness["--neutral-69-hsl"];
|
||||
|
||||
createOrUpdateStyle(OVERRIDES_STYLE_ID, [
|
||||
`.visual-refresh.theme-light {\n ${generateNewColorVars(visualRefreshColorsLightness, lightThemeBaseLightness)} \n}`,
|
||||
`.visual-refresh.theme-dark {\n ${generateNewColorVars(visualRefreshColorsLightness, darkThemeBaseLightness)} \n}`,
|
||||
`.theme-light {\n ${generateNewColorVars(visualRefreshColorsLightness, lightThemeBaseLightness)} \n}`,
|
||||
`.theme-dark {\n ${generateNewColorVars(visualRefreshColorsLightness, darkThemeBaseLightness)} \n}`,
|
||||
].join("\n\n"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,9 +44,8 @@ export default definePlugin({
|
|||
{
|
||||
find: ".selectPreviousCommandOption(",
|
||||
replacement: {
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(?<=(\i)\.which(?:!==|===)\i\.\i.ENTER(\|\||&&)).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=(?:\|\||&&)\(\i\.preventDefault)/,
|
||||
replace: (_, event, condition, codeblock) => `${condition === "||" ? "!" : ""}$self.shouldSubmit(${event},${codeblock})`
|
||||
match: /(?<=(\i)\.which!==\i\.\i.ENTER\|\|).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=\|\|\(\i\.preventDefault)/,
|
||||
replace: "!$self.shouldSubmit($1,$2)"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,18 +49,6 @@ export default definePlugin({
|
|||
{
|
||||
find: ".decorationGridItem,",
|
||||
replacement: [
|
||||
{
|
||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
||||
match: /(?<==)\i=>{let{children.{20,200}decorationGridItem/,
|
||||
replace: "$self.DecorationGridItem=$&",
|
||||
noWarn: true
|
||||
},
|
||||
{
|
||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
||||
match: /(?<==)\i=>{let{user:\i,avatarDecoration/,
|
||||
replace: "$self.DecorationGridDecoration=$&",
|
||||
noWarn: true
|
||||
},
|
||||
{
|
||||
match: /(?<==)\i=>{var{children.{20,200}decorationGridItem/,
|
||||
replace: "$self.DecorationGridItem=$&",
|
||||
|
|
|
|||
|
|
@ -255,11 +255,8 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Disallow the emoji for premium locked if the intention doesn't allow it
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(!)?(\i\.\i\.canUseEmojisEverywhere\(\i\))/,
|
||||
replace: (m, not) => not
|
||||
? `(${m}&&!${IS_BYPASSEABLE_INTENTION})`
|
||||
: `(${m}||${IS_BYPASSEABLE_INTENTION})`
|
||||
match: /!(\i\.\i\.canUseEmojisEverywhere\(\i\))/,
|
||||
replace: m => `(${m}&&!${IS_BYPASSEABLE_INTENTION})`
|
||||
},
|
||||
{
|
||||
// Allow animated emojis to be used if the intention allows it
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ export default definePlugin({
|
|||
{
|
||||
find: "#{intl::GUILD_OWNER}),children:",
|
||||
replacement: {
|
||||
match: /(?<=roleName:\i,)(colorString:)/,
|
||||
replace: "$1$self.calculateNameColorForListContext(arguments[0]),originalColor:"
|
||||
match: /(?<=roleName:\i,)colorString:/,
|
||||
replace: "colorString:$self.calculateNameColorForListContext(arguments[0]),originalColor:"
|
||||
},
|
||||
predicate: () => settings.store.memberListColors
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,12 +66,6 @@ export default definePlugin({
|
|||
{
|
||||
find: "{isSidebarVisible:",
|
||||
replacement: [
|
||||
{
|
||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
||||
match: /(?<=let\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/,
|
||||
replace: ":[$1?.startsWith('members')?$self.render():null,$2",
|
||||
noWarn: true
|
||||
},
|
||||
{
|
||||
match: /(?<=var\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/,
|
||||
replace: ":[$1?.startsWith('members')?$self.render():null,$2",
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
|
||||
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands";
|
||||
import * as DataStore from "@api/DataStore";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
|
@ -89,14 +88,6 @@ export default definePlugin({
|
|||
settings,
|
||||
|
||||
async start() {
|
||||
// TODO(OptionType.CUSTOM Related): Remove DataStore tags migration once enough time has passed
|
||||
const oldTags = await DataStore.get<Tag[]>(DATA_KEY);
|
||||
if (oldTags != null) {
|
||||
// @ts-expect-error
|
||||
settings.store.tagsList = Object.fromEntries(oldTags.map(oldTag => (delete oldTag.enabled, [oldTag.name, oldTag])));
|
||||
await DataStore.del(DATA_KEY);
|
||||
}
|
||||
|
||||
const tags = getTags();
|
||||
for (const tagName in tags) {
|
||||
createTagCommand(tags[tagName]);
|
||||
|
|
|
|||
|
|
@ -100,9 +100,8 @@ export default definePlugin({
|
|||
replace: "true"
|
||||
},
|
||||
{
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(!)?\(0,\i\.isDesktop\)\(\)/,
|
||||
replace: (_, not) => not ? "false" : "true"
|
||||
match: /\(0,\i\.isDesktop\)\(\)/,
|
||||
replace: "true"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,9 +46,8 @@ export default definePlugin({
|
|||
find: "#{intl::ONBOARDING_CHANNEL_THRESHOLD_WARNING}",
|
||||
replacement: [
|
||||
{
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /{(?:\i:(?:function\(\){return |\(\)=>)\i}?,?){2}}/,
|
||||
replace: m => m.replaceAll(canonicalizeMatch(/(function\(\){return |\(\)=>)\i/g), "$1()=>Promise.resolve(true)")
|
||||
match: /{(?:\i:\(\)=>\i,?){2}}/,
|
||||
replace: m => m.replaceAll(canonicalizeMatch(/\(\)=>\i/g), "()=>Promise.resolve(true)")
|
||||
}
|
||||
],
|
||||
predicate: () => settings.store.onboarding
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export const { getGuildPermissionSpecMap } = findByPropsLazy("getGuildPermission
|
|||
export const cl = classNameFactory("vc-permviewer-");
|
||||
|
||||
export function getSortedRolesForMember({ id: guildId }: Guild, member: GuildMember) {
|
||||
// the guild id is the @everyone role
|
||||
// The guild id is the @everyone role
|
||||
return GuildRoleStore
|
||||
.getSortedRoles(guildId)
|
||||
.filter(role => role.id === guildId || member.roles.includes(role.id));
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import * as DataStore from "@api/DataStore";
|
||||
import { Settings } from "@api/Settings";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import { UserStore } from "@webpack/common";
|
||||
|
||||
|
|
@ -28,8 +26,6 @@ let forceUpdateDms: (() => void) | undefined = undefined;
|
|||
export let currentUserCategories: Category[] = [];
|
||||
|
||||
export async function init() {
|
||||
await migrateData();
|
||||
|
||||
const userId = UserStore.getCurrentUser()?.id;
|
||||
if (userId == null) return;
|
||||
|
||||
|
|
@ -154,28 +150,3 @@ export function moveChannel(channelId: string, direction: -1 | 1) {
|
|||
|
||||
swapElementsInArray(category.channels, a, b);
|
||||
}
|
||||
|
||||
// TODO(OptionType.CUSTOM Related): Remove DataStore PinnedDms migration once enough time has passed
|
||||
async function migrateData() {
|
||||
if (Settings.plugins.PinDMs.dmSectioncollapsed != null) {
|
||||
settings.store.dmSectionCollapsed = Settings.plugins.PinDMs.dmSectioncollapsed;
|
||||
delete Settings.plugins.PinDMs.dmSectioncollapsed;
|
||||
}
|
||||
|
||||
const dataStoreKeys = await DataStore.keys();
|
||||
const pinDmsKeys = dataStoreKeys.map(key => String(key)).filter(key => key.startsWith(CATEGORY_BASE_KEY));
|
||||
|
||||
if (pinDmsKeys.length === 0) return;
|
||||
|
||||
for (const pinDmsKey of pinDmsKeys) {
|
||||
const categories = await DataStore.get<Category[]>(pinDmsKey);
|
||||
if (categories == null) continue;
|
||||
|
||||
const userId = pinDmsKey.replace(CATEGORY_BASE_KEY, "");
|
||||
settings.store.userBasedCategoryList[userId] = categories;
|
||||
|
||||
await DataStore.del(pinDmsKey);
|
||||
}
|
||||
|
||||
await Promise.all([DataStore.del(CATEGORY_MIGRATED_PINDMS_KEY), DataStore.del(CATEGORY_MIGRATED_KEY), DataStore.del(OLD_CATEGORY_KEY)]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,11 +112,8 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Prevent Discord from trying to connect to hidden voice channels
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(?=(\|\||&&)\i\.\i\.selectVoiceChannel\((\i)\.id\))/,
|
||||
replace: (_, condition, channel) => condition === "||"
|
||||
? `||$self.isHiddenChannel(${channel})`
|
||||
: `&&!$self.isHiddenChannel(${channel})`
|
||||
match: /(?=\|\|\i\.\i\.selectVoiceChannel\((\i)\.id\))/,
|
||||
replace: (_, channel) => `||$self.isHiddenChannel(${channel})`
|
||||
},
|
||||
{
|
||||
// Make Discord show inside the channel if clicking on a hidden or locked channel
|
||||
|
|
@ -129,11 +126,8 @@ export default definePlugin({
|
|||
{
|
||||
find: ".AUDIENCE),{isSubscriptionGated",
|
||||
replacement: {
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(!)?(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,
|
||||
replace: (m, not, channel) => not
|
||||
? `${m}&&!$self.isHiddenChannel(${channel})`
|
||||
: `${m}||$self.isHiddenChannel(${channel})`
|
||||
match: /(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,
|
||||
replace: (m, channel) => `${m}||$self.isHiddenChannel(${channel})`
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -183,11 +177,8 @@ export default definePlugin({
|
|||
},
|
||||
// Make voice channels also appear as muted if they are muted
|
||||
{
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(?<=\.wrapper:\i\.notInteractive,)(.+?)(if\()?(\i)(?:\)return |\?)(\i\.MUTED)/,
|
||||
replace: (_, otherClasses, isIf, isMuted, mutedClassExpression) => isIf
|
||||
? `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""`
|
||||
: `${isMuted}?${mutedClassExpression}:"",${otherClasses}${isMuted}?""`
|
||||
match: /(?<=\.wrapper:\i\.notInteractive,)(.+?)if\((\i)(?:\)return |\?)(\i\.MUTED)/,
|
||||
replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""`
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -197,8 +188,7 @@ export default definePlugin({
|
|||
{
|
||||
// Make muted channels also appear as unread if hide unreads is false, using the HiddenIconWithMutedStyle and the channel is hidden
|
||||
predicate: () => settings.store.hideUnreads === false && settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,
|
||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
||||
match: /(?<=\.LOCKED(?:;if\(|:))(?<={channel:(\i).+?)/,
|
||||
match: /(?<=\.LOCKED;if\()(?<={channel:(\i).+?)/,
|
||||
replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&`
|
||||
},
|
||||
{
|
||||
|
|
@ -292,8 +282,8 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
// Change the role permission check to CONNECT if the channel is locked
|
||||
match: /\i\.\i\(\i\.\i\.ADMINISTRATOR,\i\.\i\.VIEW_CHANNEL\)(?<=context:(\i)}.+?)/,
|
||||
replace: (m, channel) => `$self.fixPermCheck(${m},${channel})`
|
||||
match: /(forceRoles:.+?)(\i\.\i\(\i\.\i\.ADMINISTRATOR,\i\.\i\.VIEW_CHANNEL\))(?<=context:(\i)}.+?)/,
|
||||
replace: (_, rest, mergedPermissions, channel) => `${rest}$self.swapViewChannelWithConnectPermission(${mergedPermissions},${channel})`
|
||||
},
|
||||
{
|
||||
// Change the permissionOverwrite check to CONNECT if the channel is locked
|
||||
|
|
@ -303,7 +293,7 @@ export default definePlugin({
|
|||
{
|
||||
// Include the @everyone role in the allowed roles list for Hidden Channels
|
||||
match: /getSortedRoles.+?\.filter\(\i=>(?=!)/,
|
||||
replace: m => `${m}$self.isHiddenChannel(arguments[0].channel)?true:`
|
||||
replace: m => `${m}$self.isHiddenChannel(arguments[0]?.channel)?true:`
|
||||
},
|
||||
{
|
||||
// If the @everyone role has the required permissions, make the array only contain it
|
||||
|
|
@ -493,13 +483,13 @@ export default definePlugin({
|
|||
],
|
||||
|
||||
|
||||
fixPermCheck(originalPerms: bigint, channel: Channel) {
|
||||
swapViewChannelWithConnectPermission(mergedPermissions: bigint, channel: Channel) {
|
||||
if (!PermissionStore.can(PermissionsBits.CONNECT, channel)) {
|
||||
originalPerms &= ~PermissionsBits.VIEW_CHANNEL;
|
||||
originalPerms |= PermissionsBits.CONNECT;
|
||||
mergedPermissions &= ~PermissionsBits.VIEW_CHANNEL;
|
||||
mergedPermissions |= PermissionsBits.CONNECT;
|
||||
}
|
||||
|
||||
return originalPerms;
|
||||
return mergedPermissions;
|
||||
},
|
||||
|
||||
isHiddenChannel(channel: Channel & { channelId?: string; }, checkConnect = false) {
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ export default definePlugin({
|
|||
find: "#{intl::GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL}),allowOverflow:",
|
||||
predicate: () => settings.store.showModView,
|
||||
replacement: {
|
||||
match: /(role:)\i(?<=\i\.roles,\i\.highestRoleId,(\i)\].+)/,
|
||||
replace: "$1$self.findHighestRole(arguments[0],$2)",
|
||||
match: /(?<=\.highestRole\),)role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+)/,
|
||||
replace: "role:$self.getHighestRole(arguments[0],$2)",
|
||||
}
|
||||
},
|
||||
// allows you to open mod view on yourself
|
||||
|
|
@ -87,7 +87,7 @@ export default definePlugin({
|
|||
}
|
||||
],
|
||||
|
||||
findHighestRole({ member }: { member: GuildMember; }, roles: Role[]): Role | undefined {
|
||||
getHighestRole({ member }: { member: GuildMember; }, roles: Role[]): Role | undefined {
|
||||
try {
|
||||
return roles.find(role => role.id === member.highestRoleId);
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
|
||||
import "./spotifyStyles.css";
|
||||
import "./visualRefreshSpotifyStyles.css"; // TODO: merge with spotifyStyles.css and remove when old UI is discontinued
|
||||
|
||||
import { Settings } from "@api/Settings";
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
#vc-spotify-player {
|
||||
padding: 0.375rem 0.5rem;
|
||||
padding: 12px;
|
||||
background: var(--bg-overlay-floating, var(--background-base-low, var(--background-base-lower-alt)));
|
||||
margin: 0;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
|
||||
--vc-spotify-green: var(--spotify, #1db954); /* so custom themes can easily change it */
|
||||
/* so custom themes can easily change it */
|
||||
--vc-spotify-green: var(--spotify, #1db954);
|
||||
--vc-spotify-green-90: color-mix(in hsl, var(--vc-spotify-green), transparent 90%);
|
||||
--vc-spotify-green-80: color-mix(in hsl, var(--vc-spotify-green), transparent 80%);
|
||||
}
|
||||
|
|
@ -16,12 +21,13 @@
|
|||
}
|
||||
|
||||
.vc-spotify-button {
|
||||
margin: 0 2px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: none;
|
||||
color: var(--interactive-normal);
|
||||
padding: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
@ -47,13 +53,16 @@
|
|||
filter: brightness(1.3);
|
||||
} */
|
||||
|
||||
.vc-spotify-shuffle-on,
|
||||
.vc-spotify-repeat-context,
|
||||
.vc-spotify-repeat-track,
|
||||
.vc-spotify-shuffle-on:hover,
|
||||
.vc-spotify-shuffle-on {
|
||||
background-color: var(--vc-spotify-green-90);
|
||||
}
|
||||
|
||||
.vc-spotify-repeat-context:hover,
|
||||
.vc-spotify-repeat-track:hover {
|
||||
color: var(--vc-spotify-green);
|
||||
.vc-spotify-repeat-track:hover,
|
||||
.vc-spotify-shuffle-on:hover {
|
||||
background-color: var(--vc-spotify-green-80);
|
||||
}
|
||||
|
||||
.vc-spotify-tooltip-text {
|
||||
|
|
@ -74,6 +83,15 @@
|
|||
|
||||
.vc-spotify-button-row {
|
||||
justify-content: center;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.vc-spotify-secondary-song-info {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.vc-spotify-song-info-prefix {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#vc-spotify-info-wrapper {
|
||||
|
|
@ -127,7 +145,7 @@
|
|||
.vc-spotify-album {
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
color: var(--header-secondary);
|
||||
color: var(--header-primary);
|
||||
}
|
||||
|
||||
.vc-spotify-comma {
|
||||
|
|
@ -155,16 +173,26 @@
|
|||
padding: 0 !important;
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="bar-"] {
|
||||
height: 4px !important;
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="bar"] {
|
||||
height: 3px !important;
|
||||
top: calc(12px - 4px / 2 + var(--bar-offset));
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="barFill"] {
|
||||
background-color: var(--interactive-active);
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"]:hover [class^="barFill"] {
|
||||
background-color: var(--vc-spotify-green);
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] {
|
||||
/* these importants are necessary, it applies a width and height through inline styles */
|
||||
height: 10px !important;
|
||||
width: 10px !important;
|
||||
margin-top: 4px;
|
||||
background-color: var(--interactive-normal);
|
||||
height: 16px !important;
|
||||
width: 16px !important;
|
||||
margin-top: calc(17px/-2 + var(--bar-offset)/2);
|
||||
margin-left: -0.5px;
|
||||
background-color: var(--interactive-active);
|
||||
border-color: var(--interactive-normal);
|
||||
color: var(--interactive-normal);
|
||||
opacity: 0;
|
||||
|
|
@ -183,6 +211,8 @@
|
|||
font-size: 12px;
|
||||
top: 10px;
|
||||
position: absolute;
|
||||
margin-top: 8px;
|
||||
font-family: var(--font-code);
|
||||
}
|
||||
|
||||
.vc-spotify-time-left {
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
/* TODO: merge with spotifyStyles.css and remove when old UI is discontinued */
|
||||
.visual-refresh {
|
||||
#vc-spotify-player {
|
||||
padding: 12px;
|
||||
background: var(--bg-overlay-floating, var(--background-base-low, var(--background-base-lower-alt)));
|
||||
margin: 0;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
|
||||
.vc-spotify-song-info-prefix {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.vc-spotify-artist, .vc-spotify-album {
|
||||
color: var(--header-primary);
|
||||
}
|
||||
|
||||
.vc-spotify-secondary-song-info {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar {
|
||||
position: relative;
|
||||
color: var(--text-default);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] {
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="bar"] {
|
||||
height: 3px !important;
|
||||
top: calc(12px - 4px / 2 + var(--bar-offset));
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="barFill"] {
|
||||
background-color: var(--interactive-active);
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"]:hover [class^="barFill"] {
|
||||
background-color: var(--vc-spotify-green);
|
||||
}
|
||||
|
||||
#vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] {
|
||||
background-color: var(--interactive-active);
|
||||
width: 16px !important;
|
||||
height: 16px !important;
|
||||
margin-top: calc(17px/-2 + var(--bar-offset)/2);
|
||||
margin-left: -0.5px;
|
||||
}
|
||||
|
||||
.vc-spotify-progress-time {
|
||||
margin-top: 8px;
|
||||
font-family: var(--font-code);
|
||||
}
|
||||
|
||||
.vc-spotify-button-row {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.vc-spotify-button {
|
||||
margin: 0 2px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.vc-spotify-repeat-context, .vc-spotify-repeat-track, .vc-spotify-shuffle-on {
|
||||
background-color: var(--vc-spotify-green-90);
|
||||
}
|
||||
|
||||
.vc-spotify-repeat-context:hover, .vc-spotify-repeat-track:hover, .vc-spotify-shuffle-on:hover {
|
||||
background-color: var(--vc-spotify-green-80);
|
||||
}
|
||||
}
|
||||
|
|
@ -25,17 +25,10 @@ export default definePlugin({
|
|||
name: "StartupTimings",
|
||||
description: "Adds Startup Timings to the Settings menu",
|
||||
authors: [Devs.Megu],
|
||||
|
||||
patches: [{
|
||||
find: "#{intl::ACTIVITY_SETTINGS}",
|
||||
replacement: [
|
||||
{
|
||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
||||
match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+}\)}\))/,
|
||||
replace: (_, commaOrSemi, settings, elements) => "" +
|
||||
`${commaOrSemi}${settings}?.[0]==="CHANGELOG"` +
|
||||
`&&${elements}.push({section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage})`,
|
||||
noWarn: true
|
||||
},
|
||||
{
|
||||
match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+\)\)\}\))(?=\)\})/,
|
||||
replace: (_, commaOrSemi, settings, elements) => "" +
|
||||
|
|
@ -44,5 +37,6 @@ export default definePlugin({
|
|||
},
|
||||
]
|
||||
}],
|
||||
|
||||
StartupTimingPage
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { DeleteIcon } from "@components/Icons";
|
||||
|
|
@ -241,20 +240,5 @@ export default definePlugin({
|
|||
// Channel used for sharing rules, applying rules here would be messy
|
||||
if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return;
|
||||
msg.content = applyRules(msg.content);
|
||||
},
|
||||
|
||||
async start() {
|
||||
// TODO(OptionType.CUSTOM Related): Remove DataStore rules migrations once enough time has passed
|
||||
const oldStringRules = await DataStore.get<Rule[]>(STRING_RULES_KEY);
|
||||
if (oldStringRules != null) {
|
||||
settings.store.stringRules = oldStringRules;
|
||||
await DataStore.del(STRING_RULES_KEY);
|
||||
}
|
||||
|
||||
const oldRegexRules = await DataStore.get<Rule[]>(REGEX_RULES_KEY);
|
||||
if (oldRegexRules != null) {
|
||||
settings.store.regexRules = oldRegexRules;
|
||||
await DataStore.del(REGEX_RULES_KEY);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -42,13 +42,6 @@ export default definePlugin({
|
|||
{
|
||||
find: '="SYSTEM_TAG"',
|
||||
replacement: [
|
||||
{
|
||||
// Add next to username (compact mode)
|
||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
||||
match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\),(?=\i)/g,
|
||||
replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),",
|
||||
noWarn: true
|
||||
},
|
||||
{
|
||||
// Add next to username (compact mode)
|
||||
match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g,
|
||||
|
|
|
|||
|
|
@ -199,12 +199,6 @@ export default definePlugin({
|
|||
{
|
||||
find: ".overlay:void 0,status:",
|
||||
replacement: [
|
||||
{
|
||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
||||
match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/,
|
||||
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},",
|
||||
noWarn: true
|
||||
},
|
||||
{
|
||||
match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",.{0,100}className:\i,/,
|
||||
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},",
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
|||
name: "Mai",
|
||||
id: 722647978577363026n
|
||||
},
|
||||
echo: {
|
||||
name: "ECHO",
|
||||
id: 712639419785412668n
|
||||
amy: {
|
||||
name: "Amy",
|
||||
id: 603229858612510720n
|
||||
},
|
||||
katlyn: {
|
||||
name: "katlyn",
|
||||
|
|
|
|||
|
|
@ -31,8 +31,6 @@ export let MessageStore: Omit<t.MessageStore, "getMessages"> & GenericStore & {
|
|||
getMessages(chanId: string): any;
|
||||
};
|
||||
|
||||
// TODO: The correct name for this is ChannelActionCreators and it has already been exported again from utils. Remove this export once enough time has passed
|
||||
export const PrivateChannelsStore = findByPropsLazy("openPrivateChannel");
|
||||
export let PermissionStore: GenericStore;
|
||||
export let GuildChannelStore: GenericStore;
|
||||
export let ReadStateStore: GenericStore;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue