@remotion/web-renderer 4.0.451 → 4.0.453

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.
@@ -2059,6 +2059,8 @@ var calculateTransforms = ({
2059
2059
  let elementComputedStyle = null;
2060
2060
  let maskImageInfo = null;
2061
2061
  while (parent) {
2062
+ const originalTransition = parent.style.transition;
2063
+ parent.style.transition = "none";
2062
2064
  const computedStyle = getComputedStyle(parent);
2063
2065
  if (parent === element) {
2064
2066
  elementComputedStyle = computedStyle;
@@ -2101,6 +2103,12 @@ var calculateTransforms = ({
2101
2103
  parentRef.style.transform = transform;
2102
2104
  parentRef.style.scale = scale;
2103
2105
  parentRef.style.rotate = rotate;
2106
+ parentRef.style.transition = originalTransition;
2107
+ });
2108
+ } else {
2109
+ const parentRef = parent;
2110
+ toReset.push(() => {
2111
+ parentRef.style.transition = originalTransition;
2104
2112
  });
2105
2113
  }
2106
2114
  if (parent === rootElement) {
@@ -2688,9 +2696,10 @@ var drawBackground = async ({
2688
2696
  const originalWebkitBackgroundClip = element.style.webkitBackgroundClip;
2689
2697
  element.style.backgroundClip = "initial";
2690
2698
  element.style.webkitBackgroundClip = "initial";
2699
+ const textLayerCutout = new DOMRect(boundingRect.left + parentOffsetLeft, boundingRect.top + parentOffsetTop, boundingRect.width, boundingRect.height);
2691
2700
  const onlyBackgroundClipText = await createLayer({
2692
2701
  element,
2693
- cutout: new DOMRect(boundingRect.left + parentOffsetLeft, boundingRect.top + parentOffsetTop, boundingRect.width, boundingRect.height),
2702
+ cutout: textLayerCutout,
2694
2703
  logLevel,
2695
2704
  internalState,
2696
2705
  scale,
@@ -3425,6 +3434,30 @@ function skipToNextNonDescendant(treeWalker) {
3425
3434
  }
3426
3435
 
3427
3436
  // src/get-biggest-bounding-client-rect.ts
3437
+ var getTextOverflowForLineHeight = (computedStyle) => {
3438
+ const { lineHeight } = computedStyle;
3439
+ const fontSize = parseFloat(computedStyle.fontSize);
3440
+ if (!fontSize || isNaN(fontSize)) {
3441
+ return { top: 0, bottom: 0 };
3442
+ }
3443
+ let lineHeightValue;
3444
+ if (lineHeight === "normal") {
3445
+ return { top: 0, bottom: 0 };
3446
+ }
3447
+ if (lineHeight.endsWith("px")) {
3448
+ lineHeightValue = parseFloat(lineHeight) / fontSize;
3449
+ } else {
3450
+ lineHeightValue = parseFloat(lineHeight);
3451
+ if (lineHeight.endsWith("%")) {
3452
+ lineHeightValue /= 100;
3453
+ }
3454
+ }
3455
+ if (isNaN(lineHeightValue) || lineHeightValue >= 1) {
3456
+ return { top: 0, bottom: 0 };
3457
+ }
3458
+ const overflow = (1 - lineHeightValue) * fontSize;
3459
+ return { top: overflow, bottom: overflow };
3460
+ };
3428
3461
  var getBiggestBoundingClientRect = (element) => {
3429
3462
  const treeWalker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
3430
3463
  let mostLeft = Infinity;
@@ -3436,6 +3469,7 @@ var getBiggestBoundingClientRect = (element) => {
3436
3469
  const outlineWidth = parseOutlineWidth(computedStyle.outlineWidth);
3437
3470
  const outlineOffset = parseOutlineOffset(computedStyle.outlineOffset);
3438
3471
  const rect = treeWalker.currentNode.getBoundingClientRect();
3472
+ const textOverflow = getTextOverflowForLineHeight(computedStyle);
3439
3473
  const shadows = parseBoxShadow(computedStyle.boxShadow);
3440
3474
  let shadowLeft = 0;
3441
3475
  let shadowRight = 0;
@@ -3450,9 +3484,9 @@ var getBiggestBoundingClientRect = (element) => {
3450
3484
  }
3451
3485
  }
3452
3486
  mostLeft = Math.min(mostLeft, rect.left - outlineOffset - outlineWidth - shadowLeft);
3453
- mostTop = Math.min(mostTop, rect.top - outlineOffset - outlineWidth - shadowTop);
3487
+ mostTop = Math.min(mostTop, rect.top - outlineOffset - outlineWidth - shadowTop - textOverflow.top);
3454
3488
  mostRight = Math.max(mostRight, rect.right + outlineOffset + outlineWidth + shadowRight);
3455
- mostBottom = Math.max(mostBottom, rect.bottom + outlineOffset + outlineWidth + shadowBottom);
3489
+ mostBottom = Math.max(mostBottom, rect.bottom + outlineOffset + outlineWidth + shadowBottom + textOverflow.bottom);
3456
3490
  if (computedStyle.overflow === "hidden") {
3457
3491
  if (!skipToNextNonDescendant(treeWalker)) {
3458
3492
  break;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/web-renderer"
4
4
  },
5
5
  "name": "@remotion/web-renderer",
6
- "version": "4.0.451",
6
+ "version": "4.0.453",
7
7
  "main": "dist/index.js",
8
8
  "type": "module",
9
9
  "scripts": {
@@ -22,19 +22,19 @@
22
22
  "@mediabunny/mp3-encoder": "1.39.2",
23
23
  "@mediabunny/aac-encoder": "1.39.2",
24
24
  "@mediabunny/flac-encoder": "1.39.2",
25
- "@remotion/licensing": "4.0.451",
26
- "remotion": "4.0.451",
25
+ "@remotion/licensing": "4.0.453",
26
+ "remotion": "4.0.453",
27
27
  "mediabunny": "1.39.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@react-three/fiber": "9.2.0",
31
- "@remotion/eslint-config-internal": "4.0.451",
32
- "@remotion/paths": "4.0.451",
33
- "@remotion/player": "4.0.451",
34
- "@remotion/media": "4.0.451",
35
- "@remotion/shapes": "4.0.451",
36
- "@remotion/three": "4.0.451",
37
- "@remotion/transitions": "4.0.451",
31
+ "@remotion/eslint-config-internal": "4.0.453",
32
+ "@remotion/paths": "4.0.453",
33
+ "@remotion/player": "4.0.453",
34
+ "@remotion/media": "4.0.453",
35
+ "@remotion/shapes": "4.0.453",
36
+ "@remotion/three": "4.0.453",
37
+ "@remotion/transitions": "4.0.453",
38
38
  "@types/three": "0.170.0",
39
39
  "@typescript/native-preview": "7.0.0-dev.20260217.1",
40
40
  "@vitejs/plugin-react": "4.3.4",
@@ -1 +0,0 @@
1
- export declare const getPrecomposeRectForFilter: (element: HTMLElement | SVGElement) => DOMRect;