@lottiefiles/lottie-player 1.7.0 → 2.0.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/LICENSE +1 -1
- package/dist/lottie-player.d.ts +252 -233
- package/dist/lottie-player.js +350 -77
- package/dist/lottie-player.js.map +1 -1
- package/dist/lottie-player.mjs +339 -0
- package/dist/lottie-player.mjs.map +1 -0
- package/dist/tgs-player.d.ts +263 -29
- package/dist/tgs-player.js +355 -54
- package/dist/tgs-player.js.map +1 -1
- package/dist/tgs-player.mjs +349 -0
- package/dist/tgs-player.mjs.map +1 -0
- package/package.json +56 -83
- package/dist/lottie-player.d.ts.map +0 -1
- package/dist/lottie-player.esm.js +0 -77
- package/dist/lottie-player.esm.js.map +0 -1
- package/dist/lottie-player.styles.d.ts +0 -6
- package/dist/lottie-player.styles.d.ts.map +0 -1
- package/dist/tgs-player.d.ts.map +0 -1
- package/dist/tgs-player.esm.js +0 -54
- package/dist/tgs-player.esm.js.map +0 -1
- package/dist/tgs-player.styles.d.ts +0 -6
- package/dist/tgs-player.styles.d.ts.map +0 -1
- package/dist/versions.d.ts +0 -3
- package/dist/versions.d.ts.map +0 -1
package/LICENSE
CHANGED
package/dist/lottie-player.d.ts
CHANGED
|
@@ -1,233 +1,252 @@
|
|
|
1
|
-
import { LitElement } from
|
|
2
|
-
import { TemplateResult } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
*
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
1
|
+
import { LitElement, CSSResult } from 'lit';
|
|
2
|
+
import { TemplateResult } from 'lit/html.js';
|
|
3
|
+
import { AnimationItem } from 'lottie-web';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Copyright 2023 Design Barn Inc.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare enum PlayerState {
|
|
10
|
+
Destroyed = "destroyed",
|
|
11
|
+
Error = "error",
|
|
12
|
+
Frozen = "frozen",
|
|
13
|
+
Loading = "loading",
|
|
14
|
+
Ready = "ready",
|
|
15
|
+
Paused = "paused",
|
|
16
|
+
Playing = "playing",
|
|
17
|
+
Stopped = "stopped"
|
|
18
|
+
}
|
|
19
|
+
declare enum PlayMode {
|
|
20
|
+
Bounce = "bounce",
|
|
21
|
+
Normal = "normal"
|
|
22
|
+
}
|
|
23
|
+
declare enum PlayerEvents {
|
|
24
|
+
Complete = "complete",
|
|
25
|
+
Destroyed = "destroyed",
|
|
26
|
+
Error = "error",
|
|
27
|
+
Frame = "frame",
|
|
28
|
+
Freeze = "freeze",
|
|
29
|
+
Load = "load",
|
|
30
|
+
Loop = "loop",
|
|
31
|
+
Pause = "pause",
|
|
32
|
+
Play = "play",
|
|
33
|
+
Ready = "ready",
|
|
34
|
+
Rendered = "rendered",
|
|
35
|
+
Stop = "stop"
|
|
36
|
+
}
|
|
37
|
+
interface Versions {
|
|
38
|
+
lottiePlayerVersion: string;
|
|
39
|
+
lottieWebVersion: string;
|
|
40
|
+
}
|
|
41
|
+
interface InternalPlayerState {
|
|
42
|
+
background: string;
|
|
43
|
+
currentState: PlayerState;
|
|
44
|
+
frame: number;
|
|
45
|
+
seeker: number;
|
|
46
|
+
autoplay: boolean;
|
|
47
|
+
direction: number;
|
|
48
|
+
hover: boolean;
|
|
49
|
+
intermission: number;
|
|
50
|
+
loop: boolean;
|
|
51
|
+
count?: number;
|
|
52
|
+
playMode: PlayMode;
|
|
53
|
+
speed: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Parse a resource into a JSON object or a URL string
|
|
57
|
+
*/
|
|
58
|
+
declare function parseSrc(src: string | AnimationItem): string | AnimationItem;
|
|
59
|
+
/**
|
|
60
|
+
* LottiePlayer web component class
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
declare class LottiePlayer extends LitElement {
|
|
64
|
+
/**
|
|
65
|
+
* Autoplay animation on load.
|
|
66
|
+
*/
|
|
67
|
+
autoplay: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Background color.
|
|
70
|
+
*/
|
|
71
|
+
background?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Show controls.
|
|
74
|
+
*/
|
|
75
|
+
controls: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Number of times to loop animation.
|
|
78
|
+
*/
|
|
79
|
+
count?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Player state.
|
|
82
|
+
*/
|
|
83
|
+
currentState: PlayerState;
|
|
84
|
+
/**
|
|
85
|
+
* Animation description for screen readers.
|
|
86
|
+
*/
|
|
87
|
+
description: string;
|
|
88
|
+
/**
|
|
89
|
+
* Direction of animation.
|
|
90
|
+
*/
|
|
91
|
+
direction: number;
|
|
92
|
+
/**
|
|
93
|
+
* Disable checking if the Lottie is valid before loading
|
|
94
|
+
*/
|
|
95
|
+
disableCheck?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Disable using shadow dom as the root
|
|
98
|
+
*/
|
|
99
|
+
disableShadowDOM: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to play on mouse hover
|
|
102
|
+
*/
|
|
103
|
+
hover: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Intermission
|
|
106
|
+
*/
|
|
107
|
+
intermission: number;
|
|
108
|
+
/**
|
|
109
|
+
* Whether to loop animation.
|
|
110
|
+
*/
|
|
111
|
+
loop: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Play mode.
|
|
114
|
+
*/
|
|
115
|
+
mode: PlayMode;
|
|
116
|
+
/**
|
|
117
|
+
* Aspect ratio to pass to lottie-web.
|
|
118
|
+
*/
|
|
119
|
+
preserveAspectRatio: string;
|
|
120
|
+
/**
|
|
121
|
+
* Renderer to use.
|
|
122
|
+
*/
|
|
123
|
+
renderer: 'svg' | 'canvas';
|
|
124
|
+
/**
|
|
125
|
+
* seeker
|
|
126
|
+
*/
|
|
127
|
+
seeker: number;
|
|
128
|
+
/**
|
|
129
|
+
* Animation speed.
|
|
130
|
+
*/
|
|
131
|
+
speed: number;
|
|
132
|
+
/**
|
|
133
|
+
* Bodymovin JSON data or URL to JSON.
|
|
134
|
+
*/
|
|
135
|
+
src?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Viewbox size for renderer settings
|
|
138
|
+
*/
|
|
139
|
+
viewBoxSize?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Enable web workers
|
|
142
|
+
*/
|
|
143
|
+
webworkers?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Animation container.
|
|
146
|
+
*/
|
|
147
|
+
protected container: HTMLElement;
|
|
148
|
+
private _counter;
|
|
149
|
+
private _io;
|
|
150
|
+
private _lottie?;
|
|
151
|
+
/**
|
|
152
|
+
* Destroy animation and lottie-player element.
|
|
153
|
+
*/
|
|
154
|
+
destroy(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Cleanup on component destroy.
|
|
157
|
+
*/
|
|
158
|
+
disconnectedCallback(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Returns the lottie-web instance used in the component.
|
|
161
|
+
*/
|
|
162
|
+
getLottie(): any;
|
|
163
|
+
/**
|
|
164
|
+
* Returns the lottie-web version and this player's version
|
|
165
|
+
*/
|
|
166
|
+
getVersions(): Versions;
|
|
167
|
+
/**
|
|
168
|
+
* Configure and initialize lottie-web player instance.
|
|
169
|
+
*/
|
|
170
|
+
load(src: string | AnimationItem): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Pause animation play.
|
|
173
|
+
*/
|
|
174
|
+
pause(): void;
|
|
175
|
+
/**
|
|
176
|
+
* Start playing animation.
|
|
177
|
+
*/
|
|
178
|
+
play(): void;
|
|
179
|
+
getState(): InternalPlayerState;
|
|
180
|
+
render(): TemplateResult | void;
|
|
181
|
+
/**
|
|
182
|
+
* Resize animation.
|
|
183
|
+
*/
|
|
184
|
+
resize(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Seek to a given frame.
|
|
187
|
+
*/
|
|
188
|
+
seek(value: number | string): void;
|
|
189
|
+
/**
|
|
190
|
+
* Animation play direction.
|
|
191
|
+
*
|
|
192
|
+
* @param value - Direction values.
|
|
193
|
+
*/
|
|
194
|
+
setDirection(value: 1 | -1): void;
|
|
195
|
+
/**
|
|
196
|
+
* Sets the looping of the animation.
|
|
197
|
+
*
|
|
198
|
+
* @param value - Whether to enable looping. Boolean true enables looping.
|
|
199
|
+
*/
|
|
200
|
+
setLooping(value: boolean): void;
|
|
201
|
+
/**
|
|
202
|
+
* Sets animation play speed.
|
|
203
|
+
*
|
|
204
|
+
* @param value - Playback speed.
|
|
205
|
+
*/
|
|
206
|
+
setSpeed(value?: number): void;
|
|
207
|
+
/**
|
|
208
|
+
* Snapshot the current frame as SVG.
|
|
209
|
+
*
|
|
210
|
+
* If 'download' argument is boolean true, then a download is triggered in browser.
|
|
211
|
+
*/
|
|
212
|
+
snapshot(download?: boolean): string;
|
|
213
|
+
/**
|
|
214
|
+
* Stops animation play.
|
|
215
|
+
*/
|
|
216
|
+
stop(): void;
|
|
217
|
+
/**
|
|
218
|
+
* Toggles animation looping.
|
|
219
|
+
*/
|
|
220
|
+
toggleLooping(): void;
|
|
221
|
+
/**
|
|
222
|
+
* Toggle playing state.
|
|
223
|
+
*/
|
|
224
|
+
togglePlay(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Returns the styles for the component.
|
|
227
|
+
*/
|
|
228
|
+
static get styles(): CSSResult;
|
|
229
|
+
protected createRenderRoot(): Element | ShadowRoot;
|
|
230
|
+
/**
|
|
231
|
+
* Initialize everything on component first render.
|
|
232
|
+
*/
|
|
233
|
+
protected firstUpdated(): Promise<void>;
|
|
234
|
+
protected renderControls(): TemplateResult;
|
|
235
|
+
private _attachEventListeners;
|
|
236
|
+
/**
|
|
237
|
+
* Freeze animation play.
|
|
238
|
+
* This internal state pauses animation and is used to differentiate between
|
|
239
|
+
* user requested pauses and component instigated pauses.
|
|
240
|
+
*/
|
|
241
|
+
private _freeze;
|
|
242
|
+
/**
|
|
243
|
+
* Handles click and drag actions on the progress track.
|
|
244
|
+
*/
|
|
245
|
+
private _handleSeekChange;
|
|
246
|
+
/**
|
|
247
|
+
* Handle visibility change events.
|
|
248
|
+
*/
|
|
249
|
+
private _onVisibilityChange;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export { InternalPlayerState, LottiePlayer, PlayMode, PlayerEvents, PlayerState, Versions, parseSrc };
|