diff --git a/packages/core/src/widgets/markdown/plate/components/buttons/FontTypeSelect.tsx b/packages/core/src/widgets/markdown/plate/components/buttons/FontTypeSelect.tsx index 1d7b2b29..1b150086 100644 --- a/packages/core/src/widgets/markdown/plate/components/buttons/FontTypeSelect.tsx +++ b/packages/core/src/widgets/markdown/plate/components/buttons/FontTypeSelect.tsx @@ -1,5 +1,6 @@ import OptionUnstyled from '@mui/base/OptionUnstyled'; import SelectUnstyled from '@mui/base/SelectUnstyled'; +import { UnfoldMore as UnfoldMoreIcon } from '@styled-icons/material/UnfoldMore'; import { ELEMENT_H1, ELEMENT_H2, @@ -18,6 +19,7 @@ import useDebounce from '@staticcms/core/lib/hooks/useDebounce'; import classNames from '@staticcms/core/lib/util/classNames.util'; import { useMdPlateEditorState } from '@staticcms/markdown/plate/plateTypes'; +import type { SelectUnstyledRootSlotProps } from '@mui/base/SelectUnstyled'; import type { FC, FocusEvent, KeyboardEvent, MouseEvent } from 'react'; type Option = { @@ -56,6 +58,19 @@ const types: Option[] = [ }, ]; +const Button = React.forwardRef(function Button( + props: SelectUnstyledRootSlotProps, + ref: React.ForwardedRef, +) { + const { ownerState: _, children, ...other } = props; + return ( + + ); +}); + export interface FontTypeSelectProps { disabled?: boolean; } @@ -108,12 +123,16 @@ const FontTypeSelect: FC = ({ disabled = false }) => { value={value?.value ?? ELEMENT_PARAGRAPH} onChange={handleChange} disabled={disabled} + slots={{ + root: Button, + }} slotProps={{ root: { className: classNames( ` flex items-center + justify-between text-sm font-medium relative diff --git a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading1.tsx b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading1.tsx index 36e49d22..e63494aa 100644 --- a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading1.tsx +++ b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading1.tsx @@ -15,6 +15,7 @@ const Heading1: FC> = ({ {...nodeProps} className=" text-[2em] + leading-[1.5em] font-bold my-[0.67em] " diff --git a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading2.tsx b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading2.tsx index ac0bc2bd..d180aa81 100644 --- a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading2.tsx +++ b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading2.tsx @@ -15,6 +15,7 @@ const Heading2: FC> = ({ {...nodeProps} className=" text-[1.5em] + leading-[1.25em] font-bold my-[0.83em] " diff --git a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading3.tsx b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading3.tsx index 3d270f3c..6c4b58c2 100644 --- a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading3.tsx +++ b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading3.tsx @@ -15,6 +15,7 @@ const Heading3: FC> = ({ {...nodeProps} className=" text-[1.17em] + leading-[1.25em] font-bold my-[1em] " diff --git a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading4.tsx b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading4.tsx index 86bbdee3..b8dc4304 100644 --- a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading4.tsx +++ b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading4.tsx @@ -14,6 +14,7 @@ const Heading4: FC> = ({ {...attributes} {...nodeProps} className=" + leading-[1.25em] font-bold my-[1.33em] " diff --git a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading5.tsx b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading5.tsx index adca9d72..152b90f2 100644 --- a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading5.tsx +++ b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading5.tsx @@ -15,6 +15,7 @@ const Heading5: FC> = ({ {...nodeProps} className=" text-[0.83em] + leading-[1.25em] font-bold my-[1.67em] " diff --git a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading6.tsx b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading6.tsx index b759b00f..6200df61 100644 --- a/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading6.tsx +++ b/packages/core/src/widgets/markdown/plate/components/nodes/headings/Heading6.tsx @@ -15,6 +15,7 @@ const Heading6: FC> = ({ {...nodeProps} className=" text-[0.67em] + leading-[1.25em] font-bold my-[2.33em] " diff --git a/packages/core/src/widgets/markdown/plate/components/toolbar/Toolbar.tsx b/packages/core/src/widgets/markdown/plate/components/toolbar/Toolbar.tsx index 1b75ea4c..4c4ee2e1 100644 --- a/packages/core/src/widgets/markdown/plate/components/toolbar/Toolbar.tsx +++ b/packages/core/src/widgets/markdown/plate/components/toolbar/Toolbar.tsx @@ -39,7 +39,6 @@ const Toolbar: FC = ({ useMdx, collection, field, disabled }) => { className=" flex flex-wrap - relative items-center select-none min-h-markdown-toolbar @@ -53,6 +52,11 @@ const Toolbar: FC = ({ useMdx, collection, field, disabled }) => { border-gray-400 gap-0.5 shadow-md + bg-slate-50 + dark:bg-slate-900 + sticky + top-0 + z-10 " > {groups}