diff --git a/src/components/DialogCheckbox.ts b/src/components/DialogCheckbox.ts index d1bc2a5..e5a9033 100644 --- a/src/components/DialogCheckbox.ts +++ b/src/components/DialogCheckbox.ts @@ -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; diff --git a/src/components/Modal.ts b/src/components/Modal.ts index b242c7d..e0df9e0 100755 --- a/src/components/Modal.ts +++ b/src/components/Modal.ts @@ -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; -export const ModalPosition = ModalModuleProps.find((prop) => - prop?.toString().includes('.ModalPosition,fallback:'), -) as FC; +export const ModalPosition = _ModalPosition as FC; diff --git a/src/components/SliderField.ts b/src/components/SliderField.ts index 85556eb..a494ff7 100644 --- a/src/components/SliderField.ts +++ b/src/components/SliderField.ts @@ -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; diff --git a/src/components/ToggleField.ts b/src/components/ToggleField.ts index 14984c5..ffb06ba 100644 --- a/src/components/ToggleField.ts +++ b/src/components/ToggleField.ts @@ -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;