Skip to content

Commit d259549

Browse files
committed
fix(paint): clean ui
1 parent 2e599dd commit d259549

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

addons/paint/src/renderer/ExcalidrawBoard.vue

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React from 'react'
55
import { createRoot, Root } from 'react-dom/client'
66
import { watch, watchEffect } from 'vue'
77
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'
99
import { useVueRef } from './react'
1010
1111
const { file } = defineProps<{
@@ -86,32 +86,30 @@ const isLightTheme = commas.remote.useIsLightTheme()
8686
8787
const ExcalidrawApp = () => {
8888
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+
}
109102
},
103+
langCode: navigator.language,
104+
name: file,
105+
theme: isLight ? 'light' : 'dark',
110106
},
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+
)
115113
}
116114
117115
watchEffect(() => {

0 commit comments

Comments
 (0)