@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.
@@ -5,4 +5,6 @@ export type BookContextType = {
5
5
  slug: string;
6
6
  assetConfig: AssetConfig;
7
7
  analytics?: PlayerAnalytics;
8
+ /** Self-hosted URL of the dotlottie WebAssembly engine; see `PlayerProps.lottieWasmUrl`. */
9
+ lottieWasmUrl?: string;
8
10
  };
@@ -0,0 +1 @@
1
+ "use client";var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime");var u=c.default.createContext({bookId:``,slug:``,assetConfig:{type:`static`,staticFolder:``},analytics:void 0}),d=({bookId:e,slug:t,assetConfig:n,analytics:r,lottieWasmUrl:i,children:a})=>(0,l.jsx)(u.Provider,{value:{bookId:e,slug:t,assetConfig:n,analytics:r,lottieWasmUrl:i},children:a}),f=()=>(0,c.useContext)(u),p=(e,t,n)=>{let r=n??e.assetConfig,i=(t?.path??t?.url??``).split(`/`).pop()||t?.filename||t?.name||``;return r.type===`api`?`${r.assetsHost}${t?.path??t?.url??``}`:`/${r.staticFolder}/${encodeURIComponent(e.slug)}/assets/${i}`},m=(e,t)=>{let n=e.assetConfig,r=t?.path??t?.mp3??``,i=r.split(`/`).pop()||t?.filename||t?.name||``;return n.type===`api`?`${n.assetsHost}${r}`:`/${n.staticFolder}/${encodeURIComponent(e.slug)}/audio/${i}`},h=e=>new Promise(t=>{setTimeout(t,e)});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import e, { useContext as t } from "react";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
- //#region src/context/BookProvider.tsx
4
+ // src/context/BookProvider.tsx
5
5
  var r = e.createContext({
6
6
  bookId: "",
7
7
  slug: "",
@@ -10,14 +10,15 @@ var r = e.createContext({
10
10
  staticFolder: ""
11
11
  },
12
12
  analytics: void 0
13
- }), i = ({ bookId: e, slug: t, assetConfig: i, analytics: a, children: o }) => /* @__PURE__ */ n(r.Provider, {
13
+ }), i = ({ bookId: e, slug: t, assetConfig: i, analytics: a, lottieWasmUrl: o, children: s }) => /* @__PURE__ */ n(r.Provider, {
14
14
  value: {
15
15
  bookId: e,
16
16
  slug: t,
17
17
  assetConfig: i,
18
- analytics: a
18
+ analytics: a,
19
+ lottieWasmUrl: o
19
20
  },
20
- children: o
21
+ children: s
21
22
  }), a = () => t(r), o = (e, t, n) => {
22
23
  let r = n ?? e.assetConfig, i = (t?.path ?? t?.url ?? "").split("/").pop() || t?.filename || t?.name || "";
23
24
  return r.type === "api" ? `${r.assetsHost}${t?.path ?? t?.url ?? ""}` : `/${r.staticFolder}/${encodeURIComponent(e.slug)}/assets/${i}`;
@@ -27,5 +28,4 @@ var r = e.createContext({
27
28
  }, c = (e) => new Promise((t) => {
28
29
  setTimeout(t, e);
29
30
  });
30
- //#endregion
31
31
  export { a, i, o as n, s as r, c as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curiouslearning/gdl-player-core",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Package containing the core player components for the GDL interactive books",
5
5
  "homepage": "https://github.com/curiouslearning/gdl-player-core#readme",
6
6
  "bugs": {
@@ -39,7 +39,6 @@
39
39
  "dev": "vite --config vite.dev.config.ts"
40
40
  },
41
41
  "devDependencies": {
42
- "@semantic-release/exec": "^6.0.3",
43
42
  "@semantic-release/git": "^11.0.1",
44
43
  "@types/node": "^25.9.2",
45
44
  "@types/react": "^19.2.17",
@@ -1,12 +0,0 @@
1
- "use client";
2
- import { a as e, n as t } from "./utils-B8vKMuMn.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- //#region src/components/Image.tsx
5
- var r = ({ mediaItem: r }) => /* @__PURE__ */ n("img", {
6
- src: t(e(), r),
7
- alt: "",
8
- loading: "lazy",
9
- className: "max-w-full max-h-full w-full h-full -z-10"
10
- });
11
- //#endregion
12
- export { r as Image, r as default };
@@ -1 +0,0 @@
1
- "use client";const e=require("./utils-Cu46IIpo.cjs");let t=require("react/jsx-runtime");var n=({mediaItem:n})=>(0,t.jsx)(`img`,{src:e.n(e.a(),n),alt:``,loading:`lazy`,className:`max-w-full max-h-full w-full h-full -z-10`});exports.Image=n,exports.default=n;