ugcinc-render 1.8.58 → 1.8.60

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