tldraw
Version:
A tiny little drawing editor.
20 lines (19 loc) • 678 B
JavaScript
function pasteTldrawContent(editor, clipboard, point) {
const selectionBoundsBefore = editor.getSelectionPageBounds();
editor.markHistoryStoppingPoint("paste");
editor.putContentOntoCurrentPage(clipboard, {
point,
select: true
});
const selectedBoundsAfter = editor.getSelectionPageBounds();
if (selectionBoundsBefore && selectedBoundsAfter && selectionBoundsBefore?.collides(selectedBoundsAfter)) {
editor.updateInstanceState({ isChangingStyle: true });
editor.timers.setTimeout(() => {
editor.updateInstanceState({ isChangingStyle: false });
}, 150);
}
}
export {
pasteTldrawContent
};
//# sourceMappingURL=pasteTldrawContent.mjs.map