analytica-frontend-lib 1.1.84 → 1.1.86
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/Quiz/index.d.mts +1 -0
- package/dist/Quiz/index.d.ts +1 -0
- package/dist/Quiz/index.js +75 -72
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +75 -72
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Whiteboard/index.js +2 -2
- package/dist/Whiteboard/index.js.map +1 -1
- package/dist/Whiteboard/index.mjs +2 -2
- package/dist/Whiteboard/index.mjs.map +1 -1
- package/dist/index.css +0 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +77 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -74
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/Quiz/index.d.mts
CHANGED
|
@@ -30,6 +30,7 @@ declare const Quiz: react.ForwardRefExoticComponent<{
|
|
|
30
30
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
31
31
|
declare const QuizTitle: react.ForwardRefExoticComponent<{
|
|
32
32
|
className?: string;
|
|
33
|
+
onBack?: () => void;
|
|
33
34
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
34
35
|
declare const QuizHeader: () => react_jsx_runtime.JSX.Element;
|
|
35
36
|
declare const QuizContent: ({ paddingBottom }: {
|
package/dist/Quiz/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ declare const Quiz: react.ForwardRefExoticComponent<{
|
|
|
30
30
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
31
31
|
declare const QuizTitle: react.ForwardRefExoticComponent<{
|
|
32
32
|
className?: string;
|
|
33
|
+
onBack?: () => void;
|
|
33
34
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
34
35
|
declare const QuizHeader: () => react_jsx_runtime.JSX.Element;
|
|
35
36
|
declare const QuizContent: ({ paddingBottom }: {
|
package/dist/Quiz/index.js
CHANGED
|
@@ -5534,80 +5534,83 @@ var Quiz = (0, import_react14.forwardRef)(({ children, className, variant = "def
|
|
|
5534
5534
|
}, [variant, setVariant]);
|
|
5535
5535
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
5536
5536
|
});
|
|
5537
|
-
var QuizTitle = (0, import_react14.forwardRef)(
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5537
|
+
var QuizTitle = (0, import_react14.forwardRef)(({ className, onBack, ...props }, ref) => {
|
|
5538
|
+
const {
|
|
5539
|
+
quiz,
|
|
5540
|
+
currentQuestionIndex,
|
|
5541
|
+
getTotalQuestions,
|
|
5542
|
+
getQuizTitle,
|
|
5543
|
+
timeElapsed,
|
|
5544
|
+
formatTime,
|
|
5545
|
+
isStarted
|
|
5546
|
+
} = useQuizStore();
|
|
5547
|
+
const [showExitConfirmation, setShowExitConfirmation] = (0, import_react14.useState)(false);
|
|
5548
|
+
const totalQuestions = getTotalQuestions();
|
|
5549
|
+
const quizTitle = getQuizTitle();
|
|
5550
|
+
const handleBackClick = () => {
|
|
5551
|
+
if (isStarted) {
|
|
5552
|
+
setShowExitConfirmation(true);
|
|
5553
|
+
} else {
|
|
5554
|
+
actionOnBack();
|
|
5555
|
+
}
|
|
5556
|
+
};
|
|
5557
|
+
const handleConfirmExit = () => {
|
|
5558
|
+
setShowExitConfirmation(false);
|
|
5559
|
+
actionOnBack();
|
|
5560
|
+
};
|
|
5561
|
+
const actionOnBack = () => {
|
|
5562
|
+
if (onBack) {
|
|
5563
|
+
onBack();
|
|
5564
|
+
} else {
|
|
5560
5565
|
window.history.back();
|
|
5561
|
-
}
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
5586
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
5587
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
5588
|
-
] }),
|
|
5589
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react10.Clock, {}), children: isStarted ? formatTime(timeElapsed) : "00:00" }) })
|
|
5590
|
-
]
|
|
5591
|
-
}
|
|
5592
|
-
),
|
|
5593
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
5594
|
-
AlertDialog,
|
|
5595
|
-
{
|
|
5596
|
-
isOpen: showExitConfirmation,
|
|
5597
|
-
onChangeOpen: setShowExitConfirmation,
|
|
5598
|
-
title: "Deseja sair?",
|
|
5599
|
-
description: getExitConfirmationText(
|
|
5600
|
-
quiz?.type || "SIMULADO" /* SIMULADO */
|
|
5566
|
+
}
|
|
5567
|
+
};
|
|
5568
|
+
const handleCancelExit = () => {
|
|
5569
|
+
setShowExitConfirmation(false);
|
|
5570
|
+
};
|
|
5571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
5573
|
+
"div",
|
|
5574
|
+
{
|
|
5575
|
+
ref,
|
|
5576
|
+
className: cn(
|
|
5577
|
+
"flex flex-row justify-between items-center relative p-2",
|
|
5578
|
+
className
|
|
5579
|
+
),
|
|
5580
|
+
...props,
|
|
5581
|
+
children: [
|
|
5582
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
5583
|
+
IconButton_default,
|
|
5584
|
+
{
|
|
5585
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react10.CaretLeft, { size: 24 }),
|
|
5586
|
+
size: "md",
|
|
5587
|
+
"aria-label": "Voltar",
|
|
5588
|
+
onClick: handleBackClick
|
|
5589
|
+
}
|
|
5601
5590
|
),
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
)
|
|
5591
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
5592
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
5594
|
+
] }),
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react10.Clock, {}), children: isStarted ? formatTime(timeElapsed) : "00:00" }) })
|
|
5596
|
+
]
|
|
5597
|
+
}
|
|
5598
|
+
),
|
|
5599
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
5600
|
+
AlertDialog,
|
|
5601
|
+
{
|
|
5602
|
+
isOpen: showExitConfirmation,
|
|
5603
|
+
onChangeOpen: setShowExitConfirmation,
|
|
5604
|
+
title: "Deseja sair?",
|
|
5605
|
+
description: getExitConfirmationText(quiz?.type || "SIMULADO" /* SIMULADO */),
|
|
5606
|
+
cancelButtonLabel: "Voltar e revisar",
|
|
5607
|
+
submitButtonLabel: "Sair Mesmo Assim",
|
|
5608
|
+
onSubmit: handleConfirmExit,
|
|
5609
|
+
onCancel: handleCancelExit
|
|
5610
|
+
}
|
|
5611
|
+
)
|
|
5612
|
+
] });
|
|
5613
|
+
});
|
|
5611
5614
|
var QuizHeader = () => {
|
|
5612
5615
|
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
5613
5616
|
const currentQuestion = getCurrentQuestion();
|