fix(components): fix missing components on oct 2 2024 beta

This commit is contained in:
AAGaming
2024-10-03 16:46:50 -04:00
parent 8c6043b5a7
commit 0f9fb5a3b8
4 changed files with 13 additions and 10 deletions

View File

@@ -28,9 +28,12 @@ export const DialogCheckbox = Object.values(
}),
).find(
(m: any) =>
m.contextType &&
m.prototype?.render.toString().includes('fallback:') &&
m?.prototype?.SetChecked &&
m?.prototype?.Toggle &&
m?.prototype?.GetPanelElementProps,
m?.prototype?.GetPanelElementProps &&
// beta || stable as of oct 2 2024
(m?.prototype?.render?.toString().includes('="DialogCheckbox"') || (
m.contextType &&
m.prototype?.render.toString().includes('fallback:')
))
) as FC<DialogCheckboxProps>;

View File

@@ -1,7 +1,7 @@
import { FC, ReactNode } from 'react';
import { findSP } from '../utils';
import { Export, findModule, findModuleByExport, findModuleExport } from '../webpack';
import { Export, findModule, findModuleDetailsByExport, findModuleExport } from '../webpack';
// All of the popout options + strTitle are related. Proper usage is not yet known...
export interface ShowModalProps {
@@ -105,7 +105,7 @@ interface SimpleModalProps {
children: ReactNode;
}
const ModalModule = findModuleByExport((e: Export) => e?.toString().includes('.ModalPosition,fallback:'), 5);
const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e: Export) => e?.toString().includes('.ModalPosition'), 5)
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
@@ -114,6 +114,4 @@ export const SimpleModal = ModalModuleProps.find((prop) => {
return string?.includes('.ShowPortalModal()') && string?.includes('.OnElementReadyCallbacks.Register(');
}) as FC<SimpleModalProps>;
export const ModalPosition = ModalModuleProps.find((prop) =>
prop?.toString().includes('.ModalPosition,fallback:'),
) as FC<SimpleModalProps>;
export const ModalPosition = _ModalPosition as FC<SimpleModalProps>;

View File

@@ -29,5 +29,6 @@ export interface SliderFieldProps extends ItemProps {
}
export const SliderField = Object.values(CommonUIModule).find((mod: any) =>
mod?.toString()?.includes('SliderField,fallback'),
// stable || beta as of oct 2 2024
mod?.toString()?.includes('SliderField,fallback') || mod?.toString()?.includes("SliderField\",")
) as FC<SliderFieldProps>;

View File

@@ -11,5 +11,6 @@ export interface ToggleFieldProps extends ItemProps {
}
export const ToggleField = Object.values(CommonUIModule).find((mod: any) =>
mod?.render?.toString()?.includes('ToggleField,fallback'),
// stable || beta as of oct 2 2024
mod?.render?.toString()?.includes('ToggleField,fallback') || mod?.render?.toString()?.includes("ToggleField\",")
) as FC<ToggleFieldProps>;