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