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

update fix issue

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