@@ -5,9 +5,19 @@ import classNames from "classnames";
5
5
import Quill , { Range } from "quill" ;
6
6
import "quill/dist/quill.core.css" ;
7
7
import "quill/dist/quill.snow.css" ;
8
- import { createElement , CSSProperties , ReactElement , useCallback , useEffect , useMemo , useRef , useState } from "react" ;
8
+ import {
9
+ createElement ,
10
+ CSSProperties ,
11
+ ReactElement ,
12
+ useCallback ,
13
+ useContext ,
14
+ useEffect ,
15
+ useMemo ,
16
+ useRef ,
17
+ useState
18
+ } from "react" ;
9
19
import { RichTextContainerProps } from "typings/RichTextProps" ;
10
- import { EditorProvider , useFullscreen } from "../utils/editorContext " ;
20
+ import { EditorContext , EditorProvider } from "../store/EditorProvider " ;
11
21
import { updateLegacyQuillFormats } from "../utils/helpers" ;
12
22
import MendixTheme from "../utils/themes/mxTheme" ;
13
23
import { createPreset } from "./CustomToolbars/presets" ;
@@ -42,14 +52,16 @@ function EditorWrapperInner(props: EditorWrapperProps): ReactElement {
42
52
tabIndex
43
53
} = props ;
44
54
55
+ const globalState = useContext ( EditorContext ) ;
56
+
45
57
const isFirstLoad = useRef < boolean > ( false ) ;
46
58
const quillRef = useRef < Quill > ( null ) ;
47
59
const [ isFocus , setIsFocus ] = useState ( false ) ;
48
60
const editorValueRef = useRef < string > ( "" ) ;
49
61
const toolbarRef = useRef < HTMLDivElement > ( null ) ;
50
62
const [ wordCount , setWordCount ] = useState ( 0 ) ;
51
63
52
- const { isFullscreen } = useFullscreen ( ) ;
64
+ const { isFullscreen } = globalState ;
53
65
54
66
const [ setAttributeValueDebounce ] = useMemo (
55
67
( ) =>
0 commit comments