feat: Add option to replace existing file attachment in editor

This commit is contained in:
Tom Moor
2024-01-21 11:52:20 -05:00
parent cbb00c4871
commit 4ddb5c3eed
8 changed files with 157 additions and 39 deletions

View File

@@ -488,6 +488,12 @@ iframe.embed {
}
}
.attachment-replacement-uploading {
.widget {
opacity: 0.5;
}
}
.image-replacement-uploading {
img {
opacity: 0.5;

View File

@@ -11,6 +11,7 @@ type Props = {
isSelected: boolean;
children?: React.ReactNode;
onMouseDown?: React.MouseEventHandler<HTMLAnchorElement>;
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
};
export default function Widget(props: Props & ThemeProps<DefaultTheme>) {
@@ -22,6 +23,7 @@ export default function Widget(props: Props & ThemeProps<DefaultTheme>) {
href={sanitizeUrl(props.href)}
rel="noreferrer nofollow"
onMouseDown={props.onMouseDown}
onClick={props.onClick}
>
{props.icon}
<Preview>