feat: Add Valtown embed support

This commit is contained in:
Tom Moor
2023-09-04 20:47:52 -04:00
parent ce645b158b
commit 3223341062
3 changed files with 26 additions and 0 deletions

BIN
public/images/valtown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,19 @@
import * as React from "react";
import Frame from "../components/Frame";
import { EmbedProps as Props } from ".";
export default function Valtown(props: Props) {
const { matches } = props.attrs;
const valId = matches[1];
return (
<Frame
{...props}
src={`https://www.val.town/embed/${valId}`}
title="Valtown"
border
/>
);
}
Valtown.ENABLED = [/^https?:\/\/(?:www.)?val\.town\/(?:v|embed)\/(.*)$/];

View File

@@ -47,6 +47,7 @@ import Spotify from "./Spotify";
import Tldraw from "./Tldraw";
import Trello from "./Trello";
import Typeform from "./Typeform";
import Valtown from "./Valtown";
import Vimeo from "./Vimeo";
import Whimsical from "./Whimsical";
import YouTube from "./YouTube";
@@ -384,6 +385,12 @@ const embeds: EmbedDescriptor[] = [
icon: <Img src="/images/typeform.png" alt="Typeform" />,
component: Typeform,
}),
new EmbedDescriptor({
title: "Valtown",
keywords: "code",
icon: <Img src="/images/valtown.png" alt="Valtown" />,
component: Valtown,
}),
new EmbedDescriptor({
title: "Vimeo",
keywords: "video",