kopia lustrzana https://github.com/Tldraw/Tldraw
23 wiersze
506 B
TypeScript
23 wiersze
506 B
TypeScript
import { Tldraw } from '@tldraw/tldraw'
|
|
import '@tldraw/tldraw/editor.css'
|
|
import '@tldraw/tldraw/ui.css'
|
|
|
|
export default function EndToEnd() {
|
|
;(window as any).__tldraw_editor_events = []
|
|
return (
|
|
<div className="tldraw__editor">
|
|
<Tldraw
|
|
autoFocus
|
|
onUiEvent={(name, data) => {
|
|
;(window as any).__tldraw_ui_event = { name, data }
|
|
}}
|
|
onMount={(app) => {
|
|
app.on('event', (info) => {
|
|
;(window as any).__tldraw_editor_events.push(info)
|
|
})
|
|
}}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|