@lottiefiles/lottie-player 1.1.2 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file.
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), enforced with [semantic-release](https://github.com/semantic-release/semantic-release).
4
4
 
5
5
 
6
+ # [1.2.0](https://github.com/LottieFiles/lottie-player/compare/v1.1.4...v1.2.0) (2021-09-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * **events and cleanup:** added event listeners before json error check and added a destroy method for cleanup ([646d63b](https://github.com/LottieFiles/lottie-player/commit/646d63b14e89a2c0079ddc9224fc8d8e97d84806))
12
+
13
+ ## [1.1.4](https://github.com/LottieFiles/lottie-player/compare/v1.1.3...v1.1.4) (2021-09-02)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **rollback:** rollback due to race condition issues ([556307f](https://github.com/LottieFiles/lottie-player/commit/556307fc57a807c03ad1b3639c3e464d73cd87be))
19
+
20
+ ## [1.1.3](https://github.com/LottieFiles/lottie-player/compare/v1.1.2...v1.1.3) (2021-09-02)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **asset path bug fix:** asset path bug fix ([27d24e7](https://github.com/LottieFiles/lottie-player/commit/27d24e731b7203f849171657eae190bf55d59be8))
26
+
6
27
  ## [1.1.2](https://github.com/LottieFiles/lottie-player/compare/v1.1.1...v1.1.2) (2021-09-01)
7
28
 
8
29
 
package/README.md CHANGED
@@ -254,7 +254,7 @@ declare namespace JSX {
254
254
  | `loop` | `loop` | Whether to loop animation. | `boolean` | `false` |
255
255
  | `mode` | `mode` | Play mode. | `PlayMode.Bounce \| PlayMode.Normal` | `PlayMode.Normal` |
256
256
  | `preserveAspectRatio` | `preserveAspectRatio` | Valid preserve aspect ratio value. | `string` | `'xMidYMid meet'` |
257
- | `renderer` | `renderer` | Renderer to use. | `"svg" | "canvas"` |
257
+ | `renderer` | `renderer` | Renderer to use. | `"svg" \| "canvas"` | `"svg"` |
258
258
  | `speed` | `speed` | Animation speed. | `number` | `1` |
259
259
  | `src` _(required)_ | `src` | Bodymovin JSON data or URL to JSON. | `string` | `undefined` |
260
260
 
@@ -1,5 +1,6 @@
1
1
  import { LitElement, TemplateResult } from "lit-element";
2
2
  export declare enum PlayerState {
3
+ Destroyed = "destroyed",
3
4
  Error = "error",
4
5
  Frozen = "frozen",
5
6
  Loading = "loading",
@@ -13,6 +14,7 @@ export declare enum PlayMode {
13
14
  }
14
15
  export declare enum PlayerEvents {
15
16
  Complete = "complete",
17
+ Destroyed = "destroyed",
16
18
  Error = "error",
17
19
  Frame = "frame",
18
20
  Freeze = "freeze",
@@ -36,14 +38,6 @@ export declare function parseSrc(src: string | object): string | object;
36
38
  * @extends {LitElement}
37
39
  */
38
40
  export declare class LottiePlayer extends LitElement {
39
- /**
40
- * Animation container.
41
- */
42
- protected container: HTMLElement;
43
- /**
44
- * Play mode.
45
- */
46
- mode: PlayMode;
47
41
  /**
48
42
  * Autoplay animation on load.
49
43
  */
@@ -72,6 +66,10 @@ export declare class LottiePlayer extends LitElement {
72
66
  * Whether to loop animation.
73
67
  */
74
68
  loop: boolean;
69
+ /**
70
+ * Play mode.
71
+ */
72
+ mode: PlayMode;
75
73
  /**
76
74
  * Aspect ratio to pass to lottie-web.
77
75
  */
@@ -98,18 +96,14 @@ export declare class LottiePlayer extends LitElement {
98
96
  * Animation speed.
99
97
  */
100
98
  description: string;
99
+ /**
100
+ * Animation container.
101
+ */
102
+ protected container: HTMLElement;
101
103
  private _io;
102
104
  private _lottie?;
103
105
  private _prevState?;
104
106
  private _counter;
105
- /**
106
- * Handle visibility change events.
107
- */
108
- private _onVisibilityChange;
109
- /**
110
- * Handles click and drag actions on the progress track.
111
- */
112
- private _handleSeekChange;
113
107
  /**
114
108
  * Configure and initialize lottie-web player instance.
115
109
  */
@@ -130,6 +124,10 @@ export declare class LottiePlayer extends LitElement {
130
124
  * Stops animation play.
131
125
  */
132
126
  stop(): void;
127
+ /**
128
+ * Destroy animation and lottie-player element.
129
+ */
130
+ destroy(): void;
133
131
  /**
134
132
  * Seek to a given frame.
135
133
  */
@@ -140,12 +138,6 @@ export declare class LottiePlayer extends LitElement {
140
138
  * If 'download' argument is boolean true, then a download is triggered in browser.
141
139
  */
142
140
  snapshot(download?: boolean): string | void;
143
- /**
144
- * Freeze animation play.
145
- * This internal state pauses animation and is used to differentiate between
146
- * user requested pauses and component instigated pauses.
147
- */
148
- private freeze;
149
141
  /**
150
142
  * Sets animation play speed.
151
143
  *
@@ -180,15 +172,30 @@ export declare class LottiePlayer extends LitElement {
180
172
  * Returns the styles for the component.
181
173
  */
182
174
  static get styles(): import("lit-element").CSSResult;
175
+ /**
176
+ * Cleanup on component destroy.
177
+ */
178
+ disconnectedCallback(): void;
179
+ render(): TemplateResult | void;
183
180
  /**
184
181
  * Initialize everything on component first render.
185
182
  */
186
183
  protected firstUpdated(): void;
184
+ protected renderControls(): TemplateResult;
187
185
  /**
188
- * Cleanup on component destroy.
186
+ * Handle visibility change events.
189
187
  */
190
- disconnectedCallback(): void;
191
- protected renderControls(): TemplateResult;
192
- render(): TemplateResult | void;
188
+ private _onVisibilityChange;
189
+ /**
190
+ * Handles click and drag actions on the progress track.
191
+ */
192
+ private _handleSeekChange;
193
+ private _attachEventListeners;
194
+ /**
195
+ * Freeze animation play.
196
+ * This internal state pauses animation and is used to differentiate between
197
+ * user requested pauses and component instigated pauses.
198
+ */
199
+ private freeze;
193
200
  }
194
201
  //# sourceMappingURL=lottie-player.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lottie-player.d.ts","sourceRoot":"","sources":["src/lottie-player.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EAIV,cAAc,EACf,MAAM,aAAa,CAAC;AAOrB,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW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