@curiouslearning/gdl-player-core 1.5.0 → 1.5.2
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/README.md +2 -1
- package/dist/Image-BolaFg4H.cjs +1 -0
- package/dist/Image-BvZmqug_.js +14 -0
- package/dist/PlayerImage-D1RCTdBY.cjs +1 -0
- package/dist/PlayerImage-Do7_VfFo.js +26 -0
- package/dist/components/Background.d.ts +3 -1
- package/dist/components/LazySvg.d.ts +2 -2
- package/dist/components/Page.d.ts +7 -1
- package/dist/components/Player.d.ts +9 -1
- package/dist/components/PlayerImage.d.ts +20 -0
- package/dist/context/BookProvider.d.ts +2 -1
- package/dist/{dolottie-BJIvntzd.js → dolottie-C0XP7-PK.js} +42 -53
- package/dist/dolottie-FZVaMI-M.cjs +5 -0
- package/dist/dotlottie-player.wasm +0 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +1230 -1345
- package/dist/types/context.d.ts +2 -0
- package/dist/utils-D2xWCMio.cjs +1 -0
- package/dist/{utils-B8vKMuMn.js → utils-D36WDE-a.js} +5 -5
- package/package.json +1 -2
- package/dist/Image-D8mWyc98.js +0 -12
- package/dist/Image-DBMEc_qA.cjs +0 -1
- package/dist/dolottie-C7QXtKyz.cjs +0 -5
- package/dist/utils-Cu46IIpo.cjs +0 -1
package/README.md
CHANGED
|
@@ -45,7 +45,8 @@ Publishing is automated in CircleCI when changes land on `main` and validation j
|
|
|
45
45
|
|
|
46
46
|
Requirements:
|
|
47
47
|
|
|
48
|
-
1.
|
|
48
|
+
1. npm trusted publishing configured for this package (npmjs.com → package Settings → Trusted Publisher → CircleCI). No npm token is used: the release job gets a short-lived OIDC token from CircleCI.
|
|
49
|
+
Under **Allowed actions**, `npm publish` must be ticked; otherwise npm only allows staged publishes and the release fails with `403 OIDC permission denied for this action`.
|
|
49
50
|
2. Conventional Commit messages so semantic-release can calculate versions.
|
|
50
51
|
|
|
51
52
|
Common commit examples:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require("./utils-D2xWCMio.cjs"),t=require("./PlayerImage-D1RCTdBY.cjs");let n=require("react/jsx-runtime");var r=({mediaItem:r})=>{let i=e.a();return(0,n.jsx)(t.t,{src:e.n(i,r),eager:!0,className:`max-w-full max-h-full w-full h-full -z-10`})};exports.Image=r,exports.default=r;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, n as t } from "./utils-D36WDE-a.js";
|
|
3
|
+
import { t as n } from "./PlayerImage-Do7_VfFo.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
// src/components/Image.tsx
|
|
6
|
+
var i = ({ mediaItem: i }) => {
|
|
7
|
+
let a = e();
|
|
8
|
+
return /* @__PURE__ */ r(n, {
|
|
9
|
+
src: t(a, i),
|
|
10
|
+
eager: !0,
|
|
11
|
+
className: "max-w-full max-h-full w-full h-full -z-10"
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export { i as Image, i as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";let e=require("react"),t=require("react/jsx-runtime");var n=e=>{e&&(e.lazyPreloaderManaged=!0)},r=({src:r,alt:i=``,className:a,eager:o=!1})=>{let[s,c]=(0,e.useState)(!1),l=(0,e.useRef)(r);l.current!==r&&(l.current=r,c(!1));let u=(0,e.useCallback)(e=>{e&&e.complete&&e.naturalWidth>0&&c(!0)},[]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`img`,{ref:u,src:r,alt:i,loading:o?`eager`:`lazy`,decoding:`async`,className:a,onLoad:()=>c(!0)}),!s&&(0,t.jsx)(`div`,{className:`swiper-lazy-preloader`,ref:n})]})};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback as e, useRef as t, useState as n } from "react";
|
|
3
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
// src/components/PlayerImage.tsx
|
|
5
|
+
var o = (e) => {
|
|
6
|
+
e && (e.lazyPreloaderManaged = !0);
|
|
7
|
+
}, s = ({ src: s, alt: c = "", className: l, eager: u = !1 }) => {
|
|
8
|
+
let [d, f] = n(!1), p = t(s);
|
|
9
|
+
p.current !== s && (p.current = s, f(!1));
|
|
10
|
+
let m = e((e) => {
|
|
11
|
+
e && e.complete && e.naturalWidth > 0 && f(!0);
|
|
12
|
+
}, []);
|
|
13
|
+
return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("img", {
|
|
14
|
+
ref: m,
|
|
15
|
+
src: s,
|
|
16
|
+
alt: c,
|
|
17
|
+
loading: u ? "eager" : "lazy",
|
|
18
|
+
decoding: "async",
|
|
19
|
+
className: l,
|
|
20
|
+
onLoad: () => f(!0)
|
|
21
|
+
}), !d && /* @__PURE__ */ i("div", {
|
|
22
|
+
className: "swiper-lazy-preloader",
|
|
23
|
+
ref: o
|
|
24
|
+
})] });
|
|
25
|
+
};
|
|
26
|
+
export { s as t };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PageBackground } from '../types/book';
|
|
2
2
|
type BackgroundProps = {
|
|
3
3
|
background: PageBackground;
|
|
4
|
+
/** Load the image right away (active page and its neighbours). */
|
|
5
|
+
eager?: boolean;
|
|
4
6
|
};
|
|
5
|
-
export declare const Background: (
|
|
7
|
+
export declare const Background: ({ background, eager }: BackgroundProps) => import("react").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -4,6 +4,6 @@ interface LazySvgProps extends ComponentProps<'svg'> {
|
|
|
4
4
|
path: string;
|
|
5
5
|
mediaType?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const LazySvg: React.MemoExoticComponent<({ path, mediaType
|
|
8
|
-
declare const _default: React.MemoExoticComponent<React.MemoExoticComponent<({ path, mediaType
|
|
7
|
+
export declare const LazySvg: React.MemoExoticComponent<({ path, mediaType }: LazySvgProps) => React.JSX.Element | null>;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<React.MemoExoticComponent<({ path, mediaType }: LazySvgProps) => React.JSX.Element | null>>;
|
|
9
9
|
export default _default;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Page } from '../types/book';
|
|
2
|
-
export declare const BookPage: ({ page, screenScale, isActive, textDirection, }: {
|
|
2
|
+
export declare const BookPage: ({ page, screenScale, isActive, isPrev, isNext, distanceFromActive, textDirection, }: {
|
|
3
3
|
page: Page;
|
|
4
4
|
screenScale: number;
|
|
5
5
|
isActive: boolean;
|
|
6
|
+
/** Slide immediately before the active one (Swiper's `swiper-slide-prev`). */
|
|
7
|
+
isPrev?: boolean;
|
|
8
|
+
/** Slide immediately after the active one (Swiper's `swiper-slide-next`). */
|
|
9
|
+
isNext?: boolean;
|
|
10
|
+
/** Slides between this page and the active one; lets the look-ahead reach past ±1. */
|
|
11
|
+
distanceFromActive?: number;
|
|
6
12
|
textDirection?: "LTR" | "RTL";
|
|
7
13
|
}) => import("react").JSX.Element;
|
|
@@ -6,5 +6,13 @@ export type PlayerProps = {
|
|
|
6
6
|
analytics?: PlayerAnalytics;
|
|
7
7
|
fonts?: FontDefinition[];
|
|
8
8
|
bookSource?: PlayerSource;
|
|
9
|
+
/**
|
|
10
|
+
* URL of the dotlottie WebAssembly engine (`dotlottie-player.wasm`). When unset,
|
|
11
|
+
* the Lottie runtime fetches it from a public CDN the first time an animation
|
|
12
|
+
* renders, which fails offline. Point this at a self-hosted copy of the file
|
|
13
|
+
* shipped in this package's `dist/` (it must match the bundled runtime version)
|
|
14
|
+
* when the player has to work without network access.
|
|
15
|
+
*/
|
|
16
|
+
lottieWasmUrl?: string;
|
|
9
17
|
};
|
|
10
|
-
export declare const Player: ({ id, analytics, fonts, bookSource, }: PlayerProps) => import("react").JSX.Element;
|
|
18
|
+
export declare const Player: ({ id, analytics, fonts, bookSource, lottieWasmUrl, }: PlayerProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type PlayerImageProps = {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* When true the image is requested immediately, even if the slide it lives in
|
|
7
|
+
* is still outside the (overflow-hidden) Swiper viewport. Pages that are
|
|
8
|
+
* about to be swiped into view must use this, otherwise the browser's native
|
|
9
|
+
* lazy loading defers the request until the slide is already on screen and
|
|
10
|
+
* the artwork visibly pops in part-way through the transition.
|
|
11
|
+
*/
|
|
12
|
+
eager?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `<img>` with a Swiper-style preloader that is shown until the image has
|
|
16
|
+
* actually loaded. Used for every piece of page artwork (backgrounds and
|
|
17
|
+
* media) so the loading strategy lives in one place.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PlayerImage: ({ src, alt, className, eager, }: PlayerImageProps) => import("react").JSX.Element;
|
|
20
|
+
export default PlayerImage;
|
|
@@ -2,11 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import type { BookContextType } from '../types/context';
|
|
3
3
|
import { AssetConfig } from '../lib/utils';
|
|
4
4
|
import type { PlayerAnalytics } from '../types/analytics';
|
|
5
|
-
export declare const BookProvider: ({ bookId, slug, assetConfig, analytics, children, }: {
|
|
5
|
+
export declare const BookProvider: ({ bookId, slug, assetConfig, analytics, lottieWasmUrl, children, }: {
|
|
6
6
|
bookId: string;
|
|
7
7
|
slug: string;
|
|
8
8
|
assetConfig: AssetConfig;
|
|
9
9
|
analytics?: PlayerAnalytics;
|
|
10
|
+
lottieWasmUrl?: string;
|
|
10
11
|
children: React.ReactNode;
|
|
11
12
|
}) => React.JSX.Element;
|
|
12
13
|
export declare const useBookContext: () => BookContextType;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e, n as t } from "./utils-
|
|
2
|
+
import { a as e, n as t } from "./utils-D36WDE-a.js";
|
|
3
3
|
import n, { useCallback as r, useEffect as i, useRef as a } from "react";
|
|
4
4
|
import { Fragment as o, jsx as s } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// node_modules/@lottiefiles/dotlottie-web/dist/index.js
|
|
6
6
|
function c(e) {
|
|
7
7
|
"@babel/helpers - typeof";
|
|
8
8
|
return c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -610,7 +610,8 @@ async function se(e, t) {
|
|
|
610
610
|
}
|
|
611
611
|
let n = await e.arrayBuffer();
|
|
612
612
|
return await WebAssembly.instantiate(n, t);
|
|
613
|
-
}
|
|
613
|
+
}
|
|
614
|
+
{
|
|
614
615
|
let n = await WebAssembly.instantiate(e, t);
|
|
615
616
|
return n instanceof WebAssembly.Instance ? {
|
|
616
617
|
instance: n,
|
|
@@ -774,7 +775,7 @@ function H(e) {
|
|
|
774
775
|
} catch {
|
|
775
776
|
return !1;
|
|
776
777
|
}
|
|
777
|
-
|
|
778
|
+
return V(e);
|
|
778
779
|
}
|
|
779
780
|
function U() {
|
|
780
781
|
return 1 + ((h ? window.devicePixelRatio : 1) - 1) * .75;
|
|
@@ -874,7 +875,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
874
875
|
case "none": return "none";
|
|
875
876
|
default: return "contain";
|
|
876
877
|
}
|
|
877
|
-
},
|
|
878
|
+
}, X = class {
|
|
878
879
|
constructor(e) {
|
|
879
880
|
d(this, "_canvas", null), d(this, "_pendingLoad", null), d(this, "_context", null), d(this, "_eventManager", void 0), d(this, "_animationFrameId", null), d(this, "_frameManager", void 0), d(this, "_boundAnimationLoop", void 0), d(this, "_dotLottieCore", null), d(this, "_stateMachineId", ""), d(this, "_stateMachineConfig", null), d(this, "_isStateMachineRunning", !1), d(this, "_renderConfig", {}), d(this, "_isFrozen", !1), d(this, "_backgroundColor", null), d(this, "_lastFrameTime", null), d(this, "_boundOnClick", null), d(this, "_boundOnPointerUp", null), d(this, "_boundOnPointerDown", null), d(this, "_boundOnPointerMove", null), d(this, "_boundOnPointerEnter", null), d(this, "_boundOnPointerLeave", null), d(this, "_bufferMismatchCount", 0), d(this, "_lastExpectedBufferSize", 0), d(this, "_cachedImageData", null), d(this, "_cachedImageDataBuffer", null), d(this, "_cachedImageDataByteOffset", 0), d(this, "_marker", ""), d(this, "_segment", null), this._canvas = e.canvas ?? null, this._eventManager = new L(), this._frameManager = new m(), this._boundAnimationLoop = this._animationLoop.bind(this), this._renderConfig = {
|
|
880
881
|
...e.renderConfig,
|
|
@@ -941,10 +942,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
941
942
|
loopCount: n.loopCount ?? 0
|
|
942
943
|
}));
|
|
943
944
|
break;
|
|
944
|
-
case "Complete":
|
|
945
|
-
queueMicrotask(() => this._eventManager.dispatch({ type: "complete" }));
|
|
946
|
-
break;
|
|
947
|
-
default: break;
|
|
945
|
+
case "Complete": queueMicrotask(() => this._eventManager.dispatch({ type: "complete" }));
|
|
948
946
|
}
|
|
949
947
|
}
|
|
950
948
|
}
|
|
@@ -1019,13 +1017,10 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1019
1017
|
state: t.state ?? ""
|
|
1020
1018
|
});
|
|
1021
1019
|
break;
|
|
1022
|
-
case "Error":
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
});
|
|
1027
|
-
break;
|
|
1028
|
-
default: break;
|
|
1020
|
+
case "Error": this._eventManager.dispatch({
|
|
1021
|
+
type: "stateMachineError",
|
|
1022
|
+
error: t.message ?? ""
|
|
1023
|
+
});
|
|
1029
1024
|
}
|
|
1030
1025
|
}
|
|
1031
1026
|
let t;
|
|
@@ -1204,7 +1199,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1204
1199
|
}
|
|
1205
1200
|
this._bufferMismatchCount = 0, this._lastExpectedBufferSize = r;
|
|
1206
1201
|
let i = this._cachedImageData;
|
|
1207
|
-
if (
|
|
1202
|
+
if (i === null || i.width !== t || i.height !== n || i.data.byteLength !== r || this._cachedImageDataBuffer !== e.buffer || this._cachedImageDataByteOffset !== e.byteOffset) {
|
|
1208
1203
|
if (typeof ImageData > "u") this._cachedImageData = this._context.createImageData(t, n);
|
|
1209
1204
|
else {
|
|
1210
1205
|
let r = new Uint8ClampedArray(e.buffer, e.byteOffset, e.byteLength);
|
|
@@ -1234,15 +1229,9 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1234
1229
|
this._animationFrameId === null && this._dotLottieCore && !this._isFrozen && (this._dotLottieCore.is_playing() || this._isStateMachineRunning) && (this._animationFrameId = this._frameManager.requestAnimationFrame(this._boundAnimationLoop));
|
|
1235
1230
|
}
|
|
1236
1231
|
_animationLoop(e) {
|
|
1237
|
-
if (this._dotLottieCore === null)
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
}
|
|
1241
|
-
if (!this._dotLottieCore.is_playing() && !this._isStateMachineRunning) {
|
|
1242
|
-
this._stopAnimationLoop();
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
try {
|
|
1232
|
+
if (this._dotLottieCore === null) this._stopAnimationLoop();
|
|
1233
|
+
else if (!this._dotLottieCore.is_playing() && !this._isStateMachineRunning) this._stopAnimationLoop();
|
|
1234
|
+
else try {
|
|
1246
1235
|
let t = this._lastFrameTime === null ? 0 : e - this._lastFrameTime;
|
|
1247
1236
|
this._lastFrameTime = e;
|
|
1248
1237
|
let n = this._isStateMachineRunning ? this._dotLottieCore.sm_tick(t) : this._dotLottieCore.tick(t);
|
|
@@ -1322,7 +1311,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1322
1311
|
this._animationFrameId === null && (this._isFrozen = !1, this._eventManager.dispatch({ type: "unfreeze" }), this._startAnimationLoop());
|
|
1323
1312
|
}
|
|
1324
1313
|
resize() {
|
|
1325
|
-
if (
|
|
1314
|
+
if (this._dotLottieCore && this.isLoaded && this._canvas) {
|
|
1326
1315
|
if (h && this._canvas instanceof HTMLCanvasElement) {
|
|
1327
1316
|
let e = this._renderConfig.devicePixelRatio || window.devicePixelRatio || 1, { height: t, width: n } = this._canvas.getBoundingClientRect();
|
|
1328
1317
|
t !== 0 && n !== 0 && (this._canvas.width = n * e, this._canvas.height = t * e);
|
|
@@ -1331,7 +1320,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1331
1320
|
}
|
|
1332
1321
|
}
|
|
1333
1322
|
setCanvas(e) {
|
|
1334
|
-
if (
|
|
1323
|
+
if (e && this._canvas !== e && (this._canvas && this._cleanupCanvas(), this._canvas = e, this._initializeCanvas(), this._pendingLoad)) {
|
|
1335
1324
|
let e = this._pendingLoad;
|
|
1336
1325
|
this._pendingLoad = null, e.data ? this._loadFromData(e.data) : e.src && this._loadFromSrc(e.src);
|
|
1337
1326
|
}
|
|
@@ -1504,7 +1493,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1504
1493
|
this._dotLottieCore !== null && this._dotLottieCore.set_layout(e.fit ?? "contain", e.align?.[0] ?? .5, e.align?.[1] ?? .5);
|
|
1505
1494
|
}
|
|
1506
1495
|
setViewport(e, t, n, r) {
|
|
1507
|
-
return this._dotLottieCore
|
|
1496
|
+
return this._dotLottieCore !== null && this._dotLottieCore.set_viewport(e, t, n, r);
|
|
1508
1497
|
}
|
|
1509
1498
|
static setWasmUrl(e) {
|
|
1510
1499
|
q.setWasmUrl(e);
|
|
@@ -1647,7 +1636,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
1647
1636
|
_cleanupStateMachineListeners() {
|
|
1648
1637
|
h && this._canvas instanceof HTMLCanvasElement && (this._boundOnClick &&= (this._canvas.removeEventListener("click", this._boundOnClick), null), this._boundOnPointerUp &&= (this._canvas.removeEventListener("pointerup", this._boundOnPointerUp), null), this._boundOnPointerDown &&= (this._canvas.removeEventListener("pointerdown", this._boundOnPointerDown), null), this._boundOnPointerMove &&= (this._canvas.removeEventListener("pointermove", this._boundOnPointerMove), null), this._boundOnPointerEnter &&= (this._canvas.removeEventListener("pointerenter", this._boundOnPointerEnter), null), this._boundOnPointerLeave &&= (this._canvas.removeEventListener("pointerleave", this._boundOnPointerLeave), null));
|
|
1649
1638
|
}
|
|
1650
|
-
},
|
|
1639
|
+
}, me = class {
|
|
1651
1640
|
constructor() {
|
|
1652
1641
|
if (typeof Worker > "u") throw Error("Worker is not supported in this environment.");
|
|
1653
1642
|
let e = new Blob([new Uint8Array([
|
|
@@ -70503,7 +70492,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
70503
70492
|
])], { type: "application/javascript" }), t = URL.createObjectURL(e), n = new Worker(t);
|
|
70504
70493
|
return URL.revokeObjectURL(t), n;
|
|
70505
70494
|
}
|
|
70506
|
-
},
|
|
70495
|
+
}, he = class {
|
|
70507
70496
|
constructor() {
|
|
70508
70497
|
d(this, "_workers", /* @__PURE__ */ new Map()), d(this, "_animationWorkerMap", /* @__PURE__ */ new Map()), d(this, "_eventHandlers", /* @__PURE__ */ new Map()), d(this, "_rpcHandlers", /* @__PURE__ */ new Map()), d(this, "_routeMessage", (e) => {
|
|
70509
70498
|
let t = e.data;
|
|
@@ -70521,7 +70510,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
70521
70510
|
}
|
|
70522
70511
|
getWorker(e) {
|
|
70523
70512
|
let t = this._workers.get(e);
|
|
70524
|
-
return t || (t = new
|
|
70513
|
+
return t || (t = new me(), t.addEventListener("message", this._routeMessage), this._workers.set(e, t)), t;
|
|
70525
70514
|
}
|
|
70526
70515
|
assignAnimationToWorker(e, t) {
|
|
70527
70516
|
this._animationWorkerMap.set(e, t);
|
|
@@ -70554,7 +70543,7 @@ var q = fe(I, `https://cdn.jsdelivr.net/npm/${y}@${v}/dist/dotlottie-player.wasm
|
|
|
70554
70543
|
this._rpcHandlers.delete(e);
|
|
70555
70544
|
}
|
|
70556
70545
|
};
|
|
70557
|
-
function
|
|
70546
|
+
function ge(e, t) {
|
|
70558
70547
|
if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement) {
|
|
70559
70548
|
let { height: n, width: r } = e.getBoundingClientRect();
|
|
70560
70549
|
if (n !== 0 && r !== 0) return {
|
|
@@ -70632,7 +70621,7 @@ var Q = class e {
|
|
|
70632
70621
|
...e,
|
|
70633
70622
|
canvas: t
|
|
70634
70623
|
},
|
|
70635
|
-
...
|
|
70624
|
+
...ge(this._canvas, e.renderConfig?.devicePixelRatio || U())
|
|
70636
70625
|
}, [t]);
|
|
70637
70626
|
if (n !== this._id) throw Error("Instance ID mismatch");
|
|
70638
70627
|
this._created = !0, await this._updateDotLottieInstanceState();
|
|
@@ -70782,17 +70771,13 @@ var Q = class e {
|
|
|
70782
70771
|
return await this._updateDotLottieInstanceState(), t;
|
|
70783
70772
|
}
|
|
70784
70773
|
async load(e) {
|
|
70785
|
-
|
|
70786
|
-
this._pendingConfig &&= {
|
|
70787
|
-
...this._pendingConfig,
|
|
70788
|
-
...e
|
|
70789
|
-
};
|
|
70790
|
-
return;
|
|
70791
|
-
}
|
|
70792
|
-
await this._sendMessage("load", {
|
|
70774
|
+
this._created ? (await this._sendMessage("load", {
|
|
70793
70775
|
config: e,
|
|
70794
70776
|
instanceId: this._id
|
|
70795
|
-
}), await this._updateDotLottieInstanceState()
|
|
70777
|
+
}), await this._updateDotLottieInstanceState()) : this._pendingConfig &&= {
|
|
70778
|
+
...this._pendingConfig,
|
|
70779
|
+
...e
|
|
70780
|
+
};
|
|
70796
70781
|
}
|
|
70797
70782
|
async setLoop(e) {
|
|
70798
70783
|
this._created && (await this._sendMessage("setLoop", {
|
|
@@ -70808,7 +70793,7 @@ var Q = class e {
|
|
|
70808
70793
|
}
|
|
70809
70794
|
async resize() {
|
|
70810
70795
|
if (!this._created || !this._canvas) return;
|
|
70811
|
-
let { height: e, width: t } =
|
|
70796
|
+
let { height: e, width: t } = ge(this._canvas, this._dotLottieInstanceState.renderConfig.devicePixelRatio || U());
|
|
70812
70797
|
await this._sendMessage("resize", {
|
|
70813
70798
|
height: e,
|
|
70814
70799
|
instanceId: this._id,
|
|
@@ -71208,9 +71193,8 @@ var Q = class e {
|
|
|
71208
71193
|
h && this._canvas instanceof HTMLCanvasElement && (this._boundOnClick &&= (this._canvas.removeEventListener("click", this._boundOnClick), null), this._boundOnPointerUp &&= (this._canvas.removeEventListener("pointerup", this._boundOnPointerUp), null), this._boundOnPointerDown &&= (this._canvas.removeEventListener("pointerdown", this._boundOnPointerDown), null), this._boundOnPointerMove &&= (this._canvas.removeEventListener("pointermove", this._boundOnPointerMove), null), this._boundOnPointerEnter &&= (this._canvas.removeEventListener("pointerenter", this._boundOnPointerEnter), null), this._boundOnPointerLeave &&= (this._canvas.removeEventListener("pointerleave", this._boundOnPointerLeave), null));
|
|
71209
71194
|
}
|
|
71210
71195
|
};
|
|
71211
|
-
d(Q, "_workerManager", new
|
|
71212
|
-
|
|
71213
|
-
//#region node_modules/@lottiefiles/dotlottie-react/dist/index.js
|
|
71196
|
+
d(Q, "_workerManager", new he()), d(Q, "_wasmUrl", "");
|
|
71197
|
+
// node_modules/@lottiefiles/dotlottie-react/dist/index.js
|
|
71214
71198
|
var _e = ({ animationId: e, autoplay: t, backgroundColor: n, className: o, createDotLottie: c, data: l, dotLottieRefCallback: u, layout: d, loop: f, mode: p, playOnHover: m, renderConfig: h, segment: g, speed: _, src: v, stateMachineConfig: y, stateMachineId: b, style: x, themeData: S, themeId: C, useFrameInterpolation: w, workerId: T, ...E }) => {
|
|
71215
71199
|
let D = a(null), O = a(null), k = a(u), A = {
|
|
71216
71200
|
speed: _,
|
|
@@ -71303,13 +71287,19 @@ var _e = ({ animationId: e, autoplay: t, backgroundColor: n, className: o, creat
|
|
|
71303
71287
|
...E
|
|
71304
71288
|
})
|
|
71305
71289
|
});
|
|
71306
|
-
}, ve = (e) => new
|
|
71290
|
+
}, ve = (e) => new X(e), ye = (e) => s(_e, {
|
|
71307
71291
|
...e,
|
|
71308
71292
|
createDotLottie: ve
|
|
71309
|
-
}),
|
|
71293
|
+
}), be = (e) => {
|
|
71294
|
+
Q.setWasmUrl(e), X.setWasmUrl(e);
|
|
71295
|
+
}, xe, Se = (e) => {
|
|
71296
|
+
e && e !== xe && (xe = e, be(e));
|
|
71297
|
+
}, $ = n.memo(({ item: n, play: r = !1, setDotLottie: i }) => {
|
|
71310
71298
|
let a = (e) => {
|
|
71311
71299
|
i(e);
|
|
71312
|
-
}, c = e()
|
|
71300
|
+
}, c = e();
|
|
71301
|
+
Se(c.lottieWasmUrl);
|
|
71302
|
+
let { lottieConfig: l } = n;
|
|
71313
71303
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s(ye, {
|
|
71314
71304
|
src: t(c, n),
|
|
71315
71305
|
style: {
|
|
@@ -71327,6 +71317,5 @@ var _e = ({ animationId: e, autoplay: t, backgroundColor: n, className: o, creat
|
|
|
71327
71317
|
}) });
|
|
71328
71318
|
});
|
|
71329
71319
|
$.displayName = "LottieFile";
|
|
71330
|
-
var
|
|
71331
|
-
|
|
71332
|
-
export { $ as LottieFile, be as default };
|
|
71320
|
+
var Ce = n.memo($);
|
|
71321
|
+
export { $ as LottieFile, Ce as default };
|