vargai 0.4.0-alpha84 → 0.4.0-alpha86

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/package.json CHANGED
@@ -71,7 +71,7 @@
71
71
  "zod": "^4.2.1"
72
72
  },
73
73
  "sideEffects": false,
74
- "version": "0.4.0-alpha84",
74
+ "version": "0.4.0-alpha86",
75
75
  "exports": {
76
76
  ".": "./src/index.ts",
77
77
  "./ai": "./src/ai-sdk/index.ts",
@@ -83,7 +83,7 @@ async function loadComponent(filePath: string): Promise<VargElement> {
83
83
 
84
84
  if (hasVargaiImport) {
85
85
  const tmpFile = `${tmpDir}/${Date.now()}.tsx`;
86
- // Resolve @jsxImportSource to absolute path so it works from the cache dir
86
+ // Resolve JSX pragma to absolute path so it works from the cache dir
87
87
  const runtimeDir = resolve(pkgDir, "src/react/runtime");
88
88
  const resolvedSource = source.replace(
89
89
  /@jsxImportSource\s+vargai/,
@@ -255,10 +255,18 @@ export async function renderRoot(
255
255
  }
256
256
  }
257
257
 
258
- // Recurse into child clips, injecting container-level overlays
258
+ // Recurse into child clips, injecting container-level overlays.
259
+ // Mark them as clip-local (start: 0) so they are composited per-clip
260
+ // in buildBaseClipFilter instead of being swept into the global overlay
261
+ // pool by collectImageOverlays. Without this, the last container overlay
262
+ // visually wins across the entire video (all share the same position).
259
263
  for (const childClip of childClips) {
260
264
  if (containerOverlays.length > 0) {
261
- childClip.children = [...childClip.children, ...containerOverlays];
265
+ const localOverlays = containerOverlays.map((ov) => ({
266
+ ...ov,
267
+ props: { ...ov.props, start: 0 },
268
+ }));
269
+ childClip.children = [...childClip.children, ...localOverlays];
262
270
  }
263
271
  flattenClip(childClip);
264
272
  }