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
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
|
|
@ -13,11 +13,14 @@
|
||||||
"typescript.format.semicolons": "insert",
|
"typescript.format.semicolons": "insert",
|
||||||
"typescript.preferences.quoteStyle": "double",
|
"typescript.preferences.quoteStyle": "double",
|
||||||
"javascript.preferences.quoteStyle": "double",
|
"javascript.preferences.quoteStyle": "double",
|
||||||
|
|
||||||
"gitlens.remotes": [
|
"gitlens.remotes": [
|
||||||
{
|
{
|
||||||
"domain": "codeberg.org",
|
"domain": "codeberg.org",
|
||||||
"type": "Gitea"
|
"type": "Gitea"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
"css.format.spaceAroundSelectorSeparator": true,
|
||||||
|
"[css]": {
|
||||||
|
"editor.defaultFormatter": "vscode.css-language-features"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,17 +4,13 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
color: var(--text-default);
|
color: var(--text-default);
|
||||||
background-color: var(--background-base-lower-alt);
|
background-color: var(--background-base-low);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.visual-refresh .vc-notification-root {
|
|
||||||
background-color: var(--background-base-low);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) {
|
.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 2147483647;
|
z-index: 2147483647;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
import { React, TextInput } from "@webpack/common";
|
import { React, TextInput } from "@webpack/common";
|
||||||
|
|
||||||
// TODO: Refactor settings to use this as well
|
|
||||||
interface TextInputProps {
|
interface TextInputProps {
|
||||||
/**
|
/**
|
||||||
* WARNING: Changing this between renders will have no effect!
|
* WARNING: Changing this between renders will have no effect!
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
.vc-addon-card {
|
.vc-addon-card {
|
||||||
background-color: var(--background-base-lower-alt);
|
background-color: var(--card-primary-bg);
|
||||||
color: var(--interactive-active);
|
color: var(--interactive-active);
|
||||||
|
border: 1px solid var(--border-subtle);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
@ -11,26 +12,15 @@
|
||||||
box-sizing: border-box;
|
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 {
|
.vc-addon-card-disabled {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-addon-card:hover {
|
.vc-addon-card:hover {
|
||||||
background-color: var(--background-tertiary);
|
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: var(--elevation-high);
|
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 {
|
.vc-addon-header {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -104,4 +94,4 @@
|
||||||
.vc-addon-title:hover {
|
.vc-addon-title:hover {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
animation: vc-addon-title var(--duration) linear infinite;
|
animation: vc-addon-title var(--duration) linear infinite;
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
.vc-settings-quickActions-pill {
|
.vc-settings-quickActions-pill {
|
||||||
all: unset;
|
all: unset;
|
||||||
background: var(--background-base-lower);
|
background: var(--button-secondary-background);
|
||||||
color: var(--header-secondary);
|
color: var(--header-secondary);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-settings-quickActions-pill:hover {
|
.vc-settings-quickActions-pill:hover {
|
||||||
background: var(--background-base-lower-alt);
|
background: var(--button-secondary-background-hover);
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: var(--elevation-high);
|
box-shadow: var(--elevation-high);
|
||||||
}
|
}
|
||||||
|
|
@ -36,15 +36,7 @@
|
||||||
outline-offset: 2px;
|
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 {
|
.vc-settings-quickActions-img {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
.vc-author-modal-name {
|
.vc-author-modal-name {
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
background: var(--background-tertiary);
|
background: var(--background-base-lowest);
|
||||||
border-radius: 0 9999px 9999px 0;
|
border-radius: 0 9999px 9999px 0;
|
||||||
padding: 6px 0.8em 6px 0.5em;
|
padding: 6px 0.8em 6px 0.5em;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
background: var(--background-tertiary);
|
background: var(--background-base-lowest);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
left: -32px;
|
left: -32px;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -48,4 +48,4 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.5em;
|
gap: 0.5em;
|
||||||
margin-top: 0.75em;
|
margin-top: 0.75em;
|
||||||
}
|
}
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 4px solid var(--background-tertiary);
|
border: 4px solid var(--background-base-lowest);
|
||||||
box-sizing: border-box
|
box-sizing: border-box
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-settings-modal-links {
|
.vc-settings-modal-links {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.2em;
|
gap: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-settings-theme-links:focus {
|
.vc-settings-theme-links:focus {
|
||||||
background-color: var(--background-tertiary);
|
background-color: var(--background-base-lowest);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-cloud-settings-sync-grid {
|
.vc-cloud-settings-sync-grid {
|
||||||
|
|
@ -74,4 +74,4 @@
|
||||||
|
|
||||||
.vc-updater-modal-close-button {
|
.vc-updater-modal-close-button {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
@ -16,11 +16,8 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: '"sticker")',
|
find: '"sticker")',
|
||||||
replacement: {
|
replacement: {
|
||||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
match: /return\(\i\.\i\|\|(?=\(.+?(\i)\.push)/,
|
||||||
match: /return\((!)?\i\.\i(?:\|\||&&)(?=\(.+?(\i)\.push)/,
|
replace: "$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),false)||"
|
||||||
replace: (m, not, children) => not
|
|
||||||
? `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),true)&&`
|
|
||||||
: `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),false)||`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,7 @@ export default definePlugin({
|
||||||
replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}`
|
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).+?\(\)=>)\2/,
|
||||||
match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?(?:function\(\){return |\(\)=>))\2/,
|
|
||||||
replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})`
|
replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These area names need to be hardcoded. Only betterFoldersSidebar is added by the plugin. */
|
/* 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 */
|
/* stylelint-disable-next-line value-keyword-case */
|
||||||
grid-template-columns: [start] min-content [guildsEnd] min-content [sidebarEnd] min-content [channelsEnd] 1fr [end];
|
grid-template-columns: [start] min-content [guildsEnd] min-content [sidebarEnd] min-content [channelsEnd] 1fr [end];
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"titleBar titleBar titleBar titleBar"
|
"titleBar titleBar titleBar titleBar"
|
||||||
"guildsList betterFoldersSidebar notice notice"
|
"guildsList betterFoldersSidebar notice notice"
|
||||||
"guildsList betterFoldersSidebar channelsList page";
|
"guildsList betterFoldersSidebar channelsList page";
|
||||||
}
|
}
|
||||||
|
|
@ -75,8 +75,8 @@ function createColorsOverrides(styles: string) {
|
||||||
const darkThemeBaseLightness = visualRefreshColorsLightness["--neutral-69-hsl"];
|
const darkThemeBaseLightness = visualRefreshColorsLightness["--neutral-69-hsl"];
|
||||||
|
|
||||||
createOrUpdateStyle(OVERRIDES_STYLE_ID, [
|
createOrUpdateStyle(OVERRIDES_STYLE_ID, [
|
||||||
`.visual-refresh.theme-light {\n ${generateNewColorVars(visualRefreshColorsLightness, lightThemeBaseLightness)} \n}`,
|
`.theme-light {\n ${generateNewColorVars(visualRefreshColorsLightness, lightThemeBaseLightness)} \n}`,
|
||||||
`.visual-refresh.theme-dark {\n ${generateNewColorVars(visualRefreshColorsLightness, darkThemeBaseLightness)} \n}`,
|
`.theme-dark {\n ${generateNewColorVars(visualRefreshColorsLightness, darkThemeBaseLightness)} \n}`,
|
||||||
].join("\n\n"));
|
].join("\n\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,8 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: ".selectPreviousCommandOption(",
|
find: ".selectPreviousCommandOption(",
|
||||||
replacement: {
|
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)/,
|
||||||
match: /(?<=(\i)\.which(?:!==|===)\i\.\i.ENTER(\|\||&&)).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=(?:\|\||&&)\(\i\.preventDefault)/,
|
replace: "!$self.shouldSubmit($1,$2)"
|
||||||
replace: (_, event, condition, codeblock) => `${condition === "||" ? "!" : ""}$self.shouldSubmit(${event},${codeblock})`
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -49,18 +49,6 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: ".decorationGridItem,",
|
find: ".decorationGridItem,",
|
||||||
replacement: [
|
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/,
|
match: /(?<==)\i=>{var{children.{20,200}decorationGridItem/,
|
||||||
replace: "$self.DecorationGridItem=$&",
|
replace: "$self.DecorationGridItem=$&",
|
||||||
|
|
|
||||||
|
|
@ -255,11 +255,8 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Disallow the emoji for premium locked if the intention doesn't allow it
|
// 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\))/,
|
||||||
match: /(!)?(\i\.\i\.canUseEmojisEverywhere\(\i\))/,
|
replace: m => `(${m}&&!${IS_BYPASSEABLE_INTENTION})`
|
||||||
replace: (m, not) => not
|
|
||||||
? `(${m}&&!${IS_BYPASSEABLE_INTENTION})`
|
|
||||||
: `(${m}||${IS_BYPASSEABLE_INTENTION})`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Allow animated emojis to be used if the intention allows it
|
// Allow animated emojis to be used if the intention allows it
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "#{intl::GUILD_OWNER}),children:",
|
find: "#{intl::GUILD_OWNER}),children:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=roleName:\i,)(colorString:)/,
|
match: /(?<=roleName:\i,)colorString:/,
|
||||||
replace: "$1$self.calculateNameColorForListContext(arguments[0]),originalColor:"
|
replace: "colorString:$self.calculateNameColorForListContext(arguments[0]),originalColor:"
|
||||||
},
|
},
|
||||||
predicate: () => settings.store.memberListColors
|
predicate: () => settings.store.memberListColors
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,6 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "{isSidebarVisible:",
|
find: "{isSidebarVisible:",
|
||||||
replacement: [
|
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")/,
|
match: /(?<=var\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/,
|
||||||
replace: ":[$1?.startsWith('members')?$self.render():null,$2",
|
replace: ":[$1?.startsWith('members')?$self.render():null,$2",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands";
|
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands";
|
||||||
import * as DataStore from "@api/DataStore";
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
|
@ -89,14 +88,6 @@ export default definePlugin({
|
||||||
settings,
|
settings,
|
||||||
|
|
||||||
async start() {
|
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();
|
const tags = getTags();
|
||||||
for (const tagName in tags) {
|
for (const tagName in tags) {
|
||||||
createTagCommand(tags[tagName]);
|
createTagCommand(tags[tagName]);
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,8 @@ export default definePlugin({
|
||||||
replace: "true"
|
replace: "true"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
match: /\(0,\i\.isDesktop\)\(\)/,
|
||||||
match: /(!)?\(0,\i\.isDesktop\)\(\)/,
|
replace: "true"
|
||||||
replace: (_, not) => not ? "false" : "true"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,8 @@ export default definePlugin({
|
||||||
find: "#{intl::ONBOARDING_CHANNEL_THRESHOLD_WARNING}",
|
find: "#{intl::ONBOARDING_CHANNEL_THRESHOLD_WARNING}",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
match: /{(?:\i:\(\)=>\i,?){2}}/,
|
||||||
match: /{(?:\i:(?:function\(\){return |\(\)=>)\i}?,?){2}}/,
|
replace: m => m.replaceAll(canonicalizeMatch(/\(\)=>\i/g), "()=>Promise.resolve(true)")
|
||||||
replace: m => m.replaceAll(canonicalizeMatch(/(function\(\){return |\(\)=>)\i/g), "$1()=>Promise.resolve(true)")
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
predicate: () => settings.store.onboarding
|
predicate: () => settings.store.onboarding
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export const { getGuildPermissionSpecMap } = findByPropsLazy("getGuildPermission
|
||||||
export const cl = classNameFactory("vc-permviewer-");
|
export const cl = classNameFactory("vc-permviewer-");
|
||||||
|
|
||||||
export function getSortedRolesForMember({ id: guildId }: Guild, member: GuildMember) {
|
export function getSortedRolesForMember({ id: guildId }: Guild, member: GuildMember) {
|
||||||
// the guild id is the @everyone role
|
// The guild id is the @everyone role
|
||||||
return GuildRoleStore
|
return GuildRoleStore
|
||||||
.getSortedRoles(guildId)
|
.getSortedRoles(guildId)
|
||||||
.filter(role => role.id === guildId || member.roles.includes(role.id));
|
.filter(role => role.id === guildId || member.roles.includes(role.id));
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* 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 { useForceUpdater } from "@utils/react";
|
||||||
import { UserStore } from "@webpack/common";
|
import { UserStore } from "@webpack/common";
|
||||||
|
|
||||||
|
|
@ -28,8 +26,6 @@ let forceUpdateDms: (() => void) | undefined = undefined;
|
||||||
export let currentUserCategories: Category[] = [];
|
export let currentUserCategories: Category[] = [];
|
||||||
|
|
||||||
export async function init() {
|
export async function init() {
|
||||||
await migrateData();
|
|
||||||
|
|
||||||
const userId = UserStore.getCurrentUser()?.id;
|
const userId = UserStore.getCurrentUser()?.id;
|
||||||
if (userId == null) return;
|
if (userId == null) return;
|
||||||
|
|
||||||
|
|
@ -154,28 +150,3 @@ export function moveChannel(channelId: string, direction: -1 | 1) {
|
||||||
|
|
||||||
swapElementsInArray(category.channels, a, b);
|
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
|
// 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\))/,
|
||||||
match: /(?=(\|\||&&)\i\.\i\.selectVoiceChannel\((\i)\.id\))/,
|
replace: (_, channel) => `||$self.isHiddenChannel(${channel})`
|
||||||
replace: (_, condition, channel) => condition === "||"
|
|
||||||
? `||$self.isHiddenChannel(${channel})`
|
|
||||||
: `&&!$self.isHiddenChannel(${channel})`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Make Discord show inside the channel if clicking on a hidden or locked 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",
|
find: ".AUDIENCE),{isSubscriptionGated",
|
||||||
replacement: {
|
replacement: {
|
||||||
// FIXME(Bundler change related): Remove old compatiblity once enough time has passed
|
match: /(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,
|
||||||
match: /(!)?(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,
|
replace: (m, channel) => `${m}||$self.isHiddenChannel(${channel})`
|
||||||
replace: (m, not, channel) => not
|
|
||||||
? `${m}&&!$self.isHiddenChannel(${channel})`
|
|
||||||
: `${m}||$self.isHiddenChannel(${channel})`
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -183,11 +177,8 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
// Make voice channels also appear as muted if they are muted
|
// 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)/,
|
||||||
match: /(?<=\.wrapper:\i\.notInteractive,)(.+?)(if\()?(\i)(?:\)return |\?)(\i\.MUTED)/,
|
replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""`
|
||||||
replace: (_, otherClasses, isIf, isMuted, mutedClassExpression) => isIf
|
|
||||||
? `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""`
|
|
||||||
: `${isMuted}?${mutedClassExpression}:"",${otherClasses}${isMuted}?""`
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -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
|
// 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,
|
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})&&`
|
replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -292,8 +282,8 @@ export default definePlugin({
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
// Change the role permission check to CONNECT if the channel is locked
|
// Change the role permission check to CONNECT if the channel is locked
|
||||||
match: /\i\.\i\(\i\.\i\.ADMINISTRATOR,\i\.\i\.VIEW_CHANNEL\)(?<=context:(\i)}.+?)/,
|
match: /(forceRoles:.+?)(\i\.\i\(\i\.\i\.ADMINISTRATOR,\i\.\i\.VIEW_CHANNEL\))(?<=context:(\i)}.+?)/,
|
||||||
replace: (m, channel) => `$self.fixPermCheck(${m},${channel})`
|
replace: (_, rest, mergedPermissions, channel) => `${rest}$self.swapViewChannelWithConnectPermission(${mergedPermissions},${channel})`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Change the permissionOverwrite check to CONNECT if the channel is locked
|
// 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
|
// Include the @everyone role in the allowed roles list for Hidden Channels
|
||||||
match: /getSortedRoles.+?\.filter\(\i=>(?=!)/,
|
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
|
// 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)) {
|
if (!PermissionStore.can(PermissionsBits.CONNECT, channel)) {
|
||||||
originalPerms &= ~PermissionsBits.VIEW_CHANNEL;
|
mergedPermissions &= ~PermissionsBits.VIEW_CHANNEL;
|
||||||
originalPerms |= PermissionsBits.CONNECT;
|
mergedPermissions |= PermissionsBits.CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return originalPerms;
|
return mergedPermissions;
|
||||||
},
|
},
|
||||||
|
|
||||||
isHiddenChannel(channel: Channel & { channelId?: string; }, checkConnect = false) {
|
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:",
|
find: "#{intl::GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL}),allowOverflow:",
|
||||||
predicate: () => settings.store.showModView,
|
predicate: () => settings.store.showModView,
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(role:)\i(?<=\i\.roles,\i\.highestRoleId,(\i)\].+)/,
|
match: /(?<=\.highestRole\),)role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+)/,
|
||||||
replace: "$1$self.findHighestRole(arguments[0],$2)",
|
replace: "role:$self.getHighestRole(arguments[0],$2)",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// allows you to open mod view on yourself
|
// 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 {
|
try {
|
||||||
return roles.find(role => role.id === member.highestRoleId);
|
return roles.find(role => role.id === member.highestRoleId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "./spotifyStyles.css";
|
import "./spotifyStyles.css";
|
||||||
import "./visualRefreshSpotifyStyles.css"; // TODO: merge with spotifyStyles.css and remove when old UI is discontinued
|
|
||||||
|
|
||||||
import { Settings } from "@api/Settings";
|
import { Settings } from "@api/Settings";
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
#vc-spotify-player {
|
#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);
|
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-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%);
|
--vc-spotify-green-80: color-mix(in hsl, var(--vc-spotify-green), transparent 80%);
|
||||||
}
|
}
|
||||||
|
|
@ -16,12 +21,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-button {
|
.vc-spotify-button {
|
||||||
|
margin: 0 2px;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
background: none;
|
background: none;
|
||||||
color: var(--interactive-normal);
|
color: var(--interactive-normal);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border-radius: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -47,13 +53,16 @@
|
||||||
filter: brightness(1.3);
|
filter: brightness(1.3);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.vc-spotify-shuffle-on,
|
|
||||||
.vc-spotify-repeat-context,
|
.vc-spotify-repeat-context,
|
||||||
.vc-spotify-repeat-track,
|
.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-context:hover,
|
||||||
.vc-spotify-repeat-track:hover {
|
.vc-spotify-repeat-track:hover,
|
||||||
color: var(--vc-spotify-green);
|
.vc-spotify-shuffle-on:hover {
|
||||||
|
background-color: var(--vc-spotify-green-80);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-tooltip-text {
|
.vc-spotify-tooltip-text {
|
||||||
|
|
@ -74,6 +83,15 @@
|
||||||
|
|
||||||
.vc-spotify-button-row {
|
.vc-spotify-button-row {
|
||||||
justify-content: center;
|
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 {
|
#vc-spotify-info-wrapper {
|
||||||
|
|
@ -127,7 +145,7 @@
|
||||||
.vc-spotify-album {
|
.vc-spotify-album {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: var(--header-secondary);
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-comma {
|
.vc-spotify-comma {
|
||||||
|
|
@ -155,16 +173,26 @@
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#vc-spotify-progress-bar > [class^="slider"] [class^="bar-"] {
|
#vc-spotify-progress-bar > [class^="slider"] [class^="bar"] {
|
||||||
height: 4px !important;
|
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"] {
|
#vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] {
|
||||||
/* these importants are necessary, it applies a width and height through inline styles */
|
/* these importants are necessary, it applies a width and height through inline styles */
|
||||||
height: 10px !important;
|
height: 16px !important;
|
||||||
width: 10px !important;
|
width: 16px !important;
|
||||||
margin-top: 4px;
|
margin-top: calc(17px/-2 + var(--bar-offset)/2);
|
||||||
background-color: var(--interactive-normal);
|
margin-left: -0.5px;
|
||||||
|
background-color: var(--interactive-active);
|
||||||
border-color: var(--interactive-normal);
|
border-color: var(--interactive-normal);
|
||||||
color: var(--interactive-normal);
|
color: var(--interactive-normal);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
@ -183,6 +211,8 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-family: var(--font-code);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-time-left {
|
.vc-spotify-time-left {
|
||||||
|
|
@ -196,4 +226,4 @@
|
||||||
.vc-spotify-fallback {
|
.vc-spotify-fallback {
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
color: var(--text-default);
|
color: var(--text-default);
|
||||||
}
|
}
|
||||||
|
|
@ -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",
|
name: "StartupTimings",
|
||||||
description: "Adds Startup Timings to the Settings menu",
|
description: "Adds Startup Timings to the Settings menu",
|
||||||
authors: [Devs.Megu],
|
authors: [Devs.Megu],
|
||||||
|
|
||||||
patches: [{
|
patches: [{
|
||||||
find: "#{intl::ACTIVITY_SETTINGS}",
|
find: "#{intl::ACTIVITY_SETTINGS}",
|
||||||
replacement: [
|
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.+\)\)\}\))(?=\)\})/,
|
match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+\)\)\}\))(?=\)\})/,
|
||||||
replace: (_, commaOrSemi, settings, elements) => "" +
|
replace: (_, commaOrSemi, settings, elements) => "" +
|
||||||
|
|
@ -44,5 +37,6 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
|
|
||||||
StartupTimingPage
|
StartupTimingPage
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DataStore } from "@api/index";
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Flex } from "@components/Flex";
|
import { Flex } from "@components/Flex";
|
||||||
import { DeleteIcon } from "@components/Icons";
|
import { DeleteIcon } from "@components/Icons";
|
||||||
|
|
@ -241,20 +240,5 @@ export default definePlugin({
|
||||||
// Channel used for sharing rules, applying rules here would be messy
|
// Channel used for sharing rules, applying rules here would be messy
|
||||||
if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return;
|
if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return;
|
||||||
msg.content = applyRules(msg.content);
|
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"',
|
find: '="SYSTEM_TAG"',
|
||||||
replacement: [
|
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)
|
// Add next to username (compact mode)
|
||||||
match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g,
|
match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g,
|
||||||
|
|
|
||||||
|
|
@ -199,12 +199,6 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: ".overlay:void 0,status:",
|
find: ".overlay:void 0,status:",
|
||||||
replacement: [
|
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,/,
|
match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",.{0,100}className:\i,/,
|
||||||
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},",
|
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},",
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,9 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
name: "Mai",
|
name: "Mai",
|
||||||
id: 722647978577363026n
|
id: 722647978577363026n
|
||||||
},
|
},
|
||||||
echo: {
|
amy: {
|
||||||
name: "ECHO",
|
name: "Amy",
|
||||||
id: 712639419785412668n
|
id: 603229858612510720n
|
||||||
},
|
},
|
||||||
katlyn: {
|
katlyn: {
|
||||||
name: "katlyn",
|
name: "katlyn",
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@ export let MessageStore: Omit<t.MessageStore, "getMessages"> & GenericStore & {
|
||||||
getMessages(chanId: string): any;
|
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 PermissionStore: GenericStore;
|
||||||
export let GuildChannelStore: GenericStore;
|
export let GuildChannelStore: GenericStore;
|
||||||
export let ReadStateStore: GenericStore;
|
export let ReadStateStore: GenericStore;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue