From cacf9717b373757cac67f5066fbfb1e9dd89969f Mon Sep 17 00:00:00 2001 From: NotNite Date: Mon, 14 Oct 2024 20:10:09 -0400 Subject: [PATCH] Sync context menu types with contextMenu ext --- package.json | 2 +- .../discord/components/common/index.ts | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 3b77a88..ed63f88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moonlight-mod/mappings", - "version": "1.0.4", + "version": "1.0.5", "license": "MIT", "repository": { "type": "git", diff --git a/src/mappings/discord/components/common/index.ts b/src/mappings/discord/components/common/index.ts index 0645e19..dc237b2 100644 --- a/src/mappings/discord/components/common/index.ts +++ b/src/mappings/discord/components/common/index.ts @@ -639,19 +639,18 @@ export type Text = ComponentType< // #endregion // #region Menu -// TODO: find others -export type MenuVariant = "flexible"; - export type MenuSeparator = ComponentType>; export type MenuGroup = ComponentType< PropsWithChildren<{ label?: ReactNode; + className?: string; + color?: string; }> >; export type MenuItemProps = { className?: string; - id: string; + id: any; navigatable?: boolean; render?: (props: MenuItemProps) => ReactNode; label: ReactNode; @@ -691,7 +690,7 @@ export type MenuItem = ComponentType>; export type MenuCheckboxItem = ComponentType< PropsWithoutRef<{ className?: string; - id: string; + id: any; color?: string; label: string; checked: boolean; @@ -706,9 +705,9 @@ export type MenuCheckboxItem = ComponentType< export type MenuRadioItem = ComponentType< PropsWithoutRef<{ - id: string; - color?: string; + id: any; label: string; + color?: string; checked: boolean; subtext?: string; disabled?: string; @@ -737,12 +736,20 @@ export type Menu = ComponentType< PropsWithChildren<{ className?: string; navId: string; - variant?: MenuVariant; + variant?: string; hideScroller?: boolean; onClose?: () => void; onSelect?: () => void; }> >; + +export type MenuElement = + | MenuSeparator + | MenuGroup + | MenuItem + | MenuCheckboxItem + | MenuRadioItem + | MenuControlItem; // #endregion export type TitleTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; @@ -947,6 +954,7 @@ type CommonComponents = { MenuRadioItem: MenuRadioItem; MenuCheckboxItem: MenuCheckboxItem; MenuControlItem: MenuControlItem; + MenuSeparator: MenuSeparator; SettingsNotice: React.ComponentType<{ submitting: boolean; onReset: () => void;