fix: Enable embeds within HTML and PDF exports (#6290)

This commit is contained in:
Tom Moor
2023-12-14 21:52:51 -05:00
committed by GitHub
parent c40ab288fa
commit bd65a4f151
101 changed files with 420 additions and 2276 deletions

View File

@@ -3,13 +3,8 @@ import Frame from "../components/Frame";
import ImageZoom from "../components/ImageZoom";
import { EmbedProps as Props } from ".";
const IFRAME_REGEX =
/^https:\/\/(invis\.io\/.*)|(projects\.invisionapp\.com\/share\/.*)$/;
const IMAGE_REGEX =
/^https:\/\/(opal\.invisionapp\.com\/static-signed\/live-embed\/.*)$/;
function InVision(props: Props) {
if (IMAGE_REGEX.test(props.attrs.href)) {
function InVision({ matches, ...props }: Props) {
if (/opal\.invisionapp\.com/.test(props.attrs.href)) {
return (
<div className={props.isSelected ? "ProseMirror-selectednode" : ""}>
<ImageZoom zoomMargin={24}>
@@ -29,6 +24,4 @@ function InVision(props: Props) {
return <Frame {...props} src={props.attrs.href} title="InVision Embed" />;
}
InVision.ENABLED = [IFRAME_REGEX, IMAGE_REGEX];
export default InVision;