feat: excalidraw integration (#214)

* update tiptap version

* excalidraw init

* cleanup

* better file handling and other fixes

* use different modal to fix excalidraw cursor position issue
* see https://github.com/excalidraw/excalidraw/issues/7312
* fix websocket in vite dev mode

* WIP

* add align attribute

* fix table

* menu icons

* Render image in excalidraw html
* add size to custom SVG components

* rewrite undefined font urls
This commit is contained in:
Philip Okugbe
2024-08-31 19:11:07 +01:00
committed by GitHub
parent 77b541ec71
commit 38e9eef2dc
26 changed files with 1440 additions and 799 deletions

View File

@ -33,6 +33,7 @@ import {
Selection,
Attachment,
CustomCodeBlock,
Excalidraw,
} from "@docmost/editor-ext";
import {
randomElement,
@ -49,6 +50,7 @@ import { common, createLowlight } from "lowlight";
import VideoView from "@/features/editor/components/video/video-view.tsx";
import AttachmentView from "@/features/editor/components/attachment/attachment-view.tsx";
import CodeBlockView from "@/features/editor/components/code-block/code-block-view.tsx";
import ExcalidrawView from "@/features/editor/components/excalidraw/excalidraw-view.tsx";
import plaintext from "highlight.js/lib/languages/plaintext";
const lowlight = createLowlight(common);
@ -81,6 +83,7 @@ export const mainExtensions = [
}
},
includeChildren: true,
showOnlyWhenEditable: true,
}),
TextAlign.configure({ types: ["heading", "paragraph"] }),
TaskList,
@ -151,6 +154,9 @@ export const mainExtensions = [
Attachment.configure({
view: AttachmentView,
}),
Excalidraw.configure({
view: ExcalidrawView,
}),
] as any;
type CollabExtensions = (provider: HocuspocusProvider, user: IUser) => any[];