Skip to content

Commit

Permalink
Fix imports in Astro (#3742)
Browse files Browse the repository at this point in the history
This PR changes our imports so that they work in a few rare cases.
#1817

### Change Type
- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix

### Release Notes

- Fix bug effecting imports in Astro.
  • Loading branch information
steveruizok committed May 12, 2024
1 parent da415d9 commit 142c270
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/editor/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/lib/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions packages/tldraw/src/lib/ui/hooks/useClipboardEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -491,7 +491,7 @@ const handleNativeOrMenuCopy = (editor: Editor) => {
return
}

const stringifiedClipboard = compressToBase64(
const stringifiedClipboard = lz.compressToBase64(
JSON.stringify({
type: 'application/tldraw',
kind: 'content',
Expand Down

0 comments on commit 142c270

Please sign in to comment.