@remotion/web-renderer 4.0.452 → 4.0.454

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.
@@ -3434,6 +3434,30 @@ function skipToNextNonDescendant(treeWalker) {
3434
3434
  }
3435
3435
 
3436
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
+ };
3437
3461
  var getBiggestBoundingClientRect = (element) => {
3438
3462
  const treeWalker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
3439
3463
  let mostLeft = Infinity;
@@ -3445,6 +3469,7 @@ var getBiggestBoundingClientRect = (element) => {
3445
3469
  const outlineWidth = parseOutlineWidth(computedStyle.outlineWidth);
3446
3470
  const outlineOffset = parseOutlineOffset(computedStyle.outlineOffset);
3447
3471
  const rect = treeWalker.currentNode.getBoundingClientRect();
3472
+ const textOverflow = getTextOverflowForLineHeight(computedStyle);
3448
3473
  const shadows = parseBoxShadow(computedStyle.boxShadow);
3449
3474
  let shadowLeft = 0;
3450
3475
  let shadowRight = 0;
@@ -3459,9 +3484,9 @@ var getBiggestBoundingClientRect = (element) => {
3459
3484
  }
3460
3485
  }
3461
3486
  mostLeft = Math.min(mostLeft, rect.left - outlineOffset - outlineWidth - shadowLeft);
3462
- mostTop = Math.min(mostTop, rect.top - outlineOffset - outlineWidth - shadowTop);
3487
+ mostTop = Math.min(mostTop, rect.top - outlineOffset - outlineWidth - shadowTop - textOverflow.top);
3463
3488
  mostRight = Math.max(mostRight, rect.right + outlineOffset + outlineWidth + shadowRight);
3464
- mostBottom = Math.max(mostBottom, rect.bottom + outlineOffset + outlineWidth + shadowBottom);
3489
+ mostBottom = Math.max(mostBottom, rect.bottom + outlineOffset + outlineWidth + shadowBottom + textOverflow.bottom);
3465
3490
  if (computedStyle.overflow === "hidden") {
3466
3491
  if (!skipToNextNonDescendant(treeWalker)) {
3467
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.452",
6
+ "version": "4.0.454",
7
7
  "main": "dist/index.js",
8
8
  "type": "module",
9
9
  "scripts": {
@@ -19,22 +19,22 @@
19
19
  "author": "Remotion <jonny@remotion.dev>",
20
20
  "license": "UNLICENSED",
21
21
  "dependencies": {
22
- "@mediabunny/mp3-encoder": "1.39.2",
23
- "@mediabunny/aac-encoder": "1.39.2",
24
- "@mediabunny/flac-encoder": "1.39.2",
25
- "@remotion/licensing": "4.0.452",
26
- "remotion": "4.0.452",
27
- "mediabunny": "1.39.2"
22
+ "@mediabunny/mp3-encoder": "1.42.0",
23
+ "@mediabunny/aac-encoder": "1.42.0",
24
+ "@mediabunny/flac-encoder": "1.42.0",
25
+ "@remotion/licensing": "4.0.454",
26
+ "remotion": "4.0.454",
27
+ "mediabunny": "1.42.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@react-three/fiber": "9.2.0",
31
- "@remotion/eslint-config-internal": "4.0.452",
32
- "@remotion/paths": "4.0.452",
33
- "@remotion/player": "4.0.452",
34
- "@remotion/media": "4.0.452",
35
- "@remotion/shapes": "4.0.452",
36
- "@remotion/three": "4.0.452",
37
- "@remotion/transitions": "4.0.452",
31
+ "@remotion/eslint-config-internal": "4.0.454",
32
+ "@remotion/paths": "4.0.454",
33
+ "@remotion/player": "4.0.454",
34
+ "@remotion/media": "4.0.454",
35
+ "@remotion/shapes": "4.0.454",
36
+ "@remotion/three": "4.0.454",
37
+ "@remotion/transitions": "4.0.454",
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;