* Tldraw + Castopod

* Remove Castopor

* Remove files

* Update database.json

* Update database.json

* Updated tests + correctly escaped dots
This commit is contained in:
Limezy
2023-03-09 10:01:34 +07:00
committed by GitHub
parent 6ad76903b9
commit c039501035
3 changed files with 11 additions and 5 deletions

View File

@@ -3,7 +3,14 @@ import Tldraw from "./Tldraw";
describe("Tldraw", () => {
const match = Tldraw.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://beta.tldraw.com/r/v2_c_r5WVtGaktE99D3wyFFsoL".match(match)
).toBeTruthy();
});
test("to not be enabled elsewhere", () => {
expect("https://wwww.tldraw.com/r/c9d837d74182317".match(match)).toBe(null);
expect("https://wwwwtldraw.com/r/c9d837d74182317".match(match)).toBe(null);
expect("https://www.tldrawwcom/r/c9d837d74182317".match(match)).toBe(null);
});

View File

@@ -7,13 +7,13 @@ function Tldraw(props: Props) {
<Frame
{...props}
src={props.attrs.href}
title="Tldraw.com Embed"
title="Tldraw.com (beta) Embed"
referrerPolicy="origin"
border
/>
);
}
Tldraw.ENABLED = [new RegExp("https?://www\\.tldraw\\.com/r/(.*)$")];
Tldraw.ENABLED = [new RegExp("https?://beta\\.tldraw\\.com/r/(.*)")];
export default Tldraw;

View File

@@ -351,10 +351,9 @@ const embeds: EmbedDescriptor[] = [
component: Spotify,
}),
new EmbedDescriptor({
title: "Tldraw",
title: "Tldraw (beta)",
keywords: "draw schematics diagrams",
visible: false,
icon: <Img src="/images/tldraw.png" alt="Tldraw" />,
icon: <Img src="/images/tldraw.png" alt="Tldraw (beta)" />,
component: Tldraw,
}),
new EmbedDescriptor({