@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.
@@ -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
- var R;
26525
- if (n.current) {
26526
- const P = new Box3();
26527
- P.setFromObject(A);
26528
- const w = P.getSize(new Vector3());
26529
- if (n.current.position.fromArray(defaultCamPos), n.current.rotation.set(0, 0, 0), n.current.updateProjectionMatrix(), n.current.layers.enableAll(), o.type === "character") {
26530
- y.current = A;
26531
- let O;
26532
- const k = (R = o.emotion) == null ? void 0 : R.includes("seated");
26533
- n.current.position.setY(w.y - 1.5 * 1.3), A.traverse((D) => {
26534
- const F = D.name.toLowerCase();
26535
- if (D.isBone && boneWhiteList.includes(F)) {
26536
- const B = k ? 1 : 0, V = new Vector3().setFromMatrixPosition(D.matrixWorld);
26537
- if (F === "head_m") {
26538
- O = V;
26539
- return;
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
- n.current.position.setY(V.y - B), n.current.position.setX(V.x - 0.5);
26542
- }
26543
- }), O && !k && n.current.lookAt(O), n.current.zoom = 1.5;
26544
- } else
26545
- o.type === "object" && (cameraFitAnyObject(A, n.current), n.current.zoom = 1);
26546
- n.current.updateProjectionMatrix();
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
- 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;
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 g = () => {
27570
- _("click-ui"), a({ type: "success" });
27571
+ const S = () => {
27572
+ g("click-ui"), a({ type: "success" });
27571
27573
  };
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`;
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 R = (window.innerHeight - A) / 2 + S(36, 100);
27581
- E.current.style.bottom = `${R}px`;
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
- p.current && new ResizeObserver(() => S(24, 48) && C()).observe(p.current);
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", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cartel__imagewrap", children: [
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: p,
27593
- onLoad: C,
27594
+ ref: _,
27595
+ onLoad: T,
27594
27596
  className: "cartel__image",
27595
- src: y,
27597
+ src: E,
27596
27598
  alt: "cartel pic"
27597
27599
  }
27598
27600
  ),
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
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: () => g(),
27607
- "aria-label": h("storylines.misc.closePiece"),
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 = /******/
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.7",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",