@tweenjs/tween.js 24.0.0 → 25.0.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.
package/dist/tween.amd.js CHANGED
@@ -601,7 +601,7 @@ define(['exports'], (function (exports) { 'use strict';
601
601
  };
602
602
  Tween.prototype.end = function () {
603
603
  this._goToEnd = true;
604
- this.update(Infinity);
604
+ this.update(this._startTime + this._duration);
605
605
  return this;
606
606
  };
607
607
  Tween.prototype.pause = function (time) {
@@ -712,12 +712,16 @@ define(['exports'], (function (exports) { 'use strict';
712
712
  * @returns true if the tween is still playing after the update, false
713
713
  * otherwise (calling update on a paused tween still returns true because
714
714
  * it is still playing, just paused).
715
+ *
716
+ * @param autoStart - When true, calling update will implicitly call start()
717
+ * as well. Note, if you stop() or end() the tween, but are still calling
718
+ * update(), it will start again!
715
719
  */
716
720
  Tween.prototype.update = function (time, autoStart) {
717
721
  var _this = this;
718
722
  var _a;
719
723
  if (time === void 0) { time = now(); }
720
- if (autoStart === void 0) { autoStart = true; }
724
+ if (autoStart === void 0) { autoStart = Tween.autoStartOnUpdate; }
721
725
  if (this._isPaused)
722
726
  return true;
723
727
  var property;
@@ -864,10 +868,11 @@ define(['exports'], (function (exports) { 'use strict';
864
868
  }
865
869
  this._valuesEnd[property] = tmp;
866
870
  };
871
+ Tween.autoStartOnUpdate = false;
867
872
  return Tween;
868
873
  }());
869
874
 
870
- var VERSION = '24.0.0';
875
+ var VERSION = '25.0.0';
871
876
 
872
877
  /**
873
878
  * Tween.js - Licensed under the MIT license
package/dist/tween.cjs CHANGED
@@ -603,7 +603,7 @@ var Tween = /** @class */ (function () {
603
603
  };
604
604
  Tween.prototype.end = function () {
605
605
  this._goToEnd = true;
606
- this.update(Infinity);
606
+ this.update(this._startTime + this._duration);
607
607
  return this;
608
608
  };
609
609
  Tween.prototype.pause = function (time) {
@@ -714,12 +714,16 @@ var Tween = /** @class */ (function () {
714
714
  * @returns true if the tween is still playing after the update, false
715
715
  * otherwise (calling update on a paused tween still returns true because
716
716
  * it is still playing, just paused).
717
+ *
718
+ * @param autoStart - When true, calling update will implicitly call start()
719
+ * as well. Note, if you stop() or end() the tween, but are still calling
720
+ * update(), it will start again!
717
721
  */
718
722
  Tween.prototype.update = function (time, autoStart) {
719
723
  var _this = this;
720
724
  var _a;
721
725
  if (time === void 0) { time = now(); }
722
- if (autoStart === void 0) { autoStart = true; }
726
+ if (autoStart === void 0) { autoStart = Tween.autoStartOnUpdate; }
723
727
  if (this._isPaused)
724
728
  return true;
725
729
  var property;
@@ -866,10 +870,11 @@ var Tween = /** @class */ (function () {
866
870
  }
867
871
  this._valuesEnd[property] = tmp;
868
872
  };
873
+ Tween.autoStartOnUpdate = false;
869
874
  return Tween;
870
875
  }());
871
876
 
872
- var VERSION = '24.0.0';
877
+ var VERSION = '25.0.0';
873
878
 
874
879
  /**
875
880
  * Tween.js - Licensed under the MIT license
package/dist/tween.d.ts CHANGED
@@ -53,6 +53,7 @@ declare const Interpolation: {
53
53
  */
54
54
 
55
55
  declare class Tween<T extends UnknownProps = any> {
56
+ static autoStartOnUpdate: boolean;
56
57
  private _isPaused;
57
58
  private _pauseStart;
58
59
  private _valuesStart;
@@ -143,6 +144,10 @@ declare class Tween<T extends UnknownProps = any> {
143
144
  * @returns true if the tween is still playing after the update, false
144
145
  * otherwise (calling update on a paused tween still returns true because
145
146
  * it is still playing, just paused).
147
+ *
148
+ * @param autoStart - When true, calling update will implicitly call start()
149
+ * as well. Note, if you stop() or end() the tween, but are still calling
150
+ * update(), it will start again!
146
151
  */
147
152
  update(time?: number, autoStart?: boolean): boolean;
148
153
  private _updateProperties;
@@ -188,7 +193,7 @@ declare class Sequence {
188
193
  static nextId(): number;
189
194
  }
190
195
 
191
- declare const VERSION = "24.0.0";
196
+ declare const VERSION = "25.0.0";
192
197
 
193
198
  declare const nextId: typeof Sequence.nextId;
194
199
  /**
package/dist/tween.esm.js CHANGED
@@ -599,7 +599,7 @@ var Tween = /** @class */ (function () {
599
599
  };
600
600
  Tween.prototype.end = function () {
601
601
  this._goToEnd = true;
602
- this.update(Infinity);
602
+ this.update(this._startTime + this._duration);
603
603
  return this;
604
604
  };
605
605
  Tween.prototype.pause = function (time) {
@@ -710,12 +710,16 @@ var Tween = /** @class */ (function () {
710
710
  * @returns true if the tween is still playing after the update, false
711
711
  * otherwise (calling update on a paused tween still returns true because
712
712
  * it is still playing, just paused).
713
+ *
714
+ * @param autoStart - When true, calling update will implicitly call start()
715
+ * as well. Note, if you stop() or end() the tween, but are still calling
716
+ * update(), it will start again!
713
717
  */
714
718
  Tween.prototype.update = function (time, autoStart) {
715
719
  var _this = this;
716
720
  var _a;
717
721
  if (time === void 0) { time = now(); }
718
- if (autoStart === void 0) { autoStart = true; }
722
+ if (autoStart === void 0) { autoStart = Tween.autoStartOnUpdate; }
719
723
  if (this._isPaused)
720
724
  return true;
721
725
  var property;
@@ -862,10 +866,11 @@ var Tween = /** @class */ (function () {
862
866
  }
863
867
  this._valuesEnd[property] = tmp;
864
868
  };
869
+ Tween.autoStartOnUpdate = false;
865
870
  return Tween;
866
871
  }());
867
872
 
868
- var VERSION = '24.0.0';
873
+ var VERSION = '25.0.0';
869
874
 
870
875
  /**
871
876
  * Tween.js - Licensed under the MIT license
package/dist/tween.umd.js CHANGED
@@ -605,7 +605,7 @@
605
605
  };
606
606
  Tween.prototype.end = function () {
607
607
  this._goToEnd = true;
608
- this.update(Infinity);
608
+ this.update(this._startTime + this._duration);
609
609
  return this;
610
610
  };
611
611
  Tween.prototype.pause = function (time) {
@@ -716,12 +716,16 @@
716
716
  * @returns true if the tween is still playing after the update, false
717
717
  * otherwise (calling update on a paused tween still returns true because
718
718
  * it is still playing, just paused).
719
+ *
720
+ * @param autoStart - When true, calling update will implicitly call start()
721
+ * as well. Note, if you stop() or end() the tween, but are still calling
722
+ * update(), it will start again!
719
723
  */
720
724
  Tween.prototype.update = function (time, autoStart) {
721
725
  var _this = this;
722
726
  var _a;
723
727
  if (time === void 0) { time = now(); }
724
- if (autoStart === void 0) { autoStart = true; }
728
+ if (autoStart === void 0) { autoStart = Tween.autoStartOnUpdate; }
725
729
  if (this._isPaused)
726
730
  return true;
727
731
  var property;
@@ -868,10 +872,11 @@
868
872
  }
869
873
  this._valuesEnd[property] = tmp;
870
874
  };
875
+ Tween.autoStartOnUpdate = false;
871
876
  return Tween;
872
877
  }());
873
878
 
874
- var VERSION = '24.0.0';
879
+ var VERSION = '25.0.0';
875
880
 
876
881
  /**
877
882
  * Tween.js - Licensed under the MIT license
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tweenjs/tween.js",
3
3
  "description": "Simple and fast tweening engine with optimised Robert Penner's equations.",
4
- "version": "24.0.0",
4
+ "version": "25.0.0",
5
5
  "type": "module",
6
6
  "main": "dist/tween.cjs",
7
7
  "types": "dist/tween.d.ts",