mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support frames via programmatic API (#7205)
* update frame id post generation * support frames via programmatic API * fix types * add test for frames * throw error when element doesn't exist * naming tweaks * update the api to use children * consider max of frame dimensions and calculated bounds of elements * consider bound elements in frame api
This commit is contained in:
parent
9b8de8a12e
commit
f5c91c3a0f
5 changed files with 1398 additions and 187 deletions
|
@ -7,6 +7,7 @@ const elements: ExcalidrawElementSkeleton[] = [
|
|||
x: 10,
|
||||
y: 10,
|
||||
strokeWidth: 2,
|
||||
id: "1",
|
||||
},
|
||||
{
|
||||
type: "diamond",
|
||||
|
@ -19,6 +20,7 @@ const elements: ExcalidrawElementSkeleton[] = [
|
|||
strokeColor: "#099268",
|
||||
fontSize: 30,
|
||||
},
|
||||
id: "2",
|
||||
},
|
||||
{
|
||||
type: "arrow",
|
||||
|
@ -36,6 +38,11 @@ const elements: ExcalidrawElementSkeleton[] = [
|
|||
height: 230,
|
||||
fileId: "rocket" as FileId,
|
||||
},
|
||||
{
|
||||
type: "frame",
|
||||
children: ["1", "2"],
|
||||
name: "My frame",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
elements,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue