aboutsummaryrefslogtreecommitdiff
path: root/src/webpack/common
diff options
context:
space:
mode:
authorPhil <letsphil12@gmail.com>2023-06-16 19:35:50 +0200
committerGitHub <noreply@github.com>2023-06-16 19:35:50 +0200
commite8d90d2b45e8be0595f75454429fc1a5cedb4e33 (patch)
tree68c24a51d3fe3ba00d7a4314989e5c9ddbdf5403 /src/webpack/common
parent55af40ee747fbf872eb5bb07a49ea4cd276e8c34 (diff)
downloadVencord-e8d90d2b45e8be0595f75454429fc1a5cedb4e33.tar.gz
Vencord-e8d90d2b45e8be0595f75454429fc1a5cedb4e33.tar.bz2
Vencord-e8d90d2b45e8be0595f75454429fc1a5cedb4e33.zip
feat(plugin): BiggerStreamPreview (#1222)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/webpack/common')
-rw-r--r--src/webpack/common/classes.ts24
-rw-r--r--src/webpack/common/components.ts5
-rw-r--r--src/webpack/common/index.ts2
-rw-r--r--src/webpack/common/types/classes.d.ts40
-rw-r--r--src/webpack/common/types/components.d.ts7
-rw-r--r--src/webpack/common/types/menu.d.ts1
6 files changed, 75 insertions, 4 deletions
diff --git a/src/webpack/common/classes.ts b/src/webpack/common/classes.ts
new file mode 100644
index 0000000..5c1a676
--- /dev/null
+++ b/src/webpack/common/classes.ts
@@ -0,0 +1,24 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2023 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+import { findByPropsLazy } from "@webpack";
+
+import * as t from "./types/classes";
+
+export const ModalImageClasses: t.ImageModalClasses = findByPropsLazy("image", "modal");
+export const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent");
diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts
index f308cff..55d3b84 100644
--- a/src/webpack/common/components.ts
+++ b/src/webpack/common/components.ts
@@ -17,7 +17,7 @@
*/
// eslint-disable-next-line path-alias/no-relative
-import { filters, findByPropsLazy, waitFor } from "@webpack";
+import { filters, waitFor } from "@webpack";
import { waitForComponent } from "./internal";
import * as t from "./types/components";
@@ -51,11 +51,10 @@ export let Avatar: t.Avatar;
/** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */
export let useToken: t.useToken;
+export const MaskedLink = waitForComponent<t.MaskedLink>("MaskedLink", m => m?.type?.toString().includes("MASKED_LINK)"));
export const Timestamp = waitForComponent<t.Timestamp>("Timestamp", filters.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format"));
export const Flex = waitForComponent<t.Flex>("Flex", ["Justify", "Align", "Wrap"]);
-export const ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent") as Record<string, string>;
-
waitFor("FormItem", m => {
({ useToken, Card, Button, FormSwitch: Switch, Tooltip, TextInput, TextArea, Text, Select, SearchableSelect, Slider, ButtonLooks, TabBar, Popout, Dialog, Paginator, ScrollerThin, Clickable, Avatar } = m);
Forms = m;
diff --git a/src/webpack/common/index.ts b/src/webpack/common/index.ts
index dff7826..2ad9c54 100644
--- a/src/webpack/common/index.ts
+++ b/src/webpack/common/index.ts
@@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+export * from "./classes";
export * from "./components";
export * from "./menu";
export * from "./react";
@@ -24,4 +25,3 @@ export * as ComponentTypes from "./types/components.d";
export * as MenuTypes from "./types/menu.d";
export * as UtilTypes from "./types/utils.d";
export * from "./utils";
-
diff --git a/src/webpack/common/types/classes.d.ts b/src/webpack/common/types/classes.d.ts
new file mode 100644
index 0000000..0d2946f
--- /dev/null
+++ b/src/webpack/common/types/classes.d.ts
@@ -0,0 +1,40 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2023 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+export interface ImageModalClasses {
+ image: string,
+ modal: string,
+ responsiveWidthMobile: string;
+}
+
+export interface ButtonWrapperClasses {
+ hoverScale: string;
+ buttonWrapper: string;
+ button: string;
+ iconMask: string;
+ buttonContent: string;
+ icon: string;
+ pulseIcon: string;
+ pulseButton: string;
+ notificationDot: string;
+ sparkleContainer: string;
+ sparkleStar: string;
+ sparklePlus: string;
+ sparkle: string;
+ active: string;
+}
diff --git a/src/webpack/common/types/components.d.ts b/src/webpack/common/types/components.d.ts
index 7bc313c..d6d19fe 100644
--- a/src/webpack/common/types/components.d.ts
+++ b/src/webpack/common/types/components.d.ts
@@ -398,6 +398,13 @@ export type Paginator = ComponentType<{
hideMaxPage?: boolean;
}>;
+export type MaskedLink = ComponentType<{
+ onClick(): void;
+ trusted: boolean;
+ title: string,
+ href: string;
+}>;
+
export type ScrollerThin = ComponentType<PropsWithChildren<{
className?: string;
style?: CSSProperties;
diff --git a/src/webpack/common/types/menu.d.ts b/src/webpack/common/types/menu.d.ts
index 58ea626..1988617 100644
--- a/src/webpack/common/types/menu.d.ts
+++ b/src/webpack/common/types/menu.d.ts
@@ -44,6 +44,7 @@ export interface Menu {
onChildrenScroll?: Function;
childRowHeight?: number;
listClassName?: string;
+ disabled?: boolean;
}>;
MenuCheckboxItem: RC<{
id: string;