lord-icon-element
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
import { AnimationConfig, LottiePlayer } from "lottie-web"; | ||
import { AnimationItem, AnimationConfigWithPath, AnimationConfigWithData } from "lottie-web"; | ||
export declare type LottieColor = [number, number, number]; | ||
@@ -45,2 +45,2 @@ export declare type LottieFieldType = 'color' | 'slider' | 'point' | 'checkbox'; | ||
*/ | ||
export declare type LottieLoader = (params: AnimationConfig) => LottiePlayer; | ||
export declare type LottieLoader = (params: AnimationConfigWithPath | AnimationConfigWithData) => AnimationItem; |
@@ -1,3 +0,3 @@ | ||
import { LottiePlayer, AnimationConfig } from "lottie-web"; | ||
import { ITrigger } from "../interfaces.js"; | ||
import { AnimationItem } from "lottie-web"; | ||
import { ITrigger, LottieLoader } from "../interfaces.js"; | ||
declare type SUPPORTED_ATTRIBUTES = "colors" | "stroke" | "scale" | "axis-x" | "axis-y" | "src" | "icon" | "trigger" | "speed" | "target"; | ||
@@ -7,3 +7,3 @@ export declare class Element extends HTMLElement { | ||
protected root: ShadowRoot; | ||
protected lottie?: LottiePlayer; | ||
protected lottie?: AnimationItem; | ||
protected myConnectedTrigger?: ITrigger; | ||
@@ -24,3 +24,3 @@ protected icon?: string; | ||
*/ | ||
static registerLoader(loader: (params: AnimationConfig) => LottiePlayer): void; | ||
static registerLoader(loader: LottieLoader): void; | ||
/** | ||
@@ -27,0 +27,0 @@ * Register supported icon. |
@@ -160,6 +160,8 @@ import { allFields, replaceColors, replaceParams } from "../helpers/lottie.js"; | ||
autoplay: false, | ||
preserveAspectRatio: "xMidYMid meet", | ||
progressiveLoad: true, | ||
hideOnTransparent: false, | ||
animationData: iconData, | ||
rendererSettings: { | ||
preserveAspectRatio: "xMidYMid meet", | ||
progressiveLoad: true, | ||
hideOnTransparent: false, | ||
}, | ||
}); | ||
@@ -166,0 +168,0 @@ // set speed |
@@ -1,3 +0,4 @@ | ||
import { LottiePlayer, AnimationConfig } from 'lottie-web'; | ||
import { AnimationItem, AnimationConfigWithPath, AnimationConfigWithData } from 'lottie-web'; | ||
import { Element } from './element.js'; | ||
import { LottieLoader } from '../interfaces.js'; | ||
/** | ||
@@ -19,3 +20,3 @@ * Register new icon. Notify all instances about it. | ||
*/ | ||
export declare function registerLoader(loader: (params: AnimationConfig) => LottiePlayer): void; | ||
export declare function registerLoader(loader: LottieLoader): void; | ||
/** | ||
@@ -55,2 +56,2 @@ * Store element instance. | ||
*/ | ||
export declare function loadLottieAnimation(params: AnimationConfig): LottiePlayer; | ||
export declare function loadLottieAnimation(params: AnimationConfigWithPath | AnimationConfigWithData): AnimationItem; |
@@ -1,2 +0,2 @@ | ||
import { LottiePlayer } from 'lottie-web'; | ||
import { AnimationItem, AnimationDirection } from 'lottie-web'; | ||
import { ITrigger } from '../interfaces'; | ||
@@ -9,3 +9,3 @@ /** | ||
protected readonly target: HTMLElement; | ||
protected readonly lottie: LottiePlayer; | ||
protected readonly lottie: AnimationItem; | ||
private myInAnimation; | ||
@@ -16,3 +16,3 @@ private myIsReady; | ||
private myConnected; | ||
constructor(element: HTMLElement, target: HTMLElement, lottie: LottiePlayer); | ||
constructor(element: HTMLElement, target: HTMLElement, lottie: AnimationItem); | ||
/** | ||
@@ -71,3 +71,3 @@ * The animation has been connected. | ||
*/ | ||
setDirection(direction: number): void; | ||
setDirection(direction: AnimationDirection): void; | ||
/** | ||
@@ -74,0 +74,0 @@ * Enable or disable loop for this animation. |
@@ -83,3 +83,3 @@ /** | ||
goToFrame(value) { | ||
this.lottie.setCurrentRawFrameValue(value); | ||
this.lottie.goToAndStop(value, true); | ||
} | ||
@@ -86,0 +86,0 @@ /** |
{ | ||
"name": "lord-icon-element", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"private": false, | ||
@@ -12,3 +12,3 @@ "main": "./build/lord-icon-element.js", | ||
"klaw-sync": "6.0.0", | ||
"lottie-web": "^5.7.6", | ||
"lottie-web": "^5.7.13", | ||
"open": "^6.4.0", | ||
@@ -27,3 +27,2 @@ "serve-static": "^1.13.2", | ||
"serve-examples": "node serve-examples.js", | ||
"prepare": "npm run build", | ||
"release": "webpack --mode production" | ||
@@ -30,0 +29,0 @@ }, |
@@ -56,2 +56,2 @@ # lord-icon-element | ||
You can use this library also without JS modules with released version. This is simplest way to use our element without any initialization and external tools. Just look for our [JSFiddle example](https://jsfiddle.net/dxaue2y9/). | ||
You can use this library also without JS modules with released version. This is simplest way to use our element without any initialization and external tools. Just look for our [JSFiddle example](https://jsfiddle.net/enpwfy6s/). |
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
65234
-25.7%42
-36.36%1361
-28.86%