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
099e92bd
Commit
099e92bd
authored
Jul 08, 2025
by
Яков
Browse files
update
parent
fa148369
Changes
2
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
099e92bd
{
{
"name"
:
"react-ag-qeditor"
,
"name"
:
"react-ag-qeditor"
,
"version"
:
"1.1.
5
"
,
"version"
:
"1.1.
6
"
,
"description"
:
"WYSIWYG html editor"
,
"description"
:
"WYSIWYG html editor"
,
"author"
:
"atma"
,
"author"
:
"atma"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/QEditor.jsx
View file @
099e92bd
...
@@ -1084,9 +1084,31 @@ const QEditor = ({
...
@@ -1084,9 +1084,31 @@ const QEditor = ({
try
{
try
{
switch
(
innerModalType
)
{
switch
(
innerModalType
)
{
case
'
image
'
:
case
'
image
'
:
uploadedPaths
.
map
((
file
,
i
)
=>
{
uploadedPaths
.
map
(
async
(
file
)
=>
{
editor
.
chain
().
focus
().
setImage
({
src
:
file
.
path
}).
run
();
const
img
=
new
Image
()
img
.
src
=
file
.
path
img
.
onload
=
()
=>
{
const
maxWidth
=
editor
.
view
.
dom
.
clientWidth
-
32
// учёт padding
const
realWidth
=
Math
.
min
(
img
.
naturalWidth
,
maxWidth
)
const
realHeight
=
img
.
naturalHeight
*
(
realWidth
/
img
.
naturalWidth
)
editor
.
chain
()
.
focus
()
.
setImage
({
src
:
file
.
path
,
width
:
Math
.
round
(
realWidth
),
height
:
Math
.
round
(
realHeight
),
align
:
'
center
'
,
'
data-node-id
'
:
`img-
${
Date
.
now
()}
-
${
Math
.
random
().
toString
(
36
).
slice
(
2
,
10
)}
`
})
.
run
()
}
})
})
// uploadedPaths.map((file, i) => {
// editor.chain().focus().setImage({src: file.path}).run();
// })
break
break
case
'
video
'
:
case
'
video
'
:
uploadedPaths
.
map
((
file
,
i
)
=>
{
uploadedPaths
.
map
((
file
,
i
)
=>
{
...
...
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