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