@remotion/serverless-client 4.0.482 → 4.0.484

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 +62 -12
  2. package/package.json +5 -5
@@ -294,6 +294,35 @@ function findRange(input, inputRange) {
294
294
  return i - 1;
295
295
  }
296
296
  var defaultEasing = (num) => num;
297
+ var shouldExtendRightForEasing = (easing) => {
298
+ return easing.remotionShouldExtendRight === true;
299
+ };
300
+ var resolveEasingForSegment = ({
301
+ easing,
302
+ segmentIndex
303
+ }) => {
304
+ if (easing === undefined) {
305
+ return defaultEasing;
306
+ }
307
+ if (typeof easing === "function") {
308
+ return easing;
309
+ }
310
+ return easing[segmentIndex];
311
+ };
312
+ var interpolateSegment = ({
313
+ input,
314
+ inputRange,
315
+ outputRange,
316
+ easing,
317
+ extrapolateLeft,
318
+ extrapolateRight
319
+ }) => {
320
+ return interpolateFunction(input, inputRange, outputRange, {
321
+ easing,
322
+ extrapolateLeft,
323
+ extrapolateRight: input > inputRange[1] && extrapolateRight === "clamp" && shouldExtendRightForEasing(easing) ? "extend" : extrapolateRight
324
+ });
325
+ };
297
326
  var interpolateNumber = ({
298
327
  input,
299
328
  inputRange,
@@ -304,15 +333,6 @@ var interpolateNumber = ({
304
333
  return outputRange[0];
305
334
  }
306
335
  const easingOption = options?.easing;
307
- const resolveEasingForSegment = (segmentIndex) => {
308
- if (easingOption === undefined) {
309
- return defaultEasing;
310
- }
311
- if (typeof easingOption === "function") {
312
- return easingOption;
313
- }
314
- return easingOption[segmentIndex];
315
- };
316
336
  let extrapolateLeft = "extend";
317
337
  if (options?.extrapolateLeft !== undefined) {
318
338
  extrapolateLeft = options.extrapolateLeft;
@@ -323,11 +343,41 @@ var interpolateNumber = ({
323
343
  }
324
344
  const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
325
345
  const range = findRange(posterizedInput, inputRange);
326
- return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
327
- easing: resolveEasingForSegment(range),
346
+ const easing = resolveEasingForSegment({
347
+ easing: easingOption,
348
+ segmentIndex: range
349
+ });
350
+ let result = interpolateSegment({
351
+ input: posterizedInput,
352
+ inputRange: [inputRange[range], inputRange[range + 1]],
353
+ outputRange: [outputRange[range], outputRange[range + 1]],
354
+ easing,
328
355
  extrapolateLeft,
329
356
  extrapolateRight
330
357
  });
358
+ for (let segmentIndex = 0;segmentIndex < range; segmentIndex++) {
359
+ const previousEasing = resolveEasingForSegment({
360
+ easing: easingOption,
361
+ segmentIndex
362
+ });
363
+ if (!shouldExtendRightForEasing(previousEasing)) {
364
+ continue;
365
+ }
366
+ const previousSegmentEnd = inputRange[segmentIndex + 1];
367
+ if (posterizedInput <= previousSegmentEnd) {
368
+ continue;
369
+ }
370
+ const continuedSegmentValue = interpolateSegment({
371
+ input: posterizedInput,
372
+ inputRange: [inputRange[segmentIndex], previousSegmentEnd],
373
+ outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
374
+ easing: previousEasing,
375
+ extrapolateLeft,
376
+ extrapolateRight: "extend"
377
+ });
378
+ result += continuedSegmentValue - outputRange[segmentIndex + 1];
379
+ }
380
+ return result;
331
381
  };
332
382
  var interpolateString = ({
333
383
  input,
@@ -1616,7 +1666,7 @@ var validateFramesPerFunction = ({
1616
1666
  import * as tty from "tty";
1617
1667
 
1618
1668
  // ../core/dist/esm/version.mjs
1619
- var VERSION = "4.0.482";
1669
+ var VERSION = "4.0.484";
1620
1670
 
1621
1671
  // ../renderer/dist/esm/error-handling.mjs
1622
1672
  var isColorSupported = () => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless-client"
4
4
  },
5
5
  "name": "@remotion/serverless-client",
6
- "version": "4.0.482",
6
+ "version": "4.0.484",
7
7
  "main": "dist",
8
8
  "scripts": {
9
9
  "lint": "eslint src",
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "dependencies": {},
25
25
  "devDependencies": {
26
- "remotion": "4.0.482",
27
- "@remotion/streaming": "4.0.482",
28
- "@remotion/renderer": "4.0.482",
29
- "@remotion/eslint-config-internal": "4.0.482",
26
+ "remotion": "4.0.484",
27
+ "@remotion/streaming": "4.0.484",
28
+ "@remotion/renderer": "4.0.484",
29
+ "@remotion/eslint-config-internal": "4.0.484",
30
30
  "eslint": "9.19.0",
31
31
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
32
32
  },