@remotion/vercel 4.0.461 → 4.0.462

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 +192 -6
  2. package/package.json +4 -5
@@ -115,6 +115,23 @@ function checkInfiniteRange(name, arr) {
115
115
  }
116
116
  }
117
117
  }
118
+ function assertValidInterpolateEasingOption(easing, inputRangeLength) {
119
+ if (easing === undefined) {
120
+ return;
121
+ }
122
+ if (typeof easing === "function") {
123
+ return;
124
+ }
125
+ const expectedLength = inputRangeLength - 1;
126
+ if (easing.length !== expectedLength) {
127
+ throw new Error(\`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = \${expectedLength}), but got length \${easing.length}\`);
128
+ }
129
+ for (let i = 0;i < easing.length; i++) {
130
+ if (typeof easing[i] !== "function") {
131
+ throw new Error(\`easing[\${i}] must be a function\`);
132
+ }
133
+ }
134
+ }
118
135
  function interpolate(input, inputRange, outputRange, options) {
119
136
  if (typeof input === "undefined") {
120
137
  throw new Error("input can not be undefined");
@@ -131,7 +148,18 @@ function interpolate(input, inputRange, outputRange, options) {
131
148
  checkInfiniteRange("inputRange", inputRange);
132
149
  checkInfiniteRange("outputRange", outputRange);
133
150
  checkValidInputRange(inputRange);
134
- const easing = options?.easing ?? ((num) => num);
151
+ assertValidInterpolateEasingOption(options?.easing, inputRange.length);
152
+ const easingOption = options?.easing;
153
+ const defaultEasing = (num) => num;
154
+ const resolveEasingForSegment = (segmentIndex) => {
155
+ if (easingOption === undefined) {
156
+ return defaultEasing;
157
+ }
158
+ if (typeof easingOption === "function") {
159
+ return easingOption;
160
+ }
161
+ return easingOption[segmentIndex];
162
+ };
135
163
  let extrapolateLeft = "extend";
136
164
  if (options?.extrapolateLeft !== undefined) {
137
165
  extrapolateLeft = options.extrapolateLeft;
@@ -145,7 +173,7 @@ function interpolate(input, inputRange, outputRange, options) {
145
173
  }
146
174
  const range = findRange(input, inputRange);
147
175
  return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
148
- easing,
176
+ easing: resolveEasingForSegment(range),
149
177
  extrapolateLeft,
150
178
  extrapolateRight
151
179
  });
@@ -699,6 +727,70 @@ var proResProfileOptions = [
699
727
  "light",
700
728
  "proxy"
701
729
  ];
730
+ var sequenceStyleSchema = {
731
+ "style.translate": {
732
+ type: "translate",
733
+ step: 1,
734
+ default: "0px 0px",
735
+ description: "Offset"
736
+ },
737
+ "style.scale": {
738
+ type: "number",
739
+ min: 0.05,
740
+ max: 100,
741
+ step: 0.01,
742
+ default: 1,
743
+ description: "Scale"
744
+ },
745
+ "style.rotate": {
746
+ type: "rotation",
747
+ step: 1,
748
+ default: "0deg",
749
+ description: "Rotation"
750
+ },
751
+ "style.opacity": {
752
+ type: "number",
753
+ min: 0,
754
+ max: 1,
755
+ step: 0.01,
756
+ default: 1,
757
+ description: "Opacity"
758
+ },
759
+ premountFor: {
760
+ type: "number",
761
+ default: 0,
762
+ description: "Premount For",
763
+ min: 0,
764
+ step: 1
765
+ },
766
+ postmountFor: {
767
+ type: "hidden"
768
+ },
769
+ styleWhilePremounted: {
770
+ type: "hidden"
771
+ },
772
+ styleWhilePostmounted: {
773
+ type: "hidden"
774
+ }
775
+ };
776
+ var sequenceSchema = {
777
+ layout: {
778
+ type: "enum",
779
+ default: "absolute-fill",
780
+ description: "Layout",
781
+ variants: {
782
+ "absolute-fill": sequenceStyleSchema,
783
+ none: {}
784
+ }
785
+ }
786
+ };
787
+ var sequenceSchemaDefaultLayoutNone = {
788
+ ...sequenceSchema,
789
+ layout: {
790
+ ...sequenceSchema.layout,
791
+ default: "none"
792
+ }
793
+ };
702
794
  var ENABLE_V5_BREAKING_CHANGES = false;
703
795
  var validateFrame = ({
704
796
  allowFloats,
@@ -862,7 +954,8 @@ var NoReactInternals = {
862
954
  FILE_TOKEN,
863
955
  validateCodec,
864
956
  proResProfileOptions,
865
- findPropsToDelete
957
+ findPropsToDelete,
958
+ sequenceSchema
866
959
  };
867
960
 
868
961
  // src/scripts/render-still.ts
@@ -1039,6 +1132,23 @@ function checkInfiniteRange(name, arr) {
1039
1132
  }
1040
1133
  }
1041
1134
  }
1135
+ function assertValidInterpolateEasingOption(easing, inputRangeLength) {
1136
+ if (easing === undefined) {
1137
+ return;
1138
+ }
1139
+ if (typeof easing === "function") {
1140
+ return;
1141
+ }
1142
+ const expectedLength = inputRangeLength - 1;
1143
+ if (easing.length !== expectedLength) {
1144
+ throw new Error(\`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = \${expectedLength}), but got length \${easing.length}\`);
1145
+ }
1146
+ for (let i = 0;i < easing.length; i++) {
1147
+ if (typeof easing[i] !== "function") {
1148
+ throw new Error(\`easing[\${i}] must be a function\`);
1149
+ }
1150
+ }
1151
+ }
1042
1152
  function interpolate(input, inputRange, outputRange, options) {
1043
1153
  if (typeof input === "undefined") {
1044
1154
  throw new Error("input can not be undefined");
@@ -1055,7 +1165,18 @@ function interpolate(input, inputRange, outputRange, options) {
1055
1165
  checkInfiniteRange("inputRange", inputRange);
1056
1166
  checkInfiniteRange("outputRange", outputRange);
1057
1167
  checkValidInputRange(inputRange);
1058
- const easing = options?.easing ?? ((num) => num);
1168
+ assertValidInterpolateEasingOption(options?.easing, inputRange.length);
1169
+ const easingOption = options?.easing;
1170
+ const defaultEasing = (num) => num;
1171
+ const resolveEasingForSegment = (segmentIndex) => {
1172
+ if (easingOption === undefined) {
1173
+ return defaultEasing;
1174
+ }
1175
+ if (typeof easingOption === "function") {
1176
+ return easingOption;
1177
+ }
1178
+ return easingOption[segmentIndex];
1179
+ };
1059
1180
  let extrapolateLeft = "extend";
1060
1181
  if (options?.extrapolateLeft !== undefined) {
1061
1182
  extrapolateLeft = options.extrapolateLeft;
@@ -1069,7 +1190,7 @@ function interpolate(input, inputRange, outputRange, options) {
1069
1190
  }
1070
1191
  const range = findRange(input, inputRange);
1071
1192
  return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
1072
- easing,
1193
+ easing: resolveEasingForSegment(range),
1073
1194
  extrapolateLeft,
1074
1195
  extrapolateRight
1075
1196
  });
@@ -1623,6 +1744,70 @@ var proResProfileOptions = [
1623
1744
  "light",
1624
1745
  "proxy"
1625
1746
  ];
1747
+ var sequenceStyleSchema = {
1748
+ "style.translate": {
1749
+ type: "translate",
1750
+ step: 1,
1751
+ default: "0px 0px",
1752
+ description: "Offset"
1753
+ },
1754
+ "style.scale": {
1755
+ type: "number",
1756
+ min: 0.05,
1757
+ max: 100,
1758
+ step: 0.01,
1759
+ default: 1,
1760
+ description: "Scale"
1761
+ },
1762
+ "style.rotate": {
1763
+ type: "rotation",
1764
+ step: 1,
1765
+ default: "0deg",
1766
+ description: "Rotation"
1767
+ },
1768
+ "style.opacity": {
1769
+ type: "number",
1770
+ min: 0,
1771
+ max: 1,
1772
+ step: 0.01,
1773
+ default: 1,
1774
+ description: "Opacity"
1775
+ },
1776
+ premountFor: {
1777
+ type: "number",
1778
+ default: 0,
1779
+ description: "Premount For",
1780
+ min: 0,
1781
+ step: 1
1782
+ },
1783
+ postmountFor: {
1784
+ type: "hidden"
1785
+ },
1786
+ styleWhilePremounted: {
1787
+ type: "hidden"
1788
+ },
1789
+ styleWhilePostmounted: {
1790
+ type: "hidden"
1791
+ }
1792
+ };
1793
+ var sequenceSchema = {
1794
+ layout: {
1795
+ type: "enum",
1796
+ default: "absolute-fill",
1797
+ description: "Layout",
1798
+ variants: {
1799
+ "absolute-fill": sequenceStyleSchema,
1800
+ none: {}
1801
+ }
1802
+ }
1803
+ };
1804
+ var sequenceSchemaDefaultLayoutNone = {
1805
+ ...sequenceSchema,
1806
+ layout: {
1807
+ ...sequenceSchema.layout,
1808
+ default: "none"
1809
+ }
1810
+ };
1626
1811
  var ENABLE_V5_BREAKING_CHANGES = false;
1627
1812
  var validateFrame = ({
1628
1813
  allowFloats,
@@ -1786,7 +1971,8 @@ var NoReactInternals = {
1786
1971
  FILE_TOKEN,
1787
1972
  validateCodec,
1788
1973
  proResProfileOptions,
1789
- findPropsToDelete
1974
+ findPropsToDelete,
1975
+ sequenceSchema
1790
1976
  };
1791
1977
 
1792
1978
  // src/scripts/render-video.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/vercel",
3
- "version": "4.0.461",
3
+ "version": "4.0.462",
4
4
  "description": "Render Remotion videos on Vercel Sandbox",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,6 @@
8
8
  "repository": {
9
9
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/vercel"
10
10
  },
11
- "sideEffects": false,
12
11
  "type": "module",
13
12
  "scripts": {
14
13
  "formatting": "oxfmt src --check",
@@ -24,8 +23,8 @@
24
23
  "url": "https://github.com/remotion-dev/remotion/issues"
25
24
  },
26
25
  "dependencies": {
27
- "@remotion/renderer": "4.0.461",
28
- "remotion": "4.0.461"
26
+ "@remotion/renderer": "4.0.462",
27
+ "remotion": "4.0.462"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "@vercel/sandbox": ">=1.0.0"
@@ -39,7 +38,7 @@
39
38
  "./package.json": "./package.json"
40
39
  },
41
40
  "devDependencies": {
42
- "@remotion/eslint-config-internal": "4.0.461",
41
+ "@remotion/eslint-config-internal": "4.0.462",
43
42
  "@vercel/blob": "2.3.0",
44
43
  "@vercel/sandbox": "1.6.0",
45
44
  "eslint": "9.19.0",