ugcinc-render 1.8.3 → 1.8.5
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.js +17 -15
- package/dist/index.mjs +23 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2063,7 +2063,7 @@ function VideoEditorComposition({
|
|
|
2063
2063
|
var import_remotion6 = require("remotion");
|
|
2064
2064
|
|
|
2065
2065
|
// src/components/CaptionOverlay.tsx
|
|
2066
|
-
var import_react6 = require("react");
|
|
2066
|
+
var import_react6 = __toESM(require("react"));
|
|
2067
2067
|
var import_remotion5 = require("remotion");
|
|
2068
2068
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2069
2069
|
function createPages(words, wordsPerPage) {
|
|
@@ -2100,6 +2100,7 @@ function CaptionOverlay({ captions, style, previewTimeMs }) {
|
|
|
2100
2100
|
);
|
|
2101
2101
|
if (!currentPage) return null;
|
|
2102
2102
|
const maxWidthPx = style.maxWidth / 100 * width;
|
|
2103
|
+
console.log(`[CaptionOverlay] style.maxWidth: ${style.maxWidth}%, video width: ${width}px, calculated maxWidthPx: ${maxWidthPx}px`);
|
|
2103
2104
|
const scaleFactor = height / 1920;
|
|
2104
2105
|
const scaledFontSize = style.fontSize * scaleFactor;
|
|
2105
2106
|
const scaledStrokeWidth = style.strokeWidth * scaleFactor;
|
|
@@ -2185,20 +2186,21 @@ function CaptionOverlay({ captions, style, previewTimeMs }) {
|
|
|
2185
2186
|
);
|
|
2186
2187
|
}
|
|
2187
2188
|
}
|
|
2188
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react6.default.Fragment, { children: [
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2191
|
+
"span",
|
|
2192
|
+
{
|
|
2193
|
+
style: {
|
|
2194
|
+
color,
|
|
2195
|
+
display: "inline-block",
|
|
2196
|
+
transform: `scale(${scale})`,
|
|
2197
|
+
transformOrigin: "center center"
|
|
2198
|
+
},
|
|
2199
|
+
children: word.word
|
|
2200
|
+
}
|
|
2201
|
+
),
|
|
2202
|
+
index < currentPage.words.length - 1 && " "
|
|
2203
|
+
] }, `${word.word}-${word.startMs}-${index}`);
|
|
2202
2204
|
}) }) });
|
|
2203
2205
|
}
|
|
2204
2206
|
|
package/dist/index.mjs
CHANGED
|
@@ -1201,9 +1201,9 @@ function VideoEditorComposition({
|
|
|
1201
1201
|
import { AbsoluteFill as AbsoluteFill3, Video, OffthreadVideo as OffthreadVideo2 } from "remotion";
|
|
1202
1202
|
|
|
1203
1203
|
// src/components/CaptionOverlay.tsx
|
|
1204
|
-
import { useMemo as useMemo6 } from "react";
|
|
1204
|
+
import React6, { useMemo as useMemo6 } from "react";
|
|
1205
1205
|
import { useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4, interpolate } from "remotion";
|
|
1206
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1206
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1207
1207
|
function createPages(words, wordsPerPage) {
|
|
1208
1208
|
const pages = [];
|
|
1209
1209
|
for (let i = 0; i < words.length; i += wordsPerPage) {
|
|
@@ -1238,6 +1238,7 @@ function CaptionOverlay({ captions, style, previewTimeMs }) {
|
|
|
1238
1238
|
);
|
|
1239
1239
|
if (!currentPage) return null;
|
|
1240
1240
|
const maxWidthPx = style.maxWidth / 100 * width;
|
|
1241
|
+
console.log(`[CaptionOverlay] style.maxWidth: ${style.maxWidth}%, video width: ${width}px, calculated maxWidthPx: ${maxWidthPx}px`);
|
|
1241
1242
|
const scaleFactor = height / 1920;
|
|
1242
1243
|
const scaledFontSize = style.fontSize * scaleFactor;
|
|
1243
1244
|
const scaledStrokeWidth = style.strokeWidth * scaleFactor;
|
|
@@ -1323,31 +1324,32 @@ function CaptionOverlay({ captions, style, previewTimeMs }) {
|
|
|
1323
1324
|
);
|
|
1324
1325
|
}
|
|
1325
1326
|
}
|
|
1326
|
-
return /* @__PURE__ */
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1327
|
+
return /* @__PURE__ */ jsxs4(React6.Fragment, { children: [
|
|
1328
|
+
/* @__PURE__ */ jsx6(
|
|
1329
|
+
"span",
|
|
1330
|
+
{
|
|
1331
|
+
style: {
|
|
1332
|
+
color,
|
|
1333
|
+
display: "inline-block",
|
|
1334
|
+
transform: `scale(${scale})`,
|
|
1335
|
+
transformOrigin: "center center"
|
|
1336
|
+
},
|
|
1337
|
+
children: word.word
|
|
1338
|
+
}
|
|
1339
|
+
),
|
|
1340
|
+
index < currentPage.words.length - 1 && " "
|
|
1341
|
+
] }, `${word.word}-${word.startMs}-${index}`);
|
|
1340
1342
|
}) }) });
|
|
1341
1343
|
}
|
|
1342
1344
|
|
|
1343
1345
|
// src/compositions/AutoCaptionComposition.tsx
|
|
1344
|
-
import { jsx as jsx7, jsxs as
|
|
1346
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1345
1347
|
function AutoCaptionComposition({
|
|
1346
1348
|
videoUrl,
|
|
1347
1349
|
captions,
|
|
1348
1350
|
style
|
|
1349
1351
|
}) {
|
|
1350
|
-
return /* @__PURE__ */
|
|
1352
|
+
return /* @__PURE__ */ jsxs5(AbsoluteFill3, { style: { backgroundColor: "#000000" }, children: [
|
|
1351
1353
|
/* @__PURE__ */ jsx7(
|
|
1352
1354
|
OffthreadVideo2,
|
|
1353
1355
|
{
|
|
@@ -1367,7 +1369,7 @@ function AutoCaptionCompositionWithVideo({
|
|
|
1367
1369
|
captions,
|
|
1368
1370
|
style
|
|
1369
1371
|
}) {
|
|
1370
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ jsxs5(AbsoluteFill3, { style: { backgroundColor: "#000000" }, children: [
|
|
1371
1373
|
/* @__PURE__ */ jsx7(
|
|
1372
1374
|
Video,
|
|
1373
1375
|
{
|
|
@@ -1466,7 +1468,7 @@ function useResolvedPositions(elements, textValues) {
|
|
|
1466
1468
|
|
|
1467
1469
|
// src/Root.tsx
|
|
1468
1470
|
import { Composition } from "remotion";
|
|
1469
|
-
import { Fragment, jsx as jsx8, jsxs as
|
|
1471
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1470
1472
|
var defaultImageProps = {
|
|
1471
1473
|
config: {
|
|
1472
1474
|
width: 1080,
|
|
@@ -1561,7 +1563,7 @@ var calculateImageMetadata = async ({ props }) => {
|
|
|
1561
1563
|
};
|
|
1562
1564
|
};
|
|
1563
1565
|
var RenderRoot = () => {
|
|
1564
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1565
1567
|
/* @__PURE__ */ jsx8(
|
|
1566
1568
|
Composition,
|
|
1567
1569
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugcinc-render",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
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",
|