mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support creating text containers programatically
This commit is contained in:
parent
2a39d0b9a7
commit
15b5295baf
6 changed files with 105 additions and 13 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue