@tiptap/react 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/Context.tsx CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Editor } from '@tiptap/core'
2
- import React, { createContext, ReactNode, useContext } from 'react'
2
+ import React, {
3
+ createContext, HTMLAttributes, ReactNode, useContext,
4
+ } from 'react'
3
5
 
4
6
  import { EditorContent } from './EditorContent.js'
5
7
  import { useEditor, UseEditorOptions } from './useEditor.js'
@@ -23,6 +25,7 @@ export type EditorProviderProps = {
23
25
  children?: ReactNode;
24
26
  slotBefore?: ReactNode;
25
27
  slotAfter?: ReactNode;
28
+ editorContainerProps?: HTMLAttributes<HTMLDivElement>;
26
29
  } & UseEditorOptions
27
30
 
28
31
  /**
@@ -31,7 +34,7 @@ export type EditorProviderProps = {
31
34
  * with `useCurrentEditor`.
32
35
  */
33
36
  export function EditorProvider({
34
- children, slotAfter, slotBefore, ...editorOptions
37
+ children, slotAfter, slotBefore, editorContainerProps = {}, ...editorOptions
35
38
  }: EditorProviderProps) {
36
39
  const editor = useEditor(editorOptions)
37
40
 
@@ -44,7 +47,7 @@ export function EditorProvider({
44
47
  {slotBefore}
45
48
  <EditorConsumer>
46
49
  {({ editor: currentEditor }) => (
47
- <EditorContent editor={currentEditor} />
50
+ <EditorContent editor={currentEditor} {...editorContainerProps} />
48
51
  )}
49
52
  </EditorConsumer>
50
53
  {children}