import { NonDeletedExcalidrawElement } from "@zsviczian/excalidraw/types/excalidraw/element/types"; import ExcalidrawView from "./ExcalidrawView"; import { Notice, WorkspaceLeaf, WorkspaceSplit } from "obsidian"; import * as React from "react"; import { ConstructableWorkspaceSplit, getContainerForDocument, isObsidianThemeDark } from "./utils/ObsidianUtils"; import { DEVICE, EXTENDED_EVENT_TYPES, KEYBOARD_EVENT_TYPES } from "./constants/constants"; import { ExcalidrawImperativeAPI, UIAppState } from "@zsviczian/excalidraw/types/excalidraw/types"; import { ObsidianCanvasNode } from "./utils/CanvasNodeFactory"; import { processLinkText, patchMobileView } from "./utils/CustomEmbeddableUtils"; import { EmbeddableMDCustomProps } from "./dialogs/EmbeddableSettings"; declare module "obsidian" { interface Workspace { floatingSplit: any; } interface WorkspaceSplit { containerEl: HTMLDivElement; } } function getTheme (view: ExcalidrawView, theme:string): string { return view.excalidrawData.embeddableTheme === "dark" ? "theme-dark" : view.excalidrawData.embeddableTheme === "light" ? "theme-light" : view.excalidrawData.embeddableTheme === "auto" ? theme === "dark" ? "theme-dark" : "theme-light" : isObsidianThemeDark() ? "theme-dark" : "theme-light"; } //-------------------------------------------------------------------------------- //Render webview for anything other than Vimeo and Youtube //Vimeo and Youtube are rendered by Excalidraw because of the window messaging //required to control the video //-------------------------------------------------------------------------------- export function renderWebView (src: string, view: ExcalidrawView, id: string, _: UIAppState):JSX.Element { const isDataURL = src.startsWith("data:"); if(DEVICE.isDesktop && !isDataURL) { return ( view.updateEmbeddableRef(id, ref)} className="excalidraw__embeddable" title="Excalidraw Embedded Content" allowFullScreen={true} src={src} style={{ overflow: "hidden", borderRadius: "var(--embeddable-radius)", }} /> ); } return (