mirror of
https://github.com/docmost/docmost.git
synced 2026-05-23 10:42:42 +08:00
refactor: Image node and view clean-up
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
.imagePlaceholder {
|
.imageWrapper {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@mixin light {
|
@mixin light {
|
||||||
background-color: var(--mantine-color-gray-0);
|
background-color: var(--mantine-color-gray-0);
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ export default function ImageView(props: NodeViewProps) {
|
|||||||
<NodeViewWrapper data-drag-handle>
|
<NodeViewWrapper data-drag-handle>
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
selected ? "ProseMirror-selectednode" : "",
|
selected && "ProseMirror-selectednode",
|
||||||
classes.imagePlaceholder,
|
classes.imageWrapper,
|
||||||
alignClass,
|
alignClass,
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -91,11 +91,14 @@ export const TiptapImage = Image.extend<ImageOptions>({
|
|||||||
"data-size": attributes.size,
|
"data-size": attributes.size,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
placeholderId: {
|
|
||||||
default: null,
|
|
||||||
rendered: false,
|
|
||||||
},
|
|
||||||
aspectRatio: {
|
aspectRatio: {
|
||||||
|
default: null,
|
||||||
|
parseHTML: (element) => element.getAttribute("data-aspect-ratio"),
|
||||||
|
renderHTML: (attributes: ImageAttributes) => ({
|
||||||
|
"data-aspect-ratio": attributes.aspectRatio,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
placeholderId: {
|
||||||
default: null,
|
default: null,
|
||||||
rendered: false,
|
rendered: false,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user