mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
make fileId mandatory for image and export convertToExcalidrawElements
This commit is contained in:
parent
a6b389ca62
commit
756b924518
4 changed files with 6 additions and 3 deletions
|
@ -32,6 +32,7 @@ import {
|
|||
ExcalidrawLinearElement,
|
||||
ExcalidrawSelectionElement,
|
||||
ExcalidrawTextElement,
|
||||
FileId,
|
||||
FontFamilyValues,
|
||||
TextAlign,
|
||||
VerticalAlign,
|
||||
|
@ -154,6 +155,7 @@ export type ExcalidrawProgrammaticElement =
|
|||
type: Extract<ExcalidrawImageElement["type"], "image">;
|
||||
x: number;
|
||||
y: number;
|
||||
fileId: FileId;
|
||||
} & Partial<ExcalidrawImageElement>);
|
||||
|
||||
export interface ExcalidrawProgrammaticAPI {
|
||||
|
|
|
@ -31,7 +31,6 @@ import { ImportedLibraryData } from "../../../data/types";
|
|||
import CustomFooter from "./CustomFooter";
|
||||
import MobileFooter from "./MobileFooter";
|
||||
import { KEYS } from "../../../keys";
|
||||
import { convertToExcalidrawElements } from "../../../data/transform";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
@ -76,6 +75,7 @@ const {
|
|||
WelcomeScreen,
|
||||
MainMenu,
|
||||
LiveCollaborationTrigger,
|
||||
convertToExcalidrawElements,
|
||||
} = window.ExcalidrawLib;
|
||||
|
||||
const COMMENT_ICON_DIMENSION = 32;
|
||||
|
|
|
@ -32,8 +32,8 @@ const elements: ExcalidrawProgrammaticAPI["elements"] = [
|
|||
type: "image",
|
||||
x: 606.1042326312408,
|
||||
y: 153.57729779411773,
|
||||
width: 231.30325348751828,
|
||||
height: 231.64340533088227,
|
||||
width: 230,
|
||||
height: 230,
|
||||
fileId: "rocket" as FileId,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -249,3 +249,4 @@ export { LiveCollaborationTrigger };
|
|||
export { DefaultSidebar } from "../../components/DefaultSidebar";
|
||||
|
||||
export { normalizeLink } from "../../data/url";
|
||||
export { convertToExcalidrawElements } from "../../data/transform";
|
||||
|
|
Loading…
Add table
Reference in a new issue