@lordicon/web 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5289 -6272
- package/dist/src/index.d.ts +2 -0
- package/dist/src/interfaces.d.ts +163 -0
- package/dist/src/lottie.d.ts +48 -0
- package/dist/src/parsers.d.ts +40 -0
- package/dist/{index.d.ts → src/player.d.ts} +233 -394
- package/dist/src/utils.d.ts +39 -0
- package/examples/03-states.html +3 -1
- package/package.json +10 -10
- package/src/player.ts +3 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep clone value.
|
|
3
|
+
* @param value Value to clone.
|
|
4
|
+
*/
|
|
5
|
+
export declare function deepClone<T = any>(value: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if value is null or undefined.
|
|
8
|
+
* @param value Value to check.
|
|
9
|
+
* @returns True if value is null or undefined, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isNil(value: any): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if value is object like.
|
|
14
|
+
* @param value Value to check.
|
|
15
|
+
* @returns True if value is object like, false otherwise.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isObjectLike(value: any): value is object;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if path is a direct property of object.
|
|
20
|
+
* @param object Object to check.
|
|
21
|
+
* @param path Path to check.
|
|
22
|
+
*/
|
|
23
|
+
export declare function has<T>(object: T, path: string | string[]): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the value at the given path from the object.
|
|
26
|
+
* Returns defaultValue if the path does not exist.
|
|
27
|
+
* @param object Object to get value from.
|
|
28
|
+
* @param path Property path as a dot-separated string or array of keys.
|
|
29
|
+
* @param defaultValue Value to return if the path does not exist.
|
|
30
|
+
* @returns Value at the given path or defaultValue.
|
|
31
|
+
*/
|
|
32
|
+
export declare function get<T>(object: T, path: string | string[], defaultValue?: any): any;
|
|
33
|
+
/**
|
|
34
|
+
* Update object value on path.
|
|
35
|
+
* @param object Object to update.
|
|
36
|
+
* @param path Path to the value.
|
|
37
|
+
* @param value New value to set.
|
|
38
|
+
*/
|
|
39
|
+
export declare function set(object: any, path: string | string[], value: any): void;
|
package/examples/03-states.html
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lordicon/web",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A lightweight and flexible player for seamlessly embedding, controlling, and customizing animated Lordicon icons in any web application.",
|
|
5
5
|
"repository": "https://github.com/lordicondev/player-web",
|
|
6
6
|
"homepage": "https://lordicon.com/",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@lordicon/internal": "^0.5.0",
|
|
27
|
-
"vite": "^
|
|
28
|
-
"vite-plugin-dts": "^
|
|
29
|
-
"concurrently": "^
|
|
30
|
-
"eslint-config-prettier": "^
|
|
31
|
-
"eslint": "^
|
|
32
|
-
"prettier": "^3.
|
|
33
|
-
"typescript": "^
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
27
|
+
"vite": "^8.0.16",
|
|
28
|
+
"vite-plugin-dts": "^5.0.2",
|
|
29
|
+
"concurrently": "^10.0.3",
|
|
30
|
+
"eslint-config-prettier": "^10.1.8",
|
|
31
|
+
"eslint": "^10.5.0",
|
|
32
|
+
"prettier": "^3.8.4",
|
|
33
|
+
"typescript": "^6.0.3",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
35
|
+
"@typescript-eslint/parser": "^8.61.1",
|
|
36
36
|
"@types/node": "^22.13.13"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/src/player.ts
CHANGED
|
@@ -184,7 +184,7 @@ export class Player {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
// Fallback to default state if initial is invalid.
|
|
187
|
-
if (this._initialProperties.state && !this._state) {
|
|
187
|
+
if (this._initialProperties.state && !this._state && this._initialProperties.state !== '*') {
|
|
188
188
|
this._state = this._availableStates.filter(c => c.default)[0];
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -624,6 +624,8 @@ export class Player {
|
|
|
624
624
|
|
|
625
625
|
if (isNil(state)) {
|
|
626
626
|
this._state = this._availableStates.filter(c => c.default)[0];
|
|
627
|
+
} else if (state === '*') {
|
|
628
|
+
this._state = undefined;
|
|
627
629
|
} else if (state) {
|
|
628
630
|
this._state = this._availableStates.filter(c => c.name === state)[0];
|
|
629
631
|
|