chore: Move to prettier standard double quotes (#1309)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
@@ -11,8 +11,8 @@ type Props = {|
|
||||
|
||||
export default class Abstract extends React.Component<Props> {
|
||||
static ENABLED = [
|
||||
new RegExp('https?://share.(?:go)?abstract.com/(.*)$'),
|
||||
new RegExp('https?://app.(?:go)?abstract.com/(?:share|embed)/(.*)$'),
|
||||
new RegExp("https?://share.(?:go)?abstract.com/(.*)$"),
|
||||
new RegExp("https?://app.(?:go)?abstract.com/(?:share|embed)/(.*)$"),
|
||||
];
|
||||
|
||||
render() {
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Abstract from './Abstract';
|
||||
import Abstract from "./Abstract";
|
||||
|
||||
describe('Abstract', () => {
|
||||
describe("Abstract", () => {
|
||||
const match = Abstract.ENABLED[0];
|
||||
const match2 = Abstract.ENABLED[1];
|
||||
test('to be enabled on share subdomain link', () => {
|
||||
test("to be enabled on share subdomain link", () => {
|
||||
expect(
|
||||
'https://share.goabstract.com/aaec8bba-f473-4f64-96e7-bff41c70ff8a'.match(
|
||||
"https://share.goabstract.com/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
|
||||
expect(
|
||||
'https://share.abstract.com/aaec8bba-f473-4f64-96e7-bff41c70ff8a'.match(
|
||||
"https://share.abstract.com/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://app.goabstract.com/share/aaec8bba-f473-4f64-96e7-bff41c70ff8a'.match(
|
||||
"https://app.goabstract.com/share/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
|
||||
match2
|
||||
)
|
||||
).toBeTruthy();
|
||||
|
||||
expect(
|
||||
'https://app.abstract.com/share/aaec8bba-f473-4f64-96e7-bff41c70ff8a'.match(
|
||||
"https://app.abstract.com/share/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
|
||||
match2
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://app.goabstract.com/embed/aaec8bba-f473-4f64-96e7-bff41c70ff8a'.match(
|
||||
"https://app.goabstract.com/embed/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
|
||||
match2
|
||||
)
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
'https://app.abstract.com/embed/aaec8bba-f473-4f64-96e7-bff41c70ff8a'.match(
|
||||
"https://app.abstract.com/embed/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
|
||||
match2
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://abstract.com'.match(match)).toBe(null);
|
||||
expect('https://goabstract.com'.match(match)).toBe(null);
|
||||
expect('https://app.goabstract.com'.match(match)).toBe(null);
|
||||
expect('https://abstract.com/features'.match(match)).toBe(null);
|
||||
expect('https://app.abstract.com/home'.match(match)).toBe(null);
|
||||
expect('https://abstract.com/pricing'.match(match)).toBe(null);
|
||||
expect('https://goabstract.com/pricing'.match(match)).toBe(null);
|
||||
expect('https://www.goabstract.com/pricing'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://abstract.com".match(match)).toBe(null);
|
||||
expect("https://goabstract.com".match(match)).toBe(null);
|
||||
expect("https://app.goabstract.com".match(match)).toBe(null);
|
||||
expect("https://abstract.com/features".match(match)).toBe(null);
|
||||
expect("https://app.abstract.com/home".match(match)).toBe(null);
|
||||
expect("https://abstract.com/pricing".match(match)).toBe(null);
|
||||
expect("https://goabstract.com/pricing".match(match)).toBe(null);
|
||||
expect("https://www.goabstract.com/pricing".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp('https://airtable.com/(?:embed/)?(shr.*)$');
|
||||
const URL_REGEX = new RegExp("https://airtable.com/(?:embed/)?(shr.*)$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Airtable from './Airtable';
|
||||
import Airtable from "./Airtable";
|
||||
|
||||
describe('Airtable', () => {
|
||||
describe("Airtable", () => {
|
||||
const match = Airtable.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
expect('https://airtable.com/shrEoQs3erLnppMie'.match(match)).toBeTruthy();
|
||||
test("to be enabled on share link", () => {
|
||||
expect("https://airtable.com/shrEoQs3erLnppMie".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://airtable.com/embed/shrEoQs3erLnppMie'.match(match)
|
||||
"https://airtable.com/embed/shrEoQs3erLnppMie".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://airtable.com'.match(match)).toBe(null);
|
||||
expect('https://airtable.com/features'.match(match)).toBe(null);
|
||||
expect('https://airtable.com/pricing'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://airtable.com".match(match)).toBe(null);
|
||||
expect("https://airtable.com/features".match(match)).toBe(null);
|
||||
expect("https://airtable.com/pricing".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp('^https://codepen.io/(.*?)/(pen|embed)/(.*)$');
|
||||
const URL_REGEX = new RegExp("^https://codepen.io/(.*?)/(pen|embed)/(.*)$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
@@ -15,7 +15,7 @@ export default class Codepen extends React.Component<Props> {
|
||||
static ENABLED = [URL_REGEX];
|
||||
|
||||
render() {
|
||||
const normalizedUrl = this.props.attrs.href.replace(/\/pen\//, '/embed/');
|
||||
const normalizedUrl = this.props.attrs.href.replace(/\/pen\//, "/embed/");
|
||||
|
||||
return <Frame src={normalizedUrl} title="Codepen Embed" />;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Codepen from './Codepen';
|
||||
import Codepen from "./Codepen";
|
||||
|
||||
describe('Codepen', () => {
|
||||
describe("Codepen", () => {
|
||||
const match = Codepen.ENABLED[0];
|
||||
test('to be enabled on pen link', () => {
|
||||
test("to be enabled on pen link", () => {
|
||||
expect(
|
||||
'https://codepen.io/chriscoyier/pen/gfdDu'.match(match)
|
||||
"https://codepen.io/chriscoyier/pen/gfdDu".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://codepen.io/chriscoyier/embed/gfdDu'.match(match)
|
||||
"https://codepen.io/chriscoyier/embed/gfdDu".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://codepen.io'.match(match)).toBe(null);
|
||||
expect('https://codepen.io/chriscoyier'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://codepen.io".match(match)).toBe(null);
|
||||
expect("https://codepen.io/chriscoyier".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'https://([w.-]+.)?figma.com/(file|proto)/([0-9a-zA-Z]{22,128})(?:/.*)?$'
|
||||
"https://([w.-]+.)?figma.com/(file|proto)/([0-9a-zA-Z]{22,128})(?:/.*)?$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Figma from './Figma';
|
||||
import Figma from "./Figma";
|
||||
|
||||
describe('Figma', () => {
|
||||
describe("Figma", () => {
|
||||
const match = Figma.ENABLED[0];
|
||||
test('to be enabled on file link', () => {
|
||||
test("to be enabled on file link", () => {
|
||||
expect(
|
||||
'https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931'.match(match)
|
||||
"https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on prototype link', () => {
|
||||
test("to be enabled on prototype link", () => {
|
||||
expect(
|
||||
'https://www.figma.com/proto/LKQ4FJ4bTnCSjedbRpk931'.match(match)
|
||||
"https://www.figma.com/proto/LKQ4FJ4bTnCSjedbRpk931".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://www.figma.com'.match(match)).toBe(null);
|
||||
expect('https://www.figma.com/features'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://www.figma.com".match(match)).toBe(null);
|
||||
expect("https://www.figma.com/features".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp('^https://framer.cloud/(.*)$');
|
||||
const URL_REGEX = new RegExp("^https://framer.cloud/(.*)$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Framer from './Framer';
|
||||
import Framer from "./Framer";
|
||||
|
||||
describe('Framer', () => {
|
||||
describe("Framer", () => {
|
||||
const match = Framer.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
expect('https://framer.cloud/PVwJO'.match(match)).toBeTruthy();
|
||||
test("to be enabled on share link", () => {
|
||||
expect("https://framer.cloud/PVwJO".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled on root', () => {
|
||||
expect('https://framer.cloud'.match(match)).toBe(null);
|
||||
test("to not be enabled on root", () => {
|
||||
expect("https://framer.cloud".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import * as React from "react";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https://gist.github.com/([a-zd](?:[a-zd]|-(?=[a-zd])){0,38})/(.*)$'
|
||||
"^https://gist.github.com/([a-zd](?:[a-zd]|-(?=[a-zd])){0,38})/(.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
@@ -23,7 +23,7 @@ class Gist extends React.Component<Props> {
|
||||
|
||||
get id() {
|
||||
const gistUrl = new URL(this.props.attrs.href);
|
||||
return gistUrl.pathname.split('/')[2];
|
||||
return gistUrl.pathname.split("/")[2];
|
||||
}
|
||||
|
||||
updateIframeContent() {
|
||||
@@ -33,9 +33,9 @@ class Gist extends React.Component<Props> {
|
||||
|
||||
// We need to add some temporary content to the iframe for the document
|
||||
// to be available, otherwise it's undefined on first load
|
||||
const temp = document.getElementById('gist');
|
||||
const temp = document.getElementById("gist");
|
||||
if (temp) {
|
||||
temp.innerHTML = '';
|
||||
temp.innerHTML = "";
|
||||
temp.appendChild(iframe);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class Gist extends React.Component<Props> {
|
||||
gistLink
|
||||
}"></script>`;
|
||||
const styles =
|
||||
'<style>*{ font-size:12px; } body { margin: 0; } .gist .blob-wrapper.data { max-height:150px; overflow:auto; }</style>';
|
||||
"<style>*{ font-size:12px; } body { margin: 0; } .gist .blob-wrapper.data { max-height:150px; overflow:auto; }</style>";
|
||||
const iframeHtml = `<html><head><base target="_parent">${
|
||||
styles
|
||||
}</head><body>${gistScript}</body></html>`;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Gist from './Gist';
|
||||
import Gist from "./Gist";
|
||||
|
||||
describe('Gist', () => {
|
||||
describe("Gist", () => {
|
||||
const match = Gist.ENABLED[0];
|
||||
test('to be enabled on gist link', () => {
|
||||
test("to be enabled on gist link", () => {
|
||||
expect(
|
||||
'https://gist.github.com/wmertens/0b4fd66ca7055fd290ecc4b9d95271a9'.match(
|
||||
"https://gist.github.com/wmertens/0b4fd66ca7055fd290ecc4b9d95271a9".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://gist.github.com/tommoor'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://gist.github.com/tommoor".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https?://docs.google.com/document/d/(.*)/pub(.*)$'
|
||||
"^https?://docs.google.com/document/d/(.*)/pub(.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import GoogleDocs from './GoogleDocs';
|
||||
import GoogleDocs from "./GoogleDocs";
|
||||
|
||||
describe('GoogleDocs', () => {
|
||||
describe("GoogleDocs", () => {
|
||||
const match = GoogleDocs.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pubhtml'.match(
|
||||
"https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pubhtml".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
'https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub'.match(
|
||||
"https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect(
|
||||
'https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigR/edit'.match(
|
||||
"https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigR/edit".match(
|
||||
match
|
||||
)
|
||||
).toBe(null);
|
||||
expect('https://docs.google.com/document'.match(match)).toBe(null);
|
||||
expect('https://docs.google.com'.match(match)).toBe(null);
|
||||
expect('https://www.google.com'.match(match)).toBe(null);
|
||||
expect("https://docs.google.com/document".match(match)).toBe(null);
|
||||
expect("https://docs.google.com".match(match)).toBe(null);
|
||||
expect("https://www.google.com".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https?://docs.google.com/spreadsheets/d/(.*)/pub(.*)$'
|
||||
"^https?://docs.google.com/spreadsheets/d/(.*)/pub(.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import GoogleSheets from './GoogleSheets';
|
||||
import GoogleSheets from "./GoogleSheets";
|
||||
|
||||
describe('GoogleSheets', () => {
|
||||
describe("GoogleSheets", () => {
|
||||
const match = GoogleSheets.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://docs.google.com/spreadsheets/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub'.match(
|
||||
"https://docs.google.com/spreadsheets/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect(
|
||||
'https://docs.google.com/spreadsheets/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigR/edit'.match(
|
||||
"https://docs.google.com/spreadsheets/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigR/edit".match(
|
||||
match
|
||||
)
|
||||
).toBe(null);
|
||||
expect('https://docs.google.com/spreadsheets'.match(match)).toBe(null);
|
||||
expect('https://docs.google.com'.match(match)).toBe(null);
|
||||
expect('https://www.google.com'.match(match)).toBe(null);
|
||||
expect("https://docs.google.com/spreadsheets".match(match)).toBe(null);
|
||||
expect("https://docs.google.com".match(match)).toBe(null);
|
||||
expect("https://www.google.com".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https?://docs.google.com/presentation/d/(.*)/pub(.*)$'
|
||||
"^https?://docs.google.com/presentation/d/(.*)/pub(.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
@@ -19,7 +19,7 @@ export default class GoogleSlides extends React.Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<Frame
|
||||
src={this.props.attrs.href.replace('/pub', '/embed')}
|
||||
src={this.props.attrs.href.replace("/pub", "/embed")}
|
||||
title="Google Slides Embed"
|
||||
border
|
||||
/>
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import GoogleSlides from './GoogleSlides';
|
||||
import GoogleSlides from "./GoogleSlides";
|
||||
|
||||
describe('GoogleSlides', () => {
|
||||
describe("GoogleSlides", () => {
|
||||
const match = GoogleSlides.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub?start=false&loop=false&delayms=3000'.match(
|
||||
"https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub?start=false&loop=false&delayms=3000".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
'https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub'.match(
|
||||
"https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect(
|
||||
'https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigR/edit'.match(
|
||||
"https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigR/edit".match(
|
||||
match
|
||||
)
|
||||
).toBe(null);
|
||||
expect('https://docs.google.com/presentation'.match(match)).toBe(null);
|
||||
expect('https://docs.google.com'.match(match)).toBe(null);
|
||||
expect('https://www.google.com'.match(match)).toBe(null);
|
||||
expect("https://docs.google.com/presentation".match(match)).toBe(null);
|
||||
expect("https://docs.google.com".match(match)).toBe(null);
|
||||
expect("https://www.google.com".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import ImageZoom from 'react-medium-image-zoom';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import ImageZoom from "react-medium-image-zoom";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const IFRAME_REGEX = new RegExp(
|
||||
'^https://(invis.io/.*)|(projects.invisionapp.com/share/.*)$'
|
||||
"^https://(invis.io/.*)|(projects.invisionapp.com/share/.*)$"
|
||||
);
|
||||
|
||||
const IMAGE_REGEX = new RegExp(
|
||||
'^https://(opal.invisionapp.com/static-signed/live-embed/.*)$'
|
||||
"^https://(opal.invisionapp.com/static-signed/live-embed/.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
@@ -27,10 +27,10 @@ export default class InVision extends React.Component<Props> {
|
||||
<ImageZoom
|
||||
image={{
|
||||
src: this.props.attrs.href,
|
||||
alt: 'InVision Embed',
|
||||
alt: "InVision Embed",
|
||||
style: {
|
||||
maxWidth: '100%',
|
||||
maxHeight: '75vh',
|
||||
maxWidth: "100%",
|
||||
maxHeight: "75vh",
|
||||
},
|
||||
}}
|
||||
shouldRespectMaxDimension
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import InVision from './InVision';
|
||||
import InVision from "./InVision";
|
||||
|
||||
describe('InVision', () => {
|
||||
describe("InVision", () => {
|
||||
const match = InVision.ENABLED[0];
|
||||
test('to be enabled on shortlink', () => {
|
||||
expect('https://invis.io/69PG07QYQTE'.match(match)).toBeTruthy();
|
||||
test("to be enabled on shortlink", () => {
|
||||
expect("https://invis.io/69PG07QYQTE".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on share', () => {
|
||||
test("to be enabled on share", () => {
|
||||
expect(
|
||||
'https://projects.invisionapp.com/share/69PG07QYQTE'.match(match)
|
||||
"https://projects.invisionapp.com/share/69PG07QYQTE".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://invis.io'.match(match)).toBe(null);
|
||||
expect('https://invisionapp.com'.match(match)).toBe(null);
|
||||
expect('https://projects.invisionapp.com'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://invis.io".match(match)).toBe(null);
|
||||
expect("https://invisionapp.com".match(match)).toBe(null);
|
||||
expect("https://projects.invisionapp.com".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = /^https:\/\/(www\.)?(use)?loom.com\/(embed|share)\/(.*)$/;
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class Loom extends React.Component<Props> {
|
||||
static ENABLED = [URL_REGEX];
|
||||
|
||||
render() {
|
||||
const normalizedUrl = this.props.attrs.href.replace('share', 'embed');
|
||||
const normalizedUrl = this.props.attrs.href.replace("share", "embed");
|
||||
|
||||
return <Frame src={normalizedUrl} title="Loom Embed" />;
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Loom from './Loom';
|
||||
import Loom from "./Loom";
|
||||
|
||||
describe('Loom', () => {
|
||||
describe("Loom", () => {
|
||||
const match = Loom.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://www.loom.com/share/55327cbb265743f39c2c442c029277e0'.match(match)
|
||||
"https://www.loom.com/share/55327cbb265743f39c2c442c029277e0".match(match)
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
'https://www.useloom.com/share/55327cbb265743f39c2c442c029277e0'.match(
|
||||
"https://www.useloom.com/share/55327cbb265743f39c2c442c029277e0".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://www.loom.com/embed/55327cbb265743f39c2c442c029277e0'.match(match)
|
||||
"https://www.loom.com/embed/55327cbb265743f39c2c442c029277e0".match(match)
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
'https://www.useloom.com/embed/55327cbb265743f39c2c442c029277e0'.match(
|
||||
"https://www.useloom.com/embed/55327cbb265743f39c2c442c029277e0".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://www.useloom.com'.match(match)).toBe(null);
|
||||
expect('https://www.useloom.com/features'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://www.useloom.com".match(match)).toBe(null);
|
||||
expect("https://www.useloom.com/features".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = /^https?:\/\/(www\.)?lucidchart.com\/documents\/(embeddedchart|view)\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})(?:\/.*)?$/;
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Lucidchart from './Lucidchart';
|
||||
import Lucidchart from "./Lucidchart";
|
||||
|
||||
describe('Lucidchart', () => {
|
||||
describe("Lucidchart", () => {
|
||||
const match = Lucidchart.ENABLED[0];
|
||||
test('to be enabled on view link', () => {
|
||||
test("to be enabled on view link", () => {
|
||||
expect(
|
||||
'https://www.lucidchart.com/documents/view/2f4a79cb-7637-433d-8ffb-27cce65a05e7'.match(
|
||||
"https://www.lucidchart.com/documents/view/2f4a79cb-7637-433d-8ffb-27cce65a05e7".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on visited link', () => {
|
||||
test("to be enabled on visited link", () => {
|
||||
expect(
|
||||
'https://www.lucidchart.com/documents/view/2f4a79cb-7637-433d-8ffb-27cce65a05e7/0'.match(
|
||||
"https://www.lucidchart.com/documents/view/2f4a79cb-7637-433d-8ffb-27cce65a05e7/0".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://lucidchart.com'.match(match)).toBe(null);
|
||||
expect('https://www.lucidchart.com'.match(match)).toBe(null);
|
||||
expect('https://www.lucidchart.com/features'.match(match)).toBe(null);
|
||||
expect('https://www.lucidchart.com/documents/view'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://lucidchart.com".match(match)).toBe(null);
|
||||
expect("https://www.lucidchart.com".match(match)).toBe(null);
|
||||
expect("https://www.lucidchart.com/features".match(match)).toBe(null);
|
||||
expect("https://www.lucidchart.com/documents/view".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp('^https://marvelapp.com/([A-Za-z0-9-]{6})/?$');
|
||||
const URL_REGEX = new RegExp("^https://marvelapp.com/([A-Za-z0-9-]{6})/?$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Marvel from './Marvel';
|
||||
import Marvel from "./Marvel";
|
||||
|
||||
describe('Marvel', () => {
|
||||
describe("Marvel", () => {
|
||||
const match = Marvel.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
expect('https://marvelapp.com/75hj91'.match(match)).toBeTruthy();
|
||||
test("to be enabled on share link", () => {
|
||||
expect("https://marvelapp.com/75hj91".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://marvelapp.com'.match(match)).toBe(null);
|
||||
expect('https://marvelapp.com/features'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://marvelapp.com".match(match)).toBe(null);
|
||||
expect("https://marvelapp.com/features".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https://([w.-]+.)?(mindmeister.com|mm.tt)(/maps/public_map_shell)?/(\\d+)(\\?t=.*)?(/.*)?$'
|
||||
"^https://([w.-]+.)?(mindmeister.com|mm.tt)(/maps/public_map_shell)?/(\\d+)(\\?t=.*)?(/.*)?$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Mindmeister from './Mindmeister';
|
||||
import Mindmeister from "./Mindmeister";
|
||||
|
||||
describe('Mindmeister', () => {
|
||||
describe("Mindmeister", () => {
|
||||
const match = Mindmeister.ENABLED[0];
|
||||
|
||||
test('to be enabled on mm.tt link', () => {
|
||||
expect('https://mm.tt/326377934'.match(match)).toBeTruthy();
|
||||
test("to be enabled on mm.tt link", () => {
|
||||
expect("https://mm.tt/326377934".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on mm.tt link with token parameter', () => {
|
||||
expect('https://mm.tt/326377934?t=r9NcnTRr18'.match(match)).toBeTruthy();
|
||||
test("to be enabled on mm.tt link with token parameter", () => {
|
||||
expect("https://mm.tt/326377934?t=r9NcnTRr18".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://www.mindmeister.com/maps/public_map_shell/326377934/paper-digital-or-online-mind-mapping'.match(
|
||||
"https://www.mindmeister.com/maps/public_map_shell/326377934/paper-digital-or-online-mind-mapping".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on public link', () => {
|
||||
test("to be enabled on public link", () => {
|
||||
expect(
|
||||
'https://www.mindmeister.com/326377934/paper-digital-or-online-mind-mapping'.match(
|
||||
"https://www.mindmeister.com/326377934/paper-digital-or-online-mind-mapping".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled without www', () => {
|
||||
test("to be enabled without www", () => {
|
||||
expect(
|
||||
'https://mindmeister.com/326377934/paper-digital-or-online-mind-mapping'.match(
|
||||
"https://mindmeister.com/326377934/paper-digital-or-online-mind-mapping".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled without slug', () => {
|
||||
expect('https://mindmeister.com/326377934'.match(match)).toBeTruthy();
|
||||
test("to be enabled without slug", () => {
|
||||
expect("https://mindmeister.com/326377934".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://mindmeister.com'.match(match)).toBe(null);
|
||||
expect('https://www.mindmeister.com/pricing'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://mindmeister.com".match(match)).toBe(null);
|
||||
expect("https://www.mindmeister.com/pricing".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = /^https:\/\/(?:realtimeboard|miro).com\/app\/board\/(.*)$/;
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Miro from './Miro';
|
||||
import Miro from "./Miro";
|
||||
|
||||
describe('Miro', () => {
|
||||
describe("Miro", () => {
|
||||
const match = Miro.ENABLED[0];
|
||||
test('to be enabled on old domain share link', () => {
|
||||
test("to be enabled on old domain share link", () => {
|
||||
expect(
|
||||
'https://realtimeboard.com/app/board/o9J_k0fwiss='.match(match)
|
||||
"https://realtimeboard.com/app/board/o9J_k0fwiss=".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on share link', () => {
|
||||
expect('https://miro.com/app/board/o9J_k0fwiss='.match(match)).toBeTruthy();
|
||||
test("to be enabled on share link", () => {
|
||||
expect("https://miro.com/app/board/o9J_k0fwiss=".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://miro.com'.match(match)).toBe(null);
|
||||
expect('https://realtimeboard.com'.match(match)).toBe(null);
|
||||
expect('https://realtimeboard.com/features'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://miro.com".match(match)).toBe(null);
|
||||
expect("https://realtimeboard.com".match(match)).toBe(null);
|
||||
expect("https://realtimeboard.com/features".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https://([w.-]+.)?modeanalytics.com/(.*)/reports/(.*)$'
|
||||
"^https://([w.-]+.)?modeanalytics.com/(.*)/reports/(.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
@@ -18,7 +18,7 @@ export default class ModeAnalytics extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
// Allow users to paste embed or standard urls and handle them the same
|
||||
const normalizedUrl = this.props.attrs.href.replace(/\/embed$/, '');
|
||||
const normalizedUrl = this.props.attrs.href.replace(/\/embed$/, "");
|
||||
|
||||
return (
|
||||
<Frame src={`${normalizedUrl}/embed`} title="Mode Analytics Embed" />
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import ModeAnalytics from './ModeAnalytics';
|
||||
import ModeAnalytics from "./ModeAnalytics";
|
||||
|
||||
describe('ModeAnalytics', () => {
|
||||
describe("ModeAnalytics", () => {
|
||||
const match = ModeAnalytics.ENABLED[0];
|
||||
test('to be enabled on report link', () => {
|
||||
test("to be enabled on report link", () => {
|
||||
expect(
|
||||
'https://modeanalytics.com/outline/reports/5aca06064f56'.match(match)
|
||||
"https://modeanalytics.com/outline/reports/5aca06064f56".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://modeanalytics.com'.match(match)).toBe(null);
|
||||
expect('https://modeanalytics.com/outline'.match(match)).toBe(null);
|
||||
expect('https://modeanalytics.com/outline/reports'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://modeanalytics.com".match(match)).toBe(null);
|
||||
expect("https://modeanalytics.com/outline".match(match)).toBe(null);
|
||||
expect("https://modeanalytics.com/outline/reports".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp('^https://prezi.com/view/(.*)$');
|
||||
const URL_REGEX = new RegExp("^https://prezi.com/view/(.*)$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
@@ -15,7 +15,7 @@ export default class Prezi extends React.Component<Props> {
|
||||
static ENABLED = [URL_REGEX];
|
||||
|
||||
render() {
|
||||
const url = this.props.attrs.href.replace(/\/embed$/, '');
|
||||
const url = this.props.attrs.href.replace(/\/embed$/, "");
|
||||
|
||||
return <Frame src={`${url}/embed`} title="Prezi Embed" border />;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Prezi from './Prezi';
|
||||
import Prezi from "./Prezi";
|
||||
|
||||
describe('Prezi', () => {
|
||||
describe("Prezi", () => {
|
||||
const match = Prezi.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://prezi.com/view/39mn8Rn1ZkoeEKQCgk5C'.match(match)
|
||||
"https://prezi.com/view/39mn8Rn1ZkoeEKQCgk5C".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://prezi.com/view/39mn8Rn1ZkoeEKQCgk5C/embed'.match(match)
|
||||
"https://prezi.com/view/39mn8Rn1ZkoeEKQCgk5C/embed".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://prezi.com'.match(match)).toBe(null);
|
||||
expect('https://prezi.com/pricing'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://prezi.com".match(match)).toBe(null);
|
||||
expect("https://prezi.com/pricing".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp('https?://open.spotify.com/(.*)$');
|
||||
const URL_REGEX = new RegExp("https?://open.spotify.com/(.*)$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
@@ -18,12 +18,12 @@ export default class Spotify extends React.Component<Props> {
|
||||
const parsed = new URL(this.props.attrs.href);
|
||||
return parsed.pathname;
|
||||
} catch (err) {
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const normalizedPath = this.pathname.replace(/^\/embed/, '/');
|
||||
const normalizedPath = this.pathname.replace(/^\/embed/, "/");
|
||||
|
||||
return (
|
||||
<Frame
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Spotify from './Spotify';
|
||||
import Spotify from "./Spotify";
|
||||
|
||||
describe('Spotify', () => {
|
||||
describe("Spotify", () => {
|
||||
const match = Spotify.ENABLED[0];
|
||||
test('to be enabled on song link', () => {
|
||||
test("to be enabled on song link", () => {
|
||||
expect(
|
||||
'https://open.spotify.com/track/29G1ScCUhgjgI0H72qN4DE?si=DxjEUxV2Tjmk6pSVckPDRg'.match(
|
||||
"https://open.spotify.com/track/29G1ScCUhgjgI0H72qN4DE?si=DxjEUxV2Tjmk6pSVckPDRg".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on playlist link', () => {
|
||||
test("to be enabled on playlist link", () => {
|
||||
expect(
|
||||
'https://open.spotify.com/user/spotify/playlist/29G1ScCUhgjgI0H72qN4DE?si=DxjEUxV2Tjmk6pSVckPDRg'.match(
|
||||
"https://open.spotify.com/user/spotify/playlist/29G1ScCUhgjgI0H72qN4DE?si=DxjEUxV2Tjmk6pSVckPDRg".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://spotify.com'.match(match)).toBe(null);
|
||||
expect('https://open.spotify.com'.match(match)).toBe(null);
|
||||
expect('https://www.spotify.com'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://spotify.com".match(match)).toBe(null);
|
||||
expect("https://open.spotify.com".match(match)).toBe(null);
|
||||
expect("https://www.spotify.com".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = /^https:\/\/trello.com\/(c|b)\/([^/]*)(.*)?$/;
|
||||
|
||||
@@ -18,7 +18,7 @@ export default class Trello extends React.Component<Props> {
|
||||
const { matches } = this.props.attrs;
|
||||
const objectId = matches[2];
|
||||
|
||||
if (matches[1] === 'c') {
|
||||
if (matches[1] === "c") {
|
||||
return (
|
||||
<Frame
|
||||
width="316px"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https://([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?).typeform.com/to/(.*)$'
|
||||
"^https://([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?).typeform.com/to/(.*)$"
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Typeform from './Typeform';
|
||||
import Typeform from "./Typeform";
|
||||
|
||||
describe('Typeform', () => {
|
||||
describe("Typeform", () => {
|
||||
const match = Typeform.ENABLED[0];
|
||||
test('to be enabled on share link', () => {
|
||||
test("to be enabled on share link", () => {
|
||||
expect(
|
||||
'https://beardyman.typeform.com/to/zvlr4L'.match(match)
|
||||
"https://beardyman.typeform.com/to/zvlr4L".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://www.typeform.com'.match(match)).toBe(null);
|
||||
expect('https://typeform.com/to/zvlr4L'.match(match)).toBe(null);
|
||||
expect('https://typeform.com/features'.match(match)).toBe(null);
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://www.typeform.com".match(match)).toBe(null);
|
||||
expect("https://typeform.com/to/zvlr4L".match(match)).toBe(null);
|
||||
expect("https://typeform.com/features".match(match)).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = /(http|https)?:\/\/(www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|)(\d+)(?:|\/\?)/;
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import Vimeo from './Vimeo';
|
||||
import Vimeo from "./Vimeo";
|
||||
|
||||
describe('Vimeo', () => {
|
||||
describe("Vimeo", () => {
|
||||
const match = Vimeo.ENABLED[0];
|
||||
test('to be enabled on video link', () => {
|
||||
expect('https://vimeo.com/265045525'.match(match)).toBeTruthy();
|
||||
test("to be enabled on video link", () => {
|
||||
expect("https://vimeo.com/265045525".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://vimeo.com'.match(match)).toBe(null);
|
||||
expect('https://www.vimeo.com'.match(match)).toBe(null);
|
||||
expect('https://vimeo.com/upgrade'.match(match)).toBe(null);
|
||||
expect('https://vimeo.com/features/video-marketing'.match(match)).toBe(
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://vimeo.com".match(match)).toBe(null);
|
||||
expect("https://www.vimeo.com".match(match)).toBe(null);
|
||||
expect("https://vimeo.com/upgrade".match(match)).toBe(null);
|
||||
expect("https://vimeo.com/features/video-marketing".match(match)).toBe(
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = /(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i;
|
||||
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import YouTube from './YouTube';
|
||||
import YouTube from "./YouTube";
|
||||
|
||||
describe('YouTube', () => {
|
||||
describe("YouTube", () => {
|
||||
const match = YouTube.ENABLED[0];
|
||||
test('to be enabled on video link', () => {
|
||||
test("to be enabled on video link", () => {
|
||||
expect(
|
||||
'https://www.youtube.com/watch?v=dQw4w9WgXcQ'.match(match)
|
||||
"https://www.youtube.com/watch?v=dQw4w9WgXcQ".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
test("to be enabled on embed link", () => {
|
||||
expect(
|
||||
'https://www.youtube.com/embed?v=dQw4w9WgXcQ'.match(match)
|
||||
"https://www.youtube.com/embed?v=dQw4w9WgXcQ".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on shortlink', () => {
|
||||
expect('https://youtu.be/dQw4w9WgXcQ'.match(match)).toBeTruthy();
|
||||
test("to be enabled on shortlink", () => {
|
||||
expect("https://youtu.be/dQw4w9WgXcQ".match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to not be enabled elsewhere', () => {
|
||||
expect('https://youtu.be'.match(match)).toBe(null);
|
||||
expect('https://youtube.com'.match(match)).toBe(null);
|
||||
expect('https://www.youtube.com'.match(match)).toBe(null);
|
||||
expect('https://www.youtube.com/logout'.match(match)).toBe(null);
|
||||
expect('https://www.youtube.com/feed/subscriptions'.match(match)).toBe(
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://youtu.be".match(match)).toBe(null);
|
||||
expect("https://youtube.com".match(match)).toBe(null);
|
||||
expect("https://www.youtube.com".match(match)).toBe(null);
|
||||
expect("https://www.youtube.com/logout".match(match)).toBe(null);
|
||||
expect("https://www.youtube.com/feed/subscriptions".match(match)).toBe(
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observable } from 'mobx';
|
||||
import { observer } from 'mobx-react';
|
||||
import styled from 'styled-components';
|
||||
import * as React from "react";
|
||||
import { observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import styled from "styled-components";
|
||||
|
||||
type Props = {
|
||||
src?: string,
|
||||
@@ -34,12 +34,12 @@ class Frame extends React.Component<Props> {
|
||||
render() {
|
||||
const {
|
||||
border,
|
||||
width = '100%',
|
||||
height = '400px',
|
||||
width = "100%",
|
||||
height = "400px",
|
||||
forwardedRef,
|
||||
...rest
|
||||
} = this.props;
|
||||
const Component = border ? StyledIframe : 'iframe';
|
||||
const Component = border ? StyledIframe : "iframe";
|
||||
|
||||
return (
|
||||
<Rounded width={width} height={height}>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import Abstract from './Abstract';
|
||||
import Airtable from './Airtable';
|
||||
import Codepen from './Codepen';
|
||||
import Figma from './Figma';
|
||||
import Framer from './Framer';
|
||||
import Gist from './Gist';
|
||||
import GoogleDocs from './GoogleDocs';
|
||||
import GoogleSheets from './GoogleSheets';
|
||||
import GoogleSlides from './GoogleSlides';
|
||||
import InVision from './InVision';
|
||||
import Loom from './Loom';
|
||||
import Lucidchart from './Lucidchart';
|
||||
import Marvel from './Marvel';
|
||||
import Mindmeister from './Mindmeister';
|
||||
import Miro from './Miro';
|
||||
import ModeAnalytics from './ModeAnalytics';
|
||||
import Prezi from './Prezi';
|
||||
import Spotify from './Spotify';
|
||||
import Trello from './Trello';
|
||||
import Typeform from './Typeform';
|
||||
import Vimeo from './Vimeo';
|
||||
import YouTube from './YouTube';
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import Abstract from "./Abstract";
|
||||
import Airtable from "./Airtable";
|
||||
import Codepen from "./Codepen";
|
||||
import Figma from "./Figma";
|
||||
import Framer from "./Framer";
|
||||
import Gist from "./Gist";
|
||||
import GoogleDocs from "./GoogleDocs";
|
||||
import GoogleSheets from "./GoogleSheets";
|
||||
import GoogleSlides from "./GoogleSlides";
|
||||
import InVision from "./InVision";
|
||||
import Loom from "./Loom";
|
||||
import Lucidchart from "./Lucidchart";
|
||||
import Marvel from "./Marvel";
|
||||
import Mindmeister from "./Mindmeister";
|
||||
import Miro from "./Miro";
|
||||
import ModeAnalytics from "./ModeAnalytics";
|
||||
import Prezi from "./Prezi";
|
||||
import Spotify from "./Spotify";
|
||||
import Trello from "./Trello";
|
||||
import Typeform from "./Typeform";
|
||||
import Vimeo from "./Vimeo";
|
||||
import YouTube from "./YouTube";
|
||||
|
||||
function matcher(Component) {
|
||||
return (url: string) => {
|
||||
@@ -44,154 +44,154 @@ const Img = styled.img`
|
||||
|
||||
export default [
|
||||
{
|
||||
title: 'Abstract',
|
||||
keywords: 'design',
|
||||
title: "Abstract",
|
||||
keywords: "design",
|
||||
icon: () => <Img src="/images/abstract.png" />,
|
||||
component: Abstract,
|
||||
matcher: matcher(Abstract),
|
||||
},
|
||||
{
|
||||
title: 'Airtable',
|
||||
keywords: 'spreadsheet',
|
||||
title: "Airtable",
|
||||
keywords: "spreadsheet",
|
||||
icon: () => <Img src="/images/airtable.png" />,
|
||||
component: Airtable,
|
||||
matcher: matcher(Airtable),
|
||||
},
|
||||
{
|
||||
title: 'Codepen',
|
||||
keywords: 'code editor',
|
||||
title: "Codepen",
|
||||
keywords: "code editor",
|
||||
icon: () => <Img src="/images/codepen.png" />,
|
||||
component: Codepen,
|
||||
matcher: matcher(Codepen),
|
||||
},
|
||||
{
|
||||
title: 'Figma',
|
||||
keywords: 'design svg vector',
|
||||
title: "Figma",
|
||||
keywords: "design svg vector",
|
||||
icon: () => <Img src="/images/figma.png" />,
|
||||
component: Figma,
|
||||
matcher: matcher(Figma),
|
||||
},
|
||||
{
|
||||
title: 'Framer',
|
||||
keywords: 'design prototyping',
|
||||
title: "Framer",
|
||||
keywords: "design prototyping",
|
||||
icon: () => <Img src="/images/framer.png" />,
|
||||
component: Framer,
|
||||
matcher: matcher(Framer),
|
||||
},
|
||||
{
|
||||
title: 'GitHub Gist',
|
||||
keywords: 'code',
|
||||
title: "GitHub Gist",
|
||||
keywords: "code",
|
||||
icon: () => <Img src="/images/github-gist.png" />,
|
||||
component: Gist,
|
||||
matcher: matcher(Gist),
|
||||
},
|
||||
{
|
||||
title: 'Google Docs',
|
||||
title: "Google Docs",
|
||||
icon: () => <Img src="/images/google-docs.png" />,
|
||||
component: GoogleDocs,
|
||||
matcher: matcher(GoogleDocs),
|
||||
},
|
||||
{
|
||||
title: 'Google Sheets',
|
||||
keywords: 'excel spreadsheet',
|
||||
title: "Google Sheets",
|
||||
keywords: "excel spreadsheet",
|
||||
icon: () => <Img src="/images/google-sheets.png" />,
|
||||
component: GoogleSheets,
|
||||
matcher: matcher(GoogleSheets),
|
||||
},
|
||||
{
|
||||
title: 'Google Slides',
|
||||
keywords: 'presentation slideshow',
|
||||
title: "Google Slides",
|
||||
keywords: "presentation slideshow",
|
||||
icon: () => <Img src="/images/google-slides.png" />,
|
||||
component: GoogleSlides,
|
||||
matcher: matcher(GoogleSlides),
|
||||
},
|
||||
{
|
||||
title: 'InVision',
|
||||
keywords: 'design prototype',
|
||||
title: "InVision",
|
||||
keywords: "design prototype",
|
||||
icon: () => <Img src="/images/invision.png" />,
|
||||
component: InVision,
|
||||
matcher: matcher(InVision),
|
||||
},
|
||||
{
|
||||
title: 'Loom',
|
||||
keywords: 'video screencast',
|
||||
title: "Loom",
|
||||
keywords: "video screencast",
|
||||
icon: () => <Img src="/images/loom.png" />,
|
||||
component: Loom,
|
||||
matcher: matcher(Loom),
|
||||
},
|
||||
{
|
||||
title: 'Lucidchart',
|
||||
keywords: 'chart',
|
||||
title: "Lucidchart",
|
||||
keywords: "chart",
|
||||
icon: () => <Img src="/images/lucidchart.png" />,
|
||||
component: Lucidchart,
|
||||
matcher: matcher(Lucidchart),
|
||||
},
|
||||
{
|
||||
title: 'Marvel',
|
||||
keywords: 'design prototype',
|
||||
title: "Marvel",
|
||||
keywords: "design prototype",
|
||||
icon: () => <Img src="/images/marvel.png" />,
|
||||
component: Marvel,
|
||||
matcher: matcher(Marvel),
|
||||
},
|
||||
{
|
||||
title: 'Mindmeister',
|
||||
keywords: 'mindmap',
|
||||
title: "Mindmeister",
|
||||
keywords: "mindmap",
|
||||
icon: () => <Img src="/images/mindmeister.png" />,
|
||||
component: Mindmeister,
|
||||
matcher: matcher(Mindmeister),
|
||||
},
|
||||
{
|
||||
title: 'Miro',
|
||||
keywords: 'whiteboard',
|
||||
title: "Miro",
|
||||
keywords: "whiteboard",
|
||||
icon: () => <Img src="/images/miro.png" />,
|
||||
component: Miro,
|
||||
matcher: matcher(Miro),
|
||||
},
|
||||
{
|
||||
title: 'Mode',
|
||||
keywords: 'analytics',
|
||||
title: "Mode",
|
||||
keywords: "analytics",
|
||||
icon: () => <Img src="/images/mode-analytics.png" />,
|
||||
component: ModeAnalytics,
|
||||
matcher: matcher(ModeAnalytics),
|
||||
},
|
||||
{
|
||||
title: 'Prezi',
|
||||
keywords: 'presentation',
|
||||
title: "Prezi",
|
||||
keywords: "presentation",
|
||||
icon: () => <Img src="/images/prezi.png" />,
|
||||
component: Prezi,
|
||||
matcher: matcher(Prezi),
|
||||
},
|
||||
{
|
||||
title: 'Spotify',
|
||||
keywords: 'music',
|
||||
title: "Spotify",
|
||||
keywords: "music",
|
||||
icon: () => <Img src="/images/spotify.png" />,
|
||||
component: Spotify,
|
||||
matcher: matcher(Spotify),
|
||||
},
|
||||
{
|
||||
title: 'Trello',
|
||||
keywords: 'kanban',
|
||||
title: "Trello",
|
||||
keywords: "kanban",
|
||||
icon: () => <Img src="/images/trello.png" />,
|
||||
component: Trello,
|
||||
matcher: matcher(Trello),
|
||||
},
|
||||
{
|
||||
title: 'Typeform',
|
||||
keywords: 'form survey',
|
||||
title: "Typeform",
|
||||
keywords: "form survey",
|
||||
icon: () => <Img src="/images/typeform.png" />,
|
||||
component: Typeform,
|
||||
matcher: matcher(Typeform),
|
||||
},
|
||||
{
|
||||
title: 'Vimeo',
|
||||
keywords: 'video',
|
||||
title: "Vimeo",
|
||||
keywords: "video",
|
||||
icon: () => <Img src="/images/vimeo.png" />,
|
||||
component: Vimeo,
|
||||
matcher: matcher(Vimeo),
|
||||
},
|
||||
{
|
||||
title: 'YouTube',
|
||||
keywords: 'google video',
|
||||
title: "YouTube",
|
||||
keywords: "google video",
|
||||
icon: () => <Img src="/images/youtube.png" />,
|
||||
component: YouTube,
|
||||
matcher: matcher(YouTube),
|
||||
|
||||
Reference in New Issue
Block a user