Tldraw (#4968)
* Tldraw + Castopod * Remove Castopor * Remove files * Update database.json * Update database.json * Updated tests + correctly escaped dots
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user