feat: third-party embeds (#423)

* wip

* Add more providers

* icons

* unify embed providers (Youtube)

* fix case

* YT music

* remove redundant code
This commit is contained in:
Philip Okugbe
2024-10-29 18:13:20 +00:00
committed by GitHub
parent 978fadd6b9
commit ab70cee278
21 changed files with 667 additions and 41 deletions

View File

@ -35,6 +35,7 @@ import {
CustomCodeBlock,
Drawio,
Excalidraw,
Embed
} from "@docmost/editor-ext";
import {
randomElement,
@ -53,6 +54,7 @@ import AttachmentView from "@/features/editor/components/attachment/attachment-v
import CodeBlockView from "@/features/editor/components/code-block/code-block-view.tsx";
import DrawioView from "../components/drawio/drawio-view";
import ExcalidrawView from "@/features/editor/components/excalidraw/excalidraw-view.tsx";
import EmbedView from "@/features/editor/components/embed/embed-view.tsx";
import plaintext from "highlight.js/lib/languages/plaintext";
import powershell from "highlight.js/lib/languages/powershell";
import elixir from "highlight.js/lib/languages/elixir";
@ -149,6 +151,7 @@ export const mainExtensions = [
DetailsSummary,
DetailsContent,
Youtube.configure({
addPasteHandler: false,
controls: true,
nocookie: true,
}),
@ -179,6 +182,9 @@ export const mainExtensions = [
Excalidraw.configure({
view: ExcalidrawView,
}),
Embed.configure({
view: EmbedView,
})
] as any;
type CollabExtensions = (provider: HocuspocusProvider, user: IUser) => any[];