@dotlottie/dotlottie-js
Advanced tools
Comparing version 0.6.2 to 0.7.0
@@ -1,3 +0,3 @@ | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-272fe272.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-ec0c18b0.js'; | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-d160379b.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-14ad81ae.js'; | ||
import 'fflate'; | ||
@@ -4,0 +4,0 @@ import './dotlottie-state-machine-common-f17570dd.js'; |
@@ -1,3 +0,3 @@ | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-ec0c18b0.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-7b67debb.js'; | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-14ad81ae.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-a9a39caf.js'; | ||
import 'fflate'; | ||
@@ -7,3 +7,3 @@ import '@lottiefiles/lottie-types'; | ||
import 'valibot'; | ||
import './dotlottie-common-272fe272.js'; | ||
import './dotlottie-common-d160379b.js'; | ||
import './dotlottie-state-machine-common-f17570dd.js'; | ||
@@ -10,0 +10,0 @@ |
@@ -5,5 +5,5 @@ export { DotLottie } from './dotlottie.js'; | ||
export { LottieTheme } from './lottie-theme.js'; | ||
export { C as ConversionOptions, D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, G as GetAnimationOptions } from './dotlottie-common-272fe272.js'; | ||
export { d as AnimationData, A as AnimationOptions, f as AudioData, g as AudioOptions, E as ExportOptions, I as ImageData, e as ImageOptions, L as LottieAnimationCommon, c as LottieAudioCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-ec0c18b0.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-7b67debb.js'; | ||
export { C as ConversionOptions, D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, G as GetAnimationOptions } from './dotlottie-common-d160379b.js'; | ||
export { d as AnimationData, A as AnimationOptions, f as AudioData, g as AudioOptions, E as ExportOptions, I as ImageData, e as ImageOptions, L as LottieAnimationCommon, c as LottieAudioCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-14ad81ae.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-a9a39caf.js'; | ||
import { Asset, Animation } from '@lottiefiles/lottie-types'; | ||
@@ -518,3 +518,3 @@ import { UnzipFileFilter, Unzipped } from 'fflate'; | ||
*/ | ||
declare function getThemes(dotLottie: Uint8Array, filter?: UnzipFileFilter): Promise<Record<string, string>>; | ||
declare function getThemes(dotLottie: Uint8Array, filter?: UnzipFileFilter): Promise<Record<string, Record<string, unknown>>>; | ||
/** | ||
@@ -539,3 +539,3 @@ * Retrieves a specific theme by ID from the given DotLottie object. | ||
*/ | ||
declare function getTheme(dotLottie: Uint8Array, themeId: string, filter?: UnzipFileFilter): Promise<string | undefined>; | ||
declare function getTheme(dotLottie: Uint8Array, themeId: string, filter?: UnzipFileFilter): Promise<Record<string, unknown> | undefined>; | ||
/** | ||
@@ -542,0 +542,0 @@ * Retrieves the state machines from the given DotLottie object. |
@@ -1,2 +0,2 @@ | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-ec0c18b0.js'; | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-14ad81ae.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,2 +0,2 @@ | ||
import { c as LottieAudioCommon, g as AudioOptions } from './dotlottie-theme-common-ec0c18b0.js'; | ||
import { c as LottieAudioCommon, g as AudioOptions } from './dotlottie-theme-common-14ad81ae.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,2 +0,2 @@ | ||
import { b as LottieImageCommon, e as ImageOptions } from './dotlottie-theme-common-ec0c18b0.js'; | ||
import { b as LottieImageCommon, e as ImageOptions } from './dotlottie-theme-common-14ad81ae.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,2 +0,2 @@ | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-ec0c18b0.js'; | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-14ad81ae.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -161,3 +161,3 @@ import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
this._requireValidData(this._data); | ||
return this._data; | ||
return JSON.stringify(this._data); | ||
} | ||
@@ -179,3 +179,3 @@ addAnimation(animation) { | ||
_requireValidData(data) { | ||
if (typeof data !== "string" || !data) | ||
if (typeof data !== "object") | ||
throw createError("Invalid theme data"); | ||
@@ -186,3 +186,3 @@ } | ||
const response = await fetch(url); | ||
const data = await response.text(); | ||
const data = await response.json(); | ||
this._data = data; | ||
@@ -189,0 +189,0 @@ } catch (error) { |
@@ -1,3 +0,3 @@ | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-93c31774.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-433f7b92.js'; | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-9fd79824.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-21ec6cf8.js'; | ||
import 'fflate'; | ||
@@ -4,0 +4,0 @@ import './dotlottie-state-machine-common-e02ef581.js'; |
@@ -15,3 +15,3 @@ import { strToU8, zip, unzip, strFromU8 } from 'fflate'; | ||
name: "@dotlottie/dotlottie-js", | ||
version: "0.6.2", | ||
version: "0.7.0", | ||
type: "module", | ||
@@ -418,3 +418,3 @@ description: "This library helps in creating and modifying .lottie files.", | ||
this._requireValidData(this._data); | ||
return this._data; | ||
return JSON.stringify(this._data); | ||
} | ||
@@ -436,3 +436,3 @@ addAnimation(animation) { | ||
_requireValidData(data) { | ||
if (typeof data !== "string" || !data) | ||
if (typeof data !== "object") | ||
throw createError("Invalid theme data"); | ||
@@ -443,3 +443,3 @@ } | ||
const response = await fetch(url); | ||
const data = await response.text(); | ||
const data = await response.json(); | ||
this._data = data; | ||
@@ -1770,4 +1770,4 @@ } catch (error) { | ||
for (const theme of this.themes) { | ||
const lss = await theme.toString(); | ||
dotlottie[`themes/${theme.id}.lss`] = [strToU8(lss), theme.zipOptions]; | ||
const themeData = await theme.toString(); | ||
dotlottie[`themes/${theme.id}.json`] = [strToU8(themeData), theme.zipOptions]; | ||
} | ||
@@ -1873,4 +1873,4 @@ for (const state of this.stateMachines) { | ||
})); | ||
} else if (key.startsWith("themes/") && key.endsWith(".lss")) { | ||
const themeId = /themes\/(.+)\.lss/u.exec(key)?.[1]; | ||
} else if (key.startsWith("themes/") && key.endsWith(".json")) { | ||
const themeId = /themes\/(.+)\.json/u.exec(key)?.[1]; | ||
if (!themeId) { | ||
@@ -1883,3 +1883,3 @@ throw createError("Invalid theme id"); | ||
id: theme.id, | ||
data: decodedStr | ||
data: JSON.parse(decodedStr) | ||
}); | ||
@@ -1886,0 +1886,0 @@ theme.animations.forEach((animationId) => { |
@@ -1,3 +0,3 @@ | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-433f7b92.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-a738c2c1.js'; | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-21ec6cf8.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-3ae43be3.js'; | ||
import 'fflate'; | ||
@@ -7,3 +7,3 @@ import '@lottiefiles/lottie-types'; | ||
import 'valibot'; | ||
import './dotlottie-common-93c31774.js'; | ||
import './dotlottie-common-9fd79824.js'; | ||
import './dotlottie-state-machine-common-e02ef581.js'; | ||
@@ -10,0 +10,0 @@ |
@@ -5,5 +5,5 @@ export { DotLottie } from './dotlottie.js'; | ||
export { LottieTheme } from './lottie-theme.js'; | ||
export { C as ConversionOptions, D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, G as GetAnimationOptions } from './dotlottie-common-93c31774.js'; | ||
export { d as AnimationData, A as AnimationOptions, f as AudioData, g as AudioOptions, E as ExportOptions, I as ImageData, e as ImageOptions, L as LottieAnimationCommon, c as LottieAudioCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-433f7b92.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-a738c2c1.js'; | ||
export { C as ConversionOptions, D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, G as GetAnimationOptions } from './dotlottie-common-9fd79824.js'; | ||
export { d as AnimationData, A as AnimationOptions, f as AudioData, g as AudioOptions, E as ExportOptions, I as ImageData, e as ImageOptions, L as LottieAnimationCommon, c as LottieAudioCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-21ec6cf8.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-3ae43be3.js'; | ||
import { Asset, Animation } from '@lottiefiles/lottie-types'; | ||
@@ -525,3 +525,3 @@ import { UnzipFileFilter, Unzipped } from 'fflate'; | ||
*/ | ||
declare function getThemes(dotLottie: Uint8Array, filter?: UnzipFileFilter): Promise<Record<string, string>>; | ||
declare function getThemes(dotLottie: Uint8Array, filter?: UnzipFileFilter): Promise<Record<string, Record<string, unknown>>>; | ||
/** | ||
@@ -546,3 +546,3 @@ * Retrieves a specific theme by ID from the given DotLottie object. | ||
*/ | ||
declare function getTheme(dotLottie: Uint8Array, themeId: string, filter?: UnzipFileFilter): Promise<string | undefined>; | ||
declare function getTheme(dotLottie: Uint8Array, themeId: string, filter?: UnzipFileFilter): Promise<Record<string, unknown> | undefined>; | ||
/** | ||
@@ -549,0 +549,0 @@ * Retrieves the state machines from the given DotLottie object. |
@@ -1,2 +0,2 @@ | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-433f7b92.js'; | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-21ec6cf8.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,2 +0,2 @@ | ||
import { c as LottieAudioCommon, g as AudioOptions } from './dotlottie-theme-common-433f7b92.js'; | ||
import { c as LottieAudioCommon, g as AudioOptions } from './dotlottie-theme-common-21ec6cf8.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,2 +0,2 @@ | ||
import { b as LottieImageCommon, e as ImageOptions } from './dotlottie-theme-common-433f7b92.js'; | ||
import { b as LottieImageCommon, e as ImageOptions } from './dotlottie-theme-common-21ec6cf8.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,2 +0,2 @@ | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-433f7b92.js'; | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-21ec6cf8.js'; | ||
import 'fflate'; | ||
@@ -3,0 +3,0 @@ import '@lottiefiles/lottie-types'; |
@@ -161,3 +161,3 @@ import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
this._requireValidData(this._data); | ||
return this._data; | ||
return JSON.stringify(this._data); | ||
} | ||
@@ -179,3 +179,3 @@ addAnimation(animation) { | ||
_requireValidData(data) { | ||
if (typeof data !== "string" || !data) | ||
if (typeof data !== "object") | ||
throw createError("Invalid theme data"); | ||
@@ -186,3 +186,3 @@ } | ||
const response = await fetch(url); | ||
const data = await response.text(); | ||
const data = await response.json(); | ||
this._data = data; | ||
@@ -189,0 +189,0 @@ } catch (error) { |
{ | ||
"name": "@dotlottie/dotlottie-js", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "This library helps in creating and modifying .lottie files.", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2148049
18851