@aarsteinmedia/dotlottie-player 5.2.1 → 5.2.3
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/CHANGELOG.md +9 -0
- package/custom-elements.json +8 -12
- package/dist/index.d.ts +2 -17
- package/dist/index.js +9 -25
- package/dist/unpkg.js +7 -7
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
Changelog was only added since [3.2.3], so it's not exhaustive. [Please report any missing noteable changes to us](https://github.com/aarsteinmedia/dotlottie-player/issues), and we'll add them promptly.
|
|
9
9
|
|
|
10
|
+
## [5.2.3] - 11-06-2025
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Optimization to animation engine:
|
|
15
|
+
- Prevented needless function calls to check for rendering context, when only one is sufficiant.
|
|
16
|
+
- Swapped deprecated attributes like xml:href and xml:space for modern equivalents.
|
|
17
|
+
|
|
10
18
|
## [5.2.1] - 08-06-2025
|
|
11
19
|
|
|
12
20
|
- Fixed runtime bug where minification caused some functionality to break
|
|
@@ -281,6 +289,7 @@ Changelog was only added since [3.2.3], so it's not exhaustive. [Please report a
|
|
|
281
289
|
- Removed dependencies
|
|
282
290
|
- `@lit`
|
|
283
291
|
|
|
292
|
+
[5.2.3]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.2.3
|
|
284
293
|
[5.2.0]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.2.0
|
|
285
294
|
[5.1.13]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.13
|
|
286
295
|
[5.1.11]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.11
|
package/custom-elements.json
CHANGED
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
"kind": "variable",
|
|
15
15
|
"name": "PlayMode"
|
|
16
16
|
},
|
|
17
|
-
{
|
|
18
|
-
"kind": "variable",
|
|
19
|
-
"name": "PlayerEvents"
|
|
20
|
-
},
|
|
21
17
|
{
|
|
22
18
|
"kind": "class",
|
|
23
19
|
"description": "DotLottie Player Web Component.",
|
|
@@ -659,6 +655,14 @@
|
|
|
659
655
|
}
|
|
660
656
|
],
|
|
661
657
|
"exports": [
|
|
658
|
+
{
|
|
659
|
+
"kind": "js",
|
|
660
|
+
"name": "PlayerEvents",
|
|
661
|
+
"declaration": {
|
|
662
|
+
"name": "PlayerEvents",
|
|
663
|
+
"package": "@aarsteinmedia/lottie-web/utils"
|
|
664
|
+
}
|
|
665
|
+
},
|
|
662
666
|
{
|
|
663
667
|
"kind": "custom-element-definition",
|
|
664
668
|
"name": "tagName",
|
|
@@ -675,14 +679,6 @@
|
|
|
675
679
|
"module": "dist/index.js"
|
|
676
680
|
}
|
|
677
681
|
},
|
|
678
|
-
{
|
|
679
|
-
"kind": "js",
|
|
680
|
-
"name": "PlayerEvents",
|
|
681
|
-
"declaration": {
|
|
682
|
-
"name": "PlayerEvents",
|
|
683
|
-
"module": "dist/index.js"
|
|
684
|
-
}
|
|
685
|
-
},
|
|
686
682
|
{
|
|
687
683
|
"kind": "js",
|
|
688
684
|
"name": "PlayerState",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { PlayerEvents } from '@aarsteinmedia/lottie-web/utils';
|
|
1
2
|
import { AnimationSettings, AnimationData, LottieManifest, AnimationDirection, AnimationItem, Vector2 } from '@aarsteinmedia/lottie-web';
|
|
2
3
|
|
|
3
4
|
interface Animation extends AnimationSettings {
|
|
@@ -77,22 +78,6 @@ declare enum PlayMode {
|
|
|
77
78
|
Bounce = "bounce",
|
|
78
79
|
Normal = "normal"
|
|
79
80
|
}
|
|
80
|
-
declare enum PlayerEvents {
|
|
81
|
-
Complete = "complete",
|
|
82
|
-
Destroyed = "destroyed",
|
|
83
|
-
Error = "error",
|
|
84
|
-
Frame = "frame",
|
|
85
|
-
Freeze = "freeze",
|
|
86
|
-
Load = "load",
|
|
87
|
-
Loop = "loop",
|
|
88
|
-
Next = "next",
|
|
89
|
-
Pause = "pause",
|
|
90
|
-
Play = "play",
|
|
91
|
-
Previous = "previous",
|
|
92
|
-
Ready = "ready",
|
|
93
|
-
Rendered = "rendered",
|
|
94
|
-
Stop = "stop"
|
|
95
|
-
}
|
|
96
81
|
declare enum PreserveAspectRatio {
|
|
97
82
|
Contain = "xMidYMid meet",
|
|
98
83
|
Cover = "xMidYMid slice",
|
|
@@ -235,4 +220,4 @@ declare class DotLottiePlayer extends PropertyCallbackElement {
|
|
|
235
220
|
|
|
236
221
|
declare const tagName = "dotlottie-player";
|
|
237
222
|
|
|
238
|
-
export { PlayMode,
|
|
223
|
+
export { PlayMode, PlayerState, DotLottiePlayer as default, tagName };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { isServer, createElementID, PreserveAspectRatio as PreserveAspectRatio$1 } from '@aarsteinmedia/lottie-web/utils';
|
|
1
|
+
import { isServer, createElementID, PreserveAspectRatio as PreserveAspectRatio$1, PlayerEvents } from '@aarsteinmedia/lottie-web/utils';
|
|
2
|
+
export { PlayerEvents } from '@aarsteinmedia/lottie-web/utils';
|
|
2
3
|
import Lottie from '@aarsteinmedia/lottie-web';
|
|
3
4
|
import { strToU8, zip, strFromU8, unzip as unzip$1 } from 'fflate';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Credit to: Leonardo Favre https://github.com/leofavre/observed-properties.
|
|
7
8
|
*/ const updateOnConnected = Symbol('UPDATE_ON_CONNECTED');
|
|
8
|
-
if (isServer
|
|
9
|
+
if (isServer) {
|
|
9
10
|
// Mock HTMLElement for server-side rendering
|
|
10
11
|
global.HTMLElement = // eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
11
12
|
class EmptyHTMLElement {
|
|
@@ -87,23 +88,6 @@ var PlayMode = /*#__PURE__*/ function(PlayMode) {
|
|
|
87
88
|
PlayMode["Normal"] = "normal";
|
|
88
89
|
return PlayMode;
|
|
89
90
|
}({});
|
|
90
|
-
var PlayerEvents = /*#__PURE__*/ function(PlayerEvents) {
|
|
91
|
-
PlayerEvents["Complete"] = "complete";
|
|
92
|
-
PlayerEvents["Destroyed"] = "destroyed";
|
|
93
|
-
PlayerEvents["Error"] = "error";
|
|
94
|
-
PlayerEvents["Frame"] = "frame";
|
|
95
|
-
PlayerEvents["Freeze"] = "freeze";
|
|
96
|
-
PlayerEvents["Load"] = "load";
|
|
97
|
-
PlayerEvents["Loop"] = "loop";
|
|
98
|
-
PlayerEvents["Next"] = "next";
|
|
99
|
-
PlayerEvents["Pause"] = "pause";
|
|
100
|
-
PlayerEvents["Play"] = "play";
|
|
101
|
-
PlayerEvents["Previous"] = "previous";
|
|
102
|
-
PlayerEvents["Ready"] = "ready";
|
|
103
|
-
PlayerEvents["Rendered"] = "rendered";
|
|
104
|
-
PlayerEvents["Stop"] = "stop";
|
|
105
|
-
return PlayerEvents;
|
|
106
|
-
}({});
|
|
107
91
|
var PreserveAspectRatio = /*#__PURE__*/ function(PreserveAspectRatio) {
|
|
108
92
|
PreserveAspectRatio["Contain"] = "xMidYMid meet";
|
|
109
93
|
PreserveAspectRatio["Cover"] = "xMidYMid slice";
|
|
@@ -274,13 +258,13 @@ const hasExt = (path)=>{
|
|
|
274
258
|
*
|
|
275
259
|
* @param str - Base64 encoded string.
|
|
276
260
|
* @returns UTF-8/Latin-1 binary.
|
|
277
|
-
*/ base64ToU8 = (str)=>strToU8(isServer
|
|
261
|
+
*/ base64ToU8 = (str)=>strToU8(isServer ? Buffer.from(parseBase64(str), 'base64').toString('binary') : atob(parseBase64(str)), true), getExtFromB64 = (str)=>{
|
|
278
262
|
const mime = str.split(':')[1].split(';')[0], ext = mime.split('/')[1].split('+')[0];
|
|
279
263
|
return ext;
|
|
280
264
|
}, handleErrors = (err)=>{
|
|
281
265
|
const res = {
|
|
282
266
|
message: 'Unknown error',
|
|
283
|
-
status: isServer
|
|
267
|
+
status: isServer ? 500 : 400
|
|
284
268
|
};
|
|
285
269
|
if (err && typeof err === 'object') {
|
|
286
270
|
if ('message' in err && typeof err.message === 'string') {
|
|
@@ -490,7 +474,7 @@ async function resolveAssets(unzipped, assets) {
|
|
|
490
474
|
}
|
|
491
475
|
toResolve.push(new Promise((resolveAsset)=>{
|
|
492
476
|
let assetB64;
|
|
493
|
-
if (isServer
|
|
477
|
+
if (isServer) {
|
|
494
478
|
assetB64 = Buffer.from(u8).toString('base64');
|
|
495
479
|
} else {
|
|
496
480
|
let result = '';
|
|
@@ -1694,7 +1678,7 @@ const generator = '@aarsteinmedia/dotlottie-player';
|
|
|
1694
1678
|
if (!this.animateOnScroll || !this._lottieInstance) {
|
|
1695
1679
|
return;
|
|
1696
1680
|
}
|
|
1697
|
-
if (isServer
|
|
1681
|
+
if (isServer) {
|
|
1698
1682
|
console.warn('DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.');
|
|
1699
1683
|
return;
|
|
1700
1684
|
}
|
|
@@ -1890,8 +1874,8 @@ const generator = '@aarsteinmedia/dotlottie-player';
|
|
|
1890
1874
|
*
|
|
1891
1875
|
*/ globalThis.dotLottiePlayer = ()=>new DotLottiePlayer();
|
|
1892
1876
|
const tagName = 'dotlottie-player';
|
|
1893
|
-
if (!isServer
|
|
1877
|
+
if (!isServer) {
|
|
1894
1878
|
customElements.define(tagName, DotLottiePlayer);
|
|
1895
1879
|
}
|
|
1896
1880
|
|
|
1897
|
-
export { PlayMode,
|
|
1881
|
+
export { PlayMode, PlayerState, DotLottiePlayer as default, tagName };
|