feat: support creating text containers programatically

This commit is contained in:
Aakansha Doshi 2023-05-02 22:10:04 +05:30
parent 2a39d0b9a7
commit 15b5295baf
6 changed files with 105 additions and 13 deletions

View file

@ -344,7 +344,23 @@ const ExcalidrawWrapper = () => {
initializeScene({ collabAPI, excalidrawAPI }).then(async (data) => {
loadImages(data, /* isInitialLoad */ true);
initialStatePromiseRef.current.promise.resolve(data.scene);
initialStatePromiseRef.current.promise.resolve({
type: "excalidraw",
version: 2,
source: "http://localhost:3000",
elements: [
//@ts-ignore
{
type: "rectangle",
children: [{ text: "HELLO DAMMMMY" }],
},
],
appState: {
gridSize: null,
viewBackgroundColor: "#ffffff",
},
files: {},
});
});
const onHashChange = async (event: HashChangeEvent) => {