@aarsteinmedia/dotlottie-player 2.2.6 → 2.2.7

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/cjs/index.js CHANGED
@@ -33,6 +33,7 @@ exports.PlayerEvents = void 0;
33
33
  PlayerEvents["Next"] = "next";
34
34
  PlayerEvents["Pause"] = "pause";
35
35
  PlayerEvents["Play"] = "play";
36
+ PlayerEvents["Previous"] = "previous";
36
37
  PlayerEvents["Ready"] = "ready";
37
38
  PlayerEvents["Rendered"] = "rendered";
38
39
  PlayerEvents["Stop"] = "stop";
@@ -300,7 +301,7 @@ const addExt = (ext, str)=>{
300
301
  };
301
302
 
302
303
  var name = "@aarsteinmedia/dotlottie-player";
303
- var version = "2.2.6";
304
+ var version = "2.2.7";
304
305
  var description = "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";
305
306
  var exports$1 = {
306
307
  ".": {
@@ -814,7 +815,7 @@ class DotLottiePlayer extends lit.LitElement {
814
815
  _handleBlur() {
815
816
  setTimeout(()=>this._toggleSettings(false), 200);
816
817
  }
817
- _switchInstance() {
818
+ _switchInstance(isPrevious = false) {
818
819
  if (!this._animations[this._currentAnimation]) return;
819
820
  if (this._lottieInstance) this._lottieInstance.destroy();
820
821
  this._lottieInstance = Lottie.loadAnimation({
@@ -825,7 +826,7 @@ class DotLottiePlayer extends lit.LitElement {
825
826
  this._isBounce = this.multiAnimationSettings[this._currentAnimation].mode === exports.PlayMode.Bounce;
826
827
  }
827
828
  this._addEventListeners();
828
- this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Next));
829
+ this.dispatchEvent(new CustomEvent(isPrevious ? exports.PlayerEvents.Previous : exports.PlayerEvents.Next));
829
830
  if (this.multiAnimationSettings?.[this._currentAnimation]?.autoplay ?? this.autoplay) {
830
831
  this._lottieInstance?.goToAndPlay(0, true);
831
832
  this.currentState = exports.PlayerState.Playing;
@@ -840,7 +841,7 @@ class DotLottiePlayer extends lit.LitElement {
840
841
  }
841
842
  prev() {
842
843
  this._currentAnimation--;
843
- this._switchInstance();
844
+ this._switchInstance(true);
844
845
  }
845
846
  convert(typeCheck, manifest, animations, fileName, download = true) {
846
847
  if (typeCheck || this._isDotLottie) return;
@@ -649,7 +649,13 @@
649
649
  {
650
650
  "kind": "method",
651
651
  "name": "_switchInstance",
652
- "privacy": "private"
652
+ "privacy": "private",
653
+ "parameters": [
654
+ {
655
+ "name": "isPrevious",
656
+ "default": "false"
657
+ }
658
+ ]
653
659
  },
654
660
  {
655
661
  "kind": "method",
package/dist/esm/index.js CHANGED
@@ -31,6 +31,7 @@ var PlayerEvents;
31
31
  PlayerEvents["Next"] = "next";
32
32
  PlayerEvents["Pause"] = "pause";
33
33
  PlayerEvents["Play"] = "play";
34
+ PlayerEvents["Previous"] = "previous";
34
35
  PlayerEvents["Ready"] = "ready";
35
36
  PlayerEvents["Rendered"] = "rendered";
36
37
  PlayerEvents["Stop"] = "stop";
@@ -298,7 +299,7 @@ const addExt = (ext, str)=>{
298
299
  };
299
300
 
300
301
  var name = "@aarsteinmedia/dotlottie-player";
301
- var version = "2.2.6";
302
+ var version = "2.2.7";
302
303
  var description = "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";
303
304
  var exports = {
304
305
  ".": {
@@ -812,7 +813,7 @@ class DotLottiePlayer extends LitElement {
812
813
  _handleBlur() {
813
814
  setTimeout(()=>this._toggleSettings(false), 200);
814
815
  }
815
- _switchInstance() {
816
+ _switchInstance(isPrevious = false) {
816
817
  if (!this._animations[this._currentAnimation]) return;
817
818
  if (this._lottieInstance) this._lottieInstance.destroy();
818
819
  this._lottieInstance = Lottie.loadAnimation({
@@ -823,7 +824,7 @@ class DotLottiePlayer extends LitElement {
823
824
  this._isBounce = this.multiAnimationSettings[this._currentAnimation].mode === PlayMode.Bounce;
824
825
  }
825
826
  this._addEventListeners();
826
- this.dispatchEvent(new CustomEvent(PlayerEvents.Next));
827
+ this.dispatchEvent(new CustomEvent(isPrevious ? PlayerEvents.Previous : PlayerEvents.Next));
827
828
  if (this.multiAnimationSettings?.[this._currentAnimation]?.autoplay ?? this.autoplay) {
828
829
  this._lottieInstance?.goToAndPlay(0, true);
829
830
  this.currentState = PlayerState.Playing;
@@ -838,7 +839,7 @@ class DotLottiePlayer extends LitElement {
838
839
  }
839
840
  prev() {
840
841
  this._currentAnimation--;
841
- this._switchInstance();
842
+ this._switchInstance(true);
842
843
  }
843
844
  convert(typeCheck, manifest, animations, fileName, download = true) {
844
845
  if (typeCheck || this._isDotLottie) return;
package/dist/index.d.ts CHANGED
@@ -99,6 +99,7 @@ declare enum PlayerEvents {
99
99
  Next = "next",
100
100
  Pause = "pause",
101
101
  Play = "play",
102
+ Previous = "previous",
102
103
  Ready = "ready",
103
104
  Rendered = "rendered",
104
105
  Stop = "stop"