@aarsteinmedia/dotlottie-player 2.2.6 → 2.2.8
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/README.md +3 -1
- 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 +5 -5
package/README.md
CHANGED
|
@@ -286,13 +286,15 @@ The following events are exposed and can be listened to via `addEventListener` c
|
|
|
286
286
|
| `ready` | Animation is loaded and player is ready |
|
|
287
287
|
| `stop` | Animation has stopped |
|
|
288
288
|
|
|
289
|
-
## WordPress
|
|
289
|
+
## WordPress Plugins
|
|
290
290
|
<img align="left" width="110" height="110" src="/.github/wpIcon.svg" />
|
|
291
291
|
|
|
292
292
|
We've made a free WordPress plugin that works with Gutenberg Blocks, Elementor, Divi Builder and Flatsome UX Builder: [AM LottiePlayer](https://wordpress.org/plugins/am-lottieplayer/). It has all the functionality of this package, with a helpful user interface.
|
|
293
293
|
|
|
294
294
|
It's super lightweight – and only loads on pages where animations are used.
|
|
295
295
|
|
|
296
|
+
We've also made a premium WordPress plugin for purchase: [AM LottiePlayerPRO](https://www.aarstein.media/en/am-lottieplayer/pro). It has an easy-to-use GUI for combining and controlling multiple Lottie animations in a single file, converting JSON to dotLottie with drag-and-drop, and many more exclusive features.
|
|
297
|
+
|
|
296
298
|
## License
|
|
297
299
|
|
|
298
300
|
GPL-2.0-or-later
|
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;
|