* Move image zooming back to unvendorized lib * refactor * perf: Avoid mounting zoom dialog until interacted * Add captions to lightbox * lightbox
28 lines
731 B
TypeScript
28 lines
731 B
TypeScript
import * as React from "react";
|
|
import Frame from "../components/Frame";
|
|
import { ImageZoom } from "../components/ImageZoom";
|
|
import { EmbedProps as Props } from ".";
|
|
|
|
function InVision({ matches, ...props }: Props) {
|
|
if (/opal\.invisionapp\.com/.test(props.attrs.href)) {
|
|
return (
|
|
<div className={props.isSelected ? "ProseMirror-selectednode" : ""}>
|
|
<ImageZoom>
|
|
<img
|
|
src={props.attrs.href}
|
|
alt="InVision Embed"
|
|
style={{
|
|
maxWidth: "100%",
|
|
maxHeight: "75vh",
|
|
}}
|
|
/>
|
|
</ImageZoom>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return <Frame {...props} src={props.attrs.href} title="InVision Embed" />;
|
|
}
|
|
|
|
export default InVision;
|