feat: enhance ToolbarButtons with improved heading selection and styling

This commit is contained in:
swve 2025-04-06 14:58:09 +02:00
parent 298414d57f
commit 3bc6703f33
2 changed files with 52 additions and 16 deletions

View file

@ -1,4 +1,5 @@
import { NodeViewWrapper } from '@tiptap/react'
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react'
import { Node } from '@tiptap/core'
import {
Loader2, Video, Upload, X, HelpCircle,
Maximize2, Minimize2, ArrowLeftRight,
@ -133,23 +134,30 @@ interface VideoBlockObject {
size: VideoSize
}
interface VideoBlockProps {
node: {
attrs: {
blockObject: VideoBlockObject | LegacyVideoBlockObject | null
interface VideoBlockAttrs {
blockObject: VideoBlockObject | LegacyVideoBlockObject | null
}
interface VideoBlockExtension {
options: {
activity: {
activity_uuid: string
}
}
extension: {
}
interface ExtendedNodeViewProps extends Omit<NodeViewProps, 'extension'> {
extension: Node & {
options: {
activity: {
activity_uuid: string
}
}
}
updateAttributes: (attrs: { blockObject: VideoBlockObject | null }) => void
}
function VideoBlockComponent({ node, extension, updateAttributes }: VideoBlockProps) {
function VideoBlockComponent(props: ExtendedNodeViewProps) {
const { node, extension, updateAttributes } = props
const org = useOrg() as Organization | null
const course = useCourse() as Course | null
const editorState = useEditorProvider() as EditorState