ngx-lottie
Advanced tools
Comparing version 3.1.0 to 4.0.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/platform-browser')) : | ||
typeof define === 'function' && define.amd ? define('ngx-lottie', ['exports', '@angular/core', '@angular/common', '@angular/platform-browser'], factory) : | ||
(global = global || self, factory(global['ngx-lottie'] = {}, global.ng.core, global.ng.common, global.ng.platformBrowser)); | ||
}(this, function (exports, core, common, platformBrowser) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser')) : | ||
typeof define === 'function' && define.amd ? define('ngx-lottie', ['exports', '@angular/core', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/platform-browser'], factory) : | ||
(global = global || self, factory(global['ngx-lottie'] = {}, global.ng.core, global.ng.common, global.rxjs, global.rxjs.operators, global.ng.platformBrowser)); | ||
}(this, function (exports, core, common, rxjs, operators, platformBrowser) { 'use strict'; | ||
@@ -209,87 +209,85 @@ /*! ***************************************************************************** | ||
/** | ||
* @return {?} | ||
* @record | ||
*/ | ||
function getLottiePlayer() { | ||
return require('lottie-web/build/player/lottie.js'); | ||
function BMEnterFrameEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.currentTime; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.duration; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.totalTime; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.type; | ||
} | ||
/** | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
* @record | ||
*/ | ||
function resolveOptions(options, container) { | ||
function BMCompleteLoopEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
var defaulOptions = { | ||
container: container, | ||
renderer: 'svg', | ||
loop: true, | ||
autoplay: true | ||
}; | ||
return Object.assign(defaulOptions, options); | ||
BMCompleteLoopEvent.prototype.type; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.loop; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.playCount; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.frameMult; | ||
} | ||
/** | ||
* @param {?} zone | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
* @record | ||
*/ | ||
function loadAnimation(zone, options, container) { | ||
function BMCompleteEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
var resolvedOptions = resolveOptions(options, container); | ||
BMCompleteEvent.prototype.type; | ||
/** @type {?} */ | ||
var player = getLottiePlayer(); | ||
return zone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { return player.loadAnimation(resolvedOptions); })); | ||
BMCompleteEvent.prototype.duration; | ||
} | ||
/** | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
* @type {?} | ||
* @record | ||
*/ | ||
var eventsMap = { | ||
complete: 'complete', | ||
loopComplete: 'loopComplete', | ||
enterFrame: 'enterFrame', | ||
segmentStart: 'segmentStart', | ||
config_ready: 'configReady', | ||
data_ready: 'dataReady', | ||
data_failed: 'dataFailed', | ||
loaded_images: 'loadedImages', | ||
DOMLoaded: 'domLoaded', | ||
destroy: 'destroy' | ||
}; | ||
function BMSegmentStartEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.type; | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.firstFrame; | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.totalFrames; | ||
} | ||
/** | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
* @record | ||
*/ | ||
function mapEventToCamelCase(name) { | ||
return eventsMap[name]; | ||
function BMDestroyEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMDestroyEvent.prototype.target; | ||
/** @type {?} */ | ||
BMDestroyEvent.prototype.type; | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
* @record | ||
*/ | ||
function getEventEmitterFromDirectiveInstance(instance, name) { | ||
return (/** @type {?} */ (instance[mapEventToCamelCase(name)])); | ||
function BMRenderFrameErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.nativeError; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.currentTime; | ||
} | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
* @type {?} | ||
* @record | ||
*/ | ||
var lottieEvents = [ | ||
'complete', | ||
'loopComplete', | ||
'enterFrame', | ||
'segmentStart', | ||
'config_ready', | ||
'data_ready', | ||
'data_failed', | ||
'loaded_images', | ||
'DOMLoaded', | ||
'destroy' | ||
]; | ||
function BMConfigErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.nativeError; | ||
} | ||
/** @type {?} */ | ||
var LOTTIE_PLAYER_FACTORY_OR_LOADER = new core.InjectionToken('LottiePlayerOrLoader'); | ||
@@ -300,4 +298,153 @@ /** | ||
*/ | ||
var AnimationLoader = /** @class */ (function () { | ||
function AnimationLoader(ngZone, platformId, playerFactoryOrLoader) { | ||
this.ngZone = ngZone; | ||
this.platformId = platformId; | ||
this.playerFactoryOrLoader = playerFactoryOrLoader; | ||
} | ||
/** | ||
* @param {?} options | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.resolveLoaderAndLoadAnimation = /** | ||
* @param {?} options | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
function (options, container, lottieEventsService, animationCreated, instance) { | ||
var _this = this; | ||
if (common.isPlatformServer(this.platformId)) { | ||
return; | ||
} | ||
/** @type {?} */ | ||
var resolvedOptions = this.resolveOptions(options, container); | ||
this.wrapPlayerOrLoaderIntoObservable().subscribe((/** | ||
* @param {?} player | ||
* @return {?} | ||
*/ | ||
function (player) { | ||
_this.loadAnimation(player, resolvedOptions, lottieEventsService, animationCreated, instance); | ||
})); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.resolveOptions = /** | ||
* @private | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
*/ | ||
function (options, container) { | ||
/** @type {?} */ | ||
var defaultOptions = { | ||
container: container, | ||
renderer: 'svg', | ||
loop: true, | ||
autoplay: true | ||
}; | ||
return Object.assign(defaultOptions, options); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} player | ||
* @param {?} options | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.loadAnimation = /** | ||
* @private | ||
* @param {?} player | ||
* @param {?} options | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
function (player, options, lottieEventsService, animationCreated, instance) { | ||
/** @type {?} */ | ||
var animationItem = this.ngZone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { return player.loadAnimation(options); })); | ||
// Dispatch `animationCreated` event after animation is loaded successfully | ||
animationCreated.emit(animationItem); | ||
lottieEventsService.bootstrapEventsService(instance, animationItem); | ||
}; | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.wrapPlayerOrLoaderIntoObservable = /** | ||
* @private | ||
* @return {?} | ||
*/ | ||
function () { | ||
/** @type {?} */ | ||
var playerOrLoader = this.playerFactoryOrLoader(); | ||
if (playerOrLoader instanceof Promise) { | ||
return rxjs.from(playerOrLoader).pipe(operators.map((/** | ||
* @param {?} module | ||
* @return {?} | ||
*/ | ||
function (module) { return module.default || module; })), operators.catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
function (error) { | ||
console.error("\n Could retrieve \"lottie-web\" player, did you provide\n the \"player\" property correctly?\n export function playerFactory() {\n return import('lottie-web');\n }\n LottieModule.forRoot({ player: playerFactory })\n "); | ||
return rxjs.throwError(error); | ||
}))); | ||
} | ||
return rxjs.of(playerOrLoader); | ||
}; | ||
AnimationLoader.decorators = [ | ||
{ type: core.Injectable } | ||
]; | ||
/** @nocollapse */ | ||
AnimationLoader.ctorParameters = function () { return [ | ||
{ type: core.NgZone }, | ||
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: core.Inject, args: [LOTTIE_PLAYER_FACTORY_OR_LOADER,] }] } | ||
]; }; | ||
return AnimationLoader; | ||
}()); | ||
if (false) { | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.ngZone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.playerFactoryOrLoader; | ||
} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
var BaseDirective = /** @class */ (function () { | ||
function BaseDirective() { | ||
function BaseDirective(platformId, animationLoader) { | ||
this.platformId = platformId; | ||
this.animationLoader = animationLoader; | ||
this.options = null; | ||
@@ -339,13 +486,2 @@ this.containerClass = null; | ||
/** | ||
* Original event name is `data_failed`. `data_failed` can be dispatched | ||
* if the `XMLHttpRequest`, that tried to load animation data using | ||
* provided `path`, has errored | ||
*/ | ||
this.dataFailed = new core.EventEmitter(); | ||
/** | ||
* Original event name is `loaded_images`. `loaded_images` can be | ||
* dispatched after all assets are preloaded | ||
*/ | ||
this.loadedImages = new core.EventEmitter(); | ||
/** | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
@@ -360,9 +496,12 @@ * when elements have been added to the DOM | ||
this.destroy = new core.EventEmitter(); | ||
/** | ||
* `error` will be dispatched if the lottie player could not render | ||
* some frame or parse config | ||
*/ | ||
this.error = new core.EventEmitter(); | ||
} | ||
/** | ||
* @protected | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} container | ||
* @param {?} instance | ||
@@ -373,17 +512,12 @@ * @return {?} | ||
* @protected | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} container | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
function (zone, platformId, lottieEventsService, container, instance) { | ||
if (common.isPlatformServer(platformId)) { | ||
function (container, lottieEventsService, instance) { | ||
if (common.isPlatformServer(this.platformId)) { | ||
return; | ||
} | ||
/** @type {?} */ | ||
var animationItem = loadAnimation(zone, this.options, container); | ||
lottieEventsService.animationCreated(animationItem, this.animationCreated); | ||
lottieEventsService.setAnimationItemAndLottieEventListeners(animationItem, instance); | ||
this.animationLoader.resolveLoaderAndLoadAnimation(this.options, container, lottieEventsService, this.animationCreated, instance); | ||
}; | ||
@@ -393,2 +527,7 @@ BaseDirective.decorators = [ | ||
]; | ||
/** @nocollapse */ | ||
BaseDirective.ctorParameters = function () { return [ | ||
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }, | ||
{ type: AnimationLoader } | ||
]; }; | ||
BaseDirective.propDecorators = { | ||
@@ -407,6 +546,5 @@ options: [{ type: core.Input }], | ||
dataReady: [{ type: core.Output }], | ||
dataFailed: [{ type: core.Output }], | ||
loadedImages: [{ type: core.Output }], | ||
domLoaded: [{ type: core.Output }], | ||
destroy: [{ type: core.Output }] | ||
destroy: [{ type: core.Output }], | ||
error: [{ type: core.Output }] | ||
}; | ||
@@ -464,26 +602,29 @@ return BaseDirective; | ||
/** | ||
* Original event name is `data_failed`. `data_failed` can be dispatched | ||
* if the `XMLHttpRequest`, that tried to load animation data using | ||
* provided `path`, has errored | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
* when elements have been added to the DOM | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.dataFailed; | ||
BaseDirective.prototype.domLoaded; | ||
/** | ||
* Original event name is `loaded_images`. `loaded_images` can be | ||
* dispatched after all assets are preloaded | ||
* `destroy` will be dispatched in the `ngOnDestroy` hook of the service, | ||
* it's useful for releasing resources | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.loadedImages; | ||
BaseDirective.prototype.destroy; | ||
/** | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
* when elements have been added to the DOM | ||
* `error` will be dispatched if the lottie player could not render | ||
* some frame or parse config | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.domLoaded; | ||
BaseDirective.prototype.error; | ||
/** | ||
* `destroy` will be dispatched in the `ngOnDestroy` hook of the service, | ||
* it's useful for releasing resources | ||
* @type {?} | ||
* @private | ||
*/ | ||
BaseDirective.prototype.destroy; | ||
BaseDirective.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
BaseDirective.prototype.animationLoader; | ||
} | ||
@@ -495,116 +636,222 @@ | ||
*/ | ||
var LottieEventsService = /** @class */ (function () { | ||
function LottieEventsService(zone, platformId) { | ||
this.zone = zone; | ||
this.platformId = platformId; | ||
this.animationItem = null; | ||
var LottieEventsFacade = /** @class */ (function () { | ||
function LottieEventsFacade(ngZone) { | ||
this.ngZone = ngZone; | ||
/** | ||
* Save listeners so we're able to remove them from `AnimationItem` | ||
* by references in the future when this service is destroyed | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
*/ | ||
this.listeners = new Map(); | ||
this.eventsMap = { | ||
complete: 'complete', | ||
loopComplete: 'loopComplete', | ||
enterFrame: 'enterFrame', | ||
segmentStart: 'segmentStart', | ||
config_ready: 'configReady', | ||
data_ready: 'dataReady', | ||
DOMLoaded: 'domLoaded', | ||
destroy: 'destroy', | ||
error: 'error' | ||
}; | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
*/ | ||
this.eventNames = [ | ||
'complete', | ||
'loopComplete', | ||
'enterFrame', | ||
'segmentStart', | ||
'config_ready', | ||
'data_ready', | ||
'DOMLoaded', | ||
'destroy', | ||
'error' | ||
]; | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.ngOnDestroy = /** | ||
LottieEventsFacade.prototype.addEventListeners = /** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.dispose(); | ||
function (instance, animationItem) { | ||
var e_1, _a; | ||
/** @type {?} */ | ||
var listeners = new Map(); | ||
try { | ||
for (var _b = __values(this.eventNames), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var name_1 = _c.value; | ||
/** @type {?} */ | ||
var listenerFn = this.addEventListener(instance, animationItem, name_1); | ||
// We don't have to save `destroy` listener, because `AnimationItem` | ||
// is able to remove `destroy` event listener itself | ||
if (name_1 !== 'destroy') { | ||
listeners.set(name_1, listenerFn); | ||
} | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return listeners; | ||
}; | ||
/** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
*/ | ||
/** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
* @private | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @param {?} animationCreated | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.animationCreated = /** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
LottieEventsFacade.prototype.addEventListener = /** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @param {?} animationCreated | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
function (animationItem, animationCreated) { | ||
animationCreated.emit(animationItem); | ||
function (instance, animationItem, name) { | ||
/** @type {?} */ | ||
var listenerFn = this.handleEventClosure(instance, name); | ||
// `AnimationItem` triggers different events every ms, we have to listen | ||
// them outside Angular's context, thus it won't affect performance | ||
this.ngZone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { | ||
animationItem.addEventListener(name, listenerFn); | ||
})); | ||
return listenerFn; | ||
}; | ||
/** | ||
* @param {?} animationItem | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.setAnimationItemAndLottieEventListeners = /** | ||
* @param {?} animationItem | ||
LottieEventsFacade.prototype.handleEventClosure = /** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
function (animationItem, instance) { | ||
function (instance, name) { | ||
var _this = this; | ||
this.animationItem = animationItem; | ||
// `AnimationItem` triggers different events every ms, we have to listen | ||
// them outside Angular's context, thus it won't affect performance | ||
this.zone.runOutsideAngular((/** | ||
return (/** | ||
* @param {?} event | ||
* @return {?} | ||
*/ | ||
function () { return _this.setupLottieEventListeners(instance); })); | ||
function (event) { | ||
/** @type {?} */ | ||
var emitter = _this.retrieveEventEmitter(instance, name); | ||
emitter.emit(event); | ||
}); | ||
}; | ||
/** | ||
* @param name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @returns - Resolved event name in the `camelCase` | ||
*/ | ||
/** | ||
* @private | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
*/ | ||
LottieEventsFacade.prototype.camelizeNativeEventName = /** | ||
* @private | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
*/ | ||
function (name) { | ||
return this.eventsMap[name]; | ||
}; | ||
/** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.setupLottieEventListeners = /** | ||
LottieEventsFacade.prototype.retrieveEventEmitter = /** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
function (instance) { | ||
var e_1, _a; | ||
try { | ||
for (var lottieEvents_1 = __values(lottieEvents), lottieEvents_1_1 = lottieEvents_1.next(); !lottieEvents_1_1.done; lottieEvents_1_1 = lottieEvents_1.next()) { | ||
var lottieEvent = lottieEvents_1_1.value; | ||
this.setupLottieEventListener(lottieEvent, instance); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (lottieEvents_1_1 && !lottieEvents_1_1.done && (_a = lottieEvents_1.return)) _a.call(lottieEvents_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
function (instance, name) { | ||
return (/** @type {?} */ (instance[this.camelizeNativeEventName(name)])); | ||
}; | ||
LottieEventsFacade.decorators = [ | ||
{ type: core.Injectable } | ||
]; | ||
/** @nocollapse */ | ||
LottieEventsFacade.ctorParameters = function () { return [ | ||
{ type: core.NgZone } | ||
]; }; | ||
return LottieEventsFacade; | ||
}()); | ||
if (false) { | ||
/** | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
* @type {?} | ||
* @private | ||
* @param {?} name | ||
*/ | ||
LottieEventsFacade.prototype.eventsMap; | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieEventsFacade.prototype.eventNames; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieEventsFacade.prototype.ngZone; | ||
} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
var LottieEventsService = /** @class */ (function () { | ||
function LottieEventsService(platformId, lottieEventsFacade) { | ||
this.platformId = platformId; | ||
this.lottieEventsFacade = lottieEventsFacade; | ||
this.animationItem = null; | ||
/** | ||
* Save listeners so we're able to remove them from `AnimationItem` | ||
* by references in the future when this service is destroyed | ||
*/ | ||
this.listeners = (/** @type {?} */ (null)); | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.ngOnDestroy = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.dispose(); | ||
}; | ||
/** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.setupLottieEventListener = /** | ||
* @private | ||
* @param {?} name | ||
LottieEventsService.prototype.bootstrapEventsService = /** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
function (name, instance) { | ||
/** @type {?} */ | ||
var emitter = getEventEmitterFromDirectiveInstance(instance, name); | ||
/** @type {?} */ | ||
var listener = (/** | ||
* @param {?} event | ||
* @return {?} | ||
*/ | ||
function (event) { return emitter.emit(event); }); | ||
(/** @type {?} */ (this.animationItem)).addEventListener(name, listener); | ||
// We don't have to save `destroy` listener, because `AnimationItem` | ||
// is able to remove `destroy` event listener itself | ||
if (name !== 'destroy') { | ||
this.listeners.set(name, listener); | ||
} | ||
function (instance, animationItem) { | ||
this.animationItem = animationItem; | ||
this.listeners = this.lottieEventsFacade.addEventListeners(instance, animationItem); | ||
}; | ||
@@ -620,3 +867,3 @@ /** | ||
function () { | ||
var e_2, _a; | ||
var e_1, _a; | ||
if (common.isPlatformServer(this.platformId)) { | ||
@@ -627,7 +874,7 @@ return; | ||
for (var _b = __values(this.listeners.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var _d = __read(_c.value, 2), name_1 = _d[0], callback = _d[1]; | ||
(/** @type {?} */ (this.animationItem)).removeEventListener(name_1, callback); | ||
var _d = __read(_c.value, 2), name_1 = _d[0], listenerFn = _d[1]; | ||
(/** @type {?} */ (this.animationItem)).removeEventListener(name_1, listenerFn); | ||
} | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
@@ -637,6 +884,4 @@ try { | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
// Release listeners as we don't need them | ||
this.listeners.clear(); | ||
// We cannot call `destroy` before removing event listeners | ||
@@ -646,2 +891,4 @@ // as after calling `destroy` - `removeEventListener` becomes unavailable | ||
this.animationItem = null; | ||
// Release listeners as we don't need them | ||
this.listeners.clear(); | ||
}; | ||
@@ -653,4 +900,4 @@ LottieEventsService.decorators = [ | ||
LottieEventsService.ctorParameters = function () { return [ | ||
{ type: core.NgZone }, | ||
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] } | ||
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }, | ||
{ type: LottieEventsFacade } | ||
]; }; | ||
@@ -676,3 +923,3 @@ return LottieEventsService; | ||
*/ | ||
LottieEventsService.prototype.zone; | ||
LottieEventsService.prototype.platformId; | ||
/** | ||
@@ -682,3 +929,3 @@ * @type {?} | ||
*/ | ||
LottieEventsService.prototype.platformId; | ||
LottieEventsService.prototype.lottieEventsFacade; | ||
} | ||
@@ -692,6 +939,4 @@ | ||
__extends(LottieDirective, _super); | ||
function LottieDirective(zone, platformId, host, lottieEventsService) { | ||
var _this = _super.call(this) || this; | ||
_this.zone = zone; | ||
_this.platformId = platformId; | ||
function LottieDirective(platformId, host, lottieEventsService, animationLoader) { | ||
var _this = _super.call(this, platformId, animationLoader) || this; | ||
_this.host = host; | ||
@@ -708,3 +953,3 @@ _this.lottieEventsService = lottieEventsService; | ||
function () { | ||
_super.prototype.loadAnimation.call(this, this.zone, this.platformId, this.lottieEventsService, this.host.nativeElement, this); | ||
_super.prototype.loadAnimation.call(this, this.host.nativeElement, this.lottieEventsService, this); | ||
}; | ||
@@ -719,6 +964,6 @@ LottieDirective.decorators = [ | ||
LottieDirective.ctorParameters = function () { return [ | ||
{ type: core.NgZone }, | ||
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }, | ||
{ type: core.ElementRef, decorators: [{ type: core.Self }] }, | ||
{ type: LottieEventsService, decorators: [{ type: core.Self }] } | ||
{ type: LottieEventsService, decorators: [{ type: core.Self }] }, | ||
{ type: AnimationLoader } | ||
]; }; | ||
@@ -732,12 +977,2 @@ return LottieDirective; | ||
*/ | ||
LottieDirective.prototype.zone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieDirective.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieDirective.prototype.host; | ||
@@ -757,7 +992,5 @@ /** | ||
__extends(LottieComponent, _super); | ||
function LottieComponent(zone, renderer, platformId, lottieEventsService) { | ||
var _this = _super.call(this) || this; | ||
_this.zone = zone; | ||
function LottieComponent(renderer, platformId, lottieEventsService, animationLoader) { | ||
var _this = _super.call(this, platformId, animationLoader) || this; | ||
_this.renderer = renderer; | ||
_this.platformId = platformId; | ||
_this.lottieEventsService = lottieEventsService; | ||
@@ -787,3 +1020,3 @@ _this.container = (/** @type {?} */ (null)); | ||
function () { | ||
_super.prototype.loadAnimation.call(this, this.zone, this.platformId, this.lottieEventsService, this.container.nativeElement, this); | ||
_super.prototype.loadAnimation.call(this, this.container.nativeElement, this.lottieEventsService, this); | ||
}; | ||
@@ -800,6 +1033,6 @@ LottieComponent.decorators = [ | ||
LottieComponent.ctorParameters = function () { return [ | ||
{ type: core.NgZone }, | ||
{ type: core.Renderer2 }, | ||
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }, | ||
{ type: LottieEventsService, decorators: [{ type: core.Self }] } | ||
{ type: LottieEventsService, decorators: [{ type: core.Self }] }, | ||
{ type: AnimationLoader } | ||
]; }; | ||
@@ -818,7 +1051,2 @@ LottieComponent.propDecorators = { | ||
*/ | ||
LottieComponent.prototype.zone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieComponent.prototype.renderer; | ||
@@ -829,7 +1057,2 @@ /** | ||
*/ | ||
LottieComponent.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieComponent.prototype.lottieEventsService; | ||
@@ -845,2 +1068,23 @@ } | ||
} | ||
/** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
LottieModule.forRoot = /** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
function (options) { | ||
return { | ||
ngModule: LottieModule, | ||
providers: [ | ||
AnimationLoader, | ||
LottieEventsFacade, | ||
{ | ||
provide: LOTTIE_PLAYER_FACTORY_OR_LOADER, | ||
useValue: options.player | ||
} | ||
] | ||
}; | ||
}; | ||
LottieModule.decorators = [ | ||
@@ -917,3 +1161,6 @@ { type: core.NgModule, args: [{ | ||
exports.transformAnimationFilenameToKey = transformAnimationFilenameToKey; | ||
exports.ɵa = LottieEventsService; | ||
exports.ɵb = LOTTIE_PLAYER_FACTORY_OR_LOADER; | ||
exports.ɵc = AnimationLoader; | ||
exports.ɵd = LottieEventsService; | ||
exports.ɵe = LottieEventsFacade; | ||
@@ -920,0 +1167,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("ngx-lottie",["exports","@angular/core","@angular/common","@angular/platform-browser"],e):e((t=t||self)["ngx-lottie"]={},t.ng.core,t.ng.common,t.ng.platformBrowser)}(this,(function(t,e,n,r){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function l(t,e,n){var r=function(t,e){var n={container:e,renderer:"svg",loop:!0,autoplay:!0};return Object.assign(n,t)}(e,n),o=require("lottie-web/build/player/lottie.js");return t.runOutsideAngular((function(){return o.loadAnimation(r)}))}var u={complete:"complete",loopComplete:"loopComplete",enterFrame:"enterFrame",segmentStart:"segmentStart",config_ready:"configReady",data_ready:"dataReady",data_failed:"dataFailed",loaded_images:"loadedImages",DOMLoaded:"domLoaded",destroy:"destroy"};function p(t,e){return t[function(t){return u[t]}(e)]}var c=["complete","loopComplete","enterFrame","segmentStart","config_ready","data_ready","data_failed","loaded_images","DOMLoaded","destroy"],d=function(){function t(){this.options=null,this.containerClass=null,this.styles=null,this.width=null,this.height=null,this.animationCreated=new e.EventEmitter,this.complete=new e.EventEmitter,this.loopComplete=new e.EventEmitter,this.enterFrame=new e.EventEmitter,this.segmentStart=new e.EventEmitter,this.configReady=new e.EventEmitter,this.dataReady=new e.EventEmitter,this.dataFailed=new e.EventEmitter,this.loadedImages=new e.EventEmitter,this.domLoaded=new e.EventEmitter,this.destroy=new e.EventEmitter}return t.prototype.loadAnimation=function(t,e,r,o,i){if(!n.isPlatformServer(e)){var a=l(t,this.options,o);r.animationCreated(a,this.animationCreated),r.setAnimationItemAndLottieEventListeners(a,i)}},t.decorators=[{type:e.Directive,args:[{selector:"[lottie]"}]}],t.propDecorators={options:[{type:e.Input}],containerClass:[{type:e.Input}],styles:[{type:e.Input}],width:[{type:e.Input}],height:[{type:e.Input}],animationCreated:[{type:e.Output}],complete:[{type:e.Output}],loopComplete:[{type:e.Output}],enterFrame:[{type:e.Output}],segmentStart:[{type:e.Output}],configReady:[{type:e.Output}],dataReady:[{type:e.Output}],dataFailed:[{type:e.Output}],loadedImages:[{type:e.Output}],domLoaded:[{type:e.Output}],destroy:[{type:e.Output}]},t}();var y=function(){function t(t,e){this.zone=t,this.platformId=e,this.animationItem=null,this.listeners=new Map}return t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.animationCreated=function(t,e){e.emit(t)},t.prototype.setAnimationItemAndLottieEventListeners=function(t,e){var n=this;this.animationItem=t,this.zone.runOutsideAngular((function(){return n.setupLottieEventListeners(e)}))},t.prototype.setupLottieEventListeners=function(t){var e,n;try{for(var r=a(c),o=r.next();!o.done;o=r.next()){var i=o.value;this.setupLottieEventListener(i,t)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.setupLottieEventListener=function(t,e){var n=p(e,t),r=function(t){return n.emit(t)};this.animationItem.addEventListener(t,r),"destroy"!==t&&this.listeners.set(t,r)},t.prototype.dispose=function(){var t,e;if(!n.isPlatformServer(this.platformId)){try{for(var r=a(this.listeners.entries()),o=r.next();!o.done;o=r.next()){var i=s(o.value,2),l=i[0],u=i[1];this.animationItem.removeEventListener(l,u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.listeners.clear(),this.animationItem.destroy(),this.animationItem=null}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t}();var m=function(t){function n(e,n,r,o){var i=t.call(this)||this;return i.zone=e,i.platformId=n,i.host=r,i.lottieEventsService=o,i}return i(n,t),n.prototype.ngOnInit=function(){t.prototype.loadAnimation.call(this,this.zone,this.platformId,this.lottieEventsService,this.host.nativeElement,this)},n.decorators=[{type:e.Directive,args:[{selector:"[lottie]",providers:[y]}]}],n.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:e.ElementRef,decorators:[{type:e.Self}]},{type:y,decorators:[{type:e.Self}]}]},n}(d);var f=function(t){function n(e,n,r,o){var i=t.call(this)||this;return i.zone=e,i.renderer=n,i.platformId=r,i.lottieEventsService=o,i.container=null,i}return i(n,t),n.prototype.ngOnChanges=function(t){void 0!==t.containerClass&&this.renderer.addClass(this.container.nativeElement,t.containerClass.currentValue)},n.prototype.ngOnInit=function(){t.prototype.loadAnimation.call(this,this.zone,this.platformId,this.lottieEventsService,this.container.nativeElement,this)},n.decorators=[{type:e.Component,args:[{selector:"ng-lottie",template:'\n <div\n #container\n [style.width.px]="width"\n [style.height.px]="height"\n style="margin: 0 auto"\n [ngStyle]="styles"\n ></div>\n ',changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[y]}]}],n.ctorParameters=function(){return[{type:e.NgZone},{type:e.Renderer2},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:y,decorators:[{type:e.Self}]}]},n.propDecorators={container:[{type:e.ViewChild,args:["container",{static:!0}]}]},n}(d);var h=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule],declarations:[d,m,f],exports:[d,m,f]}]}],t}();function v(t){return"animation-"+t.split(".json")[0]}var g=function(){function t(t){this.state=t}return t.prototype.get=function(t){var e=v(t),n=r.makeStateKey(e);return this.state.get(n,null)},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:r.TransferState}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(r.TransferState))},token:t,providedIn:"root"}),t}();t.BaseDirective=d,t.LottieComponent=f,t.LottieDirective=m,t.LottieModule=h,t.LottieTransferState=g,t.transformAnimationFilenameToKey=v,t.ɵa=y,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("ngx-lottie",["exports","@angular/core","@angular/common","rxjs","rxjs/operators","@angular/platform-browser"],e):e((t=t||self)["ngx-lottie"]={},t.ng.core,t.ng.common,t.rxjs,t.rxjs.operators,t.ng.platformBrowser)}(this,(function(t,e,r,n,o,i){"use strict";var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function s(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function p(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function l(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}var c=new e.InjectionToken("LottiePlayerOrLoader"),u=function(){function t(t,e,r){this.ngZone=t,this.platformId=e,this.playerFactoryOrLoader=r}return t.prototype.resolveLoaderAndLoadAnimation=function(t,e,n,o,i){var a=this;if(!r.isPlatformServer(this.platformId)){var s=this.resolveOptions(t,e);this.wrapPlayerOrLoaderIntoObservable().subscribe((function(t){a.loadAnimation(t,s,n,o,i)}))}},t.prototype.resolveOptions=function(t,e){var r={container:e,renderer:"svg",loop:!0,autoplay:!0};return Object.assign(r,t)},t.prototype.loadAnimation=function(t,e,r,n,o){var i=this.ngZone.runOutsideAngular((function(){return t.loadAnimation(e)}));n.emit(i),r.bootstrapEventsService(o,i)},t.prototype.wrapPlayerOrLoaderIntoObservable=function(){var t=this.playerFactoryOrLoader();return t instanceof Promise?n.from(t).pipe(o.map((function(t){return t.default||t})),o.catchError((function(t){return console.error('\n Could retrieve "lottie-web" player, did you provide\n the "player" property correctly?\n export function playerFactory() {\n return import(\'lottie-web\');\n }\n LottieModule.forRoot({ player: playerFactory })\n '),n.throwError(t)}))):n.of(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:void 0,decorators:[{type:e.Inject,args:[c]}]}]},t}();var d=function(){function t(t,r){this.platformId=t,this.animationLoader=r,this.options=null,this.containerClass=null,this.styles=null,this.width=null,this.height=null,this.animationCreated=new e.EventEmitter,this.complete=new e.EventEmitter,this.loopComplete=new e.EventEmitter,this.enterFrame=new e.EventEmitter,this.segmentStart=new e.EventEmitter,this.configReady=new e.EventEmitter,this.dataReady=new e.EventEmitter,this.domLoaded=new e.EventEmitter,this.destroy=new e.EventEmitter,this.error=new e.EventEmitter}return t.prototype.loadAnimation=function(t,e,n){r.isPlatformServer(this.platformId)||this.animationLoader.resolveLoaderAndLoadAnimation(this.options,t,e,this.animationCreated,n)},t.decorators=[{type:e.Directive,args:[{selector:"[lottie]"}]}],t.ctorParameters=function(){return[{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:u}]},t.propDecorators={options:[{type:e.Input}],containerClass:[{type:e.Input}],styles:[{type:e.Input}],width:[{type:e.Input}],height:[{type:e.Input}],animationCreated:[{type:e.Output}],complete:[{type:e.Output}],loopComplete:[{type:e.Output}],enterFrame:[{type:e.Output}],segmentStart:[{type:e.Output}],configReady:[{type:e.Output}],dataReady:[{type:e.Output}],domLoaded:[{type:e.Output}],destroy:[{type:e.Output}],error:[{type:e.Output}]},t}();var y=function(){function t(t){this.ngZone=t,this.eventsMap={complete:"complete",loopComplete:"loopComplete",enterFrame:"enterFrame",segmentStart:"segmentStart",config_ready:"configReady",data_ready:"dataReady",DOMLoaded:"domLoaded",destroy:"destroy",error:"error"},this.eventNames=["complete","loopComplete","enterFrame","segmentStart","config_ready","data_ready","DOMLoaded","destroy","error"]}return t.prototype.addEventListeners=function(t,e){var r,n,o=new Map;try{for(var i=p(this.eventNames),a=i.next();!a.done;a=i.next()){var s=a.value,l=this.addEventListener(t,e,s);"destroy"!==s&&o.set(s,l)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},t.prototype.addEventListener=function(t,e,r){var n=this.handleEventClosure(t,r);return this.ngZone.runOutsideAngular((function(){e.addEventListener(r,n)})),n},t.prototype.handleEventClosure=function(t,e){var r=this;return function(n){r.retrieveEventEmitter(t,e).emit(n)}},t.prototype.camelizeNativeEventName=function(t){return this.eventsMap[t]},t.prototype.retrieveEventEmitter=function(t,e){return t[this.camelizeNativeEventName(e)]},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone}]},t}();var f=function(){function t(t,e){this.platformId=t,this.lottieEventsFacade=e,this.animationItem=null,this.listeners=null}return t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.bootstrapEventsService=function(t,e){this.animationItem=e,this.listeners=this.lottieEventsFacade.addEventListeners(t,e)},t.prototype.dispose=function(){var t,e;if(!r.isPlatformServer(this.platformId)){try{for(var n=p(this.listeners.entries()),o=n.next();!o.done;o=n.next()){var i=l(o.value,2),a=i[0],s=i[1];this.animationItem.removeEventListener(a,s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.animationItem.destroy(),this.animationItem=null,this.listeners.clear()}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:y}]},t}();var m=function(t){function r(e,r,n,o){var i=t.call(this,e,o)||this;return i.host=r,i.lottieEventsService=n,i}return s(r,t),r.prototype.ngOnInit=function(){t.prototype.loadAnimation.call(this,this.host.nativeElement,this.lottieEventsService,this)},r.decorators=[{type:e.Directive,args:[{selector:"[lottie]",providers:[f]}]}],r.ctorParameters=function(){return[{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:e.ElementRef,decorators:[{type:e.Self}]},{type:f,decorators:[{type:e.Self}]},{type:u}]},r}(d);var v=function(t){function r(e,r,n,o){var i=t.call(this,r,o)||this;return i.renderer=e,i.lottieEventsService=n,i.container=null,i}return s(r,t),r.prototype.ngOnChanges=function(t){void 0!==t.containerClass&&this.renderer.addClass(this.container.nativeElement,t.containerClass.currentValue)},r.prototype.ngOnInit=function(){t.prototype.loadAnimation.call(this,this.container.nativeElement,this.lottieEventsService,this)},r.decorators=[{type:e.Component,args:[{selector:"ng-lottie",template:'\n <div\n #container\n [style.width.px]="width"\n [style.height.px]="height"\n style="margin: 0 auto"\n [ngStyle]="styles"\n ></div>\n ',changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[f]}]}],r.ctorParameters=function(){return[{type:e.Renderer2},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:f,decorators:[{type:e.Self}]},{type:u}]},r.propDecorators={container:[{type:e.ViewChild,args:["container",{static:!0}]}]},r}(d);var h=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[u,y,{provide:c,useValue:e.player}]}},t.decorators=[{type:e.NgModule,args:[{imports:[r.CommonModule],declarations:[d,m,v],exports:[d,m,v]}]}],t}();function g(t){return"animation-"+t.split(".json")[0]}var E=function(){function t(t){this.state=t}return t.prototype.get=function(t){var e=g(t),r=i.makeStateKey(e);return this.state.get(r,null)},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:i.TransferState}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(i.TransferState))},token:t,providedIn:"root"}),t}();t.BaseDirective=d,t.LottieComponent=v,t.LottieDirective=m,t.LottieModule=h,t.LottieTransferState=E,t.transformAnimationFilenameToKey=g,t.ɵb=c,t.ɵc=u,t.ɵd=f,t.ɵe=y,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-lottie.umd.min.js.map |
@@ -9,3 +9,6 @@ /** | ||
export { LottieModule, BaseDirective, LottieDirective, LottieComponent, LottieTransferState, transformAnimationFilenameToKey } from './index'; | ||
export { LottieEventsService as ɵa } from './src/core/services/lottie-events.service'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxvdHRpZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJuZ3gtbG90dGllLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvSUFBYyxTQUFTLENBQUM7QUFFeEIsT0FBTyxFQUFDLG1CQUFtQixJQUFJLEVBQUUsRUFBQyxNQUFNLDJDQUEyQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcblxuZXhwb3J0IHtMb3R0aWVFdmVudHNTZXJ2aWNlIGFzIMm1YX0gZnJvbSAnLi9zcmMvY29yZS9zZXJ2aWNlcy9sb3R0aWUtZXZlbnRzLnNlcnZpY2UnOyJdfQ== | ||
export { AnimationLoader as ɵc } from './src/animation-loader'; | ||
export { LottieEventsFacade as ɵe } from './src/events-facade'; | ||
export { LottieEventsService as ɵd } from './src/events.service'; | ||
export { LOTT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bHMnOyJdfQ== |
@@ -7,6 +7,26 @@ /** | ||
import { CommonModule } from '@angular/common'; | ||
import { BaseDirective } from './core/directives/base.directive'; | ||
import { LottieDirective } from './core/directives/lottie.directive'; | ||
import { LottieComponent } from './core/components/lottie.component'; | ||
import { BaseDirective } from './base.directive'; | ||
import { LottieEventsFacade } from './events-facade'; | ||
import { AnimationLoader } from './animation-loader'; | ||
import { LottieDirective } from './lottie.directive'; | ||
import { LottieComponent } from './lottie.component'; | ||
import { LOTTIE_PLAYER_FACTORY_OR_LOADER } from './symbols'; | ||
export class LottieModule { | ||
/** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
static forRoot(options) { | ||
return { | ||
ngModule: LottieModule, | ||
providers: [ | ||
AnimationLoader, | ||
LottieEventsFacade, | ||
{ | ||
provide: LOTTIE_PLAYER_FACTORY_OR_LOADER, | ||
useValue: options.player | ||
} | ||
] | ||
}; | ||
} | ||
} | ||
@@ -20,2 +40,2 @@ LottieModule.decorators = [ | ||
]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG90dGllLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvbG90dGllLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFL0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBQ2pFLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQUNyRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFPckUsTUFBTSxPQUFPLFlBQVk7OztZQUx4QixRQ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ICAgIHJldHVybiB7XG4gICAgICBuZ01vZHVsZTogTG90dGllTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgIEFuaW1hdGlvbkxvYWRlcixcbiAgICAgICAgTG90dGllRXZlbnRzRmFjYWRlLFxuICAgICAgICB7XG4gICAgICAgICAgcHJvdmlkZTogTE9UVElFX1BMQVlFUl9GQUNUT1JZX09SX0xPQURFUixcbiAgICAgICAgICB1c2VWYWx1ZTogb3B0aW9ucy5wbGF5ZXJcbiAgICAgICAgfVxuICAgICAgXVxuICAgIH07XG4gIH1cbn1cbiJdfQ== |
@@ -6,7 +6,7 @@ /** | ||
export { LottieModule } from './lottie.module'; | ||
export { BaseDirective } from './core/directives/base.directive'; | ||
export { LottieDirective } from './core/directives/lottie.directive'; | ||
export { LottieComponent } from './core/components/lottie.component'; | ||
export { LottieTransferState } from './core/services/lottie-transfer-state'; | ||
export { BaseDirective } from './base.directive'; | ||
export { LottieDirective } from './lottie.directive'; | ||
export { LottieComponent } from './lottie.component'; | ||
export { LottieTransferState } from './transfer-state'; | ||
export { transformAnimationFilenameToKey } from './utils'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQUNqRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFDckUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBQ3JFLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxN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25maWdFcnJvckV2ZW50LFxuICBMb3R0aWVPcHRpb25zLFxuICBBbmltYXRpb25GaWxlbmFtZVxufSBmcm9tICcuL3N5bWJvbHMnO1xuZXhwb3J0IHsgdHJhbnNmb3JtQW5pbWF0aW9uRmlsZW5hbWVUb0tleSB9IGZyb20gJy4vdXRpbHMnO1xuIl19 |
@@ -5,273 +5,6 @@ /** | ||
*/ | ||
import { InjectionToken } from '@angular/core'; | ||
/** | ||
* @record | ||
*/ | ||
export function LottieOptions() { } | ||
if (false) { | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.animationData; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.container; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.renderer; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.autoloadSegments; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.loop; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.autoplay; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.name; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.path; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.rendererSettings; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function Lottie() { } | ||
if (false) { | ||
/** | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.play = function (name) { }; | ||
/** | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.stop = function (name) { }; | ||
/** | ||
* @param {?} speed | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.setSpeed = function (speed, name) { }; | ||
/** | ||
* @param {?} direction | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.setDirection = function (direction, name) { }; | ||
/** | ||
* @param {?} quality | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.setQuality = function (quality) { }; | ||
/** | ||
* @param {?} params | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.loadAnimation = function (params) { }; | ||
/** | ||
* @param {?} element | ||
* @param {?=} animationData | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.registerAnimation = function (element, animationData) { }; | ||
/** | ||
* @param {?=} animationData | ||
* @param {?=} standalone | ||
* @param {?=} renderer | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.searchAnimations = function (animationData, standalone, renderer) { }; | ||
/** | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.destroy = function (name) { }; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function AnimationItem() { } | ||
if (false) { | ||
/** @type {?} */ | ||
AnimationItem.prototype.animType; | ||
/** @type {?} */ | ||
AnimationItem.prototype.animationData; | ||
/** @type {?} */ | ||
AnimationItem.prototype.animationID; | ||
/** @type {?} */ | ||
AnimationItem.prototype.assets; | ||
/** @type {?} */ | ||
AnimationItem.prototype.assetsPath; | ||
/** @type {?} */ | ||
AnimationItem.prototype.autoloadSegments; | ||
/** @type {?} */ | ||
AnimationItem.prototype.autoplay; | ||
/** @type {?} */ | ||
AnimationItem.prototype.currentFrame; | ||
/** @type {?} */ | ||
AnimationItem.prototype.currentRawFrame; | ||
/** @type {?} */ | ||
AnimationItem.prototype.fileName; | ||
/** @type {?} */ | ||
AnimationItem.prototype.firstFrame; | ||
/** @type {?} */ | ||
AnimationItem.prototype.frameModifier; | ||
/** @type {?} */ | ||
AnimationItem.prototype.frameMult; | ||
/** @type {?} */ | ||
AnimationItem.prototype.frameRate; | ||
/** @type {?} */ | ||
AnimationItem.prototype.isLoaded; | ||
/** @type {?} */ | ||
AnimationItem.prototype.isPaused; | ||
/** @type {?} */ | ||
AnimationItem.prototype.loop; | ||
/** @type {?} */ | ||
AnimationItem.prototype.name; | ||
/** @type {?} */ | ||
AnimationItem.prototype.path; | ||
/** @type {?} */ | ||
AnimationItem.prototype.playCount; | ||
/** @type {?} */ | ||
AnimationItem.prototype.playDirection; | ||
/** @type {?} */ | ||
AnimationItem.prototype.playSpeed; | ||
/** @type {?} */ | ||
AnimationItem.prototype.renderer; | ||
/** @type {?} */ | ||
AnimationItem.prototype.segmentPos; | ||
/** @type {?} */ | ||
AnimationItem.prototype.segments; | ||
/** @type {?} */ | ||
AnimationItem.prototype.subframeEnabled; | ||
/** @type {?} */ | ||
AnimationItem.prototype.timeCompleted; | ||
/** @type {?} */ | ||
AnimationItem.prototype.totalFrames; | ||
/** @type {?} */ | ||
AnimationItem.prototype.wrapper; | ||
/** @type {?} */ | ||
AnimationItem.prototype._cbs; | ||
/** @type {?} */ | ||
AnimationItem.prototype._completedLoop; | ||
/** @type {?} */ | ||
AnimationItem.prototype._idle; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.play = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.stop = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.pause = function () { }; | ||
/** | ||
* @param {?} speed | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setSpeed = function (speed) { }; | ||
/** | ||
* @param {?} flag | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setSubframe = function (flag) { }; | ||
/** | ||
* @param {?} value | ||
* @param {?} isFrame | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.goToAndPlay = function (value, isFrame) { }; | ||
/** | ||
* @param {?} value | ||
* @param {?} isFrame | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.goToAndStop = function (value, isFrame) { }; | ||
/** | ||
* @param {?} segments | ||
* @param {?} forceFlag | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.playSegments = function (segments, forceFlag) { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.destroy = function () { }; | ||
/** | ||
* @param {?} inFrames | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.getDuration = function (inFrames) { }; | ||
/** | ||
* @param {?} name | ||
* @param {?} callback | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.addEventListener = function (name, callback) { }; | ||
/** | ||
* @param {?} name | ||
* @param {?} callback | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.removeEventListener = function (name, callback) { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.hide = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.resize = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.show = function () { }; | ||
/** | ||
* @param {?} direction | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setDirection = function (direction) { }; | ||
/** | ||
* @param {?} animationData | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.configAnimation = function (animationData) { }; | ||
/** | ||
* @param {?} assetData | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.getAssetsPath = function (assetData) { }; | ||
/** | ||
* @param {?} id | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.getAssetData = function (id) { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.loadSegments = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.loadNextSegment = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.preloadImages = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.togglePause = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.renderFrame = function () { }; | ||
/** | ||
* @param {?} value | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setCurrentRawFrameValue = function (value) { }; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function BMEnterFrameEvent() { } | ||
@@ -334,2 +67,26 @@ if (false) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ltYm9scy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvc3ltYm9scy50cyJdLCJuYW1lcyI6W10sIm1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wgJ2NvbmZpZ19yZWFkeSdcbiAgfCAnZGF0YV9yZWFkeSdcbiAgfCAnZGF0YV9mYWlsZWQnXG4gIHwgJ2xvYWRlZF9pbWFnZXMnXG4gIHwgJ0RPTUxvYWRlZCdcbiAgfCAnZGVzdHJveSc7XG5cbmV4cG9ydCB0eXBlIE1hcHBlZExvdHRpZUV2ZW50TmFtZSA9XG4gIHwgJ2NvbXBsZXRlJ1xuICB8ICdsb29wQ29tcGxldGUnXG4gIHwgJ2VudGVyRnJhbWUnXG4gIHwgJ3NlZ21lbnRTdGFydCdcbiAgfCAnY29uZmlnUmVhZHknXG4gIHwgJ2RhdGFSZWFkeSdcbiAgfCAnZGF0YUZhaWxlZCdcbiAgfCAnbG9hZGVkSW1hZ2VzJ1xuICB8ICdkb21Mb2FkZWQnXG4gIHwgJ2Rlc3Ryb3knO1xuXG5leHBvcnQgdHlwZSBMb3R0aWVDU1NTdHlsZURlY2xhcmF0aW9uID0gUGFydGlhbDxDU1NTdHlsZURlY2xhcmF0aW9uPjtcblxuZXhwb3J0IHR5cGUgTG90dGllQ29udGFpbmVyQ2xhc3MgPVxuICB8IHN0cmluZ1xuICB8IHN0cmluZ1tdXG4gIHwgU2V0PHN0cmluZz5cbiAgfCB7IFtrbGFzczogc3RyaW5nXTogYW55IH1cbiAgfCBudWxsO1xuXG5leHBvcnQgdHlwZSBBbmltYXRpb25GaWxlbmFtZSA9IHN0cmluZztcbiJdfQ== | ||
/** | ||
* @record | ||
*/ | ||
export function BMRenderFrameErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.nativeError; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.currentTime; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function BMConfigErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.nativeError; | ||
} | ||
/** @type {?} */ | ||
export const LOTTIE_PLAYER_FACTORY_OR_LOADER = new InjectionToken('LottiePlayerOrLoader'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ltYm9scy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvc3ltYm9scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7OztBQUkvQyx1Q0FLQzs7O0lBSkMsd0NBQW9COztJQUNwQixxQ0FBaUI7O0lBQ2pCLHNDQUFrQjs7SUFDbEIsaUNBQW1COzs7OztBQUdyQix5Q0FLQzs7O0lBSkMsbUNBQXFCOztJQUNyQixtQ0FBYTs7SUFDYix3Q0FBa0I7O0lBQ2xCLHdDQUFrQjs7Ozs7QUFHcEIscUNBR0M7OztJQUZDLCtCQUFpQjs7SUFDakIsbUNBQWlCOzs7OztBQUduQix5Q0FJQzs7O0lBSEMsbUNBQXFCOztJQUNyQix5Q0FBbUI7O0lBQ25CLDBDQUFvQjs7Ozs7QUFHdEIsb0NBR0M7OztJQUZDLGdDQUFzQjs7SUFDdEIsOEJBQWdCOzs7OztBQUdsQiw2Q0FJQzs7O0lBSEMsdUNBQXlCOztJQUN6Qiw4Q0FBbUI7O0lBQ25CLDhDQUFvQjs7Ozs7QUFHdEIsd0NBR0M7OztJQUZDLGtDQUFvQjs7SUFDcEIseUNBQW1COzs7QUE2RHJCLE1BQU0sT0FBTywrQkFBK0IsR0FBRyxJQUFJLGNBQWMsQ0FDL0Qsc0JBQXNCLENBQ3ZCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuZXhwb3J0IHR5cGUgTG90dGllT3B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QVlFUl9GQUNUT1JZX09SX0xPQURFUiA9IG5ldyBJbmplY3Rpb25Ub2tlbjxMb3R0aWVQbGF5ZXJGYWN0b3J5T3JMb2FkZXI+KFxuICAnTG90dGllUGxheWVyT3JMb2FkZXInXG4pO1xuIl19 |
@@ -9,3 +9,6 @@ /** | ||
export { LottieModule, BaseDirective, LottieDirective, LottieComponent, LottieTransferState, transformAnimationFilenameToKey } from './index'; | ||
export { LottieEventsService as ɵa } from './src/core/services/lottie-events.service'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxvdHRpZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJuZ3gtbG90dGllLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvSUFBYyxTQUFTLENBQUM7QUFFeEIsT0FBTyxFQUFDLG1CQUFtQixJQUFJLEVBQUUsRUFBQyxNQUFNLDJDQUEyQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcblxuZXhwb3J0IHtMb3R0aWVFdmVudHNTZXJ2aWNlIGFzIMm1YX0gZnJvbSAnLi9zcmMvY29yZS9zZXJ2aWNlcy9sb3R0aWUtZXZlbnRzLnNlcnZpY2UnOyJdfQ== | ||
export { AnimationLoader as ɵc } from './src/animation-loader'; | ||
export { LottieEventsFacade as ɵe } from './src/events-facade'; | ||
export { LottieEventsService as ɵd } from './src/events.service'; | ||
export { LOTTIE_PLAYER_FACTORY_OR_LOADER as ɵb } from './src/symbols'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxvdHRpZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJuZ3gtbG90dGllLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvSUFBYyxTQUFTLENBQUM7QUFFeEIsT0FBTyxFQUFDLGVBQWUsSUFBSSxFQUFFLEVBQUMsTUFBTSx3QkFBd0IsQ0FBQztBQUM3RCxPQUFPLEVBQUMsa0JBQWtCLElBQUksRUFBRSxFQUFDLE1BQU0scUJBQXFCLENBQUM7QUFDN0QsT0FBTyxFQUFDLG1CQUFtQixJQUFJLEVBQUUsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQy9ELE9BQU8sRUFBQywrQkFBK0IsSUFBSSxFQUFFLEVBQW1DLE1BQU0sZUFBZSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcblxuZXhwb3J0IHtBbmltYXRpb25Mb2FkZXIgYXMgybVjfSBmcm9tICcuL3NyYy9hbmltYXRpb24tbG9hZGVyJztcbmV4cG9ydCB7TG90dGllRXZlbnRzRmFjYWRlIGFzIMm1ZX0gZnJvbSAnLi9zcmMvZXZlbnRzLWZhY2FkZSc7XG5leHBvcnQge0xvdHRpZUV2ZW50c1NlcnZpY2UgYXMgybVkfSBmcm9tICcuL3NyYy9ldmVudHMuc2VydmljZSc7XG5leHBvcnQge0xPVFRJRV9QTEFZRVJfRkFDVE9SWV9PUl9MT0FERVIgYXMgybViLExvdHRpZVBsYXllckZhY3RvcnlPckxvYWRlciBhcyDJtWF9IGZyb20gJy4vc3JjL3N5bWJvbHMnOyJdfQ== |
@@ -7,8 +7,32 @@ /** | ||
import { CommonModule } from '@angular/common'; | ||
import { BaseDirective } from './core/directives/base.directive'; | ||
import { LottieDirective } from './core/directives/lottie.directive'; | ||
import { LottieComponent } from './core/components/lottie.component'; | ||
import { BaseDirective } from './base.directive'; | ||
import { LottieEventsFacade } from './events-facade'; | ||
import { AnimationLoader } from './animation-loader'; | ||
import { LottieDirective } from './lottie.directive'; | ||
import { LottieComponent } from './lottie.component'; | ||
import { LOTTIE_PLAYER_FACTORY_OR_LOADER } from './symbols'; | ||
var LottieModule = /** @class */ (function () { | ||
function LottieModule() { | ||
} | ||
/** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
LottieModule.forRoot = /** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
function (options) { | ||
return { | ||
ngModule: LottieModule, | ||
providers: [ | ||
AnimationLoader, | ||
LottieEventsFacade, | ||
{ | ||
provide: LOTTIE_PLAYER_FACTORY_OR_LOADER, | ||
useValue: options.player | ||
} | ||
] | ||
}; | ||
}; | ||
LottieModule.decorators = [ | ||
@@ -24,2 +48,2 @@ { type: NgModule, args: [{ | ||
export { LottieModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG90dGllLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvbG90dGllLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFL0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBQ2pFLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQUNyRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFFckU7SUFBQTtJQUsyQixDQUFDOztnQkFMM0IsUUFBUSxTQUFDO29CQUNSLE9BQU8sRUFBRSxDQUFDLFlBQVksQ0FBQztvQ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VsZVdpdGhQcm92aWRlcnM8TG90dGllTW9kdWxlPiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBMb3R0aWVNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgQW5pbWF0aW9uTG9hZGVyLFxuICAgICAgICBMb3R0aWVFdmVudHNGYWNhZGUsXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBMT1RUSUVfUExBWUVSX0ZBQ1RPUllfT1JfTE9BREVSLFxuICAgICAgICAgIHVzZVZhbHVlOiBvcHRpb25zLnBsYXllclxuICAgICAgICB9XG4gICAgICBdXG4gICAgfTtcbiAgfVxufVxuIl19 |
@@ -6,7 +6,7 @@ /** | ||
export { LottieModule } from './lottie.module'; | ||
export { BaseDirective } from './core/directives/base.directive'; | ||
export { LottieDirective } from './core/directives/lottie.directive'; | ||
export { LottieComponent } from './core/components/lottie.component'; | ||
export { LottieTransferState } from './core/services/lottie-transfer-state'; | ||
export { BaseDirective } from './base.directive'; | ||
export { LottieDirective } from './lottie.directive'; | ||
export { LottieComponent } from './lottie.component'; | ||
export { LottieTransferState } from './transfer-state'; | ||
export { transformAnimationFilenameToKey } from './utils'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQUNqRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFDckUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLG9DQUFvQyxDQ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xuICBCTVJlbmRlckZyYW1lRXJyb3JFdmVudCxcbiAgQk1Db25maWdFcnJvckV2ZW50LFxuICBMb3R0aWVPcHRpb25zLFxuICBBbmltYXRpb25GaWxlbmFtZVxufSBmcm9tICcuL3N5bWJvbHMnO1xuZXhwb3J0IHsgdHJhbnNmb3JtQW5pbWF0aW9uRmlsZW5hbWVUb0tleSB9IGZyb20gJy4vdXRpbHMnO1xuIl19 |
@@ -5,273 +5,6 @@ /** | ||
*/ | ||
import { InjectionToken } from '@angular/core'; | ||
/** | ||
* @record | ||
*/ | ||
export function LottieOptions() { } | ||
if (false) { | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.animationData; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.container; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.renderer; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.autoloadSegments; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.loop; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.autoplay; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.name; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.path; | ||
/** @type {?|undefined} */ | ||
LottieOptions.prototype.rendererSettings; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function Lottie() { } | ||
if (false) { | ||
/** | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.play = function (name) { }; | ||
/** | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.stop = function (name) { }; | ||
/** | ||
* @param {?} speed | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.setSpeed = function (speed, name) { }; | ||
/** | ||
* @param {?} direction | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.setDirection = function (direction, name) { }; | ||
/** | ||
* @param {?} quality | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.setQuality = function (quality) { }; | ||
/** | ||
* @param {?} params | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.loadAnimation = function (params) { }; | ||
/** | ||
* @param {?} element | ||
* @param {?=} animationData | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.registerAnimation = function (element, animationData) { }; | ||
/** | ||
* @param {?=} animationData | ||
* @param {?=} standalone | ||
* @param {?=} renderer | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.searchAnimations = function (animationData, standalone, renderer) { }; | ||
/** | ||
* @param {?=} name | ||
* @return {?} | ||
*/ | ||
Lottie.prototype.destroy = function (name) { }; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function AnimationItem() { } | ||
if (false) { | ||
/** @type {?} */ | ||
AnimationItem.prototype.animType; | ||
/** @type {?} */ | ||
AnimationItem.prototype.animationData; | ||
/** @type {?} */ | ||
AnimationItem.prototype.animationID; | ||
/** @type {?} */ | ||
AnimationItem.prototype.assets; | ||
/** @type {?} */ | ||
AnimationItem.prototype.assetsPath; | ||
/** @type {?} */ | ||
AnimationItem.prototype.autoloadSegments; | ||
/** @type {?} */ | ||
AnimationItem.prototype.autoplay; | ||
/** @type {?} */ | ||
AnimationItem.prototype.currentFrame; | ||
/** @type {?} */ | ||
AnimationItem.prototype.currentRawFrame; | ||
/** @type {?} */ | ||
AnimationItem.prototype.fileName; | ||
/** @type {?} */ | ||
AnimationItem.prototype.firstFrame; | ||
/** @type {?} */ | ||
AnimationItem.prototype.frameModifier; | ||
/** @type {?} */ | ||
AnimationItem.prototype.frameMult; | ||
/** @type {?} */ | ||
AnimationItem.prototype.frameRate; | ||
/** @type {?} */ | ||
AnimationItem.prototype.isLoaded; | ||
/** @type {?} */ | ||
AnimationItem.prototype.isPaused; | ||
/** @type {?} */ | ||
AnimationItem.prototype.loop; | ||
/** @type {?} */ | ||
AnimationItem.prototype.name; | ||
/** @type {?} */ | ||
AnimationItem.prototype.path; | ||
/** @type {?} */ | ||
AnimationItem.prototype.playCount; | ||
/** @type {?} */ | ||
AnimationItem.prototype.playDirection; | ||
/** @type {?} */ | ||
AnimationItem.prototype.playSpeed; | ||
/** @type {?} */ | ||
AnimationItem.prototype.renderer; | ||
/** @type {?} */ | ||
AnimationItem.prototype.segmentPos; | ||
/** @type {?} */ | ||
AnimationItem.prototype.segments; | ||
/** @type {?} */ | ||
AnimationItem.prototype.subframeEnabled; | ||
/** @type {?} */ | ||
AnimationItem.prototype.timeCompleted; | ||
/** @type {?} */ | ||
AnimationItem.prototype.totalFrames; | ||
/** @type {?} */ | ||
AnimationItem.prototype.wrapper; | ||
/** @type {?} */ | ||
AnimationItem.prototype._cbs; | ||
/** @type {?} */ | ||
AnimationItem.prototype._completedLoop; | ||
/** @type {?} */ | ||
AnimationItem.prototype._idle; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.play = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.stop = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.pause = function () { }; | ||
/** | ||
* @param {?} speed | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setSpeed = function (speed) { }; | ||
/** | ||
* @param {?} flag | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setSubframe = function (flag) { }; | ||
/** | ||
* @param {?} value | ||
* @param {?} isFrame | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.goToAndPlay = function (value, isFrame) { }; | ||
/** | ||
* @param {?} value | ||
* @param {?} isFrame | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.goToAndStop = function (value, isFrame) { }; | ||
/** | ||
* @param {?} segments | ||
* @param {?} forceFlag | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.playSegments = function (segments, forceFlag) { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.destroy = function () { }; | ||
/** | ||
* @param {?} inFrames | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.getDuration = function (inFrames) { }; | ||
/** | ||
* @param {?} name | ||
* @param {?} callback | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.addEventListener = function (name, callback) { }; | ||
/** | ||
* @param {?} name | ||
* @param {?} callback | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.removeEventListener = function (name, callback) { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.hide = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.resize = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.show = function () { }; | ||
/** | ||
* @param {?} direction | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setDirection = function (direction) { }; | ||
/** | ||
* @param {?} animationData | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.configAnimation = function (animationData) { }; | ||
/** | ||
* @param {?} assetData | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.getAssetsPath = function (assetData) { }; | ||
/** | ||
* @param {?} id | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.getAssetData = function (id) { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.loadSegments = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.loadNextSegment = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.preloadImages = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.togglePause = function () { }; | ||
/** | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.renderFrame = function () { }; | ||
/** | ||
* @param {?} value | ||
* @return {?} | ||
*/ | ||
AnimationItem.prototype.setCurrentRawFrameValue = function (value) { }; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function BMEnterFrameEvent() { } | ||
@@ -334,2 +67,26 @@ if (false) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ltYm9scy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNl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bnRlckZyYW1lJ1xuICB8ICdzZWdtZW50U3RhcnQnXG4gIHwgJ2NvbmZpZ19yZWFkeSdcbiAgfCAnZGF0YV9yZWFkeSdcbiAgfCAnZGF0YV9mYWlsZWQnXG4gIHwgJ2xvYWRlZF9pbWFnZXMnXG4gIHwgJ0RPTUxvYWRlZCdcbiAgfCAnZGVzdHJveSc7XG5cbmV4cG9ydCB0eXBlIE1hcHBlZExvdHRpZUV2ZW50TmFtZSA9XG4gIHwgJ2NvbXBsZXRlJ1xuICB8ICdsb29wQ29tcGxldGUnXG4gIHwgJ2VudGVyRnJhbWUnXG4gIHwgJ3NlZ21lbnRTdGFydCdcbiAgfCAnY29uZmlnUmVhZHknXG4gIHwgJ2RhdGFSZWFkeSdcbiAgfCAnZGF0YUZhaWxlZCdcbiAgfCAnbG9hZGVkSW1hZ2VzJ1xuICB8ICdkb21Mb2FkZWQnXG4gIHwgJ2Rlc3Ryb3knO1xuXG5leHBvcnQgdHlwZSBMb3R0aWVDU1NTdHlsZURlY2xhcmF0aW9uID0gUGFydGlhbDxDU1NTdHlsZURlY2xhcmF0aW9uPjtcblxuZXhwb3J0IHR5cGUgTG90dGllQ29udGFpbmVyQ2xhc3MgPVxuICB8IHN0cmluZ1xuICB8IHN0cmluZ1tdXG4gIHwgU2V0PHN0cmluZz5cbiAgfCB7IFtrbGFzczogc3RyaW5nXTogYW55IH1cbiAgfCBudWxsO1xuXG5leHBvcnQgdHlwZSBBbmltYXRpb25GaWxlbmFtZSA9IHN0cmluZztcbiJdfQ== | ||
/** | ||
* @record | ||
*/ | ||
export function BMRenderFrameErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.nativeError; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.currentTime; | ||
} | ||
/** | ||
* @record | ||
*/ | ||
export function BMConfigErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.nativeError; | ||
} | ||
/** @type {?} */ | ||
export var LOTTIE_PLAYER_FACTORY_OR_LOADER = new InjectionToken('LottiePlayerOrLoader'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ltYm9scy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1sb3R0aWUvIiwic291cmNlcyI6WyJzcmMvc3ltYm9scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7OztBQUkvQyx1Q0FLQzs7O0lBSkMsd0NBQW9COztJQUNwQixxQ0FBaUI7O0lBQ2pCLHNDQUFrQjs7SUFDbEIsaUNBQW1COzs7OztBQUdyQix5Q0FLQzs7O0lBSkMsbUNBQXFCOztJQUNyQixtQ0FBYTs7SUFDYix3Q0FBa0I7O0lBQ2xCLHdDQUFrQjs7Ozs7QUFHcEIscUNBR0M7OztJQUZDLCtCQUFpQjs7SUFDakIsbUNBQWlCOzs7OztBQUduQix5Q0FJQzs7O0lBSEMsbUNBQXFCOztJQUNyQix5Q0FBbUI7O0lBQ25CLDBDQUFvQjs7Ozs7QUFHdEIsb0NBR0M7OztJQUZDLGdDQUFzQjs7SUFDdEIsOEJBQWdCOzs7OztBQUdsQiw2Q0FJQzs7O0lBSEMsdUNBQXlCOztJQUN6Qiw4Q0FBbUI7O0lBQ25CLDhDQUFvQjs7Ozs7QUFHdEIsd0NBR0M7OztJQUZDLGtDQUFvQjs7SUFDcEIseUNBQW1COzs7QUE2RHJCLE1BQU0sS0FBTywrQkFBK0IsR0FBRyxJQUFJLGNBQWMsQ0FDL0Qsc0JBQXNCLENBQ3ZCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW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dGllTG9hZGVyO1xuXG5leHBvcnQgY29uc3QgTE9UVElFX1BMQVlFUl9GQUNUT1JZX09SX0xPQURFUiA9IG5ldyBJbmplY3Rpb25Ub2tlbjxMb3R0aWVQbGF5ZXJGYWN0b3J5T3JMb2FkZXI+KFxuICAnTG90dGllUGxheWVyT3JMb2FkZXInXG4pO1xuIl19 |
@@ -1,3 +0,5 @@ | ||
import { EventEmitter, Directive, Input, Output, Injectable, NgZone, Inject, PLATFORM_ID, ElementRef, Self, Component, ChangeDetectionStrategy, Renderer2, ViewChild, NgModule, ɵɵdefineInjectable, ɵɵinject } from '@angular/core'; | ||
import { InjectionToken, Injectable, NgZone, Inject, PLATFORM_ID, EventEmitter, Directive, Input, Output, ElementRef, Self, Component, ChangeDetectionStrategy, Renderer2, ViewChild, NgModule, ɵɵdefineInjectable, ɵɵinject } from '@angular/core'; | ||
import { isPlatformServer, CommonModule } from '@angular/common'; | ||
import { from, throwError, of } from 'rxjs'; | ||
import { map, catchError } from 'rxjs/operators'; | ||
import { makeStateKey, TransferState } from '@angular/platform-browser'; | ||
@@ -10,87 +12,215 @@ | ||
/** | ||
* @return {?} | ||
* @record | ||
*/ | ||
function getLottiePlayer() { | ||
return require('lottie-web/build/player/lottie.js'); | ||
function BMEnterFrameEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.currentTime; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.duration; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.totalTime; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.type; | ||
} | ||
/** | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
* @record | ||
*/ | ||
function resolveOptions(options, container) { | ||
function BMCompleteLoopEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
const defaulOptions = { | ||
container, | ||
renderer: 'svg', | ||
loop: true, | ||
autoplay: true | ||
}; | ||
return Object.assign(defaulOptions, options); | ||
BMCompleteLoopEvent.prototype.type; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.loop; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.playCount; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.frameMult; | ||
} | ||
/** | ||
* @param {?} zone | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
* @record | ||
*/ | ||
function loadAnimation(zone, options, container) { | ||
function BMCompleteEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
const resolvedOptions = resolveOptions(options, container); | ||
BMCompleteEvent.prototype.type; | ||
/** @type {?} */ | ||
const player = getLottiePlayer(); | ||
return zone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
() => player.loadAnimation(resolvedOptions))); | ||
BMCompleteEvent.prototype.duration; | ||
} | ||
/** | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
* @type {?} | ||
* @record | ||
*/ | ||
const eventsMap = { | ||
complete: 'complete', | ||
loopComplete: 'loopComplete', | ||
enterFrame: 'enterFrame', | ||
segmentStart: 'segmentStart', | ||
config_ready: 'configReady', | ||
data_ready: 'dataReady', | ||
data_failed: 'dataFailed', | ||
loaded_images: 'loadedImages', | ||
DOMLoaded: 'domLoaded', | ||
destroy: 'destroy' | ||
}; | ||
function BMSegmentStartEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.type; | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.firstFrame; | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.totalFrames; | ||
} | ||
/** | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
* @record | ||
*/ | ||
function mapEventToCamelCase(name) { | ||
return eventsMap[name]; | ||
function BMDestroyEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMDestroyEvent.prototype.target; | ||
/** @type {?} */ | ||
BMDestroyEvent.prototype.type; | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
* @record | ||
*/ | ||
function getEventEmitterFromDirectiveInstance(instance, name) { | ||
return (/** @type {?} */ (instance[mapEventToCamelCase(name)])); | ||
function BMRenderFrameErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.nativeError; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.currentTime; | ||
} | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
* @type {?} | ||
* @record | ||
*/ | ||
const lottieEvents = [ | ||
'complete', | ||
'loopComplete', | ||
'enterFrame', | ||
'segmentStart', | ||
'config_ready', | ||
'data_ready', | ||
'data_failed', | ||
'loaded_images', | ||
'DOMLoaded', | ||
'destroy' | ||
function BMConfigErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.nativeError; | ||
} | ||
/** @type {?} */ | ||
const LOTTIE_PLAYER_FACTORY_OR_LOADER = new InjectionToken('LottiePlayerOrLoader'); | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
class AnimationLoader { | ||
/** | ||
* @param {?} ngZone | ||
* @param {?} platformId | ||
* @param {?} playerFactoryOrLoader | ||
*/ | ||
constructor(ngZone, platformId, playerFactoryOrLoader) { | ||
this.ngZone = ngZone; | ||
this.platformId = platformId; | ||
this.playerFactoryOrLoader = playerFactoryOrLoader; | ||
} | ||
/** | ||
* @param {?} options | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
resolveLoaderAndLoadAnimation(options, container, lottieEventsService, animationCreated, instance) { | ||
if (isPlatformServer(this.platformId)) { | ||
return; | ||
} | ||
/** @type {?} */ | ||
const resolvedOptions = this.resolveOptions(options, container); | ||
this.wrapPlayerOrLoaderIntoObservable().subscribe((/** | ||
* @param {?} player | ||
* @return {?} | ||
*/ | ||
player => { | ||
this.loadAnimation(player, resolvedOptions, lottieEventsService, animationCreated, instance); | ||
})); | ||
} | ||
/** | ||
* @private | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
*/ | ||
resolveOptions(options, container) { | ||
/** @type {?} */ | ||
const defaultOptions = { | ||
container, | ||
renderer: 'svg', | ||
loop: true, | ||
autoplay: true | ||
}; | ||
return Object.assign(defaultOptions, options); | ||
} | ||
/** | ||
* @private | ||
* @param {?} player | ||
* @param {?} options | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
loadAnimation(player, options, lottieEventsService, animationCreated, instance) { | ||
/** @type {?} */ | ||
const animationItem = this.ngZone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
() => player.loadAnimation(options))); | ||
// Dispatch `animationCreated` event after animation is loaded successfully | ||
animationCreated.emit(animationItem); | ||
lottieEventsService.bootstrapEventsService(instance, animationItem); | ||
} | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
wrapPlayerOrLoaderIntoObservable() { | ||
/** @type {?} */ | ||
const playerOrLoader = this.playerFactoryOrLoader(); | ||
if (playerOrLoader instanceof Promise) { | ||
return from(playerOrLoader).pipe(map((/** | ||
* @param {?} module | ||
* @return {?} | ||
*/ | ||
module => module.default || module)), catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
error => { | ||
console.error(` | ||
Could retrieve "lottie-web" player, did you provide | ||
the "player" property correctly? | ||
export function playerFactory() { | ||
return import('lottie-web'); | ||
} | ||
LottieModule.forRoot({ player: playerFactory }) | ||
`); | ||
return throwError(error); | ||
}))); | ||
} | ||
return of(playerOrLoader); | ||
} | ||
} | ||
AnimationLoader.decorators = [ | ||
{ type: Injectable } | ||
]; | ||
/** @nocollapse */ | ||
AnimationLoader.ctorParameters = () => [ | ||
{ type: NgZone }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: Inject, args: [LOTTIE_PLAYER_FACTORY_OR_LOADER,] }] } | ||
]; | ||
if (false) { | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.ngZone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.playerFactoryOrLoader; | ||
} | ||
@@ -102,3 +232,9 @@ /** | ||
class BaseDirective { | ||
constructor() { | ||
/** | ||
* @param {?} platformId | ||
* @param {?} animationLoader | ||
*/ | ||
constructor(platformId, animationLoader) { | ||
this.platformId = platformId; | ||
this.animationLoader = animationLoader; | ||
this.options = null; | ||
@@ -140,13 +276,2 @@ this.containerClass = null; | ||
/** | ||
* Original event name is `data_failed`. `data_failed` can be dispatched | ||
* if the `XMLHttpRequest`, that tried to load animation data using | ||
* provided `path`, has errored | ||
*/ | ||
this.dataFailed = new EventEmitter(); | ||
/** | ||
* Original event name is `loaded_images`. `loaded_images` can be | ||
* dispatched after all assets are preloaded | ||
*/ | ||
this.loadedImages = new EventEmitter(); | ||
/** | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
@@ -161,20 +286,20 @@ * when elements have been added to the DOM | ||
this.destroy = new EventEmitter(); | ||
/** | ||
* `error` will be dispatched if the lottie player could not render | ||
* some frame or parse config | ||
*/ | ||
this.error = new EventEmitter(); | ||
} | ||
/** | ||
* @protected | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} container | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
loadAnimation(zone, platformId, lottieEventsService, container, instance) { | ||
if (isPlatformServer(platformId)) { | ||
loadAnimation(container, lottieEventsService, instance) { | ||
if (isPlatformServer(this.platformId)) { | ||
return; | ||
} | ||
/** @type {?} */ | ||
const animationItem = loadAnimation(zone, this.options, container); | ||
lottieEventsService.animationCreated(animationItem, this.animationCreated); | ||
lottieEventsService.setAnimationItemAndLottieEventListeners(animationItem, instance); | ||
this.animationLoader.resolveLoaderAndLoadAnimation(this.options, container, lottieEventsService, this.animationCreated, instance); | ||
} | ||
@@ -185,2 +310,7 @@ } | ||
]; | ||
/** @nocollapse */ | ||
BaseDirective.ctorParameters = () => [ | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: AnimationLoader } | ||
]; | ||
BaseDirective.propDecorators = { | ||
@@ -199,6 +329,5 @@ options: [{ type: Input }], | ||
dataReady: [{ type: Output }], | ||
dataFailed: [{ type: Output }], | ||
loadedImages: [{ type: Output }], | ||
domLoaded: [{ type: Output }], | ||
destroy: [{ type: Output }] | ||
destroy: [{ type: Output }], | ||
error: [{ type: Output }] | ||
}; | ||
@@ -254,26 +383,29 @@ if (false) { | ||
/** | ||
* Original event name is `data_failed`. `data_failed` can be dispatched | ||
* if the `XMLHttpRequest`, that tried to load animation data using | ||
* provided `path`, has errored | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
* when elements have been added to the DOM | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.dataFailed; | ||
BaseDirective.prototype.domLoaded; | ||
/** | ||
* Original event name is `loaded_images`. `loaded_images` can be | ||
* dispatched after all assets are preloaded | ||
* `destroy` will be dispatched in the `ngOnDestroy` hook of the service, | ||
* it's useful for releasing resources | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.loadedImages; | ||
BaseDirective.prototype.destroy; | ||
/** | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
* when elements have been added to the DOM | ||
* `error` will be dispatched if the lottie player could not render | ||
* some frame or parse config | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.domLoaded; | ||
BaseDirective.prototype.error; | ||
/** | ||
* `destroy` will be dispatched in the `ngOnDestroy` hook of the service, | ||
* it's useful for releasing resources | ||
* @type {?} | ||
* @private | ||
*/ | ||
BaseDirective.prototype.destroy; | ||
BaseDirective.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
BaseDirective.prototype.animationLoader; | ||
} | ||
@@ -285,78 +417,175 @@ | ||
*/ | ||
class LottieEventsService { | ||
class LottieEventsFacade { | ||
/** | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} ngZone | ||
*/ | ||
constructor(zone, platformId) { | ||
this.zone = zone; | ||
this.platformId = platformId; | ||
this.animationItem = null; | ||
constructor(ngZone) { | ||
this.ngZone = ngZone; | ||
/** | ||
* Save listeners so we're able to remove them from `AnimationItem` | ||
* by references in the future when this service is destroyed | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
*/ | ||
this.listeners = new Map(); | ||
this.eventsMap = { | ||
complete: 'complete', | ||
loopComplete: 'loopComplete', | ||
enterFrame: 'enterFrame', | ||
segmentStart: 'segmentStart', | ||
config_ready: 'configReady', | ||
data_ready: 'dataReady', | ||
DOMLoaded: 'domLoaded', | ||
destroy: 'destroy', | ||
error: 'error' | ||
}; | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
*/ | ||
this.eventNames = [ | ||
'complete', | ||
'loopComplete', | ||
'enterFrame', | ||
'segmentStart', | ||
'config_ready', | ||
'data_ready', | ||
'DOMLoaded', | ||
'destroy', | ||
'error' | ||
]; | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
ngOnDestroy() { | ||
this.dispose(); | ||
addEventListeners(instance, animationItem) { | ||
/** @type {?} */ | ||
const listeners = new Map(); | ||
for (const name of this.eventNames) { | ||
/** @type {?} */ | ||
const listenerFn = this.addEventListener(instance, animationItem, name); | ||
// We don't have to save `destroy` listener, because `AnimationItem` | ||
// is able to remove `destroy` event listener itself | ||
if (name !== 'destroy') { | ||
listeners.set(name, listenerFn); | ||
} | ||
} | ||
return listeners; | ||
} | ||
/** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
* @private | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @param {?} animationCreated | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
animationCreated(animationItem, animationCreated) { | ||
animationCreated.emit(animationItem); | ||
addEventListener(instance, animationItem, name) { | ||
/** @type {?} */ | ||
const listenerFn = this.handleEventClosure(instance, name); | ||
// `AnimationItem` triggers different events every ms, we have to listen | ||
// them outside Angular's context, thus it won't affect performance | ||
this.ngZone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
() => { | ||
animationItem.addEventListener(name, listenerFn); | ||
})); | ||
return listenerFn; | ||
} | ||
/** | ||
* @param {?} animationItem | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
setAnimationItemAndLottieEventListeners(animationItem, instance) { | ||
this.animationItem = animationItem; | ||
// `AnimationItem` triggers different events every ms, we have to listen | ||
// them outside Angular's context, thus it won't affect performance | ||
this.zone.runOutsideAngular((/** | ||
handleEventClosure(instance, name) { | ||
return (/** | ||
* @param {?} event | ||
* @return {?} | ||
*/ | ||
() => this.setupLottieEventListeners(instance))); | ||
(event) => { | ||
/** @type {?} */ | ||
const emitter = this.retrieveEventEmitter(instance, name); | ||
emitter.emit(event); | ||
}); | ||
} | ||
/** | ||
* @private | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
*/ | ||
camelizeNativeEventName(name) { | ||
return this.eventsMap[name]; | ||
} | ||
/** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
setupLottieEventListeners(instance) { | ||
for (const lottieEvent of lottieEvents) { | ||
this.setupLottieEventListener(lottieEvent, instance); | ||
} | ||
retrieveEventEmitter(instance, name) { | ||
return (/** @type {?} */ (instance[this.camelizeNativeEventName(name)])); | ||
} | ||
} | ||
LottieEventsFacade.decorators = [ | ||
{ type: Injectable } | ||
]; | ||
/** @nocollapse */ | ||
LottieEventsFacade.ctorParameters = () => [ | ||
{ type: NgZone } | ||
]; | ||
if (false) { | ||
/** | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
* @type {?} | ||
* @private | ||
* @param {?} name | ||
*/ | ||
LottieEventsFacade.prototype.eventsMap; | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieEventsFacade.prototype.eventNames; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieEventsFacade.prototype.ngZone; | ||
} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
class LottieEventsService { | ||
/** | ||
* @param {?} platformId | ||
* @param {?} lottieEventsFacade | ||
*/ | ||
constructor(platformId, lottieEventsFacade) { | ||
this.platformId = platformId; | ||
this.lottieEventsFacade = lottieEventsFacade; | ||
this.animationItem = null; | ||
/** | ||
* Save listeners so we're able to remove them from `AnimationItem` | ||
* by references in the future when this service is destroyed | ||
*/ | ||
this.listeners = (/** @type {?} */ (null)); | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
ngOnDestroy() { | ||
this.dispose(); | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
setupLottieEventListener(name, instance) { | ||
/** @type {?} */ | ||
const emitter = getEventEmitterFromDirectiveInstance(instance, name); | ||
/** @type {?} */ | ||
const listener = (/** | ||
* @param {?} event | ||
* @return {?} | ||
*/ | ||
(event) => emitter.emit(event)); | ||
(/** @type {?} */ (this.animationItem)).addEventListener(name, listener); | ||
// We don't have to save `destroy` listener, because `AnimationItem` | ||
// is able to remove `destroy` event listener itself | ||
if (name !== 'destroy') { | ||
this.listeners.set(name, listener); | ||
} | ||
bootstrapEventsService(instance, animationItem) { | ||
this.animationItem = animationItem; | ||
this.listeners = this.lottieEventsFacade.addEventListeners(instance, animationItem); | ||
} | ||
@@ -371,7 +600,5 @@ /** | ||
} | ||
for (const [name, callback] of this.listeners.entries()) { | ||
(/** @type {?} */ (this.animationItem)).removeEventListener(name, callback); | ||
for (const [name, listenerFn] of this.listeners.entries()) { | ||
(/** @type {?} */ (this.animationItem)).removeEventListener(name, listenerFn); | ||
} | ||
// Release listeners as we don't need them | ||
this.listeners.clear(); | ||
// We cannot call `destroy` before removing event listeners | ||
@@ -381,2 +608,4 @@ // as after calling `destroy` - `removeEventListener` becomes unavailable | ||
this.animationItem = null; | ||
// Release listeners as we don't need them | ||
this.listeners.clear(); | ||
} | ||
@@ -389,4 +618,4 @@ } | ||
LottieEventsService.ctorParameters = () => [ | ||
{ type: NgZone }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: LottieEventsFacade } | ||
]; | ||
@@ -410,3 +639,3 @@ if (false) { | ||
*/ | ||
LottieEventsService.prototype.zone; | ||
LottieEventsService.prototype.platformId; | ||
/** | ||
@@ -416,3 +645,3 @@ * @type {?} | ||
*/ | ||
LottieEventsService.prototype.platformId; | ||
LottieEventsService.prototype.lottieEventsFacade; | ||
} | ||
@@ -426,11 +655,9 @@ | ||
/** | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} host | ||
* @param {?} lottieEventsService | ||
* @param {?} animationLoader | ||
*/ | ||
constructor(zone, platformId, host, lottieEventsService) { | ||
super(); | ||
this.zone = zone; | ||
this.platformId = platformId; | ||
constructor(platformId, host, lottieEventsService, animationLoader) { | ||
super(platformId, animationLoader); | ||
this.host = host; | ||
@@ -443,3 +670,3 @@ this.lottieEventsService = lottieEventsService; | ||
ngOnInit() { | ||
super.loadAnimation(this.zone, this.platformId, this.lottieEventsService, this.host.nativeElement, this); | ||
super.loadAnimation(this.host.nativeElement, this.lottieEventsService, this); | ||
} | ||
@@ -455,6 +682,6 @@ } | ||
LottieDirective.ctorParameters = () => [ | ||
{ type: NgZone }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: ElementRef, decorators: [{ type: Self }] }, | ||
{ type: LottieEventsService, decorators: [{ type: Self }] } | ||
{ type: LottieEventsService, decorators: [{ type: Self }] }, | ||
{ type: AnimationLoader } | ||
]; | ||
@@ -466,12 +693,2 @@ if (false) { | ||
*/ | ||
LottieDirective.prototype.zone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieDirective.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieDirective.prototype.host; | ||
@@ -491,12 +708,10 @@ /** | ||
/** | ||
* @param {?} zone | ||
* @param {?} renderer | ||
* @param {?} platformId | ||
* @param {?} lottieEventsService | ||
* @param {?} animationLoader | ||
*/ | ||
constructor(zone, renderer, platformId, lottieEventsService) { | ||
super(); | ||
this.zone = zone; | ||
constructor(renderer, platformId, lottieEventsService, animationLoader) { | ||
super(platformId, animationLoader); | ||
this.renderer = renderer; | ||
this.platformId = platformId; | ||
this.lottieEventsService = lottieEventsService; | ||
@@ -518,3 +733,3 @@ this.container = (/** @type {?} */ (null)); | ||
ngOnInit() { | ||
super.loadAnimation(this.zone, this.platformId, this.lottieEventsService, this.container.nativeElement, this); | ||
super.loadAnimation(this.container.nativeElement, this.lottieEventsService, this); | ||
} | ||
@@ -540,6 +755,6 @@ } | ||
LottieComponent.ctorParameters = () => [ | ||
{ type: NgZone }, | ||
{ type: Renderer2 }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: LottieEventsService, decorators: [{ type: Self }] } | ||
{ type: LottieEventsService, decorators: [{ type: Self }] }, | ||
{ type: AnimationLoader } | ||
]; | ||
@@ -556,7 +771,2 @@ LottieComponent.propDecorators = { | ||
*/ | ||
LottieComponent.prototype.zone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieComponent.prototype.renderer; | ||
@@ -567,7 +777,2 @@ /** | ||
*/ | ||
LottieComponent.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieComponent.prototype.lottieEventsService; | ||
@@ -581,2 +786,19 @@ } | ||
class LottieModule { | ||
/** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
static forRoot(options) { | ||
return { | ||
ngModule: LottieModule, | ||
providers: [ | ||
AnimationLoader, | ||
LottieEventsFacade, | ||
{ | ||
provide: LOTTIE_PLAYER_FACTORY_OR_LOADER, | ||
useValue: options.player | ||
} | ||
] | ||
}; | ||
} | ||
} | ||
@@ -658,3 +880,3 @@ LottieModule.decorators = [ | ||
export { BaseDirective, LottieComponent, LottieDirective, LottieModule, LottieTransferState, transformAnimationFilenameToKey, LottieEventsService as ɵa }; | ||
export { BaseDirective, LottieComponent, LottieDirective, LottieModule, LottieTransferState, transformAnimationFilenameToKey, LOTTIE_PLAYER_FACTORY_OR_LOADER as ɵb, AnimationLoader as ɵc, LottieEventsService as ɵd, LottieEventsFacade as ɵe }; | ||
//# sourceMappingURL=ngx-lottie.js.map |
@@ -1,3 +0,5 @@ | ||
import { EventEmitter, Directive, Input, Output, Injectable, NgZone, Inject, PLATFORM_ID, ElementRef, Self, Component, ChangeDetectionStrategy, Renderer2, ViewChild, NgModule, ɵɵdefineInjectable, ɵɵinject } from '@angular/core'; | ||
import { InjectionToken, Injectable, NgZone, Inject, PLATFORM_ID, EventEmitter, Directive, Input, Output, ElementRef, Self, Component, ChangeDetectionStrategy, Renderer2, ViewChild, NgModule, ɵɵdefineInjectable, ɵɵinject } from '@angular/core'; | ||
import { isPlatformServer, CommonModule } from '@angular/common'; | ||
import { from, throwError, of } from 'rxjs'; | ||
import { map, catchError } from 'rxjs/operators'; | ||
import { __values, __read, __extends } from 'tslib'; | ||
@@ -11,87 +13,85 @@ import { makeStateKey, TransferState } from '@angular/platform-browser'; | ||
/** | ||
* @return {?} | ||
* @record | ||
*/ | ||
function getLottiePlayer() { | ||
return require('lottie-web/build/player/lottie.js'); | ||
function BMEnterFrameEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.currentTime; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.duration; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.totalTime; | ||
/** @type {?} */ | ||
BMEnterFrameEvent.prototype.type; | ||
} | ||
/** | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
* @record | ||
*/ | ||
function resolveOptions(options, container) { | ||
function BMCompleteLoopEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
var defaulOptions = { | ||
container: container, | ||
renderer: 'svg', | ||
loop: true, | ||
autoplay: true | ||
}; | ||
return Object.assign(defaulOptions, options); | ||
BMCompleteLoopEvent.prototype.type; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.loop; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.playCount; | ||
/** @type {?} */ | ||
BMCompleteLoopEvent.prototype.frameMult; | ||
} | ||
/** | ||
* @param {?} zone | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
* @record | ||
*/ | ||
function loadAnimation(zone, options, container) { | ||
function BMCompleteEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
var resolvedOptions = resolveOptions(options, container); | ||
BMCompleteEvent.prototype.type; | ||
/** @type {?} */ | ||
var player = getLottiePlayer(); | ||
return zone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { return player.loadAnimation(resolvedOptions); })); | ||
BMCompleteEvent.prototype.duration; | ||
} | ||
/** | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
* @type {?} | ||
* @record | ||
*/ | ||
var eventsMap = { | ||
complete: 'complete', | ||
loopComplete: 'loopComplete', | ||
enterFrame: 'enterFrame', | ||
segmentStart: 'segmentStart', | ||
config_ready: 'configReady', | ||
data_ready: 'dataReady', | ||
data_failed: 'dataFailed', | ||
loaded_images: 'loadedImages', | ||
DOMLoaded: 'domLoaded', | ||
destroy: 'destroy' | ||
}; | ||
function BMSegmentStartEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.type; | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.firstFrame; | ||
/** @type {?} */ | ||
BMSegmentStartEvent.prototype.totalFrames; | ||
} | ||
/** | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
* @record | ||
*/ | ||
function mapEventToCamelCase(name) { | ||
return eventsMap[name]; | ||
function BMDestroyEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMDestroyEvent.prototype.target; | ||
/** @type {?} */ | ||
BMDestroyEvent.prototype.type; | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
* @record | ||
*/ | ||
function getEventEmitterFromDirectiveInstance(instance, name) { | ||
return (/** @type {?} */ (instance[mapEventToCamelCase(name)])); | ||
function BMRenderFrameErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.nativeError; | ||
/** @type {?} */ | ||
BMRenderFrameErrorEvent.prototype.currentTime; | ||
} | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
* @type {?} | ||
* @record | ||
*/ | ||
var lottieEvents = [ | ||
'complete', | ||
'loopComplete', | ||
'enterFrame', | ||
'segmentStart', | ||
'config_ready', | ||
'data_ready', | ||
'data_failed', | ||
'loaded_images', | ||
'DOMLoaded', | ||
'destroy' | ||
]; | ||
function BMConfigErrorEvent() { } | ||
if (false) { | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.type; | ||
/** @type {?} */ | ||
BMConfigErrorEvent.prototype.nativeError; | ||
} | ||
/** @type {?} */ | ||
var LOTTIE_PLAYER_FACTORY_OR_LOADER = new InjectionToken('LottiePlayerOrLoader'); | ||
@@ -102,4 +102,153 @@ /** | ||
*/ | ||
var AnimationLoader = /** @class */ (function () { | ||
function AnimationLoader(ngZone, platformId, playerFactoryOrLoader) { | ||
this.ngZone = ngZone; | ||
this.platformId = platformId; | ||
this.playerFactoryOrLoader = playerFactoryOrLoader; | ||
} | ||
/** | ||
* @param {?} options | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.resolveLoaderAndLoadAnimation = /** | ||
* @param {?} options | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
function (options, container, lottieEventsService, animationCreated, instance) { | ||
var _this = this; | ||
if (isPlatformServer(this.platformId)) { | ||
return; | ||
} | ||
/** @type {?} */ | ||
var resolvedOptions = this.resolveOptions(options, container); | ||
this.wrapPlayerOrLoaderIntoObservable().subscribe((/** | ||
* @param {?} player | ||
* @return {?} | ||
*/ | ||
function (player) { | ||
_this.loadAnimation(player, resolvedOptions, lottieEventsService, animationCreated, instance); | ||
})); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.resolveOptions = /** | ||
* @private | ||
* @param {?} options | ||
* @param {?} container | ||
* @return {?} | ||
*/ | ||
function (options, container) { | ||
/** @type {?} */ | ||
var defaultOptions = { | ||
container: container, | ||
renderer: 'svg', | ||
loop: true, | ||
autoplay: true | ||
}; | ||
return Object.assign(defaultOptions, options); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} player | ||
* @param {?} options | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.loadAnimation = /** | ||
* @private | ||
* @param {?} player | ||
* @param {?} options | ||
* @param {?} lottieEventsService | ||
* @param {?} animationCreated | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
function (player, options, lottieEventsService, animationCreated, instance) { | ||
/** @type {?} */ | ||
var animationItem = this.ngZone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { return player.loadAnimation(options); })); | ||
// Dispatch `animationCreated` event after animation is loaded successfully | ||
animationCreated.emit(animationItem); | ||
lottieEventsService.bootstrapEventsService(instance, animationItem); | ||
}; | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
AnimationLoader.prototype.wrapPlayerOrLoaderIntoObservable = /** | ||
* @private | ||
* @return {?} | ||
*/ | ||
function () { | ||
/** @type {?} */ | ||
var playerOrLoader = this.playerFactoryOrLoader(); | ||
if (playerOrLoader instanceof Promise) { | ||
return from(playerOrLoader).pipe(map((/** | ||
* @param {?} module | ||
* @return {?} | ||
*/ | ||
function (module) { return module.default || module; })), catchError((/** | ||
* @param {?} error | ||
* @return {?} | ||
*/ | ||
function (error) { | ||
console.error("\n Could retrieve \"lottie-web\" player, did you provide\n the \"player\" property correctly?\n export function playerFactory() {\n return import('lottie-web');\n }\n LottieModule.forRoot({ player: playerFactory })\n "); | ||
return throwError(error); | ||
}))); | ||
} | ||
return of(playerOrLoader); | ||
}; | ||
AnimationLoader.decorators = [ | ||
{ type: Injectable } | ||
]; | ||
/** @nocollapse */ | ||
AnimationLoader.ctorParameters = function () { return [ | ||
{ type: NgZone }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: Inject, args: [LOTTIE_PLAYER_FACTORY_OR_LOADER,] }] } | ||
]; }; | ||
return AnimationLoader; | ||
}()); | ||
if (false) { | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.ngZone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
AnimationLoader.prototype.playerFactoryOrLoader; | ||
} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
var BaseDirective = /** @class */ (function () { | ||
function BaseDirective() { | ||
function BaseDirective(platformId, animationLoader) { | ||
this.platformId = platformId; | ||
this.animationLoader = animationLoader; | ||
this.options = null; | ||
@@ -141,13 +290,2 @@ this.containerClass = null; | ||
/** | ||
* Original event name is `data_failed`. `data_failed` can be dispatched | ||
* if the `XMLHttpRequest`, that tried to load animation data using | ||
* provided `path`, has errored | ||
*/ | ||
this.dataFailed = new EventEmitter(); | ||
/** | ||
* Original event name is `loaded_images`. `loaded_images` can be | ||
* dispatched after all assets are preloaded | ||
*/ | ||
this.loadedImages = new EventEmitter(); | ||
/** | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
@@ -162,9 +300,12 @@ * when elements have been added to the DOM | ||
this.destroy = new EventEmitter(); | ||
/** | ||
* `error` will be dispatched if the lottie player could not render | ||
* some frame or parse config | ||
*/ | ||
this.error = new EventEmitter(); | ||
} | ||
/** | ||
* @protected | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} container | ||
* @param {?} instance | ||
@@ -175,17 +316,12 @@ * @return {?} | ||
* @protected | ||
* @param {?} zone | ||
* @param {?} platformId | ||
* @param {?} container | ||
* @param {?} lottieEventsService | ||
* @param {?} container | ||
* @param {?} instance | ||
* @return {?} | ||
*/ | ||
function (zone, platformId, lottieEventsService, container, instance) { | ||
if (isPlatformServer(platformId)) { | ||
function (container, lottieEventsService, instance) { | ||
if (isPlatformServer(this.platformId)) { | ||
return; | ||
} | ||
/** @type {?} */ | ||
var animationItem = loadAnimation(zone, this.options, container); | ||
lottieEventsService.animationCreated(animationItem, this.animationCreated); | ||
lottieEventsService.setAnimationItemAndLottieEventListeners(animationItem, instance); | ||
this.animationLoader.resolveLoaderAndLoadAnimation(this.options, container, lottieEventsService, this.animationCreated, instance); | ||
}; | ||
@@ -195,2 +331,7 @@ BaseDirective.decorators = [ | ||
]; | ||
/** @nocollapse */ | ||
BaseDirective.ctorParameters = function () { return [ | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: AnimationLoader } | ||
]; }; | ||
BaseDirective.propDecorators = { | ||
@@ -209,6 +350,5 @@ options: [{ type: Input }], | ||
dataReady: [{ type: Output }], | ||
dataFailed: [{ type: Output }], | ||
loadedImages: [{ type: Output }], | ||
domLoaded: [{ type: Output }], | ||
destroy: [{ type: Output }] | ||
destroy: [{ type: Output }], | ||
error: [{ type: Output }] | ||
}; | ||
@@ -266,26 +406,29 @@ return BaseDirective; | ||
/** | ||
* Original event name is `data_failed`. `data_failed` can be dispatched | ||
* if the `XMLHttpRequest`, that tried to load animation data using | ||
* provided `path`, has errored | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
* when elements have been added to the DOM | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.dataFailed; | ||
BaseDirective.prototype.domLoaded; | ||
/** | ||
* Original event name is `loaded_images`. `loaded_images` can be | ||
* dispatched after all assets are preloaded | ||
* `destroy` will be dispatched in the `ngOnDestroy` hook of the service, | ||
* it's useful for releasing resources | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.loadedImages; | ||
BaseDirective.prototype.destroy; | ||
/** | ||
* Original event name is `DOMLoaded`. `DOMLoaded` is dispatched | ||
* when elements have been added to the DOM | ||
* `error` will be dispatched if the lottie player could not render | ||
* some frame or parse config | ||
* @type {?} | ||
*/ | ||
BaseDirective.prototype.domLoaded; | ||
BaseDirective.prototype.error; | ||
/** | ||
* `destroy` will be dispatched in the `ngOnDestroy` hook of the service, | ||
* it's useful for releasing resources | ||
* @type {?} | ||
* @private | ||
*/ | ||
BaseDirective.prototype.destroy; | ||
BaseDirective.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
BaseDirective.prototype.animationLoader; | ||
} | ||
@@ -297,116 +440,222 @@ | ||
*/ | ||
var LottieEventsService = /** @class */ (function () { | ||
function LottieEventsService(zone, platformId) { | ||
this.zone = zone; | ||
this.platformId = platformId; | ||
this.animationItem = null; | ||
var LottieEventsFacade = /** @class */ (function () { | ||
function LottieEventsFacade(ngZone) { | ||
this.ngZone = ngZone; | ||
/** | ||
* Save listeners so we're able to remove them from `AnimationItem` | ||
* by references in the future when this service is destroyed | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
*/ | ||
this.listeners = new Map(); | ||
this.eventsMap = { | ||
complete: 'complete', | ||
loopComplete: 'loopComplete', | ||
enterFrame: 'enterFrame', | ||
segmentStart: 'segmentStart', | ||
config_ready: 'configReady', | ||
data_ready: 'dataReady', | ||
DOMLoaded: 'domLoaded', | ||
destroy: 'destroy', | ||
error: 'error' | ||
}; | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
*/ | ||
this.eventNames = [ | ||
'complete', | ||
'loopComplete', | ||
'enterFrame', | ||
'segmentStart', | ||
'config_ready', | ||
'data_ready', | ||
'DOMLoaded', | ||
'destroy', | ||
'error' | ||
]; | ||
} | ||
/** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.ngOnDestroy = /** | ||
LottieEventsFacade.prototype.addEventListeners = /** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.dispose(); | ||
function (instance, animationItem) { | ||
var e_1, _a; | ||
/** @type {?} */ | ||
var listeners = new Map(); | ||
try { | ||
for (var _b = __values(this.eventNames), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var name_1 = _c.value; | ||
/** @type {?} */ | ||
var listenerFn = this.addEventListener(instance, animationItem, name_1); | ||
// We don't have to save `destroy` listener, because `AnimationItem` | ||
// is able to remove `destroy` event listener itself | ||
if (name_1 !== 'destroy') { | ||
listeners.set(name_1, listenerFn); | ||
} | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return listeners; | ||
}; | ||
/** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
*/ | ||
/** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
* @private | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @param {?} animationCreated | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.animationCreated = /** | ||
* This method is invoked after calling `loadAnimation` and dispatches the new one | ||
* created `AnimationItem` instance | ||
LottieEventsFacade.prototype.addEventListener = /** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @param {?} animationCreated | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
function (animationItem, animationCreated) { | ||
animationCreated.emit(animationItem); | ||
function (instance, animationItem, name) { | ||
/** @type {?} */ | ||
var listenerFn = this.handleEventClosure(instance, name); | ||
// `AnimationItem` triggers different events every ms, we have to listen | ||
// them outside Angular's context, thus it won't affect performance | ||
this.ngZone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { | ||
animationItem.addEventListener(name, listenerFn); | ||
})); | ||
return listenerFn; | ||
}; | ||
/** | ||
* @param {?} animationItem | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.setAnimationItemAndLottieEventListeners = /** | ||
* @param {?} animationItem | ||
LottieEventsFacade.prototype.handleEventClosure = /** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
function (animationItem, instance) { | ||
function (instance, name) { | ||
var _this = this; | ||
this.animationItem = animationItem; | ||
// `AnimationItem` triggers different events every ms, we have to listen | ||
// them outside Angular's context, thus it won't affect performance | ||
this.zone.runOutsideAngular((/** | ||
return (/** | ||
* @param {?} event | ||
* @return {?} | ||
*/ | ||
function () { return _this.setupLottieEventListeners(instance); })); | ||
function (event) { | ||
/** @type {?} */ | ||
var emitter = _this.retrieveEventEmitter(instance, name); | ||
emitter.emit(event); | ||
}); | ||
}; | ||
/** | ||
* @param name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @returns - Resolved event name in the `camelCase` | ||
*/ | ||
/** | ||
* @private | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
*/ | ||
LottieEventsFacade.prototype.camelizeNativeEventName = /** | ||
* @private | ||
* @param {?} name - Name of the event in the `snake_case` dispatched by Lottie | ||
* @return {?} - Resolved event name in the `camelCase` | ||
*/ | ||
function (name) { | ||
return this.eventsMap[name]; | ||
}; | ||
/** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.setupLottieEventListeners = /** | ||
LottieEventsFacade.prototype.retrieveEventEmitter = /** | ||
* @private | ||
* @param {?} instance | ||
* @param {?} name | ||
* @return {?} | ||
*/ | ||
function (instance) { | ||
var e_1, _a; | ||
try { | ||
for (var lottieEvents_1 = __values(lottieEvents), lottieEvents_1_1 = lottieEvents_1.next(); !lottieEvents_1_1.done; lottieEvents_1_1 = lottieEvents_1.next()) { | ||
var lottieEvent = lottieEvents_1_1.value; | ||
this.setupLottieEventListener(lottieEvent, instance); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (lottieEvents_1_1 && !lottieEvents_1_1.done && (_a = lottieEvents_1.return)) _a.call(lottieEvents_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
function (instance, name) { | ||
return (/** @type {?} */ (instance[this.camelizeNativeEventName(name)])); | ||
}; | ||
LottieEventsFacade.decorators = [ | ||
{ type: Injectable } | ||
]; | ||
/** @nocollapse */ | ||
LottieEventsFacade.ctorParameters = function () { return [ | ||
{ type: NgZone } | ||
]; }; | ||
return LottieEventsFacade; | ||
}()); | ||
if (false) { | ||
/** | ||
* Some dispatched events are in the `snake_case` registry, for convenience, | ||
* we create this object that will map event name to the `camelCase` registry | ||
* @type {?} | ||
* @private | ||
* @param {?} name | ||
*/ | ||
LottieEventsFacade.prototype.eventsMap; | ||
/** | ||
* Events that can be dispatched by `Animationitem` | ||
* @see https://github.com/airbnb/lottie-web#events | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieEventsFacade.prototype.eventNames; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieEventsFacade.prototype.ngZone; | ||
} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
var LottieEventsService = /** @class */ (function () { | ||
function LottieEventsService(platformId, lottieEventsFacade) { | ||
this.platformId = platformId; | ||
this.lottieEventsFacade = lottieEventsFacade; | ||
this.animationItem = null; | ||
/** | ||
* Save listeners so we're able to remove them from `AnimationItem` | ||
* by references in the future when this service is destroyed | ||
*/ | ||
this.listeners = (/** @type {?} */ (null)); | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.ngOnDestroy = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.dispose(); | ||
}; | ||
/** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
LottieEventsService.prototype.setupLottieEventListener = /** | ||
* @private | ||
* @param {?} name | ||
LottieEventsService.prototype.bootstrapEventsService = /** | ||
* @param {?} instance | ||
* @param {?} animationItem | ||
* @return {?} | ||
*/ | ||
function (name, instance) { | ||
/** @type {?} */ | ||
var emitter = getEventEmitterFromDirectiveInstance(instance, name); | ||
/** @type {?} */ | ||
var listener = (/** | ||
* @param {?} event | ||
* @return {?} | ||
*/ | ||
function (event) { return emitter.emit(event); }); | ||
(/** @type {?} */ (this.animationItem)).addEventListener(name, listener); | ||
// We don't have to save `destroy` listener, because `AnimationItem` | ||
// is able to remove `destroy` event listener itself | ||
if (name !== 'destroy') { | ||
this.listeners.set(name, listener); | ||
} | ||
function (instance, animationItem) { | ||
this.animationItem = animationItem; | ||
this.listeners = this.lottieEventsFacade.addEventListeners(instance, animationItem); | ||
}; | ||
@@ -422,3 +671,3 @@ /** | ||
function () { | ||
var e_2, _a; | ||
var e_1, _a; | ||
if (isPlatformServer(this.platformId)) { | ||
@@ -429,7 +678,7 @@ return; | ||
for (var _b = __values(this.listeners.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var _d = __read(_c.value, 2), name_1 = _d[0], callback = _d[1]; | ||
(/** @type {?} */ (this.animationItem)).removeEventListener(name_1, callback); | ||
var _d = __read(_c.value, 2), name_1 = _d[0], listenerFn = _d[1]; | ||
(/** @type {?} */ (this.animationItem)).removeEventListener(name_1, listenerFn); | ||
} | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
@@ -439,6 +688,4 @@ try { | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
// Release listeners as we don't need them | ||
this.listeners.clear(); | ||
// We cannot call `destroy` before removing event listeners | ||
@@ -448,2 +695,4 @@ // as after calling `destroy` - `removeEventListener` becomes unavailable | ||
this.animationItem = null; | ||
// Release listeners as we don't need them | ||
this.listeners.clear(); | ||
}; | ||
@@ -455,4 +704,4 @@ LottieEventsService.decorators = [ | ||
LottieEventsService.ctorParameters = function () { return [ | ||
{ type: NgZone }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: LottieEventsFacade } | ||
]; }; | ||
@@ -478,3 +727,3 @@ return LottieEventsService; | ||
*/ | ||
LottieEventsService.prototype.zone; | ||
LottieEventsService.prototype.platformId; | ||
/** | ||
@@ -484,3 +733,3 @@ * @type {?} | ||
*/ | ||
LottieEventsService.prototype.platformId; | ||
LottieEventsService.prototype.lottieEventsFacade; | ||
} | ||
@@ -494,6 +743,4 @@ | ||
__extends(LottieDirective, _super); | ||
function LottieDirective(zone, platformId, host, lottieEventsService) { | ||
var _this = _super.call(this) || this; | ||
_this.zone = zone; | ||
_this.platformId = platformId; | ||
function LottieDirective(platformId, host, lottieEventsService, animationLoader) { | ||
var _this = _super.call(this, platformId, animationLoader) || this; | ||
_this.host = host; | ||
@@ -510,3 +757,3 @@ _this.lottieEventsService = lottieEventsService; | ||
function () { | ||
_super.prototype.loadAnimation.call(this, this.zone, this.platformId, this.lottieEventsService, this.host.nativeElement, this); | ||
_super.prototype.loadAnimation.call(this, this.host.nativeElement, this.lottieEventsService, this); | ||
}; | ||
@@ -521,6 +768,6 @@ LottieDirective.decorators = [ | ||
LottieDirective.ctorParameters = function () { return [ | ||
{ type: NgZone }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: ElementRef, decorators: [{ type: Self }] }, | ||
{ type: LottieEventsService, decorators: [{ type: Self }] } | ||
{ type: LottieEventsService, decorators: [{ type: Self }] }, | ||
{ type: AnimationLoader } | ||
]; }; | ||
@@ -534,12 +781,2 @@ return LottieDirective; | ||
*/ | ||
LottieDirective.prototype.zone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieDirective.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieDirective.prototype.host; | ||
@@ -559,7 +796,5 @@ /** | ||
__extends(LottieComponent, _super); | ||
function LottieComponent(zone, renderer, platformId, lottieEventsService) { | ||
var _this = _super.call(this) || this; | ||
_this.zone = zone; | ||
function LottieComponent(renderer, platformId, lottieEventsService, animationLoader) { | ||
var _this = _super.call(this, platformId, animationLoader) || this; | ||
_this.renderer = renderer; | ||
_this.platformId = platformId; | ||
_this.lottieEventsService = lottieEventsService; | ||
@@ -589,3 +824,3 @@ _this.container = (/** @type {?} */ (null)); | ||
function () { | ||
_super.prototype.loadAnimation.call(this, this.zone, this.platformId, this.lottieEventsService, this.container.nativeElement, this); | ||
_super.prototype.loadAnimation.call(this, this.container.nativeElement, this.lottieEventsService, this); | ||
}; | ||
@@ -602,6 +837,6 @@ LottieComponent.decorators = [ | ||
LottieComponent.ctorParameters = function () { return [ | ||
{ type: NgZone }, | ||
{ type: Renderer2 }, | ||
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: LottieEventsService, decorators: [{ type: Self }] } | ||
{ type: LottieEventsService, decorators: [{ type: Self }] }, | ||
{ type: AnimationLoader } | ||
]; }; | ||
@@ -620,7 +855,2 @@ LottieComponent.propDecorators = { | ||
*/ | ||
LottieComponent.prototype.zone; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieComponent.prototype.renderer; | ||
@@ -631,7 +861,2 @@ /** | ||
*/ | ||
LottieComponent.prototype.platformId; | ||
/** | ||
* @type {?} | ||
* @private | ||
*/ | ||
LottieComponent.prototype.lottieEventsService; | ||
@@ -647,2 +872,23 @@ } | ||
} | ||
/** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
LottieModule.forRoot = /** | ||
* @param {?} options | ||
* @return {?} | ||
*/ | ||
function (options) { | ||
return { | ||
ngModule: LottieModule, | ||
providers: [ | ||
AnimationLoader, | ||
LottieEventsFacade, | ||
{ | ||
provide: LOTTIE_PLAYER_FACTORY_OR_LOADER, | ||
useValue: options.player | ||
} | ||
] | ||
}; | ||
}; | ||
LottieModule.decorators = [ | ||
@@ -728,3 +974,3 @@ { type: NgModule, args: [{ | ||
export { BaseDirective, LottieComponent, LottieDirective, LottieModule, LottieTransferState, transformAnimationFilenameToKey, LottieEventsService as ɵa }; | ||
export { BaseDirective, LottieComponent, LottieDirective, LottieModule, LottieTransferState, transformAnimationFilenameToKey, LOTTIE_PLAYER_FACTORY_OR_LOADER as ɵb, AnimationLoader as ɵc, LottieEventsService as ɵd, LottieEventsFacade as ɵe }; | ||
//# sourceMappingURL=ngx-lottie.js.map |
@@ -5,2 +5,5 @@ /** | ||
export * from './index'; | ||
export { LottieEventsService as ɵa } from './src/core/services/lottie-events.service'; | ||
export { AnimationLoader as ɵc } from './src/animation-loader'; | ||
export { LottieEventsFacade as ɵe } from './src/events-facade'; | ||
export { LottieEventsService as ɵd } from './src/events.service'; | ||
export { LOTTIE_PLAYER_FACTORY_OR_LOADER as ɵb, LottiePlayerFactoryOrLoader as ɵa } from './src/symbols'; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"LottieModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":12}],"declarations":[{"__symbolic":"reference","name":"BaseDirective"},{"__symbolic":"reference","name":"LottieDirective"},{"__symbolic":"reference","name":"LottieComponent"}],"exports":[{"__symbolic":"reference","name":"BaseDirective"},{"__symbolic":"reference","name":"LottieDirective"},{"__symbolic":"reference","name":"LottieComponent"}]}]}],"members":{}},"BaseDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":17,"character":1},"arguments":[{"selector":"[lottie]"}]}],"members":{"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"containerClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"styles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"width":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"animationCreated":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":32,"character":3}}]}],"complete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":37,"character":3}}]}],"loopComplete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":42,"character":3}}]}],"enterFrame":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":47,"character":3}}]}],"segmentStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"configReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":58,"character":3}}]}],"dataReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":64,"character":3}}]}],"dataFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":71,"character":3}}]}],"loadedImages":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":77,"character":3}}]}],"domLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":83,"character":3}}]}],"destroy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":89,"character":3}}]}],"loadAnimation":[{"__symbolic":"method"}]}},"LottieDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"BaseDirective"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":5,"character":1},"arguments":[{"selector":"[lottie]","providers":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":12,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":12,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":13,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":14,"character":5}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":11,"character":18},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":13,"character":37,"context":{"typeName":"HTMLElement"},"module":"./src/core/directives/lottie.directive"}]},{"__symbolic":"reference","name":"ɵa"}]}],"ngOnInit":[{"__symbolic":"method"}]}},"LottieComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"BaseDirective"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":18,"character":1},"arguments":[{"selector":"ng-lottie","template":"\n <div\n #container\n [style.width.px]=\"width\"\n [style.height.px]=\"height\"\n style=\"margin: 0 auto\"\n [ngStyle]=\"styles\"\n ></div>\n ","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":29,"character":19},"member":"OnPush"},"providers":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{"container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":33,"character":3},"arguments":["container",{"static":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":38,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":38,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":39,"character":5}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":36,"character":18},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":37,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ɵa"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}},"LottieTransferState":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"TransferState","line":8,"character":29}]}],"get":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"LottieOptions":{"__symbolic":"interface"},"Lottie":{"__symbolic":"interface"},"AnimationItem":{"__symbolic":"interface"},"BMEnterFrameEvent":{"__symbolic":"interface"},"BMCompleteLoopEvent":{"__symbolic":"interface"},"BMCompleteEvent":{"__symbolic":"interface"},"BMSegmentStartEvent":{"__symbolic":"interface"},"BMDestroyEvent":{"__symbolic":"interface"},"LottieEvent":{"__symbolic":"interface"},"LottieCSSStyleDeclaration":{"__symbolic":"interface"},"LottieContainerClass":{"__symbolic":"interface"},"AnimationFilename":{"__symbolic":"interface"},"transformAnimationFilenameToKey":{"__symbolic":"function","parameters":["animation"],"value":{"__symbolic":"binop","operator":"+","left":"animation-","right":{"__symbolic":"index","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"animation"},"member":"split"},"arguments":[".json"]},"index":0}}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":37},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":17,"character":44}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":17,"character":28},{"__symbolic":"reference","name":"string"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"animationCreated":[{"__symbolic":"method"}],"setAnimationItemAndLottieEventListeners":[{"__symbolic":"method"}],"setupLottieEventListeners":[{"__symbolic":"method"}],"setupLottieEventListener":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}]}}},"origins":{"LottieModule":"./src/lottie.module","BaseDirective":"./src/core/directives/base.directive","LottieDirective":"./src/core/directives/lottie.directive","LottieComponent":"./src/core/components/lottie.component","LottieTransferState":"./src/core/services/lottie-transfer-state","LottieOptions":"./src/symbols","Lottie":"./src/symbols","AnimationItem":"./src/symbols","BMEnterFrameEvent":"./src/symbols","BMCompleteLoopEvent":"./src/symbols","BMCompleteEvent":"./src/symbols","BMSegmentStartEvent":"./src/symbols","BMDestroyEvent":"./src/symbols","LottieEvent":"./src/symbols","LottieCSSStyleDeclaration":"./src/symbols","LottieContainerClass":"./src/symbols","AnimationFilename":"./src/symbols","transformAnimationFilenameToKey":"./src/utils","ɵa":"./src/core/services/lottie-events.service"},"importAs":"ngx-lottie"} | ||
{"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"interface"},"ɵb":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":103,"character":51},"arguments":["LottiePlayerOrLoader"]},"LottieModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":12}],"declarations":[{"__symbolic":"reference","name":"BaseDirective"},{"__symbolic":"reference","name":"LottieDirective"},{"__symbolic":"reference","name":"LottieComponent"}],"exports":[{"__symbolic":"reference","name":"BaseDirective"},{"__symbolic":"reference","name":"LottieDirective"},{"__symbolic":"reference","name":"LottieComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["options"],"value":{"ngModule":{"__symbolic":"reference","name":"LottieModule"},"providers":[{"__symbolic":"reference","name":"ɵc"},{"__symbolic":"reference","name":"ɵe"},{"provide":{"__symbolic":"reference","name":"ɵb"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"player"}}]}}}},"BaseDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":19,"character":1},"arguments":[{"selector":"[lottie]"}]}],"members":{"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"containerClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"styles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}],"width":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"animationCreated":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":34,"character":3}}]}],"complete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":39,"character":3}}]}],"loopComplete":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":44,"character":3}}]}],"enterFrame":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"segmentStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":54,"character":3}}]}],"configReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":60,"character":3}}]}],"dataReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":66,"character":3}}]}],"domLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":72,"character":3}}]}],"destroy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":78,"character":3}}]}],"error":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":84,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":87,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":87,"character":12}]}],null],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ɵc"}]}],"loadAnimation":[{"__symbolic":"method"}]}},"LottieDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"BaseDirective"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":6,"character":1},"arguments":[{"selector":"[lottie]","providers":[{"__symbolic":"reference","name":"ɵd"}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":12,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":12,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":13,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":14,"character":5}}],null],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":13,"character":37,"context":{"typeName":"HTMLElement"},"module":"./src/lottie.directive"}]},{"__symbolic":"reference","name":"ɵd"},{"__symbolic":"reference","name":"ɵc"}]}],"ngOnInit":[{"__symbolic":"method"}]}},"LottieComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"BaseDirective"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":18,"character":1},"arguments":[{"selector":"ng-lottie","template":"\n <div\n #container\n [style.width.px]=\"width\"\n [style.height.px]=\"height\"\n style=\"margin: 0 auto\"\n [ngStyle]=\"styles\"\n ></div>\n ","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":29,"character":19},"member":"OnPush"},"providers":[{"__symbolic":"reference","name":"ɵd"}]}]}],"members":{"container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":33,"character":3},"arguments":["container",{"static":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":37,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":37,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":38,"character":5}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":36,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ɵd"},{"__symbolic":"reference","name":"ɵc"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}},"LottieTransferState":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"TransferState","line":8,"character":29}]}],"get":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"BMEnterFrameEvent":{"__symbolic":"interface"},"BMCompleteLoopEvent":{"__symbolic":"interface"},"BMCompleteEvent":{"__symbolic":"interface"},"BMSegmentStartEvent":{"__symbolic":"interface"},"BMDestroyEvent":{"__symbolic":"interface"},"BMRenderFrameErrorEvent":{"__symbolic":"interface"},"BMConfigErrorEvent":{"__symbolic":"interface"},"LottieOptions":{"__symbolic":"interface"},"AnimationFilename":{"__symbolic":"interface"},"transformAnimationFilenameToKey":{"__symbolic":"function","parameters":["animation"],"value":{"__symbolic":"binop","operator":"+","left":"animation-","right":{"__symbolic":"index","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"animation"},"member":"split"},"arguments":[".json"]},"index":0}}},"ɵc":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":19,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":23,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":23,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":24,"character":5},"arguments":[{"__symbolic":"reference","name":"ɵb"}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":22,"character":20},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ɵa"}]}],"resolveLoaderAndLoadAnimation":[{"__symbolic":"method"}],"resolveOptions":[{"__symbolic":"method"}],"loadAnimation":[{"__symbolic":"method"}],"wrapPlayerOrLoaderIntoObservable":[{"__symbolic":"method"}]}},"ɵd":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":18,"character":12}]}],null],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"ɵe"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"bootstrapEventsService":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}]}},"ɵe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":44,"character":30}]}],"addEventListeners":[{"__symbolic":"method"}],"addEventListener":[{"__symbolic":"method"}],"handleEventClosure":[{"__symbolic":"method"}],"camelizeNativeEventName":[{"__symbolic":"method"}],"retrieveEventEmitter":[{"__symbolic":"method"}]}}},"origins":{"ɵa":"./src/symbols","ɵb":"./src/symbols","LottieModule":"./src/lottie.module","BaseDirective":"./src/base.directive","LottieDirective":"./src/lottie.directive","LottieComponent":"./src/lottie.component","LottieTransferState":"./src/transfer-state","BMEnterFrameEvent":"./src/symbols","BMCompleteLoopEvent":"./src/symbols","BMCompleteEvent":"./src/symbols","BMSegmentStartEvent":"./src/symbols","BMDestroyEvent":"./src/symbols","BMRenderFrameErrorEvent":"./src/symbols","BMConfigErrorEvent":"./src/symbols","LottieOptions":"./src/symbols","AnimationFilename":"./src/symbols","transformAnimationFilenameToKey":"./src/utils","ɵc":"./src/animation-loader","ɵd":"./src/events.service","ɵe":"./src/events-facade"},"importAs":"ngx-lottie"} |
{ | ||
"$schema": "../node_modules/ng-packagr/ng-package.schema.json", | ||
"name": "ngx-lottie", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -43,3 +43,3 @@ <h1 align="center"> | ||
- __strict:__ all types of objects and events are available to you | ||
- __performant:__ the `lottie` library is loaded on demand | ||
- __performant:__ the `lottie-web` library can be loaded synchronously or on demand | ||
@@ -78,3 +78,3 @@ ## Quick example | ||
First, import the `LottieModule` to any of your modules: | ||
First, import the `LottieModule` into `AppModule`: | ||
@@ -84,6 +84,13 @@ ```typescript | ||
import { LottieModule } from 'ngx-lottie'; | ||
import player from 'lottie-web'; | ||
// Note we need a separate function as it's required | ||
// by the AOT compiler | ||
export function playerFactory() { | ||
return player; | ||
} | ||
@NgModule({ | ||
imports: [ | ||
LottieModule | ||
LottieModule.forRoot({ player: playerFactory }) | ||
] | ||
@@ -94,7 +101,26 @@ }) | ||
Now you can simple use an `ng-lottie` component and provide your custom options via the `options` binding: | ||
The `lottie-web` library can be loaded on demand using dynamic import. Given the following code: | ||
```ts | ||
import { NgModule } from '@angular/core'; | ||
import { LottieModule } from 'ngx-lottie'; | ||
export function playerFactory() { | ||
return import('lottie-web'); | ||
} | ||
@NgModule({ | ||
imports: [ | ||
LottieModule.forRoot({ player: playerFactory }) | ||
] | ||
}) | ||
export class AppModule {} | ||
``` | ||
Now you can simply use the `ng-lottie` component and provide your custom options via the `options` binding: | ||
```typescript | ||
import { Component } from '@angular/core'; | ||
import { LottieOptions, AnimationItem } from 'ngx-lottie'; | ||
import { AnimationItem } from 'lottie-web'; | ||
import { LottieOptions } from 'ngx-lottie'; | ||
@@ -121,7 +147,8 @@ @Component({ | ||
Also it's possible to use a `lottie` directive if you'd like to provide your own custom container and play with it: | ||
Also it's possible to use the `lottie` directive if you'd like to provide your own custom container and control it: | ||
```typescript | ||
import { Component } from '@angular/core'; | ||
import { LottieOptions, AnimationItem } from 'ngx-lottie'; | ||
import { AnimationItem } from 'lottie-web'; | ||
import { LottieOptions } from 'ngx-lottie'; | ||
@@ -149,2 +176,4 @@ @Component({ | ||
Notice that you will need to import the `LottieModule` into other modules as it exports `ng-lottie` component and `lottie` directive. But `forRoot` has to be called only once! | ||
## API | ||
@@ -169,3 +198,2 @@ | ||
| dataReady | `void` | optional | Dispatched when all parts of the animation have been loaded | ||
| dataFailed | `void` | optional | Dispatched if the `XMLHttpRequest`, that tried to load animation data using provided `path`, has errored | ||
| domLoaded | `void` | optional | Dispatched when elements have been added to the DOM | ||
@@ -176,4 +204,4 @@ | enterFrame | `BMEnterFrameEvent` | optional | Dispatched after entering the new frame | ||
| complete | `BMCompleteEvent` | optional | Dispatched after completing the last frame | ||
| loadedImages | `void` | optional | Dispatched after all assets are preloaded | ||
| destroy | `BMDestroyEvent` | optional | Dispatched in the `ngOnDestroy` hook of the service that manages `lottie`'s events, it's useful for releasing resources | ||
| error | `BMRenderFrameErrorEvent | BMConfigErrorEvent` | optional | Dispatched if the lottie player could not render some frame or parse the config | ||
@@ -184,3 +212,3 @@ ## Optimizations | ||
Also, events, dispatched by `AnimationItem`, are listened outside Angular's zone, thus you shouldn't worry that every dispatch will be intercepted by Angular's zone. | ||
Also `AnimationItem` events are listened outside of the Angular's zone. Thus you shouldn't worry that Lottie's events will cause the `ApplicationRef` to invoke tick every ms. | ||
@@ -227,3 +255,3 @@ ## Server side rendering | ||
Also, don't forget to import `BrowserTransferStateModule` into your `AppModule`. Let's look at these options. `animations` is an array of `json` files, that contain animation data, that should be read on the server side, cached and transfered on the client. `folder` is a path where your `json` files are located, but you should use it properly, this path is joined with the `process.cwd()`. Imagine such project structure: | ||
Don't forget to import `BrowserTransferStateModule` into your `AppModule`. Let's look at these options. `animations` is an array of `json` files, that contain animation data, that should be read on the server side, cached and transfered on the client. `folder` is a path where your `json` files are located, but you should use it properly, this path is joined with the `process.cwd()`. Imagine such project structure: | ||
@@ -230,0 +258,0 @@ ``` |
@@ -0,2 +1,7 @@ | ||
import { ModuleWithProviders } from '@angular/core'; | ||
import { LottiePlayerFactoryOrLoader } from './symbols'; | ||
export declare class LottieModule { | ||
static forRoot(options: { | ||
player: LottiePlayerFactoryOrLoader; | ||
}): ModuleWithProviders<LottieModule>; | ||
} |
export { LottieModule } from './lottie.module'; | ||
export { BaseDirective } from './core/directives/base.directive'; | ||
export { LottieDirective } from './core/directives/lottie.directive'; | ||
export { LottieComponent } from './core/components/lottie.component'; | ||
export { LottieTransferState } from './core/services/lottie-transfer-state'; | ||
export { LottieOptions, Lottie, AnimationItem, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, LottieEvent, LottieCSSStyleDeclaration, LottieContainerClass, AnimationFilename } from './symbols'; | ||
export { BaseDirective } from './base.directive'; | ||
export { LottieDirective } from './lottie.directive'; | ||
export { LottieComponent } from './lottie.component'; | ||
export { LottieTransferState } from './transfer-state'; | ||
export { BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, LottieOptions, AnimationFilename } from './symbols'; | ||
export { transformAnimationFilenameToKey } from './utils'; |
@@ -1,94 +0,3 @@ | ||
export interface LottieOptions { | ||
animationData?: any; | ||
container?: HTMLElement; | ||
renderer?: 'svg' | 'canvas' | 'html'; | ||
autoloadSegments?: boolean; | ||
loop?: boolean | number; | ||
autoplay?: boolean; | ||
name?: string; | ||
path?: string; | ||
rendererSettings?: { | ||
context?: CanvasRenderingContext2D; | ||
scaleMode?: string; | ||
viewBoxOnly?: boolean; | ||
viewBoxSize?: boolean; | ||
clearCanvas?: boolean; | ||
progressiveLoad?: boolean; | ||
hideOnTransparent?: boolean; | ||
preserveAspectRatio?: string; | ||
imagePreserveAspectRatio?: string; | ||
className?: string; | ||
}; | ||
} | ||
export interface Lottie { | ||
play(name?: string): void; | ||
stop(name?: string): void; | ||
setSpeed(speed: number, name?: string): void; | ||
setDirection(direction: number, name?: string): void; | ||
setQuality(quality: 'high' | 'medium' | 'low' | number): void; | ||
loadAnimation(params: LottieOptions): AnimationItem; | ||
registerAnimation(element: any, animationData?: any): AnimationItem; | ||
searchAnimations(animationData?: any, standalone?: boolean, renderer?: string): void; | ||
destroy(name?: string): void; | ||
} | ||
export interface AnimationItem { | ||
animType: string; | ||
animationData: any; | ||
animationID: string; | ||
assets: any[]; | ||
assetsPath: string | undefined; | ||
autoloadSegments: boolean; | ||
autoplay: boolean; | ||
currentFrame: number; | ||
currentRawFrame: number; | ||
fileName: string | undefined; | ||
firstFrame: number; | ||
frameModifier: number; | ||
frameMult: number; | ||
frameRate: number; | ||
isLoaded: boolean; | ||
isPaused: boolean; | ||
loop: boolean; | ||
name: string; | ||
path: string; | ||
playCount: number; | ||
playDirection: number; | ||
playSpeed: number; | ||
renderer: any | null; | ||
segmentPos: number; | ||
segments: any[]; | ||
subframeEnabled: boolean; | ||
timeCompleted: number; | ||
totalFrames: number; | ||
wrapper: HTMLElement | HTMLCanvasElement; | ||
_cbs: ((event?: LottieEvent) => void)[]; | ||
_completedLoop: boolean; | ||
_idle: boolean; | ||
play(): void; | ||
stop(): void; | ||
pause(): void; | ||
setSpeed(speed: number): void; | ||
setSubframe(flag: boolean): void; | ||
goToAndPlay(value: number, isFrame: boolean): void; | ||
goToAndStop(value: number, isFrame: boolean): void; | ||
playSegments(segments: number[] | number[][], forceFlag: boolean): void; | ||
destroy(): void; | ||
getDuration(inFrames: boolean): number; | ||
addEventListener(name: LottieEventName, callback: (event: LottieEvent) => void): void; | ||
removeEventListener(name: LottieEventName, callback: (event: LottieEvent) => void): void; | ||
hide(): void; | ||
resize(): void; | ||
show(): void; | ||
setDirection(direction: Direction): void; | ||
configAnimation(animationData: any): void; | ||
getAssetsPath(assetData: any): string; | ||
getAssetData(id: number): any | undefined; | ||
loadSegments(): void; | ||
loadNextSegment(): void; | ||
preloadImages(): void; | ||
togglePause(): void; | ||
renderFrame(): void; | ||
setCurrentRawFrameValue(value: number): void; | ||
} | ||
export declare type Direction = 1 | -1; | ||
import { InjectionToken } from '@angular/core'; | ||
export declare type LottieOptions = Partial<AnimationConfigWithData> | Partial<AnimationConfigWithPath>; | ||
export interface BMEnterFrameEvent { | ||
@@ -119,5 +28,13 @@ currentTime: number; | ||
} | ||
export declare type LottieEvent = BMEnterFrameEvent | BMCompleteLoopEvent | BMCompleteEvent | BMSegmentStartEvent | BMDestroyEvent | void; | ||
export declare type LottieEventName = 'complete' | 'loopComplete' | 'enterFrame' | 'segmentStart' | 'config_ready' | 'data_ready' | 'data_failed' | 'loaded_images' | 'DOMLoaded' | 'destroy'; | ||
export declare type MappedLottieEventName = 'complete' | 'loopComplete' | 'enterFrame' | 'segmentStart' | 'configReady' | 'dataReady' | 'dataFailed' | 'loadedImages' | 'domLoaded' | 'destroy'; | ||
export interface BMRenderFrameErrorEvent { | ||
type: 'renderFrameError'; | ||
nativeError: Error; | ||
currentTime: number; | ||
} | ||
export interface BMConfigErrorEvent { | ||
type: 'configError'; | ||
nativeError: Error; | ||
} | ||
export declare type LottieEvent = BMEnterFrameEvent | BMCompleteLoopEvent | BMCompleteEvent | BMSegmentStartEvent | BMDestroyEvent | BMRenderFrameErrorEvent | BMConfigErrorEvent | void; | ||
export declare type CamelizedAnimationEventName = 'complete' | 'loopComplete' | 'enterFrame' | 'segmentStart' | 'configReady' | 'dataReady' | 'domLoaded' | 'destroy' | 'error'; | ||
export declare type LottieCSSStyleDeclaration = Partial<CSSStyleDeclaration>; | ||
@@ -128,1 +45,22 @@ export declare type LottieContainerClass = string | string[] | Set<string> | { | ||
export declare type AnimationFilename = string; | ||
export declare type AnimationEventName = import('lottie-web').AnimationEventName; | ||
export declare type AnimationItem = import('lottie-web').AnimationItem; | ||
export declare type AnimationConfig = import('lottie-web').AnimationConfig; | ||
export declare type AnimationConfigWithData = import('lottie-web').AnimationConfigWithData; | ||
export declare type AnimationConfigWithPath = import('lottie-web').AnimationConfigWithPath; | ||
export declare type LottiePlayer = typeof import('lottie-web').default; | ||
/** | ||
* This looks as follows | ||
* @example | ||
* import player from 'lottie-web'; | ||
* const factory = () => player; | ||
*/ | ||
export declare type LottiePlayerFactory = () => typeof import('lottie-web').default; | ||
/** | ||
* This looks as follows | ||
* @example | ||
* const factory = () => import('lottie-web'); | ||
*/ | ||
export declare type LottieLoader = () => Promise<typeof import('lottie-web')>; | ||
export declare type LottiePlayerFactoryOrLoader = LottiePlayerFactory | LottieLoader; | ||
export declare const LOTTIE_PLAYER_FACTORY_OR_LOADER: InjectionToken<LottiePlayerFactoryOrLoader>; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
497278
78
5886
300
1