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
b4462e85
Commit
b4462e85
authored
May 22, 2026
by
Яков
Browse files
update fix issue
parent
c8109471
Changes
3
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
b4462e85
{
{
"name"
:
"react-ag-qeditor"
,
"name"
:
"react-ag-qeditor"
,
"version"
:
"1.1.6
2
"
,
"version"
:
"1.1.6
3
"
,
"description"
:
"WYSIWYG html editor"
,
"description"
:
"WYSIWYG html editor"
,
"author"
:
"atma"
,
"author"
:
"atma"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/QEditor.jsx
View file @
b4462e85
...
@@ -829,6 +829,18 @@ const QEditor = ({
...
@@ -829,6 +829,18 @@ const QEditor = ({
})
})
],
],
content
:
value
,
content
:
value
,
onTransaction
:
({
transaction
})
=>
{
if
(
!
transaction
.
docChanged
)
return
// Ищем шаги, которые затрагивают image-ноды
transaction
.
steps
.
forEach
((
step
,
i
)
=>
{
const
json
=
step
.
toJSON
?.()
if
(
!
json
)
return
const
str
=
JSON
.
stringify
(
json
)
if
(
str
.
includes
(
'
"image"
'
)
||
str
.
includes
(
'
image
'
))
{
console
.
log
(
`[TxDebug] шаг #
${
i
}
type=
${
json
.
stepType
||
json
.
type
}
`
,
json
)
}
})
},
onUpdate
:
({
editor
})
=>
onChange
(
editor
.
getHTML
()),
onUpdate
:
({
editor
})
=>
onChange
(
editor
.
getHTML
()),
onFocus
:
({
editor
})
=>
{
onFocus
:
({
editor
})
=>
{
const
wrap
=
editor
.
options
.
element
.
closest
(
'
.atma-editor-wrap
'
)
const
wrap
=
editor
.
options
.
element
.
closest
(
'
.atma-editor-wrap
'
)
...
...
src/extensions/Image.jsx
View file @
b4462e85
...
@@ -15,7 +15,28 @@ const ResizableImageTemplate = ({ node, updateAttributes, editor, getPos, select
...
@@ -15,7 +15,28 @@ const ResizableImageTemplate = ({ node, updateAttributes, editor, getPos, select
const
imgRef
=
useRef
(
null
);
const
imgRef
=
useRef
(
null
);
const
wrapperRef
=
useRef
(
null
);
const
wrapperRef
=
useRef
(
null
);
const
isInitialized
=
useRef
(
false
);
const
isInitialized
=
useRef
(
false
);
const
prevPosRef
=
useRef
(
null
);
const
prevWrapRef
=
useRef
(
node
.
attrs
.
wrap
);
const
[
isResizing
,
setIsResizing
]
=
useState
(
false
);
const
[
isResizing
,
setIsResizing
]
=
useState
(
false
);
// ── DEBUG: отслеживаем смещение ноды и изменения wrap ──────────────────
useEffect
(()
=>
{
const
pos
=
getPos
?.()
const
src
=
node
.
attrs
.
src
?.
split
(
'
/
'
).
pop
()
if
(
prevPosRef
.
current
!==
null
&&
prevPosRef
.
current
!==
pos
)
{
console
.
warn
(
`[ImageDebug] ПОЗИЦИЯ ИЗМЕНИЛАСЬ src=
${
src
}
было=
${
prevPosRef
.
current
}
стало=
${
pos
}
`
,
new
Error
().
stack
.
split
(
'
\n
'
).
slice
(
1
,
4
).
join
(
'
|
'
)
)
}
if
(
prevWrapRef
.
current
!==
node
.
attrs
.
wrap
)
{
console
.
log
(
`[ImageDebug] wrap изменился src=
${
src
}
wrap=
${
node
.
attrs
.
wrap
}
pos=
${
pos
}
`
)
}
prevPosRef
.
current
=
pos
prevWrapRef
.
current
=
node
.
attrs
.
wrap
})
const
[
altModalVisible
,
setAltModalVisible
]
=
useState
(
false
);
const
[
altModalVisible
,
setAltModalVisible
]
=
useState
(
false
);
const
[
tempAlt
,
setTempAlt
]
=
useState
(
node
.
attrs
.
alt
||
''
);
const
[
tempAlt
,
setTempAlt
]
=
useState
(
node
.
attrs
.
alt
||
''
);
const
[
tempFrontAlt
,
setTempFrontAlt
]
=
useState
(
node
.
attrs
.
frontAlt
||
''
);
const
[
tempFrontAlt
,
setTempFrontAlt
]
=
useState
(
node
.
attrs
.
frontAlt
||
''
);
...
...
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