mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix
This commit is contained in:
parent
756b924518
commit
eae7ba28e3
2 changed files with 8 additions and 4 deletions
|
@ -11,6 +11,7 @@ import { deepCopyElement } from "./element/newElement";
|
||||||
import { mutateElement } from "./element/mutateElement";
|
import { mutateElement } from "./element/mutateElement";
|
||||||
import { getContainingFrame } from "./frame";
|
import { getContainingFrame } from "./frame";
|
||||||
import { isPromiseLike, isTestEnv } from "./utils";
|
import { isPromiseLike, isTestEnv } from "./utils";
|
||||||
|
import { ExcalidrawProgrammaticElement } from "./data/transform";
|
||||||
|
|
||||||
type ElementsClipboard = {
|
type ElementsClipboard = {
|
||||||
type: typeof EXPORT_DATA_TYPES.excalidrawClipboard;
|
type: typeof EXPORT_DATA_TYPES.excalidrawClipboard;
|
||||||
|
@ -20,7 +21,7 @@ type ElementsClipboard = {
|
||||||
|
|
||||||
export interface ClipboardData {
|
export interface ClipboardData {
|
||||||
spreadsheet?: Spreadsheet;
|
spreadsheet?: Spreadsheet;
|
||||||
elements?: readonly ExcalidrawElement[];
|
elements?: readonly (ExcalidrawElement | ExcalidrawProgrammaticElement)[];
|
||||||
files?: BinaryFiles;
|
files?: BinaryFiles;
|
||||||
text?: string;
|
text?: string;
|
||||||
errorMessage?: string;
|
errorMessage?: string;
|
||||||
|
|
|
@ -1928,9 +1928,12 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (data.elements) {
|
} else if (data.elements) {
|
||||||
const elements = data.programmaticAPI
|
const elements = (
|
||||||
? convertToExcalidrawElements(data.elements)
|
data.programmaticAPI
|
||||||
: data.elements;
|
? //@ts-ignore
|
||||||
|
convertToExcalidrawElements(data.elements)
|
||||||
|
: data.elements
|
||||||
|
) as readonly ExcalidrawElement[];
|
||||||
// TODO remove formatting from elements if isPlainPaste
|
// TODO remove formatting from elements if isPlainPaste
|
||||||
this.addElementsFromPasteOrLibrary({
|
this.addElementsFromPasteOrLibrary({
|
||||||
elements,
|
elements,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue