feat: Add Valtown embed support
This commit is contained in:
BIN
public/images/valtown.png
Normal file
BIN
public/images/valtown.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
19
shared/editor/embeds/Valtown.tsx
Normal file
19
shared/editor/embeds/Valtown.tsx
Normal 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)\/(.*)$/];
|
||||||
@@ -47,6 +47,7 @@ import Spotify from "./Spotify";
|
|||||||
import Tldraw from "./Tldraw";
|
import Tldraw from "./Tldraw";
|
||||||
import Trello from "./Trello";
|
import Trello from "./Trello";
|
||||||
import Typeform from "./Typeform";
|
import Typeform from "./Typeform";
|
||||||
|
import Valtown from "./Valtown";
|
||||||
import Vimeo from "./Vimeo";
|
import Vimeo from "./Vimeo";
|
||||||
import Whimsical from "./Whimsical";
|
import Whimsical from "./Whimsical";
|
||||||
import YouTube from "./YouTube";
|
import YouTube from "./YouTube";
|
||||||
@@ -384,6 +385,12 @@ const embeds: EmbedDescriptor[] = [
|
|||||||
icon: <Img src="/images/typeform.png" alt="Typeform" />,
|
icon: <Img src="/images/typeform.png" alt="Typeform" />,
|
||||||
component: Typeform,
|
component: Typeform,
|
||||||
}),
|
}),
|
||||||
|
new EmbedDescriptor({
|
||||||
|
title: "Valtown",
|
||||||
|
keywords: "code",
|
||||||
|
icon: <Img src="/images/valtown.png" alt="Valtown" />,
|
||||||
|
component: Valtown,
|
||||||
|
}),
|
||||||
new EmbedDescriptor({
|
new EmbedDescriptor({
|
||||||
title: "Vimeo",
|
title: "Vimeo",
|
||||||
keywords: "video",
|
keywords: "video",
|
||||||
|
|||||||
Reference in New Issue
Block a user