analytica-frontend-lib 1.1.91 → 1.1.92

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/index.js CHANGED
@@ -8389,7 +8389,6 @@ var DownloadButton = ({
8389
8389
  await new Promise((resolve) => setTimeout(resolve, 200));
8390
8390
  }
8391
8391
  } catch (error) {
8392
- console.error(`Erro ao baixar ${item.label}:`, error);
8393
8392
  onDownloadError?.(
8394
8393
  item.type,
8395
8394
  error instanceof Error ? error : new Error(`Falha ao baixar ${item.label}`)
@@ -10252,7 +10251,6 @@ var useQuizStore = (0, import_zustand9.create)()(
10252
10251
  const activityId = quiz.id;
10253
10252
  const userId = get().getUserId();
10254
10253
  if (!userId || userId === "") {
10255
- console.warn("selectAnswer called before userId is set");
10256
10254
  return;
10257
10255
  }
10258
10256
  const question = quiz.questions.find((q) => q.id === questionId);
@@ -10286,7 +10284,6 @@ var useQuizStore = (0, import_zustand9.create)()(
10286
10284
  const activityId = quiz.id;
10287
10285
  const userId = get().getUserId();
10288
10286
  if (!userId || userId === "") {
10289
- console.warn("selectMultipleAnswer called before userId is set");
10290
10287
  return;
10291
10288
  }
10292
10289
  const question = quiz.questions.find((q) => q.id === questionId);
@@ -10321,16 +10318,10 @@ var useQuizStore = (0, import_zustand9.create)()(
10321
10318
  const activityId = quiz.id;
10322
10319
  const userId = get().getUserId();
10323
10320
  if (!userId || userId === "") {
10324
- console.warn(
10325
- "selectDissertativeAnswer called before userId is set"
10326
- );
10327
10321
  return;
10328
10322
  }
10329
10323
  const question = quiz.questions.find((q) => q.id === questionId);
10330
10324
  if (!question || question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */) {
10331
- console.warn(
10332
- "selectDissertativeAnswer called for non-dissertative question"
10333
- );
10334
10325
  return;
10335
10326
  }
10336
10327
  const existingAnswerIndex = userAnswers.findIndex(
@@ -10364,7 +10355,6 @@ var useQuizStore = (0, import_zustand9.create)()(
10364
10355
  const activityId = quiz.id;
10365
10356
  const userId = get().getUserId();
10366
10357
  if (!userId || userId === "") {
10367
- console.warn("skipQuestion called before userId is set");
10368
10358
  return;
10369
10359
  }
10370
10360
  const existingAnswerIndex = userAnswers.findIndex(
@@ -10397,7 +10387,6 @@ var useQuizStore = (0, import_zustand9.create)()(
10397
10387
  const activityId = quiz.id;
10398
10388
  const userId = get().getUserId();
10399
10389
  if (!userId || userId === "") {
10400
- console.warn("addUserAnswer called before userId is set");
10401
10390
  return;
10402
10391
  }
10403
10392
  const question = quiz.questions.find((q) => q.id === questionId);
@@ -10625,9 +10614,6 @@ var useQuizStore = (0, import_zustand9.create)()(
10625
10614
  );
10626
10615
  }
10627
10616
  if (questionIndex === -1) {
10628
- console.warn(
10629
- `Question with id "${question.id}" not found in active quiz`
10630
- );
10631
10617
  return;
10632
10618
  }
10633
10619
  set({ currentQuestionIndex: questionIndex });
@@ -11984,34 +11970,16 @@ var QuizFooter = (0, import_react36.forwardRef)(
11984
11970
  children: "Avan\xE7ar"
11985
11971
  }
11986
11972
  )
11987
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
11988
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: quiz?.canRetry && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11989
- Button_default,
11990
- {
11991
- variant: "link",
11992
- action: "primary",
11993
- size: "medium",
11994
- onClick: () => openModal("modalResolution"),
11995
- children: "Ver Resolu\xE7\xE3o"
11996
- }
11997
- ) }),
11998
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11999
- Button_default,
12000
- {
12001
- variant: "solid",
12002
- action: "primary",
12003
- size: "medium",
12004
- onClick: () => {
12005
- if (quiz?.canRetry) {
12006
- onRepeat?.();
12007
- } else {
12008
- openModal("modalResolution");
12009
- }
12010
- },
12011
- children: quiz?.canRetry ? `Repetir ${getTypeLabel(quiz.type)}` : "Ver Resolu\xE7\xE3o"
12012
- }
12013
- )
12014
- ] })
11973
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11974
+ Button_default,
11975
+ {
11976
+ variant: "link",
11977
+ action: "primary",
11978
+ size: "medium",
11979
+ onClick: () => openModal("modalResolution"),
11980
+ children: "Ver resolu\xE7\xE3o"
11981
+ }
11982
+ ) })
12015
11983
  }
12016
11984
  ),
12017
11985
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
@@ -12290,17 +12258,32 @@ var QuizHeaderResult = (0, import_react37.forwardRef)(
12290
12258
  );
12291
12259
  }
12292
12260
  );
12293
- var QuizResultHeaderTitle = (0, import_react37.forwardRef)(({ className, showBadge = true, ...props }, ref) => {
12261
+ var QuizResultHeaderTitle = (0, import_react37.forwardRef)(({ className, showBadge = true, onRepeat, canRetry, ...props }, ref) => {
12294
12262
  const { quiz } = useQuizStore();
12295
12263
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
12296
12264
  "div",
12297
12265
  {
12298
12266
  ref,
12299
- className: cn("flex flex-row pt-4 justify-between", className),
12267
+ className: cn(
12268
+ "flex flex-row pt-4 justify-between items-center",
12269
+ className
12270
+ ),
12300
12271
  ...props,
12301
12272
  children: [
12302
12273
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
12303
- showBadge && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(QuizBadge, { subtype: quiz?.subtype || void 0 })
12274
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-row gap-3 items-center", children: [
12275
+ canRetry && onRepeat && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
12276
+ Button_default,
12277
+ {
12278
+ variant: "solid",
12279
+ action: "primary",
12280
+ size: "medium",
12281
+ onClick: onRepeat,
12282
+ children: "Repetir question\xE1rio"
12283
+ }
12284
+ ),
12285
+ showBadge && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(QuizBadge, { subtype: quiz?.subtype || void 0 })
12286
+ ] })
12304
12287
  ]
12305
12288
  }
12306
12289
  );
@@ -12492,14 +12475,15 @@ var QuizListResult = (0, import_react37.forwardRef)(({ className, onSubjectClick
12492
12475
  });
12493
12476
  var QuizListResultByMateria = ({
12494
12477
  subject,
12495
- onQuestionClick
12478
+ onQuestionClick,
12479
+ subjectName
12496
12480
  }) => {
12497
12481
  const { getQuestionsGroupedBySubject, getQuestionIndex } = useQuizStore();
12498
12482
  const groupedQuestions = getQuestionsGroupedBySubject();
12499
12483
  const answeredQuestions = groupedQuestions[subject] || [];
12500
12484
  const formattedQuestions = subject == "all" ? Object.values(groupedQuestions).flat() : answeredQuestions;
12501
12485
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col", children: [
12502
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: answeredQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" }) }),
12486
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subjectName || formattedQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name || "Sem mat\xE9ria" }) }),
12503
12487
  /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: "flex flex-col ", children: [
12504
12488
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
12505
12489
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: formattedQuestions.map((question) => {