diff --git a/app/embeds/Cawemo.js b/app/embeds/Cawemo.js new file mode 100644 index 00000000..1039be85 --- /dev/null +++ b/app/embeds/Cawemo.js @@ -0,0 +1,31 @@ +// @flow +import * as React from "react"; +import Frame from "./components/Frame"; + +const URL_REGEX = new RegExp("https?://cawemo.com/(?:share|embed)/(.*)$"); + +type Props = {| + attrs: {| + href: string, + matches: string[], + |}, +|}; + +export default class Cawemo extends React.Component { + static ENABLED = [URL_REGEX]; + + render() { + const { matches } = this.props.attrs; + const shareId = matches[1]; + + return ( + + ); + } +} diff --git a/app/embeds/Cawemo.test.js b/app/embeds/Cawemo.test.js new file mode 100644 index 00000000..f7c91d8c --- /dev/null +++ b/app/embeds/Cawemo.test.js @@ -0,0 +1,22 @@ +/* eslint-disable flowtype/require-valid-file-annotation */ +import Cawemo from "./Cawemo"; + +describe("Cawemo", () => { + const match = Cawemo.ENABLED[0]; + test("to be enabled on embed link", () => { + expect( + "https://cawemo.com/embed/a82e9f22-e283-4253-8d11".match(match) + ).toBeTruthy(); + }); + + test("to be enabled on share link", () => { + expect( + "https://cawemo.com/embed/a82e9f22-e283-4253-8d11".match(match) + ).toBeTruthy(); + }); + + test("to not be enabled elsewhere", () => { + expect("https://cawemo.com/".match(match)).toBe(null); + expect("https://cawemo.com/diagrams".match(match)).toBe(null); + }); +}); diff --git a/app/embeds/index.js b/app/embeds/index.js index 1e389a53..2cdf20a1 100644 --- a/app/embeds/index.js +++ b/app/embeds/index.js @@ -4,6 +4,7 @@ import styled from "styled-components"; import Image from "components/Image"; import Abstract from "./Abstract"; import Airtable from "./Airtable"; +import Cawemo from "./Cawemo"; import ClickUp from "./ClickUp"; import Codepen from "./Codepen"; import Figma from "./Figma"; @@ -61,6 +62,13 @@ export default [ component: Airtable, matcher: matcher(Airtable), }, + { + title: "Cawemo", + keywords: "bpmn process", + icon: () => , + component: Cawemo, + matcher: matcher(Cawemo), + }, { title: "ClickUp", keywords: "project", diff --git a/public/images/cawemo.png b/public/images/cawemo.png new file mode 100644 index 00000000..20517c96 Binary files /dev/null and b/public/images/cawemo.png differ