@aarsteinmedia/dotlottie-player 4.0.14 → 5.0.1
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/CHANGELOG.md +18 -0
- package/custom-elements.json +273 -188
- package/dist/index.d.ts +38 -93
- package/dist/index.js +1811 -2
- package/dist/unpkg/index.js +2 -0
- package/package.json +40 -41
- package/dist/cjs/index.js +0 -1804
- package/dist/esm/index.js +0 -1777
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AnimationDirection, RendererType, AnimationSegment } from 'lottie-web';
|
|
3
|
-
import { RefObject, CSSProperties } from 'react';
|
|
1
|
+
import { AnimationSettings, AnimationDirection, Vector2, LottieManifest, AnimationItem, AnimationData } from '@aarsteinmedia/lottie-web';
|
|
4
2
|
|
|
5
3
|
declare function renderPlayer(this: DotLottiePlayer): void;
|
|
6
4
|
|
|
@@ -42,103 +40,50 @@ declare enum PreserveAspectRatio {
|
|
|
42
40
|
None = "xMinYMin slice",
|
|
43
41
|
Initial = "none"
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
o: ShapeData;
|
|
50
|
-
p: ShapeData;
|
|
51
|
-
r: ShapeData;
|
|
52
|
-
s: ShapeData;
|
|
53
|
-
}
|
|
54
|
-
interface ShapeData {
|
|
55
|
-
a: BoolInt;
|
|
56
|
-
k: number | number[];
|
|
57
|
-
ix: number;
|
|
58
|
-
}
|
|
59
|
-
interface Layer {
|
|
60
|
-
ao: BoolInt;
|
|
61
|
-
bm: number;
|
|
62
|
-
completed: boolean;
|
|
63
|
-
ddd: BoolInt;
|
|
64
|
-
ip: number;
|
|
65
|
-
ks: object;
|
|
66
|
-
nm: string;
|
|
67
|
-
op: number;
|
|
68
|
-
shapes: Shape[];
|
|
69
|
-
sr: number;
|
|
70
|
-
st: number;
|
|
71
|
-
td: number;
|
|
72
|
-
ty: number;
|
|
73
|
-
}
|
|
74
|
-
interface LottieAsset {
|
|
75
|
-
e?: BoolInt;
|
|
76
|
-
layers?: Layer[];
|
|
77
|
-
h?: number;
|
|
78
|
-
id?: string;
|
|
79
|
-
nm?: string;
|
|
80
|
-
p?: string;
|
|
81
|
-
u?: string;
|
|
82
|
-
xt?: number;
|
|
83
|
-
w?: number;
|
|
84
|
-
}
|
|
85
|
-
interface LottieJSON {
|
|
86
|
-
assets?: LottieAsset[];
|
|
87
|
-
ddd: BoolInt;
|
|
88
|
-
fr: number;
|
|
89
|
-
h: number;
|
|
90
|
-
ip: number;
|
|
91
|
-
layers: Layer[];
|
|
92
|
-
markers: unknown[];
|
|
93
|
-
meta: {
|
|
94
|
-
a: string;
|
|
95
|
-
d: string;
|
|
96
|
-
g: string;
|
|
97
|
-
k: string;
|
|
98
|
-
tc: string;
|
|
99
|
-
};
|
|
100
|
-
nm: string;
|
|
101
|
-
op: number;
|
|
102
|
-
v: string;
|
|
103
|
-
w: number;
|
|
104
|
-
}
|
|
105
|
-
interface AnimationSettings {
|
|
106
|
-
autoplay?: Autoplay;
|
|
107
|
-
loop?: Loop;
|
|
108
|
-
direction?: AnimationDirection;
|
|
109
|
-
mode?: PlayMode;
|
|
110
|
-
speed?: number;
|
|
43
|
+
declare enum RendererType {
|
|
44
|
+
SVG = "svg",
|
|
45
|
+
HTML = "html",
|
|
46
|
+
Canvas = "canvas"
|
|
111
47
|
}
|
|
48
|
+
|
|
112
49
|
interface Animation extends AnimationSettings {
|
|
113
50
|
id: string;
|
|
114
51
|
}
|
|
115
52
|
interface AnimationAttributes extends Animation {
|
|
116
53
|
url: string;
|
|
117
54
|
}
|
|
118
|
-
interface LottieManifest {
|
|
119
|
-
animations: Animation[];
|
|
120
|
-
author?: string;
|
|
121
|
-
description?: string;
|
|
122
|
-
generator?: string;
|
|
123
|
-
keywords?: string;
|
|
124
|
-
version?: string;
|
|
125
|
-
}
|
|
126
55
|
type AnimateOnScroll = boolean | '' | null;
|
|
127
56
|
type Autoplay = boolean | '' | 'autoplay' | null;
|
|
128
57
|
type Controls = boolean | '' | 'controls' | null;
|
|
129
58
|
type Loop = boolean | '' | 'loop' | null;
|
|
130
59
|
type Subframe = boolean | '' | null;
|
|
131
|
-
type JSXLottiePlayer = Omit<Partial<DotLottiePlayer>, 'style'> & {
|
|
132
|
-
class?: string;
|
|
133
|
-
ref?: RefObject<unknown>;
|
|
134
|
-
style?: CSSProperties;
|
|
135
|
-
src: string;
|
|
136
|
-
};
|
|
137
60
|
declare global {
|
|
138
61
|
interface HTMLElementTagNameMap {
|
|
139
62
|
'dotlottie-player': DotLottiePlayer;
|
|
140
63
|
}
|
|
141
64
|
function dotLottiePlayer(): DotLottiePlayer;
|
|
65
|
+
}
|
|
66
|
+
type JSXLottiePlayer = Omit<Partial<DotLottiePlayer>, 'style'> & {
|
|
67
|
+
class?: string;
|
|
68
|
+
ref?: React.RefObject<unknown>;
|
|
69
|
+
style?: React.CSSProperties;
|
|
70
|
+
src: string;
|
|
71
|
+
};
|
|
72
|
+
declare module 'react' {
|
|
73
|
+
namespace JSX {
|
|
74
|
+
interface IntrinsicElements {
|
|
75
|
+
'dotlottie-player': JSXLottiePlayer;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
declare module 'react/jsx-runtime' {
|
|
80
|
+
namespace JSX {
|
|
81
|
+
interface IntrinsicElements {
|
|
82
|
+
'dotlottie-player': JSXLottiePlayer;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
declare module 'react/jsx-dev-runtime' {
|
|
142
87
|
namespace JSX {
|
|
143
88
|
interface IntrinsicElements {
|
|
144
89
|
'dotlottie-player': JSXLottiePlayer;
|
|
@@ -146,12 +91,12 @@ declare global {
|
|
|
146
91
|
}
|
|
147
92
|
}
|
|
148
93
|
|
|
149
|
-
declare class
|
|
94
|
+
declare class PropertyCallbackElement extends HTMLElement {
|
|
150
95
|
constructor();
|
|
151
96
|
connectedCallback(): void;
|
|
152
97
|
}
|
|
153
98
|
|
|
154
|
-
declare class DotLottiePlayer extends
|
|
99
|
+
declare class DotLottiePlayer extends PropertyCallbackElement {
|
|
155
100
|
constructor();
|
|
156
101
|
connectedCallback(): Promise<void>;
|
|
157
102
|
disconnectedCallback(): void;
|
|
@@ -203,10 +148,10 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
203
148
|
getMultiAnimationSettings(): AnimationSettings[];
|
|
204
149
|
setMultiAnimationSettings(settings: AnimationSettings[]): void;
|
|
205
150
|
private _segment?;
|
|
206
|
-
setSegment(segment:
|
|
207
|
-
getSegment():
|
|
208
|
-
protected _container:
|
|
209
|
-
playerState
|
|
151
|
+
setSegment(segment: Vector2): void;
|
|
152
|
+
getSegment(): Vector2 | undefined;
|
|
153
|
+
protected _container: HTMLElement | null;
|
|
154
|
+
playerState: PlayerState;
|
|
210
155
|
protected _isSettingsOpen: boolean;
|
|
211
156
|
protected _seeker: number;
|
|
212
157
|
private _currentAnimation;
|
|
@@ -217,7 +162,7 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
217
162
|
protected _errorMessage: string;
|
|
218
163
|
private _isBounce;
|
|
219
164
|
private _isDotLottie;
|
|
220
|
-
private _manifest
|
|
165
|
+
private _manifest?;
|
|
221
166
|
protected _playerState: {
|
|
222
167
|
prev: PlayerState;
|
|
223
168
|
count: number;
|
|
@@ -229,7 +174,7 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
229
174
|
private _getOptions;
|
|
230
175
|
private _addIntersectionObserver;
|
|
231
176
|
load(src: string | null): Promise<void>;
|
|
232
|
-
getManifest(): LottieManifest;
|
|
177
|
+
getManifest(): LottieManifest | undefined;
|
|
233
178
|
private _toggleEventListeners;
|
|
234
179
|
private _addEventListeners;
|
|
235
180
|
private _removeEventListeners;
|
|
@@ -251,7 +196,7 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
251
196
|
success: boolean;
|
|
252
197
|
error?: string;
|
|
253
198
|
}>;
|
|
254
|
-
getLottie():
|
|
199
|
+
getLottie(): AnimationItem | null;
|
|
255
200
|
play(): Promise<void>;
|
|
256
201
|
pause(): void;
|
|
257
202
|
stop(): void;
|
|
@@ -277,7 +222,7 @@ declare class DotLottiePlayer extends EnhancedElement {
|
|
|
277
222
|
convert({ animations, fileName, manifest, shouldDownload, src, typeCheck, }: {
|
|
278
223
|
typeCheck?: boolean;
|
|
279
224
|
manifest?: LottieManifest;
|
|
280
|
-
animations?:
|
|
225
|
+
animations?: AnimationData[];
|
|
281
226
|
src?: string;
|
|
282
227
|
fileName?: string;
|
|
283
228
|
shouldDownload?: boolean;
|