Commit 6911e026 by Яков

fix

parent 7c036f68
{ {
"name": "react-ag-qeditor", "name": "react-ag-qeditor",
"version": "1.0.89", "version": "1.0.90",
"description": "WYSIWYG html editor", "description": "WYSIWYG html editor",
"author": "atma", "author": "atma",
"license": "MIT", "license": "MIT",
......
...@@ -365,20 +365,30 @@ const ResizableImageExtension = TipTapImage.extend({ ...@@ -365,20 +365,30 @@ const ResizableImageExtension = TipTapImage.extend({
'data-type': 'resizable-image', 'data-type': 'resizable-image',
'data-image-wrapper': true, 'data-image-wrapper': true,
style: ` style: `
display: ${align === 'center' ? 'block' : 'inline-block'}; display: ${align === 'center' ? 'block' : 'inline-block'};
float: ${floatDirection}; float: ${floatDirection};
margin: ${align === 'left' ? '0 1rem 1rem 0' : margin: ${align === 'left' ? '0 1rem 1rem 0' :
align === 'right' ? '0 0 1rem 1rem' : align === 'right' ? '0 0 1rem 1rem' :
align === 'wrap-left' ? '0 1rem 1rem 0' : align === 'wrap-left' ? '0 1rem 1rem 0' :
align === 'wrap-right' ? '0 0 1rem 1rem' : align === 'wrap-right' ? '0 0 1rem 1rem' :
align === 'center' ? '0.5rem auto' : '0'}; align === 'center' ? '0.5rem auto' : '0'};
shape-outside: ${isWrap ? 'margin-box' : 'none'}; shape-outside: ${isWrap ? 'margin-box' : 'none'};
vertical-align: top; vertical-align: top;
position: relative; position: relative;
z-index: 1; z-index: 1;
`, ${align === 'center' ? 'width: 100%; text-align: center;' : ''}
`,
'data-align': align 'data-align': align
}, ['img', HTMLAttributes]]; }, ['img', {
...HTMLAttributes,
style: `
${HTMLAttributes.style || ''};
display: ${align === 'center' ? 'inline-block' : 'block'};
margin: ${align === 'center' ? '0 auto' : '0'};
max-width: 100%;
height: auto;
`
}]];
}, },
addNodeView() { addNodeView() {
......
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