@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.
- package/dist/arcade-components.cjs +1 -1
- package/dist/arcade-components.js +26 -26
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
|
27570
|
-
|
|
27569
|
+
const S = () => {
|
|
27570
|
+
g("click-ui"), a({ type: "success" });
|
|
27571
27571
|
};
|
|
27572
|
-
c(null,
|
|
27573
|
-
const
|
|
27574
|
-
if (e &&
|
|
27575
|
-
const
|
|
27576
|
-
let
|
|
27577
|
-
if (
|
|
27578
|
-
|
|
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
|
|
27581
|
-
|
|
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
|
-
|
|
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"
|
|
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:
|
|
27593
|
-
onLoad:
|
|
27592
|
+
ref: _,
|
|
27593
|
+
onLoad: T,
|
|
27594
27594
|
className: "cartel__image",
|
|
27595
|
-
src:
|
|
27595
|
+
src: E,
|
|
27596
27596
|
alt: "cartel pic"
|
|
27597
27597
|
}
|
|
27598
27598
|
),
|
|
27599
|
-
e ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
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: () =>
|
|
27607
|
-
"aria-label":
|
|
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 = /******/
|