@klikeai/cut-preview 1.0.0 → 1.0.2
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.ts +5 -0
- package/dist/index.js +90 -70
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,11 @@ interface CaptionStyle {
|
|
|
61
61
|
template?: CaptionTemplate;
|
|
62
62
|
/** Âncora vertical do bloco (sempre dentro das safe zones). */
|
|
63
63
|
position?: 'bottom' | 'center' | 'top';
|
|
64
|
+
/** Fundo do bloco (hex #RRGGBB) — vale p/ QUALQUER template; '' = sem
|
|
65
|
+
* fundo (o template pill mantém o fundo escuro default). */
|
|
66
|
+
backgroundColor?: string;
|
|
67
|
+
/** Opacidade do fundo 0-1 (default 0.72; usada com backgroundColor). */
|
|
68
|
+
backgroundOpacity?: number;
|
|
64
69
|
}
|
|
65
70
|
interface CaptionsProps {
|
|
66
71
|
enabled: boolean;
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,9 @@ var DEFAULT_CAPTION_STYLE = {
|
|
|
21
21
|
activeScale: 1.15,
|
|
22
22
|
animateIn: true,
|
|
23
23
|
template: "classic",
|
|
24
|
-
position: "bottom"
|
|
24
|
+
position: "bottom",
|
|
25
|
+
backgroundColor: "",
|
|
26
|
+
backgroundOpacity: 0.72
|
|
25
27
|
};
|
|
26
28
|
var DEFAULT_CAPTION_DISPLAY_MODE = "highlight";
|
|
27
29
|
var DEFAULT_CAPTION_COMBINE_MS = 1200;
|
|
@@ -184,11 +186,23 @@ var resolveCutTransition = (theme, explicitType, explicitMs) => {
|
|
|
184
186
|
};
|
|
185
187
|
|
|
186
188
|
// ../src/layers/VideoBase.tsx
|
|
187
|
-
import { AbsoluteFill
|
|
189
|
+
import { AbsoluteFill } from "remotion";
|
|
190
|
+
|
|
191
|
+
// ../src/layers/SmartVideo.tsx
|
|
192
|
+
import { getRemotionEnvironment, OffthreadVideo, Video } from "remotion";
|
|
188
193
|
import { jsx } from "react/jsx-runtime";
|
|
194
|
+
var SmartVideo = (props) => {
|
|
195
|
+
if (getRemotionEnvironment().isRendering) {
|
|
196
|
+
return /* @__PURE__ */ jsx(OffthreadVideo, { ...props });
|
|
197
|
+
}
|
|
198
|
+
return /* @__PURE__ */ jsx(Video, { ...props });
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// ../src/layers/VideoBase.tsx
|
|
202
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
189
203
|
var VideoBase = ({ source, fit = "cover" }) => {
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
|
|
204
|
+
return /* @__PURE__ */ jsx2(AbsoluteFill, { children: /* @__PURE__ */ jsx2(
|
|
205
|
+
SmartVideo,
|
|
192
206
|
{
|
|
193
207
|
src: source.videoPath,
|
|
194
208
|
style: { width: "100%", height: "100%", objectFit: fit }
|
|
@@ -197,15 +211,15 @@ var VideoBase = ({ source, fit = "cover" }) => {
|
|
|
197
211
|
};
|
|
198
212
|
|
|
199
213
|
// ../src/layers/ReframeContainer.tsx
|
|
200
|
-
import { AbsoluteFill as AbsoluteFill2
|
|
201
|
-
import { Fragment, jsx as
|
|
214
|
+
import { AbsoluteFill as AbsoluteFill2 } from "remotion";
|
|
215
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
202
216
|
var ReframeContainer = ({ reframe, source, children }) => {
|
|
203
217
|
if (!reframe.enabled) {
|
|
204
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */ jsx3(Fragment, { children });
|
|
205
219
|
}
|
|
206
220
|
return /* @__PURE__ */ jsxs(AbsoluteFill2, { children: [
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
|
|
221
|
+
/* @__PURE__ */ jsx3(AbsoluteFill2, { children: /* @__PURE__ */ jsx3(
|
|
222
|
+
SmartVideo,
|
|
209
223
|
{
|
|
210
224
|
src: source.videoPath,
|
|
211
225
|
muted: true,
|
|
@@ -218,7 +232,7 @@ var ReframeContainer = ({ reframe, source, children }) => {
|
|
|
218
232
|
}
|
|
219
233
|
}
|
|
220
234
|
) }),
|
|
221
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ jsx3(
|
|
222
236
|
AbsoluteFill2,
|
|
223
237
|
{
|
|
224
238
|
style: { alignItems: "center", justifyContent: "center" },
|
|
@@ -229,12 +243,7 @@ var ReframeContainer = ({ reframe, source, children }) => {
|
|
|
229
243
|
};
|
|
230
244
|
|
|
231
245
|
// ../src/layers/CutsSequencer.tsx
|
|
232
|
-
import {
|
|
233
|
-
AbsoluteFill as AbsoluteFill3,
|
|
234
|
-
interpolate as interpolate2,
|
|
235
|
-
OffthreadVideo as OffthreadVideo3,
|
|
236
|
-
useVideoConfig
|
|
237
|
-
} from "remotion";
|
|
246
|
+
import { AbsoluteFill as AbsoluteFill3, interpolate as interpolate2, useVideoConfig } from "remotion";
|
|
238
247
|
import {
|
|
239
248
|
linearTiming,
|
|
240
249
|
TransitionSeries
|
|
@@ -284,6 +293,13 @@ var gradeFilter = (preset, intensity) => {
|
|
|
284
293
|
if (t.hueDeg !== void 0) parts.push(`hue-rotate(${lerp(0, t.hueDeg)}deg)`);
|
|
285
294
|
return parts.length ? parts.join(" ") : "none";
|
|
286
295
|
};
|
|
296
|
+
var hexToRgba = (hex, alpha = 1) => {
|
|
297
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
|
|
298
|
+
if (!m) return hex;
|
|
299
|
+
const n = parseInt(m[1], 16);
|
|
300
|
+
const a = Math.max(0, Math.min(alpha, 1));
|
|
301
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${a})`;
|
|
302
|
+
};
|
|
287
303
|
var textOutline = (color, px = 3) => {
|
|
288
304
|
const o = [];
|
|
289
305
|
for (let dx = -px; dx <= px; dx++) {
|
|
@@ -296,7 +312,7 @@ var textOutline = (color, px = 3) => {
|
|
|
296
312
|
};
|
|
297
313
|
|
|
298
314
|
// ../src/layers/CutsSequencer.tsx
|
|
299
|
-
import { jsx as
|
|
315
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
300
316
|
var presentationFor = (type) => {
|
|
301
317
|
if (type === "wipe") return wipe();
|
|
302
318
|
if (type === "slide") return slide();
|
|
@@ -328,8 +344,8 @@ var SegmentVideo = ({
|
|
|
328
344
|
}
|
|
329
345
|
return v;
|
|
330
346
|
};
|
|
331
|
-
const fg = /* @__PURE__ */
|
|
332
|
-
|
|
347
|
+
const fg = /* @__PURE__ */ jsx4(
|
|
348
|
+
SmartVideo,
|
|
333
349
|
{
|
|
334
350
|
src: source.videoPath,
|
|
335
351
|
startFrom: startFromFrames,
|
|
@@ -342,11 +358,11 @@ var SegmentVideo = ({
|
|
|
342
358
|
}
|
|
343
359
|
);
|
|
344
360
|
if (!reframe.enabled) {
|
|
345
|
-
return /* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ jsx4(AbsoluteFill3, { children: fg });
|
|
346
362
|
}
|
|
347
363
|
return /* @__PURE__ */ jsxs2(AbsoluteFill3, { children: [
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
|
|
364
|
+
/* @__PURE__ */ jsx4(AbsoluteFill3, { children: /* @__PURE__ */ jsx4(
|
|
365
|
+
SmartVideo,
|
|
350
366
|
{
|
|
351
367
|
src: source.videoPath,
|
|
352
368
|
startFrom: startFromFrames,
|
|
@@ -360,7 +376,7 @@ var SegmentVideo = ({
|
|
|
360
376
|
}
|
|
361
377
|
}
|
|
362
378
|
) }),
|
|
363
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ jsx4(AbsoluteFill3, { style: { alignItems: "center", justifyContent: "center" }, children: fg })
|
|
364
380
|
] });
|
|
365
381
|
};
|
|
366
382
|
var CutsSequencer = ({ source, cuts, reframe, transition }) => {
|
|
@@ -379,11 +395,11 @@ var CutsSequencer = ({ source, cuts, reframe, transition }) => {
|
|
|
379
395
|
const fadeInF = i > 0 ? transF : 0;
|
|
380
396
|
const fadeOutF = i < segments.length - 1 ? transF : 0;
|
|
381
397
|
children.push(
|
|
382
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ jsx4(
|
|
383
399
|
TransitionSeries.Sequence,
|
|
384
400
|
{
|
|
385
401
|
durationInFrames,
|
|
386
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ jsx4(
|
|
387
403
|
SegmentVideo,
|
|
388
404
|
{
|
|
389
405
|
source,
|
|
@@ -400,7 +416,7 @@ var CutsSequencer = ({ source, cuts, reframe, transition }) => {
|
|
|
400
416
|
);
|
|
401
417
|
if (useTransition && i < segments.length - 1) {
|
|
402
418
|
children.push(
|
|
403
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ jsx4(
|
|
404
420
|
TransitionSeries.Transition,
|
|
405
421
|
{
|
|
406
422
|
presentation: presentationFor(transition.type),
|
|
@@ -411,12 +427,12 @@ var CutsSequencer = ({ source, cuts, reframe, transition }) => {
|
|
|
411
427
|
);
|
|
412
428
|
}
|
|
413
429
|
});
|
|
414
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ jsx4(TransitionSeries, { children });
|
|
415
431
|
};
|
|
416
432
|
|
|
417
433
|
// ../src/layers/ZoomLayer.tsx
|
|
418
434
|
import { AbsoluteFill as AbsoluteFill4, spring as spring2, useCurrentFrame } from "remotion";
|
|
419
|
-
import { Fragment as Fragment2, jsx as
|
|
435
|
+
import { Fragment as Fragment2, jsx as jsx5 } from "react/jsx-runtime";
|
|
420
436
|
var momentScaleBoost = (frame, fps, moment) => {
|
|
421
437
|
const startF = msToFrames(moment.startMs, fps);
|
|
422
438
|
const endF = msToFrames(moment.endMs, fps);
|
|
@@ -438,7 +454,7 @@ var momentScaleBoost = (frame, fps, moment) => {
|
|
|
438
454
|
var ZoomLayer = ({ zoom, fps, children }) => {
|
|
439
455
|
const frame = useCurrentFrame();
|
|
440
456
|
if (!zoom.enabled) {
|
|
441
|
-
return /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ jsx5(Fragment2, { children });
|
|
442
458
|
}
|
|
443
459
|
const moments = zoom.moments?.length ? zoom.moments : [{ startMs: zoom.startMs, endMs: zoom.endMs, factor: zoom.factor }];
|
|
444
460
|
let scale = 1;
|
|
@@ -456,7 +472,7 @@ var ZoomLayer = ({ zoom, fps, children }) => {
|
|
|
456
472
|
}
|
|
457
473
|
}
|
|
458
474
|
}
|
|
459
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ jsx5(AbsoluteFill4, { style: { transform: `scale(${scale})` }, children });
|
|
460
476
|
};
|
|
461
477
|
|
|
462
478
|
// ../src/layers/CaptionsLayer.tsx
|
|
@@ -505,7 +521,7 @@ function resolveFontFamily(name) {
|
|
|
505
521
|
var AVAILABLE_FONTS = Object.keys(FONTS).filter((k) => FONTS[k]);
|
|
506
522
|
|
|
507
523
|
// ../src/layers/CaptionsLayer.tsx
|
|
508
|
-
import { Fragment as Fragment3, jsx as
|
|
524
|
+
import { Fragment as Fragment3, jsx as jsx6 } from "react/jsx-runtime";
|
|
509
525
|
var glowShadow = (color, scale = 1) => `0 0 ${8 * scale}px ${color}, 0 0 ${18 * scale}px ${color}, 0 0 ${36 * scale}px ${color}66`;
|
|
510
526
|
var Page = ({ page, style, displayMode, safeZones }) => {
|
|
511
527
|
const frame = useCurrentFrame2();
|
|
@@ -543,7 +559,7 @@ var Page = ({ page, style, displayMode, safeZones }) => {
|
|
|
543
559
|
scale = springScale(frame - tokenStartFrame, fps, style.activeScale);
|
|
544
560
|
}
|
|
545
561
|
const boxed = template === "box" && highlight;
|
|
546
|
-
return /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ jsx6(
|
|
547
563
|
"span",
|
|
548
564
|
{
|
|
549
565
|
style: {
|
|
@@ -565,7 +581,7 @@ var Page = ({ page, style, displayMode, safeZones }) => {
|
|
|
565
581
|
);
|
|
566
582
|
};
|
|
567
583
|
const position = style.position;
|
|
568
|
-
return /* @__PURE__ */
|
|
584
|
+
return /* @__PURE__ */ jsx6(
|
|
569
585
|
AbsoluteFill5,
|
|
570
586
|
{
|
|
571
587
|
style: {
|
|
@@ -576,7 +592,7 @@ var Page = ({ page, style, displayMode, safeZones }) => {
|
|
|
576
592
|
paddingLeft: width * safeZones.marginSidePercent,
|
|
577
593
|
paddingRight: width * safeZones.marginSidePercent
|
|
578
594
|
},
|
|
579
|
-
children: /* @__PURE__ */
|
|
595
|
+
children: /* @__PURE__ */ jsx6(
|
|
580
596
|
"div",
|
|
581
597
|
{
|
|
582
598
|
style: {
|
|
@@ -585,12 +601,16 @@ var Page = ({ page, style, displayMode, safeZones }) => {
|
|
|
585
601
|
lineHeight: 1.25,
|
|
586
602
|
opacity: enter,
|
|
587
603
|
transform: `scale(${interpolate3(enter, [0, 1], [0.92, 1])})`,
|
|
588
|
-
//
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
604
|
+
// Fundo do bloco: override explícito (backgroundColor+opacity) vale
|
|
605
|
+
// p/ QUALQUER template; sem override, só o pill tem o fundo default.
|
|
606
|
+
...(() => {
|
|
607
|
+
const blockBg = style.backgroundColor ? hexToRgba(style.backgroundColor, style.backgroundOpacity) : template === "pill" ? "rgba(12, 12, 14, 0.72)" : void 0;
|
|
608
|
+
return blockBg ? {
|
|
609
|
+
backgroundColor: blockBg,
|
|
610
|
+
borderRadius: 22 * ui,
|
|
611
|
+
padding: "0.35em 0.6em"
|
|
612
|
+
} : {};
|
|
613
|
+
})()
|
|
594
614
|
},
|
|
595
615
|
children: page.tokens.map((t, i) => renderToken(t.text, t.fromMs, t.toMs, i))
|
|
596
616
|
}
|
|
@@ -628,16 +648,16 @@ var CaptionsLayer = ({ captions, style, displayMode, combineTokensWithinMs, safe
|
|
|
628
648
|
combineTokensWithinMilliseconds: combineTokensWithinMs
|
|
629
649
|
}).pages;
|
|
630
650
|
});
|
|
631
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ jsx6(Fragment3, { children: pages.map((page, i) => {
|
|
632
652
|
const from = msToFrames(page.startMs, fps);
|
|
633
653
|
const durationInFrames = Math.max(1, msToFrames(page.durationMs, fps));
|
|
634
|
-
return /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ jsx6(
|
|
635
655
|
Sequence,
|
|
636
656
|
{
|
|
637
657
|
from,
|
|
638
658
|
durationInFrames,
|
|
639
659
|
name: `caption-page-${i}`,
|
|
640
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */ jsx6(
|
|
641
661
|
Page,
|
|
642
662
|
{
|
|
643
663
|
page,
|
|
@@ -662,7 +682,7 @@ import {
|
|
|
662
682
|
useVideoConfig as useVideoConfig3
|
|
663
683
|
} from "remotion";
|
|
664
684
|
import { fitText } from "@remotion/layout-utils";
|
|
665
|
-
import { Fragment as Fragment4, jsx as
|
|
685
|
+
import { Fragment as Fragment4, jsx as jsx7 } from "react/jsx-runtime";
|
|
666
686
|
var DEFAULT_FADE_MS = 300;
|
|
667
687
|
var DEFAULT_FONT_SIZE = 72;
|
|
668
688
|
var DEFAULT_COLOR = "#FFFFFF";
|
|
@@ -746,7 +766,7 @@ var OverlayText = ({ item, durationInFrames, fps, safeZones, captionsPosition })
|
|
|
746
766
|
const overlayPos = item.position ?? "center";
|
|
747
767
|
const bottomClearance = safeZones.marginBottomPercent + (captionsPosition === "bottom" && overlayPos === "bottom" ? CAPTION_BAND_PCT : 0);
|
|
748
768
|
const topClearance = safeZones.marginTopPercent + (captionsPosition === "top" && overlayPos === "top" ? CAPTION_BAND_PCT : 0);
|
|
749
|
-
return /* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ jsx7(
|
|
750
770
|
AbsoluteFill6,
|
|
751
771
|
{
|
|
752
772
|
style: {
|
|
@@ -757,7 +777,7 @@ var OverlayText = ({ item, durationInFrames, fps, safeZones, captionsPosition })
|
|
|
757
777
|
paddingLeft: width * safeZones.marginSidePercent,
|
|
758
778
|
paddingRight: width * safeZones.marginSidePercent
|
|
759
779
|
},
|
|
760
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ jsx7(
|
|
761
781
|
"div",
|
|
762
782
|
{
|
|
763
783
|
style: {
|
|
@@ -781,19 +801,19 @@ var OverlayText = ({ item, durationInFrames, fps, safeZones, captionsPosition })
|
|
|
781
801
|
};
|
|
782
802
|
var OverlayLayer = ({ overlays, safeZones, fps, captionsPosition = null }) => {
|
|
783
803
|
if (!overlays || overlays.length === 0) return null;
|
|
784
|
-
return /* @__PURE__ */
|
|
804
|
+
return /* @__PURE__ */ jsx7(Fragment4, { children: overlays.map((item, i) => {
|
|
785
805
|
const from = msToFrames(item.startMs, fps);
|
|
786
806
|
const durationInFrames = Math.max(
|
|
787
807
|
1,
|
|
788
808
|
msToFrames(item.endMs, fps) - from
|
|
789
809
|
);
|
|
790
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ jsx7(
|
|
791
811
|
Sequence2,
|
|
792
812
|
{
|
|
793
813
|
from,
|
|
794
814
|
durationInFrames,
|
|
795
815
|
name: `overlay-${i}`,
|
|
796
|
-
children: /* @__PURE__ */
|
|
816
|
+
children: /* @__PURE__ */ jsx7(
|
|
797
817
|
OverlayText,
|
|
798
818
|
{
|
|
799
819
|
item,
|
|
@@ -818,7 +838,7 @@ import {
|
|
|
818
838
|
useCurrentFrame as useCurrentFrame4,
|
|
819
839
|
useVideoConfig as useVideoConfig4
|
|
820
840
|
} from "remotion";
|
|
821
|
-
import { Fragment as Fragment5, jsx as
|
|
841
|
+
import { Fragment as Fragment5, jsx as jsx8 } from "react/jsx-runtime";
|
|
822
842
|
var FADE_MS = 300;
|
|
823
843
|
var alignFor = (corner) => {
|
|
824
844
|
const vertical = corner.startsWith("top") ? "flex-start" : corner.startsWith("bottom") ? "flex-end" : "center";
|
|
@@ -836,7 +856,7 @@ var ImageOverlay = ({ item, durationInFrames, fps, safeZones }) => {
|
|
|
836
856
|
{ extrapolateLeft: "clamp", extrapolateRight: "clamp" }
|
|
837
857
|
) * item.opacity;
|
|
838
858
|
const { vertical, horizontal } = alignFor(item.corner);
|
|
839
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ jsx8(
|
|
840
860
|
AbsoluteFill7,
|
|
841
861
|
{
|
|
842
862
|
style: {
|
|
@@ -847,7 +867,7 @@ var ImageOverlay = ({ item, durationInFrames, fps, safeZones }) => {
|
|
|
847
867
|
paddingLeft: width * safeZones.marginSidePercent,
|
|
848
868
|
paddingRight: width * safeZones.marginSidePercent
|
|
849
869
|
},
|
|
850
|
-
children: /* @__PURE__ */
|
|
870
|
+
children: /* @__PURE__ */ jsx8(
|
|
851
871
|
Img,
|
|
852
872
|
{
|
|
853
873
|
src: item.src,
|
|
@@ -865,19 +885,19 @@ var ImageOverlay = ({ item, durationInFrames, fps, safeZones }) => {
|
|
|
865
885
|
};
|
|
866
886
|
var ImageOverlayLayer = ({ imageOverlays, safeZones, fps }) => {
|
|
867
887
|
if (!imageOverlays || imageOverlays.length === 0) return null;
|
|
868
|
-
return /* @__PURE__ */
|
|
888
|
+
return /* @__PURE__ */ jsx8(Fragment5, { children: imageOverlays.map((item, i) => {
|
|
869
889
|
const from = msToFrames(item.startMs, fps);
|
|
870
890
|
const durationInFrames = Math.max(
|
|
871
891
|
1,
|
|
872
892
|
msToFrames(item.endMs, fps) - from
|
|
873
893
|
);
|
|
874
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ jsx8(
|
|
875
895
|
Sequence3,
|
|
876
896
|
{
|
|
877
897
|
from,
|
|
878
898
|
durationInFrames,
|
|
879
899
|
name: `image-overlay-${i}`,
|
|
880
|
-
children: /* @__PURE__ */
|
|
900
|
+
children: /* @__PURE__ */ jsx8(
|
|
881
901
|
ImageOverlay,
|
|
882
902
|
{
|
|
883
903
|
item,
|
|
@@ -894,14 +914,14 @@ var ImageOverlayLayer = ({ imageOverlays, safeZones, fps }) => {
|
|
|
894
914
|
|
|
895
915
|
// ../src/layers/ProgressBarLayer.tsx
|
|
896
916
|
import { useCurrentFrame as useCurrentFrame5, useVideoConfig as useVideoConfig5 } from "remotion";
|
|
897
|
-
import { jsx as
|
|
917
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
898
918
|
var ProgressBarLayer = ({ progressBar, sourceDurationInSeconds, fps }) => {
|
|
899
919
|
const frame = useCurrentFrame5();
|
|
900
920
|
const { width, height } = useVideoConfig5();
|
|
901
921
|
if (!progressBar.enabled || sourceDurationInSeconds <= 0) return null;
|
|
902
922
|
const totalFrames = Math.max(1, Math.round(sourceDurationInSeconds * fps));
|
|
903
923
|
const progress = Math.min(1, frame / totalFrames);
|
|
904
|
-
return /* @__PURE__ */
|
|
924
|
+
return /* @__PURE__ */ jsx9(
|
|
905
925
|
"div",
|
|
906
926
|
{
|
|
907
927
|
style: {
|
|
@@ -928,7 +948,7 @@ import {
|
|
|
928
948
|
useCurrentFrame as useCurrentFrame6,
|
|
929
949
|
useVideoConfig as useVideoConfig6
|
|
930
950
|
} from "remotion";
|
|
931
|
-
import { jsx as
|
|
951
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
932
952
|
var DEFAULT_GRADIENT_ANGLE_DEG = 160;
|
|
933
953
|
var DEFAULT_LOGO_HEIGHT_PX = 140;
|
|
934
954
|
var backgroundStyle = (endcard) => {
|
|
@@ -973,7 +993,7 @@ var EndcardCard = ({
|
|
|
973
993
|
padding: "8%"
|
|
974
994
|
},
|
|
975
995
|
children: [
|
|
976
|
-
endcard.logoUrl ? /* @__PURE__ */
|
|
996
|
+
endcard.logoUrl ? /* @__PURE__ */ jsx10(
|
|
977
997
|
Img2,
|
|
978
998
|
{
|
|
979
999
|
src: endcard.logoUrl,
|
|
@@ -986,7 +1006,7 @@ var EndcardCard = ({
|
|
|
986
1006
|
}
|
|
987
1007
|
}
|
|
988
1008
|
) : null,
|
|
989
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ jsx10(
|
|
990
1010
|
"div",
|
|
991
1011
|
{
|
|
992
1012
|
style: {
|
|
@@ -1012,11 +1032,11 @@ var EndcardSequence = ({ endcard, sourceDurationInSeconds, fps }) => {
|
|
|
1012
1032
|
if (!endcard.enabled || !endcard.text) return null;
|
|
1013
1033
|
const from = Math.round(sourceDurationInSeconds * fps);
|
|
1014
1034
|
const durationInFrames = Math.max(1, msToFrames(endcard.durationMs, fps));
|
|
1015
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ jsx10(Sequence4, { from, durationInFrames, name: "endcard", children: /* @__PURE__ */ jsx10(EndcardCard, { endcard, fps }) });
|
|
1016
1036
|
};
|
|
1017
1037
|
|
|
1018
1038
|
// ../src/SmartStudioComposition.tsx
|
|
1019
|
-
import { jsx as
|
|
1039
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1020
1040
|
var SmartStudioComposition = (props) => {
|
|
1021
1041
|
const { source, output, captions, overlays, endcard, safeZones, reframe, zoom, cuts } = props;
|
|
1022
1042
|
const theme = resolveTheme(props.stylePreset);
|
|
@@ -1033,11 +1053,11 @@ var SmartStudioComposition = (props) => {
|
|
|
1033
1053
|
);
|
|
1034
1054
|
const videoFilter = props.colorGrade ? gradeFilter(props.colorGrade.preset, props.colorGrade.intensity) : "none";
|
|
1035
1055
|
return /* @__PURE__ */ jsxs4(AbsoluteFill9, { style: { backgroundColor: "#000000" }, children: [
|
|
1036
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ jsx11(AbsoluteFill9, { style: videoFilter !== "none" ? { filter: videoFilter } : void 0, children: cuts.enabled ? (
|
|
1037
1057
|
// Cortes DENTRO da composição: CutsSequencer é reframe-aware por
|
|
1038
1058
|
// segmento; o ZoomLayer envolve tudo (janelas já remapeadas p/ a
|
|
1039
1059
|
// timeline pós-corte pelo Python).
|
|
1040
|
-
/* @__PURE__ */
|
|
1060
|
+
/* @__PURE__ */ jsx11(ZoomLayer, { zoom, fps: output.fps, children: /* @__PURE__ */ jsx11(
|
|
1041
1061
|
CutsSequencer,
|
|
1042
1062
|
{
|
|
1043
1063
|
source,
|
|
@@ -1046,14 +1066,14 @@ var SmartStudioComposition = (props) => {
|
|
|
1046
1066
|
transition: cutTransition
|
|
1047
1067
|
}
|
|
1048
1068
|
) })
|
|
1049
|
-
) : /* @__PURE__ */
|
|
1069
|
+
) : /* @__PURE__ */ jsx11(ReframeContainer, { reframe, output, source, children: /* @__PURE__ */ jsx11(ZoomLayer, { zoom, fps: output.fps, children: /* @__PURE__ */ jsx11(
|
|
1050
1070
|
VideoBase,
|
|
1051
1071
|
{
|
|
1052
1072
|
source,
|
|
1053
1073
|
fit: reframe.enabled ? "contain" : "cover"
|
|
1054
1074
|
}
|
|
1055
1075
|
) }) }) }),
|
|
1056
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ jsx11(
|
|
1057
1077
|
CaptionsLayer,
|
|
1058
1078
|
{
|
|
1059
1079
|
captions,
|
|
@@ -1064,7 +1084,7 @@ var SmartStudioComposition = (props) => {
|
|
|
1064
1084
|
fps: output.fps
|
|
1065
1085
|
}
|
|
1066
1086
|
),
|
|
1067
|
-
/* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ jsx11(
|
|
1068
1088
|
OverlayLayer,
|
|
1069
1089
|
{
|
|
1070
1090
|
overlays: themedOverlays,
|
|
@@ -1073,7 +1093,7 @@ var SmartStudioComposition = (props) => {
|
|
|
1073
1093
|
captionsPosition: captions.enabled && captions.tokens.length > 0 ? captionStyle.position : null
|
|
1074
1094
|
}
|
|
1075
1095
|
),
|
|
1076
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ jsx11(
|
|
1077
1097
|
ImageOverlayLayer,
|
|
1078
1098
|
{
|
|
1079
1099
|
imageOverlays: props.imageOverlays,
|
|
@@ -1081,7 +1101,7 @@ var SmartStudioComposition = (props) => {
|
|
|
1081
1101
|
fps: output.fps
|
|
1082
1102
|
}
|
|
1083
1103
|
),
|
|
1084
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ jsx11(
|
|
1085
1105
|
ProgressBarLayer,
|
|
1086
1106
|
{
|
|
1087
1107
|
progressBar,
|
|
@@ -1089,7 +1109,7 @@ var SmartStudioComposition = (props) => {
|
|
|
1089
1109
|
fps: output.fps
|
|
1090
1110
|
}
|
|
1091
1111
|
),
|
|
1092
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx11(
|
|
1093
1113
|
EndcardSequence,
|
|
1094
1114
|
{
|
|
1095
1115
|
endcard: themedEndcard,
|
package/package.json
CHANGED