@@ -5,7 +5,7 @@ import React from 'react'
5
5
import { createRoot , Root } from ' react-dom/client'
6
6
import { watch , watchEffect } from ' vue'
7
7
import type { ExcalidrawImperativeAPI , State } from ' ./excalidraw'
8
- import { Excalidraw , exportToBlob , exportToSvg , hashElementsVersion , loadFromBlob , serializeAsJSON } from ' ./excalidraw'
8
+ import { Excalidraw , exportToBlob , exportToSvg , hashElementsVersion , loadFromBlob , MainMenu , serializeAsJSON } from ' ./excalidraw'
9
9
import { useVueRef } from ' ./react'
10
10
11
11
const { file } = defineProps <{
@@ -86,32 +86,30 @@ const isLightTheme = commas.remote.useIsLightTheme()
86
86
87
87
const ExcalidrawApp = () => {
88
88
const isLight = useVueRef (isLightTheme )
89
- return React .createElement (Excalidraw , {
90
- initialData: state ,
91
- excalidrawAPI : api => {
92
- excalidraw = api
93
- },
94
- onChange : (elements , appState , files ) => {
95
- state = {
96
- elements ,
97
- appState: { ... appState , exportEmbedScene: true },
98
- files ,
99
- }
100
- },
101
- UIOptions: {
102
- canvasActions: {
103
- changeViewBackgroundColor: false ,
104
- export: false ,
105
- loadScene: false ,
106
- saveToActiveFile: false ,
107
- toggleTheme: false ,
108
- saveAsImage: false ,
89
+ return React .createElement (
90
+ Excalidraw ,
91
+ {
92
+ initialData: state ,
93
+ excalidrawAPI : api => {
94
+ excalidraw = api
95
+ },
96
+ onChange : (elements , appState , files ) => {
97
+ state = {
98
+ elements ,
99
+ appState: { ... appState , exportEmbedScene: true },
100
+ files ,
101
+ }
109
102
},
103
+ langCode: navigator .language ,
104
+ name: file ,
105
+ theme: isLight ? ' light' : ' dark' ,
110
106
},
111
- langCode: navigator .language ,
112
- name: file ,
113
- theme: isLight ? ' light' : ' dark' ,
114
- })
107
+ React .createElement (
108
+ MainMenu ,
109
+ null ,
110
+ React .createElement (MainMenu .DefaultItems .ClearCanvas ),
111
+ ),
112
+ )
115
113
}
116
114
117
115
watchEffect (() => {
0 commit comments