ugcinc-render 1.8.75 → 1.8.77
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 +14 -11
- package/dist/index.mjs +22 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2893,6 +2893,19 @@ function DebugOverlay({
|
|
|
2893
2893
|
const [isDragging, setIsDragging] = (0, import_react7.useState)(false);
|
|
2894
2894
|
const lastDragPos = (0, import_react7.useRef)(null);
|
|
2895
2895
|
const zoomScale = zoom / 100;
|
|
2896
|
+
(0, import_react7.useEffect)(() => {
|
|
2897
|
+
if (mousePos === null) return;
|
|
2898
|
+
const snappedScreenX = (mousePos.x + 0.5) * zoomScale - scrollX;
|
|
2899
|
+
const snappedScreenY = (mousePos.y + 0.5) * zoomScale - scrollY;
|
|
2900
|
+
const pixelWidth = zoomScale;
|
|
2901
|
+
const pixelHeight = zoomScale;
|
|
2902
|
+
setCrosshairPos({
|
|
2903
|
+
xPercent: snappedScreenX / width * 100,
|
|
2904
|
+
yPercent: snappedScreenY / height * 100,
|
|
2905
|
+
pixelWidthPercent: pixelWidth / width * 100,
|
|
2906
|
+
pixelHeightPercent: pixelHeight / height * 100
|
|
2907
|
+
});
|
|
2908
|
+
}, [mousePos, zoomScale, scrollX, scrollY, width, height]);
|
|
2896
2909
|
const handleMouseMove = (0, import_react7.useCallback)(
|
|
2897
2910
|
(e) => {
|
|
2898
2911
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2908,16 +2921,6 @@ function DebugOverlay({
|
|
|
2908
2921
|
const snappedCanvasX = Math.floor(canvasX);
|
|
2909
2922
|
const snappedCanvasY = Math.floor(canvasY);
|
|
2910
2923
|
setMousePos({ x: snappedCanvasX, y: snappedCanvasY });
|
|
2911
|
-
const snappedScreenX = (snappedCanvasX + 0.5) * zoomScale - scrollX;
|
|
2912
|
-
const snappedScreenY = (snappedCanvasY + 0.5) * zoomScale - scrollY;
|
|
2913
|
-
const pixelWidth = zoomScale;
|
|
2914
|
-
const pixelHeight = zoomScale;
|
|
2915
|
-
setCrosshairPos({
|
|
2916
|
-
xPercent: snappedScreenX / width * 100,
|
|
2917
|
-
yPercent: snappedScreenY / height * 100,
|
|
2918
|
-
pixelWidthPercent: pixelWidth / width * 100,
|
|
2919
|
-
pixelHeightPercent: pixelHeight / height * 100
|
|
2920
|
-
});
|
|
2921
2924
|
if (isDragging && lastDragPos.current) {
|
|
2922
2925
|
const deltaX = (e.clientX - lastDragPos.current.x) * remotionScaleX;
|
|
2923
2926
|
const deltaY = (e.clientY - lastDragPos.current.y) * remotionScaleY;
|
|
@@ -3278,7 +3281,7 @@ function InstagramDmComposition({
|
|
|
3278
3281
|
bottom: 0,
|
|
3279
3282
|
zIndex: 100,
|
|
3280
3283
|
pointerEvents: "none",
|
|
3281
|
-
opacity:
|
|
3284
|
+
opacity: clampedReferenceOpacity / 100
|
|
3282
3285
|
},
|
|
3283
3286
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3284
3287
|
import_remotion9.Img,
|
package/dist/index.mjs
CHANGED
|
@@ -1946,7 +1946,7 @@ function ScreenshotAnimation({
|
|
|
1946
1946
|
}
|
|
1947
1947
|
|
|
1948
1948
|
// src/compositions/InstagramDmComposition/index.tsx
|
|
1949
|
-
import { useCallback as useCallback2, useEffect as
|
|
1949
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1950
1950
|
import { AbsoluteFill as AbsoluteFill5, Img as Img5, continueRender as continueRender2, delayRender as delayRender2 } from "remotion";
|
|
1951
1951
|
|
|
1952
1952
|
// src/compositions/InstagramDmComposition/theme.ts
|
|
@@ -1983,7 +1983,7 @@ function getThemeColors(theme) {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
|
|
1985
1985
|
// src/compositions/InstagramDmComposition/components/DebugOverlay.tsx
|
|
1986
|
-
import { useState as useState2, useCallback, useRef } from "react";
|
|
1986
|
+
import { useState as useState2, useCallback, useRef, useEffect as useEffect2 } from "react";
|
|
1987
1987
|
import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1988
1988
|
function DebugOverlay({
|
|
1989
1989
|
width,
|
|
@@ -2001,6 +2001,19 @@ function DebugOverlay({
|
|
|
2001
2001
|
const [isDragging, setIsDragging] = useState2(false);
|
|
2002
2002
|
const lastDragPos = useRef(null);
|
|
2003
2003
|
const zoomScale = zoom / 100;
|
|
2004
|
+
useEffect2(() => {
|
|
2005
|
+
if (mousePos === null) return;
|
|
2006
|
+
const snappedScreenX = (mousePos.x + 0.5) * zoomScale - scrollX;
|
|
2007
|
+
const snappedScreenY = (mousePos.y + 0.5) * zoomScale - scrollY;
|
|
2008
|
+
const pixelWidth = zoomScale;
|
|
2009
|
+
const pixelHeight = zoomScale;
|
|
2010
|
+
setCrosshairPos({
|
|
2011
|
+
xPercent: snappedScreenX / width * 100,
|
|
2012
|
+
yPercent: snappedScreenY / height * 100,
|
|
2013
|
+
pixelWidthPercent: pixelWidth / width * 100,
|
|
2014
|
+
pixelHeightPercent: pixelHeight / height * 100
|
|
2015
|
+
});
|
|
2016
|
+
}, [mousePos, zoomScale, scrollX, scrollY, width, height]);
|
|
2004
2017
|
const handleMouseMove = useCallback(
|
|
2005
2018
|
(e) => {
|
|
2006
2019
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2016,16 +2029,6 @@ function DebugOverlay({
|
|
|
2016
2029
|
const snappedCanvasX = Math.floor(canvasX);
|
|
2017
2030
|
const snappedCanvasY = Math.floor(canvasY);
|
|
2018
2031
|
setMousePos({ x: snappedCanvasX, y: snappedCanvasY });
|
|
2019
|
-
const snappedScreenX = (snappedCanvasX + 0.5) * zoomScale - scrollX;
|
|
2020
|
-
const snappedScreenY = (snappedCanvasY + 0.5) * zoomScale - scrollY;
|
|
2021
|
-
const pixelWidth = zoomScale;
|
|
2022
|
-
const pixelHeight = zoomScale;
|
|
2023
|
-
setCrosshairPos({
|
|
2024
|
-
xPercent: snappedScreenX / width * 100,
|
|
2025
|
-
yPercent: snappedScreenY / height * 100,
|
|
2026
|
-
pixelWidthPercent: pixelWidth / width * 100,
|
|
2027
|
-
pixelHeightPercent: pixelHeight / height * 100
|
|
2028
|
-
});
|
|
2029
2032
|
if (isDragging && lastDragPos.current) {
|
|
2030
2033
|
const deltaX = (e.clientX - lastDragPos.current.x) * remotionScaleX;
|
|
2031
2034
|
const deltaY = (e.clientY - lastDragPos.current.y) * remotionScaleY;
|
|
@@ -2317,7 +2320,7 @@ function InstagramDmComposition({
|
|
|
2317
2320
|
const handleToggleReference = useCallback2(() => {
|
|
2318
2321
|
setReferenceVisible((prev) => !prev);
|
|
2319
2322
|
}, []);
|
|
2320
|
-
|
|
2323
|
+
useEffect3(() => {
|
|
2321
2324
|
const interceptBeforeUnload = (e) => {
|
|
2322
2325
|
e.stopImmediatePropagation();
|
|
2323
2326
|
};
|
|
@@ -2336,7 +2339,7 @@ function InstagramDmComposition({
|
|
|
2336
2339
|
window.removeEventListener("beforeunload", interceptBeforeUnload, { capture: true });
|
|
2337
2340
|
};
|
|
2338
2341
|
}, []);
|
|
2339
|
-
|
|
2342
|
+
useEffect3(() => {
|
|
2340
2343
|
const handle = delayRender2("Loading fonts...");
|
|
2341
2344
|
preloadFonts().then(() => {
|
|
2342
2345
|
setFontsLoaded(true);
|
|
@@ -2386,7 +2389,7 @@ function InstagramDmComposition({
|
|
|
2386
2389
|
bottom: 0,
|
|
2387
2390
|
zIndex: 100,
|
|
2388
2391
|
pointerEvents: "none",
|
|
2389
|
-
opacity:
|
|
2392
|
+
opacity: clampedReferenceOpacity / 100
|
|
2390
2393
|
},
|
|
2391
2394
|
children: /* @__PURE__ */ jsx11(
|
|
2392
2395
|
Img5,
|
|
@@ -2801,10 +2804,10 @@ function MediaBubble({
|
|
|
2801
2804
|
}
|
|
2802
2805
|
|
|
2803
2806
|
// src/hooks/index.ts
|
|
2804
|
-
import { useEffect as
|
|
2807
|
+
import { useEffect as useEffect4, useState as useState4, useMemo as useMemo7 } from "react";
|
|
2805
2808
|
function useFontsLoaded() {
|
|
2806
2809
|
const [loaded, setLoaded] = useState4(areFontsLoaded());
|
|
2807
|
-
|
|
2810
|
+
useEffect4(() => {
|
|
2808
2811
|
if (!loaded) {
|
|
2809
2812
|
preloadFonts().then(() => setLoaded(true)).catch(console.error);
|
|
2810
2813
|
}
|
|
@@ -2813,7 +2816,7 @@ function useFontsLoaded() {
|
|
|
2813
2816
|
}
|
|
2814
2817
|
function useImageLoader(src) {
|
|
2815
2818
|
const [image, setImage] = useState4(null);
|
|
2816
|
-
|
|
2819
|
+
useEffect4(() => {
|
|
2817
2820
|
if (!src) {
|
|
2818
2821
|
setImage(null);
|
|
2819
2822
|
return;
|
|
@@ -2835,7 +2838,7 @@ function useImageLoader(src) {
|
|
|
2835
2838
|
function useImagePreloader(sources) {
|
|
2836
2839
|
const [images, setImages] = useState4({});
|
|
2837
2840
|
const [loaded, setLoaded] = useState4(false);
|
|
2838
|
-
|
|
2841
|
+
useEffect4(() => {
|
|
2839
2842
|
const entries = Object.entries(sources);
|
|
2840
2843
|
if (entries.length === 0) {
|
|
2841
2844
|
setLoaded(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugcinc-render",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.77",
|
|
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",
|