* Add support for Grist embeds. * Change Grist integration to only support SaaS * Update Regex * Update shared/editor/embeds/index.tsx Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com> * Change Grist embed to use function based API * Convert standard URL into embed url * Update shared/editor/embeds/Grist.tsx Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com> * Update shared/editor/embeds/Grist.tsx Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com> * Update shared/editor/embeds/Grist.tsx Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com> * Lint and test updates Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com> Co-authored-by: Tom Moor <tom.moor@gmail.com>
28 lines
610 B
TypeScript
28 lines
610 B
TypeScript
import * as React from "react";
|
|
import Frame from "../components/Frame";
|
|
import Image from "../components/Image";
|
|
import { EmbedProps as Props } from ".";
|
|
|
|
function Grist(props: Props) {
|
|
return (
|
|
<Frame
|
|
{...props}
|
|
src={props.attrs.href.replace(/(\?embed=true)?$/, "?embed=true")}
|
|
icon={
|
|
<Image
|
|
src="/images/grist.png"
|
|
alt="Grist Icon"
|
|
width={16}
|
|
height={16}
|
|
/>
|
|
}
|
|
title="Grist Spreadsheet"
|
|
border
|
|
/>
|
|
);
|
|
}
|
|
|
|
Grist.ENABLED = [new RegExp("^https?://([a-z.-]+\\.)?getgrist\\.com/(.+)$")];
|
|
|
|
export default Grist;
|