ugcinc-render 1.8.15 → 1.8.16

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/dist/index.d.mts CHANGED
@@ -621,57 +621,7 @@ declare function AutoCaptionComposition({ videoUrl, captions, style, }: AutoCapt
621
621
  declare function AutoCaptionCompositionWithVideo({ videoUrl, captions, style, }: AutoCaptionCompositionProps): react_jsx_runtime.JSX.Element;
622
622
 
623
623
  /**
624
- * ScreenshotAnimationComposition
625
- *
626
- * Simulates an iPhone screenshot animation:
627
- * 1. Flash - Screen flashes white
628
- * 2. Shrink - Content scales down to a thumbnail
629
- * 3. Slide - Thumbnail moves to bottom-left corner
630
- * 4. Pause - Thumbnail sits briefly
631
- * 5. Dismiss - Thumbnail slides off-screen to the left
632
- */
633
- interface ScreenshotAnimationCompositionProps {
634
- /** The image URL to show being "screenshotted" */
635
- imageUrl: string;
636
- /** Canvas width */
637
- width?: number;
638
- /** Canvas height */
639
- height?: number;
640
- /** Duration of the white flash (ms) */
641
- flashDurationMs?: number;
642
- /** Duration of the shrink animation (ms) */
643
- shrinkDurationMs?: number;
644
- /** Duration the thumbnail pauses before dismissing (ms) */
645
- pauseDurationMs?: number;
646
- /** Duration of the dismiss slide animation (ms) */
647
- dismissDurationMs?: number;
648
- /** Border radius of the image at full size (px) */
649
- imageCornerRadius?: number;
650
- /** Border radius of the thumbnail (px) */
651
- thumbnailCornerRadius?: number;
652
- /** Border width around the screenshot (px) */
653
- borderWidth?: number;
654
- /** Border color (hex or rgba) */
655
- borderColor?: string;
656
- /** Scale of the thumbnail (0-1, e.g., 0.15 = 15% of original) */
657
- thumbnailScale?: number;
658
- /** Padding from screen edge (px) */
659
- thumbnailPadding?: number;
660
- /** Extra offset from bottom for home indicator (px) */
661
- bottomOffset?: number;
662
- /** Spring damping (higher = less bounce) */
663
- springDamping?: number;
664
- /** Spring stiffness (higher = faster) */
665
- springStiffness?: number;
666
- /** Spring mass (higher = more momentum) */
667
- springMass?: number;
668
- /** Background color behind the animation */
669
- backgroundColor?: string;
670
- }
671
- declare function ScreenshotAnimationComposition({ imageUrl, width, height, flashDurationMs, shrinkDurationMs, pauseDurationMs, dismissDurationMs, imageCornerRadius, thumbnailCornerRadius, borderWidth, borderColor, thumbnailScale, thumbnailPadding, bottomOffset, springDamping, springStiffness, springMass, backgroundColor, }: ScreenshotAnimationCompositionProps): react_jsx_runtime.JSX.Element;
672
-
673
- /**
674
- * ScreenshotAnimationV2
624
+ * ScreenshotAnimation
675
625
  *
676
626
  * Accurate iPhone screenshot animation based on real device measurements.
677
627
  *
@@ -680,7 +630,7 @@ declare function ScreenshotAnimationComposition({ imageUrl, width, height, flash
680
630
  * - 1000-1255ms: Phase 1 (flash & reveal, content shifts down 50%)
681
631
  * - 1255ms+: Phase 2 (container shrinks, content morphs to thumbnail)
682
632
  */
683
- interface ScreenshotAnimationV2Props {
633
+ interface ScreenshotAnimationProps {
684
634
  /** The image URL being "screenshotted" */
685
635
  imageUrl: string;
686
636
  /** Canvas width in pixels */
@@ -698,7 +648,7 @@ interface ScreenshotAnimationV2Props {
698
648
  /** Background color (behind everything) */
699
649
  backgroundColor?: string;
700
650
  }
701
- declare function ScreenshotAnimationV2({ imageUrl, width, height, pauseDurationMs, flashDurationMs, borderRadius, borderColor, backgroundColor, }: ScreenshotAnimationV2Props): react_jsx_runtime.JSX.Element;
651
+ declare function ScreenshotAnimation({ imageUrl, width, height, pauseDurationMs, flashDurationMs, borderRadius, borderColor, backgroundColor, }: ScreenshotAnimationProps): react_jsx_runtime.JSX.Element;
702
652
 
703
653
  interface TextElementProps {
704
654
  segment: TextSegment;
@@ -832,4 +782,4 @@ declare function useResolvedPositions(elements: ImageEditorElement[], textValues
832
782
 
833
783
  declare const RenderRoot: React.FC;
834
784
 
835
- export { type Acceleration, type AudioConfig, type AudioSegment, AutoCaptionComposition, AutoCaptionCompositionProps, AutoCaptionCompositionWithVideo, type BaseEditorConfig, type BaseSegment, type BlendMode, BorderRadiusConfig, CaptionOverlay, CaptionOverlayProps, type Channel, type ColorFilterConfig, type ColorShiftConfig, type CropConfig, type CuttingConfig, DEDUPLICATION_LEVELS, type DeduplicationConfig, type DeduplicationInput, type DeduplicationLevel, type DiagonalFilterConfig, type DiagonalFilterType, DynamicCropConfig, type EditorConfig, type EditorSegment, type EnhanceLevel, type EnhancementConfig, FitMode, type FrameManipulationConfig, type GifOverlayConfig, type GifSource, type GradientOverlayConfig, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, ImageEditorElement, ImageElement, type ImageElementProps, type ImageSegment, LEVEL_1_CONFIG, LEVEL_2_CONFIG, LEVEL_3_CONFIG, LEVEL_4_CONFIG, LEVEL_5_CONFIG, type LensCorrectionConfig, type MobileEncodingConfig, type ParticleOverlayConfig, type PhoneConfig, type PhoneModel, type PhoneType, type PictureSegment, PositionResolutionResult, RelativePositionConfigX, RelativePositionConfigY, RenderRoot, ScreenshotAnimationComposition, type ScreenshotAnimationCompositionProps, ScreenshotAnimationV2, type ScreenshotAnimationV2Props, type Segment, SegmentType, type SpeedConfig, type StaticSegment, TextElement, type TextElementProps, type TextSegment, TextStyleProperties, TimeValue, type TraceRemovalConfig, type VideoCodec, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, VideoElement, type VideoElementProps, type VideoExtension, type VideoSegment, type VisualAdjustmentsConfig, type VisualSegment, type VisualSegmentUnion, isDeduplicationLevel, resolveDeduplicationConfig, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions };
785
+ export { type Acceleration, type AudioConfig, type AudioSegment, AutoCaptionComposition, AutoCaptionCompositionProps, AutoCaptionCompositionWithVideo, type BaseEditorConfig, type BaseSegment, type BlendMode, BorderRadiusConfig, CaptionOverlay, CaptionOverlayProps, type Channel, type ColorFilterConfig, type ColorShiftConfig, type CropConfig, type CuttingConfig, DEDUPLICATION_LEVELS, type DeduplicationConfig, type DeduplicationInput, type DeduplicationLevel, type DiagonalFilterConfig, type DiagonalFilterType, DynamicCropConfig, type EditorConfig, type EditorSegment, type EnhanceLevel, type EnhancementConfig, FitMode, type FrameManipulationConfig, type GifOverlayConfig, type GifSource, type GradientOverlayConfig, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, ImageEditorElement, ImageElement, type ImageElementProps, type ImageSegment, LEVEL_1_CONFIG, LEVEL_2_CONFIG, LEVEL_3_CONFIG, LEVEL_4_CONFIG, LEVEL_5_CONFIG, type LensCorrectionConfig, type MobileEncodingConfig, type ParticleOverlayConfig, type PhoneConfig, type PhoneModel, type PhoneType, type PictureSegment, PositionResolutionResult, RelativePositionConfigX, RelativePositionConfigY, RenderRoot, ScreenshotAnimation, type ScreenshotAnimationProps, type Segment, SegmentType, type SpeedConfig, type StaticSegment, TextElement, type TextElementProps, type TextSegment, TextStyleProperties, TimeValue, type TraceRemovalConfig, type VideoCodec, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, VideoElement, type VideoElementProps, type VideoExtension, type VideoSegment, type VisualAdjustmentsConfig, type VisualSegment, type VisualSegmentUnion, isDeduplicationLevel, resolveDeduplicationConfig, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions };
package/dist/index.d.ts CHANGED
@@ -621,57 +621,7 @@ declare function AutoCaptionComposition({ videoUrl, captions, style, }: AutoCapt
621
621
  declare function AutoCaptionCompositionWithVideo({ videoUrl, captions, style, }: AutoCaptionCompositionProps): react_jsx_runtime.JSX.Element;
622
622
 
623
623
  /**
624
- * ScreenshotAnimationComposition
625
- *
626
- * Simulates an iPhone screenshot animation:
627
- * 1. Flash - Screen flashes white
628
- * 2. Shrink - Content scales down to a thumbnail
629
- * 3. Slide - Thumbnail moves to bottom-left corner
630
- * 4. Pause - Thumbnail sits briefly
631
- * 5. Dismiss - Thumbnail slides off-screen to the left
632
- */
633
- interface ScreenshotAnimationCompositionProps {
634
- /** The image URL to show being "screenshotted" */
635
- imageUrl: string;
636
- /** Canvas width */
637
- width?: number;
638
- /** Canvas height */
639
- height?: number;
640
- /** Duration of the white flash (ms) */
641
- flashDurationMs?: number;
642
- /** Duration of the shrink animation (ms) */
643
- shrinkDurationMs?: number;
644
- /** Duration the thumbnail pauses before dismissing (ms) */
645
- pauseDurationMs?: number;
646
- /** Duration of the dismiss slide animation (ms) */
647
- dismissDurationMs?: number;
648
- /** Border radius of the image at full size (px) */
649
- imageCornerRadius?: number;
650
- /** Border radius of the thumbnail (px) */
651
- thumbnailCornerRadius?: number;
652
- /** Border width around the screenshot (px) */
653
- borderWidth?: number;
654
- /** Border color (hex or rgba) */
655
- borderColor?: string;
656
- /** Scale of the thumbnail (0-1, e.g., 0.15 = 15% of original) */
657
- thumbnailScale?: number;
658
- /** Padding from screen edge (px) */
659
- thumbnailPadding?: number;
660
- /** Extra offset from bottom for home indicator (px) */
661
- bottomOffset?: number;
662
- /** Spring damping (higher = less bounce) */
663
- springDamping?: number;
664
- /** Spring stiffness (higher = faster) */
665
- springStiffness?: number;
666
- /** Spring mass (higher = more momentum) */
667
- springMass?: number;
668
- /** Background color behind the animation */
669
- backgroundColor?: string;
670
- }
671
- declare function ScreenshotAnimationComposition({ imageUrl, width, height, flashDurationMs, shrinkDurationMs, pauseDurationMs, dismissDurationMs, imageCornerRadius, thumbnailCornerRadius, borderWidth, borderColor, thumbnailScale, thumbnailPadding, bottomOffset, springDamping, springStiffness, springMass, backgroundColor, }: ScreenshotAnimationCompositionProps): react_jsx_runtime.JSX.Element;
672
-
673
- /**
674
- * ScreenshotAnimationV2
624
+ * ScreenshotAnimation
675
625
  *
676
626
  * Accurate iPhone screenshot animation based on real device measurements.
677
627
  *
@@ -680,7 +630,7 @@ declare function ScreenshotAnimationComposition({ imageUrl, width, height, flash
680
630
  * - 1000-1255ms: Phase 1 (flash & reveal, content shifts down 50%)
681
631
  * - 1255ms+: Phase 2 (container shrinks, content morphs to thumbnail)
682
632
  */
683
- interface ScreenshotAnimationV2Props {
633
+ interface ScreenshotAnimationProps {
684
634
  /** The image URL being "screenshotted" */
685
635
  imageUrl: string;
686
636
  /** Canvas width in pixels */
@@ -698,7 +648,7 @@ interface ScreenshotAnimationV2Props {
698
648
  /** Background color (behind everything) */
699
649
  backgroundColor?: string;
700
650
  }
701
- declare function ScreenshotAnimationV2({ imageUrl, width, height, pauseDurationMs, flashDurationMs, borderRadius, borderColor, backgroundColor, }: ScreenshotAnimationV2Props): react_jsx_runtime.JSX.Element;
651
+ declare function ScreenshotAnimation({ imageUrl, width, height, pauseDurationMs, flashDurationMs, borderRadius, borderColor, backgroundColor, }: ScreenshotAnimationProps): react_jsx_runtime.JSX.Element;
702
652
 
703
653
  interface TextElementProps {
704
654
  segment: TextSegment;
@@ -832,4 +782,4 @@ declare function useResolvedPositions(elements: ImageEditorElement[], textValues
832
782
 
833
783
  declare const RenderRoot: React.FC;
834
784
 
835
- export { type Acceleration, type AudioConfig, type AudioSegment, AutoCaptionComposition, AutoCaptionCompositionProps, AutoCaptionCompositionWithVideo, type BaseEditorConfig, type BaseSegment, type BlendMode, BorderRadiusConfig, CaptionOverlay, CaptionOverlayProps, type Channel, type ColorFilterConfig, type ColorShiftConfig, type CropConfig, type CuttingConfig, DEDUPLICATION_LEVELS, type DeduplicationConfig, type DeduplicationInput, type DeduplicationLevel, type DiagonalFilterConfig, type DiagonalFilterType, DynamicCropConfig, type EditorConfig, type EditorSegment, type EnhanceLevel, type EnhancementConfig, FitMode, type FrameManipulationConfig, type GifOverlayConfig, type GifSource, type GradientOverlayConfig, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, ImageEditorElement, ImageElement, type ImageElementProps, type ImageSegment, LEVEL_1_CONFIG, LEVEL_2_CONFIG, LEVEL_3_CONFIG, LEVEL_4_CONFIG, LEVEL_5_CONFIG, type LensCorrectionConfig, type MobileEncodingConfig, type ParticleOverlayConfig, type PhoneConfig, type PhoneModel, type PhoneType, type PictureSegment, PositionResolutionResult, RelativePositionConfigX, RelativePositionConfigY, RenderRoot, ScreenshotAnimationComposition, type ScreenshotAnimationCompositionProps, ScreenshotAnimationV2, type ScreenshotAnimationV2Props, type Segment, SegmentType, type SpeedConfig, type StaticSegment, TextElement, type TextElementProps, type TextSegment, TextStyleProperties, TimeValue, type TraceRemovalConfig, type VideoCodec, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, VideoElement, type VideoElementProps, type VideoExtension, type VideoSegment, type VisualAdjustmentsConfig, type VisualSegment, type VisualSegmentUnion, isDeduplicationLevel, resolveDeduplicationConfig, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions };
785
+ export { type Acceleration, type AudioConfig, type AudioSegment, AutoCaptionComposition, AutoCaptionCompositionProps, AutoCaptionCompositionWithVideo, type BaseEditorConfig, type BaseSegment, type BlendMode, BorderRadiusConfig, CaptionOverlay, CaptionOverlayProps, type Channel, type ColorFilterConfig, type ColorShiftConfig, type CropConfig, type CuttingConfig, DEDUPLICATION_LEVELS, type DeduplicationConfig, type DeduplicationInput, type DeduplicationLevel, type DiagonalFilterConfig, type DiagonalFilterType, DynamicCropConfig, type EditorConfig, type EditorSegment, type EnhanceLevel, type EnhancementConfig, FitMode, type FrameManipulationConfig, type GifOverlayConfig, type GifSource, type GradientOverlayConfig, ImageEditorComposition, type ImageEditorCompositionProps, type ImageEditorConfig, ImageEditorElement, ImageElement, type ImageElementProps, type ImageSegment, LEVEL_1_CONFIG, LEVEL_2_CONFIG, LEVEL_3_CONFIG, LEVEL_4_CONFIG, LEVEL_5_CONFIG, type LensCorrectionConfig, type MobileEncodingConfig, type ParticleOverlayConfig, type PhoneConfig, type PhoneModel, type PhoneType, type PictureSegment, PositionResolutionResult, RelativePositionConfigX, RelativePositionConfigY, RenderRoot, ScreenshotAnimation, type ScreenshotAnimationProps, type Segment, SegmentType, type SpeedConfig, type StaticSegment, TextElement, type TextElementProps, type TextSegment, TextStyleProperties, TimeValue, type TraceRemovalConfig, type VideoCodec, VideoEditorComposition, type VideoEditorCompositionProps, type VideoEditorConfig, VideoElement, type VideoElementProps, type VideoExtension, type VideoSegment, type VisualAdjustmentsConfig, type VisualSegment, type VisualSegmentUnion, isDeduplicationLevel, resolveDeduplicationConfig, useFontsLoaded, useImageLoader, useImagePreloader, useResolvedPositions };
package/dist/index.js CHANGED
@@ -49,8 +49,7 @@ __export(index_exports, {
49
49
  LEVEL_4_CONFIG: () => LEVEL_4_CONFIG,
50
50
  LEVEL_5_CONFIG: () => LEVEL_5_CONFIG,
51
51
  RenderRoot: () => RenderRoot,
52
- ScreenshotAnimationComposition: () => ScreenshotAnimationComposition,
53
- ScreenshotAnimationV2: () => ScreenshotAnimationV2,
52
+ ScreenshotAnimation: () => ScreenshotAnimation,
54
53
  TEXT_DEFAULTS: () => TEXT_DEFAULTS,
55
54
  TextElement: () => TextElement,
56
55
  VIDEO_DEFAULTS: () => VIDEO_DEFAULTS,
@@ -2247,190 +2246,31 @@ function AutoCaptionCompositionWithVideo({
2247
2246
  ] });
2248
2247
  }
2249
2248
 
2250
- // src/compositions/ScreenshotAnimationComposition.tsx
2249
+ // src/compositions/ScreenshotAnimation.tsx
2251
2250
  var import_remotion7 = require("remotion");
2252
2251
  var import_jsx_runtime8 = require("react/jsx-runtime");
2253
- function ScreenshotAnimationComposition({
2254
- imageUrl,
2255
- width = 1080,
2256
- height = 1920,
2257
- // Timing defaults
2258
- flashDurationMs = 100,
2259
- shrinkDurationMs = 300,
2260
- pauseDurationMs = 800,
2261
- dismissDurationMs = 250,
2262
- // Image styling
2263
- imageCornerRadius = 0,
2264
- thumbnailCornerRadius = 24,
2265
- // Border
2266
- borderWidth = 0,
2267
- borderColor = "rgba(255, 255, 255, 0.3)",
2268
- // Thumbnail positioning
2269
- thumbnailScale = 0.15,
2270
- thumbnailPadding = 20,
2271
- bottomOffset = 80,
2272
- // Spring physics
2273
- springDamping = 15,
2274
- springStiffness = 120,
2275
- springMass = 0.8,
2276
- // Background
2277
- backgroundColor = "#000000"
2278
- }) {
2279
- const frame = (0, import_remotion7.useCurrentFrame)();
2280
- const { fps } = (0, import_remotion7.useVideoConfig)();
2281
- const flashDuration = Math.round(fps * (flashDurationMs / 1e3));
2282
- const shrinkDuration = Math.round(fps * (shrinkDurationMs / 1e3));
2283
- const pauseDuration = Math.round(fps * (pauseDurationMs / 1e3));
2284
- const dismissDuration = Math.round(fps * (dismissDurationMs / 1e3));
2285
- const flashStart = 0;
2286
- const flashEnd = flashDuration;
2287
- const shrinkStart = flashEnd;
2288
- const shrinkEnd = shrinkStart + shrinkDuration;
2289
- const pauseEnd = shrinkEnd + pauseDuration;
2290
- const flashOpacity = (0, import_remotion7.interpolate)(
2291
- frame,
2292
- [flashStart, flashEnd],
2293
- [1, 0],
2294
- { extrapolateRight: "clamp" }
2295
- );
2296
- const shrinkProgress = (0, import_remotion7.spring)({
2297
- frame: frame - shrinkStart,
2298
- fps,
2299
- config: {
2300
- damping: springDamping,
2301
- stiffness: springStiffness,
2302
- mass: springMass
2303
- },
2304
- durationInFrames: shrinkDuration
2305
- });
2306
- const scale = (0, import_remotion7.interpolate)(
2307
- shrinkProgress,
2308
- [0, 1],
2309
- [1, thumbnailScale],
2310
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2311
- );
2312
- const thumbnailWidth = width * thumbnailScale;
2313
- const thumbnailHeight = height * thumbnailScale;
2314
- const finalX = thumbnailPadding + thumbnailWidth / 2 - width / 2;
2315
- const finalY = height / 2 - thumbnailHeight / 2 - thumbnailPadding - bottomOffset;
2316
- const translateX = (0, import_remotion7.interpolate)(
2317
- shrinkProgress,
2318
- [0, 1],
2319
- [0, finalX],
2320
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2321
- );
2322
- const translateY = (0, import_remotion7.interpolate)(
2323
- shrinkProgress,
2324
- [0, 1],
2325
- [0, finalY],
2326
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2327
- );
2328
- const dismissProgress = (0, import_remotion7.interpolate)(
2329
- frame,
2330
- [pauseEnd, pauseEnd + dismissDuration],
2331
- [0, 1],
2332
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2333
- );
2334
- const dismissX = (0, import_remotion7.interpolate)(
2335
- dismissProgress,
2336
- [0, 1],
2337
- [0, -thumbnailWidth - thumbnailPadding - 50],
2338
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2339
- );
2340
- const currentBorderRadius = (0, import_remotion7.interpolate)(
2341
- shrinkProgress,
2342
- [0, 1],
2343
- [imageCornerRadius, thumbnailCornerRadius],
2344
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2345
- );
2346
- const shadowOpacity = (0, import_remotion7.interpolate)(
2347
- shrinkProgress,
2348
- [0, 0.5, 1],
2349
- [0, 0.3, 0.5],
2350
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2351
- );
2352
- const currentBorderWidth = (0, import_remotion7.interpolate)(
2353
- shrinkProgress,
2354
- [0, 0.3, 1],
2355
- [0, borderWidth, borderWidth],
2356
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
2357
- );
2358
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_remotion7.AbsoluteFill, { style: { backgroundColor }, children: [
2359
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2360
- "div",
2361
- {
2362
- style: {
2363
- position: "absolute",
2364
- left: "50%",
2365
- top: "50%",
2366
- width,
2367
- height,
2368
- marginLeft: -width / 2,
2369
- marginTop: -height / 2,
2370
- transform: `translate(${translateX + dismissX}px, ${translateY}px) scale(${scale})`,
2371
- transformOrigin: "center center",
2372
- borderRadius: currentBorderRadius,
2373
- overflow: "hidden",
2374
- boxShadow: `0 10px 60px rgba(0, 0, 0, ${shadowOpacity})`,
2375
- border: currentBorderWidth > 0 ? `${currentBorderWidth}px solid ${borderColor}` : "none",
2376
- boxSizing: "border-box"
2377
- },
2378
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2379
- import_remotion7.Img,
2380
- {
2381
- src: imageUrl,
2382
- style: {
2383
- width: "100%",
2384
- height: "100%",
2385
- objectFit: "cover",
2386
- borderRadius: currentBorderRadius > 0 ? currentBorderRadius - currentBorderWidth : 0
2387
- }
2388
- }
2389
- )
2390
- }
2391
- ),
2392
- frame < flashEnd && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2393
- import_remotion7.AbsoluteFill,
2394
- {
2395
- style: {
2396
- backgroundColor: "#fff",
2397
- opacity: flashOpacity
2398
- }
2399
- }
2400
- )
2401
- ] });
2402
- }
2403
-
2404
- // src/compositions/ScreenshotAnimationV2.tsx
2405
- var import_remotion8 = require("remotion");
2406
- var import_jsx_runtime9 = require("react/jsx-runtime");
2407
2252
  var CONTAINER_ANIMATION_DURATION = 480;
2408
- var CONTAINER_SETTLE_DURATION = 200;
2253
+ var CONTAINER_SETTLE_DURATION = 400;
2409
2254
  var START = {
2410
- ssBorderTop: 0,
2411
- ssBorderTopInner: 5e-3,
2412
- // Small border width
2413
- ssBorderRight: 1,
2255
+ ssBorderTop: 0.0276,
2256
+ ssBorderTopInner: 0.035,
2257
+ ssBorderRight: 0.9883,
2414
2258
  ssBorderLeft: 0,
2415
2259
  ssBorderBottom: 1,
2416
- imgTop: 0.5,
2417
- // 50% down
2418
- imgClipRight: 0.21,
2419
- imgClipBottom: 0.72,
2260
+ imgTop: 0.5125,
2261
+ imgClipRight: 0.2076,
2262
+ imgClipBottom: 0.7103,
2420
2263
  whiteOpacity: 0.824
2421
2264
  };
2422
2265
  var END = {
2423
- ssBorderTop: 0.7455,
2424
- ssBorderTopInner: 0.7508,
2425
- ssBorderRight: 0.321,
2426
- ssBorderLeft: 0.0901,
2427
- ssBorderBottom: 0.9588,
2428
- imgTop: 0.7508,
2429
- // Matches container inner top
2430
- imgClipRight: 0.321,
2431
- // Matches container right (fills width)
2432
- imgClipBottom: 0.9588,
2433
- // Matches container bottom (fills height)
2266
+ ssBorderTop: 0.761,
2267
+ ssBorderTopInner: 0.7663,
2268
+ ssBorderRight: 0.3074,
2269
+ ssBorderLeft: 0.093,
2270
+ ssBorderBottom: 0.9576,
2271
+ imgTop: 0.7566,
2272
+ imgClipRight: 0.3107,
2273
+ imgClipBottom: 0.9569,
2434
2274
  whiteOpacity: 0
2435
2275
  };
2436
2276
  var CLIP_FILL_TIME = 480;
@@ -2448,7 +2288,7 @@ function smoothInterpolate(timeMs, startTime, duration, startValue, endValue, ea
2448
2288
  const easedProgress = easingFn(progress);
2449
2289
  return startValue + (endValue - startValue) * easedProgress;
2450
2290
  }
2451
- function ScreenshotAnimationV2({
2291
+ function ScreenshotAnimation({
2452
2292
  imageUrl,
2453
2293
  width = 1202,
2454
2294
  height = 2618,
@@ -2458,8 +2298,8 @@ function ScreenshotAnimationV2({
2458
2298
  borderColor = "rgba(254, 255, 255, 1)",
2459
2299
  backgroundColor = "#000000"
2460
2300
  }) {
2461
- const frame = (0, import_remotion8.useCurrentFrame)();
2462
- const { fps } = (0, import_remotion8.useVideoConfig)();
2301
+ const frame = (0, import_remotion7.useCurrentFrame)();
2302
+ const { fps } = (0, import_remotion7.useVideoConfig)();
2463
2303
  const timeMs = frame / fps * 1e3;
2464
2304
  const flashStartMs = pauseDurationMs;
2465
2305
  const flashEndMs = flashStartMs + flashDurationMs;
@@ -2474,7 +2314,7 @@ function ScreenshotAnimationV2({
2474
2314
  whiteOpacity = 0;
2475
2315
  } else if (isFlashPhase) {
2476
2316
  const flashProgress = (timeMs - flashStartMs) / flashDurationMs;
2477
- whiteOpacity = (0, import_remotion8.interpolate)(flashProgress, [0, 0.1, 1], [1, 1, START.whiteOpacity], {
2317
+ whiteOpacity = (0, import_remotion7.interpolate)(flashProgress, [0, 0.1, 1], [1, 1, START.whiteOpacity], {
2478
2318
  extrapolateRight: "clamp"
2479
2319
  });
2480
2320
  } else if (isPhase2) {
@@ -2493,11 +2333,11 @@ function ScreenshotAnimationV2({
2493
2333
  let containerRight;
2494
2334
  let containerBottom;
2495
2335
  if (isFlashPhase) {
2496
- containerTop = 0;
2497
- containerTopInner = 5e-3;
2498
- containerLeft = 0;
2499
- containerRight = 1;
2500
- containerBottom = 1;
2336
+ containerTop = START.ssBorderTop;
2337
+ containerTopInner = START.ssBorderTopInner;
2338
+ containerLeft = START.ssBorderLeft;
2339
+ containerRight = START.ssBorderRight;
2340
+ containerBottom = START.ssBorderBottom;
2501
2341
  } else {
2502
2342
  const totalDuration = CONTAINER_ANIMATION_DURATION + CONTAINER_SETTLE_DURATION;
2503
2343
  containerTop = smoothInterpolate(phase2TimeMs, 0, totalDuration, START.ssBorderTop, END.ssBorderTop, easeOutQuart);
@@ -2517,7 +2357,7 @@ function ScreenshotAnimationV2({
2517
2357
  let imgClipRightPercent;
2518
2358
  let imgClipBottomPercent;
2519
2359
  if (isFlashPhase) {
2520
- imgTopPercent = 0.5;
2360
+ imgTopPercent = START.imgTop;
2521
2361
  imgClipRightPercent = START.imgClipRight;
2522
2362
  imgClipBottomPercent = START.imgClipBottom;
2523
2363
  } else {
@@ -2542,16 +2382,15 @@ function ScreenshotAnimationV2({
2542
2382
  easeOutQuart
2543
2383
  );
2544
2384
  const innerBorderRadius = (borderRadius - borderWidth) * cornerProgress;
2545
- const grayGapHeight = Math.max(0, (imgTopPercent - containerTopInner) * height);
2546
2385
  const smallClipTop = imgTopPercent * height;
2547
2386
  const smallClipRight = imgClipRightPercent * width;
2548
2387
  const smallClipBottom = imgClipBottomPercent * height;
2549
2388
  const smallClipLeft = containerLeft * width + borderWidth;
2550
2389
  const smallClipWidth = smallClipRight - smallClipLeft;
2551
2390
  const smallClipHeight = smallClipBottom - smallClipTop;
2552
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_remotion8.AbsoluteFill, { style: { backgroundColor }, children: [
2553
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2554
- import_remotion8.Img,
2391
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_remotion7.AbsoluteFill, { style: { backgroundColor }, children: [
2392
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2393
+ import_remotion7.Img,
2555
2394
  {
2556
2395
  src: imageUrl,
2557
2396
  style: {
@@ -2564,7 +2403,7 @@ function ScreenshotAnimationV2({
2564
2403
  }
2565
2404
  }
2566
2405
  ),
2567
- showContainer && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2406
+ showContainer && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2568
2407
  "div",
2569
2408
  {
2570
2409
  style: {
@@ -2579,7 +2418,7 @@ function ScreenshotAnimationV2({
2579
2418
  overflow: "hidden"
2580
2419
  },
2581
2420
  children: [
2582
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2421
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2583
2422
  "div",
2584
2423
  {
2585
2424
  style: {
@@ -2593,7 +2432,7 @@ function ScreenshotAnimationV2({
2593
2432
  borderRadius: `${borderRadius - borderWidth}px ${borderRadius - borderWidth}px ${innerBorderRadius}px ${innerBorderRadius}px`
2594
2433
  },
2595
2434
  children: [
2596
- !thumbnailFilled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2435
+ !thumbnailFilled && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2597
2436
  "div",
2598
2437
  {
2599
2438
  style: {
@@ -2606,7 +2445,7 @@ function ScreenshotAnimationV2({
2606
2445
  }
2607
2446
  }
2608
2447
  ),
2609
- !thumbnailFilled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2448
+ !thumbnailFilled && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2610
2449
  "div",
2611
2450
  {
2612
2451
  style: {
@@ -2617,8 +2456,8 @@ function ScreenshotAnimationV2({
2617
2456
  height,
2618
2457
  overflow: "hidden"
2619
2458
  },
2620
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2621
- import_remotion8.Img,
2459
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2460
+ import_remotion7.Img,
2622
2461
  {
2623
2462
  src: imageUrl,
2624
2463
  style: {
@@ -2630,7 +2469,7 @@ function ScreenshotAnimationV2({
2630
2469
  )
2631
2470
  }
2632
2471
  ),
2633
- showSmallClip && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2472
+ showSmallClip && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2634
2473
  "div",
2635
2474
  {
2636
2475
  style: {
@@ -2641,8 +2480,8 @@ function ScreenshotAnimationV2({
2641
2480
  height: thumbnailFilled ? contentH : smallClipHeight,
2642
2481
  overflow: "hidden"
2643
2482
  },
2644
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2645
- import_remotion8.Img,
2483
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2484
+ import_remotion7.Img,
2646
2485
  {
2647
2486
  src: imageUrl,
2648
2487
  style: {
@@ -2657,7 +2496,7 @@ function ScreenshotAnimationV2({
2657
2496
  ]
2658
2497
  }
2659
2498
  ),
2660
- whiteOpacity > 1e-3 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2499
+ whiteOpacity > 1e-3 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2661
2500
  "div",
2662
2501
  {
2663
2502
  style: {
@@ -3043,9 +2882,9 @@ function useResolvedPositions(elements, textValues) {
3043
2882
  }
3044
2883
 
3045
2884
  // src/Root.tsx
3046
- var import_remotion9 = require("remotion");
2885
+ var import_remotion8 = require("remotion");
3047
2886
  var import_zod = require("zod");
3048
- var import_jsx_runtime10 = require("react/jsx-runtime");
2887
+ var import_jsx_runtime9 = require("react/jsx-runtime");
3049
2888
  var defaultImageProps = {
3050
2889
  config: {
3051
2890
  width: 1080,
@@ -3088,32 +2927,6 @@ var defaultAutoCaptionProps = {
3088
2927
  }
3089
2928
  };
3090
2929
  var defaultScreenshotAnimationProps = {
3091
- imageUrl: "https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=1080&h=1920&fit=crop",
3092
- width: 1080,
3093
- height: 1920,
3094
- // Timing
3095
- flashDurationMs: 100,
3096
- shrinkDurationMs: 300,
3097
- pauseDurationMs: 800,
3098
- dismissDurationMs: 250,
3099
- // Image styling
3100
- imageCornerRadius: 0,
3101
- thumbnailCornerRadius: 24,
3102
- // Border
3103
- borderWidth: 0,
3104
- borderColor: "rgba(255, 255, 255, 0.3)",
3105
- // Thumbnail positioning
3106
- thumbnailScale: 0.15,
3107
- thumbnailPadding: 20,
3108
- bottomOffset: 80,
3109
- // Spring physics
3110
- springDamping: 15,
3111
- springStiffness: 120,
3112
- springMass: 0.8,
3113
- // Background
3114
- backgroundColor: "#000000"
3115
- };
3116
- var defaultScreenshotAnimationV2Props = {
3117
2930
  imageUrl: "https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3163-RY0CFNrbnSnqZpaJzi9VdslzfYLLKf.png",
3118
2931
  width: 1202,
3119
2932
  height: 2618,
@@ -3123,7 +2936,7 @@ var defaultScreenshotAnimationV2Props = {
3123
2936
  borderColor: "rgba(254, 255, 255, 1)",
3124
2937
  backgroundColor: "#000000"
3125
2938
  };
3126
- var screenshotAnimationV2Schema = import_zod.z.object({
2939
+ var screenshotAnimationSchema = import_zod.z.object({
3127
2940
  imageUrl: import_zod.z.string().describe("URL of the image being screenshotted"),
3128
2941
  width: import_zod.z.number().optional().default(1202).describe("Canvas width (px)"),
3129
2942
  height: import_zod.z.number().optional().default(2618).describe("Canvas height (px)"),
@@ -3133,38 +2946,10 @@ var screenshotAnimationV2Schema = import_zod.z.object({
3133
2946
  borderColor: import_zod.z.string().optional().default("rgba(254, 255, 255, 1)").describe("Border color"),
3134
2947
  backgroundColor: import_zod.z.string().optional().default("#000000").describe("Background color")
3135
2948
  });
3136
- var screenshotAnimationSchema = import_zod.z.object({
3137
- // Core
3138
- imageUrl: import_zod.z.string().describe("URL of the image to screenshot"),
3139
- width: import_zod.z.number().optional().default(1080).describe("Canvas width (px)"),
3140
- height: import_zod.z.number().optional().default(1920).describe("Canvas height (px)"),
3141
- // Timing
3142
- flashDurationMs: import_zod.z.number().optional().default(100).describe("Flash duration (ms)"),
3143
- shrinkDurationMs: import_zod.z.number().optional().default(300).describe("Shrink animation duration (ms)"),
3144
- pauseDurationMs: import_zod.z.number().optional().default(800).describe("Pause before dismiss (ms)"),
3145
- dismissDurationMs: import_zod.z.number().optional().default(250).describe("Dismiss slide duration (ms)"),
3146
- // Image styling
3147
- imageCornerRadius: import_zod.z.number().optional().default(0).describe("Corner radius at full size (px)"),
3148
- thumbnailCornerRadius: import_zod.z.number().optional().default(24).describe("Corner radius of thumbnail (px)"),
3149
- // Border
3150
- borderWidth: import_zod.z.number().optional().default(0).describe("Border width (px)"),
3151
- borderColor: import_zod.z.string().optional().default("rgba(255, 255, 255, 0.3)").describe("Border color"),
3152
- // Thumbnail positioning
3153
- thumbnailScale: import_zod.z.number().optional().default(0.15).describe("Thumbnail scale (0-1)"),
3154
- thumbnailPadding: import_zod.z.number().optional().default(20).describe("Padding from edge (px)"),
3155
- bottomOffset: import_zod.z.number().optional().default(80).describe("Extra bottom offset (px)"),
3156
- // Spring physics
3157
- springDamping: import_zod.z.number().optional().default(15).describe("Spring damping (higher = less bounce)"),
3158
- springStiffness: import_zod.z.number().optional().default(120).describe("Spring stiffness (higher = faster)"),
3159
- springMass: import_zod.z.number().optional().default(0.8).describe("Spring mass"),
3160
- // Background
3161
- backgroundColor: import_zod.z.string().optional().default("#000000").describe("Background color")
3162
- });
3163
2949
  var ImageComp = ImageEditorComposition;
3164
2950
  var VideoComp = VideoEditorComposition;
3165
2951
  var AutoCaptionComp = AutoCaptionComposition;
3166
- var ScreenshotAnimationComp = ScreenshotAnimationComposition;
3167
- var ScreenshotAnimationV2Comp = ScreenshotAnimationV2;
2952
+ var ScreenshotAnimationComp = ScreenshotAnimation;
3168
2953
  var calculateImageMetadata = async ({ props }) => {
3169
2954
  console.log("[calculateMetadata] Starting metadata calculation...");
3170
2955
  const canvasWidth = props.width ?? props.config?.width ?? 1080;
@@ -3215,9 +3000,9 @@ var calculateImageMetadata = async ({ props }) => {
3215
3000
  };
3216
3001
  };
3217
3002
  var RenderRoot = () => {
3218
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3219
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3220
- import_remotion9.Composition,
3003
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
3004
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3005
+ import_remotion8.Composition,
3221
3006
  {
3222
3007
  id: "ImageEditorComposition",
3223
3008
  component: ImageComp,
@@ -3229,8 +3014,8 @@ var RenderRoot = () => {
3229
3014
  defaultProps: defaultImageProps
3230
3015
  }
3231
3016
  ),
3232
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3233
- import_remotion9.Composition,
3017
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3018
+ import_remotion8.Composition,
3234
3019
  {
3235
3020
  id: "VideoEditorComposition",
3236
3021
  component: VideoComp,
@@ -3241,8 +3026,8 @@ var RenderRoot = () => {
3241
3026
  defaultProps: defaultVideoProps
3242
3027
  }
3243
3028
  ),
3244
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3245
- import_remotion9.Composition,
3029
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3030
+ import_remotion8.Composition,
3246
3031
  {
3247
3032
  id: "AutoCaptionComposition",
3248
3033
  component: AutoCaptionComp,
@@ -3253,30 +3038,17 @@ var RenderRoot = () => {
3253
3038
  defaultProps: defaultAutoCaptionProps
3254
3039
  }
3255
3040
  ),
3256
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3257
- import_remotion9.Composition,
3041
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3042
+ import_remotion8.Composition,
3258
3043
  {
3259
3044
  id: "ScreenshotAnimationComposition",
3260
3045
  component: ScreenshotAnimationComp,
3261
3046
  schema: screenshotAnimationSchema,
3262
- durationInFrames: 60,
3263
- fps: 30,
3264
- width: 1080,
3265
- height: 1920,
3266
- defaultProps: defaultScreenshotAnimationProps
3267
- }
3268
- ),
3269
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3270
- import_remotion9.Composition,
3271
- {
3272
- id: "ScreenshotAnimationV2",
3273
- component: ScreenshotAnimationV2Comp,
3274
- schema: screenshotAnimationV2Schema,
3275
3047
  durationInFrames: 90,
3276
3048
  fps: 30,
3277
3049
  width: 1202,
3278
3050
  height: 2618,
3279
- defaultProps: defaultScreenshotAnimationV2Props
3051
+ defaultProps: defaultScreenshotAnimationProps
3280
3052
  }
3281
3053
  )
3282
3054
  ] });
@@ -3302,8 +3074,7 @@ var RenderRoot = () => {
3302
3074
  LEVEL_4_CONFIG,
3303
3075
  LEVEL_5_CONFIG,
3304
3076
  RenderRoot,
3305
- ScreenshotAnimationComposition,
3306
- ScreenshotAnimationV2,
3077
+ ScreenshotAnimation,
3307
3078
  TEXT_DEFAULTS,
3308
3079
  TextElement,
3309
3080
  VIDEO_DEFAULTS,
package/dist/index.mjs CHANGED
@@ -1383,190 +1383,31 @@ function AutoCaptionCompositionWithVideo({
1383
1383
  ] });
1384
1384
  }
1385
1385
 
1386
- // src/compositions/ScreenshotAnimationComposition.tsx
1387
- import { AbsoluteFill as AbsoluteFill4, Img as Img3, interpolate as interpolate2, spring, useCurrentFrame as useCurrentFrame5, useVideoConfig as useVideoConfig5 } from "remotion";
1386
+ // src/compositions/ScreenshotAnimation.tsx
1387
+ import { AbsoluteFill as AbsoluteFill4, Img as Img3, interpolate as interpolate2, useCurrentFrame as useCurrentFrame5, useVideoConfig as useVideoConfig5 } from "remotion";
1388
1388
  import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1389
- function ScreenshotAnimationComposition({
1390
- imageUrl,
1391
- width = 1080,
1392
- height = 1920,
1393
- // Timing defaults
1394
- flashDurationMs = 100,
1395
- shrinkDurationMs = 300,
1396
- pauseDurationMs = 800,
1397
- dismissDurationMs = 250,
1398
- // Image styling
1399
- imageCornerRadius = 0,
1400
- thumbnailCornerRadius = 24,
1401
- // Border
1402
- borderWidth = 0,
1403
- borderColor = "rgba(255, 255, 255, 0.3)",
1404
- // Thumbnail positioning
1405
- thumbnailScale = 0.15,
1406
- thumbnailPadding = 20,
1407
- bottomOffset = 80,
1408
- // Spring physics
1409
- springDamping = 15,
1410
- springStiffness = 120,
1411
- springMass = 0.8,
1412
- // Background
1413
- backgroundColor = "#000000"
1414
- }) {
1415
- const frame = useCurrentFrame5();
1416
- const { fps } = useVideoConfig5();
1417
- const flashDuration = Math.round(fps * (flashDurationMs / 1e3));
1418
- const shrinkDuration = Math.round(fps * (shrinkDurationMs / 1e3));
1419
- const pauseDuration = Math.round(fps * (pauseDurationMs / 1e3));
1420
- const dismissDuration = Math.round(fps * (dismissDurationMs / 1e3));
1421
- const flashStart = 0;
1422
- const flashEnd = flashDuration;
1423
- const shrinkStart = flashEnd;
1424
- const shrinkEnd = shrinkStart + shrinkDuration;
1425
- const pauseEnd = shrinkEnd + pauseDuration;
1426
- const flashOpacity = interpolate2(
1427
- frame,
1428
- [flashStart, flashEnd],
1429
- [1, 0],
1430
- { extrapolateRight: "clamp" }
1431
- );
1432
- const shrinkProgress = spring({
1433
- frame: frame - shrinkStart,
1434
- fps,
1435
- config: {
1436
- damping: springDamping,
1437
- stiffness: springStiffness,
1438
- mass: springMass
1439
- },
1440
- durationInFrames: shrinkDuration
1441
- });
1442
- const scale = interpolate2(
1443
- shrinkProgress,
1444
- [0, 1],
1445
- [1, thumbnailScale],
1446
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1447
- );
1448
- const thumbnailWidth = width * thumbnailScale;
1449
- const thumbnailHeight = height * thumbnailScale;
1450
- const finalX = thumbnailPadding + thumbnailWidth / 2 - width / 2;
1451
- const finalY = height / 2 - thumbnailHeight / 2 - thumbnailPadding - bottomOffset;
1452
- const translateX = interpolate2(
1453
- shrinkProgress,
1454
- [0, 1],
1455
- [0, finalX],
1456
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1457
- );
1458
- const translateY = interpolate2(
1459
- shrinkProgress,
1460
- [0, 1],
1461
- [0, finalY],
1462
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1463
- );
1464
- const dismissProgress = interpolate2(
1465
- frame,
1466
- [pauseEnd, pauseEnd + dismissDuration],
1467
- [0, 1],
1468
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1469
- );
1470
- const dismissX = interpolate2(
1471
- dismissProgress,
1472
- [0, 1],
1473
- [0, -thumbnailWidth - thumbnailPadding - 50],
1474
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1475
- );
1476
- const currentBorderRadius = interpolate2(
1477
- shrinkProgress,
1478
- [0, 1],
1479
- [imageCornerRadius, thumbnailCornerRadius],
1480
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1481
- );
1482
- const shadowOpacity = interpolate2(
1483
- shrinkProgress,
1484
- [0, 0.5, 1],
1485
- [0, 0.3, 0.5],
1486
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1487
- );
1488
- const currentBorderWidth = interpolate2(
1489
- shrinkProgress,
1490
- [0, 0.3, 1],
1491
- [0, borderWidth, borderWidth],
1492
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" }
1493
- );
1494
- return /* @__PURE__ */ jsxs6(AbsoluteFill4, { style: { backgroundColor }, children: [
1495
- /* @__PURE__ */ jsx8(
1496
- "div",
1497
- {
1498
- style: {
1499
- position: "absolute",
1500
- left: "50%",
1501
- top: "50%",
1502
- width,
1503
- height,
1504
- marginLeft: -width / 2,
1505
- marginTop: -height / 2,
1506
- transform: `translate(${translateX + dismissX}px, ${translateY}px) scale(${scale})`,
1507
- transformOrigin: "center center",
1508
- borderRadius: currentBorderRadius,
1509
- overflow: "hidden",
1510
- boxShadow: `0 10px 60px rgba(0, 0, 0, ${shadowOpacity})`,
1511
- border: currentBorderWidth > 0 ? `${currentBorderWidth}px solid ${borderColor}` : "none",
1512
- boxSizing: "border-box"
1513
- },
1514
- children: /* @__PURE__ */ jsx8(
1515
- Img3,
1516
- {
1517
- src: imageUrl,
1518
- style: {
1519
- width: "100%",
1520
- height: "100%",
1521
- objectFit: "cover",
1522
- borderRadius: currentBorderRadius > 0 ? currentBorderRadius - currentBorderWidth : 0
1523
- }
1524
- }
1525
- )
1526
- }
1527
- ),
1528
- frame < flashEnd && /* @__PURE__ */ jsx8(
1529
- AbsoluteFill4,
1530
- {
1531
- style: {
1532
- backgroundColor: "#fff",
1533
- opacity: flashOpacity
1534
- }
1535
- }
1536
- )
1537
- ] });
1538
- }
1539
-
1540
- // src/compositions/ScreenshotAnimationV2.tsx
1541
- import { AbsoluteFill as AbsoluteFill5, Img as Img4, interpolate as interpolate3, useCurrentFrame as useCurrentFrame6, useVideoConfig as useVideoConfig6 } from "remotion";
1542
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1543
1389
  var CONTAINER_ANIMATION_DURATION = 480;
1544
- var CONTAINER_SETTLE_DURATION = 200;
1390
+ var CONTAINER_SETTLE_DURATION = 400;
1545
1391
  var START = {
1546
- ssBorderTop: 0,
1547
- ssBorderTopInner: 5e-3,
1548
- // Small border width
1549
- ssBorderRight: 1,
1392
+ ssBorderTop: 0.0276,
1393
+ ssBorderTopInner: 0.035,
1394
+ ssBorderRight: 0.9883,
1550
1395
  ssBorderLeft: 0,
1551
1396
  ssBorderBottom: 1,
1552
- imgTop: 0.5,
1553
- // 50% down
1554
- imgClipRight: 0.21,
1555
- imgClipBottom: 0.72,
1397
+ imgTop: 0.5125,
1398
+ imgClipRight: 0.2076,
1399
+ imgClipBottom: 0.7103,
1556
1400
  whiteOpacity: 0.824
1557
1401
  };
1558
1402
  var END = {
1559
- ssBorderTop: 0.7455,
1560
- ssBorderTopInner: 0.7508,
1561
- ssBorderRight: 0.321,
1562
- ssBorderLeft: 0.0901,
1563
- ssBorderBottom: 0.9588,
1564
- imgTop: 0.7508,
1565
- // Matches container inner top
1566
- imgClipRight: 0.321,
1567
- // Matches container right (fills width)
1568
- imgClipBottom: 0.9588,
1569
- // Matches container bottom (fills height)
1403
+ ssBorderTop: 0.761,
1404
+ ssBorderTopInner: 0.7663,
1405
+ ssBorderRight: 0.3074,
1406
+ ssBorderLeft: 0.093,
1407
+ ssBorderBottom: 0.9576,
1408
+ imgTop: 0.7566,
1409
+ imgClipRight: 0.3107,
1410
+ imgClipBottom: 0.9569,
1570
1411
  whiteOpacity: 0
1571
1412
  };
1572
1413
  var CLIP_FILL_TIME = 480;
@@ -1584,7 +1425,7 @@ function smoothInterpolate(timeMs, startTime, duration, startValue, endValue, ea
1584
1425
  const easedProgress = easingFn(progress);
1585
1426
  return startValue + (endValue - startValue) * easedProgress;
1586
1427
  }
1587
- function ScreenshotAnimationV2({
1428
+ function ScreenshotAnimation({
1588
1429
  imageUrl,
1589
1430
  width = 1202,
1590
1431
  height = 2618,
@@ -1594,8 +1435,8 @@ function ScreenshotAnimationV2({
1594
1435
  borderColor = "rgba(254, 255, 255, 1)",
1595
1436
  backgroundColor = "#000000"
1596
1437
  }) {
1597
- const frame = useCurrentFrame6();
1598
- const { fps } = useVideoConfig6();
1438
+ const frame = useCurrentFrame5();
1439
+ const { fps } = useVideoConfig5();
1599
1440
  const timeMs = frame / fps * 1e3;
1600
1441
  const flashStartMs = pauseDurationMs;
1601
1442
  const flashEndMs = flashStartMs + flashDurationMs;
@@ -1610,7 +1451,7 @@ function ScreenshotAnimationV2({
1610
1451
  whiteOpacity = 0;
1611
1452
  } else if (isFlashPhase) {
1612
1453
  const flashProgress = (timeMs - flashStartMs) / flashDurationMs;
1613
- whiteOpacity = interpolate3(flashProgress, [0, 0.1, 1], [1, 1, START.whiteOpacity], {
1454
+ whiteOpacity = interpolate2(flashProgress, [0, 0.1, 1], [1, 1, START.whiteOpacity], {
1614
1455
  extrapolateRight: "clamp"
1615
1456
  });
1616
1457
  } else if (isPhase2) {
@@ -1629,11 +1470,11 @@ function ScreenshotAnimationV2({
1629
1470
  let containerRight;
1630
1471
  let containerBottom;
1631
1472
  if (isFlashPhase) {
1632
- containerTop = 0;
1633
- containerTopInner = 5e-3;
1634
- containerLeft = 0;
1635
- containerRight = 1;
1636
- containerBottom = 1;
1473
+ containerTop = START.ssBorderTop;
1474
+ containerTopInner = START.ssBorderTopInner;
1475
+ containerLeft = START.ssBorderLeft;
1476
+ containerRight = START.ssBorderRight;
1477
+ containerBottom = START.ssBorderBottom;
1637
1478
  } else {
1638
1479
  const totalDuration = CONTAINER_ANIMATION_DURATION + CONTAINER_SETTLE_DURATION;
1639
1480
  containerTop = smoothInterpolate(phase2TimeMs, 0, totalDuration, START.ssBorderTop, END.ssBorderTop, easeOutQuart);
@@ -1653,7 +1494,7 @@ function ScreenshotAnimationV2({
1653
1494
  let imgClipRightPercent;
1654
1495
  let imgClipBottomPercent;
1655
1496
  if (isFlashPhase) {
1656
- imgTopPercent = 0.5;
1497
+ imgTopPercent = START.imgTop;
1657
1498
  imgClipRightPercent = START.imgClipRight;
1658
1499
  imgClipBottomPercent = START.imgClipBottom;
1659
1500
  } else {
@@ -1678,16 +1519,15 @@ function ScreenshotAnimationV2({
1678
1519
  easeOutQuart
1679
1520
  );
1680
1521
  const innerBorderRadius = (borderRadius - borderWidth) * cornerProgress;
1681
- const grayGapHeight = Math.max(0, (imgTopPercent - containerTopInner) * height);
1682
1522
  const smallClipTop = imgTopPercent * height;
1683
1523
  const smallClipRight = imgClipRightPercent * width;
1684
1524
  const smallClipBottom = imgClipBottomPercent * height;
1685
1525
  const smallClipLeft = containerLeft * width + borderWidth;
1686
1526
  const smallClipWidth = smallClipRight - smallClipLeft;
1687
1527
  const smallClipHeight = smallClipBottom - smallClipTop;
1688
- return /* @__PURE__ */ jsxs7(AbsoluteFill5, { style: { backgroundColor }, children: [
1689
- /* @__PURE__ */ jsx9(
1690
- Img4,
1528
+ return /* @__PURE__ */ jsxs6(AbsoluteFill4, { style: { backgroundColor }, children: [
1529
+ /* @__PURE__ */ jsx8(
1530
+ Img3,
1691
1531
  {
1692
1532
  src: imageUrl,
1693
1533
  style: {
@@ -1700,7 +1540,7 @@ function ScreenshotAnimationV2({
1700
1540
  }
1701
1541
  }
1702
1542
  ),
1703
- showContainer && /* @__PURE__ */ jsxs7(
1543
+ showContainer && /* @__PURE__ */ jsxs6(
1704
1544
  "div",
1705
1545
  {
1706
1546
  style: {
@@ -1715,7 +1555,7 @@ function ScreenshotAnimationV2({
1715
1555
  overflow: "hidden"
1716
1556
  },
1717
1557
  children: [
1718
- /* @__PURE__ */ jsxs7(
1558
+ /* @__PURE__ */ jsxs6(
1719
1559
  "div",
1720
1560
  {
1721
1561
  style: {
@@ -1729,7 +1569,7 @@ function ScreenshotAnimationV2({
1729
1569
  borderRadius: `${borderRadius - borderWidth}px ${borderRadius - borderWidth}px ${innerBorderRadius}px ${innerBorderRadius}px`
1730
1570
  },
1731
1571
  children: [
1732
- !thumbnailFilled && /* @__PURE__ */ jsx9(
1572
+ !thumbnailFilled && /* @__PURE__ */ jsx8(
1733
1573
  "div",
1734
1574
  {
1735
1575
  style: {
@@ -1742,7 +1582,7 @@ function ScreenshotAnimationV2({
1742
1582
  }
1743
1583
  }
1744
1584
  ),
1745
- !thumbnailFilled && /* @__PURE__ */ jsx9(
1585
+ !thumbnailFilled && /* @__PURE__ */ jsx8(
1746
1586
  "div",
1747
1587
  {
1748
1588
  style: {
@@ -1753,8 +1593,8 @@ function ScreenshotAnimationV2({
1753
1593
  height,
1754
1594
  overflow: "hidden"
1755
1595
  },
1756
- children: /* @__PURE__ */ jsx9(
1757
- Img4,
1596
+ children: /* @__PURE__ */ jsx8(
1597
+ Img3,
1758
1598
  {
1759
1599
  src: imageUrl,
1760
1600
  style: {
@@ -1766,7 +1606,7 @@ function ScreenshotAnimationV2({
1766
1606
  )
1767
1607
  }
1768
1608
  ),
1769
- showSmallClip && /* @__PURE__ */ jsx9(
1609
+ showSmallClip && /* @__PURE__ */ jsx8(
1770
1610
  "div",
1771
1611
  {
1772
1612
  style: {
@@ -1777,8 +1617,8 @@ function ScreenshotAnimationV2({
1777
1617
  height: thumbnailFilled ? contentH : smallClipHeight,
1778
1618
  overflow: "hidden"
1779
1619
  },
1780
- children: /* @__PURE__ */ jsx9(
1781
- Img4,
1620
+ children: /* @__PURE__ */ jsx8(
1621
+ Img3,
1782
1622
  {
1783
1623
  src: imageUrl,
1784
1624
  style: {
@@ -1793,7 +1633,7 @@ function ScreenshotAnimationV2({
1793
1633
  ]
1794
1634
  }
1795
1635
  ),
1796
- whiteOpacity > 1e-3 && /* @__PURE__ */ jsx9(
1636
+ whiteOpacity > 1e-3 && /* @__PURE__ */ jsx8(
1797
1637
  "div",
1798
1638
  {
1799
1639
  style: {
@@ -1898,7 +1738,7 @@ function useResolvedPositions(elements, textValues) {
1898
1738
  // src/Root.tsx
1899
1739
  import { Composition } from "remotion";
1900
1740
  import { z } from "zod";
1901
- import { Fragment, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1741
+ import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1902
1742
  var defaultImageProps = {
1903
1743
  config: {
1904
1744
  width: 1080,
@@ -1941,32 +1781,6 @@ var defaultAutoCaptionProps = {
1941
1781
  }
1942
1782
  };
1943
1783
  var defaultScreenshotAnimationProps = {
1944
- imageUrl: "https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=1080&h=1920&fit=crop",
1945
- width: 1080,
1946
- height: 1920,
1947
- // Timing
1948
- flashDurationMs: 100,
1949
- shrinkDurationMs: 300,
1950
- pauseDurationMs: 800,
1951
- dismissDurationMs: 250,
1952
- // Image styling
1953
- imageCornerRadius: 0,
1954
- thumbnailCornerRadius: 24,
1955
- // Border
1956
- borderWidth: 0,
1957
- borderColor: "rgba(255, 255, 255, 0.3)",
1958
- // Thumbnail positioning
1959
- thumbnailScale: 0.15,
1960
- thumbnailPadding: 20,
1961
- bottomOffset: 80,
1962
- // Spring physics
1963
- springDamping: 15,
1964
- springStiffness: 120,
1965
- springMass: 0.8,
1966
- // Background
1967
- backgroundColor: "#000000"
1968
- };
1969
- var defaultScreenshotAnimationV2Props = {
1970
1784
  imageUrl: "https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3163-RY0CFNrbnSnqZpaJzi9VdslzfYLLKf.png",
1971
1785
  width: 1202,
1972
1786
  height: 2618,
@@ -1976,7 +1790,7 @@ var defaultScreenshotAnimationV2Props = {
1976
1790
  borderColor: "rgba(254, 255, 255, 1)",
1977
1791
  backgroundColor: "#000000"
1978
1792
  };
1979
- var screenshotAnimationV2Schema = z.object({
1793
+ var screenshotAnimationSchema = z.object({
1980
1794
  imageUrl: z.string().describe("URL of the image being screenshotted"),
1981
1795
  width: z.number().optional().default(1202).describe("Canvas width (px)"),
1982
1796
  height: z.number().optional().default(2618).describe("Canvas height (px)"),
@@ -1986,38 +1800,10 @@ var screenshotAnimationV2Schema = z.object({
1986
1800
  borderColor: z.string().optional().default("rgba(254, 255, 255, 1)").describe("Border color"),
1987
1801
  backgroundColor: z.string().optional().default("#000000").describe("Background color")
1988
1802
  });
1989
- var screenshotAnimationSchema = z.object({
1990
- // Core
1991
- imageUrl: z.string().describe("URL of the image to screenshot"),
1992
- width: z.number().optional().default(1080).describe("Canvas width (px)"),
1993
- height: z.number().optional().default(1920).describe("Canvas height (px)"),
1994
- // Timing
1995
- flashDurationMs: z.number().optional().default(100).describe("Flash duration (ms)"),
1996
- shrinkDurationMs: z.number().optional().default(300).describe("Shrink animation duration (ms)"),
1997
- pauseDurationMs: z.number().optional().default(800).describe("Pause before dismiss (ms)"),
1998
- dismissDurationMs: z.number().optional().default(250).describe("Dismiss slide duration (ms)"),
1999
- // Image styling
2000
- imageCornerRadius: z.number().optional().default(0).describe("Corner radius at full size (px)"),
2001
- thumbnailCornerRadius: z.number().optional().default(24).describe("Corner radius of thumbnail (px)"),
2002
- // Border
2003
- borderWidth: z.number().optional().default(0).describe("Border width (px)"),
2004
- borderColor: z.string().optional().default("rgba(255, 255, 255, 0.3)").describe("Border color"),
2005
- // Thumbnail positioning
2006
- thumbnailScale: z.number().optional().default(0.15).describe("Thumbnail scale (0-1)"),
2007
- thumbnailPadding: z.number().optional().default(20).describe("Padding from edge (px)"),
2008
- bottomOffset: z.number().optional().default(80).describe("Extra bottom offset (px)"),
2009
- // Spring physics
2010
- springDamping: z.number().optional().default(15).describe("Spring damping (higher = less bounce)"),
2011
- springStiffness: z.number().optional().default(120).describe("Spring stiffness (higher = faster)"),
2012
- springMass: z.number().optional().default(0.8).describe("Spring mass"),
2013
- // Background
2014
- backgroundColor: z.string().optional().default("#000000").describe("Background color")
2015
- });
2016
1803
  var ImageComp = ImageEditorComposition;
2017
1804
  var VideoComp = VideoEditorComposition;
2018
1805
  var AutoCaptionComp = AutoCaptionComposition;
2019
- var ScreenshotAnimationComp = ScreenshotAnimationComposition;
2020
- var ScreenshotAnimationV2Comp = ScreenshotAnimationV2;
1806
+ var ScreenshotAnimationComp = ScreenshotAnimation;
2021
1807
  var calculateImageMetadata = async ({ props }) => {
2022
1808
  console.log("[calculateMetadata] Starting metadata calculation...");
2023
1809
  const canvasWidth = props.width ?? props.config?.width ?? 1080;
@@ -2068,8 +1854,8 @@ var calculateImageMetadata = async ({ props }) => {
2068
1854
  };
2069
1855
  };
2070
1856
  var RenderRoot = () => {
2071
- return /* @__PURE__ */ jsxs8(Fragment, { children: [
2072
- /* @__PURE__ */ jsx10(
1857
+ return /* @__PURE__ */ jsxs7(Fragment, { children: [
1858
+ /* @__PURE__ */ jsx9(
2073
1859
  Composition,
2074
1860
  {
2075
1861
  id: "ImageEditorComposition",
@@ -2082,7 +1868,7 @@ var RenderRoot = () => {
2082
1868
  defaultProps: defaultImageProps
2083
1869
  }
2084
1870
  ),
2085
- /* @__PURE__ */ jsx10(
1871
+ /* @__PURE__ */ jsx9(
2086
1872
  Composition,
2087
1873
  {
2088
1874
  id: "VideoEditorComposition",
@@ -2094,7 +1880,7 @@ var RenderRoot = () => {
2094
1880
  defaultProps: defaultVideoProps
2095
1881
  }
2096
1882
  ),
2097
- /* @__PURE__ */ jsx10(
1883
+ /* @__PURE__ */ jsx9(
2098
1884
  Composition,
2099
1885
  {
2100
1886
  id: "AutoCaptionComposition",
@@ -2106,30 +1892,17 @@ var RenderRoot = () => {
2106
1892
  defaultProps: defaultAutoCaptionProps
2107
1893
  }
2108
1894
  ),
2109
- /* @__PURE__ */ jsx10(
1895
+ /* @__PURE__ */ jsx9(
2110
1896
  Composition,
2111
1897
  {
2112
1898
  id: "ScreenshotAnimationComposition",
2113
1899
  component: ScreenshotAnimationComp,
2114
1900
  schema: screenshotAnimationSchema,
2115
- durationInFrames: 60,
2116
- fps: 30,
2117
- width: 1080,
2118
- height: 1920,
2119
- defaultProps: defaultScreenshotAnimationProps
2120
- }
2121
- ),
2122
- /* @__PURE__ */ jsx10(
2123
- Composition,
2124
- {
2125
- id: "ScreenshotAnimationV2",
2126
- component: ScreenshotAnimationV2Comp,
2127
- schema: screenshotAnimationV2Schema,
2128
1901
  durationInFrames: 90,
2129
1902
  fps: 30,
2130
1903
  width: 1202,
2131
1904
  height: 2618,
2132
- defaultProps: defaultScreenshotAnimationV2Props
1905
+ defaultProps: defaultScreenshotAnimationProps
2133
1906
  }
2134
1907
  )
2135
1908
  ] });
@@ -2154,8 +1927,7 @@ export {
2154
1927
  LEVEL_4_CONFIG,
2155
1928
  LEVEL_5_CONFIG,
2156
1929
  RenderRoot,
2157
- ScreenshotAnimationComposition,
2158
- ScreenshotAnimationV2,
1930
+ ScreenshotAnimation,
2159
1931
  TEXT_DEFAULTS,
2160
1932
  TextElement,
2161
1933
  VIDEO_DEFAULTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc-render",
3
- "version": "1.8.15",
3
+ "version": "1.8.16",
4
4
  "description": "Unified rendering package for UGC Inc - shared types, components, and compositions for pixel-perfect client/server rendering",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",