mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
refactor: remove KbdPlugin and MoreToolbarButton, and add Superscript and Subscript options to InsertToolbarButton for cleaner toolbar functionality
This commit is contained in:
parent
841e764729
commit
df3f724caf
6 changed files with 24 additions and 139 deletions
|
|
@ -19,6 +19,8 @@ import {
|
|||
QuoteIcon,
|
||||
RadicalIcon,
|
||||
SquareIcon,
|
||||
SubscriptIcon,
|
||||
SuperscriptIcon,
|
||||
TableIcon,
|
||||
} from 'lucide-react';
|
||||
import { KEYS } from 'platejs';
|
||||
|
|
@ -156,6 +158,28 @@ const groups: Group[] = [
|
|||
},
|
||||
})),
|
||||
},
|
||||
{
|
||||
group: 'Marks',
|
||||
items: [
|
||||
{
|
||||
icon: <SuperscriptIcon />,
|
||||
label: 'Superscript',
|
||||
value: KEYS.sup,
|
||||
},
|
||||
{
|
||||
icon: <SubscriptIcon />,
|
||||
label: 'Subscript',
|
||||
value: KEYS.sub,
|
||||
},
|
||||
].map((item) => ({
|
||||
...item,
|
||||
onSelect: (editor: PlateEditor, value: string) => {
|
||||
editor.tf.toggleMark(value, {
|
||||
remove: value === KEYS.sup ? KEYS.sub : KEYS.sup,
|
||||
});
|
||||
},
|
||||
})),
|
||||
},
|
||||
];
|
||||
|
||||
export function InsertToolbarButton(props: DropdownMenuProps) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue