Commit 9d4f1361 by Рамис

new editor

parent 29c3e622
{
"name": "react-ag-qeditor",
"version": "0.0.15",
"version": "1.0.1",
"description": "WYSIWYG html editor",
"author": "atma",
"license": "MIT",
......
......@@ -228,11 +228,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
}
})
useEffect(()=>{
}, [])
const buildActionsModal = (buttons = []) => {
if (buttons.length === 0) {
return null;
......@@ -344,14 +339,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
return isDisabled;
}
// useEffect(()=>{
// if(uploaderUid){
//
// }
//
// setModalIsOpen(false);
// }, [uploaderUid])
if (!editor) {
return null
}
......@@ -366,15 +353,10 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
<BubbleMenu editor={editor} shouldShow={({...o}) => {
let items = [];
console.log(editor.isActive('table'), o.from, o.to, o);
if(o.from !== o.to && editor.isActive('paragraph')){
items = initialBubbleItems;
console.log('das');
}
if(editor.isActive('table')){
if(o.from === o.to || document.querySelectorAll('.selectedCell').length > 0){
if(items.length > 0){
......@@ -407,8 +389,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
}
}
if(editor.isActive('image') === true){
setBubbleItems(['alignLeft', 'alignCenter', 'alignRight']);
}
......@@ -416,8 +396,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
setBubbleItems(items);
return true;
}
}} tippyOptions={{ duration: 100 }}>
<div className="atma-editor-bubble">
{
......@@ -437,10 +415,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
})
}
</div>
{/* <button onClick={() => editor.commands.setTextAlign('left')}>left</button> */}
{/* <button onClick={() => editor.commands.setTextAlign('center')}>center</button> */}
{/* <button onClick={() => editor.commands.setTextAlign('right')}>right</button> */}
</BubbleMenu>
<EditorContent
editor={editor}
......@@ -458,10 +432,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
title: 'Отмена',
className: ' atma-editor-cancel',
onClick: () => {
// const quill = this.quillRef.getEditor();
// let range = quill.getSelection();
// let index = range ? range.index : 0;
setUploaderUid(`uid${new Date()}`);
setUploadedPaths([]);
setModalIsOpen(false)
......@@ -540,14 +510,9 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
setUploadedPaths([]);
setModalTitle('');
setModalIsOpen(false);
}catch (err){
console.log(err)
}
},
disabled: isDisabledAction()
}
......
import React, { Fragment, useState } from 'react'
import React, { Fragment, useState } from 'react';
const ToolBar = ({ editor, toolsLib = [] }) => {
if (!editor) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment