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

update fix issue

parent a6d105fb
{ {
"name": "react-ag-qeditor", "name": "react-ag-qeditor",
"version": "1.1.69", "version": "1.1.70",
"description": "WYSIWYG html editor", "description": "WYSIWYG html editor",
"author": "atma", "author": "atma",
"license": "MIT", "license": "MIT",
......
...@@ -1672,7 +1672,8 @@ const QEditor = ({ ...@@ -1672,7 +1672,8 @@ const QEditor = ({
img.src = file.path img.src = file.path
img.onload = () => { img.onload = () => {
const maxWidth = editor.view.dom.clientWidth - 32 // учёт padding const domWidth = editor.view.dom.clientWidth
const maxWidth = domWidth > 0 ? domWidth - 32 : img.naturalWidth
const realWidth = Math.min(img.naturalWidth, maxWidth) const realWidth = Math.min(img.naturalWidth, maxWidth)
const realHeight = img.naturalHeight * (realWidth / img.naturalWidth) const realHeight = img.naturalHeight * (realWidth / img.naturalWidth)
......
...@@ -717,8 +717,7 @@ export const InteractiveImage = Node.create({ ...@@ -717,8 +717,7 @@ export const InteractiveImage = Node.create({
: style.push('display: block', 'margin-left: auto'); : style.push('display: block', 'margin-left: auto');
} }
if (width) style.push(`width: ${width}px`); if (width) style.push(`width: ${width}px`, 'max-width: 100%');
if (height) style.push(`height: ${height}px`);
return [ return [
'interactive-image', 'interactive-image',
......
...@@ -918,17 +918,17 @@ body{ ...@@ -918,17 +918,17 @@ body{
} }
&-list{ &-list{
display: flex; display: grid;
flex-wrap: wrap; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
gap: 10px; gap: 10px;
max-height: 280px; max-height: min(280px, calc(90dvh - 440px));
overflow-y: auto; overflow-y: auto;
padding-right: 4px; padding-right: 4px;
} }
&-item{ &-item{
position: relative; position: relative;
width: 100px; width: 100%;
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
background-color: #e8eaed; background-color: #e8eaed;
border-radius: 6px; border-radius: 6px;
...@@ -965,9 +965,7 @@ body{ ...@@ -965,9 +965,7 @@ body{
&.is-audio, &.is-audio,
&.is-file{ &.is-file{
aspect-ratio: auto; aspect-ratio: auto;
width: auto; width: 100%;
max-width: 160px;
min-width: 80px;
height: auto; height: auto;
background-image: none !important; background-image: none !important;
background-color: #F5F7FA; background-color: #F5F7FA;
...@@ -977,7 +975,7 @@ body{ ...@@ -977,7 +975,7 @@ body{
} }
&.is-video{ &.is-video{
width: 240px; width: 100%;
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
background-color: #000; background-color: #000;
background-image: none !important; background-image: none !important;
......
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