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
e1b05324
Commit
e1b05324
authored
Feb 02, 2026
by
Яков
Browse files
update iframe and video
parent
fe36d666
Changes
2
Show whitespace changes
Inline
Side-by-side
package.json
View file @
e1b05324
{
{
"name"
:
"react-ag-qeditor"
,
"name"
:
"react-ag-qeditor"
,
"version"
:
"1.1.2
3
"
,
"version"
:
"1.1.2
4
"
,
"description"
:
"WYSIWYG html editor"
,
"description"
:
"WYSIWYG html editor"
,
"author"
:
"atma"
,
"author"
:
"atma"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/extensions/Iframe.js
View file @
e1b05324
...
@@ -36,7 +36,11 @@ const ResizableIframeView = ({ editor, node, updateAttributes, getPos, selected
...
@@ -36,7 +36,11 @@ const ResizableIframeView = ({ editor, node, updateAttributes, getPos, selected
const
paddingRight
=
parseFloat
(
editorStyles
.
paddingRight
)
||
0
const
paddingRight
=
parseFloat
(
editorStyles
.
paddingRight
)
||
0
const
availableEditorWidth
=
fullEditorWidth
-
paddingLeft
-
paddingRight
const
availableEditorWidth
=
fullEditorWidth
-
paddingLeft
-
paddingRight
const
container
=
wrapperRef
.
current
?.
closest
(
'
li, blockquote, td, p, div
'
)
||
editorContent
// важно: стартуем от parentElement, чтобы не схватить wrapperRef.current
const
startEl
=
wrapperRef
.
current
?.
parentElement
||
editorContent
const
container
=
startEl
.
closest
(
'
li, blockquote, td, p, div
'
)
||
editorContent
const
containerStyles
=
window
.
getComputedStyle
(
container
)
const
containerStyles
=
window
.
getComputedStyle
(
container
)
const
containerPaddingLeft
=
parseFloat
(
containerStyles
.
paddingLeft
)
||
0
const
containerPaddingLeft
=
parseFloat
(
containerStyles
.
paddingLeft
)
||
0
const
containerPaddingRight
=
parseFloat
(
containerStyles
.
paddingRight
)
||
0
const
containerPaddingRight
=
parseFloat
(
containerStyles
.
paddingRight
)
||
0
...
@@ -45,6 +49,7 @@ const ResizableIframeView = ({ editor, node, updateAttributes, getPos, selected
...
@@ -45,6 +49,7 @@ const ResizableIframeView = ({ editor, node, updateAttributes, getPos, selected
return
{
width
:
containerWidth
,
availableSpace
:
availableEditorWidth
}
return
{
width
:
containerWidth
,
availableSpace
:
availableEditorWidth
}
}
}
const
safeUpdateAttributes
=
(
newAttrs
)
=>
{
const
safeUpdateAttributes
=
(
newAttrs
)
=>
{
const
{
width
:
containerWidth
,
availableSpace
}
=
getEditorDimensions
()
const
{
width
:
containerWidth
,
availableSpace
}
=
getEditorDimensions
()
...
@@ -170,13 +175,25 @@ const ResizableIframeView = ({ editor, node, updateAttributes, getPos, selected
...
@@ -170,13 +175,25 @@ const ResizableIframeView = ({ editor, node, updateAttributes, getPos, selected
}
}
}
}
const
align
=
node
.
attrs
.
align
||
'
left
'
const
wrapperStyle
=
{
const
wrapperStyle
=
{
position
:
'
relative
'
,
position
:
'
relative
'
,
display
:
node
.
attrs
.
align
===
'
center
'
?
'
block
'
:
'
inline-block
'
,
width
:
node
.
attrs
.
width
?
`
${
node
.
attrs
.
width
}
px`
:
undefined
,
width
:
node
.
attrs
.
width
?
`
${
node
.
attrs
.
width
}
px`
:
undefined
,
height
:
node
.
attrs
.
height
?
`
${
node
.
attrs
.
height
}
px`
:
undefined
,
height
:
node
.
attrs
.
height
?
`
${
node
.
attrs
.
height
}
px`
:
undefined
,
// align styles inside editor
display
:
align
===
'
center
'
?
'
block
'
:
'
inline-block
'
,
marginLeft
:
align
===
'
center
'
?
'
auto
'
:
undefined
,
marginRight
:
align
===
'
center
'
?
'
auto
'
:
undefined
,
float
:
align
===
'
left
'
?
'
left
'
:
align
===
'
right
'
?
'
right
'
:
'
none
'
,
// чтобы текст красиво обтекал
marginInlineEnd
:
align
===
'
left
'
?
'
1rem
'
:
undefined
,
marginInlineStart
:
align
===
'
right
'
?
'
1rem
'
:
undefined
,
}
}
return
(
return
(
<
NodeViewWrapper
<
NodeViewWrapper
ref
=
{
wrapperRef
}
ref
=
{
wrapperRef
}
...
...
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