public async Task InsertImage()
        {
            if (_filemanagervisible)
            {
                var fileid = _fileManager.GetFileId();
                if (fileid != -1)
                {
                    var interop = new RichTextEditorInterop(JSRuntime);
                    await interop.InsertImage(_editorElement, ContentUrl(fileid));

                    _filemanagervisible = false;
                    _message            = string.Empty;
                }
                else
                {
                    _message = "<br /><div class=\"alert alert-warning\" role=\"alert\">You Must Select An Image To Insert</div>";
                }
            }
            else
            {
                _filemanagervisible = true;
                _message            = string.Empty;
            }
            StateHasChanged();
        }
        public async Task RefreshRawHtml()
        {
            var interop = new RichTextEditorInterop(JSRuntime);

            _content = await interop.GetHtml(_editorElement);

            StateHasChanged();
        }
        public async Task <string> GetHtml()
        {
            // get rich text content
            var    interop = new RichTextEditorInterop(JSRuntime);
            string content = await interop.GetHtml(_editorElement);

            if (_original != content)
            {
                // rich text content has changed - return it
                return(content);
            }
            else
            {
                // return raw html content
                return(_content);
            }
        }
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (firstRender)
            {
                await base.OnAfterRenderAsync(firstRender);

                var interop = new RichTextEditorInterop(JSRuntime);

                await interop.CreateEditor(
                    _editorElement,
                    _toolBar,
                    ReadOnly,
                    Placeholder,
                    Theme,
                    DebugLevel);

                await interop.LoadEditorContent(_editorElement, Content);

                // preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
                _original = await interop.GetHtml(_editorElement);
            }
        }
 public async Task EnableEditor(bool mode)
 {
     var interop = new RichTextEditorInterop(JSRuntime);
     await interop.EnableEditor(_editorElement, mode);
 }
        public async Task <string> GetContent()
        {
            var interop = new RichTextEditorInterop(JSRuntime);

            return(await interop.GetContent(_editorElement));
        }
 public async Task RefreshRichText()
 {
     var interop = new RichTextEditorInterop(JSRuntime);
     await interop.LoadEditorContent(_editorElement, _content);
 }