loopwind 0.18.1 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/dist/commands/preview.d.ts.map +1 -1
- package/dist/commands/preview.js +2 -1
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/render.d.ts.map +1 -1
- package/dist/commands/render.js +2 -0
- package/dist/commands/render.js.map +1 -1
- package/dist/default-templates/AGENTS.md +54 -0
- package/dist/lib/renderer.d.ts.map +1 -1
- package/dist/lib/renderer.js +3 -0
- package/dist/lib/renderer.js.map +1 -1
- package/dist/lib/tailwind-browser.d.ts.map +1 -1
- package/dist/lib/tailwind-browser.js +169 -6
- package/dist/lib/tailwind-browser.js.map +1 -1
- package/dist/lib/tailwind.d.ts.map +1 -1
- package/dist/lib/tailwind.js +178 -7
- package/dist/lib/tailwind.js.map +1 -1
- package/dist/lib/video-preview.d.ts +1 -1
- package/dist/lib/video-preview.d.ts.map +1 -1
- package/dist/lib/video-preview.js +266 -249
- package/dist/lib/video-preview.js.map +1 -1
- package/dist/lib/video-renderer.d.ts +2 -0
- package/dist/lib/video-renderer.d.ts.map +1 -1
- package/dist/lib/video-renderer.js +4 -4
- package/dist/lib/video-renderer.js.map +1 -1
- package/dist/sdk/compiler.d.ts +94 -0
- package/dist/sdk/compiler.d.ts.map +1 -0
- package/dist/sdk/compiler.js +122 -0
- package/dist/sdk/compiler.js.map +1 -0
- package/dist/sdk/index.d.ts +3 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +2 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/preview.d.ts +65 -0
- package/dist/sdk/preview.d.ts.map +1 -0
- package/dist/sdk/preview.js +262 -0
- package/dist/sdk/preview.js.map +1 -0
- package/dist/sdk/template.d.ts +47 -24
- package/dist/sdk/template.d.ts.map +1 -1
- package/dist/sdk/template.js +53 -93
- package/dist/sdk/template.js.map +1 -1
- package/examples/nextjs-template-import.ts +2 -2
- package/examples/sdk-video-preview.tsx +120 -0
- package/examples/template-compiler-workflow.ts +251 -0
- package/package.json +6 -2
- package/render-examples-600x400.mjs +161 -0
- package/render-spring-variants-fixed.mjs +60 -0
- package/render-staggered-text.mjs +56 -0
- package/test-jsx-support.mjs +32 -6
- package/test-sdk-config.mjs +138 -81
- package/test-sdk-source-config.mjs +427 -0
- package/test-static-debug.tsx +19 -0
- package/test-templates/config-test.mjs +17 -0
- package/test-templates/test-sdk.mjs +46 -22
- package/test-video-props.json +3 -0
- package/website/DEPLOYMENT.md +1 -0
- package/website/OG_IMAGES.md +1 -0
- package/website/astro.config.mjs +18 -2
- package/website/dist/.gitkeep +1 -0
- package/website/dist/_worker.js/index.js +1 -1
- package/website/dist/_worker.js/{manifest_BAAoOzaU.mjs → manifest_CT_D-YDe.mjs} +1 -1
- package/website/dist/llm.txt +1 -1
- package/website/dist/sdk/index.html +405 -102
- package/website/dist/sitemap.xml +12 -12
- package/website/package-lock.json +2866 -7080
- package/website/package.json +1 -2
- package/website/public/.gitkeep +1 -0
- package/website/templates/og-image.tsx +20 -21
- package/website/test-playground.mjs +45 -0
package/website/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@astrojs/cloudflare": "^11.1.0",
|
|
17
17
|
"@astrojs/mdx": "^3.1.7",
|
|
18
18
|
"astro": "^4.15.11",
|
|
19
|
-
"loopwind": "
|
|
19
|
+
"loopwind": "file:..",
|
|
20
20
|
"typescript": "^5.6.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
@@ -25,4 +25,3 @@
|
|
|
25
25
|
"wrangler": "^3.86.1"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
|
package/website/public/.gitkeep
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Standard loopwind template - no imports needed
|
|
2
|
+
// The tw, config, qr, template functions are injected by loopwind at runtime
|
|
3
3
|
|
|
4
4
|
interface OgImageProps {
|
|
5
5
|
title: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
//
|
|
10
|
-
export const
|
|
9
|
+
// Standard loopwind template metadata
|
|
10
|
+
export const meta = {
|
|
11
11
|
name: 'loopwind-og',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
muted: '#27272a',
|
|
18
|
-
'muted-foreground': '#a1a1aa',
|
|
19
|
-
accent: '#6366f1',
|
|
20
|
-
border: '#27272a',
|
|
21
|
-
brand: '#6366f1',
|
|
22
|
-
},
|
|
23
|
-
fonts: {
|
|
24
|
-
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
25
|
-
},
|
|
12
|
+
description: 'OG image template for loopwind documentation',
|
|
13
|
+
type: 'image' as const,
|
|
14
|
+
size: {
|
|
15
|
+
width: 1200,
|
|
16
|
+
height: 630,
|
|
26
17
|
},
|
|
27
|
-
|
|
18
|
+
props: {
|
|
19
|
+
title: 'string',
|
|
20
|
+
description: 'string?',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Standard loopwind template component
|
|
25
|
+
export default function OgImage({ tw, title, description }: OgImageProps & { tw?: (classes: string) => any }) {
|
|
26
|
+
return (
|
|
28
27
|
<div style={tw!('flex flex-col w-full h-full bg-background p-16 justify-between')}>
|
|
29
28
|
{/* Header with logo */}
|
|
30
29
|
<div style={tw!('flex items-center gap-3')}>
|
|
@@ -57,5 +56,5 @@ export const ogTemplate = defineTemplate<OgImageProps>({
|
|
|
57
56
|
</div>
|
|
58
57
|
</div>
|
|
59
58
|
</div>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const testData = {
|
|
2
|
+
templateCode: `export const meta = {
|
|
3
|
+
name: 'test',
|
|
4
|
+
type: 'image',
|
|
5
|
+
size: { width: 400, height: 400 },
|
|
6
|
+
props: { title: 'string' }
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default function Test({ tw, title }) {
|
|
10
|
+
return (
|
|
11
|
+
<div style={tw('flex items-center justify-center w-full h-full bg-blue-500')}>
|
|
12
|
+
<h1 style={tw('text-white text-4xl')}>{title}</h1>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}`,
|
|
16
|
+
props: { title: 'Hello Playground!' },
|
|
17
|
+
format: 'svg'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
console.log('Testing playground API...');
|
|
21
|
+
console.log('Request body:', JSON.stringify(testData, null, 2));
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const response = await fetch('http://localhost:4323/api/playground/render', {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
body: JSON.stringify(testData)
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
console.log('Response status:', response.status);
|
|
33
|
+
console.log('Response headers:', Object.fromEntries(response.headers));
|
|
34
|
+
|
|
35
|
+
const data = await response.json();
|
|
36
|
+
|
|
37
|
+
if (data.type === 'image') {
|
|
38
|
+
console.log('✅ Success! Image rendered');
|
|
39
|
+
console.log('Data URL length:', data.data.length);
|
|
40
|
+
} else {
|
|
41
|
+
console.log('❌ Error:', data);
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('❌ Failed:', error.message);
|
|
45
|
+
}
|