2022-10-22 01:17:06 +02:00
|
|
|
/*
|
|
|
|
|
* Vencord, a modification for Discord's desktop app
|
|
|
|
|
* Copyright (c) 2022 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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-05-18 10:12:16 -04:00
|
|
|
import { filters, findComponentByCodeLazy, mapMangledModuleLazy } from "@webpack";
|
2026-05-10 13:58:48 +02:00
|
|
|
import { closeAllModals, closeModal, openMediaModal, openModal, openModalLazy } from "@webpack/common";
|
2023-01-25 03:25:29 +01:00
|
|
|
|
2023-05-06 01:36:00 +02:00
|
|
|
import { LazyComponent } from "./react";
|
2022-10-01 03:58:07 +02:00
|
|
|
|
2026-05-10 13:58:48 +02:00
|
|
|
/** @deprecated Migrate to new Modals */
|
2023-06-13 02:36:25 +02:00
|
|
|
export const enum ModalSize {
|
2022-10-14 22:38:49 +02:00
|
|
|
SMALL = "small",
|
|
|
|
|
MEDIUM = "medium",
|
|
|
|
|
LARGE = "large",
|
|
|
|
|
DYNAMIC = "dynamic",
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-10 13:58:48 +02:00
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const Modals = mapMangledModuleLazy(".MODAL_ROOT_LEGACY,", {
|
2025-01-29 01:04:36 -03:00
|
|
|
ModalRoot: filters.componentByCode('.MODAL,"aria-labelledby":'),
|
|
|
|
|
ModalHeader: filters.componentByCode(",id:"),
|
2026-01-23 17:51:30 +01:00
|
|
|
ModalContent: filters.componentByCode("scrollbarType:"),
|
|
|
|
|
ModalFooter: filters.componentByCode(".HORIZONTAL_REVERSE,"),
|
|
|
|
|
ModalCloseButton: filters.componentByCode(".withCircleBackground")
|
2026-05-10 13:58:48 +02:00
|
|
|
}) as never;
|
|
|
|
|
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const ModalRoot = LazyComponent(() => (Modals as any).ModalRoot) as never;
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const ModalHeader = LazyComponent(() => (Modals as any).ModalHeader) as never;
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const ModalContent = LazyComponent(() => (Modals as any).ModalContent) as never;
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const ModalFooter = LazyComponent(() => (Modals as any).ModalFooter) as never;
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const ModalCloseButton = LazyComponent(() => (Modals as any).ModalCloseButton) as never;
|
2026-01-30 14:10:22 +01:00
|
|
|
export const CloseButton = findComponentByCodeLazy("CLOSE_BUTTON_LABEL");
|
2022-10-17 20:18:25 +01:00
|
|
|
|
2026-05-10 13:58:48 +02:00
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
export const ModalAPI = {
|
|
|
|
|
openModal,
|
|
|
|
|
openModalLazy,
|
|
|
|
|
closeModal,
|
|
|
|
|
closeAllModals
|
|
|
|
|
} as never;
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
closeAllModals,
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
closeModal,
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
openMediaModal,
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
openModal,
|
|
|
|
|
/** @deprecated Migrate to new Modals */
|
|
|
|
|
openModalLazy
|
2024-10-24 08:10:29 -03:00
|
|
|
};
|