2023-01-25 02:25:29 +00:00
|
|
|
/*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// eslint-disable-next-line path-alias/no-relative
|
2024-05-03 02:18:12 +00:00
|
|
|
import { filters, findComponent, findExportedComponent, waitFor } from "@webpack";
|
2023-04-04 19:09:47 +00:00
|
|
|
|
2023-01-25 02:25:29 +00:00
|
|
|
import * as t from "./types/components";
|
|
|
|
|
2023-04-04 19:09:47 +00:00
|
|
|
export let Forms = {} as {
|
|
|
|
FormTitle: t.FormTitle,
|
|
|
|
FormSection: t.FormSection,
|
|
|
|
FormDivider: t.FormDivider,
|
|
|
|
FormText: t.FormText,
|
2023-01-25 02:25:29 +00:00
|
|
|
};
|
|
|
|
|
2023-04-04 19:09:47 +00:00
|
|
|
export let Card: t.Card;
|
|
|
|
export let Button: t.Button;
|
|
|
|
export let Switch: t.Switch;
|
|
|
|
export let Tooltip: t.Tooltip;
|
|
|
|
export let TextInput: t.TextInput;
|
|
|
|
export let TextArea: t.TextArea;
|
|
|
|
export let Text: t.Text;
|
2024-05-02 21:52:41 +00:00
|
|
|
export let Heading: t.Heading;
|
2023-04-04 19:09:47 +00:00
|
|
|
export let Select: t.Select;
|
|
|
|
export let SearchableSelect: t.SearchableSelect;
|
|
|
|
export let Slider: t.Slider;
|
|
|
|
export let ButtonLooks: t.ButtonLooks;
|
2023-05-02 00:55:38 +00:00
|
|
|
export let Popout: t.Popout;
|
|
|
|
export let Dialog: t.Dialog;
|
2023-04-04 19:09:47 +00:00
|
|
|
export let TabBar: any;
|
2023-05-28 20:03:06 +00:00
|
|
|
export let Paginator: t.Paginator;
|
2023-06-15 01:39:15 +00:00
|
|
|
export let ScrollerThin: t.ScrollerThin;
|
|
|
|
export let Clickable: t.Clickable;
|
|
|
|
export let Avatar: t.Avatar;
|
2024-03-16 01:19:26 +00:00
|
|
|
export let FocusLock: t.FocusLock;
|
2023-05-10 21:13:47 +00:00
|
|
|
// token lagger real
|
|
|
|
/** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */
|
|
|
|
export let useToken: t.useToken;
|
2023-04-04 19:09:47 +00:00
|
|
|
|
2024-05-03 02:18:12 +00:00
|
|
|
export const MaskedLink = findComponent<t.MaskedLinkProps>(filters.componentByCode("MASKED_LINK)"));
|
|
|
|
export const Timestamp = findComponent<t.TimestampProps>(filters.componentByCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format"));
|
|
|
|
export const Flex = findComponent<t.FlexProps>(filters.byProps("Justify", "Align", "Wrap"));
|
2023-01-25 02:25:29 +00:00
|
|
|
|
2024-05-03 02:18:12 +00:00
|
|
|
export const OAuth2AuthorizeModal = findExportedComponent("OAuth2AuthorizeModal");
|
2023-11-30 05:10:50 +00:00
|
|
|
|
2024-05-03 02:18:12 +00:00
|
|
|
waitFor(filters.byProps("FormItem", "Button"), m => {
|
|
|
|
Forms = m;
|
2024-05-02 13:38:53 +00:00
|
|
|
({
|
|
|
|
useToken,
|
|
|
|
Card,
|
|
|
|
Button,
|
|
|
|
FormSwitch: Switch,
|
|
|
|
Tooltip,
|
|
|
|
TextInput,
|
|
|
|
TextArea,
|
|
|
|
Text,
|
|
|
|
Select,
|
|
|
|
SearchableSelect,
|
|
|
|
Slider,
|
|
|
|
ButtonLooks,
|
|
|
|
TabBar,
|
|
|
|
Popout,
|
|
|
|
Dialog,
|
|
|
|
Paginator,
|
|
|
|
ScrollerThin,
|
|
|
|
Clickable,
|
|
|
|
Avatar,
|
|
|
|
FocusLock,
|
|
|
|
Heading
|
|
|
|
} = m);
|
2023-04-04 19:09:47 +00:00
|
|
|
});
|