@dotlottie/dotlottie-js
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -1,6 +0,6 @@ | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-c96bbbae.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-6db03840.js'; | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-d46cdb6b.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-8a5aef58.js'; | ||
import 'fflate'; | ||
import './dotlottie-state-machine-common-c1e36f9f.js'; | ||
import './manifest-a5e5a634.js'; | ||
import './dotlottie-state-machine-common-6efb69f3.js'; | ||
import './manifest-c3ad44f7.js'; | ||
import 'valibot'; | ||
@@ -7,0 +7,0 @@ import '@lottiefiles/lottie-types'; |
@@ -1,9 +0,9 @@ | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-6db03840.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-a73b241d.js'; | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-8a5aef58.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-0c0444ee.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-a5e5a634.js'; | ||
import './manifest-c3ad44f7.js'; | ||
import 'valibot'; | ||
import './dotlottie-common-c96bbbae.js'; | ||
import './dotlottie-state-machine-common-c1e36f9f.js'; | ||
import './dotlottie-common-d46cdb6b.js'; | ||
import './dotlottie-state-machine-common-6efb69f3.js'; | ||
@@ -10,0 +10,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -726,3 +726,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -738,3 +737,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -745,9 +744,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -766,7 +758,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -780,10 +768,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -790,0 +793,0 @@ jpeg: "image/jpeg", |
@@ -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-c96bbbae.js'; | ||
export { c as AnimationData, A as AnimationOptions, E as ExportOptions, I as ImageData, d as ImageOptions, L as LottieAnimationCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-6db03840.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-a73b241d.js'; | ||
export { C as ConversionOptions, D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, G as GetAnimationOptions } from './dotlottie-common-d46cdb6b.js'; | ||
export { c as AnimationData, A as AnimationOptions, E as ExportOptions, I as ImageData, d as ImageOptions, L as LottieAnimationCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-8a5aef58.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-0c0444ee.js'; | ||
import { Asset, Animation } from '@lottiefiles/lottie-types'; | ||
@@ -13,5 +13,5 @@ import { UnzipFileFilter, Unzipped } from 'fflate'; | ||
export { LottieStateMachine } from './lottie-state-machine.js'; | ||
import { M as Manifest } from './manifest-a5e5a634.js'; | ||
export { M as Manifest, a as ManifestAnimation, c as ManifestAnimationSchema, g as ManifestSchema, f as ManifestState, e as ManifestTheme, d as ManifestThemeSchema, P as PlayMode, b as PlayModeSchema, S as StateMachineSchema } from './manifest-a5e5a634.js'; | ||
export { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions, z as DotLottieStates, y as DotLottieStatesSchema, b as PlaybackOptions, P as PlaybackOptionsSchema, c as StateAnimationSettings, S as StateAnimationSettingsSchema, t as StateInfo, s as StateInfoSchema, x as StateSettings, w as StateSettingsSchema, v as StateTransitionEvents, u as StateTransitionEventsSchema, h as StateTransitionOnAfter, g as StateTransitionOnAfterSchema, f as StateTransitionOnClick, e as StateTransitionOnClickSchema, p as StateTransitionOnComplete, o as StateTransitionOnCompleteSchema, j as StateTransitionOnEnter, i as StateTransitionOnEnterSchema, l as StateTransitionOnMouseEnter, k as StateTransitionOnMouseEnterSchema, n as StateTransitionOnMouseLeave, m as StateTransitionOnMouseLeaveSchema, r as StateTransitionOnShow, q as StateTransitionOnShowSchema, d as Transitionable, T as TransitionableSchema } from './dotlottie-state-machine-common-c1e36f9f.js'; | ||
import { M as Manifest } from './manifest-c3ad44f7.js'; | ||
export { M as Manifest, a as ManifestAnimation, c as ManifestAnimationSchema, f as ManifestSchema, e as ManifestTheme, d as ManifestThemeSchema, P as PlayMode, b as PlayModeSchema } from './manifest-c3ad44f7.js'; | ||
export { v as DotLottieState, B as DotLottieStateMachine, D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions, z as DotLottieStateMachineDescriptor, y as DotLottieStateMachineDescriptorSchema, A as DotLottieStateMachineSchema, t as DotLottieStatePlaybackSettings, s as DotLottieStatePlaybackSettingsSchema, u as DotLottieStateSchema, r as DotLottieStateTransitionEvents, q as DotLottieStateTransitionEventsSchema, x as DotLottieStates, w as DotLottieStatesSchema, b as PlaybackOptions, P as PlaybackOptionsSchema, f as StateTransitionOnAfter, e as StateTransitionOnAfterSchema, d as StateTransitionOnClick, S as StateTransitionOnClickSchema, n as StateTransitionOnComplete, m as StateTransitionOnCompleteSchema, h as StateTransitionOnEnter, g as StateTransitionOnEnterSchema, j as StateTransitionOnMouseEnter, i as StateTransitionOnMouseEnterSchema, l as StateTransitionOnMouseLeave, k as StateTransitionOnMouseLeaveSchema, p as StateTransitionOnShow, o as StateTransitionOnShowSchema, c as Transitionable, T as TransitionableSchema } from './dotlottie-state-machine-common-6efb69f3.js'; | ||
import 'valibot'; | ||
@@ -18,0 +18,0 @@ |
@@ -1,5 +0,5 @@ | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-6db03840.js'; | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-8a5aef58.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-a5e5a634.js'; | ||
import './manifest-c3ad44f7.js'; | ||
import 'valibot'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -96,0 +99,0 @@ jpeg: "image/jpeg", |
@@ -1,5 +0,5 @@ | ||
import { b as LottieImageCommon, d as ImageOptions } from './dotlottie-theme-common-6db03840.js'; | ||
import { b as LottieImageCommon, d as ImageOptions } from './dotlottie-theme-common-8a5aef58.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-a5e5a634.js'; | ||
import './manifest-c3ad44f7.js'; | ||
import 'valibot'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -96,0 +99,0 @@ jpeg: "image/jpeg", |
@@ -1,4 +0,4 @@ | ||
import { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions } from './dotlottie-state-machine-common-c1e36f9f.js'; | ||
import { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions } from './dotlottie-state-machine-common-6efb69f3.js'; | ||
import 'fflate'; | ||
import './manifest-a5e5a634.js'; | ||
import './manifest-c3ad44f7.js'; | ||
import 'valibot'; | ||
@@ -5,0 +5,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue, safeParse, flatten } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple, safeParse, flatten } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
var StateInfoSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
var DotLottieStatesSchema = record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var DotLottieError = class extends Error { | ||
@@ -164,3 +167,3 @@ constructor(message, code) { | ||
_requireValidDescriptor(descriptor) { | ||
const result = safeParse(StateInfoSchema, descriptor); | ||
const result = safeParse(DotLottieStateMachineDescriptorSchema, descriptor); | ||
if (!result.success) { | ||
@@ -167,0 +170,0 @@ const error = `Invalid state machine declaration, ${JSON.stringify(flatten(result.error).nested, null, 2)}`; |
@@ -1,5 +0,5 @@ | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-6db03840.js'; | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-8a5aef58.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-a5e5a634.js'; | ||
import './manifest-c3ad44f7.js'; | ||
import 'valibot'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var createError = (message) => { | ||
@@ -96,0 +99,0 @@ const error = new Error(`[dotlottie-js]: ${message}`); |
@@ -1,6 +0,6 @@ | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-4634b3b2.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-1b7aa184.js'; | ||
import { D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, C as ConversionOptions } from './dotlottie-common-d0ac7fb7.js'; | ||
import { A as AnimationOptions } from './dotlottie-theme-common-bb92738d.js'; | ||
import 'fflate'; | ||
import './dotlottie-state-machine-common-a2841e06.js'; | ||
import './manifest-6e5571d4.js'; | ||
import './dotlottie-state-machine-common-f3555162.js'; | ||
import './manifest-dec4ae91.js'; | ||
import 'valibot'; | ||
@@ -7,0 +7,0 @@ import '@lottiefiles/lottie-types'; |
import { strToU8, zip, unzip, strFromU8 } from 'fflate'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue, safeParse, flatten } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple, safeParse, flatten } from 'valibot'; | ||
import phash from 'sharp-phash'; | ||
@@ -15,3 +15,3 @@ | ||
name: "@dotlottie/dotlottie-js", | ||
version: "0.5.0", | ||
version: "0.5.1", | ||
type: "module", | ||
@@ -119,3 +119,2 @@ description: "This library helps in creating and modifying .lottie files.", | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -131,3 +130,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -138,9 +137,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -159,7 +151,3 @@ state: string() | ||
]); | ||
var StateInfoSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -173,10 +161,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
var DotLottieStatesSchema = record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -338,3 +341,3 @@ jpeg: "image/jpeg", | ||
_requireValidDescriptor(descriptor) { | ||
const result = safeParse(StateInfoSchema, descriptor); | ||
const result = safeParse(DotLottieStateMachineDescriptorSchema, descriptor); | ||
if (!result.success) { | ||
@@ -341,0 +344,0 @@ const error = `Invalid state machine declaration, ${JSON.stringify(flatten(result.error).nested, null, 2)}`; |
@@ -1,9 +0,9 @@ | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-1b7aa184.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-e2921603.js'; | ||
import { b as LottieImageCommon } from './dotlottie-theme-common-bb92738d.js'; | ||
import { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-7dab72f5.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-6e5571d4.js'; | ||
import './manifest-dec4ae91.js'; | ||
import 'valibot'; | ||
import './dotlottie-common-4634b3b2.js'; | ||
import './dotlottie-state-machine-common-a2841e06.js'; | ||
import './dotlottie-common-d0ac7fb7.js'; | ||
import './dotlottie-state-machine-common-f3555162.js'; | ||
@@ -10,0 +10,0 @@ /** |
import phash from 'sharp-phash'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -33,3 +33,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -45,3 +44,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -52,9 +51,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -73,7 +65,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -87,10 +75,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -97,0 +100,0 @@ jpeg: "image/jpeg", |
@@ -5,11 +5,11 @@ 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-4634b3b2.js'; | ||
export { c as AnimationData, A as AnimationOptions, E as ExportOptions, I as ImageData, d as ImageOptions, L as LottieAnimationCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-1b7aa184.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-e2921603.js'; | ||
export { C as ConversionOptions, D as DotLottieCommon, a as DotLottieOptions, b as DotLottiePlugin, G as GetAnimationOptions } from './dotlottie-common-d0ac7fb7.js'; | ||
export { c as AnimationData, A as AnimationOptions, E as ExportOptions, I as ImageData, d as ImageOptions, L as LottieAnimationCommon, b as LottieImageCommon, a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-bb92738d.js'; | ||
export { D as DuplicateImageDetectorCommon } from './duplicate-image-detector-common-7dab72f5.js'; | ||
import { Asset, Animation } from '@lottiefiles/lottie-types'; | ||
import { UnzipFileFilter, Unzipped } from 'fflate'; | ||
import { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions } from './dotlottie-state-machine-common-a2841e06.js'; | ||
export { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions, z as DotLottieStates, y as DotLottieStatesSchema, b as PlaybackOptions, P as PlaybackOptionsSchema, c as StateAnimationSettings, S as StateAnimationSettingsSchema, t as StateInfo, s as StateInfoSchema, x as StateSettings, w as StateSettingsSchema, v as StateTransitionEvents, u as StateTransitionEventsSchema, h as StateTransitionOnAfter, g as StateTransitionOnAfterSchema, f as StateTransitionOnClick, e as StateTransitionOnClickSchema, p as StateTransitionOnComplete, o as StateTransitionOnCompleteSchema, j as StateTransitionOnEnter, i as StateTransitionOnEnterSchema, l as StateTransitionOnMouseEnter, k as StateTransitionOnMouseEnterSchema, n as StateTransitionOnMouseLeave, m as StateTransitionOnMouseLeaveSchema, r as StateTransitionOnShow, q as StateTransitionOnShowSchema, d as Transitionable, T as TransitionableSchema } from './dotlottie-state-machine-common-a2841e06.js'; | ||
import { M as Manifest } from './manifest-6e5571d4.js'; | ||
export { M as Manifest, a as ManifestAnimation, c as ManifestAnimationSchema, g as ManifestSchema, f as ManifestState, e as ManifestTheme, d as ManifestThemeSchema, P as PlayMode, b as PlayModeSchema, S as StateMachineSchema } from './manifest-6e5571d4.js'; | ||
import { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions } from './dotlottie-state-machine-common-f3555162.js'; | ||
export { v as DotLottieState, B as DotLottieStateMachine, D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions, z as DotLottieStateMachineDescriptor, y as DotLottieStateMachineDescriptorSchema, A as DotLottieStateMachineSchema, t as DotLottieStatePlaybackSettings, s as DotLottieStatePlaybackSettingsSchema, u as DotLottieStateSchema, r as DotLottieStateTransitionEvents, q as DotLottieStateTransitionEventsSchema, x as DotLottieStates, w as DotLottieStatesSchema, b as PlaybackOptions, P as PlaybackOptionsSchema, f as StateTransitionOnAfter, e as StateTransitionOnAfterSchema, d as StateTransitionOnClick, S as StateTransitionOnClickSchema, n as StateTransitionOnComplete, m as StateTransitionOnCompleteSchema, h as StateTransitionOnEnter, g as StateTransitionOnEnterSchema, j as StateTransitionOnMouseEnter, i as StateTransitionOnMouseEnterSchema, l as StateTransitionOnMouseLeave, k as StateTransitionOnMouseLeaveSchema, p as StateTransitionOnShow, o as StateTransitionOnShowSchema, c as Transitionable, T as TransitionableSchema } from './dotlottie-state-machine-common-f3555162.js'; | ||
import { M as Manifest } from './manifest-dec4ae91.js'; | ||
export { M as Manifest, a as ManifestAnimation, c as ManifestAnimationSchema, f as ManifestSchema, e as ManifestTheme, d as ManifestThemeSchema, P as PlayMode, b as PlayModeSchema } from './manifest-dec4ae91.js'; | ||
export { LottieStateMachine } from './lottie-state-machine.js'; | ||
@@ -16,0 +16,0 @@ import 'valibot'; |
import { unzip, strFromU8, strToU8, zip } from 'fflate'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue, safeParse, flatten } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple, safeParse, flatten } from 'valibot'; | ||
import phash from 'sharp-phash'; | ||
@@ -15,3 +15,3 @@ | ||
name: "@dotlottie/dotlottie-js", | ||
version: "0.5.0", | ||
version: "0.5.1", | ||
type: "module", | ||
@@ -119,3 +119,2 @@ description: "This library helps in creating and modifying .lottie files.", | ||
}); | ||
var StateMachineSchema = array(string()); | ||
var ManifestSchema = object({ | ||
@@ -131,3 +130,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -138,9 +137,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -159,7 +151,3 @@ state: string() | ||
]); | ||
var StateInfoSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -173,10 +161,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
var DotLottieStatesSchema = record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var DotLottieStateMachineSchema = object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -550,3 +553,3 @@ jpeg: "image/jpeg", | ||
_requireValidDescriptor(descriptor) { | ||
const result = safeParse(StateInfoSchema, descriptor); | ||
const result = safeParse(DotLottieStateMachineDescriptorSchema, descriptor); | ||
if (!result.success) { | ||
@@ -1902,3 +1905,3 @@ const error = `Invalid state machine declaration, ${JSON.stringify(flatten(result.error).nested, null, 2)}`; | ||
export { DotLottie, DotLottieCommon, DotLottieError, DotLottiePlugin, DotLottieStateMachineCommon, DotLottieStatesSchema, DuplicateImageDetectorCommon, ErrorCodes, LottieAnimation, LottieAnimationCommon, LottieImage2 as LottieImage, LottieImageCommon, LottieStateMachine, LottieTheme, LottieThemeCommon, MIME_CODES, MIME_TO_EXTENSION, MIME_TYPES, ManifestAnimationSchema, ManifestSchema, ManifestThemeSchema, PlayMode, PlayModeSchema, PlaybackOptionsSchema, StateAnimationSettingsSchema, StateInfoSchema, StateMachineSchema, StateSettingsSchema, StateTransitionEventsSchema, StateTransitionOnAfterSchema, StateTransitionOnClickSchema, StateTransitionOnCompleteSchema, StateTransitionOnEnterSchema, StateTransitionOnMouseEnterSchema, StateTransitionOnMouseLeaveSchema, StateTransitionOnShowSchema, TransitionableSchema, base64ToUint8Array, createError, dataUrlFromU8, getAnimation, getAnimations, getExtensionTypeFromBase64, getImage, getImages, getManifest, getMimeTypeFromBase64, getStateMachine, getStateMachines, getTheme, getThemes, inlineImageAssets, isImageAsset, isValidURL, loadFromArrayBuffer, loadFromURL, unzipDotLottie, unzipDotLottieFile, validateDotLottie }; | ||
export { DotLottie, DotLottieCommon, DotLottieError, DotLottiePlugin, DotLottieStateMachineCommon, DotLottieStateMachineDescriptorSchema, DotLottieStateMachineSchema, DotLottieStatePlaybackSettingsSchema, DotLottieStateSchema, DotLottieStateTransitionEventsSchema, DotLottieStatesSchema, DuplicateImageDetectorCommon, ErrorCodes, LottieAnimation, LottieAnimationCommon, LottieImage2 as LottieImage, LottieImageCommon, LottieStateMachine, LottieTheme, LottieThemeCommon, MIME_CODES, MIME_TO_EXTENSION, MIME_TYPES, ManifestAnimationSchema, ManifestSchema, ManifestThemeSchema, PlayMode, PlayModeSchema, PlaybackOptionsSchema, StateTransitionOnAfterSchema, StateTransitionOnClickSchema, StateTransitionOnCompleteSchema, StateTransitionOnEnterSchema, StateTransitionOnMouseEnterSchema, StateTransitionOnMouseLeaveSchema, StateTransitionOnShowSchema, TransitionableSchema, base64ToUint8Array, createError, dataUrlFromU8, getAnimation, getAnimations, getExtensionTypeFromBase64, getImage, getImages, getManifest, getMimeTypeFromBase64, getStateMachine, getStateMachines, getTheme, getThemes, inlineImageAssets, isImageAsset, isValidURL, loadFromArrayBuffer, loadFromURL, unzipDotLottie, unzipDotLottieFile, validateDotLottie }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,5 +0,5 @@ | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-1b7aa184.js'; | ||
import { L as LottieAnimationCommon, A as AnimationOptions } from './dotlottie-theme-common-bb92738d.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-6e5571d4.js'; | ||
import './manifest-dec4ae91.js'; | ||
import 'valibot'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -96,0 +99,0 @@ jpeg: "image/jpeg", |
@@ -1,5 +0,5 @@ | ||
import { b as LottieImageCommon, d as ImageOptions } from './dotlottie-theme-common-1b7aa184.js'; | ||
import { b as LottieImageCommon, d as ImageOptions } from './dotlottie-theme-common-bb92738d.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-6e5571d4.js'; | ||
import './manifest-dec4ae91.js'; | ||
import 'valibot'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var MIME_TYPES = { | ||
@@ -96,0 +99,0 @@ jpeg: "image/jpeg", |
@@ -1,4 +0,4 @@ | ||
import { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions } from './dotlottie-state-machine-common-a2841e06.js'; | ||
import { D as DotLottieStateMachineCommon, a as DotLottieStateMachineCommonOptions } from './dotlottie-state-machine-common-f3555162.js'; | ||
import 'fflate'; | ||
import './manifest-6e5571d4.js'; | ||
import './manifest-dec4ae91.js'; | ||
import 'valibot'; | ||
@@ -5,0 +5,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue, safeParse, flatten } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple, safeParse, flatten } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
var StateInfoSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
var DotLottieStatesSchema = record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var DotLottieError = class extends Error { | ||
@@ -164,3 +167,3 @@ constructor(message, code) { | ||
_requireValidDescriptor(descriptor) { | ||
const result = safeParse(StateInfoSchema, descriptor); | ||
const result = safeParse(DotLottieStateMachineDescriptorSchema, descriptor); | ||
if (!result.success) { | ||
@@ -167,0 +170,0 @@ const error = `Invalid state machine declaration, ${JSON.stringify(flatten(result.error).nested, null, 2)}`; |
@@ -1,5 +0,5 @@ | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-1b7aa184.js'; | ||
import { a as LottieThemeCommon, T as ThemeOptions } from './dotlottie-theme-common-bb92738d.js'; | ||
import 'fflate'; | ||
import '@lottiefiles/lottie-types'; | ||
import './manifest-6e5571d4.js'; | ||
import './manifest-dec4ae91.js'; | ||
import 'valibot'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, tuple, minValue, maxValue } from 'valibot'; | ||
import { nativeEnum, object, optional, boolean, string, union, literal, number, array, record, any, omit, merge, minValue, maxValue, tuple } from 'valibot'; | ||
import 'fflate'; | ||
@@ -32,3 +32,2 @@ | ||
}); | ||
var StateMachineSchema = array(string()); | ||
object({ | ||
@@ -44,3 +43,3 @@ activeAnimationId: optional(string()), | ||
themes: optional(array(ManifestThemeSchema)), | ||
states: optional(StateMachineSchema), | ||
states: optional(array(string())), | ||
version: optional(string()) | ||
@@ -51,9 +50,2 @@ }); | ||
var PlaybackOptionsSchema = omit(ManifestAnimationSchema, ["id"]); | ||
var StateAnimationSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var TransitionableSchema = object({ | ||
@@ -72,7 +64,3 @@ state: string() | ||
]); | ||
object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
var StateTransitionEventsSchema = object({ | ||
var DotLottieStateTransitionEventsSchema = object({ | ||
onAfter: optional(StateTransitionOnAfterSchema), | ||
@@ -86,10 +74,25 @@ onClick: optional(StateTransitionOnClickSchema), | ||
}); | ||
var StateSettingsSchema = merge([ | ||
StateTransitionEventsSchema, | ||
var DotLottieStatePlaybackSettingsSchema = merge([ | ||
PlaybackOptionsSchema, | ||
object({ | ||
playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])), | ||
segments: optional(union([array(number()), string()])) | ||
}) | ||
]); | ||
var DotLottieStateSchema = merge([ | ||
DotLottieStateTransitionEventsSchema, | ||
object({ | ||
animationId: optional(string()), | ||
playbackSettings: StateAnimationSettingsSchema | ||
playbackSettings: DotLottieStatePlaybackSettingsSchema | ||
}) | ||
]); | ||
record(string(), StateSettingsSchema); | ||
var DotLottieStatesSchema = record(string(), DotLottieStateSchema); | ||
var DotLottieStateMachineDescriptorSchema = object({ | ||
id: string(), | ||
initial: string() | ||
}); | ||
object({ | ||
descriptor: DotLottieStateMachineDescriptorSchema, | ||
states: DotLottieStatesSchema | ||
}); | ||
var createError = (message) => { | ||
@@ -96,0 +99,0 @@ const error = new Error(`[dotlottie-js]: ${message}`); |
{ | ||
"name": "@dotlottie/dotlottie-js", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"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 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 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1862141
18948