Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
6f581175a8
9 changed files with 52 additions and 126 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "equicord",
|
||||
"private": "true",
|
||||
"version": "1.14.13.3",
|
||||
"version": "1.14.14.0",
|
||||
"description": "The other cutest Discord client mod",
|
||||
"homepage": "https://github.com/Equicord/Equicord#readme",
|
||||
"bugs": {
|
||||
|
|
@ -104,4 +104,4 @@
|
|||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ import { copyWithToast } from "@utils/discord";
|
|||
import { Logger } from "@utils/Logger";
|
||||
import { shouldShowContributorBadge, shouldShowEquicordContributorBadge } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { ContextMenuApi, Menu, Toasts, UserStore } from "@webpack/common";
|
||||
import { ContextMenuApi, Forms, Menu, Modal, openModal, Toasts, UserStore } from "@webpack/common";
|
||||
|
||||
import Plugins, { PluginMeta } from "~plugins";
|
||||
|
||||
|
|
@ -140,9 +140,15 @@ export default definePlugin({
|
|||
match: /alt:" ","aria-hidden":!0,src:.{0,50}(\i).iconSrc/,
|
||||
replace: "...$1.props,$&"
|
||||
},
|
||||
// Path with 2026-04-badge-discovery OFF
|
||||
{
|
||||
match: /(?<=forceOpen:.{0,40}?ariaHidden:!0,)children:(?=.{0,50}?(\i)\.id)/,
|
||||
replace: "children:$1.component?$self.renderBadgeComponent({...$1}) :"
|
||||
replace: "children:$1.component?$self.renderBadgeComponent({...$1}):"
|
||||
},
|
||||
// Path with 2026-04-badge-discovery ON
|
||||
{
|
||||
match: /(?<=fallbackIconSrc:.{0,50}?)children:(?=.{0,50}?(\i)\.id)/,
|
||||
replace: "children:$1.component?$self.renderBadgeComponent({...$1}):"
|
||||
},
|
||||
// handle onClick and onContextMenu
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function getCounterColor(percentage: number) {
|
|||
export default definePlugin({
|
||||
name: "CharacterCounter",
|
||||
description: "Adds a character counter to the chat input",
|
||||
authors: [Devs.thororen, EquicordDevs.creations],
|
||||
authors: [Devs.thororen, Devs.creations],
|
||||
tags: ["Utility"],
|
||||
settings,
|
||||
patches: [
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
}
|
||||
|
||||
.vc-charCounter-selected {
|
||||
color: var(--vc-char-count-selected-color, --brand-500);
|
||||
}
|
||||
color: var(--brand-500);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
# FriendsSince
|
||||
|
||||
Shows when you became friends with someone in the user popout
|
||||
|
||||

|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2024 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import "./styles.css";
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { getCurrentChannel } from "@utils/discord";
|
||||
import definePlugin from "@utils/types";
|
||||
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy } from "@webpack";
|
||||
import { RelationshipStore } from "@webpack/common";
|
||||
|
||||
const WrapperClasses = findCssClassesLazy("memberSinceWrapper");
|
||||
const ContainerClasses = findCssClassesLazy("memberSince");
|
||||
const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"');
|
||||
const locale = findByPropsLazy("getLocale");
|
||||
const Section = findComponentByCodeLazy("headingVariant:", '"section"', "headingIcon:");
|
||||
|
||||
const FriendsSinceSection = ErrorBoundary.wrap(({ userId, isSideBar }: { userId: string; isSideBar: boolean; }) => {
|
||||
if (!RelationshipStore.isFriend(userId)) return null;
|
||||
|
||||
const friendsSince = RelationshipStore.getSince(userId);
|
||||
if (!friendsSince) return null;
|
||||
|
||||
if (isSideBar) {
|
||||
return (
|
||||
<Section
|
||||
heading="Friends Since"
|
||||
headingVariant="text-xs/semibold"
|
||||
headingColor="text-strong"
|
||||
>
|
||||
<BaseText size="sm">
|
||||
{getCreatedAtDate(friendsSince, locale.getLocale())}
|
||||
</BaseText>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Section
|
||||
heading="Friends Since"
|
||||
headingVariant="text-xs/medium"
|
||||
headingColor="text-default"
|
||||
className="vc-friendsSince-profile-section"
|
||||
>
|
||||
<div className={WrapperClasses.memberSinceWrapper}>
|
||||
<div className={ContainerClasses.memberSince}>
|
||||
{!!getCurrentChannel()?.guild_id && (
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="var(--interactive-icon-default)"
|
||||
>
|
||||
<path d="M13 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" />
|
||||
<path d="M3 5v-.75C3 3.56 3.56 3 4.25 3s1.24.56 1.33 1.25C6.12 8.65 9.46 12 13 12h1a8 8 0 0 1 8 8 2 2 0 0 1-2 2 .21.21 0 0 1-.2-.15 7.65 7.65 0 0 0-1.32-2.3c-.15-.2-.42-.06-.39.17l.25 2c.02.15-.1.28-.25.28H9a2 2 0 0 1-2-2v-2.22c0-1.57-.67-3.05-1.53-4.37A15.85 15.85 0 0 1 3 5Z" />
|
||||
</svg>
|
||||
)}
|
||||
<BaseText size="sm">
|
||||
{getCreatedAtDate(friendsSince, locale.getLocale())}
|
||||
</BaseText>
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}, { noop: true });
|
||||
|
||||
export default definePlugin({
|
||||
name: "FriendsSince",
|
||||
description: "Shows when you became friends with someone in the user popout",
|
||||
tags: ["Friends"],
|
||||
authors: [Devs.Elvyra, Devs.Antti],
|
||||
dependencies: ["ProfileSectionsAPI"],
|
||||
renderProfileSection: {
|
||||
render: FriendsSinceSection,
|
||||
priority: 0,
|
||||
},
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.vc-friendsSince-profile-section {
|
||||
gap: 4px;
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ import { findByCodeLazy } from "@webpack";
|
|||
import { ContextMenuApi, FluxDispatcher, GuildMemberStore, GuildRoleStore, i18n, Menu, Modal, openModalLazy, PermissionsBits, ScrollerThin, Text, Tooltip, useEffect, useMemo, useRef, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { settings } from "..";
|
||||
import { PermissionAllowedIcon, PermissionDefaultIcon, PermissionDeniedIcon } from "./icons";
|
||||
import { PermissionAllowedIcon, PermissionDeniedIcon } from "./icons";
|
||||
|
||||
type GetRoleIconData = (role: Role, size: number) => { customIconSrc?: string; unicodeEmoji?: UnicodeEmoji; };
|
||||
const getRoleIconData: GetRoleIconData = findByCodeLazy("convertSurrogateToName", "customIconSrc", "unicodeEmoji");
|
||||
|
|
@ -160,37 +160,44 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
|
|||
</ScrollerThin>
|
||||
<div className={cl("modal-divider")} />
|
||||
<ScrollerThin className={cl("modal-perms")} orientation="auto">
|
||||
{Object.values(PermissionsBits).map(bit => (
|
||||
<div key={bit} className={cl("modal-perms-item")}>
|
||||
<div className={cl("modal-perms-item-icon")}>
|
||||
{(() => {
|
||||
const { permissions, overwriteAllow, overwriteDeny } = selectedItem;
|
||||
{Object.values(PermissionsBits).map(bit => {
|
||||
const overrideType = (() => {
|
||||
const { permissions, overwriteAllow, overwriteDeny } = selectedItem;
|
||||
|
||||
if (permissions)
|
||||
return (permissions & bit) === bit
|
||||
? PermissionAllowedIcon()
|
||||
: PermissionDeniedIcon();
|
||||
if (permissions != null)
|
||||
return (permissions & bit) === bit
|
||||
? "allowed"
|
||||
: "denied";
|
||||
|
||||
if (overwriteAllow && (overwriteAllow & bit) === bit)
|
||||
return PermissionAllowedIcon();
|
||||
if (overwriteDeny && (overwriteDeny & bit) === bit)
|
||||
return PermissionDeniedIcon();
|
||||
if (overwriteAllow && (overwriteAllow & bit) === bit)
|
||||
return "allowed";
|
||||
if (overwriteDeny && (overwriteDeny & bit) === bit)
|
||||
return "denied";
|
||||
|
||||
return PermissionDefaultIcon();
|
||||
})()}
|
||||
return "default";
|
||||
})();
|
||||
|
||||
if (overrideType === "default") return null;
|
||||
|
||||
return (
|
||||
<div key={bit} className={cl("modal-perms-item")}>
|
||||
<div className={cl("modal-perms-item-icon")}>
|
||||
{overrideType === "allowed" && <PermissionAllowedIcon />}
|
||||
{overrideType === "denied" && <PermissionDeniedIcon />}
|
||||
</div>
|
||||
<Text variant="text-md/normal">{guildPermissionSpecMap[String(bit)].title}</Text>
|
||||
|
||||
<Tooltip text={
|
||||
(() => {
|
||||
const { description } = guildPermissionSpecMap[String(bit)];
|
||||
return typeof description === "function" ? i18n.intl.format(description, {}) : description;
|
||||
})()
|
||||
}>
|
||||
{props => <InfoIcon {...props} />}
|
||||
</Tooltip>
|
||||
</div>
|
||||
<Text variant="text-md/normal">{guildPermissionSpecMap[String(bit)].title}</Text>
|
||||
|
||||
<Tooltip text={
|
||||
(() => {
|
||||
const { description } = guildPermissionSpecMap[String(bit)];
|
||||
return typeof description === "function" ? i18n.intl.format(description, {}) : description;
|
||||
})()
|
||||
}>
|
||||
{props => <InfoIcon {...props} />}
|
||||
</Tooltip>
|
||||
</div>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</ScrollerThin>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -658,6 +658,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
|||
name: "prism",
|
||||
id: 390884143749136386n,
|
||||
},
|
||||
creations: {
|
||||
name: "creations",
|
||||
id: 209830981060788225n
|
||||
},
|
||||
nightmaresan: {
|
||||
name: "NightmareSan",
|
||||
id: 304239816466235392n
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue