@aarsteinmedia/dotlottie-player 5.1.5 → 5.1.7

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 CHANGED
@@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Changelog was only added since [3.2.3], so it's not exhaustive. [Please report any missing noteable changes to us](https://github.com/aarsteinmedia/dotlottie-player/issues), and we'll add them promptly.
9
9
 
10
- ## [5.1.5] - 04-06-2025
10
+ ## [5.1.8] - 04-06-2025
11
11
 
12
12
  ### Changed
13
13
 
14
+ - Fixed issue with data handling in animation engine.
14
15
  - Fixed issue with enums causing compiler errors in TypeScript
16
+ - Fixed bug preventing conversion to dotLottie in some cases
15
17
 
16
18
  ## [5.1.4] - 03-06-2025
17
19
 
@@ -249,6 +251,7 @@ Changelog was only added since [3.2.3], so it's not exhaustive. [Please report a
249
251
  - Removed dependencies
250
252
  - `@lit`
251
253
 
254
+ [5.1.6]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.6
252
255
  [5.1.4]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.4
253
256
  [5.1.3]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.3
254
257
  [5.1.0]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.0
package/dist/index.d.ts CHANGED
@@ -181,7 +181,7 @@ declare class DotLottiePlayer extends PropertyCallbackElement {
181
181
  }>;
182
182
  attributeChangedCallback(name: string, _oldValue: unknown, value: string): Promise<void>;
183
183
  connectedCallback(): Promise<void>;
184
- convert({ animations: animationsFromProps, fileName, manifest, shouldDownload, src: srcFromProps, typeCheck, }: ConvertParams): Promise<ArrayBuffer | null | undefined>;
184
+ convert({ animations: animationsFromProps, fileName, manifest, shouldDownload, src: srcFromProps, typeCheck, }: ConvertParams): Promise<string | ArrayBuffer | null>;
185
185
  destroy(): void;
186
186
  disconnectedCallback(): void;
187
187
  getLottie(): AnimationItem | null;
package/dist/index.js CHANGED
@@ -542,7 +542,7 @@ const unzip = async (resp)=>{
542
542
  }
543
543
  return buffer;
544
544
  } catch (error) {
545
- console.error(`❌ ${handleErrors(error).message}`);
545
+ console.error(handleErrors(error).message);
546
546
  return null;
547
547
  }
548
548
  }, createJSON = ({ animation, fileName, shouldDownload })=>{
@@ -556,10 +556,12 @@ const unzip = async (resp)=>{
556
556
  mimeType: 'application/json',
557
557
  name
558
558
  });
559
+ return null;
559
560
  }
560
- return;
561
+ return jsonString;
561
562
  } catch (error) {
562
- console.error(`❌ ${handleErrors(error).message}`);
563
+ console.error(handleErrors(error).message);
564
+ return null;
563
565
  }
564
566
  }, frameOutput = (frame)=>((frame ?? 0) + 1).toString().padStart(3, '0'), getAnimationData = async (input)=>{
565
567
  try {
@@ -627,7 +629,7 @@ const unzip = async (resp)=>{
627
629
  manifest
628
630
  };
629
631
  } catch (error) {
630
- console.error(`❌ ${handleErrors(error).message}`);
632
+ console.error(handleErrors(error).message);
631
633
  return {
632
634
  animations: undefined,
633
635
  isDotLottie: false,
@@ -1068,23 +1070,21 @@ const generator = '@aarsteinmedia/dotlottie-player';
1068
1070
  }
1069
1071
  async convert({ animations: animationsFromProps, fileName, manifest, shouldDownload = true, src: srcFromProps, typeCheck }) {
1070
1072
  const src = srcFromProps || this.src || this.source;
1071
- if (!src) {
1073
+ if (!src && !animationsFromProps?.length) {
1072
1074
  throw new Error('No animation to convert');
1073
1075
  }
1074
- if (typeCheck || this._isDotLottie) {
1075
- const animationData = await getAnimationData(src);
1076
- createJSON({
1077
- animation: animationData.animations?.[0],
1078
- fileName: `${getFilename(fileName || src || 'converted')}.json`,
1079
- shouldDownload
1080
- });
1081
- return;
1082
- }
1083
1076
  let animations = animationsFromProps;
1084
1077
  if (!animations) {
1085
1078
  const animationData = await getAnimationData(src);
1086
1079
  animations = animationData.animations;
1087
1080
  }
1081
+ if (typeCheck || this._isDotLottie) {
1082
+ return createJSON({
1083
+ animation: animations?.[0],
1084
+ fileName: `${getFilename(fileName || src || 'converted')}.json`,
1085
+ shouldDownload
1086
+ });
1087
+ }
1088
1088
  return createDotLottie({
1089
1089
  animations,
1090
1090
  fileName: `${getFilename(fileName || src || 'converted')}.lottie`,