feat: Add DBdiagram (dbdiagram.io) embed (#3124)
* Add dbdiagram embed * clean variable name
This commit is contained in:
committed by
GitHub
parent
7e216109dc
commit
3760a03c44
BIN
public/images/dbdiagram.png
Normal file
BIN
public/images/dbdiagram.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
22
shared/editor/embeds/DBDiagram.tsx
Normal file
22
shared/editor/embeds/DBDiagram.tsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import * as React from "react";
|
||||||
|
import Frame from "./components/Frame";
|
||||||
|
import { EmbedProps as Props } from ".";
|
||||||
|
|
||||||
|
export default class DBDiagram extends React.Component<Props> {
|
||||||
|
static ENABLED = [new RegExp("https://dbdiagram.io/(embed|d)/(\\w+)$")];
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { matches } = this.props.attrs;
|
||||||
|
const shareId = matches[2];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Frame
|
||||||
|
{...this.props}
|
||||||
|
src={`https://dbdiagram.io/embed/${shareId}`}
|
||||||
|
title={`DBDiagram (${shareId})`}
|
||||||
|
width="100%"
|
||||||
|
height="400px"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import Bilibili from "./Bilibili";
|
|||||||
import Cawemo from "./Cawemo";
|
import Cawemo from "./Cawemo";
|
||||||
import ClickUp from "./ClickUp";
|
import ClickUp from "./ClickUp";
|
||||||
import Codepen from "./Codepen";
|
import Codepen from "./Codepen";
|
||||||
|
import DBDiagram from "./DBDiagram";
|
||||||
import Descript from "./Descript";
|
import Descript from "./Descript";
|
||||||
import Diagrams from "./Diagrams";
|
import Diagrams from "./Diagrams";
|
||||||
import Figma from "./Figma";
|
import Figma from "./Figma";
|
||||||
@@ -115,6 +116,13 @@ const embeds: EmbedDescriptor[] = [
|
|||||||
component: Codepen,
|
component: Codepen,
|
||||||
matcher: matcher(Codepen),
|
matcher: matcher(Codepen),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "DBDiagram",
|
||||||
|
keywords: "diagrams database",
|
||||||
|
icon: () => <Img src="/images/dbdiagram.png" alt="DBDiagram" />,
|
||||||
|
component: DBDiagram,
|
||||||
|
matcher: matcher(DBDiagram),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Descript",
|
title: "Descript",
|
||||||
keywords: "audio",
|
keywords: "audio",
|
||||||
|
|||||||
Reference in New Issue
Block a user