{
+ const frame = makeFrame()
+ const out = exportFrame(frame)
+ expect(out.css).toMatch(/\.frame-scale\s*{[^}]*transform-origin:0 0/)
+ expect(out.html).toMatch(/class=\"frame-scale\"/)
+ })
+})
diff --git a/lib/wysiwyg/export.ts b/lib/wysiwyg/export.ts
new file mode 100644
index 0000000..c6d0deb
--- /dev/null
+++ b/lib/wysiwyg/export.ts
@@ -0,0 +1,48 @@
+import type { Frame, WObject } from '@/lib/wysiwyg/schema'
+
+export type Exported = { html: string; css: string; js: string }
+
+function esc(s: string) {
+ return s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"')
+}
+
+function isImage(o: WObject): o is Extract ${esc(o.props.text)}`
+ return { html, css: baseCss }
+ }
+ if (isText(o)) {
+ const html = `