mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 01:23:03 -04:00
Merge branch 'dev' into strict-csp
This commit is contained in:
commit
008ce1c668
8 changed files with 5 additions and 60 deletions
|
@ -13,13 +13,6 @@ export default definePlugin({
|
||||||
authors: [Devs.sadan, Devs.Nuckyz],
|
authors: [Devs.sadan, Devs.Nuckyz],
|
||||||
description: "Allows you to omit either width or height when opening an image modal",
|
description: "Allows you to omit either width or height when opening an image modal",
|
||||||
patches: [
|
patches: [
|
||||||
{
|
|
||||||
find: ".contain,SCALE_DOWN:",
|
|
||||||
replacement: {
|
|
||||||
match: /(?<="IMAGE"===\i\?)\i(?=\?)/,
|
|
||||||
replace: "true"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
find: ".dimensionlessImage,",
|
find: ".dimensionlessImage,",
|
||||||
replacement: {
|
replacement: {
|
||||||
|
|
|
@ -162,14 +162,6 @@ export default definePlugin({
|
||||||
managedStyle,
|
managedStyle,
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
|
||||||
find: ".contain,SCALE_DOWN:",
|
|
||||||
replacement: {
|
|
||||||
match: /imageClassName:/,
|
|
||||||
replace: `id:"${ELEMENT_ID}",$&`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
find: ".dimensionlessImage,",
|
find: ".dimensionlessImage,",
|
||||||
replacement: [
|
replacement: [
|
||||||
|
|
|
@ -72,6 +72,7 @@ const ReadAllButton = () => (
|
||||||
<Button
|
<Button
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
size={Button.Sizes.MIN}
|
size={Button.Sizes.MIN}
|
||||||
|
look={Button.Looks.BLANK}
|
||||||
color={Button.Colors.CUSTOM}
|
color={Button.Colors.CUSTOM}
|
||||||
className="vc-ranb-button"
|
className="vc-ranb-button"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
.vc-ranb-button {
|
.vc-ranb-button {
|
||||||
color: var(--interactive-normal);
|
color: var(--interactive-normal);
|
||||||
padding: 0 0.5em;
|
padding: 0 0.5em;
|
||||||
margin-bottom: 0.5em;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,13 +84,7 @@ export default definePlugin({
|
||||||
find: ".USER_MENTION)",
|
find: ".USER_MENTION)",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
// FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert
|
match: /(?<=onContextMenu:\i,color:)\i(?=,onClick)(?<=user:(\i),channel:(\i).+?)/,
|
||||||
match: /onContextMenu:\i,color:\i,\.\.\.\i(?=,children:)(?<=user:(\i),channel:(\i).{0,500}?)/,
|
|
||||||
replace: "$&,color:$self.getColorInt($1?.id,$2?.id)",
|
|
||||||
noWarn: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
match: /(?<=onContextMenu:\i,color:)\i(?=\},\i\),\{children)(?<=user:(\i),channel:(\i).{0,500}?)/,
|
|
||||||
replace: "$self.getColorInt($1?.id,$2?.id)",
|
replace: "$self.getColorInt($1?.id,$2?.id)",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
.vc-position-inherit {
|
|
||||||
position: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* copy pasted from discord css. not really webpack-findable since it's the only class in the module
|
|
||||||
**/
|
|
||||||
|
|
||||||
.vc-image-modal {
|
|
||||||
background: transparent !important;
|
|
||||||
box-shadow: none !important;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media(width <= 485px) {
|
|
||||||
.vc-image-modal {
|
|
||||||
overflow: visible;
|
|
||||||
overflow: initial;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -16,8 +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 "./discord.css";
|
|
||||||
|
|
||||||
import { MessageObject } from "@api/MessageEvents";
|
import { MessageObject } from "@api/MessageEvents";
|
||||||
import { ChannelStore, ComponentDispatch, Constants, FluxDispatcher, GuildStore, i18n, IconUtils, InviteActions, MessageActions, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileActions, UserProfileStore, UserSettingsActionCreators, UserUtils } from "@webpack/common";
|
import { ChannelStore, ComponentDispatch, Constants, FluxDispatcher, GuildStore, i18n, IconUtils, InviteActions, MessageActions, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileActions, UserProfileStore, UserSettingsActionCreators, UserUtils } from "@webpack/common";
|
||||||
import { Channel, Guild, Message, User } from "discord-types/general";
|
import { Channel, Guild, Message, User } from "discord-types/general";
|
||||||
|
@ -143,9 +141,6 @@ export function sendMessage(
|
||||||
*/
|
*/
|
||||||
export function openImageModal(item: Except<MediaModalItem, "type">, mediaModalProps?: Omit<MediaModalProps, "items">) {
|
export function openImageModal(item: Except<MediaModalItem, "type">, mediaModalProps?: Omit<MediaModalProps, "items">) {
|
||||||
return openMediaModal({
|
return openMediaModal({
|
||||||
className: "vc-image-modal",
|
|
||||||
fit: "vc-position-inherit",
|
|
||||||
shouldAnimateCarousel: true,
|
|
||||||
items: [{
|
items: [{
|
||||||
type: "IMAGE",
|
type: "IMAGE",
|
||||||
original: item.original ?? item.url,
|
original: item.original ?? item.url,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* 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 { filters, findModuleId, mapMangledModuleLazy, proxyLazyWebpack, wreq } from "@webpack";
|
import { filters, findByCodeLazy, mapMangledModuleLazy } from "@webpack";
|
||||||
import type { ComponentType, PropsWithChildren, ReactNode, Ref } from "react";
|
import type { ComponentType, PropsWithChildren, ReactNode, Ref } from "react";
|
||||||
|
|
||||||
import { LazyComponent } from "./react";
|
import { LazyComponent } from "./react";
|
||||||
|
@ -138,16 +138,10 @@ export type MediaModalProps = {
|
||||||
fit?: string;
|
fit?: string;
|
||||||
shouldRedactExplicitContent?: boolean;
|
shouldRedactExplicitContent?: boolean;
|
||||||
shouldHideMediaOptions?: boolean;
|
shouldHideMediaOptions?: boolean;
|
||||||
shouldAnimateCarousel?: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const openMediaModal: (props: MediaModalProps) => void = proxyLazyWebpack(() => {
|
// modal key: "Media Viewer Modal"
|
||||||
const mediaModalKeyModuleId = findModuleId('"Zoomed Media Modal"');
|
export const openMediaModal: (props: MediaModalProps) => void = findByCodeLazy("hasMediaOptions", "shouldHideMediaOptions");
|
||||||
if (mediaModalKeyModuleId == null) return;
|
|
||||||
|
|
||||||
const openMediaModalModule = wreq(findModuleId(mediaModalKeyModuleId, "modalKey:") as any);
|
|
||||||
return Object.values<any>(openMediaModalModule).find(v => String(v).includes("modalKey:"));
|
|
||||||
});
|
|
||||||
|
|
||||||
interface ModalAPI {
|
interface ModalAPI {
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue