Commit 3a2fa14f authored by Яков's avatar Яков
Browse files

update fix issue

parent 84b72d96
{
"name": "react-ag-qeditor",
"version": "1.1.72",
"version": "1.1.73",
"description": "WYSIWYG html editor",
"author": "atma",
"license": "MIT",
......
......@@ -1050,15 +1050,21 @@ const QEditor = ({
onClick={(e) => {
e.stopPropagation()
const el = audioRefs.current[uid]
if (!el) return
if (!el || !el.src) return
if (isPlaying) {
el.pause()
} else {
Object.entries(audioRefs.current).forEach(([key, ref]) => {
if (key !== uid && ref) ref.pause()
if (key !== uid && ref && !ref.paused) ref.pause()
})
el.play()
setPlayingAudio(uid)
const p = el.play()
if (p !== undefined) {
p.catch(err => {
if (err.name !== 'AbortError') console.warn(err)
setPlayingAudio(null)
})
}
}
}}
/>
......
......@@ -83,9 +83,8 @@ const ResizableVideoView = ({ editor, node, updateAttributes, getPos, selected }
useEffect(() => {
if (!node.attrs['data-node-id']) {
safeUpdateAttributes({
'data-node-id': `video-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
})
const id = `video-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
setTimeout(() => safeUpdateAttributes({ 'data-node-id': id }), 0)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [node.attrs['data-node-id']])
......@@ -98,17 +97,19 @@ const ResizableVideoView = ({ editor, node, updateAttributes, getPos, selected }
return
}
isInitialized.current = true
const { width: editorWidth } = getEditorDimensions()
const initialWidth = Math.min(editorWidth, 720)
const initialHeight = Math.round((initialWidth * 9) / 16)
setTimeout(() => {
safeUpdateAttributes({
width: initialWidth,
height: initialHeight,
align: node.attrs.align || 'left',
})
isInitialized.current = true
}, 0)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [node.attrs.width, node.attrs.height])
......
......@@ -967,6 +967,14 @@ body{
}
}
&.is-audio.selected{
box-shadow: none;
&::after{
display: none;
}
}
&.is-audio{
aspect-ratio: auto;
width: 100%;
......
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