@aarsteinmedia/dotlottie-player 2.1.8 → 2.2.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/cjs/index.js +4 -5
- package/dist/custom-elements.json +345 -347
- package/dist/esm/index.js +4 -5
- package/dist/index.d.ts +29 -28
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -36,7 +36,6 @@ var PlayerEvents;
|
|
|
36
36
|
})(PlayerEvents || (PlayerEvents = {}));
|
|
37
37
|
class CustomError extends Error {
|
|
38
38
|
}
|
|
39
|
-
|
|
40
39
|
const addExt = (ext, str)=>{
|
|
41
40
|
if (!str) return;
|
|
42
41
|
if (getExt(str)) {
|
|
@@ -298,7 +297,7 @@ const addExt = (ext, str)=>{
|
|
|
298
297
|
};
|
|
299
298
|
|
|
300
299
|
var name = "@aarsteinmedia/dotlottie-player";
|
|
301
|
-
var version = "2.
|
|
300
|
+
var version = "2.2.0";
|
|
302
301
|
var description = "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";
|
|
303
302
|
var exports = {
|
|
304
303
|
".": {
|
|
@@ -429,13 +428,13 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
429
428
|
}
|
|
430
429
|
class DotLottiePlayer extends LitElement {
|
|
431
430
|
_getOptions() {
|
|
432
|
-
const preserveAspectRatio = this.preserveAspectRatio ?? (this.objectfit && aspectRatio(this.objectfit)), initialSegment = !this.segment || this.segment.some((val)=>val < 0) ? undefined : this.segment.every((val)=>val > 0) ? [
|
|
431
|
+
const preserveAspectRatio = this.preserveAspectRatio ?? (this.objectfit && aspectRatio(this.objectfit)), currentAnimation = this._manifest.animations[this._currentAnimation], loop = this.loop !== undefined ? !!this.loop : currentAnimation.loop !== undefined && !!currentAnimation.loop, autoplay = this.autoplay !== undefined ? !!this.autoplay : currentAnimation.autoplay !== undefined && !!currentAnimation.autoplay, initialSegment = !this.segment || this.segment.some((val)=>val < 0) ? undefined : this.segment.every((val)=>val > 0) ? [
|
|
433
432
|
this.segment[0] - 1,
|
|
434
433
|
this.segment[1] - 1
|
|
435
434
|
] : this.segment, options = {
|
|
436
435
|
container: this.container,
|
|
437
|
-
loop
|
|
438
|
-
autoplay
|
|
436
|
+
loop,
|
|
437
|
+
autoplay,
|
|
439
438
|
renderer: this.renderer,
|
|
440
439
|
initialSegment,
|
|
441
440
|
rendererSettings: {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,34 +3,6 @@ import { LitElement, CSSResult } from 'lit';
|
|
|
3
3
|
import { AnimationDirection, RendererType, AnimationSegment, AnimationItem } from 'lottie-web';
|
|
4
4
|
import { RefObject, CSSProperties } from 'react';
|
|
5
5
|
|
|
6
|
-
declare enum PlayerState {
|
|
7
|
-
Completed = "completed",
|
|
8
|
-
Destroyed = "destroyed",
|
|
9
|
-
Error = "error",
|
|
10
|
-
Frozen = "frozen",
|
|
11
|
-
Loading = "loading",
|
|
12
|
-
Paused = "paused",
|
|
13
|
-
Playing = "playing",
|
|
14
|
-
Stopped = "stopped"
|
|
15
|
-
}
|
|
16
|
-
declare enum PlayMode {
|
|
17
|
-
Bounce = "bounce",
|
|
18
|
-
Normal = "normal"
|
|
19
|
-
}
|
|
20
|
-
declare enum PlayerEvents {
|
|
21
|
-
Complete = "complete",
|
|
22
|
-
Destroyed = "destroyed",
|
|
23
|
-
Error = "error",
|
|
24
|
-
Frame = "frame",
|
|
25
|
-
Freeze = "freeze",
|
|
26
|
-
Load = "load",
|
|
27
|
-
Loop = "loop",
|
|
28
|
-
Pause = "pause",
|
|
29
|
-
Play = "play",
|
|
30
|
-
Ready = "ready",
|
|
31
|
-
Rendered = "rendered",
|
|
32
|
-
Stop = "stop"
|
|
33
|
-
}
|
|
34
6
|
interface LottieAsset {
|
|
35
7
|
e: 0 | 1;
|
|
36
8
|
id: string;
|
|
@@ -98,6 +70,35 @@ declare global {
|
|
|
98
70
|
}
|
|
99
71
|
}
|
|
100
72
|
|
|
73
|
+
declare enum PlayerState {
|
|
74
|
+
Completed = "completed",
|
|
75
|
+
Destroyed = "destroyed",
|
|
76
|
+
Error = "error",
|
|
77
|
+
Frozen = "frozen",
|
|
78
|
+
Loading = "loading",
|
|
79
|
+
Paused = "paused",
|
|
80
|
+
Playing = "playing",
|
|
81
|
+
Stopped = "stopped"
|
|
82
|
+
}
|
|
83
|
+
declare enum PlayMode {
|
|
84
|
+
Bounce = "bounce",
|
|
85
|
+
Normal = "normal"
|
|
86
|
+
}
|
|
87
|
+
declare enum PlayerEvents {
|
|
88
|
+
Complete = "complete",
|
|
89
|
+
Destroyed = "destroyed",
|
|
90
|
+
Error = "error",
|
|
91
|
+
Frame = "frame",
|
|
92
|
+
Freeze = "freeze",
|
|
93
|
+
Load = "load",
|
|
94
|
+
Loop = "loop",
|
|
95
|
+
Pause = "pause",
|
|
96
|
+
Play = "play",
|
|
97
|
+
Ready = "ready",
|
|
98
|
+
Rendered = "rendered",
|
|
99
|
+
Stop = "stop"
|
|
100
|
+
}
|
|
101
|
+
|
|
101
102
|
declare class DotLottiePlayer extends LitElement {
|
|
102
103
|
autoplay?: Autoplay;
|
|
103
104
|
background?: string;
|