loopwind 0.12.3 → 0.13.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/.video-preview/entry.tsx +35 -0
- package/.video-preview/index.html +55 -0
- package/dist/commands/preview.d.ts.map +1 -1
- package/dist/commands/preview.js +38 -5
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/render.d.ts.map +1 -1
- package/dist/commands/render.js +6 -1
- package/dist/commands/render.js.map +1 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +9 -4
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/helpers.d.ts +2 -12
- package/dist/lib/helpers.d.ts.map +1 -1
- package/dist/lib/helpers.js +44 -116
- package/dist/lib/helpers.js.map +1 -1
- package/dist/lib/renderer.d.ts.map +1 -1
- package/dist/lib/renderer.js +71 -54
- package/dist/lib/renderer.js.map +1 -1
- package/dist/lib/tailwind-browser.d.ts +27 -0
- package/dist/lib/tailwind-browser.d.ts.map +1 -0
- package/dist/lib/tailwind-browser.js +656 -0
- package/dist/lib/tailwind-browser.js.map +1 -0
- package/dist/lib/tailwind.d.ts.map +1 -1
- package/dist/lib/tailwind.js +59 -0
- package/dist/lib/tailwind.js.map +1 -1
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +28 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/video-player.d.ts +25 -0
- package/dist/lib/video-player.d.ts.map +1 -0
- package/dist/lib/video-player.js +265 -0
- package/dist/lib/video-player.js.map +1 -0
- package/dist/lib/video-preview.d.ts +15 -0
- package/dist/lib/video-preview.d.ts.map +1 -0
- package/dist/lib/video-preview.js +199 -0
- package/dist/lib/video-preview.js.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
2
|
+
import { tw as twBase } from './tailwind-browser.js';
|
|
3
|
+
export function VideoPlayer({ Template, meta, props, tailwindConfig = null, loopwindConfig = null }) {
|
|
4
|
+
const [frame, setFrame] = useState(0);
|
|
5
|
+
const [isPlaying, setIsPlaying] = useState(true);
|
|
6
|
+
const [isLooping, setIsLooping] = useState(true);
|
|
7
|
+
const [scale, setScale] = useState(1);
|
|
8
|
+
const animationRef = useRef(null);
|
|
9
|
+
const lastTimeRef = useRef(0);
|
|
10
|
+
const containerRef = useRef(null);
|
|
11
|
+
const { fps, duration } = meta.video;
|
|
12
|
+
const totalFrames = Math.floor(fps * duration);
|
|
13
|
+
const durationMs = duration * 1000;
|
|
14
|
+
// Create tw function bound to current animation context
|
|
15
|
+
const boundTw = useCallback((classes) => {
|
|
16
|
+
const context = {
|
|
17
|
+
frame: Math.floor(frame),
|
|
18
|
+
totalFrames,
|
|
19
|
+
durationMs,
|
|
20
|
+
progress: frame / totalFrames
|
|
21
|
+
};
|
|
22
|
+
return twBase(classes, tailwindConfig, loopwindConfig, context);
|
|
23
|
+
}, [frame, totalFrames, durationMs, tailwindConfig, loopwindConfig]);
|
|
24
|
+
// Image helper - returns the image URL from props
|
|
25
|
+
const image = useCallback((key) => {
|
|
26
|
+
return props[key] || '';
|
|
27
|
+
}, [props]);
|
|
28
|
+
// Playback loop
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!isPlaying) {
|
|
31
|
+
if (animationRef.current) {
|
|
32
|
+
cancelAnimationFrame(animationRef.current);
|
|
33
|
+
animationRef.current = null;
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
lastTimeRef.current = performance.now();
|
|
38
|
+
const animate = (time) => {
|
|
39
|
+
const delta = time - lastTimeRef.current;
|
|
40
|
+
lastTimeRef.current = time;
|
|
41
|
+
setFrame(prev => {
|
|
42
|
+
const increment = (delta / 1000) * fps;
|
|
43
|
+
const next = prev + increment;
|
|
44
|
+
if (next >= totalFrames) {
|
|
45
|
+
if (isLooping) {
|
|
46
|
+
return next % totalFrames;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
setIsPlaying(false);
|
|
50
|
+
return totalFrames - 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return next;
|
|
54
|
+
});
|
|
55
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
56
|
+
};
|
|
57
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
58
|
+
return () => {
|
|
59
|
+
if (animationRef.current) {
|
|
60
|
+
cancelAnimationFrame(animationRef.current);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, [isPlaying, fps, totalFrames, isLooping]);
|
|
64
|
+
// Calculate scale to fit video in container
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const calculateScale = () => {
|
|
67
|
+
if (!containerRef.current)
|
|
68
|
+
return;
|
|
69
|
+
const container = containerRef.current;
|
|
70
|
+
const padding = 64; // 2rem on each side
|
|
71
|
+
const availableWidth = container.clientWidth - padding;
|
|
72
|
+
const availableHeight = container.clientHeight - padding;
|
|
73
|
+
const scaleX = availableWidth / meta.size.width;
|
|
74
|
+
const scaleY = availableHeight / meta.size.height;
|
|
75
|
+
// Use the smaller scale to fit both dimensions, but cap at 1 (don't scale up)
|
|
76
|
+
const newScale = Math.min(scaleX, scaleY, 1);
|
|
77
|
+
setScale(newScale);
|
|
78
|
+
};
|
|
79
|
+
calculateScale();
|
|
80
|
+
window.addEventListener('resize', calculateScale);
|
|
81
|
+
return () => window.removeEventListener('resize', calculateScale);
|
|
82
|
+
}, [meta.size.width, meta.size.height]);
|
|
83
|
+
// Format time as milliseconds (matches animation class format)
|
|
84
|
+
const formatTime = (ms) => {
|
|
85
|
+
return `${Math.floor(ms)}ms`;
|
|
86
|
+
};
|
|
87
|
+
const currentMs = (frame / totalFrames) * durationMs;
|
|
88
|
+
const progress = (frame / totalFrames) * 100;
|
|
89
|
+
const handleScrub = (e) => {
|
|
90
|
+
const value = parseFloat(e.target.value);
|
|
91
|
+
setFrame((value / 100) * totalFrames);
|
|
92
|
+
};
|
|
93
|
+
const handlePlayPause = () => {
|
|
94
|
+
if (!isPlaying && frame >= totalFrames - 1) {
|
|
95
|
+
setFrame(0);
|
|
96
|
+
}
|
|
97
|
+
setIsPlaying(!isPlaying);
|
|
98
|
+
};
|
|
99
|
+
const handleRestart = () => {
|
|
100
|
+
setFrame(0);
|
|
101
|
+
setIsPlaying(true);
|
|
102
|
+
};
|
|
103
|
+
const handleStepBackward = () => {
|
|
104
|
+
setIsPlaying(false);
|
|
105
|
+
setFrame(prev => Math.max(0, prev - 1));
|
|
106
|
+
};
|
|
107
|
+
const handleStepForward = () => {
|
|
108
|
+
setIsPlaying(false);
|
|
109
|
+
setFrame(prev => Math.min(totalFrames - 1, prev + 1));
|
|
110
|
+
};
|
|
111
|
+
return (React.createElement("div", { style: {
|
|
112
|
+
display: 'flex',
|
|
113
|
+
flexDirection: 'column',
|
|
114
|
+
height: '100vh',
|
|
115
|
+
background: '#0a0a0a',
|
|
116
|
+
color: '#ffffff',
|
|
117
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
118
|
+
} },
|
|
119
|
+
React.createElement("div", { style: {
|
|
120
|
+
background: '#18181b',
|
|
121
|
+
borderBottom: '1px solid #27272a',
|
|
122
|
+
padding: '1rem 2rem',
|
|
123
|
+
display: 'flex',
|
|
124
|
+
justifyContent: 'space-between',
|
|
125
|
+
alignItems: 'center'
|
|
126
|
+
} },
|
|
127
|
+
React.createElement("h1", { style: { fontSize: '1.25rem', fontWeight: 600, margin: 0 } },
|
|
128
|
+
"loopwind preview: ",
|
|
129
|
+
meta.name),
|
|
130
|
+
React.createElement("div", { style: { display: 'flex', gap: '0.5rem', alignItems: 'center' } },
|
|
131
|
+
React.createElement("span", { style: {
|
|
132
|
+
background: '#7c3aed',
|
|
133
|
+
color: 'white',
|
|
134
|
+
padding: '0.25rem 0.75rem',
|
|
135
|
+
borderRadius: '0.375rem',
|
|
136
|
+
fontSize: '0.875rem',
|
|
137
|
+
fontWeight: 500
|
|
138
|
+
} }, "VIDEO"),
|
|
139
|
+
React.createElement("span", { style: {
|
|
140
|
+
background: '#27272a',
|
|
141
|
+
color: '#a1a1aa',
|
|
142
|
+
padding: '0.25rem 0.75rem',
|
|
143
|
+
borderRadius: '0.375rem',
|
|
144
|
+
fontSize: '0.75rem',
|
|
145
|
+
fontFamily: 'monospace'
|
|
146
|
+
} },
|
|
147
|
+
meta.size.width,
|
|
148
|
+
"\u00D7",
|
|
149
|
+
meta.size.height,
|
|
150
|
+
" @ ",
|
|
151
|
+
fps,
|
|
152
|
+
"fps"))),
|
|
153
|
+
React.createElement("div", { ref: containerRef, style: {
|
|
154
|
+
flex: 1,
|
|
155
|
+
display: 'flex',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
padding: '2rem',
|
|
159
|
+
overflow: 'hidden'
|
|
160
|
+
} },
|
|
161
|
+
React.createElement("div", { style: {
|
|
162
|
+
width: meta.size.width,
|
|
163
|
+
height: meta.size.height,
|
|
164
|
+
boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.5)',
|
|
165
|
+
borderRadius: '0.5rem',
|
|
166
|
+
overflow: 'hidden',
|
|
167
|
+
flexShrink: 0,
|
|
168
|
+
border: '1px solid #3f3f46',
|
|
169
|
+
transform: `scale(${scale})`,
|
|
170
|
+
transformOrigin: 'center center'
|
|
171
|
+
} },
|
|
172
|
+
React.createElement(Template, { tw: boundTw, image: image, __currentTimeMs: currentMs, __isPlaying: isPlaying, ...props }))),
|
|
173
|
+
React.createElement("div", { style: {
|
|
174
|
+
background: '#18181b',
|
|
175
|
+
borderTop: '1px solid #27272a',
|
|
176
|
+
padding: '1rem 2rem'
|
|
177
|
+
} },
|
|
178
|
+
React.createElement("div", { style: { marginBottom: '0.75rem' } },
|
|
179
|
+
React.createElement("input", { type: "range", min: "0", max: "100", step: "0.1", value: progress, onChange: handleScrub, style: {
|
|
180
|
+
width: '100%',
|
|
181
|
+
height: '6px',
|
|
182
|
+
background: `linear-gradient(to right, #7c3aed ${progress}%, #3f3f46 ${progress}%)`,
|
|
183
|
+
borderRadius: '3px',
|
|
184
|
+
cursor: 'pointer',
|
|
185
|
+
WebkitAppearance: 'none',
|
|
186
|
+
appearance: 'none'
|
|
187
|
+
} })),
|
|
188
|
+
React.createElement("div", { style: {
|
|
189
|
+
display: 'flex',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'space-between'
|
|
192
|
+
} },
|
|
193
|
+
React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '0.5rem' } },
|
|
194
|
+
React.createElement("button", { onClick: handleRestart, style: {
|
|
195
|
+
background: 'transparent',
|
|
196
|
+
border: 'none',
|
|
197
|
+
color: '#a1a1aa',
|
|
198
|
+
cursor: 'pointer',
|
|
199
|
+
padding: '0.5rem',
|
|
200
|
+
fontSize: '1rem',
|
|
201
|
+
display: 'flex',
|
|
202
|
+
alignItems: 'center',
|
|
203
|
+
justifyContent: 'center'
|
|
204
|
+
}, title: "Restart" }, "\u23EE"),
|
|
205
|
+
React.createElement("button", { onClick: handleStepBackward, style: {
|
|
206
|
+
background: 'transparent',
|
|
207
|
+
border: 'none',
|
|
208
|
+
color: '#a1a1aa',
|
|
209
|
+
cursor: 'pointer',
|
|
210
|
+
padding: '0.5rem',
|
|
211
|
+
fontSize: '1rem',
|
|
212
|
+
display: 'flex',
|
|
213
|
+
alignItems: 'center',
|
|
214
|
+
justifyContent: 'center'
|
|
215
|
+
}, title: "Previous frame" }, "\u23EA"),
|
|
216
|
+
React.createElement("button", { onClick: handlePlayPause, style: {
|
|
217
|
+
background: '#7c3aed',
|
|
218
|
+
border: 'none',
|
|
219
|
+
color: 'white',
|
|
220
|
+
cursor: 'pointer',
|
|
221
|
+
padding: '0.75rem 1rem',
|
|
222
|
+
borderRadius: '0.375rem',
|
|
223
|
+
fontSize: '1rem',
|
|
224
|
+
display: 'flex',
|
|
225
|
+
alignItems: 'center',
|
|
226
|
+
justifyContent: 'center',
|
|
227
|
+
minWidth: '3rem'
|
|
228
|
+
} }, isPlaying ? '⏸' : '▶'),
|
|
229
|
+
React.createElement("button", { onClick: handleStepForward, style: {
|
|
230
|
+
background: 'transparent',
|
|
231
|
+
border: 'none',
|
|
232
|
+
color: '#a1a1aa',
|
|
233
|
+
cursor: 'pointer',
|
|
234
|
+
padding: '0.5rem',
|
|
235
|
+
fontSize: '1rem',
|
|
236
|
+
display: 'flex',
|
|
237
|
+
alignItems: 'center',
|
|
238
|
+
justifyContent: 'center'
|
|
239
|
+
}, title: "Next frame" }, "\u23E9"),
|
|
240
|
+
React.createElement("button", { onClick: () => setIsLooping(!isLooping), style: {
|
|
241
|
+
background: isLooping ? '#3f3f46' : 'transparent',
|
|
242
|
+
border: '1px solid #3f3f46',
|
|
243
|
+
color: isLooping ? '#ffffff' : '#71717a',
|
|
244
|
+
cursor: 'pointer',
|
|
245
|
+
padding: '0.5rem 0.75rem',
|
|
246
|
+
borderRadius: '0.375rem',
|
|
247
|
+
fontSize: '0.75rem',
|
|
248
|
+
marginLeft: '0.5rem'
|
|
249
|
+
}, title: isLooping ? 'Loop enabled' : 'Loop disabled' }, "\uD83D\uDD01")),
|
|
250
|
+
React.createElement("div", { style: {
|
|
251
|
+
fontFamily: 'monospace',
|
|
252
|
+
fontSize: '0.875rem',
|
|
253
|
+
color: '#a1a1aa'
|
|
254
|
+
} },
|
|
255
|
+
React.createElement("span", { style: { color: '#ffffff' } }, formatTime(currentMs)),
|
|
256
|
+
' / ',
|
|
257
|
+
formatTime(durationMs),
|
|
258
|
+
React.createElement("span", { style: { marginLeft: '1rem', color: '#71717a' } },
|
|
259
|
+
"Frame ",
|
|
260
|
+
Math.floor(frame),
|
|
261
|
+
" / ",
|
|
262
|
+
totalFrames))))));
|
|
263
|
+
}
|
|
264
|
+
export default VideoPlayer;
|
|
265
|
+
//# sourceMappingURL=video-player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;;wBAAK,WAAW,CACnC,CACH,CACF,CACF,CACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface VideoPreviewOptions {
|
|
2
|
+
templateName: string;
|
|
3
|
+
templatePath: string;
|
|
4
|
+
props: Record<string, any>;
|
|
5
|
+
meta: any;
|
|
6
|
+
port: number;
|
|
7
|
+
open: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function startVideoPreview(options: VideoPreviewOptions): Promise<{
|
|
10
|
+
server: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
11
|
+
vite: import("vite").ViteDevServer;
|
|
12
|
+
cleanup: () => Promise<void>;
|
|
13
|
+
}>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=video-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-preview.d.ts","sourceRoot":"","sources":["../../src/lib/video-preview.ts"],"names":[],"mappings":"AASA,UAAU,mBAAmB;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB;;;;GA2MnE"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { createServer as createViteServer } from 'vite';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import fs from 'fs/promises';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
export async function startVideoPreview(options) {
|
|
9
|
+
const { templateName, templatePath, props, meta, port, open } = options;
|
|
10
|
+
const app = express();
|
|
11
|
+
// Try to load loopwind.json from project (_loopwind/loopwind.json)
|
|
12
|
+
let loopwindConfig = null;
|
|
13
|
+
const projectRoot = path.join(__dirname, '../..');
|
|
14
|
+
const loopwindJsonPath = path.join(projectRoot, '_loopwind', 'loopwind.json');
|
|
15
|
+
try {
|
|
16
|
+
const loopwindContent = await fs.readFile(loopwindJsonPath, 'utf-8');
|
|
17
|
+
loopwindConfig = JSON.parse(loopwindContent);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// loopwind.json doesn't exist or couldn't be read - that's fine
|
|
21
|
+
}
|
|
22
|
+
// Create temporary directory for generated files
|
|
23
|
+
const tempDir = path.join(__dirname, '../../.video-preview');
|
|
24
|
+
await fs.mkdir(tempDir, { recursive: true });
|
|
25
|
+
// Get the source directory for imports
|
|
26
|
+
// __dirname at runtime is dist/lib, we need src/lib for Vite to bundle TSX
|
|
27
|
+
const srcLibDir = path.join(projectRoot, 'src/lib');
|
|
28
|
+
// Generate the entry file
|
|
29
|
+
const entryContent = `
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import { createRoot } from 'react-dom/client';
|
|
32
|
+
import { VideoPlayer } from '${srcLibDir}/video-player.tsx';
|
|
33
|
+
import { tw } from '${srcLibDir}/tailwind-browser.ts';
|
|
34
|
+
import Template, { meta } from '${templatePath}';
|
|
35
|
+
|
|
36
|
+
const props = ${JSON.stringify(props)};
|
|
37
|
+
|
|
38
|
+
// Tailwind config not loaded in browser (would need dynamic import of user's config)
|
|
39
|
+
const tailwindConfig = null;
|
|
40
|
+
|
|
41
|
+
// loopwind.json config (loaded server-side and embedded)
|
|
42
|
+
const loopwindConfig = ${JSON.stringify(loopwindConfig)};
|
|
43
|
+
|
|
44
|
+
function App() {
|
|
45
|
+
return (
|
|
46
|
+
<VideoPlayer
|
|
47
|
+
Template={Template}
|
|
48
|
+
meta={meta}
|
|
49
|
+
props={props}
|
|
50
|
+
tailwindConfig={tailwindConfig}
|
|
51
|
+
loopwindConfig={loopwindConfig}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const container = document.getElementById('root');
|
|
57
|
+
const root = createRoot(container);
|
|
58
|
+
root.render(<App />);
|
|
59
|
+
|
|
60
|
+
// Hot module replacement
|
|
61
|
+
if (import.meta.hot) {
|
|
62
|
+
import.meta.hot.accept();
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const entryPath = path.join(tempDir, 'entry.tsx');
|
|
66
|
+
await fs.writeFile(entryPath, entryContent);
|
|
67
|
+
// Generate index.html
|
|
68
|
+
const htmlContent = `
|
|
69
|
+
<!DOCTYPE html>
|
|
70
|
+
<html lang="en">
|
|
71
|
+
<head>
|
|
72
|
+
<meta charset="UTF-8">
|
|
73
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
74
|
+
<title>Video Preview: ${templateName}</title>
|
|
75
|
+
<style>
|
|
76
|
+
* {
|
|
77
|
+
margin: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
}
|
|
81
|
+
body {
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
}
|
|
84
|
+
/* Custom range slider styling */
|
|
85
|
+
input[type="range"] {
|
|
86
|
+
-webkit-appearance: none;
|
|
87
|
+
appearance: none;
|
|
88
|
+
outline: none;
|
|
89
|
+
}
|
|
90
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
91
|
+
-webkit-appearance: none;
|
|
92
|
+
appearance: none;
|
|
93
|
+
width: 14px;
|
|
94
|
+
height: 14px;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
background: #7c3aed;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
margin-top: -4px;
|
|
99
|
+
}
|
|
100
|
+
input[type="range"]::-moz-range-thumb {
|
|
101
|
+
width: 14px;
|
|
102
|
+
height: 14px;
|
|
103
|
+
border-radius: 50%;
|
|
104
|
+
background: #7c3aed;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
border: none;
|
|
107
|
+
}
|
|
108
|
+
input[type="range"]::-webkit-slider-runnable-track {
|
|
109
|
+
height: 6px;
|
|
110
|
+
border-radius: 3px;
|
|
111
|
+
}
|
|
112
|
+
input[type="range"]::-moz-range-track {
|
|
113
|
+
height: 6px;
|
|
114
|
+
border-radius: 3px;
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
117
|
+
</head>
|
|
118
|
+
<body>
|
|
119
|
+
<div id="root"></div>
|
|
120
|
+
<script type="module" src="/entry.tsx"></script>
|
|
121
|
+
</body>
|
|
122
|
+
</html>
|
|
123
|
+
`;
|
|
124
|
+
const htmlPath = path.join(tempDir, 'index.html');
|
|
125
|
+
await fs.writeFile(htmlPath, htmlContent);
|
|
126
|
+
// Dynamically import the React plugin
|
|
127
|
+
// @ts-expect-error - moduleResolution incompatibility with @vitejs/plugin-react types
|
|
128
|
+
const { default: react } = await import('@vitejs/plugin-react');
|
|
129
|
+
// Create Vite server
|
|
130
|
+
const vite = await createViteServer({
|
|
131
|
+
root: tempDir,
|
|
132
|
+
server: {
|
|
133
|
+
middlewareMode: true,
|
|
134
|
+
hmr: true,
|
|
135
|
+
},
|
|
136
|
+
plugins: [react()],
|
|
137
|
+
define: {
|
|
138
|
+
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
139
|
+
'process.env': JSON.stringify({}),
|
|
140
|
+
},
|
|
141
|
+
resolve: {
|
|
142
|
+
alias: {
|
|
143
|
+
// Ensure proper resolution of our library files
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
optimizeDeps: {
|
|
147
|
+
include: ['react', 'react-dom'],
|
|
148
|
+
// Don't pre-bundle our local files
|
|
149
|
+
exclude: ['video-player']
|
|
150
|
+
},
|
|
151
|
+
build: {
|
|
152
|
+
rollupOptions: {
|
|
153
|
+
input: entryPath
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
// Serve template directory for local assets (videos, images)
|
|
158
|
+
const templateDir = path.dirname(templatePath);
|
|
159
|
+
app.use('/template', express.static(templateDir));
|
|
160
|
+
// Use Vite's connect instance as middleware
|
|
161
|
+
app.use(vite.middlewares);
|
|
162
|
+
// Serve index.html for root
|
|
163
|
+
app.get('/', async (req, res) => {
|
|
164
|
+
try {
|
|
165
|
+
let html = await fs.readFile(htmlPath, 'utf-8');
|
|
166
|
+
html = await vite.transformIndexHtml(req.url, html);
|
|
167
|
+
res.status(200).set({ 'Content-Type': 'text/html' }).end(html);
|
|
168
|
+
}
|
|
169
|
+
catch (e) {
|
|
170
|
+
vite.ssrFixStacktrace(e);
|
|
171
|
+
res.status(500).end(e.message);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
// Start server
|
|
175
|
+
const server = app.listen(port, () => {
|
|
176
|
+
// Open browser if requested
|
|
177
|
+
if (open) {
|
|
178
|
+
import('open').then(({ default: openBrowser }) => {
|
|
179
|
+
openBrowser(`http://localhost:${port}`);
|
|
180
|
+
}).catch(() => {
|
|
181
|
+
// Silently fail
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
// Cleanup function
|
|
186
|
+
const cleanup = async () => {
|
|
187
|
+
await vite.close();
|
|
188
|
+
server.close();
|
|
189
|
+
// Clean up temp files
|
|
190
|
+
try {
|
|
191
|
+
await fs.rm(tempDir, { recursive: true });
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
// Ignore cleanup errors
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return { server, vite, cleanup };
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=video-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-preview.js","sourceRoot":"","sources":["../../src/lib/video-preview.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,IAAI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AAW,EAAE,EAAE,EAAE;gBAC/C,WAAW,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACZ,gBAAgB;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,mBAAmB;IACnB,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,sBAAsB;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loopwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "A CLI tool for AI code agents and developers for generating images and videos.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@resvg/resvg-js": "^2.6.0",
|
|
50
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
50
51
|
"boxen": "^7.1.1",
|
|
51
52
|
"chalk": "^5.3.0",
|
|
52
53
|
"chalk-animation": "^2.0.3",
|
|
@@ -61,14 +62,16 @@
|
|
|
61
62
|
"mediabunny": "^1.25.0",
|
|
62
63
|
"open": "^11.0.0",
|
|
63
64
|
"ora": "^8.0.1",
|
|
65
|
+
"patch-package": "^8.0.1",
|
|
64
66
|
"pngjs": "^7.0.0",
|
|
65
67
|
"qrcode": "^1.5.4",
|
|
66
68
|
"react": "^18.2.0",
|
|
69
|
+
"react-dom": "^18.3.1",
|
|
67
70
|
"satori": "^0.18.3",
|
|
68
71
|
"sharp": "^0.34.5",
|
|
69
72
|
"tailwind-merge": "^3.4.0",
|
|
70
73
|
"tailwindcss": "^3.4.1",
|
|
71
|
-
"
|
|
74
|
+
"vite": "^7.2.2"
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
|
74
77
|
"@types/chalk-animation": "^1.6.3",
|