diff --git a/src/components/FormField/components/Wysiwyg/index.js b/src/components/FormField/components/Wysiwyg/index.js index dcb793e..8c33a69 100644 --- a/src/components/FormField/components/Wysiwyg/index.js +++ b/src/components/FormField/components/Wysiwyg/index.js @@ -1,11 +1,19 @@ -import React from 'react'; +import React, { useRef } from 'react'; import { classNames } from 'primereact/utils'; import { Controller } from 'react-hook-form'; +import Quill from 'quill'; +import { __ } from '@wordpress/i18n'; + +// components import { Editor } from 'primereact/editor'; import BlockingOverlay from '../../../BlockingOverlay'; +import { Button } from 'primereact/button'; + +const Delta = Quill.import('delta'); const Wysiwyg = ({ fieldName, + setDataFn, label, control, rows = 3, @@ -16,6 +24,11 @@ const Wysiwyg = ({ placeholder = '', disabled = false }) => { + const editorRef = useRef(null); + + const handleCleanValue = () => { + setDataFn(fieldName, '', { shouldValidate: true }); + }; const renderHeader = () => { return ( @@ -42,6 +55,13 @@ const Wysiwyg = ({ +