@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 +5 -4
- package/dist/custom-elements.json +7 -1
- package/dist/esm/index.js +5 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
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.
|
|
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;
|
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.
|
|
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;
|