@gamelearn/arcade-components 3.12.1 → 3.12.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.
@@ -53039,28 +53039,53 @@ function WebBuilderPuzzleComponent({
53039
53039
  p && !u ? /* @__PURE__ */ jsxRuntimeExports.jsx(PublishButton, { onPublish: I, translate: G }) : null
53040
53040
  ] });
53041
53041
  }
53042
- function Card({ card: o, handleClick: e, flipped: r, cardIndex: t, wrongOrder: n }) {
53043
- const a = () => !(o.img || o.text), l = () => {
53044
- const _ = (o.img || {}).url;
53045
- return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: _, alt: "" });
53046
- }, u = () => o.text ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `card-selector-item__textbox ${o.img ? "" : "card-selector-item__textbox--noimage"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__text", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: o.text || "_" }) }) }) : null, f = () => !!(r && !o.correct || !r), c = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__feedback card-selector-item__feedback--error", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__feedbackicon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "icon-error-circle-black" }) }) }), h = () => o.order ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__order", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: o.order }) }) : null, v = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "card-selector-item__feedback card-selector-item__feedback--success ", children: [
53047
- h(),
53042
+ function CardImage({ img: o }) {
53043
+ const r = (o || {}).url;
53044
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: r, alt: "" });
53045
+ }
53046
+ function CardText({ text: o, hasImage: e }) {
53047
+ return o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `card-selector-item__textbox ${e ? "" : "card-selector-item__textbox--noimage"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__text", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: o || "_" }) }) }) : null;
53048
+ }
53049
+ function CardNumber({ order: o }) {
53050
+ return o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__order", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: o }) }) : null;
53051
+ }
53052
+ function CardSuccess({ order: o }) {
53053
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "card-selector-item__feedback card-selector-item__feedback--success ", children: [
53054
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardNumber, { order: o }),
53048
53055
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__feedbackicon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "icon-check-circle-black" }) })
53049
- ] }), E = () => !a() && r && o.correct && !n ? v() : !a() && r ? c() : null;
53056
+ ] });
53057
+ }
53058
+ function CardFail() {
53059
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__feedback card-selector-item__feedback--error", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "card-selector-item__feedbackicon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "icon-error-circle-black" }) }) });
53060
+ }
53061
+ function CardContainer({ flipped: o, correct: e, order: r, wrongOrder: t, isEmpty: n }) {
53062
+ return !n && o && e && !t ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardSuccess, { order: r }) : !n && o ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardFail, {}) : null;
53063
+ }
53064
+ function Card({ card: o, handleClick: e, flipped: r, cardIndex: t, wrongOrder: n }) {
53065
+ const a = () => !(o.img || o.text), l = () => !!(r && !o.correct || !r);
53050
53066
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
53051
53067
  "button",
53052
53068
  {
53053
53069
  type: "button",
53054
53070
  order: o.order,
53055
53071
  onClick: () => {
53056
- !a() && f() && e(t);
53072
+ !a() && l() && e(t);
53057
53073
  },
53058
53074
  className: `unset-button card-selector-item ${a() ? "card-selector-item--empty" : ""}`,
53059
53075
  "aria-label": o.text ? o.text : null,
53060
53076
  children: [
53061
- l(),
53062
- u(),
53063
- E()
53077
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardImage, { img: o.img }),
53078
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardText, { text: o.text, hasImage: !!o.img }),
53079
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
53080
+ CardContainer,
53081
+ {
53082
+ isEmpty: a(),
53083
+ flipped: r,
53084
+ wrongOrder: n,
53085
+ order: o.order,
53086
+ correct: o.correct
53087
+ }
53088
+ )
53064
53089
  ]
53065
53090
  }
53066
53091
  );
@@ -53107,9 +53132,9 @@ function Board({
53107
53132
  C();
53108
53133
  }, 1e3);
53109
53134
  };
53110
- function P(F) {
53111
- const G = Array.from(h);
53112
- G[F] = F, v(G);
53135
+ function P(F, G = F) {
53136
+ const H = Array.from(h);
53137
+ H[F] = G, v(H);
53113
53138
  }
53114
53139
  const O = useCallback(() => {
53115
53140
  const F = [];
@@ -53129,18 +53154,17 @@ function Board({
53129
53154
  if (!x && !n)
53130
53155
  if (T("click-ui"), o[F].correct && !A)
53131
53156
  k(F);
53132
- else if (A)
53157
+ else if (A) {
53133
53158
  if (o[F].order === e)
53134
53159
  r(e + 1), k(F);
53135
- else {
53136
- if (o[F].order !== e) {
53137
- const W = Array.from(E);
53138
- W[F] = F, g(W), t(((G = o[F]) == null ? void 0 : G.id) || null, o[F].correct), w();
53139
- }
53140
- P(F);
53160
+ else if (P(F), o[F].order !== e) {
53161
+ const W = Array.from(E);
53162
+ W[F] = F, g(W), t(((G = o[F]) == null ? void 0 : G.id) || null, o[F].correct), w();
53141
53163
  }
53142
- else
53143
- t(((H = o[F]) == null ? void 0 : H.id) || null), w(), P(F);
53164
+ } else
53165
+ t(((H = o[F]) == null ? void 0 : H.id) || null), P(F), setTimeout(() => {
53166
+ P(F, !1);
53167
+ }, 1e3);
53144
53168
  };
53145
53169
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `cards-selector__content cards-selector__content-${o.length}`, children: o && o.map((F, G) => /* @__PURE__ */ jsxRuntimeExports.jsx(
53146
53170
  Card,