@aarsteinmedia/dotlottie-player 3.2.0 → 3.2.2
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 -3
- package/dist/cjs/index.js +294 -296
- package/dist/custom-elements.json +981 -929
- package/dist/esm/index.js +294 -296
- package/dist/index.d.ts +62 -55
- package/dist/index.js +148 -180
- package/package.json +13 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
1
|
import { AnimationDirection, RendererType, AnimationSegment, AnimationItem } from 'lottie-web';
|
|
2
|
+
import renderPlayer from 'src/templates/player';
|
|
3
|
+
import renderControls from 'src/templates/controls';
|
|
2
4
|
import { RefObject, CSSProperties } from 'react';
|
|
3
5
|
|
|
4
|
-
declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
Next = "next",
|
|
29
|
+
Pause = "pause",
|
|
30
|
+
Play = "play",
|
|
31
|
+
Previous = "previous",
|
|
32
|
+
Ready = "ready",
|
|
33
|
+
Rendered = "rendered",
|
|
34
|
+
Stop = "stop"
|
|
35
|
+
}
|
|
36
|
+
declare enum PreserveAspectRatio {
|
|
37
|
+
Contain = "xMidYMid meet",
|
|
38
|
+
Cover = "xMidYMid slice",
|
|
39
|
+
None = "xMinYMin slice",
|
|
40
|
+
Initial = "none"
|
|
9
41
|
}
|
|
10
42
|
|
|
11
43
|
type BoolInt = 0 | 1;
|
|
@@ -111,41 +143,9 @@ declare global {
|
|
|
111
143
|
}
|
|
112
144
|
}
|
|
113
145
|
|
|
114
|
-
declare
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Error = "error",
|
|
118
|
-
Frozen = "frozen",
|
|
119
|
-
Loading = "loading",
|
|
120
|
-
Paused = "paused",
|
|
121
|
-
Playing = "playing",
|
|
122
|
-
Stopped = "stopped"
|
|
123
|
-
}
|
|
124
|
-
declare enum PlayMode {
|
|
125
|
-
Bounce = "bounce",
|
|
126
|
-
Normal = "normal"
|
|
127
|
-
}
|
|
128
|
-
declare enum PlayerEvents {
|
|
129
|
-
Complete = "complete",
|
|
130
|
-
Destroyed = "destroyed",
|
|
131
|
-
Error = "error",
|
|
132
|
-
Frame = "frame",
|
|
133
|
-
Freeze = "freeze",
|
|
134
|
-
Load = "load",
|
|
135
|
-
Loop = "loop",
|
|
136
|
-
Next = "next",
|
|
137
|
-
Pause = "pause",
|
|
138
|
-
Play = "play",
|
|
139
|
-
Previous = "previous",
|
|
140
|
-
Ready = "ready",
|
|
141
|
-
Rendered = "rendered",
|
|
142
|
-
Stop = "stop"
|
|
143
|
-
}
|
|
144
|
-
declare enum PreserveAspectRatio {
|
|
145
|
-
Contain = "xMidYMid meet",
|
|
146
|
-
Cover = "xMidYMid slice",
|
|
147
|
-
None = "xMinYMin slice",
|
|
148
|
-
Initial = "none"
|
|
146
|
+
declare class EnhancedElement extends HTMLElement {
|
|
147
|
+
constructor();
|
|
148
|
+
connectedCallback(): void;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
declare class DotLottiePlayer extends EnhancedElement {
|
|
@@ -154,9 +154,11 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
154
154
|
disconnectedCallback(): void;
|
|
155
155
|
shadow: ShadowRoot;
|
|
156
156
|
template: HTMLTemplateElement;
|
|
157
|
+
protected _renderControls: typeof renderControls;
|
|
158
|
+
protected _render: typeof renderPlayer;
|
|
157
159
|
static get observedAttributes(): string[];
|
|
158
160
|
attributeChangedCallback(name: string, _oldValue: unknown, value: string): void;
|
|
159
|
-
static get observedProperties():
|
|
161
|
+
static get observedProperties(): string[];
|
|
160
162
|
propertyChangedCallback(name: string, _oldValue: unknown, value: unknown): void;
|
|
161
163
|
set animateOnScroll(value: AnimateOnScroll);
|
|
162
164
|
get animateOnScroll(): AnimateOnScroll;
|
|
@@ -200,18 +202,25 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
200
202
|
get subframe(): Subframe;
|
|
201
203
|
protected _container: Element | null;
|
|
202
204
|
playerState?: PlayerState;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
protected _isSettingsOpen: boolean;
|
|
206
|
+
protected _seeker: number;
|
|
205
207
|
private _currentAnimation;
|
|
206
208
|
private _animations;
|
|
207
209
|
private _intersectionObserver?;
|
|
208
210
|
private _lottieInstance;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
protected _identifier: string;
|
|
212
|
+
protected _errorMessage: string;
|
|
211
213
|
private _isBounce;
|
|
212
214
|
private _isDotLottie;
|
|
213
215
|
private _manifest;
|
|
214
|
-
|
|
216
|
+
protected _playerState: {
|
|
217
|
+
prev: PlayerState;
|
|
218
|
+
count: number;
|
|
219
|
+
loaded: boolean;
|
|
220
|
+
visible: boolean;
|
|
221
|
+
scrollY: number;
|
|
222
|
+
scrollTimeout: NodeJS.Timeout | null;
|
|
223
|
+
};
|
|
215
224
|
private _getOptions;
|
|
216
225
|
private _addIntersectionObserver;
|
|
217
226
|
load(src: string | null): Promise<void>;
|
|
@@ -230,15 +239,15 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
230
239
|
private _mouseLeave;
|
|
231
240
|
private _onVisibilityChange;
|
|
232
241
|
private _handleScroll;
|
|
233
|
-
|
|
242
|
+
protected _handleSeekChange({ target }: Event): void;
|
|
234
243
|
private _isLottie;
|
|
235
244
|
addAnimation(configs: AnimationAttributes[], fileName?: string, shouldDownload?: boolean): Promise<{
|
|
236
|
-
success: boolean;
|
|
237
245
|
result: void | ArrayBuffer;
|
|
246
|
+
success: boolean;
|
|
238
247
|
error?: undefined;
|
|
239
248
|
} | {
|
|
240
|
-
success: boolean;
|
|
241
249
|
error: string;
|
|
250
|
+
success: boolean;
|
|
242
251
|
result?: undefined;
|
|
243
252
|
}>;
|
|
244
253
|
getLottie(): AnimationItem | null;
|
|
@@ -250,7 +259,7 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
250
259
|
snapshot(): string | undefined;
|
|
251
260
|
setSubframe(value: boolean): void;
|
|
252
261
|
setCount(value: number): void;
|
|
253
|
-
|
|
262
|
+
protected _freeze(): void;
|
|
254
263
|
reload(): Promise<void>;
|
|
255
264
|
setSpeed(value?: number): void;
|
|
256
265
|
setDirection(value: AnimationDirection): void;
|
|
@@ -260,12 +269,12 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
260
269
|
toggleLoop(): void;
|
|
261
270
|
toggleBoomerang(): void;
|
|
262
271
|
private _toggleSettings;
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
protected _handleSettingsClick: ({ target }: Event) => void;
|
|
273
|
+
protected _handleBlur(): void;
|
|
265
274
|
private _switchInstance;
|
|
266
275
|
next(): void;
|
|
267
276
|
prev(): void;
|
|
268
|
-
convert({
|
|
277
|
+
convert({ animations, fileName, manifest, shouldDownload, src, typeCheck, }: {
|
|
269
278
|
typeCheck?: boolean;
|
|
270
279
|
manifest?: LottieManifest;
|
|
271
280
|
animations?: LottieJSON[];
|
|
@@ -274,8 +283,6 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
274
283
|
shouldDownload?: boolean;
|
|
275
284
|
}): Promise<string | void | ArrayBuffer>;
|
|
276
285
|
static get styles(): CSSStyleSheet;
|
|
277
|
-
protected renderControls(): void;
|
|
278
|
-
protected render(): void;
|
|
279
286
|
}
|
|
280
287
|
|
|
281
288
|
declare const tagName = "dotlottie-player";
|