@gamelearn/arcade-components 3.2.5 → 3.2.6

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.
@@ -27551,8 +27551,7 @@ const Vignette = ({ vignette: o, alias: e, translate: r, backgroundImageCover: t
27551
27551
  }
27552
27552
  )
27553
27553
  ] }) }) : null;
27554
- };
27555
- function CartelComponent({
27554
+ }, CartelComponent = ({
27556
27555
  img: o,
27557
27556
  text: e,
27558
27557
  audio: r,
@@ -27562,54 +27561,55 @@ function CartelComponent({
27562
27561
  soundActions: u,
27563
27562
  audioVolume: l,
27564
27563
  pause: f,
27565
- keyboardControl: c
27566
- }) {
27567
- const h = (T) => a({ type: "translate", payload: T }), y = (o == null ? void 0 : o.url) || "https://min.gamelearn.io/css-resources/gamelearn/resources/conversation.jpg", E = useRef(), p = useRef(), [_] = u;
27564
+ keyboardControl: c,
27565
+ backgroundImageCover: h = !1
27566
+ }) => {
27567
+ const y = (x) => a({ type: "translate", payload: x }), E = (o == null ? void 0 : o.url) || "https://min.gamelearn.io/css-resources/gamelearn/resources/conversation.jpg", p = useRef(), _ = useRef(), [g] = u;
27568
27568
  useEkho({ audioType: t, voice: n, text: e, audio: r, soundActions: u, emitEvent: a, volume: l, pauseTTS: f });
27569
- const g = () => {
27570
- _("click-ui"), a({ type: "success" });
27569
+ const S = () => {
27570
+ g("click-ui"), a({ type: "success" });
27571
27571
  };
27572
- c(null, g, g);
27573
- const S = (T, x) => window.matchMedia("(min-width: 1280px)").matches ? x : T, C = useCallback(() => {
27574
- if (e && p.current) {
27575
- const T = p.current.naturalWidth / p.current.naturalHeight;
27576
- let x = p.current.height * T, A = p.current.height;
27577
- if (x > p.current.width && (x = p.current.width, A = p.current.width / T), E.current.style.width = `${x}px`, window.innerHeight < p.current.width)
27578
- E.current.style.bottom = `${S(24, 48) + S(36, 100)}px`;
27572
+ c(null, S, S);
27573
+ const C = (x, A) => window.matchMedia("(min-width: 1280px)").matches ? A : x, T = useCallback(() => {
27574
+ if (h !== !0 && e && _.current) {
27575
+ const x = _.current.naturalWidth / _.current.naturalHeight;
27576
+ let A = _.current.height * x, R = _.current.height;
27577
+ if (A > _.current.width && (A = _.current.width, R = _.current.width / x), p.current.style.width = `${A}px`, window.innerHeight < _.current.width)
27578
+ p.current.style.bottom = `${C(24, 48) + C(36, 100)}px`;
27579
27579
  else {
27580
- const R = (window.innerHeight - A) / 2 + S(36, 100);
27581
- E.current.style.bottom = `${R}px`;
27580
+ const P = (window.innerHeight - R) / 2 + C(36, 100);
27581
+ p.current.style.bottom = `${P}px`;
27582
27582
  }
27583
27583
  }
27584
- }, [e]);
27584
+ }, [h, e]);
27585
27585
  return useEffect(() => {
27586
- p.current && new ResizeObserver(() => S(24, 48) && C()).observe(p.current);
27586
+ _.current && new ResizeObserver(() => C(24, 48) && T()).observe(_.current);
27587
27587
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
27588
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cartel", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cartel__imagewrap", children: [
27588
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `cartel ${h ? "cartel--cover" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cartel__imagewrap", children: [
27589
27589
  /* @__PURE__ */ jsxRuntimeExports.jsx(
27590
27590
  "img",
27591
27591
  {
27592
- ref: p,
27593
- onLoad: C,
27592
+ ref: _,
27593
+ onLoad: T,
27594
27594
  className: "cartel__image",
27595
- src: y,
27595
+ src: E,
27596
27596
  alt: "cartel pic"
27597
27597
  }
27598
27598
  ),
27599
- e ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: E, className: "cartel__textwrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cartel__text", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: e }) }) }) : null
27599
+ e ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: p, className: "cartel__textwrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cartel__text", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: e }) }) }) : null
27600
27600
  ] }) }),
27601
27601
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "position--absolute center right", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
27602
27602
  "button",
27603
27603
  {
27604
27604
  type: "button",
27605
27605
  className: "gat--btn__round",
27606
- onClick: () => g(),
27607
- "aria-label": h("storylines.misc.closePiece"),
27606
+ onClick: () => S(),
27607
+ "aria-label": y("storylines.misc.closePiece"),
27608
27608
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: LangIsRtl() ? "icon-back" : "icon-next" })
27609
27609
  }
27610
27610
  ) })
27611
27611
  ] });
27612
- }
27612
+ };
27613
27613
  var Typist$1 = { exports: {} };
27614
27614
  (function(o) {
27615
27615
  o.exports = /******/
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "3.2.5",
5
+ "version": "3.2.6",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",