mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +08:00
fix: allow passing props to NodeViewWrapper and NodeViewContent
This commit is contained in:
parent
bd9e15d78f
commit
cfb3b80f63
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
|
||||
export interface NodeViewContentProps {
|
||||
className?: string,
|
||||
[key: string]: any,
|
||||
as?: React.ElementType,
|
||||
}
|
||||
|
||||
@ -10,9 +10,12 @@ export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
||||
|
||||
return (
|
||||
<Tag
|
||||
className={props.className}
|
||||
{...props}
|
||||
data-node-view-content=""
|
||||
style={{ whiteSpace: 'pre-wrap' }}
|
||||
style={{
|
||||
...props.style,
|
||||
whiteSpace: 'pre-wrap',
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import { useReactNodeView } from './useReactNodeView'
|
||||
|
||||
export interface NodeViewWrapperProps {
|
||||
className?: string,
|
||||
[key: string]: any,
|
||||
as?: React.ElementType,
|
||||
}
|
||||
|
||||
@ -12,12 +12,13 @@ export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = props => {
|
||||
|
||||
return (
|
||||
<Tag
|
||||
className={props.className}
|
||||
{...props}
|
||||
data-node-view-wrapper=""
|
||||
onDragStart={onDragStart}
|
||||
style={{ whiteSpace: 'normal' }}
|
||||
>
|
||||
{props.children}
|
||||
</Tag>
|
||||
style={{
|
||||
...props.style,
|
||||
whiteSpace: 'normal',
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user