mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
udpdate api
This commit is contained in:
parent
8aed24312f
commit
eb415c1851
1 changed files with 5 additions and 5 deletions
|
@ -266,7 +266,7 @@ const bindLinearElementToElement = (
|
||||||
let existingElement;
|
let existingElement;
|
||||||
if (start.id) {
|
if (start.id) {
|
||||||
existingElement = elementStore
|
existingElement = elementStore
|
||||||
.get()
|
.getElements()
|
||||||
.find((ele) => ele?.id === start.id) as Exclude<
|
.find((ele) => ele?.id === start.id) as Exclude<
|
||||||
ExcalidrawBindableElement,
|
ExcalidrawBindableElement,
|
||||||
ExcalidrawImageElement | ExcalidrawFrameElement
|
ExcalidrawImageElement | ExcalidrawFrameElement
|
||||||
|
@ -333,7 +333,7 @@ const bindLinearElementToElement = (
|
||||||
let existingElement;
|
let existingElement;
|
||||||
if (end.id) {
|
if (end.id) {
|
||||||
existingElement = elementStore
|
existingElement = elementStore
|
||||||
.get()
|
.getElements()
|
||||||
.find((ele) => ele?.id === end.id) as Exclude<
|
.find((ele) => ele?.id === end.id) as Exclude<
|
||||||
ExcalidrawBindableElement,
|
ExcalidrawBindableElement,
|
||||||
ExcalidrawImageElement | ExcalidrawFrameElement
|
ExcalidrawImageElement | ExcalidrawFrameElement
|
||||||
|
@ -416,7 +416,7 @@ class ElementStore {
|
||||||
this.elementMap.set(ele.id, index);
|
this.elementMap.set(ele.id, index);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
get = () => {
|
getElements = () => {
|
||||||
return this.res;
|
return this.res;
|
||||||
};
|
};
|
||||||
hasElementWithId = (id: string) => {
|
hasElementWithId = (id: string) => {
|
||||||
|
@ -448,7 +448,7 @@ export const convertToExcalidrawElements = (
|
||||||
});
|
});
|
||||||
|
|
||||||
const pushedElements =
|
const pushedElements =
|
||||||
elementStore.get() as readonly ExcalidrawProgrammaticElement[];
|
elementStore.getElements() as readonly ExcalidrawProgrammaticElement[];
|
||||||
pushedElements.forEach((element) => {
|
pushedElements.forEach((element) => {
|
||||||
const elementWithId = { ...element };
|
const elementWithId = { ...element };
|
||||||
|
|
||||||
|
@ -550,5 +550,5 @@ export const convertToExcalidrawElements = (
|
||||||
elementStore.add(element);
|
elementStore.add(element);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return elementStore.get();
|
return elementStore.getElements();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue