@remotion/web-renderer 4.0.438 → 4.0.440
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/esm/index.mjs +43 -0
- package/package.json +7 -7
package/dist/esm/index.mjs
CHANGED
|
@@ -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) => {
|
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.
|
|
6
|
+
"version": "4.0.440",
|
|
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.
|
|
26
|
-
"remotion": "4.0.
|
|
25
|
+
"@remotion/licensing": "4.0.440",
|
|
26
|
+
"remotion": "4.0.440",
|
|
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.
|
|
32
|
-
"@remotion/player": "4.0.
|
|
33
|
-
"@remotion/media": "4.0.
|
|
34
|
-
"@remotion/three": "4.0.
|
|
31
|
+
"@remotion/eslint-config-internal": "4.0.440",
|
|
32
|
+
"@remotion/player": "4.0.440",
|
|
33
|
+
"@remotion/media": "4.0.440",
|
|
34
|
+
"@remotion/three": "4.0.440",
|
|
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",
|