Move image zooming back to unvendorized lib (#6980)

* Move image zooming back to unvendorized lib

* refactor

* perf: Avoid mounting zoom dialog until interacted

* Add captions to lightbox

* lightbox
This commit is contained in:
Tom Moor
2024-06-03 20:26:25 -04:00
committed by GitHub
parent 62ebba1c32
commit 23606dad1d
15 changed files with 207 additions and 1260 deletions

View File

@@ -5,7 +5,7 @@ import styled from "styled-components";
import { s } from "../../styles";
import { sanitizeUrl } from "../../utils/urls";
import { ComponentProps } from "../types";
import ImageZoom from "./ImageZoom";
import { ImageZoom } from "./ImageZoom";
import { ResizeLeft, ResizeRight } from "./ResizeHandle";
import useDragResize from "./hooks/useDragResize";
@@ -70,7 +70,7 @@ const Image = (props: Props) => {
<DownloadIcon />
</Button>
)}
<ImageZoom zoomMargin={24}>
<ImageZoom caption={props.node.attrs.alt}>
<img
style={{
...widthStyle,