mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 15:49:00 +02:00
refactor(canvas): use tsx where appropriate
This commit is contained in:
parent
d8d0a64134
commit
1b25b18d9e
@ -1,8 +1,7 @@
|
|||||||
import "@excalidraw/excalidraw/index.css";
|
import "@excalidraw/excalidraw/index.css";
|
||||||
import { Excalidraw, getSceneVersion, exportToSvg } from "@excalidraw/excalidraw";
|
import { Excalidraw, getSceneVersion, exportToSvg } from "@excalidraw/excalidraw";
|
||||||
import { createElement, render, unmountComponentAtNode } from "preact/compat";
|
import { render, unmountComponentAtNode } from "preact/compat";
|
||||||
import { AppState, BinaryFileData, ExcalidrawImperativeAPI, ExcalidrawProps, LibraryItem } from "@excalidraw/excalidraw/types";
|
import { AppState, BinaryFileData, ExcalidrawImperativeAPI, ExcalidrawProps, LibraryItem } from "@excalidraw/excalidraw/types";
|
||||||
import type { ComponentType } from "preact";
|
|
||||||
import { ExcalidrawElement, NonDeletedExcalidrawElement, Theme } from "@excalidraw/excalidraw/element/types";
|
import { ExcalidrawElement, NonDeletedExcalidrawElement, Theme } from "@excalidraw/excalidraw/element/types";
|
||||||
|
|
||||||
export interface CanvasContent {
|
export interface CanvasContent {
|
||||||
@ -45,8 +44,10 @@ export default class Canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createCanvasElement(opts: ExcalidrawProps) {
|
private createCanvasElement(opts: ExcalidrawProps) {
|
||||||
return createElement("div", { className: "excalidraw-wrapper", },
|
return (
|
||||||
createElement(Excalidraw as ComponentType<ExcalidrawProps>, opts)
|
<div className="excalidraw-wrapper">
|
||||||
|
<Excalidraw {...opts} />
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user