@gamelearn/arcade-components 3.2.5 → 3.2.7
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 +2 -2
- package/dist/arcade-components.js +51 -49
- package/package.json +1 -1
|
@@ -26521,30 +26521,32 @@ function Panel({ character: o, ttsStarted: e, active: r, emitEvent: t }) {
|
|
|
26521
26521
|
}, [(T = (C = (S = o == null ? void 0 : o.resource) == null ? void 0 : S.animations) == null ? void 0 : C.talking) == null ? void 0 : T.url, e, r, p, f]);
|
|
26522
26522
|
const _ = useCallback(
|
|
26523
26523
|
(A) => {
|
|
26524
|
-
|
|
26525
|
-
|
|
26526
|
-
|
|
26527
|
-
|
|
26528
|
-
|
|
26529
|
-
|
|
26530
|
-
|
|
26531
|
-
|
|
26532
|
-
|
|
26533
|
-
|
|
26534
|
-
|
|
26535
|
-
|
|
26536
|
-
|
|
26537
|
-
|
|
26538
|
-
|
|
26539
|
-
|
|
26524
|
+
setTimeout(() => {
|
|
26525
|
+
var R;
|
|
26526
|
+
if (n.current) {
|
|
26527
|
+
const P = new Box3();
|
|
26528
|
+
P.setFromObject(A);
|
|
26529
|
+
const w = P.getSize(new Vector3());
|
|
26530
|
+
if (n.current.position.fromArray(defaultCamPos), n.current.rotation.set(0, 0, 0), n.current.updateProjectionMatrix(), n.current.layers.enableAll(), o.type === "character") {
|
|
26531
|
+
y.current = A;
|
|
26532
|
+
let O;
|
|
26533
|
+
const k = (R = o.emotion) == null ? void 0 : R.includes("seated");
|
|
26534
|
+
n.current.position.setY(w.y - 1.5 * 1.3), A.traverse((D) => {
|
|
26535
|
+
const F = D.name.toLowerCase();
|
|
26536
|
+
if (D.isBone && boneWhiteList.includes(F)) {
|
|
26537
|
+
const B = k ? 1 : 0, V = new Vector3().setFromMatrixPosition(D.matrixWorld);
|
|
26538
|
+
if (F === "head_m") {
|
|
26539
|
+
O = V;
|
|
26540
|
+
return;
|
|
26541
|
+
}
|
|
26542
|
+
n.current.position.setY(V.y - B), n.current.position.setX(V.x - 0.5);
|
|
26540
26543
|
}
|
|
26541
|
-
|
|
26542
|
-
|
|
26543
|
-
|
|
26544
|
-
|
|
26545
|
-
|
|
26546
|
-
|
|
26547
|
-
}
|
|
26544
|
+
}), O && !k && n.current.lookAt(O), n.current.zoom = 1.5;
|
|
26545
|
+
} else
|
|
26546
|
+
o.type === "object" && (cameraFitAnyObject(A, n.current), n.current.zoom = 1);
|
|
26547
|
+
n.current.updateProjectionMatrix();
|
|
26548
|
+
}
|
|
26549
|
+
}, 150);
|
|
26548
26550
|
},
|
|
26549
26551
|
[o.type, o.emotion]
|
|
26550
26552
|
);
|
|
@@ -27551,8 +27553,7 @@ const Vignette = ({ vignette: o, alias: e, translate: r, backgroundImageCover: t
|
|
|
27551
27553
|
}
|
|
27552
27554
|
)
|
|
27553
27555
|
] }) }) : null;
|
|
27554
|
-
}
|
|
27555
|
-
function CartelComponent({
|
|
27556
|
+
}, CartelComponent = ({
|
|
27556
27557
|
img: o,
|
|
27557
27558
|
text: e,
|
|
27558
27559
|
audio: r,
|
|
@@ -27562,54 +27563,55 @@ function CartelComponent({
|
|
|
27562
27563
|
soundActions: u,
|
|
27563
27564
|
audioVolume: l,
|
|
27564
27565
|
pause: f,
|
|
27565
|
-
keyboardControl: c
|
|
27566
|
-
|
|
27567
|
-
|
|
27566
|
+
keyboardControl: c,
|
|
27567
|
+
backgroundImageCover: h = !1
|
|
27568
|
+
}) => {
|
|
27569
|
+
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
27570
|
useEkho({ audioType: t, voice: n, text: e, audio: r, soundActions: u, emitEvent: a, volume: l, pauseTTS: f });
|
|
27569
|
-
const
|
|
27570
|
-
|
|
27571
|
+
const S = () => {
|
|
27572
|
+
g("click-ui"), a({ type: "success" });
|
|
27571
27573
|
};
|
|
27572
|
-
c(null,
|
|
27573
|
-
const
|
|
27574
|
-
if (e &&
|
|
27575
|
-
const
|
|
27576
|
-
let
|
|
27577
|
-
if (
|
|
27578
|
-
|
|
27574
|
+
c(null, S, S);
|
|
27575
|
+
const C = (x, A) => window.matchMedia("(min-width: 1280px)").matches ? A : x, T = useCallback(() => {
|
|
27576
|
+
if (h !== !0 && e && _.current) {
|
|
27577
|
+
const x = _.current.naturalWidth / _.current.naturalHeight;
|
|
27578
|
+
let A = _.current.height * x, R = _.current.height;
|
|
27579
|
+
if (A > _.current.width && (A = _.current.width, R = _.current.width / x), p.current.style.width = `${A}px`, window.innerHeight < _.current.width)
|
|
27580
|
+
p.current.style.bottom = `${C(24, 48) + C(36, 100)}px`;
|
|
27579
27581
|
else {
|
|
27580
|
-
const
|
|
27581
|
-
|
|
27582
|
+
const P = (window.innerHeight - R) / 2 + C(36, 100);
|
|
27583
|
+
p.current.style.bottom = `${P}px`;
|
|
27582
27584
|
}
|
|
27583
27585
|
}
|
|
27584
|
-
}, [e]);
|
|
27586
|
+
}, [h, e]);
|
|
27585
27587
|
return useEffect(() => {
|
|
27586
|
-
|
|
27588
|
+
_.current && new ResizeObserver(() => C(24, 48) && T()).observe(_.current);
|
|
27587
27589
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
27588
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cartel"
|
|
27590
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `cartel ${h ? "cartel--cover" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cartel__imagewrap", children: [
|
|
27589
27591
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27590
27592
|
"img",
|
|
27591
27593
|
{
|
|
27592
|
-
ref:
|
|
27593
|
-
onLoad:
|
|
27594
|
+
ref: _,
|
|
27595
|
+
onLoad: T,
|
|
27594
27596
|
className: "cartel__image",
|
|
27595
|
-
src:
|
|
27597
|
+
src: E,
|
|
27596
27598
|
alt: "cartel pic"
|
|
27597
27599
|
}
|
|
27598
27600
|
),
|
|
27599
|
-
e ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
27601
|
+
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
27602
|
] }) }),
|
|
27601
27603
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "position--absolute center right", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27602
27604
|
"button",
|
|
27603
27605
|
{
|
|
27604
27606
|
type: "button",
|
|
27605
27607
|
className: "gat--btn__round",
|
|
27606
|
-
onClick: () =>
|
|
27607
|
-
"aria-label":
|
|
27608
|
+
onClick: () => S(),
|
|
27609
|
+
"aria-label": y("storylines.misc.closePiece"),
|
|
27608
27610
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: LangIsRtl() ? "icon-back" : "icon-next" })
|
|
27609
27611
|
}
|
|
27610
27612
|
) })
|
|
27611
27613
|
] });
|
|
27612
|
-
}
|
|
27614
|
+
};
|
|
27613
27615
|
var Typist$1 = { exports: {} };
|
|
27614
27616
|
(function(o) {
|
|
27615
27617
|
o.exports = /******/
|