diff --git a/packages/tldraw/src/state/TldrawApp.ts b/packages/tldraw/src/state/TldrawApp.ts index fb873104e..63da32c00 100644 --- a/packages/tldraw/src/state/TldrawApp.ts +++ b/packages/tldraw/src/state/TldrawApp.ts @@ -1451,7 +1451,9 @@ export class TldrawApp extends StateManager { * @returns A string containing the JSON. */ copySvg = (ids = this.selectedIds, pageId = this.currentPageId) => { - if (ids.length === 0) return + if (ids.length === 0) ids = Object.keys(this.page.shapes) + + console.log(ids) const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg') @@ -1542,6 +1544,7 @@ export class TldrawApp extends StateManager { * @returns A string containing the JSON. */ copyJson = (ids = this.selectedIds, pageId = this.currentPageId) => { + if (ids.length === 0) ids = Object.keys(this.page.shapes) const shapes = ids.map((id) => this.getShape(id, pageId)) const json = JSON.stringify(shapes, null, 2) TLDR.copyStringToClipboard(json)