diff --git a/packages/editor/api-report.md b/packages/editor/api-report.md index c63729310..28ec3a425 100644 --- a/packages/editor/api-report.md +++ b/packages/editor/api-report.md @@ -14,7 +14,7 @@ import { Computed } from '@tldraw/state'; import { computed } from '@tldraw/state'; import { EmbedDefinition } from '@tldraw/tlschema'; import { EMPTY_ARRAY } from '@tldraw/state'; -import { EventEmitter } from 'eventemitter3'; +import EventEmitter from 'eventemitter3'; import { Expand } from '@tldraw/utils'; import { HistoryEntry } from '@tldraw/store'; import { IndexKey } from '@tldraw/utils'; diff --git a/packages/editor/src/lib/editor/Editor.ts b/packages/editor/src/lib/editor/Editor.ts index cf3f8a750..7d9092173 100644 --- a/packages/editor/src/lib/editor/Editor.ts +++ b/packages/editor/src/lib/editor/Editor.ts @@ -72,7 +72,7 @@ import { sortByIndex, structuredClone, } from '@tldraw/utils' -import { EventEmitter } from 'eventemitter3' +import EventEmitter from 'eventemitter3' import { flushSync } from 'react-dom' import { createRoot } from 'react-dom/client' import { TLUser, createTLUser } from '../config/createTLUser' diff --git a/packages/tldraw/src/lib/ui/hooks/useClipboardEvents.ts b/packages/tldraw/src/lib/ui/hooks/useClipboardEvents.ts index 16c06b07a..a3ea39249 100644 --- a/packages/tldraw/src/lib/ui/hooks/useClipboardEvents.ts +++ b/packages/tldraw/src/lib/ui/hooks/useClipboardEvents.ts @@ -15,7 +15,7 @@ import { useEditor, useValue, } from '@tldraw/editor' -import { compressToBase64, decompressFromBase64 } from 'lz-string' +import lz from 'lz-string' import { useCallback, useEffect } from 'react' import { TLUiEventSource, useUiEvents } from '../context/events' import { pasteExcalidrawContent } from './clipboard/pasteExcalidrawContent' @@ -328,7 +328,7 @@ async function handleClipboardThings(editor: Editor, things: ClipboardThing[], p if (tldrawHtmlComment) { try { // If we've found tldraw content in the html string, use that as JSON - const jsonComment = decompressFromBase64(tldrawHtmlComment) + const jsonComment = lz.decompressFromBase64(tldrawHtmlComment) if (jsonComment === null) { r({ type: 'error', @@ -491,7 +491,7 @@ const handleNativeOrMenuCopy = (editor: Editor) => { return } - const stringifiedClipboard = compressToBase64( + const stringifiedClipboard = lz.compressToBase64( JSON.stringify({ type: 'application/tldraw', kind: 'content',