refactor: Image node and view clean-up

This commit is contained in:
Arek Nawo
2026-01-19 20:15:14 +01:00
parent 0c5c83a17a
commit 13c29545a2
3 changed files with 10 additions and 7 deletions
@@ -1,4 +1,4 @@
.imagePlaceholder {
.imageWrapper {
border-radius: 8px;
@mixin light {
background-color: var(--mantine-color-gray-0);
@@ -19,8 +19,8 @@ export default function ImageView(props: NodeViewProps) {
<NodeViewWrapper data-drag-handle>
<div
className={clsx(
selected ? "ProseMirror-selectednode" : "",
classes.imagePlaceholder,
selected && "ProseMirror-selectednode",
classes.imageWrapper,
alignClass,
)}
style={{
+7 -4
View File
@@ -91,11 +91,14 @@ export const TiptapImage = Image.extend<ImageOptions>({
"data-size": attributes.size,
}),
},
placeholderId: {
default: null,
rendered: false,
},
aspectRatio: {
default: null,
parseHTML: (element) => element.getAttribute("data-aspect-ratio"),
renderHTML: (attributes: ImageAttributes) => ({
"data-aspect-ratio": attributes.aspectRatio,
}),
},
placeholderId: {
default: null,
rendered: false,
},