blob: 332b0fb8fd00d8d9fcf216b61b846da4e8cf1c19 [file] [log] [blame]
philip.zeyliger26bc6592025-06-30 20:15:30 -07001/* eslint-disable @typescript-eslint/no-explicit-any */
Sean McCullough4337aa72025-06-27 23:41:33 +00002/**
3 * Demo module for sketch-app-shell component
4 */
5
6import { DemoModule } from "./demo-framework/types";
7import { demoUtils } from "./demo-fixtures/index";
8
9const demo: DemoModule = {
10 title: "Sketch App Shell Demo",
11 description:
12 "Full sketch application shell with chat, diff, and terminal views",
13 imports: ["../sketch-app-shell"],
14 styles: ["/src/sketch-app-shell.css"],
15
16 setup: async (container: HTMLElement) => {
17 // Mock the service worker for data services
18 const { worker } = await import("./mocks/browser");
19 await worker.start();
20
21 // Create demo sections
22 const mainSection = demoUtils.createDemoSection(
23 "Sketch App Shell",
24 "Interactive sketch application shell with multiple view modes",
25 );
26
27 // Create the app shell
28 const appShell = document.createElement("sketch-app-shell") as any;
29
30 // Set up the shell to be contained within the demo
31 appShell.style.cssText = `
32 border: 1px solid #d1d9e0;
33 overflow: hidden;
34 display: block;
35 `;
36
37 // Assemble the demo
38 mainSection.appendChild(appShell);
39
40 container.appendChild(mainSection);
41
42 // Wait a bit for the component to initialize
43 await demoUtils.delay(100);
44 },
45
46 cleanup: async () => {
47 // Clean up any global state if needed
48 console.log("Cleaning up sketch-app-shell demo");
49 },
50};
51
52export default demo;