mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
update api to use label
This commit is contained in:
parent
e465a43f77
commit
bc5c58282f
2 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ export interface ImportedDataState {
|
||||||
elements?:
|
elements?:
|
||||||
| readonly (
|
| readonly (
|
||||||
| (ExcalidrawElement & {
|
| (ExcalidrawElement & {
|
||||||
children?: [
|
label?: [
|
||||||
{ text: string } & MarkOptional<
|
{ text: string } & MarkOptional<
|
||||||
ElementConstructorOpts,
|
ElementConstructorOpts,
|
||||||
"x" | "y"
|
"x" | "y"
|
||||||
|
@ -49,7 +49,7 @@ export interface ImportedDataState {
|
||||||
})
|
})
|
||||||
| {
|
| {
|
||||||
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
|
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
|
||||||
children?: [
|
label?: [
|
||||||
{ text: string } & MarkOptional<
|
{ text: string } & MarkOptional<
|
||||||
ElementConstructorOpts,
|
ElementConstructorOpts,
|
||||||
"x" | "y"
|
"x" | "y"
|
||||||
|
|
|
@ -659,7 +659,7 @@ export const convertToExcalidrawElements = (
|
||||||
if (!element) {
|
if (!element) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const textElement = element.children?.find((child) => child.text !== null);
|
const textElement = element.label?.find((child) => child.text !== null);
|
||||||
if (
|
if (
|
||||||
isValidTextContainer(element) &&
|
isValidTextContainer(element) &&
|
||||||
textElement &&
|
textElement &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue