mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	refactor(canvas): use tsx where appropriate
This commit is contained in:
		| @@ -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> | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
		Reference in New Issue
	
	Block a user