@remotion/web-renderer 4.0.484 → 4.0.485

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.
@@ -1,8 +1,8 @@
1
1
  import type { LinearGradientInfo } from './parse-linear-gradient';
2
2
  export declare const getPrecomposeRectForMask: (element: HTMLElement | SVGElement) => DOMRect;
3
- export declare const handleMask: ({ gradientInfo, rect, precomposeRect, tempContext, scale, }: {
3
+ export declare const handleMask: ({ gradientInfo, maskRect, precomposeRect, tempContext, scale, }: {
4
4
  gradientInfo: LinearGradientInfo;
5
- rect: DOMRect;
5
+ maskRect: DOMRect;
6
6
  precomposeRect: DOMRect;
7
7
  tempContext: OffscreenCanvasRenderingContext2D;
8
8
  scale: number;
@@ -1,8 +1,10 @@
1
1
  type TextDecorationLine = 'underline' | 'overline' | 'line-through';
2
+ export type TextDecorationStyle = 'solid' | 'double' | 'dotted' | 'dashed';
2
3
  export type TextDecoration = {
3
4
  lines: TextDecorationLine[];
4
5
  color: string;
5
6
  thickness: number;
7
+ style: TextDecorationStyle;
6
8
  };
7
9
  export declare const parseTextDecoration: ({ onlyBackgroundClipText, style, }: {
8
10
  onlyBackgroundClipText: boolean;
@@ -3866,12 +3866,12 @@ var getPrecomposeRectForMask = (element) => {
3866
3866
  };
3867
3867
  var handleMask = ({
3868
3868
  gradientInfo,
3869
- rect,
3869
+ maskRect,
3870
3870
  precomposeRect,
3871
3871
  tempContext,
3872
3872
  scale
3873
3873
  }) => {
3874
- const rectToFill = new DOMRect((rect.left - precomposeRect.left) * scale, (rect.top - precomposeRect.top) * scale, rect.width * scale, rect.height * scale);
3874
+ const rectToFill = new DOMRect((maskRect.left - precomposeRect.left) * scale, (maskRect.top - precomposeRect.top) * scale, maskRect.width * scale, maskRect.height * scale);
3875
3875
  const gradient = createCanvasGradient({
3876
3876
  ctx: tempContext,
3877
3877
  rect: rectToFill,
@@ -3998,7 +3998,7 @@ var processNode = async ({
3998
3998
  if (precompositing.needsMaskImage) {
3999
3999
  handleMask({
4000
4000
  gradientInfo: precompositing.needsMaskImage,
4001
- rect,
4001
+ maskRect: dimensions,
4002
4002
  precomposeRect,
4003
4003
  tempContext,
4004
4004
  scale
@@ -4133,12 +4133,21 @@ var currentColorValues = new Set(["currentcolor", "currentColor"]);
4133
4133
  var getDefaultTextDecorationThickness = (fontSizePx) => {
4134
4134
  return Math.max(1, Number.isFinite(fontSizePx) ? fontSizePx / 16 : 1);
4135
4135
  };
4136
+ var getTextDecorationStyle = (style) => {
4137
+ if (style === "wavy") {
4138
+ return null;
4139
+ }
4140
+ if (style === "double" || style === "dotted" || style === "dashed") {
4141
+ return style;
4142
+ }
4143
+ return "solid";
4144
+ };
4136
4145
  var parseTextDecoration = ({
4137
4146
  onlyBackgroundClipText,
4138
4147
  style
4139
4148
  }) => {
4140
- const textDecorationStyle = style.getPropertyValue("text-decoration-style");
4141
- if (textDecorationStyle && textDecorationStyle !== "solid") {
4149
+ const textDecorationStyle = getTextDecorationStyle(style.getPropertyValue("text-decoration-style").trim());
4150
+ if (textDecorationStyle === null) {
4142
4151
  return null;
4143
4152
  }
4144
4153
  const textDecorationLine = style.getPropertyValue("text-decoration-line");
@@ -4157,7 +4166,8 @@ var parseTextDecoration = ({
4157
4166
  return {
4158
4167
  lines,
4159
4168
  color: onlyBackgroundClipText || !textDecorationColor || currentColorValues.has(textDecorationColor) ? onlyBackgroundClipText ? "black" : style.color : textDecorationColor,
4160
- thickness
4169
+ thickness,
4170
+ style: textDecorationStyle
4161
4171
  };
4162
4172
  };
4163
4173
  var getTextDecorations = ({
@@ -4204,6 +4214,26 @@ var getTextDecorationY = ({
4204
4214
  }
4205
4215
  return y - actualAscent * 0.35;
4206
4216
  };
4217
+ var getTextDecorationLineDashPattern = (style, thickness) => {
4218
+ if (style === "dashed") {
4219
+ return [thickness * 2, thickness];
4220
+ }
4221
+ if (style === "dotted") {
4222
+ return [thickness, thickness];
4223
+ }
4224
+ return [];
4225
+ };
4226
+ var strokeTextDecorationLine = ({
4227
+ contextToDraw,
4228
+ endX,
4229
+ lineY,
4230
+ startX
4231
+ }) => {
4232
+ contextToDraw.beginPath();
4233
+ contextToDraw.moveTo(startX, lineY);
4234
+ contextToDraw.lineTo(endX, lineY);
4235
+ contextToDraw.stroke();
4236
+ };
4207
4237
  var drawTextDecoration = ({
4208
4238
  contextToDraw,
4209
4239
  fontSizePx,
@@ -4234,10 +4264,31 @@ var drawTextDecoration = ({
4234
4264
  thickness: textDecoration.thickness,
4235
4265
  fontSizePx
4236
4266
  });
4237
- contextToDraw.beginPath();
4238
- contextToDraw.moveTo(startX, lineY);
4239
- contextToDraw.lineTo(endX, lineY);
4240
- contextToDraw.stroke();
4267
+ if (textDecoration.style === "double") {
4268
+ contextToDraw.setLineDash([]);
4269
+ strokeTextDecorationLine({
4270
+ contextToDraw,
4271
+ endX,
4272
+ lineY: lineY - textDecoration.thickness,
4273
+ startX
4274
+ });
4275
+ strokeTextDecorationLine({
4276
+ contextToDraw,
4277
+ endX,
4278
+ lineY: lineY + textDecoration.thickness,
4279
+ startX
4280
+ });
4281
+ contextToDraw.setLineDash([]);
4282
+ continue;
4283
+ }
4284
+ contextToDraw.setLineDash(getTextDecorationLineDashPattern(textDecoration.style, textDecoration.thickness));
4285
+ strokeTextDecorationLine({
4286
+ contextToDraw,
4287
+ endX,
4288
+ lineY,
4289
+ startX
4290
+ });
4291
+ contextToDraw.setLineDash([]);
4241
4292
  }
4242
4293
  }
4243
4294
  contextToDraw.restore();
@@ -5,7 +5,7 @@ export type WebRendererContainer = 'mp4' | 'webm' | 'mkv' | 'mov' | 'wav' | 'mp3
5
5
  export type WebRendererAudioCodec = 'aac' | 'opus' | 'mp3' | 'vorbis' | 'pcm-s16' | 'flac';
6
6
  export type WebRendererQuality = 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
7
7
  export declare const isAudioOnlyContainer: (container: WebRendererContainer) => boolean;
8
- export declare const codecToMediabunnyCodec: (codec: WebRendererVideoCodec) => "av1" | "avc" | "hevc" | "vp8" | "vp9";
8
+ export declare const codecToMediabunnyCodec: (codec: WebRendererVideoCodec) => "av1" | "avc" | "hevc" | "prores" | "vp8" | "vp9";
9
9
  export declare const containerToMediabunnyContainer: (container: WebRendererContainer) => OutputFormat;
10
10
  export declare const getDefaultVideoCodecForContainer: (container: WebRendererContainer) => WebRendererVideoCodec | null;
11
11
  export declare const getDefaultContainerForCodec: (codec: WebRendererVideoCodec) => WebRendererContainer;
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.484",
6
+ "version": "4.0.485",
7
7
  "main": "dist/index.js",
8
8
  "type": "module",
9
9
  "scripts": {
@@ -17,24 +17,24 @@
17
17
  "remotion": "cd ../example && bunx remotion studio ../web-renderer/src/test/studio.ts --public-dir=../example-videos/videos"
18
18
  },
19
19
  "author": "Remotion <jonny@remotion.dev>",
20
- "license": "UNLICENSED",
20
+ "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
- "@mediabunny/mp3-encoder": "1.47.0",
23
- "@mediabunny/aac-encoder": "1.47.0",
24
- "@mediabunny/flac-encoder": "1.47.0",
25
- "@remotion/licensing": "4.0.484",
26
- "remotion": "4.0.484",
27
- "mediabunny": "1.47.0"
22
+ "@mediabunny/mp3-encoder": "1.50.3",
23
+ "@mediabunny/aac-encoder": "1.50.3",
24
+ "@mediabunny/flac-encoder": "1.50.3",
25
+ "@remotion/licensing": "4.0.485",
26
+ "remotion": "4.0.485",
27
+ "mediabunny": "1.50.3"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@react-three/fiber": "9.2.0",
31
- "@remotion/eslint-config-internal": "4.0.484",
32
- "@remotion/paths": "4.0.484",
33
- "@remotion/player": "4.0.484",
34
- "@remotion/media": "4.0.484",
35
- "@remotion/shapes": "4.0.484",
36
- "@remotion/three": "4.0.484",
37
- "@remotion/transitions": "4.0.484",
31
+ "@remotion/eslint-config-internal": "4.0.485",
32
+ "@remotion/paths": "4.0.485",
33
+ "@remotion/player": "4.0.485",
34
+ "@remotion/media": "4.0.485",
35
+ "@remotion/shapes": "4.0.485",
36
+ "@remotion/three": "4.0.485",
37
+ "@remotion/transitions": "4.0.485",
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",