5cd74f4bd6
This PR adds the source items from a paste event to the data shared with external content handlers. This allows developers to customize the way certain content is handled. For example, pasting text sometimes incudes additional clipboard items, such as the HTML representation of that text. We wouldn't want to create two shapes—one for the text and one for the HTML—so we still treat this as a single text paste. The `registerExternalContentHandler` API allows a developer to change how that text is handled, and the new `sources` API will now allow the developer to take into consideration all of the items that were on the clipboard. ![Kapture 2023-09-19 at 12 25 52](https://github.com/tldraw/tldraw/assets/23072548/fa976320-cfec-4921-b481-10cae0d4043e) ### Change Type - [x] `minor` — New feature ### Test Plan 1. Try the external content source example. 2. Paste text that includes HTML (e.g. from VS Code) ### Release Notes - [editor / tldraw] add `sources` to `TLExternalContent` |
||
---|---|---|
.. | ||
examples | ||
vscode |