fix: allow passing props to NodeViewWrapper and NodeViewContent
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export interface NodeViewContentProps {
|
export interface NodeViewContentProps {
|
||||||
className?: string,
|
[key: string]: any,
|
||||||
as?: React.ElementType,
|
as?: React.ElementType,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10,9 +10,12 @@ export const NodeViewContent: React.FC<NodeViewContentProps> = props => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tag
|
<Tag
|
||||||
className={props.className}
|
{...props}
|
||||||
data-node-view-content=""
|
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'
|
import { useReactNodeView } from './useReactNodeView'
|
||||||
|
|
||||||
export interface NodeViewWrapperProps {
|
export interface NodeViewWrapperProps {
|
||||||
className?: string,
|
[key: string]: any,
|
||||||
as?: React.ElementType,
|
as?: React.ElementType,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,12 +12,13 @@ export const NodeViewWrapper: React.FC<NodeViewWrapperProps> = props => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tag
|
<Tag
|
||||||
className={props.className}
|
{...props}
|
||||||
data-node-view-wrapper=""
|
data-node-view-wrapper=""
|
||||||
onDragStart={onDragStart}
|
onDragStart={onDragStart}
|
||||||
style={{ whiteSpace: 'normal' }}
|
style={{
|
||||||
>
|
...props.style,
|
||||||
{props.children}
|
whiteSpace: 'normal',
|
||||||
</Tag>
|
}}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user