@remotion/web-renderer 4.0.437 → 4.0.439

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 (2) hide show
  1. package/dist/esm/index.mjs +53 -0
  2. package/package.json +7 -7
@@ -1716,6 +1716,48 @@ var parseDirection = (directionStr) => {
1716
1716
  }
1717
1717
  return 180;
1718
1718
  };
1719
+ var cssColorToRgba = (color) => {
1720
+ try {
1721
+ const packed = NoReactInternals2.processColor(color);
1722
+ const a = (packed >>> 24 & 255) / 255;
1723
+ const r = packed >>> 16 & 255;
1724
+ const g = packed >>> 8 & 255;
1725
+ const b = packed & 255;
1726
+ return { r, g, b, a };
1727
+ } catch {
1728
+ return null;
1729
+ }
1730
+ };
1731
+ var isFullyTransparent = (color) => {
1732
+ const rgba = cssColorToRgba(color);
1733
+ return rgba !== null && rgba.a === 0;
1734
+ };
1735
+ var findNearestNonTransparent = (stops, fromIndex, direction) => {
1736
+ let i = fromIndex + direction;
1737
+ while (i >= 0 && i < stops.length) {
1738
+ if (!isFullyTransparent(stops[i].color)) {
1739
+ return stops[i].color;
1740
+ }
1741
+ i += direction;
1742
+ }
1743
+ return null;
1744
+ };
1745
+ var resolveTransparentStops = (stops) => {
1746
+ for (let i = 0;i < stops.length; i++) {
1747
+ if (!isFullyTransparent(stops[i].color)) {
1748
+ continue;
1749
+ }
1750
+ const prev = findNearestNonTransparent(stops, i, -1);
1751
+ const next = findNearestNonTransparent(stops, i, 1);
1752
+ const neighbor = prev ?? next;
1753
+ if (neighbor) {
1754
+ const rgba = cssColorToRgba(neighbor);
1755
+ if (rgba) {
1756
+ stops[i].color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, 0)`;
1757
+ }
1758
+ }
1759
+ }
1760
+ };
1719
1761
  var parseColorStops = (colorStopsStr) => {
1720
1762
  const parts = colorStopsStr.split(/,(?![^(]*\))/);
1721
1763
  const stops = [];
@@ -1799,6 +1841,7 @@ var parseColorStops = (colorStopsStr) => {
1799
1841
  for (const stop of stops) {
1800
1842
  stop.position = Math.max(0, Math.min(1, stop.position));
1801
1843
  }
1844
+ resolveTransparentStops(stops);
1802
1845
  return stops;
1803
1846
  };
1804
1847
  var extractGradientContent = (backgroundImage) => {
@@ -3637,10 +3680,15 @@ var drawText = ({
3637
3680
  fontSize,
3638
3681
  fontWeight,
3639
3682
  fontStyle,
3683
+ fontVariantCaps,
3684
+ fontKerning,
3685
+ fontStretch,
3640
3686
  direction,
3641
3687
  writingMode,
3642
3688
  letterSpacing,
3689
+ wordSpacing,
3643
3690
  textTransform,
3691
+ textRendering,
3644
3692
  webkitTextFillColor,
3645
3693
  webkitTextStrokeWidth,
3646
3694
  webkitTextStrokeColor,
@@ -3663,8 +3711,13 @@ var drawText = ({
3663
3711
  });
3664
3712
  const fontSizePx = parseFloat(fontSize);
3665
3713
  contextToDraw.font = `${fontStyle} ${fontWeight} ${fontSizePx}px ${fontFamily}`;
3714
+ contextToDraw.fontVariantCaps = fontVariantCaps;
3715
+ contextToDraw.fontKerning = fontKerning;
3716
+ contextToDraw.fontStretch = fontStretch;
3717
+ contextToDraw.textRendering = textRendering;
3666
3718
  contextToDraw.fillStyle = onlyBackgroundClipText ? "black" : webkitTextFillColor;
3667
3719
  contextToDraw.letterSpacing = letterSpacing;
3720
+ contextToDraw.wordSpacing = wordSpacing;
3668
3721
  const strokeWidth = parseFloat(webkitTextStrokeWidth);
3669
3722
  const hasStroke = strokeWidth > 0;
3670
3723
  if (hasStroke) {
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.437",
6
+ "version": "4.0.439",
7
7
  "main": "dist/index.js",
8
8
  "type": "module",
9
9
  "scripts": {
@@ -22,16 +22,16 @@
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.437",
26
- "remotion": "4.0.437",
25
+ "@remotion/licensing": "4.0.439",
26
+ "remotion": "4.0.439",
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.437",
32
- "@remotion/player": "4.0.437",
33
- "@remotion/media": "4.0.437",
34
- "@remotion/three": "4.0.437",
31
+ "@remotion/eslint-config-internal": "4.0.439",
32
+ "@remotion/player": "4.0.439",
33
+ "@remotion/media": "4.0.439",
34
+ "@remotion/three": "4.0.439",
35
35
  "@types/three": "0.170.0",
36
36
  "@typescript/native-preview": "7.0.0-dev.20260217.1",
37
37
  "@vitejs/plugin-react": "4.3.4",