diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx index 932743ddfd..59a103c19e 100644 --- a/excalidraw-app/App.tsx +++ b/excalidraw-app/App.tsx @@ -4,6 +4,7 @@ import { TTDDialogTrigger, CaptureUpdateAction, reconcileElements, + convertToExcalidrawElements, } from "@excalidraw/excalidraw"; import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { getDefaultAppState } from "@excalidraw/excalidraw/appState"; @@ -471,6 +472,276 @@ const ExcalidrawWrapper = () => { initializeScene({ collabAPI, excalidrawAPI }).then(async (data) => { loadImages(data, /* isInitialLoad */ true); + if (data.scene) { + data.scene.elements = data.scene.elements?.length + ? data.scene.elements + : convertToExcalidrawElements([ + { + id: "MyWwgGwbjyZoxKSa2pfBI", + type: "rectangle", + x: 43.5, + y: 52.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#ff8787", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 246249428, + version: 427, + versionNonce: 2079096276, + boundElements: [], + link: null, + locked: false, + }, + { + id: "ABor4pClpJJs6adQb4iqs", + type: "rectangle", + x: 357.5, + y: 481.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#b2f2bb", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 1800887636, + version: 445, + versionNonce: 650486612, + boundElements: [], + link: null, + locked: false, + }, + { + id: "-FGknlZxdFGYZNoUr2lG5", + type: "rectangle", + x: 1280.5, + y: 47.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#69db7c", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 883462868, + version: 532, + versionNonce: 912136404, + boundElements: [], + link: null, + locked: false, + }, + { + id: "XQ3bRtQnS_ydtq13c_p99", + type: "rectangle", + x: 863.5, + y: 334.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#a5d8ff", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 2033653844, + version: 459, + versionNonce: 1984683604, + boundElements: [], + link: null, + locked: false, + }, + { + id: "GmC3zgvVq3xUd2Qn0cNX3", + type: "rectangle", + x: 897.5, + y: 697.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#ffec99", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 81325524, + version: 488, + versionNonce: 1332016084, + boundElements: [], + link: null, + locked: false, + }, + { + id: "8nvmvwbmFmNAcLAmwZryR", + type: "rectangle", + x: 456.5, + y: 229.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#eebefa", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 950276948, + version: 649, + versionNonce: 532633940, + boundElements: [], + link: null, + locked: false, + }, + { + id: "7dyXEvhPDLA0-e3XCaM2H", + type: "rectangle", + x: 1446.5, + y: 609.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#d0bfff", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 1659799764, + version: 570, + versionNonce: 313593556, + boundElements: [], + link: null, + locked: false, + }, + { + id: "gJubXeAjkEAr6yywtiZ0T", + type: "rectangle", + x: 1182.5, + y: 800.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#96f2d7", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 391007828, + version: 563, + versionNonce: 2026902612, + boundElements: [], + link: null, + locked: false, + }, + { + id: "pSB2Izj9osR_XxVCzyVnD", + type: "rectangle", + x: 1477.5, + y: 295.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#9775fa", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 110715860, + version: 590, + versionNonce: 535980500, + boundElements: [], + link: null, + locked: false, + }, + { + id: "yc7IKdtbnjLRaxJI5_q7m", + type: "rectangle", + x: 696.5, + y: 21.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#4dabf7", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 1457899860, + version: 587, + versionNonce: 724438868, + boundElements: [], + link: null, + locked: false, + }, + { + id: "7KjY1vcMQm_i_i05wowTC", + type: "rectangle", + x: 447.5, + y: 771.5, + width: 357, + height: 280, + strokeColor: "transparent", + backgroundColor: "#ffc9c9", + fillStyle: "solid", + strokeWidth: 2, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: { type: 3 }, + seed: 2072608468, + version: 610, + versionNonce: 1792607444, + boundElements: [], + link: null, + locked: false, + }, + ]); + } initialStatePromiseRef.current.promise.resolve(data.scene); });