@vosjs/cli 0.56.0 → 0.57.0

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.
@@ -10122,6 +10122,15 @@ var PAINTER_LIB = ` // THE PAINTER STARTER (vos port): the maths every port r
10122
10122
  return 1 - Math.exp(-z * w0 * t) * (Math.cos(wd * t) + ((z * w0) / wd) * Math.sin(wd * t))
10123
10123
  }
10124
10124
  // The frames a spring takes to settle within half a percent and stay there.
10125
+ // The spring's continuous settle time in seconds: the duration that makes
10126
+ // a tween eased 'spring(damping, stiffness, mass)' (@vosjs/timeline 0.5+)
10127
+ // move exactly as Remotion's spring. Same rule and 1 ms step as the ease.
10128
+ const springSeconds = (config = {}) => {
10129
+ let last = 0
10130
+ for (let i = 0; i <= 30000; i++)
10131
+ if (Math.abs(springUnit(i * 0.001, config) - 1) >= 0.005) last = i * 0.001
10132
+ return last + 0.001
10133
+ }
10125
10134
  const springFrames = (fps, config = {}) => {
10126
10135
  let last = 0
10127
10136
  for (let f = 0; f <= fps * 10; f++)
@@ -10223,7 +10232,7 @@ var PAINTER_LIB = ` // THE PAINTER STARTER (vos port): the maths every port r
10223
10232
  corner(p[ii + i2 + p[jj + j2 + p[kk + k2]]], x0 - i2 + 2 * G3, y0 - j2 + 2 * G3, z0 - k2 + 2 * G3) +
10224
10233
  corner(p[ii + 1 + p[jj + 1 + p[kk + 1]]], x0 - 1 + 3 * G3, y0 - 1 + 3 * G3, z0 - 1 + 3 * G3))
10225
10234
  }
10226
- const lib = { clamp, interpolate, bezier, spring, springFrames, springTo, noise2D, noise3D, random, rng }`;
10235
+ const lib = { clamp, interpolate, bezier, spring, springFrames, springSeconds, springTo, noise2D, noise3D, random, rng }`;
10227
10236
 
10228
10237
  // src/plugin/portScaffold.ts
10229
10238
  var DESIGN_HEIGHT = 1080;
@@ -10496,9 +10505,11 @@ function programSource(p) {
10496
10505
  (s) => ` // TODO scene "${s.name}" (${s.start}s${s.duration ? ` to ${s.start + s.duration}s` : ""}): translate its motion onto ctx.elements.get(id).props / .segments here`
10497
10506
  ).join("\n") : " // TODO: translate the source's motion here, one block per scene (tl.addLabel above names them)";
10498
10507
  const springHint = p.uses.includes("spring") ? `
10499
- // The source springs: content.refs.lib.springTo(tl, target, { y: [120, 0] }, at,
10500
- // { fps: ctx.data.fps, config: { damping: 200 } }) puts Remotion's spring on
10501
- // the timeline frame by frame (spring({ frame, fps, config }) for a value).` : "";
10508
+ // The source springs. Put a spring ON THE TIMELINE with the spring ease:
10509
+ // tl.to(p, { y: 0, ease: 'spring(200)', duration: content.refs.lib.springSeconds({ damping: 200 }) }, at)
10510
+ // moves exactly as Remotion's spring({ config: { damping: 200 } }) (a longer
10511
+ // duration stretches it, as durationInFrames does). Never compute a spring in
10512
+ // onFrame. lib.spring({ frame, fps, config }) is the value, for a painter.` : "";
10502
10513
  const libBlock = p.lib ? `
10503
10514
  ${PAINTER_LIB}` : "";
10504
10515
  const painterContent = p.painter ? `
@@ -14689,4 +14700,4 @@ export {
14689
14700
  verbHelp,
14690
14701
  run
14691
14702
  };
14692
- //# sourceMappingURL=chunk-XXAY42XS.js.map
14703
+ //# sourceMappingURL=chunk-Z74Y4WNW.js.map