This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
2020-03-07 06:45:32 +00:00
|
|
|
// @flow
|
2020-06-20 20:59:15 +00:00
|
|
|
import * as React from "react";
|
|
|
|
import Frame from "./components/Frame";
|
2020-03-07 06:45:32 +00:00
|
|
|
|
|
|
|
const URL_REGEX = new RegExp(
|
2020-06-20 20:59:15 +00:00
|
|
|
"^https?://docs.google.com/spreadsheets/d/(.*)/pub(.*)$"
|
2020-03-07 06:45:32 +00:00
|
|
|
);
|
|
|
|
|
2020-05-20 03:39:34 +00:00
|
|
|
type Props = {|
|
|
|
|
attrs: {|
|
|
|
|
href: string,
|
|
|
|
matches: string[],
|
|
|
|
|},
|
|
|
|
|};
|
2020-03-07 06:45:32 +00:00
|
|
|
|
|
|
|
export default class GoogleSlides extends React.Component<Props> {
|
|
|
|
static ENABLED = [URL_REGEX];
|
|
|
|
|
|
|
|
render() {
|
2020-05-20 03:39:34 +00:00
|
|
|
return (
|
|
|
|
<Frame src={this.props.attrs.href} title="Google Sheets Embed" border />
|
|
|
|
);
|
2020-03-07 06:45:32 +00:00
|
|
|
}
|
|
|
|
}
|