Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lib
react-ag-qeditor
Commits
9d4f1361
Commit
9d4f1361
authored
Jun 09, 2022
by
Рамис
Browse files
new editor
parent
29c3e622
Changes
3
Show whitespace changes
Inline
Side-by-side
package.json
View file @
9d4f1361
{
{
"name"
:
"react-ag-qeditor"
,
"name"
:
"react-ag-qeditor"
,
"version"
:
"
0
.0.1
5
"
,
"version"
:
"
1
.0.1"
,
"description"
:
"WYSIWYG html editor"
,
"description"
:
"WYSIWYG html editor"
,
"author"
:
"atma"
,
"author"
:
"atma"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/QEditor.jsx
View file @
9d4f1361
...
@@ -228,11 +228,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -228,11 +228,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
}
}
})
})
useEffect
(()
=>
{
},
[])
const
buildActionsModal
=
(
buttons
=
[])
=>
{
const
buildActionsModal
=
(
buttons
=
[])
=>
{
if
(
buttons
.
length
===
0
)
{
if
(
buttons
.
length
===
0
)
{
return
null
;
return
null
;
...
@@ -344,14 +339,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -344,14 +339,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
return
isDisabled
;
return
isDisabled
;
}
}
// useEffect(()=>{
// if(uploaderUid){
//
// }
//
// setModalIsOpen(false);
// }, [uploaderUid])
if
(
!
editor
)
{
if
(
!
editor
)
{
return
null
return
null
}
}
...
@@ -366,15 +353,10 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -366,15 +353,10 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
<
BubbleMenu
editor
=
{
editor
}
shouldShow
=
{
({...
o
})
=>
{
<
BubbleMenu
editor
=
{
editor
}
shouldShow
=
{
({...
o
})
=>
{
let
items
=
[];
let
items
=
[];
console
.
log
(
editor
.
isActive
(
'
table
'
),
o
.
from
,
o
.
to
,
o
);
if
(
o
.
from
!==
o
.
to
&&
editor
.
isActive
(
'
paragraph
'
)){
if
(
o
.
from
!==
o
.
to
&&
editor
.
isActive
(
'
paragraph
'
)){
items
=
initialBubbleItems
;
items
=
initialBubbleItems
;
console
.
log
(
'
das
'
);
}
}
if
(
editor
.
isActive
(
'
table
'
)){
if
(
editor
.
isActive
(
'
table
'
)){
if
(
o
.
from
===
o
.
to
||
document
.
querySelectorAll
(
'
.selectedCell
'
).
length
>
0
){
if
(
o
.
from
===
o
.
to
||
document
.
querySelectorAll
(
'
.selectedCell
'
).
length
>
0
){
if
(
items
.
length
>
0
){
if
(
items
.
length
>
0
){
...
@@ -407,8 +389,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -407,8 +389,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
}
}
}
}
if
(
editor
.
isActive
(
'
image
'
)
===
true
){
if
(
editor
.
isActive
(
'
image
'
)
===
true
){
setBubbleItems
([
'
alignLeft
'
,
'
alignCenter
'
,
'
alignRight
'
]);
setBubbleItems
([
'
alignLeft
'
,
'
alignCenter
'
,
'
alignRight
'
]);
}
}
...
@@ -416,8 +396,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -416,8 +396,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
setBubbleItems
(
items
);
setBubbleItems
(
items
);
return
true
;
return
true
;
}
}
}
}
tippyOptions
=
{
{
duration
:
100
}
}
>
}
}
tippyOptions
=
{
{
duration
:
100
}
}
>
<
div
className
=
"atma-editor-bubble"
>
<
div
className
=
"atma-editor-bubble"
>
{
{
...
@@ -437,10 +415,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -437,10 +415,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
})
})
}
}
</
div
>
</
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
>
</
BubbleMenu
>
<
EditorContent
<
EditorContent
editor
=
{
editor
}
editor
=
{
editor
}
...
@@ -458,10 +432,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -458,10 +432,6 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
title
:
'
Отмена
'
,
title
:
'
Отмена
'
,
className
:
'
atma-editor-cancel
'
,
className
:
'
atma-editor-cancel
'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
// const quill = this.quillRef.getEditor();
// let range = quill.getSelection();
// let index = range ? range.index : 0;
setUploaderUid
(
`uid
${
new
Date
()}
`
);
setUploaderUid
(
`uid
${
new
Date
()}
`
);
setUploadedPaths
([]);
setUploadedPaths
([]);
setModalIsOpen
(
false
)
setModalIsOpen
(
false
)
...
@@ -540,14 +510,9 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
...
@@ -540,14 +510,9 @@ const QEditor = ({ value, onChange, style, uploadOptions }) => {
setUploadedPaths
([]);
setUploadedPaths
([]);
setModalTitle
(
''
);
setModalTitle
(
''
);
setModalIsOpen
(
false
);
setModalIsOpen
(
false
);
}
catch
(
err
){
}
catch
(
err
){
console
.
log
(
err
)
console
.
log
(
err
)
}
}
},
},
disabled
:
isDisabledAction
()
disabled
:
isDisabledAction
()
}
}
...
...
src/components/ToolBar.js
View file @
9d4f1361
import
React
,
{
Fragment
,
useState
}
from
'
react
'
import
React
,
{
Fragment
,
useState
}
from
'
react
'
;
const
ToolBar
=
({
editor
,
toolsLib
=
[]
})
=>
{
const
ToolBar
=
({
editor
,
toolsLib
=
[]
})
=>
{
if
(
!
editor
)
{
if
(
!
editor
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment