@@ -11,9 +11,15 @@ import {
1111 useLayoutEffect ,
1212 useRef
1313} from "react" ;
14- import QuillTableBetter from "../utils/formats/quill-table-better/quill-table-better" ;
15- import "../utils/formats/quill-table-better/assets/css/quill-table-better.scss" ;
14+ import { CustomFontsType } from "../../typings/RichTextProps" ;
15+ import { EditorDispatchContext } from "../store/EditorProvider" ;
16+ import { SET_FULLSCREEN_ACTION } from "../store/store" ;
1617import "../utils/customPluginRegisters" ;
18+ import { FontStyleAttributor , formatCustomFonts } from "../utils/formats/fonts" ;
19+ import "../utils/formats/quill-table-better/assets/css/quill-table-better.scss" ;
20+ import QuillTableBetter from "../utils/formats/quill-table-better/quill-table-better" ;
21+ import { RESIZE_MODULE_CONFIG } from "../utils/formats/resizeModuleConfig" ;
22+ import { ACTION_DISPATCHER } from "../utils/helpers" ;
1723import MxQuill from "../utils/MxQuill" ;
1824import {
1925 enterKeyKeyboardHandler ,
@@ -24,12 +30,9 @@ import {
2430} from "./CustomToolbars/toolbarHandlers" ;
2531import { useEmbedModal } from "./CustomToolbars/useEmbedModal" ;
2632import Dialog from "./ModalDialog/Dialog" ;
27- import { RESIZE_MODULE_CONFIG } from "../utils/formats/resizeModuleConfig" ;
28- import { ACTION_DISPATCHER } from "../utils/helpers" ;
29- import { EditorDispatchContext } from "../store/EditorProvider" ;
30- import { SET_FULLSCREEN_ACTION } from "../store/store" ;
3133
3234export interface EditorProps {
35+ customFonts : CustomFontsType [ ] ;
3336 defaultValue ?: string ;
3437 onTextChange ?: ( ...args : [ delta : Delta , oldContent : Delta , source : EmitterSource ] ) => void ;
3538 onSelectionChange ?: ( ...args : [ range : Range , oldRange : Range , source : EmitterSource ] ) => void ;
@@ -42,6 +45,9 @@ export interface EditorProps {
4245
4346// Editor is an uncontrolled React component
4447const Editor = forwardRef ( ( props : EditorProps , ref : MutableRefObject < Quill | null > ) => {
48+ const fonts = formatCustomFonts ( props . customFonts ) ;
49+ const FontStyle = new FontStyleAttributor ( fonts ) ;
50+ Quill . register ( FontStyle , true ) ;
4551 const { theme, defaultValue, style, className, toolbarId, onTextChange, onSelectionChange, readOnly } = props ;
4652 const containerRef = useRef < HTMLDivElement > ( null ) ;
4753 const modalRef = useRef < HTMLDivElement > ( null ) ;
0 commit comments