@aarsteinmedia/dotlottie-player 2.2.5 → 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
@@ -30,8 +30,10 @@ exports.PlayerEvents = void 0;
30
30
  PlayerEvents["Freeze"] = "freeze";
31
31
  PlayerEvents["Load"] = "load";
32
32
  PlayerEvents["Loop"] = "loop";
33
+ PlayerEvents["Next"] = "next";
33
34
  PlayerEvents["Pause"] = "pause";
34
35
  PlayerEvents["Play"] = "play";
36
+ PlayerEvents["Previous"] = "previous";
35
37
  PlayerEvents["Ready"] = "ready";
36
38
  PlayerEvents["Rendered"] = "rendered";
37
39
  PlayerEvents["Stop"] = "stop";
@@ -299,7 +301,7 @@ const addExt = (ext, str)=>{
299
301
  };
300
302
 
301
303
  var name = "@aarsteinmedia/dotlottie-player";
302
- var version = "2.2.5";
304
+ var version = "2.2.7";
303
305
  var description = "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";
304
306
  var exports$1 = {
305
307
  ".": {
@@ -813,7 +815,7 @@ class DotLottiePlayer extends lit.LitElement {
813
815
  _handleBlur() {
814
816
  setTimeout(()=>this._toggleSettings(false), 200);
815
817
  }
816
- _switchInstance() {
818
+ _switchInstance(isPrevious = false) {
817
819
  if (!this._animations[this._currentAnimation]) return;
818
820
  if (this._lottieInstance) this._lottieInstance.destroy();
819
821
  this._lottieInstance = Lottie.loadAnimation({
@@ -824,6 +826,7 @@ class DotLottiePlayer extends lit.LitElement {
824
826
  this._isBounce = this.multiAnimationSettings[this._currentAnimation].mode === exports.PlayMode.Bounce;
825
827
  }
826
828
  this._addEventListeners();
829
+ this.dispatchEvent(new CustomEvent(isPrevious ? exports.PlayerEvents.Previous : exports.PlayerEvents.Next));
827
830
  if (this.multiAnimationSettings?.[this._currentAnimation]?.autoplay ?? this.autoplay) {
828
831
  this._lottieInstance?.goToAndPlay(0, true);
829
832
  this.currentState = exports.PlayerState.Playing;
@@ -838,7 +841,7 @@ class DotLottiePlayer extends lit.LitElement {
838
841
  }
839
842
  prev() {
840
843
  this._currentAnimation--;
841
- this._switchInstance();
844
+ this._switchInstance(true);
842
845
  }
843
846
  convert(typeCheck, manifest, animations, fileName, download = true) {
844
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
@@ -28,8 +28,10 @@ var PlayerEvents;
28
28
  PlayerEvents["Freeze"] = "freeze";
29
29
  PlayerEvents["Load"] = "load";
30
30
  PlayerEvents["Loop"] = "loop";
31
+ PlayerEvents["Next"] = "next";
31
32
  PlayerEvents["Pause"] = "pause";
32
33
  PlayerEvents["Play"] = "play";
34
+ PlayerEvents["Previous"] = "previous";
33
35
  PlayerEvents["Ready"] = "ready";
34
36
  PlayerEvents["Rendered"] = "rendered";
35
37
  PlayerEvents["Stop"] = "stop";
@@ -297,7 +299,7 @@ const addExt = (ext, str)=>{
297
299
  };
298
300
 
299
301
  var name = "@aarsteinmedia/dotlottie-player";
300
- var version = "2.2.5";
302
+ var version = "2.2.7";
301
303
  var description = "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";
302
304
  var exports = {
303
305
  ".": {
@@ -811,7 +813,7 @@ class DotLottiePlayer extends LitElement {
811
813
  _handleBlur() {
812
814
  setTimeout(()=>this._toggleSettings(false), 200);
813
815
  }
814
- _switchInstance() {
816
+ _switchInstance(isPrevious = false) {
815
817
  if (!this._animations[this._currentAnimation]) return;
816
818
  if (this._lottieInstance) this._lottieInstance.destroy();
817
819
  this._lottieInstance = Lottie.loadAnimation({
@@ -822,6 +824,7 @@ class DotLottiePlayer extends LitElement {
822
824
  this._isBounce = this.multiAnimationSettings[this._currentAnimation].mode === PlayMode.Bounce;
823
825
  }
824
826
  this._addEventListeners();
827
+ this.dispatchEvent(new CustomEvent(isPrevious ? PlayerEvents.Previous : PlayerEvents.Next));
825
828
  if (this.multiAnimationSettings?.[this._currentAnimation]?.autoplay ?? this.autoplay) {
826
829
  this._lottieInstance?.goToAndPlay(0, true);
827
830
  this.currentState = PlayerState.Playing;
@@ -836,7 +839,7 @@ class DotLottiePlayer extends LitElement {
836
839
  }
837
840
  prev() {
838
841
  this._currentAnimation--;
839
- this._switchInstance();
842
+ this._switchInstance(true);
840
843
  }
841
844
  convert(typeCheck, manifest, animations, fileName, download = true) {
842
845
  if (typeCheck || this._isDotLottie) return;
package/dist/index.d.ts CHANGED
@@ -96,8 +96,10 @@ declare enum PlayerEvents {
96
96
  Freeze = "freeze",
97
97
  Load = "load",
98
98
  Loop = "loop",
99
+ Next = "next",
99
100
  Pause = "pause",
100
101
  Play = "play",
102
+ Previous = "previous",
101
103
  Ready = "ready",
102
104
  Rendered = "rendered",
103
105
  Stop = "stop"