mirror of https://github.com/buster-so/buster.git
update the type
This commit is contained in:
parent
fd8bce7b53
commit
9b9e8e6e76
|
@ -54,7 +54,7 @@
|
|||
"@platejs/list": "^49.2.0",
|
||||
"@platejs/resizable": "^49.0.0",
|
||||
"@platejs/selection": "^49.1.12",
|
||||
"@posthog/nextjs-config": "^1.0.2",
|
||||
"@posthog/nextjs-config": "^1.1.0",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.2",
|
||||
"@radix-ui/react-collapsible": "^1.1.11",
|
||||
|
|
|
@ -136,15 +136,7 @@ LIMIT 5;`
|
|||
],
|
||||
type: 'ul'
|
||||
},
|
||||
{
|
||||
children: [
|
||||
{
|
||||
children: [{ text: 'Multiple heading levels' }],
|
||||
type: 'li'
|
||||
}
|
||||
],
|
||||
type: 'ul'
|
||||
},
|
||||
|
||||
{
|
||||
children: [
|
||||
{
|
||||
|
|
|
@ -4,19 +4,26 @@ import * as React from 'react';
|
|||
|
||||
import { useCalloutEmojiPicker } from '@platejs/callout/react';
|
||||
import { useEmojiDropdownMenuState } from '@platejs/emoji/react';
|
||||
import type { TElement } from 'platejs';
|
||||
import { PlateElement } from 'platejs/react';
|
||||
import type { PlateElementProps } from 'platejs/react';
|
||||
|
||||
import { Button } from '@/components/ui/buttons';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
import { EmojiPicker, EmojiPopover } from './EmojiToolbarButton';
|
||||
|
||||
// Define the custom element type with your specific properties
|
||||
interface TCalloutElement extends TElement {
|
||||
backgroundColor?: string;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
export function CalloutElement({
|
||||
attributes,
|
||||
children,
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof PlateElement>) {
|
||||
}: PlateElementProps<TCalloutElement>) {
|
||||
const { emojiPickerState, isOpen, setIsOpen } = useEmojiDropdownMenuState({
|
||||
closeOnSelect: true
|
||||
});
|
||||
|
@ -28,8 +35,9 @@ export function CalloutElement({
|
|||
|
||||
return (
|
||||
<PlateElement
|
||||
className={cn('bg-muted my-1 flex rounded-sm p-4 pl-3', className)}
|
||||
className={cn('bg-muted my-1 flex rounded-sm p-4 pl-3', attributes.className)}
|
||||
style={{
|
||||
...attributes.style,
|
||||
backgroundColor: props.element.backgroundColor
|
||||
}}
|
||||
attributes={{
|
||||
|
|
Loading…
Reference in New Issue