MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / PlaygroundPreview

Class PlaygroundPreview

packages/sdk-playground/src/main.ts:67–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65// ── Preview adapter ───────────────────────────────────────────────────────────
66
67class PlaygroundPreview implements PreviewAdapter {
68 private handlers: Array<(ids: string[]) => void> = [];
69
70 elementAtPoint(_x: number, _y: number) {
71 return null;
72 }
73 applyDraft(_id: string, _props: { dx?: number; dy?: number; width?: number; height?: number }) {}
74 commitPreview() {}
75 cancelPreview() {}
76
77 select(ids: string[], _opts?: { additive?: boolean }) {
78 for (const h of this.handlers) h([...ids]);
79 }
80
81 on(event: "selection", handler: (ids: string[]) => void): () => void {
82 if (event !== "selection") return () => {};
83 this.handlers.push(handler);
84 return () => {
85 this.handlers = this.handlers.filter((h) => h !== handler);
86 };
87 }
88}
89
90// ── Preview iframe ────────────────────────────────────────────────────────────
91

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected