ugcinc-render 1.8.58 → 1.8.59
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 +130 -163
- package/dist/index.mjs +139 -172
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4344,54 +4344,46 @@ var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
|
4344
4344
|
function DebugOverlay({
|
|
4345
4345
|
width,
|
|
4346
4346
|
height,
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4347
|
+
zoom,
|
|
4348
|
+
scrollX,
|
|
4349
|
+
scrollY,
|
|
4350
|
+
onZoomChange
|
|
4350
4351
|
}) {
|
|
4351
4352
|
const [mousePos, setMousePos] = (0, import_react7.useState)(null);
|
|
4352
|
-
const [
|
|
4353
|
+
const [mouseScreenPos, setMouseScreenPos] = (0, import_react7.useState)(null);
|
|
4354
|
+
const zoomScale = zoom / 100;
|
|
4353
4355
|
const handleMouseMove = (0, import_react7.useCallback)(
|
|
4354
4356
|
(e) => {
|
|
4355
|
-
const container = scrollContainerRef.current;
|
|
4356
|
-
if (!container) return;
|
|
4357
4357
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
4358
|
-
const
|
|
4359
|
-
const
|
|
4360
|
-
|
|
4361
|
-
const
|
|
4362
|
-
const
|
|
4363
|
-
|
|
4364
|
-
const y = Math.round((scrollTop + mouseViewY) / currentZoom);
|
|
4365
|
-
setMousePos({ x, y });
|
|
4358
|
+
const screenX = e.clientX - rect.left;
|
|
4359
|
+
const screenY = e.clientY - rect.top;
|
|
4360
|
+
setMouseScreenPos({ x: screenX, y: screenY });
|
|
4361
|
+
const canvasX = Math.round((screenX + scrollX) / zoomScale);
|
|
4362
|
+
const canvasY = Math.round((screenY + scrollY) / zoomScale);
|
|
4363
|
+
setMousePos({ x: canvasX, y: canvasY });
|
|
4366
4364
|
},
|
|
4367
|
-
[
|
|
4365
|
+
[zoomScale, scrollX, scrollY]
|
|
4368
4366
|
);
|
|
4369
4367
|
const handleMouseLeave = (0, import_react7.useCallback)(() => {
|
|
4370
4368
|
setMousePos(null);
|
|
4369
|
+
setMouseScreenPos(null);
|
|
4371
4370
|
}, []);
|
|
4372
4371
|
const handleWheel = (0, import_react7.useCallback)(
|
|
4373
4372
|
(e) => {
|
|
4374
4373
|
e.preventDefault();
|
|
4375
4374
|
e.stopPropagation();
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
const
|
|
4379
|
-
const
|
|
4380
|
-
const mouseScreenY = e.clientY - rect.top;
|
|
4381
|
-
const scrollLeft = container.scrollLeft;
|
|
4382
|
-
const scrollTop = container.scrollTop;
|
|
4383
|
-
const oldZoom = zoom / 100;
|
|
4384
|
-
const canvasX = (scrollLeft + mouseScreenX) / oldZoom;
|
|
4385
|
-
const canvasY = (scrollTop + mouseScreenY) / oldZoom;
|
|
4375
|
+
if (!mouseScreenPos) return;
|
|
4376
|
+
const { x: screenX, y: screenY } = mouseScreenPos;
|
|
4377
|
+
const canvasX = (screenX + scrollX) / zoomScale;
|
|
4378
|
+
const canvasY = (screenY + scrollY) / zoomScale;
|
|
4386
4379
|
const delta = e.deltaY > 0 ? -5 : 5;
|
|
4387
|
-
const
|
|
4388
|
-
const
|
|
4389
|
-
const
|
|
4390
|
-
const
|
|
4391
|
-
|
|
4392
|
-
onZoomChange?.(newZoomPercent, newScrollLeft, newScrollTop);
|
|
4380
|
+
const newZoom = Math.max(25, Math.min(400, zoom + delta));
|
|
4381
|
+
const newZoomScale = newZoom / 100;
|
|
4382
|
+
const newScrollX = Math.max(0, canvasX * newZoomScale - screenX);
|
|
4383
|
+
const newScrollY = Math.max(0, canvasY * newZoomScale - screenY);
|
|
4384
|
+
onZoomChange(newZoom, newScrollX, newScrollY);
|
|
4393
4385
|
},
|
|
4394
|
-
[zoom,
|
|
4386
|
+
[zoom, zoomScale, scrollX, scrollY, mouseScreenPos, onZoomChange]
|
|
4395
4387
|
);
|
|
4396
4388
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4397
4389
|
"div",
|
|
@@ -4409,7 +4401,6 @@ function DebugOverlay({
|
|
|
4409
4401
|
onMouseLeave: handleMouseLeave,
|
|
4410
4402
|
onWheel: handleWheel,
|
|
4411
4403
|
children: [
|
|
4412
|
-
mousePos && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {}),
|
|
4413
4404
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4414
4405
|
"div",
|
|
4415
4406
|
{
|
|
@@ -4468,7 +4459,7 @@ function DebugOverlay({
|
|
|
4468
4459
|
zoom,
|
|
4469
4460
|
"%"
|
|
4470
4461
|
] }),
|
|
4471
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#888", fontSize: 16, marginTop: 4 }, children: "(scroll to zoom
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#888", fontSize: 16, marginTop: 4 }, children: "(scroll to zoom)" })
|
|
4472
4463
|
]
|
|
4473
4464
|
}
|
|
4474
4465
|
)
|
|
@@ -4533,15 +4524,12 @@ function InstagramDmComposition({
|
|
|
4533
4524
|
}) {
|
|
4534
4525
|
const [fontsLoaded, setFontsLoaded] = (0, import_react8.useState)(false);
|
|
4535
4526
|
const [zoom, setZoom] = (0, import_react8.useState)(100);
|
|
4536
|
-
const
|
|
4537
|
-
const
|
|
4527
|
+
const [scrollX, setScrollX] = (0, import_react8.useState)(0);
|
|
4528
|
+
const [scrollY, setScrollY] = (0, import_react8.useState)(0);
|
|
4529
|
+
const handleZoomChange = (0, import_react8.useCallback)((newZoom, newScrollX, newScrollY) => {
|
|
4538
4530
|
setZoom(newZoom);
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
scrollContainerRef.current.scrollLeft = Math.max(0, scrollX);
|
|
4542
|
-
scrollContainerRef.current.scrollTop = Math.max(0, scrollY);
|
|
4543
|
-
}
|
|
4544
|
-
});
|
|
4531
|
+
setScrollX(newScrollX);
|
|
4532
|
+
setScrollY(newScrollY);
|
|
4545
4533
|
}, []);
|
|
4546
4534
|
(0, import_react8.useEffect)(() => {
|
|
4547
4535
|
const handle = (0, import_remotion14.delayRender)("Loading fonts...");
|
|
@@ -4569,139 +4557,117 @@ function InstagramDmComposition({
|
|
|
4569
4557
|
const contentTop = headerHeight;
|
|
4570
4558
|
const contentHeight = height - headerHeight - footerHeight;
|
|
4571
4559
|
const zoomScale = zoom / 100;
|
|
4560
|
+
const renderContent = () => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IgStatusBar, { config: mergedStatusBar, theme, width }),
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4563
|
+
IgHeader,
|
|
4564
|
+
{
|
|
4565
|
+
config: mergedHeader,
|
|
4566
|
+
theme,
|
|
4567
|
+
recipient,
|
|
4568
|
+
avatarUrl: recipientAvatarUrl
|
|
4569
|
+
}
|
|
4570
|
+
),
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4572
|
+
"div",
|
|
4573
|
+
{
|
|
4574
|
+
style: {
|
|
4575
|
+
position: "absolute",
|
|
4576
|
+
top: contentTop,
|
|
4577
|
+
left: 0,
|
|
4578
|
+
right: 0,
|
|
4579
|
+
height: contentHeight,
|
|
4580
|
+
overflow: "hidden"
|
|
4581
|
+
},
|
|
4582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4583
|
+
"div",
|
|
4584
|
+
{
|
|
4585
|
+
style: {
|
|
4586
|
+
position: "absolute",
|
|
4587
|
+
top: 0,
|
|
4588
|
+
left: 0,
|
|
4589
|
+
right: 0,
|
|
4590
|
+
bottom: 0,
|
|
4591
|
+
display: "flex",
|
|
4592
|
+
flexDirection: "column",
|
|
4593
|
+
justifyContent: "flex-end",
|
|
4594
|
+
paddingBottom: 16
|
|
4595
|
+
},
|
|
4596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4597
|
+
IgMessageList,
|
|
4598
|
+
{
|
|
4599
|
+
messages,
|
|
4600
|
+
imageUrls,
|
|
4601
|
+
style: mergedStyle,
|
|
4602
|
+
theme,
|
|
4603
|
+
containerWidth: width - mergedStyle.sideMargin * 2,
|
|
4604
|
+
showTypingIndicator,
|
|
4605
|
+
readReceipt,
|
|
4606
|
+
recipientAvatarUrl,
|
|
4607
|
+
scrollOffset
|
|
4608
|
+
}
|
|
4609
|
+
)
|
|
4610
|
+
}
|
|
4611
|
+
)
|
|
4612
|
+
}
|
|
4613
|
+
),
|
|
4614
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4615
|
+
IgFooter,
|
|
4616
|
+
{
|
|
4617
|
+
config: mergedFooter,
|
|
4618
|
+
theme,
|
|
4619
|
+
compositionHeight: height
|
|
4620
|
+
}
|
|
4621
|
+
),
|
|
4622
|
+
referenceImageUrl && referenceOpacity > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4623
|
+
"div",
|
|
4624
|
+
{
|
|
4625
|
+
style: {
|
|
4626
|
+
position: "absolute",
|
|
4627
|
+
top: 0,
|
|
4628
|
+
left: 0,
|
|
4629
|
+
right: 0,
|
|
4630
|
+
bottom: 0,
|
|
4631
|
+
zIndex: 100,
|
|
4632
|
+
pointerEvents: "none",
|
|
4633
|
+
opacity: referenceOpacity / 100
|
|
4634
|
+
},
|
|
4635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4636
|
+
import_remotion14.Img,
|
|
4637
|
+
{
|
|
4638
|
+
src: referenceImageUrl,
|
|
4639
|
+
style: {
|
|
4640
|
+
width: "100%",
|
|
4641
|
+
height: "100%",
|
|
4642
|
+
objectFit: "cover"
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
)
|
|
4646
|
+
}
|
|
4647
|
+
)
|
|
4648
|
+
] });
|
|
4572
4649
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4573
4650
|
import_remotion14.AbsoluteFill,
|
|
4574
4651
|
{
|
|
4575
4652
|
style: {
|
|
4576
4653
|
backgroundColor: colors.background,
|
|
4577
|
-
fontFamily: '"SF Pro", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Apple Color Emoji", sans-serif'
|
|
4654
|
+
fontFamily: '"SF Pro", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Apple Color Emoji", sans-serif',
|
|
4655
|
+
overflow: "hidden"
|
|
4578
4656
|
},
|
|
4579
4657
|
children: [
|
|
4580
4658
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4581
4659
|
"div",
|
|
4582
4660
|
{
|
|
4583
|
-
ref: scrollContainerRef,
|
|
4584
4661
|
style: {
|
|
4585
4662
|
position: "absolute",
|
|
4586
4663
|
top: 0,
|
|
4587
4664
|
left: 0,
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4665
|
+
width,
|
|
4666
|
+
height,
|
|
4667
|
+
transform: `translate(${-scrollX}px, ${-scrollY}px) scale(${zoomScale})`,
|
|
4668
|
+
transformOrigin: "top left"
|
|
4591
4669
|
},
|
|
4592
|
-
children:
|
|
4593
|
-
"div",
|
|
4594
|
-
{
|
|
4595
|
-
style: {
|
|
4596
|
-
width: width * zoomScale,
|
|
4597
|
-
height: height * zoomScale,
|
|
4598
|
-
position: "relative"
|
|
4599
|
-
},
|
|
4600
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4601
|
-
"div",
|
|
4602
|
-
{
|
|
4603
|
-
style: {
|
|
4604
|
-
position: "absolute",
|
|
4605
|
-
top: 0,
|
|
4606
|
-
left: 0,
|
|
4607
|
-
width,
|
|
4608
|
-
height,
|
|
4609
|
-
transform: `scale(${zoomScale})`,
|
|
4610
|
-
transformOrigin: "top left"
|
|
4611
|
-
},
|
|
4612
|
-
children: [
|
|
4613
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IgStatusBar, { config: mergedStatusBar, theme, width }),
|
|
4614
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4615
|
-
IgHeader,
|
|
4616
|
-
{
|
|
4617
|
-
config: mergedHeader,
|
|
4618
|
-
theme,
|
|
4619
|
-
recipient,
|
|
4620
|
-
avatarUrl: recipientAvatarUrl
|
|
4621
|
-
}
|
|
4622
|
-
),
|
|
4623
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4624
|
-
"div",
|
|
4625
|
-
{
|
|
4626
|
-
style: {
|
|
4627
|
-
position: "absolute",
|
|
4628
|
-
top: contentTop,
|
|
4629
|
-
left: 0,
|
|
4630
|
-
right: 0,
|
|
4631
|
-
height: contentHeight,
|
|
4632
|
-
overflow: "hidden"
|
|
4633
|
-
},
|
|
4634
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4635
|
-
"div",
|
|
4636
|
-
{
|
|
4637
|
-
style: {
|
|
4638
|
-
position: "absolute",
|
|
4639
|
-
top: 0,
|
|
4640
|
-
left: 0,
|
|
4641
|
-
right: 0,
|
|
4642
|
-
bottom: 0,
|
|
4643
|
-
display: "flex",
|
|
4644
|
-
flexDirection: "column",
|
|
4645
|
-
justifyContent: "flex-end",
|
|
4646
|
-
paddingBottom: 16
|
|
4647
|
-
},
|
|
4648
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4649
|
-
IgMessageList,
|
|
4650
|
-
{
|
|
4651
|
-
messages,
|
|
4652
|
-
imageUrls,
|
|
4653
|
-
style: mergedStyle,
|
|
4654
|
-
theme,
|
|
4655
|
-
containerWidth: width - mergedStyle.sideMargin * 2,
|
|
4656
|
-
showTypingIndicator,
|
|
4657
|
-
readReceipt,
|
|
4658
|
-
recipientAvatarUrl,
|
|
4659
|
-
scrollOffset
|
|
4660
|
-
}
|
|
4661
|
-
)
|
|
4662
|
-
}
|
|
4663
|
-
)
|
|
4664
|
-
}
|
|
4665
|
-
),
|
|
4666
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4667
|
-
IgFooter,
|
|
4668
|
-
{
|
|
4669
|
-
config: mergedFooter,
|
|
4670
|
-
theme,
|
|
4671
|
-
compositionHeight: height
|
|
4672
|
-
}
|
|
4673
|
-
),
|
|
4674
|
-
referenceImageUrl && referenceOpacity > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4675
|
-
"div",
|
|
4676
|
-
{
|
|
4677
|
-
style: {
|
|
4678
|
-
position: "absolute",
|
|
4679
|
-
top: 0,
|
|
4680
|
-
left: 0,
|
|
4681
|
-
right: 0,
|
|
4682
|
-
bottom: 0,
|
|
4683
|
-
zIndex: 100,
|
|
4684
|
-
pointerEvents: "none",
|
|
4685
|
-
opacity: referenceOpacity / 100
|
|
4686
|
-
},
|
|
4687
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4688
|
-
import_remotion14.Img,
|
|
4689
|
-
{
|
|
4690
|
-
src: referenceImageUrl,
|
|
4691
|
-
style: {
|
|
4692
|
-
width: "100%",
|
|
4693
|
-
height: "100%",
|
|
4694
|
-
objectFit: "cover"
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4697
|
-
)
|
|
4698
|
-
}
|
|
4699
|
-
)
|
|
4700
|
-
]
|
|
4701
|
-
}
|
|
4702
|
-
)
|
|
4703
|
-
}
|
|
4704
|
-
)
|
|
4670
|
+
children: renderContent()
|
|
4705
4671
|
}
|
|
4706
4672
|
),
|
|
4707
4673
|
showDebugOverlay && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
@@ -4709,9 +4675,10 @@ function InstagramDmComposition({
|
|
|
4709
4675
|
{
|
|
4710
4676
|
width,
|
|
4711
4677
|
height,
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4678
|
+
zoom,
|
|
4679
|
+
scrollX,
|
|
4680
|
+
scrollY,
|
|
4681
|
+
onZoomChange: handleZoomChange
|
|
4715
4682
|
}
|
|
4716
4683
|
)
|
|
4717
4684
|
]
|
package/dist/index.mjs
CHANGED
|
@@ -1833,7 +1833,7 @@ function ScreenshotAnimation({
|
|
|
1833
1833
|
}
|
|
1834
1834
|
|
|
1835
1835
|
// src/compositions/InstagramDmComposition/index.tsx
|
|
1836
|
-
import { useCallback as useCallback2, useEffect as
|
|
1836
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1837
1837
|
import { AbsoluteFill as AbsoluteFill5, Img as Img9, continueRender as continueRender2, delayRender as delayRender2 } from "remotion";
|
|
1838
1838
|
|
|
1839
1839
|
// src/compositions/InstagramDmComposition/theme.ts
|
|
@@ -3448,54 +3448,46 @@ import { Fragment, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
|
3448
3448
|
function DebugOverlay({
|
|
3449
3449
|
width,
|
|
3450
3450
|
height,
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3451
|
+
zoom,
|
|
3452
|
+
scrollX,
|
|
3453
|
+
scrollY,
|
|
3454
|
+
onZoomChange
|
|
3454
3455
|
}) {
|
|
3455
3456
|
const [mousePos, setMousePos] = useState2(null);
|
|
3456
|
-
const [
|
|
3457
|
+
const [mouseScreenPos, setMouseScreenPos] = useState2(null);
|
|
3458
|
+
const zoomScale = zoom / 100;
|
|
3457
3459
|
const handleMouseMove = useCallback(
|
|
3458
3460
|
(e) => {
|
|
3459
|
-
const container = scrollContainerRef.current;
|
|
3460
|
-
if (!container) return;
|
|
3461
3461
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
3462
|
-
const
|
|
3463
|
-
const
|
|
3464
|
-
|
|
3465
|
-
const
|
|
3466
|
-
const
|
|
3467
|
-
|
|
3468
|
-
const y = Math.round((scrollTop + mouseViewY) / currentZoom);
|
|
3469
|
-
setMousePos({ x, y });
|
|
3462
|
+
const screenX = e.clientX - rect.left;
|
|
3463
|
+
const screenY = e.clientY - rect.top;
|
|
3464
|
+
setMouseScreenPos({ x: screenX, y: screenY });
|
|
3465
|
+
const canvasX = Math.round((screenX + scrollX) / zoomScale);
|
|
3466
|
+
const canvasY = Math.round((screenY + scrollY) / zoomScale);
|
|
3467
|
+
setMousePos({ x: canvasX, y: canvasY });
|
|
3470
3468
|
},
|
|
3471
|
-
[
|
|
3469
|
+
[zoomScale, scrollX, scrollY]
|
|
3472
3470
|
);
|
|
3473
3471
|
const handleMouseLeave = useCallback(() => {
|
|
3474
3472
|
setMousePos(null);
|
|
3473
|
+
setMouseScreenPos(null);
|
|
3475
3474
|
}, []);
|
|
3476
3475
|
const handleWheel = useCallback(
|
|
3477
3476
|
(e) => {
|
|
3478
3477
|
e.preventDefault();
|
|
3479
3478
|
e.stopPropagation();
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
const
|
|
3483
|
-
const
|
|
3484
|
-
const mouseScreenY = e.clientY - rect.top;
|
|
3485
|
-
const scrollLeft = container.scrollLeft;
|
|
3486
|
-
const scrollTop = container.scrollTop;
|
|
3487
|
-
const oldZoom = zoom / 100;
|
|
3488
|
-
const canvasX = (scrollLeft + mouseScreenX) / oldZoom;
|
|
3489
|
-
const canvasY = (scrollTop + mouseScreenY) / oldZoom;
|
|
3479
|
+
if (!mouseScreenPos) return;
|
|
3480
|
+
const { x: screenX, y: screenY } = mouseScreenPos;
|
|
3481
|
+
const canvasX = (screenX + scrollX) / zoomScale;
|
|
3482
|
+
const canvasY = (screenY + scrollY) / zoomScale;
|
|
3490
3483
|
const delta = e.deltaY > 0 ? -5 : 5;
|
|
3491
|
-
const
|
|
3492
|
-
const
|
|
3493
|
-
const
|
|
3494
|
-
const
|
|
3495
|
-
|
|
3496
|
-
onZoomChange?.(newZoomPercent, newScrollLeft, newScrollTop);
|
|
3484
|
+
const newZoom = Math.max(25, Math.min(400, zoom + delta));
|
|
3485
|
+
const newZoomScale = newZoom / 100;
|
|
3486
|
+
const newScrollX = Math.max(0, canvasX * newZoomScale - screenX);
|
|
3487
|
+
const newScrollY = Math.max(0, canvasY * newZoomScale - screenY);
|
|
3488
|
+
onZoomChange(newZoom, newScrollX, newScrollY);
|
|
3497
3489
|
},
|
|
3498
|
-
[zoom,
|
|
3490
|
+
[zoom, zoomScale, scrollX, scrollY, mouseScreenPos, onZoomChange]
|
|
3499
3491
|
);
|
|
3500
3492
|
return /* @__PURE__ */ jsxs15(
|
|
3501
3493
|
"div",
|
|
@@ -3513,7 +3505,6 @@ function DebugOverlay({
|
|
|
3513
3505
|
onMouseLeave: handleMouseLeave,
|
|
3514
3506
|
onWheel: handleWheel,
|
|
3515
3507
|
children: [
|
|
3516
|
-
mousePos && /* @__PURE__ */ jsx22(Fragment, {}),
|
|
3517
3508
|
/* @__PURE__ */ jsx22(
|
|
3518
3509
|
"div",
|
|
3519
3510
|
{
|
|
@@ -3572,7 +3563,7 @@ function DebugOverlay({
|
|
|
3572
3563
|
zoom,
|
|
3573
3564
|
"%"
|
|
3574
3565
|
] }),
|
|
3575
|
-
/* @__PURE__ */ jsx22("div", { style: { color: "#888", fontSize: 16, marginTop: 4 }, children: "(scroll to zoom
|
|
3566
|
+
/* @__PURE__ */ jsx22("div", { style: { color: "#888", fontSize: 16, marginTop: 4 }, children: "(scroll to zoom)" })
|
|
3576
3567
|
]
|
|
3577
3568
|
}
|
|
3578
3569
|
)
|
|
@@ -3582,7 +3573,7 @@ function DebugOverlay({
|
|
|
3582
3573
|
}
|
|
3583
3574
|
|
|
3584
3575
|
// src/compositions/InstagramDmComposition/index.tsx
|
|
3585
|
-
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3576
|
+
import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3586
3577
|
var defaultInstagramDmProps = {
|
|
3587
3578
|
showDebugOverlay: true,
|
|
3588
3579
|
referenceImageUrl: "https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3171-DmKgZAYCYJpLxiZjJBYYCk4mynmjkv.png",
|
|
@@ -3637,17 +3628,14 @@ function InstagramDmComposition({
|
|
|
3637
3628
|
}) {
|
|
3638
3629
|
const [fontsLoaded, setFontsLoaded] = useState3(false);
|
|
3639
3630
|
const [zoom, setZoom] = useState3(100);
|
|
3640
|
-
const
|
|
3641
|
-
const
|
|
3631
|
+
const [scrollX, setScrollX] = useState3(0);
|
|
3632
|
+
const [scrollY, setScrollY] = useState3(0);
|
|
3633
|
+
const handleZoomChange = useCallback2((newZoom, newScrollX, newScrollY) => {
|
|
3642
3634
|
setZoom(newZoom);
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
scrollContainerRef.current.scrollLeft = Math.max(0, scrollX);
|
|
3646
|
-
scrollContainerRef.current.scrollTop = Math.max(0, scrollY);
|
|
3647
|
-
}
|
|
3648
|
-
});
|
|
3635
|
+
setScrollX(newScrollX);
|
|
3636
|
+
setScrollY(newScrollY);
|
|
3649
3637
|
}, []);
|
|
3650
|
-
|
|
3638
|
+
useEffect3(() => {
|
|
3651
3639
|
const handle = delayRender2("Loading fonts...");
|
|
3652
3640
|
preloadFonts().then(() => {
|
|
3653
3641
|
setFontsLoaded(true);
|
|
@@ -3673,139 +3661,117 @@ function InstagramDmComposition({
|
|
|
3673
3661
|
const contentTop = headerHeight;
|
|
3674
3662
|
const contentHeight = height - headerHeight - footerHeight;
|
|
3675
3663
|
const zoomScale = zoom / 100;
|
|
3664
|
+
const renderContent = () => /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
3665
|
+
/* @__PURE__ */ jsx23(IgStatusBar, { config: mergedStatusBar, theme, width }),
|
|
3666
|
+
/* @__PURE__ */ jsx23(
|
|
3667
|
+
IgHeader,
|
|
3668
|
+
{
|
|
3669
|
+
config: mergedHeader,
|
|
3670
|
+
theme,
|
|
3671
|
+
recipient,
|
|
3672
|
+
avatarUrl: recipientAvatarUrl
|
|
3673
|
+
}
|
|
3674
|
+
),
|
|
3675
|
+
/* @__PURE__ */ jsx23(
|
|
3676
|
+
"div",
|
|
3677
|
+
{
|
|
3678
|
+
style: {
|
|
3679
|
+
position: "absolute",
|
|
3680
|
+
top: contentTop,
|
|
3681
|
+
left: 0,
|
|
3682
|
+
right: 0,
|
|
3683
|
+
height: contentHeight,
|
|
3684
|
+
overflow: "hidden"
|
|
3685
|
+
},
|
|
3686
|
+
children: /* @__PURE__ */ jsx23(
|
|
3687
|
+
"div",
|
|
3688
|
+
{
|
|
3689
|
+
style: {
|
|
3690
|
+
position: "absolute",
|
|
3691
|
+
top: 0,
|
|
3692
|
+
left: 0,
|
|
3693
|
+
right: 0,
|
|
3694
|
+
bottom: 0,
|
|
3695
|
+
display: "flex",
|
|
3696
|
+
flexDirection: "column",
|
|
3697
|
+
justifyContent: "flex-end",
|
|
3698
|
+
paddingBottom: 16
|
|
3699
|
+
},
|
|
3700
|
+
children: /* @__PURE__ */ jsx23(
|
|
3701
|
+
IgMessageList,
|
|
3702
|
+
{
|
|
3703
|
+
messages,
|
|
3704
|
+
imageUrls,
|
|
3705
|
+
style: mergedStyle,
|
|
3706
|
+
theme,
|
|
3707
|
+
containerWidth: width - mergedStyle.sideMargin * 2,
|
|
3708
|
+
showTypingIndicator,
|
|
3709
|
+
readReceipt,
|
|
3710
|
+
recipientAvatarUrl,
|
|
3711
|
+
scrollOffset
|
|
3712
|
+
}
|
|
3713
|
+
)
|
|
3714
|
+
}
|
|
3715
|
+
)
|
|
3716
|
+
}
|
|
3717
|
+
),
|
|
3718
|
+
/* @__PURE__ */ jsx23(
|
|
3719
|
+
IgFooter,
|
|
3720
|
+
{
|
|
3721
|
+
config: mergedFooter,
|
|
3722
|
+
theme,
|
|
3723
|
+
compositionHeight: height
|
|
3724
|
+
}
|
|
3725
|
+
),
|
|
3726
|
+
referenceImageUrl && referenceOpacity > 0 && /* @__PURE__ */ jsx23(
|
|
3727
|
+
"div",
|
|
3728
|
+
{
|
|
3729
|
+
style: {
|
|
3730
|
+
position: "absolute",
|
|
3731
|
+
top: 0,
|
|
3732
|
+
left: 0,
|
|
3733
|
+
right: 0,
|
|
3734
|
+
bottom: 0,
|
|
3735
|
+
zIndex: 100,
|
|
3736
|
+
pointerEvents: "none",
|
|
3737
|
+
opacity: referenceOpacity / 100
|
|
3738
|
+
},
|
|
3739
|
+
children: /* @__PURE__ */ jsx23(
|
|
3740
|
+
Img9,
|
|
3741
|
+
{
|
|
3742
|
+
src: referenceImageUrl,
|
|
3743
|
+
style: {
|
|
3744
|
+
width: "100%",
|
|
3745
|
+
height: "100%",
|
|
3746
|
+
objectFit: "cover"
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
)
|
|
3750
|
+
}
|
|
3751
|
+
)
|
|
3752
|
+
] });
|
|
3676
3753
|
return /* @__PURE__ */ jsxs16(
|
|
3677
3754
|
AbsoluteFill5,
|
|
3678
3755
|
{
|
|
3679
3756
|
style: {
|
|
3680
3757
|
backgroundColor: colors.background,
|
|
3681
|
-
fontFamily: '"SF Pro", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Apple Color Emoji", sans-serif'
|
|
3758
|
+
fontFamily: '"SF Pro", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Apple Color Emoji", sans-serif',
|
|
3759
|
+
overflow: "hidden"
|
|
3682
3760
|
},
|
|
3683
3761
|
children: [
|
|
3684
3762
|
/* @__PURE__ */ jsx23(
|
|
3685
3763
|
"div",
|
|
3686
3764
|
{
|
|
3687
|
-
ref: scrollContainerRef,
|
|
3688
3765
|
style: {
|
|
3689
3766
|
position: "absolute",
|
|
3690
3767
|
top: 0,
|
|
3691
3768
|
left: 0,
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3769
|
+
width,
|
|
3770
|
+
height,
|
|
3771
|
+
transform: `translate(${-scrollX}px, ${-scrollY}px) scale(${zoomScale})`,
|
|
3772
|
+
transformOrigin: "top left"
|
|
3695
3773
|
},
|
|
3696
|
-
children:
|
|
3697
|
-
"div",
|
|
3698
|
-
{
|
|
3699
|
-
style: {
|
|
3700
|
-
width: width * zoomScale,
|
|
3701
|
-
height: height * zoomScale,
|
|
3702
|
-
position: "relative"
|
|
3703
|
-
},
|
|
3704
|
-
children: /* @__PURE__ */ jsxs16(
|
|
3705
|
-
"div",
|
|
3706
|
-
{
|
|
3707
|
-
style: {
|
|
3708
|
-
position: "absolute",
|
|
3709
|
-
top: 0,
|
|
3710
|
-
left: 0,
|
|
3711
|
-
width,
|
|
3712
|
-
height,
|
|
3713
|
-
transform: `scale(${zoomScale})`,
|
|
3714
|
-
transformOrigin: "top left"
|
|
3715
|
-
},
|
|
3716
|
-
children: [
|
|
3717
|
-
/* @__PURE__ */ jsx23(IgStatusBar, { config: mergedStatusBar, theme, width }),
|
|
3718
|
-
/* @__PURE__ */ jsx23(
|
|
3719
|
-
IgHeader,
|
|
3720
|
-
{
|
|
3721
|
-
config: mergedHeader,
|
|
3722
|
-
theme,
|
|
3723
|
-
recipient,
|
|
3724
|
-
avatarUrl: recipientAvatarUrl
|
|
3725
|
-
}
|
|
3726
|
-
),
|
|
3727
|
-
/* @__PURE__ */ jsx23(
|
|
3728
|
-
"div",
|
|
3729
|
-
{
|
|
3730
|
-
style: {
|
|
3731
|
-
position: "absolute",
|
|
3732
|
-
top: contentTop,
|
|
3733
|
-
left: 0,
|
|
3734
|
-
right: 0,
|
|
3735
|
-
height: contentHeight,
|
|
3736
|
-
overflow: "hidden"
|
|
3737
|
-
},
|
|
3738
|
-
children: /* @__PURE__ */ jsx23(
|
|
3739
|
-
"div",
|
|
3740
|
-
{
|
|
3741
|
-
style: {
|
|
3742
|
-
position: "absolute",
|
|
3743
|
-
top: 0,
|
|
3744
|
-
left: 0,
|
|
3745
|
-
right: 0,
|
|
3746
|
-
bottom: 0,
|
|
3747
|
-
display: "flex",
|
|
3748
|
-
flexDirection: "column",
|
|
3749
|
-
justifyContent: "flex-end",
|
|
3750
|
-
paddingBottom: 16
|
|
3751
|
-
},
|
|
3752
|
-
children: /* @__PURE__ */ jsx23(
|
|
3753
|
-
IgMessageList,
|
|
3754
|
-
{
|
|
3755
|
-
messages,
|
|
3756
|
-
imageUrls,
|
|
3757
|
-
style: mergedStyle,
|
|
3758
|
-
theme,
|
|
3759
|
-
containerWidth: width - mergedStyle.sideMargin * 2,
|
|
3760
|
-
showTypingIndicator,
|
|
3761
|
-
readReceipt,
|
|
3762
|
-
recipientAvatarUrl,
|
|
3763
|
-
scrollOffset
|
|
3764
|
-
}
|
|
3765
|
-
)
|
|
3766
|
-
}
|
|
3767
|
-
)
|
|
3768
|
-
}
|
|
3769
|
-
),
|
|
3770
|
-
/* @__PURE__ */ jsx23(
|
|
3771
|
-
IgFooter,
|
|
3772
|
-
{
|
|
3773
|
-
config: mergedFooter,
|
|
3774
|
-
theme,
|
|
3775
|
-
compositionHeight: height
|
|
3776
|
-
}
|
|
3777
|
-
),
|
|
3778
|
-
referenceImageUrl && referenceOpacity > 0 && /* @__PURE__ */ jsx23(
|
|
3779
|
-
"div",
|
|
3780
|
-
{
|
|
3781
|
-
style: {
|
|
3782
|
-
position: "absolute",
|
|
3783
|
-
top: 0,
|
|
3784
|
-
left: 0,
|
|
3785
|
-
right: 0,
|
|
3786
|
-
bottom: 0,
|
|
3787
|
-
zIndex: 100,
|
|
3788
|
-
pointerEvents: "none",
|
|
3789
|
-
opacity: referenceOpacity / 100
|
|
3790
|
-
},
|
|
3791
|
-
children: /* @__PURE__ */ jsx23(
|
|
3792
|
-
Img9,
|
|
3793
|
-
{
|
|
3794
|
-
src: referenceImageUrl,
|
|
3795
|
-
style: {
|
|
3796
|
-
width: "100%",
|
|
3797
|
-
height: "100%",
|
|
3798
|
-
objectFit: "cover"
|
|
3799
|
-
}
|
|
3800
|
-
}
|
|
3801
|
-
)
|
|
3802
|
-
}
|
|
3803
|
-
)
|
|
3804
|
-
]
|
|
3805
|
-
}
|
|
3806
|
-
)
|
|
3807
|
-
}
|
|
3808
|
-
)
|
|
3774
|
+
children: renderContent()
|
|
3809
3775
|
}
|
|
3810
3776
|
),
|
|
3811
3777
|
showDebugOverlay && /* @__PURE__ */ jsx23(
|
|
@@ -3813,9 +3779,10 @@ function InstagramDmComposition({
|
|
|
3813
3779
|
{
|
|
3814
3780
|
width,
|
|
3815
3781
|
height,
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3782
|
+
zoom,
|
|
3783
|
+
scrollX,
|
|
3784
|
+
scrollY,
|
|
3785
|
+
onZoomChange: handleZoomChange
|
|
3819
3786
|
}
|
|
3820
3787
|
)
|
|
3821
3788
|
]
|
|
@@ -3824,10 +3791,10 @@ function InstagramDmComposition({
|
|
|
3824
3791
|
}
|
|
3825
3792
|
|
|
3826
3793
|
// src/hooks/index.ts
|
|
3827
|
-
import { useEffect as
|
|
3794
|
+
import { useEffect as useEffect4, useState as useState4, useMemo as useMemo7 } from "react";
|
|
3828
3795
|
function useFontsLoaded() {
|
|
3829
3796
|
const [loaded, setLoaded] = useState4(areFontsLoaded());
|
|
3830
|
-
|
|
3797
|
+
useEffect4(() => {
|
|
3831
3798
|
if (!loaded) {
|
|
3832
3799
|
preloadFonts().then(() => setLoaded(true)).catch(console.error);
|
|
3833
3800
|
}
|
|
@@ -3836,7 +3803,7 @@ function useFontsLoaded() {
|
|
|
3836
3803
|
}
|
|
3837
3804
|
function useImageLoader(src) {
|
|
3838
3805
|
const [image, setImage] = useState4(null);
|
|
3839
|
-
|
|
3806
|
+
useEffect4(() => {
|
|
3840
3807
|
if (!src) {
|
|
3841
3808
|
setImage(null);
|
|
3842
3809
|
return;
|
|
@@ -3858,7 +3825,7 @@ function useImageLoader(src) {
|
|
|
3858
3825
|
function useImagePreloader(sources) {
|
|
3859
3826
|
const [images, setImages] = useState4({});
|
|
3860
3827
|
const [loaded, setLoaded] = useState4(false);
|
|
3861
|
-
|
|
3828
|
+
useEffect4(() => {
|
|
3862
3829
|
const entries = Object.entries(sources);
|
|
3863
3830
|
if (entries.length === 0) {
|
|
3864
3831
|
setLoaded(true);
|
|
@@ -3907,7 +3874,7 @@ function useResolvedPositions(elements, textValues) {
|
|
|
3907
3874
|
// src/Root.tsx
|
|
3908
3875
|
import { Composition } from "remotion";
|
|
3909
3876
|
import { z } from "zod";
|
|
3910
|
-
import { Fragment as
|
|
3877
|
+
import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3911
3878
|
var defaultImageProps = {
|
|
3912
3879
|
config: {
|
|
3913
3880
|
width: 1080,
|
|
@@ -4170,7 +4137,7 @@ var calculateImageMetadata = async ({ props }) => {
|
|
|
4170
4137
|
};
|
|
4171
4138
|
};
|
|
4172
4139
|
var RenderRoot = () => {
|
|
4173
|
-
return /* @__PURE__ */ jsxs17(
|
|
4140
|
+
return /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
4174
4141
|
/* @__PURE__ */ jsx24(
|
|
4175
4142
|
Composition,
|
|
4176
4143
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugcinc-render",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.59",
|
|
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",
|